Closed
Description
proc-macro-hack is panicking[1] on beta 1.52 in some cases where it wasn't before:
My guess is this might have something to do with the usize-suffixed tuple indices, but I'm not sure. It seems to be new behavior on beta; I don't know whether this is caused by any of the recently landed macro-related patches, but it seems not impossible.
[1]: This is my belief, as it's the only repository in the dependency tree to contain the 'source.starts_with(prefix)' string in its source code (based on cargo vendor).
cc @Aaron1011 @petrochenkov @dtolnay
edit - some more cases:
- https://crater-reports.s3.amazonaws.com/beta-1.52-1/beta-2021-03-27/gh/bryanburgers.connectbot/log.txt
- https://crater-reports.s3.amazonaws.com/beta-1.52-1/beta-2021-03-27/gh/guillepb10.performance_test_rust/log.txt
- https://crater-reports.s3.amazonaws.com/beta-1.52-1/beta-2021-03-27/gh/marekm1844.user-tower/log.txt
- https://crater-reports.s3.amazonaws.com/beta-1.52-1/beta-2021-03-27/gh/mindriot101.gitlab-hook-deploy/log.txt
- https://crater-reports.s3.amazonaws.com/beta-1.52-1/beta-2021-03-27/gh/victorinno.tower_web_dummy_service/log.txt
- https://crater-reports.s3.amazonaws.com/beta-1.52-1/beta-2021-03-27/gh/vizitiuRoman.notifier-service/log.txt
- https://crater-reports.s3.amazonaws.com/beta-1.52-1/beta-2021-03-27/gh/vizitiuRoman.rust-notification-service/log.txt
- https://crater-reports.s3.amazonaws.com/beta-1.52-1/beta-2021-03-27/reg/tower-web-protobuf-0.1.0/log.txt
- https://crater-reports.s3.amazonaws.com/beta-1.52-1/beta-2021-03-27/reg/rustiful-0.1.0/log.txt
Metadata
Metadata
Assignees
Labels
Area: All kinds of macros (custom derive, macro_rules!, proc macros, ..)Call for participation: This issue has a repro, but needs a Minimal Complete and Verifiable ExampleRelevant to the compiler team, which will review and decide on the PR/issue.Performance or correctness regression from one stable version to another.Marks issues that should be documented in the release notes of the next release.
Type
Projects
Relationships
Development
No branches or pull requests
Activity
Aaron1011 commentedon Apr 12, 2021
It looks like the pretty-printing assumptions made by an older version of
proc-macro-back
have stopped holding. Runningcargo update -p proc-macro-hack
in one of the failing crates fixed the panic for me.Mark-Simulacrum commentedon Apr 12, 2021
This seems pretty widespread (edit: 57 cases, of which 10 are crates.io crates) - I found at least 5-6 more repositories in crater, though not too many actual crates. Is there an easy way for us to continue having the same pretty printing? I know we don't generally guarantee stability there, and it looks like there's a pretty easy upgrade path, so if not that seems OK (but we'll want to mention it in release notes).
dtolnay commentedon Apr 12, 2021
dtolnay/proc-macro-hack@4df5a94 fixed the whitespace sensitivity for 0.4.3. I have not looked at the build logs but it sounds like the failures are things pinned to an old patch version of 0.4? If so, I would be inclined to close this.
Mark-Simulacrum commentedon Apr 12, 2021
Yeah, things using 0.4.1 - 57 repositories is not small, and most of these are just tiny self-projects I suspect, so I agree that we can likely close if there's not a trivial fix (probably not, based on the scope of the breakage).
petrochenkov commentedon Apr 12, 2021
I remember fixing this in the past by tweaking pretty-printing (#63897), not sure what change caused pretty-printing to change again.
apiraino commentedon Apr 14, 2021
Removing I-prioritize as these panics seems to be solved by upgrading the library (but in case it helps, let's assign a priority).
@rustbot label -I-prioritize
10 remaining items