rust/tests/ui/dyn-star/enum-cast.rs

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

19 lines
310 B
Rust
Raw Normal View History

//@ 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;
}