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

Stop using `box PAT` syntax for deref patterns, as it's misleading and
also causes their semantics being tangled up.
This commit is contained in:
Michael Goulet 2024-03-20 16:53:50 -04:00
parent fb1b198cea
commit bc0965e2ff
6 changed files with 11 additions and 3 deletions

View file

@ -689,6 +689,11 @@ impl<'a, 'tcx> PrintVisitor<'a, 'tcx> {
kind!("Box({pat})");
self.pat(pat);
},
PatKind::Deref(pat) => {
bind!(self, pat);
kind!("Deref({pat})");
self.pat(pat);
},
PatKind::Ref(pat, muta) => {
bind!(self, pat);
kind!("Ref({pat}, Mutability::{muta:?})");