rust/tests/ui/traits/method-private.rs
2025-11-27 11:19:00 -05:00

21 lines
292 B
Rust

//@ edition:2015
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;
foo.method(); //~ ERROR is private
}