Commit graph

1417 commits

Author SHA1 Message Date
Brian Anderson
29ad3bdb10 Make fn denote a bare function. Convert fn to fn@ as needed 2011-10-20 18:23:48 -07:00
Brian Anderson
391e12124b Tweak typecheck to enforce covariance on higher-order function arguments 2011-10-20 18:23:48 -07:00
Brian Anderson
8136b92ee8 Give subtype relationships to function types 2011-10-20 18:23:48 -07:00
Brian Anderson
ed985b61d5 Bare functions can coerce to blocks 2011-10-20 18:23:48 -07:00
Brian Anderson
354bfc8292 Bare functions can coerce to shared closures 2011-10-20 18:23:48 -07:00
Brian Anderson
686d6a485f Drop the 2 from the spawn*2 functions
Issue #1022
2011-10-20 18:23:47 -07:00
Brian Anderson
3b54dcfa79 Convert the test runners to typesafe spawn
Issue #1022
2011-10-20 18:23:47 -07:00
Brian Anderson
a4956a7cdd XFAIL task-perf-word-count-generic
This can't be done with bare functions.

Issue #1022
2011-10-20 18:23:47 -07:00
Brian Anderson
ac671c3172 Convert tests to use bare-fn spawn
Issue #1022
2011-10-20 18:23:47 -07:00
Brian Anderson
dcee98b024 Un-xfail-fast some tests
check-fast is more reliable now.
2011-10-20 16:01:24 -07:00
Brian Anderson
28161fcf3c Change run-pass/lots-a-fail.rs from xfail-fast to xfail-win32
All failing tasks leak on windows now
2011-10-20 16:00:13 -07:00
Brian Anderson
880b1ec9f5 Fail nicer when the parser doesn't find an expected string literal
Closes #1028
2011-10-19 18:04:44 -07:00
Matt Brubeck
15d33f7957 Fix parse error in constrained-type-missing-check.rs 2011-10-18 16:42:00 -07:00
Brian Anderson
314c011d71 Immutable and mutable? are covariant on their inner types
Whereas [mutable T] is invariant with respect to T, [T] and [mutable? T]
are covariant with respect to T.
2011-10-18 10:37:04 -07:00
Marijn Haverbeke
71a4a66135 Add a math module to the standard lib
I need some rudimentary stdlib stuff for the tutorial.

Closes #1042
2011-10-18 13:54:35 +02:00
Brian Anderson
0f0fa26c72 Enforce variance rules for mutable types 2011-10-17 20:51:34 -07:00
Brian Anderson
4d9d889dbf Don't allow assignment to mutable-wha? 2011-10-17 16:35:33 -07:00
David Rajchenbach-Teller
454333368c [Lib] int.rs, uint.rs: added max_value, min_value 2011-10-17 11:22:57 -07:00
Brian Anderson
bc4c3df1bf Don't allow the value of generic bare functions to be taken
Issue #1038
2011-10-13 14:39:30 -07:00
Brian Anderson
60cfa91897 Add a test that generic bare functions can be bound
Issue #1022
2011-10-13 12:16:26 -07:00
Marijn Haverbeke
e4c91fdf65 Properly fill single-variant zero-arg tag values.
Closes #1034. Closes #1035.
2011-10-13 15:14:09 +02:00
Niko Matsakis
e8a0e592da reimplement some of the unsafe stuff which got lost
- blocks inherit unsafety
  - remove the --check-unsafe flag
  - add unsafe annotations where needed to get things to compile
