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

Reduce duplication in error messages #532

Merged

Commits on Nov 8, 2019

  1. Reduce duplication in error messages

    This commit removes duplication in error messages where the same text
    would show up multiple times in a fully rendered error message.
    
    When using `derive(Error)` when the `#[from]` attribute is used there's
    no need to also render that payload into the error string because the
    `#[from]` establishes a "backtrace" which means that when the full
    context of an error is rendered it will include the `#[from]` in the
    lower frames of the backtrace anyway.
    
    This commit audits the `derive(Error)` implementations to avoid
    duplication in the rendered error messages, ensuring that if `#[from]`
    is used then the `#[from]` field isn't also rendered in the textual
    description.
    alexcrichton committed Nov 8, 2019
    Configuration menu
    Copy the full SHA
    df2dd13 View commit details
    Browse the repository at this point in the history
  2. Search the full error in wast assertions

    Don't just search the top error, but search the whole backtrace by using
    the `{:?}` format instead of `{}`.
    alexcrichton committed Nov 8, 2019
    Configuration menu
    Copy the full SHA
    5dbdb58 View commit details
    Browse the repository at this point in the history