rust/tests/ui/shadowed/shadowed-trait-methods.rs
2023-01-11 09:32:08 +00:00

15 lines
235 B
Rust

// Test that methods from shadowed traits cannot be used
mod foo {
pub trait T { fn f(&self) {} }
impl T for () {}
}
mod bar { pub use foo::T; }
fn main() {
pub use bar::*;
struct T;
().f() //~ ERROR no method
}