Closed
Description
This playpen code snippet now fails in compile : playpen
with error
<anon>:23:26: 23:46 error: `long_enough_lifetime` does not live long enough
<anon>:23 handle.set_data(&long_enough_lifetime); // This is OK
^~~~~~~~~~~~~~~~~~~~
<anon>:17:34: 27:2 note: reference must be valid for the block suffix following statement 0 at 17:33...
But if you just swap the following 2 lines, line 17 with line 18, it compiles fine.
let long_enough_lifetime = DropCanary{label:"long"};
let mut handle = Handle(None);
Metadata
Metadata
Assignees
Labels
No labels