@@ -120,6 +120,7 @@ use std::vec;
120
120
use syntax:: ast:: * ;
121
121
use syntax:: codemap:: Span ;
122
122
use syntax:: parse:: token:: special_idents;
123
+ use syntax:: parse:: token;
123
124
use syntax:: print:: pprust:: { expr_to_str, block_to_str} ;
124
125
use syntax:: { visit, ast_util} ;
125
126
use syntax:: visit:: { Visitor , FnKind } ;
@@ -332,13 +333,14 @@ impl IrMaps {
332
333
}
333
334
}
334
335
335
- pub fn variable_name ( & self , var : Variable ) -> @ str {
336
+ pub fn variable_name ( & self , var : Variable ) -> ~ str {
336
337
let var_kinds = self . var_kinds . borrow ( ) ;
337
338
match var_kinds. get ( ) [ var. get ( ) ] {
338
339
Local ( LocalInfo { ident : nm, .. } ) | Arg ( _, nm) => {
339
- self . tcx . sess . str_of ( nm)
340
+ let string = token:: get_ident ( nm. name ) ;
341
+ string. get ( ) . to_str ( )
340
342
} ,
341
- ImplicitRet => @ "<implicit-ret>"
343
+ ImplicitRet => ~ "<implicit-ret>"
342
344
}
343
345
}
344
346
@@ -1669,7 +1671,7 @@ impl Liveness {
1669
1671
}
1670
1672
}
1671
1673
1672
- pub fn should_warn ( & self , var : Variable ) -> Option < @ str > {
1674
+ pub fn should_warn ( & self , var : Variable ) -> Option < ~ str > {
1673
1675
let name = self . ir . variable_name ( var) ;
1674
1676
if name. len ( ) == 0 || name[ 0 ] == ( '_' as u8 ) { None } else { Some ( name) }
1675
1677
}
0 commit comments