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

Using println breaks when cargo-expand uses rustfmt #6

Closed
JelteF opened this issue Jan 8, 2017 · 2 comments
Closed

Using println breaks when cargo-expand uses rustfmt #6

JelteF opened this issue Jan 8, 2017 · 2 comments
Labels

Comments

@JelteF
Copy link

JelteF commented Jan 8, 2017

For finding out where I was generating wrongly formatted quotes I used println('{:?}', tokens) to find out what tokens were being generated. Leaving those prints in causes cargo expand to hiccup when rustfmt is in the path, because they are seen as the first part of the code and it's not valid Rust.

error: expected item, found `Tokens`
 --> stdin:1:1
  |
1 | Tokens("MyInt ( self . 0 . add ( rhs . 0 ) )")
  | ^^^^^^

This can be worked around by using RUSTFMT= cargo expand, to disable rustfmt.

@dtolnay
Copy link
Owner

dtolnay commented Jan 13, 2017

Thanks for reporting this! I fixed this in cargo-expand 0.3.6.

@dtolnay dtolnay closed this as completed Jan 13, 2017
@dtolnay dtolnay added the bug label Jan 13, 2017
@JelteF
Copy link
Author

JelteF commented Jan 13, 2017

Great!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants