Stabilize force-warn
This commit is contained in:
parent
d89b4a705c
commit
aee2c30f69
3 changed files with 3 additions and 14 deletions
|
@ -1157,19 +1157,10 @@ pub fn rustc_optgroups() -> Vec<RustcOptGroup> {
|
||||||
pub fn get_cmd_lint_options(
|
pub fn get_cmd_lint_options(
|
||||||
matches: &getopts::Matches,
|
matches: &getopts::Matches,
|
||||||
error_format: ErrorOutputType,
|
error_format: ErrorOutputType,
|
||||||
debugging_opts: &DebuggingOptions,
|
|
||||||
) -> (Vec<(String, lint::Level)>, bool, Option<lint::Level>) {
|
) -> (Vec<(String, lint::Level)>, bool, Option<lint::Level>) {
|
||||||
let mut lint_opts_with_position = vec![];
|
let mut lint_opts_with_position = vec![];
|
||||||
let mut describe_lints = false;
|
let mut describe_lints = false;
|
||||||
|
|
||||||
if !debugging_opts.unstable_options && matches.opt_present("force-warn") {
|
|
||||||
early_error(
|
|
||||||
error_format,
|
|
||||||
"the `-Z unstable-options` flag must also be passed to enable \
|
|
||||||
the flag `--force-warn=lints`",
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
for level in [lint::Allow, lint::Warn, lint::ForceWarn, lint::Deny, lint::Forbid] {
|
for level in [lint::Allow, lint::Warn, lint::ForceWarn, lint::Deny, lint::Forbid] {
|
||||||
for (arg_pos, lint_name) in matches.opt_strs_pos(level.as_str()) {
|
for (arg_pos, lint_name) in matches.opt_strs_pos(level.as_str()) {
|
||||||
if lint_name == "help" {
|
if lint_name == "help" {
|
||||||
|
@ -1959,8 +1950,7 @@ pub fn build_session_options(matches: &getopts::Matches) -> Options {
|
||||||
.unwrap_or_else(|e| early_error(error_format, &e[..]));
|
.unwrap_or_else(|e| early_error(error_format, &e[..]));
|
||||||
|
|
||||||
let mut debugging_opts = DebuggingOptions::build(matches, error_format);
|
let mut debugging_opts = DebuggingOptions::build(matches, error_format);
|
||||||
let (lint_opts, describe_lints, lint_cap) =
|
let (lint_opts, describe_lints, lint_cap) = get_cmd_lint_options(matches, error_format);
|
||||||
get_cmd_lint_options(matches, error_format, &debugging_opts);
|
|
||||||
|
|
||||||
check_debug_option_stability(&debugging_opts, error_format, json_rendered);
|
check_debug_option_stability(&debugging_opts, error_format, json_rendered);
|
||||||
|
|
||||||
|
|
|
@ -671,8 +671,7 @@ impl Options {
|
||||||
return Err(1);
|
return Err(1);
|
||||||
}
|
}
|
||||||
|
|
||||||
let (lint_opts, describe_lints, lint_cap) =
|
let (lint_opts, describe_lints, lint_cap) = get_cmd_lint_options(matches, error_format);
|
||||||
get_cmd_lint_options(matches, error_format, &debugging_opts);
|
|
||||||
|
|
||||||
Ok(Options {
|
Ok(Options {
|
||||||
input,
|
input,
|
||||||
|
|
|
@ -505,7 +505,7 @@ fn opts() -> Vec<RustcOptGroup> {
|
||||||
}),
|
}),
|
||||||
stable("allow", |o| o.optmulti("A", "allow", "Set lint allowed", "LINT")),
|
stable("allow", |o| o.optmulti("A", "allow", "Set lint allowed", "LINT")),
|
||||||
stable("warn", |o| o.optmulti("W", "warn", "Set lint warnings", "LINT")),
|
stable("warn", |o| o.optmulti("W", "warn", "Set lint warnings", "LINT")),
|
||||||
unstable("force-warn", |o| o.optmulti("", "force-warn", "Set lint force-warn", "LINT")),
|
stable("force-warn", |o| o.optmulti("", "force-warn", "Set lint force-warn", "LINT")),
|
||||||
stable("deny", |o| o.optmulti("D", "deny", "Set lint denied", "LINT")),
|
stable("deny", |o| o.optmulti("D", "deny", "Set lint denied", "LINT")),
|
||||||
stable("forbid", |o| o.optmulti("F", "forbid", "Set lint forbidden", "LINT")),
|
stable("forbid", |o| o.optmulti("F", "forbid", "Set lint forbidden", "LINT")),
|
||||||
stable("cap-lints", |o| {
|
stable("cap-lints", |o| {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue