Skip to content

#[derive_PartialEq] does not work if struct/enum carries a Boxed trait. #24047

Closed
@withoutboats

Description

@withoutboats

http://is.gd/HvndbI

#[derive(PartialEq)]
struct Foo {
    bar: Box<Baz>
}

trait Baz: PartialEq {
    fn quux(&self);
}

Results in a compiler error: cannot move out of borrowed content ... in expansion of #[derive_PartialEq]

It'd be great if the PartialEq derivation were written in such a way that this were possible.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions