@@ -771,6 +771,7 @@ impl<'hir> LoweringContext<'_, 'hir> {
771771
772772 fn lower_trait_item ( & mut self , i : & AssocItem ) -> & ' hir hir:: TraitItem < ' hir > {
773773 let hir_id = self . lower_node_id ( i. id ) ;
774+ self . lower_attrs ( hir_id, & i. attrs ) ;
774775 let trait_item_def_id = hir_id. expect_owner ( ) ;
775776
776777 let ( generics, kind, has_default) = match & i. kind {
@@ -829,7 +830,6 @@ impl<'hir> LoweringContext<'_, 'hir> {
829830 AssocItemKind :: MacCall ( ..) => panic ! ( "macro item shouldn't exist at this point" ) ,
830831 } ;
831832
832- self . lower_attrs ( hir_id, & i. attrs ) ;
833833 let item = hir:: TraitItem {
834834 owner_id : trait_item_def_id,
835835 ident : self . lower_ident ( i. ident ) ,
@@ -869,6 +869,7 @@ impl<'hir> LoweringContext<'_, 'hir> {
869869 let has_value = true ;
870870 let ( defaultness, _) = self . lower_defaultness ( i. kind . defaultness ( ) , has_value) ;
871871 let hir_id = self . lower_node_id ( i. id ) ;
872+ self . lower_attrs ( hir_id, & i. attrs ) ;
872873
873874 let ( generics, kind) = match & i. kind {
874875 AssocItemKind :: Const ( _, ty, expr) => {
@@ -920,7 +921,6 @@ impl<'hir> LoweringContext<'_, 'hir> {
920921 AssocItemKind :: MacCall ( ..) => panic ! ( "`TyMac` should have been expanded by now" ) ,
921922 } ;
922923
923- self . lower_attrs ( hir_id, & i. attrs ) ;
924924 let item = hir:: ImplItem {
925925 owner_id : hir_id. expect_owner ( ) ,
926926 ident : self . lower_ident ( i. ident ) ,
0 commit comments