@@ -1370,7 +1370,7 @@ impl<'a> LoweringContext<'a> {
1370
1370
let exist_ty_item = hir:: Item {
1371
1371
id : exist_ty_id. node_id ,
1372
1372
hir_id : exist_ty_id. hir_id ,
1373
- name : keywords:: Invalid . name ( ) ,
1373
+ ident : keywords:: Invalid . ident ( ) ,
1374
1374
attrs : Default :: default ( ) ,
1375
1375
node : exist_ty_item_kind,
1376
1376
vis : respan ( span. shrink_to_lo ( ) , hir:: VisibilityKind :: Inherited ) ,
@@ -1573,7 +1573,7 @@ impl<'a> LoweringContext<'a> {
1573
1573
fn lower_variant ( & mut self , v : & Variant ) -> hir:: Variant {
1574
1574
Spanned {
1575
1575
node : hir:: VariantKind {
1576
- name : v. node . ident . name ,
1576
+ ident : v. node . ident ,
1577
1577
attrs : self . lower_attrs ( & v. node . attrs ) ,
1578
1578
data : self . lower_variant_data ( & v. node . data ) ,
1579
1579
disr_expr : v. node . disr_expr . as_ref ( ) . map ( |e| self . lower_anon_const ( e) ) ,
@@ -2748,7 +2748,7 @@ impl<'a> LoweringContext<'a> {
2748
2748
fn lower_item_kind (
2749
2749
& mut self ,
2750
2750
id : NodeId ,
2751
- name : & mut Name ,
2751
+ ident : & mut Ident ,
2752
2752
attrs : & hir:: HirVec < Attribute > ,
2753
2753
vis : & mut hir:: Visibility ,
2754
2754
i : & ItemKind ,
@@ -2762,7 +2762,7 @@ impl<'a> LoweringContext<'a> {
2762
2762
span : use_tree. span ,
2763
2763
} ;
2764
2764
2765
- self . lower_use_tree ( use_tree, & prefix, id, vis, name , attrs)
2765
+ self . lower_use_tree ( use_tree, & prefix, id, vis, ident , attrs)
2766
2766
}
2767
2767
ItemKind :: Static ( ref t, m, ref e) => {
2768
2768
let value = self . lower_body ( None , |this| this. lower_expr ( e) ) ;
@@ -2954,7 +2954,7 @@ impl<'a> LoweringContext<'a> {
2954
2954
prefix : & Path ,
2955
2955
id : NodeId ,
2956
2956
vis : & mut hir:: Visibility ,
2957
- name : & mut Name ,
2957
+ ident : & mut Ident ,
2958
2958
attrs : & hir:: HirVec < Attribute > ,
2959
2959
) -> hir:: ItemKind {
2960
2960
debug ! ( "lower_use_tree(tree={:?})" , tree) ;
@@ -2970,28 +2970,28 @@ impl<'a> LoweringContext<'a> {
2970
2970
2971
2971
match tree. kind {
2972
2972
UseTreeKind :: Simple ( rename, id1, id2) => {
2973
- * name = tree. ident ( ) . name ;
2973
+ * ident = tree. ident ( ) ;
2974
2974
2975
- // First apply the prefix to the path
2975
+ // First, apply the prefix to the path.
2976
2976
let mut path = Path {
2977
2977
segments,
2978
2978
span : path. span ,
2979
2979
} ;
2980
2980
2981
- // Correctly resolve `self` imports
2981
+ // Correctly resolve `self` imports.
2982
2982
if path. segments . len ( ) > 1
2983
2983
&& path. segments . last ( ) . unwrap ( ) . ident . name == keywords:: SelfLower . name ( )
2984
2984
{
2985
2985
let _ = path. segments . pop ( ) ;
2986
2986
if rename. is_none ( ) {
2987
- * name = path. segments . last ( ) . unwrap ( ) . ident . name ;
2987
+ * ident = path. segments . last ( ) . unwrap ( ) . ident ;
2988
2988
}
2989
2989
}
2990
2990
2991
2991
let parent_def_index = self . current_hir_id_owner . last ( ) . unwrap ( ) . 0 ;
2992
2992
let mut defs = self . expect_full_def_from_use ( id) ;
2993
- // we want to return *something* from this function, so hang onto the first item
2994
- // for later
2993
+ // We want to return *something* from this function, so hold onto the first item
2994
+ // for later.
2995
2995
let ret_def = defs. next ( ) . unwrap_or ( Def :: Err ) ;
2996
2996
2997
2997
// Here, we are looping over namespaces, if they exist for the definition
@@ -3001,7 +3001,7 @@ impl<'a> LoweringContext<'a> {
3001
3001
// two imports.
3002
3002
for ( def, & new_node_id) in defs. zip ( [ id1, id2] . iter ( ) ) {
3003
3003
let vis = vis. clone ( ) ;
3004
- let name = name . clone ( ) ;
3004
+ let ident = ident . clone ( ) ;
3005
3005
let mut path = path. clone ( ) ;
3006
3006
for seg in & mut path. segments {
3007
3007
seg. id = self . sess . next_node_id ( ) ;
@@ -3042,7 +3042,7 @@ impl<'a> LoweringContext<'a> {
3042
3042
hir:: Item {
3043
3043
id : new_id. node_id ,
3044
3044
hir_id : new_id. hir_id ,
3045
- name : name ,
3045
+ ident ,
3046
3046
attrs : attrs. clone ( ) ,
3047
3047
node : item,
3048
3048
vis,
@@ -3068,8 +3068,8 @@ impl<'a> LoweringContext<'a> {
3068
3068
hir:: ItemKind :: Use ( path, hir:: UseKind :: Glob )
3069
3069
}
3070
3070
UseTreeKind :: Nested ( ref trees) => {
3071
- // Nested imports are desugared into simple
3072
- // imports. So if we start with
3071
+ // Nested imports are desugared into simple imports.
3072
+ // So, if we start with
3073
3073
//
3074
3074
// ```
3075
3075
// pub(x) use foo::{a, b};
@@ -3090,14 +3090,14 @@ impl<'a> LoweringContext<'a> {
3090
3090
// `self.items`. However, the structure of this
3091
3091
// function also requires us to return one item, and
3092
3092
// for that we return the `{}` import (called the
3093
- // " `ListStem`" ).
3093
+ // `ListStem`).
3094
3094
3095
3095
let prefix = Path {
3096
3096
segments,
3097
3097
span : prefix. span . to ( path. span ) ,
3098
3098
} ;
3099
3099
3100
- // Add all the nested PathListItems to the HIR.
3100
+ // Add all the nested `PathListItem`s to the HIR.
3101
3101
for & ( ref use_tree, id) in trees {
3102
3102
self . allocate_hir_id_counter ( id, & use_tree) ;
3103
3103
@@ -3107,10 +3107,10 @@ impl<'a> LoweringContext<'a> {
3107
3107
} = self . lower_node_id ( id) ;
3108
3108
3109
3109
let mut vis = vis. clone ( ) ;
3110
- let mut name = name . clone ( ) ;
3110
+ let mut ident = ident . clone ( ) ;
3111
3111
let mut prefix = prefix. clone ( ) ;
3112
3112
3113
- // Give the segments new ids since they are being cloned.
3113
+ // Give the segments new node- ids since they are being cloned.
3114
3114
for seg in & mut prefix. segments {
3115
3115
seg. id = self . sess . next_node_id ( ) ;
3116
3116
}
@@ -3125,7 +3125,7 @@ impl<'a> LoweringContext<'a> {
3125
3125
& prefix,
3126
3126
new_id,
3127
3127
& mut vis,
3128
- & mut name ,
3128
+ & mut ident ,
3129
3129
attrs) ;
3130
3130
3131
3131
let vis_kind = match vis. node {
@@ -3149,7 +3149,7 @@ impl<'a> LoweringContext<'a> {
3149
3149
hir:: Item {
3150
3150
id : new_id,
3151
3151
hir_id : new_hir_id,
3152
- name ,
3152
+ ident ,
3153
3153
attrs : attrs. clone ( ) ,
3154
3154
node : item,
3155
3155
vis,
@@ -3176,7 +3176,7 @@ impl<'a> LoweringContext<'a> {
3176
3176
* vis = respan ( prefix. span . shrink_to_lo ( ) , hir:: VisibilityKind :: Inherited ) ;
3177
3177
}
3178
3178
hir:: VisibilityKind :: Restricted { .. } => {
3179
- // do nothing here, as described in the comment on the match
3179
+ // Do nothing here, as described in the comment on the match.
3180
3180
}
3181
3181
}
3182
3182
@@ -3424,15 +3424,15 @@ impl<'a> LoweringContext<'a> {
3424
3424
}
3425
3425
3426
3426
pub fn lower_item ( & mut self , i : & Item ) -> Option < hir:: Item > {
3427
- let mut name = i. ident . name ;
3427
+ let mut ident = i. ident ;
3428
3428
let mut vis = self . lower_visibility ( & i. vis , None ) ;
3429
3429
let attrs = self . lower_attrs ( & i. attrs ) ;
3430
3430
if let ItemKind :: MacroDef ( ref def) = i. node {
3431
3431
if !def. legacy || attr:: contains_name ( & i. attrs , "macro_export" ) ||
3432
3432
attr:: contains_name ( & i. attrs , "rustc_doc_only_macro" ) {
3433
3433
let body = self . lower_token_stream ( def. stream ( ) ) ;
3434
3434
self . exported_macros . push ( hir:: MacroDef {
3435
- name,
3435
+ name : ident . name ,
3436
3436
vis,
3437
3437
attrs,
3438
3438
id : i. id ,
@@ -3444,14 +3444,14 @@ impl<'a> LoweringContext<'a> {
3444
3444
return None ;
3445
3445
}
3446
3446
3447
- let node = self . lower_item_kind ( i. id , & mut name , & attrs, & mut vis, & i. node ) ;
3447
+ let node = self . lower_item_kind ( i. id , & mut ident , & attrs, & mut vis, & i. node ) ;
3448
3448
3449
3449
let LoweredNodeId { node_id, hir_id } = self . lower_node_id ( i. id ) ;
3450
3450
3451
3451
Some ( hir:: Item {
3452
3452
id : node_id,
3453
3453
hir_id,
3454
- name ,
3454
+ ident ,
3455
3455
attrs,
3456
3456
node,
3457
3457
vis,
@@ -3464,7 +3464,7 @@ impl<'a> LoweringContext<'a> {
3464
3464
let def_id = self . resolver . definitions ( ) . local_def_id ( node_id) ;
3465
3465
hir:: ForeignItem {
3466
3466
id : node_id,
3467
- name : i. ident . name ,
3467
+ ident : i. ident ,
3468
3468
attrs : self . lower_attrs ( & i. attrs ) ,
3469
3469
node : match i. node {
3470
3470
ForeignItemKind :: Fn ( ref fdec, ref generics) => {
0 commit comments