Skip to content

feat: providing PartialOrd<OsStr> for str - #151567

Open
WrldEngine wants to merge 3 commits into
rust-lang:mainfrom
WrldEngine:patch-1-kamran
Open

WrldEngine wants to merge 3 commits into
rust-lang:mainfrom
WrldEngine:patch-1-kamran

Conversation

@WrldEngine

Copy link
Copy Markdown

#19470

Make PartialOrd OsStr for str, issue was above

@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 Jan 24, 2026
@rustbot

rustbot commented Jan 24, 2026

Copy link
Copy Markdown
Collaborator

r? @tgross35

rustbot has assigned @tgross35.
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

Comment thread library/std/src/ffi/os_str.rs Resolved
@tgross35

Copy link
Copy Markdown
Member

#19470

Looks like this isn't the right issue link, that's from 2014

@WrldEngine

Copy link
Copy Markdown
Author

#19470

Looks like this isn't the right issue link, that's from 2014

I see this issue in comments

@tgross35

Copy link
Copy Markdown
Member

Please link it then, neither PartialOrd and OsStr show up in that thread from what I can see.

Removed comments about instability and coherence issues.
@WrldEngine

WrldEngine commented Jan 24, 2026 •

Copy link
Copy Markdown
Author

Please link it then, neither PartialOrd and OsStr show up in that thread from what I can see.

// FIXME (#19470): cannot provide PartialOrd<OsStr> for str until we
// have more flexible coherence rules.

This commented by Aaron Turon, maybe it is related issue

Comment thread library/std/src/ffi/os_str.rs Resolved
@tgross35

Copy link
Copy Markdown
Member

Oh, duh, I missed that. You can delete that comment.

Nominating as this is an insta-stable trait implementation:

@rustbot label +I-libs-api-nominated

@rustbot rustbot added the I-libs-api-nominated [DEPRECATED; DO NOT USE] label Jan 24, 2026
@WrldEngine

WrldEngine commented Jan 24, 2026 •

Copy link
Copy Markdown
Author
image

@tgross35 can you look at this please?

Looks like it is not direct error to this implementation, It is impls conflict, can it be serious problem for the review? Should I close this PR?

And with the addition of this tag (libs-api-nominated), should I expect more reviewers? Or not?

@rust-log-analyzer

Copy link
Copy Markdown
Collaborator

The job aarch64-gnu-llvm-20-2 failed! Check out the build log: (web) (plain enhanced) (plain)

Click to see the possible cause of the failure (guessed by this bot)
[RUSTC-TIMING] corebenches test:true 9.727
error[E0277]: can't compare `str` with `&str`
##[error]   --> alloctests/../alloc/src/collections/btree/set/tests.rs:540:32
    |
540 |             self.0.partial_cmp(&other.0)
    |                    ----------- ^^^^^^^^ no implementation for `str < &str` and `str > &str`
    |                    |
    |                    required by a bound introduced by this call
    |
    = help: the trait `PartialOrd<&str>` is not implemented for `str`
help: the following other types implement trait `PartialOrd<Rhs>`
   --> library/std/src/ffi/os_str.rs:1555:0
    |
    = note: `str` implements `PartialOrd<OsStr>`
   --> library/core/src/str/traits.rs:46:0
    |
    = note: `str` implements `PartialOrd`

