Skip to content

Commit b404ded

Browse files
committed
Fix failing privacy test
1 parent 8a12c19 commit b404ded

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

src/librustc_privacy/lib.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1439,11 +1439,11 @@ impl<'a, 'tcx, 'v> Visitor<'v> for VisiblePrivateTypesVisitor<'a, 'tcx> {
14391439
}
14401440

14411441
fn visit_struct_field(&mut self, s: &hir::StructField) {
1442-
match s.node.kind {
1443-
hir::NamedField(_, vis) if vis == hir::Public || self.in_variant => {
1444-
visit::walk_struct_field(self, s);
1445-
}
1446-
_ => {}
1442+
let vis = match s.node.kind {
1443+
hir::NamedField(_, vis) | hir::UnnamedField(vis) => vis
1444+
};
1445+
if vis == hir::Public || self.in_variant {
1446+
visit::walk_struct_field(self, s);
14471447
}
14481448
}
14491449

0 commit comments

Comments
 (0)