Skip to content

Commit 90ac295

Browse files
authored
Update Wasmtime to the 2024 Rust Edition (#10806)
* Update Wasmtime to the 2024 Rust Edition Now that our MSRV supports the 2024 edition it's possible to make this switch. This commit moves Wasmtime to the 2024 Edition to keep up-to-date with Rust idioms and access many of the edition features exclusive to the 2024 edition. prtest:full * Reformat with the 2024 edition
1 parent 16a836e commit 90ac295

File tree

592 files changed

+2100
-2107
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

592 files changed

+2100
-2107
lines changed

Cargo.toml

Lines changed: 1 addition & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -171,7 +171,7 @@ exclude = [
171171
[workspace.package]
172172
version = "34.0.0"
173173
authors = ["The Wasmtime Project Developers"]
174-
edition = "2021"
174+
edition = "2024"
175175
# Wasmtime's current policy is that this number can be no larger than the
176176
# current stable release of Rust minus 2.
177177
rust-version = "1.85.0"
@@ -185,19 +185,6 @@ unused_import_braces = 'warn'
185185
unused-lifetimes = 'warn'
186186
unused-macro-rules = 'warn'
187187

188-
# Lints that are part of the `rust-2024-compatibility` group. This group is a
189-
# bit too noisy to enable wholesale but some selective items are ones we want to
190-
# opt-in to.
191-
keyword_idents_2024 = 'warn'
192-
unsafe-attr-outside-unsafe = 'warn'
193-
deprecated-safe-2024 = 'warn'
194-
rust-2024-guarded-string-incompatible-syntax = 'warn'
195-
rust-2024-prelude-collisions = 'warn'
196-
rust-2024-incompatible-pat = 'warn'
197-
missing-unsafe-on-extern = 'warn'
198-
impl-trait-overcaptures = 'warn'
199-
unsafe-op-in-unsafe-fn = 'warn'
200-
201188
# Don't warn about unknown cfgs for pulley
202189
[workspace.lints.rust.unexpected_cfgs]
203190
level = "warn"

benches/call.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
use criterion::measurement::WallTime;
2-
use criterion::{criterion_group, criterion_main, BenchmarkGroup, Criterion};
2+
use criterion::{BenchmarkGroup, Criterion, criterion_group, criterion_main};
33
use std::fmt::Debug;
44
use std::future::Future;
55
use std::pin::Pin;

benches/instantiation.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
use anyhow::Result;
2-
use criterion::{criterion_group, criterion_main, BenchmarkId, Criterion};
2+
use criterion::{BenchmarkId, Criterion, criterion_group, criterion_main};
33
use std::cell::LazyCell;
44
use std::path::Path;
55
use std::process::Command;
6-
use std::sync::atomic::{AtomicBool, AtomicUsize, Ordering::SeqCst};
76
use std::sync::Arc;
7+
use std::sync::atomic::{AtomicBool, AtomicUsize, Ordering::SeqCst};
88
use std::thread;
9-
use wasi_common::{sync::WasiCtxBuilder, WasiCtx};
9+
use wasi_common::{WasiCtx, sync::WasiCtxBuilder};
1010
use wasmtime::*;
1111

1212
fn store(engine: &Engine) -> Store<WasiCtx> {

benches/thread_eager_init.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
use criterion::{criterion_group, criterion_main, Criterion};
1+
use criterion::{Criterion, criterion_group, criterion_main};
22
use std::thread;
33
use std::time::{Duration, Instant};
44
use wasmtime::*;

benches/wasi.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
//! Measure some common WASI call scenarios.
22
3-
use criterion::{criterion_group, criterion_main, Criterion};
3+
use criterion::{Criterion, criterion_group, criterion_main};
44
use std::{fs::File, path::Path, time::Instant};
5-
use wasi_common::{sync::WasiCtxBuilder, WasiCtx};
5+
use wasi_common::{WasiCtx, sync::WasiCtxBuilder};
66
use wasmtime::{Engine, Linker, Module, Store, TypedFunc};
77

88
criterion_group!(benches, bench_wasi);

cranelift/assembler-x64/fuzz/fuzz_targets/roundtrip.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#![no_main]
22

3-
use cranelift_assembler_x64::{fuzz, Inst};
3+
use cranelift_assembler_x64::{Inst, fuzz};
44
use libfuzzer_sys::fuzz_target;
55

66
fuzz_target!(|inst: Inst<fuzz::FuzzRegs>| {

cranelift/assembler-x64/meta/src/dsl.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,13 +8,13 @@ mod encoding;
88
mod features;
99
pub mod format;
1010

11-
pub use encoding::{rex, vex};
1211
pub use encoding::{
1312
Encoding, Group1Prefix, Group2Prefix, Group3Prefix, Group4Prefix, Opcodes, Prefixes, Rex,
1413
};
15-
pub use features::{Feature, Features, ALL_FEATURES};
16-
pub use format::{align, fmt, r, rw, sxl, sxq, sxw, w};
14+
pub use encoding::{rex, vex};
15+
pub use features::{ALL_FEATURES, Feature, Features};
1716
pub use format::{Extension, Format, Location, Mutability, Operand, OperandKind};
17+
pub use format::{align, fmt, r, rw, sxl, sxq, sxw, w};
1818

1919
/// Abbreviated constructor for an x64 instruction.
2020
pub fn inst(

cranelift/assembler-x64/meta/src/generate.rs

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ mod inst;
66
mod operand;
77

88
use crate::dsl;
9-
use cranelift_srcgen::{fmtln, Formatter};
9+
use cranelift_srcgen::{Formatter, fmtln};
1010

1111
/// Generate the Rust assembler code; e.g., `enum Inst { ... }`.
1212
pub fn rust_assembler(f: &mut Formatter, insts: &[dsl::Inst]) {
@@ -57,7 +57,10 @@ fn generate_derive(f: &mut Formatter) {
5757
/// Adds a custom bound to the `Arbitrary` implementation which ensures that
5858
/// the associated registers are all `Arbitrary` as well.
5959
fn generate_derive_arbitrary_bounds(f: &mut Formatter) {
60-
fmtln!(f, "#[cfg_attr(any(test, feature = \"fuzz\"), arbitrary(bound = \"R: crate::fuzz::RegistersArbitrary\"))]");
60+
fmtln!(
61+
f,
62+
"#[cfg_attr(any(test, feature = \"fuzz\"), arbitrary(bound = \"R: crate::fuzz::RegistersArbitrary\"))]"
63+
);
6164
}
6265

6366
/// `impl std::fmt::Display for Inst { ... }`

cranelift/assembler-x64/meta/src/generate/features.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
//! Generate feature-related Rust code.
22
3-
use super::{fmtln, Formatter};
3+
use super::{Formatter, fmtln};
44
use crate::{dsl, generate::generate_derive};
55

66
impl dsl::Feature {

cranelift/assembler-x64/meta/src/generate/format.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
//! Generate format-related Rust code; this also includes generation of encoding
22
//! Rust code.
33
4-
use super::{fmtln, Formatter};
4+
use super::{Formatter, fmtln};
55
use crate::dsl;
66

77
impl dsl::Format {

0 commit comments

Comments
 (0)