Skip to content

Commit

Permalink
Auto merge of rust-lang#99676 - thomcc:dont-overwrite, r=tmiasko
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
bors committed Jul 25, 2022
2 parents babff22 + 6cfd471 commit 530c0a8
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion compiler/rustc_typeck/src/collect.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2843,7 +2843,7 @@ fn codegen_fn_attrs(tcx: TyCtxt<'_>, did: DefId) -> CodegenFnAttrs {
let is_like_elf = !(tcx.sess.target.is_like_osx
|| tcx.sess.target.is_like_windows
|| tcx.sess.target.is_like_wasm);
codegen_fn_attrs.flags = if is_like_elf {
codegen_fn_attrs.flags |= if is_like_elf {
CodegenFnAttrFlags::USED
} else {
CodegenFnAttrFlags::USED_LINKER
Expand Down

0 comments on commit 530c0a8

Please sign in to comment.