Fix invalid add of duplicated call locations for the rustdoc scraped examples feature#154017
Open
GuillaumeGomez wants to merge 2 commits intorust-lang:mainfrom
Open
Fix invalid add of duplicated call locations for the rustdoc scraped examples feature#154017GuillaumeGomez wants to merge 2 commits intorust-lang:mainfrom
GuillaumeGomez wants to merge 2 commits intorust-lang:mainfrom
Conversation
This comment has been minimized.
This comment has been minimized.
GuillaumeGomez
commented
Mar 17, 2026
| @@ -0,0 +1,16 @@ | |||
| //! This test ensures that the call locations are not duplicated when generating scraped examples. | |||
Member
Author
There was a problem hiding this comment.
This test is sadly lacking: the only way to ensure it works is to check it didn't fail to generate docs with the feature... Would be better to look at the generated target/debug/deps/*.example file but that would involve to reparse it, including compiler crates, etc. And unless I missed something obvious, there is sadly no easy way to achieve that...
c7e38a3 to
071fe64
Compare
This comment has been minimized.
This comment has been minimized.
Urgau
reviewed
Mar 18, 2026
tests/run-make-cargo/rustdoc-scrape-examples-duplicated-calls/rmake.rs
Outdated
Show resolved
Hide resolved
071fe64 to
c399464
Compare
This comment was marked as resolved.
This comment was marked as resolved.
Member
Author
|
Added the |
Urgau
approved these changes
Mar 18, 2026
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.
Fixes #153837.
The bug was visible in the highlighting of the scrape examples code samples: the same part of the code was marked as "highlight" (by the scraped examples feature) twice, eventually leading to a wrong state of the HTML DOM status.
To fix the bug, I added a set to not re-add a location if it's already present.
r? @Urgau