1
Fork 0

add and move trait solver cycle tests

This commit is contained in:
lcnr 2023-08-10 12:56:53 +02:00
parent d558353f28
commit 02529d2cbe
21 changed files with 215 additions and 1 deletions

View file

@ -0,0 +1,20 @@
//~ ERROR overflow
// compile-flags: -Ztrait-solver=next
trait Foo1 {
type Assoc1;
}
trait Foo2 {
type Assoc2;
}
trait Bar {}
fn needs_bar<S: Bar>() {}
fn test<T: Foo1<Assoc1 = <T as Foo2>::Assoc2> + Foo2<Assoc2 = <T as Foo1>::Assoc1>>() {
needs_bar::<T::Assoc1>();
//~^ ERROR overflow evaluating the requirement `<T as Foo1>::Assoc1: Bar`
}
fn main() {}