diff options
| author | Michael Goulet <michael@errs.io> | 2024-11-06 17:53:59 +0000 |
|---|---|---|
| committer | Michael Goulet <michael@errs.io> | 2024-12-13 00:04:56 +0000 |
| commit | c605c84be8780e8f85379dc35f4567d6c64908d8 (patch) | |
| tree | 1d16f0e7628f7afb02573ff730e21de7c10e3323 /tests/ui/async-await | |
| parent | d4025ee454169fbd22f5773f54348310ab6a47bb (diff) | |
| download | rust-c605c84be8780e8f85379dc35f4567d6c64908d8.tar.gz rust-c605c84be8780e8f85379dc35f4567d6c64908d8.zip | |
Stabilize async closures
Diffstat (limited to 'tests/ui/async-await')
111 files changed, 96 insertions, 277 deletions
diff --git a/tests/ui/async-await/async-borrowck-escaping-closure-error.rs b/tests/ui/async-await/async-borrowck-escaping-closure-error.rs index ffb97ca04ac..4489f344e6f 100644 --- a/tests/ui/async-await/async-borrowck-escaping-closure-error.rs +++ b/tests/ui/async-await/async-borrowck-escaping-closure-error.rs @@ -1,6 +1,5 @@ //@ edition:2018 -#![feature(async_closure)] fn foo() -> Box<dyn std::future::Future<Output = u32>> { let x = 0u32; Box::new((async || x)()) diff --git a/tests/ui/async-await/async-borrowck-escaping-closure-error.stderr b/tests/ui/async-await/async-borrowck-escaping-closure-error.stderr index 4b1ce300b56..967b3bf5a77 100644 --- a/tests/ui/async-await/async-borrowck-escaping-closure-error.stderr +++ b/tests/ui/async-await/async-borrowck-escaping-closure-error.stderr @@ -1,5 +1,5 @@ error[E0515]: cannot return value referencing local variable `x` - --> $DIR/async-borrowck-escaping-closure-error.rs:6:5 + --> $DIR/async-borrowck-escaping-closure-error.rs:5:5 | LL | Box::new((async || x)()) | ^^^^^^^^^------------^^^ diff --git a/tests/ui/async-await/async-closure-matches-expr.rs b/tests/ui/async-await/async-closure-matches-expr.rs index 75ce14a4947..3f1c70e691c 100644 --- a/tests/ui/async-await/async-closure-matches-expr.rs +++ b/tests/ui/async-await/async-closure-matches-expr.rs @@ -1,8 +1,6 @@ //@ build-pass //@ edition:2018 -#![feature(async_closure)] - macro_rules! match_expr { ($x:expr) => {} } diff --git a/tests/ui/async-await/async-closure.rs b/tests/ui/async-await/async-closure.rs index 77c00bbdc9f..3dd88fbf739 100644 --- a/tests/ui/async-await/async-closure.rs +++ b/tests/ui/async-await/async-closure.rs @@ -6,8 +6,6 @@ //@ edition:2018 //@ aux-build:arc_wake.rs -#![feature(async_closure)] - extern crate arc_wake; use std::pin::Pin; diff --git a/tests/ui/async-await/async-closures/ambiguous-arg.rs b/tests/ui/async-await/async-closures/ambiguous-arg.rs index d76a1cf953e..e8e6ff6d97c 100644 --- a/tests/ui/async-await/async-closures/ambiguous-arg.rs +++ b/tests/ui/async-await/async-closures/ambiguous-arg.rs @@ -3,8 +3,6 @@ // Regression test for #123901. We previously ICE'd as we silently // swallowed an in the `ExprUseVisitor`. -#![feature(async_closure)] - pub fn test(test: &u64, temp: &u64) { async |check, a, b| { //~^ ERROR type annotations needed diff --git a/tests/ui/async-await/async-closures/ambiguous-arg.stderr b/tests/ui/async-await/async-closures/ambiguous-arg.stderr index 01f72e94ecc..adb71d676dc 100644 --- a/tests/ui/async-await/async-closures/ambiguous-arg.stderr +++ b/tests/ui/async-await/async-closures/ambiguous-arg.stderr @@ -1,5 +1,5 @@ error[E0282]: type annotations needed - --> $DIR/ambiguous-arg.rs:9:25 + --> $DIR/ambiguous-arg.rs:7:25 | LL | async |check, a, b| { | _________________________^ diff --git a/tests/ui/async-await/async-closures/arg-mismatch.rs b/tests/ui/async-await/async-closures/arg-mismatch.rs index c8dddee6275..f69c8122d1d 100644 --- a/tests/ui/async-await/async-closures/arg-mismatch.rs +++ b/tests/ui/async-await/async-closures/arg-mismatch.rs @@ -1,8 +1,6 @@ //@ aux-build:block-on.rs //@ edition:2021 -#![feature(async_closure)] - extern crate block_on; fn main() { diff --git a/tests/ui/async-await/async-closures/arg-mismatch.stderr b/tests/ui/async-await/async-closures/arg-mismatch.stderr index 70853ae2815..5c8e6650293 100644 --- a/tests/ui/async-await/async-closures/arg-mismatch.stderr +++ b/tests/ui/async-await/async-closures/arg-mismatch.stderr @@ -1,5 +1,5 @@ error[E0308]: mismatched types - --> $DIR/arg-mismatch.rs:12:11 + --> $DIR/arg-mismatch.rs:10:11 | LL | c(2usize).await; | - ^^^^^^ expected `i32`, found `usize` @@ -7,7 +7,7 @@ LL | c(2usize).await; | arguments to this function are incorrect | note: closure parameter defined here - --> $DIR/arg-mismatch.rs:10:24 + --> $DIR/arg-mismatch.rs:8:24 | LL | let c = async |x| {}; | ^ diff --git a/tests/ui/async-await/async-closures/async-fn-mut-for-async-fn.rs b/tests/ui/async-await/async-closures/async-fn-mut-for-async-fn.rs index 8309cfbd58f..e739230fd46 100644 --- a/tests/ui/async-await/async-closures/async-fn-mut-for-async-fn.rs +++ b/tests/ui/async-await/async-closures/async-fn-mut-for-async-fn.rs @@ -2,8 +2,6 @@ //@ edition:2021 //@ run-pass -#![feature(async_closure)] - extern crate block_on; fn main() { diff --git a/tests/ui/async-await/async-closures/async-fn-once-for-async-fn.rs b/tests/ui/async-await/async-closures/async-fn-once-for-async-fn.rs index e7644e3dfe0..078348eb4e6 100644 --- a/tests/ui/async-await/async-closures/async-fn-once-for-async-fn.rs +++ b/tests/ui/async-await/async-closures/async-fn-once-for-async-fn.rs @@ -2,8 +2,6 @@ //@ edition:2021 //@ run-pass -#![feature(async_closure)] - extern crate block_on; fn main() { diff --git a/tests/ui/async-await/async-closures/auxiliary/block-on.rs b/tests/ui/async-await/async-closures/auxiliary/block-on.rs index 8b50c5571c1..4ec45ddf333 100644 --- a/tests/ui/async-await/async-closures/auxiliary/block-on.rs +++ b/tests/ui/async-await/async-closures/auxiliary/block-on.rs @@ -1,7 +1,5 @@ //@ edition: 2021 -#![feature(async_closure)] - use std::future::Future; use std::pin::pin; use std::task::*; diff --git a/tests/ui/async-await/async-closures/auxiliary/foreign.rs b/tests/ui/async-await/async-closures/auxiliary/foreign.rs index 33548a1b30d..935b029a7c5 100644 --- a/tests/ui/async-await/async-closures/auxiliary/foreign.rs +++ b/tests/ui/async-await/async-closures/auxiliary/foreign.rs @@ -1,7 +1,5 @@ //@ edition:2021 -#![feature(async_closure)] - pub fn closure() -> impl AsyncFn() { async || { /* Don't really need to do anything here. */ } } diff --git a/tests/ui/async-await/async-closures/await-inference-guidance.rs b/tests/ui/async-await/async-closures/await-inference-guidance.rs index 1ddc1f8d1c5..f4f91e2e073 100644 --- a/tests/ui/async-await/async-closures/await-inference-guidance.rs +++ b/tests/ui/async-await/async-closures/await-inference-guidance.rs @@ -2,8 +2,6 @@ //@ edition:2021 //@ run-pass -#![feature(async_closure)] - extern crate block_on; fn main() { diff --git a/tests/ui/async-await/async-closures/body-check-on-non-fnmut.rs b/tests/ui/async-await/async-closures/body-check-on-non-fnmut.rs index a72ff8e5dce..0560d3b0867 100644 --- a/tests/ui/async-await/async-closures/body-check-on-non-fnmut.rs +++ b/tests/ui/async-await/async-closures/body-check-on-non-fnmut.rs @@ -2,8 +2,6 @@ //@ edition:2021 //@ build-pass -#![feature(async_closure)] - extern crate block_on; // Make sure that we don't call `coroutine_by_move_body_def_id` query diff --git a/tests/ui/async-await/async-closures/box-deref-in-debuginfo.rs b/tests/ui/async-await/async-closures/box-deref-in-debuginfo.rs index 5ec1c5ee50e..10f7636720c 100644 --- a/tests/ui/async-await/async-closures/box-deref-in-debuginfo.rs +++ b/tests/ui/async-await/async-closures/box-deref-in-debuginfo.rs @@ -2,8 +2,6 @@ //@ edition:2021 //@ run-pass -#![feature(async_closure)] - extern crate block_on; pub trait Trait { diff --git a/tests/ui/async-await/async-closures/brand.rs b/tests/ui/async-await/async-closures/brand.rs index db1f5d271c6..3b13506cf00 100644 --- a/tests/ui/async-await/async-closures/brand.rs +++ b/tests/ui/async-await/async-closures/brand.rs @@ -2,8 +2,6 @@ //@ edition:2021 //@ build-pass -#![feature(async_closure)] - extern crate block_on; use std::future::Future; diff --git a/tests/ui/async-await/async-closures/call-once-deduction.rs b/tests/ui/async-await/async-closures/call-once-deduction.rs index 41d92bc3d78..ed2830a5e82 100644 --- a/tests/ui/async-await/async-closures/call-once-deduction.rs +++ b/tests/ui/async-await/async-closures/call-once-deduction.rs @@ -1,7 +1,7 @@ //@ edition: 2021 //@ check-pass -#![feature(async_closure, async_fn_traits, unboxed_closures)] +#![feature(async_fn_traits, unboxed_closures)] fn bar<F, O>(_: F) where diff --git a/tests/ui/async-await/async-closures/captures.rs b/tests/ui/async-await/async-closures/captures.rs index 2bd4b685997..296fca6cb86 100644 --- a/tests/ui/async-await/async-closures/captures.rs +++ b/tests/ui/async-await/async-closures/captures.rs @@ -5,8 +5,6 @@ // Same as miri's `tests/pass/async-closure-captures.rs`, keep in sync -#![feature(async_closure)] - extern crate block_on; fn main() { diff --git a/tests/ui/async-await/async-closures/clone-closure.rs b/tests/ui/async-await/async-closures/clone-closure.rs index a9e1d6bccc7..b637ab45b9a 100644 --- a/tests/ui/async-await/async-closures/clone-closure.rs +++ b/tests/ui/async-await/async-closures/clone-closure.rs @@ -3,8 +3,6 @@ //@ run-pass //@ check-run-results -#![feature(async_closure)] - extern crate block_on; async fn for_each(f: impl AsyncFnOnce(&str) + Clone) { diff --git a/tests/ui/async-await/async-closures/closure-shim-borrowck-error.rs b/tests/ui/async-await/async-closures/closure-shim-borrowck-error.rs index 4cbbefb0f52..069744a3282 100644 --- a/tests/ui/async-await/async-closures/closure-shim-borrowck-error.rs +++ b/tests/ui/async-await/async-closures/closure-shim-borrowck-error.rs @@ -1,7 +1,5 @@ //@ compile-flags: -Zvalidate-mir --edition=2018 --crate-type=lib -Copt-level=3 -#![feature(async_closure)] - fn main() {} fn needs_fn_mut<T>(mut x: impl FnMut() -> T) { diff --git a/tests/ui/async-await/async-closures/closure-shim-borrowck-error.stderr b/tests/ui/async-await/async-closures/closure-shim-borrowck-error.stderr index bab26c19482..52697bac509 100644 --- a/tests/ui/async-await/async-closures/closure-shim-borrowck-error.stderr +++ b/tests/ui/async-await/async-closures/closure-shim-borrowck-error.stderr @@ -1,5 +1,5 @@ error[E0507]: cannot move out of `x` which is behind a mutable reference - --> $DIR/closure-shim-borrowck-error.rs:12:18 + --> $DIR/closure-shim-borrowck-error.rs:10:18 | LL | needs_fn_mut(async || { | ^^^^^^^^ `x` is moved here @@ -11,7 +11,7 @@ LL | x.hello(); | move occurs because `x` has type `Ty`, which does not implement the `Copy` trait | note: if `Ty` implemented `Clone`, you could clone the value - --> $DIR/closure-shim-borrowck-error.rs:18:1 + --> $DIR/closure-shim-borrowck-error.rs:16:1 | LL | x.hello(); | - you could clone this value diff --git a/tests/ui/async-await/async-closures/constrained-but-no-upvars-yet.rs b/tests/ui/async-await/async-closures/constrained-but-no-upvars-yet.rs index 1acbf0311b3..993f8378439 100644 --- a/tests/ui/async-await/async-closures/constrained-but-no-upvars-yet.rs +++ b/tests/ui/async-await/async-closures/constrained-but-no-upvars-yet.rs @@ -4,8 +4,6 @@ //@ ignore-compare-mode-next-solver (explicit revisions) //@[next] compile-flags: -Znext-solver -#![feature(async_closure)] - fn constrain<T: AsyncFnOnce()>(t: T) -> T { t } diff --git a/tests/ui/async-await/async-closures/debuginfo-by-move-body.rs b/tests/ui/async-await/async-closures/debuginfo-by-move-body.rs index f71cc1ef537..a1d6ce259e2 100644 --- a/tests/ui/async-await/async-closures/debuginfo-by-move-body.rs +++ b/tests/ui/async-await/async-closures/debuginfo-by-move-body.rs @@ -3,8 +3,6 @@ //@ build-pass //@ compile-flags: -Cdebuginfo=2 -#![feature(async_closure)] - extern crate block_on; async fn call_once(f: impl AsyncFnOnce()) { diff --git a/tests/ui/async-await/async-closures/def-path.rs b/tests/ui/async-await/async-closures/def-path.rs index 70450697816..838556966e8 100644 --- a/tests/ui/async-await/async-closures/def-path.rs +++ b/tests/ui/async-await/async-closures/def-path.rs @@ -1,8 +1,6 @@ //@ compile-flags: -Zverbose-internals //@ edition:2021 -#![feature(async_closure)] - fn main() { let x = async || {}; //~^ NOTE the expected `async` closure body diff --git a/tests/ui/async-await/async-closures/def-path.stderr b/tests/ui/async-await/async-closures/def-path.stderr index 0a1e30c1253..cf25b2d2d23 100644 --- a/tests/ui/async-await/async-closures/def-path.stderr +++ b/tests/ui/async-await/async-closures/def-path.stderr @@ -1,5 +1,5 @@ error[E0308]: mismatched types - --> $DIR/def-path.rs:9:9 + --> $DIR/def-path.rs:7:9 | LL | let x = async || {}; | -- the expected `async` closure body diff --git a/tests/ui/async-await/async-closures/different-projection-lengths-for-different-upvars.rs b/tests/ui/async-await/async-closures/different-projection-lengths-for-different-upvars.rs index 2313db506be..d40c9548a3a 100644 --- a/tests/ui/async-await/async-closures/different-projection-lengths-for-different-upvars.rs +++ b/tests/ui/async-await/async-closures/different-projection-lengths-for-different-upvars.rs @@ -2,8 +2,6 @@ //@ edition: 2021 // issue: rust-lang/rust#123697 -#![feature(async_closure)] - struct S { t: i32 } fn test(s: &S, t: &i32) { diff --git a/tests/ui/async-await/async-closures/dont-ice-when-body-tainted-by-errors.rs b/tests/ui/async-await/async-closures/dont-ice-when-body-tainted-by-errors.rs index 8fc9924a12f..f90d10ebe85 100644 --- a/tests/ui/async-await/async-closures/dont-ice-when-body-tainted-by-errors.rs +++ b/tests/ui/async-await/async-closures/dont-ice-when-body-tainted-by-errors.rs @@ -1,7 +1,5 @@ //@ edition: 2021 -#![feature(async_closure)] - struct DropMe; trait Impossible {} diff --git a/tests/ui/async-await/async-closures/dont-ice-when-body-tainted-by-errors.stderr b/tests/ui/async-await/async-closures/dont-ice-when-body-tainted-by-errors.stderr index b4dc3e268bd..c93c1732a22 100644 --- a/tests/ui/async-await/async-closures/dont-ice-when-body-tainted-by-errors.stderr +++ b/tests/ui/async-await/async-closures/dont-ice-when-body-tainted-by-errors.stderr @@ -1,16 +1,16 @@ error[E0277]: the trait bound `(): Impossible` is not satisfied - --> $DIR/dont-ice-when-body-tainted-by-errors.rs:19:23 + --> $DIR/dont-ice-when-body-tainted-by-errors.rs:17:23 | LL | trait_error::<()>(); | ^^ the trait `Impossible` is not implemented for `()` | help: this trait has no implementations, consider adding one - --> $DIR/dont-ice-when-body-tainted-by-errors.rs:7:1 + --> $DIR/dont-ice-when-body-tainted-by-errors.rs:5:1 | LL | trait Impossible {} | ^^^^^^^^^^^^^^^^ note: required by a bound in `trait_error` - --> $DIR/dont-ice-when-body-tainted-by-errors.rs:8:19 + --> $DIR/dont-ice-when-body-tainted-by-errors.rs:6:19 | LL | fn trait_error<T: Impossible>() {} | ^^^^^^^^^^ required by this bound in `trait_error` diff --git a/tests/ui/async-await/async-closures/drop.rs b/tests/ui/async-await/async-closures/drop.rs index 9c99550e3b7..24c182d2c2d 100644 --- a/tests/ui/async-await/async-closures/drop.rs +++ b/tests/ui/async-await/async-closures/drop.rs @@ -3,7 +3,6 @@ //@ run-pass //@ check-run-results -#![feature(async_closure)] #![allow(unused)] extern crate block_on; diff --git a/tests/ui/async-await/async-closures/fn-exception-target-features.rs b/tests/ui/async-await/async-closures/fn-exception-target-features.rs index eb554650b7c..82fc776fd2c 100644 --- a/tests/ui/async-await/async-closures/fn-exception-target-features.rs +++ b/tests/ui/async-await/async-closures/fn-exception-target-features.rs @@ -1,7 +1,7 @@ //@ edition: 2021 //@ only-x86_64 -#![feature(async_closure, target_feature_11)] +#![feature(target_feature_11)] // `target_feature_11` just to test safe functions w/ target features. use std::pin::Pin; diff --git a/tests/ui/async-await/async-closures/fn-exception.rs b/tests/ui/async-await/async-closures/fn-exception.rs index 36cb955cd5c..8ff63983e79 100644 --- a/tests/ui/async-await/async-closures/fn-exception.rs +++ b/tests/ui/async-await/async-closures/fn-exception.rs @@ -1,7 +1,5 @@ //@ edition: 2021 -#![feature(async_closure)] - use std::pin::Pin; use std::future::Future; diff --git a/tests/ui/async-await/async-closures/fn-exception.stderr b/tests/ui/async-await/async-closures/fn-exception.stderr index b3118664c15..aa74ed234df 100644 --- a/tests/ui/async-await/async-closures/fn-exception.stderr +++ b/tests/ui/async-await/async-closures/fn-exception.stderr @@ -1,5 +1,5 @@ error[E0277]: the trait bound `unsafe fn() -> Pin<Box<(dyn Future<Output = ()> + 'static)>> {unsafety}: AsyncFn()` is not satisfied - --> $DIR/fn-exception.rs:19:10 + --> $DIR/fn-exception.rs:17:10 | LL | test(unsafety); | ---- ^^^^^^^^ the trait `AsyncFn()` is not implemented for fn item `unsafe fn() -> Pin<Box<(dyn Future<Output = ()> + 'static)>> {unsafety}` @@ -7,13 +7,13 @@ LL | test(unsafety); | required by a bound introduced by this call | note: required by a bound in `test` - --> $DIR/fn-exception.rs:16:17 + --> $DIR/fn-exception.rs:14:17 | LL | fn test(f: impl AsyncFn()) {} | ^^^^^^^^^ required by this bound in `test` error[E0277]: the trait bound `extern "C" fn() -> Pin<Box<(dyn Future<Output = ()> + 'static)>> {abi}: AsyncFn()` is not satisfied - --> $DIR/fn-exception.rs:20:10 + --> $DIR/fn-exception.rs:18:10 | LL | test(abi); | ---- ^^^ the trait `AsyncFn()` is not implemented for fn item `extern "C" fn() -> Pin<Box<(dyn Future<Output = ()> + 'static)>> {abi}` @@ -21,7 +21,7 @@ LL | test(abi); | required by a bound introduced by this call | note: required by a bound in `test` - --> $DIR/fn-exception.rs:16:17 + --> $DIR/fn-exception.rs:14:17 | LL | fn test(f: impl AsyncFn()) {} | ^^^^^^^^^ required by this bound in `test` diff --git a/tests/ui/async-await/async-closures/force-move-due-to-actually-fnonce.rs b/tests/ui/async-await/async-closures/force-move-due-to-actually-fnonce.rs index 7244a29673b..1347a4b259b 100644 --- a/tests/ui/async-await/async-closures/force-move-due-to-actually-fnonce.rs +++ b/tests/ui/async-await/async-closures/force-move-due-to-actually-fnonce.rs @@ -2,8 +2,6 @@ //@ edition:2021 //@ build-pass -#![feature(async_closure)] - extern crate block_on; fn consume(_: String) {} diff --git a/tests/ui/async-await/async-closures/force-move-due-to-inferred-kind.rs b/tests/ui/async-await/async-closures/force-move-due-to-inferred-kind.rs index c20e3664d8b..c963d282c4e 100644 --- a/tests/ui/async-await/async-closures/force-move-due-to-inferred-kind.rs +++ b/tests/ui/async-await/async-closures/force-move-due-to-inferred-kind.rs @@ -2,8 +2,6 @@ //@ edition:2021 //@ build-pass -#![feature(async_closure)] - extern crate block_on; fn force_fnonce<T: AsyncFnOnce()>(t: T) -> T { t } diff --git a/tests/ui/async-await/async-closures/foreign.rs b/tests/ui/async-await/async-closures/foreign.rs index a244eef4102..b0580a8f09d 100644 --- a/tests/ui/async-await/async-closures/foreign.rs +++ b/tests/ui/async-await/async-closures/foreign.rs @@ -3,8 +3,6 @@ //@ edition:2021 //@ build-pass -#![feature(async_closure)] - use std::future::Future; extern crate block_on; diff --git a/tests/ui/async-await/async-closures/higher-ranked-return.rs b/tests/ui/async-await/async-closures/higher-ranked-return.rs index d6bea5dd103..328c733d42d 100644 --- a/tests/ui/async-await/async-closures/higher-ranked-return.rs +++ b/tests/ui/async-await/async-closures/higher-ranked-return.rs @@ -4,8 +4,6 @@ //@ known-bug: unknown // Borrow checking doesn't like that higher-ranked output... -#![feature(async_closure)] - extern crate block_on; fn main() { diff --git a/tests/ui/async-await/async-closures/higher-ranked-return.stderr b/tests/ui/async-await/async-closures/higher-ranked-return.stderr index 268631f67cd..23ce3df6616 100644 --- a/tests/ui/async-await/async-closures/higher-ranked-return.stderr +++ b/tests/ui/async-await/async-closures/higher-ranked-return.stderr @@ -1,10 +1,10 @@ error: lifetime may not live long enough - --> $DIR/higher-ranked-return.rs:13:46 + --> $DIR/higher-ranked-return.rs:11:46 | LL | let x = async move |x: &str| -> &str { | ________________________________-________----_^ | | | | - | | | return type of async closure `{async closure body@$DIR/higher-ranked-return.rs:13:46: 15:10}` contains a lifetime `'2` + | | | return type of async closure `{async closure body@$DIR/higher-ranked-return.rs:11:46: 13:10}` contains a lifetime `'2` | | let's call the lifetime of this reference `'1` LL | | x LL | | }; diff --git a/tests/ui/async-await/async-closures/higher-ranked.rs b/tests/ui/async-await/async-closures/higher-ranked.rs index 5b34bfce961..28f9df60130 100644 --- a/tests/ui/async-await/async-closures/higher-ranked.rs +++ b/tests/ui/async-await/async-closures/higher-ranked.rs @@ -2,8 +2,6 @@ //@ edition:2021 //@ build-pass -#![feature(async_closure)] - extern crate block_on; fn main() { diff --git a/tests/ui/async-await/async-closures/implements-fnmut.rs b/tests/ui/async-await/async-closures/implements-fnmut.rs index f49d1423c40..a2e31bb9870 100644 --- a/tests/ui/async-await/async-closures/implements-fnmut.rs +++ b/tests/ui/async-await/async-closures/implements-fnmut.rs @@ -7,8 +7,6 @@ // `should_reborrow_from_env_of_parent_coroutine_closure` for more detail for when we // must borrow from the closure env. -#![feature(async_closure)] - fn main() { hello(&Ty); } diff --git a/tests/ui/async-await/async-closures/inline-body.rs b/tests/ui/async-await/async-closures/inline-body.rs index b7d7102c287..3f1b9c26601 100644 --- a/tests/ui/async-await/async-closures/inline-body.rs +++ b/tests/ui/async-await/async-closures/inline-body.rs @@ -6,8 +6,6 @@ // `mir_inliner_callees` for the synthetic by-move coroutine body since // its def-id wasn't previously being considered. -#![feature(async_closure)] - use std::future::Future; use std::pin::pin; use std::task::*; diff --git a/tests/ui/async-await/async-closures/is-fn.rs b/tests/ui/async-await/async-closures/is-fn.rs index 89c3a96bbbe..45c2b6ae342 100644 --- a/tests/ui/async-await/async-closures/is-fn.rs +++ b/tests/ui/async-await/async-closures/is-fn.rs @@ -5,8 +5,6 @@ //@ ignore-compare-mode-next-solver (explicit revisions) //@[next] compile-flags: -Znext-solver -#![feature(async_closure)] - use std::future::Future; extern crate block_on; diff --git a/tests/ui/async-await/async-closures/is-not-fn.rs b/tests/ui/async-await/async-closures/is-not-fn.rs index f877513043d..4acaa5d9809 100644 --- a/tests/ui/async-await/async-closures/is-not-fn.rs +++ b/tests/ui/async-await/async-closures/is-not-fn.rs @@ -1,9 +1,7 @@ //@ edition:2021 -#![feature(async_closure)] - fn main() { fn needs_fn(x: impl FnOnce()) {} needs_fn(async || {}); - //~^ ERROR expected `{async closure@is-not-fn.rs:7:14}` to be a closure that returns `()` + //~^ ERROR expected `{async closure@is-not-fn.rs:5:14}` to be a closure that returns `()` } diff --git a/tests/ui/async-await/async-closures/is-not-fn.stderr b/tests/ui/async-await/async-closures/is-not-fn.stderr index 130746ece67..bc1d5e6e9d1 100644 --- a/tests/ui/async-await/async-closures/is-not-fn.stderr +++ b/tests/ui/async-await/async-closures/is-not-fn.stderr @@ -1,5 +1,5 @@ -error[E0271]: expected `{async closure@is-not-fn.rs:7:14}` to be a closure that returns `()`, but it returns `{async closure body@$DIR/is-not-fn.rs:7:23: 7:25}` - --> $DIR/is-not-fn.rs:7:14 +error[E0271]: expected `{async closure@is-not-fn.rs:5:14}` to be a closure that returns `()`, but it returns `{async closure body@$DIR/is-not-fn.rs:5:23: 5:25}` + --> $DIR/is-not-fn.rs:5:14 | LL | needs_fn(async || {}); | -------- ^^^^^^^^^^^ expected `()`, found `async` closure body @@ -7,9 +7,9 @@ LL | needs_fn(async || {}); | required by a bound introduced by this call | = note: expected unit type `()` - found `async` closure body `{async closure body@$DIR/is-not-fn.rs:7:23: 7:25}` + found `async` closure body `{async closure body@$DIR/is-not-fn.rs:5:23: 5:25}` note: required by a bound in `needs_fn` - --> $DIR/is-not-fn.rs:6:25 + --> $DIR/is-not-fn.rs:4:25 | LL | fn needs_fn(x: impl FnOnce()) {} | ^^^^^^^^ required by this bound in `needs_fn` diff --git a/tests/ui/async-await/async-closures/lint-closure-returning-async-block.rs b/tests/ui/async-await/async-closures/lint-closure-returning-async-block.rs index 3e2ab8321a8..f05d918aef2 100644 --- a/tests/ui/async-await/async-closures/lint-closure-returning-async-block.rs +++ b/tests/ui/async-await/async-closures/lint-closure-returning-async-block.rs @@ -1,6 +1,5 @@ //@ edition: 2021 -#![feature(async_closure)] #![deny(closure_returning_async_block)] fn main() { diff --git a/tests/ui/async-await/async-closures/lint-closure-returning-async-block.stderr b/tests/ui/async-await/async-closures/lint-closure-returning-async-block.stderr index 4c0c4d797d8..287dc52c593 100644 --- a/tests/ui/async-await/async-closures/lint-closure-returning-async-block.stderr +++ b/tests/ui/async-await/async-closures/lint-closure-returning-async-block.stderr @@ -1,11 +1,11 @@ error: closure returning async block can be made into an async closure - --> $DIR/lint-closure-returning-async-block.rs:7:13 + --> $DIR/lint-closure-returning-async-block.rs:6:13 | LL | let x = || async {}; | ^^ ----- this async block can be removed, and the closure can be turned into an async closure | note: the lint level is defined here - --> $DIR/lint-closure-returning-async-block.rs:4:9 + --> $DIR/lint-closure-returning-async-block.rs:3:9 | LL | #![deny(closure_returning_async_block)] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ @@ -16,7 +16,7 @@ LL + let x = async || {}; | error: closure returning async block can be made into an async closure - --> $DIR/lint-closure-returning-async-block.rs:10:13 + --> $DIR/lint-closure-returning-async-block.rs:9:13 | LL | let x = || async move {}; | ^^ ---------- this async block can be removed, and the closure can be turned into an async closure @@ -28,7 +28,7 @@ LL + let x = async || {}; | error: closure returning async block can be made into an async closure - --> $DIR/lint-closure-returning-async-block.rs:13:13 + --> $DIR/lint-closure-returning-async-block.rs:12:13 | LL | let x = move || async move {}; | ^^^^^^^ ---------- this async block can be removed, and the closure can be turned into an async closure @@ -40,7 +40,7 @@ LL + let x = async move || {}; | error: closure returning async block can be made into an async closure - --> $DIR/lint-closure-returning-async-block.rs:16:13 + --> $DIR/lint-closure-returning-async-block.rs:15:13 | LL | let x = move || async {}; | ^^^^^^^ ----- this async block can be removed, and the closure can be turned into an async closure @@ -52,7 +52,7 @@ LL + let x = async move || {}; | error: closure returning async block can be made into an async closure - --> $DIR/lint-closure-returning-async-block.rs:19:13 + --> $DIR/lint-closure-returning-async-block.rs:18:13 | LL | let x = || {{ async {} }}; | ^^ ----- this async block can be removed, and the closure can be turned into an async closure diff --git a/tests/ui/async-await/async-closures/mac-body.rs b/tests/ui/async-await/async-closures/mac-body.rs index a416227c390..51c077ba03f 100644 --- a/tests/ui/async-await/async-closures/mac-body.rs +++ b/tests/ui/async-await/async-closures/mac-body.rs @@ -1,8 +1,6 @@ //@ edition: 2021 //@ check-pass -#![feature(async_closure)] - // Make sure we don't ICE if an async closure has a macro body. // This happened because we were calling walk instead of visit // in the def collector, oops! diff --git a/tests/ui/async-await/async-closures/mangle.rs b/tests/ui/async-await/async-closures/mangle.rs index 1790f369c57..c8e5e52e1b2 100644 --- a/tests/ui/async-await/async-closures/mangle.rs +++ b/tests/ui/async-await/async-closures/mangle.rs @@ -5,8 +5,6 @@ //@[v0] compile-flags: -Csymbol-mangling-version=v0 //@[legacy] compile-flags: -Csymbol-mangling-version=legacy -Zunstable-options -#![feature(async_closure)] - extern crate block_on; use std::future::Future; diff --git a/tests/ui/async-await/async-closures/moro-example.rs b/tests/ui/async-await/async-closures/moro-example.rs index c331b8e5b5e..502b3e1bbf8 100644 --- a/tests/ui/async-await/async-closures/moro-example.rs +++ b/tests/ui/async-await/async-closures/moro-example.rs @@ -1,8 +1,6 @@ //@ check-pass //@ edition: 2021 -#![feature(async_closure)] - use std::future::Future; use std::pin::Pin; use std::{marker::PhantomData, sync::Mutex}; diff --git a/tests/ui/async-await/async-closures/move-consuming-capture.rs b/tests/ui/async-await/async-closures/move-consuming-capture.rs index 17925fc89ba..c833bc7e895 100644 --- a/tests/ui/async-await/async-closures/move-consuming-capture.rs +++ b/tests/ui/async-await/async-closures/move-consuming-capture.rs @@ -1,8 +1,6 @@ //@ aux-build:block-on.rs //@ edition:2021 -#![feature(async_closure)] - extern crate block_on; struct NoCopy; diff --git a/tests/ui/async-await/async-closures/move-consuming-capture.stderr b/tests/ui/async-await/async-closures/move-consuming-capture.stderr index 4ce71ec49d6..e28716ca213 100644 --- a/tests/ui/async-await/async-closures/move-consuming-capture.stderr +++ b/tests/ui/async-await/async-closures/move-consuming-capture.stderr @@ -1,8 +1,8 @@ error[E0382]: use of moved value: `x` - --> $DIR/move-consuming-capture.rs:17:9 + --> $DIR/move-consuming-capture.rs:15:9 | LL | let x = async move || { - | - move occurs because `x` has type `{async closure@$DIR/move-consuming-capture.rs:13:17: 13:30}`, which does not implement the `Copy` trait + | - move occurs because `x` has type `{async closure@$DIR/move-consuming-capture.rs:11:17: 11:30}`, which does not implement the `Copy` trait ... LL | x().await; | --- `x` moved due to this method call diff --git a/tests/ui/async-await/async-closures/move-is-async-fn.rs b/tests/ui/async-await/async-closures/move-is-async-fn.rs index d0e2bc24b52..2cbad0faffc 100644 --- a/tests/ui/async-await/async-closures/move-is-async-fn.rs +++ b/tests/ui/async-await/async-closures/move-is-async-fn.rs @@ -2,7 +2,7 @@ //@ edition:2021 //@ build-pass -#![feature(async_closure, async_fn_traits)] +#![feature(async_fn_traits)] extern crate block_on; diff --git a/tests/ui/async-await/async-closures/move-out-of-ref.rs b/tests/ui/async-await/async-closures/move-out-of-ref.rs index a05447232f6..34389d2d00a 100644 --- a/tests/ui/async-await/async-closures/move-out-of-ref.rs +++ b/tests/ui/async-await/async-closures/move-out-of-ref.rs @@ -1,8 +1,6 @@ //@ compile-flags: -Zvalidate-mir //@ edition: 2021 -#![feature(async_closure)] - // NOT copy. struct Ty; diff --git a/tests/ui/async-await/async-closures/move-out-of-ref.stderr b/tests/ui/async-await/async-closures/move-out-of-ref.stderr index 294905a481d..8a63515a8a9 100644 --- a/tests/ui/async-await/async-closures/move-out-of-ref.stderr +++ b/tests/ui/async-await/async-closures/move-out-of-ref.stderr @@ -1,11 +1,11 @@ error[E0507]: cannot move out of `*x` which is behind a shared reference - --> $DIR/move-out-of-ref.rs:11:9 + --> $DIR/move-out-of-ref.rs:9:9 | LL | *x; | ^^ move occurs because `*x` has type `Ty`, which does not implement the `Copy` trait | note: if `Ty` implemented `Clone`, you could clone the value - --> $DIR/move-out-of-ref.rs:7:1 + --> $DIR/move-out-of-ref.rs:5:1 | LL | struct Ty; | ^^^^^^^^^ consider implementing `Clone` for this type diff --git a/tests/ui/async-await/async-closures/mut-ref-reborrow.rs b/tests/ui/async-await/async-closures/mut-ref-reborrow.rs index c37048398e9..a1a90a1c9ad 100644 --- a/tests/ui/async-await/async-closures/mut-ref-reborrow.rs +++ b/tests/ui/async-await/async-closures/mut-ref-reborrow.rs @@ -5,8 +5,6 @@ //@[e2018] edition:2018 //@[e2021] edition:2021 -#![feature(async_closure)] - extern crate block_on; async fn call_once(f: impl AsyncFnOnce()) { f().await; } diff --git a/tests/ui/async-await/async-closures/mutate.rs b/tests/ui/async-await/async-closures/mutate.rs index 562a7271c66..7c1d8389eac 100644 --- a/tests/ui/async-await/async-closures/mutate.rs +++ b/tests/ui/async-await/async-closures/mutate.rs @@ -2,8 +2,6 @@ //@ edition:2021 //@ run-pass -#![feature(async_closure)] - extern crate block_on; fn main() { diff --git a/tests/ui/async-await/async-closures/no-borrow-from-env.rs b/tests/ui/async-await/async-closures/no-borrow-from-env.rs index 36b10c06dca..ce180631389 100644 --- a/tests/ui/async-await/async-closures/no-borrow-from-env.rs +++ b/tests/ui/async-await/async-closures/no-borrow-from-env.rs @@ -1,8 +1,6 @@ //@ edition: 2021 //@ check-pass -#![feature(async_closure)] - fn outlives<'a>(_: impl Sized + 'a) {} async fn call_once(f: impl AsyncFnOnce()) { diff --git a/tests/ui/async-await/async-closures/non-copy-arg-does-not-force-inner-move.rs b/tests/ui/async-await/async-closures/non-copy-arg-does-not-force-inner-move.rs index cfb50dd5574..0c22ac97265 100644 --- a/tests/ui/async-await/async-closures/non-copy-arg-does-not-force-inner-move.rs +++ b/tests/ui/async-await/async-closures/non-copy-arg-does-not-force-inner-move.rs @@ -2,8 +2,6 @@ //@ edition:2021 //@ build-pass -#![feature(async_closure)] - extern crate block_on; fn wrapper(f: impl Fn(String)) -> impl AsyncFn(String) { diff --git a/tests/ui/async-await/async-closures/not-clone-closure.rs b/tests/ui/async-await/async-closures/not-clone-closure.rs index 2776ce4690f..c96c50e85d8 100644 --- a/tests/ui/async-await/async-closures/not-clone-closure.rs +++ b/tests/ui/async-await/async-closures/not-clone-closure.rs @@ -1,7 +1,5 @@ //@ edition: 2021 -#![feature(async_closure)] - struct NotClonableArg; #[derive(Default)] struct NotClonableReturnType; diff --git a/tests/ui/async-await/async-closures/not-clone-closure.stderr b/tests/ui/async-await/async-closures/not-clone-closure.stderr index c2f963f9b92..a08ee45f970 100644 --- a/tests/ui/async-await/async-closures/not-clone-closure.stderr +++ b/tests/ui/async-await/async-closures/not-clone-closure.stderr @@ -1,12 +1,12 @@ -error[E0277]: the trait bound `NotClonableUpvar: Clone` is not satisfied in `{async closure@$DIR/not-clone-closure.rs:29:21: 29:34}` - --> $DIR/not-clone-closure.rs:32:15 +error[E0277]: the trait bound `NotClonableUpvar: Clone` is not satisfied in `{async closure@$DIR/not-clone-closure.rs:27:21: 27:34}` + --> $DIR/not-clone-closure.rs:30:15 | LL | not_clone.clone(); | ^^^^^ unsatisfied trait bound | - = help: within `{async closure@$DIR/not-clone-closure.rs:29:21: 29:34}`, the trait `Clone` is not implemented for `NotClonableUpvar` + = help: within `{async closure@$DIR/not-clone-closure.rs:27:21: 27:34}`, the trait `Clone` is not implemented for `NotClonableUpvar` note: required because it's used within this closure - --> $DIR/not-clone-closure.rs:29:21 + --> $DIR/not-clone-closure.rs:27:21 | LL | let not_clone = async move || { | ^^^^^^^^^^^^^ diff --git a/tests/ui/async-await/async-closures/not-fn.rs b/tests/ui/async-await/async-closures/not-fn.rs index 5f2d047c3e9..34dd2a22bbb 100644 --- a/tests/ui/async-await/async-closures/not-fn.rs +++ b/tests/ui/async-await/async-closures/not-fn.rs @@ -2,8 +2,6 @@ // FIXME(async_closures): This needs a better error message! -#![feature(async_closure)] - fn main() { fn needs_fn<T>(_: impl FnMut() -> T) {} diff --git a/tests/ui/async-await/async-closures/not-fn.stderr b/tests/ui/async-await/async-closures/not-fn.stderr index 9c40613599a..4b9d2db9a25 100644 --- a/tests/ui/async-await/async-closures/not-fn.stderr +++ b/tests/ui/async-await/async-closures/not-fn.stderr @@ -1,5 +1,5 @@ error: async closure does not implement `FnMut` because it captures state from its environment - --> $DIR/not-fn.rs:11:14 + --> $DIR/not-fn.rs:9:14 | LL | needs_fn(async || { | -------- ^^^^^^^^ @@ -7,7 +7,7 @@ LL | needs_fn(async || { | required by a bound introduced by this call | note: required by a bound in `needs_fn` - --> $DIR/not-fn.rs:8:28 + --> $DIR/not-fn.rs:6:28 | LL | fn needs_fn<T>(_: impl FnMut() -> T) {} | ^^^^^^^^^^^^ required by this bound in `needs_fn` diff --git a/tests/ui/async-await/async-closures/not-lending.rs b/tests/ui/async-await/async-closures/not-lending.rs index 2e5542207cf..7bf2d3ead52 100644 --- a/tests/ui/async-await/async-closures/not-lending.rs +++ b/tests/ui/async-await/async-closures/not-lending.rs @@ -1,8 +1,6 @@ //@ aux-build:block-on.rs //@ edition:2021 -#![feature(async_closure)] - extern crate block_on; // Make sure that we can't make an async closure that evaluates to a self-borrow. diff --git a/tests/ui/async-await/async-closures/not-lending.stderr b/tests/ui/async-await/async-closures/not-lending.stderr index 1713e49b551..f0028129caa 100644 --- a/tests/ui/async-await/async-closures/not-lending.stderr +++ b/tests/ui/async-await/async-closures/not-lending.stderr @@ -1,21 +1,21 @@ error: lifetime may not live long enough - --> $DIR/not-lending.rs:14:42 + --> $DIR/not-lending.rs:12:42 | LL | let x = async move || -> &String { &s }; | ------------------------ ^^^^^^ returning this value requires that `'1` must outlive `'2` | | | - | | return type of async closure `{async closure body@$DIR/not-lending.rs:14:42: 14:48}` contains a lifetime `'2` + | | return type of async closure `{async closure body@$DIR/not-lending.rs:12:42: 12:48}` contains a lifetime `'2` | lifetime `'1` represents this closure's body | = note: closure implements `Fn`, so references to captured variables can't escape the closure error: lifetime may not live long enough - --> $DIR/not-lending.rs:18:31 + --> $DIR/not-lending.rs:16:31 | LL | let x = async move || { &s }; | ------------- ^^^^^^ returning this value requires that `'1` must outlive `'2` | | | - | | return type of async closure `{async closure body@$DIR/not-lending.rs:18:31: 18:37}` contains a lifetime `'2` + | | return type of async closure `{async closure body@$DIR/not-lending.rs:16:31: 16:37}` contains a lifetime `'2` | lifetime `'1` represents this closure's body | = note: closure implements `Fn`, so references to captured variables can't escape the closure diff --git a/tests/ui/async-await/async-closures/once.rs b/tests/ui/async-await/async-closures/once.rs index 7009e0d132f..3cf70e16a12 100644 --- a/tests/ui/async-await/async-closures/once.rs +++ b/tests/ui/async-await/async-closures/once.rs @@ -5,8 +5,6 @@ //@ ignore-compare-mode-next-solver (explicit revisions) //@[next] compile-flags: -Znext-solver -#![feature(async_closure)] - use std::future::Future; extern crate block_on; diff --git a/tests/ui/async-await/async-closures/overlapping-projs.rs b/tests/ui/async-await/async-closures/overlapping-projs.rs index f778534cfe2..c37f24b4ff2 100644 --- a/tests/ui/async-await/async-closures/overlapping-projs.rs +++ b/tests/ui/async-await/async-closures/overlapping-projs.rs @@ -3,8 +3,6 @@ //@ run-pass //@ check-run-results -#![feature(async_closure)] - extern crate block_on; async fn call_once(f: impl AsyncFnOnce()) { diff --git a/tests/ui/async-await/async-closures/precise-captures.rs b/tests/ui/async-await/async-closures/precise-captures.rs index 7dcbf2595f0..638fb67c3a4 100644 --- a/tests/ui/async-await/async-closures/precise-captures.rs +++ b/tests/ui/async-await/async-closures/precise-captures.rs @@ -9,7 +9,6 @@ // force_once - Force the closure mode to `FnOnce`, so exercising what was fixed // in <https://github.com/rust-lang/rust/pull/123350>. -#![feature(async_closure)] #![allow(unused_mut)] extern crate block_on; diff --git a/tests/ui/async-await/async-closures/pretty-async-fn-opaque.rs b/tests/ui/async-await/async-closures/pretty-async-fn-opaque.rs index 2e7cf1b09fd..deae1c9376a 100644 --- a/tests/ui/async-await/async-closures/pretty-async-fn-opaque.rs +++ b/tests/ui/async-await/async-closures/pretty-async-fn-opaque.rs @@ -1,9 +1,5 @@ //@ edition: 2021 -#![feature(async_closure)] - -use std::ops::AsyncFnMut; - fn produce() -> impl AsyncFnMut() -> &'static str { async || "" } diff --git a/tests/ui/async-await/async-closures/pretty-async-fn-opaque.stderr b/tests/ui/async-await/async-closures/pretty-async-fn-opaque.stderr index 863e61eb35a..8bbd9fbec3e 100644 --- a/tests/ui/async-await/async-closures/pretty-async-fn-opaque.stderr +++ b/tests/ui/async-await/async-closures/pretty-async-fn-opaque.stderr @@ -1,5 +1,5 @@ error[E0308]: mismatched types - --> $DIR/pretty-async-fn-opaque.rs:12:18 + --> $DIR/pretty-async-fn-opaque.rs:8:18 | LL | fn produce() -> impl AsyncFnMut() -> &'static str { | --------------------------------- the found opaque type diff --git a/tests/ui/async-await/async-closures/refd.rs b/tests/ui/async-await/async-closures/refd.rs index 8c16ecb1531..ae8a10a530a 100644 --- a/tests/ui/async-await/async-closures/refd.rs +++ b/tests/ui/async-await/async-closures/refd.rs @@ -2,8 +2,6 @@ //@ edition:2021 //@ build-pass -#![feature(async_closure)] - extern crate block_on; struct NoCopy; diff --git a/tests/ui/async-await/async-closures/return-type-mismatch.rs b/tests/ui/async-await/async-closures/return-type-mismatch.rs index 992f033180e..d3b4cb61cdf 100644 --- a/tests/ui/async-await/async-closures/return-type-mismatch.rs +++ b/tests/ui/async-await/async-closures/return-type-mismatch.rs @@ -1,8 +1,6 @@ //@ aux-build:block-on.rs //@ edition:2021 -#![feature(async_closure)] - extern crate block_on; fn main() { diff --git a/tests/ui/async-await/async-closures/return-type-mismatch.stderr b/tests/ui/async-await/async-closures/return-type-mismatch.stderr index 53841f62777..d7675aab953 100644 --- a/tests/ui/async-await/async-closures/return-type-mismatch.stderr +++ b/tests/ui/async-await/async-closures/return-type-mismatch.stderr @@ -1,5 +1,5 @@ error[E0308]: mismatched types - --> $DIR/return-type-mismatch.rs:11:24 + --> $DIR/return-type-mismatch.rs:9:24 | LL | let y: usize = x().await; | ^^^^^^^^^ expected `usize`, found `i32` diff --git a/tests/ui/async-await/async-closures/sig-from-bare-fn.rs b/tests/ui/async-await/async-closures/sig-from-bare-fn.rs index a679471a3b3..72aac140256 100644 --- a/tests/ui/async-await/async-closures/sig-from-bare-fn.rs +++ b/tests/ui/async-await/async-closures/sig-from-bare-fn.rs @@ -5,8 +5,6 @@ // a function that requires the async closure implement `Fn*` but does *not* have // a `Future` bound on the return type. -#![feature(async_closure)] - use std::future::Future; trait TryStream { diff --git a/tests/ui/async-await/async-closures/signature-deduction.rs b/tests/ui/async-await/async-closures/signature-deduction.rs index 4e9a6747f1f..27ec54ba4f9 100644 --- a/tests/ui/async-await/async-closures/signature-deduction.rs +++ b/tests/ui/async-await/async-closures/signature-deduction.rs @@ -1,8 +1,6 @@ //@ build-pass //@ edition: 2021 -#![feature(async_closure)] - async fn foo(x: impl AsyncFn(&str) -> &str) {} fn main() { diff --git a/tests/ui/async-await/async-closures/signature-inference-from-two-part-bound.rs b/tests/ui/async-await/async-closures/signature-inference-from-two-part-bound.rs index 0e2d1ef1208..f66787bd6fc 100644 --- a/tests/ui/async-await/async-closures/signature-inference-from-two-part-bound.rs +++ b/tests/ui/async-await/async-closures/signature-inference-from-two-part-bound.rs @@ -4,8 +4,6 @@ //@ ignore-compare-mode-next-solver (explicit revisions) //@[next] compile-flags: -Znext-solver -#![feature(async_closure)] - use std::future::Future; use std::any::Any; diff --git a/tests/ui/async-await/async-closures/tainted-body-2.rs b/tests/ui/async-await/async-closures/tainted-body-2.rs index 73c6bdc30a0..8314f7e7f96 100644 --- a/tests/ui/async-await/async-closures/tainted-body-2.rs +++ b/tests/ui/async-await/async-closures/tainted-body-2.rs @@ -1,7 +1,5 @@ //@ edition: 2021 -#![feature(async_closure)] - // Ensure that building a by-ref async closure body doesn't ICE when the parent // body is tainted. diff --git a/tests/ui/async-await/async-closures/tainted-body-2.stderr b/tests/ui/async-await/async-closures/tainted-body-2.stderr index 798d47064d9..cffd67b6361 100644 --- a/tests/ui/async-await/async-closures/tainted-body-2.stderr +++ b/tests/ui/async-await/async-closures/tainted-body-2.stderr @@ -1,5 +1,5 @@ error[E0425]: cannot find value `missing` in this scope - --> $DIR/tainted-body-2.rs:9:5 + --> $DIR/tainted-body-2.rs:7:5 | LL | missing; | ^^^^^^^ not found in this scope diff --git a/tests/ui/async-await/async-closures/tainted-body.rs b/tests/ui/async-await/async-closures/tainted-body.rs index e42d9d6e36a..118c0887469 100644 --- a/tests/ui/async-await/async-closures/tainted-body.rs +++ b/tests/ui/async-await/async-closures/tainted-body.rs @@ -1,7 +1,5 @@ //@ edition:2021 -#![feature(async_closure)] - // Don't ICE in ByMove shim builder when MIR body is tainted by writeback errors fn main() { diff --git a/tests/ui/async-await/async-closures/tainted-body.stderr b/tests/ui/async-await/async-closures/tainted-body.stderr index b06a896b81f..617d87e9df2 100644 --- a/tests/ui/async-await/async-closures/tainted-body.stderr +++ b/tests/ui/async-await/async-closures/tainted-body.stderr @@ -1,5 +1,5 @@ error[E0425]: cannot find function `used_fn` in this scope - --> $DIR/tainted-body.rs:9:9 + --> $DIR/tainted-body.rs:7:9 | LL | used_fn(); | ^^^^^^^ not found in this scope diff --git a/tests/ui/async-await/async-closures/truncated-fields-when-imm.rs b/tests/ui/async-await/async-closures/truncated-fields-when-imm.rs index 5c718638d80..7d08cdb91e5 100644 --- a/tests/ui/async-await/async-closures/truncated-fields-when-imm.rs +++ b/tests/ui/async-await/async-closures/truncated-fields-when-imm.rs @@ -1,8 +1,6 @@ //@ edition: 2021 //@ check-pass -#![feature(async_closure)] - pub struct Struct { pub path: String, } diff --git a/tests/ui/async-await/async-closures/validate-synthetic-body.rs b/tests/ui/async-await/async-closures/validate-synthetic-body.rs index 67e683ac08a..3fd7382f7f9 100644 --- a/tests/ui/async-await/async-closures/validate-synthetic-body.rs +++ b/tests/ui/async-await/async-closures/validate-synthetic-body.rs @@ -1,8 +1,6 @@ //@ check-pass //@ edition: 2021 -#![feature(async_closure)] - // Make sure that we don't hit a query cycle when validating // the by-move coroutine body for an async closure. diff --git a/tests/ui/async-await/async-closures/without-precise-captures-we-are-powerless.rs b/tests/ui/async-await/async-closures/without-precise-captures-we-are-powerless.rs index 19f366cc903..19a31d1889b 100644 --- a/tests/ui/async-await/async-closures/without-precise-captures-we-are-powerless.rs +++ b/tests/ui/async-await/async-closures/without-precise-captures-we-are-powerless.rs @@ -4,8 +4,6 @@ // sure that we don't ICE or anything, even if precise closure captures means // that we can't actually borrowck successfully. -#![feature(async_closure)] - fn outlives<'a>(_: impl Sized + 'a) {} async fn call_once(f: impl AsyncFnOnce()) { diff --git a/tests/ui/async-await/async-closures/without-precise-captures-we-are-powerless.stderr b/tests/ui/async-await/async-closures/without-precise-captures-we-are-powerless.stderr index a70aece2dea..be39dbf313b 100644 --- a/tests/ui/async-await/async-closures/without-precise-captures-we-are-powerless.stderr +++ b/tests/ui/async-await/async-closures/without-precise-captures-we-are-powerless.stderr @@ -1,5 +1,5 @@ error[E0597]: `x` does not live long enough - --> $DIR/without-precise-captures-we-are-powerless.rs:16:13 + --> $DIR/without-precise-captures-we-are-powerless.rs:14:13 | LL | fn simple<'a>(x: &'a i32) { | -- lifetime `'a` defined here @@ -13,7 +13,7 @@ LL | } | - `x` dropped here while still borrowed error[E0597]: `c` does not live long enough - --> $DIR/without-precise-captures-we-are-powerless.rs:21:20 + --> $DIR/without-precise-captures-we-are-powerless.rs:19:20 | LL | fn simple<'a>(x: &'a i32) { | -- lifetime `'a` defined here @@ -30,7 +30,7 @@ LL | } | - `c` dropped here while still borrowed error[E0597]: `x` does not live long enough - --> $DIR/without-precise-captures-we-are-powerless.rs:28:13 + --> $DIR/without-precise-captures-we-are-powerless.rs:26:13 | LL | fn through_field<'a>(x: S<'a>) { | -- lifetime `'a` defined here @@ -44,7 +44,7 @@ LL | } | - `x` dropped here while still borrowed error[E0505]: cannot move out of `x` because it is borrowed - --> $DIR/without-precise-captures-we-are-powerless.rs:32:13 + --> $DIR/without-precise-captures-we-are-powerless.rs:30:13 | LL | fn through_field<'a>(x: S<'a>) { | -- lifetime `'a` defined here @@ -58,7 +58,7 @@ LL | let c = async move || { println!("{}", *x.0); }; | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ move out of `x` occurs here error[E0597]: `c` does not live long enough - --> $DIR/without-precise-captures-we-are-powerless.rs:33:20 + --> $DIR/without-precise-captures-we-are-powerless.rs:31:20 | LL | fn through_field<'a>(x: S<'a>) { | -- lifetime `'a` defined here @@ -75,7 +75,7 @@ LL | } | - `c` dropped here while still borrowed error[E0505]: cannot move out of `c` because it is borrowed - --> $DIR/without-precise-captures-we-are-powerless.rs:34:30 + --> $DIR/without-precise-captures-we-are-powerless.rs:32:30 | LL | fn through_field<'a>(x: S<'a>) { | -- lifetime `'a` defined here @@ -91,7 +91,7 @@ LL | outlives::<'a>(call_once(c)); | ^ move out of `c` occurs here error[E0597]: `x` does not live long enough - --> $DIR/without-precise-captures-we-are-powerless.rs:38:13 + --> $DIR/without-precise-captures-we-are-powerless.rs:36:13 | LL | fn through_field_and_ref<'a>(x: &S<'a>) { | -- lifetime `'a` defined here @@ -104,7 +104,7 @@ LL | } | - `x` dropped here while still borrowed error[E0621]: explicit lifetime required in the type of `x` - --> $DIR/without-precise-captures-we-are-powerless.rs:40:20 + --> $DIR/without-precise-captures-we-are-powerless.rs:38:20 | LL | fn through_field_and_ref<'a>(x: &S<'a>) { | ------ help: add explicit lifetime `'a` to the type of `x`: `&'a S<'a>` @@ -113,7 +113,7 @@ LL | outlives::<'a>(call_once(c)); | ^^^^^^^^^^^^ lifetime `'a` required error[E0597]: `c` does not live long enough - --> $DIR/without-precise-captures-we-are-powerless.rs:45:20 + --> $DIR/without-precise-captures-we-are-powerless.rs:43:20 | LL | fn through_field_and_ref_move<'a>(x: &S<'a>) { | -- lifetime `'a` defined here @@ -129,7 +129,7 @@ LL | } | - `c` dropped here while still borrowed error[E0621]: explicit lifetime required in the type of `x` - --> $DIR/without-precise-captures-we-are-powerless.rs:46:20 + --> $DIR/without-precise-captures-we-are-powerless.rs:44:20 | LL | fn through_field_and_ref_move<'a>(x: &S<'a>) { | ------ help: add explicit lifetime `'a` to the type of `x`: `&'a S<'a>` diff --git a/tests/ui/async-await/async-closures/wrong-fn-kind.rs b/tests/ui/async-await/async-closures/wrong-fn-kind.rs index a566b8aa663..2aed6dc6d80 100644 --- a/tests/ui/async-await/async-closures/wrong-fn-kind.rs +++ b/tests/ui/async-await/async-closures/wrong-fn-kind.rs @@ -1,7 +1,5 @@ //@ edition:2021 -#![feature(async_closure)] - fn needs_async_fn(_: impl AsyncFn()) {} fn a() { diff --git a/tests/ui/async-await/async-closures/wrong-fn-kind.stderr b/tests/ui/async-await/async-closures/wrong-fn-kind.stderr index d03b10ca2cc..95f314214cc 100644 --- a/tests/ui/async-await/async-closures/wrong-fn-kind.stderr +++ b/tests/ui/async-await/async-closures/wrong-fn-kind.stderr @@ -1,5 +1,5 @@ error[E0525]: expected a closure that implements the `AsyncFn` trait, but this closure only implements `AsyncFnOnce` - --> $DIR/wrong-fn-kind.rs:17:20 + --> $DIR/wrong-fn-kind.rs:15:20 | LL | needs_async_fn(move || async move { | -------------- -^^^^^^ @@ -14,13 +14,13 @@ LL | | }); | |_____- the requirement to implement `AsyncFn` derives from here | note: required by a bound in `needs_async_fn` - --> $DIR/wrong-fn-kind.rs:5:27 + --> $DIR/wrong-fn-kind.rs:3:27 | LL | fn needs_async_fn(_: impl AsyncFn()) {} | ^^^^^^^^^ required by this bound in `needs_async_fn` error[E0596]: cannot borrow `x` as mutable, as it is a captured variable in a `Fn` closure - --> $DIR/wrong-fn-kind.rs:9:20 + --> $DIR/wrong-fn-kind.rs:7:20 | LL | fn needs_async_fn(_: impl AsyncFn()) {} | -------------- change this to accept `FnMut` instead of `Fn` diff --git a/tests/ui/async-await/async-drop.rs b/tests/ui/async-await/async-drop.rs index d3884680e51..b1af81423ce 100644 --- a/tests/ui/async-await/async-drop.rs +++ b/tests/ui/async-await/async-drop.rs @@ -5,7 +5,7 @@ // please consider modifying miri's async drop test at // `src/tools/miri/tests/pass/async-drop.rs`. -#![feature(async_drop, impl_trait_in_assoc_type, async_closure)] +#![feature(async_drop, impl_trait_in_assoc_type)] #![allow(incomplete_features, dead_code)] //@ edition: 2021 diff --git a/tests/ui/async-await/async-fn/auxiliary/block-on.rs b/tests/ui/async-await/async-fn/auxiliary/block-on.rs index 8b50c5571c1..4ec45ddf333 100644 --- a/tests/ui/async-await/async-fn/auxiliary/block-on.rs +++ b/tests/ui/async-await/async-fn/auxiliary/block-on.rs @@ -1,7 +1,5 @@ //@ edition: 2021 -#![feature(async_closure)] - use std::future::Future; use std::pin::pin; use std::task::*; diff --git a/tests/ui/async-await/async-fn/dyn-pos.rs b/tests/ui/async-await/async-fn/dyn-pos.rs index 129ea282936..d71af1bd53e 100644 --- a/tests/ui/async-await/async-fn/dyn-pos.rs +++ b/tests/ui/async-await/async-fn/dyn-pos.rs @@ -1,7 +1,5 @@ //@ edition:2018 -#![feature(async_closure)] - fn foo(x: &dyn AsyncFn()) {} //~^ ERROR the trait `AsyncFnMut` cannot be made into an object diff --git a/tests/ui/async-await/async-fn/dyn-pos.stderr b/tests/ui/async-await/async-fn/dyn-pos.stderr index aaa8eb2634d..0c901846671 100644 --- a/tests/ui/async-await/async-fn/dyn-pos.stderr +++ b/tests/ui/async-await/async-fn/dyn-pos.stderr @@ -1,5 +1,5 @@ error[E0038]: the trait `AsyncFnMut` cannot be made into an object - --> $DIR/dyn-pos.rs:5:16 + --> $DIR/dyn-pos.rs:3:16 | LL | fn foo(x: &dyn AsyncFn()) {} | ^^^^^^^^^ `AsyncFnMut` cannot be made into an object diff --git a/tests/ui/async-await/async-fn/edition-2015.rs b/tests/ui/async-await/async-fn/edition-2015.rs index 7fc62a8dd93..341b9b10e67 100644 --- a/tests/ui/async-await/async-fn/edition-2015.rs +++ b/tests/ui/async-await/async-fn/edition-2015.rs @@ -3,7 +3,5 @@ fn foo(x: impl async Fn()) -> impl async Fn() { x } //~| ERROR `async` trait bounds are only allowed in Rust 2018 or later //~| ERROR `async` trait bounds are unstable //~| ERROR `async` trait bounds are unstable -//~| ERROR use of unstable library feature `async_closure` -//~| ERROR use of unstable library feature `async_closure` fn main() {} diff --git a/tests/ui/async-await/async-fn/edition-2015.stderr b/tests/ui/async-await/async-fn/edition-2015.stderr index 96fb4c9e979..ca9e64cd1bb 100644 --- a/tests/ui/async-await/async-fn/edition-2015.stderr +++ b/tests/ui/async-await/async-fn/edition-2015.stderr @@ -38,26 +38,6 @@ LL | fn foo(x: impl async Fn()) -> impl async Fn() { x } = note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date = help: use the desugared name of the async trait, such as `AsyncFn` -error[E0658]: use of unstable library feature `async_closure` - --> $DIR/edition-2015.rs:1:42 - | -LL | fn foo(x: impl async Fn()) -> impl async Fn() { x } - | ^^^^ - | - = note: see issue #62290 <https://github.com/rust-lang/rust/issues/62290> for more information - = help: add `#![feature(async_closure)]` to the crate attributes to enable - = note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date - -error[E0658]: use of unstable library feature `async_closure` - --> $DIR/edition-2015.rs:1:22 - | -LL | fn foo(x: impl async Fn()) -> impl async Fn() { x } - | ^^^^ - | - = note: see issue #62290 <https://github.com/rust-lang/rust/issues/62290> for more information - = help: add `#![feature(async_closure)]` to the crate attributes to enable - = note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date - -error: aborting due to 6 previous errors +error: aborting due to 4 previous errors For more information about this error, try `rustc --explain E0658`. diff --git a/tests/ui/async-await/async-fn/higher-ranked-async-fn.rs b/tests/ui/async-await/async-fn/higher-ranked-async-fn.rs index 5d675921028..ac8e0d7c63e 100644 --- a/tests/ui/async-await/async-fn/higher-ranked-async-fn.rs +++ b/tests/ui/async-await/async-fn/higher-ranked-async-fn.rs @@ -5,8 +5,6 @@ //@[next] compile-flags: -Znext-solver //@ build-pass (since it ICEs during mono) -#![feature(async_closure)] - extern crate block_on; use std::future::Future; diff --git a/tests/ui/async-await/async-fn/impl-trait.rs b/tests/ui/async-await/async-fn/impl-trait.rs index 11faf9ac983..f284de8981a 100644 --- a/tests/ui/async-await/async-fn/impl-trait.rs +++ b/tests/ui/async-await/async-fn/impl-trait.rs @@ -1,7 +1,7 @@ //@ edition:2018 //@ check-pass -#![feature(async_closure, type_alias_impl_trait)] +#![feature(type_alias_impl_trait)] type Tait = impl AsyncFn(); fn tait() -> Tait { diff --git a/tests/ui/async-await/async-fn/project.rs b/tests/ui/async-await/async-fn/project.rs index b6068a916ae..8ee50724e4c 100644 --- a/tests/ui/async-await/async-fn/project.rs +++ b/tests/ui/async-await/async-fn/project.rs @@ -4,7 +4,7 @@ //@[next] compile-flags: -Znext-solver //@ check-pass -#![feature(async_closure, unboxed_closures, async_fn_traits)] +#![feature(unboxed_closures, async_fn_traits)] use std::ops::AsyncFn; diff --git a/tests/ui/async-await/async-fn/simple.rs b/tests/ui/async-await/async-fn/simple.rs index 3f15b08560a..89b68e12435 100644 --- a/tests/ui/async-await/async-fn/simple.rs +++ b/tests/ui/async-await/async-fn/simple.rs @@ -2,8 +2,6 @@ //@ edition: 2021 //@ build-pass -#![feature(async_closure)] - extern crate block_on; use std::ops::AsyncFn; diff --git a/tests/ui/async-await/async-fn/sugar.rs b/tests/ui/async-await/async-fn/sugar.rs index 0225b666ac5..d00965ee647 100644 --- a/tests/ui/async-await/async-fn/sugar.rs +++ b/tests/ui/async-await/async-fn/sugar.rs @@ -1,7 +1,7 @@ //@ edition: 2021 //@ check-pass -#![feature(async_closure, async_trait_bounds)] +#![feature(async_trait_bounds)] async fn foo() {} diff --git a/tests/ui/async-await/coroutine-desc.rs b/tests/ui/async-await/coroutine-desc.rs index 9a61c9719db..9a581049107 100644 --- a/tests/ui/async-await/coroutine-desc.rs +++ b/tests/ui/async-await/coroutine-desc.rs @@ -1,5 +1,4 @@ //@ edition:2018 -#![feature(async_closure)] use std::future::Future; async fn one() {} diff --git a/tests/ui/async-await/coroutine-desc.stderr b/tests/ui/async-await/coroutine-desc.stderr index 5434ff3d958..01482a9cb1f 100644 --- a/tests/ui/async-await/coroutine-desc.stderr +++ b/tests/ui/async-await/coroutine-desc.stderr @@ -1,5 +1,5 @@ error[E0308]: mismatched types - --> $DIR/coroutine-desc.rs:10:19 + --> $DIR/coroutine-desc.rs:9:19 | LL | fun(async {}, async {}); | --- -------- ^^^^^^^^ expected `async` block, found a different `async` block @@ -8,12 +8,12 @@ LL | fun(async {}, async {}); | | expected all arguments to be this `async` block type because they need to match the type of this parameter | arguments to this function are incorrect | - = note: expected `async` block `{async block@$DIR/coroutine-desc.rs:10:9: 10:14}` - found `async` block `{async block@$DIR/coroutine-desc.rs:10:19: 10:24}` + = note: expected `async` block `{async block@$DIR/coroutine-desc.rs:9:9: 9:14}` + found `async` block `{async block@$DIR/coroutine-desc.rs:9:19: 9:24}` = note: no two async blocks, even if identical, have the same type = help: consider pinning your async block and casting it to a trait object note: function defined here - --> $DIR/coroutine-desc.rs:8:4 + --> $DIR/coroutine-desc.rs:7:4 | LL | fn fun<F: Future<Output = ()>>(f1: F, f2: F) {} | ^^^ - ----- ----- this parameter needs to match the `async` block type of `f1` @@ -22,7 +22,7 @@ LL | fn fun<F: Future<Output = ()>>(f1: F, f2: F) {} | `f1` and `f2` both reference this parameter `F` error[E0308]: mismatched types - --> $DIR/coroutine-desc.rs:12:16 + --> $DIR/coroutine-desc.rs:11:16 | LL | fun(one(), two()); | --- ----- ^^^^^ expected future, found a different future @@ -33,7 +33,7 @@ LL | fun(one(), two()); = help: consider `await`ing on both `Future`s = note: distinct uses of `impl Trait` result in different opaque types note: function defined here - --> $DIR/coroutine-desc.rs:8:4 + --> $DIR/coroutine-desc.rs:7:4 | LL | fn fun<F: Future<Output = ()>>(f1: F, f2: F) {} | ^^^ - ----- ----- this parameter needs to match the future type of `f1` @@ -42,7 +42,7 @@ LL | fn fun<F: Future<Output = ()>>(f1: F, f2: F) {} | `f1` and `f2` both reference this parameter `F` error[E0308]: mismatched types - --> $DIR/coroutine-desc.rs:14:26 + --> $DIR/coroutine-desc.rs:13:26 | LL | fun((async || {})(), (async || {})()); | --- --------------- ^^^^^^^^^^^^^^^ expected `async` closure body, found a different `async` closure body @@ -51,12 +51,12 @@ LL | fun((async || {})(), (async || {})()); | | expected all arguments to be this `async` closure body type because they need to match the type of this parameter | arguments to this function are incorrect | - = note: expected `async` closure body `{async closure body@$DIR/coroutine-desc.rs:14:19: 14:21}` - found `async` closure body `{async closure body@$DIR/coroutine-desc.rs:14:36: 14:38}` + = note: expected `async` closure body `{async closure body@$DIR/coroutine-desc.rs:13:19: 13:21}` + found `async` closure body `{async closure body@$DIR/coroutine-desc.rs:13:36: 13:38}` = note: no two async blocks, even if identical, have the same type = help: consider pinning your async block and casting it to a trait object note: function defined here - --> $DIR/coroutine-desc.rs:8:4 + --> $DIR/coroutine-desc.rs:7:4 | LL | fn fun<F: Future<Output = ()>>(f1: F, f2: F) {} | ^^^ - ----- ----- this parameter needs to match the `async` closure body type of `f1` diff --git a/tests/ui/async-await/feature-async-closure.rs b/tests/ui/async-await/feature-async-closure.rs deleted file mode 100644 index 15108aa5a33..00000000000 --- a/tests/ui/async-await/feature-async-closure.rs +++ /dev/null @@ -1,8 +0,0 @@ -//@ edition:2018 -// gate-test-async_closure - -fn f() { - let _ = async || {}; //~ ERROR async closures are unstable -} - -fn main() {} diff --git a/tests/ui/async-await/feature-async-closure.stderr b/tests/ui/async-await/feature-async-closure.stderr deleted file mode 100644 index 650500b4890..00000000000 --- a/tests/ui/async-await/feature-async-closure.stderr +++ /dev/null @@ -1,14 +0,0 @@ -error[E0658]: async closures are unstable - --> $DIR/feature-async-closure.rs:5:13 - | -LL | let _ = async || {}; - | ^^^^^ - | - = note: see issue #62290 <https://github.com/rust-lang/rust/issues/62290> for more information - = help: add `#![feature(async_closure)]` to the crate attributes to enable - = note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date - = help: to use an async block, remove the `||`: `async {` - -error: aborting due to 1 previous error - -For more information about this error, try `rustc --explain E0658`. diff --git a/tests/ui/async-await/issue-74072-lifetime-name-annotations.rs b/tests/ui/async-await/issue-74072-lifetime-name-annotations.rs index 58509642b10..f6c9fdd6d68 100644 --- a/tests/ui/async-await/issue-74072-lifetime-name-annotations.rs +++ b/tests/ui/async-await/issue-74072-lifetime-name-annotations.rs @@ -1,5 +1,4 @@ //@ edition:2018 -#![feature(async_closure)] use std::future::Future; // test the quality of annotations giving lifetimes names (`'1`) when async constructs are involved diff --git a/tests/ui/async-await/issue-74072-lifetime-name-annotations.stderr b/tests/ui/async-await/issue-74072-lifetime-name-annotations.stderr index 9d963686dea..e1f268116fc 100644 --- a/tests/ui/async-await/issue-74072-lifetime-name-annotations.stderr +++ b/tests/ui/async-await/issue-74072-lifetime-name-annotations.stderr @@ -1,5 +1,5 @@ error[E0506]: cannot assign to `*x` because it is borrowed - --> $DIR/issue-74072-lifetime-name-annotations.rs:9:5 + --> $DIR/issue-74072-lifetime-name-annotations.rs:8:5 | LL | pub async fn async_fn(x: &mut i32) -> &i32 { | - let's call the lifetime of this reference `'1` @@ -11,7 +11,7 @@ LL | y | - returning this value requires that `*x` is borrowed for `'1` error[E0506]: cannot assign to `*x` because it is borrowed - --> $DIR/issue-74072-lifetime-name-annotations.rs:18:9 + --> $DIR/issue-74072-lifetime-name-annotations.rs:17:9 | LL | (async move || { | - return type of async closure is &'1 i32 @@ -24,12 +24,12 @@ LL | y | - returning this value requires that `*x` is borrowed for `'1` error: lifetime may not live long enough - --> $DIR/issue-74072-lifetime-name-annotations.rs:14:20 + --> $DIR/issue-74072-lifetime-name-annotations.rs:13:20 | LL | (async move || { | ______-------------_^ | | | | - | | | return type of async closure `{async closure body@$DIR/issue-74072-lifetime-name-annotations.rs:14:20: 20:6}` contains a lifetime `'2` + | | | return type of async closure `{async closure body@$DIR/issue-74072-lifetime-name-annotations.rs:13:20: 19:6}` contains a lifetime `'2` | | lifetime `'1` represents this closure's body LL | | LL | | @@ -42,7 +42,7 @@ LL | | })() = note: closure implements `FnMut`, so references to captured variables can't escape the closure error[E0716]: temporary value dropped while borrowed - --> $DIR/issue-74072-lifetime-name-annotations.rs:14:5 + --> $DIR/issue-74072-lifetime-name-annotations.rs:13:5 | LL | pub fn async_closure(x: &mut i32) -> impl Future<Output=&i32> { | - let's call the lifetime of this reference `'1` @@ -60,7 +60,7 @@ LL | } | - temporary value is freed at the end of this statement error[E0506]: cannot assign to `*x` because it is borrowed - --> $DIR/issue-74072-lifetime-name-annotations.rs:28:9 + --> $DIR/issue-74072-lifetime-name-annotations.rs:27:9 | LL | (async move || -> &i32 { | - return type of async closure is &'1 i32 @@ -73,12 +73,12 @@ LL | y | - returning this value requires that `*x` is borrowed for `'1` error: lifetime may not live long enough - --> $DIR/issue-74072-lifetime-name-annotations.rs:24:28 + --> $DIR/issue-74072-lifetime-name-annotations.rs:23:28 | LL | (async move || -> &i32 { | ______---------------------_^ | | | | - | | | return type of async closure `{async closure body@$DIR/issue-74072-lifetime-name-annotations.rs:24:28: 30:6}` contains a lifetime `'2` + | | | return type of async closure `{async closure body@$DIR/issue-74072-lifetime-name-annotations.rs:23:28: 29:6}` contains a lifetime `'2` | | lifetime `'1` represents this closure's body LL | | LL | | @@ -91,7 +91,7 @@ LL | | })() = note: closure implements `FnMut`, so references to captured variables can't escape the closure error[E0716]: temporary value dropped while borrowed - --> $DIR/issue-74072-lifetime-name-annotations.rs:24:5 + --> $DIR/issue-74072-lifetime-name-annotations.rs:23:5 | LL | pub fn async_closure_explicit_return_type(x: &mut i32) -> impl Future<Output=&i32> { | - let's call the lifetime of this reference `'1` @@ -109,7 +109,7 @@ LL | } | - temporary value is freed at the end of this statement error[E0506]: cannot assign to `*x` because it is borrowed - --> $DIR/issue-74072-lifetime-name-annotations.rs:36:9 + --> $DIR/issue-74072-lifetime-name-annotations.rs:35:9 | LL | async move { | - return type of async block is &'1 i32 diff --git a/tests/ui/async-await/issues/issue-62009-2.rs b/tests/ui/async-await/issues/issue-62009-2.rs index f7cba29a747..b660d8a206c 100644 --- a/tests/ui/async-await/issues/issue-62009-2.rs +++ b/tests/ui/async-await/issues/issue-62009-2.rs @@ -1,7 +1,5 @@ //@ edition:2018 -#![feature(async_closure)] - async fn print_dur() {} fn main() { diff --git a/tests/ui/async-await/issues/issue-62009-2.stderr b/tests/ui/async-await/issues/issue-62009-2.stderr index 0004f99f901..9377a02612b 100644 --- a/tests/ui/async-await/issues/issue-62009-2.stderr +++ b/tests/ui/async-await/issues/issue-62009-2.stderr @@ -1,5 +1,5 @@ error[E0728]: `await` is only allowed inside `async` functions and blocks - --> $DIR/issue-62009-2.rs:8:23 + --> $DIR/issue-62009-2.rs:6:23 | LL | fn main() { | --------- this is not `async` diff --git a/tests/ui/async-await/no-params-non-move-async-closure.rs b/tests/ui/async-await/no-params-non-move-async-closure.rs index e9e43b3484a..48651396d25 100644 --- a/tests/ui/async-await/no-params-non-move-async-closure.rs +++ b/tests/ui/async-await/no-params-non-move-async-closure.rs @@ -1,8 +1,6 @@ //@ edition:2018 //@ check-pass -#![feature(async_closure)] - fn main() { let _ = async |x: u8| {}; } diff --git a/tests/ui/async-await/suggest-missing-await-closure.fixed b/tests/ui/async-await/suggest-missing-await-closure.fixed index 1ec3456a265..9ab16d34175 100644 --- a/tests/ui/async-await/suggest-missing-await-closure.fixed +++ b/tests/ui/async-await/suggest-missing-await-closure.fixed @@ -1,8 +1,6 @@ //@ edition:2018 //@ run-rustfix -#![feature(async_closure)] - fn take_u32(_x: u32) {} async fn make_u32() -> u32 { diff --git a/tests/ui/async-await/suggest-missing-await-closure.rs b/tests/ui/async-await/suggest-missing-await-closure.rs index 3a448ad411b..172132fda33 100644 --- a/tests/ui/async-await/suggest-missing-await-closure.rs +++ b/tests/ui/async-await/suggest-missing-await-closure.rs @@ -1,8 +1,6 @@ //@ edition:2018 //@ run-rustfix -#![feature(async_closure)] - fn take_u32(_x: u32) {} async fn make_u32() -> u32 { diff --git a/tests/ui/async-await/suggest-missing-await-closure.stderr b/tests/ui/async-await/suggest-missing-await-closure.stderr index 47af270a03a..002c2024f21 100644 --- a/tests/ui/async-await/suggest-missing-await-closure.stderr +++ b/tests/ui/async-await/suggest-missing-await-closure.stderr @@ -1,5 +1,5 @@ error[E0308]: mismatched types - --> $DIR/suggest-missing-await-closure.rs:16:18 + --> $DIR/suggest-missing-await-closure.rs:14:18 | LL | take_u32(x) | -------- ^ expected `u32`, found future @@ -7,12 +7,12 @@ LL | take_u32(x) | arguments to this function are incorrect | note: calling an async function returns a future - --> $DIR/suggest-missing-await-closure.rs:16:18 + --> $DIR/suggest-missing-await-closure.rs:14:18 | LL | take_u32(x) | ^ note: function defined here - --> $DIR/suggest-missing-await-closure.rs:6:4 + --> $DIR/suggest-missing-await-closure.rs:4:4 | LL | fn take_u32(_x: u32) {} | ^^^^^^^^ ------- diff --git a/tests/ui/async-await/track-caller/async-closure-gate.rs b/tests/ui/async-await/track-caller/async-closure-gate.rs index 4b88255bc36..e72ce2afa45 100644 --- a/tests/ui/async-await/track-caller/async-closure-gate.rs +++ b/tests/ui/async-await/track-caller/async-closure-gate.rs @@ -1,7 +1,7 @@ //@ edition:2021 //@ revisions: afn nofeat -#![feature(async_closure, stmt_expr_attributes)] +#![feature(stmt_expr_attributes)] #![cfg_attr(afn, feature(async_fn_track_caller))] fn main() { diff --git a/tests/ui/async-await/track-caller/panic-track-caller.rs b/tests/ui/async-await/track-caller/panic-track-caller.rs index c693a446eed..bd12bf11d6c 100644 --- a/tests/ui/async-await/track-caller/panic-track-caller.rs +++ b/tests/ui/async-await/track-caller/panic-track-caller.rs @@ -3,7 +3,7 @@ //@ revisions: afn cls nofeat //@ needs-unwind // gate-test-async_fn_track_caller -#![feature(async_closure, stmt_expr_attributes)] +#![feature(stmt_expr_attributes)] #![cfg_attr(afn, feature(async_fn_track_caller))] #![cfg_attr(cls, feature(closure_track_caller))] #![allow(unused)] diff --git a/tests/ui/async-await/try-on-option-in-async.rs b/tests/ui/async-await/try-on-option-in-async.rs index fda848141d3..4822197bf39 100644 --- a/tests/ui/async-await/try-on-option-in-async.rs +++ b/tests/ui/async-await/try-on-option-in-async.rs @@ -1,4 +1,3 @@ -#![feature(async_closure)] //@ edition:2018 fn main() {} diff --git a/tests/ui/async-await/try-on-option-in-async.stderr b/tests/ui/async-await/try-on-option-in-async.stderr index 65f63093728..9e0bb42a697 100644 --- a/tests/ui/async-await/try-on-option-in-async.stderr +++ b/tests/ui/async-await/try-on-option-in-async.stderr @@ -1,5 +1,5 @@ error[E0277]: the `?` operator can only be used in an async block that returns `Result` or `Option` (or another type that implements `FromResidual`) - --> $DIR/try-on-option-in-async.rs:8:10 + --> $DIR/try-on-option-in-async.rs:7:10 | LL | async { | ----- this function should return `Result` or `Option` to accept `?` @@ -10,7 +10,7 @@ LL | x?; = help: the trait `FromResidual<Option<Infallible>>` is not implemented for `{integer}` error[E0277]: the `?` operator can only be used in an async closure that returns `Result` or `Option` (or another type that implements `FromResidual`) - --> $DIR/try-on-option-in-async.rs:17:10 + --> $DIR/try-on-option-in-async.rs:16:10 | LL | let async_closure = async || { | __________________________________- @@ -24,7 +24,7 @@ LL | | }; = help: the trait `FromResidual<Option<Infallible>>` is not implemented for `u32` error[E0277]: the `?` operator can only be used in an async function that returns `Result` or `Option` (or another type that implements `FromResidual`) - --> $DIR/try-on-option-in-async.rs:26:6 + --> $DIR/try-on-option-in-async.rs:25:6 | LL | async fn an_async_function() -> u32 { | _____________________________________- |
