I am trying to build a raw::TraitObject
using mem::transmute
As suggested by the doc but I am getting a compiler error
Standard Error
Compiling playground v0.0.1 (file:///playground)
error[E0512]: transmute called with types of different sizes
--> src/main.rs:18:38
|
18 | let to : raw::TraitObject = unsafe { mem::transmute(b_foo) };
| ^^^^^^^^^^^^^^
|
= note: source type: std::boxed::Box<FooImpl> (64 bits)
= note: target type: std::raw::TraitObject (128 bits)
What am I doing weong here ?
Link to a sample playground: