Skip to content

Commit cc50868

Browse files
Remove the optimization of builtin attrs in is_inside_macro_call()
`#[cfg_attr]` is a builtin attr, but it may still contain a macro.
1 parent 6acff6c commit cc50868

File tree

1 file changed

+0
-8
lines changed

1 file changed

+0
-8
lines changed

crates/hir/src/semantics.rs

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@ use hir_expand::{
2525
builtin::{BuiltinFnLikeExpander, EagerExpander},
2626
db::ExpandDatabase,
2727
files::{FileRangeWrapper, HirFileRange, InRealFile},
28-
inert_attr_macro::find_builtin_attr_idx,
2928
mod_path::{ModPath, PathKind},
3029
name::AsName,
3130
};
@@ -953,13 +952,6 @@ impl<'db> SemanticsImpl<'db> {
953952
let Some(item) = ast::Item::cast(ancestor) else {
954953
return false;
955954
};
956-
// Optimization to skip the semantic check.
957-
if item.attrs().all(|attr| {
958-
attr.simple_name()
959-
.is_some_and(|attr| find_builtin_attr_idx(&Symbol::intern(&attr)).is_some())
960-
}) {
961-
return false;
962-
}
963955
self.with_ctx(|ctx| {
964956
if ctx.item_to_macro_call(token.with_value(&item)).is_some() {
965957
return true;

0 commit comments

Comments
 (0)