]> git.proxmox.com Git - rustc.git/blob - src/test/ui/autoref-autoderef/autoderef-method-twice.rs
New upstream version 1.38.0+dfsg1
[rustc.git] / src / test / ui / autoref-autoderef / autoderef-method-twice.rs
1 // run-pass
2 #![allow(non_camel_case_types)]
3 #![feature(box_syntax)]
4
5 trait double {
6 fn double(self: Box<Self>) -> usize;
7 }
8
9 impl double for usize {
10 fn double(self: Box<usize>) -> usize { *self * 2 }
11 }
12
13 pub fn main() {
14 let x: Box<Box<_>> = box box 3;
15 assert_eq!(x.double(), 6);
16 }