diff options
Diffstat (limited to 'tests/ui/error-codes/E0609-private-method.rs')
-rw-r--r-- | tests/ui/error-codes/E0609-private-method.rs | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/tests/ui/error-codes/E0609-private-method.rs b/tests/ui/error-codes/E0609-private-method.rs new file mode 100644 index 000000000..dfa97ad9a --- /dev/null +++ b/tests/ui/error-codes/E0609-private-method.rs @@ -0,0 +1,16 @@ +// This error is an E0609 and *not* an E0615 because the fact that the method exists is not +// relevant. +mod foo { + pub struct Foo { + x: u32, + } + + impl Foo { + fn method(&self) {} + } +} + +fn main() { + let f = foo::Foo { x: 0 }; + f.method; //~ ERROR E0609 +} |