]> git.lizzy.rs Git - rust.git/blob - src/test/ui/issues/issue-20414.rs
Rollup merge of #91804 - woppopo:const_clone, r=oli-obk
[rust.git] / src / test / ui / issues / issue-20414.rs
1 // check-pass
2 #![allow(dead_code)]
3 // pretty-expanded FIXME #23616
4
5 trait Trait {
6         fn method(self) -> isize;
7 }
8
9 struct Wrapper<T> {
10         field: T
11 }
12
13 impl<'a, T> Trait for &'a Wrapper<T> where &'a T: Trait {
14     fn method(self) -> isize {
15         let r: &'a T = &self.field;
16         Trait::method(r); // these should both work
17         r.method()
18     }
19 }
20
21 fn main() {}