@@ -5,7 +5,7 @@ use std::io::{Read, Seek, Write};
55use std:: path:: { Path , PathBuf } ;
66use std:: sync:: Arc ;
77
8- use rustc_ast :: attr :: AttributeExt ;
8+ use rustc_attr_data_structures :: { AttributeKind , EncodeCrossCrate } ;
99use rustc_data_structures:: fx:: { FxIndexMap , FxIndexSet } ;
1010use rustc_data_structures:: memmap:: { Mmap , MmapMut } ;
1111use rustc_data_structures:: sync:: { join, par_for_each_in} ;
@@ -824,9 +824,13 @@ struct AnalyzeAttrState<'a> {
824824/// visibility: this is a piece of data that can be computed once per defid, and not once per
825825/// attribute. Some attributes would only be usable downstream if they are public.
826826#[ inline]
827- fn analyze_attr ( attr : & impl AttributeExt , state : & mut AnalyzeAttrState < ' _ > ) -> bool {
827+ fn analyze_attr ( attr : & hir :: Attribute , state : & mut AnalyzeAttrState < ' _ > ) -> bool {
828828 let mut should_encode = false ;
829- if let Some ( name) = attr. name ( )
829+ if let hir:: Attribute :: Parsed ( p) = attr
830+ && p. encode_cross_crate ( ) == EncodeCrossCrate :: No
831+ {
832+ // Attributes not marked encode-cross-crate don't need to be encoded for downstream crates.
833+ } else if let Some ( name) = attr. name ( )
830834 && !rustc_feature:: encode_cross_crate ( name)
831835 {
832836 // Attributes not marked encode-cross-crate don't need to be encoded for downstream crates.
0 commit comments