]> git.lizzy.rs Git - rust.git/blobdiff - src/libcore/intrinsics.rs
Various minor/cosmetic improvements to code
[rust.git] / src / libcore / intrinsics.rs
index 7ed6e4a8f51eb1ea2e3913c7b0cf4d5f5daff44e..eebb98b5e6d4580727bb8ceacab2204029e897ca 100644 (file)
@@ -52,7 +52,7 @@
 pub use ptr::drop_in_place;
 
 extern "rust-intrinsic" {
-    // NB: These intrinsics take raw pointers because they mutate aliased
+    // N.B., these intrinsics take raw pointers because they mutate aliased
     // memory, which is not valid for either `&` or `&mut`.
 
     /// Stores a value if the current value is the same as the `old` value.
     /// Tells LLVM that this point in the code is not reachable, enabling
     /// further optimizations.
     ///
-    /// NB: This is very different from the `unreachable!()` macro: Unlike the
+    /// N.B., this is very different from the `unreachable!()` macro: Unlike the
     /// macro, which panics when it is executed, it is *undefined behavior* to
     /// reach code marked with this function.
     ///
     ///
     /// More specifically, this is the offset in bytes between successive
     /// items of the same type, including alignment padding.
+    ///
+    /// The stabilized version of this intrinsic is
+    /// [`std::mem::size_of`](../../std/mem/fn.size_of.html).
     pub fn size_of<T>() -> usize;
 
     /// Moves a value to an uninitialized memory location.
     /// initialize memory previous set to the result of `uninit`.
     pub fn uninit<T>() -> T;
 
+    /// Moves a value out of scope without running drop glue.
+    #[cfg(not(stage0))]
+    pub fn forget<T: ?Sized>(_: T);
+
     /// Reinterprets the bits of a value of one type as another type.
     ///
     /// Both types must have the same size. Neither the original, nor the result,