Skip to content

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

Closed

Description

@WaffleLapkin

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

Activity

  1. added
    I-prioritizeIssue needs a team member to assess the impact. Will be replaced by P-{low,medium,high,critical}
    and removed
    regression-untriagedUntriaged performance or correctness regression.
    on Dec 1, 2022
  2. apiraino commented on Dec 2, 2022

    @apiraino
    Contributor

    WG-prioritization assigning priority (Zulip discussion).

    @rustbot label -I-prioritize +P-critical

  3. added and removed
    I-prioritizeIssue needs a team member to assess the impact. Will be replaced by P-{low,medium,high,critical}
    on Dec 2, 2022
  4. added a commit that references this issue on Dec 5, 2022
    78cf0b9
  5. added a commit that references this issue on Jan 6, 2023
    d26ac3f
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions