blob: e062a253767ded6ab491ae70d47ed53eb8fd10e4 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
  | 
struct TestClient;
impl TestClient {
    fn get_inner_ref(&self) -> &Vec<usize> {
        todo!()
    }
}
fn main() {
    let client = TestClient;
    let inner = client.get_inner_ref();
    //~^ HELP consider specifying this binding's type
    inner.clear();
    //~^ ERROR cannot borrow `*inner` as mutable, as it is behind a `&` reference [E0596]
    //~| NOTE `inner` is a `&` reference, so the data it refers to cannot be borrowed as mutable
}
 
  |