From 631cd5845e8de329d0e227aaa707d7ea228b8f8f Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Wed, 17 Apr 2024 14:20:29 +0200 Subject: Merging upstream version 1.70.0+dfsg1. Signed-off-by: Daniel Baumann --- .../const-eval/transmute-size-mismatch.stderr | 37 ++++++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100644 tests/ui/consts/const-eval/transmute-size-mismatch.stderr (limited to 'tests/ui/consts/const-eval/transmute-size-mismatch.stderr') diff --git a/tests/ui/consts/const-eval/transmute-size-mismatch.stderr b/tests/ui/consts/const-eval/transmute-size-mismatch.stderr new file mode 100644 index 000000000..e051491d3 --- /dev/null +++ b/tests/ui/consts/const-eval/transmute-size-mismatch.stderr @@ -0,0 +1,37 @@ +error[E0080]: evaluation of constant value failed + --> $DIR/transmute-size-mismatch.rs:12:13 + | +LL | RET = CastTransmute(x); + | ^^^^^^^^^^^^^^^^^^^^^^ transmuting from 4-byte type to 2-byte type: `i32` -> `u16` + | +note: inside `mir_transmute::` + --> $DIR/transmute-size-mismatch.rs:12:13 + | +LL | RET = CastTransmute(x); + | ^^^^^^^^^^^^^^^^^^^^^^ +note: inside `FROM_BIGGER` + --> $DIR/transmute-size-mismatch.rs:20:35 + | +LL | const FROM_BIGGER: u16 = unsafe { mir_transmute(123_i32) }; + | ^^^^^^^^^^^^^^^^^^^^^^ + +error[E0080]: evaluation of constant value failed + --> $DIR/transmute-size-mismatch.rs:12:13 + | +LL | RET = CastTransmute(x); + | ^^^^^^^^^^^^^^^^^^^^^^ transmuting from 2-byte type to 4-byte type: `i16` -> `u32` + | +note: inside `mir_transmute::` + --> $DIR/transmute-size-mismatch.rs:12:13 + | +LL | RET = CastTransmute(x); + | ^^^^^^^^^^^^^^^^^^^^^^ +note: inside `FROM_SMALLER` + --> $DIR/transmute-size-mismatch.rs:22:36 + | +LL | const FROM_SMALLER: u32 = unsafe { mir_transmute(123_i16) }; + | ^^^^^^^^^^^^^^^^^^^^^^ + +error: aborting due to 2 previous errors + +For more information about this error, try `rustc --explain E0080`. -- cgit v1.2.3