rust/tests/ui/shadowed/shadowed-trait-methods.rs

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

15 lines
235 B
Rust
Raw Normal View History

2016-03-07 17:11:46 -06:00
// 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
}