Ah sorry, I pushed this a bit prematurely. I had reset most of the
accidental float-related transmutes. The related issue is
https://github.com/mozilla/rust/issues/6790 though.


On Tue, Mar 18, 2014 at 5:06 PM, Alex Crichton <notifications@github.com>wrote:

> In src/libstd/raw.rs:
>
> > @@ -82,6 +82,14 @@ impl<T> Repr<*Box<T>> for @T {}
> >  impl<T> Repr<*Vec<T>> for ~[T] {}
> >  impl Repr<*String> for ~str {}
> >
> > +pub unsafe fn slice_from_buf<'a, T>(data: *T, len: uint) -> &'a [T] {
> > +    cast::transmute(Slice { data: data, len: len })
> > +}
> > +
> > +pub unsafe fn mut_slice_from_buf<'a, T>(data: *mut T, len: uint) -> &'a mut [T] {
> > +    cast::transmute(Slice { data: data as *T, len: len })
> > +}
>
> I thought the whole point of these structs were to avoid having helpers
> like these?
>
> I don't think we're gaining much by just moving the transmutes into this
> module
>
> —
> Reply to this email directly or view it on GitHub<https://github.com/mozilla/rust/pull/13007/files#r10725740>
> .
>



-- 
http://octayn.net/