dtolnay/anyhow

Use `#[track_caller]` to provide info on where the error was created

laralove143 opened this issue · 1 comments

Sometimes, backtrace is overkill or it doesn't work well enough (especially in async). This proposal allow a more concise, performant and reliable (although limited) method to provide information about where in the source the error first occurred.

It should be behind a feature flag, like backtrace (though not mutually exclusive). When the feature is enabled, the location should be added to the error's Display, Debug or alternate debug implementation.

PoC: https://play.rust-lang.org/?version=stable&mode=debug&edition=2021&gist=714dd4012caca224f8fc0e17c231bde8

Duplicate of #139.