Commit graph

5033 commits

Author SHA1 Message Date
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
Michael Sullivan
2bf50114eb Simple cleanup of the freevars pass. 2011-07-22 17:46:52 -07:00
Michael Sullivan
f2f8943a85 Add a "fake" def_upvar and mechanisms to create it. 2011-07-22 17:46:52 -07:00
Paul Stansifer
e18d70fe12 Implement Macro By Example. 2011-07-22 16:53:43 -07:00
Eric Holk
4a6ccf3b0f Adding test case for #687.
The test no longer repros after a lot of my recent channel work.

Closes #687.
2011-07-22 16:22:20 -07:00
Eric Holk
54be5b044f Fixing (or at least improving) translation of move semantics for send and receive. This let's us run all of the task-comm tests. 2011-07-22 16:05:51 -07:00
Eric Holk
75ee817713 Fixing a use of uninitialized memory error in valgrind. 2011-07-22 16:05:51 -07:00
Eric Holk
838511e3aa Folding recv_val into trans_recv, since this is its only use. 2011-07-22 16:05:51 -07:00
Lindsey Kuper
e71f261e3f Exercise self-calls and overriding together a bit more. 2011-07-22 13:29:46 -07:00
Lindsey Kuper
fefeebce24 Getting rid of obsolete comments. 2011-07-22 13:10:44 -07:00
Eric Holk
898083f8fc Commenting out the huge-memory-using lines in pfib. 2011-07-22 11:55:07 -07:00
Marijn Haverbeke
5cdb010fae Remove typechecker work-arounds now that I know how 2011-07-22 20:15:46 +02:00
Brian Anderson
07732545d2 Add xfail-stage3 directives to tests
The new test runners run stage 3
2011-07-22 10:18:28 -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
Marijn Haverbeke
b9b674abe7 Start adding support for multiple variable declarations per stmt
This adds parser support and most of the machinery for

    auto x = 10, y = 20;

However, the above still goes wrong somewhere in typestate, causing
the state checker to believe only the last variable in the list is
initialized after the statement.

Tim, if you have a moment, could you go over the changes to the tstate
code in this patch and see where I'm going wrong?

Multi-var-decls without the typestate extension

Add a loop
2011-07-22 17:51:26 +02:00
Marijn Haverbeke
b45d973552 Rewrite trans_cast, float->float and float->int casts 2011-07-22 13:10:59 +02:00
Marijn Haverbeke
5864d4e13a Report unresolved names only once per function
Closes #708
2011-07-22 11:38:30 +02:00
Marijn Haverbeke
bc33897525 Revert "Enable run-pass/lib-run on win32. Closes #714"
This reverts commit 1348a383c3.

Seems that this test is still broken on win.
2011-07-22 09:59:27 +02:00
Marijn Haverbeke
93ffed4c16 Fix unboxing in alias pass
The alias checker would only deref once for autoderef, and only deref
boxes. It should now do the right thing. Closes #725.
2011-07-22 09:29:01 +02:00
Brian Anderson
1348a383c3 Enable run-pass/lib-run on win32. Closes #714 2011-07-21 19:52:27 -07:00
Brian Anderson
ed25dfe2ca Disable run-pass/lib-io.rs on mac 2011-07-21 19:36:55 -07:00
Lindsey Kuper
5566e0c3f1 Removing unnecessary argument from process_fwding_mthd(). 2011-07-21 18:41:30 -07:00
Brian Anderson
06a6005447 Use correct win file open constants, per MinGW 2011-07-21 18:23:15 -07:00
Michael Sullivan
a0a2cee896 Clean up build_environment by having it return a rec with usefully named fields. 2011-07-21 18:19:07 -07:00
Michael Sullivan
4170390cb6 Add some useful functions to freevars. 2011-07-21 18:18:59 -07:00
Michael Sullivan
4b59ae0aa9 Add some support for using a map like a set. 2011-07-21 18:14:39 -07:00
Michael Sullivan
f3149b2f57 Merge branch 'use-new-rustrt' 2011-07-21 18:00:02 -07:00
Michael Sullivan
bdbac006dc Build the stage1 compiler against the newly built librustrt. 2011-07-21 17:55:47 -07:00
Michael Sullivan
3b2d23b2cd Move a bunch of trans into trans_common, including the context structures.
Probably more should be moved or split off into other files. My algorithm
was something along the lines of: move the contexts and their transitive
dependencies along with some functions to work with them. I stopped when
I was going to have to start pulling glue generation, which really
should go into a trans_glue file.
2011-07-21 17:39:06 -07:00
Michael Sullivan
f8bb5a3b58 Make ty::ctxt be boxed.
Arguably we should leave ty_ctxt as a bare rec and just always work with
boxes of it. This winds up being simpler and prettier, though.
2011-07-21 17:39:06 -07:00
Tim Chevalier
a9a1392b2c Instantiate function preconditions inside the function body
so that if we have a function like:
f(...) : p(x) {
  ...
}

p(x) is true inside the body of f.

Closes #694.
2011-07-21 16:11:34 -07:00
Tim Chevalier
2261ddc717 Move ast_constr_to_constr from typeck to ty
so that it can be used in places that import ty.
2011-07-21 16:09:55 -07:00
Michael Sullivan
c62a9fec77 Grab librustrt.so instead of lib/librustrt.so in the snapshot. 2011-07-21 16:09:10 -07:00
Lindsey Kuper
075a094c1f Now with more type inference. 2011-07-21 15:46:03 -07:00
Lindsey Kuper
451e438ed0 Un-xfail tests. 2011-07-21 15:28:00 -07:00
Lindsey Kuper
879b6392d9 Comments and cleanup. 2011-07-21 15:12:27 -07:00
Lindsey Kuper
8ebd292253 Consolidate obj_field_from_anon_obj_field(). 2011-07-21 15:12:27 -07:00
Lindsey Kuper
55acc737a8 Remove vestiges of typarams from anon objs. 2011-07-21 15:12:27 -07:00
Michael Sullivan
f33309502a Bump the stack size and make the RUST_MIN_STACK env variable accept hex values. 2011-07-21 14:05:51 -07:00
Michael Sullivan
d9286c8bdd Build stage0/lib/libstd.so using the stage0 compiler.
This essentially starts the bootstrapping one step earlier by building
the stdlib from source using the stage0 compiler and then using that
stdlib to build the stage1 compiler. (Instead of starting by building
the stage1 compiler and then building a stdlib with it).

This means we should now be able to add features to the stdlib and use
them in the compiler without having to do a snapshot. (On the flip
side, this means that we now need to do a snapshot if we want to use a
new language feature in the stdlib, but that doesn't really seem too
burdensome (we already need to snapshot if we want to use a new
language feature in the compiler)).
2011-07-21 12:15:36 -07:00
Eric Holk
d79afd7916 Improving move semantics for channel operations.
This lets us un-XFAIL task-comm-10.rs.
2011-07-21 11:51:22 -07:00
Eric Holk
3ae4dcd41e Lots of work on memory tracking and channels.
We're trying to get closer to doing correct move semantics for channel
operations. This involves a lot of cleanup (such as removing the
unused sched parameter from rust_vec constructor) and making
circular_buffer kernel_owned.

Added tagging for memory allocations. This means we give a string tag
to everything we allocate. If we leak something and TRACK_ALLOCATIONS
is enabled, then it's much easier now to tell exactly what is leaking.
2011-07-21 11:51:22 -07:00
Patrick Walton
a44fb04d57 Revert "rustc: Avoid SHA-1 hashing every type, since they're interned"
This reverts commit df90f57a5f.
2011-07-21 11:44:12 -07:00
Patrick Walton
b49bdad499 rustc: Box raw types. Shaves about 5 seconds off compilation. 2011-07-21 11:43:52 -07:00
Patrick Walton
df90f57a5f rustc: Avoid SHA-1 hashing every type, since they're interned 2011-07-21 11:24:20 -07:00
Marijn Haverbeke
c32f525f73 Make the pretty-printer output paren-free and case-free code
We should probably do another pretty-printing pass soon.
2011-07-21 15:37:14 +02:00
Patrick Walton
45748a3be4 rustc: Implement ptr_eq in Rust. Shaves 4 s off compile time. 2011-07-20 19:34:52 -07:00
Patrick Walton
355f77ef87 rustc: Remove cnames for now 2011-07-20 19:13:55 -07:00
Patrick Walton
3ec3b02ed0 rustc: Strip cnames before generating glue to avoid duplicates 2011-07-20 19:04:45 -07:00
Patrick Walton
142ff3bb4e rustc: Translate functions only once 2011-07-20 18:43:05 -07:00
Michael Sullivan
1b9dbcc5b4 Box the vec of freevars we store in the freevars cache. 2011-07-20 18:15:56 -07:00
Michael Sullivan
430cafbe50 Use new snapshot. 2011-07-20 17:48:16 -07:00
Tim Chevalier
8a7f2e0fe5 Parse nil literals (including in patterns)
Closes #622.
2011-07-20 16:02:53 -07:00
Lindsey Kuper
431cb9a345 Test method overriding a little more. 2011-07-20 15:49:33 -07:00
Lindsey Kuper
336949a590 Test case for issue #718. 2011-07-20 15:47:29 -07:00
Lindsey Kuper
7a919da04e Method overriding tests suddenly pass valgrind for some reason.
I'm not sure if this is because of changes to glue generation in the
last few days while I've been working on other things, or if it's a
side effect of the improvements I made to typechecking for anonymous
objects, or something else, but I guess I'll take it!

Closes issue #543.
2011-07-20 12:49:54 -07:00
Lindsey Kuper
94f2a7b9a7 'Overriding' is a more accurate name than 'overloading' for these. 2011-07-20 12:22:55 -07:00
Lindsey Kuper
00f54b4a42 Refactoring and cleaning up. 2011-07-20 12:22:55 -07:00
Rafael Ávila de Espíndola
94c91382cd Fix typo. 2011-07-20 15:14:13 -04:00
Rafael Ávila de Espíndola
b7a7120804 give rust_metadata internal linkage but mark it as used. This allows
multiple static crates to be used.
2011-07-20 14:55:01 -04: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
Tim Chevalier
41212792c6 Add missing case in tyencode for ty_constr
Fixes the Windoze breakage, I hope.
2011-07-19 20:16:03 -07:00
Michael Sullivan
1a2a8b6b17 Have fn_to_str use proto_to_str. 2011-07-19 20:11:48 -07:00
Lindsey Kuper
2eb4762936 Typechecking self-calls in anon objs. Closes #540. 2011-07-19 19:52:21 -07:00
Lindsey Kuper
64fb39cdd3 Clean up formatting. 2011-07-19 19:52:21 -07:00
Tim Chevalier
bd4aeef78b Beginnings of support for constrained types
Programs with constrained types now parse and typecheck, but
typestate doesn't check them specially, so the one relevant test
case so far is XFAILed.

Also rewrote all of the constraint-related data structures in the
process (again), for some reason. I got rid of a superfluous
data structure in the context that was mapping front-end constraints
to resolved constraints, instead handling constraints in the same
way in which everything else gets resolved.
2011-07-19 18:57:28 -07:00
Michael Sullivan
da2a7e5bd2 Simple refactoring in the pretty printer.
Introduce a proto_to_str function to find the string representation of a given
proto instead of casing on the proto in multiple places.
2011-07-19 18:30:08 -07:00
Brian Anderson
9bd945639b Register new snapshots
Update snapshot scripts to complete transition of intrinsics.bc to lib dir
2011-07-19 18:26:08 -07:00
Brian Anderson
0ff76eb41f Update snapshot scripts for new location of intrinsics.bc 2011-07-19 17:22:32 -07:00
Brian Anderson
652214d7f9 Fix calculation of sizeof boxed ivec of str in rt. Closes #712 2011-07-19 16:55:45 -07:00
Lindsey Kuper
19a17b3d1d Style and indentation cleanups. 2011-07-19 16:08:49 -07:00
Brian Anderson
00e017f60e Disable run-pass/lib-run on win32. Issue #714
Trying to get the tinderbox green again. Will pursue later.
2011-07-19 15:55:15 -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
Lindsey Kuper
18162d3261 Some progress on issue #540. 2011-07-19 14:30:53 -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
Lindsey Kuper
a33bc56e43 Reduced test case for issue #540. 2011-07-19 12:48:06 -07:00
Lindsey Kuper
a0c6d0a27f Comments and cleanup. 2011-07-19 12:33:45 -07:00
Lindsey Kuper
61ee22dc84 Wrapping long strings. 2011-07-19 12:33:45 -07:00
Brian Anderson
9334fb4459 Remove cwriter.rs
This file isn't actually in the crate
2011-07-19 12:13:06 -07:00
Michael Sullivan
f8c6d282f8 Add a pass that finds all of the free variables. 2011-07-19 12:01:14 -07:00
Michael Sullivan
c4bcd0a44d Move collect_upvars into its own file. 2011-07-19 12:01:13 -07:00
Patrick Walton
2e6197aa95 rustc: Report how much time was spent to translate each function when --stats is on 2011-07-19 11:57:15 -07:00
Erick Tryzelaar
b82c9c9e79 xfail simple-qsort.rs test at stage0. 2011-07-19 11:39:04 -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
Marijn Haverbeke
a0ab57b3f6 Fix trans_alt to handle unreachable branches without blowing up 2011-07-19 17:07:51 +02:00
Patrick Walton
ce3d6339e0 rustc: Translate locals in DPS style 2011-07-18 18:28:36 -07:00
Patrick Walton
242ec22032 rustc: Remove obsolete TODO 2011-07-18 18:02:11 -07:00
Patrick Walton
07a68df3b7 rustc: Skip null when translating string concatenation 2011-07-18 18:00:45 -07:00
Patrick Walton
08eabde97b rustc: First stab at implementing interior vector concat in the DPS engine 2011-07-18 17:43:24 -07:00
Lindsey Kuper
7d4903544e Don't use 'obj_info' as an identifier for things not of type obj_info. 2011-07-18 17:05:41 -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
Lindsey Kuper
b6fc86ae5a Sane error message for self-call in non-obj context. Closes #707. 2011-07-18 15:58:36 -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
ad1c0e6308 Reformulate x86stdcall test so it works with check-fast
Hopefully this puts out the burning win32 tinderbox
2011-07-18 14:59:44 -07:00
Brian Anderson
b78eee8732 Fix native-type-mismatch test on win32 2011-07-18 13:56:19 -07:00
Brian Anderson
cc7ae32ba1 Add setenv to standard library 2011-07-18 13:56:19 -07:00
Brian Anderson
c40d6265ce Support x86 stdcall convention
This allows rust to call the Win32 API
2011-07-18 13:56:15 -07:00
Patrick Walton
682875929e rustc: Stub binary operator translation 2011-07-18 00:24:21 -07:00
Patrick Walton
437b776100 rustc: Simplify the destination format in the DPS backend; optimize aliases to interior strings to require no allocation at all 2011-07-17 22:30:13 -07:00
Brian Anderson
09ca57adb0 Revert "Revert "Rename Passes2.cpp to Passes.cpp""
This reverts commit 52507f406e.
2011-07-17 19:16:23 -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
52507f406e Revert "Rename Passes2.cpp to Passes.cpp"
This reverts commit c18127b913.
2011-07-17 19:15:27 -07:00
Brian Anderson
6fb168b3db Add setenv to standard library 2011-07-17 18:50:01 -07:00
Brian Anderson
c18127b913 Rename Passes2.cpp to Passes.cpp
The original Passes.cpp is dead so Passes2 gets promoted
2011-07-17 14:57:28 -07:00
Brian Anderson
13f5de0671 Remove Passes.cpp from rustllvm
Upstreamed
2011-07-17 14:57:28 -07:00
Brian Anderson
b7699b7889 Remove Object.h from rustllvm
This file appears to be upstream now
2011-07-17 14:57:28 -07:00
Patrick Walton
22db8b1d53 rustc: Use memmove instructions more aggressively in DPS mode. LLVM converts these to optimized block transfer instructions, significantly reducing code size. 2011-07-17 14:02:39 -07:00
Brian Anderson
4b7884e1fa Removing error logging from test 2011-07-16 19:56:12 -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
a52c3e0444 Remove unused variable from test tests 2011-07-16 16:48:33 -07:00
Josh Matthews
a411c865b2 Make clear the differentiation between char pos and byte pos in filemaps. Fix up error printing for files with multi-byte characters. 2011-07-16 15:57:24 -07:00
Josh Matthews
3ce43f37d2 Fix pre-existing problem with filemap line positions always starting at 0. Fix error line output to only retrieve up to the nearest newline. 2011-07-16 15:56:31 -07:00
Josh Matthews
a5ac8f16db Use the actual start position of the file in the codemap rather than the position of the first newline. 2011-07-16 15:56:31 -07:00
Josh Matthews
63598248e4 Reenable error line printing. 2011-07-16 15:56:31 -07:00
Josh Matthews
df74f2cde9 Fix error line display slicing. 2011-07-16 15:56:28 -07:00
Patrick Walton
652da4ca55 rustc: Implement immediates in the DPS engine; it should now always be at least as efficient as the original engine (and typically much more). 2011-07-16 10:54:12 -07:00
Patrick Walton
88574c3cea rustc: Implement interior string logging in DPS 2011-07-15 18:37:57 -07:00
Patrick Walton
f6f7f61908 rustc: Implement logging in DPS 2011-07-15 18:00:59 -07:00
Lindsey Kuper
69abf0a5ff Revised plan of attack for backwarding functions. 2011-07-15 17:23:20 -07:00
Patrick Walton
0bd7b803f6 rustc: Translate literals in DPS style; no constification of strings yet. 2011-07-15 16:40:55 -07:00
Patrick Walton
6e114a367f rustc: Write names of local variables into the LLVM IR when debug mode is on 2011-07-15 16:40:55 -07:00
Graydon Hoare
fafb42e6b1 Merge the stage1,2,3.mk files into a common definition in stageN.mk, more rearrangement of host/target libs. 2011-07-15 16:16:51 -07:00
Lindsey Kuper
c4265209a6 More tests for anonymous objects. Issues #702, #703. 2011-07-15 15:33:40 -07:00
Michael Sullivan
c610d027d9 gather_locals shouldn't descend down into fns and items. 2011-07-15 14:42:59 -05:00
Michael Sullivan
7caf8a0929 Convert gather_locals to use visit. 2011-07-15 14:24:09 -05:00
Patrick Walton
9fadab64a2 rustc: Introduce a stub destination-passing-style translation engine, accessible via the --dps switch for now 2011-07-15 11:38:46 -07:00
Patrick Walton
917afa4cc9 rustc: Remove a bunch of exterior vectors 2011-07-15 11:38:46 -07:00
Lindsey Kuper
a716eb28ec Getting rid of unnecessary casts for objects.
Now that all objects are of rust_object_type in the wake of the LLVM
type system rewrite, we don't need this cast anymore.
2011-07-15 10:55:31 -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
f634ab45bc Add task_unsupervise to rustrt.def.in 2011-07-14 19:14:36 -07:00
Brian Anderson
ed6f9bb677 Add tests for unsupervise 2011-07-14 18:50:22 -07:00
Brian Anderson
c99e110119 Modify upcall_fail so that failing tasks relinquish control to the scheduler
This is sufficient to let unsupervised tasks that don't allocate fail without
crashing or leaking.
2011-07-14 18:49:18 -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
4738cf83b0 Move the responsibility for process failure from tasks to the scheduler
When the root task fails the process fails. Failures on other tasks propagate
up the task tree. Failures on non-root tasks without parents just
(theoretically) unwind and disappear.
2011-07-14 17:44:39 -07:00
Eric Holk
827e300485 refactor: Move the task and communication-related translation functions to a new module. 2011-07-14 17:33:28 -07:00
Graydon Hoare
37b879bdf7 Fix fuzzer to compile with ivec-ized pp module. 2011-07-14 17:27:36 -07:00
Michael Sullivan
e9a6fc94d5 Make collect_upvars know about function args.
Closes #697.
2011-07-14 19:18:56 -05:00
Michael Sullivan
a3301f74f9 Generalize collect_upvars to work over any type of ast node. 2011-07-14 19:18:56 -05: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
Eric Holk
8afb1a7c63 refactor: Move the LLVM type and constant constructors into a new module. 2011-07-14 17:08:45 -07:00
Michael Sullivan
e2fcd29bbd Consolidate some arguments in typeck by just passing the record they came from. 2011-07-14 18:45:55 -05:00
Michael Sullivan
53c4cb6a2f Factor out build_environment's code to find a variable in a function context. 2011-07-14 18:45:02 -05:00
Michael Sullivan
759317ca8b Factor out closure construction from trans_for_each. 2011-07-14 18:45:01 -05:00
Michael Sullivan
0957525cc6 Fix array out of bounds index in load_environment.
Closes #696.
2011-07-14 18:34:43 -05:00
Patrick Walton
1a6419bd73 rustc: Move metadata::encoder over to interior vectors 2011-07-14 15:39:35 -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
Graydon Hoare
49da7da441 Fix long line. 2011-07-14 12:55:17 -07:00
Rafael Ávila de Espíndola
c124a025bf Move rustc to the new llvm type system. Requires an update to llvm trunk. 2011-07-14 15:19:17 -04:00
Patrick Walton
be489ee9e2 rustc: Move much of metadata reading over to interior vectors 2011-07-14 12:00:48 -07:00
Patrick Walton
4664b67ea2 snap: Register new snapshots 2011-07-14 11:54:35 -07:00
Patrick Walton
e76f44453b rustc: First stab at interior string literals, untested as of yet 2011-07-14 11:47:20 -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
Brian Anderson
f4beac4a43 Revert "Allow main to return int"
This reverts commit 8c94d8fd54.

