chris-morgan / mopa

MOPA: My Own Personal Any. A macro to implement all the `Any` methods on your own trait.
Other
112 stars 9 forks source link

Consider using raw pointer casts #6

Closed bluss closed 8 years ago

bluss commented 8 years ago

You can use a raw pointer cast (fat -> thin) to get the data pointer.

Example:

let x = 1;
let p = &x as &Send; 
let data_pointer = p as *const Send as *const u8

I guess we just need to find the right letter of an RFC to know that this is on solid ground, but it should be.

bluss commented 8 years ago

Thanks!

jonhoo commented 5 years ago

@chris-morgan any chance of seeing a release that contains the fix from 2bb823b4da60316868a8adb8be573b6b5dd6f508? 0.2.2 on crates.io doesn't contain it it seems?