summaryrefslogtreecommitdiffstats
path: root/tests/ui/async-await/in-trait/object-safety.rs
blob: a8bc35f7e0c59cfc0ad9944ed6b4ded6bedeb700 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
// edition:2021

#![feature(async_fn_in_trait)]
//~^ WARN the feature `async_fn_in_trait` is incomplete and may not be safe to use and/or cause compiler crashes

trait Foo {
    async fn foo(&self);
}

fn main() {
    let x: &dyn Foo = todo!();
    //~^ ERROR the trait `Foo` cannot be made into an object
}