@@ -134,8 +134,8 @@ pub const fn identity<T>(x: T) -> T {
134
134
/// want to accept all references that can be converted to [`&str`] as an argument.
135
135
/// Since both [`String`] and [`&str`] implement `AsRef<str>` we can accept both as input argument.
136
136
///
137
- /// [`Option<T>`]: crate::option:: Option
138
- /// [`Result<T, E>`]: crate::result:: Result
137
+ /// [`Option<T>`]: Option
138
+ /// [`Result<T, E>`]: Result
139
139
/// [`Borrow`]: crate::borrow::Borrow
140
140
/// [`Eq`]: crate::cmp::Eq
141
141
/// [`Ord`]: crate::cmp::Ord
@@ -168,8 +168,8 @@ pub trait AsRef<T: ?Sized> {
168
168
/// **Note: This trait must not fail**. If the conversion can fail, use a
169
169
/// dedicated method which returns an [`Option<T>`] or a [`Result<T, E>`].
170
170
///
171
- /// [`Option<T>`]: crate::option:: Option
172
- /// [`Result<T, E>`]: crate::result:: Result
171
+ /// [`Option<T>`]: Option
172
+ /// [`Result<T, E>`]: Result
173
173
///
174
174
/// # Generic Implementations
175
175
///
@@ -195,7 +195,7 @@ pub trait AsRef<T: ?Sized> {
195
195
/// assert_eq!(*boxed_num, 1);
196
196
/// ```
197
197
///
198
- /// [`Box<T>`]: crate:: boxed:: Box<T>
198
+ /// [`Box<T>`]: ../../std/ boxed/struct. Box.html
199
199
#[ stable( feature = "rust1" , since = "1.0.0" ) ]
200
200
pub trait AsMut < T : ?Sized > {
201
201
/// Performs the conversion.
@@ -269,10 +269,10 @@ pub trait AsMut<T: ?Sized> {
269
269
/// is_hello(s);
270
270
/// ```
271
271
///
272
- /// [`Option<T>`]: crate::option:: Option
273
- /// [`Result<T, E>`]: crate::result:: Result
272
+ /// [`Option<T>`]: Option
273
+ /// [`Result<T, E>`]: Result
274
274
/// [`String`]: ../../std/string/struct.String.html
275
- /// [`Vec`]: crate:: vec:: Vec<T>
275
+ /// [`Vec`]: ../../std/ vec/struct. Vec.html
276
276
#[ stable( feature = "rust1" , since = "1.0.0" ) ]
277
277
pub trait Into < T > : Sized {
278
278
/// Performs the conversion.
@@ -358,9 +358,10 @@ pub trait Into<T>: Sized {
358
358
/// }
359
359
/// ```
360
360
///
361
- /// [`Option<T>`]: crate::option:: Option
362
- /// [`Result<T, E>`]: crate::result:: Result
361
+ /// [`Option<T>`]: Option
362
+ /// [`Result<T, E>`]: Result
363
363
/// [`String`]: ../../std/string/struct.String.html
364
+ /// [`from`]: From::from
364
365
/// [book]: ../../book/ch09-00-error-handling.html
365
366
#[ rustc_diagnostic_item = "from_trait" ]
366
367
#[ stable( feature = "rust1" , since = "1.0.0" ) ]
@@ -418,7 +419,7 @@ pub trait TryInto<T>: Sized {
418
419
/// # Generic Implementations
419
420
///
420
421
/// - `TryFrom<T> for U` implies [`TryInto`]`<U> for T`
421
- /// - [`TryFrom:: try_from`] is reflexive, which means that `TryFrom<T> for T`
422
+ /// - [`try_from`] is reflexive, which means that `TryFrom<T> for T`
422
423
/// is implemented and cannot fail -- the associated `Error` type for
423
424
/// calling `T::try_from()` on a value of type `T` is [`Infallible`].
424
425
/// When the [`!`] type is stabilized [`Infallible`] and [`!`] will be
@@ -467,7 +468,7 @@ pub trait TryInto<T>: Sized {
467
468
/// assert!(try_successful_smaller_number.is_ok());
468
469
/// ```
469
470
///
470
- /// [`i32::MAX `]: crate::i32::MAX
471
+ /// [`try_from `]: TryFrom::try_from
471
472
/// [`!`]: ../../std/primitive.never.html
472
473
#[ stable( feature = "try_from" , since = "1.34.0" ) ]
473
474
pub trait TryFrom < T > : Sized {
@@ -670,8 +671,6 @@ impl AsRef<str> for str {
670
671
/// the two `impl`s will start to overlap
671
672
/// and therefore will be disallowed by the language’s trait coherence rules.
672
673
///
673
- /// [`Ok`]: super::result::Result::Ok
674
- /// [`Result`]: super::result::Result
675
674
/// [never]: ../../std/primitive.never.html
676
675
#[ stable( feature = "convert_infallible" , since = "1.34.0" ) ]
677
676
#[ derive( Copy ) ]
0 commit comments