File tree Expand file tree Collapse file tree 3 files changed +15
-8
lines changed
branches/try2/src/librustc/middle Expand file tree Collapse file tree 3 files changed +15
-8
lines changed Original file line number Diff line number Diff line change @@ -5,7 +5,7 @@ refs/heads/snap-stage3: 78a7676898d9f80ab540c6df5d4c9ce35bb50463
5
5
refs/heads/try: 519addf6277dbafccbb4159db4b710c37eaa2ec5
6
6
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
7
7
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b
8
- refs/heads/try2: 55a7b2feddfd54f5a4c5f4dd85d156a0da50428e
8
+ refs/heads/try2: a5db84ce128ea1307c795bbee8a076d50725817a
9
9
refs/heads/dist-snap: ba4081a5a8573875fed17545846f6f6902c8ba8d
10
10
refs/tags/release-0.2: c870d2dffb391e14efb05aa27898f1f6333a9596
11
11
refs/tags/release-0.3: b5f0d0f648d9a6153664837026ba1be43d3e2503
Original file line number Diff line number Diff line change @@ -154,9 +154,12 @@ pub fn lookup_const_by_id(tcx: ty::ctxt,
154
154
Some ( _) => None
155
155
}
156
156
} 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
+ }
160
163
}
161
164
let maps = astencode:: Maps {
162
165
root_map : @mut HashMap :: new ( ) ,
@@ -173,8 +176,12 @@ pub fn lookup_const_by_id(tcx: ty::ctxt,
173
176
} ,
174
177
_ => None
175
178
} ;
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
+ }
178
185
}
179
186
}
180
187
Original file line number Diff line number Diff line change @@ -368,7 +368,7 @@ struct ctxt_ {
368
368
369
369
// These two caches are used by const_eval when decoding external statics
370
370
// 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 > > > ,
372
372
extern_const_variants : @mut HashMap < ast:: DefId , Option < @ast:: Expr > > ,
373
373
}
374
374
@@ -1014,7 +1014,7 @@ pub fn mk_ctxt(s: session::Session,
1014
1014
populated_external_types : @mut HashSet :: new ( ) ,
1015
1015
populated_external_traits : @mut HashSet :: new ( ) ,
1016
1016
1017
- extern_const_statics : @ mut HashMap :: new ( ) ,
1017
+ extern_const_statics : RefCell :: new ( HashMap :: new ( ) ) ,
1018
1018
extern_const_variants : @mut HashMap :: new ( ) ,
1019
1019
}
1020
1020
}
You can’t perform that action at this time.
0 commit comments