rust/tests/crashes/127742.rs

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

12 lines
266 B
Rust
Raw Normal View History

2024-07-21 10:50:57 -05:00
//@ 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 };