This patch is only needed to correctly build D7865 since Rust 1.38 cannot compile Rust 1.40.
This is fine with me. Eventually, to enable cross-lang PGO/LTO in firefox, both firefox and rust will need to link/use the same llvm/clang to maintain compatibility and reduce the risk of weird compiler mismatch errors. I think this is how you link it as a shared lib:
[llvm] link-shared = true