Marijn Haverbeke
be4f7354b4
Add box patterns
...
An @ can now be prepended to a pattern to unbox something during
pattern matching.
Closes #661
2011-07-13 11:11:43 +02:00
Marijn Haverbeke
6cb5c0980a
box patterns, expect for the trans part
2011-07-13 10:50:16 +02:00
Marijn Haverbeke
6914d32acc
Do not allow moving out of obj fields, properly check move inits
...
Closes #591
2011-07-13 10:23:13 +02:00
Patrick Walton
729fa81d3b
Revert "rustc: Remove some exterior vectors from ty.rs"
...
This reverts commit 01ea0647bb9773f44a8100c461af30046c3293aa.
2011-07-12 18:47:26 -07:00
Patrick Walton
6390c43dc4
Revert "rustc: Remove exterior vectors from resolve"
...
This reverts commit 0ffe8c81c31f00e7a032d88d5397930fefbfc97f.
2011-07-12 18:42:58 -07:00
Patrick Walton
79ee267ef4
rustc: Remove the last few exterior vectors from typeck
2011-07-12 18:41:27 -07:00
Patrick Walton
f7ba28573f
rustc: Remove a few scattered uses of exterior vectors from typestate
2011-07-12 18:34:22 -07:00
Patrick Walton
0ffe8c81c3
rustc: Remove exterior vectors from resolve
2011-07-12 18:29:03 -07:00
Patrick Walton
01ea0647bb
rustc: Remove some exterior vectors from ty.rs
2011-07-12 18:21:50 -07:00
Patrick Walton
cdda0fd6d6
rustc: Remove some useless std::vec imports
2011-07-12 18:07:12 -07:00
Graydon Hoare
e53cfb979b
Fix fast-check target by disabling code snippet printing on warnings (broken on .rc files) and adding an xfail-fast flag for global-scope.rs.
2011-07-12 17:36:57 -07:00
Brian Anderson
b97318bb80
Simplify the code for generating tests. Issue #428
2011-07-12 16:54:47 -07:00
Brian Anderson
ed83f28076
Log the synthesized __test module. Issue #428
2011-07-12 16:54:46 -07:00
Brian Anderson
73e6a4f9e5
Elide existing main function when building a test runner. Issue #428
...
This prevents any defined main function from colliding with the one
synthesized for the test runner. This is not the best solution since it
doesn't compile a function the user defined, but I don't think it's likely to
be a problem in the near term.
2011-07-12 16:54:46 -07:00
Brian Anderson
41a3888da7
Fix type inference of fn tail expressions. Closes #680
2011-07-12 16:54:46 -07:00
Patrick Walton
a3add84909
rustc: Remove some interior vectors from typestate and some useless vec-related imports
2011-07-12 16:44:57 -07:00
Patrick Walton
e038e8e52b
rustc: Move ppaux away from exterior vectors
2011-07-12 16:35:02 -07:00
Patrick Walton
60cffd7116
rustc: Complete the transition of pprust to interior vectors
2011-07-12 16:13:30 -07:00
Patrick Walton
a190a2c68e
rustc: Remove exterior vectors from front::attr
2011-07-12 15:39:48 -07:00
Marijn Haverbeke
12d5532166
Use switches rather than chained conditionals to compile alt matches
...
This also moves the alt-related trans code into its own file.
Closes #467
2011-07-13 00:38:24 +02:00
Tim Chevalier
f7a1006a07
Make resolve check for type-variable name-shadowing
...
Capturing a type argument in the enclosing scope should be an error --
this commit implements that check in resolve, avoiding a potential
assertion failure in trans.
Closes #648 .
2011-07-12 13:42:05 -07:00
Lindsey Kuper
0d9c08af2a
Remove some obsolete comments.
2011-07-12 12:01:02 -07:00
Lindsey Kuper
a0b78e649e
"Narrow scope forgives many sins." -- M. Schwern
2011-07-12 12:01:02 -07:00
Patrick Walton
0be1a0b500
rustc: Simplify tritv::copy; shaves a couple of seconds off typestate.
2011-07-12 11:47:32 -07:00
Tim Chevalier
e1f9bfbac9
Add missing files
...
git add didn't, so this actually has the changes that should
have been in the previous commit
2011-07-12 11:26:14 -07:00
Tim Chevalier
0e594939aa
Fix potential use-before-init bug in trans
...
This was being masked by a bug in typestate (fixed in the next commit).
2011-07-12 11:21:14 -07:00
Marijn Haverbeke
bde52808f0
Update pretty-printing of '...' in record patterns to be ', _' instead
2011-07-12 17:58:40 +02:00
Brian Anderson
a5ec51d6a1
Fix pretty-printing of literals again. Issue #672
...
The pos variable is one character beyond where I thought it was.
2011-07-11 21:31:14 -07:00
Tim Chevalier
a8b1ea159c
Make the parser add correct spans to view_items
...
Closes #650 .
2011-07-11 19:12:02 -07:00
Brian Anderson
94e1b362f0
Pass command-line args to the test runner. Issue #428
...
This will let the test runner filter the tests it runs.
2011-07-11 19:01:53 -07:00
Paul Stansifer
2e46438507
So... I can't spell 'ellipsis'.
2011-07-11 18:52:50 -07:00
Paul Stansifer
9a0e85a920
Change "etc" syntax for record patterns from {a:b ...}
to {a:b, _}
.
2011-07-11 18:52:50 -07:00
Paul Stansifer
48dbee6b47
Add elipses, reorganize the macro components into their own AST node.
2011-07-11 18:52:50 -07:00
Paul Stansifer
425732311a
Move macro expansion to a separate phase, change macro syntax, and add parse_sess to session.
2011-07-11 18:52:50 -07:00
Paul Stansifer
80cf4ecd3b
Add nodes for embedding types and blocks in expressions for macros.
2011-07-11 18:52:10 -07:00
Josh Matthews
fd24fd5e31
Only print up to six lines on error. Print ^~~~~ to highlight error span.
2011-07-11 18:44:27 -07:00
Josh Matthews
b62fcdcc36
Hack to print lines when error spans are available.
2011-07-11 18:44:27 -07:00
Tim Chevalier
1870e97559
Visit the type argument in a port expression
...
This closes #664 .
2011-07-11 18:12:00 -07:00
Brian Anderson
e45819ad70
Add parser::parse_crate_from_source_str
...
The fuzzer wants to be able to do stuff like this
2011-07-11 17:46:24 -07:00
Tim Chevalier
e1620def9f
In typeck, check for dynamically sized by-value arguments to thunks
...
A check in trans didn't have a corresponding check in typeck, causing
some programs (to wit, compile-fail/chan-parameterized-args.rs - part of this
commit) to fail with an assertion failure in trans instead of a type error.
Fixed it. In short, arguments that are future thunk arguments (any spawn
arguments, and _ arguments in bind) need to either not contain type params
or type vars, or be by-reference.
Closes #665 .
2011-07-11 17:32:00 -07:00
Brian Anderson
9fe03b3c55
Pull lexer creation out of new_parser
...
This will allow custom lexers to be injected into the parser (for fuzzing)
2011-07-11 16:56:02 -07:00
Brian Anderson
08f8753d80
Pull file reading out of the lexer
2011-07-11 16:56:02 -07:00
Patrick Walton
05390b4b38
rustc: Implement explicit global scope resolution via leading "::"; add a test case
2011-07-11 16:02:16 -07:00
Tim Chevalier
9427864f33
Unify the rhs and lhs types in a send
...
Closes #662 .
One-line fixes are always the best :-D
2011-07-11 15:24:47 -07:00
Patrick Walton
79ce5a4614
rustc: Implement pointer dereference; add a test case
2011-07-11 15:19:16 -07:00
Michael Sullivan
4618e802db
Fix comparisons of the nil type to do something sensible.
...
Closes #576 .
2011-07-11 14:45:21 -07:00
Brian Anderson
7fc7ebd520
The lexer's get_mark_str should slice by byte position, not char. Closes #654
2011-07-11 14:41:55 -07:00
Marijn Haverbeke
c893188549
Use some actual or-patterns in resolve.rs
2011-07-11 21:23:49 +02:00
Marijn Haverbeke
55e348280e
Fix pretty-printing of record patterns
2011-07-11 21:23:49 +02:00
Michael Sullivan
7340824cbc
Fix autoderef of function calls when the function is not an lval.
...
As it turns out, the correct way to handle this is much simpler than what I
did originally.
Also add more tests.
2011-07-11 11:38:01 -07:00