For more information about this error, try `rustc --explain E0277`.
[RUSTC-TIMING] alloctests test:true 6.433
error: could not compile `alloctests` (lib test) due to 1 previous error
warning: build failed, waiting for other jobs to finish...
[RUSTC-TIMING] alloctests test:true 16.629
[RUSTC-TIMING] coretests test:true 67.044
env -u RUSTC_WRAPPER CARGO_ENCODED_RUSTDOCFLAGS="-Csymbol-mangling-version=v0\u{1f}-Zannotate-moves\u{1f}-Zrandomize-layout\u{1f}-Zunstable-options\u{1f}--check-cfg=cfg(bootstrap)\u{1f}-Wrustdoc::invalid_codeblock_attributes\u{1f}--crate-version\u{1f}1.95.0-nightly\t(0c4fe2e7a\t2026-01-24)" CARGO_ENCODED_RUSTFLAGS="-Csymbol-mangling-version=v0\u{1f}-Zannotate-moves\u{1f}-Zrandomize-layout\u{1f}-Zunstable-options\u{1f}--check-cfg=cfg(bootstrap)\u{1f}-Zmacro-backtrace\u{1f}-Csplit-debuginfo=off\u{1f}-Clink-arg=-L/usr/lib/llvm-20/lib\u{1f}-Cllvm-args=-import-instr-limit=10\u{1f}-Clink-args=-Wl,-z,origin\u{1f}-Clink-args=-Wl,-rpath,$ORIGIN/../lib\u{1f}-Alinker-messages\u{1f}--cap-lints=allow\u{1f}--cfg\u{1f}randomized_layouts" RUSTC="/checkout/obj/build/aarch64-unknown-linux-gnu/stage2-codegen/cg_clif/dist/rustc-clif" RUSTDOC="/checkout/obj/build/aarch64-unknown-linux-gnu/stage2-codegen/cg_clif/dist/rustdoc-clif" "/checkout/obj/build/aarch64-unknown-linux-gnu/stage0/bin/cargo" "test" "--manifest-path" "/checkout/obj/build/aarch64-unknown-linux-gnu/stage2-codegen/cg_clif/build/sysroot_tests/Cargo.toml" "--target-dir" "/checkout/obj/build/aarch64-unknown-linux-gnu/stage2-codegen/cg_clif/build/sysroot_tests_target" "--locked" "--target" "aarch64-unknown-linux-gnu" "-p" "coretests" "-p" "alloctests" "--tests" "--" "-q" exited with status ExitStatus(unix_wait_status(25856))
Command `/checkout/obj/build/aarch64-unknown-linux-gnu/stage0/bin/cargo run -Zwarnings --target aarch64-unknown-linux-gnu -Zbinary-dep-depinfo -j 4 -Zroot-dir=/checkout --locked --color=always --profile=release --manifest-path /checkout/compiler/rustc_codegen_cranelift/build_system/Cargo.toml -- test --download-dir /checkout/obj/build/cg_clif_download --out-dir /checkout/obj/build/aarch64-unknown-linux-gnu/stage2-codegen/cg_clif --no-unstable-features --use-backend cranelift --sysroot llvm --skip-test testsuite.extended_sysroot [workdir=/checkout/compiler/rustc_codegen_cranelift]` failed with exit code 1
Created at: src/bootstrap/src/core/build_steps/test.rs:3867:25
Executed at: src/bootstrap/src/core/build_steps/test.rs:3912:26

Command has failed. Rerun with -v to see more details.
Bootstrap failed while executing `--stage 2 test --skip tests --skip coverage-map --skip coverage-run --skip library --skip tidyselftest`
Build completed unsuccessfully in 0:26:12
  local time: Sat Jan 24 05:49:22 UTC 2026
  network time: Sat, 24 Jan 2026 05:49:23 GMT
##[error]Process completed with exit code 1.

@WrldEngine
WrldEngine requested a review from tgross35 January 24, 2026 08:59
@WrldEngine WrldEngine closed this Jan 25, 2026
@rustbot rustbot removed the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Jan 25, 2026
@WrldEngine WrldEngine reopened this Jan 25, 2026
@rustbot rustbot added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Jan 25, 2026
@rust-log-analyzer

Copy link
Copy Markdown
Collaborator

The job pr-check-1 failed! Check out the build log: (web) (plain enhanced) (plain)

Click to see the possible cause of the failure (guessed by this bot)
REPOSITORY                                   TAG       IMAGE ID       CREATED      SIZE
ghcr.io/dependabot/dependabot-updater-core   latest    354d02aa29ac   5 days ago   783MB
=> Removing docker images...
Deleted Images:
untagged: ghcr.io/dependabot/dependabot-updater-core:latest
untagged: ghcr.io/dependabot/dependabot-updater-core@sha256:596da3f22bcbdff2c96fd7126001278022c834c1621c5efa2ad1a7794590636c
deleted: sha256:354d02aa29acf525570c732b6e006ecf138de6d63ca525d552eb4b24880ddc6c
deleted: sha256:8b7af0e426bc2cbeeacfd96b8354d3b80016991520977197e62090e47abaede8
deleted: sha256:cadf11ef1de7fdd5eab563757942353684047f09b212dc99d6ed48e8acf34d62
deleted: sha256:569b0caf9d5285db44ccd2629a3470139eea755be423a33a54d8a24cb3926bfa
deleted: sha256:f9dc5feb048d8f9fd43137e3998f59e9acfbd76c47a4e14984d109654119e282
---
[RUSTC-TIMING] build_script_build test:false 0.183
error[E0277]: can't compare `str` with `String`
   --> /cargo/registry/src/index.crates.io-1949cf8c6b5b557f/find-msvc-tools-0.1.5/src/find_tools.rs:888:29
    |
