Commit graph

664 commits

Author SHA1 Message Date
Brian Anderson
4fc0848a49 Rename rust_list_files_ivec to rust_list_files 2011-08-12 12:14:07 -07:00
Brian Anderson
8561f7654c Remove rust_list_files from std and rt 2011-08-12 12:14:07 -07:00
Brian Anderson
d1b3ed8c3f Remove runtime vector builtins 2011-08-12 12:14:07 -07:00
Brian Anderson
533becef2f Don't export anything from std::vec 2011-08-12 12:14:07 -07:00
Brian Anderson
3d1634db15 Remove all usages of std::vec::vbuf 2011-08-12 12:14:07 -07:00
Brian Anderson
f9db0390f9 Remove last use of vec:buf 2011-08-12 12:14:07 -07:00
Brian Anderson
f9623f0056 Remove vecs from std::sha1 2011-08-12 12:14:07 -07:00
Brian Anderson
12cd11ecda Remove last uses of vec::len 2011-08-12 12:14:07 -07:00
Brian Anderson
544bdf05c5 Convert uint::parse_buf to ivecs 2011-08-12 12:14:07 -07:00
Brian Anderson
5f71a204d3 Remove vecs from std::getopts 2011-08-12 12:14:07 -07:00
Brian Anderson
8840fab822 Remove unused functions from std::vec 2011-08-12 12:14:07 -07:00
Brian Anderson
784884cc07 Remove more exports from std::vec 2011-08-12 12:14:06 -07:00
Brian Anderson
f323aeed17 Remove more vectors from std 2011-08-12 12:14:06 -07:00
Brian Anderson
0fed53921f Remove ebmlivec module 2011-08-12 12:14:06 -07:00
Brian Anderson
674fb0911c Rename std::termivec to std::term 2011-08-12 12:14:06 -07:00
Brian Anderson
495b0bf65e Remove std::term 2011-08-12 12:14:06 -07:00
Brian Anderson
7625ed52ee Remove vecs from std::sort 2011-08-12 12:14:06 -07:00
Brian Anderson
abf41e15ea Remove usages of vec:print_debug_info 2011-08-12 12:11:12 -07:00
Brian Anderson
13439dc870 Convert std::run to ivecs 2011-08-12 12:11:12 -07:00
Brian Anderson
5c042a02cd Remove vecs from std::bitv 2011-08-12 12:11:12 -07:00
Brian Anderson
72773e6d4d Hide even more exports from std::vec 2011-08-12 12:11:12 -07:00
Brian Anderson
5ed5ae8918 Remove a bunch of exports from std::vec 2011-08-12 12:11:12 -07:00
Brian Anderson
4dec0f6d96 Add reverse and reversed to std::ivec
Modify tests to use the ivec version
2011-08-12 12:11:11 -07:00
Brian Anderson
ae4c17e267 Add some of stdtest::vec into stdtest::ivec
Add missing functions to std::ivec as needed
2011-08-12 12:10:25 -07:00
Brian Anderson
9638f522bd Don't export vec::alloc, vec::refcount 2011-08-12 12:08:28 -07:00
Brian Anderson
a679ea5c3c Limit the exports from std::vec 2011-08-12 12:08:27 -07:00
Brian Anderson
7d05da96f7 Rename std::ioivec to std::io 2011-08-12 12:08:27 -07:00
Brian Anderson
0b71d1d445 Remove std::io 2011-08-12 12:08:27 -07:00
Brian Anderson
82b1e3f5cc Convert all uses of std::io to std::ioivec 2011-08-12 12:08:27 -07:00
Brian Anderson
c0846525e8 Remove a vbuf import from std::str 2011-08-12 12:08:27 -07:00
Brian Anderson
119f43e0c7 Rename str::connect_ivec to str::connect 2011-08-12 12:08:27 -07:00
Brian Anderson
21693db2a7 Remove str::connect 2011-08-12 12:08:27 -07:00
Brian Anderson
09cc957030 Convert str::concat to ivecs 2011-08-12 12:08:27 -07:00
Brian Anderson
1e397eee2a Rename str::split_ivec to str::split 2011-08-12 12:08:27 -07:00
Brian Anderson
e3e9811b7f Remove str::split 2011-08-12 12:08:27 -07:00
Brian Anderson
cfb9cba19f Convert str::from_chars, to_chars to ivecs 2011-08-12 12:08:27 -07:00
Brian Anderson
878fbac278 Remove str_from_vec runtime function 2011-08-12 12:08:27 -07:00
Brian Anderson
740196987e Rename std::str::unsafe_from_bytes_ivec to unsafe_from_bytes 2011-08-12 12:08:27 -07:00
Brian Anderson
6050e1d4f6 Remove std::str::unsafe_from_bytes 2011-08-12 12:08:27 -07:00
Brian Anderson
a9ce342fa3 Convert all uses of unsafe_from_bytes to unsafe_from_bytes_ivec 2011-08-12 12:08:26 -07:00
Brian Anderson
49b80f9bf7 Remove str::from_bytes
This is exactly the same as str::unsafe_from_bytes
2011-08-12 12:08:26 -07:00
Brian Anderson
7e255335d2 Convert str::is_utf8 to ivecs 2011-08-12 12:08:26 -07:00
Brian Anderson
2e7e58812b Remove vec version of str::bytes, rename bytes_ivec to str::bytes 2011-08-12 12:08:26 -07:00
Brian Anderson
4caeba9178 Remove vecs from the rustc driver 2011-08-12 12:08:26 -07:00
Brian Anderson
f195814df3 Begin removing vecs from #fmt 2011-08-12 12:08:26 -07:00
Michael Sullivan
8a9766000e Change a bunch of places in the stdlib to use blocks. 2011-08-12 11:47:44 -07:00
Michael Sullivan
5adaa6f956 Do some cleanup in stdlib. 2011-08-09 17:53:52 -07:00
Erick Tryzelaar
50f97cb368 Port the stdlib to the ivec type [T] syntax. 2011-08-09 15:53:26 -07:00
Erick Tryzelaar
bf7b516bdb Add newlines to the end of some files. 2011-08-09 11:29:36 -07:00
Patrick Walton
3dda9aabf2 stdlib: std::ebmlivec and std::ebml are now synonyms 2011-08-08 15:30:37 -07:00
Eric Holk
d9b84a546c Converted the rest of the task-comm-* tests over. Also fixed some
channel lifecycle bugs.
2011-08-08 08:57:52 -07:00
Eric Holk
86babab2fe Added an unsafe way to pass libchans over spawn and chans, and converted task-comm-0 to use libcomm. 2011-08-08 08:57:52 -07:00
Eric Holk
f9fd785cf5 Removing an invalid operation in the attempt to restore valgrind cleanness. 2011-08-05 17:01:06 -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
Rob Arnold
f4b87c749f Basic async IO module using libuv 2011-08-05 11:57:06 -07:00
Patrick Walton
d4fe1b3127 stdlib: Pass getopt matches by alias 2011-08-04 17:11:50 -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
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
Brian Anderson
a1a25969a0 Add ioivec::read_whole_file/read_whole_file_str 2011-08-02 10:39:14 -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
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
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
Eric Holk
939bca0d84 Added send and receive to comm library. 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
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
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
b8c209cba1 Refactor std::test
Separate the console output from the running of tests
2011-07-29 19:54:05 -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
Brian Anderson
f3df9f50ea Add ivec::from_vec and ivec::to_vec 2011-07-29 14:05:04 -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
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
Marijn Haverbeke
30d2e358be Replace obj dtors with resources in stdlib and rustc 2011-07-29 14:03:24 +02:00
Marijn Haverbeke
0ba34d873d Beginning of replacing drop with resources 2011-07-29 12:18:49 +02:00
Jesse Ruderman
56d680ab79 Make program_output also return stderr 2011-07-29 10:39:14 +02:00
Eric Holk
3d7016ae95 Updating to work on Windows. 2011-07-28 10:47:29 -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
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
90a79b9951 Print a newline before displaying test output 2011-07-27 19:04:56 -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
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
8365a79c7c Some more obj dtor reformatting 2011-07-27 17:05:34 +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
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
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
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
Marijn Haverbeke
41d27ddcc2 Fix win tinderbox breaking typo 2011-07-26 15:39:18 +02:00
Marijn Haverbeke
aea537779e Remove all uses of tuples from the compiler and stdlib 2011-07-26 14:06:02 +02:00
Brian Anderson
ac2424dd22 Run test tasks in parallel according to RUST_THREADS. Issue #734 2011-07-25 16:36:38 -07:00
Graydon Hoare
5749a2deac Fix signature and add string_reader to ioivec. 2011-07-25 14:04:49 -07:00
Marijn Haverbeke
e949aab10a Remove some rustboot-isms
Closes #464
2011-07-25 15:07:48 +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
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
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
Brian Anderson
e891e0b992 Print a list of test failures in the test summary. Issue #428 2011-07-22 10:18:28 -07:00
Brian Anderson
06a6005447 Use correct win file open constants, per MinGW 2011-07-21 18:23:15 -07:00
Michael Sullivan
4b59ae0aa9 Add some support for using a map like a set. 2011-07-21 18:14:39 -07:00
Patrick Walton
45748a3be4 rustc: Implement ptr_eq in Rust. Shaves 4 s off compile time. 2011-07-20 19:34:52 -07:00
Brian Anderson
a467e8e4e6 Add a huge hack to allow the test runner to continue if a single task leaks
This is just until unwinding works. Adds a flag to the runtime to turn
the memory leak checks on task destruction into warnings instead of fatal
errors. I am so sorry.

Issue #428
2011-07-20 10:22:18 -07:00
Brian Anderson
3fb33008ce Test runner should fail if any tests fail. Issue #428 2011-07-20 10:19:22 -07:00
Brian Anderson
c51f5f18dd Fix color term detection in std::termivec
Pretty error messages to be restored
2011-07-19 15:02:18 -07:00
Brian Anderson
a14e5e7046 Avoid double-closing pipes in std::run::start_program
Linux and mac seem fine with it, Windows does not
2011-07-19 14:01:21 -07:00
Brian Anderson
b022dde587 Refactor std::run 2011-07-19 10:15:16 -07:00
Brian Anderson
fb9a117743 Fix an invalid memory access in run_program and friends 2011-07-19 10:15:16 -07:00
Brian Anderson
7e55061def Add str::replace 2011-07-18 16:16:48 -07:00
Brian Anderson
689f5f487c Add str::is_empty, is_not_empty preds 2011-07-18 16:16:48 -07:00
Michael Sullivan
71909a64bc Fix qsort to not skip the right side when the pivot element gets put at index 0.
Closes #705.
2011-07-18 15:03:31 -07:00
Brian Anderson
cc7ae32ba1 Add setenv to standard library 2011-07-18 13:56:19 -07:00
Brian Anderson
20a3adbc08 Revert "Add setenv to standard library"
This reverts commit 6fb168b3db.
2011-07-17 19:16:18 -07:00
Brian Anderson
6fb168b3db Add setenv to standard library 2011-07-17 18:50:01 -07:00
Brian Anderson
64d43be647 Sort tests before running them. Issue #428 2011-07-16 17:58:32 -07:00
Brian Anderson
f010f79a61 Add std::ivec::to_mut, from_mut 2011-07-16 17:36:11 -07:00
Brian Anderson
8c4f1652ec Add ivec::zip/unzip 2011-07-16 17:36:11 -07:00
Brian Anderson
47052ce19e Refactor std::test 2011-07-15 10:07:32 -07:00
Brian Anderson
4a347760ed Run test functions in isolated tasks. Issue #428
Each test is run in its own task so that the failure can be trapped and the
test runner can continue. The easiest way to get the test functions into tasks
currently is by treating them as unsafe pointers.
2011-07-15 10:07:32 -07:00
Brian Anderson
7d475530a0 Remove task_unsupervise from rt builtin functions
This was an exact duplicate of the unsupervise function
2011-07-15 10:07:32 -07:00
Brian Anderson
ced8393f20 Modify task::join to indicate how the task terminated
This involves sticking yet another field into the task structure
2011-07-15 10:07:29 -07:00
Brian Anderson
01a52d728c Add an unsupervise builtin and function to std::task
Calling task::unsupervise de-parents the current task, with the result
that failures do not propogate up the task tree.
2011-07-14 17:56:59 -07:00
Brian Anderson
20e94de392 Add a flag to run ignored tests. Issue #428 2011-07-14 17:13:12 -07:00
Brian Anderson
81acf69f97 Add head and tail functions to std::ivec
They even have typestate preconditions
2011-07-14 17:13:12 -07:00
Brian Anderson
139aaa1616 Add is_empty, is_not_empty preds to std::ivec 2011-07-14 17:13:12 -07:00
Brian Anderson
b3dee95514 Add a facility for ignoring tests. Issue #428
Adding the #[ignore] attribute will cause the test not to be run, though it
will still show up in the list of tests.
2011-07-14 13:51:30 -07:00
Brian Anderson
4038010bc6 The test runner's main returns unit, not int. Issue #428
The appropriate way to indicate failure from main is to fail.
2011-07-14 10:51:38 -07:00
Graydon Hoare
39151f2ad8 Prohibit trailing whitespace under 'tidy' script. Clean up all caught cases. 2011-07-13 15:44:09 -07:00
Marijn Haverbeke
ece2d27205 Feeble attempt at putting out the win tinderbox 2011-07-13 11:36:09 +02:00
Patrick Walton
464d7c4480 stdlib: Fix vector index in linux_os::waitpid. Put out burning tinderbox. 2011-07-12 18:28:40 -07:00
Patrick Walton
13c44f99ae stdlib: Make pipe and waitpid use interior vectors 2011-07-12 17:54:27 -07:00
Patrick Walton
2e827eab24 stdlib: Port most of getopts over to interior vectors 2011-07-12 17:33:17 -07:00
Patrick Walton
3427a41272 stdlib: Add interior vector methods to sha1 2011-07-12 17:18:53 -07:00
Patrick Walton
032c4deefe stdlib: Implement ivec::count 2011-07-12 17:00:44 -07:00
Brian Anderson
ed556ab094 Improve test runner summary message. Issue #428 2011-07-12 16:54:46 -07:00
Patrick Walton
f06fdd5ca1 stdlib: Use the right upcall in win32_fs. Maybe puts out burning tinderbox? 2011-07-12 16:53:16 -07:00
Patrick Walton
ccd0fffcce stdlib: Implement str::split_ivec() 2011-07-12 16:36:47 -07:00
Patrick Walton
598b50e10a stdlib: Move fs over to interior vectors by introducing a rust_list_files_ivec builtin 2011-07-12 15:14:57 -07:00
Patrick Walton
ab579e1c9f stdlib: Port std::either over to interior vectors 2011-07-12 14:28:11 -07:00
Patrick Walton
b062bbdb8e stdlib: Switch lib::deque over to interior vectors 2011-07-12 14:28:11 -07:00
Patrick Walton
f2d847ec7a stdlib: Move bit vectors over to interior vectors 2011-07-12 14:28:11 -07:00
Patrick Walton
043096ea0a stdlib: Remove exterior vectors from termivec 2011-07-12 14:28:11 -07:00
Patrick Walton
4b23ea51bc stdlib: Remove obsolete FIXME about state fns 2011-07-12 11:36:01 -07:00
Patrick Walton
c15aa5e3a3 stdlib: EBML API fixes 2011-07-12 11:35:29 -07:00
Patrick Walton
3275cad6d5 stdlib: Implement ivec::unsafe::set_len 2011-07-12 11:35:29 -07:00
Patrick Walton
d21228fce7 stdlib: Box data in EBML documents 2011-07-12 11:35:29 -07:00
Brian Anderson
23d1520398 Support running a subset of tests from the command line. Issue #428 2011-07-11 19:01:54 -07:00
Brian Anderson
94e1b362f0 Pass command-line args to the test runner. Issue #428
This will let the test runner filter the tests it runs.
2011-07-11 19:01:53 -07:00
Tim Chevalier
67ecda6342 remove some workarounds for old bugs 2011-07-11 17:32:00 -07:00
Patrick Walton
79ce5a4614 rustc: Implement pointer dereference; add a test case 2011-07-11 15:19:16 -07:00
Patrick Walton
eef61a527d stdlib: Add addr_of() to the standard library 2011-07-11 14:25:35 -07:00
Patrick Walton
b6d774136b stdlib: Add interior vector-ified versions of ebml and term 2011-07-11 14:25:34 -07:00
Brian Anderson
64ad5928e7 Actually run tests from the std runner. Issue #428 2011-07-11 11:19:32 -07:00
Marijn Haverbeke
86ee3454a1 Implement or-patterns in case clauses
You can now say

    expr_move(?dst, ?src) | expr_assign(?dst, ?src) { ... }

to match both expr_move and expr_assign. The names, types, and number
of bound names have to match in all the patterns.

Closes #449.
2011-07-11 11:01:54 +02:00
Jesse Ruderman
fa78fee4de Add uint::min 2011-07-10 17:05:25 -07:00
Patrick Walton
18ebef5bba stdlib: Remove FIXME that's more like a WONTFIX 2011-07-10 15:35:06 -07:00
Patrick Walton
4008cad044 stdlib: Remove the cast from ioivec 2011-07-10 13:22:29 -07:00
Patrick Walton
7871b55597 stdlib: Implement an interior-vector version of the io module 2011-07-10 12:47:51 -07:00
Patrick Walton
875c4622fb stdlib: Implement str::bytes_ivec() using pointers and casts 2011-07-10 02:05:52 -07:00
Patrick Walton
91dcc1d054 stdlib: Add missing unsafe.rs. Puts out burning tinderbox. 2011-07-10 01:32:35 -07:00
Patrick Walton
0babfd9f98 stdlib: Add unsafe to the std.rc, now that it actually builds 2011-07-10 01:24:31 -07:00
Patrick Walton
d30f22eb65 rt: Remove the _2 prefix from intrinsics; all rust-intrinsics now use explicit return pointers 2011-07-10 01:20:18 -07:00
Patrick Walton
f42c94740a rustc: Make rust-intrinsics take an explicit return pointer 2011-07-09 21:13:25 -07:00
Brian Anderson
75047ea87e Generate code to load a crate's tests into the std test runner. Issue #428 2011-07-09 19:30:04 -07:00
Brian Anderson
09982784c6 Begin adding some test runner types to std. Issue #428 2011-07-09 16:08:03 -07:00
Patrick Walton
91d45b91e6 stdlib: Implement str::unsafe_from_bytes_ivec() 2011-07-08 22:23:11 -07:00
Patrick Walton
aa0f6f4961 stdlib: Add an offset function for simple pointer arithmetic on unsafe pointers 2011-07-08 21:56:15 -07:00
Patrick Walton
ccfbb74f11 rustc: Move maps over to interior vectors 2011-07-08 16:37:43 -07:00
Eric Holk
79ca673af7 Adding more support for working with u64s. 2011-07-08 14:02:26 -07:00
Patrick Walton
0864a22ace stdlib: Add an interior vector version of union-find for now 2011-07-08 11:44:38 -07:00
Patrick Walton
deca79f372 Merge pull request #634 from robarnold/upstream-stable
Allocate ivecs out of the kernel pool
2011-07-07 15:18:07 -07:00
Marijn Haverbeke
3bdbf74d47 Make moving of temporaries do the right thing, use it to optimize
This adds support for dropping cleanups for temporary values when they
are moved somewhere else. It then adds wraps most copy operations
(return, put in data structure, box, etc) in a way that will fall back
to a move when it is safe.

