summaryrefslogtreecommitdiffstats
path: root/tests/ui/privacy/private-struct-field-ctor.rs
diff options
context:
space:
mode:
Diffstat (limited to 'tests/ui/privacy/private-struct-field-ctor.rs')
-rw-r--r--tests/ui/privacy/private-struct-field-ctor.rs9
1 files changed, 9 insertions, 0 deletions
diff --git a/tests/ui/privacy/private-struct-field-ctor.rs b/tests/ui/privacy/private-struct-field-ctor.rs
new file mode 100644
index 000000000..56e84a751
--- /dev/null
+++ b/tests/ui/privacy/private-struct-field-ctor.rs
@@ -0,0 +1,9 @@
+mod a {
+ pub struct Foo {
+ x: isize
+ }
+}
+
+fn main() {
+ let s = a::Foo { x: 1 }; //~ ERROR field `x` of struct `Foo` is private
+}