Consider the following invalid Rust code. There is one struct Foo
that contains a reference to a second struct Bar
:
struct Foo<\'a&g
No, there is no such syntax, other than what you have typed.
For the details of how long a temporary lives when you take a reference to it, see:
There will be a parent struct owning both the
bar
and thefoo
s referencing it.
Good luck: