From 698f8c2f01ea549d77d7dc3338a12e04c11057b9 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Wed, 17 Apr 2024 14:02:58 +0200 Subject: Adding upstream version 1.64.0+dfsg1. Signed-off-by: Daniel Baumann --- src/test/ui/privacy/private-method-inherited.rs | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 src/test/ui/privacy/private-method-inherited.rs (limited to 'src/test/ui/privacy/private-method-inherited.rs') 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 +} -- cgit v1.2.3