@@ -13,7 +13,7 @@ use rustc_middle::mir::visit::{
13
13
MutVisitor , MutatingUseContext , NonMutatingUseContext , PlaceContext , Visitor ,
14
14
} ;
15
15
use rustc_middle:: mir:: {
16
- AssertKind , BasicBlock , BinOp , Body , ClearCrossCrate , Constant , ConstantKind , Local , LocalDecl ,
16
+ AssertKind , BasicBlock , BinOp , Body , Constant , ConstantKind , Local , LocalDecl ,
17
17
LocalKind , Location , Operand , Place , Rvalue , SourceInfo , SourceScope , SourceScopeData ,
18
18
Statement , StatementKind , Terminator , TerminatorKind , UnOp , RETURN_PLACE ,
19
19
} ;
@@ -440,18 +440,7 @@ impl<'mir, 'tcx> ConstPropagator<'mir, 'tcx> {
440
440
}
441
441
442
442
fn lint_root ( & self , source_info : SourceInfo ) -> Option < HirId > {
443
- let mut data = & self . source_scopes [ source_info. scope ] ;
444
- // FIXME(oli-obk): we should be able to just walk the `inlined_parent_scope`, but it
445
- // does not work as I thought it would. Needs more investigation and documentation.
446
- while data. inlined . is_some ( ) {
447
- trace ! ( ?data) ;
448
- data = & self . source_scopes [ data. parent_scope . unwrap ( ) ] ;
449
- }
450
- trace ! ( ?data) ;
451
- match & data. local_data {
452
- ClearCrossCrate :: Set ( data) => Some ( data. lint_root ) ,
453
- ClearCrossCrate :: Clear => None ,
454
- }
443
+ source_info. scope . lint_root ( & self . source_scopes )
455
444
}
456
445
457
446
fn use_ecx < F , T > ( & mut self , f : F ) -> Option < T >
0 commit comments