summaryrefslogtreecommitdiffstats
path: root/tests/ui/issues/issue-20414.rs
blob: 2496e342a2fb1ace4025df075297cbbc487ea62a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
// check-pass
#![allow(dead_code)]
// pretty-expanded FIXME #23616

trait Trait {
        fn method(self) -> isize;
}

struct Wrapper<T> {
        field: T
}

impl<'a, T> Trait for &'a Wrapper<T> where &'a T: Trait {
    fn method(self) -> isize {
        let r: &'a T = &self.field;
        Trait::method(r); // these should both work
        r.method()
    }
}

fn main() {}