2024-02-07 10:42:01 +08:00
|
|
|
//@ check-pass
|
2018-05-18 23:40:44 +01:00
|
|
|
// regression test for issue #50825
|
2018-06-08 17:00:49 +01:00
|
|
|
// Make sure that the `impl` bound (): X<T = ()> is preferred over
|
2018-05-18 23:40:44 +01:00
|
|
|
// the (): X bound in the where clause.
|
|
|
|
|
|
|
|
|
|
trait X {
|
|
|
|
|
type T;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
trait Y<U>: X {
|
|
|
|
|
fn foo(x: &Self::T);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
impl X for () {
|
|
|
|
|
type T = ();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
impl<T> Y<Vec<T>> for () where (): Y<T> {
|
|
|
|
|
fn foo(_x: &()) {}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
fn main () {}
|