Skip to content

Commit 311282f

Browse files
committed
---
yaml --- r: 147699 b: refs/heads/try2 c: 4b4ff2c h: refs/heads/master i: 147697: 7bff1cb 147695: 0c79be4 v: v3
1 parent e6468bc commit 311282f

File tree

2 files changed

+6
-5
lines changed

2 files changed

+6
-5
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ refs/heads/snap-stage3: 78a7676898d9f80ab540c6df5d4c9ce35bb50463
55
refs/heads/try: 519addf6277dbafccbb4159db4b710c37eaa2ec5
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b
8-
refs/heads/try2: fc0b466fd47ebe7f40a08276cbb26ef1f5657fce
8+
refs/heads/try2: 4b4ff2cf8b5f888581d41b3b2f10dacf7d716478
99
refs/heads/dist-snap: ba4081a5a8573875fed17545846f6f6902c8ba8d
1010
refs/tags/release-0.2: c870d2dffb391e14efb05aa27898f1f6333a9596
1111
refs/tags/release-0.3: b5f0d0f648d9a6153664837026ba1be43d3e2503

branches/try2/src/librustc/middle/trans/_match.rs

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -219,6 +219,7 @@ use middle::ty;
219219
use util::common::indenter;
220220
use util::ppaux::{Repr, vec_map_to_str};
221221

222+
use std::cell::Cell;
222223
use std::hashmap::HashMap;
223224
use std::ptr;
224225
use std::vec;
@@ -1188,19 +1189,19 @@ struct DynamicFailureHandler {
11881189
bcx: @Block,
11891190
sp: Span,
11901191
msg: @str,
1191-
finished: @mut Option<BasicBlockRef>,
1192+
finished: @Cell<Option<BasicBlockRef>>,
11921193
}
11931194

11941195
impl CustomFailureHandler for DynamicFailureHandler {
11951196
fn handle_fail(&self) -> BasicBlockRef {
1196-
match *self.finished {
1197+
match self.finished.get() {
11971198
Some(bb) => return bb,
11981199
_ => (),
11991200
}
12001201

12011202
let fail_cx = sub_block(self.bcx, "case_fallthrough");
12021203
controlflow::trans_fail(fail_cx, Some(self.sp), self.msg);
1203-
*self.finished = Some(fail_cx.llbb);
1204+
self.finished.set(Some(fail_cx.llbb));
12041205
fail_cx.llbb
12051206
}
12061207
}
@@ -1911,7 +1912,7 @@ fn trans_match_inner(scope_cx: @Block,
19111912
let chk = {
19121913
if ty::type_is_empty(tcx, t) {
19131914
// Special case for empty types
1914-
let fail_cx = @mut None;
1915+
let fail_cx = @Cell::new(None);
19151916
let fail_handler = @DynamicFailureHandler {
19161917
bcx: scope_cx,
19171918
sp: discr_expr.span,

0 commit comments

Comments
 (0)