rust/tests/ui/dyn-star/enum-cast.rs
2024-09-24 22:17:55 +02:00

19 lines
310 B
Rust

//@ check-pass
// This used to ICE, because the compiler confused a pointer-like to dyn* coercion
// with a c-like enum to integer cast.
#![feature(dyn_star)]
#![expect(incomplete_features)]
enum E {
Num(usize),
}
trait Trait {}
impl Trait for E {}
fn main() {
let _ = E::Num(42) as dyn* Trait;
}