rust/tests/crashes/126267.rs
Matthias Krüger ff096f83f7 more ice tests
2024-06-16 20:38:08 +02:00

31 lines
529 B
Rust

//@ known-bug: rust-lang/rust#126267
#![feature(transmutability)]
#![crate_type = "lib"]
pub enum ApiError {}
pub struct TokioError {
b: bool,
}
pub enum Error {
Api { source: ApiError },
Ethereum,
Tokio { source: TokioError },
}
mod assert {
use std::mem::BikeshedIntrinsicFrom;
pub fn is_transmutable<Src, Dst>()
where
Dst: BikeshedIntrinsicFrom<Src>, // safety is NOT assumed
{
}
}
fn test() {
struct Src;
type Dst = Error;
assert::is_transmutable::<Src, Dst>();
}