summaryrefslogtreecommitdiffstats
path: root/tests/ui/consts/min_const_fn/min_const_fn_unsafe_bad.stderr
diff options
context:
space:
mode:
Diffstat (limited to 'tests/ui/consts/min_const_fn/min_const_fn_unsafe_bad.stderr')
-rw-r--r--tests/ui/consts/min_const_fn/min_const_fn_unsafe_bad.stderr30
1 files changed, 30 insertions, 0 deletions
diff --git a/tests/ui/consts/min_const_fn/min_const_fn_unsafe_bad.stderr b/tests/ui/consts/min_const_fn/min_const_fn_unsafe_bad.stderr
new file mode 100644
index 000000000..820b6433f
--- /dev/null
+++ b/tests/ui/consts/min_const_fn/min_const_fn_unsafe_bad.stderr
@@ -0,0 +1,30 @@
+error[E0658]: dereferencing raw mutable pointers in constant functions is unstable
+ --> $DIR/min_const_fn_unsafe_bad.rs:1:77
+ |
+LL | const fn bad_const_fn_deref_raw(x: *mut usize) -> &'static usize { unsafe { &*x } }
+ | ^^^
+ |
+ = note: see issue #57349 <https://github.com/rust-lang/rust/issues/57349> for more information
+ = help: add `#![feature(const_mut_refs)]` to the crate attributes to enable
+
+error[E0658]: dereferencing raw mutable pointers in constant functions is unstable
+ --> $DIR/min_const_fn_unsafe_bad.rs:4:70
+ |
+LL | const unsafe fn bad_const_unsafe_deref_raw(x: *mut usize) -> usize { *x }
+ | ^^
+ |
+ = note: see issue #57349 <https://github.com/rust-lang/rust/issues/57349> for more information
+ = help: add `#![feature(const_mut_refs)]` to the crate attributes to enable
+
+error[E0658]: dereferencing raw mutable pointers in constant functions is unstable
+ --> $DIR/min_const_fn_unsafe_bad.rs:7:83
+ |
+LL | const unsafe fn bad_const_unsafe_deref_raw_ref(x: *mut usize) -> &'static usize { &*x }
+ | ^^^
+ |
+ = note: see issue #57349 <https://github.com/rust-lang/rust/issues/57349> for more information
+ = help: add `#![feature(const_mut_refs)]` to the crate attributes to enable
+
+error: aborting due to 3 previous errors
+
+For more information about this error, try `rustc --explain E0658`.