1
Fork 0
rust/src/test/ui/borrowck/immutable-arg.rs

10 lines
215 B
Rust
Raw Normal View History

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