summary refs log tree commit diff
path: root/tests/ui/pattern/deref-patterns
AgeCommit message (Collapse)AuthorLines
2025-03-13EUV: fix place of deref pattern's interior's scrutineedianne-0/+15
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?
2024-11-25`add_move_error_suggestions`: use a HIR visitor rather than `SourceMap`dianne-0/+10
2024-04-20Test or-patterns inside deref patternsNadrieril-1/+13
2024-04-20Use deep fake borrows for deref patternsNadrieril-0/+26
2024-04-20Address closure-related reviewNadrieril-0/+21
2024-04-20Allow mutable bindings inside deref patternsNadrieril-0/+15
2024-04-20Don't fake borrow inside a deref patternNadrieril-2/+2
2024-04-20Lower deref patterns to MIRNadrieril-6/+174
This handles using deref patterns to choose the correct match arm. This does not handle bindings or guards. Co-authored-by: Deadbeef <ent3rm4n@gmail.com>
2024-03-25Require DerefMut if deref pattern has nested ref mut bindingMichael Goulet-0/+37
2024-03-21Implement macro-based deref!() syntax for deref patternsMichael Goulet-4/+4
Stop using `box PAT` syntax for deref patterns, as it's misleading and also causes their semantics being tangled up.
2024-03-20Add barest-bones deref patternsNadrieril-0/+31
Co-authored-by: Deadbeef <ent3rm4n@gmail.com>