Having "fun" with `let` bindings

⚓ Rust    📅 2025-05-03    👤 surdeus    👁️ 5      

surdeus

Warning

This post was published 109 days ago. The information described in this article may have changed.

Can someone explain what ... this is supposed to mean?

fn main() {
    let a @ b @ c @ ref mut d;
    a = true;
    d = &mut false;
    b = c; // error[E0381]: used binding `c` isn't initialized -- but WHY?
}

Isn't the @ supposed to own, or reference, the same value?

Why in the world would I even be allowed to do this - in the very first place?

4 posts - 2 participants

Read full topic

🏷️ rust_feed