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

17 lines
213 B
Rust
Raw Normal View History

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