From 65ec4dd9047d5d9a47122648feba4b4996d33540 Mon Sep 17 00:00:00 2001 From: Joe Date: Sun, 6 Mar 2022 15:25:05 +0100 Subject: [PATCH 1/2] Improved error message for failed bitcode load "bc" is an unnecessary shorthand that obfuscates the compilation error --- compiler/rustc_codegen_llvm/src/back/lto.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/compiler/rustc_codegen_llvm/src/back/lto.rs b/compiler/rustc_codegen_llvm/src/back/lto.rs index 6afa649b6de32..0f5b1c08ec2dc 100644 --- a/compiler/rustc_codegen_llvm/src/back/lto.rs +++ b/compiler/rustc_codegen_llvm/src/back/lto.rs @@ -317,7 +317,7 @@ fn fat_lto( info!("linking {:?}", name); let data = bc_decoded.data(); linker.add(data).map_err(|()| { - let msg = format!("failed to load bc of {:?}", name); + let msg = format!("failed to load bitcode of module {:?}", name); write::llvm_err(diag_handler, &msg) })?; serialized_bitcode.push(bc_decoded); From 0e604a7864268d1591a49e68a7155292c99c3662 Mon Sep 17 00:00:00 2001 From: Joe Date: Sun, 6 Mar 2022 16:14:07 +0100 Subject: [PATCH 2/2] Updated corresponding stderr --- src/test/ui/lto/lto-duplicate-symbols.stderr | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/test/ui/lto/lto-duplicate-symbols.stderr b/src/test/ui/lto/lto-duplicate-symbols.stderr index 50e6b81dcf4b4..f66afa94f4da7 100644 --- a/src/test/ui/lto/lto-duplicate-symbols.stderr +++ b/src/test/ui/lto/lto-duplicate-symbols.stderr @@ -1,6 +1,6 @@ warning: Linking globals named 'foo': symbol multiply defined! -error: failed to load bc of "lto-duplicate-symbols2.lto_duplicate_symbols2.HASH-cgu.0.rcgu.o": +error: failed to load bitcode of module "lto-duplicate-symbols2.lto_duplicate_symbols2.HASH-cgu.0.rcgu.o": error: aborting due to previous error; 1 warning emitted