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