fork/rust
git clone https://git.julia.blue/fork/rust
3bcad65fbf6
master
1error: unneeded late initialization 2 --> $DIR/needless_late_init.rs:27:5 3 | 4LL | let a; 5 | ^^^^^^ created here 6LL | a = "zero"; 7 | ^^^^^^^^^^ initialised here 8 | 9 = note: `-D clippy::needless-late-init` implied by `-D warnings` 10 = help: to override `-D warnings` add `#[allow(clippy::needless_late_init)]` 11help: declare `a` here 12 | 13LL | let a = "zero"; 14 | ~~~~~ 15 16error: unneeded late initialization 17 --> $DIR/needless_late_init.rs:30:5 18 | 19LL | let b; 20 | ^^^^^^ created here 21LL | let c; 22LL | b = 1; 23 | ^^^^^ initialised here 24 | 25help: declare `b` here 26 | 27LL | let b = 1; 28 | ~~~~~ 29 30error: unneeded late initialization 31 --> $DIR/needless_late_init.rs:31:5 32 | 33LL | let c; 34 | ^^^^^^ created here 35LL | b = 1; 36LL | c = 2; 37 | ^^^^^ initialised here 38 | 39help: declare `c` here 40 | 41LL | let c = 2; 42 | ~~~~~ 43 44error: unneeded late initialization 45 --> $DIR/needless_late_init.rs:35:5 46 | 47LL | let d: usize; 48 | ^^^^^^^^^^^^^ created here 49LL | d = 1; 50 | ^^^^^ initialised here 51 | 52help: declare `d` here 53 | 54LL | let d: usize = 1; 55 | ~~~~~~~~~~~~ 56 57error: unneeded late initialization 58 --> $DIR/needless_late_init.rs:38:5 59 | 60LL | let e; 61 | ^^^^^^ created here 62LL | e = format!("{}", d); 63 | ^^^^^^^^^^^^^^^^^^^^ initialised here 64 | 65help: declare `e` here 66 | 67LL | let e = format!("{}", d); 68 | ~~~~~ 69 70error: unneeded late initialization 71 --> $DIR/needless_late_init.rs:43:5 72 | 73LL | let a; 74 | ^^^^^^ 75 | 76help: declare `a` here 77 | 78LL | let a = match n { 79 | +++++++ 80help: remove the assignments from the `match` arms 81 | 82LL ~ 1 => "one", 83LL | _ => { 84LL ~ "two" 85 | 86help: add a semicolon after the `match` expression 87 | 88LL | }; 89 | + 90 91error: unneeded late initialization 92 --> $DIR/needless_late_init.rs:52:5 93 | 94LL | let b; 95 | ^^^^^^ 96 | 97help: declare `b` here 98 | 99LL | let b = if n == 3 { 100 | +++++++ 101help: remove the assignments from the branches 102 | 103LL ~ "four" 104LL | } else { 105LL ~ "five" 106 | 107help: add a semicolon after the `if` expression 108 | 109LL | }; 110 | + 111 112error: unneeded late initialization 113 --> $DIR/needless_late_init.rs:59:5 114 | 115LL | let d; 116 | ^^^^^^ 117 | 118help: declare `d` here 119 | 120LL | let d = if true { 121 | +++++++ 122help: remove the assignments from the branches 123 | 124LL ~ temp 125LL | } else { 126LL ~ 15 127 | 128help: add a semicolon after the `if` expression 129 | 130LL | }; 131 | + 132 133error: unneeded late initialization 134 --> $DIR/needless_late_init.rs:67:5 135 | 136LL | let e; 137 | ^^^^^^ 138 | 139help: declare `e` here 140 | 141LL | let e = if true { 142 | +++++++ 143help: remove the assignments from the branches 144 | 145LL ~ format!("{} {}", a, b) 146LL | } else { 147LL ~ format!("{}", n) 148 | 149help: add a semicolon after the `if` expression 150 | 151LL | }; 152 | + 153 154error: unneeded late initialization 155 --> $DIR/needless_late_init.rs:74:5 156 | 157LL | let f; 158 | ^^^^^^ 159 | 160help: declare `f` here 161 | 162LL | let f = match 1 { 163 | +++++++ 164help: remove the assignments from the `match` arms 165 | 166LL - 1 => f = "three", 167LL + 1 => "three", 168 | 169 170error: unneeded late initialization 171 --> $DIR/needless_late_init.rs:80:5 172 | 173LL | let g: usize; 174 | ^^^^^^^^^^^^^ 175 | 176help: declare `g` here 177 | 178LL | let g: usize = if true { 179 | ++++++++++++++ 180help: remove the assignments from the branches 181 | 182LL - g = 5; 183LL + 5 184 | 185help: add a semicolon after the `if` expression 186 | 187LL | }; 188 | + 189 190error: unneeded late initialization 191 --> $DIR/needless_late_init.rs:88:5 192 | 193LL | let x; 194 | ^^^^^^ created here 195LL | let y = SignificantDrop; 196LL | x = 1; 197 | ^^^^^ initialised here 198 | 199help: declare `x` here 200 | 201LL | let x = 1; 202 | ~~~~~ 203 204error: unneeded late initialization 205 --> $DIR/needless_late_init.rs:92:5 206 | 207LL | let x; 208 | ^^^^^^ created here 209LL | let y = 1; 210LL | x = SignificantDrop; 211 | ^^^^^^^^^^^^^^^^^^^ initialised here 212 | 213help: declare `x` here 214 | 215LL | let x = SignificantDrop; 216 | ~~~~~ 217 218error: unneeded late initialization 219 --> $DIR/needless_late_init.rs:96:5 220 | 221LL | let x; 222 | ^^^^^^ created here 223... 224LL | x = SignificantDrop; 225 | ^^^^^^^^^^^^^^^^^^^ initialised here 226 | 227help: declare `x` here 228 | 229LL | let x = SignificantDrop; 230 | ~~~~~ 231 232error: unneeded late initialization 233 --> $DIR/needless_late_init.rs:115:5 234 | 235LL | let a; 236 | ^^^^^^ 237 | 238help: declare `a` here 239 | 240LL | let a = match n { 241 | +++++++ 242help: remove the assignments from the `match` arms 243 | 244LL ~ 1 => f().await, 245LL | _ => { 246LL ~ "two" 247 | 248help: add a semicolon after the `match` expression 249 | 250LL | }; 251 | + 252 253error: unneeded late initialization 254 --> $DIR/needless_late_init.rs:132:5 255 | 256LL | let a; 257 | ^^^^^^ 258 | 259help: declare `a` here 260 | 261LL | let a = match n { 262 | +++++++ 263help: remove the assignments from the `match` arms 264 | 265LL ~ 1 => f(), 266LL | _ => { 267LL ~ "two" 268 | 269help: add a semicolon after the `match` expression 270 | 271LL | }; 272 | + 273 274error: aborting due to 16 previous errors 275