]> git.lizzy.rs Git - rust.git/blob - src/test/ui/autoref-autoderef/autoderef-method-twice.rs
Rollup merge of #62994 - iluuu1994:test-for-43398, r=nikomatsakis
[rust.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 }