]> git.lizzy.rs Git - rust.git/blob - tests/ui/issues/issue-20413.rs
Rollup merge of #106144 - tgross35:patch-1, r=Mark-Simulacrum
[rust.git] / tests / ui / issues / issue-20413.rs
1 // normalize-stderr-test: "long-type-\d+" -> "long-type-hash"
2 trait Foo {
3     fn answer(self);
4 }
5
6 struct NoData<T>;
7 //~^ ERROR: parameter `T` is never used
8
9 impl<T> Foo for T where NoData<T>: Foo {
10   //~^ ERROR: overflow evaluating the requirement
11   fn answer(self) {
12     let val: NoData<T> = NoData;
13   }
14 }
15
16 trait Bar {
17     fn answer(self);
18 }
19
20 trait Baz {
21     fn answer(self);
22 }
23
24 struct AlmostNoData<T>(Option<T>);
25
26 struct EvenLessData<T>(Option<T>);
27
28 impl<T> Bar for T where EvenLessData<T>: Baz {
29 //~^ ERROR: overflow evaluating the requirement
30   fn answer(self) {
31     let val: EvenLessData<T> = EvenLessData(None);
32   }
33 }
34
35 impl<T> Baz for T where AlmostNoData<T>: Bar {
36 //~^ ERROR: overflow evaluating the requirement
37   fn answer(self) {
38     let val: NoData<T> = AlmostNoData(None);
39   }
40 }
41
42 fn main() {}