rust/compiler
Jacob Pratt 6da26f7cfe
Rollup merge of #138552 - jieyouxu:print-request-cleanups, r=Urgau
Misc print request handling cleanups + a centralized test for print request stability gating

I was working on implementing `--print=supported-crate-types`, then I noticed some things that were mildly annoying me, so I pulled out these changes. In this PR:

- First commit adds a centralized test `tests/ui/print/stability.rs` that is responsible for exercising stability gating of the print requests.
    - AFAICT we didn't have any test that systematically checks this.
    - I coalesced `tests/ui/feature-gates/feature-gate-print-check-cfg.rs` (for `--print=check-cfg`) into this test too, since `--print=check-cfg` is only `-Z unstable-options`-gated like other unstable print requests, and is not additionally feature-gated. cc ``@Urgau`` in case you have any concerns.
- Second commit alphabetically sorts the `PrintKind` enum for consistency because the `PRINT_KINDS` list (using the enum) is *already* alphabetically sorted.
- Third commit pulls out two helpers:
    1. A helper `check_print_request_stability` for checking stability of print requests and the diagnostics for using unstable print requests without `-Z unstable-options`, to avoid repeating the same logic over and over.
    2. A helper `emit_unknown_print_request_help` for the unknown print request diagnostics to make print request collection control flow more obvious.
- Fourth commit renames `PrintKind::{TargetSpec,AllTargetSpecs}` to `PrintKind::{TargetSpecJson,AllTargetSpecsJson}` to better reflect their actual print names, `--print={target-spec-json,all-target-specs-json}`.

