Commit graph

5570 commits

Author SHA1 Message Date
Niko Matsakis
4880065429 rip out unused task pointers 2011-10-24 16:06:16 -07:00
Niko Matsakis
d9b23cb022 move comm functions out of rust abi 2011-10-24 16:06:16 -07:00
Niko Matsakis
44697a4293 purge log_err 2011-10-24 16:06:16 -07:00
Niko Matsakis
e590869c8f update vec libs to use c-stack-cdecl calling convention 2011-10-24 16:06:16 -07:00
Brian Anderson
548c92df9c Register snapshots 2011-10-24 13:10:41 -07:00
Brian Anderson
ff669cf5ad Revert "Register snapshots"
This reverts commit 6e40f705c1.
2011-10-23 20:40:42 -07:00
Brian Anderson
3571061bcc Revert "Register snapshots"
This reverts commit 24a6d334b7.
2011-10-23 20:40:33 -07:00
Brian Anderson
24a6d334b7 Register snapshots 2011-10-23 20:11:07 -07:00
Brian Anderson
6e40f705c1 Register snapshots 2011-10-23 19:41:55 -07:00
Austin Seipp
1703e9ec89 Fix an insane rt build error running 'make check -j3' 2011-10-23 19:04:49 -07:00
Brian Anderson
4c95c52016 Remove a test binary that shouldn't exist 2011-10-23 14:23:09 -07:00
Brian Anderson
b916c57021 Update src/etc/gyp-uv
Make instructions more accurate. Make the sed commands work on linux.
2011-10-22 17:38:27 -07:00
Brian Anderson
bdbeb75bfb Upgrade libuv to 179f475b2ad64729feb0422f06ce133cb364482a 2011-10-22 17:37:18 -07:00
Brian Anderson
81a44ccacf Remove hack to break the AST fold cycle. Closes #998 2011-10-21 17:47:31 -07:00
Brian Anderson
160c56e768 Get 'make tidy' to work rustllvm and rt again 2011-10-21 17:35:52 -07:00
Brian Anderson
93d940de54 Register snapshots 2011-10-21 17:27:17 -07:00
Brian Anderson
739b1b5b53 Cycle-collect objects 2011-10-21 17:21:59 -07:00
Niko Matsakis
020726c981 update trans_c_stack_native_call() to use type_of_explicit_args()
currently trans_c_stack_native_call() had some ad-hoc code for
determining the type of the arguments. this code was not in
agreement with the rest of trans. now it uses the same code path.
2011-10-21 16:19:28 -07:00
Niko Matsakis
67d3d9308f add get_type_desc to list of exported funcs 2011-10-21 16:19:27 -07:00
Niko Matsakis
cdf91bbf9a add get_type_desc function to library 2011-10-21 16:19:27 -07:00
Niko Matsakis
80102c9d24 avoid extra load for by_mutable_ref parameters 2011-10-21 16:19:27 -07:00
Brian Anderson
7ab6315f5f Free vectors during cc sweep 2011-10-21 16:07:40 -07:00
Brian Anderson
2d713215a8 Record the internal reference count of environment boxes. Closes #981 2011-10-21 14:05:16 -07:00
Marijn Haverbeke
6c4c33e009 Clean up character pattern in float.rs
This is actually a test to see if I fixed the bot.
2011-10-21 21:06:54 +02:00
Marijn Haverbeke
b0a72ee06a Be more careful when parsing block calls
Previously, the parser would try to interpret this as a block call:

    if true {} // No semicolon
    {|i, am, a, block|};

Which, though unlikely, might come up in practice.
2011-10-21 14:55:54 +02:00
Marijn Haverbeke
3b5b93221e Remove some semicolons after block calls
The remaining ones can be removed after the next snapshot. (Or
we can let the next pretty-print pass take care of them.)
2011-10-21 14:24:42 +02:00
Marijn Haverbeke
7114702496 Change the way block calls are parsed, mark them as block-calls.
This makes it possible to omit the semicolon after the block, and will
cause the pretty-printer to properly print such calls (if
pretty-printing of blocks wasn't so broken). Block calls (with the
block outside of the parentheses) can now only occur at statement
level, and their value can not be used. When calling a block-style
function that returns a useful value, the block must be put insde the
parentheses.

