rust/tests/ui/consts/min_const_fn/address_of.rs

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

18 lines
327 B
Rust
Raw Normal View History

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() {}