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

std::num::Wrapping does not implement std::fmt::Display #33006

Closed
Thiez opened this issue Apr 15, 2016 · 1 comment
Closed

std::num::Wrapping does not implement std::fmt::Display #33006

Thiez opened this issue Apr 15, 2016 · 1 comment

Comments

@Thiez
Copy link
Contributor

Thiez commented Apr 15, 2016

I would expect this to work, and print '1': println!("{}", std::num::Wrapping(1u8));. Instead the compiler informs me:

error: the trait core::fmt::Display is not implemented for the type core::num::Wrapping<u8>

Perhaps Wrapping should implement Display?

@alexcrichton
Copy link
Member

Sounds like a good idea to me!

tbu- added a commit to tbu-/rust that referenced this issue Apr 16, 2016
Also, change the `Debug` implementation to only show the inner value.

Fixes rust-lang#33006.
Manishearth added a commit to Manishearth/rust that referenced this issue Apr 17, 2016
…hton

Implement `Display` and `Hash` for `std::num::Wrapping`

Also, change the `Debug` implementation to only show the inner value.

Fixes rust-lang#33006.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants