@@ -13,7 +13,7 @@ use rustc_middle::mir::visit::{
1313 MutVisitor , MutatingUseContext , NonMutatingUseContext , PlaceContext , Visitor ,
1414} ;
1515use rustc_middle:: mir:: {
16- AssertKind , BasicBlock , BinOp , Body , ClearCrossCrate , Constant , ConstantKind , Local , LocalDecl ,
16+ AssertKind , BasicBlock , BinOp , Body , Constant , ConstantKind , Local , LocalDecl ,
1717 LocalKind , Location , Operand , Place , Rvalue , SourceInfo , SourceScope , SourceScopeData ,
1818 Statement , StatementKind , Terminator , TerminatorKind , UnOp , RETURN_PLACE ,
1919} ;
@@ -440,18 +440,7 @@ impl<'mir, 'tcx> ConstPropagator<'mir, 'tcx> {
440440 }
441441
442442 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 )
455444 }
456445
457446 fn use_ecx < F , T > ( & mut self , f : F ) -> Option < T >
0 commit comments