Make RwLockReadGuard
covariant over its type parameter
#80392
Labels
A-concurrency
Area: Concurrency related issues.
C-enhancement
Category: An issue proposing an enhancement or a PR with one.
E-help-wanted
Call for participation: Help is requested to fix this issue.
T-libs-api
Relevant to the library API team, which will review and decide on the PR/issue.
Currently
RwLockReadGuard
is invariant over its type parameter, meaning that for instance this sound code:Will not compile. However, since
RwLockReadGuard
does not allow for mutation of the inner value, it would be sound to make it covariant, and it would be useful in some circumstances.See also the same issue in parking_lot.
The text was updated successfully, but these errors were encountered: