Skip to content

Commit e66b1a4

Browse files
committed
---
yaml --- r: 90730 b: refs/heads/master c: db83a95 h: refs/heads/master v: v3
1 parent 310c380 commit e66b1a4

File tree

3 files changed

+11
-7
lines changed

3 files changed

+11
-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: 06805209e4f03f32ec0e06b156bb76fbf8f7a93e
2+
refs/heads/master: db83a957b60d7b6e7045909b8ce3c1ddf78e8fde
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
@@ -93,7 +93,7 @@ pub struct CrateContext {
9393

9494
module_data: RefCell<HashMap<~str, ValueRef>>,
9595
lltypes: RefCell<HashMap<ty::t, Type>>,
96-
llsizingtypes: HashMap<ty::t, Type>,
96+
llsizingtypes: RefCell<HashMap<ty::t, Type>>,
9797
adt_reprs: HashMap<ty::t, @adt::Repr>,
9898
symbol_hasher: Sha256,
9999
type_hashcodes: HashMap<ty::t, @str>,
@@ -204,7 +204,7 @@ impl CrateContext {
204204
impl_method_cache: RefCell::new(HashMap::new()),
205205
module_data: RefCell::new(HashMap::new()),
206206
lltypes: RefCell::new(HashMap::new()),
207-
llsizingtypes: HashMap::new(),
207+
llsizingtypes: RefCell::new(HashMap::new()),
208208
adt_reprs: HashMap::new(),
209209
symbol_hasher: symbol_hasher,
210210
type_hashcodes: HashMap::new(),

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

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -101,9 +101,12 @@ pub fn type_of_fn_from_ty(cx: &mut CrateContext, fty: ty::t) -> Type {
101101
// recursive types. For example, enum types rely on this behavior.
102102

103103
pub fn sizing_type_of(cx: &mut CrateContext, t: ty::t) -> Type {
104-
match cx.llsizingtypes.find_copy(&t) {
105-
Some(t) => return t,
106-
None => ()
104+
{
105+
let llsizingtypes = cx.llsizingtypes.borrow();
106+
match llsizingtypes.get().find_copy(&t) {
107+
Some(t) => return t,
108+
None => ()
109+
}
107110
}
108111

109112
let llsizingty = match ty::get(t).sty {
@@ -166,7 +169,8 @@ pub fn sizing_type_of(cx: &mut CrateContext, t: ty::t) -> Type {
166169
}
167170
};
168171

169-
cx.llsizingtypes.insert(t, llsizingty);
172+
let mut llsizingtypes = cx.llsizingtypes.borrow_mut();
173+
llsizingtypes.get().insert(t, llsizingty);
170174
llsizingty
171175
}
172176

0 commit comments

Comments
 (0)