Commit graph

4451 commits

Author SHA1 Message Date
Eric Holk
50670eb426 Removing trailing whitespace in rust_shape.cpp 2011-08-05 17:08:22 -07:00
Eric Holk
f9fd785cf5 Removing an invalid operation in the attempt to restore valgrind cleanness. 2011-08-05 17:01:06 -07:00
Brian Anderson
5f89a4f5f3 XFAIL sio-srv
Needs to run on loopback so it doesn't trigger windows firewall, but seems
to be hanging. Giving up for now.
2011-08-05 16:49:43 -07:00
Patrick Walton
5261bd771f rt: Simplify the signature of walk_tag; stub code for the data walker 2011-08-05 16:47:43 -07:00
Paul Stansifer
a9471d8296 Revert "rustc: bzero in zero_alloca. Shaves off a second or three."
This causes trouble in Valgrind in drop glue in parsing.

This reverts commit 4d180793f0.
2011-08-05 16:38:49 -07:00
Brian Anderson
f918418953 Fix a type in the libuv mingw makefile 2011-08-05 15:48:19 -07:00
Tim Chevalier
c35bf9ca04 Another test for the occurs check, this one from issue 778 2011-08-05 15:47:17 -07:00
Eric Holk
b62e80c1f0 Atomic ref counting for chans. 2011-08-05 15:27:28 -07:00
Eric Holk
200bbcf91b Rewrote receive to return a value. This lets us initialize variables by receiving them. 2011-08-05 15:27:27 -07:00
Tim Chevalier
1c786bcc82 Initialize all constraints to False
Previously, typestate was initializing the init constraint for
a declared-but-not-initialized variable (like x in "let x;") to False,
but other constraints to Don't-know. This led to over-lenient results
when a variable was used before declaration (see the included test
case). Now, everything gets initialized to False in the prestate/poststate-
finding phase, and Don't-know should only be used in pre/postconditions.

This aspect of the algorithm really needs formalization (just on paper),
but for now, this closes #700
2011-08-05 15:25:52 -07:00
Patrick Walton
e76efbc43a etc: Add "lambda" and "inline" to the vim mode 2011-08-05 14:01:45 -07:00
Patrick Walton
b079e1adbb rustc: Parse "inline". Also write it into metadata. 2011-08-05 13:59:27 -07:00
Brian Anderson
18ef7cc531 Un-XFAIL sio-ctx, sio-srv
Seem to work consistently
2011-08-05 11:57:07 -07:00
Graydon Hoare
7da64ae461 Munge libuv makefiles sufficiently to build out of tree. 2011-08-05 11:57:07 -07:00
Brian Anderson
f6d5c56f21 Tweak libuv makefiles so they pick up custom CFLAGS 2011-08-05 11:57:07 -07:00
Brian Anderson
e653520a6f Fix uv_buf_t declaration on win32
The fields of this structure are mysteriously defined in the opposite order
on windows as on unix
2011-08-05 11:57:06 -07:00
Brian Anderson
4178e52c8f XFAIL all the sio tests
They have random failures still, sadly.
2011-08-05 11:57:06 -07:00
Rob Arnold
a4951cab7f Add libuv Makefile 2011-08-05 11:57:06 -07:00
Rob Arnold
8229c3fa75 Update libuv to revision ee599ec1141cc48f895de1f9d148033babdf9c2a 2011-08-05 11:57:06 -07:00
Rob Arnold
f4b87c749f Basic async IO module using libuv 2011-08-05 11:57:06 -07:00
Rob Arnold
b64a52df42 Integrate libuv into the build system 2011-08-05 11:57:06 -07:00
Rob Arnold
904f443fa9 Drop in libuv rev 2b5707d834a6b85b8e589ac04cb61a6db2dab94b 2011-08-05 11:57:06 -07:00
Rob Arnold
b6be83885f Log tags in memory_region::{free,realloc}
Make this useful and consistent with the destructor.
2011-08-05 11:57:06 -07:00
Patrick Walton
fd7ffd5ac2 rustc: Add inlineness to the fn decl instead 2011-08-05 11:46:43 -07:00
Patrick Walton
59e9b629c0 Revert "rustc: Introduce the concept of inline to the AST"
This reverts commit 9b9170f9fe.
2011-08-05 11:38:06 -07:00
Patrick Walton
9b9170f9fe rustc: Introduce the concept of inline to the AST 2011-08-05 11:33:48 -07:00
Patrick Walton
684df97ef0 etc: Update the Vim syntax mode with new keywords 2011-08-05 09:25:27 -07:00
Tim Chevalier
d7ee55bfd0 (Almost) Always unify a function tail expr with the function result type
typeck::check_fn had an exception for the case where the tail expr
was compatible with type nil -- in that case, it doesn't unify the
tail expr's type with the enclosing function's result type. This
seems wrong to me. There are several test cases in Issue #719
that illustrate why. If the tail expr has type T, for some type
variable T that isn't resolved when this check happens, then T
never gets unified with anything, which is incorrect -- T should
be unified with the result type of the enclosing function. (The
bug was occurring because an unconstrained type variable is
compatible with type nil.)

Instead, I removed the check for type nil and added a check that
the function isn't an iterator -- if it's an iterator, I don't
check the tail expr's type against the function result type,
as that wouldn't make sense.

However, this broke two test cases, and after discussion with
brson, I understood that the purpose of the check was to allow
semicolons to be omitted in some cases. The whole thing seems
rather ad hoc. But I came up with a hacky compromise solution:
instead of checking whether the tailexpr type is *compatible*
with nil, we now just check whether it *is* nil. This also
necessitates calling resolve_type_vars_if_possible before
the check happens, which worries me. But, this fixes the bug
from Issue #719 without requiring changes to any test cases.

