diff options
Diffstat (limited to '')
-rw-r--r-- | tests/ui/async-await/track-caller/async-closure-gate.rs | 41 |
1 files changed, 41 insertions, 0 deletions
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 d9d556855..8d8d081aa 100644 --- a/tests/ui/async-await/track-caller/async-closure-gate.rs +++ b/tests/ui/async-await/track-caller/async-closure-gate.rs @@ -1,9 +1,50 @@ // edition:2021 +// revisions: afn nofeat #![feature(async_closure, stmt_expr_attributes)] +#![cfg_attr(afn, feature(async_fn_track_caller))] fn main() { let _ = #[track_caller] async || { //~^ ERROR `#[track_caller]` on closures is currently unstable [E0658] }; } + +#[track_caller] +async fn foo() { + let _ = #[track_caller] async || { + //~^ ERROR `#[track_caller]` on closures is currently unstable [E0658] + }; +} + +async fn foo2() { + let _ = #[track_caller] || { + //~^ ERROR `#[track_caller]` on closures is currently unstable [E0658] + }; +} + +fn foo3() { + async { + let _ = #[track_caller] || { + //~^ ERROR `#[track_caller]` on closures is currently unstable [E0658] + }; + } +} + +async fn foo4() { + let _ = || { + #[track_caller] || { + //~^ ERROR `#[track_caller]` on closures is currently unstable [E0658] + }; + }; +} + +fn foo5() { + async { + let _ = || { + #[track_caller] || { + //~^ ERROR `#[track_caller]` on closures is currently unstable [E0658] + }; + }; + } +} |