Skip to content

constify Cow::Owned types#146532

Open
npmccallum wants to merge 1 commit into
rust-lang:mainfrom
npmccallum:cow_borrow
Open

constify Cow::Owned types#146532
npmccallum wants to merge 1 commit into
rust-lang:mainfrom
npmccallum:cow_borrow

Conversation

@npmccallum

Copy link
Copy Markdown
Contributor

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.

@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-libs Relevant to the library team, which will review and decide on the PR/issue. labels Sep 14, 2025
@rustbot

rustbot commented Sep 14, 2025

Copy link
Copy Markdown
Collaborator

r? @ibraheemdev

rustbot has assigned @ibraheemdev.
They will have a look at your PR within the next two weeks and either review your PR or reassign to another reviewer.

Use r? to explicitly pick a reviewer

@rustbot

This comment has been minimized.

@rustbot

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.
@rustbot

rustbot commented Oct 15, 2025

Copy link
Copy Markdown
Collaborator

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.

@joboet

joboet commented Nov 1, 2025

Copy link
Copy Markdown
Member

r? libs-api

@rustbot rustbot added the T-libs-api Relevant to the library API team, which will review and decide on the PR/issue. label Nov 1, 2025
@rustbot rustbot assigned BurntSushi and unassigned ibraheemdev Nov 1, 2025

@tisonkun tisonkun left a comment

Copy link
Copy Markdown
Contributor

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.

View changes since this review

@rust-bors

rust-bors Bot commented Feb 14, 2026

Copy link
Copy Markdown
Contributor

☔ The latest upstream changes (presumably #152574) made this pull request unmergeable. Please resolve the merge conflicts.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-libs Relevant to the library team, which will review and decide on the PR/issue. T-libs-api Relevant to the library API team, which will review and decide on the PR/issue.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants