Should Result::from_residual()
be #[track_caller]
?
#89261
Labels
F-track_caller
`#![feature(track_caller)]`
T-libs
Relevant to the library team, which will review and decide on the PR/issue.
I tried this code:
I expected to see this happen: Prints
Err(..., location: <body of square()>)
.Instead, this happened: Prints
Err(..., location: <the guts of libcore>)
.Godbolt: https://godbolt.org/z/s5YaT4Kxn
There is a philosophical question about whether this should work at all. After all, people going in via
into()
would get a location in the guts of convert.rs. I'm definitely curious about what people think... I feel like I'm abusing#[track_caller]
somewhat here, so maybe we don't want to sanction this usage?There's definitely a Pandora's box of stuff here if we do want it to work properly: for example, we would want
Into
to be#[track_caller]
if the correspondingFrom
is, too, but not otherwise!The text was updated successfully, but these errors were encountered: