Skip to content

Commit 199ea27

Browse files
committed
---
yaml --- r: 271487 b: refs/heads/auto c: f66fd89 h: refs/heads/master i: 271485: da99ef3 271483: a59a62a 271479: fec24e3 271471: 4910c7d 271455: 24c053b 271423: c98bd7f 271359: b48de84
1 parent 6741de9 commit 199ea27

File tree

3 files changed

+8
-4
lines changed

3 files changed

+8
-4
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ refs/tags/release-0.3: b5f0d0f648d9a6153664837026ba1be43d3e2503
88
refs/tags/release-0.3.1: 495bae036dfe5ec6ceafd3312b4dca48741e845b
99
refs/tags/release-0.4: e828ea2080499553b97dfe33b3f4d472b4562ad7
1010
refs/tags/release-0.5: 7e3bcfbf21278251ee936ad53e92e9b719702d73
11-
refs/heads/auto: cb04e495dc7a34cc708246dad7bb8b844216fd3e
11+
refs/heads/auto: f66fd8972f16f7a38f57c9953f1f6972a917c905
1212
refs/tags/release-0.6: b4ebcfa1812664df5e142f0134a5faea3918544c
1313
refs/tags/0.1: b19db808c2793fe2976759b85a355c3ad8c8b336
1414
refs/tags/0.2: 1754d02027f2924bed83b0160ee340c7f41d5ea1

branches/auto/src/librustc_mir/build/mod.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,8 @@ pub struct Builder<'a, 'tcx: 'a> {
2222
hir: Cx<'a, 'tcx>,
2323
cfg: CFG<'tcx>,
2424

25+
fn_span: Span,
26+
2527
// the current set of scopes, updated as we traverse;
2628
// see the `scope` module for more details
2729
scopes: Vec<scope::Scope<'tcx>>,
@@ -147,6 +149,7 @@ pub fn construct<'a,'tcx>(hir: Cx<'a,'tcx>,
147149
let mut builder = Builder {
148150
hir: hir,
149151
cfg: cfg,
152+
fn_span: span,
150153
scopes: vec![],
151154
scope_data_vec: ScopeDataVec::new(),
152155
scope_auxiliary: vec![],

branches/auto/src/librustc_mir/build/scope.rs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -438,7 +438,7 @@ impl<'a,'tcx> Builder<'a,'tcx> {
438438
// generate B0 <- B1 <- B2 in left-to-right order. Control flow of the generated blocks
439439
// always ends up at a block with the Resume terminator.
440440
if scopes.iter().any(|scope| !scope.drops.is_empty() || scope.free.is_some()) {
441-
Some(build_diverge_scope(hir.tcx(), cfg, &unit_temp, scopes))
441+
Some(build_diverge_scope(hir.tcx(), self.fn_span, cfg, &unit_temp, scopes))
442442
} else {
443443
None
444444
}
@@ -611,6 +611,7 @@ fn build_scope_drops<'tcx>(cfg: &mut CFG<'tcx>,
611611
}
612612

613613
fn build_diverge_scope<'tcx>(tcx: &TyCtxt<'tcx>,
614+
fn_span: Span,
614615
cfg: &mut CFG<'tcx>,
615616
unit_temp: &Lvalue<'tcx>,
616617
scopes: &mut [Scope<'tcx>])
@@ -639,11 +640,11 @@ fn build_diverge_scope<'tcx>(tcx: &TyCtxt<'tcx>,
639640
// Diverging from the root scope creates a RESUME terminator.
640641
// FIXME what span to use here?
641642
let resumeblk = cfg.start_new_cleanup_block();
642-
cfg.terminate(resumeblk, scope.id, DUMMY_SP, TerminatorKind::Resume);
643+
cfg.terminate(resumeblk, scope.id, fn_span, TerminatorKind::Resume);
643644
resumeblk
644645
} else {
645646
// Diverging from any other scope chains up to the previous scope.
646-
build_diverge_scope(tcx, cfg, unit_temp, earlier_scopes)
647+
build_diverge_scope(tcx, fn_span, cfg, unit_temp, earlier_scopes)
647648
};
648649
scope.cached_block = Some(target);
649650

0 commit comments

Comments
 (0)