about summary refs log tree commit diff
path: root/tests/codegen/const-array.rs
diff options
context:
space:
mode:
authorJacob Pratt <jacob@jhpratt.dev>2025-03-14 01:37:35 -0400
committerGitHub <noreply@github.com>2025-03-14 01:37:35 -0400
commitf5055722b65682815d5f18dd7e08a0e9ee7218aa (patch)
tree3e283cf7ff6d1357021724936f11857ac7dadd86 /tests/codegen/const-array.rs
parent7de35c8bb85170e885c34e2fdb45f95d4125e8f2 (diff)
parent36ff87e90e7f39cffb508292a63792cc0dcfbd6e (diff)
downloadrust-f5055722b65682815d5f18dd7e08a0e9ee7218aa.tar.gz
rust-f5055722b65682815d5f18dd7e08a0e9ee7218aa.zip
Rollup merge of #138442 - dianne:deref-pat-euv-fix, r=compiler-errors
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?

Fixes #125059

r? `@compiler-errors`
Diffstat (limited to 'tests/codegen/const-array.rs')
0 files changed, 0 insertions, 0 deletions