-
Notifications
You must be signed in to change notification settings - Fork 12.8k
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
Tracking issue for splitting Show into String and Show (RFC 504) #20013
Comments
I've been working on this. I have the traits, and many of the important implementations switched. Most debug lines will need to be stage0ed. However, I've been having a heck of a time trying to make a lint to check if a type implements fmt::Show. |
Let's hold off on the lint for now, I'd like to decide on that after we get everything landed first. I was also planning on doing a two phase implementation where we first add parsing support for |
First step of rust-lang#20013. This will allow (after a snapshot) to change all the debug strings from `{}` to `{:?}`. r? @alexcrichton
ping @seanmonstar, I think that the |
I've been tackling this. Finally getting stage2 compiling. On Mon, Dec 29, 2014, 8:18 PM Alex Crichton notifications@github.com
|
Ah, so close! Hopefully we'll have a new snapshot soon... |
fmt::Show is for debugging, and can and should be implemented for all public types. This trait is used with `{:?}` syntax. There still exists #[derive(Show)]. fmt::String is for types that faithfully be represented as a String. Because of this, there is no way to derive fmt::String, all implementations must be purposeful. It is used by the default format syntax, `{}`. This will break most instances of `{}`, since that now requires the type to impl fmt::String. In most cases, replacing `{}` with `{:?}` is the correct fix. Types that were being printed specifically for users should receive a fmt::String implementation to fix this. Part of rust-lang#20013 [breaking-change]
Should this be closed? |
Yes, I think so; we'll probably want to make tweaks with whatever conventions we finalize on, but that can be a separate tracking issue. |
rust-lang/rfcs#504
The text was updated successfully, but these errors were encountered: