@@ -410,12 +410,12 @@ pub trait TryInto<T>: Sized {
410
410
///
411
411
/// This is useful when you are doing a type conversion that may
412
412
/// trivially succeed but may also need special handling.
413
- /// For example, there is no way to convert an `i64` into an `i32`
414
- /// using the [`From`] trait, because an `i64` may contain a value
415
- /// that an `i32` cannot represent and so the conversion would lose data.
416
- /// This might be handled by truncating the `i64` to an `i32` (essentially
417
- /// giving the `i64`'s value modulo `i32::MAX`) or by simply returning
418
- /// `i32::MAX`, or by some other method. The `From` trait is intended
413
+ /// For example, there is no way to convert an [ `i64`] into an [ `i32`]
414
+ /// using the [`From`] trait, because an [ `i64`] may contain a value
415
+ /// that an [ `i32`] cannot represent and so the conversion would lose data.
416
+ /// This might be handled by truncating the [ `i64`] to an [ `i32`] (essentially
417
+ /// giving the [ `i64`] 's value modulo [ `i32::MAX`] ) or by simply returning
418
+ /// [ `i32::MAX`] , or by some other method. The [ `From`] trait is intended
419
419
/// for perfect conversions, so the `TryFrom` trait informs the
420
420
/// programmer when a type conversion could go bad and lets them
421
421
/// decide how to handle it.
@@ -425,8 +425,8 @@ pub trait TryInto<T>: Sized {
425
425
/// - `TryFrom<T> for U` implies [`TryInto`]`<U> for T`
426
426
/// - [`try_from`] is reflexive, which means that `TryFrom<T> for T`
427
427
/// is implemented and cannot fail -- the associated `Error` type for
428
- /// calling `T::try_from()` on a value of type `T` is `Infallible`.
429
- /// When the `!` type is stablized `Infallible` and `!` will be
428
+ /// calling `T::try_from()` on a value of type `T` is [ `Infallible`] .
429
+ /// When the [ `!`] type is stablized [ `Infallible`] and [ `!`] will be
430
430
/// equivalent.
431
431
///
432
432
/// `TryFrom<T>` can be implemented as follows:
@@ -451,7 +451,7 @@ pub trait TryInto<T>: Sized {
451
451
///
452
452
/// # Examples
453
453
///
454
- /// As described, [`i32`] implements `TryFrom<i64>`:
454
+ /// As described, [`i32`] implements `TryFrom<`[` i64`]` >`:
455
455
///
456
456
/// ```
457
457
/// use std::convert::TryFrom;
@@ -474,6 +474,8 @@ pub trait TryInto<T>: Sized {
474
474
///
475
475
/// [`try_from`]: trait.TryFrom.html#tymethod.try_from
476
476
/// [`TryInto`]: trait.TryInto.html
477
+ /// [`i32::MAX`]: ../../std/i32/constant.MAX.html
478
+ /// [`!`]: ../../std/primitive.never.html
477
479
#[ stable( feature = "try_from" , since = "1.34.0" ) ]
478
480
pub trait TryFrom < T > : Sized {
479
481
/// The type returned in the event of a conversion error.
0 commit comments