@@ -6,7 +6,6 @@ use rustc_ast::{LitKind, MetaItem, MetaItemInner, attr};
6
6
use rustc_hir:: attrs:: { AttributeKind , InlineAttr , InstructionSetAttr , UsedBy } ;
7
7
use rustc_hir:: def:: DefKind ;
8
8
use rustc_hir:: def_id:: { DefId , LOCAL_CRATE , LocalDefId } ;
9
- use rustc_hir:: weak_lang_items:: WEAK_LANG_ITEMS ;
10
9
use rustc_hir:: { self as hir, Attribute , LangItem , find_attr, lang_items} ;
11
10
use rustc_middle:: middle:: codegen_fn_attrs:: {
12
11
CodegenFnAttrFlags , CodegenFnAttrs , PatchableFunctionEntry ,
@@ -520,14 +519,12 @@ fn handle_lang_items(
520
519
// strippable by the linker.
521
520
//
522
521
// Additionally weak lang items have predetermined symbol names.
523
- if let Some ( lang_item) = lang_item {
524
- if WEAK_LANG_ITEMS . contains ( & lang_item) {
525
- codegen_fn_attrs. flags |= CodegenFnAttrFlags :: RUSTC_STD_INTERNAL_SYMBOL ;
526
- }
527
- if let Some ( link_name) = lang_item. link_name ( ) {
528
- codegen_fn_attrs. export_name = Some ( link_name) ;
529
- codegen_fn_attrs. link_name = Some ( link_name) ;
530
- }
522
+ if let Some ( lang_item) = lang_item
523
+ && let Some ( link_name) = lang_item. link_name ( )
524
+ {
525
+ codegen_fn_attrs. flags |= CodegenFnAttrFlags :: RUSTC_STD_INTERNAL_SYMBOL ;
526
+ codegen_fn_attrs. export_name = Some ( link_name) ;
527
+ codegen_fn_attrs. link_name = Some ( link_name) ;
531
528
}
532
529
533
530
// error when using no_mangle on a lang item item
0 commit comments