]> git.lizzy.rs Git - rust.git/blob - tests/ui/needless_late_init.stderr
Auto merge of #8374 - Alexendoo:bless-revisions, r=camsteffen
[rust.git] / tests / ui / needless_late_init.stderr
1 error: unneeded late initalization
2   --> $DIR/needless_late_init.rs:4:5
3    |
4 LL |     let a;
5    |     ^^^^^^
6    |
7    = note: `-D clippy::needless-late-init` implied by `-D warnings`
8 help: declare `a` here
9    |
10 LL |     let a = match n {
11    |     +++++++
12 help: remove the assignments from the `match` arms
13    |
14 LL ~         1 => "one",
15 LL |         _ => {
16 LL ~             "two"
17    |
18 help: add a semicolon after the `match` expression
19    |
20 LL |     };
21    |      +
22
23 error: unneeded late initalization
24   --> $DIR/needless_late_init.rs:13:5
25    |
26 LL |     let b;
27    |     ^^^^^^
28    |
29 help: declare `b` here
30    |
31 LL |     let b = if n == 3 {
32    |     +++++++
33 help: remove the assignments from the branches
34    |
35 LL ~         "four"
36 LL |     } else {
37 LL ~         "five"
38    |
39 help: add a semicolon after the `if` expression
40    |
41 LL |     };
42    |      +
43
44 error: unneeded late initalization
45   --> $DIR/needless_late_init.rs:20:5
46    |
47 LL |     let c;
48    |     ^^^^^^
49    |
50 help: declare `c` here
51    |
52 LL |     let c = if let Some(n) = Some(5) {
53    |     +++++++
54 help: remove the assignments from the branches
55    |
56 LL ~         n
57 LL |     } else {
58 LL ~         -50
59    |
60 help: add a semicolon after the `if` expression
61    |
62 LL |     };
63    |      +
64
65 error: unneeded late initalization
66   --> $DIR/needless_late_init.rs:27:5
67    |
68 LL |     let d;
69    |     ^^^^^^
70    |
71 help: declare `d` here
72    |
73 LL |     let d = if true {
74    |     +++++++
75 help: remove the assignments from the branches
76    |
77 LL ~         temp
78 LL |     } else {
79 LL ~         15
80    |
81 help: add a semicolon after the `if` expression
82    |
83 LL |     };
84    |      +
85
86 error: unneeded late initalization
87   --> $DIR/needless_late_init.rs:35:5
88    |
89 LL |     let e;
90    |     ^^^^^^
91    |
92 help: declare `e` here
93    |
94 LL |     let e = if true {
95    |     +++++++
96 help: remove the assignments from the branches
97    |
98 LL ~         format!("{} {}", a, b)
99 LL |     } else {
100 LL ~         format!("{}", c)
101    |
102 help: add a semicolon after the `if` expression
103    |
104 LL |     };
105    |      +
106
107 error: unneeded late initalization
108   --> $DIR/needless_late_init.rs:42:5
109    |
110 LL |     let f;
111    |     ^^^^^^
112    |
113 help: declare `f` here
114    |
115 LL |     let f = match 1 {
116    |     +++++++
117 help: remove the assignments from the `match` arms
118    |
119 LL -         1 => f = "three",
120 LL +         1 => "three",
121    | 
122
123 error: unneeded late initalization
124   --> $DIR/needless_late_init.rs:48:5
125    |
126 LL |     let g: usize;
127    |     ^^^^^^^^^^^^^
128    |
129 help: declare `g` here
130    |
131 LL |     let g: usize = if true {
132    |     ++++++++++++++
133 help: remove the assignments from the branches
134    |
135 LL -         g = 5;
136 LL +         5
137    | 
138 help: add a semicolon after the `if` expression
139    |
140 LL |     };
141    |      +
142
143 error: unneeded late initalization
144   --> $DIR/needless_late_init.rs:63:5
145    |
146 LL |     let a;
147    |     ^^^^^^
148    |
149 help: declare `a` here
150    |
151 LL |     let a = match n {
152    |     +++++++
153 help: remove the assignments from the `match` arms
154    |
155 LL ~         1 => f().await,
156 LL |         _ => {
157 LL ~             "two"
158    |
159 help: add a semicolon after the `match` expression
160    |
161 LL |     };
162    |      +
163
164 error: unneeded late initalization
165   --> $DIR/needless_late_init.rs:80:5
166    |
167 LL |     let a;
168    |     ^^^^^^
169    |
170 help: declare `a` here
171    |
172 LL |     let a = match n {
173    |     +++++++
174 help: remove the assignments from the `match` arms
175    |
176 LL ~         1 => f(),
177 LL |         _ => {
178 LL ~             "two"
179    |
180 help: add a semicolon after the `match` expression
181    |
182 LL |     };
183    |      +
184
185 error: aborting due to 9 previous errors
186