Skip to content

Commit 5b9a735

Browse files
committed
---
yaml --- r: 21215 b: refs/heads/snap-stage3 c: fcb055e h: refs/heads/master i: 21213: 15a69c5 21211: 63bbd87 21207: a781d44 21199: 6d8207c 21183: 5d0f1d1 v: v3
1 parent 0095a26 commit 5b9a735

File tree

4 files changed

+34
-1
lines changed

4 files changed

+34
-1
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
refs/heads/master: e430a699f2c60890d9b86069fd0c68a70ece7120
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
4-
refs/heads/snap-stage3: 4b1d83ca6494d10cb1ffaf50032e0a2d833ad635
4+
refs/heads/snap-stage3: fcb055ef7e030c3cb057a375e3fd7dfc65777137
55
refs/heads/try: ffbe0e0e00374358b789b0037bcb3a577cd218be
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
struct defer {
2+
x: &[&str];
3+
new(x: &[&str]) { self.x = x; }
4+
drop { #error["%?", self.x]; }
5+
}
6+
7+
fn main() {
8+
let _x = defer(~["Goodbye", "world!"]); //~ ERROR illegal borrow
9+
}
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
//buggy.rs
2+
use std;
3+
import std::map::hashmap;
4+
import std::map;
5+
6+
fn main() {
7+
let buggy_map :hashmap<uint, &uint> = hashmap::<uint, &uint>(uint::hash, uint::eq);
8+
buggy_map.insert(42, ~1); //~ ERROR illegal borrow
9+
10+
// but it is ok if we use a temporary
11+
let tmp = ~2;
12+
buggy_map.insert(43, tmp);
13+
}
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
fn main() {
2+
let msg;
3+
match some(~"Hello") { //~ ERROR illegal borrow
4+
some(ref m) => {
5+
msg = m;
6+
},
7+
none => { fail }
8+
}
9+
io::println(*msg);
10+
}
11+

0 commit comments

Comments
 (0)