Skip to content

Commit 7bfc464

Browse files
committed
Prefer any other crate over c-builtins when selecting an upstream monomorphization
1 parent 9044e98 commit 7bfc464

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

compiler/rustc_codegen_ssa/src/back/symbol_export.rs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -430,8 +430,11 @@ fn upstream_monomorphizations_provider(
430430
Occupied(mut e) => {
431431
// If there are multiple monomorphizations available,
432432
// we select one deterministically.
433+
// Also try to avoid selecting compiler-builtins: #150173
433434
let other_cnum = *e.get();
434-
if tcx.stable_crate_id(other_cnum) > tcx.stable_crate_id(cnum) {
435+
if tcx.stable_crate_id(other_cnum) > tcx.stable_crate_id(cnum)
436+
|| tcx.is_compiler_builtins(other_cnum)
437+
{
435438
e.insert(cnum);
436439
}
437440
}

0 commit comments

Comments
 (0)