Skip to content

Commit a39da66

Browse files
committed
---
yaml --- r: 147559 b: refs/heads/try2 c: a5db84c h: refs/heads/master i: 147557: b9bec83 147555: 5b1ebd6 147551: 10f90f9 v: v3
1 parent 3053e96 commit a39da66

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
@@ -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: 55a7b2feddfd54f5a4c5f4dd85d156a0da50428e
8+
refs/heads/try2: a5db84ce128ea1307c795bbee8a076d50725817a
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/const_eval.rs

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -154,9 +154,12 @@ pub fn lookup_const_by_id(tcx: ty::ctxt,
154154
Some(_) => None
155155
}
156156
} else {
157-
match tcx.extern_const_statics.find(&def_id) {
158-
Some(&e) => return e,
159-
None => {}
157+
{
158+
let extern_const_statics = tcx.extern_const_statics.borrow();
159+
match extern_const_statics.get().find(&def_id) {
160+
Some(&e) => return e,
161+
None => {}
162+
}
160163
}
161164
let maps = astencode::Maps {
162165
root_map: @mut HashMap::new(),
@@ -173,8 +176,12 @@ pub fn lookup_const_by_id(tcx: ty::ctxt,
173176
},
174177
_ => None
175178
};
176-
tcx.extern_const_statics.insert(def_id, e);
177-
return e;
179+
{
180+
let mut extern_const_statics = tcx.extern_const_statics
181+
.borrow_mut();
182+
extern_const_statics.get().insert(def_id, e);
183+
return e;
184+
}
178185
}
179186
}
180187

branches/try2/src/librustc/middle/ty.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -368,7 +368,7 @@ struct ctxt_ {
368368

369369
// These two caches are used by const_eval when decoding external statics
370370
// and variants that are found.
371-
extern_const_statics: @mut HashMap<ast::DefId, Option<@ast::Expr>>,
371+
extern_const_statics: RefCell<HashMap<ast::DefId, Option<@ast::Expr>>>,
372372
extern_const_variants: @mut HashMap<ast::DefId, Option<@ast::Expr>>,
373373
}
374374

@@ -1014,7 +1014,7 @@ pub fn mk_ctxt(s: session::Session,
10141014
populated_external_types: @mut HashSet::new(),
10151015
populated_external_traits: @mut HashSet::new(),
10161016

1017-
extern_const_statics: @mut HashMap::new(),
1017+
extern_const_statics: RefCell::new(HashMap::new()),
10181018
extern_const_variants: @mut HashMap::new(),
10191019
}
10201020
}

0 commit comments

Comments
 (0)