Commit Graph

9480 Commits

Author SHA1 Message Date
Niko Matsakis
3cbd1e221e mark addr_or and friends pure 2012-06-07 07:18:29 -07:00
Zack Corr
67e62b388c Cargo: Added experimental dependency support (solves from crate files) 2012-06-07 20:33:04 +10:00
Jyun-Yan You
8f5f45bfe1 fix compiletest deadlock on freebsd 2012-06-07 16:38:10 +08:00
Brian Anderson
5f4837ad6a core: Start on a stack walker 2012-06-06 23:39:56 -07:00
Brian Anderson
125552fb19 rustc: Add frame_address intrinsic 2012-06-06 23:39:56 -07:00
Brian Anderson
c816eea000 std: Add debug::breakpoint 2012-06-06 23:39:55 -07:00
Brian Anderson
469ff08e64 rustc: Enable #[cfg(windows)] and #[cfg(unix)] 2012-06-06 23:39:09 -07:00
Brian Anderson
eed3a36511 rustc: Add 'target_family' to default configuration 2012-06-06 23:39:09 -07:00
Brian Anderson
2c5a660c99 core: Add os::family. Returns either 'windows' or 'unix' 2012-06-06 23:39:09 -07:00
Tim Chevalier
cd02046de4 merge 2012-06-06 22:30:52 -07:00
Tim Chevalier
3685d53a61 Register snapshots 2012-06-06 22:30:00 -07:00
Tim Chevalier
0327dc0b18 Insert missing maybe_print_comment call for class destructors
While it wasn't the original issue, the first program from #2487
failed the pretty-printing test because of this, so it's still a good
test case :-)

It also turns out that the second program from #2487 now triggers a
kind error, so I figured I might as well add it as a test case.
2012-06-06 22:09:10 -07:00
Tim Chevalier
de4f0b92b6 Say "easily" instead of "sanely"
I can't correct it every time, but every time someone uses "insane"/
"sane" as synonyms for "bad"/"good", they're saying that being like
me is the same as being everything that's bad and wrong in the world...
so I'm changing this to a word that means approximately the same thing
but doesn't devalue any group of people.
2012-06-06 22:09:10 -07:00
Graydon Hoare
c56b8f8924 Remove unused middle::ty::sort_methods function. 2012-06-06 20:20:22 -07:00
Graydon Hoare
3251bd690e Fix some copy-paste bugs in visit glue, un-xfail reflect-visit-type. 2012-06-06 19:38:56 -07:00
Tim Chevalier
f4fb0f9eea Handle regions correctly in class ctors and dtors
Class ctors and dtors were always getting assigned the empty region
before, which meant a reference to the "self" region in a ctor argument
got resolved to a named region called "self" rather than the class's
self region, which led to a rather confusing error message as documented
in #2502.

Closes #2502
2012-06-06 19:23:26 -07:00
Niko Matsakis
3b4cfdeee2 Merge remote-tracking branch 'mozilla/incoming'
Conflicts:
	src/rustc/middle/tstate/auxiliary.rs
