Thanks to visit codestin.com
Credit goes to github.com

Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
35 commits
Select commit Hold shift + click to select a range
e720f42
See also X-Link mem::{swap, take, replace}
Havvy Aug 2, 2020
7835c8c
docs(marker/copy): clarify that `&T` is also `Copy`
janriemer Aug 2, 2020
9b0f3d1
Fix documentation error
jack-champagne Aug 13, 2020
a876b3d
docs(marker/copy): provide example for `&T` being `Copy`
janriemer Aug 16, 2020
43dec0e
rephrase: struct -> type
janriemer Aug 16, 2020
dce8644
add back emojis that have been removed accidentally
janriemer Aug 16, 2020
9061da2
add empty line above code block
janriemer Aug 16, 2020
56daf63
docs: add `derive` for struct
janriemer Aug 16, 2020
b0eb55a
Add test demonstrating the issue.
jumbatm Aug 15, 2020
db75313
Fix stack overflow for recursive types.
jumbatm Aug 15, 2020
154b74e
Actually introduce a cycle in Reffy test.
jumbatm Aug 16, 2020
a1fa4e0
Remove unnecessary rebinding of def ids.
jumbatm Aug 16, 2020
80c2c80
Remove structural equiv check for Array const.
jumbatm Aug 16, 2020
bca48ad
Reduce indentation by replacing match arm w/ early return.
jumbatm Aug 16, 2020
6c57de1
Don't memoize seen types.
jumbatm Aug 16, 2020
7708abb
Avoid double hashset lookup.
jumbatm Aug 16, 2020
1321a2d
Also accept Refs for is_primitive_or_pointer
jumbatm Aug 16, 2020
bc15dd6
Wrap recursion in `ensure_sufficient_stack`.
jumbatm Aug 17, 2020
431a465
Move to intra doc links for keyword documentation
poliorcetics Aug 17, 2020
4f9cd74
Resolve true and false as booleans
jyn514 Aug 17, 2020
d9d84dc
Add doc examples count for --show-coverage
GuillaumeGomez Aug 18, 2020
f957bae
Update rustdoc-ui tests
GuillaumeGomez Aug 18, 2020
522d177
docs: add another `derive` for `Copy`able struct
Aug 18, 2020
ff73a40
Don't emit "is not a logical operator" error outside of associative e…
tgnottingham Aug 18, 2020
3e3a2c8
Switch to intra-doc links in /src/sys/unix/ext/*.rs
nixphix Aug 18, 2020
63d2e9b
resolve comments
nixphix Aug 19, 2020
17d3ce4
Rollup merge of #75038 - rust-lang:Havvy-patch-1, r=steveklabnik
JohnTitor Aug 19, 2020
1f4f317
Rollup merge of #75049 - janriemer:patch-1, r=poliorcetics
JohnTitor Aug 19, 2020
ac264b5
Rollup merge of #75499 - jack-champagne:jack-champagne/issue-75412, r…
JohnTitor Aug 19, 2020
e8d30bf
Rollup merge of #75554 - jumbatm:fix-clashing-extern-decl-overflow, r…
JohnTitor Aug 19, 2020
9cf3903
Rollup merge of #75646 - poliorcetics:intra-links-keywords, r=jyn514
JohnTitor Aug 19, 2020
e6e917e
Rollup merge of #75652 - jyn514:true-false-2, r=GuillaumeGomez
JohnTitor Aug 19, 2020
e6fe523
Rollup merge of #75658 - tgnottingham:issue-75599, r=estebank
JohnTitor Aug 19, 2020
98f7d88
Rollup merge of #75665 - GuillaumeGomez:doc-examples-coverage, r=jyn514
JohnTitor Aug 19, 2020
07ea340
Rollup merge of #75685 - nixphix:docs/unix-ext, r=jyn514
JohnTitor Aug 19, 2020
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
Switch to intra-doc links in /src/sys/unix/ext/*.rs
  • Loading branch information
nixphix committed Aug 19, 2020
commit 3e3a2c82f3ab29f855911f2ecf57ef15a3a4fe03
45 changes: 13 additions & 32 deletions library/std/src/sys/unix/ext/fs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,7 @@ use crate::sys;
use crate::sys::platform::fs::MetadataExt as UnixMetadataExt;
use crate::sys_common::{AsInner, AsInnerMut, FromInner};

/// Unix-specific extensions to [`File`].
///
/// [`File`]: ../../../../std/fs/struct.File.html
/// Unix-specific extensions to [`fs::File`].
#[stable(feature = "file_offset", since = "1.15.0")]
pub trait FileExt {
/// Reads a number of bytes starting from a given offset.
Expand Down Expand Up @@ -55,19 +53,18 @@ pub trait FileExt {
///
/// The current file cursor is not affected by this function.
///
/// Similar to [`Read::read_exact`] but uses [`read_at`] instead of `read`.
/// Similar to [`io::Read::read_exact`] but uses [`read_at`] instead of `read`.
///
/// [`Read::read_exact`]: ../../../../std/io/trait.Read.html#method.read_exact
/// [`read_at`]: #tymethod.read_at
/// [`read_at`]: FileExt::read_at
///
/// # Errors
///
/// If this function encounters an error of the kind
/// [`ErrorKind::Interrupted`] then the error is ignored and the operation
/// [`io::ErrorKind::Interrupted`] then the error is ignored and the operation
/// will continue.
///
/// If this function encounters an "end of file" before completely filling
/// the buffer, it returns an error of the kind [`ErrorKind::UnexpectedEof`].
/// the buffer, it returns an error of the kind [`io::ErrorKind::UnexpectedEof`].
/// The contents of `buf` are unspecified in this case.
///
/// If any other read error is encountered then this function immediately
Expand All @@ -77,9 +74,6 @@ pub trait FileExt {
/// has read, but it will never read more than would be necessary to
/// completely fill the buffer.
///
/// [`ErrorKind::Interrupted`]: ../../../../std/io/enum.ErrorKind.html#variant.Interrupted
/// [`ErrorKind::UnexpectedEof`]: ../../../../std/io/enum.ErrorKind.html#variant.UnexpectedEof
///
/// # Examples
///
/// ```no_run
Expand Down Expand Up @@ -161,19 +155,18 @@ pub trait FileExt {
/// The current file cursor is not affected by this function.
///
/// This method will continuously call [`write_at`] until there is no more data
/// to be written or an error of non-[`ErrorKind::Interrupted`] kind is
/// to be written or an error of non-[`io::ErrorKind::Interrupted`] kind is
/// returned. This method will not return until the entire buffer has been
/// successfully written or such an error occurs. The first error that is
/// not of [`ErrorKind::Interrupted`] kind generated from this method will be
/// not of [`io::ErrorKind::Interrupted`] kind generated from this method will be
/// returned.
///
/// # Errors
///
/// This function will return the first error of
/// non-[`ErrorKind::Interrupted`] kind that [`write_at`] returns.
/// non-[`io::ErrorKind::Interrupted`] kind that [`write_at`] returns.
///
/// [`ErrorKind::Interrupted`]: ../../../../std/io/enum.ErrorKind.html#variant.Interrupted
/// [`write_at`]: #tymethod.write_at
/// [`write_at`]: FileExt::write_at
///
/// # Examples
///
Expand Down Expand Up @@ -223,8 +216,6 @@ impl FileExt for fs::File {
}

/// Unix-specific extensions to [`fs::Permissions`].
///
/// [`fs::Permissions`]: ../../../../std/fs/struct.Permissions.html
#[stable(feature = "fs_ext", since = "1.1.0")]
pub trait PermissionsExt {
/// Returns the underlying raw `st_mode` bits that contain the standard
Expand Down Expand Up @@ -302,8 +293,6 @@ impl PermissionsExt for Permissions {
}

/// Unix-specific extensions to [`fs::OpenOptions`].
///
/// [`fs::OpenOptions`]: ../../../../std/fs/struct.OpenOptions.html
#[stable(feature = "fs_ext", since = "1.1.0")]
pub trait OpenOptionsExt {
/// Sets the mode bits that a new file will be created with.
Expand Down Expand Up @@ -372,8 +361,6 @@ impl OpenOptionsExt for OpenOptions {
}

/// Unix-specific extensions to [`fs::Metadata`].
///
/// [`fs::Metadata`]: ../../../../std/fs/struct.Metadata.html
#[stable(feature = "metadata_ext", since = "1.1.0")]
pub trait MetadataExt {
/// Returns the ID of the device containing the file.
Expand Down Expand Up @@ -535,7 +522,7 @@ pub trait MetadataExt {
fn atime(&self) -> i64;
/// Returns the last access time of the file, in nanoseconds since [`atime`].
///
/// [`atime`]: #tymethod.atime
/// [`atime`]: MetadataExt::atime
///
/// # Examples
///
Expand Down Expand Up @@ -571,7 +558,7 @@ pub trait MetadataExt {
fn mtime(&self) -> i64;
/// Returns the last modification time of the file, in nanoseconds since [`mtime`].
///
/// [`mtime`]: #tymethod.mtime
/// [`mtime`]: MetadataExt::mtime
///
/// # Examples
///
Expand Down Expand Up @@ -607,7 +594,7 @@ pub trait MetadataExt {
fn ctime(&self) -> i64;
/// Returns the last status change time of the file, in nanoseconds since [`ctime`].
///
/// [`ctime`]: #tymethod.ctime
/// [`ctime`]: MetadataExt::ctime
///
/// # Examples
///
Expand Down Expand Up @@ -714,12 +701,10 @@ impl MetadataExt for fs::Metadata {
}
}

/// Unix-specific extensions for [`FileType`].
/// Unix-specific extensions for [`fs::FileType`].
///
/// Adds support for special Unix file types such as block/character devices,
/// pipes, and sockets.
///
/// [`FileType`]: ../../../../std/fs/struct.FileType.html
#[stable(feature = "file_type_ext", since = "1.5.0")]
pub trait FileTypeExt {
/// Returns `true` if this file type is a block device.
Expand Down Expand Up @@ -813,8 +798,6 @@ impl FileTypeExt for fs::FileType {
}

/// Unix-specific extension methods for [`fs::DirEntry`].
///
/// [`fs::DirEntry`]: ../../../../std/fs/struct.DirEntry.html
#[stable(feature = "dir_entry_ext", since = "1.1.0")]
pub trait DirEntryExt {
/// Returns the underlying `d_ino` field in the contained `dirent`
Expand Down Expand Up @@ -875,8 +858,6 @@ pub fn symlink<P: AsRef<Path>, Q: AsRef<Path>>(src: P, dst: Q) -> io::Result<()>
}

/// Unix-specific extensions to [`fs::DirBuilder`].
///
/// [`fs::DirBuilder`]: ../../../../std/fs/struct.DirBuilder.html
#[stable(feature = "dir_builder", since = "1.6.0")]
pub trait DirBuilderExt {
/// Sets the mode to create new directories with. This option defaults to
Expand Down
52 changes: 20 additions & 32 deletions library/std/src/sys/unix/ext/net.rs
Original file line number Diff line number Diff line change
Expand Up @@ -408,10 +408,9 @@ impl UnixStream {
/// indefinitely. An [`Err`] is returned if the zero [`Duration`] is passed to this
/// method.
///
/// [`None`]: ../../../../std/option/enum.Option.html#variant.None
/// [`Err`]: ../../../../std/result/enum.Result.html#variant.Err
/// [`read`]: ../../../../std/io/trait.Read.html#tymethod.read
/// [`Duration`]: ../../../../std/time/struct.Duration.html
/// [`None`]: crate::option::Option::None
/// [`Err`]: crate::result::Result::Err
/// [`read`]: io::Read::read
///
/// # Examples
///
Expand Down Expand Up @@ -453,10 +452,9 @@ impl UnixStream {
/// indefinitely. An [`Err`] is returned if the zero [`Duration`] is
/// passed to this method.
///
/// [`None`]: ../../../../std/option/enum.Option.html#variant.None
/// [`Err`]: ../../../../std/result/enum.Result.html#variant.Err
/// [`write`]: ../../../../std/io/trait.Write.html#tymethod.write
/// [`Duration`]: ../../../../std/time/struct.Duration.html
/// [`None`]: crate::option::Option::None
/// [`Err`]: crate::result::Result::Err
/// [`read`]: io::Read::read
///
/// # Examples
///
Expand Down Expand Up @@ -581,8 +579,6 @@ impl UnixStream {
/// specified portions to immediately return with an appropriate value
/// (see the documentation of [`Shutdown`]).
///
/// [`Shutdown`]: ../../../../std/net/enum.Shutdown.html
///
/// # Examples
///
/// ```no_run
Expand Down Expand Up @@ -852,7 +848,7 @@ impl UnixListener {
/// is established. When established, the corresponding [`UnixStream`] and
/// the remote peer's address will be returned.
///
/// [`UnixStream`]: ../../../../std/os/unix/net/struct.UnixStream.html
/// [`UnixStream`]: crate::os::unix::net::UnixStream
///
/// # Examples
///
Expand Down Expand Up @@ -937,8 +933,6 @@ impl UnixListener {
/// Ok(())
/// }
/// ```
///
/// [`io::ErrorKind::WouldBlock`]: ../../../io/enum.ErrorKind.html#variant.WouldBlock
#[stable(feature = "unix_socket", since = "1.10.0")]
pub fn set_nonblocking(&self, nonblocking: bool) -> io::Result<()> {
self.0.set_nonblocking(nonblocking)
Expand Down Expand Up @@ -973,8 +967,7 @@ impl UnixListener {
/// The iterator will never return [`None`] and will also not yield the
/// peer's [`SocketAddr`] structure.
///
/// [`None`]: ../../../../std/option/enum.Option.html#variant.None
/// [`SocketAddr`]: struct.SocketAddr.html
/// [`None`]: crate::option::Option::None
///
/// # Examples
///
Expand Down Expand Up @@ -1043,8 +1036,7 @@ impl<'a> IntoIterator for &'a UnixListener {
///
/// It will never return [`None`].
///
/// [`None`]: ../../../../std/option/enum.Option.html#variant.None
/// [`UnixListener`]: struct.UnixListener.html
/// [`None`]: crate::option::Option::None
///
/// # Examples
///
Expand Down Expand Up @@ -1205,9 +1197,9 @@ impl UnixDatagram {
/// The [`send`] method may be used to send data to the specified address.
/// [`recv`] and [`recv_from`] will only receive data from that address.
///
/// [`send`]: #method.send
/// [`recv`]: #method.recv
/// [`recv_from`]: #method.recv_from
/// [`send`]: UnixDatagram::send
/// [`recv`]: UnixDatagram::recv
/// [`recv_from`]: UnixDatagram::recv_from
///
/// # Examples
///
Expand Down Expand Up @@ -1284,7 +1276,7 @@ impl UnixDatagram {
///
/// The [`connect`] method will connect the socket to a peer.
///
/// [`connect`]: #method.connect
/// [`connect`]: UnixDatagram::connect
///
/// # Examples
///
Expand Down Expand Up @@ -1432,11 +1424,10 @@ impl UnixDatagram {
/// block indefinitely. An [`Err`] is returned if the zero [`Duration`]
/// is passed to this method.
///
/// [`None`]: ../../../../std/option/enum.Option.html#variant.None
/// [`Err`]: ../../../../std/result/enum.Result.html#variant.Err
/// [`recv`]: #method.recv
/// [`recv_from`]: #method.recv_from
/// [`Duration`]: ../../../../std/time/struct.Duration.html
/// [`None`]: crate::option::Option::None
/// [`Err`]: crate::result::Result::Err
/// [`recv`]: UnixDatagram::recv
/// [`recv_from`]: UnixDatagram::recv_from
///
/// # Examples
///
Expand Down Expand Up @@ -1479,10 +1470,9 @@ impl UnixDatagram {
/// block indefinitely. An [`Err`] is returned if the zero [`Duration`] is passed to this
/// method.
///
/// [`None`]: ../../../../std/option/enum.Option.html#variant.None
/// [`send`]: #method.send
/// [`send_to`]: #method.send_to
/// [`Duration`]: ../../../../std/time/struct.Duration.html
/// [`None`]: crate::option::Option::None
/// [`send`]: UnixDatagram::send
/// [`send_to`]: UnixDatagram::send_to
///
/// # Examples
///
Expand Down Expand Up @@ -1605,8 +1595,6 @@ impl UnixDatagram {
/// specified portions to immediately return with an appropriate value
/// (see the documentation of [`Shutdown`]).
///
/// [`Shutdown`]: ../../../../std/net/enum.Shutdown.html
///
/// ```no_run
/// use std::os::unix::net::UnixDatagram;
/// use std::net::Shutdown;
Expand Down
8 changes: 1 addition & 7 deletions library/std/src/sys/unix/ext/process.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,6 @@ use crate::sys;
use crate::sys_common::{AsInner, AsInnerMut, FromInner, IntoInner};

/// Unix-specific extensions to the [`process::Command`] builder.
///
/// [`process::Command`]: ../../../../std/process/struct.Command.html
#[stable(feature = "rust1", since = "1.0.0")]
pub trait CommandExt {
/// Sets the child process's user ID. This translates to a
Expand Down Expand Up @@ -65,7 +63,7 @@ pub trait CommandExt {
/// This method is stable and usable, but it should be unsafe. To fix
/// that, it got deprecated in favor of the unsafe [`pre_exec`].
///
/// [`pre_exec`]: #tymethod.pre_exec
/// [`pre_exec`]: CommandExt::pre_exec
#[stable(feature = "process_exec", since = "1.15.0")]
#[rustc_deprecated(since = "1.37.0", reason = "should be unsafe, use `pre_exec` instead")]
fn before_exec<F>(&mut self, f: F) -> &mut process::Command
Expand Down Expand Up @@ -94,8 +92,6 @@ pub trait CommandExt {
/// a new child. Like spawn, however, the default behavior for the stdio
/// descriptors will be to inherited from the current process.
///
/// [`process::exit`]: ../../../process/fn.exit.html
///
/// # Notes
///
/// The process may be in a "broken state" if this function returns in
Expand Down Expand Up @@ -151,8 +147,6 @@ impl CommandExt for process::Command {
}

/// Unix-specific extensions to [`process::ExitStatus`].
///
/// [`process::ExitStatus`]: ../../../../std/process/struct.ExitStatus.html
#[stable(feature = "rust1", since = "1.0.0")]
pub trait ExitStatusExt {
/// Creates a new `ExitStatus` from the raw underlying `i32` return value of
Expand Down
4 changes: 1 addition & 3 deletions library/std/src/sys/unix/ext/thread.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,7 @@ use crate::thread::JoinHandle;
#[allow(deprecated)]
pub type RawPthread = pthread_t;

/// Unix-specific extensions to [`thread::JoinHandle`].
///
/// [`thread::JoinHandle`]: ../../../../std/thread/struct.JoinHandle.html
/// Unix-specific extensions to [`JoinHandle`].
#[stable(feature = "thread_extensions", since = "1.9.0")]
pub trait JoinHandleExt {
/// Extracts the raw pthread_t without taking ownership
Expand Down