rust/tests/crashes/126966.rs

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

30 lines
427 B
Rust
Raw Normal View History

2024-07-04 16:44:10 -05:00
//@ known-bug: rust-lang/rust#126966
mod assert {
use std::mem::{Assume, BikeshedIntrinsicFrom};
pub fn is_transmutable<Src, Dst>()
where
Dst: BikeshedIntrinsicFrom<Src>,
{
}
}
#[repr(u32)]
enum Ox00 {
V = 0x00,
}
#[repr(C, packed(2))]
enum OxFF {
V = 0xFF,
}
fn test() {
union Superset {
a: Ox00,
b: OxFF,
}
assert::is_transmutable::<Superset, Subset>();
}