@@ -11,22 +11,40 @@ LL | #![warn(unused)] // UI tests pass `-A unused` (#43896)
1111 | ^^^^^^
1212 = note: #[warn(unused_variables)] implied by #[warn(unused)]
1313
14+ warning: unused variable: `mut_unused_var`
15+ --> $DIR/issue-47390-unused-variable-in-struct-pattern.rs:38:13
16+ |
17+ LL | let mut mut_unused_var = 1;
18+ | ^^^^^^^^^^^^^^ help: consider using `_mut_unused_var` instead
19+
20+ warning: unused variable: `var`
21+ --> $DIR/issue-47390-unused-variable-in-struct-pattern.rs:40:14
22+ |
23+ LL | let (mut var, unused_var) = (1, 2);
24+ | ^^^ help: consider using `_var` instead
25+
26+ warning: unused variable: `unused_var`
27+ --> $DIR/issue-47390-unused-variable-in-struct-pattern.rs:40:19
28+ |
29+ LL | let (mut var, unused_var) = (1, 2);
30+ | ^^^^^^^^^^ help: consider using `_unused_var` instead
31+
1432warning: unused variable: `corridors_of_light`
15- --> $DIR/issue-47390-unused-variable-in-struct-pattern.rs:38 :26
33+ --> $DIR/issue-47390-unused-variable-in-struct-pattern.rs:42 :26
1634 |
1735LL | if let SoulHistory { corridors_of_light,
1836 | ^^^^^^^^^^^^^^^^^^ help: try ignoring the field: `corridors_of_light: _`
1937
2038warning: variable `hours_are_suns` is assigned to, but never used
21- --> $DIR/issue-47390-unused-variable-in-struct-pattern.rs:39:26
39+ --> $DIR/issue-47390-unused-variable-in-struct-pattern.rs:43:30
2240 |
2341LL | mut hours_are_suns,
24- | ^^^^ ^^^^^^^^^^^^^^
42+ | ^^^^^^^^^^^^^^
2543 |
2644 = note: consider using `_hours_are_suns` instead
2745
2846warning: value assigned to `hours_are_suns` is never read
29- --> $DIR/issue-47390-unused-variable-in-struct-pattern.rs:41 :9
47+ --> $DIR/issue-47390-unused-variable-in-struct-pattern.rs:45 :9
3048 |
3149LL | hours_are_suns = false;
3250 | ^^^^^^^^^^^^^^
@@ -39,38 +57,61 @@ LL | #![warn(unused)] // UI tests pass `-A unused` (#43896)
3957 = note: #[warn(unused_assignments)] implied by #[warn(unused)]
4058
4159warning: unused variable: `case`
42- --> $DIR/issue-47390-unused-variable-in-struct-pattern.rs:50 :23
60+ --> $DIR/issue-47390-unused-variable-in-struct-pattern.rs:54 :23
4361 |
4462LL | Large::Suit { case } => {}
4563 | ^^^^ help: try ignoring the field: `case: _`
4664
4765warning: unused variable: `case`
48- --> $DIR/issue-47390-unused-variable-in-struct-pattern.rs:55 :24
66+ --> $DIR/issue-47390-unused-variable-in-struct-pattern.rs:59 :24
4967 |
5068LL | &Large::Suit { case } => {}
5169 | ^^^^ help: try ignoring the field: `case: _`
5270
5371warning: unused variable: `case`
54- --> $DIR/issue-47390-unused-variable-in-struct-pattern.rs:60 :27
72+ --> $DIR/issue-47390-unused-variable-in-struct-pattern.rs:64 :27
5573 |
5674LL | box Large::Suit { case } => {}
5775 | ^^^^ help: try ignoring the field: `case: _`
5876
5977warning: unused variable: `case`
60- --> $DIR/issue-47390-unused-variable-in-struct-pattern.rs:65 :24
78+ --> $DIR/issue-47390-unused-variable-in-struct-pattern.rs:69 :24
6179 |
6280LL | (Large::Suit { case },) => {}
6381 | ^^^^ help: try ignoring the field: `case: _`
6482
6583warning: unused variable: `case`
66- --> $DIR/issue-47390-unused-variable-in-struct-pattern.rs:70 :24
84+ --> $DIR/issue-47390-unused-variable-in-struct-pattern.rs:74 :24
6785 |
6886LL | [Large::Suit { case }] => {}
6987 | ^^^^ help: try ignoring the field: `case: _`
7088
7189warning: unused variable: `case`
72- --> $DIR/issue-47390-unused-variable-in-struct-pattern.rs:75 :29
90+ --> $DIR/issue-47390-unused-variable-in-struct-pattern.rs:79 :29
7391 |
7492LL | Tuple(Large::Suit { case }, ()) => {}
7593 | ^^^^ help: try ignoring the field: `case: _`
7694
95+ warning: variable does not need to be mutable
96+ --> $DIR/issue-47390-unused-variable-in-struct-pattern.rs:38:9
97+ |
98+ LL | let mut mut_unused_var = 1;
99+ | ----^^^^^^^^^^^^^^
100+ | |
101+ | help: remove this `mut`
102+ |
103+ note: lint level defined here
104+ --> $DIR/issue-47390-unused-variable-in-struct-pattern.rs:15:9
105+ |
106+ LL | #![warn(unused)] // UI tests pass `-A unused` (#43896)
107+ | ^^^^^^
108+ = note: #[warn(unused_mut)] implied by #[warn(unused)]
109+
110+ warning: variable does not need to be mutable
111+ --> $DIR/issue-47390-unused-variable-in-struct-pattern.rs:40:10
112+ |
113+ LL | let (mut var, unused_var) = (1, 2);
114+ | ----^^^
115+ | |
116+ | help: remove this `mut`
117+
0 commit comments