Fix precedence of postfix match
This commit is contained in:
parent
36b6f9b58e
commit
ab821aed0c
@ -1276,7 +1276,8 @@ pub fn precedence(&self) -> ExprPrecedence {
|
||||
ExprKind::While(..) => ExprPrecedence::While,
|
||||
ExprKind::ForLoop { .. } => ExprPrecedence::ForLoop,
|
||||
ExprKind::Loop(..) => ExprPrecedence::Loop,
|
||||
ExprKind::Match(..) => ExprPrecedence::Match,
|
||||
ExprKind::Match(_, _, MatchKind::Prefix) => ExprPrecedence::Match,
|
||||
ExprKind::Match(_, _, MatchKind::Postfix) => ExprPrecedence::PostfixMatch,
|
||||
ExprKind::Closure(..) => ExprPrecedence::Closure,
|
||||
ExprKind::Block(..) => ExprPrecedence::Block,
|
||||
ExprKind::TryBlock(..) => ExprPrecedence::TryBlock,
|
||||
|
@ -281,6 +281,7 @@ pub enum ExprPrecedence {
|
||||
ForLoop,
|
||||
Loop,
|
||||
Match,
|
||||
PostfixMatch,
|
||||
ConstBlock,
|
||||
Block,
|
||||
TryBlock,
|
||||
@ -334,7 +335,8 @@ pub fn order(self) -> i8 {
|
||||
| ExprPrecedence::InlineAsm
|
||||
| ExprPrecedence::Mac
|
||||
| ExprPrecedence::FormatArgs
|
||||
| ExprPrecedence::OffsetOf => PREC_POSTFIX,
|
||||
| ExprPrecedence::OffsetOf
|
||||
| ExprPrecedence::PostfixMatch => PREC_POSTFIX,
|
||||
|
||||
// Never need parens
|
||||
ExprPrecedence::Array
|
||||
|
Loading…
Reference in New Issue
Block a user