summaryrefslogtreecommitdiffstats
path: root/tests/ui/consts/issue-17458.rs
diff options
context:
space:
mode:
Diffstat (limited to 'tests/ui/consts/issue-17458.rs')
-rw-r--r--tests/ui/consts/issue-17458.rs6
1 files changed, 6 insertions, 0 deletions
diff --git a/tests/ui/consts/issue-17458.rs b/tests/ui/consts/issue-17458.rs
new file mode 100644
index 000000000..44125a1c3
--- /dev/null
+++ b/tests/ui/consts/issue-17458.rs
@@ -0,0 +1,6 @@
+static X: usize = unsafe { core::ptr::null::<usize>() as usize };
+//~^ ERROR: pointers cannot be cast to integers during const eval
+
+fn main() {
+ assert_eq!(X, 0);
+}