-
Notifications
You must be signed in to change notification settings - Fork 13.6k
Open
Labels
A-panicArea: Panicking machineryArea: Panicking machineryC-enhancementCategory: An issue proposing an enhancement or a PR with one.Category: An issue proposing an enhancement or a PR with one.F-track_caller`#![feature(track_caller)]``#![feature(track_caller)]`T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.
Description
Putting #[track_caller]
on a fn drop
implementation does not attribute the panic to the code that drops the value. Instead, some location in the standard library is blamed:
struct S;
impl Drop for S {
#[track_caller]
fn drop(&mut self) {
panic!("panicking!");
}
}
fn main() {
let _variable = S;
}
Outputs:
thread 'main' panicked at /rustc/cc66ad468955717ab92600c770da8c1601a4ff33/library/core/src/ptr/mod.rs:497:1:
panicking!
victoryaskevich, fenhl, Zenithsiz, cramertj and LHoltencramertj
Metadata
Metadata
Assignees
Labels
A-panicArea: Panicking machineryArea: Panicking machineryC-enhancementCategory: An issue proposing an enhancement or a PR with one.Category: An issue proposing an enhancement or a PR with one.F-track_caller`#![feature(track_caller)]``#![feature(track_caller)]`T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.