mirror of
https://github.com/rust-lang/rust.git
synced 2024-10-31 22:41:50 +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
|
|
}
|