Skip to content

Commit aac223f

Browse files
committed
Auto merge of #43556 - dmizuk:remove-z-opt-usage, r=arielb1
librustc_driver: Remove -Z option from usage on stable compiler The `-Z` flag has been disabled since Rust 1.19 stable, but it still shows in `rustc --help`. This PR addresses the inconsistency by removing the message on the stable channel.
2 parents 489b792 + 39ef545 commit aac223f

File tree

1 file changed

+9
-5
lines changed

1 file changed

+9
-5
lines changed

src/librustc_driver/lib.rs

+9-5
Original file line numberDiff line numberDiff line change
@@ -795,19 +795,23 @@ fn usage(verbose: bool, include_unstable_options: bool) {
795795
(option.apply)(&mut options);
796796
}
797797
let message = format!("Usage: rustc [OPTIONS] INPUT");
798-
let extra_help = if verbose {
798+
let nightly_help = if nightly_options::is_nightly_build() {
799+
"\n -Z help Print internal options for debugging rustc"
800+
} else {
801+
""
802+
};
803+
let verbose_help = if verbose {
799804
""
800805
} else {
801806
"\n --help -v Print the full set of options rustc accepts"
802807
};
803808
println!("{}\nAdditional help:
804809
-C help Print codegen options
805810
-W help \
806-
Print 'lint' options and default settings
807-
-Z help Print internal \
808-
options for debugging rustc{}\n",
811+
Print 'lint' options and default settings{}{}\n",
809812
options.usage(&message),
810-
extra_help);
813+
nightly_help,
814+
verbose_help);
811815
}
812816

813817
fn describe_lints(lint_store: &lint::LintStore, loaded_plugins: bool) {

0 commit comments

Comments
 (0)