r? ``@nnethercote`` (or compiler/reroll)
2025-03-16 21:47:44 -04:00
..
rustc Revert "Use workspace lints for crates in compiler/ #138084" 2025-03-10 18:12:47 +08:00
rustc_abi Use {Decodable,Encodable}_NoContext in type_ir 2025-03-15 06:34:36 +00:00
rustc_arena Remove #![warn(unreachable_pub)] from all compiler/ crates. 2025-03-11 13:14:21 +11:00
rustc_ast Auto merge of #138414 - matthiaskrgr:rollup-9ablqdb, r=matthiaskrgr 2025-03-12 17:27:43 +00:00
rustc_ast_ir Use {Decodable,Encodable}_NoContext in type_ir 2025-03-15 06:34:36 +00:00
rustc_ast_lowering Rollup merge of #138482 - nnethercote:fix-hir-printing, r=compiler-errors 2025-03-15 00:18:25 +01:00
rustc_ast_passes Rollup merge of #138331 - nnethercote:use-RUSTC_LINT_FLAGS-more, r=onur-ozkan,jieyouxu 2025-03-12 10:19:30 -07:00
rustc_ast_pretty Rollup merge of #138331 - nnethercote:use-RUSTC_LINT_FLAGS-more, r=onur-ozkan,jieyouxu 2025-03-12 10:19:30 -07:00
rustc_attr_data_structures Rollup merge of #138331 - nnethercote:use-RUSTC_LINT_FLAGS-more, r=onur-ozkan,jieyouxu 2025-03-12 10:19:30 -07:00
rustc_attr_parsing Auto merge of #138414 - matthiaskrgr:rollup-9ablqdb, r=matthiaskrgr 2025-03-12 17:27:43 +00:00
rustc_baked_icu_data Add unreachable_pub to RUSTC_LINT_FLAGS for compiler/ crates. 2025-03-11 13:14:21 +11:00
rustc_borrowck Auto merge of #138532 - matthiaskrgr:rollup-mgcynqu, r=matthiaskrgr 2025-03-15 11:40:17 +00:00
rustc_builtin_macros Auto merge of #138414 - matthiaskrgr:rollup-9ablqdb, r=matthiaskrgr 2025-03-12 17:27:43 +00:00
rustc_codegen_cranelift Rollup merge of #138082 - thaliaarchi:slice-cfg-not-test, r=thomcc 2025-03-16 09:40:05 +08:00
rustc_codegen_gcc intrinsics: remove unnecessary leading underscore from argument names 2025-03-12 08:04:09 +01:00
rustc_codegen_llvm Auto merge of #137011 - LuuuXXX:promote-ohos-with-host-tools, r=Amanieu 2025-03-16 18:42:18 +00:00
rustc_codegen_ssa Rollup merge of #138549 - scottmcm:option-ssa, r=saethlin 2025-03-16 13:19:53 +08:00
rustc_const_eval Stop relying on rustc_type_ir in non-type-system crates 2025-03-15 06:42:48 +00:00
rustc_data_structures Auto merge of #137011 - LuuuXXX:promote-ohos-with-host-tools, r=Amanieu 2025-03-16 18:42:18 +00:00
rustc_driver Revert "Use workspace lints for crates in compiler/ #138084" 2025-03-10 18:12:47 +08:00
rustc_driver_impl Rename PrintKind::{AllTargetSpecs,TargetSpec} to {AllTargetSpecsJson,TargetSpecJson} 2025-03-16 21:56:02 +08:00
rustc_error_codes Rollup merge of #138331 - nnethercote:use-RUSTC_LINT_FLAGS-more, r=onur-ozkan,jieyouxu 2025-03-12 10:19:30 -07:00
rustc_error_messages Rollup merge of #138404 - bjorn3:sysroot_handling_cleanup, r=petrochenkov,jieyouxu 2025-03-13 11:28:35 +01:00
rustc_errors Do not suggest using -Zmacro-backtrace for builtin macros 2025-03-14 19:50:03 +00:00
rustc_expand Do not suggest using -Zmacro-backtrace for builtin macros 2025-03-14 19:50:03 +00:00
rustc_feature Rollup merge of #138331 - nnethercote:use-RUSTC_LINT_FLAGS-more, r=onur-ozkan,jieyouxu 2025-03-12 10:19:30 -07:00
rustc_fluent_macro Remove #![warn(unreachable_pub)] from all compiler/ crates. 2025-03-11 13:14:21 +11:00
rustc_fs_util Revert "Use workspace lints for crates in compiler/ #138084" 2025-03-10 18:12:47 +08:00
rustc_graphviz Remove #![warn(unreachable_pub)] from all compiler/ crates. 2025-03-11 13:14:21 +11:00
rustc_hashes Revert "Use workspace lints for crates in compiler/ #138084" 2025-03-10 18:12:47 +08:00
rustc_hir Rollup merge of #138109 - Kohei316:feat/rust-doc-precise-capturing-arg, r=aDotInTheVoid,compiler-errors 2025-03-13 11:28:26 +01:00
rustc_hir_analysis Add RTN support to rustdoc 2025-03-15 18:13:27 +00:00
rustc_hir_pretty Fix HIR param pretty printing some more. 2025-03-14 09:45:41 +11:00
rustc_hir_typeck Rollup merge of #138484 - xizheyin:issue-138392, r=compiler-errors 2025-03-16 09:40:10 +08:00
rustc_incremental Auto merge of #138416 - Manishearth:rollup-fejor9p, r=Manishearth 2025-03-13 01:37:26 +00:00
rustc_index Use {Decodable,Encodable}_NoContext in type_ir 2025-03-15 06:34:36 +00:00
rustc_index_macros Add unreachable_pub to RUSTC_LINT_FLAGS for compiler/ crates. 2025-03-11 13:14:21 +11:00
rustc_infer Fold visit into ty 2025-03-15 06:34:36 +00:00
rustc_interface Rollup merge of #138404 - bjorn3:sysroot_handling_cleanup, r=petrochenkov,jieyouxu 2025-03-13 11:28:35 +01:00
rustc_lexer Remove #![warn(unreachable_pub)] from all compiler/ crates. 2025-03-11 13:14:21 +11:00
rustc_lint Stop relying on rustc_type_ir in non-type-system crates 2025-03-15 06:42:48 +00:00
rustc_lint_defs Remove #![warn(unreachable_pub)] from all compiler/ crates. 2025-03-11 13:14:21 +11:00
rustc_llvm Auto merge of #137011 - LuuuXXX:promote-ohos-with-host-tools, r=Amanieu 2025-03-16 18:42:18 +00:00
rustc_log Revert "Use workspace lints for crates in compiler/ #138084" 2025-03-10 18:12:47 +08:00
rustc_macros Move codec module back into middle 2025-03-15 06:42:48 +00:00
rustc_metadata Stop relying on rustc_type_ir in non-type-system crates 2025-03-15 06:42:48 +00:00
rustc_middle Rollup merge of #138549 - scottmcm:option-ssa, r=saethlin 2025-03-16 13:19:53 +08:00
rustc_mir_build Delegation: allow foreign fns reuse 2025-03-13 14:13:07 +03:00
rustc_mir_dataflow Auto merge of #138414 - matthiaskrgr:rollup-9ablqdb, r=matthiaskrgr 2025-03-12 17:27:43 +00:00
rustc_mir_transform Don't drop Rvalue::WrapUnsafeBinder during GVN 2025-03-15 18:10:55 +00:00
rustc_monomorphize Auto merge of #138414 - matthiaskrgr:rollup-9ablqdb, r=matthiaskrgr 2025-03-12 17:27:43 +00:00
rustc_next_trait_solver Use {Decodable,Encodable}_NoContext in type_ir 2025-03-15 06:34:36 +00:00
rustc_parse Rollup merge of #138511 - mohe2015:rustc-parse-pub-parse-expr-cond, r=oli-obk 2025-03-15 00:18:26 +01:00
rustc_parse_format Rollup merge of #138331 - nnethercote:use-RUSTC_LINT_FLAGS-more, r=onur-ozkan,jieyouxu 2025-03-12 10:19:30 -07:00
rustc_passes Auto merge of #138416 - Manishearth:rollup-fejor9p, r=Manishearth 2025-03-13 01:37:26 +00:00
rustc_pattern_analysis Remove #![warn(unreachable_pub)] from all compiler/ crates. 2025-03-11 13:14:21 +11:00
rustc_privacy Auto merge of #138416 - Manishearth:rollup-fejor9p, r=Manishearth 2025-03-13 01:37:26 +00:00
rustc_query_impl Auto merge of #137011 - LuuuXXX:promote-ohos-with-host-tools, r=Amanieu 2025-03-16 18:42:18 +00:00
rustc_query_system Rollup merge of #138331 - nnethercote:use-RUSTC_LINT_FLAGS-more, r=onur-ozkan,jieyouxu 2025-03-12 17:59:08 +01:00
rustc_resolve resolve: Avoid some unstable iteration 2025-03-14 18:34:08 +03:00
rustc_sanitizers Squash fold into ty 2025-03-15 06:34:36 +00:00
rustc_serialize Use {Decodable,Encodable}_NoContext in type_ir 2025-03-15 06:34:36 +00:00
rustc_session Rename PrintKind::{AllTargetSpecs,TargetSpec} to {AllTargetSpecsJson,TargetSpecJson} 2025-03-16 21:56:02 +08:00
rustc_smir Auto merge of #138416 - Manishearth:rollup-fejor9p, r=Manishearth 2025-03-13 01:37:26 +00:00
rustc_span Do not suggest using -Zmacro-backtrace for builtin macros 2025-03-14 19:50:03 +00:00
rustc_symbol_mangling Auto merge of #138414 - matthiaskrgr:rollup-9ablqdb, r=matthiaskrgr 2025-03-12 17:27:43 +00:00
rustc_target Rollup merge of #138056 - heiher:loong64v1.1-features, r=petrochenkov 2025-03-15 00:18:22 +01:00
rustc_trait_selection Fold visit into ty 2025-03-15 06:34:36 +00:00
rustc_traits Rollup merge of #138394 - lcnr:yeet-variant, r=compiler-errors 2025-03-12 10:19:32 -07:00
rustc_transmute Auto merge of #138414 - matthiaskrgr:rollup-9ablqdb, r=matthiaskrgr 2025-03-12 17:27:43 +00:00
rustc_ty_utils Stop relying on rustc_type_ir in non-type-system crates 2025-03-15 06:42:48 +00:00
rustc_type_ir Move codec module back into middle 2025-03-15 06:42:48 +00:00
rustc_type_ir_macros Fold visit into ty 2025-03-15 06:34:36 +00:00
stable_mir Revert "Use workspace lints for crates in compiler/ #138084" 2025-03-10 18:12:47 +08:00