about summary refs log tree commit diff
path: root/tests/ui/traits/unconstrained-projection-normalization-2.rs
diff options
context:
space:
mode:
authorMichael Goulet <michael@errs.io>2025-01-03 05:01:14 +0000
committerMichael Goulet <michael@errs.io>2025-01-03 05:01:14 +0000
commit2d602ea7931ca6988a34567d9255a10c09d0e17e (patch)
tree162e73434158f2a8dfdded085ce36f262f419b0e /tests/ui/traits/unconstrained-projection-normalization-2.rs
parentab3924b298eb78bf4c96cf7e6b5824f8debbf2b9 (diff)
downloadrust-2d602ea7931ca6988a34567d9255a10c09d0e17e.tar.gz
rust-2d602ea7931ca6988a34567d9255a10c09d0e17e.zip
Do not project when there are unconstrained impl params
Diffstat (limited to 'tests/ui/traits/unconstrained-projection-normalization-2.rs')
-rw-r--r--tests/ui/traits/unconstrained-projection-normalization-2.rs17
1 files changed, 17 insertions, 0 deletions
diff --git a/tests/ui/traits/unconstrained-projection-normalization-2.rs b/tests/ui/traits/unconstrained-projection-normalization-2.rs
new file mode 100644
index 00000000000..085e9e4a61a
--- /dev/null
+++ b/tests/ui/traits/unconstrained-projection-normalization-2.rs
@@ -0,0 +1,17 @@
+// Make sure we don't ICE in `normalize_erasing_regions` when normalizing
+// an associated type in an impl with unconstrained non-lifetime params.
+// (This time in a function signature)
+
+struct Thing;
+
+pub trait Every {
+    type Assoc;
+}
+impl<T: ?Sized> Every for Thing {
+//~^ ERROR the type parameter `T` is not constrained
+    type Assoc = T;
+}
+
+fn foo(_: <Thing as Every>::Assoc) {}
+
+fn main() {}