4 ms·
It's a useful lesson in that Rust's correctness relies on certain notions of borrowing dependencies which don't necessarily match what you assume. Especially th
by mathw 9y ago
It's a useful lesson in that Rust's correctness relies on certain notions of borrowing dependencies which don't necessarily match what you assume. Especially that the lifecycle dependency across a function call is essentially opaque to the compiler.
Which is how it has to be, or you could never state anything sane about the lifecycle when you return a reference.