mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-25 11:17:13 +00:00
Remove the optimization of builtin attrs in is_inside_macro_call()
`#[cfg_attr]` is a builtin attr, but it may still contain a macro.
This commit is contained in:
parent
6acff6c1f8
commit
cc50868148
@ -25,7 +25,6 @@ use hir_expand::{
|
||||
builtin::{BuiltinFnLikeExpander, EagerExpander},
|
||||
db::ExpandDatabase,
|
||||
files::{FileRangeWrapper, HirFileRange, InRealFile},
|
||||
inert_attr_macro::find_builtin_attr_idx,
|
||||
mod_path::{ModPath, PathKind},
|
||||
name::AsName,
|
||||
};
|
||||
@ -953,13 +952,6 @@ impl<'db> SemanticsImpl<'db> {
|
||||
let Some(item) = ast::Item::cast(ancestor) else {
|
||||
return false;
|
||||
};
|
||||
// Optimization to skip the semantic check.
|
||||
if item.attrs().all(|attr| {
|
||||
attr.simple_name()
|
||||
.is_some_and(|attr| find_builtin_attr_idx(&Symbol::intern(&attr)).is_some())
|
||||
}) {
|
||||
return false;
|
||||
}
|
||||
self.with_ctx(|ctx| {
|
||||
if ctx.item_to_macro_call(token.with_value(&item)).is_some() {
|
||||
return true;
|
||||
|
Loading…
x
Reference in New Issue
Block a user