@@ -9,7 +9,7 @@ use rustc::hir::def_id::DefId;
9
9
use rustc:: mir:: {
10
10
AggregateKind , Constant , Location , Place , PlaceBase , Body , Operand , Rvalue , Local , UnOp ,
11
11
StatementKind , Statement , LocalKind , TerminatorKind , Terminator , ClearCrossCrate , SourceInfo ,
12
- BinOp , SourceScope , SourceScopeLocalData , LocalDecl , BasicBlock , RETURN_PLACE ,
12
+ BinOp , SourceScope , SourceScopeData , LocalDecl , BasicBlock , RETURN_PLACE ,
13
13
} ;
14
14
use rustc:: mir:: visit:: {
15
15
Visitor , PlaceContext , MutatingUseContext , MutVisitor , NonMutatingUseContext ,
@@ -77,8 +77,7 @@ impl<'tcx> MirPass<'tcx> for ConstProp {
77
77
let dummy_body =
78
78
& Body :: new (
79
79
body. basic_blocks ( ) . clone ( ) ,
80
- Default :: default ( ) ,
81
- body. source_scope_local_data . clone ( ) ,
80
+ body. source_scopes . clone ( ) ,
82
81
body. local_decls . clone ( ) ,
83
82
Default :: default ( ) ,
84
83
body. arg_count ,
@@ -254,7 +253,7 @@ struct ConstPropagator<'mir, 'tcx> {
254
253
param_env : ParamEnv < ' tcx > ,
255
254
// FIXME(eddyb) avoid cloning these two fields more than once,
256
255
// by accessing them through `ecx` instead.
257
- source_scope_local_data : IndexVec < SourceScope , ClearCrossCrate < SourceScopeLocalData > > ,
256
+ source_scopes : IndexVec < SourceScope , SourceScopeData > ,
258
257
local_decls : IndexVec < Local , LocalDecl < ' tcx > > ,
259
258
ret : Option < OpTy < ' tcx , ( ) > > ,
260
259
}
@@ -325,7 +324,7 @@ impl<'mir, 'tcx> ConstPropagator<'mir, 'tcx> {
325
324
can_const_prop,
326
325
// FIXME(eddyb) avoid cloning these two fields more than once,
327
326
// by accessing them through `ecx` instead.
328
- source_scope_local_data : body. source_scope_local_data . clone ( ) ,
327
+ source_scopes : body. source_scopes . clone ( ) ,
329
328
//FIXME(wesleywiser) we can't steal this because `Visitor::super_visit_body()` needs it
330
329
local_decls : body. local_decls . clone ( ) ,
331
330
ret : ret. map ( Into :: into) ,
@@ -362,9 +361,9 @@ impl<'mir, 'tcx> ConstPropagator<'mir, 'tcx> {
362
361
{
363
362
self . ecx . tcx . span = source_info. span ;
364
363
// 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 {
368
367
ClearCrossCrate :: Set ( data) => data. lint_root ,
369
368
ClearCrossCrate :: Clear => return None ,
370
369
} ;
@@ -489,7 +488,7 @@ impl<'mir, 'tcx> ConstPropagator<'mir, 'tcx> {
489
488
let right_size = r. layout . size ;
490
489
let r_bits = r. to_scalar ( ) . and_then ( |r| r. to_bits ( right_size) ) ;
491
490
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 {
493
492
ClearCrossCrate :: Set ( data) => data. lint_root ,
494
493
ClearCrossCrate :: Clear => return None ,
495
494
} ;
0 commit comments