Skip to content

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

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

Closed
bstrie opened this issue Jul 24, 2013 · 0 comments
Closed

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

bstrie opened this issue Jul 24, 2013 · 0 comments
Labels
E-easy Call for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue.

Comments

@bstrie
Copy link
Contributor

bstrie commented Jul 24, 2013

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
E-easy Call for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant