simplify SourceID Ord/Eq by Eh2406 · Pull Request #14980 · rust-lang/cargo (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

Conversation10 Commits2 Checks20 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 }})

Eh2406

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.

@Eh2406

@rustbot

r? @weihanglo

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

@Eh2406

@weihanglo

Potential risk:

If someone has two alternate registry hosted on github whose name has one of the weird languages where a < b does not imply a.to_lower() < b.to_lower() (we did this normalization in CanonicialUrl for only github.com domain), then the package order in the lockfile file could switch between different versions of Cargo.

Though this is pretty niche and I doubt it impacts any real world use case.

@Eh2406 Eh2406 marked this pull request as ready for review

December 24, 2024 21:53

@weihanglo

@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!

@rfcbot

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.

@Eh2406

Note that all of the risks identified so far involve the implications to ord and the performance benefits mostly relate to eq. If more risks are found, or the risks related to ord are to painful this PR can be updated to leave ord as is and instead do the comparable thing directly on eq. I prefer the code simplicity of eq delegating to ord, but opinions can legitimately vary.

@0xPoe

If someone has two alternate registry hosted on github whose name has one of the weird languages where a < b does not imply a.to_lower() < b.to_lower()

May I ask, do you have a real example of this?

@weihanglo

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?

@Eh2406

@rfcbot

🔔 This is now entering its final comment period, as per the review above. 🔔

weihanglo

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.

Merged via the queue into rust-lang:master with commit b696870

Jan 7, 2025

20 checks passed

bors added a commit to rust-lang-ci/rust that referenced this pull request

Jan 11, 2025

@bors

github-merge-queue bot pushed a commit that referenced this pull request

Jan 25, 2025

@weihanglo

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

wip-sync pushed a commit to NetBSD/pkgsrc-wip that referenced this pull request

Apr 9, 2025

@he32

Upstream changes relative to 1.85.1:

Version 1.86.0 (2025-04-03)

Language

Compiler

Platform Support

Refer to Rust's [platform support page][platform-support-doc] for more information on Rust's tiered platform support.

Libraries

Stabilized APIs

These APIs are now stable in const contexts:

Cargo

Rustdoc

Compatibility Notes

Internal Changes

These changes do not affect any public interfaces of Rust, but they represent significant improvements to the performance or internals of rustc and related tools.

tmeijn pushed a commit to tmeijn/dotfiles that referenced this pull request

May 10, 2025

@tmeijn

This MR contains the following updates:

Package Update Change
rust minor 1.85.1 -> 1.86.0

MR created with the help of el-capitano/tools/renovate-bot.

Proposed changes to behavior should be submitted there as MRs.


Release Notes

rust-lang/rust (rust)

v1.86.0

Compare Source

==========================

Language

Compiler

Platform Support

Refer to Rust's [platform support page][platform-support-doc] for more information on Rust's tiered platform support.

Libraries

Stabilized APIs

These APIs are now stable in const contexts:

Cargo

Rustdoc

Compatibility Notes

Internal Changes

These changes do not affect any public interfaces of Rust, but they represent significant improvements to the performance or internals of rustc and related tools.


Configuration

📅 Schedule: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined).

🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.

Rebasing: Whenever MR becomes conflicted, or you tick the rebase/retry checkbox.

🔕 Ignore: Close this MR and you won't be reminded about this update again.



This MR has been generated by Renovate Bot.

netbsd-srcmastr pushed a commit to NetBSD/pkgsrc that referenced this pull request

Jun 16, 2025

@he32

Pkgsrc changes:

Upstream changes:

Version 1.86.0 (2025-04-03)

Language

Compiler

Platform Support

Refer to Rust's [platform support page][platform-support-doc] for more information on Rust's tiered platform support.

Libraries

Stabilized APIs

These APIs are now stable in const contexts:

Cargo

Rustdoc

Compatibility Notes

Internal Changes

These changes do not affect any public interfaces of Rust, but they represent significant improvements to the performance or internals of rustc and related tools.