Skip to content

Instantly share code, notes, and snippets.

@agrif
Created December 7, 2013 23:01
Show Gist options
  • Select an option

  • Save agrif/7850921 to your computer and use it in GitHub Desktop.

Select an option

Save agrif/7850921 to your computer and use it in GitHub Desktop.
use std::util::Void;
use std::ptr;
type Type1 = Void;
struct Type2;
fn main() {
let mut t1 : *Type1 = ptr::null();
let mut t2 : *Type2 = ptr::null();
println!("t1: {} t1 as *Void: {}", t1, t1.as_void_ptr());
println!("t2: {} t2 as *Void: {}", t2, t2.as_void_ptr());
}
// t1: 0x0 t1 as *Void: 0x7fa394d4e068
// t2: 0x0 t2 as *Void: 0x7fa394d4e060
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment