Keep cfg_attr cfg predicates when expanding proc-macros so it can be used by the doc_cfg feature#158980
Keep cfg_attr cfg predicates when expanding proc-macros so it can be used by the doc_cfg feature#158980GuillaumeGomez wants to merge 4 commits into
cfg_attr cfg predicates when expanding proc-macros so it can be used by the doc_cfg feature#158980Conversation
|
Unknown command "r?". Run |
|
Some changes occurred in compiler/rustc_attr_parsing cc @jdonszelmann, @JonathanBrouwer Some changes occurred in compiler/rustc_hir/src/attrs cc @jdonszelmann, @JonathanBrouwer Some changes occurred in compiler/rustc_passes/src/check_attr.rs |
|
Error: Parsing assign command in comment failed: specify user to assign to (if you want to reroll without a specific reviewer in mind, use Please file an issue on GitHub at triagebot if there's a problem with this bot, or reach out on #triagebot on Zulip. |
This comment has been minimized.
This comment has been minimized.
|
@bors try @rust-timer queue |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
…<try> Keep `cfg_attr` cfg predicates when expanding proc-macros so it can be used by the `doc_cfg` feature
This comment has been minimized.
This comment has been minimized.
|
Finished benchmarking commit (ef879b2): comparison URL. Overall result: ❌✅ regressions and improvements - please read:Benchmarking means the PR may be perf-sensitive. It's automatically marked not fit for rolling up. Overriding is possible but disadvised: it risks changing compiler perf. Next, please: If you can, justify the regressions found in this try perf run in writing along with @bors rollup=never Instruction countOur most reliable metric. Used to determine the overall result above. However, even this metric can be noisy.
Max RSS (memory usage)Results (primary -0.5%, secondary 2.1%)A less reliable metric. May be of interest, but not used to determine the overall result above.
CyclesResults (primary -2.1%, secondary 0.5%)A less reliable metric. May be of interest, but not used to determine the overall result above.
Binary sizeResults (primary 0.1%, secondary 0.0%)A less reliable metric. May be of interest, but not used to determine the overall result above.
Bootstrap: 490.207s -> 489.844s (-0.07%) |
22902d6 to
6f77a3f
Compare
This comment has been minimized.
This comment has been minimized.
|
cc @rust-lang/clippy |
|
CI is happy so PR ready for review. |
918896d to
757e43e
Compare
This comment has been minimized.
This comment has been minimized.
757e43e to
5e14870
Compare
|
Finally fixed CI. Going to run perf again to see if there is any change in perf impact. @bors try @rust-timer queue |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
…<try> Keep `cfg_attr` cfg predicates when expanding proc-macros so it can be used by the `doc_cfg` feature
This comment has been minimized.
This comment has been minimized.
|
Finished benchmarking commit (1cb4141): comparison URL. Overall result: no relevant changes - no action neededBenchmarking means the PR may be perf-sensitive. Consider adding rollup=never if this change is not fit for rolling up. @rustbot label: -S-waiting-on-perf -perf-regression Instruction countThis perf run didn't have relevant results for this metric. Max RSS (memory usage)Results (primary -2.3%)A less reliable metric. May be of interest, but not used to determine the overall result above.
CyclesResults (primary 2.5%)A less reliable metric. May be of interest, but not used to determine the overall result above.
Binary sizeThis perf run didn't have relevant results for this metric. Bootstrap: 487.42s -> 489.273s (0.38%) |
|
Fixed the performance regression, nice. This time it's ready @petrochenkov. :) |
…doc-json` stops entering it
…r_trace` into `cfg_trace` to correctly handle the `rustdoc-json-types` situation
5e14870 to
751bb05
Compare
|
Applied suggestions and fixed the |
|
#158943 came up with a different solution for a similar problem - relying on If we see an impl item, from its (I don't want to merge this PR in its current form, unless absolutely necessary, it's 100% technical debt and if we continue doing this we'll end up in the same unsalvageable state as rustdoc.) |
|
Sounds good to me! Gonna wait for it to be merged then. |
|
☔ The latest upstream changes (presumably #159444) made this pull request unmergeable. Please resolve the merge conflicts by rebasing. |
View all comments
Fixes #103300.
After long last, this PR finally allows the
deriveproc-macrocfg_attrcfg predicates information to be kept sorustdoccan use it for itsdoc_cfgfeature (cc #43781).We currently convert
cfg_attrinto acfg_attr_tracewhich doesn't contain the cfg predicates information anymore. This PR saves the cfg predicates into theCfgAttrTrace(like we do forCfgTrace) so it can be used in other locations. Then, when we expand thederiveproc-macros, it adds thecfg_attr_traceattributes to the items generated by the expansion.I think this could be improved further by converting the
cfg_attrinto acfgon the generated items when we're doing the expansion, but I think the current PR is already big enough so it can be done in a follow-up.Thanks a lot for the pointer @petrochenkov!
@bors r? @petrochenkov