rust/src/test/compile-fail/private-impl-method.rs

16 lines
190 B
Rust
Raw Normal View History

mod a {
struct Foo {
x: int
}
impl Foo {
priv fn foo() {}
}
}
fn main() {
let s = a::Foo { x: 1 };
s.foo(); //~ ERROR method `foo` is private
}