From b57f065ace64d9e173921a367c3f2d53190cc325 Mon Sep 17 00:00:00 2001 From: Imbris Date: Mon, 24 Apr 2023 22:09:20 -0400 Subject: [PATCH] Fix error in dyn_sys_data example that only appears with the MSRV --- examples/dyn_sys_data.rs | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/examples/dyn_sys_data.rs b/examples/dyn_sys_data.rs index c925669..93e5fc8 100644 --- a/examples/dyn_sys_data.rs +++ b/examples/dyn_sys_data.rs @@ -61,10 +61,14 @@ impl<'a> System<'a> for DynamicSystem { .writes .iter_mut() .map(|resource| { - meta.get_mut(&mut **resource).expect( + // For some reason this needs a type ascription, otherwise Rust will think it's + // a `&mut (Reflaction + '_)` (as opposed to `&mut (Reflection + 'static)`. (Note this + // isn't needed in newer rust version but fails on the MSRV of 1.59.0). + let res: &mut dyn Reflection = meta.get_mut(&mut **resource).expect( "Not registered in meta \ table", - ) + ); + res }) .collect();