Skip to content

Commit b57f065

Browse files
committed
Fix error in dyn_sys_data example that only appears with the MSRV
1 parent d308be2 commit b57f065

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

examples/dyn_sys_data.rs

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,10 +61,14 @@ impl<'a> System<'a> for DynamicSystem {
6161
.writes
6262
.iter_mut()
6363
.map(|resource| {
64-
meta.get_mut(&mut **resource).expect(
64+
// For some reason this needs a type ascription, otherwise Rust will think it's
65+
// a `&mut (Reflaction + '_)` (as opposed to `&mut (Reflection + 'static)`. (Note this
66+
// isn't needed in newer rust version but fails on the MSRV of 1.59.0).
67+
let res: &mut dyn Reflection = meta.get_mut(&mut **resource).expect(
6568
"Not registered in meta \
6669
table",
67-
)
70+
);
71+
res
6872
})
6973
.collect();
7074

0 commit comments

Comments
 (0)