]> git.proxmox.com Git - rustc.git/blame - tests/ui/async-await/in-trait/object-safety.rs
New upstream version 1.70.0+dfsg1
[rustc.git] / tests / ui / async-await / in-trait / object-safety.rs
CommitLineData
487cf647 1// edition:2021
353b0b11
FG
2// [next] compile-flags: -Zlower-impl-trait-in-trait-to-assoc-ty
3// revisions: current next
487cf647
FG
4
5#![feature(async_fn_in_trait)]
6//~^ WARN the feature `async_fn_in_trait` is incomplete and may not be safe to use and/or cause compiler crashes
7
8trait Foo {
9 async fn foo(&self);
10}
11
12fn main() {
13 let x: &dyn Foo = todo!();
14 //~^ ERROR the trait `Foo` cannot be made into an object
15}