Patrick Walton
b18cefdfd7
rustc: Fix a leak that resulted from copying a structural interior type containing interior vectors. Add a test case.
2011-06-29 12:16:07 -07:00
Patrick Walton
bbd0d58955
rustc: Unbreak self assignment
2011-06-29 10:22:53 -07:00
Lindsey Kuper
7b5d34aa9a
Comments and cleanup.
2011-06-28 19:06:44 -07:00
Lindsey Kuper
57e5cde3a2
Comments and cleanup.
2011-06-28 18:54:56 -07:00
Patrick Walton
74f8eb51ae
rustc: Move duplicate_heap_parts to copy glue; add a test case
2011-06-28 17:59:30 -07:00
Patrick Walton
dfcfef41df
rustc: Rename take glue to copy glue
2011-06-28 16:52:59 -07:00
Tim Chevalier
9f1444c701
Implement "claim"
...
Implement "claim" (issue #14 ), which is a version of "check" that
doesn't really do the check at runtime. It's an unsafe feature.
The new flag --check-claims turns claims into checks automatically --
but it's off by default, so by default, the assertion in a claim
doesn't execute at runtime.
2011-06-28 16:41:06 -07:00
Eric Holk
866ee6ecb4
Re-enabling some tests.
2011-06-28 16:12:34 -07:00
Eric Holk
64596e6583
Teach the parser and typechecker to understand port[int](). Closes #588
2011-06-28 16:11:04 -07:00
Patrick Walton
5f5b7e3348
rustc: Don't call cmp glue if the type is a simple scalar
2011-06-28 11:24:34 -07:00
Marijn Haverbeke
fb14afd5eb
Add test cases for resources
2011-06-28 18:00:38 +02:00
Marijn Haverbeke
07125aa38b
Fix bug that prevented boxes-in-resources from being freed
2011-06-28 18:00:05 +02:00
Marijn Haverbeke
d730bb730a
Make it possible to use * to dereference a resource
2011-06-28 18:00:05 +02:00
Marijn Haverbeke
be748fc215
Properly guard resource values against double-drop
...
Ths involved adding an extra field to their representation, so that there is
something to check for zero.
2011-06-28 16:14:15 +02:00
Patrick Walton
663aa76635
rustc: Call cmp glue directly if we statically know it
2011-06-27 18:35:01 -07:00
Patrick Walton
dfccd5a138
rustc: Fix stack explosion on -O0 from Alloca() instead of alloca() in cmp glue
2011-06-27 18:27:26 -07:00
Brian Anderson
df2cfac07f
Move what's left of metadata::cwriter into middle::trans
2011-06-27 16:30:27 -07:00
Brian Anderson
119193497e
Extract metadata::decoder from metadata::creader
2011-06-27 16:30:27 -07:00
Brian Anderson
5601a6f534
Move metadata::cwriter::encode to metadata::tyencode
2011-06-27 16:30:27 -07:00
Brian Anderson
ba5c7a570d
Rename middle::metadata to metadata::cwriter. Move creader to metadata
...
Preparation for a lot more metadata refactoring
2011-06-27 16:30:27 -07:00
Patrick Walton
e4b5d910dc
rustc: Directly emit calls to glue if possible
2011-06-27 15:38:21 -07:00
Tim Chevalier
a6f36ba3f5
removing log statement that snuck in there
2011-06-27 11:38:07 -07:00
Tim Chevalier
1656fa19ef
Implement move for scalar values
...
Before, something like:
let int y = 42;
let int x;
x <- y;
would cause an LLVM assertion failure. Fixed it.
2011-06-27 11:32:06 -07:00
Marijn Haverbeke
7432017d5e
Primitive support for non-copyable values
2011-06-25 21:15:11 +02:00
Marijn Haverbeke
61fc12d0d0
Partial implementation of resources
...
Non-copyability is not enforced yet, and something is still flaky with
dropping of the internal value, so don't actually use them yet. I'm
merging this in so that I don't have to keep merging against new
patches.
2011-06-25 21:15:11 +02:00
Patrick Walton
baf474443a
rustc: Increment by the unit size in iter_structural_ty when iterating over interior vectors if the unit size is dynamic
2011-06-24 17:36:30 -04:00
Marijn Haverbeke
2ebd19477b
Sanitize use of ids for obj constructors.
...
Typeck and trans used to, by historical coincidence, use the item_obj
node id, which was used to identify the obj type by the rest of the
system, for the constructor function. This is now identified by the
ctor id stored in the tag throughout.
2011-06-24 21:22:52 +02:00
Marijn Haverbeke
9643aedb04
Remove uses of variable name 'res' from rustc
...
This in preparation of making 'res' a keyword for defining resources.
Please don't introduce too many new ones in the meantime...
2011-06-24 21:22:23 +02:00
Marijn Haverbeke
3d7fdb509a
Remove def_obj
...
Since obj constructors and types have different def_ids now,
their def can simply be a def_fn and a def_ty.
2011-06-24 21:13:25 +02:00
Patrick Walton
b4c0893a39
rustc: If needed, duplicate types' heap parts recursively through structural types
2011-06-24 14:32:50 -04:00
Brian Anderson
b9fc4dfc54
rustc: Cleanup trans_if, trans_alt
2011-06-23 22:16:16 -07:00
Brian Anderson
05c0216654
rustc: Add ternary operator. Closes #565
...
The implementation is so simple it might be considered cheating: at almost
every step the expr_ternary is just converted to expr_if.
2011-06-23 22:16:11 -07:00
Patrick Walton
f3798fd213
rustc: Load immediate types when iterating over interior vectors
2011-06-23 17:43:03 -04:00
Lindsey Kuper
d9f452a2a8
Some work on supporting forwarding slots in vtables (issue #539 ).
2011-06-22 21:07:20 -07:00
Michael Sullivan
7a4fb084f1
Pull environment loading out into a function.
2011-06-22 07:03:16 -07:00
Michael Sullivan
6b40cedcb1
Pull building the environment for for_each into a seperate function.
2011-06-22 07:03:16 -07:00
Michael Sullivan
c07443e6eb
Removing out-of-date comment.
2011-06-22 07:03:15 -07:00
Tim Chevalier
7fb35ecf84
Serialize constraints in types (literal arguments still not supported)
...
This involved, in part, changing the ast::def type so that a def_fn
has a "purity" field. This lets the typechecker determine whether
functions defined in other crates are pure.
It also required updating some error messages in tests. As a test
for cross-crate constrained functions, I added a safe_slice function
to std::str (slice(), with one of the asserts replaced with a
function precondition) and some test cases (various versions of
fn-constraint.rs) that call it. Also, I changed "fn" to "pred" for
some of the boolean functions in std::uint.
2011-06-21 14:37:33 -07:00
Marijn Haverbeke
3b6d94d489
Move names and ids of native items into their recs, rather than their tags
2011-06-21 23:11:00 +02:00
Lindsey Kuper
26d8eaefa7
Puts out burning tinderbox (oops, AST nodes don't have def_ids/anns).
2011-06-21 14:07:28 -07:00
Lindsey Kuper
84005fadbf
Some progress on support for extending objects with new fields (issue
...
into four separate issues (#538 , #539 , #540 , #543 ) with corresponding
tests.
2011-06-21 13:31:27 -07:00
Marijn Haverbeke
c34e9b33d9
Move expr ids into the expr record type
...
This simplifies the tag variants a bit and makes expr_node_id
obsolete.
2011-06-21 22:25:32 +02:00
Patrick Walton
062c6b946b
rustc: Implement "for" over interior vectors
2011-06-21 11:10:14 -04:00
Marijn Haverbeke
588dc3897b
Make trans use the new ast_map instead of building its own
2011-06-20 23:53:28 +02:00
Marijn Haverbeke
75681f9ad7
Get rid of def_ids and anns in AST nodes, use single node_id
...
This reduces some redundancy in the AST data structures and cruft in
the code that works with them. To get a def_id from a node_id, apply
ast::local_def, which adds the local crate_num to the given node_id.
Most code only deals with crate-local node_ids, and won't have to
create def_ids at all.
2011-06-20 23:53:28 +02:00
Eric Holk
a2dcd08cc2
Added string duplication to deep_copy. Closes #520 .
2011-06-20 13:47:02 -07:00
Eric Holk
992153672b
Removed duplicated ret_ty_of_fn. This also means the native function branch is working now, so this commit closes #506 .
2011-06-20 12:04:33 -07:00
Eric Holk
5640bead58
Teach ret_ty_of_fn_ty to understand native functions. Closes #506 .
2011-06-20 12:04:33 -07:00
Graydon Hoare
97cf57adc1
Fix pp blank-lines insertion at beginning of file and before 'let' decls.
2011-06-20 10:45:33 -04:00
Brian Anderson
200dbe4c4f
Remove various rustboot workarounds
2011-06-19 20:48:20 -07:00