rust/compiler
bors b92758a9ae Auto merge of #125219 - Urgau:check-cfg-cargo-config, r=fmease
Update `unexpected_cfgs` lint for Cargo new `check-cfg` config

This PR updates the diagnostics output of the `unexpected_cfgs` lint for Cargo new `check-cfg` config.

It's a simple and cost-less alternative to the build-script `cargo::rustc-check-cfg` instruction.

```toml
[lints.rust]
unexpected_cfgs = { level = "warn", check-cfg = ['cfg(foo, values("bar"))'] }
```

This PR also adds a Cargo specific section regarding check-cfg and Cargo inside rustc's book (motivation is described inside the file, but mainly check-cfg is a rustc feature not a Cargo one, Cargo only enabled the feature, it does not own it; T-cargo even considers the `check-cfg` lint config to be an implementation detail).

This PR also updates the links to refer to that sub-page when using Cargo from rustc.

As well as updating the lint doc to refer to the check-cfg docs.

~**Not to be merged before https://github.com/rust-lang/cargo/pull/13913 reaches master!**~ (EDIT: merged in https://github.com/rust-lang/rust/pull/125237)

`@rustbot` label +F-check-cfg
r? `@fmease` *(feel free to roll)*
Fixes https://github.com/rust-lang/rust/issues/124800
cc `@epage` `@weihanglo`
2024-05-20 20:14:09 +00:00
..
rustc Change SIGPIPE ui from #[unix_sigpipe = "..."] to -Zon-broken-pipe=... 2024-05-02 19:48:29 +02:00
rustc_abi Temporarily revert to NonZeroUsize in rustc-abi to fix building on stable 2024-05-18 11:27:29 +03:00
rustc_arena rename ptr::invalid -> ptr::without_provenance 2024-02-21 20:15:52 +01:00
rustc_ast document what the span of UseTreeKind::Nested is 2024-05-19 10:22:19 +02:00
rustc_ast_ir Remove extern crate rustc_macros from numerous crates. 2024-04-29 10:21:54 +10:00
rustc_ast_lowering Rename Unsafe to Safety 2024-05-17 18:33:37 -03:00
rustc_ast_passes Rollup merge of #125314 - jdonszelmann:global-registration-feature-gate, r=pnkfelix 2024-05-20 18:13:49 +02:00
rustc_ast_pretty Rename Unsafe to Safety 2024-05-17 18:33:37 -03:00
rustc_attr Remove extern crate rustc_macros from numerous crates. 2024-04-29 10:21:54 +10:00
rustc_baked_icu_data
rustc_borrowck Rollup merge of #125173 - scottmcm:never-checked, r=davidtwco 2024-05-20 18:13:48 +02:00
rustc_builtin_macros Auto merge of #125077 - spastorino:add-new-fnsafety-enum2, r=jackh726 2024-05-18 19:35:24 +00:00
rustc_codegen_cranelift Rollup merge of #125173 - scottmcm:never-checked, r=davidtwco 2024-05-20 18:13:48 +02:00
rustc_codegen_gcc Rename Unsafe to Safety 2024-05-17 18:33:37 -03:00
rustc_codegen_llvm Rename Unsafe to Safety 2024-05-17 18:33:37 -03:00
rustc_codegen_ssa Rollup merge of #125173 - scottmcm:never-checked, r=davidtwco 2024-05-20 18:13:48 +02:00
rustc_const_eval Rollup merge of #125173 - scottmcm:never-checked, r=davidtwco 2024-05-20 18:13:48 +02:00
rustc_data_structures Rollup merge of #124818 - compiler-errors:ena, r=Mark-Simulacrum 2024-05-11 08:00:15 +02:00
rustc_driver
rustc_driver_impl Don't call env::set_var in rustc_driver::install_ice_hook 2024-05-13 09:37:29 +02:00
rustc_error_codes Remove a stray backtick in an error explanation. 2024-05-13 07:53:38 +10:00
rustc_error_messages Rename SubdiagnosticMessage as SubdiagMessage. 2024-03-05 12:14:49 +11:00
rustc_errors Uplift FnSig 2024-05-16 09:52:01 -04:00
rustc_expand Auto merge of #125180 - mu001999-contrib:improve/macro-diag, r=fee1-dead 2024-05-18 13:02:48 +00:00
rustc_feature Rollup merge of #125314 - jdonszelmann:global-registration-feature-gate, r=pnkfelix 2024-05-20 18:13:49 +02:00
rustc_fluent_macro Rename SubdiagnosticMessage as SubdiagMessage. 2024-03-05 12:14:49 +11:00
rustc_fs_util Stabilize std::path::absolute 2024-04-24 14:35:02 +00:00
rustc_graphviz
rustc_hir Rename Unsafe to Safety 2024-05-17 18:33:37 -03:00
rustc_hir_analysis Add and use generics.is_empty() and generics.is_own_empty, rather than using generics' attributes 2024-05-19 11:10:56 -03:00
rustc_hir_pretty Rename Unsafe to Safety 2024-05-17 18:33:37 -03:00
rustc_hir_typeck Rollup merge of #125282 - WaffleLapkin:never-type-unsafe-improvements, r=compiler-errors 2024-05-20 08:31:41 +02:00
rustc_incremental Auto merge of #123441 - saethlin:fixed-len-file-names, r=oli-obk 2024-05-03 17:41:48 +00:00
rustc_index Simplify static_assert_sizes. 2024-04-18 15:36:25 +10:00
rustc_index_macros rustc_index: Add a ZERO constant to index types 2024-04-03 19:06:22 +03:00
rustc_infer Rollup merge of #124682 - estebank:issue-40990, r=pnkfelix 2024-05-20 18:13:46 +02:00
rustc_interface note value of RUST_MIN_STACK and explain unsetting 2024-05-19 20:09:03 -07:00
rustc_lexer Improved the compiler code with clippy 2024-04-24 09:41:44 +02:00
rustc_lint Auto merge of #125219 - Urgau:check-cfg-cargo-config, r=fmease 2024-05-20 20:14:09 +00:00
rustc_lint_defs Auto merge of #125219 - Urgau:check-cfg-cargo-config, r=fmease 2024-05-20 20:14:09 +00:00
rustc_llvm Update cc crate to v1.0.97 2024-05-08 15:06:35 +00:00
rustc_log Construct SourceMap at the same time as SessionGlobals. 2024-04-16 13:02:53 +10:00
rustc_macros Lift Lift 2024-05-10 15:44:03 -04:00
rustc_metadata Remove extern crate rustc_middle from rustc_metadata. 2024-05-13 08:20:18 +10:00
rustc_middle Rollup merge of #125173 - scottmcm:never-checked, r=davidtwco 2024-05-20 18:13:48 +02:00
rustc_mir_build Rollup merge of #125173 - scottmcm:never-checked, r=davidtwco 2024-05-20 18:13:48 +02:00
rustc_mir_dataflow Remove Rvalue::CheckedBinaryOp 2024-05-17 20:33:02 -07:00
rustc_mir_transform Rollup merge of #125173 - scottmcm:never-checked, r=davidtwco 2024-05-20 18:13:48 +02:00
rustc_monomorphize Add and use generics.is_empty() and generics.is_own_empty, rather than using generics' attributes 2024-05-19 11:10:56 -03:00
rustc_next_trait_solver Uplift GenericArgKind, CanonicalVarValues, QueryInput 2024-05-18 16:21:43 -04:00
rustc_parse Auto merge of #125077 - spastorino:add-new-fnsafety-enum2, r=jackh726 2024-05-18 19:35:24 +00:00
rustc_parse_format Simplify static_assert_sizes. 2024-04-18 15:36:25 +10:00
rustc_passes Rename Unsafe to Safety 2024-05-17 18:33:37 -03:00
rustc_pattern_analysis Stabilize exclusive_range 2024-05-02 19:42:31 -04:00
rustc_privacy split out AliasTy -> AliasTerm 2024-05-13 11:59:42 -04:00
rustc_query_impl Remove extern crate rustc_middle from rustc_query_impl. 2024-05-13 08:20:18 +10:00
rustc_query_system Remove some unneeded Cargo.toml dependencies. 2024-05-03 15:33:52 +10:00
rustc_resolve fix typo 2024-05-19 10:23:31 +02:00
rustc_sanitizers Fix typos (taking into account review comments) 2024-05-18 18:12:18 +02:00
rustc_serialize Step bootstrap cfgs 2024-05-01 22:19:11 -04:00
rustc_session Auto merge of #124611 - Urgau:rustdoc-stdin, r=GuillaumeGomez 2024-05-18 10:53:47 +00:00
rustc_smir Rollup merge of #125173 - scottmcm:never-checked, r=davidtwco 2024-05-20 18:13:48 +02:00
rustc_span Rollup merge of #125314 - jdonszelmann:global-registration-feature-gate, r=pnkfelix 2024-05-20 18:13:49 +02:00
rustc_symbol_mangling Rename Unsafe to Safety 2024-05-17 18:33:37 -03:00
rustc_target enable rust-lld on x86_64-unknown-linux-gnu when requested 2024-05-16 16:08:06 +00:00
rustc_trait_selection Make EvalCtxt generic over interner 2024-05-19 19:38:28 -04:00
rustc_traits split out AliasTy -> AliasTerm 2024-05-13 11:59:42 -04:00
rustc_transmute Align: add bytes_usize and bits_usize 2024-05-01 15:57:33 +02:00
rustc_ty_utils Rollup merge of #125173 - scottmcm:never-checked, r=davidtwco 2024-05-20 18:13:48 +02:00
rustc_type_ir Make search graph generic over interner 2024-05-19 19:38:28 -04:00
rustc_type_ir_macros Uplift TraitPredicate 2024-05-11 18:20:00 -04:00
stable_mir Rename Unsafe to Safety 2024-05-17 18:33:37 -03:00