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> {
1359
1359
/// 2229 drop reorder migration analysis.
1360
1360
#[ inline]
1361
1361
pub fn has_significant_drop ( self , tcx : TyCtxt < ' tcx > , typing_env : ty:: TypingEnv < ' tcx > ) -> bool {
1362
+ assert ! ( !self . has_non_region_infer( ) ) ;
1362
1363
// Avoid querying in simple cases.
1363
1364
match needs_drop_components ( tcx, self ) {
1364
1365
Err ( AlwaysRequiresDrop ) => true ,
@@ -1371,14 +1372,6 @@ impl<'tcx> Ty<'tcx> {
1371
1372
_ => self ,
1372
1373
} ;
1373
1374
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
-
1382
1375
// This doesn't depend on regions, so try to minimize distinct
1383
1376
// query keys used.
1384
1377
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