Skip to content

Note rust intrinsics

Eric Holk edited this page Jun 21, 2012 · 3 revisions

Rust provides several intrinsic functions. These are called like normal functions, but are translated directly into LLVM code by trans. These are meant to implement low-level, unsafe things in the core libraries. This page attempts to list all the intrinsics, what they do, how to use them, and why they exist. The intrinsics are currently implemented in src/rustc/middle/trans/native.rs.

  • fn addr_of<T>(val: T) -> *T - Returns the address of a thing. Used to imlpement ptr::addr_of and ptr::mut_addr_of. Use these functions instead.
  • fn atomic_add(&dst: int, src: int) -> int
  • fn atomic_add_acq(&dst: int, src: int) -> int
  • fn atomic_add_rel(&dst: int, src: int) -> int
  • fn atomic_sub(&dst: int, src: int) -> int
  • fn atomic_sub_acq(&dst: int, src: int) -> int
  • fn atomic_sub_rel(&dst: int, src: int) -> int
  • fn atomic_xchng(&dst: int, src: int) -> int
  • fn atomic_xchng_acq(&dst: int, src: int) -> int
  • fn atomic_xchng_rel(&dst: int, src: int) -> int
  • forget
  • frame_address
  • get_tydesc
  • init
  • min_align_of
  • move_val
  • move_val_init
  • needs_drop
  • pref_align_of
  • reinterpret_cast
  • size_of
  • visit_ty

All Categories:

Clone this wiki locally