about summary refs log tree commit diff
diff options
context:
space:
mode:
authorDylan DPC <99973273+Dylan-DPC@users.noreply.github.com>2022-05-25 17:37:22 +0200
committerGitHub <noreply@github.com>2022-05-25 17:37:22 +0200
commit5d43ae8ecec00ff9f3de843eaa623e990c78f65d (patch)
treef9745bf91a0b96c8c0fca6fce959df1290e2b572
parent8a3ad4942ceb02b7c7182fb45b8d063b7db20ae2 (diff)
parentcca9e63d70ce23d2c042a02fe4ac212ef967784f (diff)
downloadrust-5d43ae8ecec00ff9f3de843eaa623e990c78f65d.tar.gz
rust-5d43ae8ecec00ff9f3de843eaa623e990c78f65d.zip
Rollup merge of #97398 - JohnTitor:issue-82830, r=compiler-errors
Add regression test for #82830

Closes #82830
r? `@compiler-errors`
-rw-r--r--src/test/ui/traits/issue-82830.rs16
-rw-r--r--src/test/ui/traits/issue-82830.stderr15
2 files changed, 31 insertions, 0 deletions
diff --git a/src/test/ui/traits/issue-82830.rs b/src/test/ui/traits/issue-82830.rs
new file mode 100644
index 00000000000..c8289b2e30b
--- /dev/null
+++ b/src/test/ui/traits/issue-82830.rs
@@ -0,0 +1,16 @@
+trait A<Y, N> {
+    type B;
+}
+
+type MaybeBox<T> = <T as A<T, Box<T>>>::B;
+struct P {
+    t: MaybeBox<P>, //~ ERROR: overflow evaluating the requirement `P: Sized`
+}
+
+impl<Y, N> A<Y, N> for P {
+    type B = N;
+}
+
+fn main() {
+    let t: MaybeBox<P>;
+}
diff --git a/src/test/ui/traits/issue-82830.stderr b/src/test/ui/traits/issue-82830.stderr
new file mode 100644
index 00000000000..f863143c738
--- /dev/null
+++ b/src/test/ui/traits/issue-82830.stderr
@@ -0,0 +1,15 @@
+error[E0275]: overflow evaluating the requirement `P: Sized`
+  --> $DIR/issue-82830.rs:7:8
+   |
+LL |     t: MaybeBox<P>,
+   |        ^^^^^^^^^^^
+   |
+note: required because of the requirements on the impl of `A<P, Box<P>>` for `P`
+  --> $DIR/issue-82830.rs:10:12
+   |
+LL | impl<Y, N> A<Y, N> for P {
+   |            ^^^^^^^     ^
+
+error: aborting due to previous error
+
+For more information about this error, try `rustc --explain E0275`.