@@ -6,7 +6,6 @@ use rustc_ast::{LitKind, MetaItem, MetaItemInner, attr};
66use rustc_hir:: attrs:: { AttributeKind , InlineAttr , InstructionSetAttr , UsedBy } ;
77use rustc_hir:: def:: DefKind ;
88use rustc_hir:: def_id:: { DefId , LOCAL_CRATE , LocalDefId } ;
9- use rustc_hir:: weak_lang_items:: WEAK_LANG_ITEMS ;
109use rustc_hir:: { self as hir, Attribute , LangItem , find_attr, lang_items} ;
1110use rustc_middle:: middle:: codegen_fn_attrs:: {
1211 CodegenFnAttrFlags , CodegenFnAttrs , PatchableFunctionEntry ,
@@ -520,14 +519,12 @@ fn handle_lang_items(
520519 // strippable by the linker.
521520 //
522521 // 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) ;
531528 }
532529
533530 // error when using no_mangle on a lang item item
0 commit comments