There's no mechanism to actually return the value from main, so all this does
is allow main -> int to compile. Per #688, the program returns non-zero on
failure, so it's not obvious that this change is appropriate at this time.
2011-07-14 10:37:28 -07:00
Brian Anderson
fc67dddb9b XFAIL some tests in stage 0 2011-07-14 10:27:02 -07:00
Brian Anderson
8d2706cca8 Flag --test implies '--cfg test'. Issue #428
So certain code can be conditionally compiled only when building for testing
2011-07-14 10:27:02 -07:00
Rafael Ávila de Espíndola
7376e751ae Keep a pointer to rust_object_type. 2011-07-14 12:07:51 -04:00
Rafael Ávila de Espíndola
40f617390d Main part of the type system rewrite:
Change the type of all objects to be { {}*, {}* }.
2011-07-14 00:34:45 -04:00
Brian Anderson
8c94d8fd54 Allow main to return int 2011-07-13 19:22:53 -07:00
Tim Chevalier
f26ca025de Make resolve and the typechecker check for a main fn of the
correct type

This means if a non-library program leaves out the main program,
the error gets caught earlier than link.

Closes #626.
2011-07-13 18:30:53 -07:00
Patrick Walton
196753e4c3 rustc: Remove some interior vectors from ty, except the ones that I think were causing crashes before 2011-07-13 17:39:33 -07:00
Rafael Ávila de Espíndola
c94fc7aad8 Small cleanups that were missing in the last patch. 2011-07-13 20:21:17 -04:00
Graydon Hoare
b9635df6fe Slight enhancements to round-trip code (run kdiff3 on mismatch, remove hard-wired input dir) 2011-07-13 17:15:31 -07:00
Jesse Ruderman
7885bdc575 Add issue numbers 2011-07-13 17:15:31 -07:00
Jesse Ruderman
156458b3f6 Fuzzer: test round trips through the pretty printer and parser 2011-07-13 17:15:31 -07:00
Rafael Ávila de Espíndola
9036758191 Next step in the type system change. Add task_type to the context. 2011-07-13 20:07:16 -04:00
Patrick Walton
2a3ab10f20 rustc: Remove exterior vectors from resolve again
This reverts commit 6390c43dc4.
2011-07-13 16:44:39 -07:00
Rafael Ávila de Espíndola
3d353f76a9 First step in the typesystem rewrite:
Create the typedesc type in one place. That is where it will be named.
2011-07-13 19:37:19 -04:00
Graydon Hoare
39151f2ad8 Prohibit trailing whitespace under 'tidy' script. Clean up all caught cases. 2011-07-13 15:44:09 -07:00
Tim Chevalier
04b239f3cb Use more precise spans in error messages for bad FRU exprs
The type error message for an expression using FRU where a field
expression had the wrong type was using the span for the entire
expression. Fixed it to use the span for the individual field.

Closes #628.
2011-07-13 15:30:30 -07:00
Tim Chevalier
6b86dcde67 Add test case from issue #675. The previous fix actually fixes this too. 2011-07-13 15:04:29 -07:00
Tim Chevalier
5e1a6dac44 Parse nullary ret correctly
ret is similar to fail: if not followed by an expression, it
should be parsed as a ret without an argument. The old version would
fail if ret was followed by a close paren (for example). Fixed it.

Closes #676.
2011-07-13 15:00:59 -07:00
Tim Chevalier
0c913e63d9 Add some missing cases to token::can_begin_expr 2011-07-13 15:00:23 -07:00
Graydon Hoare
d39f84d8ec Trim a few more fail(1)s, not sure how they slipped past. 2011-07-13 14:04:38 -07:00
Graydon Hoare
336a4df778 Remove 'Nop.' comments, add emacs lines, remove obsolete file. 2011-07-13 14:03:18 -07:00
Graydon Hoare
49116adbe9 Fix compile-command lines in rt. 2011-07-13 13:51:20 -07:00
Graydon Hoare
2e2951305d Remove obsolete nargs counts from runtime. 2011-07-13 13:43:35 -07:00
Graydon Hoare
01fc165517 Attempt to correct buggy win32 timer code (causing tinderbox failures). 2011-07-13 12:25:36 -07:00
Marijn Haverbeke
ece2d27205 Feeble attempt at putting out the win tinderbox 2011-07-13 11:36:09 +02:00
Marijn Haverbeke
8d68b0462a Refactor out some repetetive code in trans_alt 2011-07-13 11:33:46 +02:00
Marijn Haverbeke
be4f7354b4 Add box patterns
An @ can now be prepended to a pattern to unbox something during
pattern matching.

Closes #661
2011-07-13 11:11:43 +02:00
Marijn Haverbeke
6cb5c0980a box patterns, expect for the trans part 2011-07-13 10:50:16 +02:00
Marijn Haverbeke
6914d32acc Do not allow moving out of obj fields, properly check move inits
Closes #591
2011-07-13 10:23:13 +02:00
Patrick Walton
729fa81d3b Revert "rustc: Remove some exterior vectors from ty.rs"
This reverts commit 01ea0647bb.
2011-07-12 18:47:26 -07:00
Patrick Walton
6390c43dc4 Revert "rustc: Remove exterior vectors from resolve"
This reverts commit 0ffe8c81c3.
2011-07-12 18:42:58 -07:00
Patrick Walton
79ee267ef4 rustc: Remove the last few exterior vectors from typeck 2011-07-12 18:41:27 -07:00
Patrick Walton
f7ba28573f rustc: Remove a few scattered uses of exterior vectors from typestate 2011-07-12 18:34:22 -07:00
Patrick Walton
0ffe8c81c3 rustc: Remove exterior vectors from resolve 2011-07-12 18:29:03 -07: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
01ea0647bb rustc: Remove some exterior vectors from ty.rs 2011-07-12 18:21:50 -07:00
Patrick Walton
cdda0fd6d6 rustc: Remove some useless std::vec imports 2011-07-12 18:07:12 -07:00
Patrick Walton
13c44f99ae stdlib: Make pipe and waitpid use interior vectors 2011-07-12 17:54:27 -07:00
Graydon Hoare
e53cfb979b Fix fast-check target by disabling code snippet printing on warnings (broken on .rc files) and adding an xfail-fast flag for global-scope.rs. 2011-07-12 17:36:57 -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
b97318bb80 Simplify the code for generating tests. Issue #428 2011-07-12 16:54:47 -07:00
Brian Anderson
ed83f28076 Log the synthesized __test module. Issue #428 2011-07-12 16:54:46 -07:00
Brian Anderson
73e6a4f9e5 Elide existing main function when building a test runner. Issue #428
This prevents any defined main function from colliding with the one
synthesized for the test runner. This is not the best solution since it
doesn't compile a function the user defined, but I don't think it's likely to
be a problem in the near term.
2011-07-12 16:54:46 -07:00
Brian Anderson
41a3888da7 Fix type inference of fn tail expressions. Closes #680 2011-07-12 16:54:46 -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
a3add84909 rustc: Remove some interior vectors from typestate and some useless vec-related imports 2011-07-12 16:44:57 -07:00
Patrick Walton
ccd0fffcce stdlib: Implement str::split_ivec() 2011-07-12 16:36:47 -07:00
Patrick Walton
e038e8e52b rustc: Move ppaux away from exterior vectors 2011-07-12 16:35:02 -07:00
Patrick Walton
60cffd7116 rustc: Complete the transition of pprust to interior vectors 2011-07-12 16:13:30 -07:00
Patrick Walton
a190a2c68e rustc: Remove exterior vectors from front::attr 2011-07-12 15:39:48 -07:00
Marijn Haverbeke
12d5532166 Use switches rather than chained conditionals to compile alt matches
This also moves the alt-related trans code into its own file.

Closes #467
2011-07-13 00:38:24 +02:00
Eric Holk
1ea449e2f6 Updating and unXFAILing somet communication tests. 2011-07-12 15:27:36 -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
27834c2a65 test: Switch lib-either over to interior vectors. Puts out burning tinderbox. 2011-07-12 15:09:44 -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
Tim Chevalier
f7a1006a07 Make resolve check for type-variable name-shadowing
Capturing a type argument in the enclosing scope should be an error --
this commit implements that check in resolve, avoiding a potential
assertion failure in trans.

Closes #648.
2011-07-12 13:42:05 -07:00
Lindsey Kuper
0d9c08af2a Remove some obsolete comments. 2011-07-12 12:01:02 -07:00
Lindsey Kuper
a0b78e649e "Narrow scope forgives many sins." -- M. Schwern 2011-07-12 12:01:02 -07:00
Patrick Walton
a9b77a5011 rt: Remove the locks around upcall_shared_malloc and upcall_shared_free 2011-07-12 11:53:45 -07:00
Patrick Walton
0be1a0b500 rustc: Simplify tritv::copy; shaves a couple of seconds off typestate. 2011-07-12 11:47:32 -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
Tim Chevalier
e1f9bfbac9 Add missing files
git add didn't, so this actually has the changes that should
have been in the previous commit
2011-07-12 11:26:14 -07:00
Tim Chevalier
21b94d57d5 Change typestate to use visit instead of walk
Typestate was failing to check some code because if it saw an item,
it would quit immediately. This was to avoid checking nested items
in the same context as the lexically enclosing item, but it was
having the wrong effect: not checking the code after the item at all.

Fixed by switching to visit and skipping over items in a proper
nested fashion. Closes #668.
2011-07-12 11:22:31 -07:00
Tim Chevalier
0e594939aa Fix potential use-before-init bug in trans
This was being masked by a bug in typestate (fixed in the next commit).
2011-07-12 11:21:14 -07:00
Marijn Haverbeke
bde52808f0 Update pretty-printing of '...' in record patterns to be ', _' instead 2011-07-12 17:58:40 +02:00
Brian Anderson
a5ec51d6a1 Fix pretty-printing of literals again. Issue #672
The pos variable is one character beyond where I thought it was.
2011-07-11 21:31:14 -07:00
Tim Chevalier
a8b1ea159c Make the parser add correct spans to view_items
Closes #650.
2011-07-11 19:12:02 -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
Paul Stansifer
2e46438507 So... I can't spell 'ellipsis'. 2011-07-11 18:52:50 -07:00
Paul Stansifer
9a0e85a920 Change "etc" syntax for record patterns from {a:b ...} to {a:b, _}. 2011-07-11 18:52:50 -07:00
Paul Stansifer
48dbee6b47 Add elipses, reorganize the macro components into their own AST node. 2011-07-11 18:52:50 -07:00
Paul Stansifer
425732311a Move macro expansion to a separate phase, change macro syntax, and add parse_sess to session. 2011-07-11 18:52:50 -07:00
Paul Stansifer
80cf4ecd3b Add nodes for embedding types and blocks in expressions for macros. 2011-07-11 18:52:10 -07:00
Josh Matthews
fd24fd5e31 Only print up to six lines on error. Print ^~~~~ to highlight error span. 2011-07-11 18:44:27 -07:00
Josh Matthews
b62fcdcc36 Hack to print lines when error spans are available. 2011-07-11 18:44:27 -07:00
Tim Chevalier
1870e97559 Visit the type argument in a port expression
This closes #664.
2011-07-11 18:12:00 -07:00
Brian Anderson
e45819ad70 Add parser::parse_crate_from_source_str
The fuzzer wants to be able to do stuff like this
2011-07-11 17:46:24 -07:00
Tim Chevalier
67ecda6342 remove some workarounds for old bugs 2011-07-11 17:32:00 -07:00
Tim Chevalier
e1620def9f In typeck, check for dynamically sized by-value arguments to thunks
A check in trans didn't have a corresponding check in typeck, causing
some programs (to wit, compile-fail/chan-parameterized-args.rs - part of this
commit) to fail with an assertion failure in trans instead of a type error.
Fixed it. In short, arguments that are future thunk arguments (any spawn
arguments, and _ arguments in bind) need to either not contain type params
or type vars, or be by-reference.

Closes #665.
2011-07-11 17:32:00 -07:00
Brian Anderson
9fe03b3c55 Pull lexer creation out of new_parser
This will allow custom lexers to be injected into the parser (for fuzzing)
2011-07-11 16:56:02 -07:00
Brian Anderson
08f8753d80 Pull file reading out of the lexer 2011-07-11 16:56:02 -07:00
Patrick Walton
05390b4b38 rustc: Implement explicit global scope resolution via leading "::"; add a test case 2011-07-11 16:02:16 -07:00
Rafael Ávila de Espíndola
99a95b3613 Use new snapshot. 2011-07-11 18:35:25 -04:00
Tim Chevalier
9427864f33 Unify the rhs and lhs types in a send
Closes #662.

One-line fixes are always the best :-D
2011-07-11 15:24:47 -07:00
Patrick Walton
79ce5a4614 rustc: Implement pointer dereference; add a test case 2011-07-11 15:19:16 -07:00
Michael Sullivan
4618e802db Fix comparisons of the nil type to do something sensible.
Closes #576.
2011-07-11 14:45:21 -07:00
Brian Anderson
7fc7ebd520 The lexer's get_mark_str should slice by byte position, not char. Closes #654 2011-07-11 14:41:55 -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
Eric Holk
a84310aa48 Started working on MapReduce.
Currently it's only sequential, but it can do word frequency
counting. In an ideal world it would all be polymorphic, but that
pushes the limits of our type system right now. We can generalize it
later.
2011-07-11 14:05:09 -07:00
Rafael Ávila de Espíndola
d151e18633 Move llvm out of stageN/lib so that the host building stage 1+ can
have a newer and incompatible llvm with the bots.
2011-07-11 16:31:47 -04:00
Marijn Haverbeke
c893188549 Use some actual or-patterns in resolve.rs 2011-07-11 21:23:49 +02:00
Marijn Haverbeke
55e348280e Fix pretty-printing of record patterns 2011-07-11 21:23:49 +02:00
Michael Sullivan
7340824cbc Fix autoderef of function calls when the function is not an lval.
As it turns out, the correct way to handle this is much simpler than what I
did originally.
Also add more tests.
2011-07-11 11:38:01 -07:00
Michael Sullivan
418aa52510 Add a test that exercises these cases in bind. 2011-07-11 11:37:56 -07:00
Michael Sullivan
cd97f4eed0 Fix handling of derived tydescs in bind.
In trans_bind_thunk, we need to load the tydescs from the environment *before*
we try to construct derived tydescs from them.
2011-07-11 11:37:55 -07:00
Michael Sullivan
0beb271d8c Fix bind to work with boxed arguments with type parameters.
This still doesn't work with bare fn arguments with type parameters.
2011-07-11 11:37:55 -07:00
Rafael Ávila de Espíndola
15a670a1b1 Use new snapshot. 2011-07-11 14:32:18 -04:00
Brian Anderson
64ad5928e7 Actually run tests from the std runner. Issue #428 2011-07-11 11:19:32 -07:00
Rafael Ávila de Espíndola
f666c97e6d Step 1/n for moving to the new type system: include intrinsics.bc in the
snapshot.
2011-07-11 12:09:52 -04:00
Marijn Haverbeke
7595fe5153 Implement record patterns
Closes #469.
2011-07-11 15:32:41 +02:00
Marijn Haverbeke
12cb128a0a Move visit to newtype-style nominal type
This makes getting the function fields out of the visitor less
cumbersome and more efficient (no take/drop).
2011-07-11 13:53:50 +02:00
Marijn Haverbeke
5f544b1366 Output a meaningful error when too few or too many type parameters given
Closes #619
2011-07-11 13:19:34 +02: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
Marijn Haverbeke
4d325b1a15 Spill instead of copy when binding a pattern that's only a var binding
The alias rules guarantee that the alt-ed value will outlive the binding's
last use, so this is safe.

This is a preparation for or-patterns. Joining scoped bindings seems like
it would get messy.
2011-07-11 10:33:19 +02:00
Jesse Ruderman
fa78fee4de Add uint::min 2011-07-10 17:05:25 -07:00
Jesse Ruderman
ea69f48eac Add a missing case so nbody.rs can pp 2011-07-10 17:05:25 -07:00
Jesse Ruderman
ab50da9445 Export noop_fold_expr so the fuzzer can use it 2011-07-10 17:05:25 -07:00
Jesse Ruderman
425b331dee fuzzer.rs is now a pseudo-fuzzer that takes an AST and replaces expressions inside it 2011-07-10 17:05:25 -07:00
Jesse Ruderman
b4781bf8dd Type-parameterize ivec_fuzz 2011-07-10 17:05:25 -07:00
Jesse Ruderman
3671cddcba Remove comments complaining about https://github.com/graydon/rust/issues/633 since it is fixed 2011-07-10 17:05:25 -07:00
Jesse Ruderman
e91f8b5db2 Pieces of a fuzzer, WIP 2011-07-10 17:05:25 -07:00
Brian Anderson
6d3513eaee Make #fmt work from inside std. Issue #175
At long last, this patch makes #fmt usable from inside the standard library.
The way it does it us very hackish, but at least it works now.
2011-07-10 17:00:28 -07:00
Brian Anderson
e494e73cdd Use more encapsulation for metadata::cstore 2011-07-10 15:44:11 -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
7efb942639 rt: Remove the now-unused upcall_ivec_resize and upcall_ivec_spill, which allocated from the wrong heap 2011-07-10 01:30:45 -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
f02c998a8d snap: Register new snapshots 2011-07-10 01:13:00 -07:00
Patrick Walton
f42c94740a rustc: Make rust-intrinsics take an explicit return pointer 2011-07-09 21:13:25 -07:00
Patrick Walton
e823ca4965 stdlib: Implement casts. The horror. 2011-07-09 20:14:47 -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
Brian Anderson
f72dbec9b5 Collect functions that look like unit tests. Issue #428 2011-07-09 12:36:03 -07:00
Brian Anderson
5543404abe Track the path as we fold over the AST looking for unit tests. Issue #428 2011-07-09 12:35:30 -07:00
Brian Anderson
9af59f9d81 Add sha1 and int tests to stdtest. Issue #428 2011-07-09 12:35:30 -07:00
Brian Anderson
45b00935f3 Begin running the test for int::pow
Somehow this has been disabled forever
2011-07-09 12:35:30 -07:00
Tim Chevalier
9ec5e90608 Tests for constraint propagation 2011-07-08 22:25:57 -07:00
Tim Chevalier
182c413af1 Propagate constraints through copy, move, and swap
Assignments and moves with a simple local variable reference on the
RHS now propagate any typestate constraints the RHS was involved
in to the LHS. Swaps where both sides are local variables
exchange the constraints.

This was a pain in the butt and I'm still not proud of the resulting
code. Needs refactoring like whoa.
2011-07-08 22:25:57 -07:00
Tim Chevalier
be6febb46d Minor refactoring 2011-07-08 22:25:57 -07:00
Tim Chevalier
7060f4c89c Alias-ify some prettyprinting functions 2011-07-08 22:25:57 -07:00
Tim Chevalier
36c4cb37ad Improve impossible-case handling in ty::get_element_type 2011-07-08 22:25:57 -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
Brian Anderson
7498d03693 Improve the error message for import glob collisions. Closes #482
Instead of noting where the imported things were defined, note where they were
imported. This is more useful and avoids issue #482.
2011-07-08 18:55:01 -07:00
Brian Anderson
394b8fcd1c Add test case for issue #333. Closes #333
This has been fixed by a mystery hacker.
2011-07-08 17:43:44 -07:00
Patrick Walton
1ff426b89f rustc: Use interior vectors for the union-find in rustc 2011-07-08 17:00:21 -07:00
Patrick Walton
9b7984c250 snap: Register new snapshots 2011-07-08 16:51:25 -07:00
Patrick Walton
ccfbb74f11 rustc: Move maps over to interior vectors 2011-07-08 16:37:43 -07:00
Patrick Walton
8450ab9a2b rustc: Fix a level-of-indirection problem by using size_of() to compute dynamically sized interior vector element sizes instead of field_of_tydesc() 2011-07-08 16:37:43 -07:00
Brian Anderson
f5d604f0c3 Decode types across multiple crates. Closes #632 2011-07-08 15:07:14 -07:00
Lindsey Kuper
33ce1164e2 Nicer pretty-printing for anon objs. Closes #499.
(Incidentally, what's the right way to test changes to the
pretty-printer?  There has to be a better way than what I did, which
was to log_err the results of expr_to_str as exprs passed through
trans and glance at the output.)
2011-07-08 15:00:47 -07:00
Brian Anderson
4319e7a655 Recursively load dependencies of external crates. Issue #632 2011-07-08 14:07:41 -07:00
Brian Anderson
412e203b3c Refactor load_library_crate and resolve_crate 2011-07-08 14:07:41 -07:00
Brian Anderson
dd8ab24da2 Add a map from external cnums to local cnums in cstore::crate_metadata
Once populated, this will allow us to load type info for types defined in
external crates referenced by other external crates.
2011-07-08 14:07:41 -07:00
Brian Anderson
061bcb2e42 Extract resolve_crate from creader::visit_view_item 2011-07-08 14:07:41 -07:00
Eric Holk
79ca673af7 Adding more support for working with u64s. 2011-07-08 14:02:26 -07:00
Rafael Ávila de Espíndola
4c309321e0 Try to use static crate if we cannot find the dynamic one. This supports
the common case of wanting to link statically with the project's libraries
but dynamically with the system ones.
2011-07-08 15:39:44 -04:00
Rafael Ávila de Espíndola
94f0e9d956 Add just enough logic to the driver so that we can link std statically. 2011-07-08 15:05:32 -04:00
Patrick Walton
0864a22ace stdlib: Add an interior vector version of union-find for now 2011-07-08 11:44:38 -07:00
Eric Holk
d7db25e8f6 Added an environment variable to override the minimum stack size. Closes #637. 2011-07-08 11:36:56 -07:00
Brian Anderson
4c0a2ed378 Fix newlines when outputting crate attributes with --ls 2011-07-08 11:34:15 -07:00
Brian Anderson
3070439c00 Encode/decode a crate's externel dependencies. Issue #632
The encoding is very simple right now, just the crate name. Ultimately this
won't be enough for our versioning needs, but it should fill our immediate
need of being able to correlate encoded crate numbers to actual crates.
2011-07-08 11:34:15 -07:00
Patrick Walton
7c66894a71 rustc: Do dynamic size calculations properly when concatenating interior vectors. Closes #640. 2011-07-08 11:29:29 -07:00
Brian Anderson
d0a432f4bb Don't export tyencode from the metadata module
This involves pulling the type_abbrev cache out of crate_ctxt
2011-07-08 09:37:01 -07:00
Brian Anderson
00d54018f1 Cleanup decoding and crate searching 2011-07-08 09:37:01 -07:00
Brian Anderson
06391dda02 Make the interface to metadata::csearch more consistent 2011-07-08 09:37:01 -07:00
Brian Anderson
85212840c0 Remove unused functions from metadata::csearch 2011-07-08 09:37:01 -07:00
Brian Anderson
9ebb60d38b Extract various dependencies from metadata::decoder to metadata::csearch 2011-07-08 09:37:01 -07:00
Brian Anderson
7ae711fc03 Begin splitting metadata::decoder into decoding and crate search modules 2011-07-08 09:37:01 -07:00
Brian Anderson
cc2924068f Replace various ints with ast::crate_nums 2011-07-08 09:37:01 -07:00
Brian Anderson
29b766029c Move external crate/lib resolution to its own pass
The scope of external crate reading is beyond the resolve pass now, as it
builds up tables of information needed for several different purposes.
2011-07-08 09:37:01 -07:00
Brian Anderson
85535fc3e0 Move crate_map from resolve to cstore 2011-07-08 09:37:00 -07:00
Brian Anderson
513b2276c2 Remove non-existant export from metadata::decoder 2011-07-08 09:37:00 -07:00
Brian Anderson
51e60b6565 Comment creader 2011-07-08 09:37:00 -07:00
Brian Anderson
639cf1a8ff Comment cstore 2011-07-08 09:37:00 -07:00
Brian Anderson
58d288a4f7 Move used_link_args from session to cstore 2011-07-08 09:37:00 -07:00
Brian Anderson
4bfa269fe7 Move used_libraries from session to cstore 2011-07-08 09:37:00 -07:00
Brian Anderson
1386420cad Move used_crate_files from session to cstore 2011-07-08 09:37:00 -07:00
Brian Anderson
82983e5005 Replace the crate cache in session with the one in cstore 2011-07-08 09:37:00 -07:00
Brian Anderson
b23ecd47ce Introduce metadata::cstore
I intend for this to be the location for storing all the data retrieved by
creader, most of which is currently in the session.
2011-07-08 09:37:00 -07:00
Marijn Haverbeke
c7bfef43c8 Ignore current scope when resolving self-shadowing imports
That is, for example, import x::y::x, which defines a local x,
and thus wouldn't be able to find x::y anymore.

Closes issue #624
2011-07-08 16:04:40 +02:00
Marijn Haverbeke
eeda0f4ab1 Don't unbox types in ty::is_binopable, do it on typeck side instead
Closes issue #631

Removes ty::strip_boxes entirely, since unboxing is now more complicated
anyway.
2011-07-08 15:52:54 +02:00
Marijn Haverbeke
381505f947 Remove useless return value in typeck::check_decl_local 2011-07-08 15:01:54 +02:00
Marijn Haverbeke
022363a674 Auto-bind generic functions when their value is taken in non-call context
trans::trans_lval will now autobind if the given expression was the
name of a generic functions. Those callees (trans_call and trans_bind)
that are interested in the generics information call trans_lval_gen
now.
2011-07-08 14:28:46 +02:00
Marijn Haverbeke
faec0d7799 Avoid superfluous take/drop for temp values passes as arguments 2011-07-08 13:46:29 +02:00
Marijn Haverbeke
b41fd61045 Make for-each bodies close over their parent's iterbody
Closes issue #639
2011-07-08 11:55:15 +02:00
Patrick Walton
7ed556cf8e rustc: Check iter return types. Closes #638. 2011-07-07 19:08:59 -07:00
Patrick Walton
2255eda625 rustc: Fix long line 2011-07-07 18:41:54 -07:00
Patrick Walton
edf8245273 rustc: Make trans use interior vectors 2011-07-07 18:39:05 -07:00
Patrick Walton
e1b107d74e rustc: Remove all exterior vectors from the AST 2011-07-07 18:39:05 -07:00
Eric Holk
3958c72cd8 Some cleanup 2011-07-07 18:32:45 -07:00
Eric Holk
4739953b84 Fixed two races.
The first is that the memory_region destructor would complain there is
still an outstanding allocation. This is because circular_buffer from
rust_chan wasn't refing its task, so the task was being destructed too
soon.

The second was where the program could deadlock while joining a
task. The target task would die in the time between checking whether
the task should block and then actually blocking. The fix is to use
the target task's lock.
2011-07-07 18:22:27 -07:00
Eric Holk
2d57b25f6b Added a stress test mode to pfib. 2011-07-07 18:22:27 -07:00
Eric Holk
f6e37f659c Made TRACK_ALLOCATIONS add only constant time overhead. This makes it
feasible to turn it on and run rustc.
2011-07-07 18:22:27 -07:00
Eric Holk
5d9a5b7d55 Tightened up the scoping for our various new operators, which should
make it harder to use the wrong one.
2011-07-07 18:22:27 -07:00
Eric Holk
8acadb17c2 Work on debugging race conditions.
Ports and channels have been moved to the kernel pool, since they've
been known to outlive their associated task. This probably isn't the
right thing to do, the life cycle needs fixed instead.

