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