Skip to content

[rustdoc] Do not take doc(cfg()) into account when filtering doctests#159014

Open
GuillaumeGomez wants to merge 3 commits into
rust-lang:mainfrom
GuillaumeGomez:doc-cfg-filter-doctest
Open

[rustdoc] Do not take doc(cfg()) into account when filtering doctests#159014
GuillaumeGomez wants to merge 3 commits into
rust-lang:mainfrom
GuillaumeGomez:doc-cfg-filter-doctest

Conversation

@GuillaumeGomez

@GuillaumeGomez GuillaumeGomez commented Jul 9, 2026

Copy link
Copy Markdown
Member

Part of #147033.

Because it was using the extract_cfg_from_attrs common function, it was taking into account the doc(cfg()) attributes the same as if they were a cfg.

I didn't mark this PR as "fix" because I didn't handle the case of the doctest not being marked as ignored because I'm not sure if we should revisit the fact that we ignore these doctests or if we should just mark them as ignored (because of target_feature(enable = "...")).

Setting @fmease as reviewer as they are likely the only one with context about this issue. 😆

r? @fmease

@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 Jul 9, 2026
@rust-log-analyzer

This comment has been minimized.

@GuillaumeGomez

Copy link
Copy Markdown
Member Author

And now it fails because we (doc) inlined some functions. Fixing that then. :)

@rustbot rustbot added O-wasi Operating system: Wasi, Webassembly System Interface O-wasm Target: WASM (WebAssembly), http://webassembly.org/ O-windows Operating system: Windows labels Jul 9, 2026
@rust-log-analyzer

This comment has been minimized.

@GuillaumeGomez GuillaumeGomez force-pushed the doc-cfg-filter-doctest branch from f5059c8 to 062cfea Compare July 9, 2026 14:58
@rust-log-analyzer

This comment has been minimized.

@GuillaumeGomez GuillaumeGomez force-pushed the doc-cfg-filter-doctest branch from 062cfea to 1d5692c Compare July 9, 2026 15:43
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 O-wasi Operating system: Wasi, Webassembly System Interface O-wasm Target: WASM (WebAssembly), http://webassembly.org/ O-windows Operating system: Windows 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.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants