Skip to content

Commit 923d65b

Browse files
committed
---
yaml --- r: 90726 b: refs/heads/master c: 37e3f2f h: refs/heads/master v: v3
1 parent 55dcf30 commit 923d65b

File tree

3 files changed

+10
-7
lines changed

3 files changed

+10
-7
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
refs/heads/master: d16cca1f50d97e78334cba96bba0e6e0235cae7d
2+
refs/heads/master: 37e3f2fe63a9e0a41d5ebca7d276401599f3e636
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
44
refs/heads/snap-stage3: a6d3e57dca68fde4effdda3e4ae2887aa535fcd6
55
refs/heads/try: b160761e35efcd1207112b3b782c06633cf441a8

trunk/src/librustc/middle/trans/context.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ pub struct CrateContext {
8787
const_values: RefCell<HashMap<ast::NodeId, ValueRef>>,
8888

8989
// Cache of external const values
90-
extern_const_values: HashMap<ast::DefId, ValueRef>,
90+
extern_const_values: RefCell<HashMap<ast::DefId, ValueRef>>,
9191

9292
impl_method_cache: HashMap<(ast::DefId, ast::Name), ast::DefId>,
9393

@@ -200,7 +200,7 @@ impl CrateContext {
200200
const_cstr_cache: RefCell::new(HashMap::new()),
201201
const_globals: RefCell::new(HashMap::new()),
202202
const_values: RefCell::new(HashMap::new()),
203-
extern_const_values: HashMap::new(),
203+
extern_const_values: RefCell::new(HashMap::new()),
204204
impl_method_cache: HashMap::new(),
205205
module_data: HashMap::new(),
206206
lltypes: HashMap::new(),

trunk/src/librustc/middle/trans/expr.rs

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1018,8 +1018,10 @@ fn trans_lvalue_unadjusted(bcx: @Block, expr: &ast::Expr) -> DatumBlock {
10181018
PointerCast(bcx, val, pty)
10191019
} else {
10201020
{
1021-
let extern_const_values = &bcx.ccx().extern_const_values;
1022-
match extern_const_values.find(&did) {
1021+
let extern_const_values = bcx.ccx()
1022+
.extern_const_values
1023+
.borrow();
1024+
match extern_const_values.get().find(&did) {
10231025
None => {} // Continue.
10241026
Some(llval) => {
10251027
return *llval;
@@ -1037,8 +1039,9 @@ fn trans_lvalue_unadjusted(bcx: @Block, expr: &ast::Expr) -> DatumBlock {
10371039
llty.to_ref(),
10381040
buf)
10391041
});
1040-
let extern_const_values = &mut bcx.ccx().extern_const_values;
1041-
extern_const_values.insert(did, llval);
1042+
let mut extern_const_values =
1043+
bcx.ccx().extern_const_values.borrow_mut();
1044+
extern_const_values.get().insert(did, llval);
10421045
llval
10431046
}
10441047
}

0 commit comments

Comments
 (0)