rust/tests/ui/issues/issue-20413.rs

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

43 lines
805 B
Rust
Raw Normal View History

// normalize-stderr-test: "long-type-\d+" -> "long-type-hash"
trait Foo {
2021-05-10 10:18:55 +00:00
fn answer(self);
}
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
fn answer(self) {
let val: NoData<T> = NoData;
}
}
trait Bar {
2021-05-10 10:18:55 +00:00
fn answer(self);
}
trait Baz {
2021-05-10 10:18:55 +00:00
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() {}