By default, variables in Rust are immutable. When a variable is immutable, once a value is bound to a name, you can't change that value. These checks are made at compile-time. Variables can be made mutable by adding mut in front of the variable name. Difference between variables and constants Constants are declared using the… Continue reading Rust: Variables and mutability
Rust neither uses garbage collection nor automatic reference counting nor manual memory management. It has chosen a rather different approach: memory is managed through a system of ownership with a set of rules that the compiler checks at compile time.
Rust is a statically typed language so it must know the types of all variables at compile time.