File tree Expand file tree Collapse file tree 3 files changed +5
-3
lines changed Expand file tree Collapse file tree 3 files changed +5
-3
lines changed Original file line number Diff line number Diff 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
Original file line number Diff line number Diff 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 { ... }
Original file line number Diff line number Diff 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
You can’t perform that action at this time.
0 commit comments