-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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 and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
simplify SourceID Ord/Eq #14980
simplify SourceID Ord/Eq #14980
Conversation
r? @weihanglo rustbot has assigned @weihanglo. Use |
Potential risk:
Though this is pretty niche and I doubt it impacts any real world use case. |
@rfcbot fcp merge I propose to the team to merge this. See the comment in 2a9527b for detailed explanation. tl;dr
If there is any implication we're missing here, please call it out! |
Team member @weihanglo 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. |
Note that all of the risks identified so far involve the implications to |
May I ask, do you have a real example of this? |
I don't, unfortunately. I don't even know if there is a language has such odd upper/lowercase comparison. CJK might potentially maybe? cc @Eh2406, is it possible to create one real example on your side? |
I only speak English. So I've no idea how realistic these examples are. But some googling found this list https://stackoverflow.com/questions/67106784/why-is-upper-casing-not-enough-for-case-insensitive-comparison and with the help of some intelligent auto complete here are sum reproducers https://play.rust-lang.org/?version=stable&mode=debug&edition=2021&gist=f4bc9bc63fa18a63f2e503442521e82c |
🔔 This is now entering its final comment period, as per the review above. 🔔 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks Jacob.
Since we have reached a consensus, going to merge this now. I don't think waiting for an entire 10-day FCP will make any difference. If there is a real use case, only when the change hits nightly and people start using it will we know.
Update cargo 18 commits in fd784878cfa843e3e29a6654ecf564c62fae6735..088d496082726091024f1689c124a0c3dccbd775 2025-01-03 20:06:26 +0000 to 2025-01-10 20:10:21 +0000 - docs(reference): Fix PkgIdSpec kind docs (rust-lang/cargo#15049) - feat: Added warning when failing to update index cache (rust-lang/cargo#15014) - docs(ref): Fix the inverted logic about MSRV (rust-lang/cargo#15044) - chore(deps): update msrv (1 version) to v1.84 (rust-lang/cargo#15041) - Remove unnecessary into conversions (rust-lang/cargo#15042) - docs(contrib): Start guidelines for schema design (rust-lang/cargo#15037) - fix: emit warnings as warnings when learning rust target info (rust-lang/cargo#15036) - fix(schemas): Fix the `[lints]` JSON Schema (rust-lang/cargo#15035) - fix(schemas): Fix 'metadata' JSON Schema (rust-lang/cargo#15033) - shorten comment on Ord for SourceKind (rust-lang/cargo#15029) - Make `"C"` explicit in `extern "C"`. (rust-lang/cargo#15034) - simplify SourceID Ord/Eq (rust-lang/cargo#14980) - Setup cargo environment for `cargo rustc --print` (rust-lang/cargo#15026) - Avoid naming variables `str` (rust-lang/cargo#15025) - Bump to 0.87.0; update changelog (rust-lang/cargo#15022) - Update libgit2 to 1.9 (rust-lang/cargo#15018) - Remove condition on RUSTUP_WINDOWS_PATH_ADD_BIN (rust-lang/cargo#15017) - Fix https::self_signed_should_fail for macos (rust-lang/cargo#15016)
### What does this PR try to resolve? In PR #14980, the Ord impl for SourceId was changed, but the comment wasn’t updated. So it is now incorrect. This PR updates the comment to match the implementation. ### How should we test and review this PR? Read the Ord for SourceId code and make sure the updated comment describes what it does. ### Additional information None
What does this PR try to resolve?
This is a followup to #14800. Like that PR, this is a small incremental change that does not pull its own weight. If this PR is accepted, the next PR will unlock large performance wins. I am not posting them together because the logic of why this PR is correct is subtle and deserves to be discussed and reviewed without unrelated code changes.
How should we test and review this PR?
All tests pass on all commits. This should be reviewed one commit at a time.
Additional information
I pushed one commit at a time, so that CI can confirm that the assert (in the first commit) is never hit.