Skip to content

Commit b6be1b6

Browse files
author
Veetaha
committed
Preserved a comment on the bug previously present in ast::Literal::kind()
1 parent 3ec781d commit b6be1b6

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

crates/ra_syntax/src/ast/expr_extensions.rs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -322,6 +322,11 @@ impl ast::Literal {
322322

323323
match token.kind() {
324324
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+
325330
let text = token.text();
326331

327332
if let suffix @ Some(_) = Self::find_suffix(&text, &FLOAT_SUFFIXES) {

0 commit comments

Comments
 (0)