Depending on how rustc was built, rustc --print target-cpus can return an error ("Target CPU help is not supported by this LLVM version.").
See https://github.com/rust-lang/rust/blob/ee6533d7408f1447c028025c883a34c904d25ba4/compiler/rustc_llvm/llvm-wrapper/PassWrapper.cpp#L365 and rust-lang/rust#104785
We should catch this error and print a friendly error message to the user.