rust/src/test/ui/macros/span-covering-argument-1.rs
2018-12-25 21:08:33 -07:00

14 lines
252 B
Rust

macro_rules! bad {
($s:ident whatever) => {
{
let $s = 0;
*&mut $s = 0;
//~^ ERROR cannot borrow immutable local variable `foo` as mutable [E0596]
}
}
}
fn main() {
bad!(foo whatever);
}