rust/tests/crashes/126966.rs

30 lines
411 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, TransmuteFrom};
2024-07-04 16:44:10 -05:00
pub fn is_transmutable<Src, Dst>()
where
Dst: TransmuteFrom<Src>,
2024-07-04 16:44:10 -05:00
{
}
}
#[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>();
}