File tree Expand file tree Collapse file tree 3 files changed +15
-8
lines changed
branches/snap-stage3/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 1
1
---
2
2
refs/heads/master: deeca5d586bfaa4aa60246f671a8d611d38f6248
3
3
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
4
- refs/heads/snap-stage3: a5db84ce128ea1307c795bbee8a076d50725817a
4
+ refs/heads/snap-stage3: b976226d52d0020c37b89e1dc837bc1efc0f27cc
5
5
refs/heads/try: b160761e35efcd1207112b3b782c06633cf441a8
6
6
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
7
7
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b
Original file line number Diff line number Diff line change @@ -111,9 +111,12 @@ pub fn lookup_variant_by_id(tcx: ty::ctxt,
111
111
Some ( _) => None
112
112
}
113
113
} else {
114
- match tcx. extern_const_variants . find ( & variant_def) {
115
- Some ( & e) => return e,
116
- None => { }
114
+ {
115
+ let extern_const_variants = tcx. extern_const_variants . borrow ( ) ;
116
+ match extern_const_variants. get ( ) . find ( & variant_def) {
117
+ Some ( & e) => return e,
118
+ None => { }
119
+ }
117
120
}
118
121
let maps = astencode:: Maps {
119
122
root_map : @mut HashMap :: new ( ) ,
@@ -136,8 +139,12 @@ pub fn lookup_variant_by_id(tcx: ty::ctxt,
136
139
} ,
137
140
_ => None
138
141
} ;
139
- tcx. extern_const_variants . insert ( variant_def, e) ;
140
- return e;
142
+ {
143
+ let mut extern_const_variants = tcx. extern_const_variants
144
+ . borrow_mut ( ) ;
145
+ extern_const_variants. get ( ) . insert ( variant_def, e) ;
146
+ return e;
147
+ }
141
148
}
142
149
}
143
150
Original file line number Diff line number Diff line change @@ -369,7 +369,7 @@ struct ctxt_ {
369
369
// These two caches are used by const_eval when decoding external statics
370
370
// and variants that are found.
371
371
extern_const_statics : RefCell < HashMap < ast:: DefId , Option < @ast:: Expr > > > ,
372
- extern_const_variants : @ mut HashMap < ast:: DefId , Option < @ast:: Expr > > ,
372
+ extern_const_variants : RefCell < HashMap < ast:: DefId , Option < @ast:: Expr > > > ,
373
373
}
374
374
375
375
pub enum tbox_flag {
@@ -1015,7 +1015,7 @@ pub fn mk_ctxt(s: session::Session,
1015
1015
populated_external_traits : @mut HashSet :: new ( ) ,
1016
1016
1017
1017
extern_const_statics : RefCell :: new ( HashMap :: new ( ) ) ,
1018
- extern_const_variants : @ mut HashMap :: new ( ) ,
1018
+ extern_const_variants : RefCell :: new ( HashMap :: new ( ) ) ,
1019
1019
}
1020
1020
}
1021
1021
You can’t perform that action at this time.
0 commit comments