Generic associated type may not live long enough
问题 Take the following example (Playground): #![feature(generic_associated_types)] #![allow(incomplete_features)] trait Produce { type CustomError<'a>; fn produce<'a>(&'a self) -> Result<(), Self::CustomError<'a>>; } struct GenericProduce<T> { val: T, } struct GenericError<'a, T> { producer: &'a T, } impl<T> Produce for GenericProduce<T> { type CustomError<'a> = GenericError<'a, T>; fn produce<'a>(&'a self) -> Result<(), Self::CustomError<'a>> { Err(GenericError{producer: &self.val}) } } The