// run-pass #![allow(dead_code)] #![allow(unused_variables)] // Testing creating two vtables with the same self type, but different // traits. use std::any::Any; trait Wrap { fn get(&self) -> isize; fn wrap(self: Box) -> Box; } impl Wrap for isize { fn get(&self) -> isize { *self } fn wrap(self: Box) -> Box { self as Box } } fn is(x: &dyn Any) -> bool { x.is::() } fn main() { let x = Box::new(22isize) as Box; println!("x={}", x.get()); let y = x.wrap(); }