Skip to content

Commit aad8d58

Browse files
committed
---
yaml --- r: 21285 b: refs/heads/snap-stage3 c: e5fb58e h: refs/heads/master i: 21283: 85e3bd3 v: v3
1 parent 74365eb commit aad8d58

8 files changed

+68
-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: 5b25fc918a8b91322c28242d3956109001b0f7c4
4+
refs/heads/snap-stage3: e5fb58e6c09202df314d3ef6ccb797f2cc8401e2
55
refs/heads/try: ffbe0e0e00374358b789b0037bcb3a577cd218be
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b
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+
}
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)