Skip to content

Commit 37cb3ee

Browse files
authored
Rollup merge of rust-lang#59680 - DevQps:document-rustc-z-flag, r=cramertj
Document the -Z flag to the rustc book # Description Changes: - Added new documentation on the `-Z` flag of rustc in the command-line arguments section of the rustc book. If I need to rephrase anything or if you have any improvements, please let me know! I deliberately did not create an exhaustive list of all options since they are likely to change over time and per toolchain version. closes rust-lang#41142
2 parents e4950c7 + cdeb745 commit 37cb3ee

File tree

2 files changed

+9
-2
lines changed

2 files changed

+9
-2
lines changed

src/doc/rustc/src/command-line-arguments.md

+7
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,13 @@ This flag will set which lints should be set to the [deny level](lints/levels.ht
8686

8787
This flag will set which lints should be set to the [forbid level](lints/levels.html#forbid).
8888

89+
## `-Z`: set unstable options
90+
91+
This flag will allow you to set unstable options of rustc. In order to set multiple options,
92+
the -Z flag can be used multiple times. For example: `rustc -Z verbose -Z time`.
93+
Specifying options with -Z is only available on nightly. To view all available options
94+
run: `rustc -Z help`.
95+
8996
## `--cap-lints`: set the most restrictive lint level
9097

9198
This flag lets you 'cap' lints, for more, [see here](lints/levels.html#capping-lints).

src/librustc_driver/lib.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -744,7 +744,7 @@ fn usage(verbose: bool, include_unstable_options: bool) {
744744
}
745745
let message = "Usage: rustc [OPTIONS] INPUT";
746746
let nightly_help = if nightly_options::is_nightly_build() {
747-
"\n -Z help Print internal options for debugging rustc"
747+
"\n -Z help Print unstable compiler options"
748748
} else {
749749
""
750750
};
@@ -892,7 +892,7 @@ Available lint options:
892892
}
893893

894894
fn describe_debug_flags() {
895-
println!("\nAvailable debug options:\n");
895+
println!("\nAvailable options:\n");
896896
print_flag_list("-Z", config::DB_OPTIONS);
897897
}
898898

0 commit comments

Comments
 (0)