@@ -67,14 +67,15 @@ impl<'a> Visitor<'a> for ItemLowerer<'a, '_, '_> {
6767 if let Some ( hir_id) = item_hir_id {
6868 self . lctx . with_parent_item_lifetime_defs ( hir_id, |this| {
6969 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) ) ;
7273 this. lctx
7374 . diagnostic ( )
7475 . span_err ( item. span , "const trait impls are not yet implemented" ) ;
7576 }
7677
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) ) ;
7879 } else {
7980 visit:: walk_item ( this, item) ;
8081 }
@@ -118,7 +119,7 @@ impl<'hir> LoweringContext<'_, 'hir> {
118119 let old_len = self . in_scope_lifetimes . len ( ) ;
119120
120121 let parent_generics = match self . items . get ( & parent_hir_id) . unwrap ( ) . kind {
121- hir:: ItemKind :: Impl ( _ , _ , _ , ref generics, ..)
122+ hir:: ItemKind :: Impl { ref generics, .. }
122123 | hir:: ItemKind :: Trait ( _, _, ref generics, ..) => & generics. params [ ..] ,
123124 _ => & [ ] ,
124125 } ;
@@ -173,7 +174,7 @@ impl<'hir> LoweringContext<'_, 'hir> {
173174 vec
174175 }
175176 ItemKind :: MacroDef ( ..) => SmallVec :: new ( ) ,
176- ItemKind :: Fn ( ..) | ItemKind :: Impl ( .. , None , _ , _ ) => smallvec ! [ i. id] ,
177+ ItemKind :: Fn ( ..) | ItemKind :: Impl { of_trait : None , .. } => smallvec ! [ i. id] ,
177178 ItemKind :: Static ( ref ty, ..) => {
178179 let mut ids = smallvec ! [ i. id] ;
179180 if self . sess . features_untracked ( ) . impl_trait_in_bindings {
@@ -361,15 +362,15 @@ impl<'hir> LoweringContext<'_, 'hir> {
361362 self . lower_generics ( generics, ImplTraitContext :: disallowed ( ) ) ,
362363 )
363364 }
364- ItemKind :: Impl (
365+ ItemKind :: Impl {
365366 unsafety,
366367 polarity,
367368 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+ } => {
373374 let def_id = self . resolver . definitions ( ) . local_def_id ( id) ;
374375
375376 // Lower the "impl header" first. This ordering is important
@@ -417,15 +418,15 @@ impl<'hir> LoweringContext<'_, 'hir> {
417418 )
418419 } ) ;
419420
420- hir:: ItemKind :: Impl (
421+ hir:: ItemKind :: Impl {
421422 unsafety,
422423 polarity,
423- self . lower_defaultness ( defaultness, true /* [1] */ ) ,
424+ defaultness : self . lower_defaultness ( defaultness, true /* [1] */ ) ,
424425 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+ }
429430 }
430431 ItemKind :: Trait ( is_auto, unsafety, ref generics, ref bounds, ref items) => {
431432 let bounds = self . lower_param_bounds ( bounds, ImplTraitContext :: disallowed ( ) ) ;
0 commit comments