]> git.lizzy.rs Git - rust.git/blob - src/test/ui/liveness/liveness-assign/liveness-assign-imm-local-with-init.rs
Rollup merge of #87440 - twetzel59:fix-barrier-no-op, r=yaahc
[rust.git] / src / test / ui / liveness / liveness-assign / liveness-assign-imm-local-with-init.rs
1 fn test() {
2     let v: isize = 1; //~ NOTE first assignment
3                       //~| HELP consider making this binding mutable
4                       //~| SUGGESTION mut v
5     v.clone();
6     v = 2; //~ ERROR cannot assign twice to immutable variable `v`
7            //~| NOTE cannot assign twice to immutable
8     v.clone();
9 }
10
11 fn main() {
12 }