about summary refs log tree commit diff
path: root/src/librustc_parse
diff options
context:
space:
mode:
authorVadim Petrochenkov <vadim.petrochenkov@gmail.com>2020-02-22 20:19:49 +0300
committerVadim Petrochenkov <vadim.petrochenkov@gmail.com>2020-02-24 13:03:58 +0300
commit59261f0a7cf264f16e2b6a4e87d4249b212e920e (patch)
tree17c829ac5904f8353ef602550d8aedcaf25047c3 /src/librustc_parse
parent79cd224e758f603898b64308e849fbb9be6e6f4d (diff)
downloadrust-59261f0a7cf264f16e2b6a4e87d4249b212e920e.tar.gz
rust-59261f0a7cf264f16e2b6a4e87d4249b212e920e.zip
Add some missing support for `NtIdent`
Diffstat (limited to 'src/librustc_parse')
-rw-r--r--src/librustc_parse/parser/diagnostics.rs7
1 files changed, 3 insertions, 4 deletions
diff --git a/src/librustc_parse/parser/diagnostics.rs b/src/librustc_parse/parser/diagnostics.rs
index 018aef3c13c..09b47df2b19 100644
--- a/src/librustc_parse/parser/diagnostics.rs
+++ b/src/librustc_parse/parser/diagnostics.rs
@@ -13,7 +13,7 @@ use syntax::ast::{
 };
 use syntax::ast::{AttrVec, ItemKind, Mutability, Pat, PatKind, PathSegment, QSelf, Ty, TyKind};
 use syntax::ptr::P;
-use syntax::token::{self, token_can_begin_expr, TokenKind};
+use syntax::token::{self, TokenKind};
 use syntax::util::parser::AssocOp;
 
 use log::{debug, trace};
@@ -900,8 +900,7 @@ impl<'a> Parser<'a> {
         } else if !sm.is_multiline(self.prev_span.until(self.token.span)) {
             // The current token is in the same line as the prior token, not recoverable.
         } else if self.look_ahead(1, |t| {
-            t == &token::CloseDelim(token::Brace)
-                || token_can_begin_expr(t) && t.kind != token::Colon
+            t == &token::CloseDelim(token::Brace) || t.can_begin_expr() && t.kind != token::Colon
         }) && [token::Comma, token::Colon].contains(&self.token.kind)
         {
             // Likely typo: `,` → `;` or `:` → `;`. This is triggered if the current token is
@@ -919,7 +918,7 @@ impl<'a> Parser<'a> {
         } else if self.look_ahead(0, |t| {
             t == &token::CloseDelim(token::Brace)
                 || (
-                    token_can_begin_expr(t) && t != &token::Semi && t != &token::Pound
+                    t.can_begin_expr() && t != &token::Semi && t != &token::Pound
                     // Avoid triggering with too many trailing `#` in raw string.
                 )
         }) {