@@ -222,30 +222,31 @@ impl<'a> LoweringContext<'a> {
222
222
}
223
223
224
224
fn lower_ty ( & mut self , t : & Ty ) -> P < hir:: Ty > {
225
- use syntax:: ast:: TyKind :: * ;
226
225
P ( hir:: Ty {
227
226
id : t. id ,
228
227
node : match t. node {
229
- Infer | ImplicitSelf => hir:: TyInfer ,
230
- Vec ( ref ty) => hir:: TyVec ( self . lower_ty ( ty) ) ,
231
- Ptr ( ref mt) => hir:: TyPtr ( self . lower_mt ( mt) ) ,
232
- Rptr ( ref region, ref mt) => {
228
+ TyKind :: Infer | TyKind :: ImplicitSelf => hir:: TyInfer ,
229
+ TyKind :: Slice ( ref ty) => hir:: TySlice ( self . lower_ty ( ty) ) ,
230
+ TyKind :: Ptr ( ref mt) => hir:: TyPtr ( self . lower_mt ( mt) ) ,
231
+ TyKind :: Rptr ( ref region, ref mt) => {
233
232
hir:: TyRptr ( self . lower_opt_lifetime ( region) , self . lower_mt ( mt) )
234
233
}
235
- BareFn ( ref f) => {
234
+ TyKind :: BareFn ( ref f) => {
236
235
hir:: TyBareFn ( P ( hir:: BareFnTy {
237
236
lifetimes : self . lower_lifetime_defs ( & f. lifetimes ) ,
238
237
unsafety : self . lower_unsafety ( f. unsafety ) ,
239
238
abi : f. abi ,
240
239
decl : self . lower_fn_decl ( & f. decl ) ,
241
240
} ) )
242
241
}
243
- Never => hir:: TyNever ,
244
- Tup ( ref tys) => hir:: TyTup ( tys. iter ( ) . map ( |ty| self . lower_ty ( ty) ) . collect ( ) ) ,
245
- Paren ( ref ty) => {
242
+ TyKind :: Never => hir:: TyNever ,
243
+ TyKind :: Tup ( ref tys) => {
244
+ hir:: TyTup ( tys. iter ( ) . map ( |ty| self . lower_ty ( ty) ) . collect ( ) )
245
+ }
246
+ TyKind :: Paren ( ref ty) => {
246
247
return self . lower_ty ( ty) ;
247
248
}
248
- Path ( ref qself, ref path) => {
249
+ TyKind :: Path ( ref qself, ref path) => {
249
250
let qself = qself. as_ref ( ) . map ( |& QSelf { ref ty, position } | {
250
251
hir:: QSelf {
251
252
ty : self . lower_ty ( ty) ,
@@ -254,22 +255,22 @@ impl<'a> LoweringContext<'a> {
254
255
} ) ;
255
256
hir:: TyPath ( qself, self . lower_path ( path) )
256
257
}
257
- ObjectSum ( ref ty, ref bounds) => {
258
+ TyKind :: ObjectSum ( ref ty, ref bounds) => {
258
259
hir:: TyObjectSum ( self . lower_ty ( ty) , self . lower_bounds ( bounds) )
259
260
}
260
- FixedLengthVec ( ref ty, ref e) => {
261
- hir:: TyFixedLengthVec ( self . lower_ty ( ty) , self . lower_expr ( e) )
261
+ TyKind :: Array ( ref ty, ref e) => {
262
+ hir:: TyArray ( self . lower_ty ( ty) , self . lower_expr ( e) )
262
263
}
263
- Typeof ( ref expr) => {
264
+ TyKind :: Typeof ( ref expr) => {
264
265
hir:: TyTypeof ( self . lower_expr ( expr) )
265
266
}
266
- PolyTraitRef ( ref bounds) => {
267
+ TyKind :: PolyTraitRef ( ref bounds) => {
267
268
hir:: TyPolyTraitRef ( self . lower_bounds ( bounds) )
268
269
}
269
- ImplTrait ( ref bounds) => {
270
+ TyKind :: ImplTrait ( ref bounds) => {
270
271
hir:: TyImplTrait ( self . lower_bounds ( bounds) )
271
272
}
272
- Mac ( _) => panic ! ( "TyMac should have been expanded by now." ) ,
273
+ TyKind :: Mac ( _) => panic ! ( "TyMac should have been expanded by now." ) ,
273
274
} ,
274
275
span : t. span ,
275
276
} )
@@ -891,8 +892,8 @@ impl<'a> LoweringContext<'a> {
891
892
PatKind :: Range ( ref e1, ref e2) => {
892
893
hir:: PatKind :: Range ( self . lower_expr ( e1) , self . lower_expr ( e2) )
893
894
}
894
- PatKind :: Vec ( ref before, ref slice, ref after) => {
895
- hir:: PatKind :: Vec ( before. iter ( ) . map ( |x| self . lower_pat ( x) ) . collect ( ) ,
895
+ PatKind :: Slice ( ref before, ref slice, ref after) => {
896
+ hir:: PatKind :: Slice ( before. iter ( ) . map ( |x| self . lower_pat ( x) ) . collect ( ) ,
896
897
slice. as_ref ( ) . map ( |x| self . lower_pat ( x) ) ,
897
898
after. iter ( ) . map ( |x| self . lower_pat ( x) ) . collect ( ) )
898
899
}
@@ -1031,7 +1032,7 @@ impl<'a> LoweringContext<'a> {
1031
1032
}
1032
1033
1033
1034
ExprKind :: Vec ( ref exprs) => {
1034
- hir:: ExprVec ( exprs. iter ( ) . map ( |x| self . lower_expr ( x) ) . collect ( ) )
1035
+ hir:: ExprArray ( exprs. iter ( ) . map ( |x| self . lower_expr ( x) ) . collect ( ) )
1035
1036
}
1036
1037
ExprKind :: Repeat ( ref expr, ref count) => {
1037
1038
let expr = self . lower_expr ( expr) ;
0 commit comments