Earlier quoted context omitted.
Currently, borrows are always lexical. It'd be nice to have non-lexical borrows. It's on the todo list.
Interesting. What is an example of a non-lexical borrow that could potentially be proven safe?
The following is currently illegal because the `insert` is trying to modify the borrowed map.
match some_map.find(&a_key) {
Some(x) => println!("reference to value {}", x),
None => {
println!("not found, inserting instead");
some_map.insert(a_key, some_value);
}
}
#6393 is the relevant issue.[1]: http://doc.rust-lang.org/nightly/std/collections/struct.Hash... [6393]: https://github.com/rust-lang/rust/issues/6393