Skip to content

Implement std::error::Error for ()? #25023

@brson

Description

@brson

I ran into an API that returned Result<T, ()>, which seems reasonable, but couldn't convert the error to Box<Error> because

crater-web/main.rs:52:40: 52:52 error: the trait `std::error::Error` is not implemented for the type `()` [E0277]
crater-web/main.rs:52                 let e: Box<StdError> = Box::new(());

Metadata

Metadata

Assignees

No one assigned

    Labels

    C-feature-requestCategory: A feature request, i.e: not implemented / a PR.T-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