Marijn Haverbeke
0a01144797
Use trans_expr_save_in instead of trans_expr when appropriate
...
This guards against passing a save_in destination to nil or bot-typed things.
2011-10-14 11:27:16 +02:00
Marijn Haverbeke
06257d66e7
Don't crash when reporting an unresolved import in the nil scope
...
Closes #1027
2011-10-14 11:25:14 +02:00
Brian Anderson
3808a498cd
Remove an unnecessary visitor from rustc::middle::fn_usage
2011-10-13 14:55:50 -07:00
Brian Anderson
acf9b83e71
Fix a use of visit in rustc::middle::fn_usage
...
This was working by just skipping an AST node instead of doing the advertised
check. I can't find a test case for it, but this is more correct.
2011-10-13 14:55:47 -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
89466ffd74
Rename rustc::middle::unsafeck to fn_usage
...
I'm going to add further checks unrelated to unsafe.
Issue #1038
2011-10-13 12:25:57 -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
6a7800508b
Make trans_anon_obj properly thread its bcx
...
Closes #893
Unfortunately, anon objs are still so broken as to be useless
(fields don't work).
2011-10-13 18:04:09 +02:00
Marijn Haverbeke
e4c91fdf65
Properly fill single-variant zero-arg tag values.
...
Closes #1034 . Closes #1035 .
2011-10-13 15:14:09 +02:00
Brian Anderson
6e67c4b253
Cleanse usage of some unsafe functions on win32
2011-10-12 16:42:13 -07: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
f994871a3d
remove unsafe tags
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
9f9deff7af
make a good error msg if you try to use an unsafe fn for a test
2011-10-12 16:33:07 -07:00
Niko Matsakis
b1a9d71218
improve the span used in test generation
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
f2cd33df72
continue to annotate trans functions as unsafe where neccessary
2011-10-12 16:33:06 -07:00
Niko Matsakis
2094668949
continue to annotate trans 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
c1cefa52d0
Add unsafe tags to usage of LLVM funcs
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
a1d046c75c
Register snapshots
2011-10-12 15:44:00 -07:00
Brian Anderson
40fa88febb
Ignore stdtest::os::test_setenv. Fails periodically on mac
2011-10-12 15:27:58 -07:00
Niko Matsakis
212707ce84
make native functions markable as unsafe and incorporate that
...
into the type check
2011-10-12 14:39:34 -07:00
Niko Matsakis
24b201fa48
skip test, remove whitespace
2011-10-12 14:39:34 -07:00
Niko Matsakis
b9a9559c91
correct lines over 78 chars
2011-10-12 14:39:34 -07:00
Niko Matsakis
f3c68e7238
enable unsafe checking but only with a flag --check-unsafe
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
e9569371f7
add 'u' to one other place it was missing
2011-10-12 14:26:47 -07:00
Niko Matsakis
f304c1bee5
add 'u' to decoder (kinda' important)
2011-10-12 14:26:47 -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
Niko Matsakis
29584cc5ac
Extend the unchecked block stuff to allow unsafe blocks as well.
2011-10-12 14:26:47 -07:00
Niko Matsakis
58b8e88356
expand purity to include unsafe
2011-10-12 14:26:47 -07:00
Niko Matsakis
9476692b52
move ctags.rust into src/etc
2011-10-12 13:57:32 -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
Marijn Haverbeke
306f7fb25f
Simplify copying of uniques
...
We can call take glue, rather than duplicating it inline.
2011-10-12 11:05:20 +02:00
David Rajchenbach-Teller
75bda422df
[Tests] added float tests
2011-10-12 10:56:05 +02:00
David Rajchenbach-Teller
8c9dd54ded
[Renaming] str_to_float is now float::from_str, float_to_str is now float::to_str
2011-10-12 10:56:05 +02:00
David Rajchenbach-Teller
7faed3d87c
[Fix] float.rs: str_to_float reimplemented
2011-10-12 10:56:05 +02:00
David Rajchenbach-Teller
3219c40e18
[Optim] int.rs: reimplemented pow with fast exponentiation
2011-10-12 10:56:05 +02:00
Lindsey Kuper
0d43e90172
Revert "Merge pull request #1025 from elly/master"
...
This reverts commit e12e76e9ba
, reversing
changes made to f480203fdd
.
2011-10-11 22:23:47 -04: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
Elly Jones
19eae0bc38
Update LinkModules invocation to use new prototype
...
LLVM revision 141606 changes the prototype of llvm::Linker::LinkModules.
Signed-off-by: Elly Jones <elly@leptoquark.net>
2011-10-11 21:32:34 -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
55379a97d4
Use the correct function type for external bare functions
...
Issue #1022
2011-10-11 15:12:49 -07:00
Brian Anderson
d8fb86d2e3
Register snapshots
2011-10-11 15:01:27 -07:00
Brian Anderson
cfa2346086
Use a non-ambiguous character for encoding bare functions
...
I was using 'R' and that was already used for records.
Issue #1022
2011-10-11 14:38:15 -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
Brian Anderson
1b0f1f0b79
Remove the environment argument from bare functions
...
Issue #1022
2011-10-11 10:51:10 -07:00
Brian Anderson
84e98f4f65
Add a test for higher-order bare functions
...
Issue #1022
2011-10-11 10:51:10 -07:00
Brian Anderson
145feb3298
Add a test for binding bare functions
...
Issue #1022
2011-10-11 10:51:10 -07:00
Brian Anderson
5b0f79b75a
Don't allow bind to produce bare functions
...
Issue #1022
2011-10-11 10:51:10 -07:00
Brian Anderson
b277039325
Introduce ast::proto_bare
...
Issue #1022
2011-10-11 10:51:10 -07:00
Brian Anderson
9c46cc58cb
Add a temporary syntax for bare functions
...
Bare functions will be represented as 'fn#' until they're implemented. Then
we'll switch it over to just 'fn'.
Issue #1022
2011-10-11 10:51:09 -07:00
David Rajchenbach-Teller
2ec85135e2
[Move] Moved str_to_float, float_to_str from compiler to lib
2011-10-11 16:41:34 +02:00
Marijn Haverbeke
33167f7dec
Adjust function signatures to allow for vecs being immediate
...
Some code was relying on vectors being implicitly by-reference (as
non-immediate value). This adds the necessary &&-sigils.
Closes #1021
2011-10-10 16:01:51 +02:00
Marijn Haverbeke
b4bae8fea5
Make vectors and strings immediates again
...
There's no good reason to force them to be spilled anymore. Some
pieces of trans become more elegant this way, and less stack allocs
and load/stores are needed.
Issue #1021
2011-10-10 15:59:16 +02:00
Marijn Haverbeke
5c53959f20
Make bcx_tcx-style accessors return by reference
2011-10-10 12:25:58 +02:00
Marijn Haverbeke
00daeb485c
Move type_is_immediate into ty.rs
2011-10-10 12:23:58 +02:00
Marijn Haverbeke
a35dbf3fd5
Don't spill immediates in order to drop them
...
Issue #1012
2011-10-10 12:20:28 +02:00
Marijn Haverbeke
fa1295343f
Make free glue take a pointer to the heap part (box)
...
This way, it can be used to drop values without first spilling them.
Issue #1012
2011-10-10 10:25:32 +02:00
Brian Anderson
96f6a1861c
Revert "Revert "Stop using (DY)LD_LIBRARY_PATH on Unix""
...
This reverts commit 941d5e737c
.
2011-10-09 15:23:41 -07:00
Brian Anderson
ecfa37d336
Register snapshots
2011-10-09 15:23:34 -07:00
Brian Anderson
941d5e737c
Revert "Stop using (DY)LD_LIBRARY_PATH on Unix"
...
This reverts commit 4b58071f96
.
2011-10-09 15:05:12 -07:00
Marijn Haverbeke
aff536ec0e
Fix bad float-type detection in trans
...
Closes #1017
2011-10-09 10:07:10 +02:00
Brian Anderson
79e9f7a015
Make windows package uninstallable
2011-10-07 14:09:29 -07:00
Brian Anderson
fed56b07ba
Make windows packaging work again
2011-10-07 13:48:20 -07:00
Marijn Haverbeke
1efe5f0577
Fix up test for last commit
2011-10-07 16:58:27 +02:00
Marijn Haverbeke
f26e770745
Make 1-1 parse again
...
Issue #954
This is not a very elegant fix -- we should probably do something with
constant folding to handle negative-int alt patterns in the future.
2011-10-07 16:46:44 +02:00
Marijn Haverbeke
c7eee8fb05
Stop registering cleanups for types that don't need them
2011-10-07 14:46:23 +02:00
Marijn Haverbeke
31586339b1
Make it possible to have locals that don't live on the stack
...
Local values that are not mutated, don't need to be cleaned up, and
are immediate, don't need to be spilled. (All immediate args, and
non-pointer immediate let locals.)
2011-10-07 14:43:19 +02:00
Marijn Haverbeke
7586082bb0
Add tests for programs that are invalid by arg-passing-style
...
Closes #1008
2011-10-07 10:41:40 +02:00
Marijn Haverbeke
8db71530f5
Forbid passing dynamically-sized types by value
...
Issue #1008
2011-10-07 10:41:40 +02:00
Marijn Haverbeke
2ff89469d4
Actually pass parameters specified as by-val by value
...
Issue #1008
2011-10-07 10:41:40 +02:00
Marijn Haverbeke
41528dc543
Add pass-by-ref annotation to the tests to make them typecheck
...
Issue #1008
2011-10-07 10:41:39 +02:00
Marijn Haverbeke
fe916fb9f0
Give up on providing a by-value version of map, convert fold over to
...
passing pointers by ref
Issue #1008
2011-10-07 09:56:12 +02:00
Marijn Haverbeke
f9fbd86f52
Parse and typecheck by-value and by-ref arg specs
...
Add sprinkle && throughout the compiler to make it typecheck again.
Issue #1008
2011-10-07 09:09:50 +02:00
Brian Anderson
ed5a962d6f
Hopefully make test_prefix_rpath_abs work on win32
2011-10-06 16:39:34 -07:00
Brian Anderson
831d861d84
Mac uses @executable_path instead of $ORIGIN
2011-10-06 16:26:32 -07:00
Brian Anderson
5cd6dbd5b9
Always use an absolute path for the backup install prefix rpath
2011-10-06 16:12:45 -07:00
Brian Anderson
04e89af6db
Add std::str::contains
2011-10-06 16:08:44 -07:00
Brian Anderson
4b58071f96
Stop using (DY)LD_LIBRARY_PATH on Unix
2011-10-06 15:23:20 -07:00
Brian Anderson
a1e4ab3e38
Register snapshots
2011-10-06 15:11:30 -07:00
Brian Anderson
e4068f6715
Mac doesn't seem to support rpath $ORIGIN
2011-10-06 14:29:03 -07:00
Brian Anderson
06087e67e1
Configure out rpath tests when not testing
2011-10-06 13:29:36 -07:00