@@ -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 ,
@@ -254,7 +253,7 @@ struct ConstPropagator<'mir, 'tcx> {
254253 param_env : ParamEnv < ' tcx > ,
255254 // FIXME(eddyb) avoid cloning these two fields more than once,
256255 // by accessing them through `ecx` instead.
257- source_scope_local_data : IndexVec < SourceScope , ClearCrossCrate < SourceScopeLocalData > > ,
256+ source_scopes : IndexVec < SourceScope , SourceScopeData > ,
258257 local_decls : IndexVec < Local , LocalDecl < ' tcx > > ,
259258 ret : Option < OpTy < ' tcx , ( ) > > ,
260259}
@@ -325,7 +324,7 @@ impl<'mir, 'tcx> ConstPropagator<'mir, 'tcx> {
325324 can_const_prop,
326325 // FIXME(eddyb) avoid cloning these two fields more than once,
327326 // by accessing them through `ecx` instead.
328- source_scope_local_data : body. source_scope_local_data . clone ( ) ,
327+ source_scopes : body. source_scopes . clone ( ) ,
329328 //FIXME(wesleywiser) we can't steal this because `Visitor::super_visit_body()` needs it
330329 local_decls : body. local_decls . clone ( ) ,
331330 ret : ret. map ( Into :: into) ,
@@ -362,9 +361,9 @@ impl<'mir, 'tcx> ConstPropagator<'mir, 'tcx> {
362361 {
363362 self . ecx . tcx . span = source_info. span ;
364363 // FIXME(eddyb) move this to the `Panic(_)` error case, so that
365- // `f(self)` is always called, and that the only difference when
366- // `source_scope_local_data ` is missing, is that the lint isn't emitted.
367- let lint_root = match & self . source_scope_local_data [ source_info. scope ] {
364+ // `f(self)` is always called, and that the only difference when the
365+ // scope's `local_data ` is missing, is that the lint isn't emitted.
366+ let lint_root = match & self . source_scopes [ source_info. scope ] . local_data {
368367 ClearCrossCrate :: Set ( data) => data. lint_root ,
369368 ClearCrossCrate :: Clear => return None ,
370369 } ;
@@ -489,7 +488,7 @@ impl<'mir, 'tcx> ConstPropagator<'mir, 'tcx> {
489488 let right_size = r. layout . size ;
490489 let r_bits = r. to_scalar ( ) . and_then ( |r| r. to_bits ( right_size) ) ;
491490 if r_bits. ok ( ) . map_or ( false , |b| b >= left_bits as u128 ) {
492- let lint_root = match & self . source_scope_local_data [ source_info. scope ] {
491+ let lint_root = match & self . source_scopes [ source_info. scope ] . local_data {
493492 ClearCrossCrate :: Set ( data) => data. lint_root ,
494493 ClearCrossCrate :: Clear => return None ,
495494 } ;
0 commit comments