about summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
authorLukas Wirth <lukastw97@gmail.com>2025-03-27 08:12:29 +0000
committerGitHub <noreply@github.com>2025-03-27 08:12:29 +0000
commit5aeb82f6677dca53318d9a633cecb590c024aa4a (patch)
treebfa1ee986f6f3a260ebbc7f37109862abb5bf7c5 /src
parentf3f6f868443f68bab7306980e92bb6d8909e8666 (diff)
parent27ece57615cc6fbf727af86f73d449535307a13b (diff)
downloadrust-5aeb82f6677dca53318d9a633cecb590c024aa4a.tar.gz
rust-5aeb82f6677dca53318d9a633cecb590c024aa4a.zip
Merge pull request #19460 from Veykril/push-krmvxxvrlmyx
fix: Fix `format_args` lowering using wrong integer suffix
Diffstat (limited to 'src')
-rw-r--r--src/tools/rust-analyzer/crates/hir-def/src/expr_store/lower.rs3
-rw-r--r--src/tools/rust-analyzer/crates/hir-def/src/expr_store/tests.rs2
2 files changed, 3 insertions, 2 deletions
diff --git a/src/tools/rust-analyzer/crates/hir-def/src/expr_store/lower.rs b/src/tools/rust-analyzer/crates/hir-def/src/expr_store/lower.rs
index 86f31dcaf00..8059023f0bb 100644
--- a/src/tools/rust-analyzer/crates/hir-def/src/expr_store/lower.rs
+++ b/src/tools/rust-analyzer/crates/hir-def/src/expr_store/lower.rs
@@ -2400,7 +2400,8 @@ impl ExprCollector<'_> {
             Some(FormatCount::Literal(n)) => {
                 let args = self.alloc_expr_desugared(Expr::Literal(Literal::Uint(
                     *n as u128,
-                    Some(BuiltinUint::Usize),
+                    // FIXME: Change this to Some(BuiltinUint::U16) once we drop support for toolchains < 1.88
+                    None,
                 )));
                 let count_is = match LangItem::FormatCount.ty_rel_path(
                     self.db,
diff --git a/src/tools/rust-analyzer/crates/hir-def/src/expr_store/tests.rs b/src/tools/rust-analyzer/crates/hir-def/src/expr_store/tests.rs
index a6fcfaa445e..55b95eb8754 100644
--- a/src/tools/rust-analyzer/crates/hir-def/src/expr_store/tests.rs
+++ b/src/tools/rust-analyzer/crates/hir-def/src/expr_store/tests.rs
@@ -216,7 +216,7 @@ fn main() {
                         8u32,
                         builtin#lang(Count::Implied),
                         builtin#lang(Count::Is)(
-                            2usize,
+                            2,
                         ),
                     ), builtin#lang(Placeholder::new)(
                         1usize,