Issue #1054
2011-10-21 14:24:14 +02:00
Marijn Haverbeke
0ce40f60e7 Drop support for iter, put, and for-each
Closes #1056
2011-10-21 13:47:24 +02:00
Marijn Haverbeke
050170d2af Remove remaining uses of iter and for-each
Issue #1056
2011-10-21 13:34:35 +02:00
Marijn Haverbeke
fd5a08384d Move ast_util::pat_bindings over to new iter system.
Issue #1056
2011-10-21 12:41:42 +02:00
Marijn Haverbeke
6bcb4a426c Remove last uses of iterators from stdlib
Issue #1056
2011-10-21 12:31:48 +02:00
Marijn Haverbeke
4ebbbe597e Move hash table iteration over to block-taking functions
Issue #1056
2011-10-21 12:21:27 +02:00
Marijn Haverbeke
9bb4595c53 Register new snapshot
(For block argument syntax.)
2011-10-21 11:56:39 +02:00
Marijn Haverbeke
f134261ae6 Support Ruby-style block argument syntax
Issue #1054
2011-10-21 11:32:26 +02:00
Brian Anderson
0b791f5143 Restore broken tests in stdtest::test 2011-10-20 21:00:50 -07:00
Brian Anderson
d24894e181 Remove unused empty_fn_ty from rustc::front::test 2011-10-20 20:54:12 -07:00
Brian Anderson
4ef2c37059 Give native functions proto_bare 2011-10-20 20:53:52 -07:00
Brian Anderson
ebc61e39d7 Remove temporary fn# syntax 2011-10-20 20:34:04 -07:00
Brian Anderson
6fb9d4f83b Remove typeck::proto_to_ty_proto 2011-10-20 20:30:20 -07:00
Brian Anderson
f64d47a61e Register snapshots 2011-10-20 19:54:57 -07:00
Brian Anderson
c10eb221da Get windows working under the bare function regime
Had to ignore some task failure tests due to the current implementation
of spawn which guarantees that there's always something in the spawned
task that needs to be unwound.

Fixed some win-specific build problems.
2011-10-20 18:23:48 -07:00
Brian Anderson
5c38f7dfd7 Don't allow fn@ items
fn@ is intended to be caputring but isn't implemented.
2011-10-20 18:23:48 -07:00
Brian Anderson
9efdd0f326 Merge ast::proto_shared and ast::proto_closure
Now they are both just proto_shared and proto_shared takes an
argument indicating that it is sugared as 'lambda'
2011-10-20 18:23:48 -07:00
Brian Anderson
4b30a06abe Rename ast::proto_fn to ast::proto_shared 2011-10-20 18:23:48 -07:00
Brian Anderson
29ad3bdb10 Make fn denote a bare function. Convert fn to fn@ as needed 2011-10-20 18:23:48 -07:00
Brian Anderson
f324704c0a Parse obj methods as proto_bare
I don't know if this is the right thing to do, but it works
and it lets 'fn' always mean proto_bare
2011-10-20 18:23:48 -07:00
Brian Anderson
391e12124b Tweak typecheck to enforce covariance on higher-order function arguments 2011-10-20 18:23:48 -07:00
Brian Anderson
342a400e79 Remove type coercion from fn to block
fn is a proper subtype of block now
2011-10-20 18:23:48 -07:00
Brian Anderson
8136b92ee8 Give subtype relationships to function types 2011-10-20 18:23:48 -07:00
Brian Anderson
ed985b61d5 Bare functions can coerce to blocks 2011-10-20 18:23:48 -07:00
Brian Anderson
354bfc8292 Bare functions can coerce to shared closures 2011-10-20 18:23:48 -07:00
Brian Anderson
3bb020aaf8 Revert "Remove the environment argument from bare functions"
This reverts commit 1b0f1f0b79.
2011-10-20 18:23:48 -07:00
Brian Anderson
070c39ca1d Split parsing of fn proto between types, items and anons
The meaning of various fn incantations is going to get temporarily confusing
2011-10-20 18:23:47 -07:00
Brian Anderson
686d6a485f Drop the 2 from the spawn*2 functions
Issue #1022
2011-10-20 18:23:47 -07:00
Brian Anderson
e0bba33caa Rename std::task::spawn_inner to unsafe_spawn_inner
Delete the rest of the old, unused spawn functions.

Issue #1022
2011-10-20 18:23:47 -07:00
Brian Anderson
446aea11d0 Stop exporting unsafe spawn functions
Issue #1022
2011-10-20 18:23:47 -07:00
Brian Anderson
3b54dcfa79 Convert the test runners to typesafe spawn
Issue #1022
2011-10-20 18:23:47 -07:00
Brian Anderson
1abebf042a Convert std::aio to new spawn functions
Issue #1022
2011-10-20 18:23:47 -07:00
Brian Anderson
a4956a7cdd XFAIL task-perf-word-count-generic
This can't be done with bare functions.

Issue #1022
2011-10-20 18:23:47 -07:00
Brian Anderson
ac671c3172 Convert tests to use bare-fn spawn
Issue #1022
2011-10-20 18:23:47 -07:00
Brian Anderson
4341e50e3a Add safe versions of spawn using bare functions
Currently they just wrap the unsafe versions. Will need to be rewritten
eventually.

Issue #1022
2011-10-20 18:23:47 -07:00
Brian Anderson
034408c40a Convert DPRINT to LOG in rust_cc.cpp and add more logging 2011-10-20 18:19:06 -07:00
Brian Anderson
dcee98b024 Un-xfail-fast some tests
check-fast is more reliable now.
2011-10-20 16:01:24 -07:00
Brian Anderson
28161fcf3c Change run-pass/lots-a-fail.rs from xfail-fast to xfail-win32
All failing tasks leak on windows now
2011-10-20 16:00:13 -07:00
Brian Anderson
0714bb5f7d Fix the problem with check-fast randomly failing
Trans has been assuming that tag node id's are unique across crates and they
are not so, depending on which way the wind is blowing, it would choose to use
a crate-local tag variant instead of the correct one from std.

No test case since I can't come up with a reliable one that compiles in a
reasonable amount of time.
2011-10-20 15:38:51 -07:00
Marijn Haverbeke
f8f1d950ef Register new snapshots 2011-10-20 17:36:29 +02:00
Marijn Haverbeke
ba1c6fcf38 Remove the last vestiges of main.ll
Closes #992
2011-10-20 17:36:28 +02:00
Marijn Haverbeke
ef63f09dcd Don't rely on main.ll anymore
I'll remove the actual file after I register a snapshot.

Issue #992
2011-10-20 17:18:38 +02:00
Marijn Haverbeke
cff9c67674 Output linker errors, when linking fails 2011-10-20 15:30:27 +02:00
Marijn Haverbeke
8124846b2c Get rid of taskpointer-passing throughout the compiler
Only intrinsics still take a dummy taskptr. We'll have to do some
makefile stunts to snapshot a version without taskptrs-in-intrinsics.

Issue #466
2011-10-20 14:22:17 +02:00
Marijn Haverbeke
457683c7fe Do not pass taskpointers to "rust" native functions
Issue #466
2011-10-20 14:22:17 +02:00
Marijn Haverbeke
6323a012bd Remove taskptr argument from upcalls
Issue #466
2011-10-20 13:15:21 +02:00
Marijn Haverbeke
e927df17f7 Remove spawn_wrap and main_wrap kludges
This isn't needed now that our functions are cdecl (and was apparently
only still working by accident).

Issue #992
2011-10-20 13:15:09 +02:00
Marijn Haverbeke
243c5c3479 Use snap runtime, and the old main.o, for stage1
This is intended to be reverted again after I register the next
snapshot.
2011-10-20 13:14:28 +02:00
Brian Anderson
880b1ec9f5 Fail nicer when the parser doesn't find an expected string literal
Closes #1028
2011-10-19 18:04:44 -07:00
Matt Brubeck
15d33f7957 Fix parse error in constrained-type-missing-check.rs 2011-10-18 16:42:00 -07:00
Brian Anderson
f70a894855 Register snapshots 2011-10-18 12:08:15 -07:00
Brian Anderson
ac276f7016 Introduce fn@ as a synonym for fn 2011-10-18 11:14:02 -07:00
Brian Anderson
314c011d71 Immutable and mutable? are covariant on their inner types
Whereas [mutable T] is invariant with respect to T, [T] and [mutable? T]
are covariant with respect to T.
2011-10-18 10:37:04 -07:00
Marijn Haverbeke
71a4a66135 Add a math module to the standard lib
I need some rudimentary stdlib stuff for the tutorial.

