@@ -1893,8 +1893,9 @@ impl Resolver {
1893
1893
csearch:: each_child_of_item ( self . session . cstore ,
1894
1894
def_id,
1895
1895
|def_like, child_ident, visibility| {
1896
+ let child_ident_string = token:: get_ident ( child_ident. name ) ;
1896
1897
debug ! ( "(populating external module) ... found ident: {}" ,
1897
- token :: ident_to_str ( & child_ident ) ) ;
1898
+ child_ident_string . get ( ) ) ;
1898
1899
self . build_reduced_graph_for_external_crate_def ( module,
1899
1900
def_like,
1900
1901
child_ident,
@@ -3102,11 +3103,12 @@ impl Resolver {
3102
3103
// top of the crate otherwise.
3103
3104
let mut containing_module;
3104
3105
let mut i;
3105
- if "self" == token:: ident_to_str ( & module_path[ 0 ] ) {
3106
+ let first_module_path_string = token:: get_ident ( module_path[ 0 ] . name ) ;
3107
+ if "self" == first_module_path_string. get ( ) {
3106
3108
containing_module =
3107
3109
self . get_nearest_normal_module_parent_or_self ( module_) ;
3108
3110
i = 1 ;
3109
- } else if "super" == token :: ident_to_str ( & module_path [ 0 ] ) {
3111
+ } else if "super" == first_module_path_string . get ( ) {
3110
3112
containing_module =
3111
3113
self . get_nearest_normal_module_parent_or_self ( module_) ;
3112
3114
i = 0 ; // We'll handle `super` below.
@@ -3115,8 +3117,11 @@ impl Resolver {
3115
3117
}
3116
3118
3117
3119
// Now loop through all the `super`s we find.
3118
- while i < module_path. len ( ) &&
3119
- "super" == token:: ident_to_str ( & module_path[ i] ) {
3120
+ while i < module_path. len ( ) {
3121
+ let string = token:: get_ident ( module_path[ i] . name ) ;
3122
+ if "super" != string. get ( ) {
3123
+ break
3124
+ }
3120
3125
debug ! ( "(resolving module prefix) resolving `super` at {}" ,
3121
3126
self . module_to_str( containing_module) ) ;
3122
3127
match self . get_nearest_normal_module_parent ( containing_module) {
0 commit comments