diff --git a/crates/proc-macro-srv/src/server.rs b/crates/proc-macro-srv/src/server.rs index af50e1b70d..ed9d770505 100644 --- a/crates/proc-macro-srv/src/server.rs +++ b/crates/proc-macro-srv/src/server.rs @@ -78,8 +78,8 @@ fn literal_to_external(literal_kind: ast::LiteralKind) -> Option bridge::LitKind::Integer, - ast::LiteralKind::FloatNumber(num) => bridge::LitKind::Float, + ast::LiteralKind::IntNumber(_) => bridge::LitKind::Integer, + ast::LiteralKind::FloatNumber(_) => bridge::LitKind::Float, ast::LiteralKind::Char(_) => bridge::LitKind::Char, ast::LiteralKind::Byte(_) => bridge::LitKind::Byte, ast::LiteralKind::Bool(_) => unreachable!(), diff --git a/crates/proc-macro-srv/src/server/rust_analyzer_span.rs b/crates/proc-macro-srv/src/server/rust_analyzer_span.rs index dce4c60b2f..1b883c87ea 100644 --- a/crates/proc-macro-srv/src/server/rust_analyzer_span.rs +++ b/crates/proc-macro-srv/src/server/rust_analyzer_span.rs @@ -77,11 +77,11 @@ impl server::FreeFunctions for RaSpanServer { // FIXME: handle more than just int and float suffixes let suffix = match literal.kind() { - ast::LiteralKind::FloatNumber(num) => num.suffix(), - ast::LiteralKind::IntNumber(num) => num.suffix(), + ast::LiteralKind::FloatNumber(num) => num.suffix().map(ToString::to_string), + ast::LiteralKind::IntNumber(num) => num.suffix().map(ToString::to_string), _ => None, } - .map(|suffix| Symbol::intern(self.interner, suffix)); + .map(|suffix| Symbol::intern(self.interner, &suffix)); Ok(bridge::Literal { kind, diff --git a/crates/proc-macro-srv/src/server/token_id.rs b/crates/proc-macro-srv/src/server/token_id.rs index b237522874..7d2781d89f 100644 --- a/crates/proc-macro-srv/src/server/token_id.rs +++ b/crates/proc-macro-srv/src/server/token_id.rs @@ -69,11 +69,11 @@ impl server::FreeFunctions for TokenIdServer { // FIXME: handle more than just int and float suffixes let suffix = match literal.kind() { - ast::LiteralKind::FloatNumber(num) => num.suffix(), - ast::LiteralKind::IntNumber(num) => num.suffix(), + ast::LiteralKind::FloatNumber(num) => num.suffix().map(ToString::to_string), + ast::LiteralKind::IntNumber(num) => num.suffix().map(ToString::to_string), _ => None, } - .map(|suffix| Symbol::intern(self.interner, suffix)); + .map(|suffix| Symbol::intern(self.interner, &suffix)); Ok(bridge::Literal { kind,