]> git.lizzy.rs Git - rust.git/blob - src/test/ui/borrowck/issue-91206.rs
3b1fbf4b69902828b695ec08fca20bdc6bac12c7
[rust.git] / src / test / ui / borrowck / issue-91206.rs
1 struct TestClient;
2
3 impl TestClient {
4     fn get_inner_ref(&self) -> &Vec<usize> {
5         todo!()
6     }
7 }
8
9 fn main() {
10     let client = TestClient;
11     let inner = client.get_inner_ref();
12     //~^ HELP consider changing this to be a mutable reference
13     inner.clear();
14     //~^ ERROR cannot borrow `*inner` as mutable, as it is behind a `&` reference [E0596]
15 }