diff options
| author | Yuki Okushi <huyuumi.dev@gmail.com> | 2019-01-20 14:51:54 +0900 |
|---|---|---|
| committer | Yuki Okushi <huyuumi.dev@gmail.com> | 2019-01-20 14:51:54 +0900 |
| commit | a4ff1dcc534e9ae132e5b201a8f6e7dd06fbd9ee (patch) | |
| tree | b0a215286a480d863d5d9ac6b295f52b0386bc58 /src/libsyntax/parse | |
| parent | e9af312932baee90d260b41711f7ea95ad51bc07 (diff) | |
| download | rust-a4ff1dcc534e9ae132e5b201a8f6e7dd06fbd9ee.tar.gz rust-a4ff1dcc534e9ae132e5b201a8f6e7dd06fbd9ee.zip | |
Mark incorrect recovered `char` literals as `TyErr` to avoid type errors
Diffstat (limited to 'src/libsyntax/parse')
| -rw-r--r-- | src/libsyntax/parse/mod.rs | 2 | ||||
| -rw-r--r-- | src/libsyntax/parse/token.rs | 3 |
2 files changed, 2 insertions, 3 deletions
diff --git a/src/libsyntax/parse/mod.rs b/src/libsyntax/parse/mod.rs index cbb503f56bc..9e55f359b5e 100644 --- a/src/libsyntax/parse/mod.rs +++ b/src/libsyntax/parse/mod.rs @@ -466,7 +466,7 @@ crate fn lit_token(lit: token::Lit, suf: Option<Symbol>, diag: Option<(Span, &Ha match lit { token::Byte(i) => (true, Some(LitKind::Byte(byte_lit(&i.as_str()).0))), token::Char(i) => (true, Some(LitKind::Char(char_lit(&i.as_str(), diag).0))), - token::Err(i) => (true, Some(LitKind::Char(char_lit(&i.as_str(), diag).0))), + token::Err(i) => (true, Some(LitKind::Err(i))), // There are some valid suffixes for integer and float literals, // so all the handling is done internally. diff --git a/src/libsyntax/parse/token.rs b/src/libsyntax/parse/token.rs index 99041fd7cd6..f06e975a6d9 100644 --- a/src/libsyntax/parse/token.rs +++ b/src/libsyntax/parse/token.rs @@ -473,8 +473,7 @@ impl Token { Le | EqEq | Ne | Ge | AndAnd | OrOr | Tilde | BinOpEq(..) | At | DotDotDot | DotDotEq | Comma | Semi | ModSep | RArrow | LArrow | FatArrow | Pound | Dollar | - Question | OpenDelim(..) | CloseDelim(..) => return None, - + Question | OpenDelim(..) | CloseDelim(..) | Literal(..) | Ident(..) | Lifetime(..) | Interpolated(..) | DocComment(..) | Whitespace | Comment | Shebang(..) | Eof => return None, }) |
