Created
May 8, 2013 00:34
-
-
Save wilkie/5537339 to your computer and use it in GitHub Desktop.
Compiles to a program that segfaults upon execution.
This file contains 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
pub enum Thing { | |
A(u64), | |
B(~Foo) | |
} | |
pub trait Foo { | |
fn foo(); | |
} | |
pub struct Struct { | |
a: u64 | |
} | |
impl Foo for Struct { | |
pub fn foo() {} | |
} | |
pub fn new() -> Thing { | |
B(~Struct{a: 5} as ~Foo) | |
} | |
fn main() { | |
let foo = match new() { | |
A(a) => 0, | |
B(b) => 1 | |
}; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment