summaryrefslogtreecommitdiffstats
path: root/tests/ui/consts/const-eval/match-test-ptr-null.stderr
diff options
context:
space:
mode:
Diffstat (limited to 'tests/ui/consts/const-eval/match-test-ptr-null.stderr')
-rw-r--r--tests/ui/consts/const-eval/match-test-ptr-null.stderr11
1 files changed, 11 insertions, 0 deletions
diff --git a/tests/ui/consts/const-eval/match-test-ptr-null.stderr b/tests/ui/consts/const-eval/match-test-ptr-null.stderr
new file mode 100644
index 000000000..05c3951c1
--- /dev/null
+++ b/tests/ui/consts/const-eval/match-test-ptr-null.stderr
@@ -0,0 +1,11 @@
+error: pointers cannot be cast to integers during const eval
+ --> $DIR/match-test-ptr-null.rs:6:15
+ |
+LL | match &1 as *const i32 as usize {
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^
+ |
+ = note: at compile-time, pointers do not have an integer value
+ = note: avoiding this restriction via `transmute`, `union`, or raw pointers leads to compile-time undefined behavior
+
+error: aborting due to previous error
+