2024-05-04 12:57:01 -04:00
|
|
|
//@ compile-flags: -Znext-solver
|
|
|
|
|
|
|
|
|
|
trait Foo {}
|
|
|
|
|
trait Bar {}
|
|
|
|
|
trait Constrain {
|
|
|
|
|
type Output;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
impl<T, U> Foo for T
|
|
|
|
|
where
|
|
|
|
|
T: Constrain<Output = U>,
|
|
|
|
|
U: Bar,
|
|
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
impl Constrain for () {
|
|
|
|
|
type Output = ();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
fn needs_foo<T: Foo>() {}
|
|
|
|
|
fn main() {
|
|
|
|
|
needs_foo::<()>();
|
2025-04-05 19:19:56 +03:00
|
|
|
//~^ ERROR the trait bound `(): Foo` is not satisfied
|
2024-05-04 12:57:01 -04:00
|
|
|
}
|