File tree Expand file tree Collapse file tree 1 file changed +9
-1
lines changed
compiler/rustc_middle/src/ty Expand file tree Collapse file tree 1 file changed +9
-1
lines changed Original file line number Diff line number Diff line change @@ -1368,7 +1368,6 @@ impl<'tcx> Ty<'tcx> {
13681368 /// 2229 drop reorder migration analysis.
13691369 #[ inline]
13701370 pub fn has_significant_drop ( self , tcx : TyCtxt < ' tcx > , typing_env : ty:: TypingEnv < ' tcx > ) -> bool {
1371- assert ! ( !self . has_non_region_infer( ) ) ;
13721371 // Avoid querying in simple cases.
13731372 match needs_drop_components ( tcx, self ) {
13741373 Err ( AlwaysRequiresDrop ) => true ,
@@ -1381,6 +1380,15 @@ impl<'tcx> Ty<'tcx> {
13811380 _ => self ,
13821381 } ;
13831382
1383+ // We should be canonicalizing, or else moving this to a method of inference
1384+ // context, or *something* like that,
1385+ // but for now just avoid passing inference variables
1386+ // to queries that can't cope with them.
1387+ // Instead, conservatively return "true" (may change drop order).
1388+ if query_ty. has_infer ( ) {
1389+ return true ;
1390+ }
1391+
13841392 // This doesn't depend on regions, so try to minimize distinct
13851393 // query keys used.
13861394 let erased = tcx. normalize_erasing_regions ( typing_env, query_ty) ;
You can’t perform that action at this time.
0 commit comments