From c741923a73818f3054b66ce3cf7d58ab8d9ce9be Mon Sep 17 00:00:00 2001
From: Julio Biason
StackOverflow Survey 2023: "Most Admired Language" (84.6%)
(and lifetimes)
+ Good Syntax
+ + Helpful Errors
Good Syntax
+
+fn main() {
+ let a = 2;
+ a = 3;
+ println!("{}", a);
+}
+
+
+
+
+3 | let a = 2;
+ | -
+ | |
+ | first assignment to `a`
+ | help: make this binding mutable: `mut a`
+4 | a = 3;
+ | ^^^^^ cannot assign twice to immutable variable
+
+
+
+
+3 | let a = 2;
+ | -
+ | |
+ | first assignment to `a`
+ | help: make this binding mutable: `mut a`
+4 | a = 3;
+ | ^^^^^ cannot assign twice to immutable variable
+
+
+
+
+3 | let a = 2;
+ | -
+ | |
+ | first assignment to `a`
+ | help: make this binding mutable: `mut a`
+4 | a = 3;
+ | ^^^^^ cannot assign twice to immutable variable
+
+
+
+