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:
parent
2627e9f301
commit
2d633317f3
31 changed files with 123 additions and 35 deletions
|
@ -1626,6 +1626,12 @@ impl<'a> State<'a> {
|
|||
self.word("box ");
|
||||
self.print_pat(inner);
|
||||
}
|
||||
PatKind::Deref(inner) => {
|
||||
self.word("deref!");
|
||||
self.popen();
|
||||
self.print_pat(inner);
|
||||
self.pclose();
|
||||
}
|
||||
PatKind::Ref(inner, mutbl) => {
|
||||
self.word("&");
|
||||
if mutbl.is_mut() {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue