Filter stdlib out of stack traces #25621
Labels
A-diagnostics
Area: Messages for errors, warnings, and lints
C-feature-request
Category: A feature request, i.e: not implemented / a PR.
T-compiler
Relevant to the compiler team, which will review and decide on the PR/issue.
Stack traces would be much easier to digest if the lines from stdlib were removed before being printed to the user. For example, take this output from calling
option.unwrap
on aNone
value in a test from a project I'm working on:While it may be accurate, what I want as a programmer is to know what part of my code caused the exception. The error message only tells me about the implementation of the Option type, and I have to dig through a stack trace of stuff from the stdlib to find the line that tells me it came from tests/client_test.rs:62 in my code.
I talked with @wycats about this briefly at the Rust 1.0 launch party and he agreed that we probably need something akin to
ActiveSupport::BacktraceCleaner
from Rails.This might actually be two issues – one is that the error message should show the line in my code where the unwrap happened, not the line in option.rs where the panic was actually triggered, and the other is the filtering of lines in the stack trace. Let me know if I should split part of this off into a separate issue.
The text was updated successfully, but these errors were encountered: