"rendered": null
},
{
- "message": "consider prefixing with an underscore",
+ "message": "if this is intentional, prefix it with an underscore",
"code": null,
"level": "help",
"spans": [
/* 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"
}
```
}
} 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,
);
--> $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
--> $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
--> $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
--> $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
|
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) => {}
| ^^ ^^
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 },
| ^^ ^^
--> $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
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) {
| ^^ ^^
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) {
| ^^ ^^
--> $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
--> $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
--> $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
--> $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
--> $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
--> $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
--> $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
--> $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
--> $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
--> $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
--> $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
--> $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
--> $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
--> $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
--> $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
--> $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
--> $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
--> $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
--> $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
--> $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
--> $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
--> $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