diff options
Diffstat (limited to 'compiler')
| -rw-r--r-- | compiler/rustc_ast/src/ast.rs | 3 | ||||
| -rw-r--r-- | compiler/rustc_ast/src/util/parser.rs | 3 | ||||
| -rw-r--r-- | compiler/rustc_hir/src/hir.rs | 3 |
3 files changed, 3 insertions, 6 deletions
diff --git a/compiler/rustc_ast/src/ast.rs b/compiler/rustc_ast/src/ast.rs index 14205f66491..2c9e55e007f 100644 --- a/compiler/rustc_ast/src/ast.rs +++ b/compiler/rustc_ast/src/ast.rs @@ -1317,9 +1317,8 @@ impl Expr { pub fn precedence(&self) -> ExprPrecedence { match self.kind { - ExprKind::Closure(..) => ExprPrecedence::Closure, - ExprKind::Break(..) + | ExprKind::Closure(..) | ExprKind::Continue(..) | ExprKind::Ret(..) | ExprKind::Yield(..) diff --git a/compiler/rustc_ast/src/util/parser.rs b/compiler/rustc_ast/src/util/parser.rs index e88bf27021a..a4f152b4687 100644 --- a/compiler/rustc_ast/src/util/parser.rs +++ b/compiler/rustc_ast/src/util/parser.rs @@ -231,8 +231,7 @@ impl AssocOp { #[derive(Clone, Copy, PartialEq, PartialOrd)] pub enum ExprPrecedence { - Closure, - // return, break, yield + // return, break, yield, closures Jump, // = += -= *= /= %= &= |= ^= <<= >>= Assign, diff --git a/compiler/rustc_hir/src/hir.rs b/compiler/rustc_hir/src/hir.rs index a9696627f11..4524e1cbdf1 100644 --- a/compiler/rustc_hir/src/hir.rs +++ b/compiler/rustc_hir/src/hir.rs @@ -1697,9 +1697,8 @@ pub struct Expr<'hir> { impl Expr<'_> { pub fn precedence(&self) -> ExprPrecedence { match self.kind { - ExprKind::Closure { .. } => ExprPrecedence::Closure, - ExprKind::Break(..) + | ExprKind::Closure { .. } | ExprKind::Continue(..) | ExprKind::Ret(..) | ExprKind::Yield(..) |
