This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| extern mod std; | |
| use std::map::HashMap; | |
| use std::map::Set; | |
| use std::map::vec_from_set; | |
| enum Choice { | |
| Many(Set<int>), | |
| One(int), | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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 ... | |
| } |