Skip to content

crates: upgrade to 2024 edition and set and check MSRV of 1.85#9005

Open
daywalker90 wants to merge 4 commits intoElementsProject:masterfrom
daywalker90:rust-msrv
Open

crates: upgrade to 2024 edition and set and check MSRV of 1.85#9005
daywalker90 wants to merge 4 commits intoElementsProject:masterfrom
daywalker90:rust-msrv

Conversation

@daywalker90
Copy link
Copy Markdown
Collaborator

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 --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
    as well since we don't use const or _ expressions: Macro fragment specifiers

Also a cargo fmt --all run for the new formatting rules of 2024 edition

These changes will make cargo update on 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.

@daywalker90 daywalker90 requested a review from cdecker as a code owner March 30, 2026 12:16
Also bump the resolver version so `cargo update` will respect this MSRV.

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
@daywalker90 daywalker90 added this to the 26.06 milestone Mar 31, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant