Skip to content

Commit 8db583a

Browse files
committed
---
yaml --- r: 96973 b: refs/heads/dist-snap c: 37e3f2f h: refs/heads/master i: 96971: a6017ca v: v3
1 parent 7e42817 commit 8db583a

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
@@ -6,7 +6,7 @@ refs/heads/try: c274a6888410ce3e357e014568b43310ed787d36
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b
88
refs/heads/try2: 147ecfdd8221e4a4d4e090486829a06da1e0ca3c
9-
refs/heads/dist-snap: d16cca1f50d97e78334cba96bba0e6e0235cae7d
9+
refs/heads/dist-snap: 37e3f2fe63a9e0a41d5ebca7d276401599f3e636
1010
refs/tags/release-0.2: c870d2dffb391e14efb05aa27898f1f6333a9596
1111
refs/tags/release-0.3: b5f0d0f648d9a6153664837026ba1be43d3e2503
1212
refs/heads/try3: 9387340aab40a73e8424c48fd42f0c521a4875c0

branches/dist-snap/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(),

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