@@ -222,30 +222,29 @@ 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:: TySlice ( 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) => hir:: TyTup ( tys. iter ( ) . map ( |ty| self . lower_ty ( ty) ) . collect ( ) ) ,
244
+ TyKind :: Paren ( ref ty) => {
246
245
return self . lower_ty ( ty) ;
247
246
}
248
- Path ( ref qself, ref path) => {
247
+ TyKind :: Path ( ref qself, ref path) => {
249
248
let qself = qself. as_ref ( ) . map ( |& QSelf { ref ty, position } | {
250
249
hir:: QSelf {
251
250
ty : self . lower_ty ( ty) ,
@@ -254,22 +253,22 @@ impl<'a> LoweringContext<'a> {
254
253
} ) ;
255
254
hir:: TyPath ( qself, self . lower_path ( path) )
256
255
}
257
- ObjectSum ( ref ty, ref bounds) => {
256
+ TyKind :: ObjectSum ( ref ty, ref bounds) => {
258
257
hir:: TyObjectSum ( self . lower_ty ( ty) , self . lower_bounds ( bounds) )
259
258
}
260
- FixedLengthVec ( ref ty, ref e) => {
259
+ TyKind :: Array ( ref ty, ref e) => {
261
260
hir:: TyArray ( self . lower_ty ( ty) , self . lower_expr ( e) )
262
261
}
263
- Typeof ( ref expr) => {
262
+ TyKind :: Typeof ( ref expr) => {
264
263
hir:: TyTypeof ( self . lower_expr ( expr) )
265
264
}
266
- PolyTraitRef ( ref bounds) => {
265
+ TyKind :: PolyTraitRef ( ref bounds) => {
267
266
hir:: TyPolyTraitRef ( self . lower_bounds ( bounds) )
268
267
}
269
- ImplTrait ( ref bounds) => {
268
+ TyKind :: ImplTrait ( ref bounds) => {
270
269
hir:: TyImplTrait ( self . lower_bounds ( bounds) )
271
270
}
272
- Mac ( _) => panic ! ( "TyMac should have been expanded by now." ) ,
271
+ TyKind :: Mac ( _) => panic ! ( "TyMac should have been expanded by now." ) ,
273
272
} ,
274
273
span : t. span ,
275
274
} )
@@ -891,7 +890,7 @@ impl<'a> LoweringContext<'a> {
891
890
PatKind :: Range ( ref e1, ref e2) => {
892
891
hir:: PatKind :: Range ( self . lower_expr ( e1) , self . lower_expr ( e2) )
893
892
}
894
- PatKind :: Vec ( ref before, ref slice, ref after) => {
893
+ PatKind :: Slice ( ref before, ref slice, ref after) => {
895
894
hir:: PatKind :: Slice ( before. iter ( ) . map ( |x| self . lower_pat ( x) ) . collect ( ) ,
896
895
slice. as_ref ( ) . map ( |x| self . lower_pat ( x) ) ,
897
896
after. iter ( ) . map ( |x| self . lower_pat ( x) ) . collect ( ) )
0 commit comments