Skip to content

Implement std::num::Zero for bool #8024

Closed
@bstrie

Description

@bstrie

This currently fails:

#[deriving(Zero)]
struct Foo {
    bar: bool
}

fn main() {}
zb.rs:1:11: 1:15 error: failed to find an implementation of trait std::num::Zero for bool
zb.rs:1 #[deriving(Zero)]
                   ^~~~

Without such an implementation, it's impossible to use #[deriving(Zero)] on structs that contain bools. I presume that the proper "zero" value is false.

Metadata

Metadata

Assignees

No one assigned

    Labels

    E-easyCall for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions