Commit Graph

8612 Commits

Author SHA1 Message Date
Brian Anderson
771c1be6a6 rt: Refactor the scheduler loop so that it can be driven from without 2012-03-31 19:51:29 -07:00
Brian Anderson
243790836a rt: Rename rust_task_thread to rust_sched_loop
This class no longer represents a thread; it just schedules tasks.
2012-03-31 19:51:29 -07:00
Brian Anderson
6bf8d19712 rt: Extract rust_sched_launcher from rust_task_thread
rust_sched_launcher is actually responsible for setting up the thread and
starting the loop. There will be other implementations that do not actually
set up a new thread, in order to support scheduling tasks on the main OS
thread.
2012-03-31 19:51:29 -07:00
Jon Morton
9851a906a5 initialize cur_thread, first task on thread 0 2012-03-31 13:14:54 -05:00
Jon Morton
8aee42a382 Choose task thread in rust_scheduler by round robin
Remove the random context from rust_scheduler and use a simple round robin system to choose which thread a new task gets put on. Also, some incorrect tab indents around scoped blocks were fixed.
2012-03-31 02:14:44 -05:00
Brian Anderson
0904f25507 rustc: Convert some error logs to debug 2012-03-30 17:31:40 -07:00
Marijn Haverbeke
a4906b81f7 Change a span_err back to span_fatal
Closes #2073
2012-03-30 08:25:45 +02:00
Brian Anderson
6e8cf935db core: Add each, each_char to str::extensions 2012-03-29 22:30:15 -07:00
Brian Anderson
8641c95221 core: Add str::each_char 2012-03-29 22:28:26 -07:00
Brian Anderson
9bff2f2545 core: Add each, eachi to vec::extensions 2012-03-29 22:17:11 -07:00
Brian Anderson
5d54defce4 core: Add extension methods for vec 2012-03-29 20:56:50 -07:00
Brian Anderson
f65ea0c812 core: Add extension methods for option 2012-03-29 20:56:50 -07:00
Brian Anderson
392d3c8d44 core: Add extension methods for str 2012-03-29 20:56:50 -07:00
Niko Matsakis
35a3fa0999 add some comments explaining how the tables work 2012-03-29 19:41:09 -07:00
Niko Matsakis
2b45da8a33 refactor to store the types during inference in tables in the fcx
this is a step towards separating out the repr. of
types during inference from the repr. in later stages.
2012-03-29 19:41:09 -07:00
Niko Matsakis
f682b99e36 generate correct constraints for assignments 2012-03-29 19:41:09 -07:00
Niko Matsakis
76d0a13ae5 resolve type variables with no constraints to bot 2012-03-29 19:41:09 -07:00
Brian Anderson
5b3740508a test: Prevent run-fail/too-much-recursion from being optimized to nothing 2012-03-29 16:43:18 -07:00
Brian Anderson
b17145b4ae rt: Track backtraces of all allocations with RUSTRT_TRACK_ALLOCATIONS=3 2012-03-29 16:43:18 -07:00
Brian Anderson
3ff01361d5 rt: Make the CC sweep use the box annihilator 2012-03-29 16:43:18 -07:00
Brian Anderson
ad26b00696 rustc: Generate fewer landing pads 2012-03-29 16:43:18 -07:00
Brian Anderson
15de9b3c95 rt: Make the box annihilator walk and delete contents 2012-03-29 16:43:18 -07:00
Brian Anderson
5747fe7a2c rt: For now, only run the box annihilator after task failure 2012-03-29 16:43:18 -07:00
Brian Anderson
7f9ed39040 rustc: Only invoke when there are cleanups 2012-03-29 16:43:18 -07:00
Brian Anderson
8780db2e0b rustc: Delete some unused invoke code 2012-03-29 16:43:18 -07:00
Brian Anderson
b420f46f03 rustc: Don't generate landing pad cleanups for boxy things 2012-03-29 16:43:18 -07:00
Brian Anderson
3a7a408386 rt: Free all outstanding boxes at task death 2012-03-29 16:43:18 -07:00
Brian Anderson
106c9faa59 rustc: Move ext to librustsyntax 2012-03-29 14:42:31 -07:00
Brian Anderson
14e9f58b50 build: Add librustsyntax to snapshots 2012-03-29 14:42:31 -07:00
Brian Anderson
0e87039348 rustc: Remove the rustsyntax::attr wrapper in front 2012-03-29 14:42:31 -07:00
Brian Anderson
ba69a738c7 rustc: Cleanup 2012-03-29 14:42:31 -07:00
Brian Anderson
442d0a783a rustc: Move attr, parse, print to rustsyntax 2012-03-29 14:42:31 -07:00
Brian Anderson
15947f8b19 rustc: Move lexer and token to rustsyntax 2012-03-29 14:42:30 -07:00
Brian Anderson
ce216a5533 rustc: Remove the session dependency from front::attr 2012-03-29 14:42:30 -07:00
Brian Anderson
cb2840bcaf rustc: Add an accessor to get the diagnostic handler from the session 2012-03-29 14:42:30 -07:00
Brian Anderson
8f809f89d9 rustc: Move diagnostic to rustsyntax 2012-03-29 14:42:30 -07:00
Brian Anderson
5c25e78b27 rustc: Move fold to rustsyntax 2012-03-29 14:42:30 -07:00
Brian Anderson
454df53464 rustc: Move interner to rustsyntax 2012-03-29 14:42:30 -07:00
Brian Anderson
9e299f53f4 rustc: Move ast, ast_util, visit to rustsyntax 2012-03-29 14:42:30 -07:00
Brian Anderson
140151f3f9 rustc: Move codemap to rustsyntax 2012-03-29 14:42:30 -07:00
Brian Anderson
a0ed1fb20b build: Introduce rustsyntax crate 2012-03-29 14:42:30 -07:00
Tim Chevalier
c7082ce8e8 Require "self" as base expression for intra-class method or field references
All field or method references within a class must begin with "self." now.
A bare reference to a field or method in the same class will no longer
typecheck.
2012-03-29 12:22:01 -07:00
Patrick Walton
c2f28e231f stdlib: Remove the now-obsolete vec::alloc_len in favor of vec::capacity 2012-03-29 08:57:34 -07:00
Patrick Walton
8774493dd3 test: Rewrite binarytrees to use arenas
Perf isn't bad now. Still 50% slower than Java, but faster than other GC'd languages.
2012-03-29 08:41:26 -07:00
Patrick Walton
166d14e42d stdlib: Actually increase arena chunk sizes by powers of two 2012-03-29 08:41:26 -07:00
Patrick Walton
b210c7ad97 stdlib: Allow the fast path of arena allocation to be CCI'd. 15% improvement on binary-trees. 2012-03-29 08:41:26 -07:00
Patrick Walton
1d25594657 rustc: Add a vec::alloc_len and fix arena logic to use it 2012-03-29 08:41:26 -07:00
Patrick Walton
5ce3d35f41 rustc: Don't zero out arena chunks with vec::from_elem; that's slow because it calls the glue. 2012-03-29 08:41:25 -07:00
Patrick Walton
2663018792 rustc: Fix an infinite loop during size calculations for recursive region pointer types 2012-03-29 08:41:25 -07:00
Patrick Walton
6f0cbf4cd4 stdlib: Fix a pointer mistake in arenas 2012-03-29 08:41:25 -07:00
Brian Anderson
0d5d2e5e14 core: Don't use upcall_vec_grow from str::push_char 2012-03-29 00:20:05 -07:00
Grahame Bowland
7a87258155 Rewrite str::push_char in rust.
Avoid crossing to C to reallocate underlying array when possible,
if we must we now only cross once per char (not once per byte.)
2012-03-29 00:20:05 -07:00
Brian Anderson
b7b66b6cb3 core: Don't call into the runtime to reserve if we have capacity 2012-03-29 00:20:05 -07:00
Brian Anderson
c0a99790cb core: Add str::capacity 2012-03-29 00:20:05 -07:00
Brian Anderson
ad21976fbc core: Add vec::capacity 2012-03-29 00:20:05 -07:00
Brian Anderson
5e42c5cf19 core: Add str::reserve_at_least 2012-03-29 00:20:05 -07:00
Brian Anderson
b3d7823381 core: Add and use vec::reserve_at_least
This reserves in powers of two
2012-03-29 00:20:05 -07:00
Brian Anderson
8e743b2981 core: Improve docs for str::reserve 2012-03-29 00:20:05 -07:00
Brian Anderson
1446534271 core: Clarify docs on vec::reserve 2012-03-29 00:20:05 -07:00
Graydon Hoare
412dba5743 Update snaps for linux to point to snaps that actually work on RHEL5. 2012-03-28 20:58:43 -07:00
Graydon Hoare
e950313155 Remove execvpe use in general, it seems pointless and non-portable. 2012-03-28 20:58:43 -07:00
Tim Chevalier
f7bbe537c1 Allow explicit self-calls within classes
Allow writing self.f() within a class that has a method f. In a future
commit, this syntax will be required. For now, you can write either
self.f() or f().

I added a "privacy" field to all methods (whether class methods or not),
which allowed me to refactor the AST somewhat (getting rid of the
class_item type; now there's just class_member).
2012-03-28 20:30:07 -07:00
Niko Matsakis
fe610f04d8 use fresh vars in place of _|_ when incorrect # of params supplied 2012-03-28 17:02:54 -07:00
Niko Matsakis
23f92ea370 Detect and report types which could never be instantiated.
Fixes #2063.
2012-03-28 17:02:54 -07:00
Brian Anderson
8cf44bed57 core: Add int8_t, etc. types to libc::types::common::c99 2012-03-28 16:32:02 -07:00
Graydon Hoare
0622a74c48 Fix long line. 2012-03-28 15:16:32 -07:00
Niko Matsakis
3955b3a41a refactor so that pretty mode tests also run aux-build. Fixes #2060. 2012-03-28 14:59:36 -07:00
Patrick Walton
18a97d71f9 test: Un-XFAIL regions-mock-trans.rs and regions-mock-trans-impls.rs 2012-03-28 14:31:23 -07:00
Graydon Hoare
2aaca455b9 Tidy up multiple declarations and STDC_FOO_MACROS guards in headers. 2012-03-28 14:26:51 -07:00
Patrick Walton
3c398d28a4 rustc: Universally quantify regions when calling functions. Un-XFAIL regions-addr-of-ret.rs. 2012-03-28 14:24:18 -07:00
Tim Chevalier
ca6636d6b6 Allow references to "self" within classes
Allow writing self.f within a class that has a field f. Currently,
the compiler accepts either self.f or f. In a future commit I'll
require writing self.f and not f.

Not sure whether self.f() works if f is a method (making sure that
works next).
2012-03-28 14:19:00 -07:00
Graydon Hoare
c141e7a068 Fix some gcc-4.4-isms, should build now on 4.1+. 2012-03-28 13:52:47 -07:00
Graydon Hoare
b37d7e26fe Update crate URLs to point to interesting things. 2012-03-28 13:52:47 -07:00
Jesse Ruderman
d0ddc69298 Update CC fuzzer 2012-03-28 12:30:07 -07:00
Jesse Ruderman
8d8581e7f9 Update AST fuzzer 2012-03-28 12:29:53 -07:00
Grahame Bowland
232c771105 python scripts run with Python 2.4 (for RHEL5) 2012-03-28 11:29:47 -07:00
Tim Chevalier
52f2a9a1c9 Test case to make sure typestate checks the body of class constructors 2012-03-28 10:38:57 -07:00
Marijn Haverbeke
90cf9e0d6f Make sure type_use.rs doesn't get lost in recursive enums
Closes #2059
2012-03-28 10:35:16 +02:00
Tim Chevalier
edb747ceed Enforce mutability declarations in classes; correct shapes for classes
1. Enforce mutability declarations on class fields. Don't allow any
mutation of class fields not declared as mutable (except inside the
constructor).

2. Handle classes correctly in shape (treat classes like records).
2012-03-27 22:11:58 -07:00
Niko Matsakis
c9102ee7a1 make type_kind exhaustive, add an entry for type_self (in particular) 2012-03-27 15:44:36 -07:00
Brian Anderson
42f2810eca emacs: Make 'mut' a keyword 2012-03-27 15:10:25 -07:00
Brian Anderson
f4ee5582c7 core: Rename iter::to_list to to_vec. Closes #2056 2012-03-27 14:50:33 -07:00
Brian Anderson
ba3292d3be rust: Remove extensions' dependency on the session 2012-03-27 14:16:46 -07:00
Marijn Haverbeke
73d6df32cd Emergency safe-ref-checker maintenance
It still has some big problems, but at least it more or less
understands block arguments now.

Closes #1925
2012-03-27 17:22:57 +02:00
Marijn Haverbeke
b5a4fa9456 Move some code over to iterator-for to see how it performs. 2012-03-27 15:46:33 +02:00
Marijn Haverbeke
cbad6925c1 Register new snapshot 2012-03-27 13:53:11 +02:00
Marijn Haverbeke
eec6383771 Add vec::each, vec::eachi, and list::each
For use with the new for construct.

Issue #1619
2012-03-27 12:53:19 +02:00
Marijn Haverbeke
064f82d68d Support returning from loop blocks
The code is somewhat invasive, but it seems hard to do this in a
clean way, since the design itself involves a bunch of 'action
at a distance'.

Issue #1819
2012-03-27 12:33:13 +02:00
Marijn Haverbeke
f6e3738b9c Support an alternate for syntax that calls a higher-order function
The last argument of the call must be a block, and the type of this
argument must a function returning bool. `break` and `cont` are
supported in the body of the block, and return `false` or `true` from
the function. When the end of the function is reached, `true` is
implicitly returned.

    for vec::all([1, 2, 3]) {|elt|
        if elt == 2 { break; }
        log(error, elt);
    }

Issue #1619
2012-03-27 09:27:31 +02:00
Graydon Hoare
9638e7fece Register new snapshots. 2012-03-26 22:10:02 -07:00
Graydon Hoare
6e6798c4e1 Bulk-edit mutable -> mut. 2012-03-26 18:35:18 -07:00
Graydon Hoare
bd0399863f Disable some advanced (post glibc-2.3) libuv features when building snaps. 2012-03-26 18:03:53 -07:00
Brian Anderson
45a709766c rustc: Begin eliminating ext's dependency on the session 2012-03-26 17:16:26 -07:00
Brian Anderson
a477aaba08 rustc: Move eval_const_expr to its own mod 2012-03-26 17:16:26 -07:00
Patrick Walton
b7a741b5d0 rustc: Combine and unify regions 2012-03-26 15:07:15 -07:00
Patrick Walton
03086c5304 rustc: "unkown" -> "unknown" 2012-03-26 12:53:06 -07:00
Patrick Walton
b86c603bdf rustc: Fix typo in infer 2012-03-26 12:52:31 -07:00
Patrick Walton
d877ebdd05 rustc: Remove obsolete FIXME in infer 2012-03-26 12:49:14 -07:00
Patrick Walton
407be52036 rustc: Generalize resolve_var to work with regions too 2012-03-26 12:42:38 -07:00
Brian Anderson
d92f3ac524 Merge pull request #2054 from j3parker/master
Minor fixes
2012-03-26 12:24:53 -07:00
Tim Chevalier
11610f9ca1 In typeck, don't call ty::store_iface_methods on private methods
This was resulting in a different error message depending on whether
the private method you were trying to call was in the same crate
or a different one.
2012-03-26 10:46:37 -07:00
Niko Matsakis
21111660ca Improve type inference to compute LUB/GLB 2012-03-26 10:34:58 -07:00
Tim Chevalier
2112c391cd Remove stray comment 2012-03-26 10:04:46 -07:00
Tim Chevalier
c282810ab0 Enforce privacy declarations for class fields and methods 2012-03-26 10:00:33 -07:00
Marijn Haverbeke
a00538b3b3 Fix return-in-block in cargo
Which is apparently not built as part of make check
2012-03-26 13:16:29 +02:00
Marijn Haverbeke
b89a5af2ab Check in a forgotten new file 2012-03-26 12:54:06 +02:00
Marijn Haverbeke
87e097a853 Disallow ret inside of block functions
Also adds proper checking for cont/break being inside a loop.

Closes #1854
Issue #1619
2012-03-26 12:45:47 +02:00
Marijn Haverbeke
e4c141a331 Fix bug in generation of non-generic resource dtors
Issue #1944
2012-03-26 11:31:17 +02:00
Niko Matsakis
763142816e repair the build---also, make try/commit work over both ty/region vars 2012-03-25 13:32:13 -07:00
Jacob Parker
f5c91d10dd Fixed vim highlighting for \' (and other) escapes in char literals 2012-03-25 16:26:48 -04:00
Patrick Walton
8462c6c831 rustc: Generalize several parts of infer in preparation for using them for region bounds as well 2012-03-24 23:14:45 -07:00
Niko Matsakis
1d7d5c16b3 correct more broken tests 2012-03-24 22:15:34 -07:00
Niko Matsakis
ac4294a176 add test that was failing from tedh 2012-03-24 21:59:16 -07:00
Niko Matsakis
7ae757ff1a add annotation for variable that used to infer to bot 2012-03-24 21:55:53 -07:00
Niko Matsakis
bf9d714d46 Avoid unifying vars when possible; handle bot (more) correctly 2012-03-24 21:38:43 -07:00
Niko Matsakis
ee5d0f5e3f new test which features conflicting variance requirements 2012-03-24 21:38:42 -07:00
Patrick Walton
bd6e6e349b rustc: Stub some region resolution stuff in infer 2012-03-24 21:30:57 -07:00
Patrick Walton
f507b54f19 test: Rename run-pass/simple-regions.rs to run-pass/regions-simple.rs
This groups all the region tests under regions-*.
2012-03-24 19:21:51 -07:00
Patrick Walton
8bef2716fe test: Add a simple test for dangling pointers 2012-03-24 19:00:08 -07:00
Patrick Walton
7c27ec72d1 rustc: Add some simple region checking (no region vars yet)
Amazingly, this causes no test cases to fail!
2012-03-24 18:44:05 -07:00
Niko Matsakis
3e385a80d4 prune unused unification code; leave region code that still needs to be ported 2012-03-24 09:22:09 -07:00
Tim Chevalier
aae14e352a Allow methods to call other methods in the same class 2012-03-23 23:10:45 -07:00
Tim Chevalier
bebdfe8ce8 Add another test for cross-crate method calls 2012-03-23 23:10:45 -07:00
Niko Matsakis
6b84cee5d3 add a few measly comments, remove some dead code 2012-03-23 22:36:37 -07:00
Niko Matsakis
f5edb5ee18 xfail-test regions tests 2012-03-23 22:06:39 -07:00
Niko Matsakis
042c532a08 Implement new inference algorithm. 2012-03-23 21:47:28 -07:00
Tim Chevalier
40443768b1 Fix breakage 2012-03-23 20:53:38 -07:00
Tim Chevalier
8bbd78075f Handle self correctly when translating classes
This change uses the same code for handling the "self" reference for
classes as is already used for impls/ifaces. This allows removing the
extra maybe_self_id argument (which was just for classes) to trans_closure
that I added before. I also rewrote the translation for class ctors so
that it doesn't generate new AST nodes (instead translating directly).

Also changed visit so that it visits class ctors correctly with visit_fn,
and changed typestate to not do return-checking when visiting a class ctor.
2012-03-23 20:37:50 -07:00
Patrick Walton
713b3585c6 rustc: Remove // */ sequence from trans/base.rs; it breaks vi syntax highlighting 2012-03-23 18:21:23 -07:00
Patrick Walton
0eae490669 rustc: Stub a table of borrowings 2012-03-23 17:28:24 -07:00
Patrick Walton
c56910fc9a rustc: Make region folding not descend into function types
Since region parameters are always universally quantified at the function
level, this would be incorrect.
2012-03-23 17:06:24 -07:00
Tim Chevalier
1ffaedac2b Remove unneeded code 2012-03-23 16:25:10 -07:00
Tim Chevalier
17cd9b4308 Remove ctypes -- it's no longer used. 2012-03-23 16:25:10 -07:00
Tim Chevalier
cb0eeed539 Remove a FIXME and workaround that appear to be obsolete 2012-03-23 16:25:10 -07:00
Tim Chevalier
372673b58c Remove char::to_lower, char::to_upper, use libc versions instead
As per Graydon's comments on #1985: remove char::to_lower and
char::to_upper. The str versions of these functions now call
libc::tolower and libc::toupper (using wrappers that cast between
char and c_char). Not sure how much better that is, but it at least
makes it clearer that these functions are Unicode-unsafe.
2012-03-23 16:25:10 -07:00
Patrick Walton
cab4f1685b test: Add a test case that ensures ret &EXPR works. 2012-03-23 16:18:28 -07:00
Patrick Walton
cba007e6c8 rustc: Fix parsing of ret &EXPR
The parser didn't think that `&` could start an expression.
2012-03-23 16:15:58 -07:00
Patrick Walton
7592dae949 test: Fix unresolved name in regions-mock-trans-impls.rs 2012-03-23 15:44:37 -07:00
Patrick Walton
c56ec7b02a test: Add a version of the "mock-trans" regions test case that uses impls 2012-03-23 15:28:47 -07:00
Patrick Walton
b9c4dbeb33 test: Fix leak in regions-mock-trans 2012-03-23 15:17:34 -07:00
Patrick Walton
df77eb433b test: Fix whitespace at EOL 2012-03-23 15:05:39 -07:00
Patrick Walton
aa0f25ae31 test: Add a trans.rs-workalike test case for regions 2012-03-23 14:42:39 -07:00
Patrick Walton
7931a61ebb rustc: Redo region inference to be a bit less broken 2012-03-23 12:22:58 -07:00
Marijn Haverbeke
84019aa0dc Keep an explicit map of things that have to be spilled
This prevents us from spilling locals more than once.

Closes #2040
2012-03-23 16:08:01 +01:00
Marijn Haverbeke
1b81c5112a Remove last vestiges of old-style intrinsics
Closes #2048
2012-03-23 16:08:01 +01:00
Marijn Haverbeke
837478ccb0 Register new snapshot 2012-03-23 16:07:54 +01:00
Marijn Haverbeke
a84b56bc70 Remove more needless context threading in trans 2012-03-23 14:45:47 +01:00
Marijn Haverbeke
5cfbbbc9ed Revert resolve kludge that was working around #2049 2012-03-23 13:32:00 +01:00
Marijn Haverbeke
3e7a514521 Fix inconsistent-iteration hazard in map.rs
Closes #2049
2012-03-23 13:30:29 +01:00
Marijn Haverbeke
683085b3f0 Stop trying to link intrinsics.bc 2012-03-23 12:57:37 +01:00
Marijn Haverbeke
ca71e01bce Interpret native mods with ABI rust-intrinsic as builtins 2012-03-23 12:52:53 +01:00
Marijn Haverbeke
52d618a99a Revert removal of intrinsics
Oops. We can't do this yet until the next snapshot.
2012-03-23 12:51:20 +01:00
Marijn Haverbeke
c704d5a5d3 Clean up some confused shuffling of def_ids in resolve.rs 2012-03-23 12:38:36 +01:00
Marijn Haverbeke
562afef216 Rename builtin back to intrinsic
As per Graydon's request

Issue #1981
2012-03-23 12:21:56 +01:00
Marijn Haverbeke
f5024692d4 Remove support for the old-style intrinsics
Closes #2042
Closes #1981
2012-03-23 12:21:55 +01:00
Marijn Haverbeke
0303396f4c Register snapshot, turn off USE_SNAPSHOT flags 2012-03-23 12:21:46 +01:00
Marijn Haverbeke
6374ffc5f3 Kludge in resolve to be able to land builtins
Something strange is happening to hash maps. I'm still investigating but
want to get my snapshot built in the meantime. (Problem only happened on
OS X.)
2012-03-23 11:09:19 +01:00
Marijn Haverbeke
cdb93d70a1 Fix bug in function-instance reuse
You can't safely reuse functions that pass a T by move, since they might
zero it out, which will not end well when it doesn't know its precise
size.
2012-03-23 10:49:47 +01:00
Marijn Haverbeke
16ca6e8d7f Change vector append to no longer rely on an intrinsic
Issue #1981
2012-03-23 10:49:47 +01:00
Marijn Haverbeke
0545e4a920 Support [rust_stack] annotation on native functions (crudely) 2012-03-23 10:49:47 +01:00
Marijn Haverbeke
894b7469d6 Replace most uses of intrinsics in core with builtins
Issue #1981
2012-03-23 10:49:47 +01:00
Marijn Haverbeke
ea2e379e4f Implement built-in native modules as an alternative to intrinsics
Issue #1981
2012-03-23 10:49:47 +01:00
Tim Chevalier
73a0c17d77 Make cross-crate calls to class methods work 2012-03-22 20:32:47 -07:00
Brian Anderson
f7f1490d6e rt: Run resource destructors during cycle collection 2012-03-22 19:07:31 -07:00
Brian Anderson
f3fe85dad7 Bump version numbers to 0.2 2012-03-22 15:25:02 -07:00
Graydon Hoare
b224bcf6e1 Add an LLVM-instruction-counting mode to trans.
Pipe to xdu to see a trans call graph of generated insns.
2012-03-22 13:44:20 -07:00
Niko Matsakis
dc07280b08 make --enforce-mut-vars always on, add mut annotations to remaining files 2012-03-22 09:58:19 -07:00
Niko Matsakis
b653a18416 add mut decls to rustc and make them mandatory 2012-03-21 21:04:14 -07:00
Brian Anderson
d7be4abdae rt: Fix valgrind stack hints 2012-03-21 19:10:32 -07:00
Brian Anderson
9ea3bc614e rt: Shave 16 bytes off the __morestack frame 2012-03-21 19:10:32 -07:00
Brian Anderson
9f89cc9d15 rt: Shave a few instructions off __morestack 2012-03-21 19:10:32 -07:00
Brian Anderson
f5f6135fd0 rt: Stop using large stacks for the main task 2012-03-21 19:10:32 -07:00
Brian Anderson
0639b67290 rt: Use get_task_from_tcb during stack growth calls 2012-03-21 19:10:32 -07:00
Brian Anderson
4ad57f5c39 rt: Add rust_task::get_task_from_tcb 2012-03-21 19:10:32 -07:00
Brian Anderson
08f783ff10 rt: Add a task field to stk_seg and populate it 2012-03-21 19:10:32 -07:00
Brian Anderson
4a0c6c7f41 rt: Add a get_sp_limit function 2012-03-21 19:10:31 -07:00
Brian Anderson
1cb35c9b26 rt: Rename record_sp to record_sp_limit 2012-03-21 19:10:31 -07:00
Brian Anderson
ba322b0a70 rt: Reset the stack limit after catching an exception
This wasn't causing problems but it looked wrong
2012-03-21 19:10:31 -07:00
Brian Anderson
b78af4f7c4 rt: Inline a bunch of stack switching code 2012-03-21 19:10:31 -07:00
Brian Anderson
d5968d9f38 rt: Swap the definition of stk_seg::next and prev 2012-03-21 19:10:31 -07:00
Brian Anderson
6115b13dfc rt: Don't switch to the C stack on the upcall_new_stack fast path 2012-03-21 19:10:31 -07:00
Brian Anderson
8a145a601e rt: Don't swatch stacks during upcall_del_stack 2012-03-21 19:10:31 -07:00
Graydon Hoare
9ba712fb8b Every time you don't use a variable, a kitten scowls. 2012-03-21 19:00:52 -07:00
Graydon Hoare
eba5129978 Quiet unused-result error harder. 2012-03-21 18:53:27 -07:00
Graydon Hoare
d28175b916 Upgrade valgrind headers to 3.7, silencing build breakage on FreeBSD. 2012-03-21 18:40:32 -07:00
Graydon Hoare
a9e7bff731 Remove incorrect uses of NVALGRIND, Close #1435. 2012-03-21 18:21:11 -07:00
Patrick Walton
44bd8da7fd rustc: Use the right "nxt" function in unify_regions 2012-03-21 16:13:34 -07:00
Brian Anderson
75ee4633eb rustc: Long lines 2012-03-21 16:10:39 -07:00
Josh Matthews
5835a4cc8e Merge remote-tracking branch 'mozilla/master' 2012-03-21 19:01:04 -04:00
Patrick Walton
b0f6dad5e3 rustc: Add a function to record region bindings 2012-03-21 15:59:57 -07:00
Josh Matthews
8142438938 Avoid mangling names differently in debug builds to work around a build error. Fix up file name and path debug information, and build one compilation unit for a crate instead of one per source file. 2012-03-21 18:56:36 -04:00
Patrick Walton
c8ab0c1b3b rustc: Replace region parameters in function return values 2012-03-21 15:22:12 -07:00
Patrick Walton
324f57a180 rustc: Check call and bind expressions using a set of region bindings 2012-03-21 14:47:57 -07:00
Patrick Walton
bdf968c9d9 rustc: Add a version of demand that takes in a set of region variable bindings 2012-03-21 14:15:43 -07:00
Tim Chevalier
30c272cb3a methods work
Cross-crate method calls don't work yet. Added
run-pass/class-method-cross-crate to test that, but it's xfailed

References to fields within methods don't work yet. Added
run-pass/class-methods to test that, but it's also xfailed
2012-03-21 13:53:21 -07:00
Patrick Walton
3e47442471 rustc: Add region unification functions 2012-03-21 13:28:50 -07:00
Patrick Walton
68e364b54d rustc: Introduce re_params into the typechecker
This is the first step of the region refactoring I need to do in order to handle named regions properly.
2012-03-21 12:21:53 -07:00
Graydon Hoare
071dedde79 Register snapsnots. 2012-03-21 11:46:46 -07:00
Niko Matsakis
7cc0f554ae add test for commit 9502fb99e0 2012-03-21 08:23:31 -07:00
Marijn Haverbeke
9502fb99e0 Fix bug in vtable resolution 2012-03-21 15:57:23 +01:00
Marijn Haverbeke
bc3f5e7160 rustc: Replace intrinsic vec_len with unsafe Rust code
Preparation for #1981
2012-03-21 15:56:48 +01:00
Niko Matsakis
cce2751461 Adjust arena definition to be compatible with placement new 2012-03-21 05:46:31 -07:00
Niko Matsakis
cfcbec3cc3 Implement an initial version of placement new. 2012-03-20 20:39:40 -07:00
Patrick Walton
ba39e277e2 stdlib: Implement arenas 2012-03-20 19:08:17 -07:00
Brian Anderson
57281f52e5 test: Begin running the language ref examples. Mostly xfailed 2012-03-20 18:59:21 -07:00
Brian Anderson
a0cbf638ee doc: Switch the tutorial to pandoc's method of tagging code blocks
Instead of '## tag', it's '~~~ {.tag}'
2012-03-20 18:59:21 -07:00
Patrick Walton
237cd4455c rustc: Fix a few more instances of node ID stomping, due to AST folding incorrectly passing stuff through unchanged 2012-03-20 18:37:09 -07:00
Graydon Hoare
084fe56ad5 Conditionalize test to only run double/byte/double test on x64 for now. 2012-03-20 17:34:21 -07:00
Patrick Walton
86ebde575c rustc: Make the quasiquote operator stop reusing nodes (and therefore stop reusing node IDs). Should fix issue #1947 for real. 2012-03-20 17:23:46 -07:00
Graydon Hoare
faacbb38f0 Xfail struct-return test. x64 ABI is not quite right yet. 2012-03-20 17:13:48 -07:00
Tim Chevalier
b06dc884e5 Class methods WIP
In particular, use the ast::method type to represent a class method,
and try to reuse as much iface code as possible. (This makes sense now
since I'll be allowing polymorphic class methods.)
2012-03-20 17:07:07 -07:00
Graydon Hoare
855c99ea75 Some tests for passing and returning structures by value on x64. Close #1402. Close #1970. 2012-03-20 16:44:56 -07:00
Brian Anderson
b181ea415e core: Rename unsafe::leak to unsafe::forget. Closes #2031 2012-03-20 15:20:37 -07:00
Graydon Hoare
56828d49fd Remove unused "flav" parameter from function registration paths. 2012-03-20 15:16:12 -07:00
Graydon Hoare
d282481c12 Fix naughty mangling-breakage from stringifying a node ID. Close #1344. 2012-03-20 15:16:12 -07:00
Graydon Hoare
8e911cbd65 Work on fixing name mangling. 2012-03-20 15:16:12 -07:00
Brian Anderson
1695148b5d rustdoc: Refactor reexport_pass 2012-03-20 14:54:40 -07:00
Brian Anderson
651aeea961 rustdoc: Document impl reexports 2012-03-20 14:54:40 -07:00
Brian Anderson
f3ed738399 rustdoc: Run the entire resolve pass 2012-03-20 14:54:40 -07:00
Graydon Hoare
b994b17be8 Remove object file directly rather than running "rm". Close #1778 also. 2012-03-20 12:39:40 -07:00
Graydon Hoare
0973bccfe2 Fail when there's an error starting a process. Close #1778. 2012-03-20 12:38:57 -07:00
Jyun-Yan You
d3712a287d make native and crust functions conform to x86-64 ABI 2012-03-20 11:59:24 -07:00
Graydon Hoare
716dc29ffc Minor io fixlet to account for racing against last_os_error. 2012-03-20 11:59:23 -07:00
Marijn Haverbeke
1a20f8e7cc rustc: Be more careful about spans in 'unexpected token' errors
Closes #2017
2012-03-20 15:05:14 +01:00
Marijn Haverbeke
7a34ac5890 Revert order of arguments to option::maybe and from_maybe
Closes #2019
2012-03-20 14:55:07 +01:00
Marijn Haverbeke
1547c27926 Fix caching bug in resolve, get rid of enumness kludge
Closes #1911
2012-03-20 14:33:04 +01:00
Marijn Haverbeke
928364b98b Only make symbols external when they are actually externally accessible
Closes #2030
2012-03-20 13:19:33 +01:00
Marijn Haverbeke
ade1207ba3 Move external-reachability checker to trans
Preparation for a fix for issue #2020
2012-03-20 12:28:46 +01:00
Brian Anderson
ccaace6587 rt: Remove an unused function 2012-03-19 19:02:54 -07:00
Patrick Walton
bf13fb7921 rustc: Fix handling of the self region in method return types. Also stub some code to allow the regions of simple field access expressions to be determined. 2012-03-19 18:52:18 -07:00
Patrick Walton
b12588a197 rustc: Fix mutability checking when dereferencing a region-annotated pointer 2012-03-19 17:28:00 -07:00
Brian Anderson
4e3e13302d test: Remove pretty/issue-953. Doesn't typecheck 2012-03-19 16:11:46 -07:00
Brian Anderson
20417ebf31 core: Move unsafe conversions to str::unsafe 2012-03-19 15:47:52 -07:00
Brian Anderson
1a40aa0935 core: Make converting from a C string unsafe 2012-03-19 15:47:52 -07:00
Graydon Hoare
869b2d7064 Send string concatenation to specialized upcall, shave 17s off librustc compile time. 2012-03-19 14:29:39 -07:00
Brian Anderson
bbfa08d947 rustc: Stop generating the flag_none #fmt flag. Issue #1993 2012-03-19 14:28:42 -07:00
Brian Anderson
a0c6ad0c51 core: Remove a FIXME. Closes #1992
This is too vague to ever fix
2012-03-19 14:17:59 -07:00
Brian Anderson
009bbadd92 core: Remove a FIXME. Closes #2002
It works for negative integers
2012-03-19 14:14:49 -07:00
Marijn Haverbeke
cec1a9b859 Properly check kinds when instantiating types
Closes #2011
2012-03-19 10:45:29 +01:00
Brian Anderson
4c4ac05f02 rustdoc: Print type params in fn sigs. Closes #2021 2012-03-18 21:41:57 -07:00
Brian Anderson
7dcac31e4d rt: Remove rust_task_thread::dead_tasks 2012-03-18 18:18:18 -07:00
Brian Anderson
6f6650e726 rt: Remove rust_task_thread::newborn_tasks 2012-03-18 18:18:18 -07:00
Brian Anderson
5d4bf75f56 rt: Convert rust_task_list to a typedef 2012-03-18 18:18:18 -07:00
Brian Anderson
47c1895724 rt: Don't store the name of the task state in rust_task_list 2012-03-18 18:18:15 -07:00
Brian Anderson
05466c6138 rt: Use an enum to represent the task state 2012-03-18 17:41:56 -07:00
Brian Anderson
0201a03203 core: Rename vec::*_from to _between to match str mod 2012-03-18 17:40:52 -07:00
Brian Anderson
13bcc73625 core: Rename vec::position_elt to position_elem 2012-03-18 17:40:49 -07:00
Brian Anderson
cab02145ba Merge pull request #2025 from damag/master
Fix typo in error message
2012-03-18 17:05:38 -07:00
Brian Anderson
b247de6458 rt: Remove lock_held_by_current_thread 2012-03-18 17:03:35 -07:00
Brian Anderson
e4af1ca065 core: Add vec::unshift 2012-03-18 16:16:47 -07:00
Brian Anderson
397f33fd35 core: Don't require a copyable T for vec::push 2012-03-18 16:08:37 -07:00
Brian Anderson
b1eb4579c6 core: Improve the docs and signature of vec::iter2 2012-03-18 15:41:03 -07:00
Brian Anderson
d6ded6788d core: vec::filter_map doesn't require a copyable T 2012-03-18 15:26:05 -07:00
Damien Grassart
38ac87f0ff rustc: Fix typo in error message 2012-03-18 04:45:03 +01:00
Brian Anderson
132266b2cb rt: Remove the recursive lock from rust_task_thread 2012-03-17 18:44:41 -07:00
Brian Anderson
3ee4a15e5e core: Don't copy elements in filter_map 2012-03-17 18:17:27 -07:00
Brian Anderson
35e9970e29 rt: Ports don't need to ref their tasks
Port lifetime is always bounded by their owning task
2012-03-17 17:56:15 -07:00
Brian Anderson
5728a69e78 rt: Remove some bogus pthread settings from rust_task_thread
This is all handled by rust_thread, and 'true' isn't even a valid
value to pass to pthread_attr_setdetachestate
2012-03-17 17:18:24 -07:00
Brian Anderson
4debe71785 compiletest: Remove FIXME. Closes #1984 2012-03-17 14:57:13 -07:00
Brian Anderson
c139b348fe core: Fix signature of call_with_retptr. Closes #1987 2012-03-17 14:57:13 -07:00
Brian Anderson
cae2c1611b Register snapshots 2012-03-17 00:49:23 -07:00
Tim Chevalier
e3a1c5c96a Encode both private and public class fields in metadata
This is necessary to calculate the correct offsets for field references.

Simple cross-crate class tests (still with fields only) now pass.
2012-03-16 20:36:07 -07:00
Tim Chevalier
16dd6c4756 Fix encoding of class ctors
Class tests still fail at runtime
2012-03-16 19:20:36 -07:00
Josh Matthews
d958123d8a Don't break -g in the presence of monomorphization. 2012-03-16 20:19:52 -04:00
Brian Anderson
154a3fdf44 rustc: Unify impl self types in the opposite order so variance is correct 2012-03-16 17:06:15 -07:00
Brian Anderson
3445454e79 core: Resolve and remove some FIXMEs 2012-03-16 16:46:32 -07:00
Brian Anderson
9e9f4a6240 core: Remove str::init_elt
This was added based on my FIXME, but I no longer believe it has a place in
core::str, partly because it doesn't follow current naming conventions, and
partly because it can be immitated with a one liner using str::from_chars and
vec::from_elem. I have replaced the existing uses with said one-liner.
2012-03-16 15:31:53 -07:00
Tim Chevalier
1680ccce1e Classes WIP
Cross-crate metadata for classes works well enough that programs with
classes in other crates compile successfully, but output wrong results.
Checking in work so far to avoid merge hassles. (Tests are xfailed.)
2012-03-16 15:28:05 -07:00
Brian Anderson
47d468f08c core: Store reexporting result and either. Closes #1997 2012-03-16 15:14:37 -07:00
Brian Anderson
ddbd02aaf2 rustdoc: Allow elipses to appear in brief descriptions. Closes #2003 2012-03-16 14:50:30 -07:00
Niko Matsakis
e399ddbf17 allow binding of fn~, make result fn@. fixes 1899. 2012-03-16 17:48:53 -04:00
Brian Anderson
f80008f04b core: Add lots of string docs 2012-03-16 14:29:09 -07:00
Patrick Walton
f6a792585b rustc: Give a better error message when references involving the caller region fail to unify 2012-03-16 14:02:02 -07:00
Brian Anderson
3db8ae0bdc core: Remove extra backslashes from docs 2012-03-16 12:20:38 -07:00
Brian Anderson
0b0ecc662b rustdoc: Escape backslashes 2012-03-16 12:20:29 -07:00
Brian Anderson
a7132eeb1e core: Doc cleanup 2012-03-16 12:12:25 -07:00
Brian Anderson
0d88bf7e43 core: Escape some characters in comments 2012-03-16 11:58:39 -07:00
Erick Tryzelaar
67a1c35264 std: Add a a hashmap_from_vecs function 2012-03-16 17:05:29 +01:00
Erick Tryzelaar
2ddd084631 std: Add a function to iterate over a subset of a vec 2012-03-16 17:05:29 +01:00
Erick Tryzelaar
da91b60343 Add loop to the vim keyword list. 2012-03-16 17:05:29 +01:00
Marijn Haverbeke
35fc4a4291 Check kind bounds when calling methods
Closes #1915
2012-03-16 17:05:29 +01:00
Marijn Haverbeke
25c2be0ff4 Forbid boxed ifaces with self types or generic methods in bounded params
They are a soundness hole.

Closes #1994
2012-03-16 15:39:07 +01:00
Marijn Haverbeke
484469c58d Register new snapshot 2012-03-16 15:39:04 +01:00
Marijn Haverbeke
22bef74b55 Remove shared tydescs
All tydescs are static now, there's no need to worry about
marshalling them between threads anymore.
2012-03-16 15:38:42 +01:00
Marijn Haverbeke
15a325f267 Support binding of methods off boxed iface values
Closes #435
2012-03-16 12:58:26 +01:00
Marijn Haverbeke
5f20c94785 Register new snapshots 2012-03-16 12:58:21 +01:00
Tim Chevalier
c86135e80b Comments only: associate core::libc FIXMEs with issue numbers 2012-03-15 23:12:07 -07:00
Tim Chevalier
2ef7d135a9 Comments only: associate core::iter FIXMEs with issue numbers 2012-03-15 23:12:07 -07:00
Tim Chevalier
f5da4881dc Comments only: issue numbers for FIXMEs 2012-03-15 23:12:06 -07:00
Tim Chevalier
c1c84e92dd Put the OS error in the error string in io::mk_file_writer() 2012-03-15 23:12:06 -07:00
Patrick Walton
e464e2ba56 rustc: Describe why regions failed to unify as part of the type error message 2012-03-15 19:19:32 -07:00
Patrick Walton
4ea3b0b89c rustc: Fix the AST map to actually map blocks. Also improve region error messages involving blocks. 2012-03-15 19:06:38 -07:00
Brian Anderson
389f53c6ff core: Docs 2012-03-15 18:58:30 -07:00
Tim Chevalier
07d0981bbb Comments only: associate FIXMEs with issue numbers in int library 2012-03-15 18:50:26 -07:00
Patrick Walton
e0edcfc21c rustc: Index blocks 2012-03-15 18:46:57 -07:00
Tim Chevalier
43b457c5d6 Comments only: associate FIXMEs in float libs with issue numbers 2012-03-15 18:46:17 -07:00
Patrick Walton
0972571cdd test: Add a test case for self regions and typeclass implementations 2012-03-15 18:13:57 -07:00
Tim Chevalier
20ec72830a Address FIXMEs in extfmt / add issue numbers 2012-03-15 17:50:22 -07:00
Tim Chevalier
ce3f369047 Change ctypes::intptr_t to int 2012-03-15 17:50:22 -07:00
Tim Chevalier
e3222e9905 Improve error message for passing mutable argument by reference 2012-03-15 17:50:22 -07:00