This saves a lot of taking/dropping, shaving over a megabyte off the
stage2/rustc binary size.

In some cases, most notably function returns, we could detect that the
returned value is a local variable, and can thus be safely moved even
though it is not a temporary. This will require putting some more
information in lvals.

I did not yet handle function arguments, since the logic for passing
them looked too convoluted to touch. I'll probably try that in the
near future, since it's bound to be a big win.
2011-07-07 15:54:01 +02:00
Rob Arnold
f6117173c9 Allocate rust_ivec buffers out of the kernel pool
The duplication of upcalls is due to the fact that the runtime is
shared between stage0/rustc and stage1/rustc. Once snapshots are
updated, they should be de-duplicated.
2011-07-06 20:41:24 -07:00
Patrick Walton
1bba585044 stdlib: Implement ivec::foldl 2011-07-05 18:29:47 -07:00
Patrick Walton
8261d2e6fb stdlib: Add filter_map to ivec 2011-07-05 17:22:02 -07:00
Patrick Walton
ee5d7bbc86 stdlib: Don't have ivec::map take a mutable alias 2011-07-05 16:28:07 -07:00
Patrick Walton
1980a2db53 stdlib: Add str::connect_ivec() temporarily 2011-07-05 16:02:02 -07:00
Patrick Walton
219cd4b21f stdlib: Change ivec::rustrt::ivec_on_heap() to use a 32-bit return value 2011-07-05 15:34:50 -07:00
Marijn Haverbeke
6fd6fdea93 Move everything syntax-related to syntax/, break deps on rest of compiler
src/comp/syntax is currently just a sub-module of rustc, but it will,
in the near future, be its own crate. This includes:

 - The AST data structure
 - The parser
 - The pretty-printer
 - Visit, walk, and fold
 - The syntax extension system
 - Some utility stuff that should be in the stdlib*

