Commit Graph

9480 Commits

Author SHA1 Message Date
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
Lindsey Kuper
43eb5f0a2e More tests wrt #2263. 2012-06-01 09:26:48 -07:00
Lindsey Kuper
9a89a7503d Clarify comments in test. 2012-06-01 09:26:48 -07:00
Niko Matsakis
5b40066a47 register snapshots 2012-06-01 05:18:19 -07:00
Brian Anderson
4c8bc19ad2 rt: Refactor task failure to go through rust_task_fail
This is the place to but a breakpoint. We will raise SIGINT here
to break into the debugger.
2012-05-31 23:47:52 -07:00
Michael Sullivan
e47962f6a9 Have lint build up a table of the warning settings on a per item basis for later use. 2012-05-31 19:07:24 -07:00
Michael Sullivan
d1a65da835 Time lint in the driver like every other pass, instead of in lint. 2012-05-31 19:07:24 -07:00
Michael Sullivan
af228711e5 Make lint properly deal with nested items. Closes #2473. 2012-05-31 19:07:24 -07:00
Michael Sullivan
84adcb9806 Rework lint to copy lint mode maps when changing them. 2012-05-31 19:07:24 -07:00
Michael Sullivan
7b02f29d47 Switch lint over to using a smallintmap. 2012-05-31 18:38:42 -07:00
Michael Sullivan
3dfb174793 Remove some dead code from kind checking. 2012-05-31 18:38:42 -07:00
Graydon Hoare
574b3e81e6 Add some convenience helpers to getopts. Close #1837. 2012-05-31 17:02:03 -07:00
Brian Anderson
89aa28289b rustc: Use fewer boxes in typestate 2012-05-31 16:20:58 -07:00
Graydon Hoare
57f399bd63 Implement 2 kinds of char / str escaping. Use in rustc. Close #2306. 2012-05-31 15:32:29 -07:00
Niko Matsakis
c2ce2741a7 allow mutable vectors and so forth to be used as immutable slices 2012-05-31 15:07:09 -07:00
Eric Holk
0470abe1d2 Allow some resources to be considered const. 2012-05-31 13:55:54 -07:00
Eric Holk
3acc3c4d85 Make std::map require const keys. 2012-05-31 13:55:54 -07:00
Lindsey Kuper
f394933641 Allow optional comma before with in FRU. Closes #2463. 2012-05-31 12:20:26 -07:00
Lindsey Kuper
abef5f54c9 syntax: get rid of redundant case 2012-05-31 12:20:25 -07:00
Graydon Hoare
6ef458252b Some fixes to bitv. Close #2342. 2012-05-31 11:38:05 -07:00
Kevin Cantu
1e33612729 Add libsyntax to the Python script for making a snapshot 2012-05-31 11:15:00 -07:00
Kevin Cantu
7dcbaedd32 Rename librustsyntax to libsyntax
Per issue #2418.
2012-05-31 11:15:00 -07:00
Brian Anderson
41b02b7c57 Merge remote-tracking branch 'brson/self-describing-uniques'
Conflicts:
	src/snapshots.txt
