-
Notifications
You must be signed in to change notification settings - Fork 2.2k
Upgrade Rust Toolchain to 1.85.0 and Edition to 2024 #5079
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #5079 +/- ##
=======================================
Coverage 83.15% 83.15%
=======================================
Files 248 248
Lines 26896 26910 +14
=======================================
+ Hits 22365 22377 +12
- Misses 4531 4533 +2
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
|
Kani is timing out but it's doing so also on the v78 devctr built yesterday, so it's doesn't seem to be caused by these changes. |
The section has been renamed and the old name has been deprecated. This has no functional changes. > The "poetry.dev-dependencies" section is deprecated and will > be removed in a future version. > Use "poetry.group.dev.dependencies" instead. Signed-off-by: Riccardo Mancini <[email protected]>
I've run `poetry update --lock` inside `/tools/devctr`. Signed-off-by: Riccardo Mancini <[email protected]>
This commit updates the rust toolchain in the devctr to 1.85.0. Changes will take effect on the next devctr release. Signed-off-by: Riccardo Mancini <[email protected]>
The clippy update now flags cases where operator precedence may lead to unexpected results [1]. The fix is to explicitly wrap in parenthesis. [1]: https://rust-lang.github.io/rust-clippy/master/index.html#precedence Signed-off-by: Riccardo Mancini <[email protected]>
The rust toolchain version requires specifying which ABI the packed representation refers to [1]. In all our cases, we want C ABI. [1]: https://rust-lang.github.io/rust-clippy/master/index.html#repr_packed_without_abi Signed-off-by: Riccardo Mancini <[email protected]>
The compiler complains that we're not consuming the output of `exec`. Let's be explicit about ignoring it. Signed-off-by: Riccardo Mancini <[email protected]>
Clippy complains that `map_or` can be simplified. Replace it with `is_some_and`. Signed-off-by: Riccardo Mancini <[email protected]>
The call is redundant as len() on a string returns the number of bytes [1]. [1]: https://rust-lang.github.io/rust-clippy/master/index.html#needless_as_bytes Signed-off-by: Riccardo Mancini <[email protected]>
When applying fixes automatically, clippy doesn't know what to do in this case. It's also objectively obscure. Let's replace it with an explicit cast, specifying the pointer types, and modernize the syntax to use `&raw mut`. Signed-off-by: Riccardo Mancini <[email protected]>
The new version has rust toolchain v1.85.0 Signed-off-by: Riccardo Mancini <[email protected]>
Binding modifiers may only be written when the default binding mode is `move`. For more information, see [1]. [1]: https://doc.rust-lang.org/nightly/edition-guide/rust-2024/match-ergonomics.html Signed-off-by: Riccardo Mancini <[email protected]>
In Rust 2024 these are considered unsafe operations, but it's safe to edit them from a single threaded program. Signed-off-by: Riccardo Mancini <[email protected]>
In Rust 2024 edition, it is required to mark which parts of an unsafe functions are unsafe. Signed-off-by: Riccardo Mancini <[email protected]>
In Rust 2024 edition, extern blocks must be marked unsafe. Signed-off-by: Riccardo Mancini <[email protected]>
In Rust 2024 edition, gen is a keyword reserved for future use. This change updates bindgen to change the destination of the generated files. I've tested this by rerunning bindgen.sh The next change will switch all files to reference the new path. Signed-off-by: Riccardo Mancini <[email protected]>
This change switches the generated files location from gen/ to generated/, updating all references in the code. Signed-off-by: Riccardo Mancini <[email protected]>
All issues have been fixed in the previous commits, so finally switch to use 2024 edition. Signed-off-by: Riccardo Mancini <[email protected]>
The new rust edition comes with different opinions on how code should be formatted, mostly around ordering of dependencies. Let's fix it. Signed-off-by: Riccardo Mancini <[email protected]>
The re-formatting made clippy aware of this unneeded late initialization. Let's fix it. Signed-off-by: Riccardo Mancini <[email protected]>
|
The only change from the latest approved revision is to use |
Changes
This patchset upgrades the rust toolchain to 1.85.0 and the edition to 2024. Furthermore, the dev container is bumped to v79.
It looks like a big change but there's no functional changes. The biggest pieces are:
rustfmthas a different opinion in 2024, leading to many reformatted linesgenis now a reserved keyword, so I've updated all generated files to use thegenerated/prefix instead. I've also updated and rerunbindgen.sh.unsafenow needs to be used explicitly insideunsafefunctionsrefinmatchhave been removedShould I add a changelog entry? There's no user-visible change.
Reason
As part of the new release cycle, we're updating the rust toolchain and edition.
License Acceptance
By submitting this pull request, I confirm that my contribution is made under
the terms of the Apache 2.0 license. For more information on following Developer
Certificate of Origin and signing off your commits, please check
CONTRIBUTING.md.PR Checklist
tools/devtool checkstyleto verify that the PR passes theautomated style checks.
how they are solving the problem in a clear and encompassing way.
in the PR.
CHANGELOG.md.Runbook for Firecracker API changes.
integration tests.
TODO.rust-vmm.