mirror of
https://github.com/rust-lang/rust
synced 2024-11-05 20:45:15 +00:00
14 lines
209 B
Rust
14 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
|
|
}
|