You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Auto merge of rust-lang#137268 - bjoernager:c-string-eq-c-str, r=<try>
Allow comparisons between `CStr`, `CString`, and `Cow<CStr>`.
Closes: rust-lang#137265
This PR adds the trait implementations proposed in the [ACP](rust-lang/libs-team#517) under the `c_string_eq_c_str` feature gate:
```rust
// 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).
0 commit comments