rustbot
added
T-compiler
labels
Jul 22, 2026
GuillaumeGomez
changed the title
[rustdoc[ Retrieve
[rustdoc] Retrieve cfg_attr information for derived impls for doc_cfg featurecfg_attr information for derived impls for doc_cfg feature
rust-bors Bot pushed a commit that referenced this pull request
Jul 22, 2026rust-bors Bot pushed a commit that referenced this pull request
Jul 22, 2026
rustbot
added
S-waiting-on-author
and removed S-waiting-on-review
Status: Awaiting review from the assignee but also interested parties.labels
Jul 22, 2026
rust-bors
Bot
added
S-waiting-on-bors
and removed S-waiting-on-author
Status: This is awaiting some action (such as code changes or more information) from the author.labels
Jul 23, 2026jhpratt added a commit to jhpratt/rust that referenced this pull request
Jul 23, 2026…=petrochenkov,mejrs,Urgau [rustdoc] Retrieve `cfg_attr` information for derived impls for `doc_cfg` feature Fixes rust-lang#103300. After long last, this PR finally allows the derive proc-macro `cfg_attr` cfg predicates information to be kept so rustdoc can use it for its `doc_cfg` feature (cc rust-lang#43781). It works as follows: for `impl` generated by macro expansion, we then look for the attributes on the type for which the `impl` block is implemented. Then, to know which `cfg_attr` attribute we want to look at, we use `expn_that_defined` on the impl's `DefId` which returns the `Span` where the macro was expanded. If it's part of a `cfg_attr`, then the `cfg_attr`'s `Span` will contain the derive's, so from then, we just need to add the `cfg` information. This PR also adds the cfg predicates into the `AttributeKind::CfgAttrTrace` variant so it can be reused by rustdoc (hence the `compiler/*` changes). Thanks a lot @petrochenkov for the pointers here! r? @petrochenkov
Closed
jhpratt added a commit to jhpratt/rust that referenced this pull request
Jul 24, 2026…=petrochenkov,mejrs,Urgau [rustdoc] Retrieve `cfg_attr` information for derived impls for `doc_cfg` feature Fixes rust-lang#103300. After long last, this PR finally allows the derive proc-macro `cfg_attr` cfg predicates information to be kept so rustdoc can use it for its `doc_cfg` feature (cc rust-lang#43781). It works as follows: for `impl` generated by macro expansion, we then look for the attributes on the type for which the `impl` block is implemented. Then, to know which `cfg_attr` attribute we want to look at, we use `expn_that_defined` on the impl's `DefId` which returns the `Span` where the macro was expanded. If it's part of a `cfg_attr`, then the `cfg_attr`'s `Span` will contain the derive's, so from then, we just need to add the `cfg` information. This PR also adds the cfg predicates into the `AttributeKind::CfgAttrTrace` variant so it can be reused by rustdoc (hence the `compiler/*` changes). Thanks a lot @petrochenkov for the pointers here! r? @petrochenkov
Closed
jhpratt added a commit to jhpratt/rust that referenced this pull request
Jul 24, 2026…=petrochenkov,mejrs,Urgau [rustdoc] Retrieve `cfg_attr` information for derived impls for `doc_cfg` feature Fixes rust-lang#103300. After long last, this PR finally allows the derive proc-macro `cfg_attr` cfg predicates information to be kept so rustdoc can use it for its `doc_cfg` feature (cc rust-lang#43781). It works as follows: for `impl` generated by macro expansion, we then look for the attributes on the type for which the `impl` block is implemented. Then, to know which `cfg_attr` attribute we want to look at, we use `expn_that_defined` on the impl's `DefId` which returns the `Span` where the macro was expanded. If it's part of a `cfg_attr`, then the `cfg_attr`'s `Span` will contain the derive's, so from then, we just need to add the `cfg` information. This PR also adds the cfg predicates into the `AttributeKind::CfgAttrTrace` variant so it can be reused by rustdoc (hence the `compiler/*` changes). Thanks a lot @petrochenkov for the pointers here! r? @petrochenkov
Closed
rust-bors Bot pushed a commit that referenced this pull request
Jul 24, 2026Rollup of 12 pull requests Successful merges: - #159765 (Avoid spurious rebuilds of JSON docs in bootstrap) - #159781 (Update bootstrap to use -Zembed-metadata=no instead of -Zno-embed-metadata) - #158362 (trait solver: account for universes from replace_bound_vars) - #159173 (Add allowed list check on EII implementations attributes) - #159718 (Make `DocLinkResMap` an `FxIndexMap`) - #159722 ( [rustdoc] Retrieve `cfg_attr` information for derived impls for `doc_cfg` feature) - #155795 (constify `vec![1, 2, 3]` macro) - #157776 (ci: Enable autodiff tests on x86_64 linux) - #158766 (Promote riscv64-unknown-linux-musl to tier 2 with host tools) - #159271 (str: add ASCII fast path to word_to_titlecase) - #159666 (fix(ld64.lld): route version mismatch warnings to linker_info on macOS) - #159667 (Make some parser structured suggestions verbose and tweak their wording)
Merged
rust-bors Bot pushed a commit that referenced this pull request
Jul 24, 2026Rollup of 14 pull requests Successful merges: - #159765 (Avoid spurious rebuilds of JSON docs in bootstrap) - #159781 (Update bootstrap to use -Zembed-metadata=no instead of -Zno-embed-metadata) - #158362 (trait solver: account for universes from replace_bound_vars) - #158372 (rustfmt: Discover modules via `cfg_select!`) - #159173 (Add allowed list check on EII implementations attributes) - #159718 (Make `DocLinkResMap` an `FxIndexMap`) - #159722 ( [rustdoc] Retrieve `cfg_attr` information for derived impls for `doc_cfg` feature) - #159731 (std: Implement futex on wasip3 targets, update target spec) - #159755 (Improve consistency of attribute error messages) - #155795 (constify `vec![1, 2, 3]` macro) - #157776 (ci: Enable autodiff tests on x86_64 linux) - #158766 (Promote riscv64-unknown-linux-musl to tier 2 with host tools) - #159271 (str: add ASCII fast path to word_to_titlecase) - #159667 (Make some parser structured suggestions verbose and tweak their wording)
rust-timer added a commit that referenced this pull request
Jul 24, 2026Rollup merge of #159722 - GuillaumeGomez:cfg_attr-doc_cfg, r=petrochenkov,mejrs,Urgau [rustdoc] Retrieve `cfg_attr` information for derived impls for `doc_cfg` feature Fixes #103300. After long last, this PR finally allows the derive proc-macro `cfg_attr` cfg predicates information to be kept so rustdoc can use it for its `doc_cfg` feature (cc #43781). It works as follows: for `impl` generated by macro expansion, we then look for the attributes on the type for which the `impl` block is implemented. Then, to know which `cfg_attr` attribute we want to look at, we use `expn_that_defined` on the impl's `DefId` which returns the `Span` where the macro was expanded. If it's part of a `cfg_attr`, then the `cfg_attr`'s `Span` will contain the derive's, so from then, we just need to add the `cfg` information. This PR also adds the cfg predicates into the `AttributeKind::CfgAttrTrace` variant so it can be reused by rustdoc (hence the `compiler/*` changes). Thanks a lot @petrochenkov for the pointers here! r? @petrochenkov
github-actions Bot pushed a commit to rust-lang/rustc-dev-guide that referenced this pull request
Jul 25, 2026
mejrs
mentioned this pull request
Merged
chenyukang added a commit to chenyukang/rust that referenced this pull request
Jul 26, 2026Minor `rustc_ast::ast` doc cleanups `P` is an outdated reference. `CfgAttrTrace` was updated in rust-lang#159722 Docs were formatted so that the entire paragraph doesn't show up on the module level docs (pet peeve of mine). r? @nnethercote
chenyukang added a commit to chenyukang/rust that referenced this pull request
Jul 26, 2026Minor `rustc_ast::ast` doc cleanups `P` is an outdated reference. `CfgAttrTrace` was updated in rust-lang#159722 Docs were formatted so that the entire paragraph doesn't show up on the module level docs (pet peeve of mine). r? @nnethercote
chenyukang added a commit to chenyukang/rust that referenced this pull request
Jul 26, 2026Minor `rustc_ast::ast` doc cleanups `P` is an outdated reference. `CfgAttrTrace` was updated in rust-lang#159722 Docs were formatted so that the entire paragraph doesn't show up on the module level docs (pet peeve of mine). r? @nnethercote
JonathanBrouwer added a commit to JonathanBrouwer/rust that referenced this pull request
Jul 26, 2026Minor `rustc_ast::ast` doc cleanups `P` is an outdated reference. `CfgAttrTrace` was updated in rust-lang#159722 Docs were formatted so that the entire paragraph doesn't show up on the module level docs (pet peeve of mine). r? @nnethercote
JonathanBrouwer added a commit to JonathanBrouwer/rust that referenced this pull request
Jul 26, 2026Minor `rustc_ast::ast` doc cleanups `P` is an outdated reference. `CfgAttrTrace` was updated in rust-lang#159722 Docs were formatted so that the entire paragraph doesn't show up on the module level docs (pet peeve of mine). r? @nnethercote
JonathanBrouwer added a commit to JonathanBrouwer/rust that referenced this pull request
Jul 26, 2026Minor `rustc_ast::ast` doc cleanups `P` is an outdated reference. `CfgAttrTrace` was updated in rust-lang#159722 Docs were formatted so that the entire paragraph doesn't show up on the module level docs (pet peeve of mine). r? @nnethercote
rust-timer added a commit that referenced this pull request
Jul 27, 2026Rollup merge of #159936 - mejrs:ast_docs, r=chenyukang Minor `rustc_ast::ast` doc cleanups `P` is an outdated reference. `CfgAttrTrace` was updated in #159722 Docs were formatted so that the entire paragraph doesn't show up on the module level docs (pet peeve of mine). r? @nnethercote
pull Bot pushed a commit to xtqqczze/rust-lang-miri that referenced this pull request
Jul 27, 2026Minor `rustc_ast::ast` doc cleanups `P` is an outdated reference. `CfgAttrTrace` was updated in rust-lang/rust#159722 Docs were formatted so that the entire paragraph doesn't show up on the module level docs (pet peeve of mine). r? @nnethercote
flip1995 pushed a commit to flip1995/rust that referenced this pull request
Aug 1, 2026…=petrochenkov,mejrs,Urgau [rustdoc] Retrieve `cfg_attr` information for derived impls for `doc_cfg` feature Fixes rust-lang#103300. After long last, this PR finally allows the derive proc-macro `cfg_attr` cfg predicates information to be kept so rustdoc can use it for its `doc_cfg` feature (cc rust-lang#43781). It works as follows: for `impl` generated by macro expansion, we then look for the attributes on the type for which the `impl` block is implemented. Then, to know which `cfg_attr` attribute we want to look at, we use `expn_that_defined` on the impl's `DefId` which returns the `Span` where the macro was expanded. If it's part of a `cfg_attr`, then the `cfg_attr`'s `Span` will contain the derive's, so from then, we just need to add the `cfg` information. This PR also adds the cfg predicates into the `AttributeKind::CfgAttrTrace` variant so it can be reused by rustdoc (hence the `compiler/*` changes). Thanks a lot @petrochenkov for the pointers here! r? @petrochenkov
github-actions Bot pushed a commit to rust-lang/rustc-dev-guide that referenced this pull request
Aug 3, 2026Minor `rustc_ast::ast` doc cleanups `P` is an outdated reference. `CfgAttrTrace` was updated in rust-lang/rust#159722 Docs were formatted so that the entire paragraph doesn't show up on the module level docs (pet peeve of mine). r? @nnethercote
Closed