Description
Servo currently can't compile with -Zorbit
(see servo/servo#11706) and my suspect is return_address
.
Even if that wasn't the reason, Servo's usage of return_address
to create a rooting cycle only ever worked because it happened to get the final destination of the call, but with MIR, the call destination might be a temporary, so it's not the final destination anymore.
Servo has a lint for disallowing moves on the types that are being returned, but that analysis is wrong unless performed on exactly the MIR we translate.
We also could change the ABI at any time, so the indirect returns becomes direct (we can do this for any pair of pointer-sized values) which would also break Servo.
I'm not even sure how LLVM doesn't miscompile what Servo is doing, capturing an sret
argument seems quite dubious to me, and some architectures also have an intermediary copy.
AFAIK, the eventual solution is to have proper stack map support, however that might be a long ways off and I don't want to block removing old trans on it.
cc @jdm @pcwalton @Manishearth @rust-lang/compiler