From cd4219fae7f29b9c3d96aee640cefb6b2639e1a8 Mon Sep 17 00:00:00 2001 From: HampusM Date: Fri, 12 Jun 2026 22:13:14 +0200 Subject: fix(engine): make Reflection derive macro add Reflection type param bounds --- engine-macros/src/util.rs | 24 ++++++++++++++++++++++-- 1 file changed, 22 insertions(+), 2 deletions(-) (limited to 'engine-macros/src/util.rs') diff --git a/engine-macros/src/util.rs b/engine-macros/src/util.rs index 515b066..327c517 100644 --- a/engine-macros/src/util.rs +++ b/engine-macros/src/util.rs @@ -7,8 +7,8 @@ macro_rules! syn_path { ::syn::Path { leading_colon: None, segments: ::syn::punctuated::Punctuated::from_iter([ - syn_path_segment!($first_segment), - $(syn_path_segment!($segment),)* + $crate::util::syn_path_segment!($first_segment), + $($crate::util::syn_path_segment!($segment),)* ]) } }; @@ -26,6 +26,9 @@ macro_rules! syn_path_segment { }; } +pub(crate) use syn_path; +pub(crate) use syn_path_segment; + pub fn find_engine_crate_path() -> Option { let cargo_crate_name = std::env::var("CARGO_CRATE_NAME").ok()?; @@ -63,3 +66,20 @@ pub fn syn_path_to_string(path: &syn::Path) -> String output } + +pub trait SynPathExt +{ + fn join(&self, tail: Self) -> Self; +} + +impl SynPathExt for syn::Path +{ + fn join(&self, tail: Self) -> Self + { + let mut new = self.clone(); + + new.segments.extend(tail.segments); + + new + } +} -- cgit v1.2.3-18-g5258