-
Notifications
You must be signed in to change notification settings - Fork 12.6k
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
Inconsistency between Display and IntoIterator for a TokenStream containing a module #47627
Comments
I believe this is the same as #48644 as @dtolnay points out, and I've got some more explanation below that. For this, however, there's the question of which representation is correct? Is |
I think, that whatever it is, the effect of annotation of I also think, that annotation of modules WITH their content is an important feature, but my opinion could be biased since I'm the author of a crate, which uses this. |
Since |
The following crate reproduces the issue. Given an attribute macro on a mod item like
#[...] mod module;
, iterating over the tokens of the TokenStream producesmod module;
but invoking to_string() on the TokenStream producesmod module { /* the contents */ }
. I don't know which one is correct but they should be consistent.@jseyfried
Cargo.toml
src/main.rs
src/module.rs
src/lib.rs
Output
The text was updated successfully, but these errors were encountered: