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 {
|
||||
let registered = self.registered_attrs.iter().map(SmolStr::as_str);
|
||||
let is_inert = builtin_attr::INERT_ATTRIBUTES
|
||||
.iter()
|
||||
.map(|it| it.name)
|
||||
.chain(registered)
|
||||
.any(pred);
|
||||
let mut registered = self.registered_attrs.iter().map(SmolStr::as_str);
|
||||
let is_inert =
|
||||
builtin_attr::find_builtin_attr_idx(&name).is_some() || registered.any(pred);
|
||||
return is_inert;
|
||||
}
|
||||
}
|
||||
|
@ -2697,9 +2697,7 @@ impl BuiltinAttr {
|
||||
}
|
||||
|
||||
fn builtin(name: &str) -> Option<Self> {
|
||||
hir_def::builtin_attr::INERT_ATTRIBUTES
|
||||
.iter()
|
||||
.position(|tool| tool.name == name)
|
||||
hir_def::builtin_attr::find_builtin_attr_idx(name)
|
||||
.map(|idx| BuiltinAttr { krate: None, idx: idx as u32 })
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user