2018-02-01 11:51:49 -08:00
|
|
|
macro_rules! bad {
|
|
|
|
|
($s:ident whatever) => {
|
|
|
|
|
{
|
|
|
|
|
let $s = 0;
|
|
|
|
|
*&mut $s = 0;
|
2019-04-22 08:40:08 +01:00
|
|
|
//~^ ERROR cannot borrow `foo` as mutable, as it is not declared as mutable [E0596]
|
2018-02-01 11:51:49 -08:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
fn main() {
|
|
|
|
|
bad!(foo whatever);
|
|
|
|
|
}
|