Flush delayed bugs before codegen#102373
Merged
bors merged 4 commits intorust-lang:masterfrom Oct 1, 2022
Merged
Conversation
Sometimes it can happen that invalid code like a TyKind::Error makes its way through the compiler without triggering any errors (this is always a bug in rustc but bugs do happen sometimes :)). These ICEs will manifest in the backend like as cg_llvm not being able to get the layout of `[type error]`, which makes it hard to debug. By flushing before codegen, we display all the delayed bugs, making it easier to trace it to the root of the problem.
Contributor
|
r? @nagisa (rust-highfive has picked a reviewer for you, use r? to override) |
Member
Author
|
Interestingly, I've encountered exactly this problem just in this moment myself when I had bugs in my ast_lowering code that made their way to cg_llvm as well :D |
Contributor
|
Does this deserve a test, or at least a comment on why we are exiting early? |
Member
Author
|
I don't think we can test this, but I can add a comment, I forgot about that |
cjgillot
reviewed
Sep 30, 2022
Contributor
|
@bors r+ |
Collaborator
Member
Author
|
@cjgillot there's another typo, you can reapprove it if you want |
Member
|
@bors r- r+ |
Collaborator
Member
|
@bors r- r=cjgillot |
Collaborator
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Sometimes it can happen that invalid code like a TyKind::Error makes its way through the compiler without triggering any errors (this is always a bug in rustc but bugs do happen sometimes :)). These ICEs will manifest in the backend like as cg_llvm not being able to get the layout of
[type error], which makes it hard to debug. By flushing before codegen, we display all the delayed bugs, making it easier to trace it to the root of the problem.I tried this on #102366 and it showed tons of of delayed bugs and no error in cg_llvm, so it seems to be working.