7 ms·
This is handled by the borrow checker, the same as anything else that might hold references to stack data - you get a compiler error and then can decide how to
by Rusky 10y ago
This is handled by the borrow checker, the same as anything else that might hold references to stack data - you get a compiler error and then can decide how to resolve the conflict, either by extending the lifetime of the referent (perhaps by boxing, or creating it earlier in the call stack), or by shrinking the lifetime of the future.