rustc: Prevent false positives in crate loading#13017
Closed
alexcrichton wants to merge 1 commit intorust-lang:masterfrom
Closed
rustc: Prevent false positives in crate loading#13017alexcrichton wants to merge 1 commit intorust-lang:masterfrom
alexcrichton wants to merge 1 commit intorust-lang:masterfrom
Conversation
Previously, any library of the pattern `lib<name>-<hash>-<version>.so` was >considered a candidate (rightly so) for loading a crate. Sets are generated for each unique `<hash>`, and then from these sets a candidate is selected. If a set contained more than one element, then it immediately generated an error saying that multiple copies of the same dylib were found. This is incorrect because each candidate needs to be validated to actually contain a rust library (valid metadata). This commit alters the logic to filter each set of candidates for a hash to only libraries which are actually rust libraries. This means that if multiple false positives are found with the right name pattern, they're all ignored. Closes rust-lang#13010
Contributor
There was a problem hiding this comment.
Doesn't this cause the note to be printed twice for candidate 1?
Member
Author
There was a problem hiding this comment.
A little subtle, but the first errors prints the previously found library (stored in ret), and the second prints prints the current library (stored in lib)
bors
added a commit
that referenced
this pull request
Mar 20, 2014
Previously, any library of the pattern `lib<name>-<hash>-<version>.so` was >considered a candidate (rightly so) for loading a crate. Sets are generated for each unique `<hash>`, and then from these sets a candidate is selected. If a set contained more than one element, then it immediately generated an error saying that multiple copies of the same dylib were found. This is incorrect because each candidate needs to be validated to actually contain a rust library (valid metadata). This commit alters the logic to filter each set of candidates for a hash to only libraries which are actually rust libraries. This means that if multiple false positives are found with the right name pattern, they're all ignored. Closes #13010
lnicola
pushed a commit
to lnicola/rust
that referenced
this pull request
Aug 16, 2022
…kril Pad empty diagnostic messages in relatedInformation as well Follw up to rust-lang/rust-analyzer#13016
flip1995
pushed a commit
to flip1995/rust
that referenced
this pull request
Jul 11, 2024
Image-related valid idents False positives for idents in markdown changelog: Add "WebP", "OpenExr", "YcbCr", "sRGB" to `doc-valid-idents` default.
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.
Previously, any library of the pattern
lib<name>-<hash>-<version>.sowasThis is incorrect because each candidate needs to be validated to actually
contain a rust library (valid metadata). This commit alters the logic to filter
each set of candidates for a hash to only libraries which are actually rust
libraries. This means that if multiple false positives are found with the right
name pattern, they're all ignored.
Closes #13010