Commit graph

5409 commits

Author SHA1 Message Date
Marijn Haverbeke
25787bd2b8 Forbid assignment to by-reference bindings
Issue #918
2011-09-15 14:08:54 +02:00
Marijn Haverbeke
d7a1d6a1cb Make trans understand by-ref bindings
Issue #918
2011-09-15 14:00:58 +02:00
Marijn Haverbeke
8aad16112b Implement basic checking of by-reference bindings
Issue #918
2011-09-15 13:40:28 +02:00
Marijn Haverbeke
44c6370e6a Move local numbering into ast_map.rs
This further simplifies the alias pass, which is sorely needed.
2011-09-15 13:18:32 +02:00
Marijn Haverbeke
1cda74deee Add representation for by-ref let bindings
Issue #918
2011-09-15 11:42:56 +02:00
Marijn Haverbeke
197f360e30 Ensure parens are wrapped around composite exprs in call/index/field pos
This is needed to fix the second example in issue #919
2011-09-15 11:15:14 +02:00
Marijn Haverbeke
8c83ea564b More thorough check for (.. 10).x in pretty-printer
Closes #919
2011-09-15 10:59:06 +02:00
Marijn Haverbeke
d0d322ac93 Stop mentioning tail calls in reference
They don't work, and won't work in the near future.
2011-09-15 10:14:52 +02:00
Marijn Haverbeke
63ecc84562 Also handle fail and put in print_maybe_parens_discrim
Closes #920
2011-09-15 10:14:52 +02:00
Marijn Haverbeke
3798b6f780 Remove maybe_protect_block kludge from pretty-printer
It is no longer needed.
2011-09-15 10:14:52 +02:00
Marijn Haverbeke
0b34e0e60b Introduce new semicolon rules
- Loop bodies and resource constructors aren't allowed to have
  trailing expressions anymore.

- An expression that ends* in a block without trailing expression can
  can not be called, indexed, or subscripted.

- Only expression-statements that end* in a block without trailing
  expression can omit their semicolon.

*) 'Ending in a trailing expression' is defined as being a block or
   construct-ending-in-a-block (if, alt) that either ends in an
   expression itself, or ends in another block-like expression that
   has a trailing expression (by these same rules).
2011-09-15 09:49:00 +02:00
Marijn Haverbeke
7298b8f4ba Insert omitted semicolons for statements 2011-09-15 09:49:00 +02:00
Brian Anderson
2bed548d1b xfail-fast run-pass/linked-failure.rs. Not sure what the problem is. 2011-09-14 17:47:48 -07:00
Brian Anderson
a0ad9a42cd Unsupervise tasks before the scheduler kills them. Unblock before yield->fail 2011-09-14 17:05:35 -07:00
Brian Anderson
69eda46af8 Add a run-pass test for linked failure 2011-09-14 15:51:46 -07:00
Brian Anderson
103197bc42 Make failure propagation to dead parents work
The failure will basically go 'through' the dead parent and continue
propagating the failure (as if the child was reparented).
2011-09-14 15:48:14 -07:00
Graydon Hoare
6dcd0a9b5e Remove mention of port, chan and task *types*, as they're not just library-provided. Move some text about channels into the comm section. 2011-09-14 14:48:40 -07:00
Graydon Hoare
f13acbdbf1 Remove talk of 'sharing boxes between tasks', old GC layer, etc. Add description of unique boxes. 2011-09-14 14:38:52 -07:00
Graydon Hoare
4e93ea8b1e Remove mention of the nonexistent (and no longer implementable) memory accounting model. 2011-09-14 14:22:27 -07:00
Brian Anderson
9505d70513 Make linked task failure work again 2011-09-14 14:20:41 -07:00
Graydon Hoare
c61f06fde9 Fix vector indexing notation, remove reference to 'slices'. 2011-09-14 14:13:47 -07:00
Graydon Hoare
7c782c10df Fix description of tuples. 2011-09-14 14:11:31 -07:00
Brian Anderson
79751348b3 Remove more references to reflection from docs 2011-09-14 13:32:09 -07:00
Graydon Hoare
431a27f9a8 Remove description of nonexistent stuff (reflection, meta directives); add description of attributes and tidy up description of syntax extensions. 2011-09-14 12:35:26 -07:00
Graydon Hoare
ffeb175239 Remove stuff that's either unimplemented or misleading. 2011-09-14 12:35:26 -07:00
Graydon Hoare
2812f3cf24 Remove misleading details. 2011-09-14 12:35:26 -07:00
Brian Anderson
ad2bdbee08 Add another XFAILed test for failing destructors 2011-09-14 10:59:17 -07:00
Brian Anderson
ca0d3cae5c Add another unwind test
This makes sure that cleanups added after the first invoke in a scope are
actually run on unwind
2011-09-14 09:21:28 -07:00
Brian Anderson
31d4fe37f6 Revert "Try a little harder to avoid creating new landing pads"
This reverts commit b8e31ac469.

