2021-01-03 12:46:20 -06:00
|
|
|
static OH_NO: &mut i32 = &mut 42; //~ ERROR mutable references are not allowed
|
2019-11-28 10:38:07 -06:00
|
|
|
fn main() {
|
2020-06-08 15:16:23 -05:00
|
|
|
assert_eq!(*OH_NO, 42);
|
2021-01-03 12:46:20 -06:00
|
|
|
*OH_NO = 43; //~ ERROR cannot assign to `*OH_NO`, as `OH_NO` is an immutable static
|
2019-11-28 10:38:07 -06:00
|
|
|
}
|