Skip to content

Commit 4b3692b

Browse files
committed
Update some compile-fail tests to accommodate new scoping/dtor rules.
1 parent b72786a commit 4b3692b

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

src/test/compile-fail/borrowck-borrowed-uniq-rvalue.rs

+2-1
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,11 @@ extern crate collections;
1616
use std::collections::HashMap;
1717

1818
fn main() {
19+
let tmp;
1920
let mut buggy_map: HashMap<usize, &usize> = HashMap::new();
2021
buggy_map.insert(42, &*box 1); //~ ERROR borrowed value does not live long enough
2122

2223
// but it is ok if we use a temporary
23-
let tmp = box 2;
24+
tmp = box 2;
2425
buggy_map.insert(43, &*tmp);
2526
}

src/test/compile-fail/issue-18783.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@
1313
use std::cell::RefCell;
1414

1515
fn main() {
16-
let c = RefCell::new(vec![]);
1716
let mut y = 1us;
17+
let c = RefCell::new(vec![]);
1818
c.push(box || y = 0);
1919
c.push(box || y = 0);
2020
//~^ ERROR cannot borrow `y` as mutable more than once at a time

0 commit comments

Comments
 (0)