Conflicts:

	src/comp/middle/trans.rs
2011-09-14 09:19:31 -07:00
Marijn Haverbeke
93de2f0b74 Add syntax and representation for return-by-mutably-rooted-ref
This will be used in the near future to decide what can safely
be done with the returned reference.

Issue #918
2011-09-14 17:30:38 +02:00
Marijn Haverbeke
1cabe37155 Prevent memory errors when returning references to temp args.
Issue #918
2011-09-14 16:46:54 +02:00
Marijn Haverbeke
c6619f9ce0 Accept returning refs rooted in an arg from a by-ref funtion
Issue #918
2011-09-14 16:19:15 +02:00
Marijn Haverbeke
a3c449df74 Make ast_map.rs index function args, switch it over to simple_visitor 2011-09-14 15:30:59 +02:00
Marijn Haverbeke
cd0e7fc041 Remove some extra white-space introduced by the pretty-printer 2011-09-14 15:20:22 +02:00
Marijn Haverbeke
7d69712dee Disallow implicit arg copying when the function returns a ref
Issue #918
2011-09-14 14:57:20 +02:00
Marijn Haverbeke
93d2a4f82a Add support for basic return-by-alias to trans
Issue #918
2011-09-14 14:39:08 +02:00
Marijn Haverbeke
9a69ee79e0 Clean up trans_obj.rs a bit
As a preparation to adding an arg to type_of_fn_full
2011-09-14 13:49:22 +02:00
Marijn Haverbeke
6cd24173d4 Add a ret_style field to fn_ctxt in trans 2011-09-14 13:48:51 +02:00
Marijn Haverbeke
2aac43d809 Simplify trans::new_fn_ctxt_w_id
It was still living in the pre-decent-type-inference era.
2011-09-14 13:26:39 +02:00
Marijn Haverbeke
0699acb6f7 Rudimentary checking of safe alias returns 2011-09-14 13:09:45 +02:00
Marijn Haverbeke
63519d9006 Rename restrict to binding in alias.rs
Its role gradually changed to the point where the old name doesn't
really make sense anymore.
2011-09-14 12:06:51 +02:00
Marijn Haverbeke
44df041799 Stop needlessly boxing vectors in alias.rs 2011-09-14 11:37:52 +02:00
Marijn Haverbeke
51dae63c44 Make most of the compiler aware of return-by-reference
tyencode/tydecode still don't know about it. return_ref will be extended to take
arguments anyway.
2011-09-14 11:31:05 +02:00
Marijn Haverbeke
c1c083cd66 Refactor parse_ret_ty, start parsing by-alias return specs 2011-09-14 10:46:40 +02:00
Marijn Haverbeke
6eb9738a66 Rename ast::controlflow to ast::ret_style
It will include information about returning by alias.
2011-09-14 10:38:23 +02:00
Josh Matthews
f6fe07d1f3 Add support for negative literals. 2011-09-14 00:47:14 -04:00
Graydon Hoare
c0ffd2ea26 Print perf measurement outputs on completion of 'perf' target. 2011-09-13 17:32:25 -07:00
Brian Anderson
6d3dd0e48c Try harder still to generate fewer landing pads
Scopes that don't have cleanups don't need their own landing pads

This takes the optimized rustc bin from 4.7MB to 4.4
2011-09-13 16:52:12 -07:00
Brian Anderson
b8e31ac469 Try a little harder to avoid creating new landing pads
It's only when we add or revoke cleanups involving immediates that we need a
new landing pad for the scope.

Trims 5K off the optimized rustc bin
2011-09-13 16:52:12 -07:00
Brian Anderson
74c39469be Reuse landing pads when possible
Cuts the optimized rustc bin from 5.2 to 4.7MB
2011-09-13 16:52:12 -07:00