888 |                     && name > &version_file
    |                             ^ no implementation for `str < String` and `str > String`
    |
    = help: the trait `PartialOrd<String>` is not implemented for `str`
    = note: required for `&str` to implement `PartialOrd<&String>`
help: consider dereferencing both sides of the expression
    |
888 -                     && name > &version_file
888 +                     && *name > *version_file
    |

For more information about this error, try `rustc --explain E0277`.
[RUSTC-TIMING] find_msvc_tools test:false 0.619
error: could not compile `find-msvc-tools` (lib) due to 1 previous error

@tgross35 tgross35 removed the I-libs-api-nominated [DEPRECATED; DO NOT USE] label Jan 26, 2026
@tgross35

tgross35 commented Jan 26, 2026 •

Copy link
Copy Markdown
Member

I don't have a chance to validate right now, but I'm guessing it might not auto-deref now that there are multiple possible implementations? You can ask on zulip to see if anyone has any ideas. Or change the part giving you the error and we can crater it.

If it winds up that we can't really change this, it would be worthwhile to update the comment with the new details.

Un-nominated until that issue can be figured out.

@tgross35

Copy link
Copy Markdown
Member

@rustbot author

@rustbot rustbot removed the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Jan 26, 2026
@rustbot

rustbot commented Jan 26, 2026

Copy link
Copy Markdown
Collaborator

Reminder, once the PR becomes ready for a review, use @rustbot ready.

@rustbot rustbot added the S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. label Jan 26, 2026
@SpriteOvO

Copy link
Copy Markdown
Member

@WrldEngine Hi, ping from triage team. This PR has been inactive for a while. Are there any updates on this? Thanks.

@WrldEngine

Copy link
Copy Markdown
Author

@WrldEngine Hi, ping from triage team. This PR has been inactive for a while. Are there any updates on this? Thanks.

Good morning triage team! I still waiting for review

@Dylan-DPC Dylan-DPC added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. and removed S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. labels May 4, 2026
@tgross35

Copy link
Copy Markdown
Member

Nothing changed from the above:

I don't have a chance to validate right now, but I'm guessing it might not auto-deref now that there are multiple possible implementations? You can ask on zulip to see if anyone has any ideas. Or change the part giving you the error and we can crater it.

I'm not sure what the issue is so @WrldEngine you can ask around or change this to an experimental PR that we can crater.

@rustbot author

@rustbot rustbot added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels May 18, 2026
@tgross35

Copy link
Copy Markdown
Member

@WrldEngine gentle ping, this needs you to do some investigation

@WrldEngine

Copy link
Copy Markdown
Author

Honestly, do whatever you want, I’ve lost faith in the rust community. As soon as a problem becomes very popular, some talentless AI sloppers quickly making pull requests, and even claim they wrote the code themselves. If an issue is nontrivial or complex, i have to wait for feedback from your team most of whom don’t even want to know what’s going on with that particular issue - only to have it rejected or ignored with a response like, “Oh, I don’t really understand this issue myself, let others take a look and weigh in, and we’ll close it in a few days” where, in the end, no one except rustbot actually looked at anything. Even with the jungle in the compiler, the same problem is evident.

All these labels and the processes surrounding them are just a waste of time, sometimes it seems to me that most people don’t care about the language, and that they just like imitation of work, not the real one.
If you think the community should thank you and you get upset when that doesn't happen - let me relieve you of that burden, and let everyone write whatever they want separatedly.

Despite its good front end, Rust has a lot of design flaws and hard-coded elements. But this even not close for disscussion in your comminities

Zulip is the worst platform for disscussing something, very uncomfortable platform, harder even discord

@tgross35

Copy link
Copy Markdown
Member

Well, that's rather disheartening to hear. I'm sorry that has been your experience.

We have to expect that contributors are willing to do a bit of poking around for issues they care about, that's always needed. Speaking for myself, I'm happy to answer any questions about the suggested ways to make progress at #151567 (comment). But I can't do that background research myself, and it's not fair to expect that one individual reviewer has all the answers: that's why we have places to discuss with more people.

And we certainly do care about the language, there is no paycheck that comes with being involved. Processes like labels and bots help organize the chaos (I don't understand that concern).

Despite its good front end, Rust has a lot of design flaws and hard-coded elements. But this even not close for disscussion in your comminities

Please discuss it! It needs to happen in the right place (typically Zulip), but there is zero harm in talking about improvement ideas you may have.

Zulip is the worst platform for disscussing something, very uncomfortable platform, harder even discord

It does take a bit of getting used to, but then it is actually a very nice platform for technical discussion. It's much more organized than many alternatives.

This branch has not been deployed

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

Labels

S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. T-libs Relevant to the library 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