Skip to content

Conversation

kpp
Copy link
Contributor

@kpp kpp commented Sep 2, 2025

Remove two unsafe {} in the code. Blocked until rustc 1.83 MSRV.

@github-actions github-actions bot added the R-loom-sync Run loom sync tests on this PR label Sep 2, 2025
@mox692 mox692 added A-tokio Area: The main tokio crate M-sync Module: tokio/sync S-blocked-on-msrv Status: need an MSRV bump to progress labels Sep 2, 2025
@ADD-SP ADD-SP added S-blocked-on-msrv Status: need an MSRV bump to progress and removed S-blocked-on-msrv Status: need an MSRV bump to progress labels Sep 2, 2025
Copy link
Member

@ADD-SP ADD-SP left a comment

Choose a reason for hiding this comment

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

The UnsafeCell::get_mut is available since 1.50.0, and become const since 1.83.

Thanks!

@ADD-SP ADD-SP changed the title Use safe UnsafeCell::get_mut in 1.83 sync: use UnsafeCell::get_mut in Mutex Sep 4, 2025
@ADD-SP ADD-SP changed the title sync: use UnsafeCell::get_mut in Mutex sync: use UnsafeCell::get_mut for Mutex::get_mut and RwLock::get_mut Sep 4, 2025
@ADD-SP ADD-SP changed the title sync: use UnsafeCell::get_mut for Mutex::get_mut and RwLock::get_mut sync: use UnsafeCell::get_mut in Mutex::get_mut and RwLock::get_mut Sep 4, 2025
@ADD-SP ADD-SP merged commit a99a351 into tokio-rs:master Sep 4, 2025
98 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-tokio Area: The main tokio crate M-sync Module: tokio/sync R-loom-sync Run loom sync tests on this PR
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants