// run-pass trait Foo { fn get(&self) -> T; } struct S { x: isize } impl Foo for S { fn get(&self) -> isize { self.x } } pub fn main() { let x = Box::new(S { x: 1 }); let y = x as Box>; assert_eq!(y.get(), 1); }