File tree Expand file tree Collapse file tree 2 files changed +19
-8
lines changed
compiler/rustc_middle/src/ty Expand file tree Collapse file tree 2 files changed +19
-8
lines changed Original file line number Diff line number Diff line change @@ -1359,6 +1359,7 @@ impl<'tcx> Ty<'tcx> {
13591359 /// 2229 drop reorder migration analysis.
13601360 #[ inline]
13611361 pub fn has_significant_drop ( self , tcx : TyCtxt < ' tcx > , typing_env : ty:: TypingEnv < ' tcx > ) -> bool {
1362+ assert ! ( !self . has_non_region_infer( ) ) ;
13621363 // Avoid querying in simple cases.
13631364 match needs_drop_components ( tcx, self ) {
13641365 Err ( AlwaysRequiresDrop ) => true ,
@@ -1371,14 +1372,6 @@ impl<'tcx> Ty<'tcx> {
13711372 _ => self ,
13721373 } ;
13731374
1374- // FIXME(#86868): We should be canonicalizing, or else moving this to a method of inference
1375- // context, or *something* like that, but for now just avoid passing inference
1376- // variables to queries that can't cope with them. Instead, conservatively
1377- // return "true" (may change drop order).
1378- if query_ty. has_infer ( ) {
1379- return true ;
1380- }
1381-
13821375 // This doesn't depend on regions, so try to minimize distinct
13831376 // query keys used.
13841377 let erased = tcx. normalize_erasing_regions ( typing_env, query_ty) ;
Original file line number Diff line number Diff line change 1+ //@ run-pass
2+ // Inference, canonicalization, and significant drops should work nicely together.
3+ // Related issue: #86868
4+
5+ #[ clippy:: has_significant_drop]
6+ struct DropGuy { }
7+
8+ fn creator ( ) -> DropGuy {
9+ DropGuy { }
10+ }
11+
12+ fn dropper ( ) {
13+ let _ = creator ( ) ;
14+ }
15+
16+ fn main ( ) {
17+ dropper ( ) ;
18+ }
You can’t perform that action at this time.
0 commit comments