mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-10-01 11:31:15 +00:00
Use hir_def::builtin_attr::find_builtin_attr_idx
This commit is contained in:
parent
99b69525f4
commit
40c068f502
@ -83,12 +83,9 @@ impl DefMap {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if segments.len() == 1 {
|
if segments.len() == 1 {
|
||||||
let registered = self.registered_attrs.iter().map(SmolStr::as_str);
|
let mut registered = self.registered_attrs.iter().map(SmolStr::as_str);
|
||||||
let is_inert = builtin_attr::INERT_ATTRIBUTES
|
let is_inert =
|
||||||
.iter()
|
builtin_attr::find_builtin_attr_idx(&name).is_some() || registered.any(pred);
|
||||||
.map(|it| it.name)
|
|
||||||
.chain(registered)
|
|
||||||
.any(pred);
|
|
||||||
return is_inert;
|
return is_inert;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -2697,9 +2697,7 @@ impl BuiltinAttr {
|
|||||||
}
|
}
|
||||||
|
|
||||||
fn builtin(name: &str) -> Option<Self> {
|
fn builtin(name: &str) -> Option<Self> {
|
||||||
hir_def::builtin_attr::INERT_ATTRIBUTES
|
hir_def::builtin_attr::find_builtin_attr_idx(name)
|
||||||
.iter()
|
|
||||||
.position(|tool| tool.name == name)
|
|
||||||
.map(|idx| BuiltinAttr { krate: None, idx: idx as u32 })
|
.map(|idx| BuiltinAttr { krate: None, idx: idx as u32 })
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user