Skip to content

Instantly share code, notes, and snippets.

@anka-213
Forked from anonymous/playground.rs
Created May 12, 2016 22:44
Show Gist options
  • Save anka-213/741a575be7d02ca42ac36e3c500415ad to your computer and use it in GitHub Desktop.
Save anka-213/741a575be7d02ca42ac36e3c500415ad 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