aboutsummaryrefslogtreecommitdiff
path: root/mingling_macros/src/func/gen_program.rs
diff options
context:
space:
mode:
author魏曹先生 <1992414357@qq.com>2026-07-28 19:10:17 +0800
committer魏曹先生 <1992414357@qq.com>2026-07-28 19:10:17 +0800
commitbf35af6bbf30492bcd23eb6103fdac3382dd6d33 (patch)
treedb4485c91a78ce1219f9c7774a2988ccce2897be /mingling_macros/src/func/gen_program.rs
parent045c6aab213aadf4dbb66270ec0d203d7ec762a6 (diff)
refactor(pathf): move type resolution from compile-time to build-time
Diffstat (limited to 'mingling_macros/src/func/gen_program.rs')
-rw-r--r--mingling_macros/src/func/gen_program.rs10
1 files changed, 10 insertions, 0 deletions
diff --git a/mingling_macros/src/func/gen_program.rs b/mingling_macros/src/func/gen_program.rs
index c5358bc..6b6a643 100644
--- a/mingling_macros/src/func/gen_program.rs
+++ b/mingling_macros/src/func/gen_program.rs
@@ -15,6 +15,15 @@ pub(crate) fn gen_program_impl(_input: TokenStream) -> TokenStream {
#[cfg(not(feature = "comp"))]
let comp_gen = quote! {};
+ // When pathf is enabled, include the type_using.rs generated by the build
+ // script so that types from submodules are in scope for gen_program!().
+ #[cfg(feature = "pathf")]
+ let pathf_include = quote! {
+ include!(concat!(env!("OUT_DIR"), "/", env!("CARGO_PKG_NAME"), "/type_using.rs"));
+ };
+ #[cfg(not(feature = "pathf"))]
+ let pathf_include = quote! {};
+
TokenStream::from(quote! {
/// Alias for the current program type `crate::ThisProgram`
pub type Next = ::mingling::ChainProcess<crate::ThisProgram>;
@@ -40,6 +49,7 @@ pub(crate) fn gen_program_impl(_input: TokenStream) -> TokenStream {
}
}
+ #pathf_include
#comp_gen
::mingling::macros::program_fallback_gen!();
::mingling::macros::program_final_gen!();