Flag the Repr::repr function with #[inline]

This allows cross-crate inlining which is *very* good because this is called a
lot throughout libstd (even when libstd is inlined across crates).
This commit is contained in:
Alex Crichton 2013-09-06 22:29:29 -07:00
parent 28d042e198
commit 739df232fe

View File

@ -49,6 +49,7 @@ pub trait Repr<T> {
/// struct representation. This can be used to read/write different values
/// for the struct. This is a safe method because by default it does not
/// give write-access to the struct returned.
#[inline]
fn repr(&self) -> T { unsafe { cast::transmute_copy(self) } }
}