File tree Expand file tree Collapse file tree 1 file changed +3
-5
lines changed
compiler/rustc_codegen_ssa/src Expand file tree Collapse file tree 1 file changed +3
-5
lines changed Original file line number Diff line number Diff line change @@ -527,14 +527,14 @@ fn handle_lang_items(
527
527
attrs : & [ Attribute ] ,
528
528
codegen_fn_attrs : & mut CodegenFnAttrs ,
529
529
) {
530
+ let lang_item = lang_items:: extract ( attrs) . and_then ( |( name, _) | LangItem :: from_name ( name) ) ;
531
+
530
532
// Weak lang items have the same semantics as "std internal" symbols in the
531
533
// sense that they're preserved through all our LTO passes and only
532
534
// strippable by the linker.
533
535
//
534
536
// Additionally weak lang items have predetermined symbol names.
535
- if let Some ( ( name, _) ) = lang_items:: extract ( attrs)
536
- && let Some ( lang_item) = LangItem :: from_name ( name)
537
- {
537
+ if let Some ( lang_item) = lang_item {
538
538
if WEAK_LANG_ITEMS . contains ( & lang_item) {
539
539
codegen_fn_attrs. flags |= CodegenFnAttrFlags :: RUSTC_STD_INTERNAL_SYMBOL ;
540
540
}
@@ -548,8 +548,6 @@ fn handle_lang_items(
548
548
if codegen_fn_attrs. flags . contains ( CodegenFnAttrFlags :: RUSTC_STD_INTERNAL_SYMBOL )
549
549
&& codegen_fn_attrs. flags . contains ( CodegenFnAttrFlags :: NO_MANGLE )
550
550
{
551
- let lang_item =
552
- lang_items:: extract ( attrs) . map_or ( None , |( name, _span) | LangItem :: from_name ( name) ) ;
553
551
let mut err = tcx
554
552
. dcx ( )
555
553
. struct_span_err (
You can’t perform that action at this time.
0 commit comments