-
Notifications
You must be signed in to change notification settings - Fork 682
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
PollFd::new requires too restrictive lifetime #2118
Comments
Duplicate of #2130 |
Oops; I read this too fast. It's not a duplicate. |
asomers
added a commit
that referenced
this issue
Sep 23, 2023
asomers
added a commit
that referenced
this issue
Sep 23, 2023
asomers
added a commit
that referenced
this issue
Sep 23, 2023
asomers
added a commit
that referenced
this issue
Sep 23, 2023
asomers
added a commit
that referenced
this issue
Sep 29, 2023
asomers
added a commit
that referenced
this issue
Sep 30, 2023
github-merge-queue bot
pushed a commit
that referenced
this issue
Oct 1, 2023
* Relax lifetime requirements for PollFd::new Fixes #2118 * Take BorrowedFd as the argument for PollFd::new &AsFd didn't work because there are 'static types, like std::fs::File, which implement AsFd. The created BorrowedFd type within the PollFd::new method would have a very brief lifetime, but the PhantomData would capture the lifetime of the std::fs::File. Taking BorrowFd<'fd> argument makes the lifetime explicit. * fix legacy comment --------- Co-authored-by: Steve Lau <stevelauc@outlook.com>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I was trying to do
where
status_cmd_fd()
returnsOption<BorrowedFd<'_>>
. This code does not compile because the reference&cmd_fd
does not live long enough, but the lifetime of the reference should be irrelevant.Current signature of
PollFd::new
isI think it should probably be
The text was updated successfully, but these errors were encountered: