diff options
| author | Simonas Kazlauskas <git@kazlauskas.me> | 2021-06-06 15:41:58 +0300 |
|---|---|---|
| committer | Simonas Kazlauskas <git@kazlauskas.me> | 2021-07-08 23:49:18 +0300 |
| commit | 6440785304a4cfff75d707f33bc2105ecfec0004 (patch) | |
| tree | 7679297528ea497c14dc79664aa84e085beebb6e /compiler/rustc_codegen_llvm/src | |
| parent | aa65b08b1dbaf4b637847646801ebc8c01d7ecbd (diff) | |
| download | rust-6440785304a4cfff75d707f33bc2105ecfec0004.tar.gz rust-6440785304a4cfff75d707f33bc2105ecfec0004.zip | |
Improve ICE message when data-layouts don't match
LLVM target name does not necessarily match the Rust target name and it can be confusing when the ICE message is describing a target other than has been specified on the command line.
Diffstat (limited to 'compiler/rustc_codegen_llvm/src')
| -rw-r--r-- | compiler/rustc_codegen_llvm/src/context.rs | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/compiler/rustc_codegen_llvm/src/context.rs b/compiler/rustc_codegen_llvm/src/context.rs index f662887abf8..ac7190fa686 100644 --- a/compiler/rustc_codegen_llvm/src/context.rs +++ b/compiler/rustc_codegen_llvm/src/context.rs @@ -149,11 +149,12 @@ pub unsafe fn create_module( if !custom_llvm_used && target_data_layout != llvm_data_layout { bug!( - "data-layout for builtin `{}` target, `{}`, \ - differs from LLVM default, `{}`", - sess.target.llvm_target, - target_data_layout, - llvm_data_layout + "data-layout for target `{rustc_target}`, `{rustc_layout}`, \ + differs from LLVM target's `{llvm_target}` default layout, `{llvm_layout}`", + rustc_target = sess.opts.target_triple, + rustc_layout = target_data_layout, + llvm_target = sess.target.llvm_target, + llvm_layout = llvm_data_layout ); } } |
