Skip to content

Commit b4be475

Browse files
committed
Fix Markdown issues in the docs
* Since the switch to pulldown-cmark reference links need a blank line before the URLs. * Reference link references are not case sensitive. * Doc comments need to be indented uniformly otherwise rustdoc gets confused.
1 parent e5e9275 commit b4be475

File tree

10 files changed

+44
-26
lines changed

10 files changed

+44
-26
lines changed

src/libcollections/vec.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1346,7 +1346,7 @@ impl<T: PartialEq> Vec<T> {
13461346
/// # Examples
13471347
///
13481348
/// ```
1349-
///# #![feature(vec_remove_item)]
1349+
/// # #![feature(vec_remove_item)]
13501350
/// let mut vec = vec![1, 2, 3, 1];
13511351
///
13521352
/// vec.remove_item(&1);

src/libcore/sync/atomic.rs

+3-2
Original file line numberDiff line numberDiff line change
@@ -153,8 +153,9 @@ unsafe impl<T> Sync for AtomicPtr<T> {}
153153
/// Rust's memory orderings are [the same as
154154
/// LLVM's](http://llvm.org/docs/LangRef.html#memory-model-for-concurrent-operations).
155155
///
156-
/// For more information see the [nomicon][1].
157-
/// [1]: ../../../nomicon/atomics.html
156+
/// For more information see the [nomicon].
157+
///
158+
/// [nomicon]: ../../../nomicon/atomics.html
158159
#[stable(feature = "rust1", since = "1.0.0")]
159160
#[derive(Copy, Clone, Debug)]
160161
pub enum Ordering {

src/libstd/fs.rs

+14
Original file line numberDiff line numberDiff line change
@@ -1176,6 +1176,7 @@ impl AsInner<fs_imp::DirEntry> for DirEntry {
11761176
/// This function currently corresponds to the `unlink` function on Unix
11771177
/// and the `DeleteFile` function on Windows.
11781178
/// Note that, this [may change in the future][changes].
1179+
///
11791180
/// [changes]: ../io/index.html#platform-specific-behavior
11801181
///
11811182
/// # Errors
@@ -1212,6 +1213,7 @@ pub fn remove_file<P: AsRef<Path>>(path: P) -> io::Result<()> {
12121213
/// This function currently corresponds to the `stat` function on Unix
12131214
/// and the `GetFileAttributesEx` function on Windows.
12141215
/// Note that, this [may change in the future][changes].
1216+
///
12151217
/// [changes]: ../io/index.html#platform-specific-behavior
12161218
///
12171219
/// # Errors
@@ -1245,6 +1247,7 @@ pub fn metadata<P: AsRef<Path>>(path: P) -> io::Result<Metadata> {
12451247
/// This function currently corresponds to the `lstat` function on Unix
12461248
/// and the `GetFileAttributesEx` function on Windows.
12471249
/// Note that, this [may change in the future][changes].
1250+
///
12481251
/// [changes]: ../io/index.html#platform-specific-behavior
12491252
///
12501253
/// # Errors
@@ -1287,6 +1290,7 @@ pub fn symlink_metadata<P: AsRef<Path>>(path: P) -> io::Result<Metadata> {
12871290
/// on Windows, `from` can be anything, but `to` must *not* be a directory.
12881291
///
12891292
/// Note that, this [may change in the future][changes].
1293+
///
12901294
/// [changes]: ../io/index.html#platform-specific-behavior
12911295
///
12921296
/// # Errors
@@ -1330,6 +1334,7 @@ pub fn rename<P: AsRef<Path>, Q: AsRef<Path>>(from: P, to: Q) -> io::Result<()>
13301334
/// `O_CLOEXEC` is set for returned file descriptors.
13311335
/// On Windows, this function currently corresponds to `CopyFileEx`.
13321336
/// Note that, this [may change in the future][changes].
1337+
///
13331338
/// [changes]: ../io/index.html#platform-specific-behavior
13341339
///
13351340
/// # Errors
@@ -1366,6 +1371,7 @@ pub fn copy<P: AsRef<Path>, Q: AsRef<Path>>(from: P, to: Q) -> io::Result<u64> {
13661371
/// This function currently corresponds to the `link` function on Unix
13671372
/// and the `CreateHardLink` function on Windows.
13681373
/// Note that, this [may change in the future][changes].
1374+
///
13691375
/// [changes]: ../io/index.html#platform-specific-behavior
13701376
///
13711377
/// # Errors
@@ -1424,6 +1430,7 @@ pub fn soft_link<P: AsRef<Path>, Q: AsRef<Path>>(src: P, dst: Q) -> io::Result<(
14241430
/// and the `CreateFile` function with `FILE_FLAG_OPEN_REPARSE_POINT` and
14251431
/// `FILE_FLAG_BACKUP_SEMANTICS` flags on Windows.
14261432
/// Note that, this [may change in the future][changes].
1433+
///
14271434
/// [changes]: ../io/index.html#platform-specific-behavior
14281435
///
14291436
/// # Errors
@@ -1457,6 +1464,7 @@ pub fn read_link<P: AsRef<Path>>(path: P) -> io::Result<PathBuf> {
14571464
/// This function currently corresponds to the `realpath` function on Unix
14581465
/// and the `CreateFile` and `GetFinalPathNameByHandle` functions on Windows.
14591466
/// Note that, this [may change in the future][changes].
1467+
///
14601468
/// [changes]: ../io/index.html#platform-specific-behavior
14611469
///
14621470
/// # Errors
@@ -1489,6 +1497,7 @@ pub fn canonicalize<P: AsRef<Path>>(path: P) -> io::Result<PathBuf> {
14891497
/// This function currently corresponds to the `mkdir` function on Unix
14901498
/// and the `CreateDirectory` function on Windows.
14911499
/// Note that, this [may change in the future][changes].
1500+
///
14921501
/// [changes]: ../io/index.html#platform-specific-behavior
14931502
///
14941503
/// # Errors
@@ -1522,6 +1531,7 @@ pub fn create_dir<P: AsRef<Path>>(path: P) -> io::Result<()> {
15221531
/// This function currently corresponds to the `mkdir` function on Unix
15231532
/// and the `CreateDirectory` function on Windows.
15241533
/// Note that, this [may change in the future][changes].
1534+
///
15251535
/// [changes]: ../io/index.html#platform-specific-behavior
15261536
///
15271537
/// # Errors
@@ -1562,6 +1572,7 @@ pub fn create_dir_all<P: AsRef<Path>>(path: P) -> io::Result<()> {
15621572
/// This function currently corresponds to the `rmdir` function on Unix
15631573
/// and the `RemoveDirectory` function on Windows.
15641574
/// Note that, this [may change in the future][changes].
1575+
///
15651576
/// [changes]: ../io/index.html#platform-specific-behavior
15661577
///
15671578
/// # Errors
@@ -1599,6 +1610,7 @@ pub fn remove_dir<P: AsRef<Path>>(path: P) -> io::Result<()> {
15991610
/// and the `FindFirstFile`, `GetFileAttributesEx`, `DeleteFile`, and `RemoveDirectory` functions
16001611
/// on Windows.
16011612
/// Note that, this [may change in the future][changes].
1613+
///
16021614
/// [changes]: ../io/index.html#platform-specific-behavior
16031615
///
16041616
/// # Errors
@@ -1633,6 +1645,7 @@ pub fn remove_dir_all<P: AsRef<Path>>(path: P) -> io::Result<()> {
16331645
/// This function currently corresponds to the `opendir` function on Unix
16341646
/// and the `FindFirstFile` function on Windows.
16351647
/// Note that, this [may change in the future][changes].
1648+
///
16361649
/// [changes]: ../io/index.html#platform-specific-behavior
16371650
///
16381651
/// # Errors
@@ -1679,6 +1692,7 @@ pub fn read_dir<P: AsRef<Path>>(path: P) -> io::Result<ReadDir> {
16791692
/// This function currently corresponds to the `chmod` function on Unix
16801693
/// and the `SetFileAttributes` function on Windows.
16811694
/// Note that, this [may change in the future][changes].
1695+
///
16821696
/// [changes]: ../io/index.html#platform-specific-behavior
16831697
///
16841698
/// # Errors

src/libstd/io/buffered.rs

+9-8
Original file line numberDiff line numberDiff line change
@@ -21,12 +21,12 @@ use memchr;
2121
/// The `BufReader` struct adds buffering to any reader.
2222
///
2323
/// It can be excessively inefficient to work directly with a [`Read`] instance.
24-
/// For example, every call to [`read`] on [`TcpStream`] results in a system call.
25-
/// A `BufReader` performs large, infrequent reads on the underlying [`Read`]
26-
/// and maintains an in-memory buffer of the results.
24+
/// For example, every call to [`read`][`TcpStream::read`] on [`TcpStream`]
25+
/// results in a system call. A `BufReader` performs large, infrequent reads on
26+
/// the underlying [`Read`] and maintains an in-memory buffer of the results.
2727
///
2828
/// [`Read`]: ../../std/io/trait.Read.html
29-
/// [`read`]: ../../std/net/struct.TcpStream.html#method.read
29+
/// [`TcpStream::read`]: ../../std/net/struct.TcpStream.html#method.read
3030
/// [`TcpStream`]: ../../std/net/struct.TcpStream.html
3131
///
3232
/// # Examples
@@ -261,9 +261,10 @@ impl<R: Seek> Seek for BufReader<R> {
261261
/// Wraps a writer and buffers its output.
262262
///
263263
/// It can be excessively inefficient to work directly with something that
264-
/// implements [`Write`]. For example, every call to [`write`] on [`TcpStream`]
265-
/// results in a system call. A `BufWriter` keeps an in-memory buffer of data
266-
/// and writes it to an underlying writer in large, infrequent batches.
264+
/// implements [`Write`]. For example, every call to
265+
/// [`write`][`Tcpstream::write`] on [`TcpStream`] results in a system call. A
266+
/// `BufWriter` keeps an in-memory buffer of data and writes it to an underlying
267+
/// writer in large, infrequent batches.
267268
///
268269
/// The buffer will be written out when the writer is dropped.
269270
///
@@ -303,7 +304,7 @@ impl<R: Seek> Seek for BufReader<R> {
303304
/// the `stream` is dropped.
304305
///
305306
/// [`Write`]: ../../std/io/trait.Write.html
306-
/// [`write`]: ../../std/net/struct.TcpStream.html#method.write
307+
/// [`Tcpstream::write`]: ../../std/net/struct.TcpStream.html#method.write
307308
/// [`TcpStream`]: ../../std/net/struct.TcpStream.html
308309
#[stable(feature = "rust1", since = "1.0.0")]
309310
pub struct BufWriter<W: Write> {

src/libstd/io/mod.rs

+5-4
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,8 @@
2121
//! of other types, and you can implement them for your types too. As such,
2222
//! you'll see a few different types of I/O throughout the documentation in
2323
//! this module: [`File`]s, [`TcpStream`]s, and sometimes even [`Vec<T>`]s. For
24-
//! example, [`Read`] adds a [`read`] method, which we can use on `File`s:
24+
//! example, [`Read`] adds a [`read`][`Read::read`] method, which we can use on
25+
//! `File`s:
2526
//!
2627
//! ```
2728
//! use std::io;
@@ -106,7 +107,7 @@
106107
//! ```
107108
//!
108109
//! [`BufWriter`] doesn't add any new ways of writing; it just buffers every call
109-
//! to [`write`]:
110+
//! to [`write`][`Write::write`]:
110111
//!
111112
//! ```
112113
//! use std::io;
@@ -257,13 +258,13 @@
257258
//! [`Vec<T>`]: ../vec/struct.Vec.html
258259
//! [`BufReader`]: struct.BufReader.html
259260
//! [`BufWriter`]: struct.BufWriter.html
260-
//! [`write`]: trait.Write.html#tymethod.write
261+
//! [`Write::write`]: trait.Write.html#tymethod.write
261262
//! [`io::stdout`]: fn.stdout.html
262263
//! [`println!`]: ../macro.println.html
263264
//! [`Lines`]: struct.Lines.html
264265
//! [`io::Result`]: type.Result.html
265266
//! [`?` operator]: ../../book/syntax-index.html
266-
//! [`read`]: trait.Read.html#tymethod.read
267+
//! [`Read::read`]: trait.Read.html#tymethod.read
267268
268269
#![stable(feature = "rust1", since = "1.0.0")]
269270

src/libstd/net/tcp.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ pub struct TcpStream(net_imp::TcpStream);
5858
///
5959
/// After creating a `TcpListener` by [`bind`]ing it to a socket address, it listens
6060
/// for incoming TCP connections. These can be accepted by calling [`accept`] or by
61-
/// iterating over the [`Incoming`] iterator returned by [`incoming`].
61+
/// iterating over the [`Incoming`] iterator returned by [`incoming`][`TcpListener::incoming`].
6262
///
6363
/// The socket will be closed when the value is dropped.
6464
///
@@ -68,7 +68,7 @@ pub struct TcpStream(net_imp::TcpStream);
6868
/// [`bind`]: #method.bind
6969
/// [IETF RFC 793]: https://tools.ietf.org/html/rfc793
7070
/// [`Incoming`]: ../../std/net/struct.Incoming.html
71-
/// [`incoming`]: #method.incoming
71+
/// [`TcpListener::incoming`]: #method.incoming
7272
///
7373
/// # Examples
7474
///

src/libstd/prelude/mod.rs

+6-6
Original file line numberDiff line numberDiff line change
@@ -56,14 +56,14 @@
5656
//! traits indicate fundamental properties of types.
5757
//! * [`std::ops`]::{[`Drop`], [`Fn`], [`FnMut`], [`FnOnce`]}. Various
5858
//! operations for both destructors and overloading `()`.
59-
//! * [`std::mem`]::[`drop`], a convenience function for explicitly dropping a
60-
//! value.
59+
//! * [`std::mem`]::[`drop`][`mem::drop`], a convenience function for explicitly
60+
//! dropping a value.
6161
//! * [`std::boxed`]::[`Box`], a way to allocate values on the heap.
6262
//! * [`std::borrow`]::[`ToOwned`], The conversion trait that defines
6363
//! [`to_owned`], the generic method for creating an owned type from a
6464
//! borrowed type.
65-
//! * [`std::clone`]::[`Clone`], the ubiquitous trait that defines [`clone`],
66-
//! the method for producing a copy of a value.
65+
//! * [`std::clone`]::[`Clone`], the ubiquitous trait that defines
66+
//! [`clone`][`Clone::clone`], the method for producing a copy of a value.
6767
//! * [`std::cmp`]::{[`PartialEq`], [`PartialOrd`], [`Eq`], [`Ord`] }. The
6868
//! comparison traits, which implement the comparison operators and are often
6969
//! seen in trait bounds.
@@ -117,8 +117,8 @@
117117
//! [`ToOwned`]: ../borrow/trait.ToOwned.html
118118
//! [`ToString`]: ../string/trait.ToString.html
119119
//! [`Vec`]: ../vec/struct.Vec.html
120-
//! [`clone`]: ../clone/trait.Clone.html#tymethod.clone
121-
//! [`drop`]: ../mem/fn.drop.html
120+
//! [`Clone::clone`]: ../clone/trait.Clone.html#tymethod.clone
121+
//! [`mem::drop`]: ../mem/fn.drop.html
122122
//! [`std::borrow`]: ../borrow/index.html
123123
//! [`std::boxed`]: ../boxed/index.html
124124
//! [`std::clone`]: ../clone/index.html

src/libstd/sys/windows/ext/fs.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,7 @@ pub trait OpenOptionsExt {
144144
/// `CreateFile`).
145145
///
146146
/// If a _new_ file is created because it does not yet exist and
147-
///`.create(true)` or `.create_new(true)` are specified, the new file is
147+
/// `.create(true)` or `.create_new(true)` are specified, the new file is
148148
/// given the attributes declared with `.attributes()`.
149149
///
150150
/// If an _existing_ file is opened with `.create(true).truncate(true)`, its

src/libstd/sys/windows/ext/process.rs

+1
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,7 @@ pub trait CommandExt {
104104
/// Sets the [process creation flags][1] to be passed to `CreateProcess`.
105105
///
106106
/// These will always be ORed with `CREATE_UNICODE_ENVIRONMENT`.
107+
///
107108
/// [1]: https://msdn.microsoft.com/en-us/library/windows/desktop/ms684863(v=vs.85).aspx
108109
#[stable(feature = "windows_process_extensions", since = "1.16.0")]
109110
fn creation_flags(&mut self, flags: u32) -> &mut process::Command;

src/libstd/thread/mod.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@
9090
//! two ways:
9191
//!
9292
//! * By spawning a new thread, e.g. using the [`thread::spawn`][`spawn`]
93-
//! function, and calling [`thread`] on the [`JoinHandle`].
93+
//! function, and calling [`thread`][`JoinHandle::thread`] on the [`JoinHandle`].
9494
//! * By requesting the current thread, using the [`thread::current`] function.
9595
//!
9696
//! The [`thread::current`] function is available even for threads not spawned
@@ -151,7 +151,7 @@
151151
//! [`Arc`]: ../../std/sync/struct.Arc.html
152152
//! [`spawn`]: ../../std/thread/fn.spawn.html
153153
//! [`JoinHandle`]: ../../std/thread/struct.JoinHandle.html
154-
//! [`thread`]: ../../std/thread/struct.JoinHandle.html#method.thread
154+
//! [`JoinHandle::thread`]: ../../std/thread/struct.JoinHandle.html#method.thread
155155
//! [`join`]: ../../std/thread/struct.JoinHandle.html#method.join
156156
//! [`Result`]: ../../std/result/enum.Result.html
157157
//! [`Ok`]: ../../std/result/enum.Result.html#variant.Ok

0 commit comments

Comments
 (0)