| 1 |
fn foo(_a: &i32) {} |
| 2 |
fn bar(_a: i32) {} |
| 3 |
|
| 4 |
mod inner { |
| 5 |
pub static mut a: i32 = 15; |
| 6 |
} |
| 7 |
|
| 8 |
fn main() { |
| 9 |
foo(&inner::a); // { dg-error "use of mutable static" } |
| 10 |
bar(inner::a); // { dg-error "use of mutable static" } |
| 11 |
|
| 12 |
unsafe { |
| 13 |
foo(&inner::a); |
| 14 |
bar(inner::a); |
| 15 |
} |
| 16 |
} |