Closed
Description
use std::collections::BTreeMap;
fn main() {
let mut map = BTreeMap::new();
map.entry("e").or_insert(0) += 1;
}
rustc 1.18.0 (03fc9d6 2017-06-06)
error[E0368]: binary assignment operation `+=` cannot be applied to type `&mut {integer}`
--> src/main.rs:5:5
|
5 | map.entry("e").or_insert(0) += 1;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^ cannot use `+=` on type `&mut {integer}`
rustc 1.19.0-beta.1 (a879841 2017-06-06) and rustc 1.19.0-nightly (4bf5c99 2017-06-10)
error[E0368]: binary assignment operation `+=` cannot be applied to type `&mut {integer}`
--> src/main.rs:5:5
|
5 | map.entry("e").or_insert(0) += 1;
| ---------------------------^^^^^ot use `+=` on type `&mut {integer}`