External Publication
Visit Post

Just `mut` alongside `let mut`

Rust Internals [Unofficial] March 15, 2026
Source

Also note that let mut isn’t an atomic thing that can be shortened.

Instead the sequence “let mut” appears in let statement containing mut x-style identifier pattern. The mut is part of the pattern.

let mut x = 123;

is technically composed of let, followed by mut x, not let mut followed by x.

Like, you could think of it as bracketing; let (mut x) not (let mut) x. [Note that let (mut x) = 123; is even valid Rust syntax.]

Hence, it’s also the case that

// error
let mut _ = 123;

is illegal syntax, and

let (mut x, mut y) = (1, 2);

is not written like this:

// error
let mut (x, y) = (1, 2);

Discussion in the ATmosphere

Loading comments...