From 205a8278a9da4bc1289449b916468e972fb624fc Mon Sep 17 00:00:00 2001 From: csmoe Date: Fri, 7 Jun 2019 19:49:49 +0800 Subject: fix: never type with binding Change-Id: I14e1bc628b9d2dfdb1f40de3d3707f4e872767f2 --- crates/ra_parser/src/grammar/expressions.rs | 4 +++- crates/ra_parser/src/parser.rs | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) (limited to 'crates/ra_parser') diff --git a/crates/ra_parser/src/grammar/expressions.rs b/crates/ra_parser/src/grammar/expressions.rs index 99e32c4e8..795dccea1 100644 --- a/crates/ra_parser/src/grammar/expressions.rs +++ b/crates/ra_parser/src/grammar/expressions.rs @@ -137,12 +137,14 @@ pub(super) fn stmt(p: &mut Parser, with_semi: StmtWithSemi) { m.complete(p, EXPR_STMT); } - // test let_stmt; + // test let_stmt // fn foo() { // let a; // let b: i32; // let c = 92; // let d: i32 = 92; + // let e: !; + // let _: ! = {}; // } fn let_stmt(p: &mut Parser, m: Marker, with_semi: StmtWithSemi) { assert!(p.at(T![let])); diff --git a/crates/ra_parser/src/parser.rs b/crates/ra_parser/src/parser.rs index 8f654f04c..8a2e253ac 100644 --- a/crates/ra_parser/src/parser.rs +++ b/crates/ra_parser/src/parser.rs @@ -272,7 +272,7 @@ impl<'t> Parser<'t> { T![=] if jn1 && la2 == T![=] => Some((T![==], 2)), T![=] if jn1 && la2 == T![>] => Some((T![=>], 2)), - T![!] if la2 == T![=] => Some((T![!=], 2)), + T![!] if jn1 && la2 == T![=] => Some((T![!=], 2)), T![-] if la2 == T![>] => Some((T![->], 2)), _ => None, } -- cgit v1.2.3