@@ -9,7 +9,7 @@ use rustc::hir::def_id::DefId;
99use rustc:: mir:: {
1010 AggregateKind , Constant , Location , Place , PlaceBase , Body , Operand , Rvalue , Local , UnOp ,
1111 StatementKind , Statement , LocalKind , TerminatorKind , Terminator , ClearCrossCrate , SourceInfo ,
12- BinOp , SourceScope , SourceScopeLocalData , LocalDecl , BasicBlock , RETURN_PLACE ,
12+ BinOp , SourceScope , SourceScopeData , LocalDecl , BasicBlock , RETURN_PLACE ,
1313} ;
1414use rustc:: mir:: visit:: {
1515 Visitor , PlaceContext , MutatingUseContext , MutVisitor , NonMutatingUseContext ,
@@ -77,8 +77,7 @@ impl<'tcx> MirPass<'tcx> for ConstProp {
7777 let dummy_body =
7878 & Body :: new (
7979 body. basic_blocks ( ) . clone ( ) ,
80- Default :: default ( ) ,
81- body. source_scope_local_data . clone ( ) ,
80+ body. source_scopes . clone ( ) ,
8281 body. local_decls . clone ( ) ,
8382 Default :: default ( ) ,
8483 body. arg_count ,
@@ -253,7 +252,7 @@ struct ConstPropagator<'mir, 'tcx> {
253252 param_env : ParamEnv < ' tcx > ,
254253 // FIXME(eddyb) avoid cloning these two fields more than once,
255254 // by accessing them through `ecx` instead.
256- source_scope_local_data : IndexVec < SourceScope , ClearCrossCrate < SourceScopeLocalData > > ,
255+ source_scopes : IndexVec < SourceScope , SourceScopeData > ,
257256 local_decls : IndexVec < Local , LocalDecl < ' tcx > > ,
258257 ret : Option < OpTy < ' tcx , ( ) > > ,
259258}
@@ -324,7 +323,7 @@ impl<'mir, 'tcx> ConstPropagator<'mir, 'tcx> {
324323 can_const_prop,
325324 // FIXME(eddyb) avoid cloning these two fields more than once,
326325 // by accessing them through `ecx` instead.
327- source_scope_local_data : body. source_scope_local_data . clone ( ) ,
326+ source_scopes : body. source_scopes . clone ( ) ,
328327 //FIXME(wesleywiser) we can't steal this because `Visitor::super_visit_body()` needs it
329328 local_decls : body. local_decls . clone ( ) ,
330329 ret : ret. map ( Into :: into) ,
@@ -361,9 +360,9 @@ impl<'mir, 'tcx> ConstPropagator<'mir, 'tcx> {
361360 {
362361 self . ecx . tcx . span = source_info. span ;
363362 // FIXME(eddyb) move this to the `Panic(_)` error case, so that
364- // `f(self)` is always called, and that the only difference when
365- // `source_scope_local_data ` is missing, is that the lint isn't emitted.
366- let lint_root = match & self . source_scope_local_data [ source_info. scope ] {
363+ // `f(self)` is always called, and that the only difference when the
364+ // scope's `local_data ` is missing, is that the lint isn't emitted.
365+ let lint_root = match & self . source_scopes [ source_info. scope ] . local_data {
367366 ClearCrossCrate :: Set ( data) => data. lint_root ,
368367 ClearCrossCrate :: Clear => return None ,
369368 } ;
@@ -488,7 +487,7 @@ impl<'mir, 'tcx> ConstPropagator<'mir, 'tcx> {
488487 let right_size = r. layout . size ;
489488 let r_bits = r. to_scalar ( ) . and_then ( |r| r. to_bits ( right_size) ) ;
490489 if r_bits. ok ( ) . map_or ( false , |b| b >= left_bits as u128 ) {
491- let lint_root = match & self . source_scope_local_data [ source_info. scope ] {
490+ let lint_root = match & self . source_scopes [ source_info. scope ] . local_data {
492491 ClearCrossCrate :: Set ( data) => data. lint_root ,
493492 ClearCrossCrate :: Clear => return None ,
494493 } ;
0 commit comments