Skip to content

Instantly share code, notes, and snippets.

Created May 12, 2016 22:44
Show Gist options
  • Save anonymous/876e8a31714dc3ba0b966d7391dd2c4e to your computer and use it in GitHub Desktop.
Save anonymous/876e8a31714dc3ba0b966d7391dd2c4e to your computer and use it in GitHub Desktop.
Shared via Rust Playground
#![allow(dead_code)]
#![allow(unused_variables)]
#![allow(unused_mut)]
struct Asdf(i32, Option<Gc<Asdf>>);
struct Gc<T>(*const T);
impl<T> Drop for Gc<T> {
fn drop(&mut self) {
// remove from roots
}
}
#[derive(Default)]
struct Heap<T> {
contents : Vec<T>,
roots : Vec<usize>
}
fn main() {
let mut heap : Heap<Asdf> = Heap{contents: vec!(), roots: vec!()};
println!("Hello");
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment