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 in const_trait check code #102361

Merged
merged 2 commits into from
Oct 1, 2022
Merged

Conversation

fee1-dead
Copy link
Member

This fixes #102156.

@rustbot rustbot added the T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. label Sep 27, 2022
@rust-highfive
Copy link
Collaborator

r? @eholk

(rust-highfive has picked a reviewer for you, use r? to override)

@rust-highfive rust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Sep 27, 2022
Comment on lines +5 to +6
//~^ ERROR
//~| ERROR
Copy link
Contributor

@Rageking8 Rageking8 Sep 29, 2022

Choose a reason for hiding this comment

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

Maybe add the error code to make it a tad clearer, or is it mostly unnecessary for this case? Not sure on the error annotations guidelines.

Copy link
Member Author

Choose a reason for hiding this comment

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

The errors are expected, but checking the error message is mostly unnecessary because we are only ensuring that it doesn't ICE.

@@ -199,7 +199,7 @@ impl<'tcx> Visitor<'tcx> for CheckConstVisitor<'tcx> {
..
}) = item.kind
{
let def_id = trait_ref.trait_def_id().unwrap();
let Some(def_id) = trait_ref.trait_def_id() else { return; };
Copy link
Contributor

Choose a reason for hiding this comment

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

Do we want to return here or break out of the block so that intravisit::walk_item still runs?

Copy link
Member Author

Choose a reason for hiding this comment

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

Done.

@eholk
Copy link
Contributor

eholk commented Sep 30, 2022

@bors r+

@bors
Copy link
Contributor

bors commented Sep 30, 2022

📌 Commit d7fe44d has been approved by eholk

It is now in the queue for this repository.

@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 Sep 30, 2022
bors added a commit to rust-lang-ci/rust that referenced this pull request Oct 1, 2022
…iaskrgr

Rollup of 7 pull requests

Successful merges:

 - rust-lang#102361 (Fix ICE in const_trait check code)
 - rust-lang#102373 (Flush delayed bugs before codegen)
 - rust-lang#102483 (create def ids for impl traits during ast lowering)
 - rust-lang#102490 (Generate synthetic region from `impl` even in closure body within an associated fn)
 - rust-lang#102492 (Don't lower assoc bindings just to deny them)
 - rust-lang#102493 (Group together more size assertions.)
 - rust-lang#102521 (rustdoc: add missing margin to no-docblock methods)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup
@bors bors merged commit c07ebeb into rust-lang:master Oct 1, 2022
@rustbot rustbot added this to the 1.66.0 milestone Oct 1, 2022
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. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

ICE: None in compiler/rustc_passes/src/check_const.rs
7 participants