--- a/pallets/common/src/lib.rs +++ b/pallets/common/src/lib.rs @@ -875,7 +875,7 @@ enum LazyValueState<'a, T> { Pending(Box T + 'a>), - InProgress(PhantomData>), + InProgress, Computed(T), } @@ -930,13 +930,9 @@ return; } - match sp_std::mem::replace(&mut self.state, InProgress(PhantomData)) { + match sp_std::mem::replace(&mut self.state, InProgress) { Pending(f) => self.state = Computed(f()), - _ => { - // Computed is ruled out by the above condition - // InProgress is ruled out by not implementing Sync and absence of recursion - unreachable!() - } + _ => panic!("recursion isn't supported"), } } }