Skip to content

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

Description

@petrochenkov

#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.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

A-macrosArea: All kinds of macros (custom derive, macro_rules!, proc macros, ..)A-prettyArea: Pretty printing (including `-Z unpretty`)T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.regression-from-stable-to-betaPerformance or correctness regression from stable to beta.

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions