@@ -251,12 +251,12 @@ pub trait AsMut<T: ?Sized> {
251251///
252252/// # Examples
253253///
254- /// [`String`] implements `Into< Vec<u8 >>`:
254+ /// [`String`] implements [ `Into`]`<`[` Vec`]`<`[`u8`]` >>`:
255255///
256256/// In order to express that we want a generic function to take all arguments that can be
257257/// converted to a specified type `T`, we can use a trait bound of [`Into`]`<T>`.
258258/// For example: The function `is_hello` takes all arguments that can be converted into a
259- /// `Vec<u8 >`.
259+ /// [ `Vec`]`<`[`u8`]` >`.
260260///
261261/// ```
262262/// fn is_hello<T: Into<Vec<u8>>>(s: T) {
@@ -274,6 +274,7 @@ pub trait AsMut<T: ?Sized> {
274274/// [`String`]: ../../std/string/struct.String.html
275275/// [`From`]: trait.From.html
276276/// [`Into`]: trait.Into.html
277+ /// [`Vec`]: ../../std/vec/struct.Vec.html
277278#[ stable( feature = "rust1" , since = "1.0.0" ) ]
278279pub trait Into < T > : Sized {
279280 /// Performs the conversion.
@@ -410,12 +411,12 @@ pub trait TryInto<T>: Sized {
410411///
411412/// This is useful when you are doing a type conversion that may
412413/// 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
414+ /// For example, there is no way to convert an [ `i64`] into an [ `i32`]
415+ /// using the [`From`] trait, because an [ `i64`] may contain a value
416+ /// that an [ `i32`] cannot represent and so the conversion would lose data.
417+ /// This might be handled by truncating the [ `i64`] to an [ `i32`] (essentially
418+ /// giving the [ `i64`] 's value modulo [ `i32::MAX`] ) or by simply returning
419+ /// [ `i32::MAX`] , or by some other method. The [ `From`] trait is intended
419420/// for perfect conversions, so the `TryFrom` trait informs the
420421/// programmer when a type conversion could go bad and lets them
421422/// decide how to handle it.
@@ -425,8 +426,8 @@ pub trait TryInto<T>: Sized {
425426/// - `TryFrom<T> for U` implies [`TryInto`]`<U> for T`
426427/// - [`try_from`] is reflexive, which means that `TryFrom<T> for T`
427428/// 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
429+ /// calling `T::try_from()` on a value of type `T` is [ `Infallible`] .
430+ /// When the [ `!`] type is stablized [ `Infallible`] and [ `!`] will be
430431/// equivalent.
431432///
432433/// `TryFrom<T>` can be implemented as follows:
@@ -451,7 +452,7 @@ pub trait TryInto<T>: Sized {
451452///
452453/// # Examples
453454///
454- /// As described, [`i32`] implements `TryFrom<i64>`:
455+ /// As described, [`i32`] implements `TryFrom<`[` i64`]` >`:
455456///
456457/// ```
457458/// use std::convert::TryFrom;
@@ -474,6 +475,8 @@ pub trait TryInto<T>: Sized {
474475///
475476/// [`try_from`]: trait.TryFrom.html#tymethod.try_from
476477/// [`TryInto`]: trait.TryInto.html
478+ /// [`i32::MAX`]: ../../std/i32/constant.MAX.html
479+ /// [`!`]: ../../std/primitive.never.html
477480#[ stable( feature = "try_from" , since = "1.34.0" ) ]
478481pub trait TryFrom < T > : Sized {
479482 /// The type returned in the event of a conversion error.
0 commit comments