-
Notifications
You must be signed in to change notification settings - Fork 13.1k
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
Record proc macro harness order for use during metadata deserialization #68814
Conversation
r? @varkor (rust_highfive has picked a reviewer for you, use r? to override) |
The job Click to expand the log.
I'm a bot! I can only do what humans tell me to, so if this was not helpful or you have suggestions for improvements, please ping or otherwise contact |
591a367
to
5eb06a0
Compare
r? @petrochenkov |
There's probably some way to fix the ordering mismatch, but I really don't think it's the right approach. We shouldn't have to care about the precise order in which we generate the harness - we've already been wrong twice. Explicitly defining the order ensures that we'll never have to worry about this again. If we try to patch the visitation orders to match, I'm almost certain that we'll hit this kind of issue again. We might miss another weird corner case, or someone could change the AST/HIR such that the itertion order is different. |
(This will probably has to wait until the next weekend.) |
See #68814 (comment). |
r=me with comments added to AST as well. |
Fixes rust-lang#68690 When we generate the proc macro harness, we now explicitly recorder the order in which we generate entries. We then use this ordering data to deserialize the correct proc-macro-data from the crate metadata.
5eb06a0
to
5164598
Compare
@petrochenkov: I've added an additional comment. |
@bors r+ |
📌 Commit 5164598 has been approved by |
@bors rollup=never |
…nkov Record proc macro harness order for use during metadata deserialization Fixes #68690 When we generate the proc macro harness, we now explicitly recorder the order in which we generate entries. We then use this ordering data to deserialize the correct proc-macro-data from the crate metadata.
☀️ Test successful - checks-azure |
I won't revert this PR since it had already landed, but the error was actually in the encoder. tcx.hir().krate().items
=>
tcx.hir().krate().module.item_ids Item order in HIR does repeat the item order in AST, |
Fixes #68690
When we generate the proc macro harness, we now explicitly recorder the
order in which we generate entries. We then use this ordering data to
deserialize the correct proc-macro-data from the crate metadata.