Commit graph

4989 commits

Author SHA1 Message Date
Tim Chevalier
809a833e34 Test case for unchecked blocks 2011-08-25 18:33:57 -07:00
Tim Chevalier
f841e89443 Support unchecked blocks
This patch supports the syntax

    unchecked {
      ...
    }

    to disable purity checking within a block. Presumably it will only be
    used within a declared "pure fn". However, there is no checking that it
    doesn't occur elsewhere, and it would be harmless for it to do so.

    I went with Lindsey's suggestion for the syntax, but it's subject to
    change.

    This allows you to write code that uses predicates that call arbitrary
    Rust functions, but you must declare your intentions by wrapping it in
    an unchecked { ... } block. The test case run-pass/unchecked-predicates.rs
    demonstrates how to do that.
2011-08-25 18:28:23 -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
1cb85015c3 Change "pred" to "pure fn" within the compiler. 2011-08-25 18:24:40 -07:00
Tim Chevalier
2e89edab1d Register snapshot 2011-08-25 18:01:40 -07:00
Tim Chevalier
e241f2996d Allow pure fns to have any return type 2011-08-25 17:23:35 -07:00
Patrick Walton
4dd23f24d6 rt: Null check in walk_obj_contents. Prevents marking from crashing when calling object constructors. 2011-08-25 17:14:54 -07:00
Patrick Walton
8bd019bdc8 rt: Remember the number of captured type descriptors for objects in the type descriptor crate cache 2011-08-25 14:21:05 -07:00
Brian Anderson
608f7ccded Move ast::pat_id_map to ast::util 2011-08-25 14:15:54 -07:00
Eric Holk
4d92cb5c63 Removing mention of domain, updating the communication examples. 2011-08-25 12:33:09 -07:00
Patrick Walton
880fd788eb rustc: Add an extra flag to object tydescs so that shapes know how to find the captured subtydescs 2011-08-25 12:01:10 -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
b31815f8a0 Fix istr::unsafe_from_bytes. Issue #855 2011-08-25 10:33:28 -07:00
Patrick Walton
b371891c7c rt: Fix walk_obj_contents for type-parameteric objects. Hash tables can be logged now. 2011-08-24 16:54:10 -07:00
Patrick Walton
72d78e6a93 rt: Factor out type param construction into from_tydesc and from_obj_shape. (The latter is unimplemented at the moment.) 2011-08-24 15:19:59 -07:00
Brian Anderson
0dc1d7ee57 Register new snapshots 2011-08-24 15:00:26 -07:00
Tim Chevalier
da766791d3 hmm, this should have been in the last commit. Oops. 2011-08-24 14:29:08 -07:00
Tim Chevalier
c6155d1fd1 Change "pred" to "pure fn" (but still accept "pred")
This is part 1 of changing the "pred" keyword to "pure fn".
Right now, the compiler accepts both "pred" and "pure fn".
2011-08-24 14:21:37 -07:00
Brian Anderson
5b5689d4dd Test that processes that are supposed to fail return a non-zero status 2011-08-24 13:24:03 -07:00
Patrick Walton
b07968dda4 rt: Print out fields of objects when logging them 2011-08-24 12:09:06 -07:00
Brian Anderson
65357eeecc XFAIL task-comm-2. Doesn't work under windows 2011-08-24 12:03:08 -07:00
Brian Anderson
b7d74c32b6 Fix combine-tests.py for new ivec regime 2011-08-24 12:03:08 -07:00
Brian Anderson
a0208e3899 Return an error code after fail under win32 2011-08-24 12:03:07 -07:00
Patrick Walton
db72bd90f5 mk: Introduce CFG_DISABLE_OPTIMIZE_CXX 2011-08-24 11:59:21 -07:00
Marijn Haverbeke
fa97793139 Revert "Back out copy-glue"
This reverts commit 629ee94a0b.
2011-08-24 20:30:20 +02:00
Brian Anderson
60547f6500 Use memmove to load istr literals. Issue #855 2011-08-24 10:24:59 -07:00
Marijn Haverbeke
629ee94a0b Back out copy-glue
This wasn't a good idea after all.
2011-08-24 17:05:53 +02:00
Marijn Haverbeke
15b540ded4 Use a single builder object throughout
This seems to be faster than creating separate ones for each block
context.
2011-08-24 16:57:33 +02:00
Marijn Haverbeke
b9112525ba Move to a more lightweight builder system
You now do

    bld::Ret(bcx, someval)

where you used to say

    bcx.build.Ret(someval)

Two fewer boxes are allocated for each block context, and build calls
no longer go through a vtable.
2011-08-24 16:48:10 +02:00
Marijn Haverbeke
9f44df65ef Ensure values created in an alt guard are cleaned up properly 2011-08-24 14:01:56 +02:00
Marijn Haverbeke
054914712e Remove rust_start_ivec 2011-08-24 13:59:22 +02:00
Marijn Haverbeke
e58c48bdda Optimize += [x] into a simple push operation
This is a preparation for making vectors always-on-the-heap again,
which would cause way too much malloc traffic for this idiom. I will
add an efficient std::vec::push in the future, and migrate += [x] to
that instead.

Reduces compiler code size by 3%
2011-08-24 13:57:27 +02:00
Marijn Haverbeke
bead045f27 Check for is_terminated after translating a block
Closes #861
2011-08-24 10:55:34 +02: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
68fd28c2c1 Cleanup formatting in std::sha1
This file has suffered a lot of reformats and was looking pretty ragged
2011-08-23 13:22:44 -07:00
Brian Anderson
7b12924813 Fix pretty-printing of istr literals. Issue #855 2011-08-23 11:09:38 -07:00
Brian Anderson
c274d16b7f Eliminate unused variable warnings in stdtest 2011-08-22 21:33:52 -07:00
Brian Anderson
45b614f54a Add ivec::from_str and to_str methods. Issue #855 2011-08-22 21:33:52 -07:00
Brian Anderson
663d07d319 Add std::istr. Issue #855 2011-08-22 21:33:49 -07:00
Brian Anderson
55c54f0db5 Promote std::task::rustrt::leak to std::unsafe::leak
I want to use this for std::istr
2011-08-22 18:05:34 -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
Brian Anderson
0a93a48ff5 Extract trans_ivec::alloc_with_heap from trans_ivec::trans_ivec
Need this for building istrs
2011-08-22 13:30:53 -07:00