Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save vitvakatu/0ace3cd5510a16513a368b3f79f76159 to your computer and use it in GitHub Desktop.
Save vitvakatu/0ace3cd5510a16513a368b3f79f76159 to your computer and use it in GitHub Desktop.
error: borrowed value does not live long enough
--> src/lib.rs:59:15
|
59 | (&mut self.sub_ref.drain(..), &mut self.epoch.as_mut_slice())
| ^^^^^^^^^^^^^^^^^^^^^^ does not live long enough
60 | }
| - temporary value only lives until here
|
note: borrowed value must be valid for the anonymous lifetime #1 defined on the body at 58:75...
--> src/lib.rs:58:76
|
58 | fn drain_sub(&mut self) -> (&mut std::vec::Drain<usize>, &mut [Epoch]) {
| ____________________________________________________________________________^
59 | | (&mut self.sub_ref.drain(..), &mut self.epoch.as_mut_slice())
60 | | }
| |_____^
error: borrowed value does not live long enough
--> src/lib.rs:59:44
|
59 | (&mut self.sub_ref.drain(..), &mut self.epoch.as_mut_slice())
| ^^^^^^^^^^^^^^^^^^^^^^^^^ does not live long enough
60 | }
| - temporary value only lives until here
|
note: borrowed value must be valid for the anonymous lifetime #1 defined on the body at 58:75...
--> src/lib.rs:58:76
|
58 | fn drain_sub(&mut self) -> (&mut std::vec::Drain<usize>, &mut [Epoch]) {
| ____________________________________________________________________________^
59 | | (&mut self.sub_ref.drain(..), &mut self.epoch.as_mut_slice())
60 | | }
| |_____^
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment