Skip to content
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

Rollup of 6 pull requests #95101

Merged
merged 24 commits into from
Mar 19, 2022
Merged
Changes from 1 commit
Commits
Show all changes
24 commits
Select commit Hold shift click to select a range
4038ca0
Refactor tests of Write for Cursor<_>
cuviper Jan 8, 2022
a04d553
impl Write for Cursor<[u8; N]>
cuviper Jan 19, 2022
38cef65
Write for Cursor with a custom Allocator
cuviper Jan 20, 2022
6706ab8
keyword_docs: document use of `in` with `pub` keyword
mfrw Feb 6, 2022
d4686c6
Use verbatim paths for `process::Command` if necessary
ChrisDenton Jan 5, 2022
93f627d
Keep the path after `program_exists` succeeds
ChrisDenton Feb 17, 2022
ee02f01
Consistently present absent stdio handles on Windows as NULL handles.
sunfishcode Jan 21, 2022
7dd3246
Fix a compilation error.
sunfishcode Jan 25, 2022
7ddf41c
Remove redundant code for handling NULL handles on Windows.
sunfishcode Mar 2, 2022
7a74d28
fix return values in L4Re networking stub
humenda Jun 18, 2020
11b7176
fix return value of LookupHost::port()
humenda Dec 5, 2018
898f379
drop unused libc imports on L4Re
atopia May 31, 2021
c0dc41f
L4Re does not support sanitizing standard streams
atopia Jun 2, 2021
997dc58
adapt L4Re network interface mock to #87329
atopia Oct 18, 2021
cb013d4
put L4Re specifics into their own platform
atopia Oct 18, 2021
bc199b5
add as_raw() method to L4Re's Socket mock
atopia Jan 14, 2022
7d44316
Bump impl Write for Cursor<[u8; N]> to 1.61
dtolnay Mar 18, 2022
d5fe4ca
add CStr::from_bytes_until_nul
ericseppanen Mar 15, 2022
ba2d5ed
Rollup merge of #92519 - ChrisDenton:command-maybe-verbatim, r=dtolnay
Dylan-DPC Mar 19, 2022
a87590e
Rollup merge of #92612 - atopia:update-lib-l4re, r=dtolnay
Dylan-DPC Mar 19, 2022
e9f63fd
Rollup merge of #92663 - cuviper:generic-write-cursor, r=dtolnay
Dylan-DPC Mar 19, 2022
fe55eee
Rollup merge of #93263 - sunfishcode:sunfishcode/detatched-console-ha…
Dylan-DPC Mar 19, 2022
463e516
Rollup merge of #93692 - mfrw:mfrw/document-keyword-in, r=dtolnay
Dylan-DPC Mar 19, 2022
30b4182
Rollup merge of #94984 - ericseppanen:cstr_from_bytes, r=Mark-Simulacrum
Dylan-DPC Mar 19, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
adapt L4Re network interface mock to #87329
Copy the relevant trait implementations from the Unix default.
  • Loading branch information
atopia committed Mar 9, 2022
commit 997dc5899a0549ca6a6fe007ae1150ae4fccd728
43 changes: 34 additions & 9 deletions library/std/src/sys/unix/l4re.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 13,7 @@ pub mod net {
use crate::fmt;
use crate::io::{self, IoSlice, IoSliceMut};
use crate::net::{Ipv4Addr, Ipv6Addr, Shutdown, SocketAddr};
use crate::os::unix::io::{AsFd, AsRawFd, BorrowedFd, FromRawFd, IntoRawFd, RawFd};
use crate::sys::fd::FileDesc;
use crate::sys_common::{AsInner, FromInner, IntoInner};
use crate::time::Duration;
Expand Down Expand Up @@ -123,21 124,45 @@ pub mod net {
}
}

impl AsInner<libc::c_int> for Socket {
fn as_inner(&self) -> &libc::c_int {
self.0.as_inner()
impl AsInner<FileDesc> for Socket {
fn as_inner(&self) -> &FileDesc {
&self.0
}
}

impl FromInner<libc::c_int> for Socket {
fn from_inner(fd: libc::c_int) -> Socket {
Socket(FileDesc::new(fd))
impl FromInner<FileDesc> for Socket {
fn from_inner(file_desc: FileDesc) -> Socket {
Socket(file_desc)
}
}

impl IntoInner<libc::c_int> for Socket {
fn into_inner(self) -> libc::c_int {
self.0.into_raw()
impl IntoInner<FileDesc> for Socket {
fn into_inner(self) -> FileDesc {
self.0
}
}

impl AsFd for Socket {
fn as_fd(&self) -> BorrowedFd<'_> {
self.0.as_fd()
}
}

impl AsRawFd for Socket {
fn as_raw_fd(&self) -> RawFd {
self.0.as_raw_fd()
}
}

impl IntoRawFd for Socket {
fn into_raw_fd(self) -> RawFd {
self.0.into_raw_fd()
}
}

impl FromRawFd for Socket {
unsafe fn from_raw_fd(raw_fd: RawFd) -> Self {
Self(FromRawFd::from_raw_fd(raw_fd))
}
}

Expand Down