rust/compiler/rustc_interface/src
Dylan DPC afa85f0841
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```
2022-03-04 22:58:34 +01:00
..
callbacks.rs Remove SPAN_DEBUG global 2022-02-12 11:50:02 +01:00
interface.rs Add support for values() with --check-cfg 2022-03-03 12:00:28 +01:00
lib.rs Switch bootstrap cfgs 2022-02-25 08:00:52 -05:00
passes.rs Auto merge of #94096 - cjgillot:ensure-stability, r=lcnr 2022-03-04 05:49:14 +00:00
proc_macro_decls.rs Avoid more invocations of hir_crate query. 2021-09-29 23:16:47 +02:00
queries.rs rename ErrorReported -> ErrorGuaranteed 2022-03-02 09:45:25 -06:00
tests.rs Auto merge of #93516 - nagisa:branch-protection, r=cjgillot 2022-02-26 21:53:03 +00:00
util.rs Remove the everybody loops pass 2022-03-03 18:23:09 +01:00