diff options
| author | Matthias Krüger <matthias.krueger@famsik.de> | 2024-11-27 22:23:26 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-11-27 22:23:26 +0100 |
| commit | 5fc4f85f60f9b1169bddf62d4f23340d81f14a0a (patch) | |
| tree | 02afdff8e02e17028859a3dea79ec0302a935762 /tests | |
| parent | 5d0ee56e883249bee1ead06d3476cd054c388c4b (diff) | |
| parent | 48b2bbd0dedae98abf7a124dfa409efb5554e7a3 (diff) | |
Rollup merge of #133521 - compiler-errors:structurally-resolve-cat-proj, r=lcnr
Structurally resolve before matching on type of projection Another missing structural resolve in closure upvar analysis. I think it's better to place the normalization here rather than trying to guarantee that all types returned by the expr use visitor are structurally normalized, which I don't think we do now. Thoughts? r? lcnr
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/ui/traits/next-solver/typeck/resolve-before-checking-builtin-ptr.rs | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/tests/ui/traits/next-solver/typeck/resolve-before-checking-builtin-ptr.rs b/tests/ui/traits/next-solver/typeck/resolve-before-checking-builtin-ptr.rs new file mode 100644 index 00000000000..d47f705a8ab --- /dev/null +++ b/tests/ui/traits/next-solver/typeck/resolve-before-checking-builtin-ptr.rs @@ -0,0 +1,20 @@ +//@ check-pass +//@ compile-flags: -Znext-solver + +trait Mirror { + type Assoc; +} +impl<T> Mirror for T { + type Assoc = T; +} + +struct Place { + field: <&'static [u8] as Mirror>::Assoc, +} + +fn main() { + let local = Place { field: &[] }; + let z = || { + let y = &local.field[0]; + }; +} |
