Skip to content

Instantly share code, notes, and snippets.

@am0d
Created October 13, 2012 19:00
Show Gist options
  • Save am0d/3885764 to your computer and use it in GitHub Desktop.
Save am0d/3885764 to your computer and use it in GitHub Desktop.
Sample showing llvm crash
extern mod std;
struct Tree {
mut leftTree: @Option<Tree>,
mut rightTree: @Option<Tree>,
key: int
}
impl Tree {
fn insert(i: int) {
if i > self.key {
match copy *self.rightTree {
Some(t) => t.insert(i),
None => self.rightTree = @Some(Tree {leftTree: @None, rightTree: @None, key: i})
}
}
}
}
fn main () {
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment