Rollup merge of #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 #41142
This commit is contained in:
Mazdak Farrokhzad 2019-04-12 12:17:48 +02:00 committed by GitHub
commit 59e95ddfa8
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 9 additions and 2 deletions

View file

@ -86,6 +86,13 @@ This flag will set which lints should be set to the [deny level](lints/levels.ht
This flag will set which lints should be set to the [forbid level](lints/levels.html#forbid).
## `-Z`: set unstable options
This flag will allow you to set unstable options of rustc. In order to set multiple options,
the -Z flag can be used multiple times. For example: `rustc -Z verbose -Z time`.
Specifying options with -Z is only available on nightly. To view all available options
run: `rustc -Z help`.
## `--cap-lints`: set the most restrictive lint level
This flag lets you 'cap' lints, for more, [see here](lints/levels.html#capping-lints).

View file

@ -744,7 +744,7 @@ fn usage(verbose: bool, include_unstable_options: bool) {
}
let message = "Usage: rustc [OPTIONS] INPUT";
let nightly_help = if nightly_options::is_nightly_build() {
"\n -Z help Print internal options for debugging rustc"
"\n -Z help Print unstable compiler options"
} else {
""
};
@ -892,7 +892,7 @@ Available lint options:
}
fn describe_debug_flags() {
println!("\nAvailable debug options:\n");
println!("\nAvailable options:\n");
print_flag_list("-Z", config::DB_OPTIONS);
}