Enable the `useless_conversion` Clippy lint (#10838)* Enable the `useless_conversion` Clippy lintWe've got lots of types in Wasmtime and convert between them quite alot, but often over time conv
Enable the `useless_conversion` Clippy lint (#10838)* Enable the `useless_conversion` Clippy lintWe've got lots of types in Wasmtime and convert between them quite alot, but often over time conversions become unnecessary throughrefactorings or similar. This will hopefully enable us to clean up someconversions as they come up to try to have as few as possible ideally.* Review comments
show more ...
Update Wasmtime to the 2024 Rust Edition (#10806)* Update Wasmtime to the 2024 Rust EditionNow that our MSRV supports the 2024 edition it's possible to make thisswitch. This commit moves Wasmtim
Update Wasmtime to the 2024 Rust Edition (#10806)* Update Wasmtime to the 2024 Rust EditionNow that our MSRV supports the 2024 edition it's possible to make thisswitch. This commit moves Wasmtime to the 2024 Edition to keepup-to-date with Rust idioms and access many of the edition featuresexclusive to the 2024 edition.prtest:full* Reformat with the 2024 edition
meta: deduplicate source generation infrastructure (#10348)* Move `Formatter` and `Error` to new crate: `cranelift-srcgen`The `cranelift-codegen-meta` crate emits both Rust and ISLE source codeu
meta: deduplicate source generation infrastructure (#10348)* Move `Formatter` and `Error` to new crate: `cranelift-srcgen`The `cranelift-codegen-meta` crate emits both Rust and ISLE source codeusing a `Formatter` which may fail with an `Error`. The`cranelift-assembler-x64-meta` crate uses a subset of thisfunctionality. To deduplicate efforts, this creates a new crate,`cranelift-srcgen`, and moves only the `cranelift-codgen-meta`functionality there (for now).* Add notion of a formatted `Language`; append file locationsWhile developing `cranelift-assembler-x64`, it became clear that knowingthe source code location that _generated_ some code was extremelyuseful. This change alters the `fmtln!` macro to append file locationsas comments to the generated code; this doesn't change all the`fmt.line()` invocations but it's a start. To do this, we need to knowwhich language we are generating to emit the correct comment kind. Thisled to adding a new `enum Language` to identify that.* Rename `update_file` to `write`* Use shared `Formatter` in `cranelift-assembler-x64-meta`This change removes the duplicate implementation of `Formatter` in`cranelift-assembler-x64-meta` and replaces it with the shared`Formatter` in `cranelift-srcgen`.* Add `Formatter::add_block`While implementing all these changes, I noticed an opportunity: byadding `Formatter::add_block` we can automatically adds braces andindentation. This should be more safe (i.e., harder to forget to appendthe ending `}`) and result in less verbose generator code (no need for`fmtln!(...)` then `f.indent(|f| ...)`). This refactoring does touch alarge amount of code, though.Now with `Formatter::add_block`, we can allow the `fmtln!` macro toauto-format no-arg format strings (e.g., `fmtln!(f, "{x}")`), whichshould be a bit more ergonomic. This does mean that a few locations thatweren't covered by `Formatter::add_block` need some extra escaping(e.g., `{` -> `{{`).* Avoid appending a file location comment to a Rust comment* Make `cranelift-srcgen` publishableThis ensures the crate has a version and is tracked by`cranelift-srcgen`.