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

Implied bounds for transparent attribute #149

merged 2 commits into from Sep 5, 2021

Implied bounds for transparent attribute #149

merged 2 commits into from Sep 5, 2021


Copy link

@dtolnay dtolnay commented Sep 5, 2021

This is the remaining piece of #79.

The field of a transparent variant is required to implement Display and Error (not necessarily 'static), since we delegate those two traits to it.

#[derive(Error, Debug)]
enum MyError<E> {
    Delegate(#[from] E),
// generated

impl<E> Error for MyError<E>
    E: Error,
    Self: Debug + Display;

impl<E> Display for MyError<E>
    E: Display;

impl<E> From<E> for MyError<E>;

@dtolnay dtolnay merged commit 0a1c5bd into master Sep 5, 2021
12 checks passed
@dtolnay dtolnay deleted the bound branch Sep 5, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
None yet
None yet

Successfully merging this pull request may close these issues.

None yet

1 participant