rust/tests/ui/consts/min_const_fn/address_of.rs
2024-01-22 09:28:00 +01:00

18 lines
323 B
Rust

#![feature(raw_ref_op)]
const fn mutable_address_of_in_const() {
let mut a = 0;
let b = &raw mut a; //~ ERROR mutable pointer
}
struct X;
impl X {
const fn inherent_mutable_address_of_in_const() {
let mut a = 0;
let b = &raw mut a; //~ ERROR mutable pointer
}
}
fn main() {}