-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
Expand more single ident macro calls upon item collection #14800
Conversation
|
||
// Case 1: try to resolve in legacy scope and expand macro_rules | ||
// FIXME: Eagerly expanding in "Case 1" is insufficient since "Case 2" may also define |
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.
Using the term eager might be a bit confusing here as there is a concept of eager vs lazy macros
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.
I've replaced it with "immediately" as used in the comment below.
I wish we had the resources to run analysis stats on rust-lang/rust on CI tbh though I imagine r-a will take ages on that codebase |
a0ad760
to
e9ddb62
Compare
Yeah, I've run it a few times for this PR and it took more than an hour in total, such a pain :/ (partly because I'm on a relatively old PC though). I wish we had a rust-timer-like bot dedicated to our needs... |
Oh, a rust-timer-like bot for this would be amazing tbh. Wouldn't hurt to bring that up in t-infra at least I guess |
☀️ Test successful - checks-actions |
Addresses #14781 (comment)
I believe this (almost) brings the number of unresolved names back to pre-#14781:
analysis-stats compiler/rustc
(rust-lang/rust@69fef92)(I haven't investigated on the increase in some numbers but hopefully not too much of a problem)
This is only a temporary solution. The core problem is that we haven't fully implemented the textual scope of legacy macros. For example, we have been failing to resolve
foo
in the following snippet, even before #14781 or after this patch. As noted in a FIXME, we need a way to resolve names in textual scope without eager expansion during item collection.