Update MSRV to Rust 1.82 and replace once_cell with std equivalents#2217
Merged
Update MSRV to Rust 1.82 and replace once_cell with std equivalents#2217
Conversation
Copilot
AI
changed the title
[WIP] Update MSRV to Rust 1.82 and replace once_cell usage
Update MSRV to Rust 1.82 and replace once_cell with std equivalents
Oct 13, 2025
This couldn't happen everywhere just yet. Co-authored-by: Byron <63622+Byron@users.noreply.github.com>
c87d09f to
0eb90d3
Compare
240cfad to
c9e7d5a
Compare
e430454 to
6819e54
Compare
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.
This PR updates the Minimum Supported Rust Version (MSRV) to 1.82 and replaces most usages of the
once_cellcrate with standard library equivalents that are now available in stable Rust.Changes
MSRV Update
Updated
rust-versionfrom various versions (1.70, 1.74) to1.82in 78 Cargo.toml files across the repository.once_cell Replacements
Replaced all 26 instances of
once_cell::sync::Lazywithstd::sync::LazyLock(stable since Rust 1.80):gix-tempfile/src/{lib.rs, signal.rs}tests/tools/src/lib.rsgix-path/src/env/{mod.rs, git/mod.rs, auxiliary.rs}gix/src/interrupt.rssrc/shared.rstests/it/src/commands/check_mode.rsWhy OnceCell Remains
The
OnceCelltype ingix-features/src/threading.rscontinues to useonce_cellbecausestd::sync::OnceLock::get_or_try_init()is not yet stable in Rust (tracking issue: rust-lang/rust#109737). This method is essential for error handling during lazy initialization in multiple places throughout the codebase, particularly ingix/src/config/cache/access.rs.Once
get_or_try_init()is stabilized, we can complete the migration by updating theOnceCelltype aliases to usestd::sync::OnceLockandstd::cell::OnceCell.Dependency Cleanup
Removed the
once_celldependency from 12 Cargo.toml files where it's no longer needed. The dependency is retained only ingix-features(with theonce_cellfeature flag) to support theOnceCelltype until the standard library API is fully stabilized.Testing
Original prompt
💬 Share your feedback on Copilot coding agent for the chance to win a $200 gift card! Click here to start the survey.