@@ -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 }
@@ -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
0 commit comments