diff options
Diffstat (limited to 'tests/ui/shadowed/shadowed-trait-methods.rs')
-rw-r--r-- | tests/ui/shadowed/shadowed-trait-methods.rs | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/tests/ui/shadowed/shadowed-trait-methods.rs b/tests/ui/shadowed/shadowed-trait-methods.rs new file mode 100644 index 000000000..f9c25d979 --- /dev/null +++ b/tests/ui/shadowed/shadowed-trait-methods.rs @@ -0,0 +1,14 @@ +// 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 +} |