-// xfail-stage0
// error-pattern: Unsatisfied precondition constraint (for example, init(i
fn main() {
-// xfail-stage0
// error-pattern: expecting mod
#[attr = "val"];
-// xfail-stage0
// error-pattern:expecting ]
// asterisk is bogus
-// xfail-stage0
// error-pattern:expected item
fn f() {
-// xfail-stage0
// error-pattern:expected item
#[foo = "bar"]
-// xfail-stage0
// error-pattern:expected item
mod m {
-// xfail-stage0
// error-pattern:expected item
fn f() {
-// xfail-stage0
// error-pattern:expected item
fn main() {
-// xfail-stage0
// xfail-stage1
// xfail-stage2
// xfail-stage3
-// xfail-stage0
// xfail-stage1
// xfail-stage2
// xfail-stage3
-// xfail-stage0
// error-pattern: some control paths may return
fn f() -> ! { 3 }
fn main(){}
-// xfail-stage0
// error-pattern:+ cannot be applied to type `{x: bool}`
fn main() { let x = {x: true}; x += {x: false}; }
\ No newline at end of file
-// xfail-stage0
// error-pattern:+ cannot be applied to type `{x: bool}`
fn main() { let x = {x: true} + {x: false}; }
\ No newline at end of file
-// xfail-stage0
// error-pattern:^ cannot be applied to type `str`
fn main() { let x = "a" ^ "b"; }
\ No newline at end of file
-// xfail-stage0
// error-pattern:|| cannot be applied to type `f32`
fn main() { let x = 1.0_f32 || 2.0_f32; }
\ No newline at end of file
-// xfail-stage0
// error-pattern:&& cannot be applied to type `int`
fn main() { let x = 1 && 2; }
\ No newline at end of file
-// xfail-stage0
// error-pattern:* cannot be applied to type `bool`
fn main() { let x = true * false; }
\ No newline at end of file
-// xfail-stage0
// error-pattern:>> cannot be applied to type `port[int]`
fn main() {
-// xfail-stage0
// error-pattern:- cannot be applied to type `obj
fn main() { let x = obj () { } - obj () { }; }
\ No newline at end of file
-// xfail-stage0
// error-pattern:mismatched types
// issue #500
// error-pattern: mismatched types
-// xfail-stage0
// Make sure that fn-to-block coercion isn't incorrectly lifted over
// other tycons.
// error-pattern: non-copyable
-// xfail-stage0
fn lol(f: &block() ) -> block() { ret f; }
fn main() { let i = 8; let f = lol(block () { log_err i; }); f(); }
\ No newline at end of file
// error-pattern: Unsatisfied precondition constraint
-// xfail-stage0
fn force(f: &block() ) { f(); }
fn main() { let x: int; force(block () { log_err x; }); }
\ No newline at end of file
-// xfail-stage0
// error-pattern:Break outside a loop
fn main() {
let pth = break;
-// xfail-stage0
// error-pattern:spawning functions with type params not allowed
fn main() {
fn echo[T](c: chan[T], oc: chan[chan[T]]) {
// -*- rust -*-
-// xfail-stage0
// xfail-stage1
// xfail-stage2
// xfail-stage3
-// xfail-stage0
// error-pattern:'swap' is glob-imported from multiple different modules
// issue #482
-// xfail-stage0
// xfail-stage1
// xfail-stage2
// xfail-stage3
-// xfail-stage0
// xfail-stage1
// xfail-stage2
// xfail-stage3
-// xfail-stage0
// error-pattern: Unsatisfied precondition constraint (for example, init(y
fn main() {
-// xfail-stage0
// error-pattern: Unsatisfied precondition constraint (for example, even(y
fn print_even(y: int) : even(y) {
-// xfail-stage0
// error-pattern:duplicate meta item `name`
#[link(name = "test", name)];
-// xfail-stage0
// error-pattern:expecting [, found fmt
// Don't know how to deal with a syntax extension appearing after an
-// xfail-stage0
// error-pattern: literal
fn main() {
-// xfail-stage0
// error-pattern: literal
fn main() {
-// xfail-stage0
// error-pattern:not enough arguments
use std;
-// xfail-stage0
// error-pattern:too many arguments
use std;
-// xfail-stage0
// error-pattern:only valid in signed #fmt conversion
fn main() {
-// xfail-stage0
// error-pattern:only valid in signed #fmt conversion
fn main() {
// error-pattern:expected str but found vec
-// xfail-stage0
fn main() { fail []; }
\ No newline at end of file
-// xfail-stage0
// error-pattern:mismatched types
fn f() -> int { true }
-// xfail-stage0
// error-pattern:expected fn() but found fn(int)
fn main() {
// error-pattern:Unsatisfied precondition
-// xfail-stage0
fn main() {
// Typestate should work even in a lambda. we should reject this program.
// error-pattern:Unsatisfied precondition
-// xfail-stage0
fn main() { let j = fn () -> int { let i: int; ret i; }(); log_err j; }
\ No newline at end of file
-// xfail-stage0
// error-pattern:Unsatisfied precondition constraint
pred even(x: uint) -> bool {
if x < 2u {
-// xfail-stage0
// error-pattern:mismatched types
// issue #513
-// xfail-stage0
// xfail-stage1
// xfail-stage2
// xfail-stage3
// -*- rust -*-
-// xfail-stage0
// error-pattern: illegal recursive type
type x = vec[x];
// -*- rust -*-
-// xfail-stage0
// error-pattern: Dynamically sized arguments must be passed by alias
mod foo {
-// xfail-stage0
//error-pattern:is an expr, expected an identifier
fn main() {
#macro([#mylambda(x, body), {fn f(x: int) -> int {ret body}; f}]);
-// xfail-stage0
//error-pattern:no clauses match
fn main() {
-// xfail-stage0
// error-pattern:Wrong type in main function: found fn() -> char
fn main() -> char { }
\ No newline at end of file
-// xfail-stage0
// error-pattern:Wrong type in main function: found fn(
fn main(foo: {x: int, y: int}) { }
\ No newline at end of file
-// xfail-stage0
// error-pattern:Main function not found
fn mian() { }
\ No newline at end of file
-// xfail-stage0
// error-pattern:Attempt to use a type argument out of scope
fn hd[U](v: &vec[U]) -> U {
fn hd1(w: &vec[U]) -> U { ret w.(0); }
// error-pattern:Unsatisfied precondition constraint (for example, le(b, d
-// xfail-stage0
use std;
import std::str::*;
import std::uint::*;
// -*- rust -*-
-// xfail-stage0
// error-pattern: Non-predicate in constraint: lt
fn f(a: int, b: int) : lt(a,b) { }
-// xfail-stage0
// error-pattern: Unsatisfied precondition constraint (for example, init(i
fn main() {
-// xfail-stage0
// -*- rust -*-
// error-pattern: Unsatisfied precondition constraint (for example, lt(a, b)
-// xfail-stage0
// -*- rust -*-
// error-pattern: lt(a, c)
-// xfail-stage0
// -*- rust -*-
// error-pattern: Unsatisfied precondition constraint (for example, lt(a, b)
-// xfail-stage0
// xfail-stage1
// xfail-stage2
// xfail-stage3
-// xfail-stage0
// error-pattern:expected int but found bool
fn main() {
-//xfail-stage0
-
// error-pattern:self-call in non-object context
// Fix for issue #707.
// -*- rust -*-
-// xfail-stage0
// error-pattern: unresolved name: lt
fn f(a: int, b: int) : lt(a,b) { }
-// xfail-stage0
// error-pattern: mismatched types
fn f(x: int) -> int { ret x; }
-// xfail-stage0
// error-pattern: Wrong number of type arguments
tag quux[T] { }
-// xfail-stage0
// error-pattern:Attempt to use a type argument out of scope
fn foo[T](x: &T) {
fn bar(f: fn(&T) -> T ) { }
-// xfail-stage0
// error-pattern:expected bool but found int
// issue #516
-// xfail-stage0
// error-pattern:illegal recursive type
type t1 = {foo: int, foolish: t1};
// error-pattern:Unsatisfied precondition constraint (for example, init(bar
-// xfail-stage0
fn main() {
let bar;
fn baz(x: int) { }
-// xfail-stage0
// error-pattern:mutable alias to a variable that roots another alias
fn f(a: &int, b: &mutable int) -> int { b += 1; ret a + b; }
-// xfail-stage0
// error-pattern:duplicate meta item `name`
use std(name = "std", name = "nonstd");
-// xfail-stage0
// error-pattern:attempted field access on type vec[int]
// issue #367
-// xfail-stage0
// error-pattern: Unsatisfied precondition constraint (for example, init(y
fn main() {
-// xfail-stage0
// error-pattern: Unsatisfied precondition constraint (for example, even(y
fn print_even(y: int) : even(y) { log y; }
-// xfail-stage0
// -*- rust -*-
// error-pattern:assignment to immutable field
-// xfail-stage0
// error-pattern:assigning to immutable obj field
obj objy(x: int) {
fn foo() { x = 5; }
-// xfail-stage0
// error-pattern:assignment to immutable vec content
fn main() { let v: vec[int] = [1, 2, 3]; v.(1) = 4; }
\ No newline at end of file
-// xfail-stage0
// error-pattern:meep
fn f(a: int, b: int, c: @int) { fail "moop"; }
-// xfail-stage0
// error-pattern:woe
fn f(a: int) { log a; }
-// xfail-stage0
// error-pattern:moop
use std;
import std::uint;
-// xfail-stage0
// error-pattern:meh
use std;
import std::str;
-// xfail-stage0
// error-pattern:moop
use std;
import std::uint;
-// xfail-stage0
// error-pattern:Number is odd
pred even(x: uint) -> bool {
if x < 2u {
-// xfail-stage0
// error-pattern:meep
fn echo[T](c: chan[T], oc: chan[chan[T]]) {
// Tests that the type argument in port gets
-
-
-
// -*- rust -*-
-// xfail-stage0
// error-pattern:Predicate lt(b, a) failed
fn f(a: int, b: int) { }
-
-
-
// Tests that trans treats the rhs of pth's decl
// as a _|_-typed thing, not a str-typed thing
-// xfail-stage0
// error-pattern:bye
fn main() { let pth = fail "bye"; let rs: {t: str} = {t: pth}; }
\ No newline at end of file
-// xfail-stage0
// xfail-stage1
// xfail-stage2
// xfail-stage3
-
-
-
-// xfail-stage0
// xfail-stage1
// xfail-stage2
// xfail-stage3
-// xfail-stage0
// xfail-stage1
// xfail-stage2
// xfail-stage3
-// xfail-stage0
-
tag option[T] { some(T); none; }
type r[T] = {mutable v: (option[T])[]};
-
-
-// xfail-stage0
use std;
import std::option::*;
-
-
-
-// xfail-stage0
tag maybe[T] { nothing; just(T); }
fn foo(x: maybe[int]) {
-// xfail-stage0
// xfail-stage1
// xfail-stage2
// xfail-stage3
-//xfail-stage0
//xfail-stage1
//xfail-stage2
//xfail-stage3
-//xfail-stage0
//xfail-stage1
//xfail-stage2
//xfail-stage3
-//xfail-stage0
//xfail-stage1
//xfail-stage2
//xfail-stage3
-
-
-
-// xfail-stage0
fn f() -> int { { ret 3; } }
fn main() { assert (f() == 3); }
\ No newline at end of file
-
-
-
-// xfail-stage0
-
// Issue 483 - Assignment expressions result in nil
fn test_assign() {
let x: int;
-// xfail-stage0
-
fn add1(i: int) -> int { ret i + 1; }
fn main() {
let f = @add1;
-// xfail-stage0
// -*- rust -*-
fn a(c: chan[int]) { c <| 10; }
-// xfail-stage0
// -*- rust -*-
fn a(c: chan[int]) { log "task a0"; log "task a1"; c <| 10; }
-// xfail-stage0
// -*- rust -*-
fn a(c: chan[int]) {
-// xfail-stage0
fn main() {
fn echo[T](c: int, x: fn(&T)) { log_err "wee"; }
-// xfail-stage0
fn main() {
fn echo[T](c: int, x: vec[T]) { }
-// xfail-stage0
-
// Binop corner cases
fn test_nil() {
-// xfail-stage0
-
fn force(f: &block() -> int ) -> int { ret f(); }
fn main() {
let f = fn () -> int { ret 7 };
-// xfail-stage0
-
fn iter_vec[T](v: &vec[T], f: &block(&T) ) { for x: T in v { f(x); } }
fn main() {
-// xfail-stage0
-
fn iter_vec[T](v: &vec[T], f: &block(&T) ) { for x: T in v { f(x); } }
fn main() {
-// xfail-stage0
-
type foo = {a: int, b: uint};
tag bar { u(@foo); w(int); }
-
-
-
-// xfail-stage0
fn int_id(x: int) -> int { ret x; }
fn main() { while true { int_id(break); } }
\ No newline at end of file
-// xfail-stage0
tag int_fn { f(fn(int) -> int ); }
tag int_box_fn { fb(@fn(int) -> int ); }
fn add1(i: int) -> int { ret i + 1; }
-// xfail-stage0
// Reported as issue #126, child leaks the string.
fn child2(s: str) { }
-// xfail-stage0
// xfail-stage1
// xfail-stage2
// xfail-stage3
-// xfail-stage0
// -*- rust -*-
fn main() {
-// xfail-stage0
-
#[cfg(bogus)]
const b: bool = false;
-// xfail-stage0
// xfail-pretty
// -*- rust -*-
-// xfail-stage0
use std;
import std::str::*;
import std::uint::*;
-// xfail-stage0
use std;
import std::str::*;
import std::uint::*;
-// xfail-stage0
use std;
import std::str::*;
import std::uint::*;
-// xfail-stage0
use std;
import std::str::*;
import std::uint::*;
-
-
-
-// xfail-stage0
fn test_simple() {
let r = alt true { true { true } false { fail } };
assert (r == true);
-
-
-
-// xfail-stage0
-
// Regression test for issue #388
fn main() { let x = { { [10] } }; }
\ No newline at end of file
-
-
-
-// xfail-stage0
-
// Regression test for issue #377
fn main() {
let a = { let b = {a: 3}; b };
-
-
-
-// xfail-stage0
-
// Make sure we drop the refs of the temporaries needed to return the
// values from the else if branch
fn main() {
-
-
-
-// xfail-stage0
-
// Regression test for issue #388
fn main() {
let x = if false { [0u] } else if (true) { [10u] } else { [0u] };
-// xfail-stage0
// Issue #521
fn f() { let x = alt true { true { 10 } false { ret } }; }
-
-
-
-// xfail-stage0
fn test_int() {
fn f() -> int { 10 }
assert (f() == 10);
-
-
-
-// xfail-stage0
-
// When all branches of an if expression result in fail, the entire if
// expression results in fail.
fn main() { let x = if true { 10 } else { if true { fail } else { fail } }; }
\ No newline at end of file
-
-
-
-// xfail-stage0
fn test_if_fail() { let x = if false { fail } else { 10 }; assert (x == 10); }
fn test_else_fail() {
-// xfail-stage0
-
fn fix_help[A, B](f: @fn(@fn(&A) -> B , &A) -> B , x: &A) -> B {
ret f(@bind fix_help(f, _), x);
}
-
-
-
-// xfail-stage0
fn main() { let x = fn (a: int) -> int { ret a + 1; }; assert (x(4) == 5); }
\ No newline at end of file
-// xfail-stage0
-
fn main() {
// We should be able to type infer inside of lambdas.
let f = fn () { let i = 10; };
-// xfail-stage0
fn main() { let x: vec[int] = []; for i: int in x { fail "moop"; } }
\ No newline at end of file
-// xfail-stage0
-
tag wrapper[T] { wrapped(T); }
fn main() { let w = wrapped(~[1, 2, 3, 4, 5]); }
-// xfail-stage0
-
fn f[T](v: @T) { }
fn main() { f(@~[1, 2, 3, 4, 5]); }
-// xfail-stage0
// xfail-fast
fn f() -> int { ret 1; }
-// xfail-stage0
pred even(x: uint) -> bool {
if x < 2u {
ret false;
-// xfail-stage0
pred even(x: uint) -> bool {
if x < 2u {
ret false;
-// xfail-stage0
// xfail-pretty
fn foo() { if (ret) { } }
-// xfail-stage0
// issue #680
fn f() -> int[] { ~[] }
A simple way to make sure threading works. This should use all the
CPU cycles an any machines that we're likely to see for a while.
*/
-
-// xfail-stage0
// xfail-stage1
// xfail-stage2
// xfail-stage3
-// xfail-stage0
// xfail-pretty
import rusti::ivec_len;
A reduced test case for Issue #506, provided by Rob Arnold.
*/
-// xfail-stage0
-
native "rust" mod rustrt {
fn task_yield();
}
-// xfail-stage0
-
use std;
import std::ivec;
-//xfail-stage0
//xfail-stage1
//xfail-stage2
//xfail-stage3
-// xfail-stage0
-
// These are attributes of the implicit crate. Really this just needs to parse
// for completeness since .rs files linked from .rc files support this
// notation to specify their module's attributes
-// xfail-stage0
-
fn double[T](a: &T) -> T[] { ret ~[a] + ~[a]; }
fn double_int(a: int) -> int[] { ret ~[a] + ~[a]; }
-// xfail-stage0
-
fn f(a: int[]) { }
fn main() { f(~[1, 2, 3, 4, 5]); }
-// xfail-stage0
// -*- rust -*-
use std;
-// xfail-stage0
// -*- rust -*-
fn main() {
-// xfail-stage0
-
fn main() {
#macro([#mylambda[x,body], {fn f(x: int) -> int { ret body }; f}]);
-// xfail-stage0
-
fn main() {
#macro([#trivial[], 1*2*4*2*1]);
-// xfail-stage0
-
fn main() {
#macro[[#m1[a], a*4]];
assert (#m1[2] == 8);
-// xfail-stage0
// xfail-stage1
// xfail-stage2
// xfail-stage3
-
-
-// xfail-stage0
// xfail-stage1
// xfail-stage2
// xfail-stage3
-// xfail-stage0
// xfail-stage1
// xfail-stage2
// xfail-stage3
-// xfail-stage0
// xfail-stage1
// xfail-stage2
// xfail-stage3
-// xfail-stage0
fn main() { let x = (); alt x { () { } } }
\ No newline at end of file
-
-
-
-// xfail-stage0
// xfail-stage1
// xfail-stage2
// xfail-stage3
-// xfail-stage0
// Tests that trans_path checks whether a
// pattern-bound var is an upvar (when translating
// the for-each body)
-
-
-
// -*- rust -*-
-// xfail-stage0
pred f(q: int) -> bool { ret true; }
fn main() { let x = 0; check (f(x)); }
\ No newline at end of file
-
-
-
-// xfail-stage0
// -*- rust -*-
fn f(a: int, b: int) { }
-// xfail-stage0
// xfail-stage1
// xfail-stage2
// xfail-stage3
-// xfail-stage0
fn add(i: int, j: int) -> int { ret i + j; }
fn binder(n: int) -> fn() -> int {
let f = bind add(n, _);
-// xfail-stage0
-
tag t1 { a(int); b(uint); }
type t2 = {x: t1, y: int};
tag t3 { c(t2, uint); }
-// xfail-stage0
// tests that ctrl's type gets inferred properly
type command[K, V] = {key: K, val: V};
-// xfail-stage0
// xfail-stage1
// xfail-stage2
// xfail-stage3
-// xfail-stage0
// xfail-stage1
// xfail-stage2
// xfail-stage3
Arnold.
*/
-// xfail-stage0
-
use std;
import std::str;
-// xfail-stage0
// -*- rust -*-
use std;
-// xfail-stage0
// -*- rust -*-
fn main() { spawn child(10, 20, 30, 40, 50, 60, 70, 80, 90); }
-//xfail-stage0
//xfail-stage1
//xfail-stage2
//xfail-stage3
-// xfail-stage0
-
use std;
import std::str;
-// xfail-stage0
// xfail-stage1
// xfail-stage2
// xfail-stage3
-// xfail-stage0
fn main() { test05(); }
fn test05_start(ch: chan[int]) { ch <| 10; ch <| 20; ch <| 30; }
-// xfail-stage0
-
use std;
import std::task::join;
-// xfail-stage0
-
use std;
import std::task;
-// xfail-stage0
// xfail-stage3
fn start(c: chan[chan[str]]) { let p: port[str] = port(); c <| chan(p); }
-// xfail-stage0
-
use std;
import std::task;
-// xfail-stage0
-
use std;
import std::task;
-// xfail-stage0
-
use std;
import std::task;
-// xfail-stage0
-
use std;
import std::task;
-// xfail-stage0
-
use std;
import std::task;
-// xfail-stage0
-
use std;
import std::task;
-// xfail-stage0
-
use std;
import std::task;
-// xfail-stage0
-
use std;
import std::task;
-// xfail-stage0
// xfail-stage1
// xfail-stage2
// xfail-stage3
-// xfail-stage0
// xfail-stage1
// xfail-stage2
// xfail-stage3
-// xfail-stage0
fn main() { spawn child("Hello"); }
fn child(s: str) {
-// xfail-stage0
-
/**
Exercises task pinning and unpinning. Doesn't really ensure it
works, just makes sure it runs.
-// xfail-stage0
-
fn test_simple() { let x = true ? 10 : 11; assert (x == 10); }
fn test_precedence() {
-// xfail-stage0
// xfail-stage1
// xfail-stage2
// xfail-stage3
-
-
-
-// xfail-stage0
type a = {a: int};
fn a(a: a) -> int { ret a.a; }
-
-
-// xfail-stage0
// xfail-stage1
// xfail-stage2
// xfail-stage3
-
-
-// xfail-stage0
// xfail-stage1
// xfail-stage2
// xfail-stage3
-// xfail-stage0
// xfail-stage1
// xfail-stage2
// xfail-stage3
-// xfail-stage0
-
fn main() {
let yen: char = '¥'; // 0xa5
let c_cedilla: char = 'ç'; // 0xe7
-// xfail-stage0
-
use std;
import std::str;
import std::vec;
-// xfail-stage0
-
fn main() { let a = ~[1, 2, 3, 4, 5]; let b = [a, a]; b += b; }
\ No newline at end of file
-// xfail-stage0
-
use std;
import std::vec;
-// xfail-stage0
// xfail-stage1
// xfail-stage2
// xfail-stage3
-
-
-
-// xfail-stage0
fn main() { let quux: @vec[uint] = @[]; }
\ No newline at end of file
-// xfail-stage0
fn main() {
let y: int = 42;
-// xfail-stage0
-
#[cfg(target_os = "win32")]
native "x86stdcall" mod kernel32 {
fn SetLastError(err: uint);
-
-
-// xfail-stage0
// -*- rust -*-
use std;
import std::task::*;
-
-
-// xfail-stage0
// -*- rust -*-
use std;
import std::task::*;
-
-
-// xfail-stage0
// -*- rust -*-
use std;