summaryrefslogtreecommitdiffstats
path: root/src/test/ui/issues/issue-20413.rs
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--src/test/ui/issues/issue-20413.rs41
1 files changed, 41 insertions, 0 deletions
diff --git a/src/test/ui/issues/issue-20413.rs b/src/test/ui/issues/issue-20413.rs
new file mode 100644
index 000000000..138a235e6
--- /dev/null
+++ b/src/test/ui/issues/issue-20413.rs
@@ -0,0 +1,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() {}