Skip to content

Commit 6440785

Browse files
committed
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.
1 parent aa65b08 commit 6440785

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

compiler/rustc_codegen_llvm/src/context.rs

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -149,11 +149,12 @@ pub unsafe fn create_module(
149149

150150
if !custom_llvm_used && target_data_layout != llvm_data_layout {
151151
bug!(
152-
"data-layout for builtin `{}` target, `{}`, \
153-
differs from LLVM default, `{}`",
154-
sess.target.llvm_target,
155-
target_data_layout,
156-
llvm_data_layout
152+
"data-layout for target `{rustc_target}`, `{rustc_layout}`, \
153+
differs from LLVM target's `{llvm_target}` default layout, `{llvm_layout}`",
154+
rustc_target = sess.opts.target_triple,
155+
rustc_layout = target_data_layout,
156+
llvm_target = sess.target.llvm_target,
157+
llvm_layout = llvm_data_layout
157158
);
158159
}
159160
}

0 commit comments

Comments
 (0)