rust/tests/ui/shadowed/shadowed-trait-methods.rs
2025-11-27 11:19:00 -05:00

15 lines
259 B
Rust

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