]> git.proxmox.com Git - rustc.git/blob - tests/ui/issues/issue-40402-ref-hints/issue-40402-1.rs
New upstream version 1.68.2+dfsg1
[rustc.git] / tests / ui / issues / issue-40402-ref-hints / issue-40402-1.rs
1 // Check that we do not suggest `ref f` here in the `main()` function.
2 struct Foo {
3 pub v: Vec<String>,
4 }
5
6 fn main() {
7 let mut f = Foo { v: Vec::new() };
8 f.v.push("hello".to_string());
9 let e = f.v[0]; //~ ERROR cannot move out of index
10 }