]> git.lizzy.rs Git - rust.git/blob - src/test/ui/borrowck/immutable-arg.rs
Rollup merge of #57132 - daxpedda:master, r=steveklabnik
[rust.git] / src / test / ui / borrowck / immutable-arg.rs
1 //compile-flags: -Z borrowck=compare
2
3 fn foo(_x: u32) {
4     _x = 4;
5     //~^ ERROR cannot assign to immutable argument `_x` (Mir)
6     //~^^ ERROR cannot assign twice to immutable variable `_x` (Ast)
7 }
8
9 fn main() {}
10