Skip to content

async{} blocks can no longer be used in functions marked as #[track_caller] #105134

New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Closed
WaffleLapkin opened this issue Dec 1, 2022 · 1 comment · Fixed by #105180
Closed

async{} blocks can no longer be used in functions marked as #[track_caller] #105134

WaffleLapkin opened this issue Dec 1, 2022 · 1 comment · Fixed by #105180
Labels
A-async-await Area: Async & Await C-bug Category: This is a bug. P-critical Critical priority regression-from-stable-to-nightly Performance or correctness regression from stable to nightly.

Comments

@WaffleLapkin
Copy link
Member

Code

The following code compiles and works as expected on nightly-2022-11-17 and fails on nightly-2022-11-18:

#[track_caller]
pub fn f() {
    _ = async {};
}
error[E0658]: `#[track_caller]` on closures is currently unstable
 --> src/lib.rs:3:9
  |
3 |     _ = async {};
  |         ^^^^^^^^
  |
  = note: see issue #87417 <https://github.com/rust-lang/rust/issues/87417> for more information
  = help: add `#![feature(closure_track_caller)]` to the crate attributes to enable

(play)

Version it worked on

It most recently worked on: nightly-2022-11-17

Version with regression

rustc --version --verbose:

rustc 1.67.0-nightly (c97b539e4 2022-11-30)
binary: rustc
commit-hash: c97b539e408ea353f4fde2f9251d598291fec421
commit-date: 2022-11-30
host: x86_64-unknown-linux-gnu
release: 1.67.0-nightly
LLVM version: 15.0.4

Similarly to #104588, this is caused by #104219, but this reproduction doesn't even use #[track_caller] on async fn!
btw I've found this b/c users of my crate reported that it doesn't compile anymore, good stuff


@rustbot modify labels: +regression-from-stable-to-nightly -regression-untriaged
cc @bryangarza

@WaffleLapkin WaffleLapkin added C-bug Category: This is a bug. regression-untriaged Untriaged performance or correctness regression. labels Dec 1, 2022
@rustbot rustbot added regression-from-stable-to-nightly Performance or correctness regression from stable to nightly. I-prioritize Issue: Indicates that prioritization has been requested for this issue. and removed regression-untriaged Untriaged performance or correctness regression. labels Dec 1, 2022
@eholk eholk added the A-async-await Area: Async & Await label Dec 1, 2022
@apiraino
Copy link
Contributor

apiraino commented Dec 2, 2022

WG-prioritization assigning priority (Zulip discussion).

@rustbot label -I-prioritize +P-critical

@rustbot rustbot added P-critical Critical priority and removed I-prioritize Issue: Indicates that prioritization has been requested for this issue. labels Dec 2, 2022
@bors bors closed this as completed in 78cf0b9 Dec 6, 2022
Aaron1011 pushed a commit to Aaron1011/rust that referenced this issue Jan 6, 2023
…piler-errors

Use proper HirId for async track_caller attribute check

Fix rust-lang#105134
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
A-async-await Area: Async & Await C-bug Category: This is a bug. P-critical Critical priority regression-from-stable-to-nightly Performance or correctness regression from stable to nightly.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants