Rust: Use of raw RWLock instead of RwLock

Created on 6 May 2019  路  2Comments  路  Source: rust-lang/rust

https://github.com/rust-lang/rust/blob/7ac02005f3d7ac4b2c32b82dde365107aa2aafdf/src/libstd/panicking.rs#L57-L58

looking at these two lines of code is very frightening.
Is there a specific reason to use RWLock instead of RwLock? I would open a PR with either using RwLock or a comment describing why RWLock is needed here.

@rustbot modify labels: T-libs

C-cleanup T-libs

Most helpful comment

RwLock can't be statically initialized, or at least couldn't be when that code was written. That'll change once the parking_lot PR lands.

All 2 comments

Just another thought, isn't the naming itself a bit dangerous? RW vs. Rw seems like an easy typo to make. Perhaps renaming RW as RawRw could help?

RwLock can't be statically initialized, or at least couldn't be when that code was written. That'll change once the parking_lot PR lands.

Was this page helpful?
0 / 5 - 0 ratings