Skip to content
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

Merged
merged 2 commits into from
Nov 28, 2021

Conversation

BGR360
Copy link
Contributor

@BGR360 BGR360 commented Nov 28, 2021

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

@rust-highfive rust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Nov 28, 2021
@rust-log-analyzer

This comment has been minimized.

Copy link
Member

@JohnTitor JohnTitor left a 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.
Copy link
Member

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.

Copy link
Member

@jackh726 jackh726 left a 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 🙂

&mut bounds,
ty::List::empty(),
);
astconv.add_bounds(param_ty, std::array::IntoIter::new([bound]), &mut bounds, bound_vars);
Copy link
Member

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?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yup!

@jackh726
Copy link
Member

@bors r+ rollup

@bors
Copy link
Collaborator

bors commented Nov 28, 2021

📌 Commit 6df2c78 has been approved by jackh726

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Nov 28, 2021
bors added a commit to rust-lang-ci/rust that referenced this pull request Nov 28, 2021
…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
@bors bors merged commit 67d1755 into rust-lang:master Nov 28, 2021
@rustbot rustbot added this to the 1.59.0 milestone Nov 28, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

assertion failed: !value.has_escaping_bound_vars() with trait A where for<'a> Self: 'a{}
7 participants