Skip to content

Commit e068f45

Browse files
bors[bot]taiki-e
andauthored
Merge #559 #560
559: Use intra-doc links r=stjepang a=taiki-e Switch to use [intra-doc links](rust-lang/rfcs#1946) in all crates. Previously there was a big bug on cross crate re-exports (rust-lang/rust#65983), but it has been fixed, so we can use this in crossbeam. This also adds checks of the docs to CI. 560: Use collect::<Box<[_]>>() directly in ShardedLock::new() r=stjepang a=taiki-e Co-authored-by: Taiki Endo <[email protected]>
3 parents a1b9bf3 + 8cbd936 + 6877244 commit e068f45

File tree

23 files changed

+77
-168
lines changed

23 files changed

+77
-168
lines changed

ci/crossbeam-channel.sh

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,4 +11,6 @@ cargo test -- --test-threads=1
1111
if [[ "$RUST_VERSION" == "nightly"* ]]; then
1212
cd benchmarks
1313
cargo check --bins
14+
15+
RUSTDOCFLAGS=-Dwarnings cargo doc --no-deps --all-features
1416
fi

ci/crossbeam-deque.sh

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,3 +7,7 @@ export RUSTFLAGS="-D warnings"
77

88
cargo check --bins --examples --tests
99
cargo test
10+
11+
if [[ "$RUST_VERSION" == "nightly"* ]]; then
12+
RUSTDOCFLAGS=-Dwarnings cargo doc --no-deps --all-features
13+
fi

ci/crossbeam-epoch.sh

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@ cargo test
1111
if [[ "$RUST_VERSION" == "nightly"* ]]; then
1212
cargo test --features nightly
1313

14+
RUSTDOCFLAGS=-Dwarnings cargo doc --no-deps --all-features
15+
1416
if [[ "$OSTYPE" == "linux"* ]]; then
1517
ASAN_OPTIONS="detect_odr_violation=0 detect_leaks=0" \
1618
RUSTFLAGS="-Z sanitizer=address" \

ci/crossbeam-queue.sh

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,3 +7,7 @@ export RUSTFLAGS="-D warnings"
77

88
cargo check --bins --examples --tests
99
cargo test
10+
11+
if [[ "$RUST_VERSION" == "nightly"* ]]; then
12+
RUSTDOCFLAGS=-Dwarnings cargo doc --no-deps --all-features
13+
fi

ci/crossbeam-skiplist.sh

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,4 +10,6 @@ cargo test
1010

1111
if [[ "$RUST_VERSION" == "nightly"* ]]; then
1212
cargo test --features nightly
13+
14+
RUSTDOCFLAGS=-Dwarnings cargo doc --no-deps --all-features
1315
fi

ci/crossbeam-utils.sh

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,4 +10,6 @@ cargo test
1010

1111
if [[ "$RUST_VERSION" == "nightly"* ]]; then
1212
cargo test --features nightly
13+
14+
RUSTDOCFLAGS=-Dwarnings cargo doc --no-deps --all-features
1315
fi

ci/crossbeam.sh

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,4 +10,6 @@ cargo test
1010

1111
if [[ "$RUST_VERSION" == "nightly"* ]]; then
1212
cargo test --features nightly
13+
14+
RUSTDOCFLAGS=-Dwarnings cargo doc --no-deps --all-features
1315
fi

crossbeam-channel/src/channel.rs

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -911,8 +911,7 @@ impl<T> Receiver<T> {
911911
/// Each call to [`next`] blocks waiting for the next message and then returns it. However, if
912912
/// the channel becomes empty and disconnected, it returns [`None`] without blocking.
913913
///
914-
/// [`next`]: https://doc.rust-lang.org/std/iter/trait.Iterator.html#tymethod.next
915-
/// [`None`]: https://doc.rust-lang.org/std/option/enum.Option.html#variant.None
914+
/// [`next`]: Iterator::next
916915
///
917916
/// # Examples
918917
///
@@ -944,7 +943,7 @@ impl<T> Receiver<T> {
944943
/// Each call to [`next`] returns a message if there is one ready to be received. The iterator
945944
/// never blocks waiting for the next message.
946945
///
947-
/// [`next`]: https://doc.rust-lang.org/std/iter/trait.Iterator.html#tymethod.next
946+
/// [`next`]: Iterator::next
948947
///
949948
/// # Examples
950949
///
@@ -1062,8 +1061,7 @@ impl<T> IntoIterator for Receiver<T> {
10621061
/// Each call to [`next`] blocks waiting for the next message and then returns it. However, if the
10631062
/// channel becomes empty and disconnected, it returns [`None`] without blocking.
10641063
///
1065-
/// [`next`]: https://doc.rust-lang.org/std/iter/trait.Iterator.html#tymethod.next
1066-
/// [`None`]: https://doc.rust-lang.org/std/option/enum.Option.html#variant.None
1064+
/// [`next`]: Iterator::next
10671065
///
10681066
/// # Examples
10691067
///
@@ -1111,7 +1109,7 @@ impl<T> fmt::Debug for Iter<'_, T> {
11111109
/// Each call to [`next`] returns a message if there is one ready to be received. The iterator
11121110
/// never blocks waiting for the next message.
11131111
///
1114-
/// [`next`]: https://doc.rust-lang.org/std/iter/trait.Iterator.html#tymethod.next
1112+
/// [`next`]: Iterator::next
11151113
///
11161114
/// # Examples
11171115
///
@@ -1161,8 +1159,7 @@ impl<T> fmt::Debug for TryIter<'_, T> {
11611159
/// Each call to [`next`] blocks waiting for the next message and then returns it. However, if the
11621160
/// channel becomes empty and disconnected, it returns [`None`] without blocking.
11631161
///
1164-
/// [`next`]: https://doc.rust-lang.org/std/iter/trait.Iterator.html#tymethod.next
1165-
/// [`None`]: https://doc.rust-lang.org/std/option/enum.Option.html#variant.None
1162+
/// [`next`]: Iterator::next
11661163
///
11671164
/// # Examples
11681165
///

crossbeam-channel/src/err.rs

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -7,15 +7,15 @@ use std::fmt;
77
///
88
/// The error contains the message so it can be recovered.
99
///
10-
/// [`send`]: struct.Sender.html#method.send
10+
/// [`send`]: super::Sender::send
1111
#[derive(PartialEq, Eq, Clone, Copy)]
1212
pub struct SendError<T>(pub T);
1313

1414
/// An error returned from the [`try_send`] method.
1515
///
1616
/// The error contains the message being sent so it can be recovered.
1717
///
18-
/// [`try_send`]: struct.Sender.html#method.try_send
18+
/// [`try_send`]: super::Sender::try_send
1919
#[derive(PartialEq, Eq, Clone, Copy)]
2020
pub enum TrySendError<T> {
2121
/// The message could not be sent because the channel is full.
@@ -32,7 +32,7 @@ pub enum TrySendError<T> {
3232
///
3333
/// The error contains the message being sent so it can be recovered.
3434
///
35-
/// [`send_timeout`]: struct.Sender.html#method.send_timeout
35+
/// [`send_timeout`]: super::Sender::send_timeout
3636
#[derive(PartialEq, Eq, Clone, Copy)]
3737
pub enum SendTimeoutError<T> {
3838
/// The message could not be sent because the channel is full and the operation timed out.
@@ -49,13 +49,13 @@ pub enum SendTimeoutError<T> {
4949
///
5050
/// A message could not be received because the channel is empty and disconnected.
5151
///
52-
/// [`recv`]: struct.Receiver.html#method.recv
52+
/// [`recv`]: super::Receiver::recv
5353
#[derive(PartialEq, Eq, Clone, Copy, Debug)]
5454
pub struct RecvError;
5555

5656
/// An error returned from the [`try_recv`] method.
5757
///
58-
/// [`try_recv`]: struct.Receiver.html#method.recv
58+
/// [`try_recv`]: super::Receiver::try_recv
5959
#[derive(PartialEq, Eq, Clone, Copy, Debug)]
6060
pub enum TryRecvError {
6161
/// A message could not be received because the channel is empty.
@@ -70,7 +70,7 @@ pub enum TryRecvError {
7070

7171
/// An error returned from the [`recv_timeout`] method.
7272
///
73-
/// [`recv_timeout`]: struct.Receiver.html#method.recv_timeout
73+
/// [`recv_timeout`]: super::Receiver::recv_timeout
7474
#[derive(PartialEq, Eq, Clone, Copy, Debug)]
7575
pub enum RecvTimeoutError {
7676
/// A message could not be received because the channel is empty and the operation timed out.
@@ -87,31 +87,31 @@ pub enum RecvTimeoutError {
8787
///
8888
/// Failed because none of the channel operations were ready.
8989
///
90-
/// [`try_select`]: struct.Select.html#method.try_select
90+
/// [`try_select`]: super::Select::try_select
9191
#[derive(PartialEq, Eq, Clone, Copy, Debug)]
9292
pub struct TrySelectError;
9393

9494
/// An error returned from the [`select_timeout`] method.
9595
///
9696
/// Failed because none of the channel operations became ready before the timeout.
9797
///
98-
/// [`select_timeout`]: struct.Select.html#method.select_timeout
98+
/// [`select_timeout`]: super::Select::select_timeout
9999
#[derive(PartialEq, Eq, Clone, Copy, Debug)]
100100
pub struct SelectTimeoutError;
101101

102102
/// An error returned from the [`try_ready`] method.
103103
///
104104
/// Failed because none of the channel operations were ready.
105105
///
106-
/// [`try_ready`]: struct.Select.html#method.try_ready
106+
/// [`try_ready`]: super::Select::try_ready
107107
#[derive(PartialEq, Eq, Clone, Copy, Debug)]
108108
pub struct TryReadyError;
109109

110110
/// An error returned from the [`ready_timeout`] method.
111111
///
112112
/// Failed because none of the channel operations became ready before the timeout.
113113
///
114-
/// [`ready_timeout`]: struct.Select.html#method.ready_timeout
114+
/// [`ready_timeout`]: super::Select::ready_timeout
115115
#[derive(PartialEq, Eq, Clone, Copy, Debug)]
116116
pub struct ReadyTimeoutError;
117117

crossbeam-channel/src/lib.rs

Lines changed: 4 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -316,20 +316,10 @@
316316
//! }
317317
//! ```
318318
//!
319-
//! [`std::sync::mpsc`]: https://doc.rust-lang.org/std/sync/mpsc/index.html
320-
//! [`unbounded`]: fn.unbounded.html
321-
//! [`bounded`]: fn.bounded.html
322-
//! [`after`]: fn.after.html
323-
//! [`tick`]: fn.tick.html
324-
//! [`never`]: fn.never.html
325-
//! [`send`]: struct.Sender.html#method.send
326-
//! [`recv`]: struct.Receiver.html#method.recv
327-
//! [`iter`]: struct.Receiver.html#method.iter
328-
//! [`try_iter`]: struct.Receiver.html#method.try_iter
329-
//! [`select!`]: macro.select.html
330-
//! [`Select`]: struct.Select.html
331-
//! [`Sender`]: struct.Sender.html
332-
//! [`Receiver`]: struct.Receiver.html
319+
//! [`send`]: Sender::send
320+
//! [`recv`]: Receiver::recv
321+
//! [`iter`]: Receiver::iter
322+
//! [`try_iter`]: Receiver::try_iter
333323
334324
#![doc(test(
335325
no_crate_inject,

0 commit comments

Comments
 (0)