]> git.lizzy.rs Git - rust.git/blob - src/test/ui/autoref-autoderef/autoderef-method-on-trait.rs
Merge commit 'e9d1a0a7b0b28dd422f1a790ccde532acafbf193' into sync_cg_clif-2022-08-24
[rust.git] / src / test / ui / autoref-autoderef / autoderef-method-on-trait.rs
1 // run-pass
2 #![allow(non_camel_case_types)]
3
4 trait double {
5     fn double(self: Box<Self>) -> usize;
6 }
7
8 impl double for usize {
9     fn double(self: Box<usize>) -> usize { *self * 2 }
10 }
11
12 pub fn main() {
13     let x: Box<_> = Box::new(Box::new(3usize) as Box<dyn double>);
14     assert_eq!(x.double(), 6);
15 }