rust/tests/ui/did_you_mean/issue-34337.rs

9 lines
195 B
Rust
Raw Normal View History

2016-11-02 01:15:02 -05:00
fn get(key: &mut String) { }
fn main() {
let mut v: Vec<String> = Vec::new();
let ref mut key = v[0];
2017-11-20 06:13:27 -06:00
get(&mut key); //~ ERROR cannot borrow
//~| HELP try removing `&mut` here
2016-11-02 01:15:02 -05:00
}