It's likely this is more a misunderstanding than a real issue, however the following gives borrow checker failures despite being seemingly legitimate according to the documentation.
This is the sort of thing you might do if you wanted to represent a tree, where a head node had a set of children, each of those has grandchildren and so forth.
error[E0597]: `arena` does not live long enough
--> test.rs:17:9
|
17 | foo(&arena);
| ^^^^^^ borrowed value does not live long enough
18 | }
| -
| |
| `arena` dropped here while still borrowed
| borrow might be used here, when `arena` is dropped and runs the destructor for type `Arena<Thing<'_>>`
For more information about this error, try `rustc --explain E0597`.
Plausibly this is related to what's going on inside intrusive_adapter.
It's likely this is more a misunderstanding than a real issue, however the following gives borrow checker failures despite being seemingly legitimate according to the documentation.
This is the sort of thing you might do if you wanted to represent a tree, where a head node had a set of children, each of those has grandchildren and so forth.
This gives the following output:
Plausibly this is related to what's going on inside
intrusive_adapter
.