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
a679ea5c3c
Limit the exports from std::vec
2011-08-12 12:08:27 -07:00
Brian Anderson
7d05da96f7
Rename std::ioivec to std::io
2011-08-12 12:08:27 -07:00
Brian Anderson
0b71d1d445
Remove std::io
2011-08-12 12:08:27 -07:00
Brian Anderson
82b1e3f5cc
Convert all uses of std::io to std::ioivec
2011-08-12 12:08:27 -07:00
Brian Anderson
c0846525e8
Remove a vbuf import from std::str
2011-08-12 12:08:27 -07:00
Brian Anderson
119f43e0c7
Rename str::connect_ivec to str::connect
2011-08-12 12:08:27 -07:00
Brian Anderson
21693db2a7
Remove str::connect
2011-08-12 12:08:27 -07:00
Brian Anderson
369be5c8df
Convert uses of str::connect to str::connect_ivec
2011-08-12 12:08:27 -07:00
Brian Anderson
09cc957030
Convert str::concat to ivecs
2011-08-12 12:08:27 -07:00
Brian Anderson
1e397eee2a
Rename str::split_ivec to str::split
2011-08-12 12:08:27 -07:00
Brian Anderson
e3e9811b7f
Remove str::split
2011-08-12 12:08:27 -07:00
Brian Anderson
64f53dfbb0
Convert uses of str::split to split_ivec
2011-08-12 12:08:27 -07:00
Brian Anderson
cfb9cba19f
Convert str::from_chars, to_chars to ivecs
2011-08-12 12:08:27 -07:00
Brian Anderson
878fbac278
Remove str_from_vec runtime function
2011-08-12 12:08:27 -07:00
Brian Anderson
740196987e
Rename std::str::unsafe_from_bytes_ivec to unsafe_from_bytes
2011-08-12 12:08:27 -07:00
Brian Anderson
6050e1d4f6
Remove std::str::unsafe_from_bytes
2011-08-12 12:08:27 -07:00
Brian Anderson
a9ce342fa3
Convert all uses of unsafe_from_bytes to unsafe_from_bytes_ivec
2011-08-12 12:08:26 -07:00
Brian Anderson
49b80f9bf7
Remove str::from_bytes
...
This is exactly the same as str::unsafe_from_bytes
2011-08-12 12:08:26 -07:00
Brian Anderson
7e255335d2
Convert str::is_utf8 to ivecs
2011-08-12 12:08:26 -07:00
Brian Anderson
2e7e58812b
Remove vec version of str::bytes, rename bytes_ivec to str::bytes
2011-08-12 12:08:26 -07:00
Brian Anderson
d6626143cc
Remove vecs from compiletest
2011-08-12 12:08:26 -07:00
Brian Anderson
4caeba9178
Remove vecs from the rustc driver
2011-08-12 12:08:26 -07:00
Brian Anderson
b32889d82c
Remove vecs from simplext
2011-08-12 12:08:26 -07:00
Brian Anderson
f195814df3
Begin removing vecs from #fmt
2011-08-12 12:08:26 -07:00
Michael Sullivan
8a9766000e
Change a bunch of places in the stdlib to use blocks.
2011-08-12 11:47:44 -07:00
Marijn Haverbeke
de4b383a0f
Properly typecheck unary minus
...
Closes #813
2011-08-12 16:05:56 +02:00
Patrick Walton
e8d170beae
rt: Stub Rust GC metadata printer and Rust GC strategy modules
2011-08-11 21:15:26 -07:00
Brian Anderson
0a22f91c9c
Revert "Add missing functions to rustllvm.def.in"
...
This reverts commit 1bea273974
.
Looks like this is not actually necessary. Hard to tell since the tinderboxes
are falling behind.
2011-08-11 18:23:21 -07:00
Brian Anderson
5e840182e6
XFAIL do-while-body-fails
...
Doesn't work w/out optimizations
2011-08-11 18:05:39 -07:00
Brian Anderson
1bea273974
Add missing functions to rustllvm.def.in
2011-08-11 17:50:10 -07:00
Tim Chevalier
051b401051
Handle _|_ - typed things in the bodies of do-while loops
...
The resulting code is strange, but perhaps someone else can
fix it. The obvious things, like returning body_res, all resulted
in completely incomprehensible LLVM errors.
Closes #814
2011-08-11 17:23:47 -07:00
Lindsey Kuper
19bbd02049
Fix too-long line.
2011-08-11 16:21:09 -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
Rafael Ávila de Espíndola
6402b63b4f
Use the new C API for PassManagerBuilder.
2011-08-11 19:09:52 -04:00
Rafael Ávila de Espíndola
4cee063976
Update for llvm api change.
2011-08-11 14:58:30 -07:00
Patrick Walton
5079f51386
rustc: Associate type descriptors with allocas as metadata
2011-08-11 14:35:33 -07:00
Brian Anderson
4b22243416
Un-ignore stdtest::task::test_sleep
...
Works for me.
2011-08-11 10:15:14 -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
Brian Anderson
4ff6763b60
rustc: Lowercase "main function not found" error
2011-08-11 10:09:02 -07:00
Brian Anderson
0cddcac016
rustc: Use spans in some main typeck errors
2011-08-11 10:09:02 -07:00
Brian Anderson
612fe3d2d6
Add ast_map::node_span function
2011-08-11 10:09:02 -07:00
Brian Anderson
14b3ad194a
Switch a check for main type from an error to an ICE
...
This code path doesn't look possible, so I think it indicates a bug. Also,
make the message lowercase.
2011-08-11 10:09:02 -07:00
Brian Anderson
0f8e58e3ce
Lowercase the "wrong type in main fn" error
2011-08-11 10:09:02 -07:00
Brian Anderson
32438e82b3
Fix the error-pattern in compile-fail/bad-main.rs. Un-XFAIL
...
This is also tested by compile-fail/main-wrong-type.rs but the type signatures
are slightly different, so I guess it's worth holding on to.
2011-08-11 10:09:02 -07:00
Patrick Walton
7b337e3581
rustc: Don't free shared memory when --gc is on
2011-08-10 22:47:18 -07:00
Patrick Walton
a5d5f9ef48
rustc: Add a --gc switch for debugging and experimentation
2011-08-10 22:13:30 -07:00
Michael Sullivan
c5c8258937
Rework check_expr substantially.
...
The bulk of check_expr is now check_expr_with_unifier, which takes an
expected type and a unification function and will perform the
unification on the type it produces. check_expr calls
check_expr_with_unifier with a dummy unifier and a new function,
check_expr_with, takes an expected type and uses the simple unifier.
I think this generally makes thing cleaner, but the purpose for doing
this is to enable type inferred lambda-blocks to be useful by allowing
the argument types to be unified before the body of the lambda is
checked.
2011-08-10 20:18:07 -07:00
Michael Sullivan
67e361a940
Introduce a ty_infer ast node and use it instead of option::t[ty].
...
This actually basically makes things worse, since we get less nice
type system guarentees but it will make doing type inferred blocks a
fair deal less painful. I'm not /really/ happy about this...
2011-08-10 20:18:07 -07:00
Patrick Walton
1e6074ca73
rustc: Mark functions as "rust" GC
2011-08-10 20:12:30 -07:00
Michael Sullivan
43c9fe65bd
Eliminate the last vestiges of init_recv.
2011-08-10 19:21:29 -07:00
Michael Sullivan
00b781e495
Some cleanup in check_expr.
2011-08-10 19:20:00 -07:00
Patrick Walton
ba7c8f18d4
rustc: Remove unused "trace" upcalls
2011-08-10 18:09:52 -07:00
Patrick Walton
d1494901d0
rustc: Declare GC-related intrinsics
2011-08-10 17:59:33 -07:00
Patrick Walton
19424dfab6
rustc: Add unique pointers to the set of types we support
2011-08-10 17:24:22 -07:00
Tim Chevalier
a8a4d4ec05
Use actual type, not declared type, when zeroing move arguments
...
trans was failing with a bounds check error because the caller
was using the declared type (an out-of-scope ty param) and not
the actual type in a list of argument types to zero.
Closes #811
2011-08-10 17:22:57 -07:00
Graydon Hoare
511c053856
Remove dead keywords from parser.
2011-08-10 17:11:24 -07:00
Lindsey Kuper
bf81a05223
Factor out creation of object body types.
2011-08-10 16:53:32 -07:00
Michael Sullivan
bcc30cb4f6
Rename unify::simple to unify::unify.
2011-08-10 16:43:03 -07:00
Michael Sullivan
7d5092ee7b
Some trivial cleanup.
2011-08-10 16:28:34 -07:00
Patrick Walton
347230b001
rt: Add the last few cases to polymorphic log
2011-08-10 15:45:32 -07:00
Patrick Walton
955ac84da4
rt: Step over type params properly in glue
2011-08-10 15:39:05 -07:00
Patrick Walton
15e1e3185d
rt: Allow records and boxes to be logged
2011-08-10 15:36:37 -07:00
Lindsey Kuper
007af36bb3
Comments, cleanup, whitespace, refactoring.
2011-08-10 15:11:32 -07:00
Lindsey Kuper
b23360ec8e
Test case for issue #812 .
2011-08-10 15:11:32 -07:00
Patrick Walton
6affa3264b
rt: Allow tags to be logged
2011-08-10 14:57:02 -07:00
Patrick Walton
f5c8c85196
rt: Implement logging of vectors
2011-08-10 14:42:06 -07:00
Patrick Walton
dc720c3aba
rt: Implement polymorphic log on strings
2011-08-10 14:35:12 -07:00
Patrick Walton
adce35acd4
rustc: Use polymorphic logging
2011-08-10 14:35:12 -07:00
Brian Anderson
40ae704ff2
Begin valgrinding run-fail tests
...
Introduce a temporary no-valgrind directive for the few that aren't clean
2011-08-10 13:36:57 -07:00
Brian Anderson
0cd607bcbd
rt: Shutdown gracefully on failure
...
When the kernel fails, kill all tasks and wait for the schedulers to stop
instead of just exiting. I'm sure there are tons of lurking issues here but
this is enough to fail without leaking (at least in the absence of cleanups).
2011-08-10 13:02:31 -07:00
Patrick Walton
f6ad051408
rt: Use _LP64 instead of SIZE_MAX and UINT64_MAX to try to put out the burning tinderbox
2011-08-10 10:55:41 -07:00
Patrick Walton
ceaf02abe1
rt: Attempt to quiet MinGW by including limits.h
2011-08-10 05:17:30 -07:00
Patrick Walton
6fbb7ffdbd
rt: Stub code for polymorphic log
2011-08-09 19:01:15 -07:00
Patrick Walton
8e6e6f5f89
rustc: Make iter_structural_ty_full and friends take one value, not two. Shaves a second off codegen.
2011-08-09 18:31:14 -07:00
Patrick Walton
044b16ad68
rustc: Remove the code to generate cmp glue
2011-08-09 18:31:13 -07:00
Graydon Hoare
a5997f2eb2
Actually perform handoff from caller to callee on move-mode args.
2011-08-09 17:56:26 -07:00
Michael Sullivan
5adaa6f956
Do some cleanup in stdlib.
2011-08-09 17:53:52 -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
865ca749dc
rustc: Use shapes instead of codegen'd cmp glue
2011-08-09 17:02:17 -07:00
Patrick Walton
a73a0dd74e
test: Update binops.rs with the new equality semantics
2011-08-09 17:02:17 -07:00
Patrick Walton
1f8e0fa083
rt: Implement comparison of functions, objects, ports, channels, and tasks
2011-08-09 17:02:17 -07:00
Patrick Walton
ade998d743
rt: Don't walk vars twice. We self-host with compare glue now.
2011-08-09 17:02:17 -07:00
Patrick Walton
1e1125fcbe
rt: Initialize "result" in all constructors for cmp
2011-08-09 17:02:17 -07:00
Lindsey Kuper
5d9680fc7e
Move object-system-related trans stuff to its own file.
2011-08-09 16:42:55 -07:00
Brian Anderson
61425c8d13
Convert remaning ivec decls to new syntax
...
These snuck in during rebasing
2011-08-09 15:53:26 -07:00
Erick Tryzelaar
00ccd6ba42
Remove support for the ivec T[] syntax.
2011-08-09 15:53:26 -07:00
Erick Tryzelaar
491ed7f12c
Port the fuzzer and tests to ivec type [T] syntax.
2011-08-09 15:53:26 -07:00
Erick Tryzelaar
8b15045224
Port the compiler to the ivec type [T] syntax.
2011-08-09 15:53:26 -07:00
Erick Tryzelaar
50f97cb368
Port the stdlib to the 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
Brian Anderson
fed62af887
Register new snapshots
2011-08-09 15:07:00 -07:00
Patrick Walton
e5533a5d5e
rt: Compare exterior vectors
2011-08-09 12:49:52 -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
Patrick Walton
b83167cf91
rt: Make comparison through type vars work
2011-08-09 12:19:40 -07:00
Patrick Walton
f9363f01a1
rt: Fix comparison of interior vectors
2011-08-09 12:19:40 -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
Erick Tryzelaar
bf7b516bdb
Add newlines to the end of some files.
2011-08-09 11:29:36 -07:00
Lindsey Kuper
d5c8bb9d86
A little backwarding cleanup/refactoring.
2011-08-09 11:19:24 -07:00
Lindsey Kuper
a334adaab9
Thread "self" through the stack. Backwarding! Closes #702 .
2011-08-09 10:59:13 -07:00
Graydon Hoare
b2cac5afa3
Implement typestate checking for move-mode args. Un-XFAIL compile-fail/move-arg.rs.
2011-08-08 19:41:54 -07:00
Patrick Walton
f7749b1608
rt: Add code to walk over interior vectors, untested as of yet
2011-08-08 19:16:33 -07:00
Patrick Walton
7d7f62613a
rt: Compare tags
2011-08-08 18:29:20 -07:00
Patrick Walton
e5531504c9
rt: Align when comparing the insides of boxes
2011-08-08 17:30:21 -07:00
Patrick Walton
0459e38bde
rt: Align mallocs to 16 byte boundaries
2011-08-08 17:30:21 -07:00
Eric Holk
42b13c1db3
Disabling TRACK_ALLOCATIONS
2011-08-08 17:12:44 -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
Patrick Walton
f4f057ced1
rt: Compare the insides of boxes
2011-08-08 16:52:11 -07:00
Patrick Walton
72fdb1a3bf
rustc: Emit the shape of "float" as f64, not f32
2011-08-08 16:52:10 -07:00
Michael Sullivan
059c66b9f7
Don't bother zeroing out slots in cleanups.
2011-08-08 16:17:09 -07:00
Patrick Walton
c0fc204112
rustc: Fix signature on cmp glue upcall
2011-08-08 16:01:03 -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
Patrick Walton
3dda9aabf2
stdlib: std::ebmlivec and std::ebml are now synonyms
2011-08-08 15:30:37 -07:00
Patrick Walton
4d7f866eec
rustc: Declare upcall_cmp_type
2011-08-08 15:05:12 -07:00
Patrick Walton
42daeab7df
rt: "const foo const &" == "const foo &", duh. Puts out burning tinderbox.
2011-08-08 14:55:35 -07:00
Patrick Walton
eb7e9dce4d
rt: Stub the shape-based cmp upcall
2011-08-08 14:33:06 -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
Patrick Walton
0aeddb3673
rt: Stub compare glue
2011-08-05 18:47:12 -07:00
Patrick Walton
d7828e694d
rt: Uncomment data<T>
2011-08-05 17:50:59 -07:00
Eric Holk
50670eb426
Removing trailing whitespace in rust_shape.cpp
2011-08-05 17:08:22 -07:00
Eric Holk
f9fd785cf5
Removing an invalid operation in the attempt to restore valgrind cleanness.
2011-08-05 17:01:06 -07:00
Brian Anderson
5f89a4f5f3
XFAIL sio-srv
...
Needs to run on loopback so it doesn't trigger windows firewall, but seems
to be hanging. Giving up for now.
2011-08-05 16:49:43 -07:00
Patrick Walton
5261bd771f
rt: Simplify the signature of walk_tag; stub code for the data walker
2011-08-05 16:47:43 -07:00
Paul Stansifer
a9471d8296
Revert "rustc: bzero in zero_alloca. Shaves off a second or three."
...
This causes trouble in Valgrind in drop glue in parsing.
This reverts commit 4d180793f0
.
2011-08-05 16:38:49 -07:00
Brian Anderson
f918418953
Fix a type in the libuv mingw makefile
2011-08-05 15:48:19 -07:00
Tim Chevalier
c35bf9ca04
Another test for the occurs check, this one from issue 778
2011-08-05 15:47:17 -07:00
Eric Holk
b62e80c1f0
Atomic ref counting for chans.
2011-08-05 15:27:28 -07:00
Eric Holk
200bbcf91b
Rewrote receive to return a value. This lets us initialize variables by receiving them.
2011-08-05 15:27:27 -07:00
Tim Chevalier
1c786bcc82
Initialize all constraints to False
...
Previously, typestate was initializing the init constraint for
a declared-but-not-initialized variable (like x in "let x;") to False,
but other constraints to Don't-know. This led to over-lenient results
when a variable was used before declaration (see the included test
case). Now, everything gets initialized to False in the prestate/poststate-
finding phase, and Don't-know should only be used in pre/postconditions.
This aspect of the algorithm really needs formalization (just on paper),
but for now, this closes #700
2011-08-05 15:25:52 -07:00
Patrick Walton
e76efbc43a
etc: Add "lambda" and "inline" to the vim mode
2011-08-05 14:01:45 -07:00
Patrick Walton
b079e1adbb
rustc: Parse "inline". Also write it into metadata.
2011-08-05 13:59:27 -07:00
Brian Anderson
18ef7cc531
Un-XFAIL sio-ctx, sio-srv
...
Seem to work consistently
2011-08-05 11:57:07 -07:00
Graydon Hoare
7da64ae461
Munge libuv makefiles sufficiently to build out of tree.
2011-08-05 11:57:07 -07:00
Brian Anderson
f6d5c56f21
Tweak libuv makefiles so they pick up custom CFLAGS
2011-08-05 11:57:07 -07:00
Brian Anderson
e653520a6f
Fix uv_buf_t declaration on win32
...
The fields of this structure are mysteriously defined in the opposite order
on windows as on unix
2011-08-05 11:57:06 -07:00
Brian Anderson
4178e52c8f
XFAIL all the sio tests
...
They have random failures still, sadly.
2011-08-05 11:57:06 -07:00
Rob Arnold
a4951cab7f
Add libuv Makefile
2011-08-05 11:57:06 -07:00
Rob Arnold
8229c3fa75
Update libuv to revision ee599ec1141cc48f895de1f9d148033babdf9c2a
2011-08-05 11:57:06 -07:00
Rob Arnold
f4b87c749f
Basic async IO module using libuv
2011-08-05 11:57:06 -07:00
Rob Arnold
b64a52df42
Integrate libuv into the build system
2011-08-05 11:57:06 -07:00
Rob Arnold
904f443fa9
Drop in libuv rev 2b5707d834a6b85b8e589ac04cb61a6db2dab94b
2011-08-05 11:57:06 -07:00
Rob Arnold
b6be83885f
Log tags in memory_region::{free,realloc}
...
Make this useful and consistent with the destructor.
2011-08-05 11:57:06 -07:00
Patrick Walton
fd7ffd5ac2
rustc: Add inlineness to the fn decl instead
2011-08-05 11:46:43 -07:00
Patrick Walton
59e9b629c0
Revert "rustc: Introduce the concept of inline to the AST"
...
This reverts commit 9b9170f9fe
.
2011-08-05 11:38:06 -07:00
Patrick Walton
9b9170f9fe
rustc: Introduce the concept of inline to the AST
2011-08-05 11:33:48 -07:00
Patrick Walton
684df97ef0
etc: Update the Vim syntax mode with new keywords
2011-08-05 09:25:27 -07:00
Tim Chevalier
d7ee55bfd0
(Almost) Always unify a function tail expr with the function result type
...
typeck::check_fn had an exception for the case where the tail expr
was compatible with type nil -- in that case, it doesn't unify the
tail expr's type with the enclosing function's result type. This
seems wrong to me. There are several test cases in Issue #719
that illustrate why. If the tail expr has type T, for some type
variable T that isn't resolved when this check happens, then T
never gets unified with anything, which is incorrect -- T should
be unified with the result type of the enclosing function. (The
bug was occurring because an unconstrained type variable is
compatible with type nil.)
Instead, I removed the check for type nil and added a check that
the function isn't an iterator -- if it's an iterator, I don't
check the tail expr's type against the function result type,
as that wouldn't make sense.
However, this broke two test cases, and after discussion with
brson, I understood that the purpose of the check was to allow
semicolons to be omitted in some cases. The whole thing seems
rather ad hoc. But I came up with a hacky compromise solution:
instead of checking whether the tailexpr type is *compatible*
with nil, we now just check whether it *is* nil. This also
necessitates calling resolve_type_vars_if_possible before
the check happens, which worries me. But, this fixes the bug
from Issue #719 without requiring changes to any test cases.
Closes #719 but I didn't try every variation -- so reopen the bug
if one of the variations still doesn't work.
2011-08-05 02:21:58 -07:00
Michael Sullivan
c5d55ef918
Prohibit assignment to upvars in lambdas. Closes #805 .
2011-08-04 19:35:44 -07:00
Patrick Walton
a26c027731
Revert "rustc: Don't emit memset for non-structural types" due to crashes
...
This reverts commit 3d5a777fe1
.
2011-08-04 19:06:13 -07:00
Patrick Walton
3d5a777fe1
rustc: Don't emit memset for non-structural types
2011-08-04 18:24:57 -07:00
Michael Sullivan
66a255ac92
Add a cleanup for copying closures. Closes #804 .
2011-08-04 17:58:12 -07:00
Michael Sullivan
9a5e9806f3
Don't force resolution of type variables until there is no enclosing function scope. Closes #803 .
2011-08-04 17:33:15 -07:00
Patrick Walton
d4fe1b3127
stdlib: Pass getopt matches by alias
2011-08-04 17:11:50 -07:00
Patrick Walton
6c0297cfe7
rustc: bzero in drop_slot
2011-08-04 16:47:20 -07:00
Lindsey Kuper
fcec628203
Enable creation of backwarding vtables (issue #702 ), but don't start
...
using them yet. Also, refactor process_fwding_mthd into separate
functions to handle backwarding and forwarding, and refactor
create_vtbl to be more digestible.
2011-08-04 16:40:17 -07:00
Patrick Walton
4d180793f0
rustc: bzero in zero_alloca. Shaves off a second or three.
2011-08-04 16:33:38 -07:00
Michael Sullivan
cf9c0f9d93
Use lambdas in gather_locals in typeck.
2011-08-04 16:18:12 -07:00
Michael Sullivan
95680474e2
Use lambdas in the freevars pass.
2011-08-04 16:18:12 -07:00
Patrick Walton
ae3312002a
rustc: Use memmove in copy_ty. 45% LLVM codegen speed improvement.
2011-08-04 16:14:28 -07:00
Tim Chevalier
e0985c1060
Handle alt on a _|_ - typed value
...
Return the result of the discriminant from trans_alt,
rather than nil, in the _|_ case. This was breaking the
enclosed test case (alt-bot-2) when optimization was disabled.
Closes #769
2011-08-04 16:07:26 -07:00
Tim Chevalier
5f03ca48d8
Add a fast path in ty::occurs_check_fails
...
Use type_contains_vars in occurs_check_fails to avoid doing
any work most of the time. This fixes a performance regression.
(No one else noticed yet that typechecking just got 4x slower, right?
Well, now it isn't anymore. :-})
2011-08-04 15:56:40 -07:00
Tim Chevalier
2baaeab784
Implement the occurs check
...
In the writeback phase, the typechecker now checks that it isn't
replacing a type variable T with a type that contains T. It
also does an occurs check in do_autoderef in order to avoid
getting into an infinite chain of derefs.
I'm a bit worried that there are more places where the occurs
check needs to happen where I'm not doing it now, though.
Closes #768
2011-08-04 15:30:09 -07:00
Lindsey Kuper
d7d4b4fc38
trans_args no longer needs llobj argument.
2011-08-04 11:34:06 -07:00
Patrick Walton
2a3235b58c
rustc: Actually emit shapes
2011-08-04 11:25:46 -07:00
Eric Holk
b55b80ed11
Merge commit '6ec4829' into snap
2011-08-04 11:13:52 -07:00
Eric Holk
6ec4829068
Registering snapshot.
2011-08-04 11:06:11 -07:00
Patrick Walton
4061ca2bbd
rustc: Generate shapes
2011-08-04 10:46:10 -07:00
Patrick Walton
6bb6922c28
rt: Change int to uint32_t. Put out burning tinderbox.
2011-08-04 09:50:11 -07:00
Patrick Walton
e351ad762d
rt: Stub shape glue and implement shape::print and shape::size_of.
2011-08-03 20:25:44 -07:00
Lindsey Kuper
1b1d8e7b91
Killing an obsolete comment.
2011-08-03 20:03:05 -07:00
Lindsey Kuper
6df7c041bc
Pointer-ifying llenv. Step 1 of 2 steps to object system sanity.
2011-08-03 19:50:19 -07:00
Lindsey Kuper
29ec2503db
Put comments on trans contexts back where they belong. :(
2011-08-03 19:49:29 -07:00
Michael Sullivan
316bf01e26
Fix the pretty print tests to handle terminal newlines. Sorry!
2011-08-03 19:47:54 -07:00
Erick Tryzelaar
a8943f3442
timeout_in_ns was renamed to timeout_in_ms.
2011-08-03 19:28:49 -07:00
Eric Holk
7a2e9f4874
Sleep for a nonzero amount of time on Windows.
2011-08-03 18:21:19 -07:00
Michael Sullivan
5d5a3ca52d
Fix trans_put to properly return (). Closes #773 .
2011-08-03 18:10:54 -07:00
Michael Sullivan
5ea8d7f467
Make the pretty printer put trailing newlines at the end of files.
2011-08-03 17:52:25 -07:00
Michael Sullivan
9bfbb2bf83
Remove an obsolete FIXME in stdtest/deque.rs. Closes #140 .
2011-08-03 17:08:23 -07:00
Brian Anderson
2298a2b29f
Whitespace cleanup
2011-08-03 16:25:38 -07:00
Brian Anderson
89f2c43cf3
Convert line endings when doing exact pretty-print testing
...
For the benefit of windows
2011-08-03 15:37:51 -07:00
Brian Anderson
4ae6c835cb
Add some hacks to get stdin piping working more correctly in windows
...
The way pipes work in windows is not the same as unix, though I'm not
entirely clear on the differences. This patch changes the windows pipe
method to return non-inheritable fds, and the windows rust_run_program
method to duplicate them before spawning the new process.
This allows make-check-pretty to work on windows.
2011-08-03 15:09:00 -07:00
Michael Sullivan
e33de59e47
Clean up how we deal with dynamic size function arguments/returns.
2011-08-03 14:24:41 -07:00
Michael Sullivan
7bcde7270d
Have trans_bind_thunk handle polymorphic but statically sized return values.
...
Closes #775 .
2011-08-03 14:24:41 -07:00
Tim Chevalier
001df3f0ca
Revert "Revert "Handle conditionals on _|_ - typed values correctly""
...
This reverts commit ea81c03960
.
Changed the case in trans_if where the conditional is _|_ - typed
but the block is terminated to return the result of the cond,
instead of nil.
This passes "make check" with optimization disabled as well as
enabled.
2011-08-03 13:07:41 -07:00
Paul Stansifer
513276e595
Add #concat_idents[] and #ident_to_str[]
2011-08-03 12:42:35 -07:00
Michael Sullivan
4a636b06f6
Actually un-xfail the test for put in fns.
2011-08-03 11:59:11 -07:00
Michael Sullivan
c9ae548dae
Reject programs that do a put outside of iterators.
...
Closes #774 .
2011-08-03 11:43:50 -07:00
Michael Sullivan
8871462575
Do a bunch more typechecking for iters and for each loops.
...
Closes #771 .
Closes #772 .
Closes #796 .
2011-08-03 11:07:53 -07:00
Michael Sullivan
3254fb9806
Code cleanup in check_expr.
2011-08-03 11:06:58 -07:00
Michael Sullivan
fcc458d4a0
Fix typechecking when spawning something type inferred.
...
Of course, we still don't *translate* it.
Closes #757 .
2011-08-03 11:06:58 -07:00
Brian Anderson
228422303f
Remove the last remaining xfail-boot directive
2011-08-03 10:55:59 -07:00
Brian Anderson
c53402846e
Remove all xfail-stage0 directives
...
While it is still technically possible to test stage 0, it is not part of any
of the main testing rules and maintaining xfail-stage0 is a chore. Nobody
should worry about how tests fare in stage0.
2011-08-03 10:55:59 -07:00
Brian Anderson
63600828cd
Un-xfail more pretty-printing tests
2011-08-03 10:55:59 -07:00
Brian Anderson
e4da7c5bee
parse_crate_from_source_str takes a parse_sess, not codemap
...
This was causing problems when reading from stdin for subsequent passes that
needed to generate node ids.
2011-08-03 10:55:59 -07:00
Brian Anderson
97a8784c98
Fix pretty-printer to read from files again
...
I accidentally made the pretty-printer always read from stdin
2011-08-03 10:55:59 -07:00
Brian Anderson
0b7a94a94c
Pretty-print kinds of type params
2011-08-03 10:55:59 -07:00
Brian Anderson
843767a841
Disambiguate unop statements in pretty-printer. Closes #674
2011-08-03 10:55:59 -07:00
Brian Anderson
ea81c03960
Revert "Handle conditionals on _|_ - typed values correctly"
...
This reverts commit 13f8b3f2a6
.
run-pass/if-ret.rs does not translate correctly when unoptimized. Issue #797
2011-08-03 10:48:52 -07:00
Marijn Haverbeke
d08c0f0ec1
Make ast::pat_bindings an iterator
...
And use it to get rid of some repetetive code
2011-08-03 10:26:41 +02:00
Tim Chevalier
948f8090ae
Handle _|_ - typed discriminants in alts correctly
...
Stop me, won't you, if you've heard this one before?
Closes #794
2011-08-02 19:02:38 -07:00
Tim Chevalier
13f8b3f2a6
Handle conditionals on _|_ - typed values correctly
...
Closes #776
2011-08-02 18:34:44 -07:00
Tim Chevalier
7c34550931
Make _|_ type binopable
...
But don't actually generate code that does the operation. That means
hoisting the check I added in my last commit from trans_compare
up into trans_eager_binop (don't generate any code if one operand
has type _|_ ).
Closes #777
2011-08-02 18:06:46 -07:00
Brian Anderson
44c93b5fb2
Remove task-comm-chan-chan test
...
This issue has a smaller test case in chan-leak.rs
2011-08-02 17:49:11 -07:00
Brian Anderson
a6cb0c2843
Enable more tests that pretty-print correctly now
2011-08-02 17:49:11 -07:00
Brian Anderson
2911156820
Pretty-print fn constraints more correctish
2011-08-02 17:49:11 -07:00
Brian Anderson
637037f68c
Un-xfail run-pass/claim-nonterm
...
Seems to work
2011-08-02 17:49:11 -07:00
Brian Anderson
25b16ba9a2
Un-xfail run-fail/fn-constraint-claim
...
Seems to work
2011-08-02 17:49:11 -07:00
Brian Anderson
3eef9993af
Don't pp extra lines after block open when preserving whitespace. Closes #759
2011-08-02 17:49:11 -07:00
Tim Chevalier
731797d075
In trans, don't assume both sides of a binop have the same type
...
This was at least partially responsible for Issue 777.
The only solution I can think of is for trans to just not generate
code for a comparison if one or both sides has type _|_. Since
that means evaluating that subexpression diverges, it should be ok
to never do the comparison. Actually generating code for the
comparison would trip an LLVM assertion failure.
2011-08-02 17:36:41 -07:00
Lindsey Kuper
430a28bb49
Refactor: a backwarding vtable can only have one kind of method.
2011-08-02 16:59:49 -07:00
Lindsey Kuper
48467c4faa
Comment tweaks and re-flows.
2011-08-02 16:53:31 -07:00
Michael Sullivan
f371482593
Consolidate environment building/loading between closure types.
2011-08-02 16:30:56 -07:00
Michael Sullivan
4cf4e17e1d
Track the node_id of the function in trans_common::fn_ctxt.
2011-08-02 16:30:56 -07:00
Michael Sullivan
f8b0d3d7d2
Use GEPi a bunch.
2011-08-02 16:26:00 -07:00
Graydon Hoare
bc11cd5ca5
Fix majority of valgrind-purity bugs observed in a rustc run (LLVM still appears to leak some of its own memory).
2011-08-02 15:00:51 -07:00
Paul Stansifer
ab4764520c
Allow patterns of the form `[a, b, c ...] to be matched and transcribed.
2011-08-02 14:46:02 -07:00
Brian Anderson
ea2a968146
Include benchmarks in pretty-print tests
2011-08-02 14:37:03 -07:00
Brian Anderson
795e80fc19
Register new snapshots
2011-08-02 13:43:13 -07:00
Tim Chevalier
40c1b864c6
Use or-patterns in trans::trans_compare, eliminating a FIXME
2011-08-02 13:17:59 -07:00
Brian Anderson
35e9e02066
Use ioivec::read_whole_file_str in a few places
2011-08-02 10:39:14 -07:00
Brian Anderson
a1a25969a0
Add ioivec::read_whole_file/read_whole_file_str
2011-08-02 10:39:14 -07:00
Brian Anderson
77be30fa73
Typecheck pretty-printing test results as libraries. Issue #789
...
After running source files through the pretty printer, we sanity check them by
running the results through the compiler with the --no-trans flag. Now also
use the --lib flag so that pretty-printer tests don't have to include a main
function.
2011-08-02 10:39:14 -07:00
Brian Anderson
0fbb6782bb
Add dedicated pretty-printer tests with new pp-exact directive
...
Add a new src/test/pretty directory to hold just source files for testing the
pretty-printer.
Add a new pp-exact directive. When this directive is followed by a file name
it specifies a file containing the output that the pretty-printer should
generate. When pp-exact is not followed by a filename it says that the file
should pretty-print as written.
2011-08-02 10:39:13 -07:00
Brian Anderson
e13390a199
Pretty-print test the rfail tests. Issue #789
2011-08-02 10:39:13 -07:00
Brian Anderson
0a6e3362c6
Add xfail-pretty directives to tests that don't pretty-print correctly
...
Issue #789
2011-08-02 10:39:13 -07:00
Brian Anderson
166c73546a
Remove test/run-pass/simple-qsort
...
This is part of stdtest now
2011-08-02 10:39:13 -07:00
Brian Anderson
67b8f8b13a
Display the name of the test being waited for before the result is in
...
So the test runner displays the name of the test, then waits for it to finish,
then displays the result. It worked this way before things were parallelized
and it's just much friendlier this way.
2011-08-02 10:39:13 -07:00
Brian Anderson
1702b8507d
Add xfail-pretty test directive. Issue #789
...
Indicates that this test should not be used to test the pretty-printer
2011-08-02 10:39:13 -07:00
Brian Anderson
ce8cac5d9a
Use color to report the final test result, even when running in parallel
...
After the tests are run there is no more parallelism, so it should be less
likely that the control characters will introduce wierd artifacts.
2011-08-02 10:39:13 -07:00
Brian Anderson
a601eb169e
Run pretty-printed sources through the compiler again for sanity
...
Just go as far as typechecking for speed sake.
Issue #789
2011-08-02 10:39:13 -07:00
Brian Anderson
1653f3f1a9
Implement test that pretty-printed code converges. Issue #789
2011-08-02 10:39:13 -07:00
Brian Anderson
4828d8f73f
Remove unused procsrv::clone function from compiletest
2011-08-02 10:39:12 -07:00
Brian Anderson
291c43af31
Fix comment typo in compiletest
2011-08-02 10:39:12 -07:00
Brian Anderson
39d3b93a38
Pretty-print tests only run on .rs files. Issue #789
...
The pretty-printer can't handle .rc files currently
2011-08-02 10:39:12 -07:00
Brian Anderson
4e8ab8b3a8
Introduce pretty-print testing mode to compiletest. Issue #789
2011-08-02 10:39:12 -07:00
Brian Anderson
af2eecdabe
Replace an open-coded conversion with ivec::from_vec
2011-08-02 10:39:12 -07:00
Brian Anderson
a8af13e784
Move compiletest modules into separate files
2011-08-02 10:39:12 -07:00
Brian Anderson
840a09c86e
Add a --no-trans command line option
...
Runs all passes before translation. This will be used for pretty-printing
tests to verify that the results are still probably valid Rust code.
2011-08-02 10:39:12 -07:00
Brian Anderson
5f4b7e1ba7
Compiler accepts input from stdin when source file is called "-"
2011-08-02 10:39:09 -07:00
Marijn Haverbeke
2d5b651f49
Assign collection element ty to loop local tvar when checking loops
...
This makes the type declarationg for the loop variable optional in
most cases.
Closes #790
2011-08-02 15:09:29 +02:00
Marijn Haverbeke
78a0d380cc
Do not try to save block result when the block is an iter body
...
Closes #791
2011-08-02 14:28:32 +02:00
Marijn Haverbeke
6c9b90d06a
Be a little more clever about picking columns to match on in trans_alt
...
This should result in slightly more efficient matching of 'complex'
patterns with multiple discriminants in them.
2011-08-02 12:57:27 +02:00
Marijn Haverbeke
f8fa574864
Copy locals created by destructuring on the content of a box
...
This is required so that assigning to these locals doesn't clobber
the content of the box.
(A possible optimization would be to only do this copying for
locals that actually are assigned to.)
2011-08-02 12:09:15 +02:00
Marijn Haverbeke
043d95a2bd
Move ppaux::ty_to_str to new record syntax
2011-08-02 12:09:15 +02:00
Marijn Haverbeke
8d8ff16dfe
Improve handling of bottom type in alt arms
2011-08-02 10:24:06 +02:00
Tim Chevalier
5cf5f5024d
Handle bang functions correctly in typestate
...
The logic for how the "returns" constraint was handled was always
dodgy, for reasons explained in the comments I added to
auxiliary::fn_info in this commit. Fixed it by adding distinct
"returns" and "diverges" constraints for each function, which
are both handled positively (that is: for a ! function, the
"diverges" constraint must be true on every exit path; for
any other function, the "returns" constraint must be true
on every exit path).
Closes #779
2011-08-01 20:58:16 -07:00
Brian Anderson
c9b16ac4c2
Add std::str::is_whitespace
2011-08-01 18:55:51 -07:00
Brian Anderson
1ad68eafd2
Add std::str::trim/trim_left/trim_right
2011-08-01 18:55:51 -07:00
Brian Anderson
598e25e091
Add std::char_slice
2011-08-01 18:55:51 -07:00
Brian Anderson
0c7a95fde5
Add std::char::is_whitespace
2011-08-01 18:55:51 -07:00
Brian Anderson
6f8f00d1af
Add std::char module
2011-08-01 18:55:51 -07:00
Paul Stansifer
fcc32797de
Fix incorrect uses of str::buf()
2011-08-01 18:51:56 -07:00
Eric Holk
286be2d94e
Adding an intrinsic for recv.
2011-08-01 18:43:05 -07:00
Brian Anderson
2f7ed33517
Ignore whitespace in argument lists in compiletest
...
Makes testing work with DEBUG=1
2011-08-01 16:41:20 -07:00
Eric Holk
939bca0d84
Added send and receive to comm library.
2011-08-01 15:58:39 -07:00
Eric Holk
6a6d5c669e
Enabling logging in circular_buffer again.
2011-08-01 15:58:39 -07:00
Eric Holk
b3d9d9b73c
Objectified library chans and ports.
2011-08-01 15:58:30 -07:00
Eric Holk
5a673cc2c9
Started working on a library-based comm system. Creating and deleting ports work.
2011-08-01 15:58:30 -07:00
Michael Sullivan
7a05f1db7c
Fix closures over dynamically-sized polymorphic values.
2011-08-01 15:19:55 -07:00
Michael Sullivan
601c299d52
Fix closures over known-size polymorphic values.
2011-08-01 15:18:44 -07:00
Michael Sullivan
a32f287c8a
Add a GEPi function that wraps GEP with integer arguments.
2011-08-01 15:18:44 -07:00
Brian Anderson
7b87fa3683
Replace a lock/unlock with scoped_lock in rust_scheduler::create_task
2011-08-01 11:01:59 -07:00
Marijn Haverbeke
4837a57df5
Add tests for destructuring locals
2011-08-01 17:52:43 +02:00
Marijn Haverbeke
92240eb25b
Add check for irrefutable patterns in destructuring locals
2011-08-01 17:52:43 +02:00
Marijn Haverbeke
985c32ef4c
Partially implement destructuring locals
...
You can now say
let {bcx, val} = some_result_returner();
Similar for loop variables. Assigning to such variables is not safe
yet. Function arguments also remain a TODO.
2011-08-01 17:51:37 +02:00
Marijn Haverbeke
48ec25da42
Get rid of walk.rs
...
And we're down to a single AST walker again
2011-07-31 12:24:14 +02:00
Marijn Haverbeke
c7ef6d2866
Stop using walk.rs in the fuzzer
2011-07-31 12:23:42 +02:00
Tim Chevalier
2971cfb145
Remove unused imports
2011-07-31 00:06:25 -07:00
Tim Chevalier
28f7c6af24
Change bitvectors::relax_precond_block to use visit instead of walk
2011-07-31 00:06:25 -07:00
Brian Anderson
d552a0b959
Minimize scheduler locking on task creation
...
This takes my CPU utilization on task-perf-spawnalot from 35% to 55%
2011-07-29 23:02:51 -07:00
Brian Anderson
ec46f07e6e
Add a task spawning benchmark
...
This is the kind of workload that the test runner generates - lots of tiny
little tasks - and currently it leaves the CPU underutilized.
2011-07-29 22:45:01 -07:00
Brian Anderson
6657e729de
Lock the new task's scheduler when creating a task
...
Previously we were locking the spawning task's scheduler. I couldn't
see that that was protecting anything. The newborn_task list in the new task's
scheduler though was unprotected from concurrent access. So now we're locking
the new task's scheduler.
2011-07-29 22:43:11 -07:00
Brian Anderson
96a629d2fa
Base test concurrency on the number of scheduler threads.
...
Ideally we would just spawn every test and collect the results but I'm not
entirely comfortable doing that yet for reasons that I'm too tired to remember
right now. Urgh.
2011-07-29 21:07:03 -07:00
Brian Anderson
9dbe6941c4
Add sched_threads rt function to get the number of scheduler threads
2011-07-29 21:03:17 -07:00
Brian Anderson
b8c209cba1
Refactor std::test
...
Separate the console output from the running of tests
2011-07-29 19:54:05 -07:00
Eric Holk
d1dbb99984
Removing proxies and message queues.
2011-07-29 18:54:59 -07:00
Graydon Hoare
bc4e9afe25
Fix bug in typechecker counting occurrences of typarams in instantiation rather than checking formals list.
2011-07-29 18:48:15 -07:00
Graydon Hoare
0c9b749d20
Enable kind checking on typarams, fix kind constraints in library and comp.
2011-07-29 18:48:15 -07:00
Lindsey Kuper
6ba4e34959
Reduced test case for current backwarding bug.
...
Still working on getting backwarding to play nicely with self and
overriding. Currently can't fix issue #702 without breaking how self
and overriding interact.
2011-07-29 18:30:27 -07:00
Michael Sullivan
a34f7c8cb3
Switch the heap build and load environment functions to use GEP_tup_like.
2011-07-29 18:22:41 -07:00
Michael Sullivan
56f0fbeafc
Initial trans of lambdas. Doesn't work with polymorphism yet.
2011-07-29 18:22:41 -07:00
Tim Chevalier
766e939857
Test case for previous commit
2011-07-29 18:00:10 -07:00
Tim Chevalier
126cd44c38
Refactor typestate code involving stmt_decls
...
To handle multiple-LHS declarations with initializers properly,
I changed seq_states to take a list of expressions paired with optional
names, not just a list of expressions. Then, the same logic that handles
ordered lists of subexpressions everywhere else can handle multi-
declarations.
2011-07-29 18:00:10 -07:00
Graydon Hoare
59c441a66a
Encode, decode, and thread through typechecking all the param kinds, not just the counts.
2011-07-29 16:40:30 -07:00
Michael Sullivan
a684f6078f
Do some cleanup in load_environment.
2011-07-29 15:29:38 -07:00
Michael Sullivan
6a4d0ce829
Add in some missing cases for typestate with closures.
2011-07-29 15:29:38 -07:00
Lindsey Kuper
7efbad674a
Don't confuse backwards and forwards.
...
Oops. If we already have a backwarding vtable, that means that we are
currently building a forwarding fn. (Progress toward issue #702.)
2011-07-29 15:21:40 -07:00
Lindsey Kuper
6423cc7b52
Comments and cleanup, in preparation for more work on issue #702 .
2011-07-29 15:21:40 -07:00
Lindsey Kuper
f4eacbb3b4
Get rid of an obsolete comment now that obj dtors are gone.
2011-07-29 15:21:40 -07:00