rust/src/test/run-pass/class-cast-to-trait-cross-crate-2.rs
2012-08-23 11:14:14 -07:00

18 lines
355 B
Rust

// xfail-fast
// aux-build:cci_class_cast.rs
use cci_class_cast;
import to_str::ToStr;
import cci_class_cast::kitty::*;
fn print_out<T: ToStr>(thing: T, expected: ~str) {
let actual = thing.to_str();
debug!("%s", actual);
assert(actual == expected);
}
fn main() {
let nyan : ToStr = cat(0u, 2, ~"nyan") as ToStr;
print_out(nyan, ~"nyan");
}