]> git.lizzy.rs Git - rust.git/blob - src/test/ui/autoref-autoderef/autoderef-method-twice-but-not-thrice.rs
Rollup merge of #61969 - MikailBag:master, r=Centril
[rust.git] / src / test / ui / autoref-autoderef / autoderef-method-twice-but-not-thrice.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 Box<usize> {
10     fn double(self: Box<Box<usize>>) -> usize { **self * 2 }
11 }
12
13 pub fn main() {
14     let x: Box<Box<Box<Box<Box<_>>>>> = box box box box box 3;
15     assert_eq!(x.double(), 6);
16 }