We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent b72786a commit 4b3692bCopy full SHA for 4b3692b
src/test/compile-fail/borrowck-borrowed-uniq-rvalue.rs
@@ -16,10 +16,11 @@ extern crate collections;
16
use std::collections::HashMap;
17
18
fn main() {
19
+ let tmp;
20
let mut buggy_map: HashMap<usize, &usize> = HashMap::new();
21
buggy_map.insert(42, &*box 1); //~ ERROR borrowed value does not live long enough
22
23
// but it is ok if we use a temporary
- let tmp = box 2;
24
+ tmp = box 2;
25
buggy_map.insert(43, &*tmp);
26
}
src/test/compile-fail/issue-18783.rs
@@ -13,8 +13,8 @@
13
use std::cell::RefCell;
14
15
- let c = RefCell::new(vec![]);
let mut y = 1us;
+ let c = RefCell::new(vec![]);
c.push(box || y = 0);
//~^ ERROR cannot borrow `y` as mutable more than once at a time
0 commit comments