Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
laralove143 opened this issue Aug 17, 2023 · 1 comment
Closed

Comments

@laralove143
Copy link

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

@dtolnay
Copy link
Owner

dtolnay commented Aug 17, 2023

Duplicate of #139.

@dtolnay dtolnay closed this as completed Aug 17, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants