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

Expand the deriving(ToStr) implementation #7204

Merged
merged 1 commit into from Jun 23, 2013

Conversation

alexcrichton
Copy link
Member

Closes #7180 and #7179.

Before, the deriving(ToStr) attribute was essentially fmt!("%?"). This changes it to recursively invoke to_str() on fields instead of relying on fmt!-style things. This seems more natural to me and what should actually be expected.

@huonw
Copy link
Member

huonw commented Jun 22, 2013

Much better than the old version! Although this should probably also update the section of the manual that says deriving(ToStr) is the same as fmt!("%?", x).

@alexcrichton
Copy link
Member Author

Oh good point! I have noted this now.

bors added a commit that referenced this pull request Jun 23, 2013
Closes #7180 and #7179.

Before, the `deriving(ToStr)` attribute was essentially `fmt!("%?")`. This changes it to recursively invoke `to_str()` on fields instead of relying on `fmt!`-style things. This seems more natural to me and what should actually be expected.
@bors bors closed this Jun 23, 2013
@bors bors merged commit 30d7559 into rust-lang:master Jun 23, 2013
flip1995 pushed a commit to flip1995/rust that referenced this pull request May 27, 2021
Backport of rust-lang#7170 to beta

r? `@ghost`

changelog: none (fixes stack overflow, but this was introduced in this release cycle)

Now actually opened towards the `beta` branch.
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.

#[deriving(ToStr)] handles generics in a surprising manner.
4 participants