Skip to content

Commit 775f315

Browse files
authored
Unrolled build for rust-lang#126356
Rollup merge of rust-lang#126356 - epage:check-cfg, r=Urgau docs(rustc): Improve discoverable of Cargo docs In preparing Cargo's blog post for 1.80, I tried to find the documentation for the lint configuration and I couldn't. The link is only visible from the lint itself, which isn't where I started, and the side bar, which was collapsed for me. The first place I went was the docs for `unexpected_cfgs` because this is configuration for that lint. If using lint configuration were a one off, I could see skipping it here. However, when we discussed this with at least one T-compiler member, there was interest in using this for other lints in the future. To that end, it seems like we should be exposing this with the lint itself. The second place I checked was the `check-cfg` documentation. This now has a call out for the sub-page.
2 parents f6b4b71 + e171e64 commit 775f315

File tree

2 files changed

+9
-2
lines changed

2 files changed

+9
-2
lines changed

compiler/rustc_lint_defs/src/builtin.rs

+4
Original file line numberDiff line numberDiff line change
@@ -3257,7 +3257,11 @@ declare_lint! {
32573257
/// See the [Checking Conditional Configurations][check-cfg] section for more
32583258
/// details.
32593259
///
3260+
/// See the [Cargo Specifics][unexpected_cfgs_lint_config] section for configuring this lint in
3261+
/// `Cargo.toml`.
3262+
///
32603263
/// [check-cfg]: https://doc.rust-lang.org/nightly/rustc/check-cfg.html
3264+
/// [unexpected_cfgs_lint_config]: https://doc.rust-lang.org/nightly/rustc/check-cfg/cargo-specifics.html#check-cfg-in-lintsrust-table
32613265
pub UNEXPECTED_CFGS,
32623266
Warn,
32633267
"detects unexpected names and values in `#[cfg]` conditions",

src/doc/rustc/src/check-cfg.md

+5-2
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@ development process.
1111
In order to accomplish that goal, `rustc` accepts the `--check-cfg` flag, which specifies
1212
whether to check conditions and how to check them.
1313

14-
> **Note:** No implicit expectation is added when using `--cfg`. Users are expected to
15-
pass all expected names and values using the _check cfg specification_.
14+
> **Note:** For interacting with this through Cargo,
15+
see [Cargo Specifics](check-cfg/cargo-specifics.md) page.
1616

1717
[^reachable]: `rustc` promises to at least check reachable `#[cfg]`, and while non-reachable
1818
`#[cfg]` are not currently checked, they may well be checked in the future without it being a
@@ -23,6 +23,9 @@ breaking change.
2323
To specify expected names and values, the _check cfg specification_ provides the `cfg(...)`
2424
option which enables specifying for an expected config name and it's expected values.
2525

26+
> **Note:** No implicit expectation is added when using `--cfg`. Users are expected to
27+
pass all expected names and values using the _check cfg specification_.
28+
2629
It has this basic form:
2730

2831
```bash

0 commit comments

Comments
 (0)