about summary refs log tree commit diff
path: root/tests/ui
diff options
context:
space:
mode:
authorRalf Jung <post@ralfj.de>2024-11-02 08:25:30 +0100
committerRalf Jung <post@ralfj.de>2024-11-04 23:27:46 +0100
commit5069434c816aa13ffd2807cf95133ade5a9306df (patch)
tree0ed1e1a274f8f16015883d3728c6d46629badabf /tests/ui
parent1f0ed2b0f54aff2dbc63ff72261b8acb2c186404 (diff)
downloadrust-5069434c816aa13ffd2807cf95133ade5a9306df.tar.gz
rust-5069434c816aa13ffd2807cf95133ade5a9306df.zip
most const intrinsics don't need an explicit rustc_const_unstable any more
Diffstat (limited to 'tests/ui')
-rw-r--r--tests/ui/consts/const-compare-bytes-ub.rs1
-rw-r--r--tests/ui/consts/const-compare-bytes-ub.stderr16
-rw-r--r--tests/ui/consts/const-compare-bytes.rs1
-rw-r--r--tests/ui/intrinsics/intrinsic-raw_eq-const-bad.rs1
-rw-r--r--tests/ui/intrinsics/intrinsic-raw_eq-const-bad.stderr6
-rw-r--r--tests/ui/intrinsics/intrinsic-raw_eq-const.rs1
6 files changed, 11 insertions, 15 deletions
diff --git a/tests/ui/consts/const-compare-bytes-ub.rs b/tests/ui/consts/const-compare-bytes-ub.rs
index 903ba15e622..9dafae1efd1 100644
--- a/tests/ui/consts/const-compare-bytes-ub.rs
+++ b/tests/ui/consts/const-compare-bytes-ub.rs
@@ -1,7 +1,6 @@
 //@ check-fail
 
 #![feature(core_intrinsics)]
-#![feature(const_intrinsic_compare_bytes)]
 use std::intrinsics::compare_bytes;
 use std::mem::MaybeUninit;
 
diff --git a/tests/ui/consts/const-compare-bytes-ub.stderr b/tests/ui/consts/const-compare-bytes-ub.stderr
index 7f83dee6409..9ef5c8ad43a 100644
--- a/tests/ui/consts/const-compare-bytes-ub.stderr
+++ b/tests/ui/consts/const-compare-bytes-ub.stderr
@@ -1,47 +1,47 @@
 error[E0080]: evaluation of constant value failed
-  --> $DIR/const-compare-bytes-ub.rs:10:9
+  --> $DIR/const-compare-bytes-ub.rs:9:9
    |
 LL |         compare_bytes(0 as *const u8, 2 as *const u8, 1)
    |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ memory access failed: expected a pointer to 1 byte of memory, but got a null pointer
 
 error[E0080]: evaluation of constant value failed
-  --> $DIR/const-compare-bytes-ub.rs:14:9
+  --> $DIR/const-compare-bytes-ub.rs:13:9
    |
 LL |         compare_bytes(1 as *const u8, 0 as *const u8, 1)
    |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ memory access failed: expected a pointer to 1 byte of memory, but got 0x1[noalloc] which is a dangling pointer (it has no provenance)
 
 error[E0080]: evaluation of constant value failed
-  --> $DIR/const-compare-bytes-ub.rs:18:9
+  --> $DIR/const-compare-bytes-ub.rs:17:9
    |
 LL |         compare_bytes(1 as *const u8, 2 as *const u8, 1)
    |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ memory access failed: expected a pointer to 1 byte of memory, but got 0x1[noalloc] which is a dangling pointer (it has no provenance)
 
 error[E0080]: evaluation of constant value failed
-  --> $DIR/const-compare-bytes-ub.rs:22:9
+  --> $DIR/const-compare-bytes-ub.rs:21:9
    |
 LL |         compare_bytes([1, 2, 3].as_ptr(), [1, 2, 3, 4].as_ptr(), 4)
    |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ memory access failed: expected a pointer to 4 bytes of memory, but got ALLOC0 which is only 3 bytes from the end of the allocation
 
 error[E0080]: evaluation of constant value failed
-  --> $DIR/const-compare-bytes-ub.rs:26:9
+  --> $DIR/const-compare-bytes-ub.rs:25:9
    |
 LL |         compare_bytes([1, 2, 3, 4].as_ptr(), [1, 2, 3].as_ptr(), 4)
    |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ memory access failed: expected a pointer to 4 bytes of memory, but got ALLOC1 which is only 3 bytes from the end of the allocation
 
 error[E0080]: evaluation of constant value failed
