-
Notifications
You must be signed in to change notification settings - Fork 13.3k
Missing trait Debug for std::time::Instant #31866
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
Comments
Debug doesn't have to be derived. |
But it's not really useful for debugging the code that compares/offsets them a lot. |
I believe this issue is about the Debug implementation for Instant exposing internal API details, but I don't necessarily see that as a bad thing. I think it's somewhat expected that while Debug may print information, the actual output should not be relied upon (i.e., parsing it would not be acceptable). I'm nominating for the libs team since this general question is interesting for the API guidelines discussion: Can/should Debug impls expose internals in order to aid debugging? |
We discussed this at trigae today and concluded:
Patches are of course welcome to help implement this! |
I believe this impl has existed since the very beginning of std::time::Instant -- #29894 contains fn main() {
println!("{:?}", std::time::Instant::now());
} The output is |
Although
, I think Debug may leak internal representation which can include those number of seconds (or some other increasing number).
The text was updated successfully, but these errors were encountered: