Skip to content

Instantly share code, notes, and snippets.

extern mod std;
use std::map::HashMap;
use std::map::Set;
use std::map::vec_from_set;
enum Choice {
Many(Set<int>),
One(int),
}
fn foo(p: &a.memory_pool) -> &a.T {
let x: &a.T = new(*p) T;
ret x; // ok
}
fn bar() {
let pool: memory_pool = pool();
let x = foo(pool);
// ... do something with x ...
}