summaryrefslogtreecommitdiffstats
path: root/tests/ui/consts/const-float-bits-reject-conv.stderr
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-17 12:19:03 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-17 12:19:03 +0000
commit64d98f8ee037282c35007b64c2649055c56af1db (patch)
tree5492bcf97fce41ee1c0b1cc2add283f3e66cdab0 /tests/ui/consts/const-float-bits-reject-conv.stderr
parentAdding debian version 1.67.1+dfsg1-1. (diff)
downloadrustc-64d98f8ee037282c35007b64c2649055c56af1db.tar.xz
rustc-64d98f8ee037282c35007b64c2649055c56af1db.zip
Merging upstream version 1.68.2+dfsg1.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'tests/ui/consts/const-float-bits-reject-conv.stderr')
-rw-r--r--tests/ui/consts/const-float-bits-reject-conv.stderr115
1 files changed, 115 insertions, 0 deletions
diff --git a/tests/ui/consts/const-float-bits-reject-conv.stderr b/tests/ui/consts/const-float-bits-reject-conv.stderr
new file mode 100644
index 000000000..7ad022520
--- /dev/null
+++ b/tests/ui/consts/const-float-bits-reject-conv.stderr
@@ -0,0 +1,115 @@
+error[E0080]: evaluation of constant value failed
+ --> $SRC_DIR/core/src/num/f32.rs:LL:COL
+ |
+ = note: the evaluated program panicked at 'const-eval error: cannot use f32::to_bits on a NaN', $SRC_DIR/core/src/num/f32.rs:LL:COL
+ |
+note: inside `core::f32::<impl f32>::to_bits::ct_f32_to_u32`
+ --> $SRC_DIR/core/src/num/f32.rs:LL:COL
+note: inside `core::f32::<impl f32>::to_bits`
+ --> $SRC_DIR/core/src/num/f32.rs:LL:COL
+note: inside `f32::MASKED_NAN1`
+ --> $DIR/const-float-bits-reject-conv.rs:28:30
+ |
+LL | const MASKED_NAN1: u32 = f32::NAN.to_bits() ^ 0x002A_AAAA;
+ | ^^^^^^^^^^^^^^^^^^
+ = note: this error originates in the macro `$crate::panic::panic_2021` which comes from the expansion of the macro `panic` (in Nightly builds, run with -Z macro-backtrace for more info)
+
+error[E0080]: evaluation of constant value failed
+ --> $SRC_DIR/core/src/num/f32.rs:LL:COL
+ |
+ = note: the evaluated program panicked at 'const-eval error: cannot use f32::to_bits on a NaN', $SRC_DIR/core/src/num/f32.rs:LL:COL
+ |
+note: inside `core::f32::<impl f32>::to_bits::ct_f32_to_u32`
+ --> $SRC_DIR/core/src/num/f32.rs:LL:COL
+note: inside `core::f32::<impl f32>::to_bits`
+ --> $SRC_DIR/core/src/num/f32.rs:LL:COL
+note: inside `f32::MASKED_NAN2`
+ --> $DIR/const-float-bits-reject-conv.rs:30:30
+ |
+LL | const MASKED_NAN2: u32 = f32::NAN.to_bits() ^ 0x0055_5555;
+ | ^^^^^^^^^^^^^^^^^^
+ = note: this error originates in the macro `$crate::panic::panic_2021` which comes from the expansion of the macro `panic` (in Nightly builds, run with -Z macro-backtrace for more info)
+
+note: erroneous constant used
+ --> $DIR/const-float-bits-reject-conv.rs:35:34
+ |
+LL | const_assert!(f32::from_bits(MASKED_NAN1).is_nan());
+ | ^^^^^^^^^^^
+
+note: erroneous constant used
+ --> $DIR/const-float-bits-reject-conv.rs:36:34
+ |
+LL | const_assert!(f32::from_bits(MASKED_NAN1).is_nan());
+ | ^^^^^^^^^^^
+
+note: erroneous constant used
+ --> $DIR/const-float-bits-reject-conv.rs:42:34
+ |
+LL | const_assert!(f32::from_bits(MASKED_NAN1).to_bits(), MASKED_NAN1);
+ | ^^^^^^^^^^^
+
+note: erroneous constant used
+ --> $DIR/const-float-bits-reject-conv.rs:43:34
+ |
+LL | const_assert!(f32::from_bits(MASKED_NAN2).to_bits(), MASKED_NAN2);
+ | ^^^^^^^^^^^
+
+error[E0080]: evaluation of constant value failed
+ --> $SRC_DIR/core/src/num/f64.rs:LL:COL
+ |
+ = note: the evaluated program panicked at 'const-eval error: cannot use f64::to_bits on a NaN', $SRC_DIR/core/src/num/f64.rs:LL:COL
+ |
+note: inside `core::f64::<impl f64>::to_bits::ct_f64_to_u64`
+ --> $SRC_DIR/core/src/num/f64.rs:LL:COL
+note: inside `core::f64::<impl f64>::to_bits`
+ --> $SRC_DIR/core/src/num/f64.rs:LL:COL
+note: inside `f64::MASKED_NAN1`
+ --> $DIR/const-float-bits-reject-conv.rs:50:30
+ |
+LL | const MASKED_NAN1: u64 = f64::NAN.to_bits() ^ 0x000A_AAAA_AAAA_AAAA;
+ | ^^^^^^^^^^^^^^^^^^
+ = note: this error originates in the macro `$crate::panic::panic_2021` which comes from the expansion of the macro `panic` (in Nightly builds, run with -Z macro-backtrace for more info)
+
+error[E0080]: evaluation of constant value failed
+ --> $SRC_DIR/core/src/num/f64.rs:LL:COL
+ |
+ = note: the evaluated program panicked at 'const-eval error: cannot use f64::to_bits on a NaN', $SRC_DIR/core/src/num/f64.rs:LL:COL
+ |
+note: inside `core::f64::<impl f64>::to_bits::ct_f64_to_u64`
+ --> $SRC_DIR/core/src/num/f64.rs:LL:COL
+note: inside `core::f64::<impl f64>::to_bits`
+ --> $SRC_DIR/core/src/num/f64.rs:LL:COL
+note: inside `f64::MASKED_NAN2`
+ --> $DIR/const-float-bits-reject-conv.rs:52:30
+ |
+LL | const MASKED_NAN2: u64 = f64::NAN.to_bits() ^ 0x0005_5555_5555_5555;
+ | ^^^^^^^^^^^^^^^^^^
+ = note: this error originates in the macro `$crate::panic::panic_2021` which comes from the expansion of the macro `panic` (in Nightly builds, run with -Z macro-backtrace for more info)
+
+note: erroneous constant used
+ --> $DIR/const-float-bits-reject-conv.rs:57:34
+ |
+LL | const_assert!(f64::from_bits(MASKED_NAN1).is_nan());
+ | ^^^^^^^^^^^
+
+note: erroneous constant used
+ --> $DIR/const-float-bits-reject-conv.rs:58:34
+ |
+LL | const_assert!(f64::from_bits(MASKED_NAN1).is_nan());
+ | ^^^^^^^^^^^
+
+note: erroneous constant used
+ --> $DIR/const-float-bits-reject-conv.rs:61:34
+ |
+LL | const_assert!(f64::from_bits(MASKED_NAN1).to_bits(), MASKED_NAN1);
+ | ^^^^^^^^^^^
+
+note: erroneous constant used
+ --> $DIR/const-float-bits-reject-conv.rs:62:34
+ |
+LL | const_assert!(f64::from_bits(MASKED_NAN2).to_bits(), MASKED_NAN2);
+ | ^^^^^^^^^^^
+
+error: aborting due to 4 previous errors
+
+For more information about this error, try `rustc --explain E0080`.