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
It's (I think) have save root of problem like in my previous issue #2771.
first try
traitSomeTrait<'a>:Serialize + Deserialize<'a>{typeSomeType:Serialize + Deserialize<'a>;// ...}#[derive(Serialize,Deserialize)]// I must use it because I don't have access to 'de lifetime#[serde(bound(deserialize = "T: SomeTrait<'de>"))]structSomeStruct<T>{a:T,field2:T::SomeType,}
COMPILE ERROR!!!: associated type SomeType not found for T
second try
#[derive(Serialize,Deserialize)]#[serde(bound(deserialize = "T: SomeTrait<'de>"))]structSomeStruct<T>{a:T,// COMPILE ERROR!!!: associated type `SomeType` not found for `T`field2:T::SomeType,}
... some other errors,
help: use fully-qualified syntax to disambiguate
|
14 | field2: <T as SomeTrait<'a>>::SomeType,
| ~~~~~~~~~~~~~~~~~~~~~~
help: use fully-qualified syntax to disambiguate
|
14 | field2: <T as SomeTrait<'de>>::SomeType,
| ~~~~~~~~~~~~~~~~~~~~~~~
hmm.. compiler see <T as SomeTrait<'de>>::SomeType?
third try
#[derive(Serialize,Deserialize)]#[serde(bound(deserialize = "T: SomeTrait<'de>"))]structSomeStruct<T>{a:T,// COMPILE ERROR!!!: associated type `SomeType` not found for `T`field2: <TasSomeTrait<'de>>::SomeType,}
It's (I think) have save root of problem like in my previous issue #2771.
first try
COMPILE ERROR!!!: associated type
SomeType
not found forT
second try
... some other errors,
help: use fully-qualified syntax to disambiguate
|
14 | field2: <T as SomeTrait<'a>>::SomeType,
| ~~~~~~~~~~~~~~~~~~~~~~
help: use fully-qualified syntax to disambiguate
|
14 | field2: <T as SomeTrait<'de>>::SomeType,
| ~~~~~~~~~~~~~~~~~~~~~~~
hmm.. compiler see <T as SomeTrait<'de>>::SomeType?
third try
aghh...
14 | field2: <T as SomeTrait<'de>>::SomeType,
| ^^^ undeclared lifetime
Ok, I know how to make it work:
BUT
'a
twice.The text was updated successfully, but these errors were encountered: