fix: Fix format_args lowering using wrong integer suffix

This commit is contained in:
Lukas Wirth 2025-03-27 08:55:09 +01:00
parent 042e6d8efb
commit 9a5a11fb30
2 changed files with 3 additions and 2 deletions

View file

@ -2400,7 +2400,8 @@ impl ExprCollector<'_> {
Some(FormatCount::Literal(n)) => { Some(FormatCount::Literal(n)) => {
let args = self.alloc_expr_desugared(Expr::Literal(Literal::Uint( let args = self.alloc_expr_desugared(Expr::Literal(Literal::Uint(
*n as u128, *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( let count_is = match LangItem::FormatCount.ty_rel_path(
self.db, self.db,

View file

@ -216,7 +216,7 @@ fn main() {
8u32, 8u32,
builtin#lang(Count::Implied), builtin#lang(Count::Implied),
builtin#lang(Count::Is)( builtin#lang(Count::Is)(
2usize, 2,
), ),
), builtin#lang(Placeholder::new)( ), builtin#lang(Placeholder::new)(
1usize, 1usize,