← Back to archive

Stdle #124 · ownership · 2026-10-08

What does this Rust snippet output?

A past puzzle — fully playable. 4 attempts, hints on wrong guesses.

fn square(n: i32) -> i32 { n * n }
fn main() {
let n = 4;
let s = square(n);
let t = square(n);
println!("{} {} {}", n, s, t);
}
Ownership
4 attempts left

Answer & explanation