@@ -11,22 +11,40 @@ LL | #![warn(unused)] // UI tests pass `-A unused` (#43896)
11
11
| ^^^^^^
12
12
= note: #[warn(unused_variables)] implied by #[warn(unused)]
13
13
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
+
14
32
warning: 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
16
34
|
17
35
LL | if let SoulHistory { corridors_of_light,
18
36
| ^^^^^^^^^^^^^^^^^^ help: try ignoring the field: `corridors_of_light: _`
19
37
20
38
warning: 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
22
40
|
23
41
LL | mut hours_are_suns,
24
- | ^^^^ ^^^^^^^^^^^^^^
42
+ | ^^^^^^^^^^^^^^
25
43
|
26
44
= note: consider using `_hours_are_suns` instead
27
45
28
46
warning: 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
30
48
|
31
49
LL | hours_are_suns = false;
32
50
| ^^^^^^^^^^^^^^
@@ -39,38 +57,61 @@ LL | #![warn(unused)] // UI tests pass `-A unused` (#43896)
39
57
= note: #[warn(unused_assignments)] implied by #[warn(unused)]
40
58
41
59
warning: 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
43
61
|
44
62
LL | Large::Suit { case } => {}
45
63
| ^^^^ help: try ignoring the field: `case: _`
46
64
47
65
warning: 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
49
67
|
50
68
LL | &Large::Suit { case } => {}
51
69
| ^^^^ help: try ignoring the field: `case: _`
52
70
53
71
warning: 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
55
73
|
56
74
LL | box Large::Suit { case } => {}
57
75
| ^^^^ help: try ignoring the field: `case: _`
58
76
59
77
warning: 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
61
79
|
62
80
LL | (Large::Suit { case },) => {}
63
81
| ^^^^ help: try ignoring the field: `case: _`
64
82
65
83
warning: 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
67
85
|
68
86
LL | [Large::Suit { case }] => {}
69
87
| ^^^^ help: try ignoring the field: `case: _`
70
88
71
89
warning: 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
73
91
|
74
92
LL | Tuple(Large::Suit { case }, ()) => {}
75
93
| ^^^^ help: try ignoring the field: `case: _`
76
94
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