]> git.lizzy.rs Git - rust.git/blob - tests/ui/span/drop-location-span-error-rust-2021-incompatible-closure-captures-93117.rs
Rollup merge of #106441 - mllken:abstract-socket-noref, r=joshtriplett
[rust.git] / tests / ui / span / drop-location-span-error-rust-2021-incompatible-closure-captures-93117.rs
1 // compile-flags: -Wrust-2021-incompatible-closure-captures
2
3 pub struct A {}
4
5 impl A {
6     async fn create(path: impl AsRef<std::path::Path>)  { //~ ERROR  `async fn` is not permitted in Rust 2015
7     //~^ WARN changes to closure capture in Rust 2021 will affect drop order [rust_2021_incompatible_closure_captures]
8     ;
9     crate(move || {} ).await //~ ERROR expected function, found module `crate`
10     }
11 }
12
13 trait C{async fn new(val: T) {} //~ ERROR  `async fn` is not permitted in Rust 2015
14 //~^ ERROR functions in traits cannot be declared `async`
15 //~| ERROR cannot find type `T` in this scope
16 //~| WARN changes to closure capture in Rust 2021 will affect drop order [rust_2021_incompatible_closure_captures]
17
18 //~ ERROR  this file contains an unclosed delimiter