]> git.lizzy.rs Git - rust.git/blob - src/test/ui/borrowck/issue-91206.rs
Do not use a suggestion to change a binding's name to a type
[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     //~^ NOTE consider changing this binding's type to be
13     inner.clear();
14     //~^ ERROR cannot borrow `*inner` as mutable, as it is behind a `&` reference [E0596]
15     //~| NOTE `inner` is a `&` reference, so the data it refers to cannot be borrowed as mutable
16 }