rust/tests/crashes/126267.rs

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

31 lines
513 B
Rust
Raw Normal View History

2024-06-16 13:38:08 -05:00
//@ 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::TransmuteFrom;
2024-06-16 13:38:08 -05:00
pub fn is_transmutable<Src, Dst>()
where
Dst: TransmuteFrom<Src>, // safety is NOT assumed
2024-06-16 13:38:08 -05:00
{
}
}
fn test() {
struct Src;
type Dst = Error;
assert::is_transmutable::<Src, Dst>();
}