Skip to content

printf! behaving inconsistently with a single argument #8094

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

Closed
bluss opened this issue Jul 28, 2013 · 3 comments
Closed

printf! behaving inconsistently with a single argument #8094

bluss opened this issue Jul 28, 2013 · 3 comments
Labels
A-pretty Area: Pretty printing (including `-Z unpretty`) A-syntaxext Area: Syntax extensions

Comments

@bluss
Copy link
Member

bluss commented Jul 28, 2013

With a single argument, printf! goes back to just rendering the %? representation of a value, even if it's a string.

compare these two invocations and their output:

printf!("test\n")
"test\n"

printf!("%s\n", "test")
test
@alexcrichton
Copy link
Member

The cause for this is that fmt!(a) == fmt!("%?", a) (at least that's what it's transformed to). The %? representation makes the string printing weird.

Now that we have a generic printf macro though I agree that this should definitely be addressed.

@catamorphism
Copy link
Contributor

Visiting for triage. Unfortunate, but not a milestone blocker.

@alexcrichton
Copy link
Member

Closing due to being old, printf has been removed and print does not have this behavior.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-pretty Area: Pretty printing (including `-Z unpretty`) A-syntaxext Area: Syntax extensions
Projects
None yet
Development

No branches or pull requests

3 participants