@@ -222,21 +222,6 @@ impl FunctionDebugContext {
222
222
}
223
223
}
224
224
225
- fn get_mut_ref < ' a > ( & ' a mut self ,
226
- cx : & CrateContext ,
227
- span : Span )
228
- -> & ' a mut FunctionDebugContextData {
229
- match * self {
230
- FunctionDebugContext ( ~ref mut data) => data,
231
- DebugInfoDisabled => {
232
- cx. sess . span_bug ( span, FunctionDebugContext :: debuginfo_disabled_message ( ) ) ;
233
- }
234
- FunctionWithoutDebugInfo => {
235
- cx. sess . span_bug ( span, FunctionDebugContext :: should_be_ignored_message ( ) ) ;
236
- }
237
- }
238
- }
239
-
240
225
fn debuginfo_disabled_message ( ) -> & ' static str {
241
226
"debuginfo: Error trying to access FunctionDebugContext although debug info is disabled!"
242
227
}
@@ -459,7 +444,7 @@ pub fn create_self_argument_metadata(bcx: @Block,
459
444
let scope_metadata = bcx. fcx . debug_context . get_ref ( bcx. ccx ( ) , span) . fn_metadata ;
460
445
461
446
let argument_index = {
462
- let counter = & mut bcx. fcx . debug_context . get_mut_ref ( bcx. ccx ( ) , span) . argument_counter ;
447
+ let counter = & bcx. fcx . debug_context . get_ref ( bcx. ccx ( ) , span) . argument_counter ;
463
448
let argument_index = counter. get ( ) ;
464
449
counter. set ( argument_index + 1 ) ;
465
450
argument_index
@@ -538,7 +523,7 @@ pub fn create_argument_metadata(bcx: @Block,
538
523
let argument_ident = ast_util:: path_to_ident ( path_ref) ;
539
524
540
525
let argument_index = {
541
- let counter = & fcx. debug_context . get_mut_ref ( cx, span) . argument_counter ;
526
+ let counter = & fcx. debug_context . get_ref ( cx, span) . argument_counter ;
542
527
let argument_index = counter. get ( ) ;
543
528
counter. set ( argument_index + 1 ) ;
544
529
argument_index
@@ -596,9 +581,9 @@ pub fn clear_source_location(fcx: &FunctionContext) {
596
581
/// when beginning to translate a new function. This functions switches source location emitting on
597
582
/// and must therefore be called before the first real statement/expression of the function is
598
583
/// translated.
599
- pub fn start_emitting_source_locations ( fcx : & mut FunctionContext ) {
584
+ pub fn start_emitting_source_locations ( fcx : & FunctionContext ) {
600
585
match fcx. debug_context {
601
- FunctionDebugContext ( ~ref mut data) => {
586
+ FunctionDebugContext ( ~ref data) => {
602
587
data. source_locations_enabled . set ( true )
603
588
} ,
604
589
_ => { /* safe to ignore */ }
0 commit comments