2017-04-27 15:26:12 -05:00
|
|
|
// Check that we do not suggest `ref f` here in the `main()` function.
|
2017-04-14 23:04:37 -05:00
|
|
|
struct Foo {
|
|
|
|
pub v: Vec<String>,
|
|
|
|
}
|
|
|
|
|
|
|
|
fn main() {
|
|
|
|
let mut f = Foo { v: Vec::new() };
|
|
|
|
f.v.push("hello".to_string());
|
2019-05-05 06:02:32 -05:00
|
|
|
let e = f.v[0]; //~ ERROR cannot move out of index
|
2017-04-14 23:04:37 -05:00
|
|
|
}
|