Skip to content

Commit

Permalink
Improve ICE message when data-layouts don't match
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
nagisa committed Jul 8, 2021
1 parent aa65b08 commit 6440785
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions compiler/rustc_codegen_llvm/src/context.rs
Expand Up @@ -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
);
}
}
Expand Down

0 comments on commit 6440785

Please sign in to comment.