@@ -250,7 +250,7 @@ impl FunctionDebugContext {
250
250
struct FunctionDebugContextData {
251
251
scope_map : RefCell < HashMap < ast:: NodeId , DIScope > > ,
252
252
fn_metadata : DISubprogram ,
253
- argument_counter : uint ,
253
+ argument_counter : Cell < uint > ,
254
254
source_locations_enabled : bool ,
255
255
}
256
256
@@ -460,8 +460,8 @@ pub fn create_self_argument_metadata(bcx: @Block,
460
460
461
461
let argument_index = {
462
462
let counter = & mut bcx. fcx . debug_context . get_mut_ref ( bcx. ccx ( ) , span) . argument_counter ;
463
- let argument_index = * counter;
464
- * counter += 1 ;
463
+ let argument_index = counter. get ( ) ;
464
+ counter. set ( argument_index + 1 ) ;
465
465
argument_index
466
466
} ;
467
467
@@ -538,9 +538,9 @@ pub fn create_argument_metadata(bcx: @Block,
538
538
let argument_ident = ast_util:: path_to_ident ( path_ref) ;
539
539
540
540
let argument_index = {
541
- let counter = & mut fcx. debug_context . get_mut_ref ( cx, span) . argument_counter ;
542
- let argument_index = * counter;
543
- * counter += 1 ;
541
+ let counter = & fcx. debug_context . get_mut_ref ( cx, span) . argument_counter ;
542
+ let argument_index = counter. get ( ) ;
543
+ counter. set ( argument_index + 1 ) ;
544
544
argument_index
545
545
} ;
546
546
@@ -761,10 +761,10 @@ pub fn create_function_debug_context(cx: &CrateContext,
761
761
} ) ;
762
762
763
763
// Initialize fn debug context (including scope map and namespace map)
764
- let mut fn_debug_context = ~FunctionDebugContextData {
764
+ let fn_debug_context = ~FunctionDebugContextData {
765
765
scope_map : RefCell :: new ( HashMap :: new ( ) ) ,
766
766
fn_metadata : fn_metadata,
767
- argument_counter : 1 ,
767
+ argument_counter : Cell :: new ( 1 ) ,
768
768
source_locations_enabled : false ,
769
769
} ;
770
770
0 commit comments