mirror of
https://github.com/rust-lang/rust.git
synced 2024-12-01 19:23:50 +00:00
25 lines
345 B
Rust
25 lines
345 B
Rust
#![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
|
|
}
|