Why doesnt x get moved here? Should the last println even compile?

54 points christusvincit77
fn main() {
    let x = 5;
    {
        let x = x * 2;
        println!("inner scope {x}");
    }
    println!("outer scope {x}");
}

\-- Output -- inner scope 10 outer scope 5

// edit

You guys are right. Integers have the Copy trait. Tried it with a String and it didn't compile: Snippet

Snippet with cloning (compiles)