2013-02-27 11:20:50 -08:00
|
|
|
// Tests that inherited visibility applies to methods.
|
|
|
|
|
|
|
|
|
|
mod a {
|
|
|
|
|
pub struct Foo;
|
|
|
|
|
|
|
|
|
|
impl Foo {
|
|
|
|
|
fn f(self) {}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
fn main() {
|
|
|
|
|
let x = a::Foo;
|
2023-02-21 14:11:08 -07:00
|
|
|
x.f(); //~ ERROR method `f` is private
|
2013-02-27 11:20:50 -08:00
|
|
|
}
|