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

derive Debug for distributions? #118

Closed
zackmdavis opened this issue Sep 25, 2016 · 3 comments
Closed

derive Debug for distributions? #118

zackmdavis opened this issue Sep 25, 2016 · 3 comments

Comments

@zackmdavis
Copy link

This surprised me; is there any reason not to follow the standard advice ("should be implemented for all public types"):

src/main.rs:91:22: 91:41 error: the trait bound `rand::distributions::Normal: std::fmt::Debug` is not satisfied [E0277]
src/main.rs:91     println!("{:?}", Normal::new(1., 1.));
@mulkieran
Copy link

That would be nice for me, too. I don't think it would be wrong to just have a simple opaque placeholder, to start, to make it easier for consumers of the library.

zackmdavis added a commit to zackmdavis/rand that referenced this issue Oct 13, 2016
This commit adds derivations of the Debug format trait for our
distributions, as is apparently recommended by the std::fmt
documentation ("fmt::Debug implementations should be implemented for all
public types" —https://doc.rust-lang.org/std/fmt/#fmtdisplay-vs-fmtdebug
).

This is in the matter of rust-random#118.
@pyfisch
Copy link

pyfisch commented Mar 26, 2017

@zackmdavis I think all distributions derive Debug now and this issue should be closed, shouldn't it?

@zackmdavis
Copy link
Author

@pyfisch agree (#137)

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

3 participants