Skip to content

Commit 79c884a

Browse files
committed
fix CI errors in wasm-bindgen
1 parent 718b6fe commit 79c884a

File tree

6 files changed

+11
-10
lines changed

6 files changed

+11
-10
lines changed

.cargo/config.toml

+4-3
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,10 @@
22
runner = 'cargo run -p wasm-bindgen-cli --bin wasm-bindgen-test-runner --'
33

44
[build]
5+
56
[target.'cfg(all(target_arch = "wasm32", target_os = "emscripten"))']
67
rustflags = [
7-
"-Cllvm-args=-enable-emscripten-cxx-exceptions=0",
8-
"-Clink-arg=-Wno-undefined",
9-
"-Crelocation-model=static",
8+
"-Cllvm-args=-enable-emscripten-cxx-exceptions=0",
9+
"-Clink-arg=-Wno-undefined",
10+
"-Crelocation-model=static",
1011
]

crates/cli-support/Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -17,12 +17,12 @@ version = "0.2.100"
1717
anyhow = "1.0"
1818
base64 = "0.22"
1919
log = "0.4"
20+
regex = "1"
2021
rustc-demangle = "0.1.13"
2122
serde = { version = "1.0", features = ["derive"] }
2223
serde_json = "1.0"
2324
tempfile = "3.0"
2425
walrus = { version = "0.23", features = ['parallel'] }
25-
regex = "1"
2626
wasm-bindgen-externref-xform = { path = '../externref-xform', version = '=0.2.100' }
2727
wasm-bindgen-multi-value-xform = { path = '../multi-value-xform', version = '=0.2.100' }
2828
wasm-bindgen-shared = { path = "../shared", version = '=0.2.100' }

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

+1-1
Original file line numberDiff line numberDiff line change
@@ -3188,7 +3188,7 @@ __wbg_set_wasm(wasm);"
31883188
code
31893189
)
31903190
} else {
3191-
if !import_deps.is_empty() {
3191+
if (matches!(self.config.mode, OutputMode::Emscripten) && !import_deps.is_empty()) {
31923192
for dep in &import_deps {
31933193
self.emscripten_deps.insert(dep.clone());
31943194
}

crates/cli/src/bin/wasm-bindgen-test-runner/main.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ fn main() -> anyhow::Result<()> {
117117
.map(Path::new)
118118
.context("file to test is not a valid file, can't extract file name")?;
119119

120-
let mut file_name_buf = PathBuf::from(cli.file.clone());
120+
let mut file_name_buf = cli.file.clone();
121121

122122
// Repoint the file to be read from "name.js" to "name.wasm" in the case of emscripten.
123123
// Rustc generates a .js and a .wasm file when targeting emscripten. It lists the .js

crates/cli/src/bin/wasm-bindgen-test-runner/server.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -353,7 +353,7 @@ pub(crate) fn spawn(
353353
response
354354
})
355355
.map_err(|e| anyhow!("{}", e))?;
356-
return Ok(srv);
356+
Ok(srv)
357357
}
358358

359359
pub(crate) fn spawn_emscripten(
@@ -390,7 +390,7 @@ pub(crate) fn spawn_emscripten(
390390
response
391391
})
392392
.map_err(|e| anyhow!("{}", e))?;
393-
return Ok(srv);
393+
Ok(srv)
394394
}
395395

396396
fn try_asset(request: &Request, dir: &Path) -> Response {

src/convert/impls.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ impl WasmAbi for i128 {
4444

4545
#[inline]
4646
fn join(low: u64, high: u64, _: (), _: ()) -> Self {
47-
((high as u128) << 64 | low as u128) as i128
47+
(((high as u128) << 64) | low as u128) as i128
4848
}
4949
}
5050
impl WasmAbi for u128 {
@@ -62,7 +62,7 @@ impl WasmAbi for u128 {
6262

6363
#[inline]
6464
fn join(low: u64, high: u64, _: (), _: ()) -> Self {
65-
(high as u128) << 64 | low as u128
65+
((high as u128) << 64) | low as u128
6666
}
6767
}
6868

0 commit comments

Comments
 (0)