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