diff options
Diffstat (limited to '')
6 files changed, 36 insertions, 21 deletions
diff --git a/tests/ui/intrinsics/const-eval-select-backtrace-std.run.stderr b/tests/ui/intrinsics/const-eval-select-backtrace-std.run.stderr index 463cd52c5..a0024c092 100644 --- a/tests/ui/intrinsics/const-eval-select-backtrace-std.run.stderr +++ b/tests/ui/intrinsics/const-eval-select-backtrace-std.run.stderr @@ -1,2 +1,3 @@ -thread 'main' panicked at 'byte index 1 is out of bounds of ``', $DIR/const-eval-select-backtrace-std.rs:6:6 +thread 'main' panicked at $DIR/const-eval-select-backtrace-std.rs:6:8: +byte index 1 is out of bounds of `` note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace diff --git a/tests/ui/intrinsics/const-eval-select-backtrace.run.stderr b/tests/ui/intrinsics/const-eval-select-backtrace.run.stderr index 54e28db5e..3f196bd8a 100644 --- a/tests/ui/intrinsics/const-eval-select-backtrace.run.stderr +++ b/tests/ui/intrinsics/const-eval-select-backtrace.run.stderr @@ -1,2 +1,3 @@ -thread 'main' panicked at 'Aaah!', $DIR/const-eval-select-backtrace.rs:17:9 +thread 'main' panicked at $DIR/const-eval-select-backtrace.rs:17:9: +Aaah! note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace 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() { +} diff --git a/tests/ui/intrinsics/intrinsic-raw_eq-const-bad.stderr b/tests/ui/intrinsics/intrinsic-raw_eq-const-bad.stderr new file mode 100644 index 000000000..4fc304cda --- /dev/null +++ b/tests/ui/intrinsics/intrinsic-raw_eq-const-bad.stderr @@ -0,0 +1,15 @@ +error[E0080]: evaluation of constant value failed + --> $DIR/intrinsic-raw_eq-const-bad.rs:5:5 + | +LL | std::intrinsics::raw_eq(&(1_u8, 2_u16), &(1_u8, 2_u16)) + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ reading memory at alloc3[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 + | +LL | std::intrinsics::raw_eq(&(&0), &(&1)) + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ `raw_eq` on bytes with provenance + +error: aborting due to 2 previous errors + +For more information about this error, try `rustc --explain E0080`. diff --git a/tests/ui/intrinsics/intrinsic-raw_eq-const-padding.rs b/tests/ui/intrinsics/intrinsic-raw_eq-const-padding.rs deleted file mode 100644 index a93d777d2..000000000 --- a/tests/ui/intrinsics/intrinsic-raw_eq-const-padding.rs +++ /dev/null @@ -1,10 +0,0 @@ -#![feature(core_intrinsics)] -#![feature(const_intrinsic_raw_eq)] - -const BAD_RAW_EQ_CALL: bool = unsafe { - std::intrinsics::raw_eq(&(1_u8, 2_u16), &(1_u8, 2_u16)) -//~^ ERROR evaluation of constant value failed -}; - -pub fn main() { -} diff --git a/tests/ui/intrinsics/intrinsic-raw_eq-const-padding.stderr b/tests/ui/intrinsics/intrinsic-raw_eq-const-padding.stderr deleted file mode 100644 index 56d5a4857..000000000 --- a/tests/ui/intrinsics/intrinsic-raw_eq-const-padding.stderr +++ /dev/null @@ -1,9 +0,0 @@ -error[E0080]: evaluation of constant value failed - --> $DIR/intrinsic-raw_eq-const-padding.rs:5:5 - | -LL | std::intrinsics::raw_eq(&(1_u8, 2_u16), &(1_u8, 2_u16)) - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ reading memory at alloc3[0x0..0x4], but memory is uninitialized at [0x1..0x2], and this operation requires initialized memory - -error: aborting due to previous error - -For more information about this error, try `rustc --explain E0080`. |