diff options
Diffstat (limited to 'src/test/compile-fail/private-method-inherited.rs')
| -rw-r--r-- | src/test/compile-fail/private-method-inherited.rs | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/src/test/compile-fail/private-method-inherited.rs b/src/test/compile-fail/private-method-inherited.rs new file mode 100644 index 00000000000..7b64623e16c --- /dev/null +++ b/src/test/compile-fail/private-method-inherited.rs @@ -0,0 +1,15 @@ +// 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 method `f` is private +} + |
