]> git.lizzy.rs Git - rust.git/blob - src/test/ui/issues/issue-40402-ref-hints/issue-40402-1.rs
Update tests for changes to cannot move errors
[rust.git] / src / test / 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 }