1
Fork 0

rustc_metadata: Make attribute decoding slightly faster and stricter

Rename `CStore::item_attrs` -> `CStore::item_attrs_untracked` top follow conventions
This commit is contained in:
Vadim Petrochenkov 2022-01-06 12:13:41 +08:00
parent 636fd495c8
commit 4c6120c386
4 changed files with 24 additions and 22 deletions

View file

@ -895,8 +895,11 @@ impl<'a> Resolver<'a> {
// a note about editions
let note = if let Some(did) = did {
let requires_note = !did.is_local()
&& this.cstore().item_attrs(did, this.session).iter().any(
|attr| {
&& this
.cstore()
.item_attrs_untracked(did, this.session)
.iter()
.any(|attr| {
if attr.has_name(sym::rustc_diagnostic_item) {
[sym::TryInto, sym::TryFrom, sym::FromIterator]
.map(|x| Some(x))
@ -904,8 +907,7 @@ impl<'a> Resolver<'a> {
} else {
false
}
},
);
});
requires_note.then(|| {
format!(

View file

@ -3420,7 +3420,7 @@ impl<'a> Resolver<'a> {
let attr = self
.cstore()
.item_attrs(def_id, self.session)
.item_attrs_untracked(def_id, self.session)
.into_iter()
.find(|a| a.has_name(sym::rustc_legacy_const_generics))?;
let mut ret = Vec::new();