rust/src/test/ui/privacy/private-method-inherited.rs
2018-12-25 21:08:33 -07:00

15 lines
209 B
Rust

// 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
}