rust/tests/ui/feature-gates/feature-gate-async-fn-in-dyn-trait.rs

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

15 lines
293 B
Rust
Raw Normal View History

2024-11-16 20:18:02 +00:00
//@ edition: 2021
trait Foo {
async fn bar(&self);
}
async fn takes_dyn_trait(x: &dyn Foo) {
//~^ ERROR the trait `Foo` is not dyn compatible
2024-11-16 20:18:02 +00:00
x.bar().await;
//~^ ERROR the trait `Foo` is not dyn compatible
//~| ERROR the trait `Foo` is not dyn compatible
2024-11-16 20:18:02 +00:00
}
fn main() {}