Skip to content

Commit b8710de

Browse files
committed
Add test cases
issue-912 is xfailed. issue-2111 is already fixed, but it's good to have the test case.
1 parent be8a08b commit b8710de

File tree

2 files changed

+19
-0
lines changed

2 files changed

+19
-0
lines changed

src/test/compile-fail/issue-2111.rs

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
fn foo(a: option<uint>, b: option<uint>) {
2+
alt (a,b) { //! ERROR: non-exhaustive patterns: none not covered
3+
(some(a), some(b)) if a == b { }
4+
(some(_), none) |
5+
(none, some(_)) { }
6+
}
7+
}
8+
9+
fn main() {
10+
foo(none, none);
11+
}

src/test/run-pass/issue-912.rs

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
// xfail-test
2+
fn find<T>(_f: fn(@T) -> bool, _v: [@T]) {}
3+
4+
fn main() {
5+
let x = 10, arr = [];
6+
find({|f| f.id == x}, arr);
7+
arr += [{id: 20}]; // This assigns a type to arr
8+
}

0 commit comments

Comments
 (0)