about summary refs log tree commit diff
path: root/compiler/rustc_interface/src
diff options
context:
space:
mode:
authordianne <diannes.gm@gmail.com>2025-03-12 23:08:37 -0700
committerdianne <diannes.gm@gmail.com>2025-03-13 01:01:26 -0700
commit36ff87e90e7f39cffb508292a63792cc0dcfbd6e (patch)
treeadb4aa51f09152af238fa2e3aa832ca6114eb23b /compiler/rustc_interface/src
parent0e76f8b7e02b1ddd349dde1501f73426a4e764cf (diff)
downloadrust-36ff87e90e7f39cffb508292a63792cc0dcfbd6e.tar.gz
rust-36ff87e90e7f39cffb508292a63792cc0dcfbd6e.zip
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?
Diffstat (limited to 'compiler/rustc_interface/src')
0 files changed, 0 insertions, 0 deletions