File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -18,7 +18,7 @@ impl Pty {
1818 /// The provided file descriptor must be valid, open, and belong to a pty.
1919 #[ must_use]
2020 pub unsafe fn from_fd ( fd : std:: os:: fd:: OwnedFd ) -> Self {
21- Self ( crate :: sys:: Pty :: from_fd ( fd) )
21+ unsafe { Self ( crate :: sys:: Pty :: from_fd ( fd) ) }
2222 }
2323
2424 /// Change the terminal size associated with the pty.
@@ -93,7 +93,7 @@ impl Pts {
9393 /// child end of a pty.
9494 #[ must_use]
9595 pub unsafe fn from_fd ( fd : std:: os:: fd:: OwnedFd ) -> Self {
96- Self ( crate :: sys:: Pts :: from_fd ( fd) )
96+ unsafe { Self ( crate :: sys:: Pts :: from_fd ( fd) ) }
9797 }
9898}
9999
Original file line number Diff line number Diff line change @@ -30,9 +30,9 @@ impl Pty {
3030 /// # Errors
3131 /// Returns an error if it fails to be registered with the async runtime.
3232 pub unsafe fn from_fd ( fd : std:: os:: fd:: OwnedFd ) -> crate :: Result < Self > {
33- Ok ( Self ( tokio:: io:: unix:: AsyncFd :: new (
34- crate :: sys:: Pty :: from_fd ( fd) ,
35- ) ?) )
33+ Ok ( Self ( tokio:: io:: unix:: AsyncFd :: new ( unsafe {
34+ crate :: sys:: Pty :: from_fd ( fd)
35+ } ) ?) )
3636 }
3737
3838 /// Change the terminal size associated with the pty.
@@ -163,7 +163,7 @@ impl Pts {
163163 /// child end of a pty.
164164 #[ must_use]
165165 pub unsafe fn from_fd ( fd : std:: os:: fd:: OwnedFd ) -> Self {
166- Self ( crate :: sys:: Pts :: from_fd ( fd) )
166+ Self ( unsafe { crate :: sys:: Pts :: from_fd ( fd) } )
167167 }
168168}
169169
Original file line number Diff line number Diff line change @@ -138,7 +138,9 @@ impl Pts {
138138 ) )
139139 }
140140
141- pub fn session_leader ( & self ) -> impl FnMut ( ) -> std:: io:: Result < ( ) > {
141+ pub fn session_leader (
142+ & self ,
143+ ) -> impl FnMut ( ) -> std:: io:: Result < ( ) > + use < > {
142144 let pts_fd = self . 0 . as_raw_fd ( ) ;
143145 move || {
144146 rustix:: process:: setsid ( ) ?;
You can’t perform that action at this time.
0 commit comments