Tim Chevalier
95e1aa18c1
change comment
2011-05-27 20:43:51 -07:00
Tim Chevalier
9a24e4f780
Fix two typestate bugs
...
* Non-returning calls should set all predicates to be true, not
just the "this function returns" predicate
* Fixed a bug in the expr_alt case in tstate.states that wasn't updating
the changed flag properly, then fixed *another* bug that was updating
it too enthusiastically, but was masked by the first bug.
2011-05-27 20:43:51 -07:00
Lindsey Kuper
dc9d5e1689
Lots of comments, and some more descriptive names.
2011-05-27 18:20:43 -07:00
Tim Chevalier
b6e0c5829f
Check the declaration type in a for loop against the sequence type
...
Changed the typechecker to correctly typecheck the declared variable
type in a for or for-each loop against the vector element type (for
a for loop) or the iterator type (for a for-each loop). Added a
test case.
2011-05-27 17:42:09 -07:00
Tim Chevalier
0c5a55f275
add a function that returns the type of a local decl
2011-05-27 17:34:50 -07:00
Graydon Hoare
85a2b0bfb9
Re-XFAIL, not valgrind-clean.
2011-05-27 15:52:00 -07:00
Eric Holk
52795049e7
Generating names for wrappers, removed extra logging
2011-05-27 15:37:19 -07:00
Eric Holk
8cfc388d40
Switched calling conventions so that spawn with multiple arguments works.
2011-05-27 15:20:58 -07:00
Eric Holk
d49998f0ed
Switching over to wrappers for spawning functions of multiple arguments. Doesn't quite work yet.
2011-05-27 15:20:58 -07:00
Eric Holk
842bf7cad1
Un-XFAILing spawn tests.
2011-05-27 15:20:58 -07:00
Eric Holk
da0e0b6f5e
Removing excessively verbous logging.
2011-05-27 15:20:58 -07:00
Eric Holk
a88af906c5
Programs using spawn terminate
2011-05-27 15:20:58 -07:00
Eric Holk
dad426419c
Working on 2 argument spawn. The arguments seem to be copied correctly once, but then they get lost.
2011-05-27 15:20:58 -07:00
Eric Holk
bb4c7a9c68
Arguments seem to be correctly passed to child processes now.
2011-05-27 15:20:58 -07:00
Eric Holk
21efd07bc1
New tasks run, but their arguments get lost and something ends up in an infinite loop when the task exits.
2011-05-27 15:20:58 -07:00
Lindsey Kuper
867e9fb030
Test case showing that issue 324 is resolved.
2011-05-27 12:45:01 -07:00
Tim Chevalier
0cbcf92749
Use annotations on blocks
...
Previously, block_ty returned the type of the terminating
expression of the block (or nil if said expression was absent).
I changed check_expr to write the type of that expression into
the annotation for the block itself, so now block_ty can use the
block's annotation.
2011-05-27 12:21:37 -07:00
Michael Sullivan
a7a42c24be
Change the syntax for RECV from "var <- port" to "port |> var".
2011-05-27 12:01:20 -07:00
Michael Sullivan
2119e3b5b9
Fix missing bump in RECV lexer case.
2011-05-27 12:01:20 -07:00
Michael Sullivan
9c79200a7f
Pretty print the new RECV token...
2011-05-27 12:01:20 -07:00
Michael Sullivan
ea16e582eb
Remove parser support for recv as an initializer in preparation for changing the recv syntax.
2011-05-27 12:01:20 -07:00
Michael Sullivan
55b40e6894
Lex '|>' as the RECV token.
2011-05-27 12:01:20 -07:00
Tim Chevalier
147b088125
Test for use of break as an expression
...
The test was meant to verify that the typechecker correctly
allows a _|_ value (break, here) to be used in any context.
However, the compiler fails with an LLVM assertion failure.
I xfailed it, but wanted it to be on the record anyway.
2011-05-26 20:52:05 -07:00
Tim Chevalier
1a96e79fe0
Make _|_ unify with anything
...
The typechecker had a number of special cases for unifying types
with _|_ (as with checking if and alt). But, a value of type _|_
should be usable in any context, as such a value always diverges,
and will never be used by its immediate context. Changed unify
accordingly, removed special cases.
2011-05-26 20:50:25 -07:00
Paul Stansifer
af6b4821c1
Handle circularity in glob imports in a more elegant fashion.
2011-05-27 02:42:33 +00:00
Paul Stansifer
7fe3d821ac
Add a map from def_id s to items in resolve::env.
...
Use it to provide better error messages in the event of
glob-importing the same name multiple times.
2011-05-27 02:42:33 +00:00
Paul Stansifer
54ca8565c9
Fix bugs: make sure glob imports show up in the right module,
...
and make sure that circular glob imports don't diverge.
2011-05-27 02:42:33 +00:00
Paul Stansifer
3375b8fba2
Add list function 'has'.
2011-05-27 02:42:33 +00:00
Paul Stansifer
40fe44d23e
"import module::*;" now works.
2011-05-27 02:42:33 +00:00
Paul Stansifer
22953f52fa
Added filter_map.
2011-05-27 02:42:33 +00:00
Paul Stansifer
e2bb98001e
Part one of adding globbing to resolve.rs: build up glob links. (Part two will follow those links if non-glob resolution fails.)
2011-05-27 02:42:32 +00:00
Paul Stansifer
f11f846ead
Parsing and folding changes for globbed imports.
2011-05-27 02:42:32 +00:00
Tim Chevalier
610c81af19
Fix typo
2011-05-26 19:13:56 -07:00
Tim Chevalier
83cdb47a7c
Add a list append function, which I didn't end up using, but why not add it?
2011-05-26 19:13:56 -07:00
Graydon Hoare
fc31aa7f85
Fix testcase to be slightly less fussy about line number of error, as it just drifted.
2011-05-26 18:29:28 -07:00
Graydon Hoare
79c9e13073
More delicious dead code removal from runtime, upcalls.
2011-05-26 18:21:02 -07:00
Tim Chevalier
4f792f2dbb
Track spans for each local variable in typestate
...
This lets us print better messages in situations with name
shadowing.
2011-05-26 18:14:32 -07:00
Tim Chevalier
250643c549
Remove unused imports
2011-05-26 18:01:48 -07:00
Tim Chevalier
97e0575e2e
Add a span_str function in session
2011-05-26 18:00:54 -07:00
Tim Chevalier
79693fab1f
Fix typo in error message
2011-05-26 18:00:54 -07:00
Graydon Hoare
9f95538462
Remove redisue of unused fields from 'ann'.
2011-05-26 17:26:59 -07:00
Graydon Hoare
2561b01211
Remove residual uses of fold, and fold itself.
2011-05-26 17:16:54 -07:00
Graydon Hoare
8e945dcd81
Remove native glues. All calls to C are direct now.
2011-05-26 16:45:01 -07:00
Rafael Ávila de Espíndola
89e5f6c883
New snapshot.
2011-05-26 18:47:21 -04:00
Graydon Hoare
9491dc3e61
Add early returns to rustc main on non-compiling paths.
2011-05-26 15:22:08 +00:00
Graydon Hoare
dc1b34288c
Pretty print view items with :: rather than :.
2011-05-25 22:09:36 -07:00
Brian Anderson
29a801565a
rustc: Fail better when the first argument to #fmt is not a string literal
2011-05-25 23:50:19 -04:00
Brian Anderson
c4e9d8fb91
rustc: Fail when #fmt is given too many arguments
2011-05-25 23:43:04 -04:00
Michael Sullivan
1b29892b5b
Produce a useful error message in trans when attempting to log an unsupported type.
...
(Previously, an llvm assert was tripped.)
2011-05-25 18:54:33 -04:00
Eric Holk
d72d50473f
Fixing typechecking for spawn.
2011-05-25 18:01:45 -04:00
Rafael Ávila de Espíndola
4c4a4aee91
Fix non linux bots.
2011-05-25 16:03:50 -04:00
Rafael Ávila de Espíndola
94129c4216
dead argument removal part one.
2011-05-25 15:33:57 -04:00
Rafael Ávila de Espíndola
db47cb5c13
Dead code.
2011-05-25 15:22:25 -04:00
Rafael Ávila de Espíndola
0e324cad0a
Dead code.
2011-05-25 15:08:31 -04:00
Rafael Ávila de Espíndola
9a3624466b
Dead code.
2011-05-25 14:12:09 -04:00
Rafael Ávila de Espíndola
2306fb19f2
dead code.
2011-05-25 13:25:00 -04:00
Rafael Ávila de Espíndola
23c1335cb3
Dead code.
2011-05-25 12:00:16 -04:00
Rafael Ávila de Espíndola
579b317ae8
Dead code.
2011-05-25 11:45:07 -04:00
Rafael Ávila de Espíndola
3eafea46a3
Dead code.
2011-05-25 11:36:34 -04:00
Brian Anderson
70106f35ce
test: Fix run-fail testing and bring tests up to date
...
A typo in the Makefile was causing these to not run. Happily, a lot of these
tests pass, so un-xfailed.
2011-05-24 22:09:12 -04:00
Brian Anderson
763380a2cc
test: xfail vector-no-ann-2 in stage0
2011-05-24 22:08:08 -04:00
Rafael Ávila de Espíndola
4364be3744
Dead code.
2011-05-24 20:36:27 -04:00
Brian Anderson
9a88ba2b81
rustc: Downcase typeck::demand and typeck::pushdown
2011-05-24 20:26:46 -04:00
Brian Anderson
6473b73174
rustc: Use demand functions instead of open-coded typecheck for spawn
...
Un-xfail spawn-non-nil-fn
2011-05-24 20:23:21 -04:00
Rafael Ávila de Espíndola
0c1ea141b4
Dead code.
2011-05-24 20:12:30 -04:00
Rafael Ávila de Espíndola
f9946c9748
Dead code.
2011-05-24 19:39:30 -04:00
Rafael Ávila de Espíndola
40a3923fca
Dead code.
2011-05-24 19:29:46 -04:00
Rafael Ávila de Espíndola
395940f7e3
Dead code elimination.
2011-05-24 19:07:30 -04:00
Rafael Ávila de Espíndola
de2e84e5b0
Only one gc glue.
2011-05-24 18:52:31 -04:00
Kelly Wilson
31de8e15c0
Add quick_sort3 function based on 'QuicksortIsOptimal.pdf' (see comments in file). Cleanup the quick_sort function a little, as well. Add test file.
2011-05-24 18:38:41 -04:00
Rafael Ávila de Espíndola
ac836dd79c
There is only one yield glue.
2011-05-24 18:29:08 -04:00
Rafael Ávila de Espíndola
b1292580b9
Remove dead code for unwind_glue.
2011-05-24 17:28:37 -04:00
Rafael Ávila de Espíndola
0fc91b6ecc
There is only one activate function now.
2011-05-24 17:00:45 -04:00
Eric Holk
2e8afc7b47
Merge pull request #404 from lkuper/cleanup
...
Just removing some unnecessary imports.
2011-05-24 13:51:00 -07:00
Rafael Ávila de Espíndola
fe90159b86
"constant propagate" rust_new_exit_task_glue to its only use.
2011-05-24 15:51:22 -04:00
Marijn Haverbeke
fbc0e840e3
Stop showing a 'cyclic import' message for unresolved imports
...
This only happened for single-length import paths, because the import
was being looked up in its own scope.
2011-05-24 20:58:38 +02:00
Lindsey Kuper
f1d3b88f0a
Just removing some unnecessary imports.
2011-05-24 11:22:40 -07:00
Tim Chevalier
bad05e20a3
Improve nonexistent-module error message
...
The error message for (for example) "import vec;" without "use std;"
was "cyclic import", which was misleading because there were no
cycles. I changed it to "cyclic import or nonexistent module",
which doesn't break existing tests.
2011-05-24 10:47:58 -07:00
Brian Anderson
029c1e71ff
test: Remove compile-fail/export-boot.rs
...
This was a rustboot-specific test which is covered by other tests in rustc.
2011-05-23 23:13:18 -04:00
Brian Anderson
e5e2811bc6
test: Un-xfail some compile-fail tests
...
Changed a few error patterns to match rustc's errors where it seemed
reasonable.
2011-05-23 23:13:18 -04:00
Tim Chevalier
c22100ab2d
Un-XFAIL vector-no-ann
...
and update it to reflect the new friendly error message
2011-05-23 19:46:27 -07:00
Tim Chevalier
c9a8bdee2f
Improve error message for ambiguous polymorphic types
...
If a type still contains free type variables after typechecking (for
example, as with "auto foo = []", the result was an assertion failure
in typeck. Made it a human-readable error message instead.
2011-05-23 19:46:27 -07:00
Brian Anderson
776977b755
test: Un-xfail some working tests
2011-05-23 22:41:37 -04:00
Tim Chevalier
b620be9cd2
Typecheck @[] correctly
...
Previously, if you wrote
let @vec[int] foo = @[];
that would be a type error. That didn't seem right, so I changed
pushdown to unify the inner type in an unop application with the
argument type of the operator type.
2011-05-23 17:17:49 -07:00
Brian Anderson
2505a2312e
rustc: Run the llvm verifier pass before optimization. Closes #376
...
The optimization passes were hiding some codegen errors so now we run the
verifier both before and after optimization.
2011-05-23 19:52:57 -04:00
Brian Anderson
8637c09cf9
stdlib: Make the bound vector an alias in std::deque
...
Workaround for issue #375
2011-05-23 19:45:51 -04:00
Marijn Haverbeke
edf95efae8
Un-xfail test/run-pass/mlist
2011-05-23 23:25:55 +02:00
Marijn Haverbeke
86d51ec24b
Get test-pass/utf8.rs to run
...
This involved a small fix to the unicode-escape character lexing and
to the pretty-printer.
2011-05-23 23:25:55 +02:00
Marijn Haverbeke
dc2cdbf4a1
Un-xfail test/run-pass/use-import-export
2011-05-23 23:25:54 +02:00
Tim Chevalier
2a73c4ffab
Add line breaks to typestate error messages
2011-05-23 13:32:29 -07:00
Brian Anderson
db7611c4c9
rustc: More cleanup of rustc.rs
2011-05-22 16:58:33 -04:00
Brian Anderson
1081d0aee9
rustc: Some refactoring of rustc.rs
2011-05-22 16:41:32 -04:00
Brian Anderson
837dff9226
stdlib: Export match type from std::getopts
2011-05-22 16:41:06 -04:00
Brian Anderson
65ec38c096
rustc: Cleanup formatting in rustc.rs
2011-05-22 16:07:30 -04:00
Brian Anderson
c1122a6707
stdlib: Use if/alt expressions in std::uint
2011-05-22 12:28:27 -04:00
Brian Anderson
1ecd6a82ab
stdlib: Use if/alt expressions in std::str
2011-05-22 12:28:27 -04:00
Brian Anderson
10c904bc6a
stdlib: Add regression tests for std::str
2011-05-22 12:28:27 -04:00
Brian Anderson
443e1e4557
stdlib: Use if/alt expressions in std::option
2011-05-22 12:28:27 -04:00
Brian Anderson
820ccf4a13
stdlib: Do tail calls in std::map. Remove FIXMEs
2011-05-22 12:28:20 -04:00
Brian Anderson
2d17d9101d
stdlib: Use if/alt expressions in std::map
2011-05-22 12:28:20 -04:00
Brian Anderson
f6777db615
stdlib: Add regression tests for std::map
2011-05-22 12:28:20 -04:00
Brian Anderson
f1c1887cab
stdlib: Remove unneeded fail statements from std::list. Remove FIXMEs
2011-05-22 12:28:14 -04:00
Brian Anderson
f6beec6c43
stdlib: Do tail calls in std::list. Remove FIXMEs
2011-05-22 12:28:08 -04:00
Brian Anderson
bac68e4af3
stdlib: Add regression tests for std::list
2011-05-22 02:10:10 -04:00
Brian Anderson
b4c9f782e4
stdlib: Add list::from_vec
2011-05-22 02:10:10 -04:00
Brian Anderson
1e9aef828c
stdlib: Reindent list.rs
2011-05-22 02:10:10 -04:00
Brian Anderson
d4f5f69930
stdlib: Use if/alt expressions in std::io
2011-05-22 02:10:10 -04:00
Brian Anderson
d4da3f5172
stdlib: Use if/alt expressions in std::int
2011-05-22 02:10:09 -04:00
Brian Anderson
d85447c4fb
stdlib: Use initial caps for all error messages in std::getopts
2011-05-22 02:10:09 -04:00
Brian Anderson
3a2d64f044
stdlib: Use if/alt expressions in std::getopts
2011-05-22 02:10:09 -04:00
Brian Anderson
a0f855e488
stdlib: Report an error when getopts is given an argument to a flag option
2011-05-22 02:10:09 -04:00
Brian Anderson
079711d5f6
stdlib: Add regression tests for std::getopts
2011-05-22 02:10:09 -04:00
Brian Anderson
c1a6c2e6c2
stdlib: Only export what's necessary from std::getopts
2011-05-22 02:10:09 -04:00
Brian Anderson
264c3b5be4
stdlib: Use if/alt expressions in std::generic_os
2011-05-22 02:10:09 -04:00
Brian Anderson
da0e961f61
stdlib: Use if/alt expressions in std::fs
2011-05-22 02:10:09 -04:00
Brian Anderson
85bcf75da1
stdlib: Add regression test for fs::connect and a FIXME
2011-05-22 02:10:09 -04:00
Brian Anderson
0755a30051
stdlib: Use if/alt expressions in std::deque
2011-05-22 02:10:08 -04:00
Brian Anderson
6432599c5d
stdlib: Use if/alt expressions in std::bitv
2011-05-22 02:10:08 -04:00
Brian Anderson
90e6453f46
stdlib: Use if/alt expressions in std::extfmt
2011-05-22 02:10:08 -04:00
Brian Anderson
d7d387171c
test: Un-xfail alias-uninit-value.rs. Closes #374 .
...
This started working correctly at some point.
2011-05-22 02:03:07 -04:00
Brian Anderson
8102926b4b
test: Use more sensible cases in expr-alt-fail-all.
...
Thanks for the review, Jesse.
2011-05-21 20:01:38 -04:00
Brian Anderson
d82e9c1874
rustc: Add a FIXME to expr_alt type checking
2011-05-21 18:35:21 -04:00
Brian Anderson
420d18a448
test: Adda test that all arms of an alt may result in fail
2011-05-21 18:31:40 -04:00
Brian Anderson
4504e23a82
rustc: Remove unnecessary pushdown from check_expr in the expr_if case
2011-05-21 18:18:48 -04:00
Brian Anderson
4bcdf57d78
test: Add a test for mismatched types of if branches
2011-05-21 18:18:48 -04:00
Brian Anderson
e24d7ae967
rustc: If all if branches are _|_, then the entire if is _|_
2011-05-21 18:18:48 -04:00
Brian Anderson
c0b4fc1846
Register new snapshots
2011-05-21 18:09:15 -04:00
Brian Anderson
085fb1a2db
rustc: Remove outdated comment
2011-05-21 14:43:04 -04:00
Brian Anderson
b62bf8cede
rustc: Allow if expressions to fail
2011-05-21 14:22:01 -04:00
Brian Anderson
6824f119fc
rustc: Allow alt expressions to fail
2011-05-21 13:22:01 -04:00
Brian Anderson
418b4c4567
rustc: Assign ty_bot to nodes in write::bot_ty. Remove FIXME
2011-05-21 13:02:58 -04:00
Brian Anderson
779dd809d2
rustc: Blocks shouldn't try to return results for ty_bot
2011-05-21 12:56:31 -04:00
Tim Chevalier
7b4eec215c
Some tests for ! annotations
2011-05-20 19:54:14 -07:00
Tim Chevalier
a1b440baaa
Un-XFAIL some tests that now pass.
2011-05-20 19:54:14 -07:00
Tim Chevalier
77f56f3154
XFAIL two tests for stage0
2011-05-20 19:54:14 -07:00
Tim Chevalier
755ca8eb73
Correctly check that ! functions always diverge
...
Also make _|_ unify with any type.
2011-05-20 19:54:14 -07:00
Brian Anderson
699986d192
fuzzer: Begin writing main
2011-05-20 22:32:41 -04:00
Brian Anderson
01c13a3878
stdlib: Add io::writer.write_line
2011-05-20 22:32:41 -04:00
Brian Anderson
fc8b9671bb
stdlib: Export only what's needed from std::bitv
2011-05-20 22:12:57 -04:00
Brian Anderson
04ce99b83c
stdlib: Export only what's needed from std::sort
2011-05-20 22:12:16 -04:00
Brian Anderson
2fc0bedc83
rustc: Don't write metadata for unexported items
2011-05-20 21:32:57 -04:00
Brian Anderson
7817824205
stdlib: export ptr_eq from box, but not rustrt
2011-05-20 21:32:57 -04:00
Tim Chevalier
467b938ea8
Merge remote-tracking branch 'graydon/master' into typestate_4
2011-05-20 18:23:03 -07:00
Tim Chevalier
5de9d27fcc
un-XFAIL forgot-ret and update error pattern
2011-05-20 18:20:54 -07:00
Tim Chevalier
964898eaf1
Error instead of warning for missing returns. Huzzah!
2011-05-20 18:20:54 -07:00
Tim Chevalier
fed0486c33
Annotate erroring functions in session and parser
2011-05-20 18:20:54 -07:00
Tim Chevalier
90dd6e7044
New snapshot that handles bang annotations
2011-05-20 18:20:54 -07:00
Lindsey Kuper
c3410bf927
More work on anonymous objects.
2011-05-20 17:59:56 -07:00
Tim Chevalier
c8d488b337
Change node_ann hash table to a vector in typestate
2011-05-20 16:57:37 -07:00
Tim Chevalier
9128a1bab8
rm unnecessary logging
2011-05-20 16:57:37 -07:00