@@ -622,7 +622,8 @@ pub fn create_function_debug_context(cx: &CrateContext,
622
622
} ;
623
623
624
624
// get_template_parameters() will append a `<...>` clause to the function name if necessary.
625
- let mut function_name = token:: ident_to_str ( & ident) . to_owned ( ) ;
625
+ let function_name_string = token:: get_ident ( ident. name ) ;
626
+ let mut function_name = function_name_string. get ( ) . to_owned ( ) ;
626
627
let template_parameters = get_template_parameters ( cx,
627
628
generics,
628
629
param_substs,
@@ -791,7 +792,9 @@ pub fn create_function_debug_context(cx: &CrateContext,
791
792
792
793
let ident = special_idents:: type_self;
793
794
794
- let param_metadata = token:: ident_to_str ( & ident) . with_c_str ( |name| {
795
+ let param_metadata_string = token:: get_ident ( ident. name ) ;
796
+ let param_metadata = param_metadata_string. get ( )
797
+ . with_c_str ( |name| {
795
798
unsafe {
796
799
llvm:: LLVMDIBuilderCreateTemplateTypeParameter (
797
800
DIB ( cx) ,
@@ -829,7 +832,9 @@ pub fn create_function_debug_context(cx: &CrateContext,
829
832
// Again, only create type information if extra_debuginfo is enabled
830
833
if cx. sess . opts . extra_debuginfo {
831
834
let actual_type_metadata = type_metadata ( cx, actual_type, codemap:: DUMMY_SP ) ;
832
- let param_metadata = token:: ident_to_str ( & ident) . with_c_str ( |name| {
835
+ let param_metadata_string = token:: get_ident ( ident. name ) ;
836
+ let param_metadata = param_metadata_string. get ( )
837
+ . with_c_str ( |name| {
833
838
unsafe {
834
839
llvm:: LLVMDIBuilderCreateTemplateTypeParameter (
835
840
DIB ( cx) ,
@@ -934,7 +939,8 @@ fn declare_local(bcx: &Block,
934
939
let filename = span_start ( cx, span) . file . name . clone ( ) ;
935
940
let file_metadata = file_metadata ( cx, filename) ;
936
941
937
- let name: & str = token:: ident_to_str ( & variable_ident) ;
942
+ let variable_ident_string = token:: get_ident ( variable_ident. name ) ;
943
+ let name: & str = variable_ident_string. get ( ) ;
938
944
let loc = span_start ( cx, span) ;
939
945
let type_metadata = type_metadata ( cx, variable_type, span) ;
940
946
@@ -1363,7 +1369,8 @@ fn describe_enum_variant(cx: &CrateContext,
1363
1369
file_metadata : DIFile ,
1364
1370
span : Span )
1365
1371
-> ( DICompositeType , Type , @MemberDescriptionFactory ) {
1366
- let variant_name = token:: ident_to_str ( & variant_info. name ) ;
1372
+ let variant_info_string = token:: get_ident ( variant_info. name . name ) ;
1373
+ let variant_name = variant_info_string. get ( ) ;
1367
1374
let variant_llvm_type = Type :: struct_ ( struct_def. fields . map ( |& t| type_of:: type_of ( cx, t) ) ,
1368
1375
struct_def. packed ) ;
1369
1376
// Could some consistency checks here: size, align, field count, discr type
@@ -1458,7 +1465,8 @@ fn prepare_enum_metadata(cx: &CrateContext,
1458
1465
let enumerators_metadata: ~[ DIDescriptor ] = variants
1459
1466
. iter ( )
1460
1467
. map ( |v| {
1461
- let name: & str = token:: ident_to_str ( & v. name ) ;
1468
+ let string = token:: get_ident ( v. name . name ) ;
1469
+ let name: & str = string. get ( ) ;
1462
1470
let discriminant_value = v. disr_val as c_ulonglong ;
1463
1471
1464
1472
name. with_c_str ( |name| {
@@ -2002,9 +2010,10 @@ fn trait_metadata(cx: &CrateContext,
2002
2010
// the trait's methods.
2003
2011
let path = ty:: item_path ( cx. tcx , def_id) ;
2004
2012
let ident = path. last ( ) . unwrap ( ) . ident ( ) ;
2013
+ let ident_string = token:: get_ident ( ident. name ) ;
2005
2014
let name = ppaux:: trait_store_to_str ( cx. tcx , trait_store) +
2006
2015
ppaux:: mutability_to_str ( mutability) +
2007
- token :: ident_to_str ( & ident ) ;
2016
+ ident_string . get ( ) ;
2008
2017
// Add type and region parameters
2009
2018
let name = ppaux:: parameterized ( cx. tcx , name, & substs. regions ,
2010
2019
substs. tps , def_id, true ) ;
@@ -2761,8 +2770,10 @@ impl NamespaceTreeNode {
2761
2770
}
2762
2771
None => { }
2763
2772
}
2764
- let name = token:: ident_to_str ( & node. ident ) ;
2765
- output. push_str ( format ! ( "{}{}" , name. len( ) , name) ) ;
2773
+ let string = token:: get_ident ( node. ident . name ) ;
2774
+ output. push_str ( format ! ( "{}{}" ,
2775
+ string. get( ) . len( ) ,
2776
+ string. get( ) ) ) ;
2766
2777
}
2767
2778
}
2768
2779
}
@@ -2813,7 +2824,8 @@ fn namespace_for_item(cx: &CrateContext,
2813
2824
Some ( node) => node. scope ,
2814
2825
None => ptr:: null ( )
2815
2826
} ;
2816
- let namespace_name = token:: ident_to_str ( & ident) ;
2827
+ let namespace_name_string = token:: get_ident ( ident. name ) ;
2828
+ let namespace_name = namespace_name_string. get ( ) ;
2817
2829
2818
2830
let namespace_metadata = unsafe {
2819
2831
namespace_name. with_c_str ( |namespace_name| {
0 commit comments