@@ -67,14 +67,15 @@ impl<'a> Visitor<'a> for ItemLowerer<'a, '_, '_> {
67
67
if let Some ( hir_id) = item_hir_id {
68
68
self . lctx . with_parent_item_lifetime_defs ( hir_id, |this| {
69
69
let this = & mut ItemLowerer { lctx : this } ;
70
- if let ItemKind :: Impl ( .., ref opt_trait_ref, _, _) = item. kind {
71
- if opt_trait_ref. as_ref ( ) . map ( |tr| tr. constness . is_some ( ) ) . unwrap_or ( false ) {
70
+ if let ItemKind :: Impl { ref of_trait, .. } = item. kind {
71
+ if of_trait. as_ref ( ) . map ( |tr| tr. constness . is_some ( ) ) . unwrap_or ( false ) {
72
+ this. with_trait_impl_ref ( of_trait, |this| visit:: walk_item ( this, item) ) ;
72
73
this. lctx
73
74
. diagnostic ( )
74
75
. span_err ( item. span , "const trait impls are not yet implemented" ) ;
75
76
}
76
77
77
- this. with_trait_impl_ref ( opt_trait_ref , |this| visit:: walk_item ( this, item) ) ;
78
+ this. with_trait_impl_ref ( of_trait , |this| visit:: walk_item ( this, item) ) ;
78
79
} else {
79
80
visit:: walk_item ( this, item) ;
80
81
}
@@ -118,7 +119,7 @@ impl<'hir> LoweringContext<'_, 'hir> {
118
119
let old_len = self . in_scope_lifetimes . len ( ) ;
119
120
120
121
let parent_generics = match self . items . get ( & parent_hir_id) . unwrap ( ) . kind {
121
- hir:: ItemKind :: Impl ( _ , _ , _ , ref generics, ..)
122
+ hir:: ItemKind :: Impl { ref generics, .. }
122
123
| hir:: ItemKind :: Trait ( _, _, ref generics, ..) => & generics. params [ ..] ,
123
124
_ => & [ ] ,
124
125
} ;
@@ -173,7 +174,7 @@ impl<'hir> LoweringContext<'_, 'hir> {
173
174
vec
174
175
}
175
176
ItemKind :: MacroDef ( ..) => SmallVec :: new ( ) ,
176
- ItemKind :: Fn ( ..) | ItemKind :: Impl ( .. , None , _ , _ ) => smallvec ! [ i. id] ,
177
+ ItemKind :: Fn ( ..) | ItemKind :: Impl { of_trait : None , .. } => smallvec ! [ i. id] ,
177
178
ItemKind :: Static ( ref ty, ..) => {
178
179
let mut ids = smallvec ! [ i. id] ;
179
180
if self . sess . features_untracked ( ) . impl_trait_in_bindings {
@@ -361,15 +362,15 @@ impl<'hir> LoweringContext<'_, 'hir> {
361
362
self . lower_generics ( generics, ImplTraitContext :: disallowed ( ) ) ,
362
363
)
363
364
}
364
- ItemKind :: Impl (
365
+ ItemKind :: Impl {
365
366
unsafety,
366
367
polarity,
367
368
defaultness,
368
- ref ast_generics,
369
- ref trait_ref,
370
- ref ty,
371
- ref impl_items,
372
- ) => {
369
+ generics : ref ast_generics,
370
+ of_trait : ref trait_ref,
371
+ self_ty : ref ty,
372
+ items : ref impl_items,
373
+ } => {
373
374
let def_id = self . resolver . definitions ( ) . local_def_id ( id) ;
374
375
375
376
// Lower the "impl header" first. This ordering is important
@@ -417,15 +418,15 @@ impl<'hir> LoweringContext<'_, 'hir> {
417
418
)
418
419
} ) ;
419
420
420
- hir:: ItemKind :: Impl (
421
+ hir:: ItemKind :: Impl {
421
422
unsafety,
422
423
polarity,
423
- self . lower_defaultness ( defaultness, true /* [1] */ ) ,
424
+ defaultness : self . lower_defaultness ( defaultness, true /* [1] */ ) ,
424
425
generics,
425
- trait_ref,
426
- lowered_ty,
427
- new_impl_items,
428
- )
426
+ of_trait : trait_ref,
427
+ self_ty : lowered_ty,
428
+ items : new_impl_items,
429
+ }
429
430
}
430
431
ItemKind :: Trait ( is_auto, unsafety, ref generics, ref bounds, ref items) => {
431
432
let bounds = self . lower_param_bounds ( bounds, ImplTraitContext :: disallowed ( ) ) ;
0 commit comments