Closes #719 but I didn't try every variation -- so reopen the bug
if one of the variations still doesn't work.
2011-08-05 02:21:58 -07:00
Michael Sullivan
c5d55ef918 Prohibit assignment to upvars in lambdas. Closes #805. 2011-08-04 19:35:44 -07:00
Patrick Walton
a26c027731 Revert "rustc: Don't emit memset for non-structural types" due to crashes
This reverts commit 3d5a777fe1.
2011-08-04 19:06:13 -07:00
Patrick Walton
3d5a777fe1 rustc: Don't emit memset for non-structural types 2011-08-04 18:24:57 -07:00
Michael Sullivan
66a255ac92 Add a cleanup for copying closures. Closes #804. 2011-08-04 17:58:12 -07:00
Michael Sullivan
9a5e9806f3 Don't force resolution of type variables until there is no enclosing function scope. Closes #803. 2011-08-04 17:33:15 -07:00
Patrick Walton
d4fe1b3127 stdlib: Pass getopt matches by alias 2011-08-04 17:11:50 -07:00
Patrick Walton
6c0297cfe7 rustc: bzero in drop_slot 2011-08-04 16:47:20 -07:00
Lindsey Kuper
fcec628203 Enable creation of backwarding vtables (issue #702), but don't start
using them yet.  Also, refactor process_fwding_mthd into separate
functions to handle backwarding and forwarding, and refactor
create_vtbl to be more digestible.
2011-08-04 16:40:17 -07:00
Patrick Walton
4d180793f0 rustc: bzero in zero_alloca. Shaves off a second or three. 2011-08-04 16:33:38 -07:00
Michael Sullivan
cf9c0f9d93 Use lambdas in gather_locals in typeck. 2011-08-04 16:18:12 -07:00
Michael Sullivan
95680474e2 Use lambdas in the freevars pass. 2011-08-04 16:18:12 -07:00
Patrick Walton
ae3312002a rustc: Use memmove in copy_ty. 45% LLVM codegen speed improvement. 2011-08-04 16:14:28 -07:00
Tim Chevalier
e0985c1060 Handle alt on a _|_ - typed value
Return the result of the discriminant from trans_alt,
rather than nil, in the _|_ case. This was breaking the
enclosed test case (alt-bot-2) when optimization was disabled.

Closes #769
2011-08-04 16:07:26 -07:00
Tim Chevalier
5f03ca48d8 Add a fast path in ty::occurs_check_fails
Use type_contains_vars in occurs_check_fails to avoid doing
any work most of the time. This fixes a performance regression.
(No one else noticed yet that typechecking just got 4x slower, right?
Well, now it isn't anymore. :-})
2011-08-04 15:56:40 -07:00
Tim Chevalier
2baaeab784 Implement the occurs check
In the writeback phase, the typechecker now checks that it isn't
replacing a type variable T with a type that contains T. It
also does an occurs check in do_autoderef in order to avoid
getting into an infinite chain of derefs.

I'm a bit worried that there are more places where the occurs
check needs to happen where I'm not doing it now, though.

Closes #768
2011-08-04 15:30:09 -07:00
Lindsey Kuper
d7d4b4fc38 trans_args no longer needs llobj argument. 2011-08-04 11:34:06 -07:00
Patrick Walton
2a3235b58c rustc: Actually emit shapes 2011-08-04 11:25:46 -07:00
Eric Holk
b55b80ed11 Merge commit '6ec4829' into snap 2011-08-04 11:13:52 -07:00
Eric Holk
6ec4829068 Registering snapshot. 2011-08-04 11:06:11 -07:00
Patrick Walton
4061ca2bbd rustc: Generate shapes 2011-08-04 10:46:10 -07:00
Patrick Walton
6bb6922c28 rt: Change int to uint32_t. Put out burning tinderbox. 2011-08-04 09:50:11 -07:00
Patrick Walton
e351ad762d rt: Stub shape glue and implement shape::print and shape::size_of. 2011-08-03 20:25:44 -07:00
Lindsey Kuper
1b1d8e7b91 Killing an obsolete comment. 2011-08-03 20:03:05 -07:00
Lindsey Kuper
6df7c041bc Pointer-ifying llenv. Step 1 of 2 steps to object system sanity. 2011-08-03 19:50:19 -07:00
Lindsey Kuper
29ec2503db Put comments on trans contexts back where they belong. :( 2011-08-03 19:49:29 -07:00
Michael Sullivan
316bf01e26 Fix the pretty print tests to handle terminal newlines. Sorry! 2011-08-03 19:47:54 -07:00
Erick Tryzelaar
a8943f3442 timeout_in_ns was renamed to timeout_in_ms. 2011-08-03 19:28:49 -07:00
Eric Holk
7a2e9f4874 Sleep for a nonzero amount of time on Windows. 2011-08-03 18:21:19 -07:00
Michael Sullivan
5d5a3ca52d Fix trans_put to properly return (). Closes #773. 2011-08-03 18:10:54 -07:00
Michael Sullivan
5ea8d7f467 Make the pretty printer put trailing newlines at the end of files. 2011-08-03 17:52:25 -07:00
Michael Sullivan
9bfbb2bf83 Remove an obsolete FIXME in stdtest/deque.rs. Closes #140. 2011-08-03 17:08:23 -07:00
Brian Anderson
2298a2b29f Whitespace cleanup 2011-08-03 16:25:38 -07:00
Brian Anderson
89f2c43cf3 Convert line endings when doing exact pretty-print testing
For the benefit of windows
2011-08-03 15:37:51 -07:00
Brian Anderson
4ae6c835cb Add some hacks to get stdin piping working more correctly in windows
The way pipes work in windows is not the same as unix, though I'm not
entirely clear on the differences. This patch changes the windows pipe
method to return non-inheritable fds, and the windows rust_run_program
method to duplicate them before spawning the new process.

This allows make-check-pretty to work on windows.
2011-08-03 15:09:00 -07:00
Michael Sullivan
e33de59e47 Clean up how we deal with dynamic size function arguments/returns. 2011-08-03 14:24:41 -07:00
Michael Sullivan
7bcde7270d Have trans_bind_thunk handle polymorphic but statically sized return values.
Closes #775.
2011-08-03 14:24:41 -07:00
Tim Chevalier
001df3f0ca Revert "Revert "Handle conditionals on _|_ - typed values correctly""
This reverts commit ea81c03960.

Changed the case in trans_if where the conditional is _|_ - typed
but the block is terminated to return the result of the cond,
instead of nil.

This passes "make check" with optimization disabled as well as
enabled.
2011-08-03 13:07:41 -07:00
Paul Stansifer
513276e595 Add #concat_idents[] and #ident_to_str[] 2011-08-03 12:42:35 -07:00
Michael Sullivan
4a636b06f6 Actually un-xfail the test for put in fns. 2011-08-03 11:59:11 -07:00
Michael Sullivan
c9ae548dae Reject programs that do a put outside of iterators.
Closes #774.
2011-08-03 11:43:50 -07:00
Michael Sullivan
8871462575 Do a bunch more typechecking for iters and for each loops.
Closes #771.
Closes #772.
Closes #796.
2011-08-03 11:07:53 -07:00
Michael Sullivan
3254fb9806 Code cleanup in check_expr. 2011-08-03 11:06:58 -07:00
Michael Sullivan
fcc458d4a0 Fix typechecking when spawning something type inferred.
Of course, we still don't *translate* it.

Closes #757.
2011-08-03 11:06:58 -07:00
Brian Anderson
228422303f Remove the last remaining xfail-boot directive 2011-08-03 10:55:59 -07:00
Brian Anderson
c53402846e Remove all xfail-stage0 directives
While it is still technically possible to test stage 0, it is not part of any
of the main testing rules and maintaining xfail-stage0 is a chore. Nobody
should worry about how tests fare in stage0.
2011-08-03 10:55:59 -07:00
Brian Anderson
63600828cd Un-xfail more pretty-printing tests 2011-08-03 10:55:59 -07:00
Brian Anderson
e4da7c5bee parse_crate_from_source_str takes a parse_sess, not codemap
This was causing problems when reading from stdin for subsequent passes that
needed to generate node ids.
2011-08-03 10:55:59 -07:00
Brian Anderson
97a8784c98 Fix pretty-printer to read from files again
I accidentally made the pretty-printer always read from stdin
2011-08-03 10:55:59 -07:00
Brian Anderson
0b7a94a94c Pretty-print kinds of type params 2011-08-03 10:55:59 -07:00
Brian Anderson
843767a841 Disambiguate unop statements in pretty-printer. Closes #674 2011-08-03 10:55:59 -07:00
Brian Anderson
ea81c03960 Revert "Handle conditionals on _|_ - typed values correctly"
This reverts commit 13f8b3f2a6.

run-pass/if-ret.rs does not translate correctly when unoptimized. Issue #797
2011-08-03 10:48:52 -07:00
Marijn Haverbeke
d08c0f0ec1 Make ast::pat_bindings an iterator
And use it to get rid of some repetetive code
2011-08-03 10:26:41 +02:00
Tim Chevalier
948f8090ae Handle _|_ - typed discriminants in alts correctly
Stop me, won't you, if you've heard this one before?

Closes #794
2011-08-02 19:02:38 -07:00
Tim Chevalier
13f8b3f2a6 Handle conditionals on _|_ - typed values correctly
Closes #776
2011-08-02 18:34:44 -07:00
Tim Chevalier
7c34550931 Make _|_ type binopable
But don't actually generate code that does the operation. That means
hoisting the check I added in my last commit from trans_compare
up into trans_eager_binop (don't generate any code if one operand
has type _|_ ).

Closes #777
2011-08-02 18:06:46 -07:00
Brian Anderson
44c93b5fb2 Remove task-comm-chan-chan test
This issue has a smaller test case in chan-leak.rs
2011-08-02 17:49:11 -07:00
Brian Anderson
a6cb0c2843 Enable more tests that pretty-print correctly now 2011-08-02 17:49:11 -07:00
Brian Anderson
2911156820 Pretty-print fn constraints more correctish 2011-08-02 17:49:11 -07:00
Brian Anderson
637037f68c Un-xfail run-pass/claim-nonterm
Seems to work
2011-08-02 17:49:11 -07:00
Brian Anderson
25b16ba9a2 Un-xfail run-fail/fn-constraint-claim
Seems to work
2011-08-02 17:49:11 -07:00
Brian Anderson
3eef9993af Don't pp extra lines after block open when preserving whitespace. Closes #759 2011-08-02 17:49:11 -07:00
Tim Chevalier
731797d075 In trans, don't assume both sides of a binop have the same type
This was at least partially responsible for Issue 777.

    The only solution I can think of is for trans to just not generate
    code for a comparison if one or both sides has type _|_. Since
    that means evaluating that subexpression diverges, it should be ok
    to never do the comparison. Actually generating code for the
    comparison would trip an LLVM assertion failure.
2011-08-02 17:36:41 -07:00
Lindsey Kuper
430a28bb49 Refactor: a backwarding vtable can only have one kind of method. 2011-08-02 16:59:49 -07:00
Lindsey Kuper
48467c4faa Comment tweaks and re-flows. 2011-08-02 16:53:31 -07:00
Michael Sullivan
f371482593 Consolidate environment building/loading between closure types. 2011-08-02 16:30:56 -07:00
Michael Sullivan
4cf4e17e1d Track the node_id of the function in trans_common::fn_ctxt. 2011-08-02 16:30:56 -07:00
Michael Sullivan
f8b0d3d7d2 Use GEPi a bunch. 2011-08-02 16:26:00 -07:00
Graydon Hoare
bc11cd5ca5 Fix majority of valgrind-purity bugs observed in a rustc run (LLVM still appears to leak some of its own memory). 2011-08-02 15:00:51 -07:00
Paul Stansifer
ab4764520c Allow patterns of the form `[a, b, c ...] to be matched and transcribed. 2011-08-02 14:46:02 -07:00
Brian Anderson
ea2a968146 Include benchmarks in pretty-print tests 2011-08-02 14:37:03 -07:00
Brian Anderson
795e80fc19 Register new snapshots 2011-08-02 13:43:13 -07:00
Tim Chevalier
40c1b864c6 Use or-patterns in trans::trans_compare, eliminating a FIXME 2011-08-02 13:17:59 -07:00
Brian Anderson
35e9e02066 Use ioivec::read_whole_file_str in a few places 2011-08-02 10:39:14 -07:00
Brian Anderson
a1a25969a0 Add ioivec::read_whole_file/read_whole_file_str 2011-08-02 10:39:14 -07:00
Brian Anderson
77be30fa73 Typecheck pretty-printing test results as libraries. Issue #789
After running source files through the pretty printer, we sanity check them by
running the results through the compiler with the --no-trans flag. Now also
use the --lib flag so that pretty-printer tests don't have to include a main
function.
2011-08-02 10:39:14 -07:00
Brian Anderson
0fbb6782bb Add dedicated pretty-printer tests with new pp-exact directive
Add a new src/test/pretty directory to hold just source files for testing the
pretty-printer.

Add a new pp-exact directive. When this directive is followed by a file name
it specifies a file containing the output that the pretty-printer should
generate. When pp-exact is not followed by a filename it says that the file
should pretty-print as written.
2011-08-02 10:39:13 -07:00
Brian Anderson
e13390a199 Pretty-print test the rfail tests. Issue #789 2011-08-02 10:39:13 -07:00
Brian Anderson
0a6e3362c6 Add xfail-pretty directives to tests that don't pretty-print correctly
Issue #789
2011-08-02 10:39:13 -07:00
Brian Anderson
166c73546a Remove test/run-pass/simple-qsort
This is part of stdtest now
2011-08-02 10:39:13 -07:00
Brian Anderson
67b8f8b13a Display the name of the test being waited for before the result is in
So the test runner displays the name of the test, then waits for it to finish,
then displays the result. It worked this way before things were parallelized
and it's just much friendlier this way.
2011-08-02 10:39:13 -07:00
Brian Anderson
1702b8507d Add xfail-pretty test directive. Issue #789
Indicates that this test should not be used to test the pretty-printer
2011-08-02 10:39:13 -07:00
Brian Anderson
ce8cac5d9a Use color to report the final test result, even when running in parallel
After the tests are run there is no more parallelism, so it should be less
likely that the control characters will introduce wierd artifacts.
2011-08-02 10:39:13 -07:00
Brian Anderson
a601eb169e Run pretty-printed sources through the compiler again for sanity
Just go as far as typechecking for speed sake.

Issue #789
2011-08-02 10:39:13 -07:00
Brian Anderson
1653f3f1a9 Implement test that pretty-printed code converges. Issue #789 2011-08-02 10:39:13 -07:00
Brian Anderson
4828d8f73f Remove unused procsrv::clone function from compiletest 2011-08-02 10:39:12 -07:00
Brian Anderson
291c43af31 Fix comment typo in compiletest 2011-08-02 10:39:12 -07:00
Brian Anderson
39d3b93a38 Pretty-print tests only run on .rs files. Issue #789
The pretty-printer can't handle .rc files currently
2011-08-02 10:39:12 -07:00
Brian Anderson
4e8ab8b3a8 Introduce pretty-print testing mode to compiletest. Issue #789 2011-08-02 10:39:12 -07:00
Brian Anderson
af2eecdabe Replace an open-coded conversion with ivec::from_vec 2011-08-02 10:39:12 -07:00
Brian Anderson
a8af13e784 Move compiletest modules into separate files 2011-08-02 10:39:12 -07:00
Brian Anderson
840a09c86e Add a --no-trans command line option
Runs all passes before translation. This will be used for pretty-printing
tests to verify that the results are still probably valid Rust code.
2011-08-02 10:39:12 -07:00
Brian Anderson
5f4b7e1ba7 Compiler accepts input from stdin when source file is called "-" 2011-08-02 10:39:09 -07:00
Marijn Haverbeke
2d5b651f49 Assign collection element ty to loop local tvar when checking loops
This makes the type declarationg for the loop variable optional in
most cases.

Closes #790
2011-08-02 15:09:29 +02:00
Marijn Haverbeke
78a0d380cc Do not try to save block result when the block is an iter body
Closes #791
2011-08-02 14:28:32 +02:00
Marijn Haverbeke
6c9b90d06a Be a little more clever about picking columns to match on in trans_alt
This should result in slightly more efficient matching of 'complex'
patterns with multiple discriminants in them.
2011-08-02 12:57:27 +02:00
Marijn Haverbeke
f8fa574864 Copy locals created by destructuring on the content of a box
This is required so that assigning to these locals doesn't clobber
the content of the box.

(A possible optimization would be to only do this copying for
locals that actually are assigned to.)
2011-08-02 12:09:15 +02:00
Marijn Haverbeke
043d95a2bd Move ppaux::ty_to_str to new record syntax 2011-08-02 12:09:15 +02:00
Marijn Haverbeke
8d8ff16dfe Improve handling of bottom type in alt arms 2011-08-02 10:24:06 +02:00
Tim Chevalier
5cf5f5024d Handle bang functions correctly in typestate
The logic for how the "returns" constraint was handled was always
dodgy, for reasons explained in the comments I added to
auxiliary::fn_info in this commit. Fixed it by adding distinct
"returns" and "diverges" constraints for each function, which
are both handled positively (that is: for a ! function, the
"diverges" constraint must be true on every exit path; for
any other function, the "returns" constraint must be true
on every exit path).

Closes #779
2011-08-01 20:58:16 -07:00
Brian Anderson
c9b16ac4c2 Add std::str::is_whitespace 2011-08-01 18:55:51 -07:00
Brian Anderson
1ad68eafd2 Add std::str::trim/trim_left/trim_right 2011-08-01 18:55:51 -07:00
Brian Anderson
598e25e091 Add std::char_slice 2011-08-01 18:55:51 -07:00
Brian Anderson
0c7a95fde5 Add std::char::is_whitespace 2011-08-01 18:55:51 -07:00
Brian Anderson
6f8f00d1af Add std::char module 2011-08-01 18:55:51 -07:00
Paul Stansifer
fcc32797de Fix incorrect uses of str::buf() 2011-08-01 18:51:56 -07:00
Eric Holk
286be2d94e Adding an intrinsic for recv. 2011-08-01 18:43:05 -07:00
Brian Anderson
2f7ed33517 Ignore whitespace in argument lists in compiletest
Makes testing work with DEBUG=1
2011-08-01 16:41:20 -07:00
Eric Holk
939bca0d84 Added send and receive to comm library. 2011-08-01 15:58:39 -07:00
Eric Holk
6a6d5c669e Enabling logging in circular_buffer again. 2011-08-01 15:58:39 -07:00
Eric Holk
b3d9d9b73c Objectified library chans and ports. 2011-08-01 15:58:30 -07:00
Eric Holk
5a673cc2c9 Started working on a library-based comm system. Creating and deleting ports work. 2011-08-01 15:58:30 -07:00
Michael Sullivan
7a05f1db7c Fix closures over dynamically-sized polymorphic values. 2011-08-01 15:19:55 -07:00
Michael Sullivan
601c299d52 Fix closures over known-size polymorphic values. 2011-08-01 15:18:44 -07:00
Michael Sullivan
a32f287c8a Add a GEPi function that wraps GEP with integer arguments. 2011-08-01 15:18:44 -07:00
Brian Anderson
7b87fa3683 Replace a lock/unlock with scoped_lock in rust_scheduler::create_task 2011-08-01 11:01:59 -07:00
Marijn Haverbeke
4837a57df5 Add tests for destructuring locals 2011-08-01 17:52:43 +02:00
Marijn Haverbeke
92240eb25b Add check for irrefutable patterns in destructuring locals 2011-08-01 17:52:43 +02:00
Marijn Haverbeke
985c32ef4c Partially implement destructuring locals
You can now say

    let {bcx, val} = some_result_returner();

Similar for loop variables. Assigning to such variables is not safe
yet. Function arguments also remain a TODO.
2011-08-01 17:51:37 +02:00
Marijn Haverbeke
48ec25da42 Get rid of walk.rs
And we're down to a single AST walker again
2011-07-31 12:24:14 +02:00
Marijn Haverbeke
c7ef6d2866 Stop using walk.rs in the fuzzer 2011-07-31 12:23:42 +02:00
Tim Chevalier
2971cfb145 Remove unused imports 2011-07-31 00:06:25 -07:00
Tim Chevalier
28f7c6af24 Change bitvectors::relax_precond_block to use visit instead of walk 2011-07-31 00:06:25 -07:00
Brian Anderson
d552a0b959 Minimize scheduler locking on task creation
This takes my CPU utilization on task-perf-spawnalot from 35% to 55%
2011-07-29 23:02:51 -07:00
Brian Anderson
ec46f07e6e Add a task spawning benchmark
This is the kind of workload that the test runner generates - lots of tiny
little tasks - and currently it leaves the CPU underutilized.
2011-07-29 22:45:01 -07:00
Brian Anderson
6657e729de Lock the new task's scheduler when creating a task
Previously we were locking the spawning task's scheduler. I couldn't
see that that was protecting anything. The newborn_task list in the new task's
scheduler though was unprotected from concurrent access. So now we're locking
the new task's scheduler.
2011-07-29 22:43:11 -07:00
Brian Anderson
96a629d2fa Base test concurrency on the number of scheduler threads.
Ideally we would just spawn every test and collect the results but I'm not
entirely comfortable doing that yet for reasons that I'm too tired to remember
right now. Urgh.
2011-07-29 21:07:03 -07:00
Brian Anderson
9dbe6941c4 Add sched_threads rt function to get the number of scheduler threads 2011-07-29 21:03:17 -07:00
Brian Anderson
b8c209cba1 Refactor std::test
Separate the console output from the running of tests
2011-07-29 19:54:05 -07:00
Eric Holk
d1dbb99984 Removing proxies and message queues. 2011-07-29 18:54:59 -07:00
Graydon Hoare
bc4e9afe25 Fix bug in typechecker counting occurrences of typarams in instantiation rather than checking formals list. 2011-07-29 18:48:15 -07:00
Graydon Hoare
0c9b749d20 Enable kind checking on typarams, fix kind constraints in library and comp. 2011-07-29 18:48:15 -07:00
Lindsey Kuper
6ba4e34959 Reduced test case for current backwarding bug.
Still working on getting backwarding to play nicely with self and
overriding.  Currently can't fix issue #702 without breaking how self
and overriding interact.
2011-07-29 18:30:27 -07:00
Michael Sullivan
a34f7c8cb3 Switch the heap build and load environment functions to use GEP_tup_like. 2011-07-29 18:22:41 -07:00
Michael Sullivan
56f0fbeafc Initial trans of lambdas. Doesn't work with polymorphism yet. 2011-07-29 18:22:41 -07:00
Tim Chevalier
766e939857 Test case for previous commit 2011-07-29 18:00:10 -07:00
Tim Chevalier
126cd44c38 Refactor typestate code involving stmt_decls
To handle multiple-LHS declarations with initializers properly,
I changed seq_states to take a list of expressions paired with optional
names, not just a list of expressions. Then, the same logic that handles
ordered lists of subexpressions everywhere else can handle multi-
declarations.
2011-07-29 18:00:10 -07:00
Graydon Hoare
59c441a66a Encode, decode, and thread through typechecking all the param kinds, not just the counts. 2011-07-29 16:40:30 -07:00
Michael Sullivan
a684f6078f Do some cleanup in load_environment. 2011-07-29 15:29:38 -07:00
Michael Sullivan
6a4d0ce829 Add in some missing cases for typestate with closures. 2011-07-29 15:29:38 -07:00
Lindsey Kuper
7efbad674a Don't confuse backwards and forwards.
Oops.  If we already have a backwarding vtable, that means that we are
currently building a forwarding fn.  (Progress toward issue #702.)
2011-07-29 15:21:40 -07:00
Lindsey Kuper
6423cc7b52 Comments and cleanup, in preparation for more work on issue #702. 2011-07-29 15:21:40 -07:00
Lindsey Kuper
f4eacbb3b4 Get rid of an obsolete comment now that obj dtors are gone. 2011-07-29 15:21:40 -07:00
Brian Anderson
57e4efb894 Fix long lines 2011-07-29 15:20:24 -07:00
Brian Anderson
d4616725ad Add issue numbers to FIXMEs in compiletest 2011-07-29 15:11:14 -07:00
Brian Anderson
d03af073b4 Close pipes under failure scenario in compiletest 2011-07-29 14:37:00 -07:00
Brian Anderson
b306a0d714 Get compile tests to run in parallel
Takes a lot of workarounds. The biggest problem is that boxes still don't seem
to be moved across channels and bad things happen when the receiver destroys
them. So there's all sorts of defensive cloning and scoping going on here to
make the box lifetimes come out right.
2011-07-29 14:36:56 -07:00
Brian Anderson
f3df9f50ea Add ivec::from_vec and ivec::to_vec 2011-07-29 14:05:04 -07:00
Lindsey Kuper
3595f1f966 Disallow overloading a method with one of different type. Closes #703. 2011-07-29 13:44:34 -07:00
Graydon Hoare
f3c05b9fae Turn on kind propagation for typarams. Annotate a bunch of typarams in rustc and libstd. 2011-07-29 12:58:52 -07:00
Marijn Haverbeke
c34d74315f Remove unreachable statements 2011-07-29 20:54:44 +02:00
Marijn Haverbeke
aa3b89610e Track failures in typeck, assign proper type to failing blocks
(and warn for unreachable statements)

Closes #727
2011-07-29 20:54:44 +02:00
Lindsey Kuper
9705f97ead Typechecking bugfix for anon objs. Removes duplicate methods in outer
object types.
2011-07-29 10:33:00 -07:00
Lindsey Kuper
a6151aa9a8 Formatting tweaks. 2011-07-29 10:33:00 -07:00
robarnold
bdf2daee1e Merge pull request #781 from robarnold/upstream-stable
More useful leak debugging output.
2011-07-29 09:13:20 -07:00
Marijn Haverbeke
48cc11631c Parse anonymous objs in statement position
Closes #761
2011-07-29 15:01:06 +02:00
Marijn Haverbeke
451ec03c2d Clean up old FIXME regarding or-patterns 2011-07-29 14:03:52 +02:00
Marijn Haverbeke
b1d2a00b4a Remove support for obj dtors 2011-07-29 14:03:24 +02:00
Marijn Haverbeke
30d2e358be Replace obj dtors with resources in stdlib and rustc 2011-07-29 14:03:24 +02:00
Marijn Haverbeke
ae46c154f0 Make sure resources always have their drop glue called
Even when their content does not contain pointers
2011-07-29 12:53:58 +02:00
Marijn Haverbeke
0ba34d873d Beginning of replacing drop with resources 2011-07-29 12:18:49 +02:00
Marijn Haverbeke
4c09d4a770 Missed another instance of walk in typeck 2011-07-29 12:18:26 +02:00
Marijn Haverbeke
2ef947b85c Register a snapshot 2011-07-29 12:18:26 +02:00
Marijn Haverbeke
5adf87a2c6 Fix iter_structural_ty_full for resource types
The compiler would blow up when compiling a structural type
containing a resource.
2011-07-29 11:44:29 +02:00
Jesse Ruderman
4642300683 Make the fuzzer check for obvious errors in the 'rest of the compiler', not just the parser. (Disabled by default because it's slow and messy.) 2011-07-29 10:39:15 +02:00
Jesse Ruderman
56d680ab79 Make program_output also return stderr 2011-07-29 10:39:14 +02:00
Michael Sullivan
2c0f4d51f9 Change the way freevars stores its information again. 2011-07-28 18:40:17 -07:00
Michael Sullivan
5068ae4771 Factor out a bunch of environment construction code from trans_bind. 2011-07-28 18:40:17 -07:00
Brian Anderson
3896524750 Drop the previous reference when receiving. Closes #763 2011-07-28 18:22:15 -07:00
Graydon Hoare
bf99573860 Register new snapshots. 2011-07-28 16:28:04 -07:00
Brian Anderson
3dd522b6b7 Add an assertion about the lock in rust_chan::disassociate 2011-07-28 16:04:49 -07:00
Michael Sullivan
d0cb62ac90 Factor out box initializing code into trans_malloc_boxed. 2011-07-28 15:49:06 -07:00
Lindsey Kuper
0ea5a8a6ed Updated alt indenting. 2011-07-28 15:01:12 -07:00
Lindsey Kuper
b24da1c2e5 The names 'outer' and 'inner' make more sense than 'self' and 'with'.
(Also, some formatting and long-string cleanup.)
2011-07-28 14:54:32 -07:00
Brian Anderson
73812cd3de Turn off TRACK_ALLOCATIONS 2011-07-28 14:52:50 -07:00
Brian Anderson
4b356097c2 Change the locking rules around channel disassociation again
This prevents port's destructor from accessing a deleted channel
2011-07-28 14:25:20 -07:00
Brian Anderson
12ab65107a Make combine-tests ignore temp files 2011-07-28 14:24:20 -07:00
Brian Anderson
021bfb4b9b Reenable expr-scope test. Disable under check-fast 2011-07-28 14:14:29 -07:00
Graydon Hoare
3e63fdc4c9 Thread kinds into the type system. Don't quite activate yet, since it breaks stdlib and snapshot isn't ready to compile modified stdlib. 2011-07-28 13:29:39 -07:00
Brian Anderson
5c0fd045ce Fiddle with the locking around channel disassociation
This still looks a bit sketchy to me (why isn't there locking in
port::destroy?) but this manages to get rid of a problem with channels
accessing their task after it's NULL.
2011-07-28 12:53:44 -07:00
Brian Anderson
b54eb0480d No strnlen on mac 2011-07-28 12:53:14 -07:00
Brian Anderson
0fcd72c932 When using the allow leaks hack don't even print a warning about the leak
This is only used for the test runner and in that case it just makes the test
output confusing
2011-07-28 12:23:01 -07:00
Brian Anderson
4ef1ec580a Do all runtime calls to getenv at initialization
getenv is not threadsafe and (maybe as a result) it's randomly crashing with
CFLAGS=-g and RUST_THREADS=32. Calls from rust code are still on their
own.
2011-07-28 12:23:01 -07:00
Brian Anderson
75985ab75e Remove color-related code from rust_log
This is all dead. If someone decides they want color it will be easy to redo.
2011-07-28 12:23:00 -07:00
Paul Stansifer
86f337484e Change macro syntax to accept a single expr, not a sequence of exprs. 2011-07-28 12:12:08 -07:00
Eric Holk
3d7016ae95 Updating to work on Windows. 2011-07-28 10:47:29 -07:00
Eric Holk
9618ab67ae Re-enabled the rest of the asserts and things in rust_chan.cpp 2011-07-28 10:47:29 -07:00
Eric Holk
b85dee8d5b Resurrecting some of the logging in rust_chan.cpp 2011-07-28 10:47:28 -07:00
Eric Holk
9ea8476faa Removed outdated comment. 2011-07-28 10:47:28 -07:00
Eric Holk
279844ce9f Atomic reference counting for tasks. 2011-07-28 10:47:28 -07:00
Eric Holk
a5fe66e706 Adding upcalls to to ref() and deref() tasks. This is the first step towards atomic reference counting of tasks. 2011-07-28 10:47:28 -07:00
Eric Holk
5302cde188 Made task threads wait instead of sleep, so they can be woken up. This appears to give us much better parallel performance.
Also, commented out one more unsafe log and updated rust_kernel.cpp to compile under g++
2011-07-28 10:47:28 -07:00
Eric Holk
e697a52359 Adding a function to stdlib to set the min stack size, for programs
that absolutely will not succeed with a large default stack. This
should be removed once we have stack grown working.

Also updated word-count to succeed under the new test framework.
2011-07-28 10:47:28 -07:00
Eric Holk
117e251733 Re-removing a test case that was moved during the big test suite overhaul. 2011-07-28 10:47:28 -07:00
Eric Holk
62bc6b5113 Per-thread scheduling. Closes #682.
Tasks are spawned on a random thread. Currently they stay there, but
we should add task migration and load balancing in the future. This
should drammatically improve our task performance benchmarks.
2011-07-28 10:47:28 -07:00
Eric Holk
b51f5c395c Made root_task no longer special. 2011-07-28 10:47:28 -07:00
Lindsey Kuper
c15871ac51 Test case for issue #435. 2011-07-28 10:37:46 -07:00
Jesse Ruderman
0268cb7c96 Get expr-moving fuzzer working again 2011-07-28 10:28:50 -07:00
Graydon Hoare
acac6abc85 Parse, store and print type parameter kind constraints. 2011-07-28 17:22:59 +00:00
Rob Arnold
f45ac8db07 More useful leak debugging output.
When printing out leaked allocations, print the allocation tag and address of
the returned pointer.
2011-07-28 08:28:32 -07:00
Marijn Haverbeke
1836f59d9a Disable expr-scope test, since it break windows 2011-07-28 12:02:08 +02:00
Graydon Hoare
2749ef5ede Fix stale 'copy' occurrences to 'move' in comments. 2011-07-27 23:43:17 -07:00
Josh Matthews
f0e29c92aa :: is allowed to start an expression. Close #762. 2011-07-28 02:33:24 -04:00
Marijn Haverbeke
c141718952 Replace walk with visit in the typechecker 2011-07-28 08:05:04 +02:00
Marijn Haverbeke
757b7ec534 Remove walk instance from kind.rs 2011-07-28 07:42:51 +02:00
Marijn Haverbeke
c78ac29002 Show millisecond precision for time_passes times
Closes #713
2011-07-28 07:22:16 +02:00
Graydon Hoare
a11bb404a5 Further refinement to kind system lattice and type-kind rules; first successful caught kind error (prohibits copying a pinned resource, though trans already caught it later). 2011-07-27 21:23:54 -07:00
Lindsey Kuper
7073ee4e31 Some work on backwarding for issue #702. 2011-07-27 19:43:21 -07:00
Brian Anderson
54c1c07ab1 Add std::io::stderr 2011-07-27 19:04:57 -07:00
Brian Anderson
e81d6d28e7 Don't stop at first test failure
Since compiletest is setting up its own test tasks it needs to configure them
the correct way, which means allowing them to leak.
2011-07-27 19:04:57 -07:00
Brian Anderson
51ef7a3676 Clean up output a bit when running verbose compile tests 2011-07-27 19:04:56 -07:00
Brian Anderson
90a79b9951 Print a newline before displaying test output 2011-07-27 19:04:56 -07:00
Brian Anderson
e9dd971129 Capture stderr when running compile tests. Closes #755 2011-07-27 19:04:56 -07:00
Brian Anderson
278d360525 Refactor compiletest 2011-07-27 19:04:56 -07:00
Michael Sullivan
d1298f768c Have bind support non-alias parametric non-bound arguments.
This was previously disallowed by the typechecker and not properly handled
in trans. I removed the typechecker check (replacing it with a simpler
check that spawned functions don't have type params) and fixed trans.
Closes #756.
2011-07-27 18:46:46 -07:00
Michael Sullivan
4de0b3d947 Allow already bound functions to be bound again.
This commit just disables the check. All of the real work was in previous
commits that moved the target function into the bindings part of the closure
that is tracked by the tydesc.
Closes #754.
2011-07-27 18:46:46 -07:00
Michael Sullivan
63fa765e0e Fix binding a bare fn argument with type parameters.
Closes #642.
2011-07-27 18:46:46 -07:00
Graydon Hoare
63f74f3771 Remove vestiges of "layers", insert skeletal do-nothing "kind" pass plus cached calculation of kind for each type. 2011-07-27 17:49:00 -07:00
Michael Sullivan
04611a3e56 Remove the bind-alias test, since binding to aliases is fine. 2011-07-27 16:14:57 -07:00
Brian Anderson
80d6ee9ae7 Remove task::worker harder 2011-07-27 16:07:31 -07:00
Brian Anderson
92e9382193 Remove task::worker
It was too unsafe to live. It already apeared to be causing problems with
eholk's incoming task changes, so I'm killing it now before it can spread.
2011-07-27 15:53:47 -07:00
Michael Sullivan
55a65a51aa Eliminate "target" field in closures. 2011-07-27 15:22:11 -07:00
Michael Sullivan
b977b5c508 Put the bound function in bind in the bindings, not in a distinguished spot. 2011-07-27 15:22:11 -07:00
Michael Sullivan
db19231596 Mess around with the casting in trans_bind. 2011-07-27 14:43:35 -07:00
Michael Sullivan
e3f9648096 Some cleanup in trans. 2011-07-27 14:41:08 -07:00
Michael Sullivan
1c612ebdcc Associate names with taskptr and tydesc types for better debugging. 2011-07-27 14:30:16 -07:00
Michael Sullivan
ab8d91dcfd Make trand_bind_1 use create_real_fn_pair. 2011-07-27 14:28:07 -07:00
Marijn Haverbeke
73e8e49897 More thorough check for interior-ness in str_from_ivec
Closes #750
2011-07-27 21:46:14 +02:00
Marijn Haverbeke
0186176ae9 Stop outputting spurious spaces in ivec types and empty mutable vecs
(in the pretty-printer)
2011-07-27 21:20:51 +02:00
Marijn Haverbeke
a4cf804671 (belatedly) register a new stable snapshot
This is to make it more likely that our build can be replayed/reconstructed later.
2011-07-27 20:46:08 +02:00
Brian Anderson
0923d67096 Fix comment placement in compiletest 2011-07-27 11:17:03 -07:00
Marijn Haverbeke
7647cf73d1 Another attempt at fixing fast check for the win tinderbox 2011-07-27 19:02:45 +02:00
Marijn Haverbeke
f379c97913 Don't allow globals or immutable locals to be passed by mut alias
Closes #747
2011-07-27 17:19:46 +02:00
Marijn Haverbeke
06e1d8b745 Remove superfluous spaces in pretty-printing of loops
(And extra parens around else-if tests)
2011-07-27 17:18:53 +02:00
Marijn Haverbeke
8365a79c7c Some more obj dtor reformatting 2011-07-27 17:05:34 +02:00
Marijn Haverbeke
edd1a0230e Fix nil pattern case to handle for parser adjustment 2011-07-27 16:55:49 +02:00
Marijn Haverbeke
66b84e3f55 Make the pretty-printer output whitespace before obj drop clause 2011-07-27 16:54:48 +02:00
Marijn Haverbeke
2593c50e75 Re-format some obj dtors that were messed up by the pretty-printer 2011-07-27 16:52:49 +02:00
Marijn Haverbeke
0334faef1f Improve pretty-printing of constraints
(Methods still don't seem to have constraints associated with them.
Method types do, so I guess this is a TODO.)
2011-07-27 16:50:51 +02:00
Marijn Haverbeke
30377a0d05 Fix python script for fast-check to output valid syntax 2011-07-27 16:34:35 +02:00
Marijn Haverbeke
19394a50e7 Make printing of comments inside bindings slightly less broken 2011-07-27 16:24:41 +02:00
Marijn Haverbeke
e3552da0e6 No longer allow 'case' keyword before patterns 2011-07-27 16:01:31 +02:00
Marijn Haverbeke
6e2a7bff7f Fix damage done by the pretty-printer 2011-07-27 15:54:33 +02:00
Marijn Haverbeke
df7f21db09 Reformat for new syntax 2011-07-27 15:54:33 +02:00
Marijn Haverbeke
930e2cfc74 Register transitional snapshot 2011-07-27 15:42:43 +02:00
Marijn Haverbeke
f45524d0d4 This time, I'm almost sure it'll work
(Tinderbox workaround kludge)
2011-07-27 15:19:31 +02:00
Marijn Haverbeke
66c1ca857b Update the parser to accept the new syntax 2011-07-27 15:19:31 +02:00
Marijn Haverbeke
300eb30113 Output native_name field for native mods when needed 2011-07-27 15:19:31 +02:00
Marijn Haverbeke
e9b2487db7 Have the pretty-printer parentesize unary ops when needed 2011-07-27 15:19:31 +02:00
Marijn Haverbeke
a6260ebaa2 Update the pretty-printer to output the new syntax 2011-07-27 15:19:31 +02:00
Marijn Haverbeke
557c2a380a Parenthesize ivec types as needed 2011-07-27 15:19:31 +02:00
Marijn Haverbeke
b0059bd357 Hack to make snap-stage1 actually build incompatible changes
You can't build libstd both with stage0 and stage1 if the two are incompatible

This is probably temporary
2011-07-27 15:19:31 +02:00
Marijn Haverbeke
95b926f675 Add missing case for view_item_use in resolve.rs
Closes #748
2011-07-27 10:01:21 +02:00
Brian Anderson
bcb5c4d54f Run compile tests in a way that's safe in a multithreaded environment
In theory. There's still something leaking but I hope it's no longer due to
the test runner doing unsafe things.

This is a pretty nasty patch, working around limitations in the type and task
systems, and it makes the std::test API a little uglier.
2011-07-26 18:39:55 -07:00
Brian Anderson
1c780b4203 Make the setenv tests threadsafe(ish) 2011-07-26 17:47:36 -07:00
Graydon Hoare
797cd9fd0e Try to keep the local and its type together when wrapping a long decl. 2011-07-26 16:28:16 -07:00
Graydon Hoare
4070b75914 Prohibit breaking between "let" and "=" in local decls. 2011-07-26 15:58:50 -07:00
Lindsey Kuper
e1769ab76f Clean up long strings and indentation. 2011-07-26 15:53:00 -07:00
Graydon Hoare
821c1e7a44 Trailing whitespace. 2011-07-26 15:41:43 -07:00
Graydon Hoare
7a1e656ba6 Tidy up fuzzer logic a bit. 2011-07-26 15:41:43 -07:00
Graydon Hoare
ba626779de Handle printing 'auto' occurring in loop-variable context. 2011-07-26 15:41:42 -07:00
Graydon Hoare
1c97510a16 Improve printing of mod and native mod. 2011-07-26 15:41:42 -07:00
Graydon Hoare
69f8d0e787 Handle hardbreaks at bol slightly better, including break_offset calls (tuck offset into previous hardbreak). 2011-07-26 15:41:42 -07:00
Graydon Hoare
0a69196ef3 Handle column-zero \n explicitly rather than looking for \n\n. 2011-07-26 15:41:42 -07:00
Graydon Hoare
63aa869405 Consume EOL after line comment. 2011-07-26 15:41:42 -07:00
Brian Anderson
d52169686b Dump all subprocess output to stdout when running verbose compiler tests 2011-07-26 15:36:58 -07:00
Michael Sullivan
a17735cfb5 Some simple cleanup of trans_bind. 2011-07-26 14:47:44 -07:00
Michael Sullivan
be0629d880 Convert a bunch of cx.fcx.lcx... paths into bcx_...(cx) 2011-07-26 13:02:26 -07:00
Michael Sullivan
4c17cb73a2 Add a bunch of tests for blocks. 2011-07-26 12:34:38 -07:00
Michael Sullivan
9ca0ce91bf Initial implementation of typestate for closures.
There are still things not handled properly: relying on other preconditions
of upvars is likely to cause bad things to happen. We probably want to
disallow it.
2011-07-26 12:30:14 -07:00
Michael Sullivan
166d4f5fe9 Translate anonymous block closures. 2011-07-26 12:30:14 -07:00
Michael Sullivan
ac948b4ccd Resolve and typecheck alias-environment-capturing blocks. 2011-07-26 12:30:14 -07:00
Michael Sullivan
8c8fa79312 Add block and closure protos and parse/pp block and lambda exprs. 2011-07-26 12:30:14 -07:00
Michael Sullivan
eaab0db4ea Fix the freevars pass to actually work on top of visit. 2011-07-26 12:30:14 -07:00
Brian Anderson
49a98f1508 Base scheduler threads on number of cores. Closes #739 2011-07-26 11:12:20 -07:00
Brian Anderson
e37dd2646a Clone all data before before putting it in a test closure
Putting shared boxes into a closure then running that closure in parallel
tasks seems like a recipe for refcounting disaster.

This doesn't completely fix the problems when running in parallel, but I'm
working on it.
2011-07-26 11:12:20 -07:00
Brian Anderson
f110c20609 Join the process server after running all compile tests 2011-07-26 11:12:20 -07:00
Brian Anderson
067cb6d537 Run test process from a dedicated task
This avoids a race wherein test tasks could run processes that stole the
environment of other tasks's processes.
2011-07-26 11:12:20 -07:00
Paul Stansifer
bca34d11ef Oops, left whitespace. 2011-07-26 11:11:25 -07:00
Paul Stansifer
d11c887382 Add basic support for blocks and types in macros. 2011-07-26 11:09:37 -07:00
Marijn Haverbeke
e133f929b7 Convert all code that uses walk.rs in the straightforward way to simple_visit
Code that needs the keep_going functionality is still using walk. I will
add an equivalent to visit.rs later.
2011-07-26 17:13:48 +02:00
Marijn Haverbeke
473a03a214 Add 'simple' visiting to visit.rs 2011-07-26 16:35:31 +02:00
Marijn Haverbeke
2509a3dcae Resolve loop collection expressions in the right scope
Closes #745
2011-07-26 15:52:59 +02:00
Marijn Haverbeke
41d27ddcc2 Fix win tinderbox breaking typo 2011-07-26 15:39:18 +02:00
Marijn Haverbeke
bfaa85b735 Detect duplicate field names in record literals and types
Closes #746
2011-07-26 15:32:16 +02:00
Marijn Haverbeke
2c1250780d Remove tuple support from the compiler 2011-07-26 15:19:56 +02:00
Marijn Haverbeke
bc9db454a0 Fixup test changes 2011-07-26 14:56:24 +02:00
Marijn Haverbeke
c0976ad70b Properly parse 'auto' for loop variable types 2011-07-26 14:53:01 +02:00
Marijn Haverbeke
f8968d1e71 Remove uses of tuples from the test suite 2011-07-26 14:49:40 +02:00
Marijn Haverbeke
aea537779e Remove all uses of tuples from the compiler and stdlib 2011-07-26 14:06:02 +02:00
Marijn Haverbeke
e123366bff Make the pretty-printer output new-style syntax for records 2011-07-26 10:53:24 +02:00
Marijn Haverbeke
ce808bbc6f Make the pretty-printer output new-style syntax for local decls 2011-07-26 10:40:28 +02:00
Marijn Haverbeke
252b8ffe42 Add support for new-style local decls
let x = 5;
    let y: int = 10;
    // as soon as a typestate bug is fixed:
    let x: str = foo, y <- 20u;

'auto' and 'type-first let' will soon be dropped.
2011-07-26 10:27:26 +02:00
Graydon Hoare
5ab213a464 Correct input coordinate tracking on block-opening brace. 2011-07-25 17:35:40 -07:00
Graydon Hoare
f639085a42 Tidy fuzzer a bit. 2011-07-25 17:10:08 -07:00
Graydon Hoare
1243ce271e Recognize and preserve first blank line if first line of file. 2011-07-25 17:10:08 -07:00
Brian Anderson
ac2424dd22 Run test tasks in parallel according to RUST_THREADS. Issue #734 2011-07-25 16:36:38 -07:00
Brian Anderson
2de43c220c Disable task-comm-15. Fails with multiple threads. 2011-07-25 16:34:49 -07:00
Michael Sullivan
25a89e068d Rename the block type to be blk also. Sorry. 2011-07-25 14:18:07 -07:00
Graydon Hoare
552bff8a21 Adjust pp interface to that printing a crate (an reproducing literals/comments) takes a reader, not just a filename. Fixes first big pp-fuzzer bug. 2011-07-25 14:04:49 -07:00
Graydon Hoare
5749a2deac Fix signature and add string_reader to ioivec. 2011-07-25 14:04:49 -07:00
Michael Sullivan
6bcdb48e35 Disallow block as a variable name in preparation for it becoming a keyword. 2011-07-25 13:42:38 -07:00
Brian Anderson
758c11b22c Ignore various files that are probably not tests when searching for tests
Closes #732
2011-07-25 12:20:23 -07:00
Graydon Hoare
42e57f64b7 remove datalayout from the intrinsics.ll.in file, silence linkage warning. 2011-07-25 11:50:09 -07:00
Marijn Haverbeke
19507787a9 Add support for bracey record types and literals
type foo = {mutable x: int, y: int};
    auto myfoo = {mutable x: 10, y: 20u};

The old syntax is also still supported.
2011-07-25 17:41:00 +02:00
Marijn Haverbeke
cce1b4667b Add look-ahead to parser object 2011-07-25 17:16:41 +02:00
Marijn Haverbeke
dca67f95cb Make the lexer slightly less stateful 2011-07-25 16:46:08 +02:00
Marijn Haverbeke
e949aab10a Remove some rustboot-isms
Closes #464
2011-07-25 15:07:48 +02:00
Marijn Haverbeke
48013db5c5 Tie up the ends needed to get external consts working
Closes #658
2011-07-25 14:58:59 +02:00
Marijn Haverbeke
f0be65cb50 Fix span information returned by parser::parse_seq
Its hi pos used to be the end of the token after the sequence. It now
properly reports the end of the closing token.
2011-07-25 14:04:37 +02:00
Marijn Haverbeke
beab6ba8aa Add a pass that checks for unreachable alt arms 2011-07-25 13:52:59 +02:00
Brian Anderson
bd81adabff Add task::send and task::recv 2011-07-24 16:18:31 -07:00
Brian Anderson
73fed01108 Add task::worker. Spawns a task and returns a channel to it
It takes a lot of boilerplate to create a task and establish a way to talk to
it. This function simplifies that, allowing you to write something like
'worker(f).chan <| start'. Implementation is very unsafe and only works for a
few types of channels, but something like this is very useful.
2011-07-24 16:18:05 -07:00
Brian Anderson
b82bedb28e Reindent lib-task.rs 2011-07-24 16:17:25 -07:00
Brian Anderson
2573fe7026 The Big Test Suite Overhaul
This replaces the make-based test runner with a set of Rust-based test
runners. I believe that all existing functionality has been
preserved. The primary objective is to dogfood the Rust test
framework.

A few main things happen here:

1) The run-pass/lib-* tests are all moved into src/test/stdtest. This
is a standalone test crate intended for all standard library tests. It
compiles to build/test/stdtest.stageN.

2) rustc now compiles into yet another build artifact, this one a test
runner that runs any tests contained directly in the rustc crate. This
allows much more fine-grained unit testing of the compiler. It
compiles to build/test/rustctest.stageN.

3) There is a new custom test runner crate at src/test/compiletest
that reproduces all the functionality for running the compile-fail,
run-fail, run-pass and bench tests while integrating with Rust's test
framework. It compiles to build/test/compiletest.stageN.

4) The build rules have been completely changed to use the new test
runners, while also being less redundant, following the example of the
recent stageN.mk rewrite.

It adds two new features to the cfail/rfail/rpass/bench tests:

1) Tests can specify multiple 'error-pattern' directives which must be
satisfied in order.

2) Tests can specify a 'compile-flags' directive which will make the
test runner provide additional command line arguments to rustc.

There are some downsides, the primary being that Rust has to be
functioning pretty well just to run _any_ tests, which I imagine will
be the source of some frustration when the entire test suite
breaks. Will also cause some headaches during porting.

Not having individual make rules, each rpass, etc test no longer
remembers between runs whether it completed successfully. As a result,
it's not possible to incrementally fix multiple tests by just running
'make check', fixing a test, and repeating without re-running all the
tests contained in the test runner. Instead you can filter just the
tests you want to run by using the TESTNAME environment variable.

This also dispenses with the ability to run stage0 tests, but they
tended to be broken more often than not anyway.
2011-07-24 15:34:34 -07:00
Paul Stansifer
e6e53aff63 Add --expand option to rustc to pretty-print expanded code. 2011-07-23 14:33:12 -07:00
Eric Holk
63e77a3de1 Attempt to put out burning Windows tinderbox. 2011-07-23 13:01:30 -07:00
Graydon Hoare
ad954fcecc Add an NSIS script for building a win32 installer. Closes #522. 2011-07-23 12:27:06 -07:00
Eric Holk
57459ec8ae Fixed another concurrency issue in channels. 2011-07-23 12:21:23 -07:00
Eric Holk
8878b128ba More work on word-count.
Updated the MapReduce protocol so that it's correct more often. It's
still not perfect, but the bugs repro less often now.

Also found a race condition in channel sending. The problem is that
send and receive both need to refer to the _unread field in
circular_buffer. For now I just grabbed the port lock to send. We can
probably get around this by using atomics instead.
2011-07-22 18:45:34 -07:00
Eric Holk
404d4e0528 Adding test case dealing with communication and hashmaps. 2011-07-22 18:45:34 -07:00
Eric Holk
c7e967148c Task-ified the word count program.
This meant most of the generic-ness of it had to go away, since our
type system doesn't quite support it yet. Hopefully someday...

This version has lots of memory management errors. My next commit will
hopefully fix these.
2011-07-22 18:45:34 -07:00
Michael Sullivan
0cacbe901d Overhaul how we handle freevars. 2011-07-22 17:46:52 -07:00