Fixes #121381 (cherry picked from commit a17211b05c)
a17211b05c
Please read the rustc-dev-guide chapter on Backend Agnostic Codegen.