Skip to content

Should Display for Error include source? #145561

@stepancheg

Description

@stepancheg

Location (URL)

https://doc.rust-lang.org/std/error/trait.Error.html

Summary

std::error::Error requires Display and has .source().

It is not clear whether Error is supposed to include source in Display.

Libraries like anyhow assume that Display does not print source, the library is popular, so it seems like this is how Display should be done. So would be good to include that in the documentation of Error trait.

This is specification request.

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-docsArea: Documentation for any part of the project, including the compiler, standard library, and toolsT-libs-apiRelevant to the library API team, which will review and decide on the PR/issue.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions