-
Notifications
You must be signed in to change notification settings - Fork 12.9k
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
Return err instead of ICE #95085
Return err instead of ICE #95085
Conversation
r? @davidtwco (rust-highfive has picked a reviewer for you, use r? to override) |
This isn't the right fix for this. Roughly, when we see an impl like So, our final See #85477 for a previous (abandoned) attempt at this. And my comment for solutions. I think probably the simplest option is either to 1) Check if the self ty is an error as in #85477 2) Treat this lifetime as Here is resolve lifetime in scope for an impl. Interestingly, we are storing late-bound lifetimes here but probably shouldn't be. (You can try to remove that line and see if anything fails; would be good to know.) But, we can probably add a |
r? @jackh726 |
Thanks for the great review I was not happy with the fix itself 😅 , I will try to implement new solution as you suggested. |
Let me know if you have questions. I'm around on Zulip most of the time. |
Scope::Binder { hir_id, allow_late_bound: true, .. } => { | ||
break *hir_id; | ||
} | ||
Scope::Binder { allow_late_bound: false, .. } => { |
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.
This can just be in the same match arm as Scope::ObjectLifetimeDefault
etc.
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.
How ? Scope::ObjectLifetimeDefault
does a completely different thing, that would cause an infinite loop I think.
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.
Oops, I mean Root
/Body
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.
Sorry, just a couple more things! Also, can you squash the commits?
@bors r+ |
📌 Commit be566f1 has been approved by |
…askrgr Rollup of 6 pull requests Successful merges: - rust-lang#95074 (Refactor: use `format-args-capture` and remove unnecessary nested if blocks in some parts of `rust_passes`) - rust-lang#95085 (Return err instead of ICE) - rust-lang#95116 (Add needs-* directives to many tests) - rust-lang#95129 (Remove animation on source sidebar) - rust-lang#95166 (Update the unstable book with the new `values()` form of check-cfg) - rust-lang#95175 (move `adt_const_params` to its own tracking issue) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
Having
escaping_bound_vars
results in ICE when trying to createty::Binder::dummy
, to avoid it we return err like the line above. I think this requires a more sophisticated fix, I would love to investigate if mentorship is available 🤓Fixes #95023 and #85350