summaryrefslogtreecommitdiffstats
path: root/tests/ui/intrinsics/intrinsic-raw_eq-const-bad.rs
diff options
context:
space:
mode:
Diffstat (limited to 'tests/ui/intrinsics/intrinsic-raw_eq-const-bad.rs')
-rw-r--r--tests/ui/intrinsics/intrinsic-raw_eq-const-bad.rs17
1 files changed, 17 insertions, 0 deletions
diff --git a/tests/ui/intrinsics/intrinsic-raw_eq-const-bad.rs b/tests/ui/intrinsics/intrinsic-raw_eq-const-bad.rs
new file mode 100644
index 000000000..0e894ef58
--- /dev/null
+++ b/tests/ui/intrinsics/intrinsic-raw_eq-const-bad.rs
@@ -0,0 +1,17 @@
+#![feature(core_intrinsics)]
+#![feature(const_intrinsic_raw_eq)]
+
+const RAW_EQ_PADDING: bool = unsafe {
+ std::intrinsics::raw_eq(&(1_u8, 2_u16), &(1_u8, 2_u16))
+//~^ ERROR evaluation of constant value failed
+//~| requires initialized memory
+};
+
+const RAW_EQ_PTR: bool = unsafe {
+ std::intrinsics::raw_eq(&(&0), &(&1))
+//~^ ERROR evaluation of constant value failed
+//~| `raw_eq` on bytes with provenance
+};
+
+pub fn main() {
+}