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