diff options
| author | Michael Goulet <michael@errs.io> | 2024-03-20 16:53:50 -0400 |
|---|---|---|
| committer | Michael Goulet <michael@errs.io> | 2024-03-21 11:42:49 -0400 |
| commit | 2d633317f30dd02895f167b65dc1feeee0d08265 (patch) | |
| tree | 50b3622db66615853ae53baa9c54d968f01e413b /compiler/rustc_ast_lowering/src | |
| parent | 2627e9f3012a97d3136b3e11bf6bd0853c38a534 (diff) | |
| download | rust-2d633317f30dd02895f167b65dc1feeee0d08265.tar.gz rust-2d633317f30dd02895f167b65dc1feeee0d08265.zip | |
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.
Diffstat (limited to 'compiler/rustc_ast_lowering/src')
| -rw-r--r-- | compiler/rustc_ast_lowering/src/pat.rs | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/compiler/rustc_ast_lowering/src/pat.rs b/compiler/rustc_ast_lowering/src/pat.rs index 469cdac11e4..8631d90be81 100644 --- a/compiler/rustc_ast_lowering/src/pat.rs +++ b/compiler/rustc_ast_lowering/src/pat.rs @@ -91,6 +91,9 @@ impl<'a, 'hir> LoweringContext<'a, 'hir> { PatKind::Box(inner) => { break hir::PatKind::Box(self.lower_pat(inner)); } + PatKind::Deref(inner) => { + break hir::PatKind::Deref(self.lower_pat(inner)); + } PatKind::Ref(inner, mutbl) => { break hir::PatKind::Ref(self.lower_pat(inner), *mutbl); } |
