Skip to content

Commit f186759

Browse files
committed
Fixes for compile-fail/ tests in wake of destructor lifetime changes.
1 parent fc18f8b commit f186759

File tree

5 files changed

+4
-51
lines changed

5 files changed

+4
-51
lines changed

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

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,11 @@ extern crate collections;
1414
use std::collections::HashMap;
1515

1616
fn main() {
17+
let tmp;
1718
let mut buggy_map: HashMap<uint, &uint> = HashMap::new();
1819
buggy_map.insert(42, &*box 1); //~ ERROR borrowed value does not live long enough
1920

20-
// but it is ok if we use a temporary
21-
let tmp = box 2;
21+
// but it is ok if we use a temporary that outlives `buggy_map`.
22+
tmp = box 2;
2223
buggy_map.insert(43, &*tmp);
2324
}

src/test/compile-fail/borrowck-let-suggestion.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010

1111
fn f() {
1212
let x = [1i].iter(); //~ ERROR borrowed value does not live long enough
13-
//~^^ NOTE reference must be valid for the block
13+
//~^ NOTE reference must be valid for the block
1414
//~^^ HELP consider using a `let` binding to increase its lifetime
1515
}
1616

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

Lines changed: 0 additions & 24 deletions
This file was deleted.

src/test/compile-fail/kindck-destructor-owned.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,6 @@ struct Bar<'a> {
2727
}
2828

2929
impl<'a> Drop for Bar<'a> {
30-
//~^ ERROR E0141
3130
fn drop(&mut self) {
3231
}
3332
}

src/test/compile-fail/unsafe-destructor-check-crash.rs

Lines changed: 0 additions & 23 deletions
This file was deleted.

0 commit comments

Comments
 (0)