@@ -1080,25 +1080,25 @@ impl<'a> LoweringContext<'a> {
1080
1080
1081
1081
fn lower_ty_direct ( & mut self , t : & Ty , mut itctx : ImplTraitContext ) -> hir:: Ty {
1082
1082
let kind = match t. node {
1083
- TyKind :: Infer => hir:: TyInfer ,
1084
- TyKind :: Err => hir:: TyErr ,
1085
- TyKind :: Slice ( ref ty) => hir:: TySlice ( self . lower_ty ( ty, itctx) ) ,
1086
- TyKind :: Ptr ( ref mt) => hir:: TyPtr ( self . lower_mt ( mt, itctx) ) ,
1083
+ TyKind :: Infer => hir:: TyKind :: Infer ,
1084
+ TyKind :: Err => hir:: TyKind :: Err ,
1085
+ TyKind :: Slice ( ref ty) => hir:: TyKind :: Slice ( self . lower_ty ( ty, itctx) ) ,
1086
+ TyKind :: Ptr ( ref mt) => hir:: TyKind :: Ptr ( self . lower_mt ( mt, itctx) ) ,
1087
1087
TyKind :: Rptr ( ref region, ref mt) => {
1088
1088
let span = t. span . shrink_to_lo ( ) ;
1089
1089
let lifetime = match * region {
1090
1090
Some ( ref lt) => self . lower_lifetime ( lt) ,
1091
1091
None => self . elided_ref_lifetime ( span) ,
1092
1092
} ;
1093
- hir:: TyRptr ( lifetime, self . lower_mt ( mt, itctx) )
1093
+ hir:: TyKind :: Rptr ( lifetime, self . lower_mt ( mt, itctx) )
1094
1094
}
1095
1095
TyKind :: BareFn ( ref f) => self . with_in_scope_lifetime_defs (
1096
1096
& f. generic_params ,
1097
1097
|this| {
1098
1098
this. with_anonymous_lifetime_mode (
1099
1099
AnonymousLifetimeMode :: PassThrough ,
1100
1100
|this| {
1101
- hir:: TyBareFn ( P ( hir:: BareFnTy {
1101
+ hir:: TyKind :: BareFn ( P ( hir:: BareFnTy {
1102
1102
generic_params : this. lower_generic_params (
1103
1103
& f. generic_params ,
1104
1104
& NodeMap ( ) ,
@@ -1113,9 +1113,9 @@ impl<'a> LoweringContext<'a> {
1113
1113
)
1114
1114
} ,
1115
1115
) ,
1116
- TyKind :: Never => hir:: TyNever ,
1116
+ TyKind :: Never => hir:: TyKind :: Never ,
1117
1117
TyKind :: Tup ( ref tys) => {
1118
- hir:: TyTup ( tys. iter ( ) . map ( |ty| {
1118
+ hir:: TyKind :: Tup ( tys. iter ( ) . map ( |ty| {
1119
1119
self . lower_ty_direct ( ty, itctx. reborrow ( ) )
1120
1120
} ) . collect ( ) )
1121
1121
}
@@ -1126,12 +1126,12 @@ impl<'a> LoweringContext<'a> {
1126
1126
let id = self . lower_node_id ( t. id ) ;
1127
1127
let qpath = self . lower_qpath ( t. id , qself, path, ParamMode :: Explicit , itctx) ;
1128
1128
let ty = self . ty_path ( id, t. span , qpath) ;
1129
- if let hir:: TyTraitObject ( ..) = ty. node {
1129
+ if let hir:: TyKind :: TraitObject ( ..) = ty. node {
1130
1130
self . maybe_lint_bare_trait ( t. span , t. id , qself. is_none ( ) && path. is_global ( ) ) ;
1131
1131
}
1132
1132
return ty;
1133
1133
}
1134
- TyKind :: ImplicitSelf => hir:: TyPath ( hir:: QPath :: Resolved (
1134
+ TyKind :: ImplicitSelf => hir:: TyKind :: Path ( hir:: QPath :: Resolved (
1135
1135
None ,
1136
1136
P ( hir:: Path {
1137
1137
def : self . expect_full_def ( t. id ) ,
@@ -1140,10 +1140,10 @@ impl<'a> LoweringContext<'a> {
1140
1140
} ) ,
1141
1141
) ) ,
1142
1142
TyKind :: Array ( ref ty, ref length) => {
1143
- hir:: TyArray ( self . lower_ty ( ty, itctx) , self . lower_anon_const ( length) )
1143
+ hir:: TyKind :: Array ( self . lower_ty ( ty, itctx) , self . lower_anon_const ( length) )
1144
1144
}
1145
1145
TyKind :: Typeof ( ref expr) => {
1146
- hir:: TyTypeof ( self . lower_anon_const ( expr) )
1146
+ hir:: TyKind :: Typeof ( self . lower_anon_const ( expr) )
1147
1147
}
1148
1148
TyKind :: TraitObject ( ref bounds, kind) => {
1149
1149
let mut lifetime_bound = None ;
@@ -1167,7 +1167,7 @@ impl<'a> LoweringContext<'a> {
1167
1167
if kind != TraitObjectSyntax :: Dyn {
1168
1168
self . maybe_lint_bare_trait ( t. span , t. id , false ) ;
1169
1169
}
1170
- hir:: TyTraitObject ( bounds, lifetime_bound)
1170
+ hir:: TyKind :: TraitObject ( bounds, lifetime_bound)
1171
1171
}
1172
1172
TyKind :: ImplTrait ( def_node_id, ref bounds) => {
1173
1173
let span = t. span ;
@@ -1206,7 +1206,7 @@ impl<'a> LoweringContext<'a> {
1206
1206
}
1207
1207
} ) ;
1208
1208
1209
- hir:: TyPath ( hir:: QPath :: Resolved (
1209
+ hir:: TyKind :: Path ( hir:: QPath :: Resolved (
1210
1210
None ,
1211
1211
P ( hir:: Path {
1212
1212
span,
@@ -1223,7 +1223,7 @@ impl<'a> LoweringContext<'a> {
1223
1223
"`impl Trait` not allowed outside of function \
1224
1224
and inherent method return types"
1225
1225
) ;
1226
- hir:: TyErr
1226
+ hir:: TyKind :: Err
1227
1227
}
1228
1228
}
1229
1229
}
@@ -1245,7 +1245,7 @@ impl<'a> LoweringContext<'a> {
1245
1245
fn_def_id : DefId ,
1246
1246
exist_ty_node_id : NodeId ,
1247
1247
lower_bounds : impl FnOnce ( & mut LoweringContext ) -> hir:: GenericBounds ,
1248
- ) -> hir:: Ty_ {
1248
+ ) -> hir:: TyKind {
1249
1249
// Make sure we know that some funky desugaring has been going on here.
1250
1250
// This is a first: there is code in other places like for loop
1251
1251
// desugaring that explicitly states that we don't want to track that.
@@ -1320,7 +1320,7 @@ impl<'a> LoweringContext<'a> {
1320
1320
} ) )
1321
1321
} ] ,
1322
1322
} ) ;
1323
- hir:: TyPath ( hir:: QPath :: Resolved ( None , path) )
1323
+ hir:: TyKind :: Path ( hir:: QPath :: Resolved ( None , path) )
1324
1324
} )
1325
1325
}
1326
1326
@@ -1365,7 +1365,7 @@ impl<'a> LoweringContext<'a> {
1365
1365
1366
1366
fn visit_ty ( & mut self , t : & ' v hir:: Ty ) {
1367
1367
// Don't collect elided lifetimes used inside of `fn()` syntax
1368
- if let hir:: Ty_ :: TyBareFn ( _) = t. node {
1368
+ if let hir:: TyKind :: BareFn ( _) = t. node {
1369
1369
let old_collect_elided_lifetimes = self . collect_elided_lifetimes ;
1370
1370
self . collect_elided_lifetimes = false ;
1371
1371
@@ -1805,7 +1805,7 @@ impl<'a> LoweringContext<'a> {
1805
1805
let inputs = inputs. iter ( ) . map ( |ty| this. lower_ty_direct ( ty, DISALLOWED ) ) . collect ( ) ;
1806
1806
let mk_tup = |this : & mut Self , tys, span| {
1807
1807
let LoweredNodeId { node_id, hir_id } = this. next_id ( ) ;
1808
- hir:: Ty { node : hir:: TyTup ( tys) , id : node_id, hir_id, span }
1808
+ hir:: Ty { node : hir:: TyKind :: Tup ( tys) , id : node_id, hir_id, span }
1809
1809
} ;
1810
1810
1811
1811
(
@@ -1985,7 +1985,7 @@ impl<'a> LoweringContext<'a> {
1985
1985
1986
1986
fn visit_ty ( & mut self , t : & ' v hir:: Ty ) {
1987
1987
// Don't collect elided lifetimes used inside of `fn()` syntax
1988
- if let & hir:: Ty_ :: TyBareFn ( _) = & t. node {
1988
+ if let & hir:: TyKind :: BareFn ( _) = & t. node {
1989
1989
let old_collect_elided_lifetimes = self . collect_elided_lifetimes ;
1990
1990
self . collect_elided_lifetimes = false ;
1991
1991
@@ -2105,7 +2105,7 @@ impl<'a> LoweringContext<'a> {
2105
2105
P ( hir:: Ty {
2106
2106
id : node_id,
2107
2107
hir_id : hir_id,
2108
- node : hir:: TyTup ( hir_vec ! [ ] ) ,
2108
+ node : hir:: TyKind :: Tup ( hir_vec ! [ ] ) ,
2109
2109
span : * span,
2110
2110
} )
2111
2111
}
@@ -4624,7 +4624,7 @@ impl<'a> LoweringContext<'a> {
4624
4624
let mut id = id;
4625
4625
let node = match qpath {
4626
4626
hir:: QPath :: Resolved ( None , path) => {
4627
- // Turn trait object paths into `TyTraitObject ` instead.
4627
+ // Turn trait object paths into `TyKind::TraitObject ` instead.
4628
4628
if let Def :: Trait ( _) = path. def {
4629
4629
let principal = hir:: PolyTraitRef {
4630
4630
bound_generic_params : hir:: HirVec :: new ( ) ,
@@ -4638,12 +4638,12 @@ impl<'a> LoweringContext<'a> {
4638
4638
// The original ID is taken by the `PolyTraitRef`,
4639
4639
// so the `Ty` itself needs a different one.
4640
4640
id = self . next_id ( ) ;
4641
- hir:: TyTraitObject ( hir_vec ! [ principal] , self . elided_dyn_bound ( span) )
4641
+ hir:: TyKind :: TraitObject ( hir_vec ! [ principal] , self . elided_dyn_bound ( span) )
4642
4642
} else {
4643
- hir:: TyPath ( hir:: QPath :: Resolved ( None , path) )
4643
+ hir:: TyKind :: Path ( hir:: QPath :: Resolved ( None , path) )
4644
4644
}
4645
4645
}
4646
- _ => hir:: TyPath ( qpath) ,
4646
+ _ => hir:: TyKind :: Path ( qpath) ,
4647
4647
} ;
4648
4648
hir:: Ty {
4649
4649
id : id. node_id ,
0 commit comments