rust/tests/ui/traits/alias/ambiguous.rs

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

25 lines
345 B
Rust
Raw Normal View History

#![feature(trait_alias)]
mod inner {
pub trait A { fn foo(&self); }
pub trait B { fn foo(&self); }
impl A for u8 {
fn foo(&self) {}
}
impl B for u8 {
fn foo(&self) {}
}
pub trait C = A + B;
}
use inner::C;
fn main() {
let t = 1u8;
t.foo(); //~ ERROR E0034
inner::A::foo(&t); // ok
}