Unsafe casting functions

Function bump_box_refcount

unsafe fn bump_box_refcount<T>(t: @T)

Force-increment the reference count on a shared box. If used carelessly, this can leak the box.

Function copy_lifetime

unsafe fn copy_lifetime<'a, S, T>(_ptr: &'a S, ptr: &T) -> &'a T

Transforms lifetime of the second pointer to match the first.

Function copy_lifetime_vec

unsafe fn copy_lifetime_vec<'a, S, T>(_ptr: &'a [S], ptr: &T) -> &'a T

Transforms lifetime of the second pointer to match the first.

Function copy_mut_lifetime

unsafe fn copy_mut_lifetime<'a, S, T>(_ptr: &'a mut S, ptr: &mut T) ->
 &'a mut T

Transforms lifetime of the second pointer to match the first.

Function forget

unsafe fn forget<T>(thing: T)

Move a thing into the void

The forget function will take ownership of the provided value but neglect to run any required cleanup or memory-management operations on it. This can be used for various acts of magick.

Function transmute

unsafe fn transmute<L, G>(thing: L) -> G

Transform a value of one type into a value of another type. Both types must have the same size and alignment.

Example

assert!(transmute("L") == ~[76u8, 0u8]);

Function transmute_copy

unsafe fn transmute_copy<T, U>(src: &T) -> U

Casts the value at src to U. The two types must have the same length.

Function transmute_immut

unsafe fn transmute_immut<'a, T>(ptr: &'a mut T) -> &'a T

Coerce a mutable reference to be immutable.

Function transmute_immut_unsafe

unsafe fn transmute_immut_unsafe<T>(ptr: *const T) -> *T

Coerce an immutable reference to be mutable.

Function transmute_mut

unsafe fn transmute_mut<'a, T>(ptr: &'a T) -> &'a mut T

Coerce an immutable reference to be mutable.

Function transmute_mut_region

unsafe fn transmute_mut_region<'a, 'b, T>(ptr: &'a mut T) -> &'b mut T

Coerce a borrowed mutable pointer to have an arbitrary associated region.

Function transmute_mut_unsafe

unsafe fn transmute_mut_unsafe<T>(ptr: *const T) -> *mut T

Coerce an immutable reference to be mutable.

Function transmute_region

unsafe fn transmute_region<'a, 'b, T>(ptr: &'a T) -> &'b T

Coerce a borrowed pointer to have an arbitrary associated region.