Marijn Haverbeke
3798b6f780
Remove maybe_protect_block kludge from pretty-printer
...
It is no longer needed.
2011-09-15 10:14:52 +02:00
Marijn Haverbeke
7298b8f4ba
Insert omitted semicolons for statements
2011-09-15 09:49:00 +02:00
Brian Anderson
2bed548d1b
xfail-fast run-pass/linked-failure.rs. Not sure what the problem is.
2011-09-14 17:47:48 -07:00
Brian Anderson
69eda46af8
Add a run-pass test for linked failure
2011-09-14 15:51:46 -07:00
Josh Matthews
f6fe07d1f3
Add support for negative literals.
2011-09-14 00:47:14 -04:00
Marijn Haverbeke
2f402343c9
Make for loop alias-safe
2011-09-13 13:05:59 +02:00
Marijn Haverbeke
3e92f90952
Apply implicit copying for unsafe references to alt patterns
2011-09-13 12:23:36 +02:00
Brian Anderson
393deeb06f
Merge branch 'unwind'
...
Conflicts:
src/comp/middle/trans.rs
src/comp/middle/trans_build.rs
src/lib/run_program.rs
src/test/compiletest/runtest.rs
2011-09-12 09:36:51 -07:00
Marijn Haverbeke
8dd46d4384
Properly implement copy expressions
...
(And use them in some places that were doing {expr} before.)
2011-09-12 13:13:20 +02:00
Marijn Haverbeke
ca1df2b111
Pretty-print for new arg-mode syntax
2011-09-12 12:49:00 +02:00
Marijn Haverbeke
fc6b7c8b38
Reformat for new mode syntax, step 1
...
Long lines were fixed in a very crude way, as I'll be following up
with another reformat in a bit.
2011-09-12 12:04:14 +02:00
Marijn Haverbeke
8b7909afd7
Fix tests for new argument-passing convention
2011-09-12 11:07:20 +02:00
Brian Anderson
cb50e4329a
Add an XFAILed test for native "llvm" modules
...
This functionality is completely broken
2011-09-11 23:14:42 -07:00
Brian Anderson
7940382070
XFAIL run-pass/task-comm-15 on win32 again
...
Maybe it works with check-fast, but it stills fails for me
2011-09-11 17:31:41 -07:00
Brian Anderson
be9fe24220
XFAIL some run-pass unwinding tests on win32
...
Curiously, because of some unfortunate interaction between win32 hacks, all the
run-fail unwind tests actually pass (that wouldn't be the case if we were
valgrinding though).
2011-09-11 17:31:40 -07:00
Brian Anderson
f99cf2d62f
Add a number of unwinding tests
...
Issue #236
2011-09-11 17:31:39 -07:00
Brian Anderson
5c49e4f4e9
Reformat. Issue #855
2011-09-02 22:11:42 -07:00
Brian Anderson
72c14d5a41
Eliminate const_refcount. Issue #855
2011-09-02 15:13:41 -07:00
Patrick Walton
10ea787772
test: Add a test case for linearize_ty_params() and shapes
2011-09-02 10:39:05 -07:00
Brian Anderson
418d09e547
Convert all uses of #ifmt to #fmt. Issue #855
2011-09-01 18:54:03 -07:00
Brian Anderson
6972f07510
Make #fmt and #ifmt synonymous. Issue #855
2011-09-01 17:56:25 -07:00
Brian Anderson
60d0a9227b
Do less work in run-pass/task-comm.rs
...
This test is not important enough to be taking so long
2011-09-01 17:33:39 -07:00
Brian Anderson
ab6bb035e5
Rename std::istr to std::str. Issue #855
2011-09-01 17:27:58 -07:00
Brian Anderson
d8a833dccd
Convert some comm tests to istrs. Issue #855
...
These spawn thunks need to take move-mode strings to be correct
2011-09-01 16:53:53 -07:00
Brian Anderson
e824775d53
Remove std::str. Issue #855
2011-09-01 16:09:15 -07:00
Tim Chevalier
3690f38d79
No, not all fn constraints have the same args as the fn does, in the same order...
...
derp!
Closes #862
2011-09-01 15:41:09 -07:00
Brian Anderson
7924368268
Allow istrs as patterns. Issue #855
2011-09-01 12:14:36 -07:00
Brian Anderson
4c25d81041
Remove some uses of str_buf builtin. Issue #855
2011-09-01 12:14:35 -07:00
Brian Anderson
bb56a75343
Convert main functions to istrs. Issue #855
2011-09-01 12:14:35 -07:00
Brian Anderson
d0c509ad1b
Remove a bunch of string builtins. Issue #855
2011-09-01 12:14:33 -07:00
Brian Anderson
b714150487
Remove more functions from std::str. Issue #855
2011-09-01 12:14:32 -07:00
Brian Anderson
53a9d5a1d2
Start paring down std::str. Issue #855
2011-08-31 16:24:09 -07:00
Brian Anderson
498e38b705
Convert uses of #fmt to #ifmt. Issue #855
2011-08-31 11:44:06 -07:00
Marijn Haverbeke
6209e844ee
Replace xfail-stageN with simply xfail-test
...
Closes #799
2011-08-31 16:32:16 +02:00
Marijn Haverbeke
66bc014720
Revert "Replace xfail-stageN with simply xfail-test"
...
This reverts commit 574194f6bc
.
2011-08-31 14:24:08 +02:00
Marijn Haverbeke
574194f6bc
Replace xfail-stageN with simply xfail-test
...
Closes #799
2011-08-31 13:43:09 +02:00
Brian Anderson
be2ad97a61
Allow main to take istrs. Issue #855
2011-08-30 23:57:09 -07:00
Brian Anderson
c94d4cff03
Convert std::net to istrs. Issue #855
2011-08-30 21:08:07 -07:00
Brian Anderson
4c936d7992
Add #ifmt extension, like #fmt but for istrs. Issue #855
2011-08-30 21:08:07 -07:00
Brian Anderson
9e2c5f77a4
Remove the %S istr conversion from #fmt
...
I want to do the #fmt transition a different way. Issue #855
2011-08-30 21:08:07 -07:00
Tim Chevalier
6d8bb3ce29
Un-xfail zip-same-length
...
There was a type error that was getting reported poorly. Fixed it.
(Now to figure out why the error was reported so poorly...)
2011-08-30 17:19:13 -07:00
Tim Chevalier
4fc72c2130
XFAIL zip-same-length -- that's ok, since it's a new test
2011-08-30 16:43:12 -07:00
Tim Chevalier
819b00079c
Library test cases for vec::zip
2011-08-30 16:42:32 -07:00
Marijn Haverbeke
c9c5ee252a
Implement non-internal ivecs
...
Vectors are now similar to our old, pre-internal vectors, except that
they are uniquely owned, not refcounted.
Their name should probably change too, then. I've renamed them to vec
in the runtime, will do so throughout the compiler later.
2011-08-29 09:07:53 +02:00
Brian Anderson
7284f820d5
Support istrs in #fmt. Issue #855
...
The format string may be an istr and istr args may be used with %S
2011-08-27 15:54:44 -07:00
Brian Anderson
652332f9d4
Convert std::map::new_str_hash to istrs. Issue #855
2011-08-27 15:54:44 -07:00
Tim Chevalier
844e2d7d1c
Test case for checks on pattern-bound vars
2011-08-26 00:46:53 -07:00
Tim Chevalier
809a833e34
Test case for unchecked blocks
2011-08-25 18:33:57 -07:00
Tim Chevalier
d9bc3cb10c
Change "pred" to "pure fn" in all libraries and test cases
2011-08-25 18:24:45 -07:00
Tim Chevalier
e241f2996d
Allow pure fns to have any return type
2011-08-25 17:23:35 -07:00
Eric Holk
2f7c583bc1
Cleaning up task and comm exports, updating all the test cases.
2011-08-25 11:21:25 -07:00
Brian Anderson
65357eeecc
XFAIL task-comm-2. Doesn't work under windows
2011-08-24 12:03:08 -07:00
Brian Anderson
18576e55f7
Resolve a number of FIXMEs
2011-08-23 18:55:37 -07:00
Brian Anderson
c1f2394245
Zero locals with initializers that may break or terminate. Closes #787
2011-08-23 16:29:21 -07:00
Graydon Hoare
c011f13144
Add kind-checking for assign-op, copy, ret, be, fail exprs. Fix caught kinding-violations in rustc and libstd.
2011-08-23 15:58:53 -07:00
Brian Anderson
a3c8d4a5a5
Recheck the while loop contition after continuing. Closes #825
2011-08-23 14:51:22 -07:00
Brian Anderson
663d07d319
Add std::istr. Issue #855
2011-08-22 21:33:49 -07:00
Brian Anderson
d6e4fa6b44
Teach rustc to append istrs. Issue #855
2011-08-22 17:40:06 -07:00
Brian Anderson
3ab86fb79e
Teach rustc to add istrs. Issue #855
2011-08-22 16:39:18 -07:00
Brian Anderson
aae212727d
Encode the istr shape correctly. Issue #855
2011-08-22 16:12:42 -07:00
Brian Anderson
6841f3827a
Fix ivec self-append. Closes #816
2011-08-22 15:04:28 -07:00
Brian Anderson
0f1f5e67ea
Create correct drop glue for istrs. Issue #855
2011-08-22 14:34:55 -07:00
Brian Anderson
fd8ca2cf5d
Translate istr literals. Issue #855
2011-08-22 14:34:36 -07:00
Marijn Haverbeke
7d08678b74
Implement pattern guards
...
The syntax is
alt x {
mypat where mycond { ... }
}
The condition may refer to any of the variables bound by the pattern.
When a guard fails, pattern-matching continues with the next pattern.
Closes #857
2011-08-22 17:49:31 +02:00
Marijn Haverbeke
b24f978011
Drop arguments on the caller side, not the callee
...
This makes it easier for the caller to optimize the take/drop away for
temporary values, and opens up new possibilities for alias handling.
Breaks tail calls.
2011-08-22 10:16:09 +02:00
Brian Anderson
518dc52f85
Reformat
...
This changes the indexing syntax from .() to [], the vector syntax from ~[] to
[] and the extension syntax from #fmt() to #fmt[]
2011-08-20 11:04:00 -07:00
Brian Anderson
7053b6010a
Parse x[y] as indexes
2011-08-19 12:50:05 -07:00
Michael Sullivan
a7e559ee2e
Fix polymorphic iterators. Closes #829 .
2011-08-19 11:54:46 -07:00
Brian Anderson
cc2ebbec92
Pretty-print constrained types correctly
2011-08-19 10:16:39 -07:00
Brian Anderson
09e21fe2b9
Pretty-print parens around more things that need disambiguation
...
Ridiculous stuff like (ret 0) == (log "error")
2011-08-19 10:16:38 -07:00
Brian Anderson
8327416411
Teach the pretty-printer to disambiguate 'if ret { }' et. al
2011-08-19 10:16:38 -07:00
Brian Anderson
664b0ad3fc
Add some tests for expression corner cases, mostly involving ret and fail
...
Some of these don't actually work.
2011-08-19 10:16:38 -07:00
Brian Anderson
d681f062c7
Clean up run-pass/fun-call-variants
...
Uncomment parts of the test that work correctly now, enable pretty testing
2011-08-19 10:16:38 -07:00
Brian Anderson
a0ca1ac1bc
Remove xfail-pretty directives from working tests
2011-08-19 10:16:38 -07:00
Brian Anderson
22c8eebc48
Add a comment about our single use of no-reformat
2011-08-19 10:16:38 -07:00
Tim Chevalier
d81d86440f
Handle sequential let semantics properly in typestate
...
Closes #824
2011-08-18 17:21:55 -07:00
Michael Sullivan
0a00fab249
Fix task-comm-15 type errors and un-xfail.
2011-08-18 16:13:03 -07:00
Eric Holk
3ab21e5ee0
Better type inference for chans and ports.
2011-08-17 17:16:23 -07:00
Brian Anderson
df10df821b
Remove last mentions of vec<> type in Rust source
2011-08-17 16:08:17 -07:00
Eric Holk
94260fb91d
Using move-mode for spawn thunks to avoid race conditions.
2011-08-17 11:44:50 -07:00
Brian Anderson
cd54e77720
Allow multiple imports in a single statement
...
Like so: import foo::{bar, baz};
Issue #817
2011-08-17 11:04:56 -07:00
Brian Anderson
67cc5b9e34
Allow multiple exports in a single export statement. Issue #817
2011-08-17 11:04:05 -07:00
Erick Tryzelaar
b3eba15271
Port the tests to the expr foo::<T> syntax.
2011-08-16 15:05:57 -07:00
Erick Tryzelaar
3520499544
Port the tests to the decl foo<T> syntax.
2011-08-16 15:05:56 -07:00
Erick Tryzelaar
21f46a1655
Port the tests to the typaram foo<T> syntax.
2011-08-16 15:05:56 -07:00
Brian Anderson
f05a91a0dc
Rename std::ivec to std::vec
2011-08-16 10:36:19 -07:00
Brian Anderson
f32079f7c0
Convert most main functions to the ivec signature
...
Converting rustc will still take a snapshot
2011-08-16 10:29:08 -07:00
Brian Anderson
053b8bff5a
Accept main(args: [str]) as main signature
2011-08-16 10:29:08 -07:00
Eric Holk
88a47020cf
Updating sio tests.
2011-08-16 09:45:55 -07:00
Eric Holk
cf2def46c1
Removed trans_comm.rs from the compiler. Updating aio/sio to work with the new chan and port system, started on a networking module for the standard library.
2011-08-16 09:36:29 -07:00
Marijn Haverbeke
e33af7e0b5
Make let bindings' scope start at their definition
...
Also, allow let bindings in a block to shadow each other.
2011-08-16 13:45:41 +02:00
Lindsey Kuper
f91351aaf6
The wonky for...in... whitespace was bothering me. Sorry!
2011-08-15 22:19:50 -07:00
Brian Anderson
cb239cc028
XFAIL task-comm-15
...
Fails consistently on windows
2011-08-15 19:28:38 -07:00
Lindsey Kuper
d55048ec5c
Test case for issue #115 .
2011-08-15 17:10:13 -07:00
Lindsey Kuper
4ff6b6fc27
Test cases for issue #822 .
2011-08-15 16:29:42 -07:00
Lindsey Kuper
93d425e7a5
Simple example of anonymous objects from nothing. Closes #812 .
2011-08-15 16:13:29 -07:00
Michael Sullivan
886c2ee93e
Tests for type inferred lambda-blocks.
2011-08-15 15:48:11 -07:00
Graydon Hoare
814bf41d89
Add operator 'copy', translates as fall-through.
2011-08-15 15:44:41 -07:00
Brian Anderson
9ca8df93b3
XFAIL run-pass/task-killjoin
...
Seems to be failing with some consistency
2011-08-15 15:41:33 -07:00
Paul Stansifer
87b56b5565
Allow [a, b, ..., c]
transcription patterns in MBE.
2011-08-15 15:35:27 -07:00
Eric Holk
871013b942
Syntax updates.
2011-08-15 09:52:18 -07:00
Eric Holk
be7325073a
Removed spawn and task from the parser. Updated all the tests except for the benchmarks.
2011-08-15 09:26:52 -07:00
Eric Holk
c3535f5842
Porting a bunch of tests over.
2011-08-15 09:26:52 -07:00
Eric Holk
cc353aa17a
Removed old object-based chans.
2011-08-15 09:26:51 -07:00
Eric Holk
7ad13392bd
Converted two more spawn tests.
2011-08-15 09:26:51 -07:00
Eric Holk
2f23405a60
Working on more spawn test cases.
2011-08-15 09:26:51 -07:00
Eric Holk
871d1317e5
Move mode for lib comm, converted a few tests.
2011-08-15 09:26:51 -07:00
Eric Holk
39b16077bb
Port ID-based channels.
2011-08-15 09:26:51 -07:00
Marijn Haverbeke
1570949ef1
Re-add some deleted tuple tests
2011-08-15 13:39:45 +02:00
Michael Sullivan
0340f32748
Eliminate autoderef on binops and unary negation.
...
Autoderef on binops is basically unused, kind of silly, and
complicates typechecking. There were only three instances of it in the
compiler and the test drivers, two of which were of the form "*foo =
foo + 1", which should be written as "*foo += 1" anyways.
2011-08-12 18:28:03 -07:00
Michael Sullivan
e527140548
Change some tests that used binop autoderef.
2011-08-12 18:28:03 -07:00
Brian Anderson
ee7d03f7d7
Convert most working tests to ivecs
...
I tried to pay attention to what was actually being tested so, e.g. when I
test was just using a vec as a boxed thing, I converted to boxed ints, etc.
Haven't converted the macro tests yet. Not sure what to do there.
2011-08-12 16:13:13 -07:00
Brian Anderson
4e62c0d6cb
Remove std::vec
2011-08-12 12:14:07 -07:00
Brian Anderson
3d1634db15
Remove all usages of std::vec::vbuf
2011-08-12 12:14:07 -07:00
Brian Anderson
235109f8d2
XFAIL run-pass/vec-self-append
...
Broken under the ivec regime
2011-08-12 12:14:07 -07:00
Brian Anderson
12cd11ecda
Remove last uses of vec::len
2011-08-12 12:14:07 -07:00
Brian Anderson
48ad07b5d6
Convert run-pass/import-glob-crate to ivecs
2011-08-12 12:11:12 -07:00
Brian Anderson
cb59e28679
Convert run-pass/mod-view-items to ivecs
2011-08-12 12:11:12 -07:00
Brian Anderson
a76165f670
Move the ivec::reverse tests to stdtest
2011-08-12 12:11:11 -07:00
Brian Anderson
4dec0f6d96
Add reverse and reversed to std::ivec
...
Modify tests to use the ivec version
2011-08-12 12:11:11 -07:00
Brian Anderson
3814d8d4b0
Convert run-pass/vec-append to ivecs
2011-08-12 12:08:28 -07:00
Brian Anderson
e790f1e6c5
Remove run-pass/vec-alloc-append.rs
...
There is no ivec::append and this is the only remaining user of vec::append
2011-08-12 12:08:28 -07:00
Brian Anderson
fc7664e4c6
Remove run-pass/vec-ref-count.rs
...
This test will be irellevant when vecs are gone
2011-08-12 12:08:28 -07:00
Brian Anderson
82b1e3f5cc
Convert all uses of std::io to std::ioivec
2011-08-12 12:08:27 -07:00
Brian Anderson
cfb9cba19f
Convert str::from_chars, to_chars to ivecs
2011-08-12 12:08:27 -07:00
Brian Anderson
7e255335d2
Convert str::is_utf8 to ivecs
2011-08-12 12:08:26 -07:00
Brian Anderson
2e7e58812b
Remove vec version of str::bytes, rename bytes_ivec to str::bytes
2011-08-12 12:08:26 -07:00
Lindsey Kuper
f2e22b2e8e
Sanity-check the code examples that appear in the object system docs.
2011-08-11 16:19:51 -07:00
Brian Anderson
9742148e25
Bring run-pass/spawn-fn up to date and un-XFAIL
2011-08-11 10:15:14 -07:00
Brian Anderson
d4a17caf1e
Bring run-pass/spawn-module-qualified up to date and un-XFAIL
2011-08-11 10:15:14 -07:00
Brian Anderson
832d89db47
Bring run-pass/task-killjoin up to date and un-XFAIL
2011-08-11 10:15:14 -07:00
Brian Anderson
ffd6ee0730
Fill out some of the run-pass/binops tests
...
Un-XFAIL, and just comment out and add a FIXME to the two cases that fail on
linux.
Closes #577 . This still doesn't compare <, >, etc for channels, ports and
tasks, but since they use pointer equality, that's a bit difficult to set up.
2011-08-11 10:15:07 -07:00
Brian Anderson
29ceb41cc3
Update and un-XFAIL run-pass/many.rs
2011-08-11 10:09:02 -07:00
Lindsey Kuper
b23360ec8e
Test case for issue #812 .
2011-08-10 15:11:32 -07:00
Graydon Hoare
a5997f2eb2
Actually perform handoff from caller to callee on move-mode args.
2011-08-09 17:56:26 -07:00
Patrick Walton
169f1e5b5a
test: XFAIL binops.rs for now due to mysterious tinderbox failure on Linux
2011-08-09 17:50:21 -07:00
Patrick Walton
a73a0dd74e
test: Update binops.rs with the new equality semantics
2011-08-09 17:02:17 -07:00
Erick Tryzelaar
491ed7f12c
Port the fuzzer and tests to ivec type [T] syntax.
2011-08-09 15:53:26 -07:00
Lindsey Kuper
bf84d20f7c
Move along; nothing to see here...
2011-08-09 15:42:48 -07:00
Lindsey Kuper
0d74d22eda
Un-XFAIL a test. Issue #435 .
2011-08-09 12:35:41 -07:00
Brian Anderson
c4877f88fa
Update comments on sio-ctx test
2011-08-09 12:30:50 -07:00
Lindsey Kuper
eaefb0f1f6
Test case for issue #758 .
2011-08-09 12:25:47 -07:00
Brian Anderson
dcc9a81d17
XFAIL sio-ctx
...
Reportedly fails sometimes, probably when RUST_THREADS > 1
2011-08-09 12:03:30 -07:00
Lindsey Kuper
ff22368279
The self-stack stuff (from #702 ) also closes issue #718 .
2011-08-09 11:46:15 -07:00
Erick Tryzelaar
a37e00ed1f
Change the ivec type syntax to [T].
...
This preserves the old syntax for now.
2011-08-09 11:29:36 -07:00
Lindsey Kuper
a334adaab9
Thread "self" through the stack. Backwarding! Closes #702 .
2011-08-09 10:59:13 -07:00
unknown
44bef5f2cb
Introduced task handles.
...
This is the new way to refer to tasks in rust-land. Currently all they
do is serve as a key to look up the old rust_task structure. Ideally
they won't be ref counted, but baby steps.
2011-08-08 16:55:38 -07:00
Graydon Hoare
b54e7e4506
Add new arg-passing mode 'move' denoted with '-T'. Translate as pass-by-value, doesn't deinit source yet nor get proper analysis in typestate, alias passes.
2011-08-08 15:53:41 -07:00
Eric Holk
d4a4224d1b
Using unsafe chan pointer idiom to make task-comm-16.rs pass again.
2011-08-08 10:48:21 -07:00
Eric Holk
c54d57b4b4
Temporarily disabling chan test to put out linux fire.
2011-08-08 10:05:00 -07:00
Eric Holk
d9b84a546c
Converted the rest of the task-comm-* tests over. Also fixed some
...
channel lifecycle bugs.
2011-08-08 08:57:52 -07:00
Eric Holk
86babab2fe
Added an unsafe way to pass libchans over spawn and chans, and converted task-comm-0 to use libcomm.
2011-08-08 08:57:52 -07:00
Brian Anderson
5f89a4f5f3
XFAIL sio-srv
...
Needs to run on loopback so it doesn't trigger windows firewall, but seems
to be hanging. Giving up for now.
2011-08-05 16:49:43 -07:00
Brian Anderson
18ef7cc531
Un-XFAIL sio-ctx, sio-srv
...
Seem to work consistently
2011-08-05 11:57:07 -07:00
Brian Anderson
4178e52c8f
XFAIL all the sio tests
...
They have random failures still, sadly.
2011-08-05 11:57:06 -07:00
Rob Arnold
f4b87c749f
Basic async IO module using libuv
2011-08-05 11:57:06 -07:00
Tim Chevalier
d7ee55bfd0
(Almost) Always unify a function tail expr with the function result type
...
typeck::check_fn had an exception for the case where the tail expr
was compatible with type nil -- in that case, it doesn't unify the
tail expr's type with the enclosing function's result type. This
seems wrong to me. There are several test cases in Issue #719
that illustrate why. If the tail expr has type T, for some type
variable T that isn't resolved when this check happens, then T
never gets unified with anything, which is incorrect -- T should
be unified with the result type of the enclosing function. (The
bug was occurring because an unconstrained type variable is
compatible with type nil.)
Instead, I removed the check for type nil and added a check that
the function isn't an iterator -- if it's an iterator, I don't
check the tail expr's type against the function result type,
as that wouldn't make sense.
However, this broke two test cases, and after discussion with
brson, I understood that the purpose of the check was to allow
semicolons to be omitted in some cases. The whole thing seems
rather ad hoc. But I came up with a hacky compromise solution:
instead of checking whether the tailexpr type is *compatible*
with nil, we now just check whether it *is* nil. This also
necessitates calling resolve_type_vars_if_possible before
the check happens, which worries me. But, this fixes the bug
from Issue #719 without requiring changes to any test cases.
Closes #719 but I didn't try every variation -- so reopen the bug
if one of the variations still doesn't work.
2011-08-05 02:21:58 -07:00
Michael Sullivan
66a255ac92
Add a cleanup for copying closures. Closes #804 .
2011-08-04 17:58:12 -07:00
Michael Sullivan
9a5e9806f3
Don't force resolution of type variables until there is no enclosing function scope. Closes #803 .
2011-08-04 17:33:15 -07:00
Tim Chevalier
e0985c1060
Handle alt on a _|_ - typed value
...
Return the result of the discriminant from trans_alt,
rather than nil, in the _|_ case. This was breaking the
enclosed test case (alt-bot-2) when optimization was disabled.
Closes #769
2011-08-04 16:07:26 -07:00
Paul Stansifer
513276e595
Add #concat_idents[] and #ident_to_str[]
2011-08-03 12:42:35 -07:00
Brian Anderson
228422303f
Remove the last remaining xfail-boot directive
2011-08-03 10:55:59 -07:00
Brian Anderson
c53402846e
Remove all xfail-stage0 directives
...
While it is still technically possible to test stage 0, it is not part of any
of the main testing rules and maintaining xfail-stage0 is a chore. Nobody
should worry about how tests fare in stage0.
2011-08-03 10:55:59 -07:00
Brian Anderson
63600828cd
Un-xfail more pretty-printing tests
2011-08-03 10:55:59 -07:00
Brian Anderson
0b7a94a94c
Pretty-print kinds of type params
2011-08-03 10:55:59 -07:00
Brian Anderson
843767a841
Disambiguate unop statements in pretty-printer. Closes #674
2011-08-03 10:55:59 -07:00
Tim Chevalier
7c34550931
Make _|_ type binopable
...
But don't actually generate code that does the operation. That means
hoisting the check I added in my last commit from trans_compare
up into trans_eager_binop (don't generate any code if one operand
has type _|_ ).
Closes #777
2011-08-02 18:06:46 -07:00
Brian Anderson
44c93b5fb2
Remove task-comm-chan-chan test
...
This issue has a smaller test case in chan-leak.rs
2011-08-02 17:49:11 -07:00
Brian Anderson
a6cb0c2843
Enable more tests that pretty-print correctly now
2011-08-02 17:49:11 -07:00
Brian Anderson
2911156820
Pretty-print fn constraints more correctish
2011-08-02 17:49:11 -07:00
Brian Anderson
637037f68c
Un-xfail run-pass/claim-nonterm
...
Seems to work
2011-08-02 17:49:11 -07:00
Brian Anderson
3eef9993af
Don't pp extra lines after block open when preserving whitespace. Closes #759
2011-08-02 17:49:11 -07:00
Tim Chevalier
731797d075
In trans, don't assume both sides of a binop have the same type
...
This was at least partially responsible for Issue 777.
The only solution I can think of is for trans to just not generate
code for a comparison if one or both sides has type _|_. Since
that means evaluating that subexpression diverges, it should be ok
to never do the comparison. Actually generating code for the
comparison would trip an LLVM assertion failure.
2011-08-02 17:36:41 -07:00
Paul Stansifer
ab4764520c
Allow patterns of the form `[a, b, c ...] to be matched and transcribed.
2011-08-02 14:46:02 -07:00
Brian Anderson
0a6e3362c6
Add xfail-pretty directives to tests that don't pretty-print correctly
...
Issue #789
2011-08-02 10:39:13 -07:00
Brian Anderson
166c73546a
Remove test/run-pass/simple-qsort
...
This is part of stdtest now
2011-08-02 10:39:13 -07:00
Marijn Haverbeke
f8fa574864
Copy locals created by destructuring on the content of a box
...
This is required so that assigning to these locals doesn't clobber
the content of the box.
(A possible optimization would be to only do this copying for
locals that actually are assigned to.)
2011-08-02 12:09:15 +02:00
Eric Holk
5a673cc2c9
Started working on a library-based comm system. Creating and deleting ports work.
2011-08-01 15:58:30 -07:00
Marijn Haverbeke
4837a57df5
Add tests for destructuring locals
2011-08-01 17:52:43 +02:00
Lindsey Kuper
6ba4e34959
Reduced test case for current backwarding bug.
...
Still working on getting backwarding to play nicely with self and
overriding. Currently can't fix issue #702 without breaking how self
and overriding interact.
2011-07-29 18:30:27 -07:00
Tim Chevalier
766e939857
Test case for previous commit
2011-07-29 18:00:10 -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
b1d2a00b4a
Remove support for obj dtors
2011-07-29 14:03:24 +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
Brian Anderson
3896524750
Drop the previous reference when receiving. Closes #763
2011-07-28 18:22:15 -07:00
Brian Anderson
021bfb4b9b
Reenable expr-scope test. Disable under check-fast
2011-07-28 14:14:29 -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
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
Lindsey Kuper
c15871ac51
Test case for issue #435 .
2011-07-28 10:37:46 -07:00
Graydon Hoare
acac6abc85
Parse, store and print type parameter kind constraints.
2011-07-28 17:22:59 +00:00
Marijn Haverbeke
1836f59d9a
Disable expr-scope test, since it break windows
2011-07-28 12:02:08 +02:00
Josh Matthews
f0e29c92aa
:: is allowed to start an expression. Close #762 .
2011-07-28 02:33:24 -04: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
Marijn Haverbeke
edd1a0230e
Fix nil pattern case to handle for parser adjustment
2011-07-27 16:55:49 +02:00
Marijn Haverbeke
6e2a7bff7f
Fix damage done by the pretty-printer
2011-07-27 15:54:33 +02:00
Marijn Haverbeke
df7f21db09
Reformat for new syntax
2011-07-27 15:54:33 +02:00
Michael Sullivan
4c17cb73a2
Add a bunch of tests for blocks.
2011-07-26 12:34:38 -07:00
Paul Stansifer
d11c887382
Add basic support for blocks and types in macros.
2011-07-26 11:09:37 -07:00
Marijn Haverbeke
2509a3dcae
Resolve loop collection expressions in the right scope
...
Closes #745
2011-07-26 15:52:59 +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
Brian Anderson
2de43c220c
Disable task-comm-15. Fails with multiple threads.
2011-07-25 16:34:49 -07:00
Brian Anderson
2573fe7026
The Big Test Suite Overhaul
...
This replaces the make-based test runner with a set of Rust-based test
runners. I believe that all existing functionality has been
preserved. The primary objective is to dogfood the Rust test
framework.
A few main things happen here:
1) The run-pass/lib-* tests are all moved into src/test/stdtest. This
is a standalone test crate intended for all standard library tests. It
compiles to build/test/stdtest.stageN.
2) rustc now compiles into yet another build artifact, this one a test
runner that runs any tests contained directly in the rustc crate. This
allows much more fine-grained unit testing of the compiler. It
compiles to build/test/rustctest.stageN.
3) There is a new custom test runner crate at src/test/compiletest
that reproduces all the functionality for running the compile-fail,
run-fail, run-pass and bench tests while integrating with Rust's test
framework. It compiles to build/test/compiletest.stageN.
4) The build rules have been completely changed to use the new test
runners, while also being less redundant, following the example of the
recent stageN.mk rewrite.
It adds two new features to the cfail/rfail/rpass/bench tests:
1) Tests can specify multiple 'error-pattern' directives which must be
satisfied in order.
2) Tests can specify a 'compile-flags' directive which will make the
test runner provide additional command line arguments to rustc.
There are some downsides, the primary being that Rust has to be
functioning pretty well just to run _any_ tests, which I imagine will
be the source of some frustration when the entire test suite
breaks. Will also cause some headaches during porting.
Not having individual make rules, each rpass, etc test no longer
remembers between runs whether it completed successfully. As a result,
it's not possible to incrementally fix multiple tests by just running
'make check', fixing a test, and repeating without re-running all the
tests contained in the test runner. Instead you can filter just the
tests you want to run by using the TESTNAME environment variable.
This also dispenses with the ability to run stage0 tests, but they
tended to be broken more often than not anyway.
2011-07-24 15:34:34 -07:00
Eric Holk
63e77a3de1
Attempt to put out burning Windows tinderbox.
2011-07-23 13:01:30 -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
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
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
Brian Anderson
07732545d2
Add xfail-stage3 directives to tests
...
The new test runners run stage 3
2011-07-22 10:18:28 -07: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
Brian Anderson
06a6005447
Use correct win file open constants, per MinGW
2011-07-21 18:23:15 -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
Lindsey Kuper
451e438ed0
Un-xfail tests.
2011-07-21 15:28:00 -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
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
2eb4762936
Typechecking self-calls in anon objs. Closes #540 .
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
Brian Anderson
652214d7f9
Fix calculation of sizeof boxed ivec of str in rt. Closes #712
2011-07-19 16:55:45 -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
Lindsey Kuper
18162d3261
Some progress on issue #540 .
2011-07-19 14:30:53 -07:00
Lindsey Kuper
a33bc56e43
Reduced test case for issue #540 .
2011-07-19 12:48:06 -07:00
Erick Tryzelaar
b82c9c9e79
xfail simple-qsort.rs test at stage0.
2011-07-19 11:39:04 -07:00
Brian Anderson
fb9a117743
Fix an invalid memory access in run_program and friends
2011-07-19 10:15:16 -07:00
Brian Anderson
7e55061def
Add str::replace
2011-07-18 16:16:48 -07:00
Brian Anderson
689f5f487c
Add str::is_empty, is_not_empty preds
2011-07-18 16:16:48 -07:00
Michael Sullivan
71909a64bc
Fix qsort to not skip the right side when the pivot element gets put at index 0.
...
Closes #705 .
2011-07-18 15:03:31 -07:00
Brian Anderson
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
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
Brian Anderson
20a3adbc08
Revert "Add setenv to standard library"
...
This reverts commit 6fb168b3db
.
2011-07-17 19:16:18 -07:00
Brian Anderson
6fb168b3db
Add setenv to standard library
2011-07-17 18:50:01 -07:00
Brian Anderson
8c4f1652ec
Add ivec::zip/unzip
2011-07-16 17:36:11 -07:00
Lindsey Kuper
69abf0a5ff
Revised plan of attack for backwarding functions.
2011-07-15 17:23:20 -07:00
Lindsey Kuper
c4265209a6
More tests for anonymous objects. Issues #702 , #703 .
2011-07-15 15:33:40 -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
ed6f9bb677
Add tests for unsupervise
2011-07-14 18:50:22 -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