mirror of
https://github.com/neondatabase/neon.git
synced 2026-05-19 22:20:37 +00:00
error[E0521]: borrowed data escapes outside of method
--> repro-problem/src/virtual_file.rs:702:51
|
692 | impl<'a> FileGuard<'a> {
| -- lifetime `'a` defined here
...
695 | fn with_std_file<F, R>(&mut self, with: F) -> R
| --------- `self` is a reference that is only valid in the method body
...
702 | let mut file = unsafe { File::from_raw_fd(self.as_ref().as_raw_fd()) };
| ^^^^^^^^^^^^^
| |
| `self` escapes the method body here
| argument requires that `'a` must outlive `'static`
|
= note: requirement occurs because of a mutable reference to `FileGuard<'_>`
= note: mutable references are invariant over their type parameter
= help: see <https://doc.rust-lang.org/nomicon/subtyping.html> for more information about variance