From ee5daec60b373210cb5b8de93959394b4b605382 Mon Sep 17 00:00:00 2001 From: HampusM Date: Thu, 16 Jul 2026 20:32:38 +0200 Subject: fix(engine-macros): allow unreachable code in struct reflection try_get_field_mut --- engine-macros/src/reflection/struct_impl.rs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'engine-macros') diff --git a/engine-macros/src/reflection/struct_impl.rs b/engine-macros/src/reflection/struct_impl.rs index 8617874..1cd9fb8 100644 --- a/engine-macros/src/reflection/struct_impl.rs +++ b/engine-macros/src/reflection/struct_impl.rs @@ -142,7 +142,9 @@ fn gen_impl( #get_default_value_fn }, cast_dyn_any: |ptr| ptr.cast::(), - try_get_field_mut: |target, field_index| { + try_get_field_mut: |target, field_index| { { + #![allow(unreachable_code)] + let target = target .downcast_mut::() .ok_or(GetError::WrongTargetType)?; @@ -157,7 +159,7 @@ fn gen_impl( }; Ok(field) - }, + } }, } ) }; -- cgit v1.2.3-18-g5258