diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-17 12:18:58 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-17 12:18:58 +0000 |
commit | a4b7ed7a42c716ab9f05e351f003d589124fd55d (patch) | |
tree | b620cd3f223850b28716e474e80c58059dca5dd4 /src/test/mir-opt/const_prop/invalid_constant.rs | |
parent | Adding upstream version 1.67.1+dfsg1. (diff) | |
download | rustc-a4b7ed7a42c716ab9f05e351f003d589124fd55d.tar.xz rustc-a4b7ed7a42c716ab9f05e351f003d589124fd55d.zip |
Adding upstream version 1.68.2+dfsg1.upstream/1.68.2+dfsg1
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'src/test/mir-opt/const_prop/invalid_constant.rs')
-rw-r--r-- | src/test/mir-opt/const_prop/invalid_constant.rs | 42 |
1 files changed, 0 insertions, 42 deletions
diff --git a/src/test/mir-opt/const_prop/invalid_constant.rs b/src/test/mir-opt/const_prop/invalid_constant.rs deleted file mode 100644 index 0337a7ca8..000000000 --- a/src/test/mir-opt/const_prop/invalid_constant.rs +++ /dev/null @@ -1,42 +0,0 @@ -// Verify that we can pretty print invalid constants. - -#![feature(adt_const_params)] -#![feature(inline_const)] -#![allow(incomplete_features)] - -#[derive(Copy, Clone)] -#[repr(u32)] -enum E { A, B, C } - -#[derive(Copy, Clone)] -enum Empty {} - -// EMIT_MIR invalid_constant.main.ConstProp.diff -fn main() { - // An invalid char. - union InvalidChar { - int: u32, - chr: char, - } - let _invalid_char = unsafe { InvalidChar { int: 0x110001 }.chr }; - - // An enum with an invalid tag. Regression test for #93688. - union InvalidTag { - int: u32, - e: E, - } - let _invalid_tag = [unsafe { InvalidTag { int: 4 }.e }]; - - // An enum without variants. Regression test for #94073. - union NoVariants { - int: u32, - empty: Empty, - } - let _enum_without_variants = [unsafe { NoVariants { int: 0 }.empty }]; - - // A non-UTF-8 string slice. Regression test for #75763 and #78520. - struct Str<const S: &'static str>; - let _non_utf8_str: Str::<{ - unsafe { std::mem::transmute::<&[u8], &str>(&[0xC0, 0xC1, 0xF5]) } - }>; -} |