about summary refs log tree commit diff
path: root/tests/ui/traits/method-private.rs
diff options
context:
space:
mode:
Diffstat (limited to 'tests/ui/traits/method-private.rs')
-rw-r--r--tests/ui/traits/method-private.rs20
1 files changed, 20 insertions, 0 deletions
diff --git a/tests/ui/traits/method-private.rs b/tests/ui/traits/method-private.rs
new file mode 100644
index 00000000000..4cd184854ec
--- /dev/null
+++ b/tests/ui/traits/method-private.rs
@@ -0,0 +1,20 @@
+mod inner {
+    pub trait Bar {
+        fn method(&self);
+    }
+
+    pub struct Foo;
+
+    impl Foo {
+        fn method(&self) {}
+    }
+
+    impl Bar for Foo {
+        fn method(&self) {}
+    }
+}
+
+fn main() {
+    let foo = inner::Foo;
+    foo.method(); //~ ERROR is private
+}