Fix invalid add of duplicated call locations for the rustdoc scraped examples feature#154017
Merged
rust-bors[bot] merged 2 commits intorust-lang:mainfrom Mar 24, 2026
Merged
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
Member
|
Seems like we both forgot to bors approve the PR. ;-) Let's fix that. @bors r+ rollup |
Contributor
JonathanBrouwer
added a commit
to JonathanBrouwer/rust
that referenced
this pull request
Mar 23, 2026
…aped, r=Urgau Fix invalid add of duplicated call locations for the rustdoc scraped examples feature Fixes rust-lang#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
rust-bors bot
pushed a commit
that referenced
this pull request
Mar 24, 2026
Rollup of 10 pull requests Successful merges: - #153964 (Fix `doc_cfg` not working as expected on trait impls) - #153979 (Rename various query cycle things.) - #154132 (Add missing num_internals feature gate to coretests/benches) - #154153 (core: Implement `unchecked_funnel_{shl,shr}`) - #154236 (Clean up query-forcing functions) - #154252 (Don't store current-session side effects in `OnDiskCache`) - #154017 ( Fix invalid add of duplicated call locations for the rustdoc scraped examples feature) - #154163 (enzyme submodule update) - #154264 (Update books) - #154282 (rustc-dev-guide subtree update)
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