Update Rust edition to 2024#2049
Open
ImplOfAnImpl wants to merge 3 commits intomasterfrom
Open
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The breaking changes are:
genis a reserved keyword now, so the raw syntax has to be uses instead -r#gen(though after therandupgrade there are only a few places that had to be changed).impl Traitnow implicitly captures all lifetime parameters, so an explicituse<..>has to be used where it's not what is needed.refkeyword can be used. Basically, redundantrefs are now disallowed.std::env::{set_var, remove_var}are nowunsafe(but note that they were never safe to use in multithreaded environments on *nix, including the case when an env var is set at the start of atokio::mainand a multithreaded runtime is used).There were different scenarios where we were using them:
RUST_LOGto "info". I removed that, now the default value can be passed to logger initialization functions and if it's not, then "info" will be used by default.RUST_BACKTRACEto "full". For this I added theenable_rust_backtracemacro that must be called at the module scope, so that the env var is set beforemainortokio::mainis entered. It usesctorunder the hood, so I also upgradedctorto 0.10.Also, backtrace wasn't enabled in api-web-server for some reason, so I enabled it there for consistency.
I wrapped the functions in non-unsafe ones in test-utils, to avoid writing
unsafeevery time, and wrote a comment about how to deal with the potential problems. We only have 2 env-modifying tests - in logging and utils, and I turned them into integration tests, to ensure they're not run in parallel with anything else.Additionally,
if let ...can now be chained with other conditions; though not a breaking change, clippy insists that all such calls should be chained, so I indulged.P.S.
style_edition = "2021"to prevent it from reformatting the code all over the place. I'll remove it and reformat the code in a follow-up PR.cargo update opensslto address some of the dependabot errors.