about summary refs log tree commit diff
path: root/compiler/rustc_parse/src/parser/expr.rs
diff options
context:
space:
mode:
authorMatthias Krüger <matthias.krueger@famsik.de>2022-10-01 16:45:05 +0200
committerGitHub <noreply@github.com>2022-10-01 16:45:05 +0200
commitcc009bc5364ec183e47e165c1afeb37e48af9ffe (patch)
tree66aef1f525ca1c9b2b48778facf9f18434876aa5 /compiler/rustc_parse/src/parser/expr.rs
parent21fc2185325fcf6f1a002e4c0c015fecff2ac888 (diff)
parent85a726e7540b801924cfb207e7b5714e00080471 (diff)
downloadrust-cc009bc5364ec183e47e165c1afeb37e48af9ffe.tar.gz
rust-cc009bc5364ec183e47e165c1afeb37e48af9ffe.zip
Rollup merge of #102500 - compiler-errors:parse-sess-cleanup, r=cjgillot
Remove `expr_parentheses_needed` from `ParseSess`

Not sure why this method needed to exist on `ParseSess`, but we can achieve the same behavior by just inlining it everywhere.
Diffstat (limited to 'compiler/rustc_parse/src/parser/expr.rs')
-rw-r--r--compiler/rustc_parse/src/parser/expr.rs2
1 files changed, 1 insertions, 1 deletions
diff --git a/compiler/rustc_parse/src/parser/expr.rs b/compiler/rustc_parse/src/parser/expr.rs
index 8b328e593ae..11301f03e48 100644
--- a/compiler/rustc_parse/src/parser/expr.rs
+++ b/compiler/rustc_parse/src/parser/expr.rs
@@ -1310,7 +1310,7 @@ impl<'a> Parser<'a> {
                 // If the input is something like `if a { 1 } else { 2 } | if a { 3 } else { 4 }`
                 // then suggest parens around the lhs.
                 if let Some(sp) = self.sess.ambiguous_block_expr_parse.borrow().get(&lo) {
-                    self.sess.expr_parentheses_needed(&mut err, *sp);
+                    err.subdiagnostic(ExprParenthesesNeeded::surrounding(*sp));
                 }
                 err
             })