2022-11-16 21:09:57 -06:00
|
|
|
// normalize-stderr-test: "long-type-\d+" -> "long-type-hash"
|
2015-05-12 04:02:47 -05:00
|
|
|
trait Foo {
|
2021-05-10 05:18:55 -05:00
|
|
|
fn answer(self);
|
2015-05-12 04:02:47 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
struct NoData<T>;
|
|
|
|
//~^ ERROR: parameter `T` is never used
|
|
|
|
|
|
|
|
impl<T> Foo for T where NoData<T>: Foo {
|
2019-02-23 16:25:30 -06:00
|
|
|
//~^ ERROR: overflow evaluating the requirement
|
2020-01-29 18:55:37 -06:00
|
|
|
fn answer(self) {
|
2015-05-12 04:02:47 -05:00
|
|
|
let val: NoData<T> = NoData;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2020-11-18 10:33:27 -06:00
|
|
|
trait Bar {
|
2021-05-10 05:18:55 -05:00
|
|
|
fn answer(self);
|
2020-11-18 10:33:27 -06:00
|
|
|
}
|
|
|
|
|
|
|
|
trait Baz {
|
2021-05-10 05:18:55 -05:00
|
|
|
fn answer(self);
|
2020-11-18 10:33:27 -06:00
|
|
|
}
|
|
|
|
|
|
|
|
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);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2015-05-12 04:02:47 -05:00
|
|
|
fn main() {}
|