2019-09-18 15:31:25 -05:00
|
|
|
#![feature(raw_ref_op)]
|
|
|
|
|
|
|
|
const fn mutable_address_of_in_const() {
|
|
|
|
let mut a = 0;
|
2020-10-01 13:03:52 -05:00
|
|
|
let b = &raw mut a; //~ ERROR mutable reference
|
2019-09-18 15:31:25 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
struct X;
|
|
|
|
|
|
|
|
impl X {
|
|
|
|
const fn inherent_mutable_address_of_in_const() {
|
|
|
|
let mut a = 0;
|
2020-10-01 13:03:52 -05:00
|
|
|
let b = &raw mut a; //~ ERROR mutable reference
|
2019-09-18 15:31:25 -05:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
fn main() {}
|