Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions crates/hir_def/src/builtin_attr.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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] = &[
Expand Down
1 change: 1 addition & 0 deletions crates/hir_def/src/nameres/collector.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down