rust/tests/ui/traits/method-private.rs

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

21 lines
275 B
Rust
Raw Normal View History

mod inner {
pub trait Bar {
fn method(&self);
}
pub struct Foo;
impl Foo {
fn method(&self) {}
}
impl Bar for Foo {
fn method(&self) {}
}
}
fn main() {
let foo = inner::Foo;
2017-11-20 12:13:27 +00:00
foo.method(); //~ ERROR is private
}