2025-06-27 15:32:53 +02:00
|
|
|
static OH_NO: &mut i32 = &mut 42; //~ ERROR mutable borrows of temporaries
|
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
|
|
|
}
|