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

[1.38] Regression: proc-macro derive panicked #63896

Closed
petrochenkov opened this issue Aug 25, 2019 · 2 comments · Fixed by #63897
Closed

[1.38] Regression: proc-macro derive panicked #63896

petrochenkov opened this issue Aug 25, 2019 · 2 comments · Fixed by #63897
Assignees
Labels
A-macros Area: All kinds of macros (custom derive, macro_rules!, proc macros, ..) A-pretty Area: Pretty printing (including `-Z unpretty`) regression-from-stable-to-beta Performance or correctness regression from stable to beta. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.

Comments

@petrochenkov
Copy link
Contributor

#63628 (comment)

proc-macro derive panicked

[INFO] [stderr] error: proc-macro derive panicked
[INFO] [stderr]   --> src/lib.rs:11:1
[INFO] [stderr]    |
[INFO] [stderr] 11 | / proc_macro_item_decl! {
[INFO] [stderr] 12 | |     /// Generates a default blanket impl for a generic trait that gets passed into
[INFO] [stderr] 13 | |     /// `autoimpl!`, with the same type parameters and type bounds as its trait.
[INFO] [stderr] 14 | |     ///
[INFO] [stderr] ...  |
[INFO] [stderr] 44 | |     autoimpl! => generate_auto_impl_impl
[INFO] [stderr] 45 | | }
[INFO] [stderr]    | |_^
[INFO] [stderr]    |
[INFO] [stderr]    = help: message: assertion failed: `(left == right)`
[INFO] [stderr]              left: `Some("#[allow(unused,")`,
[INFO] [stderr]             right: `Some("#[allow(unused")`

All of the 62 regressions are due to old versions of proc-macro-hack having an assert expecting #[allow(unused, instead of #[allow(unused ,.
So this is again a consequence of whitespace changes in pretty-printing (#62667).

I think we should be able to fix this by special casing the comma token during token stream pretty-printing and not printing the space before it.

@petrochenkov petrochenkov added the regression-from-stable-to-beta Performance or correctness regression from stable to beta. label Aug 25, 2019
@petrochenkov petrochenkov self-assigned this Aug 25, 2019
@petrochenkov petrochenkov added A-macros Area: All kinds of macros (custom derive, macro_rules!, proc macros, ..) A-pretty Area: Pretty printing (including `-Z unpretty`) labels Aug 25, 2019
@petrochenkov
Copy link
Contributor Author

Fixed in #63897.

@petrochenkov petrochenkov added the T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. label Aug 26, 2019
@bors bors closed this as completed in 9fa8f14 Aug 26, 2019
@nikomatsakis
Copy link
Contributor

Just FYI, we discussed this in the Sep 05 @rust-lang/lang meeting. We felt like the action here was appropriate -- while in general we do not guarantee stability of pretty printing, it makes sense to be judicious, and in this particular case not having a leading space before , just looks better anyway. 😛

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-macros Area: All kinds of macros (custom derive, macro_rules!, proc macros, ..) A-pretty Area: Pretty printing (including `-Z unpretty`) regression-from-stable-to-beta Performance or correctness regression from stable to beta. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants