Created
August 2, 2013 13:15
-
-
Save olsonjeffery/6139793 to your computer and use it in GitHub Desktop.
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
use std::io::println; | |
use std::result::{Result, Ok}; | |
use std::task::{spawn}; | |
pub struct Foo(int); | |
pub trait Bar { | |
fn baz(&self); | |
} | |
impl Bar for Foo { | |
pub fn baz(&self) { println("yay me?"); } | |
} | |
pub struct Froobie(~Bar); | |
fn main() { | |
println("hello world"); | |
let v = 1; | |
do spawn { | |
let foo = Foo(1); | |
let r: Result<~Bar, ()> = Ok(foo as ~Bar); | |
let froobie = match r { | |
Ok(f) => Froobie(~f), | |
Err(_) => {} | |
}; | |
(*froobie).baz(); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment