2019-09-18 21:31:25 +01:00
|
|
|
#![feature(raw_ref_op)]
|
|
|
|
|
|
|
|
const fn mutable_address_of_in_const() {
|
|
|
|
let mut a = 0;
|
2023-12-17 11:24:34 +01:00
|
|
|
let b = &raw mut a; //~ ERROR mutable pointer
|
2019-09-18 21:31:25 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
struct X;
|
|
|
|
|
|
|
|
impl X {
|
|
|
|
const fn inherent_mutable_address_of_in_const() {
|
|
|
|
let mut a = 0;
|
2023-12-17 11:24:34 +01:00
|
|
|
let b = &raw mut a; //~ ERROR mutable pointer
|
2019-09-18 21:31:25 +01:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
fn main() {}
|