Skip to content

Commit 250fb72

Browse files
committed
No need to collect result of get_item_attrs
1 parent 675059a commit 250fb72

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

compiler/rustc_metadata/src/rmeta/decoder.rs

+2-3
Original file line numberDiff line numberDiff line change
@@ -1133,9 +1133,8 @@ impl<'a, 'tcx> CrateMetadataRef<'a> {
11331133
// within the crate. We only need this for fictive constructors,
11341134
// for other constructors correct visibilities
11351135
// were already encoded in metadata.
1136-
let attrs: Vec<_> =
1137-
self.get_item_attrs(def_id.index, sess).collect();
1138-
if sess.contains_name(&attrs, sym::non_exhaustive) {
1136+
let mut attrs = self.get_item_attrs(def_id.index, sess);
1137+
if attrs.any(|item| item.has_name(sym::non_exhaustive)) {
11391138
let crate_def_id = self.local_def_id(CRATE_DEF_INDEX);
11401139
vis = ty::Visibility::Restricted(crate_def_id);
11411140
}

0 commit comments

Comments
 (0)