crates: upgrade to 2024 edition and set and check MSRV of 1.85#9005
Open
daywalker90 wants to merge 4 commits intoElementsProject:masterfrom
Open
crates: upgrade to 2024 edition and set and check MSRV of 1.85#9005daywalker90 wants to merge 4 commits intoElementsProject:masterfrom
daywalker90 wants to merge 4 commits intoElementsProject:masterfrom
Conversation
Also bump the resolver version so `cargo update` will respect this MSRV. Changelog-None
Changelog-None
I've ran `cargo fix --edition` and three changes were noticeable: - set_var is now unsafe, i've added a SAFETY comment on each to explain why this is fine here. - conversions of several if let to match because of the new if let temporary scope I have reviewed and restored all of them since the behaviour was the same on each. - the macro expr was converted to expr_2021 in the lsps plugin, i have reverted those aswell since we don't use const or _ expressions Changelog-None
`cargo fmt --all` Changelog-None
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.
Previously the MSRV was only implied as 1.85 in some places in the project. Now we set it explicitly for cargo and check it on any rust related file changes with a CI job and make full use of it with the new 2024 edition.
I've ran
cargo fix --editionand three changes were noticeable:set_varis now unsafe, i've added a SAFETY comment on each to explain whythis is fine here.
if lettomatchbecause of the newif lettemporary scopeI have reviewed and restored all of them since the behaviour was the same on each.
exprwas converted toexpr_2021in the lsps plugin, i have reverted thoseas well since we don't use
constor_expressions: Macro fragment specifiersAlso a
cargo fmt --allrun for the new formatting rules of 2024 editionThese changes will make
cargo updateon all rust versions use the new resolver to upgrade dependencies only as far as 1.85 supports. That is only part of ensuring the MSRV and it's also not perfect. There might also be new code patterns not supported by 1.85 so we need the CI job to verify the MSRV.We do all this so people with current distros don't necessarily need to install and manage rust with
rustup.