rust/compiler
bors c0bb3b98bb Auto merge of #143290 - azhogin:azhogin/link-pub-async-impls, r=oli-obk
pub async fn impl is monomorphized when func itself is monomorphized

Implentation coroutine (`func::{closure#0}`) is monomorphized, when func itself is monomorphized.

Currently, when `pub async fn foo(..)` is exported from lib and used in several dependent crates, only 'header' function is monomorphized in the defining crate. 'header' function, returning coroutine object, is monomorphized, but the coroutine's poll function (which actually implements all the logic for the function) is not. In such situation, `func::{closure#0}` will be monomorphized in every dependency.

This PR adds monomorphization for `func::{closure#0}` (coroutine poll function), when func itself is monomorphized.

Simple test with one lib async function and ten dependent crates (executable) that use the function, shows 5-7% compilation time improvement (single-threaded).
2025-09-01 10:54:40 +00:00
..
rustc rename stable_mir to rustc_public, and rustc_smir to rustc_public_bridge 2025-07-14 09:25:54 +00:00
rustc_abi Rollup merge of #144443 - WaffleLapkin:integer-target-pointer-width, r=Noratrieb 2025-08-31 13:40:34 +02:00
rustc_arena Introduce Arena::try_alloc_from_iter. 2025-04-19 01:13:18 +00:00
rustc_ast Rollup merge of #145984 - nnethercote:TokenStream-cleanups, r=chenyukang 2025-08-29 12:37:32 +02:00
rustc_ast_ir turn pointer width into an integer in target.json 2025-08-27 23:44:49 +02:00
rustc_ast_lowering Add tracing to [workspace.dependencies]. 2025-08-27 14:21:19 +10:00
rustc_ast_passes Add new doc(attribute = "...") attribute 2025-08-28 15:56:29 +02:00
rustc_ast_pretty Add itertools to [workspace.dependencies]. 2025-08-27 14:21:21 +10:00
rustc_attr_parsing Remove incorrect FIXME 2025-08-30 13:44:13 +02:00
rustc_baked_icu_data Use default locale fallback data 2025-08-28 09:48:54 +00:00
rustc_borrowck Introduce MirDumper and MirWriter. 2025-09-01 09:19:03 +10:00
rustc_builtin_macros Rollup merge of #145905 - TaKO8Ki:fix-137580, r=nnethercote 2025-08-27 11:26:52 +02:00
rustc_codegen_cranelift Introduce MirDumper and MirWriter. 2025-09-01 09:19:03 +10:00
rustc_codegen_gcc fix target-pointer-width in tests 2025-08-27 23:44:49 +02:00
rustc_codegen_llvm Rollup merge of #145967 - Enselic:big-enum-debuginfo-span, r=wesleywiser 2025-08-29 19:33:03 -05:00
rustc_codegen_ssa Rollup merge of #145947 - nnethercote:workspace-members-2, r=Kobzol 2025-08-29 12:54:12 +10:00
rustc_const_eval Add rustc_apfloat to [workspace.dependencies]. 2025-08-28 20:10:55 +10:00
rustc_data_structures Add measureme to [workspace.dependencies]. 2025-08-28 20:12:14 +10:00
rustc_driver Remove recursion_limit increases. 2025-04-02 16:25:27 +11:00
rustc_driver_impl Add serde_json to [workspace.dependencies]. 2025-08-28 20:10:54 +10:00
rustc_error_codes Changes to the uitests 2025-08-27 20:25:18 +02:00
rustc_error_messages Use default locale fallback data 2025-08-28 09:48:54 +00:00
rustc_errors Rollup merge of #145947 - nnethercote:workspace-members-2, r=Kobzol 2025-08-29 12:54:12 +10:00
rustc_expand Add tracing to [workspace.dependencies]. 2025-08-27 14:21:19 +10:00
rustc_feature Add serde_json to [workspace.dependencies]. 2025-08-28 20:10:54 +10:00
rustc_fluent_macro Add proc-macro2 and quote to [workspace.dependencies]. 2025-08-28 20:10:55 +10:00
rustc_fs_util Add tempfile to [workspace.dependencies]. 2025-08-28 20:10:55 +10:00
rustc_graphviz Remove #![warn(unreachable_pub)] from all compiler/ crates. 2025-03-11 13:14:21 +11:00
rustc_hashes Revert "Use workspace lints for crates in compiler/ #138084" 2025-03-10 18:12:47 +08:00
rustc_hir Rollup merge of #145947 - nnethercote:workspace-members-2, r=Kobzol 2025-08-29 12:54:12 +10:00
rustc_hir_analysis autoderef final ty is already resolved 2025-08-29 10:53:39 +02:00
rustc_hir_id rustc_hir_id: Add a comment explaining why the crate exists 2025-08-20 15:04:00 -07:00
rustc_hir_pretty Propagate TraitImplHeader to hir 2025-08-11 17:05:42 -05:00
rustc_hir_typeck Rollup merge of #146046 - chenyukang:yukang-fix-method-exists-for-ret-ty-error, r=estebank 2025-09-01 12:42:27 +10:00
rustc_incremental Add tracing to [workspace.dependencies]. 2025-08-27 14:21:19 +10:00
rustc_index Update documentation. 2025-08-24 22:15:19 +00:00
rustc_index_macros Add proc-macro2 and quote to [workspace.dependencies]. 2025-08-28 20:10:55 +10:00
rustc_infer Add tracing to [workspace.dependencies]. 2025-08-27 14:21:19 +10:00
rustc_interface Move NativeLibKind from rustc_session to rustc_hir 2025-08-27 20:24:59 +02:00
rustc_lexer fix(lexer): Don't require frontmatters to be escaped with indented fences 2025-08-28 14:08:33 -05:00
rustc_lint Rollup merge of #145941 - Urgau:int_to_ptr_transmutes-unsized, r=lcnr 2025-08-28 23:10:37 +10:00
rustc_lint_defs Fix stage 1 compiler tests 2025-08-30 15:28:41 +02:00
rustc_llvm Rollup merge of #145947 - nnethercote:workspace-members-2, r=Kobzol 2025-08-29 12:54:12 +10:00
rustc_log Add tracing to [workspace.dependencies]. 2025-08-27 14:21:19 +10:00
rustc_macros Add proc-macro2 and quote to [workspace.dependencies]. 2025-08-28 20:10:55 +10:00
rustc_metadata Rollup merge of #145947 - nnethercote:workspace-members-2, r=Kobzol 2025-08-29 12:54:12 +10:00
rustc_middle Rollup merge of #146042 - estebank:issue-83413, r=lcnr 2025-09-01 12:42:26 +10:00
rustc_mir_build Introduce MirDumper and MirWriter. 2025-09-01 09:19:03 +10:00
rustc_mir_dataflow Introduce MirDumper and MirWriter. 2025-09-01 09:19:03 +10:00
rustc_mir_transform Auto merge of #146077 - Zalathar:rollup-l7ip5yi, r=Zalathar 2025-09-01 07:44:42 +00:00
rustc_monomorphize Auto merge of #143290 - azhogin:azhogin/link-pub-async-impls, r=oli-obk 2025-09-01 10:54:40 +00:00
rustc_next_trait_solver Auto merge of #145978 - Zalathar:rollup-0dzk72g, r=Zalathar 2025-08-29 03:40:14 +00:00
rustc_parse Auto merge of #145582 - estebank:issue-107806, r=chenyukang 2025-08-31 03:00:54 +00:00
rustc_parse_format Rollup merge of #145592 - nilotpal-n7:fix-format-alignment, r=lcnr 2025-08-31 13:40:35 +02:00
rustc_passes Rollup merge of #142472 - GuillaumeGomez:doc-attribute-attribute, r=fmease 2025-08-28 21:41:00 +02:00
rustc_pattern_analysis Add rustc-hash to [workspace.dependencies]. 2025-08-28 20:11:43 +10:00
rustc_privacy Add tracing to [workspace.dependencies]. 2025-08-27 14:21:19 +10:00
rustc_proc_macro Add rustc-literal-escaper to [workspace.dependencies]. 2025-08-27 13:59:32 +10:00
rustc_public Add scoped-tls to [workspace.dependencies]. 2025-08-28 20:12:16 +10:00
rustc_public_bridge Remove useless lifetime parameter. 2025-07-23 23:54:37 +00:00
rustc_query_impl Add measureme to [workspace.dependencies]. 2025-08-28 20:12:14 +10:00
rustc_query_system Add tracing to [workspace.dependencies]. 2025-08-27 14:21:19 +10:00
rustc_resolve resolve: Merge ExternPreludeEntry::only_item into flag_binding 2025-08-29 18:42:04 +03:00
rustc_sanitizers Add tracing to [workspace.dependencies]. 2025-08-27 14:21:19 +10:00
rustc_serialize Add indexmap to [workspace.dependencies]. 2025-08-28 20:10:55 +10:00
rustc_session Rollup merge of #145947 - nnethercote:workspace-members-2, r=Kobzol 2025-08-29 12:54:12 +10:00
rustc_span Rollup merge of #145756 - okaneco:stabilize_char_boundary, r=scottmcm 2025-08-29 19:33:03 -05:00
rustc_symbol_mangling Add rustc-demangle to [workspace.dependencies]. 2025-08-28 20:12:16 +10:00
rustc_target Rollup merge of #144443 - WaffleLapkin:integer-target-pointer-width, r=Noratrieb 2025-08-31 13:40:34 +02:00
rustc_thread_pool Add scoped-tls to [workspace.dependencies]. 2025-08-28 20:12:16 +10:00
rustc_trait_selection Split ObligationCauseCode::BinOp for unops to UnOp 2025-08-31 21:13:12 +00:00
rustc_traits Add tracing to [workspace.dependencies]. 2025-08-27 14:21:19 +10:00
rustc_transmute Add itertools to [workspace.dependencies]. 2025-08-27 14:21:21 +10:00
rustc_ty_utils Add itertools to [workspace.dependencies]. 2025-08-27 14:21:21 +10:00
rustc_type_ir Auto merge of #145978 - Zalathar:rollup-0dzk72g, r=Zalathar 2025-08-29 03:40:14 +00:00
rustc_type_ir_macros Add proc-macro2 and quote to [workspace.dependencies]. 2025-08-28 20:10:55 +10:00