rustc_metadata: Switch all decoder methods from vectors to iterators

Also remove unnecessary `is_proc_macro_crate` checks from decoder
This commit is contained in:
Vadim Petrochenkov 2021-12-24 14:57:21 +08:00
parent a0984b4e4c
commit 4549b13571
5 changed files with 66 additions and 87 deletions

View file

@ -914,11 +914,8 @@ 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_untracked(did, this.session)
.iter()
.any(|attr| {
&& this.cstore().item_attrs_untracked(did, this.session).any(
|attr| {
if attr.has_name(sym::rustc_diagnostic_item) {
[sym::TryInto, sym::TryFrom, sym::FromIterator]
.map(|x| Some(x))
@ -926,7 +923,8 @@ impl<'a> Resolver<'a> {
} else {
false
}
});
},
);
requires_note.then(|| {
format!(