-
-
Notifications
You must be signed in to change notification settings - Fork 14.4k
constify Cow::Owned types
#146532
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
constify Cow::Owned types
#146532
Conversation
|
r? @ibraheemdev rustbot has assigned @ibraheemdev. Use |
ce9573b to
e84a425
Compare
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
`Cow` already has a `Deref<Target=B>` implementation that is `const` when the `Borrow` impl from the owned type is also `const`. However, none of the major types actually implement this, so the `Deref` impl doesn't really work. This change constifies the two major `Cow::Owned` types so that the `Deref` impl on `Cow` will work for those two types.
e8737a1 to
89f4adb
Compare
|
This PR was rebased onto a different master commit. Here's a range-diff highlighting what actually changed. Rebasing is a normal part of keeping PRs up to date, so no action is needed—this note is just to help reviewers. |
|
r? libs-api |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good. Not sure if we should find another binding reviewer.
Cowalready has aDeref<Target=B>implementation that isconstwhen theBorrowimpl from the owned type is alsoconst. However, none of the major types actually implement this, so theDerefimpl doesn't really work.This change constifies the two major
Cow::Ownedtypes so that theDerefimpl onCowwill work for those two types.