Add various test cases, mostly xfailed

This commit is contained in:
Tim Chevalier 2012-12-06 16:13:40 -08:00
parent 0027874218
commit fe9a339939
4 changed files with 38 additions and 0 deletions

View File

@ -0,0 +1,9 @@
// xfail-test
fn foo<T, U>(x: T, y: U) {
let mut xx = x;
xx = y; // error message should mention T and U, not 'a and 'b
}
fn main() {
}

View File

@ -0,0 +1,9 @@
// xfail-test
fn main()
{
// See #2969 -- error message should be improved
let mut x = [mut 1, 2, 4];
let v : &int = &x[2];
x[2] = 6;
assert *v == 6;
}

View File

@ -0,0 +1,9 @@
// xfail-test
enum x = ();
impl x {
unsafe fn with() { } // This should fail
}
fn main() {
x(()).with();
}

View File

@ -0,0 +1,11 @@
struct thing<Q> {
x: &Q
}
fn thing<Q>(x: &Q) -> thing<Q> {
thing{ x: x }
}
fn main() {
thing(&());
}