blob: ace078bb1d907fdb33a4263de251e9d11d07f47c [file] [log] [blame]
//@ run-pass
#![allow(non_camel_case_types)]
trait double {
fn double(self: Box<Self>) -> usize;
}
impl double for Box<usize> {
fn double(self: Box<Box<usize>>) -> usize { **self * 2 }
}
pub fn main() {
let x: Box<Box<Box<Box<Box<_>>>>> = Box::new(Box::new(Box::new(Box::new(Box::new(3)))));
assert_eq!(x.double(), 6);
}