You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
But because of the GAT the bound 'de: 'a is not added for A.
I know it's possible to use #[serde(bound = "'de: 'a")] but it's surprising the bounds used by GAT are ignored.
traitTrait{typeGat<'a>;}structFoo;implTraitforFoo{typeGat<'a> = &'a str;}structGoo;implTraitforGoo{typeGat<'a> = String;}#[derive(serde::Deserialize)]structA<'a>{x: <FooasTrait>::Gat<'a>,// lifetime may not live long enough consider adding the following bound: `'de: 'a`y: <GooasTrait>::Gat<'a>,// this one is OK}#[derive(serde::Deserialize)]structB<'a>{x:&'a str,// no problem when inlined}
I'm trying to use Generic Associated Types in structure that derive
serde::Deserialize
.But because of the GAT the bound
'de: 'a
is not added forA
.I know it's possible to use
#[serde(bound = "'de: 'a")]
but it's surprising the bounds used by GAT are ignored.Output of
cargo expand
The text was updated successfully, but these errors were encountered: