diff options
author | Veetaha <[email protected]> | 2020-01-22 10:38:25 +0000 |
---|---|---|
committer | Veetaha <[email protected]> | 2020-01-22 11:02:21 +0000 |
commit | b6be1b6f6122c0a6bdfa18813870a197a4be51bf (patch) | |
tree | 643a4fb82bcc9c1cd7d5131ddf58f1fe89d31b1d /crates/ra_syntax | |
parent | 3ec781d4f2e2e3087a99b7ace21f97a84b7c7b84 (diff) |
Preserved a comment on the bug previously present in ast::Literal::kind()
Diffstat (limited to 'crates/ra_syntax')
-rw-r--r-- | crates/ra_syntax/src/ast/expr_extensions.rs | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/crates/ra_syntax/src/ast/expr_extensions.rs b/crates/ra_syntax/src/ast/expr_extensions.rs index e609e02dc..c91dd2bf4 100644 --- a/crates/ra_syntax/src/ast/expr_extensions.rs +++ b/crates/ra_syntax/src/ast/expr_extensions.rs | |||
@@ -322,6 +322,11 @@ impl ast::Literal { | |||
322 | 322 | ||
323 | match token.kind() { | 323 | match token.kind() { |
324 | INT_NUMBER => { | 324 | INT_NUMBER => { |
325 | // FYI: there was a bug here previously, thus an if statement here is necessary. | ||
326 | // The lexer treated e.g. `1f64` as an integer literal. See | ||
327 | // https://github.com/rust-analyzer/rust-analyzer/issues/1592 | ||
328 | // and the comments on the linked PR. | ||
329 | |||
325 | let text = token.text(); | 330 | let text = token.text(); |
326 | 331 | ||
327 | if let suffix @ Some(_) = Self::find_suffix(&text, &FLOAT_SUFFIXES) { | 332 | if let suffix @ Some(_) = Self::find_suffix(&text, &FLOAT_SUFFIXES) { |