@@ -346,7 +346,7 @@ struct ImplTraitTypeIdVisitor<'a> { ids: &'a mut SmallVec<[NodeId; 1]> }
346
346
347
347
impl < ' a , ' b > Visitor < ' a > for ImplTraitTypeIdVisitor < ' b > {
348
348
fn visit_ty ( & mut self , ty : & ' a Ty ) {
349
- match ty. node {
349
+ match ty. kind {
350
350
| TyKind :: Typeof ( _)
351
351
| TyKind :: BareFn ( _)
352
352
=> return ,
@@ -497,7 +497,7 @@ impl<'a> LoweringContext<'a> {
497
497
}
498
498
499
499
fn visit_ty ( & mut self , t : & ' tcx Ty ) {
500
- match t. node {
500
+ match t. kind {
501
501
// Mirrors the case in visit::walk_ty
502
502
TyKind :: BareFn ( ref f) => {
503
503
walk_list ! (
@@ -1104,7 +1104,7 @@ impl<'a> LoweringContext<'a> {
1104
1104
let ty = this. lower_ty (
1105
1105
& Ty {
1106
1106
id : this. sess . next_node_id ( ) ,
1107
- node : TyKind :: ImplTrait ( impl_trait_node_id, bounds. clone ( ) ) ,
1107
+ kind : TyKind :: ImplTrait ( impl_trait_node_id, bounds. clone ( ) ) ,
1108
1108
span : constraint. span ,
1109
1109
} ,
1110
1110
itctx,
@@ -1165,14 +1165,14 @@ impl<'a> LoweringContext<'a> {
1165
1165
let id = self . lower_node_id ( t. id ) ;
1166
1166
let qpath = self . lower_qpath ( t. id , qself, path, param_mode, itctx) ;
1167
1167
let ty = self . ty_path ( id, t. span , qpath) ;
1168
- if let hir:: TyKind :: TraitObject ( ..) = ty. node {
1168
+ if let hir:: TyKind :: TraitObject ( ..) = ty. kind {
1169
1169
self . maybe_lint_bare_trait ( t. span , t. id , qself. is_none ( ) && path. is_global ( ) ) ;
1170
1170
}
1171
1171
ty
1172
1172
}
1173
1173
1174
1174
fn lower_ty_direct ( & mut self , t : & Ty , mut itctx : ImplTraitContext < ' _ > ) -> hir:: Ty {
1175
- let kind = match t. node {
1175
+ let kind = match t. kind {
1176
1176
TyKind :: Infer => hir:: TyKind :: Infer ,
1177
1177
TyKind :: Err => hir:: TyKind :: Err ,
1178
1178
TyKind :: Slice ( ref ty) => hir:: TyKind :: Slice ( self . lower_ty ( ty, itctx) ) ,
@@ -1345,7 +1345,7 @@ impl<'a> LoweringContext<'a> {
1345
1345
} ;
1346
1346
1347
1347
hir:: Ty {
1348
- node : kind,
1348
+ kind,
1349
1349
span : t. span ,
1350
1350
hir_id : self . lower_node_id ( t. id ) ,
1351
1351
}
@@ -1505,7 +1505,7 @@ impl<'a> LoweringContext<'a> {
1505
1505
1506
1506
fn visit_ty ( & mut self , t : & ' v hir:: Ty ) {
1507
1507
// Don't collect elided lifetimes used inside of `fn()` syntax.
1508
- if let hir:: TyKind :: BareFn ( _) = t. node {
1508
+ if let hir:: TyKind :: BareFn ( _) = t. kind {
1509
1509
let old_collect_elided_lifetimes = self . collect_elided_lifetimes ;
1510
1510
self . collect_elided_lifetimes = false ;
1511
1511
@@ -2026,7 +2026,7 @@ impl<'a> LoweringContext<'a> {
2026
2026
. map ( |ty| this. lower_ty_direct ( ty, ImplTraitContext :: disallowed ( ) ) )
2027
2027
. collect ( ) ;
2028
2028
let mk_tup = |this : & mut Self , tys, span| {
2029
- hir:: Ty { node : hir:: TyKind :: Tup ( tys) , hir_id : this. next_id ( ) , span }
2029
+ hir:: Ty { kind : hir:: TyKind :: Tup ( tys) , hir_id : this. next_id ( ) , span }
2030
2030
} ;
2031
2031
(
2032
2032
hir:: GenericArgs {
@@ -2179,16 +2179,16 @@ impl<'a> LoweringContext<'a> {
2179
2179
_ => false ,
2180
2180
} ;
2181
2181
2182
- match arg. ty . node {
2182
+ match arg. ty . kind {
2183
2183
TyKind :: ImplicitSelf if is_mutable_pat => hir:: ImplicitSelfKind :: Mut ,
2184
2184
TyKind :: ImplicitSelf => hir:: ImplicitSelfKind :: Imm ,
2185
2185
// Given we are only considering `ImplicitSelf` types, we needn't consider
2186
2186
// the case where we have a mutable pattern to a reference as that would
2187
2187
// no longer be an `ImplicitSelf`.
2188
- TyKind :: Rptr ( _, ref mt) if mt. ty . node . is_implicit_self ( ) &&
2188
+ TyKind :: Rptr ( _, ref mt) if mt. ty . kind . is_implicit_self ( ) &&
2189
2189
mt. mutbl == ast:: Mutability :: Mutable =>
2190
2190
hir:: ImplicitSelfKind :: MutRef ,
2191
- TyKind :: Rptr ( _, ref mt) if mt. ty . node . is_implicit_self ( ) =>
2191
+ TyKind :: Rptr ( _, ref mt) if mt. ty . kind . is_implicit_self ( ) =>
2192
2192
hir:: ImplicitSelfKind :: ImmRef ,
2193
2193
_ => hir:: ImplicitSelfKind :: None ,
2194
2194
}
@@ -2403,7 +2403,7 @@ impl<'a> LoweringContext<'a> {
2403
2403
let opaque_ty_ref = hir:: TyKind :: Def ( hir:: ItemId { id : opaque_ty_id } , generic_args. into ( ) ) ;
2404
2404
2405
2405
hir:: FunctionRetTy :: Return ( P ( hir:: Ty {
2406
- node : opaque_ty_ref,
2406
+ kind : opaque_ty_ref,
2407
2407
span,
2408
2408
hir_id : self . next_id ( ) ,
2409
2409
} ) )
@@ -2424,7 +2424,7 @@ impl<'a> LoweringContext<'a> {
2424
2424
FunctionRetTy :: Default ( ret_ty_span) => {
2425
2425
P ( hir:: Ty {
2426
2426
hir_id : self . next_id ( ) ,
2427
- node : hir:: TyKind :: Tup ( hir_vec ! [ ] ) ,
2427
+ kind : hir:: TyKind :: Tup ( hir_vec ! [ ] ) ,
2428
2428
span : * ret_ty_span,
2429
2429
} )
2430
2430
}
@@ -3164,7 +3164,7 @@ impl<'a> LoweringContext<'a> {
3164
3164
}
3165
3165
3166
3166
fn ty_path ( & mut self , mut hir_id : hir:: HirId , span : Span , qpath : hir:: QPath ) -> hir:: Ty {
3167
- let node = match qpath {
3167
+ let kind = match qpath {
3168
3168
hir:: QPath :: Resolved ( None , path) => {
3169
3169
// Turn trait object paths into `TyKind::TraitObject` instead.
3170
3170
match path. res {
@@ -3188,9 +3188,10 @@ impl<'a> LoweringContext<'a> {
3188
3188
}
3189
3189
_ => hir:: TyKind :: Path ( qpath) ,
3190
3190
} ;
3191
+
3191
3192
hir:: Ty {
3192
3193
hir_id,
3193
- node ,
3194
+ kind ,
3194
3195
span,
3195
3196
}
3196
3197
}
@@ -3394,7 +3395,7 @@ pub fn is_range_literal(sess: &Session, expr: &hir::Expr) -> bool {
3394
3395
// `..=` desugars into `::std::ops::RangeInclusive::new(...)`.
3395
3396
ExprKind :: Call ( ref func, _) => {
3396
3397
if let ExprKind :: Path ( QPath :: TypeRelative ( ref ty, ref segment) ) = func. kind {
3397
- if let TyKind :: Path ( QPath :: Resolved ( None , ref path) ) = ty. node {
3398
+ if let TyKind :: Path ( QPath :: Resolved ( None , ref path) ) = ty. kind {
3398
3399
let new_call = segment. ident . as_str ( ) == "new" ;
3399
3400
return is_range_path ( & path) && is_lit ( sess, & expr. span ) && new_call;
3400
3401
}
0 commit comments