2012-06-06 19:00:34 -07:00
Niko Matsakis
9c1910a66d workaround LLVM bug #13042 2012-06-06 18:42:11 -07:00
Niko Matsakis
ab8fa495d0 some (very little) work on commenting 2012-06-06 18:42:09 -07:00
Niko Matsakis
dd37c0a41e mask extra borrowck errors (should find out how to not report those) 2012-06-06 18:42:06 -07:00
Niko Matsakis
8ebbf464f5 minor changes to tests so they pass borrowck 2012-06-06 18:37:58 -07:00
Niko Matsakis
e8dfe179da move tstate to dvec 2012-06-06 18:37:55 -07:00
Niko Matsakis
9be612f7ee move resolve to dvec, remove unnecessary mut annotations 2012-06-06 18:37:52 -07:00
Niko Matsakis
594e01d007 add pure, copies to liveness 2012-06-06 18:37:46 -07:00
Niko Matsakis
7d17c2d87f move check_const to dvec 2012-06-06 18:37:43 -07:00
Niko Matsakis
08520a1697 move borrowck to dvec, insert a few minor copies 2012-06-06 18:37:35 -07:00
Niko Matsakis
d9db4f02a4 move to dvec in metadata 2012-06-06 18:37:31 -07:00
Niko Matsakis
4490c99b11 avoid unnecessary by-mut-ref in cargo 2012-06-06 18:37:27 -07:00
Niko Matsakis
22cf4b9ac3 move test to dvec 2012-06-06 18:37:22 -07:00
Niko Matsakis
2adb3a5013 add pure annotations in ast_util 2012-06-06 18:37:18 -07:00
Niko Matsakis
0d20717fab add some purity annotations in dvec/vec, occasional accessor method 2012-06-06 18:37:07 -07:00
Niko Matsakis
45680c83ab borrowck changes: some copies, some removed mut annotations, some dvec 2012-06-06 18:37:04 -07:00
Niko Matsakis
c3b266f50f Rewrite deque to use dvec 2012-06-06 18:36:59 -07:00
Niko Matsakis
b828df93f6 miscellaneous pure annotations and other small changes.
it seems that, to be truly useful, pure fns really need the
ability to modify their parameters.  alternatively, we could
rewrite the functions that modify their arguments to take/return.
2012-06-06 18:36:54 -07:00
Niko Matsakis
3bc42d5661 distinguish by-val passes of pointer and non-pointer things 2012-06-06 18:36:47 -07:00
Niko Matsakis
64c7897187 exempt unsafe ptrs from by-val checks 2012-06-06 18:36:42 -07:00
Niko Matsakis
b61071d953 make lookup fn pure in codemap 2012-06-06 18:36:34 -07:00
Niko Matsakis
83d290f461 add misc. pure modifiers in core 2012-06-06 18:36:29 -07:00
Niko Matsakis
60913bf045 constrain scope of mut ptr to please borrowck 2012-06-06 18:36:27 -07:00
Niko Matsakis
bede54b14a misc. copies in core/syntax to please borrowck 2012-06-06 18:36:15 -07:00
Michael Sullivan
d542e67827 Do some cleanup of the allocation code. 2012-06-06 18:26:47 -07:00
Graydon Hoare
107442d994 Add some testcases for bug #2470. 2012-06-06 18:26:46 -07:00
Brian Anderson
ef32ffd0b1 core: Remove swappable. Unused 2012-06-06 17:48:45 -07:00
Tim Chevalier
db31969d4a prefix an _ to the name of an unused variable 2012-06-06 17:19:39 -07:00
Tim Chevalier
ee8c762bde Change subtypes_require to handle class fields correctly 2012-06-06 16:13:21 -07:00
Graydon Hoare
be83a12ff7 Add some testcases for bug #2470. 2012-06-06 16:01:12 -07:00
Tim Chevalier
32e448e0da Change subtypes_require to handle class fields correctly 2012-06-06 15:45:49 -07:00
Tim Chevalier
a5c9e8d59e Fix tests to avoid empty classes 2012-06-06 15:08:24 -07:00
Tim Chevalier
feece9814a Revert "Revert "Fix test case so the class in it is non-empty" due to test failures"
This reverts commit c6e16c5668.
2012-06-06 15:08:24 -07:00
Tim Chevalier
5e8ef74e22 Revert "Revert "Forbid classes with no fields" due to test failures"
This reverts commit e56a6e8cb0.
2012-06-06 15:08:24 -07:00
Tim Chevalier
a6c92f0a17 Revert "Revert "Merge pull request #2516 from mozilla/incoming" due to failures"
This reverts commit 9fae95860de510f6874810cf43efb83f101246ef.
2012-06-06 15:08:24 -07:00
Lindsey Kuper
cba77ffbfa syntax: More grammatical error message 2012-06-06 14:51:13 -07:00
Tim Chevalier
d5d7b3b921 Merge branch 'master' into really-really-to-snap 2012-06-06 12:47:34 -07:00
Brian Anderson
9975ad073a rustc: Add comments about linking to libm 2012-06-06 12:46:19 -07:00
Jyun-Yan You
b54c76c832 fix link error 2012-06-06 12:45:56 -07:00
Tim Chevalier
0218418428 Merge branch 'master' into really-really-to-snap 2012-06-06 12:22:14 -07:00
Tim Chevalier
704a5a8c68 Register snapshots 2012-06-06 12:21:35 -07:00
Patrick Walton
d64ff98311 Revert "core: Remove swappable. Unused" due to test failures
This reverts commit ec5cbb4f5e.
2012-06-06 11:40:04 -07:00
Patrick Walton
d53e633bd5 Revert "test: Remove swappable-test" due to test failures
This reverts commit aabf84cdd8.
2012-06-06 11:39:52 -07:00
Patrick Walton
055158d051 Revert "Merge pull request #2516 from mozilla/incoming" due to failures
This reverts commit adb717b5fa, reversing
changes made to aabf84cdd8.
2012-06-06 11:39:19 -07:00
Zack Corr
9187406da5 Cargo: Added new source scheme, added sources CLI management, added source dumping 2012-06-06 18:55:44 +10:00
Tim Chevalier
fec3b91a3c In reachability, visit class ctors 2012-06-05 21:17:16 -07:00
Tim Chevalier
17e707cf6d Fix test case so the class in it is non-empty 2012-06-05 21:13:25 -07:00
Tim Chevalier
8fd9986f0f Forbid classes with no fields
Classes with no fields don't really make sense, so forbid them
(just as records with no fields aren't allowed). Closes #2509
2012-06-05 20:47:55 -07:00
Michael Sullivan
167d726183 Get rid of spill_map and associated infrastructure. 2012-06-05 17:33:30 -07:00
Michael Sullivan
868e3f9180 Don't try to keep locals off of the stack. Closes #2408.
There were bugs in the code path for initialization of non-spilled
locals, the code-path is hit approximately never, and mem2reg can do
it for us.
I think this will let us kill spill_map.
2012-06-05 17:33:30 -07:00
Patrick Walton
d9cdddeb5f stdlib: Introduce ord and eq interfaces. Make std::sort::quick_sort3 use them. i=#2348 2012-06-05 17:26:52 -07:00
Patrick Walton
49c6dac47a rustc: Fix some more cyclic imports 2012-06-05 15:50:46 -07:00
Tim Chevalier
8972588583 Dereference classes with dtors only on a field access
A class with a dtor has a different representation (a pair of a bit field
and a pointer to the class itself), and previously, the trans code
was selecting out the second field on any reference to a variable whose
type was a class with a dtor. This turned out to be wrong in the case where
a closure captures a variable with such a type. Changed the code to only
insert the field selection on a class field access.
2012-06-05 15:11:33 -07:00
Tim Chevalier
7daf986aec Port remaining run-fail tests to use classes instead of resources 2012-06-05 15:11:33 -07:00
Tim Chevalier
ebde93861f Allow classes with dtors to be used before declaration
get_item_val could generate an internal compiler error if a class with
a dtor was used before the class itself got translated, because it was
assuming that the dtor's node ID was always in the item_symbols table. Fixed
it to create a new symbol if necessary, and use it subsequently.
2012-06-05 15:11:33 -07:00
Brian Anderson
aabf84cdd8 test: Remove swappable-test 2012-06-05 14:59:43 -07:00
Brian Anderson
ec5cbb4f5e core: Remove swappable. Unused 2012-06-05 14:47:20 -07:00
Brian Anderson
d3c641678e rustc: Put uniques into addrspace 1 2012-06-05 14:03:25 -07:00
Lindsey Kuper
1a3b8fc43c Have "aborting due to previous errors" message show an error count 2012-06-05 10:08:32 -07:00
Brian Anderson
99d6807ee0 rt: Unique allocations have -1 ref count 2012-06-05 00:21:27 -07:00
Brian Anderson
78fe75a741 rt: Fix iaac_init using wrong type and not seeding correctly
This was a result of changing the vector representation to contain
a box header.
2012-06-05 00:21:19 -07:00
Brian Anderson
e04e9488ad Revert "rt: Unique allocations have -1 ref count"
This reverts commit 422aec85d6.
2012-06-04 22:58:15 -07:00
Brian Anderson
422aec85d6 rt: Unique allocations have -1 ref count 2012-06-04 22:45:46 -07:00
Brian Anderson
75e4b8c8e9 syntax: Make span functions take args by copy. Eliminate some copy warnings 2012-06-04 21:57:47 -07:00
Michael Sullivan
e86214830a Make "no implicit copies" diagnostics controllable through lint settings. Closes #2503. 2012-06-04 20:44:58 -07:00
Michael Sullivan
6396e2c3c3 Make vecs implicitly copyable for all of our projects. 2012-06-04 19:53:30 -07:00
Michael Sullivan
01a6c713c3 Make vecs/strs not implicitly copyable by default, but make it configurable. Closes #2450. 2012-06-04 19:53:30 -07:00
Michael Sullivan
a405ff9bf6 Fix lint's handling of multiple warn attributes... 2012-06-04 19:53:30 -07:00
Eric Holk
1e8f501343 Machine types are different from int/uint, etc (Issue #2187) 2012-06-04 19:16:47 -07:00
Graydon Hoare
5f904d278f Shave off one more string append in a rare case. 2012-06-04 19:01:24 -07:00
Patrick Walton
a542258277 Add a test case for previous commit 2012-06-04 18:56:50 -07:00
Patrick Walton
ae6d8d1b4d rustc: Implement optional fat-arrow syntax for alt (transitional change) 2012-06-04 18:35:14 -07:00
Graydon Hoare
7803488a43 Implement stack-only variants of int/uint str conversion and output. 2012-06-04 18:06:59 -07:00
Niko Matsakis
903033bb03 handle fixed-length vecs in borrowck categorization 2012-06-04 16:40:09 -07:00
Michael Sullivan
6d9dd055d1 Get rid of warnings from instantiating typarams with non-implicitly copyable types. 2012-06-04 16:35:32 -07:00
Michael Sullivan
4d5d43beae Warn when invoking polymorphic functions with non copyable types. Closes #2466. 2012-06-04 16:30:41 -07:00
Michael Sullivan
5a4e53487f Heavily rework lint infrastructure. Split it into two passes: one that builds the table and one that does the checks. Build the table early and make session know about it fo reasy use. 2012-06-04 16:08:07 -07:00
Brian Anderson
2d0e7cd272 core: Don't allow radix 1 in uint::to_str 2012-06-04 15:22:40 -07:00
Brian Anderson
6e0085210c core: Make uint::to_str faster 2012-06-04 14:30:57 -07:00
Patrick Walton
70353cdbc4 Move imports around in qquote to avoid another cyclic import 2012-06-04 14:25:36 -07:00
Michael Sullivan
0b6db742e2 Register snapshots 2012-06-04 14:09:53 -07:00
Patrick Walton
3aaef3b9c7 Remove cyclic import * that resolve probably shouldn't have accepted 2012-06-04 13:40:08 -07:00
Niko Matsakis
3c4baf694e better support for classes with polymorphic methods 2012-06-04 11:46:23 -07:00
Michael Sullivan
7213274e57 Make how lint handles unknown warn directives configurable by lint (default to warn). Closes #2480. 2012-06-04 09:54:03 -07:00
Michael Sullivan
9be94f6650 Provide mechanisms to inspect warning settings from outside lint. 2012-06-04 09:54:03 -07:00
Niko Matsakis
01b5777c8b prohibit type parameters in native fns and other minor fixes
trans now can safely assert that it never sees a type param
2012-06-03 20:03:08 -07:00
Brian Anderson
b2ae333917 Merge pull request #2496 from arkaitzj/log_cleanup
Moved log method into logger class better than scheduler
2012-06-03 18:34:59 -07:00
Arkaitz Jimenez
dad3007584 Moved log method into logger class better than scheduler fixes #2495 2012-06-04 01:53:24 +01:00
Brian Anderson
9826541c0e Merge pull request #2492 from tedhorst/mandelbrot_args
fix args to shootout-mandelbrot benchmark
2012-06-03 15:02:16 -07:00
Brian Anderson
35aa8d86e1 rt: Add a FIXME about #2495 2012-06-03 14:47:04 -07:00
Brian Anderson
802a8c0f19 test: Add a test that logs are truncated with ellipses 2012-06-03 14:44:03 -07:00
Arkaitz Jimenez
9a2b240c89 Show ellipsis sign when log line is truncated 2012-06-03 21:06:42 +01:00
Ted Horst
3c4a1ab0c4 fix args to shootout-mandelbrot benchmark 2012-06-03 09:45:23 -05:00
Brian Anderson
9b81dbfef3 cargo: Require hexidecimals in uuids 2012-06-02 23:57:32 -07:00
Brian Anderson
8fbd5ac049 core: Add str::is_alphanumeric fn and method 2012-06-02 23:42:20 -07:00
Brian Anderson
0746190826 cargo: Add test for is_uuid 2012-06-02 23:30:11 -07:00
Brian Anderson
94ac30c498 rt: Improve docs for main, kernel, scheduler, and task 2012-06-02 23:14:47 -07:00
Zack Corr
84fce7a527 Fix cargo to uninstall binaries by name correctly 2012-06-02 20:54:39 -07:00
Zack Corr
3f983ca084 Fix cargo to install from archives correctly 2012-06-02 20:54:39 -07:00
Zack Corr
ce2719a4d9 Correct cargo usage line going over 78 chars 2012-06-02 20:54:39 -07:00
Zack Corr
54b8d5f1ab Cargo revamp: root in home directory, automatic init & sync for first time usage, uninstallation, improved installation usage and other usage changes. Closes #2475. Closes #1353. 2012-06-02 20:54:38 -07:00
Niko Matsakis
3f6e6532ac make vec fns/methods take imm slices.
this also repairs the unsoundness in typing of unpack_slice,
which was silently converting a const ptr to an imm one.
2012-06-02 19:14:57 -07:00
Niko Matsakis
e94683dce9 register new snapshots 2012-06-02 18:56:12 -07:00
Brian Anderson
027e97b129 bench: Add an unwinding benchmark 2012-06-02 17:49:36 -07:00
Brian Anderson
3ab738f4af Add more #fmt float tests 2012-06-02 16:45:20 -07:00
Kevin Cantu
a7359f5b3b (float) fix some rounding errors when showing as str
This seems to fix issue #1876, and some of the superficial parts of
issue #1375.  The #fmt macro and the to_str functions will round,
rather than truncate, floats as strings.

Other issues remain, and I wrote more code here than intended, but the
following should pass now.

```
fn x() {
   assert "3.1416"      == #fmt["%.4f", 3.14159];
   assert "3"           == #fmt["%.0f", 3.14159];
   assert "99"          == #fmt["%.0f", 98.5];
   assert "7.0000"      == #fmt["%.4f", 6.999999999];
   assert "3.141590000" == #fmt["%.9f", 3.14159];
}
```
2012-06-02 16:38:18 -07:00
Lindsey Kuper
7d0755529e Add ty_var_integral (WIP on issue #1425). 2012-06-02 11:19:27 -07:00
Niko Matsakis
77c470d183 Allow rcvrs to be borrowed; check rcvrs in borrowck properly 2012-06-02 10:08:04 -07:00
Niko Matsakis
cfac9b6833 improve borrowck to handle some frankly rather tricky cases
- receivers of method calls are also borrowed
- by-val arguments are also borrowed (needs tests)
- assignment to components can interfere with loans
2012-06-02 10:08:04 -07:00
Niko Matsakis
c5f2c1d61e add some purity annotations in core 2012-06-02 10:08:00 -07:00
Brian Anderson
2a0b6f5fe2 test: xfail-win32 run-pass/companionmod. not sure why it's broke 2012-06-01 21:28:55 -07:00
Tim Chevalier
6e2aa3b998 Port more resource tests to classes 2012-06-01 20:40:35 -07:00
Tim Chevalier
14e3fdea9c Check that classes are instantiable
that is, check that there aren't any mutually recursive cycles between
classes and other types
2012-06-01 20:40:35 -07:00
Tim Chevalier
79787833bb Make sure classes with dtors are still sendable (but not copyable) 2012-06-01 20:40:35 -07:00
Tim Chevalier
475013fcb6 Comment only: fix typo 2012-06-01 20:40:35 -07:00
Tim Chevalier
de40318037 Tests for copyability and sendability rules for classes
Closes #2296
2012-06-01 20:40:35 -07:00
Tim Chevalier
11b4a92fc8 Port another resource test to use classes 2012-06-01 20:40:35 -07:00
Tim Chevalier
facb5c08c6 Enforce rule that classes with dtors aren't copyable
The test for this is copy-a-resource.
2012-06-01 20:40:35 -07:00
Tim Chevalier
b67f8e340b Remove obsolete test
This test no longer makes sense with classes instead of resources,
since class types can't be dereferenced.
2012-06-01 20:40:35 -07:00
Tim Chevalier
f6c552d6d7 Update task-killjoin-rsrc to use classes
This test was xfailed, but I decided to update it to use classes
anyway. The test currently compiles, but fails with a runtime error.
So it's still xfailed.
2012-06-01 20:40:34 -07:00
Tim Chevalier
053db0208b Comment only: fix typo 2012-06-01 20:40:34 -07:00
Tim Chevalier
10c141a232 Port more test cases to use classes instead of resources 2012-06-01 20:40:34 -07:00
Tim Chevalier
bc5cb4deb3 Change type_needs_drop to say that any class w/ a dtor needs a drop
This was preventing dtors from running for class types that didn't
have pointer fields.
2012-06-01 20:40:34 -07:00
Brian Anderson
1e801baa84 Revert "test: xfail-win32 run-pass/cci_borrow.rs"
This reverts commit 30f874bac5.
2012-06-01 18:27:38 -07:00
Brian Anderson
7737c094af Revert "test: xfail-win32 run-pass/cci_capture_clause.rs"
This reverts commit 2ab1b5838b.
2012-06-01 18:27:30 -07:00
Brian Anderson
7335b2a51c compiletest: Add the libaux path to PATH on win32 2012-06-01 18:24:55 -07:00
Michael Sullivan
8f7364b26d Don't try to compute kinds of fictitious types. Indicate a bug instead. 2012-06-01 17:58:40 -07:00
Brian Anderson
2ab1b5838b test: xfail-win32 run-pass/cci_capture_clause.rs 2012-06-01 17:40:14 -07:00
Brian Anderson
30f874bac5 test: xfail-win32 run-pass/cci_borrow.rs 2012-06-01 17:26:01 -07:00
Brian Anderson
7b862a5278 core: Fix handling of 0-padded floats with precision in #fmt 2012-06-01 16:10:37 -07:00
Brian Anderson
630c084da6 test: Move tests with rustc deps into run-pass-fulldeps
These tests require a lot more to be built before running so are not part of
check-lite
2012-06-01 16:01:56 -07:00
Niko Matsakis
dd8f76c619 squelch warnings in tests 2012-06-01 11:10:27 -07:00
Niko Matsakis
6c6ad229a3 break up borrowck into modules and begin to document how it works 2012-06-01 10:50:19 -07:00
Lindsey Kuper
3c622a5b12 Clarifying comments in test. 2012-06-01 10:30:50 -07:00