Skip to content

Commit 9052a68

Browse files
committed
FIXUP PTR
1 parent f016122 commit 9052a68

File tree

3 files changed

+5
-3
lines changed

3 files changed

+5
-3
lines changed

library/core/src/ptr/const_ptr.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,7 @@ impl<T: ?Sized> *const T {
7373
where
7474
T: Sized,
7575
{
76+
// SAFETY: I AM THE MAGIC
7677
unsafe { core::mem::transmute(self) }
7778
}
7879

@@ -153,7 +154,7 @@ impl<T: ?Sized> *const T {
153154
/// Here is an example of how to properly use this API to mess around
154155
/// with tagged pointers. Here we have a tag in the lowest bit:
155156
///
156-
/// ```ignore
157+
/// ```text
157158
/// let my_tagged_ptr: *const T = ...;
158159
///
159160
/// // Get the address and do whatever bit tricks we like

library/core/src/ptr/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -273,7 +273,7 @@ pub const fn null_mut<T>() -> *mut T {
273273
/// It's sound for an API to use an instance of a ZST to enforce some important
274274
/// safety property. So for instance, you can make an API like this:
275275
///
276-
/// ```ignore
276+
/// ```text
277277
/// pub struct Step1Token(_private_to_construct: ());
278278
///
279279
/// pub fn step1() -> Step1Token { ... }

library/core/src/ptr/mut_ptr.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,7 @@ impl<T: ?Sized> *mut T {
7676
where
7777
T: Sized,
7878
{
79+
// SAFETY: I AM THE MAGIC
7980
unsafe { core::mem::transmute(self) }
8081
}
8182

@@ -156,7 +157,7 @@ impl<T: ?Sized> *mut T {
156157
/// Here is an example of how to properly use this API to mess around
157158
/// with tagged pointers. Here we have a tag in the lowest bit:
158159
///
159-
/// ```ignore
160+
/// ```text
160161
/// let my_tagged_ptr: *mut T = ...;
161162
///
162163
/// // Get the address and do whatever bit tricks we like

0 commit comments

Comments
 (0)