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

Implement Show for Arc<T> #18344

Merged
merged 1 commit into from Oct 28, 2014
Merged

Implement Show for Arc<T> #18344

merged 1 commit into from Oct 28, 2014

Conversation

aochagavia
Copy link
Contributor

Fixes #18299

@@ -147,6 +148,12 @@ impl<T: Send + Sync> Deref<T> for Arc<T> {
}
}

impl<T: Show> Show for Arc<T> {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
(*self).fmt(f)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have a feeling this is infinite recursion, it probably needs to be (**self).fmt(f). Could you add a test too?

@aochagavia
Copy link
Contributor Author

@huonw You were right. I have added a test and amended the commit

alexcrichton added a commit to alexcrichton/rust that referenced this pull request Oct 27, 2014
@bors bors merged commit 79e05e9 into rust-lang:master Oct 28, 2014
@aochagavia aochagavia deleted the show-arc branch October 28, 2014 15:45
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.

Show is not implemented for Arc
3 participants