@@ -6,10 +6,7 @@ use rustc_ast::{LitKind, MetaItem, MetaItemInner, attr};
66use rustc_hir:: attrs:: { AttributeKind , InlineAttr , InstructionSetAttr , RtsanSetting , UsedBy } ;
77use rustc_hir:: def:: DefKind ;
88use rustc_hir:: def_id:: { DefId , LOCAL_CRATE , LocalDefId } ;
9- use rustc_hir:: {
10- self as hir, Attribute , CoroutineDesugaring , CoroutineKind , CoroutineSource , LangItem ,
11- find_attr, lang_items,
12- } ;
9+ use rustc_hir:: { self as hir, Attribute , LangItem , find_attr, lang_items} ;
1310use rustc_middle:: middle:: codegen_fn_attrs:: {
1411 CodegenFnAttrFlags , CodegenFnAttrs , PatchableFunctionEntry , SanitizerFnAttrs ,
1512} ;
@@ -389,15 +386,6 @@ fn apply_overrides(tcx: TyCtxt<'_>, did: LocalDefId, codegen_fn_attrs: &mut Code
389386 }
390387 }
391388
392- // #129347: desugared async coutines inherit inline attrs from the async fn/closure
393- if let Some ( parent) = async_poll_inherit_inline ( tcx, did. to_def_id ( ) ) {
394- let parent_attrs = tcx. codegen_fn_attrs ( parent) ;
395- if matches ! ( parent_attrs. inline, InlineAttr :: Never | InlineAttr :: Hint | InlineAttr :: Always )
396- {
397- codegen_fn_attrs. inline = parent_attrs. inline ;
398- }
399- }
400-
401389 // When `no_builtins` is applied at the crate level, we should add the
402390 // `no-builtins` attribute to each function to ensure it takes effect in LTO.
403391 let crate_attrs = tcx. hir_attrs ( rustc_hir:: CRATE_HIR_ID ) ;
@@ -659,23 +647,6 @@ fn inherited_align<'tcx>(tcx: TyCtxt<'tcx>, def_id: DefId) -> Option<Align> {
659647 tcx. codegen_fn_attrs ( tcx. trait_item_of ( def_id) ?) . alignment
660648}
661649
662- // Checks if the given DefId is a desugared async coroutine that should inherit inline attrs.
663- fn async_poll_inherit_inline ( tcx : TyCtxt < ' _ > , def_id : DefId ) -> Option < DefId > {
664- let Some ( kind) = tcx. coroutine_kind ( def_id) else {
665- return None ;
666- } ;
667-
668- if matches ! (
669- kind,
670- CoroutineKind :: Desugared ( CoroutineDesugaring :: Async , CoroutineSource :: Fn )
671- | CoroutineKind :: Desugared ( CoroutineDesugaring :: Async , CoroutineSource :: Closure )
672- ) {
673- Some ( tcx. parent ( def_id) )
674- } else {
675- None
676- }
677- }
678-
679650/// We now check the #\[rustc_autodiff\] attributes which we generated from the #[autodiff(...)]
680651/// macros. There are two forms. The pure one without args to mark primal functions (the functions
681652/// being differentiated). The other form is #[rustc_autodiff(Mode, ActivityList)] on top of the
0 commit comments