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");