-
Notifications
You must be signed in to change notification settings - Fork 12.8k
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
Add well known values to --check-cfg
implementation
#94362
Conversation
|
This comment has been minimized.
This comment has been minimized.
8048ec0
to
8cc0669
Compare
This comment has been minimized.
This comment has been minimized.
I've addressed all review comments and responded to all questions. @rustbot ready |
r=me after addressing the last comment #94362 (comment) |
I don't have bors permissions to r=you but it's ready. |
Error: Parsing shortcut command in comment failed: ...'tbot ready' | error: expected end of command at >| ' but I don'... Please let |
@bors: r=petrochenkov |
📌 Commit 4aa92af has been approved by |
Add well known values to `--check-cfg` implementation This pull-request adds well known values for the well known names via `--check-cfg=values()`. [RFC 3013: Checking conditional compilation at compile time](https://rust-lang.github.io/rfcs/3013-conditional-compilation-checking.html#checking-conditional-compilation-at-compile-time) doesn't define this at all, but this seems a nice improvement. The activation is done by a empty `values()` (new syntax) similar to `names()` except that `names(foo)` also activate well known names while `values(aa, "aa", "kk")` would not. As stated this use a different activation logic because well known values for the well known names are not always sufficient. In fact this is problematic for every `target_*` cfg because of non builtin targets, as the current implementation use those built-ins targets to create the list the well known values. The implementation is straight forward, first we gather (if necessary) all the values (lazily or not) and then we apply them. r? ```@petrochenkov```
Add well known values to `--check-cfg` implementation This pull-request adds well known values for the well known names via `--check-cfg=values()`. [RFC 3013: Checking conditional compilation at compile time](https://rust-lang.github.io/rfcs/3013-conditional-compilation-checking.html#checking-conditional-compilation-at-compile-time) doesn't define this at all, but this seems a nice improvement. The activation is done by a empty `values()` (new syntax) similar to `names()` except that `names(foo)` also activate well known names while `values(aa, "aa", "kk")` would not. As stated this use a different activation logic because well known values for the well known names are not always sufficient. In fact this is problematic for every `target_*` cfg because of non builtin targets, as the current implementation use those built-ins targets to create the list the well known values. The implementation is straight forward, first we gather (if necessary) all the values (lazily or not) and then we apply them. r? `@petrochenkov`
Add well known values to `--check-cfg` implementation This pull-request adds well known values for the well known names via `--check-cfg=values()`. [RFC 3013: Checking conditional compilation at compile time](https://rust-lang.github.io/rfcs/3013-conditional-compilation-checking.html#checking-conditional-compilation-at-compile-time) doesn't define this at all, but this seems a nice improvement. The activation is done by a empty `values()` (new syntax) similar to `names()` except that `names(foo)` also activate well known names while `values(aa, "aa", "kk")` would not. As stated this use a different activation logic because well known values for the well known names are not always sufficient. In fact this is problematic for every `target_*` cfg because of non builtin targets, as the current implementation use those built-ins targets to create the list the well known values. The implementation is straight forward, first we gather (if necessary) all the values (lazily or not) and then we apply them. r? ``@petrochenkov``
Rollup of 5 pull requests Successful merges: - rust-lang#94362 (Add well known values to `--check-cfg` implementation) - rust-lang#94577 (only disable SIMD for doctests in Miri (not for the stdlib build itself)) - rust-lang#94595 (Fix invalid `unresolved imports` errors for a single-segment import) - rust-lang#94596 (Delay bug in expr adjustment when check_expr is called multiple times) - rust-lang#94618 (Don't round stack size up for created threads in Windows) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
…ark-Simulacrum Enable conditional checking of values in the Rust codebase This pull-request enable conditional checking of (well known) values in the Rust codebase. Well known values were added in rust-lang#94362. All the `target_*` values are taken from all the built-in targets which is why some extra values were needed do be added as they are not (yet ?) defined in any built-in targets. r? `@Mark-Simulacrum`
…k, r=petrochenkov Update the unstable book with the new `values()` form of check-cfg Forgot to update the unstable book in rust-lang#94362 r? `@petrochenkov`
…k, r=petrochenkov Update the unstable book with the new `values()` form of check-cfg Forgot to update the unstable book in rust-lang#94362 r? ``@petrochenkov``
This pull-request adds well known values for the well known names via
--check-cfg=values()
.RFC 3013: Checking conditional compilation at compile time doesn't define this at all, but this seems a nice improvement.
The activation is done by a empty
values()
(new syntax) similar tonames()
except thatnames(foo)
also activate well known names whilevalues(aa, "aa", "kk")
would not.As stated this use a different activation logic because well known values for the well known names are not always sufficient.
In fact this is problematic for every
target_*
cfg because of non builtin targets, as the current implementation use those built-ins targets to create the list the well known values.The implementation is straight forward, first we gather (if necessary) all the values (lazily or not) and then we apply them.
r? @petrochenkov