Skip to content

Instantly share code, notes, and snippets.

@pcwalton
Forked from nikomatsakis/gist:2039794
Created March 14, 2012 21:51
Show Gist options
  • Save pcwalton/2039801 to your computer and use it in GitHub Desktop.
Save pcwalton/2039801 to your computer and use it in GitHub Desktop.
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 ...
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment