Skip to content

Commit ebd25df

Browse files
authored
Update to wasmtime 34 (#471)
* Update to wasmtime 34 * Clippy and fmt
1 parent f90bed0 commit ebd25df

File tree

9 files changed

+133
-121
lines changed

9 files changed

+133
-121
lines changed

Cargo.lock

Lines changed: 117 additions & 108 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Gemfile.lock

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
PATH
22
remote: .
33
specs:
4-
wasmtime (33.0.0)
4+
wasmtime (34.0.0)
55
rb_sys (~> 0.9.108)
66

77
GEM

ext/Cargo.toml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,8 @@ magnus = { version = "0.7", features = ["rb-sys"] }
2424
rb-sys = { version = "*", default-features = false, features = [
2525
"stable-api-compiled-fallback",
2626
] }
27-
wasmtime = { version = "=33.0.0", features = ["memory-protection-keys"] }
28-
wasmtime-wasi = "=33.0.0"
27+
wasmtime = { version = "=34.0.0", features = ["memory-protection-keys"] }
28+
wasmtime-wasi = "=34.0.0"
2929
cap-std = "3.4.0"
3030
wat = "1.227.1"
3131
tokio = { version = "1.40.0", features = [
@@ -38,8 +38,8 @@ async-timer = { version = "1.0.0-beta.15", features = [
3838
"tokio1",
3939
], optional = true }
4040
static_assertions = "1.1.0"
41-
wasmtime-environ = "=33.0.0"
42-
deterministic-wasi-ctx = { version = "=1.2.1" }
41+
wasmtime-environ = "=34.0.0"
42+
deterministic-wasi-ctx = { version = "=3.0.0" }
4343

4444
[build-dependencies]
4545
rb-sys-env = "0.2.2"

ext/src/ruby_api/caller.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,10 @@ impl<'a> CallerHandle<'a> {
2020
}
2121
}
2222

23+
// Note that the underlying implemenation relies on `UnsafeCell`, which
24+
// provides some gurantees around interior mutability, therefore we're
25+
// opting to allow this lint.
26+
#[allow(clippy::mut_from_ref)]
2327
pub fn get_mut(&self) -> Result<&mut CallerImpl<'a, StoreData>, Error> {
2428
unsafe { &mut *self.caller.get() }
2529
.as_mut()

ext/src/ruby_api/component/convert.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ pub(crate) fn component_val_to_rb(val: Val, _store: &StoreContextValue) -> Resul
4949
let hash = RHash::new();
5050
for (name, val) in fields {
5151
let rb_value = component_val_to_rb(val, _store)
52-
.map_err(|e| e.append(format!(" (struct field \"{}\")", name)))?;
52+
.map_err(|e| e.append(format!(" (struct field \"{name}\")")))?;
5353
hash.aset(name.as_str(), rb_value)?
5454
}
5555

@@ -138,7 +138,7 @@ pub(crate) fn rb_to_component_val(
138138
// user code so user code can't mutate it either.
139139
for (i, value) in unsafe { rarray.as_slice() }.iter().enumerate() {
140140
let component_val = rb_to_component_val(*value, _store, &ty)
141-
.map_err(|e| e.append(format!(" (list item at index {})", i)))?;
141+
.map_err(|e| e.append(format!(" (list item at index {i})")))?;
142142

143143
vals.push(component_val);
144144
}
@@ -180,7 +180,7 @@ pub(crate) fn rb_to_component_val(
180180

181181
for (i, (ty, value)) in types.zip(unsafe { rarray.as_slice() }.iter()).enumerate() {
182182
let component_val = rb_to_component_val(*value, _store, &ty)
183-
.map_err(|error| error.append(format!(" (tuple value at index {})", i)))?;
183+
.map_err(|error| error.append(format!(" (tuple value at index {i})")))?;
184184

185185
vals.push(component_val);
186186
}

ext/src/ruby_api/component/func.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,7 @@ fn convert_params(
142142
.map_err(|_| Error::new(arg_error(), "too many params"))?;
143143

144144
let component_val = rb_to_component_val(*value, store, &ty.1)
145-
.map_err(|error| error.append(format!(" (param at index {})", i)))?;
145+
.map_err(|error| error.append(format!(" (param at index {i})")))?;
146146

147147
params.push(component_val);
148148
}

ext/src/ruby_api/config.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ pub fn hash_to_config(hash: RHash) -> Result<Config, Error> {
119119

120120
if let Some(target) = target {
121121
config.target(&target).map_err(|e| {
122-
Error::new(arg_error(), format!("Invalid target: {}: {}", target, e))
122+
Error::new(arg_error(), format!("Invalid target: {target}: {e}"))
123123
})?;
124124
}
125125
} else if *GENERATE_ADDRESS_MAP == id {

ext/src/ruby_api/pooling_allocation_config.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -235,8 +235,7 @@ impl PoolingAllocationConfig {
235235
let inner = format!("{:?}", rb_self.borrow_mut()?);
236236

237237
Ok(format!(
238-
"#<Wasmtime::PoolingAllocationConfig inner={}>",
239-
inner
238+
"#<Wasmtime::PoolingAllocationConfig inner={inner}>"
240239
))
241240
}
242241

lib/wasmtime/version.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# frozen_string_literal: true
22

33
module Wasmtime
4-
VERSION = "33.0.0"
4+
VERSION = "34.0.0"
55
end

0 commit comments

Comments
 (0)