rust/tests/ui/feature-gates/feature-gate-trait_upcasting.rs

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

14 lines
209 B
Rust
Raw Normal View History

2021-06-13 05:42:11 -05:00
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]
2021-06-13 05:42:11 -05:00
}