-
Notifications
You must be signed in to change notification settings - Fork 12.8k
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
create dummy placeholder crate to prevent compiler from panicing #107721
Conversation
(rustbot has picked a reviewer for you, use r? to override) |
ccdfda5
to
e7c96ca
Compare
Thanks for the PR, @megakorre! Adding the However, I don't quite understand how a non-existing attribute interacts with the recursion limit. Maybe @petrochenkov knows what's exactly going on here? Maybe unknown attributes are speculatively assumed to be proc-macros and the recursion limit is checked before expansion? |
That's an expected behavior. |
All non-builtin attributes are expanded (maybe trivially) and contribute to the recursion count, including unresolved ones. |
e7c96ca
to
60c0593
Compare
60c0593
to
0fd2a70
Compare
@bors r+ |
☀️ Test successful - checks-actions |
Finished benchmarking commit (267cd1d): comparison URL. Overall result: no relevant changes - no action needed@rustbot label: -perf-regression Instruction countThis benchmark run did not return any relevant results for this metric. Max RSS (memory usage)This benchmark run did not return any relevant results for this metric. CyclesThis benchmark run did not return any relevant results for this metric. |
This PR is to address the panic found in #105700.
There are 2 separate things going on with this panic.
First the code could not generate a dummy response for crate fragment types when it hits the recursion limit.
This PR adds the method to the trait implementation for
DymmyResult
to be able to create a dummy crate node.This stops the panic from happening.
The second thing that is not addressed (and maybe does not need addressing? 🤷🏻)
is that when you have multiple attributes it ends up treating attributes that follow another as being the result of expanding the former (maybe there is a better way to say that). So you end up hitting the recursion limit. Even though you would think there is no expansion happening here.
If you did not hit the recursion limit the compiler would output that
invalid_attribute
does not exists. But it currently exits before the resolution step when the recursion limit is reached here.