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

Tracking issue for splitting Show into String and Show (RFC 504) #20013

Closed
aturon opened this issue Dec 19, 2014 · 9 comments
Closed

Tracking issue for splitting Show into String and Show (RFC 504) #20013

aturon opened this issue Dec 19, 2014 · 9 comments
Labels
B-RFC-approved Blocker: Approved by a merged RFC but not yet implemented.

Comments

@aturon
Copy link
Member

aturon commented Dec 19, 2014

rust-lang/rfcs#504

@aturon aturon added A-libs B-RFC-approved Blocker: Approved by a merged RFC but not yet implemented. labels Dec 19, 2014
@aturon
Copy link
Member Author

aturon commented Dec 19, 2014

cc @alexcrichton

@seanmonstar
Copy link
Contributor

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.

@alexcrichton
Copy link
Member

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 :?, make a snapshot, and then make all the changes (may make it easier), but I'm also more than willing to review changes!

alexcrichton added a commit to alexcrichton/rust that referenced this issue Dec 21, 2014
First step of rust-lang#20013. This will allow (after a snapshot) to change all the debug strings from `{}` to `{:?}`.

r? @alexcrichton
@alexcrichton
Copy link
Member

ping @seanmonstar, I think that the :? syntax is in a snapshot now, so we should be ready to go with this! If you're busy though, I can certainly take over too :)

@seanmonstar
Copy link
Contributor

I've been tackling this. Finally getting stage2 compiling.

On Mon, Dec 29, 2014, 8:18 PM Alex Crichton notifications@github.com
wrote:

ping @seanmonstar https://github.com/seanmonstar, I think that the :?
syntax is in a snapshot now, so we should be ready to go with this! If
you're busy though, I can certainly take over too :)


Reply to this email directly or view it on GitHub
#20013 (comment).

@seanmonstar
Copy link
Contributor

I've been developing with --enable-local-rust, but just tried without it, and it seems the latest snapshot was just before #20080 landed: compare

@alexcrichton
Copy link
Member

Ah, so close! Hopefully we'll have a new snapshot soon...

seanmonstar added a commit to seanmonstar/rust that referenced this issue Jan 6, 2015
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]
@sfackler
Copy link
Member

Should this be closed?

@aturon
Copy link
Member Author

aturon commented Jan 10, 2015

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.

@aturon aturon closed this as completed Jan 10, 2015
alkor added a commit to alkor/rust-http that referenced this issue Jan 11, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
B-RFC-approved Blocker: Approved by a merged RFC but not yet implemented.
Projects
None yet
Development

No branches or pull requests

4 participants