summaryrefslogtreecommitdiffstats
path: root/src/test/ui/span/drop-location-span-error-rust-2021-incompatible-closure-captures-93117.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/test/ui/span/drop-location-span-error-rust-2021-incompatible-closure-captures-93117.rs')
-rw-r--r--src/test/ui/span/drop-location-span-error-rust-2021-incompatible-closure-captures-93117.rs18
1 files changed, 18 insertions, 0 deletions
diff --git a/src/test/ui/span/drop-location-span-error-rust-2021-incompatible-closure-captures-93117.rs b/src/test/ui/span/drop-location-span-error-rust-2021-incompatible-closure-captures-93117.rs
new file mode 100644
index 000000000..b280c8ab6
--- /dev/null
+++ b/src/test/ui/span/drop-location-span-error-rust-2021-incompatible-closure-captures-93117.rs
@@ -0,0 +1,18 @@
+// compile-flags: -Wrust-2021-incompatible-closure-captures
+
+pub struct A {}
+
+impl A {
+ async fn create(path: impl AsRef<std::path::Path>) { //~ ERROR `async fn` is not permitted in Rust 2015
+ //~^ WARN changes to closure capture in Rust 2021 will affect drop order [rust_2021_incompatible_closure_captures]
+ ;
+ crate(move || {} ).await //~ ERROR expected function, found module `crate`
+ }
+}
+
+trait C{async fn new(val: T) {} //~ ERROR `async fn` is not permitted in Rust 2015
+//~^ ERROR functions in traits cannot be declared `async`
+//~^^ ERROR cannot find type `T` in this scope
+//~^^^ WARN changes to closure capture in Rust 2021 will affect drop order [rust_2021_incompatible_closure_captures]
+
+//~ ERROR this file contains an unclosed delimiter