| ... | @@ -0,0 +1,28 @@ |
| 1 | fn entry0() void { |
| 2 | var a: u32 = 1 + 2; |
| 3 | _ = a; |
| 4 | } |
| 5 | |
| 6 | fn entry1() void { |
| 7 | const a: u32 = 1; |
| 8 | const b: u32 = 2; |
| 9 | var c = a + b; |
| 10 | const d = c; |
| 11 | _ = d; |
| 12 | } |
| 13 | |
| 14 | fn entry2() void { |
| 15 | var a: u32 = 123; |
| 16 | foo(a); |
| 17 | } |
| 18 | |
| 19 | fn foo(_: u32) void {} |
| 20 | |
| 21 | // error |
| 22 | // |
| 23 | // :2:9: error: local variable is never mutated |
| 24 | // :2:9: note: consider using 'const' |
| 25 | // :9:9: error: local variable is never mutated |
| 26 | // :9:9: note: consider using 'const' |
| 27 | // :15:9: error: local variable is never mutated |
| 28 | // :15:9: note: consider using 'const' |