Skip to content

Commit b870019

Browse files
committed
---
yaml --- r: 90731 b: refs/heads/master c: a1747a6 h: refs/heads/master i: 90729: 310c380 90727: 17ff87b v: v3
1 parent e66b1a4 commit b870019

File tree

3 files changed

+12
-7
lines changed

3 files changed

+12
-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: db83a957b60d7b6e7045909b8ce3c1ddf78e8fde
2+
refs/heads/master: a1747a609122f6bc82f396897752d182fd583d4a
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
44
refs/heads/snap-stage3: a6d3e57dca68fde4effdda3e4ae2887aa535fcd6
55
refs/heads/try: b160761e35efcd1207112b3b782c06633cf441a8

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

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -118,13 +118,18 @@ pub fn represent_node(bcx: @Block, node: ast::NodeId) -> @Repr {
118118
/// Decides how to represent a given type.
119119
pub fn represent_type(cx: &mut CrateContext, t: ty::t) -> @Repr {
120120
debug!("Representing: {}", ty_to_str(cx.tcx, t));
121-
match cx.adt_reprs.find(&t) {
122-
Some(repr) => return *repr,
123-
None => { }
121+
{
122+
let adt_reprs = cx.adt_reprs.borrow();
123+
match adt_reprs.get().find(&t) {
124+
Some(repr) => return *repr,
125+
None => {}
126+
}
124127
}
128+
125129
let repr = @represent_type_uncached(cx, t);
126130
debug!("Represented as: {:?}", repr)
127-
cx.adt_reprs.insert(t, repr);
131+
let mut adt_reprs = cx.adt_reprs.borrow_mut();
132+
adt_reprs.get().insert(t, repr);
128133
return repr;
129134
}
130135

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ pub struct CrateContext {
9494
module_data: RefCell<HashMap<~str, ValueRef>>,
9595
lltypes: RefCell<HashMap<ty::t, Type>>,
9696
llsizingtypes: RefCell<HashMap<ty::t, Type>>,
97-
adt_reprs: HashMap<ty::t, @adt::Repr>,
97+
adt_reprs: RefCell<HashMap<ty::t, @adt::Repr>>,
9898
symbol_hasher: Sha256,
9999
type_hashcodes: HashMap<ty::t, @str>,
100100
type_short_names: HashMap<ty::t, ~str>,
@@ -205,7 +205,7 @@ impl CrateContext {
205205
module_data: RefCell::new(HashMap::new()),
206206
lltypes: RefCell::new(HashMap::new()),
207207
llsizingtypes: RefCell::new(HashMap::new()),
208-
adt_reprs: HashMap::new(),
208+
adt_reprs: RefCell::new(HashMap::new()),
209209
symbol_hasher: symbol_hasher,
210210
type_hashcodes: HashMap::new(),
211211
type_short_names: HashMap::new(),

0 commit comments

Comments
 (0)