Size of () type in *mut ()



Couldn’t find this in reference.
In particular, if I have

let mut pointer: *mut () = some_pointer_returner();
pointer = pointer.offset(1);

will it be moved by 1 byte? Or some other value?



The Rustinomicon has a chapter on zero sized types.


Thanks for help.

I read Rustonomicon though I somehow missed that () is zero-sized.
Guess I should use *u8 for raw pointers instead :smile:


If you’re interfacing with C, use libc’s c_void (unless you’re actually handling bytes).


I’m actually juggling with bytes, so it should be u8 I think