From 800c5f9202ca5309bbe372bbb8f2d6f1c29e59a5 Mon Sep 17 00:00:00 2001 From: Ryan Levick Date: Wed, 21 Jul 2021 15:40:52 +0200 Subject: Rename force-warns to force-warn --- .../unstable-book/src/compiler-flags/force-warn.md | 21 +++++++++++++++++++++ .../unstable-book/src/compiler-flags/force-warns.md | 21 --------------------- 2 files changed, 21 insertions(+), 21 deletions(-) create mode 100644 src/doc/unstable-book/src/compiler-flags/force-warn.md delete mode 100644 src/doc/unstable-book/src/compiler-flags/force-warns.md (limited to 'src/doc') diff --git a/src/doc/unstable-book/src/compiler-flags/force-warn.md b/src/doc/unstable-book/src/compiler-flags/force-warn.md new file mode 100644 index 00000000000..052de0f379e --- /dev/null +++ b/src/doc/unstable-book/src/compiler-flags/force-warn.md @@ -0,0 +1,21 @@ +# `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-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 + +```rust,ignore (partial-example) +#![allow(dead_code)] + +fn dead_function() {} +// This would normally not produce a warning even though the +// function is not used, because dead code is being allowed + +fn main() {} +``` + +We can force a warning to be produced by providing `--force-warn dead_code` to rustc. diff --git a/src/doc/unstable-book/src/compiler-flags/force-warns.md b/src/doc/unstable-book/src/compiler-flags/force-warns.md deleted file mode 100644 index 0a205be096c..00000000000 --- a/src/doc/unstable-book/src/compiler-flags/force-warns.md +++ /dev/null @@ -1,21 +0,0 @@ -# `force-warns` - -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)]`. - -## Example - -```rust,ignore (partial-example) -#![allow(dead_code)] - -fn dead_function() {} -// This would normally not produce a warning even though the -// function is not used, because dead code is being allowed - -fn main() {} -``` - -We can force a warning to be produced by providing `--force-warns dead_code` to rustc. -- cgit 1.4.1-3-g733a5