@@ -771,6 +771,7 @@ impl<'hir> LoweringContext<'_, 'hir> {
771
771
772
772
fn lower_trait_item ( & mut self , i : & AssocItem ) -> & ' hir hir:: TraitItem < ' hir > {
773
773
let hir_id = self . lower_node_id ( i. id ) ;
774
+ self . lower_attrs ( hir_id, & i. attrs ) ;
774
775
let trait_item_def_id = hir_id. expect_owner ( ) ;
775
776
776
777
let ( generics, kind, has_default) = match & i. kind {
@@ -829,7 +830,6 @@ impl<'hir> LoweringContext<'_, 'hir> {
829
830
AssocItemKind :: MacCall ( ..) => panic ! ( "macro item shouldn't exist at this point" ) ,
830
831
} ;
831
832
832
- self . lower_attrs ( hir_id, & i. attrs ) ;
833
833
let item = hir:: TraitItem {
834
834
owner_id : trait_item_def_id,
835
835
ident : self . lower_ident ( i. ident ) ,
@@ -869,6 +869,7 @@ impl<'hir> LoweringContext<'_, 'hir> {
869
869
let has_value = true ;
870
870
let ( defaultness, _) = self . lower_defaultness ( i. kind . defaultness ( ) , has_value) ;
871
871
let hir_id = self . lower_node_id ( i. id ) ;
872
+ self . lower_attrs ( hir_id, & i. attrs ) ;
872
873
873
874
let ( generics, kind) = match & i. kind {
874
875
AssocItemKind :: Const ( _, ty, expr) => {
@@ -920,7 +921,6 @@ impl<'hir> LoweringContext<'_, 'hir> {
920
921
AssocItemKind :: MacCall ( ..) => panic ! ( "`TyMac` should have been expanded by now" ) ,
921
922
} ;
922
923
923
- self . lower_attrs ( hir_id, & i. attrs ) ;
924
924
let item = hir:: ImplItem {
925
925
owner_id : hir_id. expect_owner ( ) ,
926
926
ident : self . lower_ident ( i. ident ) ,
0 commit comments