diff options
| author | bors <bors@rust-lang.org> | 2017-08-11 09:37:52 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2017-08-11 09:37:52 +0000 |
| commit | 59675d29eb47eb743026dcc0737884f548f2197a (patch) | |
| tree | 44a9c4ea0b551956de3697ed63d1e57cd4dbeb8f /src/libstd | |
| parent | 9868352b953dc88975324b27e2865d5ee2ea72e9 (diff) | |
| parent | 742bba0ebfa26f65d9aca239edaf5b0aad8fa9e2 (diff) | |
| download | rust-59675d29eb47eb743026dcc0737884f548f2197a.tar.gz rust-59675d29eb47eb743026dcc0737884f548f2197a.zip | |
Auto merge of #43800 - GuillaumeGomez:rollup, r=GuillaumeGomez
Rollup of 18 pull requests - Successful merges: #43176, #43632, #43650, #43712, #43715, #43721, #43739, #43741, #43744, #43747, #43752, #43760, #43773, #43779, #43783, #43791, #43793, #43795 - Failed merges:
Diffstat (limited to 'src/libstd')
| -rw-r--r-- | src/libstd/fs.rs | 16 | ||||
| -rw-r--r-- | src/libstd/io/error.rs | 23 | ||||
| -rw-r--r-- | src/libstd/io/mod.rs | 10 | ||||
| -rw-r--r-- | src/libstd/net/ip.rs | 2 | ||||
| -rw-r--r-- | src/libstd/sys/unix/ext/net.rs | 2 |
5 files changed, 32 insertions, 21 deletions
diff --git a/src/libstd/fs.rs b/src/libstd/fs.rs index 38d3312b4e7..062186ef708 100644 --- a/src/libstd/fs.rs +++ b/src/libstd/fs.rs @@ -28,7 +28,7 @@ use time::SystemTime; /// A reference to an open file on the filesystem. /// /// An instance of a `File` can be read and/or written depending on what options -/// it was opened with. Files also implement `Seek` to alter the logical cursor +/// it was opened with. Files also implement [`Seek`] to alter the logical cursor /// that the file contains internally. /// /// Files are automatically closed when they go out of scope. @@ -48,7 +48,7 @@ use time::SystemTime; /// # } /// ``` /// -/// Read the contents of a file into a `String`: +/// Read the contents of a file into a [`String`]: /// /// ```no_run /// use std::fs::File; @@ -81,6 +81,8 @@ use time::SystemTime; /// # } /// ``` /// +/// [`Seek`]: ../io/trait.Seek.html +/// [`String`]: ../string/struct.String.html /// [`Read`]: ../io/trait.Read.html /// [`BufReader<R>`]: ../io/struct.BufReader.html #[stable(feature = "rust1", since = "1.0.0")] @@ -104,19 +106,19 @@ pub struct Metadata(fs_imp::FileAttr); /// Iterator over the entries in a directory. /// /// This iterator is returned from the [`read_dir`] function of this module and -/// will yield instances of `io::Result<DirEntry>`. Through a [`DirEntry`] +/// will yield instances of [`io::Result`]`<`[`DirEntry`]`>`. Through a [`DirEntry`] /// information like the entry's path and possibly other metadata can be /// learned. /// -/// [`read_dir`]: fn.read_dir.html -/// [`DirEntry`]: struct.DirEntry.html -/// /// # Errors /// -/// This [`io::Result`] will be an `Err` if there's some sort of intermittent +/// This [`io::Result`] will be an [`Err`] if there's some sort of intermittent /// IO error during iteration. /// +/// [`read_dir`]: fn.read_dir.html +/// [`DirEntry`]: struct.DirEntry.html /// [`io::Result`]: ../io/type.Result.html +/// [`Err`]: ../result/enum.Result.html#variant.Err #[stable(feature = "rust1", since = "1.0.0")] #[derive(Debug)] pub struct ReadDir(fs_imp::ReadDir); diff --git a/src/libstd/io/error.rs b/src/libstd/io/error.rs index 0a5804a7744..68f55221a6c 100644 --- a/src/libstd/io/error.rs +++ b/src/libstd/io/error.rs @@ -17,17 +17,21 @@ use convert::From; /// A specialized [`Result`](../result/enum.Result.html) type for I/O /// operations. /// -/// This type is broadly used across `std::io` for any operation which may +/// This type is broadly used across [`std::io`] for any operation which may /// produce an error. /// -/// This typedef is generally used to avoid writing out `io::Error` directly and -/// is otherwise a direct mapping to `Result`. +/// This typedef is generally used to avoid writing out [`io::Error`] directly and +/// is otherwise a direct mapping to [`Result`]. /// -/// While usual Rust style is to import types directly, aliases of `Result` -/// often are not, to make it easier to distinguish between them. `Result` is -/// generally assumed to be `std::result::Result`, and so users of this alias +/// While usual Rust style is to import types directly, aliases of [`Result`] +/// often are not, to make it easier to distinguish between them. [`Result`] is +/// generally assumed to be [`std::result::Result`][`Result`], and so users of this alias /// will generally use `io::Result` instead of shadowing the prelude's import -/// of `std::result::Result`. +/// of [`std::result::Result`][`Result`]. +/// +/// [`std::io`]: ../io/index.html +/// [`io::Error`]: ../io/struct.Error.html +/// [`Result`]: ../result/enum.Result.html /// /// # Examples /// @@ -47,13 +51,16 @@ use convert::From; #[stable(feature = "rust1", since = "1.0.0")] pub type Result<T> = result::Result<T, Error>; -/// The error type for I/O operations of the `Read`, `Write`, `Seek`, and +/// The error type for I/O operations of the [`Read`], [`Write`], [`Seek`], and /// associated traits. /// /// Errors mostly originate from the underlying OS, but custom instances of /// `Error` can be created with crafted error messages and a particular value of /// [`ErrorKind`]. /// +/// [`Read`]: ../io/trait.Read.html +/// [`Write`]: ../io/trait.Write.html +/// [`Seek`]: ../io/trait.Seek.html /// [`ErrorKind`]: enum.ErrorKind.html #[derive(Debug)] #[stable(feature = "rust1", since = "1.0.0")] diff --git a/src/libstd/io/mod.rs b/src/libstd/io/mod.rs index 9a3036f753e..f486493f98b 100644 --- a/src/libstd/io/mod.rs +++ b/src/libstd/io/mod.rs @@ -22,7 +22,7 @@ //! you'll see a few different types of I/O throughout the documentation in //! this module: [`File`]s, [`TcpStream`]s, and sometimes even [`Vec<T>`]s. For //! example, [`Read`] adds a [`read`][`Read::read`] method, which we can use on -//! `File`s: +//! [`File`]s: //! //! ``` //! use std::io; @@ -146,9 +146,9 @@ //! # } //! ``` //! -//! Note that you cannot use the `?` operator in functions that do not return -//! a `Result<T, E>` (e.g. `main`). Instead, you can call `.unwrap()` or `match` -//! on the return value to catch any possible errors: +//! Note that you cannot use the [`?` operator] in functions that do not return +//! a [`Result<T, E>`][`Result`] (e.g. `main`). Instead, you can call [`.unwrap()`] +//! or `match` on the return value to catch any possible errors: //! //! ``` //! use std::io; @@ -265,6 +265,8 @@ //! [`io::Result`]: type.Result.html //! [`?` operator]: ../../book/first-edition/syntax-index.html //! [`Read::read`]: trait.Read.html#tymethod.read +//! [`Result`]: ../result/enum.Result.html +//! [`.unwrap()`]: ../result/enum.Result.html#method.unwrap #![stable(feature = "rust1", since = "1.0.0")] diff --git a/src/libstd/net/ip.rs b/src/libstd/net/ip.rs index 1e5368896af..0abf8179cc9 100644 --- a/src/libstd/net/ip.rs +++ b/src/libstd/net/ip.rs @@ -466,7 +466,7 @@ impl Ipv4Addr { /// - test addresses used for documentation (192.0.2.0/24, 198.51.100.0/24 and 203.0.113.0/24) /// - the unspecified address (0.0.0.0) /// - /// [ipv4-sr]: http://goo.gl/RaZ7lg + /// [ipv4-sr]: https://www.iana.org/assignments/iana-ipv4-special-registry/iana-ipv4-special-registry.xhtml /// [`true`]: ../../std/primitive.bool.html /// /// # Examples diff --git a/src/libstd/sys/unix/ext/net.rs b/src/libstd/sys/unix/ext/net.rs index 94b87a6bff4..7701ae25b41 100644 --- a/src/libstd/sys/unix/ext/net.rs +++ b/src/libstd/sys/unix/ext/net.rs @@ -655,7 +655,7 @@ impl UnixListener { /// Accepts a new incoming connection to this listener. /// /// This function will block the calling thread until a new Unix connection - /// is established. When established, the corersponding [`UnixStream`] and + /// is established. When established, the corresponding [`UnixStream`] and /// the remote peer's address will be returned. /// /// [`UnixStream`]: ../../../../std/os/unix/net/struct.UnixStream.html |
