Here's another problem where the compiler tells me I need a static lifetime, but I shouldn't need one.
The idea here is that World owns many ViewableObjects, which it keeps in a Vec.
ViewableObjects are dyn trait objects of various types. Here in the playground version the only ViewableObject type is Primitive.
Up at the top, something external calls processudppkt, which takes in "decoder", which is of an impl of DecoderUser. That object owns World.
What's strange about this is is that the error reported is about "decoder". But the problem seems to be further down. If the ViewableObject part is done with a plain structure instead of a trait, the compiler is happy.
Is there some way to get more info from the compiler about these deep errors? "cargo build --verbose" does not seem to help. Thanks.
error[E0477]: the type `PacketLogDecoder<'a>` does not fulfill the required lifetime --> src/lib.rs:34:29 | 34 | DecoderUser::udpindummy(decoder); // pass to decoder | ^^^^^^^ | = note: type must satisfy the static lifetime error: aborting due to previous error