Skip to content

Commit 530c0a8

Browse files
committed
Auto merge of rust-lang#99676 - thomcc:dont-overwrite, r=tmiasko
Don't overwrite CodegenFnAttrs when adding used compiler/linker Pointed out by `@tmiasko` in rust-lang#93718 (comment). Probably a better fix than rust-lang#99674 for rust-lang#99596, assuming it does fix the latter. I don't have the ability to write a regression test for this at the moment, and am quite surprised this didn't cause other failures. The old code is clearly wrong though, but I'm not picky as to which of these is better to go with.
2 parents babff22 + 6cfd471 commit 530c0a8

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

Diff for: compiler/rustc_typeck/src/collect.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -2843,7 +2843,7 @@ fn codegen_fn_attrs(tcx: TyCtxt<'_>, did: DefId) -> CodegenFnAttrs {
28432843
let is_like_elf = !(tcx.sess.target.is_like_osx
28442844
|| tcx.sess.target.is_like_windows
28452845
|| tcx.sess.target.is_like_wasm);
2846-
codegen_fn_attrs.flags = if is_like_elf {
2846+
codegen_fn_attrs.flags |= if is_like_elf {
28472847
CodegenFnAttrFlags::USED
28482848
} else {
28492849
CodegenFnAttrFlags::USED_LINKER

0 commit comments

Comments
 (0)