mirror of https://github.com/rust-lang/rust
24 lines
321 B
Rust
24 lines
321 B
Rust
//@ check-pass
|
|
|
|
#![feature(type_alias_impl_trait)]
|
|
trait Foo {
|
|
type Assoc;
|
|
}
|
|
|
|
impl Foo for i32 {
|
|
type Assoc = u32;
|
|
}
|
|
type ImplTrait = impl Sized;
|
|
fn constrain() -> ImplTrait {
|
|
1u64
|
|
}
|
|
impl Foo for i64 {
|
|
type Assoc = ImplTrait;
|
|
}
|
|
|
|
trait Bar<T> {}
|
|
|
|
impl<T: Foo> Bar<<T as Foo>::Assoc> for T {}
|
|
|
|
fn main() {}
|