@@ -346,7 +346,7 @@ struct ImplTraitTypeIdVisitor<'a> { ids: &'a mut SmallVec<[NodeId; 1]> }
346346
347347impl < ' a , ' b > Visitor < ' a > for ImplTraitTypeIdVisitor < ' b > {
348348 fn visit_ty ( & mut self , ty : & ' a Ty ) {
349- match ty. node {
349+ match ty. kind {
350350 | TyKind :: Typeof ( _)
351351 | TyKind :: BareFn ( _)
352352 => return ,
@@ -497,7 +497,7 @@ impl<'a> LoweringContext<'a> {
497497 }
498498
499499 fn visit_ty ( & mut self , t : & ' tcx Ty ) {
500- match t. node {
500+ match t. kind {
501501 // Mirrors the case in visit::walk_ty
502502 TyKind :: BareFn ( ref f) => {
503503 walk_list ! (
@@ -1104,7 +1104,7 @@ impl<'a> LoweringContext<'a> {
11041104 let ty = this. lower_ty (
11051105 & Ty {
11061106 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 ( ) ) ,
11081108 span : constraint. span ,
11091109 } ,
11101110 itctx,
@@ -1165,14 +1165,14 @@ impl<'a> LoweringContext<'a> {
11651165 let id = self . lower_node_id ( t. id ) ;
11661166 let qpath = self . lower_qpath ( t. id , qself, path, param_mode, itctx) ;
11671167 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 {
11691169 self . maybe_lint_bare_trait ( t. span , t. id , qself. is_none ( ) && path. is_global ( ) ) ;
11701170 }
11711171 ty
11721172 }
11731173
11741174 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 {
11761176 TyKind :: Infer => hir:: TyKind :: Infer ,
11771177 TyKind :: Err => hir:: TyKind :: Err ,
11781178 TyKind :: Slice ( ref ty) => hir:: TyKind :: Slice ( self . lower_ty ( ty, itctx) ) ,
@@ -1345,7 +1345,7 @@ impl<'a> LoweringContext<'a> {
13451345 } ;
13461346
13471347 hir:: Ty {
1348- node : kind,
1348+ kind,
13491349 span : t. span ,
13501350 hir_id : self . lower_node_id ( t. id ) ,
13511351 }
@@ -1505,7 +1505,7 @@ impl<'a> LoweringContext<'a> {
15051505
15061506 fn visit_ty ( & mut self , t : & ' v hir:: Ty ) {
15071507 // 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 {
15091509 let old_collect_elided_lifetimes = self . collect_elided_lifetimes ;
15101510 self . collect_elided_lifetimes = false ;
15111511
@@ -2026,7 +2026,7 @@ impl<'a> LoweringContext<'a> {
20262026 . map ( |ty| this. lower_ty_direct ( ty, ImplTraitContext :: disallowed ( ) ) )
20272027 . collect ( ) ;
20282028 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 }
20302030 } ;
20312031 (
20322032 hir:: GenericArgs {
@@ -2179,16 +2179,16 @@ impl<'a> LoweringContext<'a> {
21792179 _ => false ,
21802180 } ;
21812181
2182- match arg. ty . node {
2182+ match arg. ty . kind {
21832183 TyKind :: ImplicitSelf if is_mutable_pat => hir:: ImplicitSelfKind :: Mut ,
21842184 TyKind :: ImplicitSelf => hir:: ImplicitSelfKind :: Imm ,
21852185 // Given we are only considering `ImplicitSelf` types, we needn't consider
21862186 // the case where we have a mutable pattern to a reference as that would
21872187 // 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 ( ) &&
21892189 mt. mutbl == ast:: Mutability :: Mutable =>
21902190 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 ( ) =>
21922192 hir:: ImplicitSelfKind :: ImmRef ,
21932193 _ => hir:: ImplicitSelfKind :: None ,
21942194 }
@@ -2403,7 +2403,7 @@ impl<'a> LoweringContext<'a> {
24032403 let opaque_ty_ref = hir:: TyKind :: Def ( hir:: ItemId { id : opaque_ty_id } , generic_args. into ( ) ) ;
24042404
24052405 hir:: FunctionRetTy :: Return ( P ( hir:: Ty {
2406- node : opaque_ty_ref,
2406+ kind : opaque_ty_ref,
24072407 span,
24082408 hir_id : self . next_id ( ) ,
24092409 } ) )
@@ -2424,7 +2424,7 @@ impl<'a> LoweringContext<'a> {
24242424 FunctionRetTy :: Default ( ret_ty_span) => {
24252425 P ( hir:: Ty {
24262426 hir_id : self . next_id ( ) ,
2427- node : hir:: TyKind :: Tup ( hir_vec ! [ ] ) ,
2427+ kind : hir:: TyKind :: Tup ( hir_vec ! [ ] ) ,
24282428 span : * ret_ty_span,
24292429 } )
24302430 }
@@ -3164,7 +3164,7 @@ impl<'a> LoweringContext<'a> {
31643164 }
31653165
31663166 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 {
31683168 hir:: QPath :: Resolved ( None , path) => {
31693169 // Turn trait object paths into `TyKind::TraitObject` instead.
31703170 match path. res {
@@ -3188,9 +3188,10 @@ impl<'a> LoweringContext<'a> {
31883188 }
31893189 _ => hir:: TyKind :: Path ( qpath) ,
31903190 } ;
3191+
31913192 hir:: Ty {
31923193 hir_id,
3193- node ,
3194+ kind ,
31943195 span,
31953196 }
31963197 }
@@ -3394,7 +3395,7 @@ pub fn is_range_literal(sess: &Session, expr: &hir::Expr) -> bool {
33943395 // `..=` desugars into `::std::ops::RangeInclusive::new(...)`.
33953396 ExprKind :: Call ( ref func, _) => {
33963397 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 {
33983399 let new_call = segment. ident . as_str ( ) == "new" ;
33993400 return is_range_path ( & path) && is_lit ( sess, & expr. span ) && new_call;
34003401 }
0 commit comments