Skip to content

Commit 99e67f8

Browse files
bors[bot]Veykril
andauthored
Merge #10044
10044: minor: Ignore text and bench attributes again r=Veykril a=Veykril Reverts part of #9943 Co-authored-by: Lukas Wirth <[email protected]>
2 parents 97409e5 + 798c539 commit 99e67f8

File tree

2 files changed

+6
-0
lines changed

2 files changed

+6
-0
lines changed

crates/hir_def/src/builtin_attr.rs

+5
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,11 @@ macro_rules! rustc_attr {
3434
};
3535
}
3636

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.
39+
/// Built-in macro-like attributes.
40+
pub const EXTRA_ATTRIBUTES: &[BuiltinAttribute] = &["test", "bench"];
41+
3742
/// "Inert" built-in attributes that have a special meaning to rustc or rustdoc.
3843
#[rustfmt::skip]
3944
pub const INERT_ATTRIBUTES: &[BuiltinAttribute] = &[

crates/hir_def/src/nameres/collector.rs

+1
Original file line numberDiff line numberDiff line change
@@ -1732,6 +1732,7 @@ impl ModCollector<'_, '_> {
17321732
let name = name.to_string();
17331733
let is_inert = builtin_attr::INERT_ATTRIBUTES
17341734
.iter()
1735+
.chain(builtin_attr::EXTRA_ATTRIBUTES)
17351736
.copied()
17361737
.chain(self.def_collector.registered_attrs.iter().map(AsRef::as_ref))
17371738
.any(|attr| name == *attr);

0 commit comments

Comments
 (0)