Some refactorying in memory_region.cpp. Added a helper function to
increment and decrement the allocation counter. This makes it easier
to switch between atomic and non-atomic increments. Using atomic
increments for now, although this still does not fix the problem.
2011-07-07 18:22:27 -07:00
Eric Holk
dcd2563a3a Removing the synchronized memory region from tasks. 2011-07-07 18:22:27 -07:00
Eric Holk
a0f45f4456 Removing most of the locks in rust_upcall.cpp and elsewhere. 2011-07-07 18:22:27 -07:00
Lindsey Kuper
e7111fe147 Un-xfail a test. 2011-07-07 17:39:35 -07:00
Lindsey Kuper
3243144046 Fix a bug that was interfering with method overriding. Issue #543.
Previously, we were creating both a normal vtable entry and a
forwarding function for overriding methods, when they should have just
gotten a vtable entry.  This patch fixes that.
2011-07-07 17:29:15 -07:00
Brian Anderson
94f782e6a1 Register new snapshots
New snapshots also include rt and rustllvm
2011-07-07 16:40:58 -07:00
Brian Anderson
64595a53f8 Add rt and rustllvm to the snapshot 2011-07-07 15:40:27 -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
Rafael Ávila de Espíndola
5547e5dd21 Use new snapshot. 2011-07-07 17:36:23 -04:00
Brian Anderson
6ee1ffe4ac Rename encoder::ty_str to encoded_str 2011-07-07 13:31:12 -07:00
Brian Anderson
de88739350 Don't expert def_to_str from metadata::encoder 2011-07-07 13:31:12 -07:00
Brian Anderson
7d26d1d67b Move tyencode::ty_str to metadata::encoder 2011-07-07 13:31:12 -07:00
Brian Anderson
73963eae9a Refactor tyencode::ty_str to not require a tyencode::ctxt
All users were constructing the context the same way.
2011-07-07 13:31:11 -07:00
Brian Anderson
4304f8d4f6 Remove duplicate definition of def_to_str from middle::ty 2011-07-07 13:31:11 -07:00
Brian Anderson
e29ef1bec2 Refactor a few things in the metadata module
Rename metadata::tags to metadata::common. Move some utility functions from
metadata::encoder to metadata::common.
2011-07-07 13:31:11 -07:00
Brian Anderson
b723082cdb Rename hash_def_id to hash_node_id 2011-07-07 13:31:11 -07:00
Brian Anderson
d2362599d6 Remove metadata::encoder's dependence on trans::node_id_type 2011-07-07 13:31:11 -07:00
Rafael Ávila de Espíndola
83991c4c95 Add the static std library in the next snapshot. 2011-07-07 16:25:25 -04:00
Patrick Walton
0e2fff5337 rustc: Change lots of AST nodes to use interior vectors 2011-07-07 12:53:17 -07:00
Rafael Ávila de Espíndola
77c708cdbf Implement --lib --static. 2011-07-07 15:25:09 -04:00
Rafael Ávila de Espíndola
b13527735e Use an early exit to reduce indentation. 2011-07-07 14:59:18 -04:00
Rafael Ávila de Espíndola
6d6c4c2a76 Command line changes for adding support for static libraries. 2011-07-07 14:42:50 -04:00
Marijn Haverbeke
16f82dce1c Clean up trans_arg_expr
As a preparation for implementing the temporary-move optimization for
argument passing. The optimization itself isn't in yet, since it
mysteriously corrupts memory.
2011-07-07 17:54:58 +02: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
Marijn Haverbeke
007a736642 Improve handling of move and swap by alias checker
Closes issue #541.
Closes issue #591
2011-07-07 10:37:19 +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
Rob Arnold
2e2e1f7cb3 Add realloc method to rust_kernel 2011-07-06 20:37:27 -07:00
Lindsey Kuper
130006cdda Tie the knot for self-calls inside extended objects. Closes #539. 2011-07-06 18:39:01 -07:00
Brian Anderson
cf4c2ac0be Generate a main fn for test running. Issue #428 2011-07-06 18:26:22 -07:00
Lindsey Kuper
6ca81b3407 Fix a pointer bug. 2011-07-06 17:16:54 -07:00
Lindsey Kuper
553beda96d Add span information to create_vtbl and friends. 2011-07-06 17:16:53 -07:00
Lindsey Kuper
41f6a3d5e1 Comments and cleanup. 2011-07-06 17:16:53 -07:00
Patrick Walton
2f29f9931d rustc: Make constraint args in the AST interior vectors 2011-07-06 16:19:19 -07:00
Patrick Walton
f164d7779a rustc: Move AST constraints to interior vectors 2011-07-06 16:12:39 -07:00
Patrick Walton
c83782f500 rustc: Migrate core AST types to interior vectors 2011-07-06 16:01:47 -07:00
Patrick Walton
aad0bcc8d5 rustc: Make AST tuple types use interior vectors 2011-07-06 15:53:47 -07:00
Patrick Walton
401b6362d7 rustc: Make meta items into interior vectors 2011-07-06 15:46:03 -07:00
Patrick Walton
479ce4d783 rustc: Move crate directives over to interior vectors 2011-07-06 15:15:06 -07:00
Patrick Walton
0226f56115 rustc: Convert attribute in the AST to interior vectors 2011-07-06 15:15:00 -07:00
Patrick Walton
7714cb297b rustc: Make AST paths use interior vectors 2011-07-06 15:14:52 -07:00
Patrick Walton
368f1f4ba8 rustc: Move middle::tstate::collect_locals over to interior vectors 2011-07-06 15:14:45 -07:00
Patrick Walton
b232ad94fd rustc: Remove unused or seldom-used imports from middle::tstate::{bitvectors, ck} 2011-07-06 15:14:35 -07:00
Patrick Walton
5739e0be01 rustc: Remove some unused references to std::vec from tstate::ann and tstate::auxiliary 2011-07-06 15:14:29 -07:00
Patrick Walton
abab04635a rustc: Move middle::tstate::auxiliary and middle::tstate::bitvectors over to interior vectors 2011-07-06 15:14:19 -07:00
Patrick Walton
6d1517cf3a rustc: Move tstate::annotate over to interior vectors 2011-07-06 15:14:09 -07:00
Patrick Walton
35c1dbd492 rustc: Convert bind_params_in_type() to use interior vectors 2011-07-06 15:13:59 -07:00
Patrick Walton
1d57800236 rustc: Migrate tag variants to interior vectors 2011-07-06 15:13:54 -07:00
Patrick Walton
2e1aa04fcd rustc: Make object methods into interior vectors 2011-07-06 15:13:47 -07:00
Patrick Walton
0391e14fc2 rt: Double stack size 2011-07-06 15:13:00 -07:00
Patrick Walton
91eb63eaee rt: Add a stack check to upcall_get_type_desc 2011-07-06 15:07:04 -07:00
Brian Anderson
2f7bc90514 Add a stdtest crate to hold the standard library tests
This will link to std and compile with the --test flag. Eventually the
run-pass/lib* tests will move here.

We could also put the std tests directly into the library and compile both a
library version and a test version, but I think this way will make for faster
builds.

Issue #428
2011-07-06 14:39:40 -07:00
Brian Anderson
b06ccb45ab Begin adding unit testing infrastructure to the compiler
Add a --test flag and a pass for transforming the AST to generate a test
harness.

Issue #428
2011-07-06 14:39:36 -07:00
Brian Anderson
0eac640fdd Swap the expected/actual for typechecking fields of updated records
In 'rec(a = b with c)', if a exists in c then the expected type for b is the
type of c.
2011-07-06 14:04:52 -07:00
Patrick Walton
05954f37b7 rustc: Use an interior vector for ty::count_ty_params 2011-07-06 12:05:18 -07:00
Patrick Walton
e066bae56e rustc: Move the interner over to interior vectors 2011-07-06 12:05:13 -07:00
Patrick Walton
717ac3df77 rustc: Make the various constraint-related types in middle::ty use interior vectors 2011-07-06 12:05:06 -07:00
Patrick Walton
2fd46b54fb rustc: Make type parameter substitutions interior vectors 2011-07-06 12:04:59 -07:00
Patrick Walton
cb2018c6db rustc: Change constraints in types to use interior vectors 2011-07-06 12:04:07 -07:00
Patrick Walton
13d920c10d rustc: Switch tag type parameters to interior vectors 2011-07-06 12:03:55 -07:00
Patrick Walton
ede35f4c43 rustc: Use interior vectors for tag type parameters 2011-07-06 12:03:06 -07:00
Eric Holk
111989a626 Removed what seems to be the last of the calls to rand(). Closes #582. 2011-07-06 11:50:25 -07:00
Brian Anderson
066bcc6c79 Make "cannot determine a type for this local variable" non-fatal 2011-07-06 11:44:42 -07:00
Brian Anderson
5c20a8aa9c Make "cannot determine a type for this expression" non-fatal. Closes #621 2011-07-06 11:44:36 -07:00
Brian Anderson
c31472e845 Refactor the typeck::writeback AST walk
All visitors take a wb_ctxt now instead of some taking a fn_ctxt and some
taking an ignore flag.
2011-07-06 11:42:20 -07:00
Brian Anderson
0c9c4cb575 Remove unused method from typeck::writeback 2011-07-06 11:42:20 -07:00
Brian Anderson
c1136e4e05 Limit exports from typeck 2011-07-06 11:42:20 -07:00
Brian Anderson
97c1537374 Limit exports from typeck::writeback 2011-07-06 11:42:20 -07:00
Lindsey Kuper
e30d2c82ae Simplify AST for expr_anon_obj. 2011-07-06 11:36:06 -07:00
Lindsey Kuper
23bae67f4c Simplify arguments to trans_anon_obj and friends. 2011-07-06 11:36:06 -07:00
Eric Holk
bc5d6aefda Added a task wakeup callback. Closes #599.
The callback happens when a task moves from the "blocked" state to the
"running" state. The callback is also inherited by child tasks. There
is currently only a native API.

This code hasn't been heavily exercised yet.
2011-07-06 11:30:00 -07:00
Patrick Walton
bbdba21b1f rustc: Revert the conversion to interior vectors due to heap corruption 2011-07-06 11:26:26 -07:00
Patrick Walton
ec890fff23 Temp commit on the way to making meta_item into an interior vector 2011-07-06 11:09:08 -07:00
Patrick Walton
3f6c9f8d84 rustc: Move crate directives over to interior vectors 2011-07-06 11:09:08 -07:00
Patrick Walton
c927d97fa0 rustc: Convert attribute in the AST to interior vectors 2011-07-06 11:09:08 -07:00
Patrick Walton
1591955adf rustc: Make AST paths use interior vectors 2011-07-06 11:09:08 -07:00
Patrick Walton
b108280db1 rustc: Move middle::tstate::collect_locals over to interior vectors 2011-07-06 11:09:08 -07:00
Patrick Walton
48438ba1ae rustc: Remove unused or seldom-used imports from middle::tstate::{bitvectors, ck} 2011-07-06 11:09:07 -07:00
Patrick Walton
ec634e471f rustc: Remove some unused references to std::vec from tstate::ann and tstate::auxiliary 2011-07-06 11:09:07 -07:00
Patrick Walton
cfc659009e rustc: Move middle::tstate::auxiliary and middle::tstate::bitvectors over to interior vectors 2011-07-06 11:09:07 -07:00
Patrick Walton
702f88a3be rustc: Move tstate::annotate over to interior vectors 2011-07-06 11:09:07 -07:00
Patrick Walton
4c384304e9 rustc: Convert bind_params_in_type() to use interior vectors 2011-07-06 11:09:07 -07:00
Patrick Walton
5703bd1760 rustc: Migrate tag variants to interior vectors 2011-07-06 11:09:07 -07:00
Patrick Walton
52a7c2b78e rustc: Make object methods into interior vectors 2011-07-06 11:09:07 -07:00
Patrick Walton
75c5f9bdba rustc: Use an interior vector for ty::count_ty_params 2011-07-06 11:09:06 -07:00
Patrick Walton
bd7a072266 rustc: Move the interner over to interior vectors 2011-07-06 11:09:06 -07:00
Patrick Walton
b9a2117475 rustc: Make the various constraint-related types in middle::ty use interior vectors 2011-07-06 11:09:06 -07:00
Patrick Walton
0eb889f9d2 rustc: Make type parameter substitutions interior vectors 2011-07-06 11:09:06 -07:00
Patrick Walton
8bee69da25 rustc: Change constraints in types to use interior vectors 2011-07-06 11:09:06 -07:00
Patrick Walton
f391acbd3f rustc: Switch tag type parameters to interior vectors 2011-07-06 11:09:06 -07:00
Patrick Walton
09e591c12f rustc: Use interior vectors for tag type parameters 2011-07-06 11:09:06 -07:00
Patrick Walton
9c4411ac5e snap: Register new snapshots 2011-07-06 11:05:57 -07:00
Lindsey Kuper
6bd80d0121 Add a compile-fail test for attempts to extend non-objects. 2011-07-06 10:47:36 -07:00
Marijn Haverbeke
8e585e7008 Support paren-free and lightweight-case syntax
(The old syntax is still supported as well, for now.)

It is now possible to leave out the parens around if, while, and
do/while conditions, and around alt expressions. Cases in an alt block
can now leave off the case keyword and parens around the pattern.

After the next snapshot, we can start migrating our code to use the
new alt syntax, probably with a pretty-printer pass. The paren-free
syntax will remain optional (you may always parenthesize expressions),
but the old case syntax will no longer be supported in the future.
2011-07-06 17:50:52 +02:00
Marijn Haverbeke
7661c08496 Remove temporary stdlib placeholders, use actual stdlib functions
(Possible now that a snapshot took place.)
2011-07-06 16:46:17 +02:00
Lindsey Kuper
4c315666dd Forwarding functions. Lots of progress toward #539, #540, #543. 2011-07-05 20:21:59 -07:00
Lindsey Kuper
993e47175f Comments and cleanup. 2011-07-05 20:17:33 -07:00
Tim Chevalier
f279e0d76e Handle pattern-bound upvars
If a closure inside a case alternative (for example, a for each loop)
referenced a pattern-bound variable, this would cause an assertion
failure in trans. Changed trans::collect_upvars to handle pattern-bound
vars correctly.

Incidentally, eliminated all direct uses of option::get in trans.
2011-07-05 19:58:49 -07:00
Patrick Walton
1bba585044 stdlib: Implement ivec::foldl 2011-07-05 18:29:47 -07:00
Brian Anderson
2cb129355b Change ast::meta_name_value to accept any literal, not just string
This isn't useful for much of anything yet, since metadata::encoder doesn't
know how to handle the non-string variants.

Issue #611
2011-07-05 17:25:18 -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
Brian Anderson
375f0b2211 Require that the meta items in a use statement have unique names 2011-07-05 16:12:24 -07:00
Tim Chevalier
a793b85fbd Handle fail inside a for-each loop properly 2011-07-05 16:05:38 -07:00
Tim Chevalier
ded9008e38 handle fail inside a for loop 2011-07-05 16:05:38 -07:00
Tim Chevalier
6d0cb70fc3 Handle fail as an argument 2011-07-05 16:05:38 -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
Graydon Hoare
741db24e49 Print remaining comments at end of *crate*, not module. 2011-07-05 14:44:54 -07:00
Brian Anderson
a9d84ab28a Make type unification failures non-fatal
Add a failure checkpoint after the typechecking pass. There are still many
fatal errors in typeck, but loosening up this one makes it easier to lean on
the compiler when making changes to types.

Issue #440.
2011-07-05 14:40:33 -07:00
Patrick Walton
291df4d732 rt: Add missing CDECL to routines in rust_builtin 2011-07-05 14:29:14 -07:00
Graydon Hoare
a7d82a7f0f Factor the ivec code a touch. 2011-07-05 14:19:27 -07:00
Brian Anderson
c5e28567a2 Register new snapshots 2011-07-05 13:39:54 -07:00
Brian Anderson
57d94493cf Remove unused eval function. Issue #604 2011-07-05 13:34:02 -07:00
Brian Anderson
b79ea489e3 Support conditional compilation of native items. Closes #610 2011-07-05 13:30:00 -07:00
Brian Anderson
8499c77cee Parse attributes for native items. Closes #609 2011-07-05 12:43:44 -07:00
Brian Anderson
10a4737d34 Warn when compiling shared crates that don't have name/vers link attributes
Closes #614
2011-07-05 11:58:44 -07:00
Brian Anderson
6f8bc404f8 Error if the link attribute has duplicate items. Issue #614 2011-07-05 11:46:02 -07:00
Marijn Haverbeke
4349eaed84 Don't thread the local crate number through the session
It's a constant, anyway.
2011-07-05 16:09:32 +02: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
Marijn Haverbeke
c59ebf0f01 Add a test file for distinct ty_native types
This should have gone into patch
77f5d14f14, had I not forgotten to add
the file.
2011-07-05 11:50:41 +02:00
Marijn Haverbeke
04acba7968 Move pretty-printing 'modes' into a callback hook
This way, the pretty-printer does not have to know about middle::ty.

(This is a preparation for separating the AST functionality into a
separate crate.)
2011-07-05 10:42:17 +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
5d2c189631 rustc: Remove obsolete "The second has to be authed pure" comment 2011-07-04 19:08:25 -07:00
Brian Anderson
ccf6112f15 Link the fuzzer crate to librustc again 2011-07-04 15:30:36 -07:00
Graydon Hoare
5c9fb0bc98 Merge pull request #605 from wilsonk/target
Update RustWrapper.cpp so that LLVM revision 134231 from June 30, 2011 at
2011-07-04 13:45:59 -07:00
Marijn Haverbeke
fb10829aef Switch the alias checking pass to use span_err instead of span_fatal
It'll now spit out all problems it finds, and only abort after
the whole pass has run.
2011-07-04 22:00:07 +02:00
Marijn Haverbeke
b1423be1d6 Move the ids of pat AST nodes into their struct
Just like it was done with items and exprs. Simplifies some code.
2011-07-04 22:00:06 +02:00
Rafael Ávila de Espíndola
b669430f72 Use metadata to avoid always passing -Lrustllvm to the linker. 2011-07-04 13:22:23 -04:00
Rafael Ávila de Espíndola
6b1da80eb4 Simplify. 2011-07-04 11:36:10 -04:00
Rafael Ávila de Espíndola
e0ce092ddc Simplify the code a bit. 2011-07-04 11:17:30 -04:00
Josh Matthews
7e7e326ee6 Make use of demand::simple instead of manually checking fail expr type. 2011-07-03 21:46:17 -07:00
Josh Matthews
a2775a5b72 Make non-str fail expression a type checking failure instead of a translation one. 2011-07-03 21:46:17 -07:00
Tim Chevalier
b110bbf886 Un-XFAIL fail-arg 2011-07-03 11:56:23 -07:00
Tim Chevalier
046c25dbc0 Handle fail as an argument; parse fail expressions unambiguously
An expression like:

foo(1, fail, 2)

