Skip to content

Commit 1fc4e9f

Browse files
committed
Add tests and fix pexp bug. Closes rust-lang#141.
1 parent 559e1e7 commit 1fc4e9f

File tree

4 files changed

+28
-2
lines changed

4 files changed

+28
-2
lines changed

src/Makefile

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -381,11 +381,13 @@ TASK_XFAILS := test/run-pass/acyclic-unwind.rs \
381381
test/run-pass/task-comm-9.rs \
382382
test/run-pass/task-comm.rs \
383383
test/run-pass/threads.rs \
384-
test/run-pass/yield.rs
384+
test/run-pass/yield.rs
385385

386386
TEST_XFAILS_X86 := $(TASK_XFAILS) \
387387
test/run-pass/bind-obj-ctor.rs \
388+
test/run-pass/child-outlives-parent.rs \
388389
test/run-pass/clone-with-exterior.rs \
390+
test/run-pass/constrained-type.rs \
389391
test/run-pass/obj-as.rs \
390392
test/run-pass/vec-slice.rs \
391393
test/run-pass/fn-lval.rs \
@@ -424,10 +426,12 @@ TEST_XFAILS_LLVM := $(TASK_XFAILS) \
424426
box-in-tup.rs \
425427
box-unbox.rs \
426428
cast.rs \
429+
child-outlives-parent.rs \
427430
clone-with-exterior.rs \
428431
comm.rs \
429432
command-line-args.rs \
430433
complex.rs \
434+
constrained-type.rs \
431435
deep.rs \
432436
deref.rs \
433437
destructor-ordering.rs \

src/boot/fe/pexp.ml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ and parse_carg_base (ps:pstate) : Ast.carg_base =
121121

122122
and parse_carg (ps:pstate) : Ast.carg =
123123
match peek ps with
124-
IDENT _ ->
124+
IDENT _ | STAR ->
125125
begin
126126
let base = Ast.CARG_base (parse_carg_base ps) in
127127
let path =
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
// Reported as issue #126, child leaks the string.
2+
3+
fn child2(str s) {
4+
}
5+
6+
fn main() {
7+
auto x = spawn child2("hi");
8+
}

src/test/run-pass/constrained-type.rs

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
// -*- rust -*-
2+
3+
// Reported as issue #141, as a parse error. Ought to work in full though.
4+
5+
type list = tag(cons(int,@list), nil());
6+
type bubu = rec(int x, int y);
7+
8+
9+
fn less_than(int x, int y) -> bool { ret x < y; }
10+
11+
type ordered_range = rec(int low, int high) : less_than(*.low, *.high);
12+
13+
fn main() {
14+
}

0 commit comments

Comments
 (0)