mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-25 16:24:46 +00:00
11 lines
254 B
Rust
11 lines
254 B
Rust
// Check that we do not suggest `ref f` here in the `main()` function.
|
|
struct Foo {
|
|
pub v: Vec<String>,
|
|
}
|
|
|
|
fn main() {
|
|
let mut f = Foo { v: Vec::new() };
|
|
f.v.push("hello".to_string());
|
|
let e = f.v[0]; //~ ERROR cannot move out of index
|
|
}
|