about summary refs log tree commit diff
path: root/src/libsyntax/parse
diff options
context:
space:
mode:
authorMazdak Farrokhzad <twingoow@gmail.com>2019-06-18 01:28:20 +0200
committerMazdak Farrokhzad <twingoow@gmail.com>2019-06-23 01:29:29 +0200
commit851066f57e19b645e2dd33392ee7f822cbb2e374 (patch)
treef87ee3c3ecf6ec822e06cae2a4cf8cf11b815425 /src/libsyntax/parse
parent7465eb44f0288da9b48c86881b9e88e73d8f27dd (diff)
downloadrust-851066f57e19b645e2dd33392ee7f822cbb2e374.tar.gz
rust-851066f57e19b645e2dd33392ee7f822cbb2e374.zip
let_chains: Fix bugs in pretty printing.
Diffstat (limited to 'src/libsyntax/parse')
-rw-r--r--src/libsyntax/parse/parser.rs4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/libsyntax/parse/parser.rs b/src/libsyntax/parse/parser.rs
index 65936345fe1..b2003e2d6bd 100644
--- a/src/libsyntax/parse/parser.rs
+++ b/src/libsyntax/parse/parser.rs
@@ -41,7 +41,7 @@ use crate::parse::lexer::UnmatchedBrace;
 use crate::parse::lexer::comments::{doc_comment_style, strip_doc_comment_decoration};
 use crate::parse::token::{Token, TokenKind, DelimToken};
 use crate::parse::{new_sub_parser_from_file, ParseSess, Directory, DirectoryOwnership};
-use crate::util::parser::{AssocOp, Fixity};
+use crate::util::parser::{AssocOp, Fixity, prec_let_scrutinee_needs_par};
 use crate::print::pprust;
 use crate::ptr::P;
 use crate::parse::PResult;
@@ -3208,7 +3208,7 @@ impl<'a> Parser<'a> {
         self.expect(&token::Eq)?;
         let expr = self.with_res(
             Restrictions::NO_STRUCT_LITERAL,
-            |this| this.parse_assoc_expr_with(1 + AssocOp::LAnd.precedence(), None.into())
+            |this| this.parse_assoc_expr_with(1 + prec_let_scrutinee_needs_par(), None.into())
         )?;
         let span = lo.to(expr.span);
         self.sess.let_chains_spans.borrow_mut().push(span);