]> git.proxmox.com Git - rustc.git/blob - tests/ui/specialization/issue-38091-2.rs
New upstream version 1.68.2+dfsg1
[rustc.git] / tests / ui / specialization / issue-38091-2.rs
1 // build-fail
2 //~^ ERROR overflow evaluating the requirement `i32: Check`
3
4 #![feature(specialization)]
5 //~^ WARN the feature `specialization` is incomplete
6
7 trait Iterate<'a> {
8 type Ty: Valid;
9 fn iterate(self);
10 }
11 impl<'a, T> Iterate<'a> for T
12 where
13 T: Check,
14 {
15 default type Ty = ();
16 default fn iterate(self) {}
17 }
18
19 trait Check {}
20 impl<'a, T> Check for T where <T as Iterate<'a>>::Ty: Valid {}
21
22 trait Valid {}
23
24 impl Valid for () {}
25
26 fn main() {
27 Iterate::iterate(0);
28 }