Skip to content

Commit 381a585

Browse files
committed
---
yaml --- r: 89083 b: refs/heads/snap-stage3 c: 4b4ff2c h: refs/heads/master i: 89081: 7611163 89079: 27beea3 v: v3
1 parent 33c2da4 commit 381a585

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
@@ -1,7 +1,7 @@
11
---
22
refs/heads/master: deeca5d586bfaa4aa60246f671a8d611d38f6248
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
4-
refs/heads/snap-stage3: fc0b466fd47ebe7f40a08276cbb26ef1f5657fce
4+
refs/heads/snap-stage3: 4b4ff2cf8b5f888581d41b3b2f10dacf7d716478
55
refs/heads/try: b160761e35efcd1207112b3b782c06633cf441a8
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b

branches/snap-stage3/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)