Skip to content

panic location points to start of call chain instead of expect call #69977

Closed
@est31

Description

@est31

In call chains, the newly stabilized feature to make panics point to useful locations doesn't report the actual call site of the expand/unwrap call, but to the start of the call chain.

    let v = None;
   //v---- reported panic location
    v.map(|x: ()| x)
        .map(|_| ())
      //v---- expected panic location 
        .expect("test");

It should rather point to the expect/unwrap instead. You can have multiple such expects/unwraps in your chain.

Edit: happens on latest nightly as well as on the 1.42.0 stable release.

Metadata

Metadata

Assignees

No one assigned

    Labels

    C-enhancementCategory: An issue proposing an enhancement or a PR with one.F-track_caller`#![feature(track_caller)]`T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions