diff options
| author | Michael Woerister <michaelwoerister@gmail> | 2013-08-07 14:29:29 +0200 |
|---|---|---|
| committer | Michael Woerister <michaelwoerister@gmail> | 2013-08-07 14:30:00 +0200 |
| commit | 2c9922aa491f406d0a17631ef2f0bfc0bbf85346 (patch) | |
| tree | 67a8dd9e22edd3a57bcd5961e031ab6548605bd1 /src/test/compile-fail | |
| parent | 4da1cfe92369725b2e6bf34acb1fdebdbaff9339 (diff) | |
| download | rust-2c9922aa491f406d0a17631ef2f0bfc0bbf85346.tar.gz rust-2c9922aa491f406d0a17631ef2f0bfc0bbf85346.zip | |
Enable privacy check for enum methods.
Diffstat (limited to 'src/test/compile-fail')
| -rw-r--r-- | src/test/compile-fail/xc-private-method.rs | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/src/test/compile-fail/xc-private-method.rs b/src/test/compile-fail/xc-private-method.rs index e8777a0a9f2..8314755af3b 100644 --- a/src/test/compile-fail/xc-private-method.rs +++ b/src/test/compile-fail/xc-private-method.rs @@ -4,5 +4,13 @@ extern mod xc_private_method_lib; fn main() { - let _ = xc_private_method_lib::Foo::new(); //~ ERROR function `new` is private + // normal method on struct + let _ = xc_private_method_lib::Struct{ x: 10 }.meth_struct(); //~ ERROR method `meth_struct` is private + // static method on struct + let _ = xc_private_method_lib::Struct::static_meth_struct(); //~ ERROR function `static_meth_struct` is private + + // normal method on enum + let _ = xc_private_method_lib::Variant1(20).meth_enum(); //~ ERROR method `meth_enum` is private + // static method on enum + let _ = xc_private_method_lib::Enum::static_meth_enum(); //~ ERROR function `static_meth_enum` is private } |
