0
0
mirror of https://github.com/rust-lang/rust.git synced 2024-11-28 09:36:05 +01:00
rust/tests/crashes/127742.rs
Matthias Krüger 5ab2e40294 add more tests
2024-07-21 17:50:57 +02:00

12 lines
266 B
Rust

//@ known-bug: #127742
struct Vtable(dyn Cap); // missing lifetime
trait Cap<'a> {}
union Transmute {
t: u64, // ICEs with u64, u128, or usize. Correctly errors with u32.
u: &'static Vtable,
}
const G: &'static Vtable = unsafe { Transmute { t: 1 }.u };