Commit 78d85fc 1 parent 30a9978 commit 78d85fc Copy full SHA for 78d85fc
File tree 1 file changed +10
-1
lines changed
src/librustc_mir/transform
1 file changed +10
-1
lines changed Original file line number Diff line number Diff line change @@ -388,16 +388,25 @@ impl Inliner<'tcx> {
388
388
let mut local_map = IndexVec :: with_capacity ( callee_body. local_decls . len ( ) ) ;
389
389
let mut scope_map = IndexVec :: with_capacity ( callee_body. source_scopes . len ( ) ) ;
390
390
391
- for mut scope in callee_body. source_scopes . iter ( ) . cloned ( ) {
391
+ for ( callee_idx, scope) in callee_body. source_scopes . iter_enumerated ( ) {
392
+ let mut scope = scope. clone ( ) ;
392
393
if scope. parent_scope . is_none ( ) {
393
394
scope. parent_scope = Some ( callsite. location . scope ) ;
395
+ // FIXME(eddyb) is this really needed?
396
+ // (also note that it's always overwritten below)
394
397
scope. span = callee_body. span ;
395
398
}
396
399
400
+ // FIXME(eddyb) this doesn't seem right at all.
401
+ // The inlined source scopes should probably be annotated as
402
+ // such, but also contain all of the original information.
397
403
scope. span = callsite. location . span ;
398
404
399
405
let idx = caller_body. source_scopes . push ( scope) ;
400
406
scope_map. push ( idx) ;
407
+
408
+ let local_data = callee_body. source_scope_local_data [ callee_idx] . clone ( ) ;
409
+ assert_eq ! ( idx, caller_body. source_scope_local_data. push( local_data) ) ;
401
410
}
402
411
403
412
for loc in callee_body. vars_and_temps_iter ( ) {
You can’t perform that action at this time.
0 commit comments