2012-05-31 01:26:05 -07:00
Brian Anderson
3a2c92b463 Register snapshots 2012-05-31 01:24:41 -07:00
Brian Anderson
615f532475 test: Update test with current error message
These errors where previously generated by typestate, but there seem to
be other passes that cover this now.
2012-05-31 00:06:10 -07:00
Brian Anderson
5aae184415 Register snapshots 2012-05-30 23:37:57 -07:00
Brian Anderson
151de909c1 rustc: Do less work still in typestate 2012-05-30 23:20:31 -07:00
Brian Anderson
4b7e40d817 rustc: Remove debug logging 2012-05-30 21:23:34 -07:00
Brian Anderson
b16bdd9ed0 rt: Don't zero the unique box header 2012-05-30 21:23:34 -07:00
Brian Anderson
a2bbdd3f52 rt: Remove upcall_shared_malloc/free/realloc 2012-05-30 21:23:34 -07:00
Brian Anderson
80dc2e11a1 rustc: Remove the last use of upcall_shared_malloc 2012-05-30 21:23:34 -07:00
Brian Anderson
70ecfa686a rt: Fix build errors on win 2012-05-30 21:23:34 -07:00
Brian Anderson
3f8223ffc2 rt: Fix vec_from_buf_shared for new vecs 2012-05-30 21:23:34 -07:00
Brian Anderson
ecd4318094 rt: Fix rust_list_files for new vecs 2012-05-30 21:23:34 -07:00
Brian Anderson
54d42c4d74 rustc: Make trans handle self-describing strings 2012-05-30 21:23:34 -07:00
Brian Anderson
1523298bc7 core: Update vec_repr to include the box header 2012-05-30 21:23:34 -07:00
Brian Anderson
09a1b94907 Various changes for self-describing vecs 2012-05-30 21:23:34 -07:00
Brian Anderson
178c5cc4a3 rt: Add yet another allocating upcall
upcall_exchange_malloc_dyn, for allocating unique boxes for types that don't
have a fixed size.
2012-05-30 21:23:34 -07:00
Brian Anderson
c6a23cddfb rustc: Make unique closures use the new unique allocator 2012-05-30 21:23:34 -07:00
Brian Anderson
654f7e3086 rustc: Make unique boxes self-describing 2012-05-30 21:23:34 -07:00
Brian Anderson
45933ca485 rustc: Add some methods for trans for mallocing uniques 2012-05-30 21:23:34 -07:00
Brian Anderson
508ccca014 rt: Add upcall_exchange_malloc/free 2012-05-30 21:23:33 -07:00
Brian Anderson
6d37c90ce6 rustc: Remove tuplify_cbox_ty. Unused 2012-05-30 21:23:33 -07:00
Brian Anderson
02dde781eb rustc: Don't typestate fns that don't have constrained function calls 2012-05-30 17:48:05 -07:00
Brian Anderson
6b4cf00552 test: Add an error pattern to small-negative-indexing 2012-05-30 17:48:05 -07:00
Eric Holk
ad292a8c73 Add xorshift to core::rand, which gave a 3x speedup for graph generation in the bfs code. Also, remove trailing white space. 2012-05-30 17:39:53 -07:00
Eric Holk
09a32aedb5 Remove warnings in std::par. 2012-05-30 17:39:53 -07:00
Eric Holk
58fdbdc4ef Avoid some more copies. 2012-05-30 17:39:53 -07:00
Eric Holk
f0c345841c Added a factory version of par::mapi, which avoids the need for share_arc, and copies arcs between tasks better. 2012-05-30 17:39:53 -07:00
Eric Holk
f05040f17a Use std::deque now that the bugs are fixed. Also, avoid a few copies. 2012-05-30 17:39:53 -07:00
Michael Sullivan
e5757923cd Add a test for that last bug. Oops. 2012-05-30 17:12:50 -07:00
Michael Sullivan
ea8d4d7f17 Properly sign extend array indexes. Closes #2468. 2012-05-30 17:09:52 -07:00
Michael Sullivan
1eebb1fe87 Add a test for the just closed issue #2426. 2012-05-30 16:02:48 -07:00
Michael Sullivan
7fee392de5 Handle differing signedness in constant shifts. Closes #2426. 2012-05-30 15:03:24 -07:00
Eric Holk
ccb54f0ce0 Move par into libstd. Closes #2441. 2012-05-30 12:03:51 -07:00
Eric Holk
f5554db734 Adding xfail-fast, since multi-crate tests don't work on Windows. 2012-05-30 12:03:51 -07:00
Eric Holk
07830612fd Adding a test to make sure CCI works with capture clauses. 2012-05-30 12:03:51 -07:00
Eric Holk
f49b891ce5 Include capture clauses when generating metadata.
This may fix the bug that's blocking Issue #2441.
2012-05-30 12:03:51 -07:00
Eric Holk
6abddca18b Rewriting shared_arc to work around Issue #2444.
Sadly, this exposes another ICE when trying to use the new version with Graph500
2012-05-30 12:03:51 -07:00
Niko Matsakis
dca11e1f99 test our some of the various combinations of fn subtyping 2012-05-30 12:02:01 -07:00
Niko Matsakis
5b8abec92f test for pure fn vs impure fn etc subtyping 2012-05-30 11:56:50 -07:00
Niko Matsakis
6dc4bc517a test for troublesome case where preserve was freeing uninitialized memory 2012-05-30 11:26:15 -07:00
Niko Matsakis
862976c267 avoid modifying variable we are alting over 2012-05-30 11:26:15 -07:00
Niko Matsakis
1f4b3cfc36 zero out alloca for preserving values
conservatively do it always for now
2012-05-30 11:26:15 -07:00
Niko Matsakis
555492e427 port alt to dvec 2012-05-30 11:26:15 -07:00
Niko Matsakis
79b3dedac3 allow for loop bodies 2012-05-30 11:26:15 -07:00
Niko Matsakis
653a1f8781 integrate purity into type 2012-05-30 11:26:15 -07:00
Niko Matsakis
22a10f0e4a refactor region manip. to remove redundancy, get closer to fn subtyping
also: remove "auto-mode-matching" for implemented interfaces, as it
is complex and interacts poorly with classes

