2018-01-11 02:57:56 +00:00
|
|
|
#![feature(specialization)]
|
2020-06-16 08:06:35 +00:00
|
|
|
//~^ WARN the feature `specialization` is incomplete
|
2018-01-11 02:57:56 +00:00
|
|
|
|
|
|
|
trait Iterate<'a> {
|
|
|
|
type Ty: Valid;
|
|
|
|
fn iterate(self);
|
|
|
|
}
|
|
|
|
impl<'a, T> Iterate<'a> for T where T: Check {
|
|
|
|
default type Ty = ();
|
2020-05-30 16:21:25 +00:00
|
|
|
//~^ ERROR the trait bound `(): Valid` is not satisfied
|
2018-01-11 02:57:56 +00:00
|
|
|
default fn iterate(self) {}
|
|
|
|
}
|
|
|
|
|
|
|
|
trait Check {}
|
|
|
|
impl<'a, T> Check for T where <T as Iterate<'a>>::Ty: Valid {}
|
|
|
|
|
|
|
|
trait Valid {}
|
|
|
|
|
|
|
|
fn main() {
|
|
|
|
Iterate::iterate(0);
|
|
|
|
}
|