about summary refs log tree commit diff
path: root/compiler/rustc_codegen_ssa/src/base.rs
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2022-10-31 12:07:07 +0000
committerbors <bors@rust-lang.org>2022-10-31 12:07:07 +0000
commit2afca78a0b03db144c5d8b9f8868feebfe096309 (patch)
tree50b298f204ba63b6de1acf5f7667559bc86b0d8a /compiler/rustc_codegen_ssa/src/base.rs
parent4596f4f8b565bdd02d3b99d1ab12ff09146a93de (diff)
parent4a254d557aef513c4dec1757eb1c2e7913a9f5a0 (diff)
downloadrust-2afca78a0b03db144c5d8b9f8868feebfe096309.tar.gz
rust-2afca78a0b03db144c5d8b9f8868feebfe096309.zip
Auto merge of #103797 - Dylan-DPC:rollup-ps589fi, r=Dylan-DPC
Rollup of 5 pull requests

Successful merges:

 - #103338 (Fix unreachable_pub suggestion for enum with fields)
 - #103603 (Lang item cleanups)
 - #103732 (Revert "Make the `c` feature for `compiler-builtins` opt-in instead of inferred")
 - #103766 (Add tracking issue to `error_in_core`)
 - #103789 (Update E0382.md)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup
Diffstat (limited to 'compiler/rustc_codegen_ssa/src/base.rs')
-rw-r--r--compiler/rustc_codegen_ssa/src/base.rs13
1 files changed, 6 insertions, 7 deletions
diff --git a/compiler/rustc_codegen_ssa/src/base.rs b/compiler/rustc_codegen_ssa/src/base.rs
index 84b89cd71a6..a92087305b8 100644
--- a/compiler/rustc_codegen_ssa/src/base.rs
+++ b/compiler/rustc_codegen_ssa/src/base.rs
@@ -22,7 +22,6 @@ use rustc_data_structures::sync::ParallelIterator;
 use rustc_hir as hir;
 use rustc_hir::def_id::{DefId, LOCAL_CRATE};
 use rustc_hir::lang_items::LangItem;
-use rustc_hir::weak_lang_items::WEAK_ITEMS_SYMBOLS;
 use rustc_index::vec::Idx;
 use rustc_metadata::EncodedMetadata;
 use rustc_middle::middle::codegen_fn_attrs::CodegenFnAttrs;
@@ -887,14 +886,14 @@ impl CrateInfo {
         // by the compiler, but that's ok because all this stuff is unstable anyway.
         let target = &tcx.sess.target;
         if !are_upstream_rust_objects_already_included(tcx.sess) {
-            let missing_weak_lang_items: FxHashSet<&Symbol> = info
+            let missing_weak_lang_items: FxHashSet<Symbol> = info
                 .used_crates
                 .iter()
-                .flat_map(|cnum| {
-                    tcx.missing_lang_items(*cnum)
-                        .iter()
-                        .filter(|l| lang_items::required(tcx, **l))
-                        .filter_map(|item| WEAK_ITEMS_SYMBOLS.get(item))
+                .flat_map(|&cnum| tcx.missing_lang_items(cnum))
+                .filter(|l| l.is_weak())
+                .filter_map(|&l| {
+                    let name = l.link_name()?;
+                    lang_items::required(tcx, l).then_some(name)
                 })
                 .collect();
             let prefix = if target.is_like_windows && target.arch == "x86" { "_" } else { "" };