Skip to content

Failing to use derive for nested types parameterized on associated types #31518

Closed
@asajeffrey

Description

@asajeffrey

In this example (https://play.rust-lang.org/?gist=5dde58647c1e97b97f46) there's an error failing to derive Debug for Bang:

pub trait Foo { type Bar; }

#[derive(Debug)]
pub enum Baz<F> where F: Foo { Baz(F::Bar) }

#[derive(Debug)]
pub enum Bang<F> where F: Foo { Bang(Baz<F>) }

The error is error: the traitcore::fmt::Debugis not implemented for the type::Bar[E0277]. It works for Baz, you only get problems when you nest types parameterized on associated types.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions