Skip to content

Commit 56c6a48

Browse files
committed
Truncate hex stable crate id to 8 characters (32 bits)
1 parent ca935dd commit 56c6a48

File tree

2 files changed

+8
-3
lines changed

2 files changed

+8
-3
lines changed

compiler/rustc_middle/src/mir/mono.rs

+7-2
Original file line numberDiff line numberDiff line change
@@ -494,14 +494,19 @@ impl CodegenUnitNameBuilder<'tcx> {
494494
format!(
495495
"-in-{}.{:08x}",
496496
tcx.crate_name(LOCAL_CRATE),
497-
local_stable_crate_id.to_u64()
497+
local_stable_crate_id.to_u64() as u32,
498498
)
499499
} else {
500500
String::new()
501501
};
502502

503503
let stable_crate_id = tcx.sess.local_stable_crate_id();
504-
format!("{}.{:08x}{}", tcx.crate_name(cnum), stable_crate_id.to_u64(), local_crate_id)
504+
format!(
505+
"{}.{:08x}{}",
506+
tcx.crate_name(cnum),
507+
stable_crate_id.to_u64() as u32,
508+
local_crate_id,
509+
)
505510
});
506511

507512
write!(cgu_name, "{}", crate_prefix).unwrap();
+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
warning: Linking globals named 'foo': symbol multiply defined!
22

3-
error: failed to load bc of "lto-duplicate-symbols2.lto_duplicate_symbols2.288b404e693a75b4-cgu.0.rcgu.o":
3+
error: failed to load bc of "lto-duplicate-symbols2.lto_duplicate_symbols2.693a75b4-cgu.0.rcgu.o":
44

55
error: aborting due to previous error; 1 warning emitted
66

0 commit comments

Comments
 (0)