cranelift: fix backend limit diagnostics#158827
Conversation
|
cc @bjorn3 |
|
r? @chenyukang rustbot has assigned @chenyukang. Use Why was this reviewer chosen?The reviewer was selected based on:
|
|
Thanks for figuring out why this ICE happened! Could you open this PR against https://github.com/rust-lang/rustc_codegen_cranelift/ to reduce the risk of conflicts during the next subtree sync? That is where development of cg_clif happens. I did be fine with omitting the test. I don't think it is that likely to regress in the future and it is just an ICE and not a miscompilation anyway. |
fixes #158801
cg_clif was reporting cranelift impl-limit failures through earlydiagctxt. that printed the backend error, but it never reached the session dcx, so join_codegen could still hit the worker-thread ice.
the fix routes those failures through the shared emitter/session dcx path. verifier failures also use one fatal diagnostic, so the pretty verifier text does not get lost behind an earlier queued error.
imo this is the least weird fix because the backend limit itself is fine; the bad part was the diagnostic plumbing. i added both a cg_clif harness check and a cranelift-gated ui fixture. idk if we keep both forever, but they make the regression pretty obvious. ltm if you want the ui one dropped.