Skip to content
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

Use more Rust features allowed under REPO_MSRV #6887

Merged
merged 5 commits into from
Jan 10, 2025

Conversation

ErichDonGubler
Copy link
Member

@ErichDonGubler ErichDonGubler commented Jan 9, 2025

A veritable grab bag of miscellaneous Rust features that we can now use for crates under REPO_MSRV:

  • Removal of std::mem imports.
  • Using std::sync::LazyLock instead of once_cell::Lazy.
  • #[expect(…)] instead of #[allow(…)] (where I was able to make it work)

@ErichDonGubler ErichDonGubler added the kind: refactor Making existing function faster or nicer label Jan 9, 2025
@ErichDonGubler ErichDonGubler self-assigned this Jan 9, 2025
@ErichDonGubler ErichDonGubler force-pushed the repo_msrv-upgrades branch 3 times, most recently from cb586c7 to ad2b3db Compare January 9, 2025 19:05
`std::mem::{size,align}_of{,_val}` was added to `std::prelude` in Rust
1.80; see
[`rust`#123168](rust-lang/rust#123168).
Weaken our dependence on the `once_cell` crate by using functionality
from `std` instead that was upstreamed from `once_cell`, this time with
what's available in Rust 1.80+.

It's not yet possible to eliminate this dependency entirely, but do what
we can with `REPO_MSRV` for now.
Remove or `expect` clear-cut `allow` statements that were easy for me to
figure out.
@ErichDonGubler ErichDonGubler marked this pull request as ready for review January 10, 2025 21:05
@ErichDonGubler ErichDonGubler requested a review from a team as a code owner January 10, 2025 21:05
Copy link
Member

@cwfitzgerald cwfitzgerald left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice!

@cwfitzgerald cwfitzgerald added this pull request to the merge queue Jan 10, 2025
Merged via the queue into gfx-rs:trunk with commit d9cc727 Jan 10, 2025
29 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind: refactor Making existing function faster or nicer
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

2 participants