-
Notifications
You must be signed in to change notification settings - Fork 12.8k
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
Flush delayed bugs before codegen #102373
Flush delayed bugs before codegen #102373
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.
r? @nagisa (rust-highfive has picked a reviewer for you, use r? to override) |
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 |
Does this deserve a test, or at least a comment on why we are exiting early? |
I don't think we can test this, but I can add a comment, I forgot about that |
@bors r+ |
@cjgillot there's another typo, you can reapprove it if you want |
@bors r- r+ |
@bors r- r=cjgillot |
…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
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.