-
Notifications
You must be signed in to change notification settings - Fork 112
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
OpenVMM Rust 2024 Compatibility #288
Comments
This PR fixes up the easy issues with Rust 2024 compatibility and enables the lint for it. However it also scopes out some allows for the things that need some more work and focus. #288 is tracking them. Changes in this PR: - extern blocks are now unsafe - `gen` is becoming a reserved keyword, rename variables - mark unsafe attributes other than linkme's - resolve the ambiguity of `fn poll` in VmbusSerialDriver
Instead, just make our own environment clone. With additional parameters! And annoying type conversions! Part of #288
Part of #288. This is not yet enforced by clippy (rust-lang/rust-clippy#13316), but we should be doing it anyways.
…528) The Rust 2024 edition will be changing how `impl Trait` in return position functions. Namely it will be changing the rules from capturing no lifetimes, to capturing all lifetimes. The reasons for this are documented in [RFC 3498](https://github.com/rust-lang/rfcs/blob/master/text/3498-lifetime-capture-rules-2024.md) and [the migration guide](https://doc.rust-lang.org/nightly/edition-guide/rust-2024/rpit-lifetime-capture.html). A new 'precise capturing' syntax has been added to allow cases that don't need everything captured to scope down what they take. This PR updates all such cases to use the new syntax. Note that currently this new syntax requires all type parameters in scope to be listed. This currently results in overcapturing of type parameters. This will be relaxed in the future, and is tracked by [RFC 3617](rust-lang/rust#130043). This PR also marks the edition_2024_expr_fragment_specifier lint as no longer needing fixing, as I have completed an audit of all our macros that it flagged and none of them need changing. Part of #288
This PR fixes up the easy issues with Rust 2024 compatibility and enables the lint for it. However it also scopes out some allows for the things that need some more work and focus. microsoft#288 is tracking them. Changes in this PR: - extern blocks are now unsafe - `gen` is becoming a reserved keyword, rename variables - mark unsafe attributes other than linkme's - resolve the ambiguity of `fn poll` in VmbusSerialDriver
Some PRs are pending that will improve the behavior of the drop order lints in 1.87 (rust-lang/rust#137455, rust-lang/rust#137444). Given that we currently have over 1000 instances of those lints triggering I'm tempted to wait for these changes, unless we have a need to adopt the 2024 edition sooner. |
Yeah, I'd recommend to just wait a couple of days until that PR lands, and then try to migrate your crates with the latest nightly edition instead. |
rustfmt.toml's 'edition' key only controls parsing behavior. We should leave this to the default (read from Cargo.toml) so that rustfmt's parsing behavior always matches what our code is targeting. Formatting behavior is controlled by this separate key, 'style_edition', which we can change separately from the actual code edition. This will allow us to take 2024 edition formatting changes separately from code behavior changes, should we so choose. Part of #288
This brings Rust 2024 compatibility. Part of #288
Tracking issue for known problems that will prevent OpenVMM from adopting the Rust 2024 edition once it is released. Ideally we will fully turn on the
rust-2024-compatibility
lint and remove all allows before making the switch.undocumented_unsafe_blocks
) rust-lang/rust-clippy#13316)The text was updated successfully, but these errors were encountered: