tfa: serde tools: improve variance and dropck

`FoldSeqVisitor` doesn't actually own a `T` and therefore
cannot drop a `T`, we only use it via the `Fn(&mut Out, T)`,
so use `fn(T)` in the `PhantomData` to keep `T`
contravariant.

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
This commit is contained in:
Wolfgang Bumiller 2022-03-22 12:29:59 +01:00
parent 6221d86c64
commit f04eb949d1

View File

@ -17,7 +17,7 @@ where
init: Option<Init>,
closure: F,
expecting: &'static str,
_ty: PhantomData<T>,
_ty: PhantomData<fn(T)>,
}
impl<T, Out, F, Init> FoldSeqVisitor<T, Out, F, Init>