2022-12-02 11:17:31 -06:00
|
|
|
//@ edition:2021
|
2023-05-30 16:32:29 -05:00
|
|
|
//@ revisions: afn nofeat
|
2022-12-02 11:17:31 -06:00
|
|
|
|
|
|
|
#![feature(async_closure, stmt_expr_attributes)]
|
2023-05-30 16:32:29 -05:00
|
|
|
#![cfg_attr(afn, feature(async_fn_track_caller))]
|
2022-12-02 11:17:31 -06:00
|
|
|
|
|
|
|
fn main() {
|
|
|
|
let _ = #[track_caller] async || {
|
|
|
|
//~^ ERROR `#[track_caller]` on closures is currently unstable [E0658]
|
|
|
|
};
|
|
|
|
}
|
2023-05-30 16:32:29 -05:00
|
|
|
|
|
|
|
#[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 {
|
2023-10-31 08:45:26 -05:00
|
|
|
//~^ ERROR mismatched types
|
2023-05-30 16:32:29 -05:00
|
|
|
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 {
|
2023-10-31 08:45:26 -05:00
|
|
|
//~^ ERROR mismatched types
|
2023-05-30 16:32:29 -05:00
|
|
|
let _ = || {
|
|
|
|
#[track_caller] || {
|
|
|
|
//~^ ERROR `#[track_caller]` on closures is currently unstable [E0658]
|
|
|
|
};
|
|
|
|
};
|
|
|
|
}
|
|
|
|
}
|