1
Fork 0

Rollup merge of #122793 - compiler-errors:deref-pat-syntax, r=Nadrieril

Implement macro-based deref!() syntax for deref patterns

Stop using `box PAT` syntax for deref patterns, and instead use a perma-unstable macro.

Blocked on #122222

r? `@Nadrieril`
This commit is contained in:
Matthias Krüger 2024-03-21 17:46:50 +01:00 committed by GitHub
commit 9cd11c4335
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
32 changed files with 125 additions and 36 deletions

View file

@ -1179,7 +1179,7 @@ impl<'tcx> fmt::Display for Pat<'tcx> {
write!(f, "{subpattern}")
}
PatKind::DerefPattern { ref subpattern } => {
write!(f, "k#deref {subpattern}")
write!(f, "deref!({subpattern})")
}
PatKind::Constant { value } => write!(f, "{value}"),
PatKind::InlineConstant { def: _, ref subpattern } => {