File tree Expand file tree Collapse file tree 1 file changed +5
-4
lines changed
src/librustc/middle/trans Expand file tree Collapse file tree 1 file changed +5
-4
lines changed Original file line number Diff line number Diff line change @@ -219,6 +219,7 @@ use middle::ty;
219
219
use util:: common:: indenter;
220
220
use util:: ppaux:: { Repr , vec_map_to_str} ;
221
221
222
+ use std:: cell:: Cell ;
222
223
use std:: hashmap:: HashMap ;
223
224
use std:: ptr;
224
225
use std:: vec;
@@ -1188,19 +1189,19 @@ struct DynamicFailureHandler {
1188
1189
bcx : @Block ,
1189
1190
sp : Span ,
1190
1191
msg : @str ,
1191
- finished : @mut Option < BasicBlockRef > ,
1192
+ finished : @Cell < Option < BasicBlockRef > > ,
1192
1193
}
1193
1194
1194
1195
impl CustomFailureHandler for DynamicFailureHandler {
1195
1196
fn handle_fail ( & self ) -> BasicBlockRef {
1196
- match * self . finished {
1197
+ match self . finished . get ( ) {
1197
1198
Some ( bb) => return bb,
1198
1199
_ => ( ) ,
1199
1200
}
1200
1201
1201
1202
let fail_cx = sub_block ( self . bcx , "case_fallthrough" ) ;
1202
1203
controlflow:: trans_fail ( fail_cx, Some ( self . sp ) , self . msg ) ;
1203
- * self . finished = Some ( fail_cx. llbb ) ;
1204
+ self . finished . set ( Some ( fail_cx. llbb ) ) ;
1204
1205
fail_cx. llbb
1205
1206
}
1206
1207
}
@@ -1911,7 +1912,7 @@ fn trans_match_inner(scope_cx: @Block,
1911
1912
let chk = {
1912
1913
if ty:: type_is_empty ( tcx, t) {
1913
1914
// Special case for empty types
1914
- let fail_cx = @mut None ;
1915
+ let fail_cx = @Cell :: new ( None ) ;
1915
1916
let fail_handler = @DynamicFailureHandler {
1916
1917
bcx : scope_cx,
1917
1918
sp : discr_expr. span ,
You can’t perform that action at this time.
0 commit comments