10044: minor: Ignore text and bench attributes again r=Veykril a=Veykril

Reverts part of #9943

Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
This commit is contained in:
bors[bot] 2021-08-27 20:19:56 +00:00 committed by GitHub
commit 99e67f8998
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 6 additions and 0 deletions

View File

@ -34,6 +34,11 @@ macro_rules! rustc_attr {
};
}
// FIXME: We shouldn't special case these at all, but as of now expanding attributes severely degrades
// user experience due to lacking support.
/// Built-in macro-like attributes.
pub const EXTRA_ATTRIBUTES: &[BuiltinAttribute] = &["test", "bench"];
/// "Inert" built-in attributes that have a special meaning to rustc or rustdoc.
#[rustfmt::skip]
pub const INERT_ATTRIBUTES: &[BuiltinAttribute] = &[

View File

@ -1732,6 +1732,7 @@ impl ModCollector<'_, '_> {
let name = name.to_string();
let is_inert = builtin_attr::INERT_ATTRIBUTES
.iter()
.chain(builtin_attr::EXTRA_ATTRIBUTES)
.copied()
.chain(self.def_collector.registered_attrs.iter().map(AsRef::as_ref))
.any(|attr| name == *attr);