Skip to content

Commit 2d1c559

Browse files
committed
---
yaml --- r: 29993 b: refs/heads/incoming c: e5fb58e h: refs/heads/master i: 29991: 10c31b7 v: v3
1 parent c61b94a commit 2d1c559

8 files changed

+68
-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: 5b25fc918a8b91322c28242d3956109001b0f7c4
9+
refs/heads/incoming: e5fb58e6c09202df314d3ef6ccb797f2cc8401e2
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 X { x: (); drop { error!("destructor runs"); } }
2+
3+
fn main() {
4+
let x = some(X { x: () });
5+
match move x {
6+
some(ref _y @ move _z) => { }, //~ ERROR cannot bind by-move and by-ref in the same pattern
7+
none => fail
8+
}
9+
}
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
struct X { x: (); drop { error!("destructor runs"); } }
2+
3+
fn main() {
4+
let x = some((X { x: () }, X { x: () }));
5+
match move x {
6+
some((ref _y, move _z)) => { }, //~ ERROR cannot bind by-move and by-ref in the same pattern
7+
none => fail
8+
}
9+
}
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
struct X { x: (); drop { error!("destructor runs"); } }
2+
3+
enum double_option<T,U> { some2(T,U), none2 }
4+
5+
fn main() {
6+
let x = some2(X { x: () }, X { x: () });
7+
match move x {
8+
some2(ref _y, move _z) => { }, //~ ERROR cannot bind by-move and by-ref in the same pattern
9+
none2 => fail
10+
}
11+
}
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
fn main() {
2+
let (c,p) = pipes::stream();
3+
let x = some(p);
4+
c.send(false);
5+
match move x {
6+
some(move z) if z.recv() => { fail }, //~ ERROR cannot bind by-move into a pattern guard
7+
some(move z) => { assert !z.recv(); },
8+
none => fail
9+
}
10+
}
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
struct X { x: (); drop { error!("destructor runs"); } }
2+
3+
fn main() {
4+
let x = some(X { x: () });
5+
match x {
6+
some(move _z) => { }, //~ ERROR cannot bind by-move when matching an lvalue
7+
none => fail
8+
}
9+
}
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
struct X { x: (); drop { error!("destructor runs"); } }
2+
struct Y { y: option<X>; }
3+
4+
fn main() {
5+
let x = Y { y: some(X { x: () }) };
6+
match x.y {
7+
some(move _z) => { }, //~ ERROR cannot bind by-move when matching an lvalue
8+
none => fail
9+
}
10+
}
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
struct X { x: (); drop { error!("destructor runs"); } }
2+
3+
fn main() {
4+
let x = some(X { x: () });
5+
match move x {
6+
some(move _y @ ref _z) => { }, //~ ERROR cannot bind by-move with sub-bindings
7+
none => fail
8+
}
9+
}

0 commit comments

Comments
 (0)