@@ -33,7 +33,7 @@ struct CallSite<'tcx> {
33
33
callee : DefId ,
34
34
substs : SubstsRef < ' tcx > ,
35
35
bb : BasicBlock ,
36
- location : SourceInfo ,
36
+ source_info : SourceInfo ,
37
37
}
38
38
39
39
impl < ' tcx > MirPass < ' tcx > for Inline {
@@ -217,7 +217,7 @@ impl Inliner<'tcx> {
217
217
callee : instance. def_id ( ) ,
218
218
substs : instance. substs ,
219
219
bb,
220
- location : terminator. source_info ,
220
+ source_info : terminator. source_info ,
221
221
} ) ;
222
222
}
223
223
}
@@ -440,7 +440,7 @@ impl Inliner<'tcx> {
440
440
441
441
for mut scope in callee_body. source_scopes . iter ( ) . cloned ( ) {
442
442
if scope. parent_scope . is_none ( ) {
443
- scope. parent_scope = Some ( callsite. location . scope ) ;
443
+ scope. parent_scope = Some ( callsite. source_info . scope ) ;
444
444
// FIXME(eddyb) is this really needed?
445
445
// (also note that it's always overwritten below)
446
446
scope. span = callee_body. span ;
@@ -449,7 +449,7 @@ impl Inliner<'tcx> {
449
449
// FIXME(eddyb) this doesn't seem right at all.
450
450
// The inlined source scopes should probably be annotated as
451
451
// such, but also contain all of the original information.
452
- scope. span = callsite. location . span ;
452
+ scope. span = callsite. source_info . span ;
453
453
454
454
let idx = caller_body. source_scopes . push ( scope) ;
455
455
scope_map. push ( idx) ;
@@ -459,7 +459,7 @@ impl Inliner<'tcx> {
459
459
let mut local = callee_body. local_decls [ loc] . clone ( ) ;
460
460
461
461
local. source_info . scope = scope_map[ local. source_info . scope ] ;
462
- local. source_info . span = callsite. location . span ;
462
+ local. source_info . span = callsite. source_info . span ;
463
463
464
464
let idx = caller_body. local_decls . push ( local) ;
465
465
local_map. push ( idx) ;
@@ -491,13 +491,13 @@ impl Inliner<'tcx> {
491
491
492
492
let ty = dest. ty ( caller_body, self . tcx ) ;
493
493
494
- let temp = LocalDecl :: new ( ty, callsite. location . span ) ;
494
+ let temp = LocalDecl :: new ( ty, callsite. source_info . span ) ;
495
495
496
496
let tmp = caller_body. local_decls . push ( temp) ;
497
497
let tmp = Place :: from ( tmp) ;
498
498
499
499
let stmt = Statement {
500
- source_info : callsite. location ,
500
+ source_info : callsite. source_info ,
501
501
kind : StatementKind :: Assign ( box ( tmp, dest) ) ,
502
502
} ;
503
503
caller_body[ callsite. bb ] . statements . push ( stmt) ;
@@ -535,7 +535,7 @@ impl Inliner<'tcx> {
535
535
}
536
536
537
537
let terminator = Terminator {
538
- source_info : callsite. location ,
538
+ source_info : callsite. source_info ,
539
539
kind : TerminatorKind :: Goto { target : BasicBlock :: new ( bb_len) } ,
540
540
} ;
541
541
@@ -654,20 +654,23 @@ impl Inliner<'tcx> {
654
654
655
655
let ty = arg. ty ( caller_body, self . tcx ) ;
656
656
657
- let arg_tmp = LocalDecl :: new ( ty, callsite. location . span ) ;
657
+ let arg_tmp = LocalDecl :: new ( ty, callsite. source_info . span ) ;
658
658
let arg_tmp = caller_body. local_decls . push ( arg_tmp) ;
659
659
660
660
caller_body[ callsite. bb ] . statements . push ( Statement {
661
- source_info : callsite. location ,
661
+ source_info : callsite. source_info ,
662
662
kind : StatementKind :: StorageLive ( arg_tmp) ,
663
663
} ) ;
664
664
caller_body[ callsite. bb ] . statements . push ( Statement {
665
- source_info : callsite. location ,
665
+ source_info : callsite. source_info ,
666
666
kind : StatementKind :: Assign ( box ( Place :: from ( arg_tmp) , arg) ) ,
667
667
} ) ;
668
668
caller_body[ return_block] . statements . insert (
669
669
0 ,
670
- Statement { source_info : callsite. location , kind : StatementKind :: StorageDead ( arg_tmp) } ,
670
+ Statement {
671
+ source_info : callsite. source_info ,
672
+ kind : StatementKind :: StorageDead ( arg_tmp) ,
673
+ } ,
671
674
) ;
672
675
673
676
arg_tmp
0 commit comments