summaryrefslogtreecommitdiffstats
path: root/src/test/ui/consts/const-eval/const-pointer-values-in-various-types.rs
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-17 12:11:38 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-17 12:13:23 +0000
commit20431706a863f92cb37dc512fef6e48d192aaf2c (patch)
tree2867f13f5fd5437ba628c67d7f87309ccadcd286 /src/test/ui/consts/const-eval/const-pointer-values-in-various-types.rs
parentReleasing progress-linux version 1.65.0+dfsg1-2~progress7.99u1. (diff)
downloadrustc-20431706a863f92cb37dc512fef6e48d192aaf2c.tar.xz
rustc-20431706a863f92cb37dc512fef6e48d192aaf2c.zip
Merging upstream version 1.66.0+dfsg1.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'src/test/ui/consts/const-eval/const-pointer-values-in-various-types.rs')
-rw-r--r--src/test/ui/consts/const-eval/const-pointer-values-in-various-types.rs81
1 files changed, 27 insertions, 54 deletions
diff --git a/src/test/ui/consts/const-eval/const-pointer-values-in-various-types.rs b/src/test/ui/consts/const-eval/const-pointer-values-in-various-types.rs
index f6a5e4d3c..45eed9d84 100644
--- a/src/test/ui/consts/const-eval/const-pointer-values-in-various-types.rs
+++ b/src/test/ui/consts/const-eval/const-pointer-values-in-various-types.rs
@@ -24,118 +24,91 @@ union Nonsense {
fn main() {
const I32_REF_USIZE_UNION: usize = unsafe { Nonsense { int_32_ref: &3 }.u };
- //~^ ERROR any use of this value will cause an error
- //~| WARN this was previously accepted by the compiler but is being phased out
+ //~^ ERROR evaluation of constant value failed
const I32_REF_U8_UNION: u8 = unsafe { Nonsense { int_32_ref: &3 }.uint_8 };
- //~^ ERROR any use of this value will cause an error
- //~| WARN this was previously accepted by the compiler but is being phased out
+ //~^ ERROR evaluation of constant value failed
const I32_REF_U16_UNION: u16 = unsafe { Nonsense { int_32_ref: &3 }.uint_16 };
- //~^ ERROR any use of this value will cause an error
- //~| WARN this was previously accepted by the compiler but is being phased out
+ //~^ ERROR evaluation of constant value failed
const I32_REF_U32_UNION: u32 = unsafe { Nonsense { int_32_ref: &3 }.uint_32 };
- //~^ ERROR any use of this value will cause an error
- //~| WARN this was previously accepted by the compiler but is being phased out
+ //~^ ERROR evaluation of constant value failed
const I32_REF_U64_UNION: u64 = unsafe { Nonsense { int_32_ref: &3 }.uint_64 };
- //~^ ERROR any use of this value will cause an error
- //~| WARN this was previously accepted by the compiler but is being phased out
+ //~^ ERROR evaluation of constant value failed
const I32_REF_U128_UNION: u128 = unsafe { Nonsense { int_32_ref: &3 }.uint_128 };
//~^ ERROR evaluation of constant value failed
//~| uninitialized
const I32_REF_I8_UNION: i8 = unsafe { Nonsense { int_32_ref: &3 }.int_8 };
- //~^ ERROR any use of this value will cause an error
- //~| WARN this was previously accepted by the compiler but is being phased out
+ //~^ ERROR evaluation of constant value failed
const I32_REF_I16_UNION: i16 = unsafe { Nonsense { int_32_ref: &3 }.int_16 };
- //~^ ERROR any use of this value will cause an error
- //~| WARN this was previously accepted by the compiler but is being phased out
+ //~^ ERROR evaluation of constant value failed
const I32_REF_I32_UNION: i32 = unsafe { Nonsense { int_32_ref: &3 }.int_32 };
- //~^ ERROR any use of this value will cause an error
- //~| WARN this was previously accepted by the compiler but is being phased out
+ //~^ ERROR evaluation of constant value failed
const I32_REF_I64_UNION: i64 = unsafe { Nonsense { int_32_ref: &3 }.int_64 };
- //~^ ERROR any use of this value will cause an error
- //~| WARN this was previously accepted by the compiler but is being phased out
+ //~^ ERROR evaluation of constant value failed
const I32_REF_I128_UNION: i128 = unsafe { Nonsense { int_32_ref: &3 }.int_128 };
//~^ ERROR evaluation of constant value failed
//~| uninitialized
const I32_REF_F32_UNION: f32 = unsafe { Nonsense { int_32_ref: &3 }.float_32 };
- //~^ ERROR any use of this value will cause an error
- //~| WARN this was previously accepted by the compiler but is being phased out
+ //~^ ERROR evaluation of constant value failed
const I32_REF_F64_UNION: f64 = unsafe { Nonsense { int_32_ref: &3 }.float_64 };
- //~^ ERROR any use of this value will cause an error
- //~| WARN this was previously accepted by the compiler but is being phased out
+ //~^ ERROR evaluation of constant value failed
const I32_REF_BOOL_UNION: bool = unsafe { Nonsense { int_32_ref: &3 }.truthy_falsey };
- //~^ ERROR any use of this value will cause an error
- //~| WARN this was previously accepted by the compiler but is being phased out
+ //~^ ERROR evaluation of constant value failed
const I32_REF_CHAR_UNION: char = unsafe { Nonsense { int_32_ref: &3 }.character };
- //~^ ERROR any use of this value will cause an error
- //~| WARN this was previously accepted by the compiler but is being phased out
+ //~^ ERROR evaluation of constant value failed
const STR_U8_UNION: u8 = unsafe { Nonsense { stringy: "3" }.uint_8 };
- //~^ ERROR any use of this value will cause an error
- //~| WARN this was previously accepted by the compiler but is being phased out
+ //~^ ERROR evaluation of constant value failed
const STR_U16_UNION: u16 = unsafe { Nonsense { stringy: "3" }.uint_16 };
- //~^ ERROR any use of this value will cause an error
- //~| WARN this was previously accepted by the compiler but is being phased out
+ //~^ ERROR evaluation of constant value failed
const STR_U32_UNION: u32 = unsafe { Nonsense { stringy: "3" }.uint_32 };
- //~^ ERROR any use of this value will cause an error
- //~| WARN this was previously accepted by the compiler but is being phased out
+ //~^ ERROR evaluation of constant value failed
const STR_U64_UNION: u64 = unsafe { Nonsense { stringy: "3" }.uint_64 };
- //~^ ERROR any use of this value will cause an error
- //~| WARN this was previously accepted by the compiler but is being phased out
+ //~^ ERROR evaluation of constant value failed
const STR_U128_UNION: u128 = unsafe { Nonsense { stringy: "3" }.uint_128 };
- //~^ ERROR any use of this value will cause an error
- //~| WARN this was previously accepted by the compiler but is being phased out
+ //~^ ERROR evaluation of constant value failed
const STR_I8_UNION: i8 = unsafe { Nonsense { stringy: "3" }.int_8 };
- //~^ ERROR any use of this value will cause an error
- //~| WARN this was previously accepted by the compiler but is being phased out
+ //~^ ERROR evaluation of constant value failed
const STR_I16_UNION: i16 = unsafe { Nonsense { stringy: "3" }.int_16 };
- //~^ ERROR any use of this value will cause an error
- //~| WARN this was previously accepted by the compiler but is being phased out
+ //~^ ERROR evaluation of constant value failed
const STR_I32_UNION: i32 = unsafe { Nonsense { stringy: "3" }.int_32 };
- //~^ ERROR any use of this value will cause an error
- //~| WARN this was previously accepted by the compiler but is being phased out
+ //~^ ERROR evaluation of constant value failed
const STR_I64_UNION: i64 = unsafe { Nonsense { stringy: "3" }.int_64 };
- //~^ ERROR any use of this value will cause an error
- //~| WARN this was previously accepted by the compiler but is being phased out
+ //~^ ERROR evaluation of constant value failed
const STR_I128_UNION: i128 = unsafe { Nonsense { stringy: "3" }.int_128 };
- //~^ ERROR any use of this value will cause an error
- //~| WARN this was previously accepted by the compiler but is being phased out
+ //~^ ERROR evaluation of constant value failed
const STR_F32_UNION: f32 = unsafe { Nonsense { stringy: "3" }.float_32 };
- //~^ ERROR any use of this value will cause an error
- //~| WARN this was previously accepted by the compiler but is being phased out
+ //~^ ERROR evaluation of constant value failed
const STR_F64_UNION: f64 = unsafe { Nonsense { stringy: "3" }.float_64 };
- //~^ ERROR any use of this value will cause an error
- //~| WARN this was previously accepted by the compiler but is being phased out
+ //~^ ERROR evaluation of constant value failed
const STR_BOOL_UNION: bool = unsafe { Nonsense { stringy: "3" }.truthy_falsey };
- //~^ ERROR any use of this value will cause an error
- //~| WARN this was previously accepted by the compiler but is being phased out
+ //~^ ERROR evaluation of constant value failed
const STR_CHAR_UNION: char = unsafe { Nonsense { stringy: "3" }.character };
- //~^ ERROR any use of this value will cause an error
- //~| WARN this was previously accepted by the compiler but is being phased out
+ //~^ ERROR evaluation of constant value failed
}