rust/tests/ui/feature-gates/feature-gate-trait_upcasting.rs
2024-01-22 14:24:31 +00:00

14 lines
209 B
Rust

trait Foo {}
trait Bar: Foo {}
impl Foo for () {}
impl Bar for () {}
fn main() {
let bar: &dyn Bar = &();
let foo: &dyn Foo = bar;
//~^ ERROR trait upcasting coercion is experimental [E0658]
}