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

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

9 lines
195 B
Rust
Raw Normal View History

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