Skip to content

Impl PartialEq/Ord<str/String> for Path[Buf] #31861

New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Closed
wants to merge 1 commit into from
Closed

Impl PartialEq/Ord<str/String> for Path[Buf] #31861

wants to merge 1 commit into from

Conversation

gkoz
Copy link
Contributor

@gkoz gkoz commented Feb 24, 2016

Sorry for revisiting this: when preparing #31751 I was still assuming that the <str> impls are already there. So currently OsStr can be compared to str and Path cannot. This seems both inconsistent and inconvenient.

I'm likely blind to some drawbacks and/or going over the top with combinations here. Could some of them be replaced with blanket impls for T: AsRef<Path>?

It would help if there was a coordinating issue for libstd trait impls with some goals, dos and don'ts.

@rust-highfive
Copy link
Contributor

r? @aturon

(rust_highfive has picked a reviewer for you, use r? to override)

@gkoz
Copy link
Contributor Author

gkoz commented Feb 24, 2016

Apparently this patch causes

src/libcollectionstest/btree/set.rs:226:20: 226:31 error: the trait `core::cmp::PartialEq<&str>` is not implemented for the type `str` [E0277]

src/libcollectionstest/btree/set.rs:226             self.0.partial_cmp(&other.0)

                                                           ^~~~~~~~~~~

I'm not yet sure how exactly.

@gkoz
Copy link
Contributor Author

gkoz commented Mar 1, 2016

Okay, with nightly becoming 1.9 in a few days this would have to be rewritten anyway.

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants