From a3332e4be6ae3339dd77f37257e3d4d170085099 Mon Sep 17 00:00:00 2001 From: Thomas Etter Date: Sun, 31 Dec 2023 04:23:04 +0100 Subject: [PATCH] CI fix for Rust 1.75 (#3761) * fix wat output file * cargo clippy --no-deps --all-features -p wasm-bindgen-macro-support --fix -- -D warnings * add #[allow(unused_imports)] for the binding file in web-sys --- .../tests/reference/anyref-import-catch.wat | 4 +- crates/macro-support/src/parser.rs | 2 +- crates/web-sys/src/features/mod.rs | 1588 +++++++++++++++++ crates/webidl/src/lib.rs | 4 +- 4 files changed, 1593 insertions(+), 5 deletions(-) diff --git a/crates/cli/tests/reference/anyref-import-catch.wat b/crates/cli/tests/reference/anyref-import-catch.wat index ed8e5683402..48071a315d7 100644 --- a/crates/cli/tests/reference/anyref-import-catch.wat +++ b/crates/cli/tests/reference/anyref-import-catch.wat @@ -5,8 +5,8 @@ (type (;3;) (func (param i32) (result i32))) (import "./reference_test_bg.js" "__wbindgen_init_externref_table" (func (;0;) (type 0))) (func $__wbindgen_exn_store (;1;) (type 2) (param i32)) - (func $exported (;2;) (type 2) (param i32)) - (func $__externref_table_dealloc (;3;) (type 2) (param i32)) + (func $__externref_table_dealloc (;2;) (type 2) (param i32)) + (func $exported (;3;) (type 2) (param i32)) (func $__externref_table_alloc (;4;) (type 1) (result i32)) (func $__wbindgen_add_to_stack_pointer (;5;) (type 3) (param i32) (result i32)) (table (;0;) 128 externref) diff --git a/crates/macro-support/src/parser.rs b/crates/macro-support/src/parser.rs index 73b9c2166f0..39ab459f864 100644 --- a/crates/macro-support/src/parser.rs +++ b/crates/macro-support/src/parser.rs @@ -525,7 +525,7 @@ impl<'a> ConvertToAst<(&ast::Program, BindgenAttrs, &'a Option Result { let binding_file = features.keys().map(|name| { if generate_features { - format!("#[cfg(feature = \"{name}\")] #[allow(non_snake_case)] mod gen_{name};\n#[cfg(feature = \"{name}\")] pub use gen_{name}::*;", name = name) + format!("#[cfg(feature = \"{name}\")] #[allow(non_snake_case)] mod gen_{name};\n#[cfg(feature = \"{name}\")] #[allow(unused_imports)] pub use gen_{name}::*;", name = name) } else { - format!("#[allow(non_snake_case)] mod gen_{name};\npub use gen_{name}::*;", name = name) + format!("#[allow(non_snake_case)] mod gen_{name};\n#[allow(unused_imports)] pub use gen_{name}::*;", name = name) } }).collect::>().join("\n\n");