Open
Description
Hey, this code does not work in 1.68.2, but it should.
struct W(u8);
fn sooqa () -> Option<W> {
Some(W(0))
}
fn main() {
let p@W(v);
loop {
if let Some(p_) = sooqa() { p = p_;break /*A*/ };
}
println!("{}", v);
}
This is the error message
error[[E0381]](https://doc.rust-lang.org/stable/error_codes/E0381.html): used binding `v` isn't initialized
--> src/main.rs:13:20
|
9 | let p@W(v);
| - binding declared here but left uninitialized
...
13 | println!("{}", v);
| ^ `v` used here but it isn't initialized
|
= note: this error originates in the macro `$crate::format_args_nl` which comes from the expansion of the macro `println` (in Nightly builds, run with -Z macro-backtrace for more info)
help: consider assigning a value
|
9 | let p@W(v = 0);
| +++