-
Notifications
You must be signed in to change notification settings - Fork 13.5k
Setup proc-macro metadata at encoding instead of decoding #79353
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Conversation
r? @lcnr (rust_highfive has picked a reviewer for you, use r? to override) |
@bors try @rust-timer queue |
Awaiting bors try build completion |
⌛ Trying commit d9d6b836427f03853ee316391ddff4ff815e4e18 with merge a7328d96f1234b84898788717e82a5d0762c05a6... |
☀️ Try build successful - checks-actions |
Queued a7328d96f1234b84898788717e82a5d0762c05a6 with parent 40cf721, future comparison URL. |
Finished benchmarking try commit (a7328d96f1234b84898788717e82a5d0762c05a6): comparison url. Benchmarking this pull request likely means that it is perf-sensitive, so we're automatically marking it as not fit for rolling up. Please note that if the perf results are neutral, you should likely undo the rollup=never given below by specifying Importantly, though, if the results of this run are non-neutral do not roll this PR up -- it will mask other regressions or improvements in the roll up. @bors rollup=never |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm
and it seems like a small perf improvement to me.
@petrochenkov assigned themselves, so leaving the final approval to them |
Hmm, looks like this PR basically reverts recently landed #76897. |
I'm not sure which side is more important to optimize here. |
I was not aware of @Aaron1011's PR. |
@cjgillot |
Part of my motivation for #76897 was to stop encoding invalid metadata for proc macros (i.e. encoding I have no objection to this PR. |
MacroKind::Derive | ||
} else { | ||
bug!("Unknown proc-macro type for item {:?}", id); | ||
}; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It would be nicer to pre-record macro kind and name into Crate::proc_macros
, but seems ok as is.
Ok, I see what this PR does now, it's pretty different from #76897. |
r=me after squashing commits. |
Encode proc_macro name directly. Do not store None values.
Squashed. |
Thanks! |
📌 Commit 9dd32e1 has been approved by |
☀️ Test successful - checks-actions |
This should improve the common non-proc-macro case for metadata decoding.