Add compile-fail tests for tail calls
This commit is contained in:
parent
378c0087ca
commit
6461cf30de
3 changed files with 26 additions and 0 deletions
|
@ -434,6 +434,7 @@ TEST_XFAILS_BOOT := $(TASK_XFAILS) \
|
|||
test/compile-fail/bad-recv.rs \
|
||||
test/compile-fail/bad-send.rs \
|
||||
test/compile-fail/infinite-vec-type-recursion.rs \
|
||||
test/compile-fail/tail-non-call.rs \
|
||||
test/compile-fail/writing-through-read-alias.rs
|
||||
|
||||
# Same strategy here for the time being: just list the ones that
|
||||
|
@ -555,6 +556,8 @@ TEST_XFAILS_RUSTC := $(filter-out \
|
|||
multiline-comment-line-tracking.rs \
|
||||
output-type-mismatch.rs \
|
||||
rec-missing-fields.rs \
|
||||
tail-non-call.rs \
|
||||
tail-typeck.rs \
|
||||
type-shadow.rs \
|
||||
while-type-error.rs \
|
||||
wrong-ret-type.rs \
|
||||
|
|
10
src/test/compile-fail/tail-non-call.rs
Normal file
10
src/test/compile-fail/tail-non-call.rs
Normal file
|
@ -0,0 +1,10 @@
|
|||
// error-pattern: Non-call expression in tail call
|
||||
|
||||
fn f() -> int {
|
||||
auto x = 1;
|
||||
be x;
|
||||
}
|
||||
|
||||
fn main() {
|
||||
auto y = f();
|
||||
}
|
13
src/test/compile-fail/tail-typeck.rs
Normal file
13
src/test/compile-fail/tail-typeck.rs
Normal file
|
@ -0,0 +1,13 @@
|
|||
// error-pattern: mismatched types
|
||||
|
||||
fn f() -> int {
|
||||
be g();
|
||||
}
|
||||
|
||||
fn g() -> uint {
|
||||
ret 0u;
|
||||
}
|
||||
|
||||
fn main() {
|
||||
auto y = f();
|
||||
}
|
Loading…
Add table
Reference in a new issue