summaryrefslogtreecommitdiffstats
path: root/tests/ui/issues/issue-20413.rs
blob: 4de22f0c9177d4f90ff06e7dd667c043ac29aeca (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
// normalize-stderr-test: "long-type-\d+" -> "long-type-hash"
trait Foo {
    fn answer(self);
}

struct NoData<T>;
//~^ ERROR: parameter `T` is never used

impl<T> Foo for T where NoData<T>: Foo {
  //~^ ERROR: overflow evaluating the requirement
  fn answer(self) {
    let val: NoData<T> = NoData;
  }
}

trait Bar {
    fn answer(self);
}

trait Baz {
    fn answer(self);
}

struct AlmostNoData<T>(Option<T>);

struct EvenLessData<T>(Option<T>);

impl<T> Bar for T where EvenLessData<T>: Baz {
//~^ ERROR: overflow evaluating the requirement
  fn answer(self) {
    let val: EvenLessData<T> = EvenLessData(None);
  }
}

impl<T> Baz for T where AlmostNoData<T>: Bar {
//~^ ERROR: overflow evaluating the requirement
  fn answer(self) {
    let val: NoData<T> = AlmostNoData(None);
  }
}

fn main() {}