*) Stdlib extensions currently require a snapshot before they can be
   used, and the win build is very broken right now. This is temporary
   and will be cleaned up when one of those problems goes away.

A lot of code was moved by this patch, mostly towards a more organized
layout. Some package paths did get longer, and I guess the new layout
will take some getting used to. Sorry about that!

Please try not to re-introduce any dependencies in syntax/ on any of
the other src/comp/ subdirs.
2011-07-05 15:57:21 +02:00
Patrick Walton
001397da3c stdlib: Add ivec::any() and ivec::all(); put out burning tinderbox 2011-07-04 23:52:47 -07:00
Patrick Walton
f71c8dd918 stdlib: Implement interior vector map 2011-07-04 22:48:42 -07:00
Patrick Walton
d3a4102bc1 stdlib: Add an inefficient implementation of ivec::pop 2011-07-04 21:20:18 -07:00
Patrick Walton
b4465aca5a stdlib: Fix long line in sort.rs 2011-06-30 22:21:30 -07:00
Patrick Walton
4c76bfdc1f stdlib: Add an interior vector version of sort and a test case 2011-06-30 19:09:52 -07:00
Brian Anderson
64d6081429 Use attributes for conditional compilation in std.rc 2011-06-30 14:13:49 -07:00
Tim Chevalier
a0cdb23892 Get rid of an unused variable 2011-06-30 12:37:30 -07:00
Eric Holk
b4a145e60f Added a nanosecond timer to time.rs, support for some floating point casts, and a commandline-driven mode for pfib.rs 2011-06-30 11:32:10 -07:00
Eric Holk
63dcd325b9 Adding support for pinning tasks to the currently running thread. Closes #598. 2011-06-29 18:47:47 -07:00
Lindsey Kuper
9155544a5a Comments. 2011-06-28 18:54:56 -07:00
Graydon Hoare
d79330de26 Fix logic bug in std::fs::dirname. 2011-06-28 17:24:30 -07:00
Brian Anderson
a83b64d15d Rework how linkage attributes are determined
The meta items within a crate's link attribute are used in linkage:

 #[link(name = "std",
        vers = "1.0",
        custom = "whatever")];

Name and vers are treated specially, and everything else is hashed together
into the crate meta hash.

Issue #487
2011-06-28 15:25:47 -07:00
Patrick Walton
7554423423 stdlib: Remove old botch from ufind 2011-06-28 14:16:09 -07:00
Paul Stansifer
c3901cdf8e Add simple syntax extension (#simplext) 2011-06-28 15:02:12 +00:00
Rafael Ávila de Espíndola
ecc080ed0b Use "" in the native_name as an indication that no extra options have to
be passed to the "linker". Use that for libc.
2011-06-28 08:21:13 -04:00
Rafael Ávila de Espíndola
ac081c30be Record and link with used native libraries. 2011-06-27 15:24:44 -04:00
Tim Chevalier
582e1f13f0 Invalidate constraints correctly after an assignment expression
Modified typestate to throw away any constraints mentioning a
variable on the LHS of an assignment, recv, assign_op, or on
either side of a swap.

Some code cleanup as well.
2011-06-24 22:36:53 -07:00
Marijn Haverbeke
d507d5fe91 Remove res idents from stdlib 2011-06-24 21:13:26 +02:00