diff options
Diffstat (limited to 'src/test')
| -rw-r--r-- | src/test/compile-fail/block-arg-used-as-lambda-with-illegal-cap.rs | 4 | ||||
| -rw-r--r-- | src/test/compile-fail/cap-clause-illegal-cap.rs | 6 | ||||
| -rw-r--r-- | src/test/compile-fail/fn-expr-type-state.rs | 2 | ||||
| -rw-r--r-- | src/test/compile-fail/lambda-mutate-nested.rs | 6 | ||||
| -rw-r--r-- | src/test/compile-fail/lambda-mutate.rs | 4 | ||||
| -rw-r--r-- | src/test/compile-fail/sendfn-is-not-a-lambda.rs | 4 | ||||
| -rw-r--r-- | src/test/pretty/cap-clause.rs | 6 | ||||
| -rw-r--r-- | src/test/run-fail/unwind-lambda.rs | 2 | ||||
| -rw-r--r-- | src/test/run-pass/block-arg-call-as.rs | 2 | ||||
| -rw-r--r-- | src/test/run-pass/block-arg-used-as-lambda.rs | 4 | ||||
| -rw-r--r-- | src/test/run-pass/cap-clause-move.rs | 4 | ||||
| -rw-r--r-- | src/test/run-pass/fn-type-infer.rs | 2 | ||||
| -rw-r--r-- | src/test/run-pass/lambda-infer-unresolved.rs | 4 | ||||
| -rw-r--r-- | src/test/run-pass/lambda-no-leak.rs | 6 | ||||
| -rw-r--r-- | src/test/run-pass/last-use-in-cap-clause.rs | 4 | ||||
| -rw-r--r-- | src/test/run-pass/last-use-is-capture.rs | 2 |
16 files changed, 31 insertions, 31 deletions
diff --git a/src/test/compile-fail/block-arg-used-as-lambda-with-illegal-cap.rs b/src/test/compile-fail/block-arg-used-as-lambda-with-illegal-cap.rs index d5a0042d107..a7348b26fa2 100644 --- a/src/test/compile-fail/block-arg-used-as-lambda-with-illegal-cap.rs +++ b/src/test/compile-fail/block-arg-used-as-lambda-with-illegal-cap.rs @@ -1,10 +1,10 @@ // error-pattern: copying a noncopyable value -fn to_lambda1(f: lambda(uint) -> uint) -> lambda(uint) -> uint { +fn to_lambda1(f: fn@(uint) -> uint) -> fn@(uint) -> uint { ret f; } -fn to_lambda2(b: block(uint) -> uint) -> lambda(uint) -> uint { +fn to_lambda2(b: block(uint) -> uint) -> fn@(uint) -> uint { ret to_lambda1({|x| b(x)}); } diff --git a/src/test/compile-fail/cap-clause-illegal-cap.rs b/src/test/compile-fail/cap-clause-illegal-cap.rs index e2f60dbb6ab..6f4972fdf66 100644 --- a/src/test/compile-fail/cap-clause-illegal-cap.rs +++ b/src/test/compile-fail/cap-clause-illegal-cap.rs @@ -1,9 +1,9 @@ // error-pattern: copying a noncopyable value -fn to_lambda2(b: block(uint) -> uint) -> lambda(uint) -> uint { +fn to_lambda2(b: block(uint) -> uint) -> fn@(uint) -> uint { // test case where copy clause specifies a value that is not used - // in lambda body, but value is illegal to copy: - ret lambda[copy b](u: uint) -> uint { 22u }; + // in fn@ body, but value is illegal to copy: + ret fn@[copy b](u: uint) -> uint { 22u }; } fn main() { diff --git a/src/test/compile-fail/fn-expr-type-state.rs b/src/test/compile-fail/fn-expr-type-state.rs index 5eb7541a520..cd7800b3780 100644 --- a/src/test/compile-fail/fn-expr-type-state.rs +++ b/src/test/compile-fail/fn-expr-type-state.rs @@ -1,7 +1,7 @@ // error-pattern:Unsatisfied precondition fn main() { - // Typestate should work even in a lambda. we should reject this program. + // Typestate should work even in a fn@. we should reject this program. let f = fn () -> int { let i: int; ret i; }; log(error, f()); } diff --git a/src/test/compile-fail/lambda-mutate-nested.rs b/src/test/compile-fail/lambda-mutate-nested.rs index 0a733687aa3..2117eeefe8b 100644 --- a/src/test/compile-fail/lambda-mutate-nested.rs +++ b/src/test/compile-fail/lambda-mutate-nested.rs @@ -1,11 +1,11 @@ // error-pattern:assigning to upvar -// Make sure that nesting a block within a lambda doesn't let us -// mutate upvars from a lambda. +// Make sure that nesting a block within a fn@ doesn't let us +// mutate upvars from a fn@. fn f2(x: block()) { x(); } fn main() { let i = 0; - let ctr = lambda () -> int { f2({|| i = i + 1; }); ret i; }; + let ctr = fn@ () -> int { f2({|| i = i + 1; }); ret i; }; log(error, ctr()); log(error, ctr()); log(error, ctr()); diff --git a/src/test/compile-fail/lambda-mutate.rs b/src/test/compile-fail/lambda-mutate.rs index 6ba1cfc5401..0c6d8b1e7c5 100644 --- a/src/test/compile-fail/lambda-mutate.rs +++ b/src/test/compile-fail/lambda-mutate.rs @@ -1,8 +1,8 @@ // error-pattern:assigning to upvar -// Make sure we can't write to upvars from lambdas +// Make sure we can't write to upvars from fn@s fn main() { let i = 0; - let ctr = lambda () -> int { i = i + 1; ret i; }; + let ctr = fn@ () -> int { i = i + 1; ret i; }; log(error, ctr()); log(error, ctr()); log(error, ctr()); diff --git a/src/test/compile-fail/sendfn-is-not-a-lambda.rs b/src/test/compile-fail/sendfn-is-not-a-lambda.rs index 0eb787761f3..1be97b94654 100644 --- a/src/test/compile-fail/sendfn-is-not-a-lambda.rs +++ b/src/test/compile-fail/sendfn-is-not-a-lambda.rs @@ -1,6 +1,6 @@ -// error-pattern: mismatched types: expected `lambda(++uint) -> uint` +// error-pattern: mismatched types: expected `fn@(++uint) -> uint` -fn test(f: lambda(uint) -> uint) -> uint { +fn test(f: fn@(uint) -> uint) -> uint { ret f(22u); } diff --git a/src/test/pretty/cap-clause.rs b/src/test/pretty/cap-clause.rs index cbe19a4cd1e..eeaa7853c3e 100644 --- a/src/test/pretty/cap-clause.rs +++ b/src/test/pretty/cap-clause.rs @@ -4,9 +4,9 @@ fn main() { let x = 1; let y = 2; let z = 3; - let l1 = lambda[copy x]() -> int { x + y }; - let l2 = lambda[copy x; move y]() -> int { x + y }; - let l3 = lambda[move z]() -> int { z }; + let l1 = fn@[copy x]() -> int { x + y }; + let l2 = fn@[copy x; move y]() -> int { x + y }; + let l3 = fn@[move z]() -> int { z }; let x = 1; let y = 2; diff --git a/src/test/run-fail/unwind-lambda.rs b/src/test/run-fail/unwind-lambda.rs index 6980cc16bd1..b9dcabcabbf 100644 --- a/src/test/run-fail/unwind-lambda.rs +++ b/src/test/run-fail/unwind-lambda.rs @@ -8,7 +8,7 @@ fn main() { macerate(*tasties); } (carrots, { |food| let mush = food + cheese; - lambda() { + let _ = fn@() { let chew = mush + cheese; fail "so yummy" } (); diff --git a/src/test/run-pass/block-arg-call-as.rs b/src/test/run-pass/block-arg-call-as.rs index caef692060e..87067c50218 100644 --- a/src/test/run-pass/block-arg-call-as.rs +++ b/src/test/run-pass/block-arg-call-as.rs @@ -4,7 +4,7 @@ fn asSendfn( f : sendfn()->uint ) -> uint { ret f(); } -fn asLambda( f : lambda()->uint ) -> uint { +fn asLambda( f : fn@()->uint ) -> uint { ret f(); } diff --git a/src/test/run-pass/block-arg-used-as-lambda.rs b/src/test/run-pass/block-arg-used-as-lambda.rs index 6780e3692f5..18e8513b090 100644 --- a/src/test/run-pass/block-arg-used-as-lambda.rs +++ b/src/test/run-pass/block-arg-used-as-lambda.rs @@ -1,9 +1,9 @@ -fn to_lambda(f: lambda(uint) -> uint) -> lambda(uint) -> uint { +fn to_lambda(f: fn@(uint) -> uint) -> fn@(uint) -> uint { ret f; } fn main() { - let x: lambda(uint) -> uint = to_lambda({ |x| x * 2u }); + let x: fn@(uint) -> uint = to_lambda({ |x| x * 2u }); let y = to_lambda(x); let x_r = x(22u); diff --git a/src/test/run-pass/cap-clause-move.rs b/src/test/run-pass/cap-clause-move.rs index a8cca1490fa..b484a16b06d 100644 --- a/src/test/run-pass/cap-clause-move.rs +++ b/src/test/run-pass/cap-clause-move.rs @@ -2,8 +2,8 @@ fn main() { let x = ~1; let y = ptr::addr_of(*x) as uint; - let lam_copy = lambda[copy x]() -> uint { ptr::addr_of(*x) as uint }; - let lam_move = lambda[move x]() -> uint { ptr::addr_of(*x) as uint }; + let lam_copy = fn@[copy x]() -> uint { ptr::addr_of(*x) as uint }; + let lam_move = fn@[move x]() -> uint { ptr::addr_of(*x) as uint }; assert lam_copy() != y; assert lam_move() == y; diff --git a/src/test/run-pass/fn-type-infer.rs b/src/test/run-pass/fn-type-infer.rs index d9b6ac60ba3..8367cbd58a7 100644 --- a/src/test/run-pass/fn-type-infer.rs +++ b/src/test/run-pass/fn-type-infer.rs @@ -1,4 +1,4 @@ fn main() { - // We should be able to type infer inside of lambdas. + // We should be able to type infer inside of fn@s. let f = fn () { let i = 10; }; } diff --git a/src/test/run-pass/lambda-infer-unresolved.rs b/src/test/run-pass/lambda-infer-unresolved.rs index 87dc1e6d89b..d526c00a998 100644 --- a/src/test/run-pass/lambda-infer-unresolved.rs +++ b/src/test/run-pass/lambda-infer-unresolved.rs @@ -1,7 +1,7 @@ // This should typecheck even though the type of e is not fully -// resolved when we finish typechecking the lambda. +// resolved when we finish typechecking the fn@. fn main() { let e = @{mutable refs: [], n: 0}; - let f = lambda () { log(error, e.n); }; + let f = fn@ () { log(error, e.n); }; e.refs += [1]; } diff --git a/src/test/run-pass/lambda-no-leak.rs b/src/test/run-pass/lambda-no-leak.rs index 0eeb306d4fd..171650a4268 100644 --- a/src/test/run-pass/lambda-no-leak.rs +++ b/src/test/run-pass/lambda-no-leak.rs @@ -1,7 +1,7 @@ -// Make sure we don't leak lambdas in silly ways. +// Make sure we don't leak fn@s in silly ways. fn force(f: fn@()) { f() } fn main() { let x = 7; - lambda () { log(error, x); }; - force(lambda () { log(error, x); }); + let _ = fn@ () { log(error, x); }; + force(fn@ () { log(error, x); }); } diff --git a/src/test/run-pass/last-use-in-cap-clause.rs b/src/test/run-pass/last-use-in-cap-clause.rs index aaef6e8e366..6ac7404c3ce 100644 --- a/src/test/run-pass/last-use-in-cap-clause.rs +++ b/src/test/run-pass/last-use-in-cap-clause.rs @@ -1,9 +1,9 @@ // Make sure #1399 stays fixed -fn foo() -> lambda() -> int { +fn foo() -> fn@() -> int { let k = ~22; let _u = {a: k}; - ret lambda[move k]() -> int { 22 }; + ret fn@[move k]() -> int { 22 }; } fn main() { diff --git a/src/test/run-pass/last-use-is-capture.rs b/src/test/run-pass/last-use-is-capture.rs index 1399839a1ed..b238dab3026 100644 --- a/src/test/run-pass/last-use-is-capture.rs +++ b/src/test/run-pass/last-use-is-capture.rs @@ -1,7 +1,7 @@ // Make sure #1399 stays fixed fn main() { - fn invoke(f: lambda()) { f(); } + fn invoke(f: fn@()) { f(); } let k = ~22; let _u = {a: k}; invoke {||log(error, k);} |
