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

num: Derive Debug for Wrapping #23780

Merged
merged 1 commit into from
Mar 28, 2015
Merged

num: Derive Debug for Wrapping #23780

merged 1 commit into from
Mar 28, 2015

Conversation

ruuda
Copy link
Contributor

@ruuda ruuda commented Mar 27, 2015

This allows Wrapping<T> to be used in assert_eq!, for example.

One of the tests (compile-fail/xc-private-method.rs) fails, but I can hardly imagine it is related to this change. I would also like to add a tests to ensure that assert_eq! compiles and keeps working in the future for Wrapped<T> values, but there appear to be no tests in libcore. What would be a good place to add such a test?

This allows `Wrapping<T>` to be used in `assert_eq!`, for example.
@rust-highfive
Copy link
Collaborator

r? @huonw

(rust_highfive has picked a reviewer for you, use r? to override)

@oli-obk
Copy link
Contributor

oli-obk commented Mar 27, 2015

how does this look rendered? is the inner debug value surrounded by brackets? if so, maybe a custom Debug implementation would be better here

@alexcrichton
Copy link
Member

@bors: r+ 975ebc1

We can always update the representation later if Wrapping(T) is too much to print.

alexcrichton added a commit to alexcrichton/rust that referenced this pull request Mar 27, 2015
This allows `Wrapping<T>` to be used in `assert_eq!`, for example.

One of the tests (compile-fail/xc-private-method.rs) fails, but I can hardly imagine it is related to this change. I would also like to add a tests to ensure that `assert_eq!` compiles and keeps working in the future for `Wrapped<T>` values, but there appear to be no tests in libcore. What would be a good place to add such a test?
@bors bors merged commit 975ebc1 into rust-lang:master Mar 28, 2015
@ruuda ruuda deleted the wrapping branch November 30, 2016 09:59
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

Successfully merging this pull request may close these issues.

6 participants