2018-11-10 23:02:13 +00:00
|
|
|
//compile-flags: -Z borrowck=compare
|
2018-01-07 17:02:26 -08:00
|
|
|
|
|
|
|
fn foo(_x: u32) {
|
|
|
|
_x = 4;
|
2018-01-09 19:10:45 -08:00
|
|
|
//~^ ERROR cannot assign to immutable argument `_x` (Mir)
|
2018-01-07 17:02:26 -08:00
|
|
|
//~^^ ERROR cannot assign twice to immutable variable `_x` (Ast)
|
|
|
|
}
|
|
|
|
|
|
|
|
fn main() {}
|