I am attempting to create a MergedObject from two objects (a SimpleObject, and an Object) with explicit lifetime parameters; however, this fails to compile with "implicit elided lifetime not allowed here". Removing the #[derive(MergedObject)] will allow the crate to compile. Does this mean that MergedObjects cannot support explicit lifetimes? (I checked the book, but I didn't see this as a restriction of MergedObjects, so I wonder if maybe I am just doing something wrong.)
Some example code:
#[derive(SimpleObject)]
struct ObjectA<'a> {
field_a: &'a str
}
#[derive(SimpleObject)]
struct ObjectB<'a> {
field_b: &'a str
}
#[derive(MergedObject)] # fails with "implicit elided lifetime not allowed here"
pub struct Object<'a>(ObjectA<'a>, ObjectB<'a>);
I will solve this problem later.
Fixed, here is the test code.
Awesome! Thanks for the super quick resolution :)
Most helpful comment
Fixed, here is the test code.
https://github.com/async-graphql/async-graphql/blob/7c62b10ebcda3df12cdfc91695286e362ae3bd58/tests/merged_object.rs#L341