summaryrefslogtreecommitdiffstats
path: root/src/test/ui/traits/method-private.rs
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--src/test/ui/traits/method-private.rs20
1 files changed, 20 insertions, 0 deletions
diff --git a/src/test/ui/traits/method-private.rs b/src/test/ui/traits/method-private.rs
new file mode 100644
index 000000000..4cd184854
--- /dev/null
+++ b/src/test/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
+}