about summary refs log tree commit diff
path: root/src/libsyntax/parse/parser/expr.rs
diff options
context:
space:
mode:
authorTyler Mandry <tmandry@gmail.com>2019-10-05 21:54:52 -0700
committerGitHub <noreply@github.com>2019-10-05 21:54:52 -0700
commitc7d7e3730aa211bec291f31d5318628411c1ba77 (patch)
treee6daf4f93effaeb87814b30e27582631e895e97c /src/libsyntax/parse/parser/expr.rs
parentae2a720e92f78e76db5b7c1d6308fcd87d5c5281 (diff)
parent76456e74066d7594f23757ebade169c33276ea4d (diff)
downloadrust-c7d7e3730aa211bec291f31d5318628411c1ba77.tar.gz
rust-c7d7e3730aa211bec291f31d5318628411c1ba77.zip
Rollup merge of #64909 - estebank:turbofish-reloaded, r=Centril
When encountering chained operators use heuristics to recover from bad turbofish
Diffstat (limited to 'src/libsyntax/parse/parser/expr.rs')
-rw-r--r--src/libsyntax/parse/parser/expr.rs4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/libsyntax/parse/parser/expr.rs b/src/libsyntax/parse/parser/expr.rs
index 23674ad589d..b459782d237 100644
--- a/src/libsyntax/parse/parser/expr.rs
+++ b/src/libsyntax/parse/parser/expr.rs
@@ -238,7 +238,9 @@ impl<'a> Parser<'a> {
 
             self.bump();
             if op.is_comparison() {
-                self.check_no_chained_comparison(&lhs, &op)?;
+                if let Some(expr) = self.check_no_chained_comparison(&lhs, &op)? {
+                    return Ok(expr);
+                }
             }
             // Special cases:
             if op == AssocOp::As {