Skip to content

Commit f10ab91

Browse files
committed
Add suggestions from code review
1 parent b3437f3 commit f10ab91

File tree

2 files changed

+12
-17
lines changed

2 files changed

+12
-17
lines changed

library/std/src/primitive_docs.rs

+6-6
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ mod prim_bool {}
9999
/// at all we know it can never produce a value which isn't a [`u32`]. This illustrates another
100100
/// behaviour of the `!` type - expressions with type `!` will coerce into any other type.
101101
///
102-
/// [`exit`]: crate::process::exit
102+
/// [`exit`]: process::exit
103103
///
104104
/// # `!` and generics
105105
///
@@ -354,7 +354,7 @@ mod prim_unit {}
354354
//
355355
/// Raw, unsafe pointers, `*const T`, and `*mut T`.
356356
///
357-
/// *[See also the `std::ptr` module][`crate::ptr`].*
357+
/// *[See also the `std::ptr` module][`ptr`].*
358358
///
359359
/// Working with raw pointers in Rust is uncommon, typically limited to a few patterns.
360360
/// Raw pointers can be unaligned or [`null`]. However, when a raw pointer is
@@ -545,7 +545,7 @@ mod prim_array {}
545545
/// means that elements are laid out so that every element is the same
546546
/// distance from its neighbors.
547547
///
548-
/// *[See also the `std::slice` module][`crate::slice`].*
548+
/// *[See also the `std::slice` module][`slice`].*
549549
///
550550
/// Slices are a view into a block of memory represented as a pointer and a
551551
/// length.
@@ -590,7 +590,7 @@ mod prim_slice {}
590590
//
591591
/// String slices.
592592
///
593-
/// *[See also the `std::str` module][`crate::str`].*
593+
/// *[See also the `std::str` module][`str`].*
594594
///
595595
/// The `str` type, also called a 'string slice', is the most primitive string
596596
/// type. It is usually seen in its borrowed form, `&str`. It is also the type
@@ -785,7 +785,7 @@ mod prim_tuple {}
785785
///
786786
/// For more information on floating point numbers, see [Wikipedia][wikipedia].
787787
///
788-
/// *[See also the `std::f32::consts` module][`crate::f32::consts`].*
788+
/// *[See also the `std::f32::consts` module][`f32::consts`].*
789789
///
790790
/// [wikipedia]: https://en.wikipedia.org/wiki/Single-precision_floating-point_format
791791
#[stable(feature = "rust1", since = "1.0.0")]
@@ -799,7 +799,7 @@ mod prim_f32 {}
799799
/// `f32`] or [Wikipedia on double precision
800800
/// values][wikipedia] for more information.
801801
///
802-
/// *[See also the `std::f64::consts` module][`crate::f64::consts`].*
802+
/// *[See also the `std::f64::consts` module][`f64::consts`].*
803803
///
804804
/// [wikipedia]: https://en.wikipedia.org/wiki/Double-precision_floating-point_format
805805
#[stable(feature = "rust1", since = "1.0.0")]

library/std/src/sys_common/poison.rs

+6-11
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,9 @@ use crate::fmt;
33
use crate::sync::atomic::{AtomicBool, Ordering};
44
use crate::thread;
55

6+
#[cfg(doc)]
7+
use crate::sync::{Mutex, RwLock};
8+
69
pub struct Flag {
710
failed: AtomicBool,
811
}
@@ -77,9 +80,6 @@ pub struct Guard {
7780
/// }
7881
/// };
7982
/// ```
80-
///
81-
/// [`Mutex`]: crate::sync::Mutex
82-
/// [`RwLock`]: crate::sync::RwLock
8383
#[stable(feature = "rust1", since = "1.0.0")]
8484
pub struct PoisonError<T> {
8585
guard: T,
@@ -89,11 +89,9 @@ pub struct PoisonError<T> {
8989
/// can occur while trying to acquire a lock, from the [`try_lock`] method on a
9090
/// [`Mutex`] or the [`try_read`] and [`try_write`] methods on an [`RwLock`].
9191
///
92-
/// [`Mutex`]: crate::sync::Mutex
93-
/// [`RwLock`]: crate::sync::RwLock
94-
/// [`try_lock`]: crate::sync::Mutex::try_lock
95-
/// [`try_read`]: crate::sync::RwLock::try_read
96-
/// [`try_write`]: crate::sync::RwLock::try_write
92+
/// [`try_lock`]: Mutex::try_lock
93+
/// [`try_read`]: RwLock::try_read
94+
/// [`try_write`]: RwLock::try_write
9795
#[stable(feature = "rust1", since = "1.0.0")]
9896
pub enum TryLockError<T> {
9997
/// The lock could not be acquired because another thread failed while holding
@@ -152,9 +150,6 @@ impl<T> PoisonError<T> {
152150
/// Creates a `PoisonError`.
153151
///
154152
/// This is generally created by methods like [`Mutex::lock`] or [`RwLock::read`].
155-
///
156-
/// [`Mutex::lock`]: crate::sync::Mutex::lock
157-
/// [`RwLock::read`]: crate::sync::RwLock::read
158153
#[stable(feature = "sync_poison", since = "1.2.0")]
159154
pub fn new(guard: T) -> PoisonError<T> {
160155
PoisonError { guard }

0 commit comments

Comments
 (0)