diff --git a/lib/src/evolution.rs b/lib/src/evolution.rs index 4a4b78826..c899cf683 100644 --- a/lib/src/evolution.rs +++ b/lib/src/evolution.rs @@ -309,7 +309,7 @@ impl<'r> ReadonlyEvolution<'r> { } } -pub struct MutableEvolution<'r, 'm: 'r> { +pub struct MutableEvolution<'r: 'm, 'm> { repo: &'m MutableRepo<'r>, state: State, } diff --git a/lib/src/transaction.rs b/lib/src/transaction.rs index 3de8c6686..1e8fd6f5d 100644 --- a/lib/src/transaction.rs +++ b/lib/src/transaction.rs @@ -219,8 +219,10 @@ impl<'r> Repo for MutableRepo<'r> { } } -impl MutableRepo<'_> { - pub fn evolution_mut(&mut self) -> &MutableEvolution { - self.evolution.as_mut().unwrap() +impl<'r> MutableRepo<'r> { + pub fn evolution_mut<'m>(&'m mut self) -> &'m mut MutableEvolution<'r, 'm> { + let evolution: &mut MutableEvolution<'static, 'static> = self.evolution.as_mut().unwrap(); + let evolution: &mut MutableEvolution<'r, 'm> = unsafe { std::mem::transmute(evolution) }; + evolution } }