2011-10-12 16:33:07 -07:00
Niko Matsakis
5b015288b5 new test 2011-10-12 16:33:07 -07:00
Niko Matsakis
215b1ab000 make compiler emit more than 1 error in the case of unsafe 2011-10-12 16:33:07 -07:00
Niko Matsakis
3b66806624 prohibit ptr deref unless in unsafe code 2011-10-12 16:33:07 -07:00
Niko Matsakis
a56698575c fix error msg 2011-10-12 16:33:07 -07:00
Niko Matsakis
e8a29fbe3c add some new tests 2011-10-12 16:33:07 -07:00
Niko Matsakis
70164739e8 convert a few tests from unsafe fns to fns with unsafe bodies 2011-10-12 16:33:07 -07:00
Niko Matsakis
81533ff737 add pass to check that unsafe fns cannot be used as values 2011-10-12 16:33:06 -07:00
Niko Matsakis
e39db5a100 all tests pass 2011-10-12 16:33:06 -07:00
Niko Matsakis
db16fce77f all tests pass 2011-10-12 16:33:06 -07:00
Niko Matsakis
85da98db4a continue to annotate functions as unsafe where neccessary 2011-10-12 16:33:06 -07:00
Niko Matsakis
d4d7eb069b add unsafe tags into various points in the translation chains
and so forth
2011-10-12 16:33:06 -07:00
Niko Matsakis
8ea1a8eef9 make treatment of unchecked/unsafe blocks more uniform
also repair various errors in the parser related to such blocks.
rename checked_blk to default_blk to reflect the fact that it
inherits its purity from the surrounding context.
2011-10-12 16:32:57 -07:00
Brian Anderson
8366f3caa3 Revert "Test for #954"
This reverts commit 7edb043889.
2011-10-12 15:53:54 -07:00
Brian Anderson
7edb043889 Test for #954 2011-10-12 15:53:15 -07:00
Brian Anderson
40fa88febb Ignore stdtest::os::test_setenv. Fails periodically on mac 2011-10-12 15:27:58 -07:00
Niko Matsakis
24b201fa48 skip test, remove whitespace 2011-10-12 14:39:34 -07:00
Niko Matsakis
cbe8da0655 make treatment of unchecked/unsafe blocks more uniform
also repair various errors in the parser related to such blocks.
rename checked_blk to default_blk to reflect the fact that it
inherits its purity from the surrounding context.
2011-10-12 14:39:24 -07:00
Niko Matsakis
8c1231ae5f fix test to include a main() function 2011-10-12 14:26:47 -07:00
Niko Matsakis
d207bc3a0b it is also legal to call unsafe functions from other unsafe functions 2011-10-12 14:26:47 -07:00
Niko Matsakis
046ca827dd Add unsafe blocks, unsafe functions, and two rudimentary tests
related to them
2011-10-12 14:26:47 -07:00
Brian Anderson
99f876e3a8 Make build_environment and trans_bind_thunk GEP bound arguments the same
These functions both use GEP_tup_like to get at the arguments bound to the
environment, but they were starting from a different 'level' of the
environment-box structure. Frighteningly, this was leading to them having
different opinions of how the bound arguments were aligned in some cases.
2011-10-12 12:11:07 -07:00
David Rajchenbach-Teller
75bda422df [Tests] added float tests 2011-10-12 10:56:05 +02:00
Lindsey Kuper
813c2eb369 Revert "Revert "Add a test case for #898. Closes #898.""
This reverts commit e305ab3851.

Oops again.  Reverting a mistaken revert.
2011-10-11 22:03:23 -04:00
Lindsey Kuper
e305ab3851 Revert "Add a test case for #898. Closes #898."
This reverts commit f480203fdd.

Oops.  This patch requires people to bump their LLVM version.
2011-10-11 22:00:17 -04:00
Brian Anderson
f480203fdd Add a test case for #898. Closes #898.
Seems to have been fixed.
2011-10-11 16:50:50 -07:00
Brian Anderson
8c77d063a9 Add a test for assignment of bare functions
Issue #1022
2011-10-11 13:40:31 -07:00
Brian Anderson
b04f84275a Add a test that bare functions are word-sized
Issue #1022
2011-10-11 13:40:28 -07:00
Brian Anderson
90c2402089 Add a test that uses a hypothetical bare-fn spawn signature
Issue #1022
2011-10-11 12:10:56 -07:00