Allow comparisons between CStr
, CString
, and Cow<CStr>
. by bjoernager · Pull Request #137268 · rust-lang/rust (original) (raw)
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 andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Conversation18 Commits1 Checks0 Files changed
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
[ Show hidden characters]({{ revealButtonHref }})
Closes: #137265
This PR adds the trait implementations proposed in the ACP under the c_string_eq_c_str
feature gate:
// core::ffi
impl PartialEq<&Self> for CStr;
impl PartialEq for CStr;
impl PartialEq<Cow<'_, Self>> for CStr;
// alloc::ffi
impl PartialEq for CString;
impl PartialEq<&CStr> for CString;
impl PartialEq<Cow<'_, CStr>> for CString;
// alloc::borrow
impl PartialEq for Cow<'_, CStr>;
impl PartialEq<&CStr> for Cow<'_, CStr>;
impl PartialEq for Cow<'_, CStr>;
As I understand it, stable traits cannot be unstably implemented for stable types, and we would thereby be forced to skip the FCP and directly stabilise these implementations (as is done in this PR).
(@joshtriplett mentioned that Crater may have to be run).
r? @Amanieu
rustbot has assigned @Amanieu.
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 added S-waiting-on-review
Status: Awaiting review from the assignee but also interested parties.
Relevant to the library team, which will review and decide on the PR/issue.
labels
@rustbot label +T-libs-api -T-libs
r? libs-api
rustbot added T-libs-api
Relevant to the library API team, which will review and decide on the PR/issue.
and removed T-libs
Relevant to the library team, which will review and decide on the PR/issue.
labels
This comment has been minimized.
bjoernager changed the title
Implement Allow comparisons between PartialEq<{&Self, CString}>
for CStr
and PartialEq<{CStr, &CStr}>
for CString
.CStr
, CString
, and Cow<CStr>
.
…ent 'PartialEq<{CStr, &CStr, Cow}>' for 'CString'; Implement 'PartialEq<{CStr, &CStr, CString}>' for 'Cow';
bors added a commit to rust-lang-ci/rust that referenced this pull request
Allow comparisons between CStr
, CString
, and Cow<CStr>
.
Closes: rust-lang#137265
This PR adds the trait implementations proposed in the ACP under the c_string_eq_c_str
feature gate:
// core::ffi
impl PartialEq<&Self> for CStr;
impl PartialEq<CString> for CStr;
impl PartialEq<Cow<'_, Self>> for CStr;
// alloc::ffi
impl PartialEq<CStr> for CString;
impl PartialEq<&CStr> for CString;
impl PartialEq<Cow<'_, CStr>> for CString;
// alloc::borrow
impl PartialEq<CStr> for Cow<'_, CStr>;
impl PartialEq<&CStr> for Cow<'_, CStr>;
impl PartialEq<CString> for Cow<'_, CStr>;
As I understand it, stable traits cannot be unstably implemented for stable types, and we would thereby be forced to skip the FCP and directly stabilise these implementations (as is done in this PR).
(@joshtriplett
mentioned that Crater may have to be run).
☀️ Try build successful - checks-actions
Build commit: 1f308f1 (1f308f12738d8cc40bb23bf0c8114b37c164bb49
)
🚧 Experiment pr-137268
is now running
ℹ️ Crater is a tool to run experiments across parts of the Rust ecosystem. Learn more
Team member @Amanieu has proposed to merge this. The next step is review by the rest of the tagged team members:
No concerns currently listed.
Once a majority of reviewers approve (and at most 2 approvals are outstanding), this will enter its final comment period. If you spot a major issue that hasn't been raised at any point in this process, please speak up!
See this document for info about what commands tagged team members can give me.
🔔 This is now entering its final comment period, as per the review above. 🔔
The final comment period, with a disposition to merge, as per the review above, is now complete.
As the automated representative of the governance process, I would like to thank the author for their work and everyone else who contributed.
This will be merged soon.
📌 Commit 817b093 has been approved by Amanieu
It is now in the queue for this repository.
bors added S-waiting-on-bors
Status: Waiting on bors to run and complete tests. Bors will change the label on completion.
and removed S-waiting-on-review
Status: Awaiting review from the assignee but also interested parties.
labels
bors added a commit that referenced this pull request
Rollup of 7 pull requests
Successful merges:
- #137268 (Allow comparisons between
CStr
,CString
, andCow<CStr>
.) - #142704 (Remove the deprecated unstable
concat_idents!
macro) - #142742 ([win][aarch64] Fix linking statics on Arm64EC, take 2)
- #142843 (Enable reproducible-build-2 for Windows MSVC)
- #142916 (rustdoc-json: Add test for
#[optimize(..)]
) - #142919 (rustdoc-json: Add test for
#[cold]
) - #142944 (Stats output tweaks)
Failed merges:
- #142825 (Port
#[track_caller]
to the new attribute system)
r? @ghost
@rustbot
modify labels: rollup
rust-timer added a commit that referenced this pull request
Rollup merge of #137268 - bjoernager:c-string-eq-c-str, r=Amanieu
Allow comparisons between CStr
, CString
, and Cow<CStr>
.
Closes: #137265
This PR adds the trait implementations proposed in the ACP under the c_string_eq_c_str
feature gate:
// core::ffi
impl PartialEq<&Self> for CStr;
impl PartialEq<CString> for CStr;
impl PartialEq<Cow<'_, Self>> for CStr;
// alloc::ffi
impl PartialEq<CStr> for CString;
impl PartialEq<&CStr> for CString;
impl PartialEq<Cow<'_, CStr>> for CString;
// alloc::borrow
impl PartialEq<CStr> for Cow<'_, CStr>;
impl PartialEq<&CStr> for Cow<'_, CStr>;
impl PartialEq<CString> for Cow<'_, CStr>;
As I understand it, stable traits cannot be unstably implemented for stable types, and we would thereby be forced to skip the FCP and directly stabilise these implementations (as is done in this PR).
(@joshtriplett
mentioned that Crater may have to be run).
workingjubilee added a commit to workingjubilee/rustc that referenced this pull request
…tr, r=Amanieu"
This reverts commit 30550c0, reversing changes made to 36b2163.
rust-bors bot added a commit that referenced this pull request
Revert "Rollup merge of #137268 - bjoernager:c-string-eq-c-str, r=Amanieu"
This reverts commit 30550c0, reversing changes made to 36b2163.
This is an experiment for purposes of retrying the relevant crater run.
r? @ghost
Labels
This issue / PR is in PFCP or FCP with a disposition to merge it.
The final comment period is finished for this PR / Issue.
Status: Waiting on bors to run and complete tests. Bors will change the label on completion.
Relevant to the library API team, which will review and decide on the PR/issue.