diff options
| author | Michael Goulet <michael@errs.io> | 2025-01-03 05:01:14 +0000 |
|---|---|---|
| committer | Michael Goulet <michael@errs.io> | 2025-01-03 05:01:14 +0000 |
| commit | 2d602ea7931ca6988a34567d9255a10c09d0e17e (patch) | |
| tree | 162e73434158f2a8dfdded085ce36f262f419b0e /tests/ui/traits/unconstrained-projection-normalization-2.rs | |
| parent | ab3924b298eb78bf4c96cf7e6b5824f8debbf2b9 (diff) | |
| download | rust-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.rs | 17 |
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() {} |
