diff options
Diffstat (limited to 'tests/ui/consts/min_const_fn/address_of.rs')
-rw-r--r-- | tests/ui/consts/min_const_fn/address_of.rs | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/tests/ui/consts/min_const_fn/address_of.rs b/tests/ui/consts/min_const_fn/address_of.rs new file mode 100644 index 000000000..40d1882d7 --- /dev/null +++ b/tests/ui/consts/min_const_fn/address_of.rs @@ -0,0 +1,17 @@ +#![feature(raw_ref_op)] + +const fn mutable_address_of_in_const() { + let mut a = 0; + let b = &raw mut a; //~ ERROR mutable reference +} + +struct X; + +impl X { + const fn inherent_mutable_address_of_in_const() { + let mut a = 0; + let b = &raw mut a; //~ ERROR mutable reference + } +} + +fn main() {} |