From b35c30251f441f44a5e3ea9c99ced8d75162897f Mon Sep 17 00:00:00 2001 From: Alex Tokarev Date: Mon, 23 Mar 2020 11:02:46 +0300 Subject: [PATCH] Reword unused variable warning --- src/doc/rustc/src/json.md | 4 +- src/librustc_passes/liveness.rs | 2 +- ...62187-encountered-polymorphic-const.stderr | 2 +- src/test/ui/issues/issue-17999.stderr | 4 +- src/test/ui/issues/issue-22599.stderr | 2 +- src/test/ui/issues/issue-56685.stderr | 12 +++--- ...0-unused-variable-in-struct-pattern.stderr | 8 ++-- src/test/ui/lint/lint-match-arms.stderr | 2 +- src/test/ui/lint/lint-removed-allow.stderr | 2 +- src/test/ui/lint/lint-removed-cmdline.stderr | 2 +- src/test/ui/lint/lint-removed.stderr | 2 +- src/test/ui/lint/lint-renamed-allow.stderr | 2 +- src/test/ui/lint/lint-renamed-cmdline.stderr | 2 +- src/test/ui/lint/lint-renamed.stderr | 2 +- src/test/ui/lint/lint-unused-variables.stderr | 22 +++++------ .../ui/lint/lint-uppercase-variables.stderr | 6 +-- src/test/ui/liveness/liveness-unused.stderr | 16 ++++---- .../never_type/never-assign-dead-code.stderr | 2 +- .../ui/proc-macro/attributes-included.stderr | 2 +- .../param-attrs-cfg.stderr | 38 +++++++++---------- src/test/ui/span/issue-24690.stderr | 2 +- .../unused-closure-argument.stderr | 2 +- 22 files changed, 69 insertions(+), 69 deletions(-) diff --git a/src/doc/rustc/src/json.md b/src/doc/rustc/src/json.md index b737849516310..c46380f1505df 100644 --- a/src/doc/rustc/src/json.md +++ b/src/doc/rustc/src/json.md @@ -168,7 +168,7 @@ Diagnostics have the following format: "rendered": null }, { - "message": "consider prefixing with an underscore", + "message": "if this is intentional, prefix it with an underscore", "code": null, "level": "help", "spans": [ @@ -201,7 +201,7 @@ Diagnostics have the following format: /* Optional string of the rendered version of the diagnostic as displayed by rustc. Note that this may be influenced by the `--json` flag. */ - "rendered": "warning: unused variable: `x`\n --> lib.rs:2:9\n |\n2 | let x = 123;\n | ^ help: consider prefixing with an underscore: `_x`\n |\n = note: `#[warn(unused_variables)]` on by default\n\n" + "rendered": "warning: unused variable: `x`\n --> lib.rs:2:9\n |\n2 | let x = 123;\n | ^ help: if this is intentional, prefix it with an underscore: `_x`\n |\n = note: `#[warn(unused_variables)]` on by default\n\n" } ``` diff --git a/src/librustc_passes/liveness.rs b/src/librustc_passes/liveness.rs index bf577d26b0fed..97f6457d39736 100644 --- a/src/librustc_passes/liveness.rs +++ b/src/librustc_passes/liveness.rs @@ -1565,7 +1565,7 @@ impl<'tcx> Liveness<'_, 'tcx> { } } else { err.multipart_suggestion( - "consider prefixing with an underscore", + "if this is intentional, prefix it with an underscore", spans.iter().map(|span| (*span, format!("_{}", name))).collect(), Applicability::MachineApplicable, ); diff --git a/src/test/ui/const-generics/issues/issue-62187-encountered-polymorphic-const.stderr b/src/test/ui/const-generics/issues/issue-62187-encountered-polymorphic-const.stderr index 20347ac4b7dac..72f0b333c5a35 100644 --- a/src/test/ui/const-generics/issues/issue-62187-encountered-polymorphic-const.stderr +++ b/src/test/ui/const-generics/issues/issue-62187-encountered-polymorphic-const.stderr @@ -10,7 +10,7 @@ warning: unused variable: `foo` --> $DIR/issue-62187-encountered-polymorphic-const.rs:15:9 | LL | let foo = <[u8; 2]>::BIT_LEN; - | ^^^ help: consider prefixing with an underscore: `_foo` + | ^^^ help: if this is intentional, prefix it with an underscore: `_foo` | = note: `#[warn(unused_variables)]` on by default diff --git a/src/test/ui/issues/issue-17999.stderr b/src/test/ui/issues/issue-17999.stderr index 448208ef033f7..4a1ef7350b8cb 100644 --- a/src/test/ui/issues/issue-17999.stderr +++ b/src/test/ui/issues/issue-17999.stderr @@ -2,7 +2,7 @@ error: unused variable: `x` --> $DIR/issue-17999.rs:5:13 | LL | let x = (); - | ^ help: consider prefixing with an underscore: `_x` + | ^ help: if this is intentional, prefix it with an underscore: `_x` | note: the lint level is defined here --> $DIR/issue-17999.rs:1:9 @@ -14,7 +14,7 @@ error: unused variable: `a` --> $DIR/issue-17999.rs:7:13 | LL | a => {} - | ^ help: consider prefixing with an underscore: `_a` + | ^ help: if this is intentional, prefix it with an underscore: `_a` error: aborting due to 2 previous errors diff --git a/src/test/ui/issues/issue-22599.stderr b/src/test/ui/issues/issue-22599.stderr index 9c3b2cbe6c796..2b34830d08427 100644 --- a/src/test/ui/issues/issue-22599.stderr +++ b/src/test/ui/issues/issue-22599.stderr @@ -2,7 +2,7 @@ error: unused variable: `a` --> $DIR/issue-22599.rs:8:19 | LL | v = match 0 { a => 0 }; - | ^ help: consider prefixing with an underscore: `_a` + | ^ help: if this is intentional, prefix it with an underscore: `_a` | note: the lint level is defined here --> $DIR/issue-22599.rs:1:9 diff --git a/src/test/ui/issues/issue-56685.stderr b/src/test/ui/issues/issue-56685.stderr index 2cef3126b9ee0..eccb71095acc7 100644 --- a/src/test/ui/issues/issue-56685.stderr +++ b/src/test/ui/issues/issue-56685.stderr @@ -9,7 +9,7 @@ note: the lint level is defined here | LL | #![deny(unused_variables)] | ^^^^^^^^^^^^^^^^ -help: consider prefixing with an underscore +help: if this is intentional, prefix it with an underscore | LL | E::A(_x) | E::B(_x) => {} | ^^ ^^ @@ -20,7 +20,7 @@ error: unused variable: `x` LL | F::A(x, y) | F::B(x, y) => { y }, | ^ ^ | -help: consider prefixing with an underscore +help: if this is intentional, prefix it with an underscore | LL | F::A(_x, y) | F::B(_x, y) => { y }, | ^^ ^^ @@ -29,13 +29,13 @@ error: unused variable: `a` --> $DIR/issue-56685.rs:27:14 | LL | F::C(a, b) => { 3 } - | ^ help: consider prefixing with an underscore: `_a` + | ^ help: if this is intentional, prefix it with an underscore: `_a` error: unused variable: `b` --> $DIR/issue-56685.rs:27:17 | LL | F::C(a, b) => { 3 } - | ^ help: consider prefixing with an underscore: `_b` + | ^ help: if this is intentional, prefix it with an underscore: `_b` error: unused variable: `x` --> $DIR/issue-56685.rs:32:25 @@ -43,7 +43,7 @@ error: unused variable: `x` LL | let _ = if let F::A(x, y) | F::B(x, y) = F::A(1, 2) { | ^ ^ | -help: consider prefixing with an underscore +help: if this is intentional, prefix it with an underscore | LL | let _ = if let F::A(_x, y) | F::B(_x, y) = F::A(1, 2) { | ^^ ^^ @@ -54,7 +54,7 @@ error: unused variable: `x` LL | while let F::A(x, y) | F::B(x, y) = F::A(1, 2) { | ^ ^ | -help: consider prefixing with an underscore +help: if this is intentional, prefix it with an underscore | LL | while let F::A(_x, y) | F::B(_x, y) = F::A(1, 2) { | ^^ ^^ diff --git a/src/test/ui/lint/issue-47390-unused-variable-in-struct-pattern.stderr b/src/test/ui/lint/issue-47390-unused-variable-in-struct-pattern.stderr index b07474bb48673..cc675a709a2c6 100644 --- a/src/test/ui/lint/issue-47390-unused-variable-in-struct-pattern.stderr +++ b/src/test/ui/lint/issue-47390-unused-variable-in-struct-pattern.stderr @@ -2,7 +2,7 @@ warning: unused variable: `i_think_continually` --> $DIR/issue-47390-unused-variable-in-struct-pattern.rs:26:9 | LL | let i_think_continually = 2; - | ^^^^^^^^^^^^^^^^^^^ help: consider prefixing with an underscore: `_i_think_continually` + | ^^^^^^^^^^^^^^^^^^^ help: if this is intentional, prefix it with an underscore: `_i_think_continually` | note: the lint level is defined here --> $DIR/issue-47390-unused-variable-in-struct-pattern.rs:5:9 @@ -15,19 +15,19 @@ warning: unused variable: `mut_unused_var` --> $DIR/issue-47390-unused-variable-in-struct-pattern.rs:33:13 | LL | let mut mut_unused_var = 1; - | ^^^^^^^^^^^^^^ help: consider prefixing with an underscore: `_mut_unused_var` + | ^^^^^^^^^^^^^^ help: if this is intentional, prefix it with an underscore: `_mut_unused_var` warning: unused variable: `var` --> $DIR/issue-47390-unused-variable-in-struct-pattern.rs:37:14 | LL | let (mut var, unused_var) = (1, 2); - | ^^^ help: consider prefixing with an underscore: `_var` + | ^^^ help: if this is intentional, prefix it with an underscore: `_var` warning: unused variable: `unused_var` --> $DIR/issue-47390-unused-variable-in-struct-pattern.rs:37:19 | LL | let (mut var, unused_var) = (1, 2); - | ^^^^^^^^^^ help: consider prefixing with an underscore: `_unused_var` + | ^^^^^^^^^^ help: if this is intentional, prefix it with an underscore: `_unused_var` warning: unused variable: `corridors_of_light` --> $DIR/issue-47390-unused-variable-in-struct-pattern.rs:45:26 diff --git a/src/test/ui/lint/lint-match-arms.stderr b/src/test/ui/lint/lint-match-arms.stderr index b124971f90512..1bc0e41fd550c 100644 --- a/src/test/ui/lint/lint-match-arms.stderr +++ b/src/test/ui/lint/lint-match-arms.stderr @@ -2,7 +2,7 @@ error: unused variable: `y` --> $DIR/lint-match-arms.rs:5:9 | LL | y => (), - | ^ help: consider prefixing with an underscore: `_y` + | ^ help: if this is intentional, prefix it with an underscore: `_y` | note: the lint level is defined here --> $DIR/lint-match-arms.rs:3:16 diff --git a/src/test/ui/lint/lint-removed-allow.stderr b/src/test/ui/lint/lint-removed-allow.stderr index 5ab95c89b9c7e..029334c2eb67c 100644 --- a/src/test/ui/lint/lint-removed-allow.stderr +++ b/src/test/ui/lint/lint-removed-allow.stderr @@ -2,7 +2,7 @@ error: unused variable: `unused` --> $DIR/lint-removed-allow.rs:8:17 | LL | fn main() { let unused = (); } - | ^^^^^^ help: consider prefixing with an underscore: `_unused` + | ^^^^^^ help: if this is intentional, prefix it with an underscore: `_unused` | note: the lint level is defined here --> $DIR/lint-removed-allow.rs:7:8 diff --git a/src/test/ui/lint/lint-removed-cmdline.stderr b/src/test/ui/lint/lint-removed-cmdline.stderr index a9ebd3e32712c..4adc18cc2ce5d 100644 --- a/src/test/ui/lint/lint-removed-cmdline.stderr +++ b/src/test/ui/lint/lint-removed-cmdline.stderr @@ -18,7 +18,7 @@ error: unused variable: `unused` --> $DIR/lint-removed-cmdline.rs:12:17 | LL | fn main() { let unused = (); } - | ^^^^^^ help: consider prefixing with an underscore: `_unused` + | ^^^^^^ help: if this is intentional, prefix it with an underscore: `_unused` | note: the lint level is defined here --> $DIR/lint-removed-cmdline.rs:11:8 diff --git a/src/test/ui/lint/lint-removed.stderr b/src/test/ui/lint/lint-removed.stderr index 2c043392f098c..190e10c8a9944 100644 --- a/src/test/ui/lint/lint-removed.stderr +++ b/src/test/ui/lint/lint-removed.stderr @@ -10,7 +10,7 @@ error: unused variable: `unused` --> $DIR/lint-removed.rs:8:17 | LL | fn main() { let unused = (); } - | ^^^^^^ help: consider prefixing with an underscore: `_unused` + | ^^^^^^ help: if this is intentional, prefix it with an underscore: `_unused` | note: the lint level is defined here --> $DIR/lint-removed.rs:7:8 diff --git a/src/test/ui/lint/lint-renamed-allow.stderr b/src/test/ui/lint/lint-renamed-allow.stderr index 9da74f61b7569..46f6a10de2743 100644 --- a/src/test/ui/lint/lint-renamed-allow.stderr +++ b/src/test/ui/lint/lint-renamed-allow.stderr @@ -2,7 +2,7 @@ error: unused variable: `unused` --> $DIR/lint-renamed-allow.rs:8:17 | LL | fn main() { let unused = (); } - | ^^^^^^ help: consider prefixing with an underscore: `_unused` + | ^^^^^^ help: if this is intentional, prefix it with an underscore: `_unused` | note: the lint level is defined here --> $DIR/lint-renamed-allow.rs:7:8 diff --git a/src/test/ui/lint/lint-renamed-cmdline.stderr b/src/test/ui/lint/lint-renamed-cmdline.stderr index 235215598a2bd..ef617dfe31f02 100644 --- a/src/test/ui/lint/lint-renamed-cmdline.stderr +++ b/src/test/ui/lint/lint-renamed-cmdline.stderr @@ -18,7 +18,7 @@ error: unused variable: `unused` --> $DIR/lint-renamed-cmdline.rs:8:17 | LL | fn main() { let unused = (); } - | ^^^^^^ help: consider prefixing with an underscore: `_unused` + | ^^^^^^ help: if this is intentional, prefix it with an underscore: `_unused` | note: the lint level is defined here --> $DIR/lint-renamed-cmdline.rs:7:8 diff --git a/src/test/ui/lint/lint-renamed.stderr b/src/test/ui/lint/lint-renamed.stderr index dc43f2e4c46da..0225e22623424 100644 --- a/src/test/ui/lint/lint-renamed.stderr +++ b/src/test/ui/lint/lint-renamed.stderr @@ -10,7 +10,7 @@ error: unused variable: `unused` --> $DIR/lint-renamed.rs:4:17 | LL | fn main() { let unused = (); } - | ^^^^^^ help: consider prefixing with an underscore: `_unused` + | ^^^^^^ help: if this is intentional, prefix it with an underscore: `_unused` | note: the lint level is defined here --> $DIR/lint-renamed.rs:3:8 diff --git a/src/test/ui/lint/lint-unused-variables.stderr b/src/test/ui/lint/lint-unused-variables.stderr index 57389f8d12010..d6e684e830651 100644 --- a/src/test/ui/lint/lint-unused-variables.stderr +++ b/src/test/ui/lint/lint-unused-variables.stderr @@ -2,7 +2,7 @@ error: unused variable: `a` --> $DIR/lint-unused-variables.rs:8:5 | LL | a: i32, - | ^ help: consider prefixing with an underscore: `_a` + | ^ help: if this is intentional, prefix it with an underscore: `_a` | note: the lint level is defined here --> $DIR/lint-unused-variables.rs:5:9 @@ -14,61 +14,61 @@ error: unused variable: `b` --> $DIR/lint-unused-variables.rs:14:5 | LL | b: i32, - | ^ help: consider prefixing with an underscore: `_b` + | ^ help: if this is intentional, prefix it with an underscore: `_b` error: unused variable: `a` --> $DIR/lint-unused-variables.rs:68:9 | LL | a: i32, - | ^ help: consider prefixing with an underscore: `_a` + | ^ help: if this is intentional, prefix it with an underscore: `_a` error: unused variable: `b` --> $DIR/lint-unused-variables.rs:74:9 | LL | b: i32, - | ^ help: consider prefixing with an underscore: `_b` + | ^ help: if this is intentional, prefix it with an underscore: `_b` error: unused variable: `b` --> $DIR/lint-unused-variables.rs:42:9 | LL | b: i32, - | ^ help: consider prefixing with an underscore: `_b` + | ^ help: if this is intentional, prefix it with an underscore: `_b` error: unused variable: `b` --> $DIR/lint-unused-variables.rs:47:9 | LL | b: i32, - | ^ help: consider prefixing with an underscore: `_b` + | ^ help: if this is intentional, prefix it with an underscore: `_b` error: unused variable: `a` --> $DIR/lint-unused-variables.rs:22:9 | LL | a: i32, - | ^ help: consider prefixing with an underscore: `_a` + | ^ help: if this is intentional, prefix it with an underscore: `_a` error: unused variable: `b` --> $DIR/lint-unused-variables.rs:29:9 | LL | b: i32, - | ^ help: consider prefixing with an underscore: `_b` + | ^ help: if this is intentional, prefix it with an underscore: `_b` error: unused variable: `b` --> $DIR/lint-unused-variables.rs:34:9 | LL | b: i32, - | ^ help: consider prefixing with an underscore: `_b` + | ^ help: if this is intentional, prefix it with an underscore: `_b` error: unused variable: `b` --> $DIR/lint-unused-variables.rs:55:9 | LL | b: i32, - | ^ help: consider prefixing with an underscore: `_b` + | ^ help: if this is intentional, prefix it with an underscore: `_b` error: unused variable: `b` --> $DIR/lint-unused-variables.rs:60:9 | LL | b: i32, - | ^ help: consider prefixing with an underscore: `_b` + | ^ help: if this is intentional, prefix it with an underscore: `_b` error: aborting due to 11 previous errors diff --git a/src/test/ui/lint/lint-uppercase-variables.stderr b/src/test/ui/lint/lint-uppercase-variables.stderr index 7c2497758d955..1d7e0909e40ab 100644 --- a/src/test/ui/lint/lint-uppercase-variables.stderr +++ b/src/test/ui/lint/lint-uppercase-variables.stderr @@ -22,7 +22,7 @@ warning: unused variable: `Foo` --> $DIR/lint-uppercase-variables.rs:22:9 | LL | Foo => {} - | ^^^ help: consider prefixing with an underscore: `_Foo` + | ^^^ help: if this is intentional, prefix it with an underscore: `_Foo` | note: the lint level is defined here --> $DIR/lint-uppercase-variables.rs:1:9 @@ -35,13 +35,13 @@ warning: unused variable: `Foo` --> $DIR/lint-uppercase-variables.rs:28:9 | LL | let Foo = foo::Foo::Foo; - | ^^^ help: consider prefixing with an underscore: `_Foo` + | ^^^ help: if this is intentional, prefix it with an underscore: `_Foo` warning: unused variable: `Foo` --> $DIR/lint-uppercase-variables.rs:33:17 | LL | fn in_param(Foo: foo::Foo) {} - | ^^^ help: consider prefixing with an underscore: `_Foo` + | ^^^ help: if this is intentional, prefix it with an underscore: `_Foo` error: structure field `X` should have a snake case name --> $DIR/lint-uppercase-variables.rs:10:5 diff --git a/src/test/ui/liveness/liveness-unused.stderr b/src/test/ui/liveness/liveness-unused.stderr index 7adb6a3295b0e..42187330a3eb1 100644 --- a/src/test/ui/liveness/liveness-unused.stderr +++ b/src/test/ui/liveness/liveness-unused.stderr @@ -17,7 +17,7 @@ error: unused variable: `x` --> $DIR/liveness-unused.rs:8:7 | LL | fn f1(x: isize) { - | ^ help: consider prefixing with an underscore: `_x` + | ^ help: if this is intentional, prefix it with an underscore: `_x` | note: the lint level is defined here --> $DIR/liveness-unused.rs:2:9 @@ -29,19 +29,19 @@ error: unused variable: `x` --> $DIR/liveness-unused.rs:12:8 | LL | fn f1b(x: &mut isize) { - | ^ help: consider prefixing with an underscore: `_x` + | ^ help: if this is intentional, prefix it with an underscore: `_x` error: unused variable: `x` --> $DIR/liveness-unused.rs:20:9 | LL | let x: isize; - | ^ help: consider prefixing with an underscore: `_x` + | ^ help: if this is intentional, prefix it with an underscore: `_x` error: unused variable: `x` --> $DIR/liveness-unused.rs:25:9 | LL | let x = 3; - | ^ help: consider prefixing with an underscore: `_x` + | ^ help: if this is intentional, prefix it with an underscore: `_x` error: variable `x` is assigned to, but never used --> $DIR/liveness-unused.rs:30:13 @@ -76,25 +76,25 @@ error: unused variable: `i` --> $DIR/liveness-unused.rs:59:12 | LL | Some(i) => { - | ^ help: consider prefixing with an underscore: `_i` + | ^ help: if this is intentional, prefix it with an underscore: `_i` error: unused variable: `x` --> $DIR/liveness-unused.rs:79:9 | LL | for x in 1..10 { } - | ^ help: consider prefixing with an underscore: `_x` + | ^ help: if this is intentional, prefix it with an underscore: `_x` error: unused variable: `x` --> $DIR/liveness-unused.rs:84:10 | LL | for (x, _) in [1, 2, 3].iter().enumerate() { } - | ^ help: consider prefixing with an underscore: `_x` + | ^ help: if this is intentional, prefix it with an underscore: `_x` error: unused variable: `x` --> $DIR/liveness-unused.rs:89:13 | LL | for (_, x) in [1, 2, 3].iter().enumerate() { - | ^ help: consider prefixing with an underscore: `_x` + | ^ help: if this is intentional, prefix it with an underscore: `_x` error: variable `x` is assigned to, but never used --> $DIR/liveness-unused.rs:112:9 diff --git a/src/test/ui/never_type/never-assign-dead-code.stderr b/src/test/ui/never_type/never-assign-dead-code.stderr index 6002f8e1eb75e..5525802c2511a 100644 --- a/src/test/ui/never_type/never-assign-dead-code.stderr +++ b/src/test/ui/never_type/never-assign-dead-code.stderr @@ -25,7 +25,7 @@ warning: unused variable: `x` --> $DIR/never-assign-dead-code.rs:9:9 | LL | let x: ! = panic!("aah"); - | ^ help: consider prefixing with an underscore: `_x` + | ^ help: if this is intentional, prefix it with an underscore: `_x` | note: the lint level is defined here --> $DIR/never-assign-dead-code.rs:6:9 diff --git a/src/test/ui/proc-macro/attributes-included.stderr b/src/test/ui/proc-macro/attributes-included.stderr index 27a215de032aa..bfbcf68b6c7e6 100644 --- a/src/test/ui/proc-macro/attributes-included.stderr +++ b/src/test/ui/proc-macro/attributes-included.stderr @@ -2,7 +2,7 @@ warning: unused variable: `a` --> $DIR/attributes-included.rs:17:9 | LL | let a: i32 = "foo"; - | ^ help: consider prefixing with an underscore: `_a` + | ^ help: if this is intentional, prefix it with an underscore: `_a` | note: the lint level is defined here --> $DIR/attributes-included.rs:4:9 diff --git a/src/test/ui/rfc-2565-param-attrs/param-attrs-cfg.stderr b/src/test/ui/rfc-2565-param-attrs/param-attrs-cfg.stderr index 82099066a89d2..1ced8d8a14a53 100644 --- a/src/test/ui/rfc-2565-param-attrs/param-attrs-cfg.stderr +++ b/src/test/ui/rfc-2565-param-attrs/param-attrs-cfg.stderr @@ -2,7 +2,7 @@ error: unused variable: `a` --> $DIR/param-attrs-cfg.rs:24:23 | LL | #[cfg(something)] a: i32, - | ^ help: consider prefixing with an underscore: `_a` + | ^ help: if this is intentional, prefix it with an underscore: `_a` | note: the lint level is defined here --> $DIR/param-attrs-cfg.rs:5:9 @@ -14,109 +14,109 @@ error: unused variable: `b` --> $DIR/param-attrs-cfg.rs:30:23 | LL | #[cfg(something)] b: i32, - | ^ help: consider prefixing with an underscore: `_b` + | ^ help: if this is intentional, prefix it with an underscore: `_b` error: unused variable: `c` --> $DIR/param-attrs-cfg.rs:32:40 | LL | #[cfg_attr(nothing, cfg(nothing))] c: i32, - | ^ help: consider prefixing with an underscore: `_c` + | ^ help: if this is intentional, prefix it with an underscore: `_c` error: unused variable: `a` --> $DIR/param-attrs-cfg.rs:107:27 | LL | #[cfg(something)] a: i32, - | ^ help: consider prefixing with an underscore: `_a` + | ^ help: if this is intentional, prefix it with an underscore: `_a` error: unused variable: `b` --> $DIR/param-attrs-cfg.rs:113:27 | LL | #[cfg(something)] b: i32, - | ^ help: consider prefixing with an underscore: `_b` + | ^ help: if this is intentional, prefix it with an underscore: `_b` error: unused variable: `c` --> $DIR/param-attrs-cfg.rs:115:44 | LL | #[cfg_attr(nothing, cfg(nothing))] c: i32, - | ^ help: consider prefixing with an underscore: `_c` + | ^ help: if this is intentional, prefix it with an underscore: `_c` error: unused variable: `b` --> $DIR/param-attrs-cfg.rs:67:27 | LL | #[cfg(something)] b: i32, - | ^ help: consider prefixing with an underscore: `_b` + | ^ help: if this is intentional, prefix it with an underscore: `_b` error: unused variable: `c` --> $DIR/param-attrs-cfg.rs:69:44 | LL | #[cfg_attr(nothing, cfg(nothing))] c: i32, - | ^ help: consider prefixing with an underscore: `_c` + | ^ help: if this is intentional, prefix it with an underscore: `_c` error: unused variable: `b` --> $DIR/param-attrs-cfg.rs:75:27 | LL | #[cfg(something)] b: i32, - | ^ help: consider prefixing with an underscore: `_b` + | ^ help: if this is intentional, prefix it with an underscore: `_b` error: unused variable: `c` --> $DIR/param-attrs-cfg.rs:77:44 | LL | #[cfg_attr(nothing, cfg(nothing))] c: i32, - | ^ help: consider prefixing with an underscore: `_c` + | ^ help: if this is intentional, prefix it with an underscore: `_c` error: unused variable: `a` --> $DIR/param-attrs-cfg.rs:41:27 | LL | #[cfg(something)] a: i32, - | ^ help: consider prefixing with an underscore: `_a` + | ^ help: if this is intentional, prefix it with an underscore: `_a` error: unused variable: `b` --> $DIR/param-attrs-cfg.rs:48:27 | LL | #[cfg(something)] b: i32, - | ^ help: consider prefixing with an underscore: `_b` + | ^ help: if this is intentional, prefix it with an underscore: `_b` error: unused variable: `c` --> $DIR/param-attrs-cfg.rs:50:44 | LL | #[cfg_attr(nothing, cfg(nothing))] c: i32, - | ^ help: consider prefixing with an underscore: `_c` + | ^ help: if this is intentional, prefix it with an underscore: `_c` error: unused variable: `b` --> $DIR/param-attrs-cfg.rs:56:27 | LL | #[cfg(something)] b: i32, - | ^ help: consider prefixing with an underscore: `_b` + | ^ help: if this is intentional, prefix it with an underscore: `_b` error: unused variable: `c` --> $DIR/param-attrs-cfg.rs:58:44 | LL | #[cfg_attr(nothing, cfg(nothing))] c: i32, - | ^ help: consider prefixing with an underscore: `_c` + | ^ help: if this is intentional, prefix it with an underscore: `_c` error: unused variable: `b` --> $DIR/param-attrs-cfg.rs:86:27 | LL | #[cfg(something)] b: i32, - | ^ help: consider prefixing with an underscore: `_b` + | ^ help: if this is intentional, prefix it with an underscore: `_b` error: unused variable: `c` --> $DIR/param-attrs-cfg.rs:88:44 | LL | #[cfg_attr(nothing, cfg(nothing))] c: i32, - | ^ help: consider prefixing with an underscore: `_c` + | ^ help: if this is intentional, prefix it with an underscore: `_c` error: unused variable: `b` --> $DIR/param-attrs-cfg.rs:94:27 | LL | #[cfg(something)] b: i32, - | ^ help: consider prefixing with an underscore: `_b` + | ^ help: if this is intentional, prefix it with an underscore: `_b` error: unused variable: `c` --> $DIR/param-attrs-cfg.rs:96:44 | LL | #[cfg_attr(nothing, cfg(nothing))] c: i32, - | ^ help: consider prefixing with an underscore: `_c` + | ^ help: if this is intentional, prefix it with an underscore: `_c` error: aborting due to 19 previous errors diff --git a/src/test/ui/span/issue-24690.stderr b/src/test/ui/span/issue-24690.stderr index 69d1150abba47..2a090f442cc5f 100644 --- a/src/test/ui/span/issue-24690.stderr +++ b/src/test/ui/span/issue-24690.stderr @@ -2,7 +2,7 @@ warning: unused variable: `theOtherTwo` --> $DIR/issue-24690.rs:13:9 | LL | let theOtherTwo = 2; - | ^^^^^^^^^^^ help: consider prefixing with an underscore: `_theOtherTwo` + | ^^^^^^^^^^^ help: if this is intentional, prefix it with an underscore: `_theOtherTwo` | note: the lint level is defined here --> $DIR/issue-24690.rs:8:9 diff --git a/src/test/ui/suggestions/unused-closure-argument.stderr b/src/test/ui/suggestions/unused-closure-argument.stderr index d83ab08e71efc..55195ce50a13e 100644 --- a/src/test/ui/suggestions/unused-closure-argument.stderr +++ b/src/test/ui/suggestions/unused-closure-argument.stderr @@ -14,7 +14,7 @@ error: unused variable: `x` --> $DIR/unused-closure-argument.rs:17:15 | LL | .map(|x| 4) - | ^ help: consider prefixing with an underscore: `_x` + | ^ help: if this is intentional, prefix it with an underscore: `_x` error: aborting due to 2 previous errors