Skip to content

Commit 0a0aa11

Browse files
committed
Add comment noting that this naive approach is not too naive.
1 parent 0b1d5f0 commit 0a0aa11

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

src/librustc_privacy/lib.rs

+3
Original file line numberDiff line numberDiff line change
@@ -898,6 +898,9 @@ impl<'a, 'tcx, 'v> Visitor<'v> for PrivacyVisitor<'a, 'tcx> {
898898
ast::ExprStruct(_, ref fields, _) => {
899899
match ty::expr_ty(self.tcx, expr).sty {
900900
ty::ty_struct(ctor_id, _) => {
901+
// RFC 736: ensure all unmentioned fields are visible.
902+
// Rather than computing the set of unmentioned fields
903+
// (i.e. `all_fields - fields`), just check them all.
901904
let all_fields = ty::lookup_struct_fields(self.tcx, ctor_id);
902905
for field in all_fields {
903906
self.check_field(expr.span, ctor_id,

0 commit comments

Comments
 (0)