-
-
Notifications
You must be signed in to change notification settings - Fork 14.9k
Make RwLockReadGuard covariant over its type parameter #80392
Copy link
Copy link
Closed
Labels
A-concurrencyArea: ConcurrencyArea: ConcurrencyC-enhancementCategory: An issue proposing an enhancement or a PR with one.Category: An issue proposing an enhancement or a PR with one.E-help-wantedCall for participation: Help is requested to fix this issue.Call for participation: Help is requested to fix this issue.T-libs-apiRelevant to the library API team, which will review and decide on the PR/issue.Relevant to the library API team, which will review and decide on the PR/issue.
Metadata
Metadata
Assignees
Labels
A-concurrencyArea: ConcurrencyArea: ConcurrencyC-enhancementCategory: An issue proposing an enhancement or a PR with one.Category: An issue proposing an enhancement or a PR with one.E-help-wantedCall for participation: Help is requested to fix this issue.Call for participation: Help is requested to fix this issue.T-libs-apiRelevant to the library API team, which will review and decide on the PR/issue.Relevant to the library API team, which will review and decide on the PR/issue.
Type
Fields
Give feedbackNo fields configured for issues without a type.
Currently
RwLockReadGuardis invariant over its type parameter, meaning that for instance this sound code:Will not compile. However, since
RwLockReadGuarddoes 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.