blob: 138a235e675e375f588bf4bc3d27bcc606023249 (
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
|
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() {}
|