Skip to content

Commit e65385f

Browse files
committed
Fix broken links to Drop that used to point to Drop::drop due to the markdown link definition names being case insensitive.
1 parent 87ac118 commit e65385f

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

library/core/src/pin.rs

+7-7
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,7 @@
129129
//!
130130
//! To make this work, every element has pointers to its predecessor and successor in
131131
//! the list. Elements can only be added when they are pinned, because moving the elements
132-
//! around would invalidate the pointers. Moreover, the [`Drop`] implementation of a linked
132+
//! around would invalidate the pointers. Moreover, the [`Drop`][Drop] implementation of a linked
133133
//! list element will patch the pointers of its predecessor and successor to remove itself
134134
//! from the list.
135135
//!
@@ -165,18 +165,18 @@
165165
//! # `Drop` implementation
166166
//!
167167
//! If your type uses pinning (such as the two examples above), you have to be careful
168-
//! when implementing [`Drop`]. The [`drop`] function takes <code>[&mut] self</code>, but this
168+
//! when implementing [`Drop`][Drop]. The [`drop`] function takes <code>[&mut] self</code>, but this
169169
//! is called *even if your type was previously pinned*! It is as if the
170170
//! compiler automatically called [`Pin::get_unchecked_mut`].
171171
//!
172172
//! This can never cause a problem in safe code because implementing a type that
173173
//! relies on pinning requires unsafe code, but be aware that deciding to make
174174
//! use of pinning in your type (for example by implementing some operation on
175-
//! <code>[Pin]<[&]Self></code> or <code>[Pin]<[&mut] Self></code>) has consequences for your [`Drop`]
175+
//! <code>[Pin]<[&]Self></code> or <code>[Pin]<[&mut] Self></code>) has consequences for your [`Drop`][Drop]
176176
//! implementation as well: if an element of your type could have been pinned,
177-
//! you must treat [`Drop`] as implicitly taking <code>[Pin]<[&mut] Self></code>.
177+
//! you must treat [`Drop`][Drop] as implicitly taking <code>[Pin]<[&mut] Self></code>.
178178
//!
179-
//! For example, you could implement [`Drop`] as follows:
179+
//! For example, you could implement [`Drop`][Drop] as follows:
180180
//!
181181
//! ```rust,no_run
182182
//! # use std::pin::Pin;
@@ -284,7 +284,7 @@
284284
//! 2. The destructor of the struct must not move structural fields out of its argument. This
285285
//! is the exact point that was raised in the [previous section][drop-impl]: [`drop`] takes
286286
//! <code>[&mut] self</code>, but the struct (and hence its fields) might have been pinned before.
287-
//! You have to guarantee that you do not move a field inside your [`Drop`] implementation.
287+
//! You have to guarantee that you do not move a field inside your [`Drop`][Drop] implementation.
288288
//! In particular, as explained previously, this means that your struct must *not*
289289
//! be `#[repr(packed)]`.
290290
//! See that section for how to write [`drop`] in a way that the compiler can help you
@@ -294,7 +294,7 @@
294294
//! content is not overwritten or deallocated without calling the content's destructors.
295295
//! This can be tricky, as witnessed by <code>[VecDeque]\<T></code>: the destructor of <code>[VecDeque]\<T></code>
296296
//! can fail to call [`drop`] on all elements if one of the destructors panics. This violates
297-
//! the [`Drop`] guarantee, because it can lead to elements being deallocated without
297+
//! the [`Drop`][Drop] guarantee, because it can lead to elements being deallocated without
298298
//! their destructor being called. (<code>[VecDeque]\<T></code> has no pinning projections, so this
299299
//! does not cause unsoundness.)
300300
//! 4. You must not offer any other operations that could lead to data being moved out of

0 commit comments

Comments
 (0)