Don't overwrite CodegenFnAttrs when adding used compiler/linker

This commit is contained in:
Thom Chiovoloni 2022-07-24 06:18:34 -07:00
parent b4151a41a0
commit 6cfd471ffe
No known key found for this signature in database
GPG Key ID: D7733D1D7A775F0A

View File

@ -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