test: Fix tests. rs=tests

This commit is contained in:
Patrick Walton 2013-03-08 12:10:48 -08:00
parent a34749c289
commit 1274d4a006
8 changed files with 32 additions and 32 deletions

View file

@ -507,7 +507,7 @@ impl<T> BaseIter<T> for @mut DList<T> {
* allow for e.g. breadth-first search with in-place enqueues), but
* removing the current node is forbidden.
*/
pure fn each(&self, f: fn(v: &T) -> bool) {
pure fn each(&self, f: &fn(v: &T) -> bool) {
let mut link = self.peek_n();
while option::is_some(&link) {
let nobe = option::get(link);

View file

@ -9,13 +9,13 @@
// except according to those terms.
struct S(())
pub struct S(());
pub impl S {
fn foo() { }
}
trait T {
pub trait T {
fn bar();
}

View file

@ -15,7 +15,7 @@ fn main() {
fn f(f: extern fn(extern fn(extern fn()))) {
}
fn g(f: extern fn(fn())) {
fn g(f: extern fn(&fn())) {
}
f(g);

View file

@ -12,5 +12,5 @@ struct foo(int);
fn main() {
let x = foo(3);
*x = 4; //~ ERROR assigning to enum content
*x = 4; //~ ERROR assigning to anonymous field
}

View file

@ -28,5 +28,5 @@ struct wrapper(noncopyable);
fn main() {
let x1 = wrapper(noncopyable());
let _x2 = *x1; //~ ERROR moving out of enum content
let _x2 = *x1; //~ ERROR moving out of anonymous field
}

View file

@ -11,7 +11,7 @@
// test that autoderef of a type like this does not
// cause compiler to loop. Note that no instances
// of such a type could ever be constructed.
enum t(@t); //~ ERROR this type cannot be instantiated
struct t(@t); //~ ERROR this type cannot be instantiated
trait to_str_2 {
fn to_str() -> ~str;

View file

@ -17,41 +17,41 @@ fn test_fn<T>(_x: &x/T, _y: &y/T, _z: &z/T) {
// subtype::<T1>(of::<T2>()) will typecheck
// iff T1 <: T2.
subtype::<fn(&a/T)>(
of::<fn(&a/T)>());
subtype::<&fn(&a/T)>(
of::<&fn(&a/T)>());
subtype::<fn(&a/T)>(
of::<fn(&b/T)>());
subtype::<&fn(&a/T)>(
of::<&fn(&b/T)>());
subtype::<fn(&b/T)>(
of::<fn(&x/T)>());
subtype::<&fn(&b/T)>(
of::<&fn(&x/T)>());
subtype::<fn(&x/T)>(
of::<fn(&b/T)>()); //~ ERROR mismatched types
subtype::<&fn(&x/T)>(
of::<&fn(&b/T)>()); //~ ERROR mismatched types
subtype::<fn(&a/T, &b/T)>(
of::<fn(&a/T, &a/T)>());
subtype::<&fn(&a/T, &b/T)>(
of::<&fn(&a/T, &a/T)>());
subtype::<fn(&a/T, &a/T)>(
of::<fn(&a/T, &b/T)>()); //~ ERROR mismatched types
subtype::<&fn(&a/T, &a/T)>(
of::<&fn(&a/T, &b/T)>()); //~ ERROR mismatched types
subtype::<fn(&a/T, &b/T)>(
of::<fn(&x/T, &y/T)>());
subtype::<&fn(&a/T, &b/T)>(
of::<&fn(&x/T, &y/T)>());
subtype::<fn(&x/T, &y/T)>(
of::<fn(&a/T, &b/T)>()); //~ ERROR mismatched types
subtype::<&fn(&x/T, &y/T)>(
of::<&fn(&a/T, &b/T)>()); //~ ERROR mismatched types
subtype::<fn(&x/T) -> @fn(&a/T)>(
of::<fn(&x/T) -> @fn(&a/T)>());
subtype::<&fn(&x/T) -> @fn(&a/T)>(
of::<&fn(&x/T) -> @fn(&a/T)>());
subtype::<fn(&a/T) -> @fn(&a/T)>(
of::<fn(&a/T) -> @fn(&b/T)>()); //~ ERROR mismatched types
subtype::<&fn(&a/T) -> @fn(&a/T)>(
of::<&fn(&a/T) -> @fn(&b/T)>()); //~ ERROR mismatched types
subtype::<fn(&a/T) -> @fn(&a/T)>(
of::<fn(&x/T) -> @fn(&b/T)>()); //~ ERROR mismatched types
subtype::<&fn(&a/T) -> @fn(&a/T)>(
of::<&fn(&x/T) -> @fn(&b/T)>()); //~ ERROR mismatched types
subtype::<fn(&a/T) -> @fn(&b/T)>(
of::<fn(&a/T) -> @fn(&a/T)>());
subtype::<&fn(&a/T) -> @fn(&b/T)>(
of::<&fn(&a/T) -> @fn(&a/T)>());
}
fn main() {}

View file

@ -12,7 +12,7 @@ fn plus_one(f: &fn() -> int) -> int {
return f() + 1;
}
fn ret_plus_one() -> extern fn(fn() -> int) -> int {
fn ret_plus_one() -> extern fn(&fn() -> int) -> int {
return plus_one;
}