rust/tests/ui/traits/new-solver/alias-relate/deeply-nested-no-hang.rs

23 lines
428 B
Rust

// check-pass
// compile-flags: -Ztrait-solver=next
// regression test for trait-system-refactor-initiative#68
trait Identity {
type Assoc: ?Sized;
}
impl<T: ?Sized> Identity for T {
type Assoc = T;
}
type Id<T> = <T as Identity>::Assoc;
type Five<T> = Id<Id<Id<Id<Id<T>>>>>;
type Ty<T> = Five<Five<Five<Five<Five<T>>>>>;
trait Trait<T> {}
impl<T> Trait<T> for Ty<T> {}
impl Trait<u32> for Ty<i32> {}
fn main() {}