cc #2263
2012-05-30 11:04:12 -07:00
Niko Matsakis
e4694ca519 add a test that types w/ def_ids compare just fine to types w/o def_ids
this is not clearly going to work due to monomorphization, which convverts
each enum<T> to a distinct "type" from POV of the shape code
2012-05-30 11:04:12 -07:00
Niko Matsakis
e6b9db0884 refactor region manipulation routines to eliminate duplication
fn subtyping is starting to work, but it's exposing bugs in the
code which checks for iface conformance, which doesn't properly
skolemize the self region
2012-05-30 11:04:12 -07:00
Michael Sullivan
b744f52620 Make heap closures always require a capture clause to capture mutable variables. Closes #2446. 2012-05-30 10:46:22 -07:00
Brian Anderson
736ff34e8a rustc: Move filesearch into metadata mod
It's not that related to metadata, but metadata needs it and it will
probably be useful for doing dynamic loading.
2012-05-29 20:38:49 -07:00
Tim Chevalier
3f3c9caf4d Handle poststates of breaking loops correctly in typestate
The poststate should be one where all predicates are assumed false,
rather than the unchanged prestate.

Closes #2374
2012-05-29 18:22:38 -07:00
Tim Chevalier
b30daa6eef Test case for issue 2380 2012-05-29 17:05:17 -07:00
Tim Chevalier
8d7765be82 Resolve bounds in iface types
Closes #2311
2012-05-29 16:50:21 -07:00
Niko Matsakis
f90228b8a8 make all arguments modes immutable
note: you can still move from copy/move mode args
2012-05-29 16:22:17 -07:00
Niko Matsakis
47375439ed remove useless invocations of universally_quantify_from_sty() in method lookup 2012-05-29 16:20:54 -07:00
Niko Matsakis
37b78b48e3 modify shape code to only emit monomorphized enums (#2444)
this is hacky, but shape code is going away anyway and I didn't
want to invest too much effort into it
2012-05-29 15:12:36 -07:00
Tim Chevalier
ccc7651b48 In reachability, don't ignore nested items
Reachability was considering nested items to be unreachable, which
was causing the bug in #2383. Once I fixed that, I also had to make
impl::make_impl_vtable instantiate methods where necessary, before
calling monomorphic_fn.

Closes #2383
2012-05-29 14:40:35 -07:00
Brian Anderson
730e8e9310 Register snapshots 2012-05-29 14:20:11 -07:00
Michael Sullivan
5d1c29912d Fix an error message to not refer to "block type". Closes #2423. 2012-05-29 12:18:59 -07:00
Michael Sullivan
98766e388e Fix the maximum value of i16. Closes #2462. 2012-05-29 12:18:59 -07:00
Eric Holk
5e35d49a50 Moving the arc tests into arc.rs. 2012-05-29 11:30:10 -07:00
Eric Holk
aa2efc05ea Adding shared_arc to hide some of the tedium of sharing an arc between tasks.
Also added some asserts and logging to trans.

Modified graph500 to use the shared_arc, but this unfortunately doesn't work due to #2444.
2012-05-29 10:43:19 -07:00
Eric Holk
3f0358bc5c Updating comments. 2012-05-29 10:33:04 -07:00
Erick Tryzelaar
7b36d66049 Allow installing arbitrary git cargos 2012-05-28 18:58:01 -07:00
Erick Tryzelaar
68e5d8daa3 Merge pull request #2455 from erickt/master
Fleshing out result methods
2012-05-28 18:27:30 -07:00
Erick Tryzelaar
07db8c8382 Merge pull request #2454 from killerswan/cargo_may2012
(cargo) fixed a package installation bug, cleaned up usage
2012-05-28 18:20:20 -07:00
Kevin Cantu
b7393ecdf2 (cargo) fix old typo for installation to libdir 2012-05-28 17:54:47 -07:00
Graydon Hoare
163b0604dc Re-xfail reflect-visit-type since it crashes check-fast. 2012-05-28 17:03:44 -07:00
Graydon Hoare
e0f0c5c1ab Remove bad Load in make_visit_glue, un-xfail reflect-visit-type.rs. 2012-05-28 13:19:31 -07:00
Erick Tryzelaar
ed5af70a36 std: add json::to_str and json::to_json iface. 2012-05-28 12:14:41 -07:00
Erick Tryzelaar
e45ed323c9 Add methods iter, iter_err, map, map_err to the result type. 2012-05-28 12:03:25 -07:00
Erick Tryzelaar
46173e98ef Rename result::{iter,map,map2} to add _vec suffix
The result module doesn't follow the standard iter/map pattern
that we use in the rest of the library. So to
2012-05-28 12:03:25 -07:00
Benjamin Kircher
360194d282 std: Fix bitv each() method (issue 2363) 2012-05-27 22:08:48 +02:00
Kevin Cantu
1aa0804637 (cargo) added a rough fix for installed exe permissions
Since `os::copy_file` wasn't preserving the executable permissions,
this reverts back to `run::run_program` and `cp` to install
the packages.
2012-05-27 10:48:19 -07:00
Kevin Cantu
50423e9545 (cargo) fixed a package installation bug, cleaned up usage
This fixes a bug where os::copy_file was called with a directory name, and
updates the command line options and usage messages for clarity.
2012-05-27 01:29:04 -07:00
Brian Anderson
2c90d66637 Register snapshots 2012-05-26 17:36:57 -07:00
Brian Anderson
18f4bfd576 bench: Remove task-perf-vector-party. No longer relevant 2012-05-26 16:00:38 -07:00
Brian Anderson
45d0fbf6a1 bench: Increase the difficulty of some benchmarks 2012-05-26 16:00:35 -07:00
Brian Anderson
432c6cbde9 core: Make range follow the for loop protocol 2012-05-26 02:28:00 -07:00
Brian Anderson
5281db2bc2 core: Fix capitalization in docs 2012-05-26 00:16:32 -07:00
Brian Anderson
b4516590e4 core: Add to_str impls for remaining int types 2012-05-25 23:47:02 -07:00
Eric Holk
df83a793d9 In generic word count, use str instead of [u8], and use built in is_alphabetic, etc. functions. 2012-05-25 18:32:18 -07:00
Eric Holk
0c3a128419 Update word-count-generic to latest syntax and un-xfail it. Closes #1740. 2012-05-25 18:32:18 -07:00
Lindsey Kuper
e11742de32 More refactoring on a quest to understand region types. 2012-05-25 17:55:55 -07:00
Niko Matsakis
269bc6fb5c fix warning 2012-05-25 17:14:17 -07:00
Niko Matsakis
98740a59da detect ambig. calls to iface bounds, use transactions
cc #2433
2012-05-25 17:04:05 -07:00
Michael Sullivan
93633ea734 Add an internal notion of 'implicit copyability' and use it to warn when implicitly copying mutable data and some unique data. Closes #2448. 2012-05-25 16:53:34 -07:00
Michael Sullivan
8668d06400 Get rid of many implicit copies as a preliminary to Issue #2448. 2012-05-25 16:39:35 -07:00
Brian Anderson
d89b4c8c61 std: Modify arc to tolerate upcoming change to uniques 2012-05-25 16:22:29 -07:00
Michael Sullivan
174f789e0b Add hack to silence the annoying liveness warning in trans/base.rs. 2012-05-25 15:34:09 -07:00
Michael Sullivan
842f9d8616 Remove from_const hack from vec.rs. 2012-05-25 15:16:17 -07:00
Niko Matsakis
266fdd032b test for issue #2443 2012-05-25 14:37:35 -07:00
Niko Matsakis
9e6a068034 replace last_use with liveness info 2012-05-25 14:37:30 -07:00
Niko Matsakis
62fe587f81 revisit error message; create spill map 2012-05-25 14:37:30 -07:00
Lindsey Kuper
123c5c4315 typeck: cleanup/refactoring 2012-05-25 11:35:42 -07:00
Lindsey Kuper
f7cb7b06d5 typeck: Minor cleanup 2012-05-25 11:35:42 -07:00
Brian Anderson
7c2e981381 std: Don't export get_monitor_task_gl 2012-05-25 11:03:32 -07:00
Brian Anderson
78b664fead std: More iotask cleanup 2012-05-25 11:03:31 -07:00
Brian Anderson
937ef188e3 std: Remove unused iotask field active 2012-05-25 11:03:31 -07:00
Brian Anderson
81b8e20f31 std: Rename uv::hl to uv::iotask. Additional cleanup 2012-05-25 11:03:29 -07:00
Brian Anderson
59262dfc62 std: Move spawn_high_level_loop to uv::hl 2012-05-24 22:52:51 -07:00
Brian Anderson
d4db1beabf std: Separate weakening the I/O task from spawning it 2012-05-24 22:26:30 -07:00
Brian Anderson
95898b4cfc std: Simplify run_high_level_loop further 2012-05-24 22:05:31 -07:00
Brian Anderson
623acaa013 std: Remove unused args from run_high_level_loop 2012-05-24 21:50:35 -07:00
Brian Anderson
444ff687a2 std: Move loop creation into run_high_level_loop 2012-05-24 21:50:35 -07:00
Brian Anderson
2a82a9907f std: Clean up uv_global_loop 2012-05-24 21:50:33 -07:00
Brian Anderson
26ed1e91c8 std: Rename spawn_libuv_weak_task to spawn_high_level_loop 2012-05-24 21:03:30 -07:00
Brian Anderson
06ff3f8b4b std: Use more concise code in uv::hl 2012-05-24 20:31:27 -07:00
Brian Anderson
77bbd72171 std: Remove unused variables 2012-05-24 20:31:27 -07:00
Eric Holk
23fcab927c Updating snapshots.txt 2012-05-24 18:28:10 -07:00
Lindsey Kuper
7e70412711 Some refactoring and WIP on issue #2263. 2012-05-24 16:48:44 -07:00
Lindsey Kuper
ef33c5c9bc Typo fixes in comments. 2012-05-24 16:48:44 -07:00
Brian Anderson
a8c8c8ae28 std: FIXME's and cleanups for uv 2012-05-24 16:42:16 -07:00
Eric Holk
433e4ca5f1 Fixing method call issue in parser. 2012-05-24 15:19:10 -07:00
Eric Holk
8b12892ca2 Convert kinds to strings better for more usable error messages. 2012-05-24 15:06:56 -07:00
Eric Holk
4ffe34cace Updating the comments in kind.rs to better reflect the current state of things. 2012-05-24 15:06:56 -07:00
Eric Holk
8b6bfc96cb Const kind checking. The rules are almost certainly incomplete and unsound... 2012-05-24 15:06:56 -07:00
Eric Holk
d993df74c3 Teach parser and related things to understand const kind bounds. 2012-05-24 15:06:56 -07:00
Eric Holk
30f8555544 Some comments giving some idea how to use these things. 2012-05-24 15:05:39 -07:00
Paul Stansifer
5b72e52e47 Access parse/attrs.rs with an impl. 2012-05-24 14:39:22 -07:00
Paul Stansifer
09652c8f5f Use an impl to access parse/common.rs 2012-05-24 14:39:22 -07:00
Niko Matsakis
ccd8d5573e remove dead assignments 2012-05-24 13:35:57 -07:00
Niko Matsakis
f5c51b0a9c remove initedness checking from typestate, as best I could 2012-05-24 09:52:16 -07:00
Niko Matsakis
0d3811e275 improve liveness so it reports unused vars / dead assignments
doesn't warn about pattern bindings yet though
2012-05-24 09:52:16 -07:00
Niko Matsakis
30b47649ea new liveness pass to supercede last_use / initedness 2012-05-24 09:52:03 -07:00
Niko Matsakis
a3be0b1054 fix classes and parameterized ifaces; remove needless self check
ref #1726, #2434
2012-05-24 06:49:40 -07:00
Niko Matsakis
bd573becf5 change region scope of call arguments, old one was unsound
improve error message to describe kind of deref'd ptr using sigil
2012-05-24 05:19:44 -07:00
Niko Matsakis
c9eb9ee612 rewrite purity check to search through scope chain 2012-05-24 05:19:44 -07:00
Niko Matsakis
6ca6a3b80b rewrite arc to use region & expressions (also making it pass borrowck) 2012-05-24 05:19:44 -07:00
Brian Anderson
4fec4cd8f5 bench: Add hard mode to benchmarks. Activate with RUST_BENCH.
RUST_BENCH is on automatically when running `make perf`
2012-05-23 22:55:41 -07:00
Brian Anderson
2f3cff2806 bench: Remove 99bob benchmarks 2012-05-23 20:29:46 -07:00
Niko Matsakis
58988c3565 changes to get std passing borrowck 2012-05-23 17:25:56 -07:00
Paul Stansifer
4c2bf8e4a7 The parser is represented by a class now. 2012-05-23 16:23:11 -07:00
Paul Stansifer
a16cb376ac Update reserved words for syntax highlighters (vim is still behind, though) 2012-05-23 16:23:11 -07:00
Eric Holk
5f154770e2 Prevent capturing non-copyable things in closures. 2012-05-23 15:46:43 -07:00
Eric Holk
6fa1a084f7 A shareable atomically reference counted pointer wrapper.
Needs more tests to ensure safety, and probably some more work on usability too.
2012-05-23 14:58:16 -07:00
Niko Matsakis
9773a22119 shuffle error messages in borrowck, and prevent it from spewing too many
also, fix a few minor issues it complains about
2012-05-23 12:01:27 -07:00
Brian Anderson
248f8826a9 bench: Reduce constants in std-smallintmap to make it valgrind fast 2012-05-23 11:24:02 -07:00
Eric Holk
8678baab12 Resources are once again not copyable. 2012-05-23 10:27:42 -07:00
Niko Matsakis
b93839408c new test 2012-05-23 06:30:29 -07:00
Niko Matsakis
e0f59e835e modify borrowck to allow arbitrary borrows in pure scopes 2012-05-23 06:30:29 -07:00
Niko Matsakis
00849191ce refactor loan to not return result<> 2012-05-23 06:30:29 -07:00
Niko Matsakis
01a2e99639 prepare for gather to gather up multiple maps 2012-05-23 06:30:29 -07:00
Brian Anderson
d2ec15bcf1 rustc: Eliminate metadata's dependency on util::common 2012-05-23 00:57:07 -07:00
Brian Anderson
f9d0cde19a syntax: Remove one of the two def_id hashers 2012-05-23 00:45:18 -07:00
Brian Anderson
4756556748 rustc: Move new_def_hash to ast_util 2012-05-23 00:43:02 -07:00
Brian Anderson
8ec467d521 std: Update timer for new kind rules 2012-05-22 22:29:17 -07:00
Jeff Olson
92e9e736fa std: high-level libuv-leverage APIs now take a hl_loop as arg (tcp/timer) 2012-05-22 22:29:17 -07:00
Jeff Olson
b0b175214a std: more work on uv tests to endure valgrind's machinations against them
- change port of tcp server test in uv_ll to avoid conflict w/ test in
net::tcp
- a few places the tcp::read fn is used in test w/ a timeout.. suspend
use of the timeout from here on out.
2012-05-22 22:29:17 -07:00
Jeff Olson
c7656f67ad std:: adding tcp::read fn as simple, blocking read operation, akin to write
also: read_future ala write_future .. woooooohooooooooo
2012-05-22 22:29:17 -07:00
Jeff Olson
c2ae062e90 std: adding tcp::write_future for non-block tcp writes, docs cleanup 2012-05-22 22:29:17 -07:00
Jeff Olson
9b10359041 std: several minor cleanups wrt codereview.. see extended comments
* there are a few places where I was experimenting w/ using `alt` in places
where `if`/`else` would've sufficed. don't drink the koolaid!
* I had an unneeded `else` structure (the `if` branch that preceeded
concluded with a `fail` statement.. I added the `fail` later in the dev
cycle for this branch, so I forgot to remove the `else` after doing so)
* consistent wrt `prop_name: value` vs. `prop_name : value` in record decl
and initialization
* change an `alt` exp on an `ip_addr` to actually be exhaustive,
instead of using a catch-all clause
2012-05-22 22:29:17 -07:00
Jeff Olson
7de1a68217 std: add try_parse_addr and change an alt w/ ip_addr::ipv6 to avoid warning 2012-05-22 22:29:17 -07:00
Jeff Olson
bb88f772a4 core: doc/err feedback tweeks for result::unwrap 2012-05-22 22:29:17 -07:00
Jeff Olson
a40f550ed5 std: more docs and some methods for types in net::tcp 2012-05-22 22:29:17 -07:00
Jeff Olson
a4b1e965e2 std: ignoring timer test that seems to be race-failing b/c valgrind
.. this test fails frequently, locally, when ran with the batch of other
global_loop tests running due to how valgrind deals with multithreading
in the test app. not sure what to do, here.
2012-05-22 22:29:17 -07:00
Jeff Olson
6c6a47bf22 std: splitting out tcp server API + tests
- we now have two interfaces for the TCP/IP server/listener workflow,
based on different user approaches surrounding how to deal with the
flow of accept a new tcp connection:

1. the "original" API closely mimics the low-level libuv API, in that we
have an on_connect_cb that the user provides *that is ran on the libuv
thread*. In this callback, the user can accept() a connection, turning it
into a tcp_socket.. of course, before accepting, they have the option
of passing it to a new task, provided they *make the cb block until
the accept is done* .. this is because, in libuv, you have to do the
uv_accept call in the span of that on_connect_cb callback that gets fired
when a new connection comes in. thems the breaks..

I wanted to just get rid of this API, because the general proposition of
users always running code on the libuv thread sounds like an invitation
for many future headaches. the API restriction to have to choose to
immediately accept a connection (and allow the user to block libuv as
needed) isn't too bad for power users who could conceive of circumstances
where they would drop an incoming TCP connection and know what they're
doing, in general.

but as a general API, I thought this was a bit cumbersome, so I ended up
devising..

2. an API that is initiated with a call to `net::tcp::new_listener()` ..
has a similar signature to `net::tcp::listen()`, except that is just
returns an object that sort of behaves like a `comm::port`. Users can
block on the `tcp_conn_port` to receive new connections, either in the
current task or in a new task, depending on which API route they take
(`net::tcp::conn_recv` or `net::tcp::conn_recv_spawn` respectively).. there
is also a `net::tcp::conn_peek` function that will do a peek on the
underlying port to see if there are pending connections.

The main difference, with this API, is that the low-level libuv glue is
going to *accept every connection attempt*, along with the overhead that
that brings. But, this is a much more hassle-free API for 95% of use
cases and will probably be the one that most users will want to reach for.
2012-05-22 22:29:17 -07:00
Jeff Olson
e9c6416df6 std: splitting out tcp server API WIP 2012-05-22 22:29:17 -07:00
Jeff Olson
d02b3dffa4 std: reworking how some net and libuv modules are exported in the rc
.. turns out that, without the export, the modules aren't accessible
outside of the crate, itself. I thought that, by importing some module
into another (nesting it) and exporting from that nested module (which
is, itself, exported from std.rc) that my mod would be in the build
artifact. This doesn't appear to be the case. learning is fun!
2012-05-22 22:29:17 -07:00
Jeff Olson
8769409612 rt: adding rust_uv_* binding for kernel malloc and free'ing :/
I need these in the context of doing various malloc/free operations for
libuv structs that need to live in the heap, because of API workflow
(there's no stack to put them in). This has cropped up several times
when impl'ing the high-level API for things like timers, but I've decided
to take the plunge and use this approach for the net::tcp module.

Technically, this can be avoided by spawning a new
task that contains the needed memory structures on its stack and then
having it block for the duration of the time we need that memory to be
valid (this is what I did in std::timer). Exposing this API provides a
much lower overhead way to address
the issue, albeit with safety concerns. The main mitigation policy should
be to use malloc/free with libuv handles only when the handles, are then
associated with a resource or class-with-dtor. So we have a finite lifetime
for the object and can gaurantee a free(), barring a runtime crash (in
which case you have bigger problems!)
2012-05-22 22:29:16 -07:00
Jeff Olson
733881d852 std: tightening up net::tcp, server/client test done, still has races..
.. going to rework the listen() API to be non-blocking.
2012-05-22 22:29:16 -07:00
Jeff Olson
a4127d3fc6 std: change sig of uv::ll::accept, again. 2012-05-22 22:29:16 -07:00
Jeff Olson
465412aeff std: first-pass at a tcp server API, with a basic (non-robust) test
also whitespace cleanup

.. for now, the test just spins up the server and listens for messages,
echoing them back to an output port. there's a "kill" msg that it will
listen for. need to point the tcp client and server test impls at each
other for a loopback server/client test, like how its done in uv::ll

once ipv6 parse/format lands, i can add another test using the entirely
same codebase, but substituting an ip_addr ipv6 varient for the ipv4
varient used in the existing code

still need some other plumbing to get the client/server tests to work
together.
2012-05-22 22:29:16 -07:00
Jeff Olson
f2fd3bcf17 std: FIXME stub net::ip::ip_addr::ipv6 variant...needs parse/format impl
still need implementation for parsing/output formatting and (perhaps?)
representation (for now, i just followef the ipv4 variant's lead and
am representing it as a tuple of 8x u16).

parsing an ipv6 addr is way more complex than parsing an ipv4 addr, so
i'm putting off an implementation here, for now.

candidate solutions:
- could use getaddrinfo() (exists on both POSIX and windows), but with
incompatible fn signatures.
- libuv has a way to parse an ipv6 string into
a sockaddr_in6, but it also requires a port, so it's probably not aprop
for ip_addr
2012-05-22 22:29:16 -07:00
Jeff Olson
64048d43d6 std: makeing uv::ll::listen/accept use generic params for ptr args
more flexibility..
2012-05-22 22:29:16 -07:00
Jeff Olson
83cca50240 std: change tcp_*_result to use result::result.. flatter! 2012-05-22 22:29:16 -07:00
Jeff Olson
082a95a077 core: add result::unwrap() .. patch from @nmatsakis 2012-05-22 22:29:16 -07:00
Jeff Olson
3d8f7d644b std: no longer return uv::ll::err_data records from net::tcp
they're changed into a net::tcp::tcp_err_data record, for now. once the
scope of possible tcp errors, from libuv, is established ill create an
err type for each one and return those where they might occur
2012-05-22 22:29:16 -07:00
Jeff Olson
565c5d694a std: impl for high-level tcp client/request workflow 2012-05-22 22:29:16 -07:00
Jeff Olson
7e114b200a std: impl of net::tcp::write and make net::tcp::tcp_socket a resource 2012-05-22 22:29:16 -07:00
Jeff Olson
5590dfc857 std: tweak uv::ll::write signature and make it generic/more flexible 2012-05-22 22:29:16 -07:00
Jeff Olson
550b34b782 std: impl for net::tcp::connect 2012-05-22 22:29:15 -07:00
Jeff Olson
bc846ce7e3 std: export net::ip::format_addr 2012-05-22 22:29:15 -07:00
Jeff Olson
08b3048c43 std: misc cleanup for uv::ll
* tweaked the layout of sockaddr_in6 struct in anticipation of future use
* changed several uv:ll fn signatures to use generics and be more flexible
with ptr types they get passed
* add uv_err_data and a help fn to return it.. packages up err_name and
err_msg info from uv_get_last_error() stuff..
2012-05-22 22:29:15 -07:00
Jeff Olson
d99b7bcb2f std: pushing existing code in net.rs -> net_ip.rs and re-import/exporting 2012-05-22 22:29:15 -07:00
Jeff Olson
ffdaf14dd9 initial stab at API for std::net::tcp 2012-05-22 22:29:15 -07:00
Brian Anderson
27427a950a Merge pull request #2430 from mmeyerho/master
Added support for #! comments.  Closes issue 1772.
2012-05-22 20:39:53 -07:00
Tim Chevalier
ed357af980 Convert more resource tests to use classes with dtors
And monomorphize dtors correctly.
2012-05-22 22:12:18 -04:00
Margaret Meyerhofer
4f10c19215 Merge branch 'master' of git://github.com/mozilla/rust 2012-05-22 18:23:32 -07:00