Skip to content

Commit 800c5f9

Browse files
committed
Rename force-warns to force-warn
1 parent da7d405 commit 800c5f9

34 files changed

+43
-43
lines changed

compiler/rustc_lint/src/context.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -370,7 +370,7 @@ impl LintStore {
370370
match level {
371371
Level::Allow => "-A",
372372
Level::Warn => "-W",
373-
Level::ForceWarn => "--force-warns",
373+
Level::ForceWarn => "--force-warn",
374374
Level::Deny => "-D",
375375
Level::Forbid => "-F",
376376
},

compiler/rustc_lint_defs/src/lib.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ impl Level {
6464
match self {
6565
Level::Allow => "allow",
6666
Level::Warn => "warn",
67-
Level::ForceWarn => "force-warns",
67+
Level::ForceWarn => "force-warn",
6868
Level::Deny => "deny",
6969
Level::Forbid => "forbid",
7070
}

compiler/rustc_middle/src/lint.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -288,7 +288,7 @@ pub fn struct_lint_level<'s, 'd>(
288288
Level::Deny => "-D",
289289
Level::Forbid => "-F",
290290
Level::Allow => "-A",
291-
Level::ForceWarn => "--force-warns",
291+
Level::ForceWarn => "--force-warn",
292292
};
293293
let hyphen_case_lint_name = name.replace("_", "-");
294294
if lint_flag_val.as_str() == name {

compiler/rustc_session/src/config.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -1101,7 +1101,7 @@ pub fn rustc_short_optgroups() -> Vec<RustcOptGroup> {
11011101
),
11021102
opt::multi_s(
11031103
"",
1104-
"force-warns",
1104+
"force-warn",
11051105
"Specifiy lints that should warn even if \
11061106
they are allowed somewhere else",
11071107
"LINT",
@@ -1175,11 +1175,11 @@ pub fn get_cmd_lint_options(
11751175
let mut lint_opts_with_position = vec![];
11761176
let mut describe_lints = false;
11771177

1178-
if !debugging_opts.unstable_options && matches.opt_present("force-warns") {
1178+
if !debugging_opts.unstable_options && matches.opt_present("force-warn") {
11791179
early_error(
11801180
error_format,
11811181
"the `-Z unstable-options` flag must also be passed to enable \
1182-
the flag `--force-warns=lints`",
1182+
the flag `--force-warn=lints`",
11831183
);
11841184
}
11851185

src/doc/unstable-book/src/compiler-flags/force-warns.md renamed to src/doc/unstable-book/src/compiler-flags/force-warn.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1-
# `force-warns`
1+
# `force-warn`
22

33
The tracking issue for this feature is: [#85512](https://github.com/rust-lang/rust/issues/85512).
44

55
------------------------
66

7-
This feature allows you to cause any lint to produce a warning even if the lint has a different level by default or another level is set somewhere else. For instance, the `force-warns` option can be used to make a lint (e.g., `dead_code`) produce a warning even if that lint is allowed in code with `#![allow(dead_code)]`.
7+
This feature allows you to cause any lint to produce a warning even if the lint has a different level by default or another level is set somewhere else. For instance, the `force-warn` option can be used to make a lint (e.g., `dead_code`) produce a warning even if that lint is allowed in code with `#![allow(dead_code)]`.
88

99
## Example
1010

@@ -18,4 +18,4 @@ fn dead_function() {}
1818
fn main() {}
1919
```
2020

21-
We can force a warning to be produced by providing `--force-warns dead_code` to rustc.
21+
We can force a warning to be produced by providing `--force-warn dead_code` to rustc.

src/librustdoc/lib.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -511,10 +511,10 @@ fn opts() -> Vec<RustcOptGroup> {
511511
"LEVEL",
512512
)
513513
}),
514-
unstable("force-warns", |o| {
514+
unstable("force-warn", |o| {
515515
o.optopt(
516516
"",
517-
"force-warns",
517+
"force-warn",
518518
"Lints that will warn even if allowed somewhere else",
519519
"LINTS",
520520
)

src/test/run-make/unstable-flag-required/Makefile

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,4 @@
22

33
all:
44
$(RUSTDOC) --output-format=json x.html 2>&1 | diff - output-format-json.stderr
5-
$(RUSTC) --force-warns dead_code x.rs 2>&1 | diff - force-warns.stderr
5+
$(RUSTC) --force-warn dead_code x.rs 2>&1 | diff - force-warn.stderr
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
error: the `-Z unstable-options` flag must also be passed to enable the flag `--force-warns=lints`
1+
error: the `-Z unstable-options` flag must also be passed to enable the flag `--force-warn=lints`
22

src/test/ui/lint/cli-lint-override.force_warn_deny.stderr

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ warning: extern declarations without an explicit ABI are deprecated
44
LL | extern fn foo() {}
55
| ^^^^^^^^^^^^^^^ ABI should be specified here
66
|
7-
= note: requested on the command line with `--force-warns missing-abi`
7+
= note: requested on the command line with `--force-warn missing-abi`
88
= help: the default ABI is C
99

1010
warning: 1 warning emitted

src/test/ui/lint/cli-lint-override.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
//
66
//[warn_deny] compile-flags: --warn missing_abi --deny missing_abi
77
//[forbid_warn] compile-flags: --warn missing_abi --forbid missing_abi
8-
//[force_warn_deny] compile-flags: -Z unstable-options --force-warns missing_abi --allow missing_abi
8+
//[force_warn_deny] compile-flags: -Z unstable-options --force-warn missing_abi --allow missing_abi
99
//[force_warn_deny] check-pass
1010

1111

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
// Checks that rustc correctly errors when passed an invalid lint with
2-
// `--force-warns`. This is a regression test for issue #86958.
2+
// `--force-warn`. This is a regression test for issue #86958.
33
//
4-
// compile-flags: -Z unstable-options --force-warns foo-qux
4+
// compile-flags: -Z unstable-options --force-warn foo-qux
55
// error-pattern: unknown lint: `foo_qux`
66

77
fn main() {}

src/test/ui/lint/cli-unknown-force-warn.stderr

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
error[E0602]: unknown lint: `foo_qux`
22
|
3-
= note: requested on the command line with `--force-warns foo_qux`
3+
= note: requested on the command line with `--force-warn foo_qux`
44

55
error[E0602]: unknown lint: `foo_qux`
66
|
7-
= note: requested on the command line with `--force-warns foo_qux`
7+
= note: requested on the command line with `--force-warn foo_qux`
88

99
error[E0602]: unknown lint: `foo_qux`
1010
|
11-
= note: requested on the command line with `--force-warns foo_qux`
11+
= note: requested on the command line with `--force-warn foo_qux`
1212

1313
error: aborting due to 3 previous errors
1414

src/test/ui/lint/force-warn/force-allowed-by-default-lint.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// compile-flags: --force-warns elided_lifetimes_in_paths -Zunstable-options
1+
// compile-flags: --force-warn elided_lifetimes_in_paths -Zunstable-options
22
// check-pass
33

44
struct Foo<'a> {

src/test/ui/lint/force-warn/force-allowed-by-default-lint.stderr

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ warning: hidden lifetime parameters in types are deprecated
44
LL | fn foo(x: &Foo) {}
55
| ^^^- help: indicate the anonymous lifetime: `<'_>`
66
|
7-
= note: requested on the command line with `--force-warns elided-lifetimes-in-paths`
7+
= note: requested on the command line with `--force-warn elided-lifetimes-in-paths`
88

99
warning: 1 warning emitted
1010

src/test/ui/lint/force-warn/force-allowed-deny-by-default-lint.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// compile-flags: --force-warns const_err -Zunstable-options
1+
// compile-flags: --force-warn const_err -Zunstable-options
22
// check-pass
33

44
#![allow(const_err)]

src/test/ui/lint/force-warn/force-allowed-deny-by-default-lint.stderr

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ LL | const C: i32 = 1 / 0;
66
| |
77
| attempt to divide `1_i32` by zero
88
|
9-
= note: requested on the command line with `--force-warns const-err`
9+
= note: requested on the command line with `--force-warn const-err`
1010
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
1111
= note: for more information, see issue #71800 <https://github.com/rust-lang/rust/issues/71800>
1212

src/test/ui/lint/force-warn/force-allowed-warning.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// compile-flags: --force-warns dead_code -Zunstable-options
1+
// compile-flags: --force-warn dead_code -Zunstable-options
22
// check-pass
33

44
#![allow(dead_code)]

src/test/ui/lint/force-warn/force-allowed-warning.stderr

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ warning: function is never used: `dead_function`
44
LL | fn dead_function() {}
55
| ^^^^^^^^^^^^^
66
|
7-
= note: requested on the command line with `--force-warns dead-code`
7+
= note: requested on the command line with `--force-warn dead-code`
88

99
warning: 1 warning emitted
1010

src/test/ui/lint/force-warn/force-deny-by-default-lint.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// compile-flags: --force-warns const_err -Zunstable-options
1+
// compile-flags: --force-warn const_err -Zunstable-options
22
// check-pass
33

44
const C: i32 = 1 / 0;

src/test/ui/lint/force-warn/force-deny-by-default-lint.stderr

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ LL | const C: i32 = 1 / 0;
66
| |
77
| attempt to divide `1_i32` by zero
88
|
9-
= note: requested on the command line with `--force-warns const-err`
9+
= note: requested on the command line with `--force-warn const-err`
1010
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
1111
= note: for more information, see issue #71800 <https://github.com/rust-lang/rust/issues/71800>
1212

src/test/ui/lint/force-warn/force-lint-allow-all-warnings.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// compile-flags: --force-warns dead_code -Zunstable-options
1+
// compile-flags: --force-warn dead_code -Zunstable-options
22
// check-pass
33

44
#![allow(warnings)]

src/test/ui/lint/force-warn/force-lint-allow-all-warnings.stderr

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ warning: function is never used: `dead_function`
44
LL | fn dead_function() {}
55
| ^^^^^^^^^^^^^
66
|
7-
= note: requested on the command line with `--force-warns dead-code`
7+
= note: requested on the command line with `--force-warn dead-code`
88

99
warning: 1 warning emitted
1010

src/test/ui/lint/force-warn/force-lint-group-allow-all-warnings.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// compile-flags: --force-warns nonstandard_style -Zunstable-options
1+
// compile-flags: --force-warn nonstandard_style -Zunstable-options
22
// check-pass
33

44
#![allow(warnings)]

src/test/ui/lint/force-warn/force-lint-group-allow-all-warnings.stderr

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ warning: function `FUNCTION` should have a snake case name
44
LL | pub fn FUNCTION() {}
55
| ^^^^^^^^ help: convert the identifier to snake case: `function`
66
|
7-
= note: `--force-warns non-snake-case` implied by `--force-warns nonstandard-style`
7+
= note: `--force-warn non-snake-case` implied by `--force-warn nonstandard-style`
88

99
warning: 1 warning emitted
1010

src/test/ui/lint/force-warn/force-lint-in-allowed-group.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// compile-flags: --force-warns bare_trait_objects -Zunstable-options
1+
// compile-flags: --force-warn bare_trait_objects -Zunstable-options
22
// check-pass
33

44
#![allow(rust_2018_idioms)]

src/test/ui/lint/force-warn/force-lint-in-allowed-group.stderr

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ warning: trait objects without an explicit `dyn` are deprecated
44
LL | pub fn function(_x: Box<SomeTrait>) {}
55
| ^^^^^^^^^ help: use `dyn`: `dyn SomeTrait`
66
|
7-
= note: requested on the command line with `--force-warns bare-trait-objects`
7+
= note: requested on the command line with `--force-warn bare-trait-objects`
88
= warning: this is accepted in the current edition (Rust 2015) but is a hard error in Rust 2021!
99
= note: for more information, see issue #80165 <https://github.com/rust-lang/rust/issues/80165>
1010

src/test/ui/lint/force-warn/force-warns-cap-lints-allow.rs renamed to src/test/ui/lint/force-warn/force-warn-cap-lints-allow.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// compile-flags: --cap-lints allow --force-warns bare_trait_objects -Zunstable-options
1+
// compile-flags: --cap-lints allow --force-warn bare_trait_objects -Zunstable-options
22
// check-pass
33

44
pub trait SomeTrait {}

src/test/ui/lint/force-warn/force-warns-cap-lints-allow.stderr renamed to src/test/ui/lint/force-warn/force-warn-cap-lints-allow.stderr

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
warning: trait objects without an explicit `dyn` are deprecated
2-
--> $DIR/force-warns-cap-lints-allow.rs:6:25
2+
--> $DIR/force-warn-cap-lints-allow.rs:6:25
33
|
44
LL | pub fn function(_x: Box<SomeTrait>) {}
55
| ^^^^^^^^^ help: use `dyn`: `dyn SomeTrait`
66
|
7-
= note: requested on the command line with `--force-warns bare-trait-objects`
7+
= note: requested on the command line with `--force-warn bare-trait-objects`
88
= warning: this is accepted in the current edition (Rust 2015) but is a hard error in Rust 2021!
99
= note: for more information, see issue #80165 <https://github.com/rust-lang/rust/issues/80165>
1010

src/test/ui/lint/force-warn/force-warn-cap-lints-warn.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// compile-flags: --cap-lints warn --force-warns rust-2021-compatibility -Zunstable-options
1+
// compile-flags: --cap-lints warn --force-warn rust-2021-compatibility -Zunstable-options
22
// check-pass
33
#![allow(ellipsis_inclusive_range_patterns)]
44

src/test/ui/lint/force-warn/force-warn-cap-lints-warn.stderr

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ warning: `...` range patterns are deprecated
44
LL | 0...100 => true,
55
| ^^^ help: use `..=` for an inclusive range
66
|
7-
= note: `--force-warns ellipsis-inclusive-range-patterns` implied by `--force-warns rust-2021-compatibility`
7+
= note: `--force-warn ellipsis-inclusive-range-patterns` implied by `--force-warn rust-2021-compatibility`
88
= warning: this is accepted in the current edition (Rust 2015) but is a hard error in Rust 2021!
99
= note: for more information, see issue #80165 <https://github.com/rust-lang/rust/issues/80165>
1010

src/test/ui/lint/force-warn/force-warn-group-allow-warning.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// compile-flags: --force-warns rust-2018-idioms -Zunstable-options
1+
// compile-flags: --force-warn rust-2018-idioms -Zunstable-options
22
// check-pass
33

44
#![allow(bare_trait_objects)]

src/test/ui/lint/force-warn/force-warn-group-allow-warning.stderr

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ warning: trait objects without an explicit `dyn` are deprecated
44
LL | pub fn function(_x: Box<SomeTrait>) {}
55
| ^^^^^^^^^ help: use `dyn`: `dyn SomeTrait`
66
|
7-
= note: `--force-warns bare-trait-objects` implied by `--force-warns rust-2018-idioms`
7+
= note: `--force-warn bare-trait-objects` implied by `--force-warn rust-2018-idioms`
88
= warning: this is accepted in the current edition (Rust 2015) but is a hard error in Rust 2021!
99
= note: for more information, see issue #80165 <https://github.com/rust-lang/rust/issues/80165>
1010

src/test/ui/lint/force-warn/force-warn-group.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// compile-flags: --force-warns rust_2018_idioms -Zunstable-options
1+
// compile-flags: --force-warn rust_2018_idioms -Zunstable-options
22
// check-pass
33

44
#![allow(rust_2018_idioms)]

src/test/ui/lint/force-warn/force-warn-group.stderr

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ warning: trait objects without an explicit `dyn` are deprecated
44
LL | pub fn function(_x: Box<SomeTrait>) {}
55
| ^^^^^^^^^ help: use `dyn`: `dyn SomeTrait`
66
|
7-
= note: `--force-warns bare-trait-objects` implied by `--force-warns rust-2018-idioms`
7+
= note: `--force-warn bare-trait-objects` implied by `--force-warn rust-2018-idioms`
88
= warning: this is accepted in the current edition (Rust 2015) but is a hard error in Rust 2021!
99
= note: for more information, see issue #80165 <https://github.com/rust-lang/rust/issues/80165>
1010

0 commit comments

Comments
 (0)