mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-27 17:24:06 +00:00
26 lines
322 B
Rust
26 lines
322 B
Rust
#![feature(trait_alias)]
|
|
|
|
struct B;
|
|
struct C;
|
|
|
|
trait Tr {}
|
|
|
|
impl Tr for B {}
|
|
impl Tr for C {}
|
|
|
|
trait Tr2<S> = Into<S>;
|
|
|
|
fn foo2<T: Tr2<()>>() {}
|
|
|
|
fn foo() -> impl Tr {
|
|
let x = foo2::<_>();
|
|
|
|
match true {
|
|
true => B,
|
|
false => C,
|
|
//~^ `match` arms have incompatible types
|
|
}
|
|
}
|
|
|
|
fn main() {}
|