Skip to content

Commit

Permalink
Fix CI failures introduced by Rust 1.78 (except clippy::empty_docs) (
Browse files Browse the repository at this point in the history
…#3949)

* Fix clippy/cargo warnings introduced by Rust 1.78

* Update reference tests
  • Loading branch information
Liamolucko committed May 7, 2024
1 parent e78db23 commit ad251c0
Show file tree
Hide file tree
Showing 18 changed files with 21 additions and 20 deletions.
2 changes: 0 additions & 2 deletions .cargo/config → .cargo/config.toml
@@ -1,5 +1,3 @@
# TODO: we shouldn't check this in to git, need to figure out how to avoid doing
# that.
[target.wasm32-unknown-unknown]
runner = 'cargo run -p wasm-bindgen-cli --bin wasm-bindgen-test-runner --'

Expand Down
1 change: 1 addition & 0 deletions benchmarks/Cargo.toml
Expand Up @@ -2,6 +2,7 @@
name = "wasm-bindgen-benchmark"
version = "0.1.0"
authors = ["The wasm-bindgen Developers"]
edition = "2018"
rust-version = "1.57"

[dependencies]
Expand Down
9 changes: 5 additions & 4 deletions crates/cli-support/src/js/mod.rs
Expand Up @@ -2797,15 +2797,15 @@ impl<'a> Context<'a> {
match &js.name {
JsImportName::Module { module, name } => {
let import = self.module.imports.get_mut(id);
import.module = module.clone();
import.name = name.clone();
import.module.clone_from(module);
import.name.clone_from(name);
return Ok(true);
}
JsImportName::LocalModule { module, name } => {
let module = self.config.local_module_name(module);
let import = self.module.imports.get_mut(id);
import.module = module;
import.name = name.clone();
import.name.clone_from(name);
return Ok(true);
}
JsImportName::InlineJs {
Expand All @@ -2818,7 +2818,7 @@ impl<'a> Context<'a> {
.inline_js_module_name(unique_crate_identifier, *snippet_idx_in_crate);
let import = self.module.imports.get_mut(id);
import.module = module;
import.name = name.clone();
import.name.clone_from(name);
return Ok(true);
}

Expand Down Expand Up @@ -4133,6 +4133,7 @@ impl ExportedClass {
}
}

#[allow(clippy::assigning_clones)] // Clippy's suggested fix doesn't work at MSRV.
fn push_accessor_ts(
&mut self,
docs: &str,
Expand Down
2 changes: 1 addition & 1 deletion crates/cli/tests/reference/add.wat
@@ -1,4 +1,4 @@
(module
(module $reference_test.wasm
(type (;0;) (func (param i32 i32) (result i32)))
(func $add_u32 (;0;) (type 0) (param i32 i32) (result i32))
(func $add_i32 (;1;) (type 0) (param i32 i32) (result i32))
Expand Down
2 changes: 1 addition & 1 deletion crates/cli/tests/reference/anyref-empty.wat
@@ -1,4 +1,4 @@
(module
(module $reference_test.wasm
(type (;0;) (func))
(import "./reference_test_bg.js" "__wbindgen_init_externref_table" (func (;0;) (type 0)))
(table (;0;) 128 externref)
Expand Down
2 changes: 1 addition & 1 deletion crates/cli/tests/reference/anyref-import-catch.wat
@@ -1,4 +1,4 @@
(module
(module $reference_test.wasm
(type (;0;) (func))
(type (;1;) (func (result i32)))
(type (;2;) (func (param i32)))
Expand Down
2 changes: 1 addition & 1 deletion crates/cli/tests/reference/anyref-nop.wat
@@ -1,4 +1,4 @@
(module
(module $reference_test.wasm
(type (;0;) (func))
(import "./reference_test_bg.js" "__wbindgen_init_externref_table" (func (;0;) (type 0)))
(func $foo (;1;) (type 0))
Expand Down
2 changes: 1 addition & 1 deletion crates/cli/tests/reference/builder.wat
@@ -1,4 +1,4 @@
(module
(module $reference_test.wasm
(type (;0;) (func (result i32)))
(type (;1;) (func (param i32)))
(func $classbuilder_builder (;0;) (type 0) (result i32))
Expand Down
2 changes: 1 addition & 1 deletion crates/cli/tests/reference/constructor.wat
@@ -1,4 +1,4 @@
(module
(module $reference_test.wasm
(type (;0;) (func (result i32)))
(type (;1;) (func (param i32)))
(func $classconstructor_new (;0;) (type 0) (result i32))
Expand Down
2 changes: 1 addition & 1 deletion crates/cli/tests/reference/empty.wat
@@ -1,4 +1,4 @@
(module
(module $reference_test.wasm
(memory (;0;) 16)
(export "memory" (memory 0))
)
2 changes: 1 addition & 1 deletion crates/cli/tests/reference/enums.wat
@@ -1,4 +1,4 @@
(module
(module $reference_test.wasm
(type (;0;) (func (param i32) (result i32)))
(func $enum_echo (;0;) (type 0) (param i32) (result i32))
(func $option_enum_echo (;1;) (type 0) (param i32) (result i32))
Expand Down
2 changes: 1 addition & 1 deletion crates/cli/tests/reference/import-catch.wat
@@ -1,4 +1,4 @@
(module
(module $reference_test.wasm
(type (;0;) (func (param i32)))
(type (;1;) (func (param i32) (result i32)))
(func $exported (;0;) (type 0) (param i32))
Expand Down
2 changes: 1 addition & 1 deletion crates/cli/tests/reference/nop.wat
@@ -1,4 +1,4 @@
(module
(module $reference_test.wasm
(type (;0;) (func))
(func $nop (;0;) (type 0))
(memory (;0;) 17)
Expand Down
2 changes: 1 addition & 1 deletion crates/cli/tests/reference/pointers.wat
@@ -1,4 +1,4 @@
(module
(module $reference_test.wasm
(type (;0;) (func (param i32) (result i32)))
(func $const_pointer (;0;) (type 0) (param i32) (result i32))
(func $mut_pointer (;1;) (type 0) (param i32) (result i32))
Expand Down
2 changes: 1 addition & 1 deletion crates/cli/tests/reference/result-string.wat
@@ -1,4 +1,4 @@
(module
(module $reference_test.wasm
(type (;0;) (func (param i32)))
(type (;1;) (func (param i32) (result i32)))
(type (;2;) (func (param i32 i32 i32)))
Expand Down
2 changes: 1 addition & 1 deletion crates/cli/tests/reference/skip-jsdoc.wat
@@ -1,4 +1,4 @@
(module
(module $reference_test.wasm
(type (;0;) (func (param i32) (result i32)))
(func $docme (;0;) (type 0) (param i32) (result i32))
(memory (;0;) 17)
Expand Down
2 changes: 1 addition & 1 deletion crates/cli/tests/reference/string-arg.wat
@@ -1,4 +1,4 @@
(module
(module $reference_test.wasm
(type (;0;) (func (param i32 i32)))
(type (;1;) (func (param i32 i32) (result i32)))
(type (;2;) (func (param i32 i32 i32 i32) (result i32)))
Expand Down
1 change: 1 addition & 0 deletions tests/wasm/slice.rs
Expand Up @@ -233,6 +233,7 @@ impl ReturnVecApplication {
ReturnVecApplication { thing }
}

#[allow(clippy::assigning_clones)] // false positive, should be fixed by https://github.com/rust-lang/rust-clippy/pull/12756
pub fn tick(&mut self) {
self.thing = self.thing.clone();
}
Expand Down

0 comments on commit ad251c0

Please sign in to comment.