Closes #1042
2011-10-18 13:54:35 +02:00
Marijn Haverbeke
d9d0782b5f Don't try to build an LLVM switch on floats
Closes #1046
2011-10-18 13:54:35 +02:00
Marijn Haverbeke
3cabe7429f Add a print and println to std::io 2011-10-18 13:06:47 +02:00
Brian Anderson
0f0fa26c72 Enforce variance rules for mutable types 2011-10-17 20:51:34 -07:00
Brian Anderson
48d351b21e Add a variance transform for calculation of recursive variance 2011-10-17 19:37:34 -07:00
Brian Anderson
d6613384fd Introduce covariance, contravariance and invariance to the type unifier
This will be used to resolve some problems with mutable? covariance and also
to implement function subtyping
2011-10-17 19:34:12 -07:00
Brian Anderson
b61578e1cd Don't unify from mutable? to immutable
Immutable is supposed to be a subtype of mutable-huh.
2011-10-17 16:36:49 -07:00
Brian Anderson
f7a825c614 Split record_var_binding into methods for expected and actual
This allows unify to maintain the same subtype relationship between
expected and actual throughout unify, which we are going to need
for mutable? and for function types.
2011-10-17 16:36:49 -07:00
Brian Anderson
1a64153b24 Correct two more analyses of mutable? as mutable
I can't come up with test cases but this seems correct.
2011-10-17 16:35:33 -07:00
Brian Anderson
4d9d889dbf Don't allow assignment to mutable-wha? 2011-10-17 16:35:33 -07:00
David Rajchenbach-Teller
454333368c [Lib] int.rs, uint.rs: added max_value, min_value 2011-10-17 11:22:57 -07:00
David Rajchenbach-Teller
064f9dd93e [Lib] uint.rs: +min_value 2011-10-17 11:22:57 -07:00
David Rajchenbach-Teller
a85e035038 [Lib] rand.rs: type rng now defines next_float 2011-10-17 11:22:57 -07:00
David Rajchenbach-Teller
eba88ef3ea [Lib] u32.rs: created 2011-10-17 11:22:57 -07:00
David Rajchenbach-Teller
27ca86a853 [Lib] u8.rs, u64.rs: +min_value, max_value 2011-10-17 11:22:57 -07:00
Brian Anderson
007422cc04 Change the linkage order on linux and add -ldl
-lrt and -ldl need to be specified after -lrustrt since they are only used by
rustrt.
2011-10-17 10:41:22 -07:00
Brian Anderson
b42e551285 Only link librt on linux 2011-10-16 02:36:42 -07:00
Haitao Li
ad5014bf4c Fix link error by explicitly link needed DSOs
Building Rust(version 280bc56) on Ubuntu 11.10 failed with link error,
like:

compile_and_link: stage0/lib/rustc/i686-unknown-linux-gnu/lib/libstd.so
compile_and_link: stage0/lib/rustc/i686-unknown-linux-gnu/bin/rustc
/local/src/rust/build/stage0/lib/rustc/i686-unknown-linux-gnu/lib/librustrt.so:
undefined reference to `clock_gettime'
collect2: ld returned 1 exit status
error: linking with gcc failed with code 1

GCC toolchain released by Ubuntu 11.10 introduced a few compiler flags
that are different with upstream GCC[1]. Flags "-Wl,--as-needed' and
'-Wl,--no-copy-dt-needed-entries' are passed by default.

Function clock_gettime from librt is used by librustrt, indirectly by
rustc. It is necessary to explicitly pass the "-lrt" flags when building
rustc.

Please note since the toolchain changes will be the default in the next
release(2.22) of binutils, this is not actually a Debian/Ubuntu specific
issue.

1. https://wiki.ubuntu.com/OneiricOcelot/ReleaseNotes#GCC_4.6_Toolchain

Signed-off-by: Haitao Li <lihaitao@gmail.com>
2011-10-16 17:12:30 +08:00
Elly Jones
a5dc6a7aa8 Update LinkModules invocation to use new prototype
LLVM revision 141606 changes the prototype of llvm::Linker::LinkModules.

Signed-off-by: Elly Jones <elly@leptoquark.net>
2011-10-15 15:53:18 -07:00
Marijn Haverbeke
0a01144797 Use trans_expr_save_in instead of trans_expr when appropriate
This guards against passing a save_in destination to nil or bot-typed things.
2011-10-14 11:27:16 +02:00
Marijn Haverbeke
06257d66e7 Don't crash when reporting an unresolved import in the nil scope
Closes #1027
2011-10-14 11:25:14 +02:00