mirror of
https://github.com/rust-lang/rust
synced 2024-11-05 20:45:15 +00:00
13 lines
328 B
Rust
13 lines
328 B
Rust
fn test() {
|
|
let v: isize;
|
|
//~^ HELP consider making this binding mutable
|
|
//~| SUGGESTION mut v
|
|
v = 1; //~ NOTE first assignment
|
|
println!("v={}", v);
|
|
v = 2; //~ ERROR cannot assign twice to immutable variable
|
|
//~| NOTE cannot assign twice to immutable
|
|
println!("v={}", v);
|
|
}
|
|
|
|
fn main() {
|
|
}
|