Skip to content

Fix invalid add of duplicated call locations for the rustdoc scraped examples feature#154017

Merged
rust-bors[bot] merged 2 commits intorust-lang:mainfrom
GuillaumeGomez:duplicated-locs-scraped
Mar 24, 2026
Merged

Fix invalid add of duplicated call locations for the rustdoc scraped examples feature#154017
rust-bors[bot] merged 2 commits intorust-lang:mainfrom
GuillaumeGomez:duplicated-locs-scraped

Conversation

@GuillaumeGomez
Copy link
Copy Markdown
Member

@GuillaumeGomez GuillaumeGomez commented Mar 17, 2026

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

@rustbot rustbot added A-run-make Area: port run-make Makefiles to rmake.rs S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue. labels Mar 17, 2026
@rustbot

This comment has been minimized.

@@ -0,0 +1,16 @@
//! This test ensures that the call locations are not duplicated when generating scraped examples.
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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...

@GuillaumeGomez GuillaumeGomez force-pushed the duplicated-locs-scraped branch from c7e38a3 to 071fe64 Compare March 17, 2026 21:58
@rustbot

This comment has been minimized.

Copy link
Copy Markdown
Member

@Urgau Urgau left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The core logic change seems fine, thus I wondering if we can avoid using Cargo.

View changes since this review

@GuillaumeGomez GuillaumeGomez force-pushed the duplicated-locs-scraped branch from 071fe64 to c399464 Compare March 18, 2026 19:25
@rustbot

This comment was marked as resolved.

@GuillaumeGomez
Copy link
Copy Markdown
Member Author

Added the htmldocck checks.

Copy link
Copy Markdown
Member

@Urgau Urgau left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks. r=me when CI is green

View changes since this review

@Urgau
Copy link
Copy Markdown
Member

Urgau commented Mar 23, 2026

Seems like we both forgot to bors approve the PR. ;-)

Let's fix that.

@bors r+ rollup

@rust-bors
Copy link
Copy Markdown
Contributor

rust-bors bot commented Mar 23, 2026

📌 Commit c399464 has been approved by Urgau

It is now in the queue for this repository.

@rust-bors rust-bors bot added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Mar 23, 2026
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)
@rust-bors rust-bors bot merged commit 429c8d4 into rust-lang:main Mar 24, 2026
11 checks passed
@rustbot rustbot added this to the 1.96.0 milestone Mar 24, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-run-make Area: port run-make Makefiles to rmake.rs S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[ICE]: exit_elem called on empty class stack parent

3 participants