-
Notifications
You must be signed in to change notification settings - Fork 13.3k
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
Fix ICE when lowering trait A where for<'a> Self: 'a
#91308
Conversation
Fixes the ICE in rust-lang#88586.
This comment has been minimized.
This comment has been minimized.
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.
Thanks for fixing it! Left one nit about the test.
// Regression test for #88586: a higher-ranked outlives bound on Self in a trait | ||
// definition caused an ICE when debug_assertions were enabled. | ||
// | ||
// The error output is incidentally unhelpful; this should be improved. |
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.
Adding FIXME:
prefix would be helpful as we can pick it up by grepping in the future.
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 is a much more targeted fix, but perfectly acceptable.
One small comment (that is unrelated). And FIXME. Other than that, LGTM.
Great job here 🙂
compiler/rustc_typeck/src/collect.rs
Outdated
&mut bounds, | ||
ty::List::empty(), | ||
); | ||
astconv.add_bounds(param_ty, std::array::IntoIter::new([bound]), &mut bounds, bound_vars); |
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.
Drive by thought: can this be replaced by [bound].into_iter()
now?
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.
Yup!
@bors r+ rollup |
📌 Commit 6df2c78 has been approved by |
…askrgr Rollup of 3 pull requests Successful merges: - rust-lang#91251 (Perform Sync check on static items in wf-check instead of during const checks) - rust-lang#91308 (Fix ICE when lowering `trait A where for<'a> Self: 'a`) - rust-lang#91319 (Change output path to {{build-base}} for rustdoc scrape_examples ui test) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
Fixes #88586.
r? @jackh726
Jack, this fix is much smaller in scope than what I think you were proposing in the issue. Let me know if you had a vision for a larger refactor here.
cc @JohnTitor