]> git.lizzy.rs Git - rust.git/commit
Make std::raw::Repr an unsafe trait
authorUlrik Sverdrup <root@localhost>
Fri, 13 Feb 2015 19:31:09 +0000 (20:31 +0100)
committerHuon Wilson <dbau.pp+github@gmail.com>
Sat, 14 Feb 2015 00:32:42 +0000 (11:32 +1100)
commit7a52932f4cd65f57bcc8d77f12e32066b2a9c432
tree383cdfcd296f2d0eb92f59fbfbfe3048d14b425c
parent5e3ae102dbeeb646e8c7d2d423cea263337a76af
Make std::raw::Repr an unsafe trait

The default implementation of .repr() will call conveniently call
transmute_copy which should be appropriate for all implementors, but is
memory unsafe if used wrong.

Fixes #22260

You need to use `unsafe impl` to implement the Repr trait now.

[breaking-change]
src/libcore/raw.rs