rust/tests/ui/pattern/deref-patterns
dianne 36ff87e90e EUV: fix place of deref pattern's interior's scrutinee
The place previously used here was that of the temporary holding the
reference returned by `Deref::deref` or `DerefMut::deref_mut`. However,
since the inner pattern of `deref!(inner)` expects the deref-target type
itself, this would ICE when that type was inspected (e.g. by the EUV
case for slice patterns). This adds a deref projection to fix that.

Since current in-tree consumers of EUV (upvar inference and clippy)
don't care about Rvalues, the place could be simplified to
`self.cat_rvalue(pat.hir_id, self.pat_ty_adjusted(subpat)?)` to save
some cycles. I personally find EUV to be a bit fragile, so I've opted
for pedantic correctness. Maybe a `HACK` comment would suffice though?
2025-03-13 01:01:26 -07:00
..
bindings.rs
branch.rs
cant_move_out_of_pattern.rs
cant_move_out_of_pattern.stderr
closure_capture.rs
dont-ice-on-slice-in-deref-pat-in-closure.rs EUV: fix place of deref pattern's interior's scrutinee 2025-03-13 01:01:26 -07:00
fake_borrows.rs
fake_borrows.stderr
ref-mut.rs
ref-mut.stderr
typeck.rs
typeck_fail.rs
typeck_fail.stderr