Add a bunch of inline hints.

This commit is contained in:
Graydon Hoare
2012-09-11 15:57:32 -07:00
parent 3c14dae4a6
commit 4ce2ee12be
3 changed files with 12 additions and 0 deletions

View File

@@ -9,9 +9,11 @@ use cmp::Eq;
*/
/// The identity function.
#[inline(always)]
pure fn id<T>(+x: T) -> T { move x }
/// Ignores a value.
#[inline(always)]
pure fn ignore<T>(+_x: T) { }
/// Sets `*ptr` to `new_value`, invokes `op()`, and then restores the