Commit Graph

4458 Commits

Author SHA1 Message Date
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
Eric Holk
244efa6331 Merge branch 'master' of github.com:graydon/rust 2011-08-05 15:27:23 -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
Eric Holk
d65aaa933a Merge branch 'master' of github.com:graydon/rust 2011-08-05 15:17:18 -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
c6bb04aba6 Add make clean rules for libuv 2011-08-05 11:57:07 -07:00
Brian Anderson
1758876381 Build libuv with the same C compiler as the rest of rt 2011-08-05 11:57:07 -07:00
Brian Anderson
43313b5504 Introduce CC and CXX variables to the makefiles 2011-08-05 11:57:07 -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
b2c3fc739c More win32 libuv build tweaks 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
Brian Anderson
585c6f96d1 Update build rules so rt builds with libuv on Linux.
Needed to shuffle around the linker arguments and add -lpthread
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
ad925955d8 build: Don't error out if clang is too old. Instead, build with GCC. 2011-08-05 09:25:27 -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
Eric Holk
bdb84e76c5 Merge branch 'master' of github.com:graydon/rust 2011-08-04 16:17:13 -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