Skip to content

Commit 9c9b66c

Browse files
authored
Rollup merge of #148240 - InvalidPathException:master, r=WaffleLapkin
rustc_codegen: fix musttail returns for cast/indirect ABIs Fixes rust-lang/rust#148239 rust-lang/rust#144986 Explicit tail calls trigger `bug!` for any callee whose ABI returns via `PassMode::Cast`, and we forgot to to forward the hidden `sret` out-pointer when the ABI requested an indirect return. The former causes ICE, the latter produced malformed IR (wrong codegen) if the return value is large enough to need `sret`. Updated the musttail helper to accept cast-mode returns, made it so that we pass the return pointer through the tail-call path. Added two UI tests to demonstrate each case. This is my first time contributing, please do check if I did it right. r? theemathas
2 parents 352bb6c + 09bdb28 commit 9c9b66c

File tree

0 file changed

+0
-0
lines changed

    0 file changed

    +0
    -0
    lines changed

    0 commit comments

    Comments
     (0)