-
Notifications
You must be signed in to change notification settings - Fork 13.7k
cfg_select: Support unbraced expressions #145233
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
When operating on expressions, `cfg_select!` can now handle expressions without braces. (It still requires braces for other things, such as items.) Expand the test coverage and documentation accordingly.
We discussed this in the @rust-lang/libs-api meeting and everyone was happy with this change. |
We discussed this in the lang meeting. We were all happy to see this land in nightly. Thanks to @joshtriplett for putting this forward. |
I updated the PR description to point to the tracking issue #115585. It seems like the tracking issue was very outdated, so I tried to update that as well (but I probably missed a few still). You may wish to update the tracking issue example (#115585 (comment)) to demonstrate this syntax allowance. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Implementation wise, this looks good, thanks!
@bors r+ rollup |
…eyouxu cfg_select: Support unbraced expressions Tracking issue for `cfg_select`: rust-lang#115585 When operating on expressions, `cfg_select!` can now handle expressions without braces. (It still requires braces for other things, such as items.) Expand the test coverage and documentation accordingly. --- I'm not sure whether deciding to extend `cfg_select!` in this way is T-lang or T-libs-api. I've labeled for both, with the request that both teams don't block on each other. :)
Rollup of 9 pull requests Successful merges: - #118087 (Add Ref/RefMut try_map method) - #140794 (Add information about group a lint belongs to) - #144947 (Fix description of unsigned `checked_exact_div`) - #145005 (strip prefix of temporary file names when it exceeds filesystem name length limit) - #145233 (cfg_select: Support unbraced expressions) - #145243 (take attr style into account in diagnostics) - #145353 (bootstrap: Fix jemalloc 64K page support for aarch64 tools) - #145379 (bootstrap: Support passing `--timings` to cargo) - #145389 ([rustdoc] Revert "rustdoc search: prefer stable items in search results") Failed merges: - #144983 (Rehome 37 `tests/ui/issues/` tests to other subdirectories under `tests/ui/`) - #145065 (resolve: Introduce `RibKind::Block`) r? `@ghost` `@rustbot` modify labels: rollup
…eyouxu cfg_select: Support unbraced expressions Tracking issue for `cfg_select`: rust-lang#115585 When operating on expressions, `cfg_select!` can now handle expressions without braces. (It still requires braces for other things, such as items.) Expand the test coverage and documentation accordingly. --- I'm not sure whether deciding to extend `cfg_select!` in this way is T-lang or T-libs-api. I've labeled for both, with the request that both teams don't block on each other. :)
Done. |
Rollup of 11 pull requests Successful merges: - #137872 (Include whitespace in "remove |" suggestion and make it hidden) - #144631 (Fix test intrinsic-raw_eq-const-bad for big-endian) - #145233 (cfg_select: Support unbraced expressions) - #145261 (Improve tracing in bootstrap) - #145324 (Rename and document `ONLY_HOSTS` in bootstrap) - #145353 (bootstrap: Fix jemalloc 64K page support for aarch64 tools) - #145379 (bootstrap: Support passing `--timings` to cargo) - #145397 (Rust documentation, use `rustc-dev-guide` :3) - #145398 (Use `default_field_values` in `Resolver`) - #145401 (cleanup: Remove useless `[T].iter().last()`) - #145403 (Adjust error message grammar to be less awkward) r? `@ghost` `@rustbot` modify labels: rollup
Rollup merge of #145233 - joshtriplett:cfg-select-expr, r=jieyouxu cfg_select: Support unbraced expressions Tracking issue for `cfg_select`: #115585 When operating on expressions, `cfg_select!` can now handle expressions without braces. (It still requires braces for other things, such as items.) Expand the test coverage and documentation accordingly. --- I'm not sure whether deciding to extend `cfg_select!` in this way is T-lang or T-libs-api. I've labeled for both, with the request that both teams don't block on each other. :)
@rust-timer build b7907e9 Testing for #145407. |
This comment has been minimized.
This comment has been minimized.
Finished benchmarking commit (b7907e9): comparison URL. Overall result: ❌✅ regressions and improvements - please read the text belowBenchmarking this pull request means it may be perf-sensitive – we'll automatically label it not fit for rolling up. You can override this, but we strongly advise not to, due to possible changes in compiler perf. Next Steps: If you can justify the regressions found in this try perf run, please do so in sufficient 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 -3.4%, secondary -2.0%)A less reliable metric. May be of interest, but not used to determine the overall result above.
CyclesResults (primary -2.7%)A less reliable metric. May be of interest, but not used to determine the overall result above.
Binary sizeResults (primary -0.2%, secondary -0.1%)A less reliable metric. May be of interest, but not used to determine the overall result above.
Bootstrap: 470.516s -> 470.62s (0.02%) |
The perf results there don't seem particularly likely from this PR; looking at some of the deltas they're in places like LLVM codegen, which this doesn't even touch. Are those spurious/noise? |
Tracking issue for
cfg_select
: #115585When operating on expressions,
cfg_select!
can now handle expressionswithout braces. (It still requires braces for other things, such as
items.)
Expand the test coverage and documentation accordingly.
I'm not sure whether deciding to extend
cfg_select!
in this way is T-lang or T-libs-api. I've labeled for both, with the request that both teams don't block on each other. :)