Pls explain this code why am getting error

⚓ Rust    📅 2025-11-17    👤 surdeus    👁️ 7      

surdeus

#![allow(warnings)]
fn main() {
    let mut z = 4;
    let mut x = &mut z;

    let mut s = 44;
    let mut d: &mut u32 = x;

    let mut f = 4444;
    let mut q = 444;

    d = &mut f;
    x = &mut q;

    println!("{}", q);
    println!("{}", d);
}

(Playground)

1 post - 1 participant

Read full topic

🏷️ Rust_feed