about summary refs log tree commit diff
diff options
context:
space:
mode:
authorFelix S. Klock II <pnkfelix@pnkfx.org>2015-02-10 15:45:36 +0100
committerFelix S. Klock II <pnkfelix@pnkfx.org>2015-02-10 15:45:36 +0100
commit0a0aa11bb1551ef3c0eda2a93d94077ba76b5150 (patch)
tree5882df2e197da70d0e7e2128878098cc3d35f94c
parent0b1d5f01828fdb21e31071d149618d2e983342c5 (diff)
downloadrust-0a0aa11bb1551ef3c0eda2a93d94077ba76b5150.tar.gz
rust-0a0aa11bb1551ef3c0eda2a93d94077ba76b5150.zip
Add comment noting that this naive approach is not too naive.
-rw-r--r--src/librustc_privacy/lib.rs3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/librustc_privacy/lib.rs b/src/librustc_privacy/lib.rs
index 4afe8fe7878..96e146fc894 100644
--- a/src/librustc_privacy/lib.rs
+++ b/src/librustc_privacy/lib.rs
@@ -898,6 +898,9 @@ impl<'a, 'tcx, 'v> Visitor<'v> for PrivacyVisitor<'a, 'tcx> {
             ast::ExprStruct(_, ref fields, _) => {
                 match ty::expr_ty(self.tcx, expr).sty {
                     ty::ty_struct(ctor_id, _) => {
+                        // RFC 736: ensure all unmentioned fields are visible.
+                        // Rather than computing the set of unmentioned fields
+                        // (i.e. `all_fields - fields`), just check them all.
                         let all_fields = ty::lookup_struct_fields(self.tcx, ctor_id);
                         for field in all_fields {
                             self.check_field(expr.span, ctor_id,