about summary refs log tree commit diff
path: root/tests/ui/error-codes/ex-E0611.rs
diff options
context:
space:
mode:
Diffstat (limited to 'tests/ui/error-codes/ex-E0611.rs')
-rw-r--r--tests/ui/error-codes/ex-E0611.rs12
1 files changed, 12 insertions, 0 deletions
diff --git a/tests/ui/error-codes/ex-E0611.rs b/tests/ui/error-codes/ex-E0611.rs
new file mode 100644
index 00000000000..f18a3619f31
--- /dev/null
+++ b/tests/ui/error-codes/ex-E0611.rs
@@ -0,0 +1,12 @@
+mod a {
+    pub struct Foo(u32);
+
+    impl Foo {
+        pub fn new() -> Foo { Foo(0) }
+    }
+}
+
+fn main() {
+   let y = a::Foo::new();
+   y.0; //~ ERROR field `0` of struct `Foo` is private
+}