We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 675059a commit 250fb72Copy full SHA for 250fb72
compiler/rustc_metadata/src/rmeta/decoder.rs
@@ -1133,9 +1133,8 @@ impl<'a, 'tcx> CrateMetadataRef<'a> {
1133
// within the crate. We only need this for fictive constructors,
1134
// for other constructors correct visibilities
1135
// 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) {
+ let mut attrs = self.get_item_attrs(def_id.index, sess);
+ if attrs.any(|item| item.has_name(sym::non_exhaustive)) {
1139
let crate_def_id = self.local_def_id(CRATE_DEF_INDEX);
1140
vis = ty::Visibility::Restricted(crate_def_id);
1141
}
0 commit comments