File tree 2 files changed +10
-0
lines changed
2 files changed +10
-0
lines changed Original file line number Diff line number Diff line change @@ -34,6 +34,15 @@ macro_rules! rustc_attr {
34
34
} ;
35
35
}
36
36
37
+ // FIXME: We shouldn't special case these at all, but as of now expanding attributes severely degrades
38
+ // user experience due to lacking support. Hence only expand(not ignore) these in tests for now.
39
+ /// Built-in macro-like attributes.
40
+ #[ cfg( test) ]
41
+ pub const EXTRA_ATTRIBUTES : & [ BuiltinAttribute ] = & [ "test" , "bench" ] ;
42
+ /// Built-in macro-like attributes.
43
+ #[ cfg( not( test) ) ]
44
+ pub const EXTRA_ATTRIBUTES : & [ BuiltinAttribute ] = & [ ] ;
45
+
37
46
/// "Inert" built-in attributes that have a special meaning to rustc or rustdoc.
38
47
#[ rustfmt:: skip]
39
48
pub const INERT_ATTRIBUTES : & [ BuiltinAttribute ] = & [
Original file line number Diff line number Diff line change @@ -1732,6 +1732,7 @@ impl ModCollector<'_, '_> {
1732
1732
let name = name. to_string ( ) ;
1733
1733
let is_inert = builtin_attr:: INERT_ATTRIBUTES
1734
1734
. iter ( )
1735
+ . chain ( builtin_attr:: EXTRA_ATTRIBUTES )
1735
1736
. copied ( )
1736
1737
. chain ( self . def_collector . registered_attrs . iter ( ) . map ( AsRef :: as_ref) )
1737
1738
. any ( |attr| name == * attr) ;
You can’t perform that action at this time.
0 commit comments