rust/tests/ui/privacy/private-method-inherited.rs

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

15 lines
222 B
Rust
Raw Normal View History

// Tests that inherited visibility applies to methods.
mod a {
pub struct Foo;
impl Foo {
fn f(self) {}
}
}
fn main() {
let x = a::Foo;
2020-03-05 03:03:15 +00:00
x.f(); //~ ERROR associated function `f` is private
}