Skip to content

Commit c934bd4

Browse files
committed
---
yaml --- r: 88944 b: refs/heads/snap-stage3 c: b976226 h: refs/heads/master v: v3
1 parent ca3d1fb commit c934bd4

File tree

3 files changed

+15
-8
lines changed

3 files changed

+15
-8
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: a5db84ce128ea1307c795bbee8a076d50725817a
4+
refs/heads/snap-stage3: b976226d52d0020c37b89e1dc837bc1efc0f27cc
55
refs/heads/try: b160761e35efcd1207112b3b782c06633cf441a8
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b

branches/snap-stage3/src/librustc/middle/const_eval.rs

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -111,9 +111,12 @@ pub fn lookup_variant_by_id(tcx: ty::ctxt,
111111
Some(_) => None
112112
}
113113
} else {
114-
match tcx.extern_const_variants.find(&variant_def) {
115-
Some(&e) => return e,
116-
None => {}
114+
{
115+
let extern_const_variants = tcx.extern_const_variants.borrow();
116+
match extern_const_variants.get().find(&variant_def) {
117+
Some(&e) => return e,
118+
None => {}
119+
}
117120
}
118121
let maps = astencode::Maps {
119122
root_map: @mut HashMap::new(),
@@ -136,8 +139,12 @@ pub fn lookup_variant_by_id(tcx: ty::ctxt,
136139
},
137140
_ => None
138141
};
139-
tcx.extern_const_variants.insert(variant_def, e);
140-
return e;
142+
{
143+
let mut extern_const_variants = tcx.extern_const_variants
144+
.borrow_mut();
145+
extern_const_variants.get().insert(variant_def, e);
146+
return e;
147+
}
141148
}
142149
}
143150

branches/snap-stage3/src/librustc/middle/ty.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -369,7 +369,7 @@ struct ctxt_ {
369369
// These two caches are used by const_eval when decoding external statics
370370
// and variants that are found.
371371
extern_const_statics: RefCell<HashMap<ast::DefId, Option<@ast::Expr>>>,
372-
extern_const_variants: @mut HashMap<ast::DefId, Option<@ast::Expr>>,
372+
extern_const_variants: RefCell<HashMap<ast::DefId, Option<@ast::Expr>>>,
373373
}
374374

375375
pub enum tbox_flag {
@@ -1015,7 +1015,7 @@ pub fn mk_ctxt(s: session::Session,
10151015
populated_external_traits: @mut HashSet::new(),
10161016

10171017
extern_const_statics: RefCell::new(HashMap::new()),
1018-
extern_const_variants: @mut HashMap::new(),
1018+
extern_const_variants: RefCell::new(HashMap::new()),
10191019
}
10201020
}
10211021

0 commit comments

Comments
 (0)