diff --git a/src/libcore/raw.rs b/src/libcore/raw.rs index 81edfe7d6e26..bb0c22d3561d 100644 --- a/src/libcore/raw.rs +++ b/src/libcore/raw.rs @@ -154,7 +154,7 @@ pub struct TraitObject { /// This trait is meant to map equivalences between raw structs and their /// corresponding rust values. -pub trait Repr { +pub unsafe trait Repr { /// This function "unwraps" a rust value (without consuming it) into its raw /// 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 @@ -163,5 +163,5 @@ pub trait Repr { fn repr(&self) -> T { unsafe { mem::transmute_copy(&self) } } } -impl Repr> for [T] {} -impl Repr> for str {} +unsafe impl Repr> for [T] {} +unsafe impl Repr> for str {}