granite-rust/tests/ui/feature-gates/feature-gate-async-fn-in-dyn-trait.rs
2024-12-10 16:52:20 +00:00

14 lines
317 B
Rust

//@ edition: 2021
trait Foo {
async fn bar(&self);
}
async fn takes_dyn_trait(x: &dyn Foo) {
//~^ ERROR the trait `Foo` cannot be made into an object
x.bar().await;
//~^ ERROR the trait `Foo` cannot be made into an object
//~| ERROR the trait `Foo` cannot be made into an object
}
fn main() {}