rust/tests/rustdoc-ui
Matthias Krüger ce407429dd
Rollup merge of #111072 - Urgau:check-cfg-new-syntax, r=petrochenkov
Add new simpler and more explicit syntax for check-cfg

<details>
<summary>
Old proposition (before the MCP)
</summary>

This PR adds a new simpler and more explicit syntax for check-cfg. It consist of two new form:
 - `exhaustive(names, values)`
 - `configure(name, "value1", "value2", ... "valueN")`

The preview forms `names(...)` and `values(...)` have implicit meaning that are not strait-forward. In particular `values(foo)`&`values(bar)` and `names(foo, bar)` are not equivalent which has created [some confusions](https://github.com/rust-lang/rust/pull/98080).

Also the `names()` and `values()` form are not clear either and again created some confusions where peoples believed that `values()`&`values(foo)` could be reduced to just `values(foo)`.

To fix that the two new forms are made to be explicit and simpler. See the table of correspondence:
  - `names()` -> `exhaustive(names)`
  - `values()` -> `exhaustive(values)`
  - `names(foo)` -> `exhaustive(names)`&`configure(foo)`
  - `values(foo)` -> `configure(foo)`
  - `values(feat, "foo", "bar")` -> `configure(feat, "foo", "bar")`
  - `values(foo)`&`values(bar)` -> `configure(foo, bar)`
  - `names()`&`values()`&`values(my_cfg)` -> `exhaustive(names, values)`&`configure(my_cfg)`

Another benefits of the new syntax is that it allow for further options (like conditional checking for --cfg, currently always on) without syntax change.

The two previous forms are deprecated and will be removed once cargo and beta rustc have the necessary support.

</details>

This PR is the first part of the implementation of [MCP636 - Simplify and improve explicitness of the check-cfg syntax](https://github.com/rust-lang/compiler-team/issues/636).

## New `cfg` form

It introduces the new [`cfg` form](https://github.com/rust-lang/compiler-team/issues/636) and deprecate the other two:
```
rustc --check-cfg 'cfg(name1, ..., nameN, values("value1", "value2", ... "valueN"))'
```

## Default built-in names and values

It also changes the default for the built-in names and values checking.

 - Built-in values checking would always be activated as long as a `--check-cfg` argument is present
 - Built-in names checking would always be activated as long as a `--check-cfg` argument is present **unless** if any `cfg(any())` arg is passed

~~**Note: depends on https://github.com/rust-lang/rust/pull/111068 but is reviewable (last two commits)!**~~

Resolve https://github.com/rust-lang/compiler-team/issues/636

r? `@petrochenkov`
2023-10-17 19:07:21 +02:00
..
auxiliary Move some rustdoc-ui tests to subdirectories 2023-04-29 11:36:19 -05:00
check-cfg MCP636: Adapt check-cfg tests to the new syntax 2023-10-13 13:51:03 +02:00
coverage Update tests for rustc_doc_primitive 2023-03-30 22:56:52 +02:00
doctest MCP636: Adapt check-cfg tests to the new syntax 2023-10-13 13:51:03 +02:00
error-in-impl-trait Add a failing rustdoc-ui test for public infinite recursive type 2023-04-18 14:13:44 +02:00
generate-link-to-definition Move some rustdoc-ui tests to subdirectories 2023-04-29 11:36:19 -05:00
intra-doc Add a note to duplicate diagnostics 2023-10-05 01:04:41 +00:00
issues Tweak wording 2023-10-13 19:18:46 +00:00
lints Add a note to duplicate diagnostics 2023-10-05 01:04:41 +00:00
scrape-examples Move some rustdoc-ui tests to subdirectories 2023-04-29 11:36:19 -05:00
suggestions
ambiguous-inherent-assoc-ty.rs
bounded-hr-lifetime.rs
bounded-hr-lifetime.stderr Make configure_and_expand "infalllible" by just aborting the compilation if it fails instead of bubbling out an error 2023-02-20 15:28:59 +00:00
check-doc-alias-attr-location.rs
check-doc-alias-attr-location.stderr
check-doc-alias-attr.rs
check-doc-alias-attr.stderr
commandline-argfile-badutf8.args
commandline-argfile-badutf8.rs
commandline-argfile-badutf8.stderr
commandline-argfile-missing.rs
commandline-argfile-missing.stderr
commandline-argfile.args
commandline-argfile.rs
const_arg_in_type_position.rs rustdoc: run more HIR validation to mirror rustc 2023-03-30 14:55:03 +02:00
const_arg_in_type_position.stderr rustdoc: run more HIR validation to mirror rustc 2023-03-30 14:55:03 +02:00
const-evalutation-ice.rs
const-evalutation-ice.stderr
crate-reference-in-block-module.rs rustdoc: Don't crash on crate references in blocks 2023-03-10 17:49:13 +01:00
crate-reference-in-block-module.stderr rustdoc: Don't crash on crate references in blocks 2023-03-10 17:49:13 +01:00
custom_code_classes_in_docs-warning3.rs Add support for double quotes in markdown codeblock attributes 2023-09-15 21:32:28 +02:00
custom_code_classes_in_docs-warning3.stderr Add a note to duplicate diagnostics 2023-10-05 01:04:41 +00:00
custom_code_classes_in_docs-warning.rs Update tests for custom classes 2023-09-19 17:29:39 +02:00
custom_code_classes_in_docs-warning.stderr Update tests for custom classes 2023-09-19 17:29:39 +02:00
deprecated-attrs.rs
deprecated-attrs.stderr
deref-generic.rs
diagnostic-width.rs
diagnostic-width.stderr
doc-alias-assoc-const.rs
doc-alias-assoc-const.stderr
doc-alias-crate-level.rs
doc-alias-crate-level.stderr
doc-alias-same-name.rs
doc-alias-same-name.stderr
doc-cfg.rs
doc-cfg.stderr
doc-include-suggestion.rs
doc-include-suggestion.stderr
feature-gate-custom_code_classes_in_docs.rs Update tests for custom classes 2023-09-19 17:29:39 +02:00
feature-gate-custom_code_classes_in_docs.stderr Update tests for custom classes 2023-09-19 17:29:39 +02:00
feature-gate-doc_cfg_hide.rs
feature-gate-doc_cfg_hide.stderr Make configure_and_expand "infalllible" by just aborting the compilation if it fails instead of bubbling out an error 2023-02-20 15:28:59 +00:00
ice-assoc-const-for-primitive-31808.rs rustdoc: add check-pass to ICE test with no expected output 2023-10-16 18:03:22 -07:00
ice-bug-report-url.rs Fix test output. 2023-07-29 11:42:53 +02:00
ice-bug-report-url.stderr Fix test output. 2023-07-29 11:42:53 +02:00
ignore-block-help.rs
ignore-block-help.stderr
impl-fn-nesting.rs
impl-fn-nesting.stderr Make configure_and_expand "infalllible" by just aborting the compilation if it fails instead of bubbling out an error 2023-02-20 15:28:59 +00:00
infinite-recursive-type.rs
infinite-recursive-type.stderr
invalid_associated_const.rs rustdoc: run more HIR validation to mirror rustc 2023-03-30 14:55:03 +02:00
invalid_associated_const.stderr rustdoc: run more HIR validation to mirror rustc 2023-03-30 14:55:03 +02:00
invalid_const_in_lifetime_position.rs rustdoc: run more HIR validation to mirror rustc 2023-03-30 14:55:03 +02:00
invalid_const_in_lifetime_position.stderr rustdoc: run more HIR validation to mirror rustc 2023-03-30 14:55:03 +02:00
invalid_infered_static_and_const.rs rustdoc: run more HIR validation to mirror rustc 2023-03-30 14:55:03 +02:00
invalid_infered_static_and_const.stderr rustdoc: run more HIR validation to mirror rustc 2023-03-30 14:55:03 +02:00
invalid-cfg.rs
invalid-cfg.stderr
invalid-keyword.rs
invalid-keyword.stderr
invalid-syntax.rs
invalid-syntax.stderr
invalid-theme-name.rs
invalid-theme-name.stderr
issue-102467.rs Add regression test for #102467 2023-09-24 14:09:38 +02:00
issue-102467.stderr Add regression test for #102467 2023-09-24 14:09:38 +02:00
issue-110629-private-type-cycle-dyn.rs rustdoc: catch and don't blow up on impl Trait cycles 2023-04-29 16:53:02 -07:00
issue-110629-private-type-cycle-dyn.stderr fix issue-110629-private-type-cycle-dyn test 2023-07-19 10:02:15 -04:00
issue-110629-private-type-cycle.rs rustdoc: catch and don't blow up on impl Trait cycles 2023-04-29 16:53:02 -07:00
macro-docs.rs
macro-docs.stderr
macro-docs.stdout
mismatched_arg_count.rs rustdoc: remove excess from rustdoc test 2023-03-30 14:55:03 +02:00
mismatched_arg_count.stderr rustdoc: remove excess from rustdoc test 2023-03-30 14:55:03 +02:00
normalize-cycle.rs
normalize-overflow.rs
output-format-html-stable.rs
proc_macro_bug.rs Test rustdoc encountering proc_macro_derive in a non-proc-macro crate 2023-02-23 09:00:33 +00:00
proc_macro_bug.stderr Test rustdoc encountering proc_macro_derive in a non-proc-macro crate 2023-02-23 09:00:33 +00:00
range-pattern.rs
recursive-deref-ice.rs
rustc-check-passes.rs
rustc-check-passes.stderr
search-index-generics-recursion-bug-issue-59502.rs
track-diagnostics.rs
track-diagnostics.stderr Modify primary span label for E0308 2023-01-30 20:12:19 +00:00
tuple-variadic-check.rs
tuple-variadic-check.stderr
unable-fulfill-trait.rs
unable-fulfill-trait.stderr rustdoc: update UI test for dropping "this" article 2023-02-23 11:59:26 -07:00
unescaped_backticks.rs Still resolving rustdoc resolution panicking 2023-08-18 15:19:17 +08:00
unescaped_backticks.stderr Add a note to duplicate diagnostics 2023-10-05 01:04:41 +00:00
unused-extern-crate.rs
use_both_out_dir_and_output_options.rs
use_both_out_dir_and_output_options.stderr
wasm-safe.rs