]> git.lizzy.rs Git - rust.git/blob - src/test/ui/autoref-autoderef/autoderef-method.rs
Auto merge of #75936 - sdroege:chunks-exact-construction-bounds-check, r=nagisa
[rust.git] / src / test / ui / autoref-autoderef / autoderef-method.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 3;
15     assert_eq!(x.double(), 6);
16 }