Open
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!