1 // run-pass 2 #![allow(non_camel_case_types)] 3 4 trait double { double(self: Box<Self>) -> usize5 fn double(self: Box<Self>) -> usize; 6 } 7 8 impl double for Box<usize> { double(self: Box<Box<usize>>) -> usize9 fn double(self: Box<Box<usize>>) -> usize { **self * 2 } 10 } 11 main()12pub fn main() { 13 let x: Box<Box<Box<Box<Box<_>>>>> = Box::new(Box::new(Box::new(Box::new(Box::new(3))))); 14 assert_eq!(x.double(), 6); 15 } 16