was failing to parse, because the parser was interpreting the comma
as the start of an expression that was an argument to fail, rather
than recognizing that the fail here has no arguments

Fixed this by using can_begin_expr to determine whether the next
token after a fail token suggests that this is a nullary fail or a
unary fail.

In addition, when translating calls, check before translating each
argument that the block still isn't terminated. This has the effect
that if an argument list includes fail, the back-end won't keep trying
to generate code for successive arguments and trip the !*terminated
assertion.
2011-07-03 11:51:47 -07:00
Tim Chevalier
6369807ffe Add a predicate that determines whether a token can begin an expression 2011-07-03 11:51:46 -07:00
Tim Chevalier
48a69d2100 Eliminate all direct calls to option::get() from typeck
This means fewer mysterious error messages.
2011-07-03 02:48:08 -07:00
Tim Chevalier
c425a422ed Manipulate contexts correctly in trans_fail_expr
This fixes Issue #617
2011-07-03 02:38:11 -07:00
Tim Chevalier
9349826909 XFAILing the new test case...
...because the parsing of fail got changed out from under me.
Will fix shortly.
2011-07-03 01:15:41 -07:00
Tim Chevalier
7426252549 Generate code properly for calls with _|_ - typed arguments
The code for translating a fail (for example) would call
Unreachable(), which terminates the block; if a fail appeared as an
argument, this would cause an LLVM assertion failure. Changed
trans_call to handle this situation correctly.
2011-07-02 22:02:59 -07:00
Tim Chevalier
f0fad0dca5 Add a function that determines whether the block is terminated 2011-07-02 22:02:08 -07:00
Josh Matthews
a4421cc4e8 Fix assertion failure when syntax extension name is missing. 2011-07-02 00:06:58 -07:00
Brian Anderson
7c8ee712be Fix the error-pattern on compile-fail/fail-simple
Recent changes to the fail statement changed the way the parser errors in this
scenario.
2011-07-02 00:06:58 -07:00
Josh Matthews
d485e0d15a Allow any string expression to be used with fail. 2011-07-02 00:06:58 -07:00
Patrick Walton
67c9ef9b30 rustc: Fix memory corruption with ivectors-inside-ivectors by duplicating *first*, and *then* copying subtypes. 2011-07-01 20:07:19 -07:00
Patrick Walton
d39c59ae41 rustc: Move path_to_str to front::ast 2011-07-01 17:22:18 -07:00
Rob Arnold
4e59b0be54 Sync rust_chan's deref() method with rustc's code.
If the channel is associated with a port then the destructor will assert.
Additionally, destruction of the object is not always appropriate. This brings
the deref() method into sync with the behavior of generated rust code which
only invokes destroy() once the reference count goes to 0.
2011-07-01 16:59:11 -07:00
Rob Arnold
02a5949aba Add macro for refcounting runtime structures.
The macro with the extra dtor parameter is intended for structures like
rust_chan which may not necessarily delete themselves when the ref count
becomes 0. This functionality will be used in an upcoming changeset.
2011-07-01 16:59:10 -07:00
Rob Arnold
73cc624e8e Move the channel destroy code into rust_chan.
This lets native code more easily destroy channels since directly deleting a
channel is not always the right way to destroy it.
2011-07-01 16:59:10 -07:00
Rob Arnold
09921cf86f Move channel cloning logic into a method on rust_chan.
This will allow us to more easily clone channels from native code.
2011-07-01 16:59:10 -07:00
Brian Anderson
396c4defcc Introduce --cfg argument for providing additional configuration. Issue #489 2011-07-01 15:30:25 -07:00
Brian Anderson
a34b61fb15 Add some FIXMEs for issue #607 2011-07-01 12:51:46 -07:00
Brian Anderson
021b203fc6 Add some logging to attr when reading crate link attributes
Only link attributes of the meta_list type are considered when matching crate
attributes. Instead of doing nothing we can at least log that link attributes
of other types were ignored.
2011-07-01 12:30:27 -07:00
Brian Anderson
22be98264e Add a test for mismatched crate metadata in use statements 2011-07-01 12:26:57 -07:00
Patrick Walton
f7a2f01746 Revert "rustc: Change methods in ty::t to use interior vectors"
This reverts commit 6720ea760d.
2011-07-01 11:37:19 -07:00
Patrick Walton
6720ea760d rustc: Change methods in ty::t to use interior vectors 2011-07-01 11:33:17 -07:00
Brian Anderson
172c5633c4 Export only what's in use from front::eval. Issue #604 2011-07-01 10:46:59 -07:00
Brian Anderson
bdc5abe82c Remove unused imports from front::eval 2011-07-01 10:45:30 -07:00
Brian Anderson
8614cc975c Remove remaining unused eval methods. Issue #604 2011-07-01 10:45:30 -07:00
Brian Anderson
91b87b31e5 Remove the concept of crate directive let statements. Issue #604 2011-07-01 10:45:30 -07:00
Brian Anderson
d8fe0d7cee Remove the concept of crate directive expressions. Issue #604 2011-07-01 10:45:30 -07:00
Brian Anderson
bca45720f7 Remove the environment concept from front::eval
This is the old method of conditional compilation. It is going away.

Issue #489
2011-07-01 10:45:30 -07:00
Brian Anderson
70a28dc238 Cleanup attribute code. Issue #487 2011-07-01 10:45:30 -07:00
Brian Anderson
26ce1e1035 Add some helper functions to front::attr 2011-07-01 10:45:29 -07:00
Brian Anderson
5fb9cad38d Partially restore the fuzzer crate's build rules
Right now the stage1/fuzzer crate will build but it's not linked to librustc
because stage1/librustc won't link.
2011-07-01 10:43:21 -07:00
Marijn Haverbeke
77f5d14f14 Track def_ids of native types so that they can be distinguished
Closes #526
2011-07-01 18:39:24 +02:00
Marijn Haverbeke
d863cdb98f Add tests for newtype-style tags 2011-07-01 17:51:49 +02:00
Marijn Haverbeke
432e5e9f7f Allow dereferencing of single-variant, single-argument tag values
(Using the * operator.)

This makes tags more useful as nominal 'newtype' types, since you no
longer have to copy out their contents (or construct a cumbersome
boilerplate alt) to access them.

I could have gone with a scheme where you could dereference individual
arguments of an n-ary variant with ._0, ._1, etc, but opted not to,
since we plan to move to a system where all variants are unary (or, I
guess, nullary).
2011-07-01 17:51:47 +02:00
Marijn Haverbeke
57e6340253 Allow 'newtype' syntax for tags
Doing this:

    tag foo = mytype;

is now equivalent to doing this:

    tag foo { foo(mytype); }
2011-07-01 17:51:43 +02:00
Marijn Haverbeke
fb72be0a89 Do not store a tag num for single-variant tags
This is a preparation for tags-as-nominal-types. A tag that has only a
single variant is now represented, at run-time, as simply a tuple of
the variant's parameters, with the variant id left off.
2011-07-01 17:50:52 +02:00
Marijn Haverbeke
bf20fe5575 Make sure the pretty-printer understand resources 2011-07-01 13:04:49 +02:00
Michael Sullivan
7b1b5d5a8a Implement autoderef for function calls.
This is important since we are going to be making functions noncopyable
soon, which means we'll be seeing a lot of boxed functions.
(*f)(...) is really just too heavyweight.

Doing the autodereferencing was a very little bit tricky since
trans_call works with an *lval* of the function whereas existing
autoderef code was not for lvals.
2011-07-01 12:39:58 +02:00
Michael Sullivan
ee45d54a4e Move autoderefed_ty to ty.rs and rename it type_autoderef. 2011-07-01 12:39:57 +02:00
Kelly Wilson
1e4f198a1d Update RustWrapper.cpp so that LLVM revision 134231 from June 30, 2011 at 22:15 GMT, works. 2011-07-01 00:56:49 -06: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
Patrick Walton
b773f8d22b rustc: Duplicate heap data of interior vectors when passing them by value 2011-06-30 19:09:52 -07:00
Graydon Hoare
0eb257e864 Minor pp cleanups. 2011-06-30 17:58:19 -07:00
Graydon Hoare
6d441d3238 Preserve hard \n\n pairs from source when pretty-printing, as explicit formatting control from users. 2011-06-30 17:25:20 -07:00
Patrick Walton
dc9f285b06 rustc: Remove unused variables from last commit 2011-06-30 16:19:04 -07:00
Patrick Walton
108cc4e0ed rustc: Change function argument types to interior vectors 2011-06-30 16:11:39 -07:00
Brian Anderson
50b1953f9b Pretty-print view items in mod items
For mods that aren't defined at the file level we were forgetting to print the
view items so, e.g. 'mod { use std; }' would not print correctly.
2011-06-30 16:08:28 -07:00
Graydon Hoare
1e63d5303f Restore some functionality that got stripped out of the export tests while last reformatting. 2011-06-30 15:39:25 -07:00
Brian Anderson
64d6081429 Use attributes for conditional compilation in std.rc 2011-06-30 14:13:49 -07:00
Brian Anderson
39fccf3bc7 Conditionally compile items declared as statements. Issue #489 2011-06-30 13:04:35 -07:00
Brian Anderson
6346a67cbd Add more tests for conditional compilation. Issue #489 2011-06-30 13:04:35 -07:00
Tim Chevalier
7fd04a21a1 remove an unused variable 2011-06-30 12:45:50 -07:00
Tim Chevalier
37bfbc4b79 Get rid of remaining unused variables 2011-06-30 12:37:30 -07:00
Tim Chevalier
6a74253d60 Don't warn about unused for-loop index variables 2011-06-30 12:37:30 -07:00
Tim Chevalier
d8db9a0fe1 Kill unused variables 2011-06-30 12:37:30 -07:00
Tim Chevalier
a0cdb23892 Get rid of an unused variable 2011-06-30 12:37:30 -07:00
Tim Chevalier
4519f54857 Warn for unused variables
Modify typestate to check for unused variables and emit warnings
where relevant. This exposed a (previously harmless) bug in
collect_locals where outer functions had bit-vector entries
for init constraints for variables declared in their inner
nested functions. Fixing that required changing collect_locals to
use visit instead of walk -- probably a good thing anyway.
2011-06-30 12:37:30 -07:00
Patrick Walton
add9031dd5 rustc: Use interior vectors for record types 2011-06-30 12:02:40 -07:00
Patrick Walton
fd0d1cb7d8 rustc: Make mk_imm_tup() take an interior vector 2011-06-30 11:35:05 -07:00
Patrick Walton
b841152a40 rustc: Use interior vectors for tuple types 2011-06-30 11:35:05 -07:00
Patrick Walton
be50cdd24a rt: Add room for the new fill slot when resizing interior vectors 2011-06-30 11:35:05 -07:00
Eric Holk
e1927553a5 Added a new version of pfib that's better suited for benchmarking the task system. It generates gnuplot output. 2011-06-30 11:32:16 -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
Brian Anderson
441c7e0610 Un-XFAIL run-pass/conditional-compile.rs. Issue #489 2011-06-30 10:06:26 -07:00
Brian Anderson
4165d3640a Add a pass to fold out items that do not belong in the current configuration
The parser needs to parse unconfigured items into the AST so that they can
make the round trip back through the pretty printer, but subsequent passes
shouldn't care about items not being translated. Running a fold pass after
parsing is the lowest-impact way to make this work. The performance seems
fine.

Issue #489
2011-06-30 10:06:26 -07:00
Brian Anderson
3483c65b1f Add missing item variants to fold_item_underscore 2011-06-30 10:06:26 -07:00
Brian Anderson
aa6a3debf3 Add missing expression variants to fold_expr 2011-06-30 10:06:26 -07:00
Brian Anderson
1f0c25406c Fold the crate-level module in front::fold 2011-06-30 10:06:26 -07:00
Brian Anderson
5de916dd5c Move middle::attr to front::attr 2011-06-30 10:06:26 -07:00
Brian Anderson
afc8a5c031 Convert the eval::env to an ast::crate_cfg
crate_cfg will replace eval::env as the mechanism for conditional compilation.
This is a transitional step so they can both exist together.

Issue #489
2011-06-30 10:06:25 -07:00
Brian Anderson
d53bfad8e7 Introduce a config property to the crate AST node
This represents the compilation environment, defined as AST meta_items, Used
for driving conditional compilation and will eventually replace the
environment used by the parser for the current conditional compilation scheme.

Issue #489
2011-06-30 10:06:25 -07:00
Brian Anderson
cbcc7bba30 Introduce a testcase for conditional compilation via attributes
Issue #489
2011-06-30 10:06:21 -07:00
Brian Anderson
78a82b9fd1 Switch rustc's crate metadata to use the link attribute 2011-06-30 10:03:07 -07:00
Marijn Haverbeke
86f16b90cd Support type parameters in resources
Some rather dodgy code was added to trans in the process. I'd love to
discuss it with someone who knows more about types during translation.
2011-06-30 18:36:12 +02:00
Marijn Haverbeke
31ec26d46a Make calling resource destructors work cross-crate
Tydescs are currently re-created for each compilation unit (and I
guess for structural types, they have to be, though the duplication
still bothers me). This means a destructor can not be inlined in the
drop glue for a resource type, since other crates don't have access to
the destructor body.

