From b6be1b6f6122c0a6bdfa18813870a197a4be51bf Mon Sep 17 00:00:00 2001 From: Veetaha Date: Wed, 22 Jan 2020 12:38:25 +0200 Subject: Preserved a comment on the bug previously present in ast::Literal::kind() --- crates/ra_syntax/src/ast/expr_extensions.rs | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'crates/ra_syntax/src/ast/expr_extensions.rs') 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 { match token.kind() { INT_NUMBER => { + // FYI: there was a bug here previously, thus an if statement here is necessary. + // The lexer treated e.g. `1f64` as an integer literal. See + // https://github.com/rust-analyzer/rust-analyzer/issues/1592 + // and the comments on the linked PR. + let text = token.text(); if let suffix @ Some(_) = Self::find_suffix(&text, &FLOAT_SUFFIXES) { -- cgit v1.2.3