rustc: Compare paths with --extern, not bytes#15971
Merged
Merged
Conversation
The right hand side of the comparison in these checks are values of type Option<&Path> which are normalized versions of the left-hand side, so they're not guaranteed to be byte-for-byte equivalent even though they're the same path. For this reasons, the command line arguments are promoted to paths for comparison of equality. This fixes a bug on windows where if a library was specified with --extern it would then be picked up twice because it was not considered to have been previously registered.
bors
added a commit
that referenced
this pull request
Jul 25, 2014
The right hand side of the comparison in these checks are values of type Option<&Path> which are normalized versions of the left-hand side, so they're not guaranteed to be byte-for-byte equivalent even though they're the same path. For this reasons, the command line arguments are promoted to paths for comparison of equality. This fixes a bug on windows where if a library was specified with --extern it would then be picked up twice because it was not considered to have been previously registered.
bors
added a commit
to rust-lang-ci/rust
that referenced
this pull request
Dec 4, 2023
fix: don't make `MissingMatchArms` diagnostic for empty match body before <img width="423" alt="before" src="https://github.com/rust-lang/rust-analyzer/assets/71162630/5c0e46fb-0c03-42f2-96ff-8e5245c25965"> after <img width="423" alt="after" src="https://github.com/rust-lang/rust-analyzer/assets/71162630/e2479dc5-3634-479b-af29-0b0ec7dc4a4f"> close rust-lang/rust-analyzer#15954
flip1995
pushed a commit
to flip1995/rust
that referenced
this pull request
Oct 31, 2025
Violets are red, Roses are blue, Ghosts haunt the night, And pumpkins grin too. ----- Meet @thefiddler's Mowgli and @bjornwein's Buffy, our winners at rust-lang/rust-clippy#15670 It's our first dual winner of the Clippy Cat Changelog Contest! <img width="1100" height="714" alt="image" src="https://github.com/user-attachments/assets/ee9399d5-f8bd-45bb-a18c-c24a94817672" /> <img width="1664" height="1940" alt="image" src="https://github.com/user-attachments/assets/2734c5df-2ebc-465f-89e4-5801f4d33678" /> ----- Cats for the next release can be traditionally nominated in the comments. changelog: none r? flip1995
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The right hand side of the comparison in these checks are values of type
Option<&Path> which are normalized versions of the left-hand side, so they're
not guaranteed to be byte-for-byte equivalent even though they're the same path.
For this reasons, the command line arguments are promoted to paths for
comparison of equality.
This fixes a bug on windows where if a library was specified with --extern it
would then be picked up twice because it was not considered to have been
previously registered.