summaryrefslogtreecommitdiffstats
path: root/src/test/ui/privacy/private-method-inherited.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/test/ui/privacy/private-method-inherited.rs')
-rw-r--r--src/test/ui/privacy/private-method-inherited.rs14
1 files changed, 14 insertions, 0 deletions
diff --git a/src/test/ui/privacy/private-method-inherited.rs b/src/test/ui/privacy/private-method-inherited.rs
new file mode 100644
index 000000000..2f6454288
--- /dev/null
+++ b/src/test/ui/privacy/private-method-inherited.rs
@@ -0,0 +1,14 @@
+// Tests that inherited visibility applies to methods.
+
+mod a {
+ pub struct Foo;
+
+ impl Foo {
+ fn f(self) {}
+ }
+}
+
+fn main() {
+ let x = a::Foo;
+ x.f(); //~ ERROR associated function `f` is private
+}