Skip to content

Commit ad251c0

Browse files
authored
Fix CI failures introduced by Rust 1.78 (except clippy::empty_docs) (#3949)
* Fix clippy/cargo warnings introduced by Rust 1.78 * Update reference tests
1 parent e78db23 commit ad251c0

18 files changed

+21
-20
lines changed

.cargo/config renamed to .cargo/config.toml

-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
# TODO: we shouldn't check this in to git, need to figure out how to avoid doing
2-
# that.
31
[target.wasm32-unknown-unknown]
42
runner = 'cargo run -p wasm-bindgen-cli --bin wasm-bindgen-test-runner --'
53

benchmarks/Cargo.toml

+1
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
name = "wasm-bindgen-benchmark"
33
version = "0.1.0"
44
authors = ["The wasm-bindgen Developers"]
5+
edition = "2018"
56
rust-version = "1.57"
67

78
[dependencies]

crates/cli-support/src/js/mod.rs

+5-4
Original file line numberDiff line numberDiff line change
@@ -2797,15 +2797,15 @@ impl<'a> Context<'a> {
27972797
match &js.name {
27982798
JsImportName::Module { module, name } => {
27992799
let import = self.module.imports.get_mut(id);
2800-
import.module = module.clone();
2801-
import.name = name.clone();
2800+
import.module.clone_from(module);
2801+
import.name.clone_from(name);
28022802
return Ok(true);
28032803
}
28042804
JsImportName::LocalModule { module, name } => {
28052805
let module = self.config.local_module_name(module);
28062806
let import = self.module.imports.get_mut(id);
28072807
import.module = module;
2808-
import.name = name.clone();
2808+
import.name.clone_from(name);
28092809
return Ok(true);
28102810
}
28112811
JsImportName::InlineJs {
@@ -2818,7 +2818,7 @@ impl<'a> Context<'a> {
28182818
.inline_js_module_name(unique_crate_identifier, *snippet_idx_in_crate);
28192819
let import = self.module.imports.get_mut(id);
28202820
import.module = module;
2821-
import.name = name.clone();
2821+
import.name.clone_from(name);
28222822
return Ok(true);
28232823
}
28242824

@@ -4133,6 +4133,7 @@ impl ExportedClass {
41334133
}
41344134
}
41354135

4136+
#[allow(clippy::assigning_clones)] // Clippy's suggested fix doesn't work at MSRV.
41364137
fn push_accessor_ts(
41374138
&mut self,
41384139
docs: &str,

crates/cli/tests/reference/add.wat

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
(module
1+
(module $reference_test.wasm
22
(type (;0;) (func (param i32 i32) (result i32)))
33
(func $add_u32 (;0;) (type 0) (param i32 i32) (result i32))
44
(func $add_i32 (;1;) (type 0) (param i32 i32) (result i32))

crates/cli/tests/reference/anyref-empty.wat

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
(module
1+
(module $reference_test.wasm
22
(type (;0;) (func))
33
(import "./reference_test_bg.js" "__wbindgen_init_externref_table" (func (;0;) (type 0)))
44
(table (;0;) 128 externref)

crates/cli/tests/reference/anyref-import-catch.wat

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
(module
1+
(module $reference_test.wasm
22
(type (;0;) (func))
33
(type (;1;) (func (result i32)))
44
(type (;2;) (func (param i32)))

crates/cli/tests/reference/anyref-nop.wat

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
(module
1+
(module $reference_test.wasm
22
(type (;0;) (func))
33
(import "./reference_test_bg.js" "__wbindgen_init_externref_table" (func (;0;) (type 0)))
44
(func $foo (;1;) (type 0))

crates/cli/tests/reference/builder.wat

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
(module
1+
(module $reference_test.wasm
22
(type (;0;) (func (result i32)))
33
(type (;1;) (func (param i32)))
44
(func $classbuilder_builder (;0;) (type 0) (result i32))

crates/cli/tests/reference/constructor.wat

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
(module
1+
(module $reference_test.wasm
22
(type (;0;) (func (result i32)))
33
(type (;1;) (func (param i32)))
44
(func $classconstructor_new (;0;) (type 0) (result i32))

crates/cli/tests/reference/empty.wat

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
(module
1+
(module $reference_test.wasm
22
(memory (;0;) 16)
33
(export "memory" (memory 0))
44
)

crates/cli/tests/reference/enums.wat

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
(module
1+
(module $reference_test.wasm
22
(type (;0;) (func (param i32) (result i32)))
33
(func $enum_echo (;0;) (type 0) (param i32) (result i32))
44
(func $option_enum_echo (;1;) (type 0) (param i32) (result i32))

crates/cli/tests/reference/import-catch.wat

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
(module
1+
(module $reference_test.wasm
22
(type (;0;) (func (param i32)))
33
(type (;1;) (func (param i32) (result i32)))
44
(func $exported (;0;) (type 0) (param i32))

crates/cli/tests/reference/nop.wat

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
(module
1+
(module $reference_test.wasm
22
(type (;0;) (func))
33
(func $nop (;0;) (type 0))
44
(memory (;0;) 17)

crates/cli/tests/reference/pointers.wat

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
(module
1+
(module $reference_test.wasm
22
(type (;0;) (func (param i32) (result i32)))
33
(func $const_pointer (;0;) (type 0) (param i32) (result i32))
44
(func $mut_pointer (;1;) (type 0) (param i32) (result i32))

crates/cli/tests/reference/result-string.wat

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
(module
1+
(module $reference_test.wasm
22
(type (;0;) (func (param i32)))
33
(type (;1;) (func (param i32) (result i32)))
44
(type (;2;) (func (param i32 i32 i32)))

crates/cli/tests/reference/skip-jsdoc.wat

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
(module
1+
(module $reference_test.wasm
22
(type (;0;) (func (param i32) (result i32)))
33
(func $docme (;0;) (type 0) (param i32) (result i32))
44
(memory (;0;) 17)

crates/cli/tests/reference/string-arg.wat

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
(module
1+
(module $reference_test.wasm
22
(type (;0;) (func (param i32 i32)))
33
(type (;1;) (func (param i32 i32) (result i32)))
44
(type (;2;) (func (param i32 i32 i32 i32) (result i32)))

tests/wasm/slice.rs

+1
Original file line numberDiff line numberDiff line change
@@ -233,6 +233,7 @@ impl ReturnVecApplication {
233233
ReturnVecApplication { thing }
234234
}
235235

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

0 commit comments

Comments
 (0)