]> git.lizzy.rs Git - rust.git/blob - src/test/ui/autoref-autoderef/autoderef-method-priority.rs
Rollup merge of #62514 - stephaneyfx:box-ffi, r=nikomatsakis
[rust.git] / src / test / ui / autoref-autoderef / autoderef-method-priority.rs
1 // run-pass
2 #![allow(non_camel_case_types)]
3 #![feature(box_syntax)]
4
5 trait double {
6     fn double(self) -> usize;
7 }
8
9 impl double for usize {
10     fn double(self) -> usize { self }
11 }
12
13 impl double for Box<usize> {
14     fn double(self) -> usize { *self * 2 }
15 }
16
17 pub fn main() {
18     let x: Box<_> = box 3;
19     assert_eq!(x.double(), 6);
20 }