@@ -5,7 +5,7 @@ use std::io::{Read, Seek, Write};
5
5
use std:: path:: { Path , PathBuf } ;
6
6
use std:: sync:: Arc ;
7
7
8
- use rustc_ast :: attr :: AttributeExt ;
8
+ use rustc_attr_data_structures :: { AttributeKind , EncodeCrossCrate } ;
9
9
use rustc_data_structures:: fx:: { FxIndexMap , FxIndexSet } ;
10
10
use rustc_data_structures:: memmap:: { Mmap , MmapMut } ;
11
11
use rustc_data_structures:: sync:: { join, par_for_each_in} ;
@@ -824,9 +824,13 @@ struct AnalyzeAttrState<'a> {
824
824
/// visibility: this is a piece of data that can be computed once per defid, and not once per
825
825
/// attribute. Some attributes would only be usable downstream if they are public.
826
826
#[ inline]
827
- fn analyze_attr ( attr : & impl AttributeExt , state : & mut AnalyzeAttrState < ' _ > ) -> bool {
827
+ fn analyze_attr ( attr : & hir :: Attribute , state : & mut AnalyzeAttrState < ' _ > ) -> bool {
828
828
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 ( )
830
834
&& !rustc_feature:: encode_cross_crate ( name)
831
835
{
832
836
// Attributes not marked encode-cross-crate don't need to be encoded for downstream crates.
0 commit comments