diff options
| author | Eric Huss <eric@huss.org> | 2021-07-21 10:12:30 -0700 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2021-07-21 10:12:30 -0700 |
| commit | 43e25751ff6f20941bef019bdb10bce32af8f178 (patch) | |
| tree | bb1f1d4339aa9d223e1c4053d8c773f00069bc07 /src | |
| parent | b9e3f3d5a21a24bf91e34a649896092dbad83a38 (diff) | |
| parent | 800c5f9202ca5309bbe372bbb8f2d6f1c29e59a5 (diff) | |
| download | rust-43e25751ff6f20941bef019bdb10bce32af8f178.tar.gz rust-43e25751ff6f20941bef019bdb10bce32af8f178.zip | |
Rollup merge of #87346 - rylev:rename-force-warn, r=nikomatsakis
Rename force-warns to force-warn The renames the `--force-warns` option to `--force-warn`. This mirrors other lint options like `--warn` and `--deny` which are in the singular. r? `@nikomatsakis` cc `@ehuss` - this option is being used by Cargo. How do we make sure the transition to using the new name is as smooth as possible?
Diffstat (limited to 'src')
30 files changed, 37 insertions, 37 deletions
diff --git a/src/doc/unstable-book/src/compiler-flags/force-warns.md b/src/doc/unstable-book/src/compiler-flags/force-warn.md index 0a205be096c..052de0f379e 100644 --- a/src/doc/unstable-book/src/compiler-flags/force-warns.md +++ b/src/doc/unstable-book/src/compiler-flags/force-warn.md @@ -1,10 +1,10 @@ -# `force-warns` +# `force-warn` The tracking issue for this feature is: [#85512](https://github.com/rust-lang/rust/issues/85512). ------------------------ -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)]`. +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)]`. ## Example @@ -18,4 +18,4 @@ fn dead_function() {} fn main() {} ``` -We can force a warning to be produced by providing `--force-warns dead_code` to rustc. +We can force a warning to be produced by providing `--force-warn dead_code` to rustc. diff --git a/src/librustdoc/lib.rs b/src/librustdoc/lib.rs index 19deaa11388..fa755777584 100644 --- a/src/librustdoc/lib.rs +++ b/src/librustdoc/lib.rs @@ -511,10 +511,10 @@ fn opts() -> Vec<RustcOptGroup> { "LEVEL", ) }), - unstable("force-warns", |o| { + unstable("force-warn", |o| { o.optopt( "", - "force-warns", + "force-warn", "Lints that will warn even if allowed somewhere else", "LINTS", ) diff --git a/src/test/run-make/unstable-flag-required/Makefile b/src/test/run-make/unstable-flag-required/Makefile index aa20d6aa4bf..a9aad54162f 100644 --- a/src/test/run-make/unstable-flag-required/Makefile +++ b/src/test/run-make/unstable-flag-required/Makefile @@ -2,4 +2,4 @@ all: $(RUSTDOC) --output-format=json x.html 2>&1 | diff - output-format-json.stderr - $(RUSTC) --force-warns dead_code x.rs 2>&1 | diff - force-warns.stderr + $(RUSTC) --force-warn dead_code x.rs 2>&1 | diff - force-warn.stderr diff --git a/src/test/run-make/unstable-flag-required/force-warns.stderr b/src/test/run-make/unstable-flag-required/force-warn.stderr index e0936196a11..1b70dc83bdb 100644 --- a/src/test/run-make/unstable-flag-required/force-warns.stderr +++ b/src/test/run-make/unstable-flag-required/force-warn.stderr @@ -1,2 +1,2 @@ -error: the `-Z unstable-options` flag must also be passed to enable the flag `--force-warns=lints` +error: the `-Z unstable-options` flag must also be passed to enable the flag `--force-warn=lints` diff --git a/src/test/ui/lint/cli-lint-override.force_warn_deny.stderr b/src/test/ui/lint/cli-lint-override.force_warn_deny.stderr index 50c58ea6e15..74e7823e1ff 100644 --- a/src/test/ui/lint/cli-lint-override.force_warn_deny.stderr +++ b/src/test/ui/lint/cli-lint-override.force_warn_deny.stderr @@ -4,7 +4,7 @@ warning: extern declarations without an explicit ABI are deprecated LL | extern fn foo() {} | ^^^^^^^^^^^^^^^ ABI should be specified here | - = note: requested on the command line with `--force-warns missing-abi` + = note: requested on the command line with `--force-warn missing-abi` = help: the default ABI is C warning: 1 warning emitted diff --git a/src/test/ui/lint/cli-lint-override.rs b/src/test/ui/lint/cli-lint-override.rs index 6814c15e656..a0a96d01be3 100644 --- a/src/test/ui/lint/cli-lint-override.rs +++ b/src/test/ui/lint/cli-lint-override.rs @@ -5,7 +5,7 @@ // //[warn_deny] compile-flags: --warn missing_abi --deny missing_abi //[forbid_warn] compile-flags: --warn missing_abi --forbid missing_abi -//[force_warn_deny] compile-flags: -Z unstable-options --force-warns missing_abi --allow missing_abi +//[force_warn_deny] compile-flags: -Z unstable-options --force-warn missing_abi --allow missing_abi //[force_warn_deny] check-pass diff --git a/src/test/ui/lint/cli-unknown-force-warn.rs b/src/test/ui/lint/cli-unknown-force-warn.rs index 201161296ba..55544cc7378 100644 --- a/src/test/ui/lint/cli-unknown-force-warn.rs +++ b/src/test/ui/lint/cli-unknown-force-warn.rs @@ -1,7 +1,7 @@ // Checks that rustc correctly errors when passed an invalid lint with -// `--force-warns`. This is a regression test for issue #86958. +// `--force-warn`. This is a regression test for issue #86958. // -// compile-flags: -Z unstable-options --force-warns foo-qux +// compile-flags: -Z unstable-options --force-warn foo-qux // error-pattern: unknown lint: `foo_qux` fn main() {} diff --git a/src/test/ui/lint/cli-unknown-force-warn.stderr b/src/test/ui/lint/cli-unknown-force-warn.stderr index 3a9aebb996c..4367c3b4500 100644 --- a/src/test/ui/lint/cli-unknown-force-warn.stderr +++ b/src/test/ui/lint/cli-unknown-force-warn.stderr @@ -1,14 +1,14 @@ error[E0602]: unknown lint: `foo_qux` | - = note: requested on the command line with `--force-warns foo_qux` + = note: requested on the command line with `--force-warn foo_qux` error[E0602]: unknown lint: `foo_qux` | - = note: requested on the command line with `--force-warns foo_qux` + = note: requested on the command line with `--force-warn foo_qux` error[E0602]: unknown lint: `foo_qux` | - = note: requested on the command line with `--force-warns foo_qux` + = note: requested on the command line with `--force-warn foo_qux` error: aborting due to 3 previous errors diff --git a/src/test/ui/lint/force-warn/force-allowed-by-default-lint.rs b/src/test/ui/lint/force-warn/force-allowed-by-default-lint.rs index 0a3e20b4f7d..4799429ea2c 100644 --- a/src/test/ui/lint/force-warn/force-allowed-by-default-lint.rs +++ b/src/test/ui/lint/force-warn/force-allowed-by-default-lint.rs @@ -1,4 +1,4 @@ -// compile-flags: --force-warns elided_lifetimes_in_paths -Zunstable-options +// compile-flags: --force-warn elided_lifetimes_in_paths -Zunstable-options // check-pass struct Foo<'a> { diff --git a/src/test/ui/lint/force-warn/force-allowed-by-default-lint.stderr b/src/test/ui/lint/force-warn/force-allowed-by-default-lint.stderr index 37c61e614f3..05513de81d1 100644 --- a/src/test/ui/lint/force-warn/force-allowed-by-default-lint.stderr +++ b/src/test/ui/lint/force-warn/force-allowed-by-default-lint.stderr @@ -4,7 +4,7 @@ warning: hidden lifetime parameters in types are deprecated LL | fn foo(x: &Foo) {} | ^^^- help: indicate the anonymous lifetime: `<'_>` | - = note: requested on the command line with `--force-warns elided-lifetimes-in-paths` + = note: requested on the command line with `--force-warn elided-lifetimes-in-paths` warning: 1 warning emitted diff --git a/src/test/ui/lint/force-warn/force-allowed-deny-by-default-lint.rs b/src/test/ui/lint/force-warn/force-allowed-deny-by-default-lint.rs index 0abc4913726..d066feba869 100644 --- a/src/test/ui/lint/force-warn/force-allowed-deny-by-default-lint.rs +++ b/src/test/ui/lint/force-warn/force-allowed-deny-by-default-lint.rs @@ -1,4 +1,4 @@ -// compile-flags: --force-warns const_err -Zunstable-options +// compile-flags: --force-warn const_err -Zunstable-options // check-pass #![allow(const_err)] diff --git a/src/test/ui/lint/force-warn/force-allowed-deny-by-default-lint.stderr b/src/test/ui/lint/force-warn/force-allowed-deny-by-default-lint.stderr index 56b2f0236a5..dd4f88a3b53 100644 --- a/src/test/ui/lint/force-warn/force-allowed-deny-by-default-lint.stderr +++ b/src/test/ui/lint/force-warn/force-allowed-deny-by-default-lint.stderr @@ -6,7 +6,7 @@ LL | const C: i32 = 1 / 0; | | | attempt to divide `1_i32` by zero | - = note: requested on the command line with `--force-warns const-err` + = note: requested on the command line with `--force-warn const-err` = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! = note: for more information, see issue #71800 <https://github.com/rust-lang/rust/issues/71800> diff --git a/src/test/ui/lint/force-warn/force-allowed-warning.rs b/src/test/ui/lint/force-warn/force-allowed-warning.rs index bac0e4f8f8e..280de506472 100644 --- a/src/test/ui/lint/force-warn/force-allowed-warning.rs +++ b/src/test/ui/lint/force-warn/force-allowed-warning.rs @@ -1,4 +1,4 @@ -// compile-flags: --force-warns dead_code -Zunstable-options +// compile-flags: --force-warn dead_code -Zunstable-options // check-pass #![allow(dead_code)] diff --git a/src/test/ui/lint/force-warn/force-allowed-warning.stderr b/src/test/ui/lint/force-warn/force-allowed-warning.stderr index 7eb980a1297..fced147254e 100644 --- a/src/test/ui/lint/force-warn/force-allowed-warning.stderr +++ b/src/test/ui/lint/force-warn/force-allowed-warning.stderr @@ -4,7 +4,7 @@ warning: function is never used: `dead_function` LL | fn dead_function() {} | ^^^^^^^^^^^^^ | - = note: requested on the command line with `--force-warns dead-code` + = note: requested on the command line with `--force-warn dead-code` warning: 1 warning emitted diff --git a/src/test/ui/lint/force-warn/force-deny-by-default-lint.rs b/src/test/ui/lint/force-warn/force-deny-by-default-lint.rs index e721760ab2d..8331df02da7 100644 --- a/src/test/ui/lint/force-warn/force-deny-by-default-lint.rs +++ b/src/test/ui/lint/force-warn/force-deny-by-default-lint.rs @@ -1,4 +1,4 @@ -// compile-flags: --force-warns const_err -Zunstable-options +// compile-flags: --force-warn const_err -Zunstable-options // check-pass const C: i32 = 1 / 0; diff --git a/src/test/ui/lint/force-warn/force-deny-by-default-lint.stderr b/src/test/ui/lint/force-warn/force-deny-by-default-lint.stderr index 8b9bb5a74cf..68cd3a392f5 100644 --- a/src/test/ui/lint/force-warn/force-deny-by-default-lint.stderr +++ b/src/test/ui/lint/force-warn/force-deny-by-default-lint.stderr @@ -6,7 +6,7 @@ LL | const C: i32 = 1 / 0; | | | attempt to divide `1_i32` by zero | - = note: requested on the command line with `--force-warns const-err` + = note: requested on the command line with `--force-warn const-err` = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! = note: for more information, see issue #71800 <https://github.com/rust-lang/rust/issues/71800> diff --git a/src/test/ui/lint/force-warn/force-lint-allow-all-warnings.rs b/src/test/ui/lint/force-warn/force-lint-allow-all-warnings.rs index 0dc1ce28ac4..0e8a65a4117 100644 --- a/src/test/ui/lint/force-warn/force-lint-allow-all-warnings.rs +++ b/src/test/ui/lint/force-warn/force-lint-allow-all-warnings.rs @@ -1,4 +1,4 @@ -// compile-flags: --force-warns dead_code -Zunstable-options +// compile-flags: --force-warn dead_code -Zunstable-options // check-pass #![allow(warnings)] diff --git a/src/test/ui/lint/force-warn/force-lint-allow-all-warnings.stderr b/src/test/ui/lint/force-warn/force-lint-allow-all-warnings.stderr index ebdb022f2a2..3305f2c0283 100644 --- a/src/test/ui/lint/force-warn/force-lint-allow-all-warnings.stderr +++ b/src/test/ui/lint/force-warn/force-lint-allow-all-warnings.stderr @@ -4,7 +4,7 @@ warning: function is never used: `dead_function` LL | fn dead_function() {} | ^^^^^^^^^^^^^ | - = note: requested on the command line with `--force-warns dead-code` + = note: requested on the command line with `--force-warn dead-code` warning: 1 warning emitted diff --git a/src/test/ui/lint/force-warn/force-lint-group-allow-all-warnings.rs b/src/test/ui/lint/force-warn/force-lint-group-allow-all-warnings.rs index 4f637c7fefa..aaca59a2a2a 100644 --- a/src/test/ui/lint/force-warn/force-lint-group-allow-all-warnings.rs +++ b/src/test/ui/lint/force-warn/force-lint-group-allow-all-warnings.rs @@ -1,4 +1,4 @@ -// compile-flags: --force-warns nonstandard_style -Zunstable-options +// compile-flags: --force-warn nonstandard_style -Zunstable-options // check-pass #![allow(warnings)] diff --git a/src/test/ui/lint/force-warn/force-lint-group-allow-all-warnings.stderr b/src/test/ui/lint/force-warn/force-lint-group-allow-all-warnings.stderr index 7429e77fe83..065a8f6a556 100644 --- a/src/test/ui/lint/force-warn/force-lint-group-allow-all-warnings.stderr +++ b/src/test/ui/lint/force-warn/force-lint-group-allow-all-warnings.stderr @@ -4,7 +4,7 @@ warning: function `FUNCTION` should have a snake case name LL | pub fn FUNCTION() {} | ^^^^^^^^ help: convert the identifier to snake case: `function` | - = note: `--force-warns non-snake-case` implied by `--force-warns nonstandard-style` + = note: `--force-warn non-snake-case` implied by `--force-warn nonstandard-style` warning: 1 warning emitted diff --git a/src/test/ui/lint/force-warn/force-lint-in-allowed-group.rs b/src/test/ui/lint/force-warn/force-lint-in-allowed-group.rs index b4c2c505aa5..d8447bd2382 100644 --- a/src/test/ui/lint/force-warn/force-lint-in-allowed-group.rs +++ b/src/test/ui/lint/force-warn/force-lint-in-allowed-group.rs @@ -1,4 +1,4 @@ -// compile-flags: --force-warns bare_trait_objects -Zunstable-options +// compile-flags: --force-warn bare_trait_objects -Zunstable-options // check-pass #![allow(rust_2018_idioms)] diff --git a/src/test/ui/lint/force-warn/force-lint-in-allowed-group.stderr b/src/test/ui/lint/force-warn/force-lint-in-allowed-group.stderr index 4f7bba6bba1..185c0e8e3d0 100644 --- a/src/test/ui/lint/force-warn/force-lint-in-allowed-group.stderr +++ b/src/test/ui/lint/force-warn/force-lint-in-allowed-group.stderr @@ -4,7 +4,7 @@ warning: trait objects without an explicit `dyn` are deprecated LL | pub fn function(_x: Box<SomeTrait>) {} | ^^^^^^^^^ help: use `dyn`: `dyn SomeTrait` | - = note: requested on the command line with `--force-warns bare-trait-objects` + = note: requested on the command line with `--force-warn bare-trait-objects` = warning: this is accepted in the current edition (Rust 2015) but is a hard error in Rust 2021! = note: for more information, see issue #80165 <https://github.com/rust-lang/rust/issues/80165> diff --git a/src/test/ui/lint/force-warn/force-warns-cap-lints-allow.rs b/src/test/ui/lint/force-warn/force-warn-cap-lints-allow.rs index e364897ec4e..e10d161e7c6 100644 --- a/src/test/ui/lint/force-warn/force-warns-cap-lints-allow.rs +++ b/src/test/ui/lint/force-warn/force-warn-cap-lints-allow.rs @@ -1,4 +1,4 @@ -// compile-flags: --cap-lints allow --force-warns bare_trait_objects -Zunstable-options +// compile-flags: --cap-lints allow --force-warn bare_trait_objects -Zunstable-options // check-pass pub trait SomeTrait {} diff --git a/src/test/ui/lint/force-warn/force-warns-cap-lints-allow.stderr b/src/test/ui/lint/force-warn/force-warn-cap-lints-allow.stderr index 21532024f1c..a8997058775 100644 --- a/src/test/ui/lint/force-warn/force-warns-cap-lints-allow.stderr +++ b/src/test/ui/lint/force-warn/force-warn-cap-lints-allow.stderr @@ -1,10 +1,10 @@ warning: trait objects without an explicit `dyn` are deprecated - --> $DIR/force-warns-cap-lints-allow.rs:6:25 + --> $DIR/force-warn-cap-lints-allow.rs:6:25 | LL | pub fn function(_x: Box<SomeTrait>) {} | ^^^^^^^^^ help: use `dyn`: `dyn SomeTrait` | - = note: requested on the command line with `--force-warns bare-trait-objects` + = note: requested on the command line with `--force-warn bare-trait-objects` = warning: this is accepted in the current edition (Rust 2015) but is a hard error in Rust 2021! = note: for more information, see issue #80165 <https://github.com/rust-lang/rust/issues/80165> diff --git a/src/test/ui/lint/force-warn/force-warn-cap-lints-warn.rs b/src/test/ui/lint/force-warn/force-warn-cap-lints-warn.rs index bcfe6e5a5bd..4afc0868608 100644 --- a/src/test/ui/lint/force-warn/force-warn-cap-lints-warn.rs +++ b/src/test/ui/lint/force-warn/force-warn-cap-lints-warn.rs @@ -1,4 +1,4 @@ -// compile-flags: --cap-lints warn --force-warns rust-2021-compatibility -Zunstable-options +// compile-flags: --cap-lints warn --force-warn rust-2021-compatibility -Zunstable-options // check-pass #![allow(ellipsis_inclusive_range_patterns)] diff --git a/src/test/ui/lint/force-warn/force-warn-cap-lints-warn.stderr b/src/test/ui/lint/force-warn/force-warn-cap-lints-warn.stderr index 07e786ce7d2..1d5f88086c5 100644 --- a/src/test/ui/lint/force-warn/force-warn-cap-lints-warn.stderr +++ b/src/test/ui/lint/force-warn/force-warn-cap-lints-warn.stderr @@ -4,7 +4,7 @@ warning: `...` range patterns are deprecated LL | 0...100 => true, | ^^^ help: use `..=` for an inclusive range | - = note: `--force-warns ellipsis-inclusive-range-patterns` implied by `--force-warns rust-2021-compatibility` + = note: `--force-warn ellipsis-inclusive-range-patterns` implied by `--force-warn rust-2021-compatibility` = warning: this is accepted in the current edition (Rust 2015) but is a hard error in Rust 2021! = note: for more information, see issue #80165 <https://github.com/rust-lang/rust/issues/80165> diff --git a/src/test/ui/lint/force-warn/force-warn-group-allow-warning.rs b/src/test/ui/lint/force-warn/force-warn-group-allow-warning.rs index 83a1c078f06..193ba2b6f0d 100644 --- a/src/test/ui/lint/force-warn/force-warn-group-allow-warning.rs +++ b/src/test/ui/lint/force-warn/force-warn-group-allow-warning.rs @@ -1,4 +1,4 @@ -// compile-flags: --force-warns rust-2018-idioms -Zunstable-options +// compile-flags: --force-warn rust-2018-idioms -Zunstable-options // check-pass #![allow(bare_trait_objects)] diff --git a/src/test/ui/lint/force-warn/force-warn-group-allow-warning.stderr b/src/test/ui/lint/force-warn/force-warn-group-allow-warning.stderr index 65de6c9e287..d242ef266b8 100644 --- a/src/test/ui/lint/force-warn/force-warn-group-allow-warning.stderr +++ b/src/test/ui/lint/force-warn/force-warn-group-allow-warning.stderr @@ -4,7 +4,7 @@ warning: trait objects without an explicit `dyn` are deprecated LL | pub fn function(_x: Box<SomeTrait>) {} | ^^^^^^^^^ help: use `dyn`: `dyn SomeTrait` | - = note: `--force-warns bare-trait-objects` implied by `--force-warns rust-2018-idioms` + = note: `--force-warn bare-trait-objects` implied by `--force-warn rust-2018-idioms` = warning: this is accepted in the current edition (Rust 2015) but is a hard error in Rust 2021! = note: for more information, see issue #80165 <https://github.com/rust-lang/rust/issues/80165> diff --git a/src/test/ui/lint/force-warn/force-warn-group.rs b/src/test/ui/lint/force-warn/force-warn-group.rs index 5e5fda973d5..0198610b78e 100644 --- a/src/test/ui/lint/force-warn/force-warn-group.rs +++ b/src/test/ui/lint/force-warn/force-warn-group.rs @@ -1,4 +1,4 @@ -// compile-flags: --force-warns rust_2018_idioms -Zunstable-options +// compile-flags: --force-warn rust_2018_idioms -Zunstable-options // check-pass #![allow(rust_2018_idioms)] diff --git a/src/test/ui/lint/force-warn/force-warn-group.stderr b/src/test/ui/lint/force-warn/force-warn-group.stderr index fd3397c916a..180dff880a6 100644 --- a/src/test/ui/lint/force-warn/force-warn-group.stderr +++ b/src/test/ui/lint/force-warn/force-warn-group.stderr @@ -4,7 +4,7 @@ warning: trait objects without an explicit `dyn` are deprecated LL | pub fn function(_x: Box<SomeTrait>) {} | ^^^^^^^^^ help: use `dyn`: `dyn SomeTrait` | - = note: `--force-warns bare-trait-objects` implied by `--force-warns rust-2018-idioms` + = note: `--force-warn bare-trait-objects` implied by `--force-warn rust-2018-idioms` = warning: this is accepted in the current edition (Rust 2015) but is a hard error in Rust 2021! = note: for more information, see issue #80165 <https://github.com/rust-lang/rust/issues/80165> |
