Immutability is the default in Rust. Trying to modify an immutable variable in Rust leads to a compiler error:
let x = 1;
x += 2;
x[E0384] Error: cannot assign twice to immutable variable `x`
╭─[ command_2:1:1 ]
│
1 │ let x = 1;
│ ┬
│ ╰── first assignment to `x`
2 │ x += 2;
│ ───┬──
│ ╰──── cannot assign twice to immutable variable
│
├─[ command_2:1:1 ]
│
1 │ let x = 1;
│ │
│ ╰─ help: consider making this binding mutable: `mut `
│
│ Note: You can change an existing variable to mutable like: `let mut x = x;`
───╯