summaryrefslogtreecommitdiffstats
path: root/tests/ui/did_you_mean/issue-38147-1.rs
blob: c068a1834f350e49ae39be0e552b3048e507130c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
struct Pass<'a> {
    s: &'a mut String
}

impl<'a> Pass<'a> {
    fn f(&mut self) {
        self.s.push('x');
    }
}

struct Foo<'a> {
    s: &'a mut String
}

impl<'a> Foo<'a> {
    fn f(&self) {
        self.s.push('x'); //~ cannot borrow `*self.s` as mutable, as it is behind a `&` reference
    }
}

fn main() {}