mirror of
https://github.com/rust-lang/rust.git
synced 2024-12-05 13:13:40 +00:00
9 lines
195 B
Rust
9 lines
195 B
Rust
fn get(key: &mut String) { }
|
|
|
|
fn main() {
|
|
let mut v: Vec<String> = Vec::new();
|
|
let ref mut key = v[0];
|
|
get(&mut key); //~ ERROR cannot borrow
|
|
//~| HELP try removing `&mut` here
|
|
}
|