use std::any::Any;
use std::boxed::BoxAny;
fn main() {
let x: Box<Any> = box "rust";
match x.downcast::<str>() {
Ok(s) => println!("str: {}", s),
Err(x) => println!("{}", x)
}
}
on rustc 0.13.0-dev (260e46115 2015-01-04 16:36:41 +0000)
this yields:
issue.rs:6:13: 6:30 error: the trait `core::kinds::Sized` is not implemented for the type `str`
issue.rs:6 match x.downcast::<str>() {
^~~~~~~~~~~~~~~~~
error: aborting due to previous error