From c06ec63c2fe7af1cef71d267c191e3d0af0cea00 Mon Sep 17 00:00:00 2001 From: Jamie Hill-Daniel Date: Fri, 19 Jun 2026 14:42:12 +0100 Subject: [PATCH] Rename `lint-rust-version` to `hint-msrv` --- compiler/rustc_errors/src/lib.rs | 2 +- compiler/rustc_session/src/options.rs | 4 ++-- compiler/rustc_session/src/session.rs | 2 +- .../src/compiler-flags/{lint-rust-version.md => hint-msrv.md} | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) rename src/doc/unstable-book/src/compiler-flags/{lint-rust-version.md => hint-msrv.md} (93%) diff --git a/compiler/rustc_errors/src/lib.rs b/compiler/rustc_errors/src/lib.rs index 76cdb10f429c7..26e2bdaa19e8d 100644 --- a/compiler/rustc_errors/src/lib.rs +++ b/compiler/rustc_errors/src/lib.rs @@ -367,7 +367,7 @@ struct DiagCtxtInner { /// stored along side the main panic backtrace. ice_file: Option, - /// Controlled by `-Z lint-rust-version`; this allows avoiding emitting lints which would raise MSRV. + /// Controlled by `-Z hint-msrv`; this allows avoiding emitting lints which would raise MSRV. msrv: Option, } diff --git a/compiler/rustc_session/src/options.rs b/compiler/rustc_session/src/options.rs index 2f9fa09c322bb..289d5c7918322 100644 --- a/compiler/rustc_session/src/options.rs +++ b/compiler/rustc_session/src/options.rs @@ -2400,6 +2400,8 @@ options! { "allow deducing higher-ranked outlives assumptions from coroutines when proving auto traits"), hint_mostly_unused: bool = (false, parse_bool, [TRACKED], "hint that most of this crate will go unused, to minimize work for uncalled functions"), + hint_msrv: Option = (None, parse_rust_version, [TRACKED], + "control the minimum rust version for lints"), human_readable_cgu_names: bool = (false, parse_bool, [TRACKED], "generate human-readable, predictable names for codegen units (default: no)"), identify_regions: bool = (false, parse_bool, [UNTRACKED], @@ -2468,8 +2470,6 @@ options! { "lint LLVM IR (default: no)"), lint_mir: bool = (false, parse_bool, [UNTRACKED], "lint MIR before and after each transformation"), - lint_rust_version: Option = (None, parse_rust_version, [TRACKED], - "control the minimum rust version for lints"), llvm_module_flag: Vec<(String, u32, String)> = (Vec::new(), parse_llvm_module_flag, [TRACKED], "a list of module flags to pass to LLVM (space separated)"), llvm_plugins: Vec = (Vec::new(), parse_list, [TRACKED], diff --git a/compiler/rustc_session/src/session.rs b/compiler/rustc_session/src/session.rs index c19a2d71e2078..4cf152136bf3a 100644 --- a/compiler/rustc_session/src/session.rs +++ b/compiler/rustc_session/src/session.rs @@ -1040,7 +1040,7 @@ pub fn build_session( dcx = dcx.with_ice_file(ice_file); } - if let Some(msrv) = sopts.unstable_opts.lint_rust_version { + if let Some(msrv) = sopts.unstable_opts.hint_msrv { dcx = dcx.with_msrv(msrv); } diff --git a/src/doc/unstable-book/src/compiler-flags/lint-rust-version.md b/src/doc/unstable-book/src/compiler-flags/hint-msrv.md similarity index 93% rename from src/doc/unstable-book/src/compiler-flags/lint-rust-version.md rename to src/doc/unstable-book/src/compiler-flags/hint-msrv.md index ecc0e7fba6350..456c50f1e35d6 100644 --- a/src/doc/unstable-book/src/compiler-flags/lint-rust-version.md +++ b/src/doc/unstable-book/src/compiler-flags/hint-msrv.md @@ -1,4 +1,4 @@ -# `lint-rust-version` +# `hint-msrv` The tracking issue for this feature is: [#157574](https://github.com/rust-lang/rust/issues/157574).