@@ -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 :: 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} ;
@@ -839,9 +839,13 @@ struct AnalyzeAttrState<'a> {
839
839
/// visibility: this is a piece of data that can be computed once per defid, and not once per
840
840
/// attribute. Some attributes would only be usable downstream if they are public.
841
841
#[ inline]
842
- fn analyze_attr ( attr : & impl AttributeExt , state : & mut AnalyzeAttrState < ' _ > ) -> bool {
842
+ fn analyze_attr ( attr : & hir :: Attribute , state : & mut AnalyzeAttrState < ' _ > ) -> bool {
843
843
let mut should_encode = false ;
844
- if let Some ( name) = attr. name ( )
844
+ if let hir:: Attribute :: Parsed ( p) = attr
845
+ && p. encode_cross_crate ( ) == EncodeCrossCrate :: No
846
+ {
847
+ // Attributes not marked encode-cross-crate don't need to be encoded for downstream crates.
848
+ } else if let Some ( name) = attr. name ( )
845
849
&& !rustc_feature:: encode_cross_crate ( name)
846
850
{
847
851
// Attributes not marked encode-cross-crate don't need to be encoded for downstream crates.
0 commit comments