-  --> $DIR/const-compare-bytes-ub.rs:30:9
+  --> $DIR/const-compare-bytes-ub.rs:29:9
    |
 LL |         compare_bytes(MaybeUninit::uninit().as_ptr(), [1].as_ptr(), 1)
    |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ reading memory at ALLOC2[0x0..0x1], but memory is uninitialized at [0x0..0x1], and this operation requires initialized memory
 
 error[E0080]: evaluation of constant value failed
-  --> $DIR/const-compare-bytes-ub.rs:34:9
+  --> $DIR/const-compare-bytes-ub.rs:33:9
    |
 LL |         compare_bytes([1].as_ptr(), MaybeUninit::uninit().as_ptr(), 1)
    |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ reading memory at ALLOC3[0x0..0x1], but memory is uninitialized at [0x0..0x1], and this operation requires initialized memory
 
 error[E0080]: evaluation of constant value failed
-  --> $DIR/const-compare-bytes-ub.rs:38:9
+  --> $DIR/const-compare-bytes-ub.rs:37:9
    |
 LL |         compare_bytes([&1].as_ptr().cast(), [&2].as_ptr().cast(), std::mem::size_of::<usize>())
    |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ unable to turn pointer into integer
diff --git a/tests/ui/consts/const-compare-bytes.rs b/tests/ui/consts/const-compare-bytes.rs
index 8596a2d9df9..cd5cdfd0400 100644
--- a/tests/ui/consts/const-compare-bytes.rs
+++ b/tests/ui/consts/const-compare-bytes.rs
@@ -1,7 +1,6 @@
 //@ run-pass
 
 #![feature(core_intrinsics)]
-#![feature(const_intrinsic_compare_bytes)]
 use std::intrinsics::compare_bytes;
 
 fn main() {
diff --git a/tests/ui/intrinsics/intrinsic-raw_eq-const-bad.rs b/tests/ui/intrinsics/intrinsic-raw_eq-const-bad.rs
index 99f98c3f27a..76b6a8c8395 100644
--- a/tests/ui/intrinsics/intrinsic-raw_eq-const-bad.rs
+++ b/tests/ui/intrinsics/intrinsic-raw_eq-const-bad.rs
@@ -1,5 +1,4 @@
 #![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))
diff --git a/tests/ui/intrinsics/intrinsic-raw_eq-const-bad.stderr b/tests/ui/intrinsics/intrinsic-raw_eq-const-bad.stderr
index bedfc8283ea..b8fdfe7bef3 100644
--- a/tests/ui/intrinsics/intrinsic-raw_eq-const-bad.stderr
+++ b/tests/ui/intrinsics/intrinsic-raw_eq-const-bad.stderr
@@ -1,11 +1,11 @@
 error[E0080]: evaluation of constant value failed
-  --> $DIR/intrinsic-raw_eq-const-bad.rs:5:5
+  --> $DIR/intrinsic-raw_eq-const-bad.rs:4:5
    |
 LL |     std::intrinsics::raw_eq(&(1_u8, 2_u16), &(1_u8, 2_u16))
    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ reading memory at ALLOC0[0x0..0x4], but memory is uninitialized at [0x1..0x2], and this operation requires initialized memory
 
 error[E0080]: evaluation of constant value failed
-  --> $DIR/intrinsic-raw_eq-const-bad.rs:11:5
+  --> $DIR/intrinsic-raw_eq-const-bad.rs:10:5
    |
 LL |     std::intrinsics::raw_eq(&(&0), &(&1))
    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ unable to turn pointer into integer
@@ -14,7 +14,7 @@ LL |     std::intrinsics::raw_eq(&(&0), &(&1))
    = help: the absolute address of a pointer is not known at compile-time, so such operations are not supported
 
 error[E0080]: evaluation of constant value failed
-  --> $DIR/intrinsic-raw_eq-const-bad.rs:19:5
+  --> $DIR/intrinsic-raw_eq-const-bad.rs:18:5
    |
 LL |     std::intrinsics::raw_eq(aref, aref)
    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ accessing memory with alignment 1, but alignment 4 is required
diff --git a/tests/ui/intrinsics/intrinsic-raw_eq-const.rs b/tests/ui/intrinsics/intrinsic-raw_eq-const.rs
index 47b4e20dfbb..b37def85bb7 100644
--- a/tests/ui/intrinsics/intrinsic-raw_eq-const.rs
+++ b/tests/ui/intrinsics/intrinsic-raw_eq-const.rs
@@ -1,7 +1,6 @@
 //@ run-pass
 
 #![feature(core_intrinsics)]
-#![feature(const_intrinsic_raw_eq)]
 
 pub fn main() {
     use std::intrinsics::raw_eq;