Skip to content

Commit c7cb857

Browse files
committed
---
yaml --- r: 27901 b: refs/heads/try c: fcb055e h: refs/heads/master i: 27899: c1e3c0e v: v3
1 parent 113b4d6 commit c7cb857

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
@@ -2,7 +2,7 @@
22
refs/heads/master: cd6f24f9d14ac90d167386a56e7a6ac1f0318195
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
44
refs/heads/snap-stage3: cd6f24f9d14ac90d167386a56e7a6ac1f0318195
5-
refs/heads/try: 4b1d83ca6494d10cb1ffaf50032e0a2d833ad635
5+
refs/heads/try: fcb055ef7e030c3cb057a375e3fd7dfc65777137
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b
88
refs/heads/try2: d0c6ce338884ee21843f4b40bf6bf18d222ce5df
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)