Skip to content

Commit d270244

Browse files
author
John-Mark Allen
committed
Fix Deref docs typos
1 parent 072cda5 commit d270244

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

library/core/src/ops/deref.rs

+3-4
Original file line numberDiff line numberDiff line change
@@ -3,15 +3,15 @@
33
/// In addition to being used for explicit dereferencing operations with the
44
/// (unary) `*` operator in immutable contexts, `Deref` is also used implicitly
55
/// by the compiler in many circumstances. This mechanism is called
6-
/// ['`Deref` coercion'][coercion]. In mutable contexts, [`DerefMut`] is used and
6+
/// ["`Deref` coercion"][coercion]. In mutable contexts, [`DerefMut`] is used and
77
/// mutable deref coercion similarly occurs.
88
///
99
/// **Warning:** Deref coercion is a powerful language feature which has
1010
/// far-reaching implications for every type that implements `Deref`. The
1111
/// compiler will silently insert calls to `Deref::deref`. For this reason, one
1212
/// should be careful about implementing `Deref` and only do so when deref
1313
/// coercion is desirable. See [below][implementing] for advice on when this is
14-
/// typeically desired or undesirable.
14+
/// typically desirable or undesirable.
1515
///
1616
/// Types that implement `Deref` or `DerefMut` are often called "smart
1717
/// pointers" and the mechanism of deref coercion has been specifically designed
@@ -25,7 +25,7 @@
2525
/// If `T` implements `Deref<Target = U>`, and `v` is a value of type `T`, then:
2626
///
2727
/// * In immutable contexts, `*v` (where `T` is neither a reference nor a raw
28-
/// pointer) is equivalent to `*Deref::deref(&x)`.
28+
/// pointer) is equivalent to `*Deref::deref(&v)`.
2929
/// * Values of type `&T` are coerced to values of type `&U`
3030
/// * `T` implicitly implements all the methods of the type `U` which take the
3131
/// `&self` receiver.
@@ -96,7 +96,6 @@
9696
/// [string]: ../../alloc/string/struct.String.html
9797
/// [rc]: ../../alloc/rc/struct.Rc.html
9898
/// [cow]: ../../alloc/borrow/enum.Cow.html
99-
/// [borrow]: core::borrow::Borrow
10099
///
101100
/// # Examples
102101
///

0 commit comments

Comments
 (0)