Skip to content

Commit fc1af9f

Browse files
committed
---
yaml --- r: 29923 b: refs/heads/incoming c: fcb055e h: refs/heads/master i: 29921: cbdc03f 29919: c49713b v: v3
1 parent 53d1ce4 commit fc1af9f

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
@@ -6,7 +6,7 @@ refs/heads/try: d324a424d8f84b1eb049b12cf34182bda91b0024
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b
88
refs/heads/try2: d0c6ce338884ee21843f4b40bf6bf18d222ce5df
9-
refs/heads/incoming: 4b1d83ca6494d10cb1ffaf50032e0a2d833ad635
9+
refs/heads/incoming: fcb055ef7e030c3cb057a375e3fd7dfc65777137
1010
refs/heads/dist-snap: 2f32a1581f522e524009138b33b1c7049ced668d
1111
refs/tags/release-0.2: c870d2dffb391e14efb05aa27898f1f6333a9596
1212
refs/tags/release-0.3: b5f0d0f648d9a6153664837026ba1be43d3e2503
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)