Destructors are now compiled as separate functions with an external
symbol that can be looked up in the crate (under the resource type's
def_id), and called from the drop glue.
2011-06-30 18:36:12 +02:00
Graydon Hoare
8c36a76626 More fiddling with fast-check, now works on at least one windows machine. 2011-06-30 09:26:17 -07:00
Rafael Ávila de Espíndola
5b7ce80ffa Second try to remove -lssp. 2011-06-30 08:55:25 -04:00
Eric Holk
b3e5b5bd05 Added inheritance for task pinning. Closes #598 for real. 2011-06-29 18:56:34 -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
Graydon Hoare
afabde19dc More fixes to fast-check. 2011-06-29 17:54:05 -07:00
Brian Anderson
a82aeb7af6 Register new snapshots
Also finish transition of snapshot scripts for new glue.o location
2011-06-29 17:45:54 -07:00
Brian Anderson
865534978f Change snapshot logic to archive glue.o from the lib directory 2011-06-29 15:39:30 -07:00
Graydon Hoare
4e5d32e1c4 Add fast-check target that combines the stage2 run-pass suite into a single executable. 2011-06-29 15:14:55 -07:00
Graydon Hoare
c796a8f24d Re-enable tidy (it was broken) and fix various non-tidy things. 2011-06-29 15:14:55 -07:00
Brian Anderson
190644063e Be more strategic about linking to rust crates
Instead of linking directly to the rust crate, try to figure out the location
and name of the library from the file name, then call gcc with appropriate -L,
-l flags. This will allow dynamic linking to be more forgiving about where it
loads the library from at runtime - currently a stage3 compiler can't run
correctly from the stage0 directory. Only tested on Linux. Fingers crossed.
2011-06-29 14:35:39 -07:00
Brian Anderson
e130e7b598 Display an error when linking fails 2011-06-29 14:35:39 -07:00
Brian Anderson
e60cb9197f Add session.note method 2011-06-29 14:35:39 -07:00
Brian Anderson
4ffa5ddf76 session.err shouldn't take a span 2011-06-29 14:35:39 -07:00
Tim Chevalier
76b755f9ad Remove workaround for a compiler bug that, I guess, got fixed 2011-06-29 14:28:03 -07:00
Tim Chevalier
88447a47c0 Eliminate the --check-claims compiler flag
The option can only be toggled at runtime now.
2011-06-29 14:28:02 -07:00
Tim Chevalier
1ba85932b1 Add a runtime flag to enable/disable claims en masse
Now, if the environment variable CHECK_CLAIMS is set, then all
claims turn into checks. Otherwise, claims are no-ops.
2011-06-29 14:28:02 -07:00
Brian Anderson
d4b5b48e0a Correctly locate the crate's version from the link attribute 2011-06-29 14:21:39 -07:00
Brian Anderson
29afe1a518 Write metadata for sythesized name/vers items to the crate's link attr
If the crate doesn't specify it's name or version, the defaults need to be
exported in the crate metadata
2011-06-29 14:21:39 -07:00
Brian Anderson
308bc31f24 Encapsulate more crate meta calculations 2011-06-29 14:21:39 -07:00
Brian Anderson
325f46da06 Move the calculation of the crate name, vers and cmh to a single function 2011-06-29 14:21:39 -07:00
Rafael Ávila de Espíndola
8c535d4aba Don't enable ssp everywhere. 2011-06-29 16:25:54 -04:00
Graydon Hoare
5b2c17fba5 Fix resource encoding bugs. 2011-06-29 12:14:29 -07:00
Graydon Hoare
750dcc05e4 Make tests a little more friendly to combine. 2011-06-29 12:14:29 -07:00
Patrick Walton
b18cefdfd7 rustc: Fix a leak that resulted from copying a structural interior type containing interior vectors. Add a test case. 2011-06-29 12:16:07 -07:00
Patrick Walton
a2ce532337 rt: Remove the lock around upcall_vec_append. Add a test case. Closes #156. 2011-06-29 10:33:51 -07:00
Rafael Ávila de Espíndola
54f618128e Revert ""Try" push without -lssp on windows to see what needs it."
This reverts commit 47b3e087e9.
2011-06-29 13:25:52 -04:00
Patrick Walton
bbd0d58955 rustc: Unbreak self assignment 2011-06-29 10:22:53 -07:00
Rafael Ávila de Espíndola
47b3e087e9 "Try" push without -lssp on windows to see what needs it. 2011-06-29 12:56:54 -04:00
Michael Sullivan
1d05718c2d Extend visit to use visit_fn to visit fn expressions. 2011-06-29 09:04:00 -07:00
Brian Anderson
bc47804473 Revert "Register new snapshots"
This reverts commit b29886cdeb.
2011-06-28 22:50:20 -07:00
Brian Anderson
b29886cdeb Register new snapshots 2011-06-28 22:24:33 -07:00
Brian Anderson
7c500fc0a0 Replace common::new_seq_hash with an adapter around std::smallintmap
It would be better to either convert ast_map to use smallintmap or make
smallintmap and hashmap follow the same interface, but I don't feel up to
it just now. Closes #585.
2011-06-28 19:48:33 -07:00
Lindsey Kuper
7b5d34aa9a Comments and cleanup. 2011-06-28 19:06:44 -07:00
Lindsey Kuper
57e5cde3a2 Comments and cleanup. 2011-06-28 18:54:56 -07:00
Lindsey Kuper
684c0dc494 Comments and cleanup. 2011-06-28 18:54:56 -07:00
Lindsey Kuper
9155544a5a Comments. 2011-06-28 18:54:56 -07:00
Brian Anderson
6832f75f0b Support attaching attributes to modules via the crate file. Issue #487 2011-06-28 18:39:34 -07:00
Patrick Walton
74f8eb51ae rustc: Move duplicate_heap_parts to copy glue; add a test case 2011-06-28 17:59:30 -07:00
Tim Chevalier
db478ed4de Remove outdated comments 2011-06-28 17:50:07 -07:00
Graydon Hoare
5059c5f8fd Actually notice xfail-stage2 as different from xfail-stage2. Fix affected tests. 2011-06-28 17:36:51 -07:00
Michael Sullivan
b944d8d72e Require that both sides of a swap be lvals. 2011-06-28 17:28:06 -07:00
Graydon Hoare
d79330de26 Fix logic bug in std::fs::dirname. 2011-06-28 17:24:30 -07:00
Brian Anderson
83b7215366 Cleanup attribute code. Issue #487 2011-06-28 16:55:07 -07:00
Brian Anderson
82a74fcb3f Remove the last traces of the distinction between export / local meta items
Issue #487
2011-06-28 16:55:07 -07:00
Patrick Walton
dfcfef41df rustc: Rename take glue to copy glue 2011-06-28 16:52:59 -07:00
Tim Chevalier
9f1444c701 Implement "claim"
Implement "claim" (issue #14), which is a version of "check" that
doesn't really do the check at runtime. It's an unsafe feature.

The new flag --check-claims turns claims into checks automatically --
but it's off by default, so by default, the assertion in a claim
doesn't execute at runtime.
2011-06-28 16:41:06 -07:00
Eric Holk
866ee6ecb4 Re-enabling some tests. 2011-06-28 16:12:34 -07:00
Eric Holk
f6f8a06d6b Resurrecting the runtime unit tests, and modifying them so they compile under the latest refactoring changes. 2011-06-28 16:12:34 -07:00
Eric Holk
657e5a2bd5 Renamed what's left of rust_dom to rust_scheduler 2011-06-28 16:12:33 -07:00
Eric Holk
02f6645fca Moved win32_require to the kernel. 2011-06-28 16:12:33 -07:00
Eric Holk
2f84987a48 Fixed Win32 compile errors. 2011-06-28 16:12:33 -07:00
Eric Holk
49a8cb34d2 Removed dom_owned, splitting things between task_owned and kernel_owned. Had to re-xfail a few tests brson recently un-xfailed. 2011-06-28 16:12:33 -07:00
Eric Holk
f6f945fed5 Moved thread management to rust_kernel. 2011-06-28 16:12:33 -07:00
Eric Holk
c6d8324830 There is only one domain per kernel now. 2011-06-28 16:12:33 -07:00
Eric Holk
1c852ac9c0 Removing runtime tests. The runtime is tested well enough by the standard library tests, so we might as well have less code to fix during refactoring. 2011-06-28 16:12:33 -07:00
Eric Holk
64596e6583 Teach the parser and typechecker to understand port[int](). Closes #588 2011-06-28 16:11:04 -07:00
Brian Anderson
1c6ae8cadf Use span_fatal for failure to find crates 2011-06-28 16:04:09 -07:00
Brian Anderson
46b83a92d6 Add test case for non-matching crate metadata in use statements 2011-06-28 15:58:22 -07:00
Brian Anderson
8ac60e99ea Extract meta_item sorting from back::link to middle::attr 2011-06-28 15:46:09 -07:00
Brian Anderson
aecc5e6e0f Add comments to middle::attr. Issue #487 2011-06-28 15:34:27 -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
Brian Anderson
0608e277b6 Add some helper functions for attributes. 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
Tim Chevalier
d832f7abec Another test for typestate and expr_fn 2011-06-28 13:14:52 -07:00
Tim Chevalier
28459ca0eb Handle lazy binops properly in typestate
The typestate analysis now reflects that the second operand of a
logical and or or may not be evaluated.
2011-06-28 13:07:52 -07:00
Tim Chevalier
a7c4c19d4b add a predicate that determines whether a binop is lazy (and and or are lazy) 2011-06-28 13:07:52 -07:00
Rafael Ávila de Espíndola
d5fc01caef Move glue.o to stageN/lib. 2011-06-28 15:20:43 -04:00
Tim Chevalier
926049eddd Tests only: more tests with constraints and loops 2011-06-28 11:49:11 -07:00
Patrick Walton
1ca0db5421 rustc: Add a "type-owns-heap-mem" cache. 2x translation speedup. 2011-06-28 11:36:11 -07:00
Patrick Walton
5f5b7e3348 rustc: Don't call cmp glue if the type is a simple scalar 2011-06-28 11:24:34 -07:00
Graydon Hoare
0dc2aa3d09 Bit more work on mingw cross. Pending on other changes now (test combination, build artifact locations) 2011-06-28 11:18:34 -07:00
Brian Anderson
cab73f8897 Write metadata for more meta_item types. Issue #487 2011-06-28 10:12:05 -07:00
Brian Anderson
f53c4f79d7 Write metadata for crate attributes. Issue #487 2011-06-28 10:03:41 -07:00
Brian Anderson
894e2229ac Add emacs variables to encoder.rs 2011-06-28 10:03:40 -07:00
Brian Anderson
d328c7e03e List crate attributes when running rustc with '--ls' 2011-06-28 10:03:40 -07:00
Marijn Haverbeke
9561def209 Use 'resource' rather than 'res' as a keyword
Resources are now defined like...

    resource fd(int n) { close(n); }

Calling fd with an int will then produce a non-copyable value
that, when dropped, will call close on the given int.
2011-06-28 18:00:39 +02:00
Marijn Haverbeke
fb14afd5eb Add test cases for resources 2011-06-28 18:00:38 +02:00
Marijn Haverbeke
07125aa38b Fix bug that prevented boxes-in-resources from being freed 2011-06-28 18:00:05 +02:00
Marijn Haverbeke
e2cb97a2fc Add some missing cases for ty_res in ty.rs 2011-06-28 18:00:05 +02:00
Marijn Haverbeke
d730bb730a Make it possible to use * to dereference a resource 2011-06-28 18:00:05 +02:00
Paul Stansifer
b3443eb049 '#simplext' -> '#macro' 2011-06-28 15:02:12 +00:00
Paul Stansifer
c3901cdf8e Add simple syntax extension (#simplext) 2011-06-28 15:02:12 +00:00
Paul Stansifer
b632681780 Add AST fold. 2011-06-28 15:02:12 +00:00
Marijn Haverbeke
be748fc215 Properly guard resource values against double-drop
Ths involved adding an extra field to their representation, so that there is
something to check for zero.
2011-06-28 16:14:15 +02: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
Patrick Walton
663aa76635 rustc: Call cmp glue directly if we statically know it 2011-06-27 18:35:01 -07:00
Patrick Walton
dfccd5a138 rustc: Fix stack explosion on -O0 from Alloca() instead of alloca() in cmp glue 2011-06-27 18:27:26 -07:00
Tim Chevalier
85b5b2a8e4 Tests for while loops that may invalidate constraints
Wrote some small test cases that use while loops and moves, to
make sure the poststate for the loop body gets propagated into the
new prestate and deinitialization gets reflected.

Along with that, rewrite the code for intersecting states. I still
find it dodgy, but I guess I'll continue trying to add more tests.
Also, I'll probably feel better about it once I start formalizing
the algorithm.
2011-06-27 18:14:23 -07:00
Tim Chevalier
6d1050b1c7 pure_exp should set the state, not extend it
This fixes a bug where de-initializations were getting masked
(and programs that used a variable that had been de-initialized
snuck through).
2011-06-27 18:14:23 -07:00
Brian Anderson
a72481f90b Rename metadata::defs to metadata::tags 2011-06-27 16:43:50 -07:00
Brian Anderson
55944f4e7f Don't export some of the metadata modules 2011-06-27 16:38:57 -07:00
Brian Anderson
df2cfac07f Move what's left of metadata::cwriter into middle::trans 2011-06-27 16:30:27 -07:00
Brian Anderson
45efb1f02a Cleanup in metadata module 2011-06-27 16:30:27 -07:00
Brian Anderson
119193497e Extract metadata::decoder from metadata::creader 2011-06-27 16:30:27 -07:00
Brian Anderson
a3a2cc3d98 Extract metadata::tydecode from metadata::creader 2011-06-27 16:30:27 -07:00
Brian Anderson
33294c7293 Extract llvm-independent code from cwriter to metadata::encoder 2011-06-27 16:30:27 -07:00
Brian Anderson
279a229414 Move metadata tag definition to metadata::defs 2011-06-27 16:30:27 -07:00
Brian Anderson
6c23e09454 Limit exports from metadata::tyencode 2011-06-27 16:30:27 -07:00
Brian Anderson
5601a6f534 Move metadata::cwriter::encode to metadata::tyencode 2011-06-27 16:30:27 -07:00
Brian Anderson
ba5c7a570d Rename middle::metadata to metadata::cwriter. Move creader to metadata
Preparation for a lot more metadata refactoring
2011-06-27 16:30:27 -07:00
Brian Anderson
d4a5487e1c Limit exports from middle::metadata 2011-06-27 16:30:27 -07:00
Patrick Walton
e4b5d910dc rustc: Directly emit calls to glue if possible 2011-06-27 15:38:21 -07:00
Michael Sullivan
12d9d07a84 Improve the tests for vector self appending. 2011-06-27 12:34:45 -07:00
Michael Sullivan
99b4fff4d2 Properly handle the case where src==dst but we have to allocate a new vector. 2011-06-27 12:34:45 -07:00
Michael Sullivan
ec80918865 Add a test written by jdm that tests repeated vector self appending. 2011-06-27 12:34:45 -07:00
Michael Sullivan
8ad7f3b56b Properly handle the case where src==dst in upcall_vec_append. 2011-06-27 12:34:44 -07:00
Brian Anderson
36fb754476 Index obj and res ctor metadata by ctor id, not item id
Both the type and the ctor were trying to use the same id and this was making
creader unable to find the ctor when running 'rustc --ls'
2011-06-27 12:34:44 -07:00
Patrick Walton
b55277002b etc: Eliminate dyld valgrind errors on OS X 2011-06-27 12:34:13 -07:00
Rafael Ávila de Espíndola
ac081c30be Record and link with used native libraries. 2011-06-27 15:24:44 -04:00
Tim Chevalier
a6f36ba3f5 removing log statement that snuck in there 2011-06-27 11:38:07 -07:00
Tim Chevalier
1656fa19ef Implement move for scalar values
Before, something like:

let int y = 42;
let int x;
x <- y;

would cause an LLVM assertion failure. Fixed it.
2011-06-27 11:32:06 -07:00
Graydon Hoare
bc9fa31618 A little tidying in rt. 2011-06-27 10:08:57 -07:00
Eric Holk
022ebc198b Implementation mising features in lock_and_signal for Win32. Also lowered the minimum stack size to get the pfib benchmark to run without exhausting its address space on Windows. 2011-06-27 09:58:39 -07:00
Eric Holk
681c063ec0 Conservatively serialize nearly all upcalls. Successfuly ran make check with RUST_THREADS=8, so we're probably fairly safe now. In the future we can relax the synchronization to get better performance. 2011-06-27 09:58:39 -07:00
Eric Holk
6367bcf427 Fixed a few concurrency bugs. Still not perfect, but overall it seems much more reliable. 2011-06-27 09:58:39 -07:00
Eric Holk
4d99bf9af2 Added some locking to ports to prevent the case where two threads simultaneously wake up a task blocked on a certain port. 2011-06-27 09:58:39 -07:00
Eric Holk
cb00befff0 Added an environment variable to control how many threads to use. 2011-06-27 09:58:39 -07:00
Eric Holk
4bc773465f Basic multithreading support. The infinite loops test successfully maxes out the CPU. 2011-06-27 09:58:39 -07:00
Eric Holk
91eadfd1ea Added a parallel fibonacci program. It doesn't actually run in parallel yet, but it will give us something fun to test threading with. 2011-06-27 09:58:39 -07:00
Rafael Ávila de Espíndola
bea28ea537 Easy fix for using newer LLVMs: just use the MachOObjectFile.cpp they provide. 2011-06-27 11:52:23 -04:00
Brian Anderson
fcbdac96dd Update README files 2011-06-26 22:27:22 -07:00
Brian Anderson
f2d76bcd7d Remove src/run.py
This script is totally bitrotted
2011-06-26 22:01:32 -07:00
Brian Anderson
29a8219c4c Add a very simple map implementation for sequential integer keys
Use it for the ast_map. Cuts 40% off the time spent prior to LLVM.
2011-06-26 20:37:08 -07:00
Brian Anderson
08b49a5d8f Reformulate an assert in ty::tag_variants
This was doing a redundant hashmap lookup. Removing the redundancy trims 5%
(2.8s) off rustc's compile time
2011-06-26 18:02:47 -07:00
Brian Anderson
cfaa0f4b91 Fail typechecking for bad binop/type combinations
Includes assignment operations. Add regression tests for lots of less useful,
less used or unexpected combinations, as well as a selection of compile-fail
tests. Closes #500 (again!)
2011-06-25 19:42:59 -07:00
Brian Anderson
51d07830ba Add a test for mismatched types when comparing functions 2011-06-25 19:28:19 -07:00
Marijn Haverbeke
afa632124f Use single-bar or to make tstate/states.rs prettier
Sorry. This is the kind of thing I do when I'm on a plane and too
tired to manage anything that requires thinking.
2011-06-25 21:16:03 +02:00
Marijn Haverbeke
7432017d5e Primitive support for non-copyable values 2011-06-25 21:15:11 +02:00
Marijn Haverbeke
f6753be655 Allow moving out of temporary values
This will probably need more work, as moving doesn't appear to do
quite the right thing yet in general, and we should also check
somewhere that we're not, for example, moving out the content out of
an immutable field (probably moving out of fields is not okay in
general).
2011-06-25 21:15:11 +02:00
Marijn Haverbeke
61fc12d0d0 Partial implementation of resources
Non-copyability is not enforced yet, and something is still flaky with
dropping of the internal value, so don't actually use them yet. I'm
merging this in so that I don't have to keep merging against new
patches.
2011-06-25 21:15:11 +02:00
Marijn Haverbeke
781a265b88 Remove variable name 'res' from test suite 2011-06-25 21:15:04 +02:00
Tim Chevalier
c772269f08 Fix inexhaustive match in parser 2011-06-24 22:38:01 -07: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
Michael Sullivan
818d7c9398 Use visit_fn_{pre,post} to avoid going past lambdas during writeback instead of explicitly casing. 2011-06-24 15:55:08 -07:00
Michael Sullivan
4499ebe858 Add a test that tests typestate checking inside of fn exprs. 2011-06-24 15:46:20 -07:00
Michael Sullivan
b732ec6f82 Have walk call visit_fn_pre and visit_fn_post on fn expressions.
As a side effect, this fixes a bug where typestate would not properly be checked
inside of fn expressions.
2011-06-24 15:46:20 -07:00
Michael Sullivan
f3717da1b1 Modify the fn vistors in walk so that they can handle functions without names. Update the typestate code to understand this. 2011-06-24 15:46:20 -07:00
Paul Stansifer
142ff011da Make a test compile faster. 2011-06-24 14:47:36 -07:00
Patrick Walton
baf474443a rustc: Increment by the unit size in iter_structural_ty when iterating over interior vectors if the unit size is dynamic 2011-06-24 17:36:30 -04:00
Marijn Haverbeke
2ebd19477b Sanitize use of ids for obj constructors.
Typeck and trans used to, by historical coincidence, use the item_obj
node id, which was used to identify the obj type by the rest of the
system, for the constructor function. This is now identified by the
ctor id stored in the tag throughout.
2011-06-24 21:22:52 +02:00
Marijn Haverbeke
9643aedb04 Remove uses of variable name 'res' from rustc
This in preparation of making 'res' a keyword for defining resources.
Please don't introduce too many new ones in the meantime...
2011-06-24 21:22:23 +02:00
Marijn Haverbeke
d507d5fe91 Remove res idents from stdlib 2011-06-24 21:13:26 +02:00
Marijn Haverbeke
3d7fdb509a Remove def_obj
Since obj constructors and types have different def_ids now,
their def can simply be a def_fn and a def_ty.
2011-06-24 21:13:25 +02:00
Patrick Walton
b4c0893a39 rustc: If needed, duplicate types' heap parts recursively through structural types 2011-06-24 14:32:50 -04:00
Brian Anderson
1e7f06b17a test: Improve ternary operator tests 2011-06-23 23:27:32 -07:00
Brian Anderson
3aa8d7ff45 rustc: Pretty-print ternary operator 2011-06-23 23:14:40 -07:00
Brian Anderson
b9fc4dfc54 rustc: Cleanup trans_if, trans_alt 2011-06-23 22:16:16 -07:00
Brian Anderson
05c0216654 rustc: Add ternary operator. Closes #565
The implementation is so simple it might be considered cheating: at almost
every step the expr_ternary is just converted to expr_if.
2011-06-23 22:16:11 -07:00
Michael Sullivan
5495ad17d1 Fix type inference inside of anonymous functions. 2011-06-23 21:36:10 -07:00
Eric Holk
860e8fd98b Combined set_registers and get_registers into swap_registers. 2011-06-23 20:23:04 -07:00
Eric Holk
98dee91f25 Wrote swap_context in assembly. Closes #548. This also allows us to re-enable optimization on OSX for both gcc and clang. Also, re-enamed task-comm-1.rs, which was previously broken by optimization. 2011-06-23 18:49:29 -07:00
Rafael Ávila de Espíndola
3c534b2bef Remove parse_str_lit_or_env_ident.
We decided to use metadata for the more complex cases, and a simple
string is enough for rustc right now.
2011-06-23 18:42:55 -04:00
Graydon Hoare
14c31c26c2 Flesh out type pp code. 2011-06-23 18:40:44 -04:00
Patrick Walton
f3798fd213 rustc: Load immediate types when iterating over interior vectors 2011-06-23 17:43:03 -04:00
Tim Chevalier
3cf00c1577 Correct error message for argument mode mismatch
If you use a function expecting an alias argument in a context that
expects a function expecting a value argument, or vice versa, the
previous error message complained that the number of arguments was
wrong. Fixed the error message to be accurate.
2011-06-23 11:54:10 -07:00
Lindsey Kuper
5bd65de289 Typo fix in test case. 2011-06-23 10:47:29 -07:00
Tim Chevalier
9a48bd2f21 Compute typestate properly for move
typestate now drops constraints correctly in the post-state of
a move expression or a declaration whose op is a move. It doesn't
yet drop constraints mentioning variables that get updated.

To do this, I had to change typestate to use trit-vectors instead
of bit-vectors, because for every constraint, there are three
possible values: known-to-be-false (e.g. after x <- y, init(y) is
known-to-be-false), known-to-be-true, and unknown. Before, we
conflated known-to-be-false with unknown. But move requires them
to be treated differently. Consider:

(program a)
(a1) x = 1;
(a2) y <- x;
(a3) log x;

(program b)
(b1) x = 1;
(b2) y <- z;
(b3) log x;

With only two values, the postcondition of statement a2 for
constraint init(x) is the same as that of b2: 0. But in (a2)'s
postcondition, init(x) *must* be false, but in (b2)'s condition,
it's just whatever it was in the postcondition of the preceding statement.
2011-06-22 22:13:42 -07:00
Brian Anderson
7105cd1761 test: Add test for string matching in pattern alts. Closes #53 2011-06-22 22:05:11 -07:00
Brian Anderson
54566e9037 rustc: Convert field access on invalid types from an ICE to a fatal error
Closes #367
2011-06-22 21:31:32 -07:00
Lindsey Kuper
d9f452a2a8 Some work on supporting forwarding slots in vtables (issue #539). 2011-06-22 21:07:20 -07:00
Brian Anderson
523a088451 rustc: Use the rhs span when unifying binops
This makes the error message correctly identify the term that wasn't the
expected type. Issue #516.
2011-06-22 20:50:53 -07:00
Brian Anderson
ae234d61ea rustc: Remove some unneeded type annotations 2011-06-22 20:45:02 -07:00
Brian Anderson
d2b7ea877c rustc: Don't commit unification changes until unify succeeds
This is so that subsequent reports about type mismatches get the types
correct.

Issue #516
2011-06-22 20:43:50 -07:00
Brian Anderson
d9b56ec2ea rustc: Limit creader exports 2011-06-22 19:04:04 -07:00
Brian Anderson
ab98f16373 rustc: Downcase metadata::Encode 2011-06-22 18:09:53 -07:00
Brian Anderson
8746b84eec rustc: Handle valueless ret expressions as block results. Closes #521 2011-06-22 17:20:01 -07:00
Paul Stansifer
b4c3b83f26 Fix bug: globbed imports were importing everything visible from the other
module, not just everything exported.
2011-06-22 15:41:39 -07:00
Brian Anderson
adc18bb24a rustc: Introduce and parse additional meta_item forms
Examples: #[test], #[link(name = "vers")]

Issue #487
2011-06-22 13:55:58 -07:00
Rafael Ávila de Espíndola
64513808ca Use fast regalloc and codegen at OptLevel=0. 2011-06-22 16:50:30 -04:00
Brian Anderson
a6e188f8bf rustc: Rename parser.err to parser.fatal 2011-06-22 12:55:26 -07:00
Paul Stansifer
fe0925678c Remove a simidgeon of dead code. 2011-06-23 03:32:57 +08:00
Brian Anderson
cc2a514cdc test: Enable more tests 2011-06-22 08:35:02 -07:00
Michael Sullivan
7a4fb084f1 Pull environment loading out into a function. 2011-06-22 07:03:16 -07:00
Michael Sullivan
6b40cedcb1 Pull building the environment for for_each into a seperate function. 2011-06-22 07:03:16 -07:00
Michael Sullivan
c07443e6eb Removing out-of-date comment. 2011-06-22 07:03:15 -07:00
Tim Chevalier
1a6d029b07 Emit a better error message for unbound type parameters in nested functions
This code was causing a bounds check failure:

fn hd[U](&vec[U] v) -> U {
  fn hd1(&vec[U] w) -> U {
    ret w.(0);
  }
  ret hd1(v);
}

because in hd1, U was being treated as if it referred to a type
parameter of hd1, rather than referring to the lexically enclosing binding
for U that's part of hd.

I'm actually not sure whether this is a legit program or not. But I wanted
to get rid of the bounds check error, so I assumed that program shouldn't
compile and made it a proper error message.
2011-06-21 17:58:49 -07:00
Lindsey Kuper
efd8ff4647 Comments for all the anon obj tests. 2011-06-21 16:35:21 -07:00
Tim Chevalier
7fb35ecf84 Serialize constraints in types (literal arguments still not supported)
This involved, in part, changing the ast::def type so that a def_fn
has a "purity" field. This lets the typechecker determine whether
functions defined in other crates are pure.

It also required updating some error messages in tests. As a test
for cross-crate constrained functions, I added a safe_slice function
to std::str (slice(), with one of the asserts replaced with a
function precondition) and some test cases (various versions of
fn-constraint.rs) that call it. Also, I changed "fn" to "pred" for
some of the boolean functions in std::uint.
2011-06-21 14:37:33 -07:00
Marijn Haverbeke
3b6d94d489 Move names and ids of native items into their recs, rather than their tags 2011-06-21 23:11:00 +02:00
Lindsey Kuper
26d8eaefa7 Puts out burning tinderbox (oops, AST nodes don't have def_ids/anns). 2011-06-21 14:07:28 -07:00
Lindsey Kuper
84005fadbf Some progress on support for extending objects with new fields (issue
into four separate issues (#538, #539, #540, #543) with corresponding
tests.
2011-06-21 13:31:27 -07:00
Lindsey Kuper
718ee98f43 More descriptive identifiers. 2011-06-21 13:31:27 -07:00
Marijn Haverbeke
c34e9b33d9 Move expr ids into the expr record type
This simplifies the tag variants a bit and makes expr_node_id
obsolete.
2011-06-21 22:25:32 +02:00
Brian Anderson
34040be580 test: Add a test for distinguishing attributes from extensions
Issue #487
2011-06-21 11:50:55 -07:00
Patrick Walton
c109c9dd73 rustc: Output an unimplemented message when alias encounters an unknown sequence type 2011-06-21 11:10:14 -04:00
Patrick Walton
062c6b946b rustc: Implement "for" over interior vectors 2011-06-21 11:10:14 -04:00
Brian Anderson
23d6a6bde1 rustc: Remove unused slice call from extfmt. Closes #532 2011-06-21 07:49:40 -07:00
Rafael Ávila de Espíndola
28d1626221 Remove the old library names. These were unused since rustboot.
Right now rustc hardcodes -lrustllvm. The idea is to instead remember all the native
modules used and convert them to -l directives to the linker. In the case of a
library that is installed in an unusual location, Graydon suggested using metadata:

native module foo = "bar" {
}
2011-06-20 18:09:24 -04:00
Rafael Ávila de Espíndola
2ad0954941 Merge remote branch 'upstream/master' 2011-06-20 17:58:37 -04:00
Rafael Ávila de Espíndola
a355505a5f Fix line length. 2011-06-20 17:57:29 -04:00
Marijn Haverbeke
56eb986584 Fix some uses of span_warn in alias.rs that should be span_fatal 2011-06-20 23:53:29 +02:00
Marijn Haverbeke
588dc3897b Make trans use the new ast_map instead of building its own 2011-06-20 23:53:28 +02:00
Marijn Haverbeke
854b3a9b73 Use ast_map in typeck, instead of building another index 2011-06-20 23:53:28 +02:00
Marijn Haverbeke
40db3aa6fb Add a separate AST mapping phase
This will replace the various node_id-to-node mappings done in several
other passes. This commit already uses the new map in resolve, dropping
the ast_map that was built there before.
2011-06-20 23:53:28 +02:00
Marijn Haverbeke
77af54bf6f Reduce confusing variable naming in resolve
'id' is now used for node_ids, 'name' for idents
2011-06-20 23:53:28 +02:00
Marijn Haverbeke
75681f9ad7 Get rid of def_ids and anns in AST nodes, use single node_id
This reduces some redundancy in the AST data structures and cruft in
the code that works with them. To get a def_id from a node_id, apply
ast::local_def, which adds the local crate_num to the given node_id.
Most code only deals with crate-local node_ids, and won't have to
create def_ids at all.
2011-06-20 23:53:28 +02:00
Rafael Ávila de Espíndola
3d8a5cb9e6 Remember the library files we used in rustc and pass them to the "linker".
This avoid the hardcoded -lstd, allows programs to use other crates and avoids
any differences that may exist in the rustc and ld search logic.
2011-06-20 17:44:12 -04:00
Eric Holk
a2dcd08cc2 Added string duplication to deep_copy. Closes #520. 2011-06-20 13:47:02 -07:00
Graydon Hoare
c051501784 Tighten up the hardbreak rules a bit. 2011-06-20 19:58:23 +00:00
Graydon Hoare
8cd0695230 Suppress hardbreaks when following hardbreaks. 2011-06-20 19:58:23 +00:00
Graydon Hoare
035d60d533 Fix interference between if-check and if printing. 2011-06-20 19:58:23 +00:00
Eric Holk
992153672b Removed duplicated ret_ty_of_fn. This also means the native function branch is working now, so this commit closes #506. 2011-06-20 12:04:33 -07:00
Eric Holk
ce50ae3212 Added a test case for #506 2011-06-20 12:04:33 -07:00
Eric Holk
5640bead58 Teach ret_ty_of_fn_ty to understand native functions. Closes #506. 2011-06-20 12:04:33 -07:00
Rafael Ávila de Espíndola
283744ba78 Remove flags that are not used during linking. 2011-06-20 15:00:07 -04:00
Graydon Hoare
97cf57adc1 Fix pp blank-lines insertion at beginning of file and before 'let' decls. 2011-06-20 10:45:33 -04:00
Brian Anderson
200dbe4c4f Remove various rustboot workarounds 2011-06-19 20:48:20 -07:00
Graydon Hoare
9b6ae59b22 Fix pp blank-line insertion after isolated comments in cboxes. 2011-06-19 22:55:58 -04:00
Patrick Walton
3f7380ccec rustc: Change smallintmap to use an ivec and use it for the node type table. 3x typechecking speedup. 2011-06-19 18:03:19 -07:00
Patrick Walton
8cdef277b2 rt: Fix size miscalculation in ivec_reserve 2011-06-19 18:03:19 -07:00
Brian Anderson
6cf9b17086 rustc: Make name resolution errors less fatal
Failure happens at the end of name resolution

Issue #440
2011-06-19 15:23:11 -07:00
Brian Anderson
c5238d57eb rustc: Make import resolution errors less fatal
Failure happens at the end of import resolution

Issue #440
2011-06-19 14:35:50 -07:00
Brian Anderson
76a752e7a4 rustc: Export only what's needed from middle::ty
The list is formidable.
2011-06-19 12:27:43 -07:00
Brian Anderson
80a8af7b47 rustc: Export only what's used from middle::resolve 2011-06-19 12:27:43 -07:00
Brian Anderson
942fcbe7a1 rustc: Re-introduce session.span_err, session.err
These errors are non-fatal. The session.abort_if_errors function needs to be
called at strategic points to convert the previous errors to utter failure.

Issue #440
2011-06-19 12:19:53 -07:00
Brian Anderson
43427dae0c rustc: Rename session.span_err -> span_fatal, err -> fatal
Issue #440
2011-06-19 12:19:53 -07:00
Brian Anderson
cf9ed08a50 Revert previous 6 commits. Hopefully put out Windows fire.
Revert "rustc: Export only what's needed from middle::ty"

This reverts commit 4255d58aa5.

Revert "rustc: Make name resolution errors less fatal"

This reverts commit b8ab9ea89c.

Revert "rustc: Make import resolution errors less fatal"

This reverts commit 92a8ae94b9.

Revert "rustc: Export only what's used from middle::resolve"

This reverts commit 4539a2cf7a.

Revert "rustc: Re-introduce session.span_err, session.err"

This reverts commit 7fe9a88e31.

Revert "rustc: Rename session.span_err -> span_fatal, err -> fatal"

This reverts commit c394a7f49a.
2011-06-19 03:29:19 -07:00
Brian Anderson
4255d58aa5 rustc: Export only what's needed from middle::ty
The list is formidable.
2011-06-19 02:42:05 -07:00
Brian Anderson
b8ab9ea89c rustc: Make name resolution errors less fatal
Failure happens at the end of name resolution

Issue #440
2011-06-19 02:42:05 -07:00
Brian Anderson
92a8ae94b9 rustc: Make import resolution errors less fatal
Failure happens at the end of import resolution

Issue #440
2011-06-19 02:42:01 -07:00
Brian Anderson
4539a2cf7a rustc: Export only what's used from middle::resolve 2011-06-19 02:41:03 -07:00
Brian Anderson
7fe9a88e31 rustc: Re-introduce session.span_err, session.err
These errors are non-fatal. The session.abort_if_errors function needs to be
called at strategic points to convert the previous errors to utter failure.

Issue #440
2011-06-19 02:41:02 -07:00
Brian Anderson
c394a7f49a rustc: Rename session.span_err -> span_fatal, err -> fatal
Issue #440
2011-06-19 02:40:59 -07:00
Brian Anderson
514813148b rustc: Store the lhs and rhs of receive exprs in left to right order
With the changing of receive semantics the parser has been putting the rhs
expression in the first argument of expr_recv and the lhs in the second, and
all subsequent passes have been referring to them backwords (but still doing
the right thing because they were assuming that lhs was the port and rhs was
the receiver).

This makes all code agree on what lhs and rhs mean for receive expressions.
2011-06-18 20:23:05 -07:00
Brian Anderson
364cd5763c rustc: receive is spelled |> now 2011-06-18 20:23:05 -07:00
Brian Anderson
3852f1eee3 Typecheck block tail expressions that are fn return values 2011-06-18 20:23:05 -07:00
Brian Anderson
ddbb31eb8e rustc: Remove the meta keyword
Issue #487
2011-06-18 20:23:05 -07:00
Brian Anderson
f58de2d687 Replace unexported meta tags with attributes
Issue #487
2011-06-18 20:23:05 -07:00
Brian Anderson
60023047a4 rustc: Replace 'export meta' with attributes
Issue #487
2011-06-18 20:23:05 -07:00
Graydon Hoare
814beaafdf Add -lssp on windows in attempt to put out tinderbox; no idea why ssp seems required on mingw. 2011-06-18 22:07:02 -04:00
Patrick Walton
7bb6733f2c test: Add a test case for derived-tydescs-before-dynamic-allocas 2011-06-18 18:44:21 -07:00
Patrick Walton
4f13879218 rustc: Allocate derived tydescs before dynamically sized allocas 2011-06-18 18:43:07 -07:00
Patrick Walton
877f001512 rustc: Don't bother to supply an alignment argument to the memmove intrinsic; LLVM is very fussy about what it considers a constant. 2011-06-18 16:59:44 -07:00
Patrick Walton
ca2ff9c50d stdlib: Add ivec::grow_set() 2011-06-18 16:41:09 -07:00
Patrick Walton
5d90b1df4b stdlib: Add ivec::grow() and ivec::grow_fn() 2011-06-18 16:29:45 -07:00
Patrick Walton
ef65542b1d test: Add test cases for ivec::init_elt, ivec::last, and ivec::slice 2011-06-18 16:05:44 -07:00
Patrick Walton
2ba7729ae7 rustc: Cache results of type_has_pointers. 70% translation speedup. 2011-06-18 00:41:25 -07:00
Patrick Walton
b2bcafe6fd stdlib: Add some more ivec functions, untested as of yet 2011-06-17 19:16:26 -07:00
Patrick Walton
5894e400b6 rustc: Add missing case for interior vectors in alias.rs 2011-06-17 19:16:26 -07:00
Tim Chevalier
7fc89f573d Restructure the "checking" pass in typestate
I noticed that typestate was being lazier than it should be,
because it was only checking typestate for statements and
top-level expression (that is, the expression in a stmt_expr, but
not any subexpressions). So I rewrote the checks in tstate/ck.rs
to use walk, which exposed a few bugs in typestate that I fixed.

Also added some more test cases for if-check.
2011-06-17 19:09:18 -07:00
Patrick Walton
a4eb6630f3 rustc: Increment by the dynamically-computed size in ivec::trans_append. Uncomment init_fn test in lib-ivec. 2011-06-17 19:01:14 -07:00
Brian Anderson
77189f834c rustc: Use correct version key in metadata 2011-06-17 18:33:07 -07:00
Brian Anderson
bd93e1abcd Register new snapshots. Update location of stage0's libstd 2011-06-17 18:19:37 -07:00
Patrick Walton
e0afcb400b test: Comment out the init-fn line in lib-ivec. Puts out burning tinderbox. 2011-06-17 17:53:43 -07:00
Patrick Walton
5fb9325848 rustc: Fix a bunch of memory management bugs relating to generic interior vectors. Uncomment all tests in lib-ivec. 2011-06-17 17:31:24 -07:00
Patrick Walton
68122edac3 Revert "rustc: Fix a bunch of memory management bugs relating to generic interior vectors"
This reverts commit 2b5e40311d.
2011-06-17 16:38:47 -07:00
Patrick Walton
2b5e40311d rustc: Fix a bunch of memory management bugs relating to generic interior vectors 2011-06-17 16:23:06 -07:00
unknown
8c6354ceb9 Made sure getcwd and friends work well on Windows. 2011-06-17 15:53:21 -07:00
Eric Holk
7c57b8baf5 Updating rustrt.def.in so that the path manipulation functions work on OS X. 2011-06-17 15:53:20 -07:00
Eric Holk
9adacfb26a Adding a test case for getcwd and related functions. 2011-06-17 15:53:20 -07:00
Eric Holk
a40116b398 stdlib: added getcwd and a convenience function to make relative paths absolute. This will be helpful for #441. 2011-06-17 15:53:19 -07:00
Brian Anderson
175fd8ee73 Update snapshot scripts to understand new dir layout 2011-06-17 15:39:58 -07:00
Eric Holk
2c1b269960 Implemented enough of deep_copy that we can pass scalars and channels to tasks. Closes #507. 2011-06-17 15:17:46 -07:00
Eric Holk
81fc51a8d7 Started using deep_copy for spawn arguments. 2011-06-17 15:17:46 -07:00
Eric Holk
71e1db596c Added a test case for #507 2011-06-17 15:17:46 -07:00
Brian Anderson
6e6bc5076c rustc: Support both meta tags and attributes for crate metadata
This is a transitional patch for converting from 'meta' to attributes.

Issue #487
2011-06-17 15:07:34 -07:00
Brian Anderson
81a187e8be rustc: Remove metadata from the session.
This mechanism was not being used for anything. Issue #487.
2011-06-17 14:46:59 -07:00
Rafael Ávila de Espíndola
342dbd7abe Put std in stageN/lib. This avoids windows trying to load stageN/std.ll when
stageN/runstc.exe is run.
2011-06-17 15:34:59 -04:00
Patrick Walton
e43a3755dd rustc: Add a type_owns_heap_mem() predicate 2011-06-17 12:32:18 -07:00
Patrick Walton
dfb806b367 rustc: Cast to opaque interior vector types in trans_vec_append if necessary. Puts out burning tinderbox. 2011-06-17 12:23:04 -07:00
Patrick Walton
4918c99f69 rustc: Copy the contents of generic interior vectors 2011-06-17 12:22:53 -07:00
Patrick Walton
4bb7597542 Revert "rustc: Copy the contents of generic interior vectors"
This reverts commit 5bdbe1dfc2.
2011-06-17 12:03:21 -07:00
Patrick Walton
5bdbe1dfc2 rustc: Copy the contents of generic interior vectors 2011-06-17 11:45:51 -07:00
Brian Anderson
e8228e1260 rustc: Demand that if conditions have bool type
Closes #513
2011-06-17 11:35:00 -07:00
Brian Anderson
a4d88dacc9 rustc: Fail to unify if two ty_vars don't unify
Closes #500
2011-06-17 11:35:00 -07:00
Brian Anderson
2a69db5b76 test: Fix mismatched types in prep for typechecker fixes
Issue #500
2011-06-17 11:35:00 -07:00
Brian Anderson
753da64fd6 rustc: Demand unification of both sides of a binop
Issue #500
2011-06-17 11:35:00 -07:00
Rafael Ávila de Espíndola
1dbc0442cd Automatically add a -L to the directory the binary is in. 2011-06-17 13:36:08 -04:00
Patrick Walton
982f51aa95 stdlib: Fix reserve on zero-length interior vectors; uncomment test_unsafe_ptrs() 2011-06-16 18:01:57 -07:00
Paul Stansifer
391348ec86 Consistify ast::local. 2011-06-16 17:56:24 -07:00
Patrick Walton
d47101703e stdlib: Sketch out ivec::init_fn, currently segfaulting 2011-06-16 17:48:59 -07:00
Patrick Walton
ab7ebb608a rustc: Fix dominance issue when translating generic interior vectors 2011-06-16 17:48:32 -07:00
Brian Anderson
a68a5c9b5e Disable lib-ivec's test_unsafe_ptrs. Not working here 2011-06-16 17:34:39 -07:00
Brian Anderson
6f4326c54d Add better error messages for bad attributes in .rc files
Issue #487
2011-06-16 17:23:20 -07:00
Brian Anderson
4b8fba5f34 rustc: Fix regressed handling of bad attributes
Issue #487
2011-06-16 17:23:20 -07:00
Brian Anderson
ffa7c76ed2 rustc: Change print_file to print_crate
The pretty-printer needs access to the crate attributes in order to reproduce
inner crate attributes in standalone .rs files

Issue #487
2011-06-16 17:23:20 -07:00
Brian Anderson
e83a115d79 rustc: Parse crate attributes in standalone .rs files
Issue #487
2011-06-16 17:23:20 -07:00
Brian Anderson
ffae642663 rustc: Parse attributes in crate files
Issue #487
2011-06-16 17:23:20 -07:00
Brian Anderson
62939e41b2 rustc: Parse inner items of file-level modules linked from crate files
Issue #487
2011-06-16 17:23:20 -07:00
Patrick Walton
40746fa447 rustc: Implement conversions from interior vector data to unsafe pointers and vice-versa 2011-06-16 17:07:02 -07:00
Patrick Walton
e50c918e6b rustc: Implement type walking and comparison glue for unsafe pointers 2011-06-16 17:07:02 -07:00
Graydon Hoare
b84fffaa4e Reformat a bunch of recent churn. 2011-06-16 16:55:46 -07:00
Graydon Hoare
eb9969f546 Add support for marking files no-reformat. 2011-06-16 16:42:29 -07:00
Patrick Walton
050f62983d stdlib: Introduce an ivec module into the standard library; add a minimal test case 2011-06-16 16:08:26 -07:00
Patrick Walton
94cd2985b2 rustc: Parse T[mutable?] 2011-06-16 15:17:06 -07:00
Patrick Walton
d90ad442b4 rustc: Work around leak when translating interior vectors. Un-XFAIL interior-vec.rs. 2011-06-16 15:07:21 -07:00
Patrick Walton
5b341443da test: Add an interior-vec test case, XFAIL'd for now because of leaks in the compiler 2011-06-16 14:30:10 -07:00
Patrick Walton
e7575b9f3a rustc: Add cases for istr and ivec to visit 2011-06-16 14:26:11 -07:00
Brian Anderson
99301ff830 test: Add a test for outer attributes on the first module in a file
Issue #487
2011-06-16 14:21:43 -07:00
Brian Anderson
b727d079ed rustc: Pretty print module inner attributes
Issue #487
2011-06-16 14:21:43 -07:00
Brian Anderson
43cbbabccb rustc: Correctly mark attributes as inner attributes
Issue #487
2011-06-16 14:21:43 -07:00
Brian Anderson
f3996d32b0 rustc: Parse inner attributes of modules
Issue #487
2011-06-16 14:21:42 -07:00
Brian Anderson
0efd7fac8a stdlib: Add option::is_some 2011-06-16 14:21:42 -07:00
Tim Chevalier
49a4867da6 Pretty-print if-check 2011-06-16 14:08:48 -07:00
Patrick Walton
4fc286e24e rustc: Parse interior vector types in which the base type is a path properly 2011-06-16 14:03:07 -07:00
Patrick Walton
9210afc8a5 rustc: Pretty print interior vector types 2011-06-16 14:03:07 -07:00
Eric Holk
6ed6791df4 Removing dead upcall_join. Closes #509. 2011-06-16 12:23:13 -07:00
Lindsey Kuper
a5563e173e Clean up whitespace oddities perpetrated by pretty-printer. 2011-06-16 12:21:49 -07:00
Lindsey Kuper
efc55b2a3d Simple anonymous objects compile with stage0. 2011-06-16 12:21:49 -07:00
Tim Chevalier
219924e669 Bring back if-check
Add "if check" (expr_if_check), a variation on check that executes
an "else" clause rather than failing if the check doesn't hold.
2011-06-16 12:13:20 -07:00
Tim Chevalier
94ae4590c5 if-check test case 2011-06-16 12:13:20 -07:00
Michael Sullivan
bd8f6097a7 Get rid of old vec_append glue. 2011-06-16 11:58:29 -07:00
Michael Sullivan
a9d62e5a90 Write some tests for swap. 2011-06-16 11:47:54 -07:00
Michael Sullivan
272c7e2e87 Translate the swap operator. 2011-06-16 11:47:54 -07:00
Michael Sullivan
bc33a5fe50 Fix bug in move on structure types. 2011-06-16 11:47:54 -07:00
Michael Sullivan
cfd1f74ebb Bring swap through typechecking and typestate. 2011-06-16 11:47:54 -07:00
Michael Sullivan
066599104a Parse swap. 2011-06-16 11:47:54 -07:00
Michael Sullivan
e8d2d27a88 Add "<->" to the token definition and the lexer. 2011-06-16 11:47:54 -07:00
Patrick Walton
02c0501a61 rt: memory_region::free(NULL) shouldn't touch the live allocation count 2011-06-16 11:16:03 -07:00
Patrick Walton
4673eb6839 rustc: Fix LLVM type error when generating cmp glue for interior vectors 2011-06-16 11:16:03 -07:00
Rafael Ávila de Espíndola
741e77174c Merge remote branch 'upstream/master' 2011-06-16 14:09:15 -04:00
Rafael Ávila de Espíndola
c51ac6730f Update the snapshots. 2011-06-16 13:49:57 -04:00
Patrick Walton
f9da8b2676 rt: Add an ivec length intrinsic and an ivec reserve function, both untested as of yet 2011-06-16 10:32:52 -07:00
Patrick Walton
66c52036da rustc: Change interior vector syntax to T[] 2011-06-16 10:13:39 -07:00
Marijn Haverbeke
15f71b3600 Refactor ast::item representation
Most of the fields in an AST item were present in all variants. Things
could be simplified considerably by putting them in the rec rather
than in the variant tags.
2011-06-16 13:32:35 +02:00
Brian Anderson
6c2f322f82 Improve and test failure behavior for malformed attributes 2011-06-15 19:30:10 -07:00
Eric Holk
67360ae618 Fixed a problem where spawn arguments were getting lost again. Also, fixed up stack alignment, which closes #496 2011-06-15 18:16:59 -07:00
Eric Holk
c4f9bd9470 Re-enabled join. 2011-06-15 18:16:59 -07:00
Patrick Walton
1fa9133b76 rustc: Implement interior vector concatenation 2011-06-15 18:03:25 -07:00
Eric Holk
260aa408f3 Merge branch 'master' of github.com:graydon/rust into fastcall 2011-06-15 17:45:24 -07:00
Eric Holk
405c164f02 Updating snapshots.txt. Closes #495. 2011-06-15 17:45:02 -07:00
Michael Sullivan
a91d301b31 Add xterm to the term lib's list of supported terms. 2011-06-15 17:33:37 -07:00
Brian Anderson
94d971c0e8 rustc: Remove unused variable from check_assignment 2011-06-15 16:48:59 -07:00
Brian Anderson
f50fd6d8ae stdlib: Add color support for GNU screen 2011-06-15 16:38:17 -07:00
Brian Anderson
c19a026f46 stdlib: Add emacs variables to term.rs 2011-06-15 16:28:14 -07:00
Eric Holk
02018fed42 Step 3 of cdecl conversion. 2011-06-15 16:04:39 -07:00
Brian Anderson
14c5900a70 test: Add a compile-fail test for attribute/syntax parsing
I don't currently know how to deal with syntax extensions that appear betweeen
an attribute and an item, so this test captures the error that occurs.

Issue #487
2011-06-15 16:01:39 -07:00
Brian Anderson
2772a29e92 rustc: Support outer attributes on items that are defined as statements
Issue #487
2011-06-15 16:01:35 -07:00
Eric Holk
89ba649c3a Updating snapshots.txt 2011-06-15 15:57:15 -07:00
Brian Anderson
b8a5440b2d stdlib: Add an either module
Like Haskell's, with left and right tags, various conversion functions
2011-06-15 15:45:41 -07:00
Brian Anderson
95bdedf12d test: Add missing fn test cases to run-pass/item-attributes.rs
Issue #487
2011-06-15 15:45:41 -07:00
Tim Chevalier
a5bca7df88 Refactor data structures representing constraints (again...)
I added a "resolved" version of the ast::constr type -- ty::constr_def
-- that has a def_id field instead of an ann_field. This is more
consistent with other types and eliminates some checking.

Incidentally, I removed the def_map argument to the top-level function
in middle::alias, since the ty::ctxt already has a def_map field.
2011-06-15 15:38:12 -07:00
Patrick Walton
52d4f48144 rustc: Move ivec stuff to an ivec module in trans 2011-06-15 14:43:00 -07:00
Eric Holk
92bd35075b Step 2 of cdecl task transition. 2011-06-15 14:25:53 -07:00
Eric Holk
6a3f4abc6f Updating snapshots.txt 2011-06-15 14:19:40 -07:00
Patrick Walton
6c8e94f397 rustc: Change the default interior vector length to 4 per science 2011-06-15 14:14:33 -07:00
Rafael Ávila de Espíndola
a77180f4f5 Add support for producing shared libraries directly in the rust driver. 2011-06-15 16:54:13 -04:00
Marijn Haverbeke
9b5ebe726c Implement checking of alias safety in tail calls. 2011-06-15 21:39:27 +02:00
Marijn Haverbeke
b2b8002fd3 Fix unsafe uses of aliases in tail calls 2011-06-15 21:39:27 +02:00
Marijn Haverbeke
0987b17dcb Small simplification in parser.rs' crate parsing 2011-06-15 21:39:26 +02:00
Lindsey Kuper
1ad69291bc Added issue # to FIXME. 2011-06-15 12:29:34 -07:00
Lindsey Kuper
fa5a7e7453 Simple anonymous objects get through translation. 2011-06-15 12:18:52 -07:00
Lindsey Kuper
59a254ae32 Just some typo fixes. 2011-06-15 12:18:52 -07:00
Eric Holk
01ea27b205 Step 1 of moving task startup to always be cdecl. 2011-06-15 12:10:15 -07:00
Graydon Hoare
766d54df93 Fix a bunch of compile-command lines to use RBUILD 2011-06-15 12:01:19 -07:00