From 2cf686f2cdd6446a3cd47df0305ead40fabe85df Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rg=20Thalheim?= Date: Sun, 26 Mar 2017 18:54:08 +0200 Subject: [PATCH 01/14] Implement AsRawFd/IntoRawFd for RawFd This is useful to build os abstraction like the nix crate does. It allows to define functions, which accepts generic arguments of data structures convertible to RawFd, including RawFd itself. For example: fn write(fd: FD, buf: &[u8]) -> Result instead of: fn write(fd: RawFd, buf: &[u8]) -> Result write(foo.as_raw_fd(), buf); --- src/libstd/sys/unix/ext/io.rs | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/src/libstd/sys/unix/ext/io.rs b/src/libstd/sys/unix/ext/io.rs index 296235e173d13..75aa72e3cff8c 100644 --- a/src/libstd/sys/unix/ext/io.rs +++ b/src/libstd/sys/unix/ext/io.rs @@ -72,6 +72,13 @@ pub trait IntoRawFd { fn into_raw_fd(self) -> RawFd; } +#[stable(feature = "rust1", since = "1.0.0")] +impl AsRawFd for RawFd { + fn as_raw_fd(&self) -> RawFd { + *self + } +} + #[stable(feature = "rust1", since = "1.0.0")] impl AsRawFd for fs::File { fn as_raw_fd(&self) -> RawFd { @@ -84,6 +91,14 @@ impl FromRawFd for fs::File { fs::File::from_inner(sys::fs::File::from_inner(fd)) } } + +#[stable(feature = "into_raw_os", since = "1.4.0")] +impl IntoRawFd for RawFd { + fn into_raw_fd(self) -> RawFd { + self + } +} + #[stable(feature = "into_raw_os", since = "1.4.0")] impl IntoRawFd for fs::File { fn into_raw_fd(self) -> RawFd { From 2040daee472033ae5a0d369ae05bd07706595854 Mon Sep 17 00:00:00 2001 From: Wesley Wiser Date: Thu, 23 Mar 2017 23:05:30 -0400 Subject: [PATCH 02/14] Make the rustdoc sidebar white on `src` pages Fixes #40724 --- src/librustdoc/html/layout.rs | 4 ++-- src/librustdoc/html/static/rustdoc.css | 6 +++--- src/librustdoc/html/static/styles/main.css | 4 ++++ 3 files changed, 9 insertions(+), 5 deletions(-) diff --git a/src/librustdoc/html/layout.rs b/src/librustdoc/html/layout.rs index 06a816412969b..d6033a69da786 100644 --- a/src/librustdoc/html/layout.rs +++ b/src/librustdoc/html/layout.rs @@ -54,7 +54,7 @@ r##" {favicon} {in_header} - +