Skip to content

Commit

Permalink
Fix Deref docs typos
Browse files Browse the repository at this point in the history
  • Loading branch information
John-Mark Allen committed Jun 16, 2023
1 parent 072cda5 commit d270244
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions library/core/src/ops/deref.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,15 @@
/// In addition to being used for explicit dereferencing operations with the
/// (unary) `*` operator in immutable contexts, `Deref` is also used implicitly
/// by the compiler in many circumstances. This mechanism is called
/// ['`Deref` coercion'][coercion]. In mutable contexts, [`DerefMut`] is used and
/// ["`Deref` coercion"][coercion]. In mutable contexts, [`DerefMut`] is used and
/// mutable deref coercion similarly occurs.
///
/// **Warning:** Deref coercion is a powerful language feature which has
/// far-reaching implications for every type that implements `Deref`. The
/// compiler will silently insert calls to `Deref::deref`. For this reason, one
/// should be careful about implementing `Deref` and only do so when deref
/// coercion is desirable. See [below][implementing] for advice on when this is
/// typeically desired or undesirable.
/// typically desirable or undesirable.
///
/// Types that implement `Deref` or `DerefMut` are often called "smart
/// pointers" and the mechanism of deref coercion has been specifically designed
Expand All @@ -25,7 +25,7 @@
/// If `T` implements `Deref<Target = U>`, and `v` is a value of type `T`, then:
///
/// * In immutable contexts, `*v` (where `T` is neither a reference nor a raw
/// pointer) is equivalent to `*Deref::deref(&x)`.
/// pointer) is equivalent to `*Deref::deref(&v)`.
/// * Values of type `&T` are coerced to values of type `&U`
/// * `T` implicitly implements all the methods of the type `U` which take the
/// `&self` receiver.
Expand Down Expand Up @@ -96,7 +96,6 @@
/// [string]: ../../alloc/string/struct.String.html
/// [rc]: ../../alloc/rc/struct.Rc.html
/// [cow]: ../../alloc/borrow/enum.Cow.html
/// [borrow]: core::borrow::Borrow
///
/// # Examples
///
Expand Down

0 comments on commit d270244

Please sign in to comment.