From c582a3007b9caebf4e783cf13ae5841656e4d205 Mon Sep 17 00:00:00 2001 From: daxpedda Date: Thu, 18 Apr 2024 23:41:58 +0200 Subject: [PATCH] Fix MSRV compilation --- CHANGELOG.md | 3 +++ crates/backend/src/codegen.rs | 6 +++--- src/lib.rs | 2 +- 3 files changed, 7 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 677a338c0ff..4b5cb92a78e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -33,6 +33,9 @@ * Fix `catch` not being thread-safe. [#3879](https://github.com/rustwasm/wasm-bindgen/pull/3879) +* Fix MSRV compilation. + [#3927](https://github.com/rustwasm/wasm-bindgen/pull/3927) + -------------------------------------------------------------------------------- ## [0.2.92](https://github.com/rustwasm/wasm-bindgen/compare/0.2.91...0.2.92) diff --git a/crates/backend/src/codegen.rs b/crates/backend/src/codegen.rs index bae386fc476..0749a4f69ed 100644 --- a/crates/backend/src/codegen.rs +++ b/crates/backend/src/codegen.rs @@ -1716,9 +1716,9 @@ fn splat( let mut args = Vec::new(); let mut names = Vec::new(); - for n in 1..=4 { - let arg_name = format_ident!("{name}_{n}"); - let prim_name = format_ident!("Prim{n}"); + for n in 1_u32..=4 { + let arg_name = format_ident!("{}_{}", name, n); + let prim_name = format_ident!("Prim{}", n); args.push(quote! { #arg_name: <#abi as #wasm_bindgen::convert::WasmAbi>::#prim_name }); diff --git a/src/lib.rs b/src/lib.rs index c4f41d0e357..f09bec2d213 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -1820,7 +1820,7 @@ pub mod __rt { } } - pub const fn flat_len(slices: [&[T]; SIZE]) -> usize { + pub const fn flat_len(slices: [&[T]; SIZE]) -> usize { let mut len = 0; let mut i = 0; while i < slices.len() {