about summary refs log tree commit diff
path: root/compiler/rustc_codegen_llvm/src
diff options
context:
space:
mode:
authorDylan DPC <99973273+Dylan-DPC@users.noreply.github.com>2022-03-04 22:58:34 +0100
committerGitHub <noreply@github.com>2022-03-04 22:58:34 +0100
commitafa85f08410aaa874f628c2704818ef2fb126f00 (patch)
treedc65aab68cf9b65f14011a7a7807a86dbc8cdf75 /compiler/rustc_codegen_llvm/src
parent9fcbc32053d5084d1de79bd484de82474cdae427 (diff)
parent4aa92aff054c8e89c61ac06551a405af828ade70 (diff)
downloadrust-afa85f08410aaa874f628c2704818ef2fb126f00.tar.gz
rust-afa85f08410aaa874f628c2704818ef2fb126f00.zip
Rollup merge of #94362 - Urgau:check-cfg-values, 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```
Diffstat (limited to 'compiler/rustc_codegen_llvm/src')
0 files changed, 0 insertions, 0 deletions