Add test cases
issue-912 is xfailed. issue-2111 is already fixed, but it's good to have the test case.
This commit is contained in:
parent
be8a08b2af
commit
b8710de5ff
11
src/test/compile-fail/issue-2111.rs
Normal file
11
src/test/compile-fail/issue-2111.rs
Normal file
@ -0,0 +1,11 @@
|
||||
fn foo(a: option<uint>, b: option<uint>) {
|
||||
alt (a,b) { //! ERROR: non-exhaustive patterns: none not covered
|
||||
(some(a), some(b)) if a == b { }
|
||||
(some(_), none) |
|
||||
(none, some(_)) { }
|
||||
}
|
||||
}
|
||||
|
||||
fn main() {
|
||||
foo(none, none);
|
||||
}
|
8
src/test/run-pass/issue-912.rs
Normal file
8
src/test/run-pass/issue-912.rs
Normal file
@ -0,0 +1,8 @@
|
||||
// xfail-test
|
||||
fn find<T>(_f: fn(@T) -> bool, _v: [@T]) {}
|
||||
|
||||
fn main() {
|
||||
let x = 10, arr = [];
|
||||
find({|f| f.id == x}, arr);
|
||||
arr += [{id: 20}]; // This assigns a type to arr
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user