-
Notifications
You must be signed in to change notification settings - Fork 13.2k
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
Do not visit attributes in ItemLowerer
.
#91111
Conversation
This comment has been minimized.
This comment has been minimized.
a48e333
to
9d39a6e
Compare
This comment has been minimized.
This comment has been minimized.
9d39a6e
to
4404d4b
Compare
Hi, I run a fuzzer on this branch to make sure that it fixes all the crashes that I found, and it does fix them so that's nice. But I also found a new input that does crash on this branch: #![a={impl std::ops::Neg for i8 {}}] That doesn't ICE on latest nightly 2021-11-20, but it does ICE on stable 1.56.1. I guess it's the same issue, but if not then let me know and I will open a new one. Backtrace
|
By default, AST visitors visit expressions that appear in key-value attributes. Those expressions should not be lowered to HIR, as they do not correspond to actually compiled code. Since an attribute cannot produce meaningful HIR, just skip them altogether.
4404d4b
to
907a69d
Compare
This comment has been minimized.
This comment has been minimized.
907a69d
to
7f5d3ff
Compare
@Badel2 this should fix your second example. |
📌 Commit 7f5d3ff has been approved by |
…askrgr Rollup of 6 pull requests Successful merges: - rust-lang#89359 (Various fixes for const_trait_impl) - rust-lang#90499 (Link with default MACOSX_DEPLOYMENT_TARGET if not otherwise specified.) - rust-lang#91096 (Print associated types on opaque `impl Trait` types) - rust-lang#91111 (Do not visit attributes in `ItemLowerer`.) - rust-lang#91162 (explain why CTFE/Miri perform truncation on shift offset) - rust-lang#91185 (Remove `-Z force-overflow-checks`) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
Yes, this fixes all the examples I found. Thank you! |
By default, AST visitors visit expressions that appear in key-value attributes.
Those expressions should not be lowered to HIR, as they do not correspond to actually compiled code.
Since an attribute cannot produce meaningful HIR, just skip them altogether.
Fixes #81886
Fixes #90873
r? @michaelwoerister