News for hackers. Stuff that matters.
Re:Why Rust for Low-Level Linux Programming? by pornel on Friday June 10, 2016 @07:12PM (#11880897)
Like in C you can cast the pointer to an integer and back. Rust allows such hacks if you mark them with a "hold my beer" keyword:

    let the_bits:usize = unsafe { std::mem::transmute(pointer) };
You can also use `std::mem::forget(*pointer)` to avoid fighting with Rust about who manages the memory.
Re:Why Rust for Low-Level Linux Programming? by FreeFull on Friday June 10, 2016 @09:01PM (#11881396)
You can actually turn a pointer into an usize without using an unsafe block. For example, here's how you'd do it with a reference:

    let the_bits = pointer as *const _ as usize;