Commit Graph

1221 Commits

Author SHA1 Message Date
Ben Blum
6cf2f89452 Implement option::unwrap safely...! 2012-08-25 03:07:30 -04:00
Michael Sullivan
1ce7902a41 Add a Buildable interface for constructing general sequences. Work on #2921. 2012-08-24 22:56:05 -07:00
Michael Sullivan
c87e9a5815 Get rid of the unseemly reinterpret_casts in build_sized implementations. Closes #3272. 2012-08-24 22:56:05 -07:00
Tim Chevalier
c7a3d0eb58 Remove one last match check, in send_map 2012-08-24 21:35:35 -07:00
Graydon Hoare
c284b8b1dc Start using core::path2::Path in a lot of places. 2012-08-24 15:51:16 -07:00
Michael Sullivan
b5dd01eb2a Add a bunch more unsafe blocks to prepare for the new semantics of unsafe/closure interactions. 2012-08-24 14:21:26 -07:00
Niko Matsakis
d320848bf7 wrap long line 2012-08-23 18:56:56 -07:00
Niko Matsakis
a08f3a7d4d More complete fix to #3162 (borrowck bug related to access to rec fields) 2012-08-23 18:54:08 -07:00
Patrick Walton
83e7c869bd libcore: Add from_buf_len_nocopy 2012-08-23 18:10:16 -07:00
Ben Blum
dcbeebc801 Make vec::zip not require T:copy (close #3254) 2012-08-23 21:09:57 -04:00
Erick Tryzelaar
bf0ea66dac libcore: update bytes/str reader to work with regions.
This optimizes away a copy.
2012-08-23 17:42:50 -07:00
Tim Chevalier
9f591319dd Rename str::bytes to str::to_bytes
Closes #3245
2012-08-23 15:46:10 -07:00
Ben Blum
c47342e7c2 Convert pipes to new atomic intrinsics 2012-08-23 16:54:25 -04:00
Paul Stansifer
77e83d83a9 Change calls of proto! to use parens. 2012-08-23 11:14:15 -07:00
Paul Stansifer
c74a442e86 Eliminate some extraneous curly brackets inside invocations of macro_rules!. 2012-08-23 11:14:14 -07:00
Paul Stansifer
29f32b4a72 m1!{...} -> m1!(...) 2012-08-23 11:14:14 -07:00
Michael Sullivan
226fd87199 Make a bunch more of the iteration functions/methods marked pure. Closes #3253. 2012-08-23 10:22:33 -07:00
Niko Matsakis
511e7626ae Infer variance of types with respect to the region parameter.
A similar approach could be used for type parameters.

Fixes #2282.
2012-08-23 06:30:43 -07:00
Niko Matsakis
8185ede1fa convert send_map to use explicit self 2012-08-22 21:14:32 -07:00
Ben Blum
fe2566777d Use swap_remove in pipes::select(). Close #3219. 2012-08-22 22:20:42 -04:00
Ben Blum
20773f33f5 Add vec::swap_remove (#3219) 2012-08-22 22:20:42 -04:00
Ben Blum
95bc9d4aef export unwrap_arc functions in core/std 2012-08-22 21:16:35 -04:00
Tim Chevalier
73ffc7e700 Remove match check in send_map 2012-08-22 15:24:33 -07:00
Tim Chevalier
6f77fcbd07 Comments only: update issue number for FIXME 2012-08-22 15:24:33 -07:00
Brian Anderson
48a4bca066 Merge pull request #3251 from fsouza/to_digit_fix
libcore: fix doc for char::to_digit
2012-08-22 15:13:59 -07:00
Brian Anderson
91c652b1ca Merge pull request #3244 from dbp/osbug
core: removing repeated code in os.rs homedir() test
2012-08-22 15:12:53 -07:00
Ben Blum
0e620ac030 Remove one last default argument mode from core::os 2012-08-22 14:10:56 -04:00
Ben Blum
d2e2d97602 Merge pull request #3231 from killerswan/modes1
Remove deprecated modes from os.rs
2012-08-22 10:37:45 -07:00
Francisco Souza
493117dcda libcore: fix doc for char::to_digit
Closes #3249.
2012-08-22 13:51:45 -03:00
Niko Matsakis
907f5b4672 ignore should_fail tests on windows 2012-08-21 20:49:35 -07:00
Niko Matsakis
b5411f765c add tests to manage, fix test breakage I inadvertently introduced 2012-08-21 20:15:22 -07:00
Michael Sullivan
5f32e18011 Make std::arena run destructors. Closes #2831. 2012-08-21 17:03:00 -07:00
Daniel Patterson
6083409f17 core: removing repeated code in os.rs homedir() test 2012-08-21 19:26:32 -04:00
Niko Matsakis
236f833007 remove tab character 2012-08-21 16:08:18 -07:00
Niko Matsakis
bc5eb95222 implement a map testing benchmark
This involved some other changes:
- add a managed<T> wrapper that makes send_map usable from @-data
- implement map<K,V> for managed<send_map>

Unit tests are coming.
2012-08-21 16:07:53 -07:00
Niko Matsakis
182814ef81 remove some FIXMEd code as the relevant issue is fixed 2012-08-21 16:07:53 -07:00
Patrick Walton
9440f8e9b8 libcore: Implement a dup2 2012-08-21 16:01:00 -07:00
Daniel Patterson
8b8e0c2a45 core: switching os::tmpdir() to always return a directory, by defaulting to Windows dir on windows, as per .NET 2012-08-21 15:51:36 -07:00
Daniel Patterson
9bb2963b7e core: adding test for os::tmpdir() 2012-08-21 15:51:36 -07:00
Daniel Patterson
3f1f6bf9e3 core: adding os::tmpdir() that returns a system temporary directory if it can find one, and none otherwise. 2012-08-21 15:51:36 -07:00
Ben Blum
47cca22d54 Bypass lifecycle_lock in inhibit_kill/allow_kill for 3% to 5% speedup. Close #3213. 2012-08-21 18:03:41 -04:00
Ben Blum
0229bc4def Remove fixmes about exporting. Close #2648, close #3119. 2012-08-21 15:30:53 -04:00
Ben Blum
932f239a9c respect distinct anonymous regions in unsafe::transmute_* 2012-08-21 15:30:53 -04:00
Niko Matsakis
652b312122 more sound treatment of fn& regions; change all & to be distinct 2012-08-21 10:28:34 -07:00
Niko Matsakis
8ee79c79aa new region inference, seperate infer into modules, improve error msgs
Fixes #2806
Fixes #3197
Fixes #3138
2012-08-20 22:00:06 -07:00
Ben Blum
bd736a0f9b oops, remove #[cfg(stage1)]s from arc::unwrap functions+tests 2012-08-20 22:00:06 -04:00
Ben Blum
05accaa167 implement arc::unwrap and add exclusive_unwrap tests 2012-08-20 21:51:39 -04:00
Daniel Patterson
62ea688e50 core: adding option::or, a function to return the leftmost of two some() values or none if both are none 2012-08-20 21:29:41 -04:00
Kevin Cantu
77ef394d72 Remove deprecated modes from os.rs 2012-08-20 14:11:37 -07:00
Graydon Hoare
08441fca76 Add PosixPath to path2. Add path2 to core build. Add dot/dotdot-normalizing. 2012-08-20 13:59:47 -07:00
Graydon Hoare
3e52a0acde Initial sketch of path2 module, starting with WindowsPath. 2012-08-17 19:12:08 -07:00
Niko Matsakis
4b1d83ca64 fix deprecated-mode lint warning to consider dtors 2012-08-17 17:31:03 -07:00
Patrick Walton
9ea6b3a32e rustc: Remove a few allocations from metadata. Shaves a few milliseconds off compilation of hello world. 2012-08-17 15:54:18 -07:00
Brian Anderson
3ab4b014cf Remove the class keyword 2012-08-17 10:13:45 -07:00
Ben Blum
0e3825d38c Add option::get_ref 2012-08-16 21:07:55 -04:00
Eric Holk
5f57588887 Update the rock-paper-scissors example in the tutorial, and rename some types in core::pipes 2012-08-16 17:50:36 -07:00
Eric Holk
b2452896d1 Don't use move, because it is less safe than the unsafe move_it macro. 2012-08-16 16:46:20 -07:00
Eric Holk
942649a260 Make wait_many work on selectable types instead.
This should avoid allocation in many select paths.
2012-08-16 16:46:20 -07:00
Brian Anderson
9c6890f488 Convert more core types to camel case 2012-08-15 17:46:05 -07:00
Brian Anderson
913f7bdae7 Modify pipec to not emit calls to some and none 2012-08-15 16:53:41 -07:00
Brian Anderson
74c69e1053 Convert more core types to camel case 2012-08-15 14:14:20 -07:00
Eric Holk
8be0f665bc De-mode pipes 2012-08-15 13:58:08 -07:00
Tim Chevalier
51d98d9c7b Expunge match checks 2012-08-15 12:38:32 -07:00
Ben Blum
00ef5418d4 Change TLS key type to stack closure 2012-08-15 14:38:38 -04:00
Ben Blum
fa8fc4b2b5 Add 1shot pipe chan_one/port_one type aliases and convert std::sync to use them 2012-08-15 13:22:50 -04:00
Ben Blum
a63f85ce8c add some inlines to shared mutable state 2012-08-15 13:22:50 -04:00
Tim Chevalier
fa0e96e0f7 Fix build breakage 2012-08-14 21:13:05 -07:00
Tim Chevalier
ccd36439f7 Make Num::from_int a static method 2012-08-14 20:03:31 -07:00
Brian Anderson
11258310e2 Convert more core types to camel case 2012-08-14 18:26:03 -07:00
Graydon Hoare
c1fad07758 Add a map::str_slice_map constructor to libstd. 2012-08-14 16:45:51 -07:00
Ben Blum
958df4b003 De-mode comm, libc, priv, rt, sync, arc. Super easy. 2012-08-14 19:36:04 -04:00
Ben Blum
4377802202 De-mode task.rs and add some option::foo_ref() helpers 2012-08-14 19:32:52 -04:00
Brian Anderson
4f3aeb4703 Attempt to fix windows bustage 2012-08-14 15:58:21 -07:00
Ben Blum
589ee65fd4 Add rw_arc.downgrade() + std and cfail tests. Tons of region FIXMEs... (cf #2282, #3154) 2012-08-14 17:53:18 -04:00
Graydon Hoare
1795cda1b7 De-mode more pieces of core. 2012-08-14 12:15:00 -07:00
Graydon Hoare
36883186ab De-mode core::future. 2012-08-13 19:08:02 -07:00
Graydon Hoare
bc6eaf2acb More core mode forbidding. 2012-08-13 19:08:02 -07:00
Brian Anderson
5394e34aa4 core: Camel case some lesser-used modules 2012-08-13 18:59:48 -07:00
Brian Anderson
6b43c0c1ad Stop parsing old operator overloading syntax 2012-08-13 18:59:17 -07:00
Graydon Hoare
91612dbb7e De-mode-ify a few minor libcore modules. 2012-08-13 17:11:33 -07:00
Ben Blum
3a403e36d3 Add pipes::oneshot() to wrap pipes::oneshot::init() 2012-08-13 19:45:48 -04:00
Ben Blum
2ac288383d Add pipes::oneshot(), pipes::send_one(), pipes::try_send_one() wrappers. 2012-08-13 19:45:48 -04:00
Eric Holk
8bb5f077c4 Comments describing the packet structures for pipes. 2012-08-13 16:20:23 -07:00
Patrick Walton
5bd4110170 rustc: Mostly implement region-bounded stack closures 2012-08-13 15:34:36 -07:00
Brian Anderson
28cd0ad54b core: Export to_str trait from top level. Closes #3175 2012-08-13 14:58:34 -07:00
Ben Blum
6c4843d9da Add ptr::ref_eq() 2012-08-13 17:18:24 -04:00
Chris Peterson
9470e5d7d5 core: Export f32::ge(), f64::ge(), and float::ge() 2012-08-13 14:03:14 -07:00
Eric Holk
ebe7b0cc37 Remove print 2012-08-10 18:27:48 -07:00
Eric Holk
d2e9d99f81 Handle failure during select nicely. Fixes #3176 2012-08-10 18:19:42 -07:00
Ben Blum
42825fbea6 Split libcore/arc.rs: arc -> std::arc; exclusive -> unsafe::exclusive 2012-08-10 20:53:09 -04:00
Eric Holk
4808d59909 Terminate blocked receive packets on failure. Fixes #3168. 2012-08-10 16:26:22 -07:00
Ben Blum
e1086b0175 Implement sync::rwlock::write_cond (and task::rekillable) 2012-08-09 23:23:18 -04:00
Ben Blum
4c9f168372 Convert sync to the new struct syntax 2012-08-09 23:23:17 -04:00
Ben Blum
758dd786f6 Make rwlocks fail-proof 2012-08-09 22:07:59 -04:00
Niko Matsakis
1b2d91c79d de-mode-ify infer and some parts of typeck
also, fix bug in the various lint passes that fn() was considered
not suitable for the default mode
2012-08-09 18:26:50 -07:00
Ben Blum
bcb6a68cbd sync: Add rwlocks (half-done) and test cases 2012-08-09 20:29:34 -04:00
Ben Blum
be2e4ef624 Allow failing in arc::exclusive; poison to fail subsequent accesses (fix #3092) 2012-08-09 17:22:19 -04:00
Ben Blum
190ecc220a Make sync primitives fail-unwind-friendly 2012-08-09 17:22:19 -04:00
Eric Holk
6a10e3a713 Added oneshot protocol. Fixes #3125 2012-08-09 11:55:17 -07:00
Graydon Hoare
71bc2673ed Fix number-peek code in fmt!, close #1610. 2012-08-08 18:40:30 -07:00
Brian Anderson
6a0720b439 Convert impls to new syntax 2012-08-08 18:19:24 -07:00
Eric Holk
e997948c8a Remove an invalid assert and some commented out code. 2012-08-08 18:03:28 -07:00
Eric Holk
c0874dbd21 Adding try_send for pipes::chan and pipes::shared_chan 2012-08-08 18:03:27 -07:00
Ben Blum
35db5b7be1 Merge pull request #3153 from jruderman/sconv
Add spawn_conversation
2012-08-08 17:05:31 -07:00
Ben Blum
604e4add4a sync: add blocking mutexes, condvars, and testcases 2012-08-08 19:59:38 -04:00
Michael Sullivan
79b5f68176 Implement + for @-vectors. 2012-08-08 14:30:45 -07:00
Jesse Ruderman
a76e4334b3 Add spawn_conversation 2012-08-08 16:57:13 -04:00
Eric Holk
c5fbff01ce Add a really optimistic fast path in receive. Gives about a 7% performance improvement in msgsend-ring-pipes 2012-08-08 10:28:57 -07:00
Ben Blum
64ba7a31cb Touch up semaphores; add another test 2012-08-07 18:57:49 -04:00
Ben Blum
1a6dadad5b fix trailing whitespace 2012-08-07 18:20:02 -04:00
Ben Blum
f2ca54991f Add sync.rs with counting blocking semaphores 2012-08-07 18:18:48 -04:00
Ben Blum
bdbad614ac Remove rust_cond_lock and sys::condition (rename to little_lock) 2012-08-07 18:18:48 -04:00
Brian Anderson
2772b2e5c7 syntax: Make match arm parsing more restrictive again
Require comma separators for all expression types except the plain block
2012-08-07 12:23:43 -07:00
Eric Holk
abf4421e7c Generate try_send versions for all the messages. Fixes #3128 2012-08-07 11:47:12 -07:00
Eric Holk
8d1922d4c8 Add a selectable implementation for *packet_header 2012-08-07 11:47:12 -07:00
Ben Blum
18ac4a8e6d Change task().future_result's argument mode 2012-08-07 14:26:41 -04:00
Ben Blum
ae6d84f573 Rework task::try for new task_builder interface (close #3103) 2012-08-07 14:26:41 -04:00
Ben Blum
0cc6cefaec Add util::ignore 2012-08-07 14:26:41 -04:00
Tim Chevalier
6bd01d0ac8 In resolve, forbid duplicate value, type, and module items
Closes #3099
2012-08-06 16:37:18 -07:00
Brian Anderson
ecaf9e39c9 Convert alt to match. Stop parsing alt 2012-08-06 15:36:30 -07:00
Brian Anderson
74370042aa core: Rename task::osmain to platform_thread. #3090 2012-08-06 14:07:51 -07:00
Eric Holk
4544c015b3 Fill out rust docs for pipes some more. 2012-08-06 13:25:34 -07:00
Eric Holk
9f287c211e Refcount tasks in packets to avoid races.
Revert "Once again, revert "Use pipes in compiletest""

Fixes #3098
2012-08-06 09:10:19 -07:00
Eric Holk
86947e47ad More documentation on pipes, and moving assert in runtime. 2012-08-06 09:07:40 -07:00
Brian Anderson
025d86624d Switch alts to use arrows 2012-08-05 22:08:09 -07:00
Ben Blum
0c623c4474 Document arc::exclusive. 2012-08-03 17:50:59 -04:00
Eric Holk
749a184a06 Fix a failing string test. 2012-08-03 12:04:19 -07:00
Eric Holk
01ca0d1f68 Be more defensive in pipes (#3098) 2012-08-03 12:04:18 -07:00
Tim Chevalier
948172b93f Make comparisons between region pointers work
Region pointers were considered a scalar type, so compare_scalar_type would
get called to compare region pointers in trans. This would fail, since
compare_scalar_type has no case for region pointers.

Changed type_is_scalar to return false for region pointers. This had the side
effect of breaking casts to types of the form &T. To ameliorate that, I added
library functions ptr::assimilate (taking a &T to a *T) and ptr::to_uint
(taking a &T to a uint), both of which use reinterpret_cast.

While I was at it, I removed ty::type_has_resources, which is dead code.
2012-08-02 23:53:45 -07:00
Niko Matsakis
31c5cec55b Purge placement new; Make borrowck know about unary move.
cc #3071
2012-08-02 22:36:36 -07:00
Eric Holk
bd195518c7 Fix an apparent race in pipes.
Also removed some unsafety in pipes and added vec::consume_mut.
2012-08-02 19:27:07 -07:00
Eric Holk
110ff312df Give better error messages when port_set.recv fails. 2012-08-02 19:27:07 -07:00
Graydon Hoare
4779d2b392 De-duplicate core::hash some, refactor the traits. 2012-08-02 18:06:33 -07:00
Graydon Hoare
009352101d Shift writer_util to a derived impl attached to the writer trait 2012-08-02 18:06:33 -07:00
Graydon Hoare
b14a6aca9f Cleanups in the int and uint templates. 2012-08-02 18:06:33 -07:00
Niko Matsakis
97452c0ca1 Remove modes from map API and replace with regions.
API is (for now) mostly by value, there are options to use it by
reference if you like.  Hash and equality functions must be pure
and by reference (forward looking to the day when something
like send_map becomes the standard map).
2012-08-02 15:53:28 -07:00
Ben Blum
b1784673b1 Clean up task.rs docs and use replace/swap_unwrap 2012-08-02 14:59:37 -04:00
Ben Blum
9facb15c49 option::swap_unwrap, the ubiquitous 'option dance'. 2012-08-02 14:59:37 -04:00
Ben Blum
63b70b2370 Remove std::util 2012-08-02 14:31:58 -04:00
Ben Blum
7d9c61a9fb Linked failure touchups (#1868) 2012-08-01 23:39:44 -04:00
Ben Blum
ac0c8b0823 Linked failure: add ASCII art. Close #1868. 2012-08-01 23:08:06 -04:00
Ben Blum
7cb3f3e86a Linked failure: enable unidirectional propagate test; replace FIXMEs with comments (tag #1868). 2012-08-01 23:08:06 -04:00
Ben Blum
43b8114750 Linked failure: Rewrite to use ancestor_list and send_map for proper-propagation. (tag #3068, #2190, #1868) 2012-08-01 23:08:01 -04:00
Brian Anderson
b355936b4d Convert ret to return 2012-08-01 19:16:06 -07:00
Brian Anderson
dc499f193e Merge pull request #3077 from erickt/incoming
core: change vec's ref_set to set_ref, move get_ref to unsafe::get.
2012-08-01 18:42:57 -07:00
Ben Blum
fd17d347b0 core.rc export core::util 2012-08-01 19:12:23 -04:00
Ben Blum
90ce3d94e4 Add core::util, with swap, replace, and noncopyable 2012-08-01 19:07:28 -04:00
Ben Blum
6fdd1ef9b1 send_map - fix size bug; add is_empty and test case for same 2012-08-01 19:07:28 -04:00
Ben Blum
0c3158b3a5 core::arc - add an assert 2012-08-01 19:07:28 -04:00
Graydon Hoare
7f60c56c3e Clean out transitional lint. 2012-08-01 13:35:40 -07:00
Erick Tryzelaar
71927615e0 core: change vec's ref_set to set_ref, move get_ref to unsafe::get. 2012-08-01 12:37:13 -07:00
Eric Holk
e7a69fbe4e Working on documentation of pipes. 2012-08-01 12:30:07 -07:00
Patrick Walton
b414db041b rustc: Parse by-reference pattern bindings with the "ref" keyword 2012-07-31 19:26:25 -07:00
Patrick Walton
c88933d714 rustc: Implement unary move. Closes #917. 2012-07-31 17:33:20 -07:00
Brian Anderson
c4bb8f8aaf test: Move two tests from run-pass into the libs 2012-07-31 17:30:54 -07:00
Brian Anderson
7b2026bf21 Introduce 'return', 'match' and 'module' as synonyms 2012-07-31 17:22:30 -07:00
Ben Blum
a89ed49d3d Add hash tests: idempotent, no_bytes_dropped. 2012-07-31 18:32:58 -04:00
Ben Blum
513557b465 Add hash uint tests 2012-07-31 18:18:45 -04:00
Ben Blum
77efd389dc Add hash_u64, hash_u32, hash_uint. 2012-07-31 18:11:08 -04:00
Ben Blum
ea568f38ff send_map: each -> each_ref, and add each* copying versions; add 'iterate' test 2012-07-31 17:47:19 -04:00
Ben Blum
8e7fb8e8f5 Add send_map::each{,_key,_value} 2012-07-31 17:02:44 -04:00
Lindsey Kuper
439afaa329 Change remaining "iface" occurrences to "trait"; deprecate "iface" 2012-07-31 11:52:16 -07:00
Ben Blum
e7d26a4917 make option::map_default<T,U> instead of U:copy 2012-07-31 13:22:32 -04:00
Paul Stansifer
a9cc5066ee Change syntax extension syntax: #m[...] -> m!{...}. 2012-07-30 18:38:15 -07:00
Michael Sullivan
68e9aa5fcb Make at_vec push functions more like the current vec ones. 2012-07-30 11:29:24 -07:00
Ben Blum
52ed570f1c Move send_map to libcore 2012-07-30 13:56:14 -04:00
Damian Gryski
04f2073bea core::hash -- add a hash::streaming interface and associated siphash implementation. 2012-07-30 10:46:01 -07:00
Tim Chevalier
6ac86e92fe Make uint::iterate pure 2012-07-29 18:39:15 -07:00
Brian Anderson
e178999833 core: More magic to make core build with --test 2012-07-28 16:06:25 -07:00
Brian Anderson
2df03bfdca core: Correct exports of intrinsic ops 2012-07-28 16:06:25 -07:00
Brian Anderson
dfbe6976c2 core: Fix compilation of intrinsic ops when testing 2012-07-28 16:06:25 -07:00
Ben Blum
5312704904 Fix too-large constants in linked failure tests for happier valgrinding 2012-07-28 04:23:18 -04:00
Patrick Walton
93c2f5e0e4 rustc: Use coherence for operator overloading.
The only use of the old-style impls is now placement new.
2012-07-27 19:35:24 -07:00
Brian Anderson
2407373fa4 core: Make #fmt pure 2012-07-27 15:11:22 -07:00
Patrick Walton
01e2471cb7 core: Trait-ify various overloaded operators 2012-07-27 14:52:46 -07:00
Ben Blum
9258053b5c Undo dlist's destructor-involving type structure in light of #3039 2012-07-26 21:20:02 -04:00
Ben Blum
73ca5603bd (comments only) Mention unsafe TLS destructor use (#3039) 2012-07-26 21:20:02 -04:00
Eric Holk
79f5d62d47 Added .peek for recv_packets 2012-07-26 17:10:48 -07:00
Graydon Hoare
dbbaa50290 Nomenclature fixes in the lint checker. Fewer double-negatives.
New style is allow(foo), warn(foo), deny(foo) and forbid(foo),
mirrored by -A foo, -W foo, -D foo and -F foo on command line.

These replace -W no-foo, -W foo, -W err-foo, respectively.

Forbid is new, and means "deny, and you can't override it".
2012-07-26 17:08:33 -07:00
Tim Chevalier
c60a6b93fb Remove superfluous rets (purely style) 2012-07-26 17:06:09 -07:00
Damian Gryski
cdd052f6ea core::io::writer : add get_type() method
The get_type() method can hint to users what kind of item might be
   under the hood.
2012-07-26 17:05:13 -07:00
Paul Stansifer
872ef0f312 Merge branch 'incoming' of github.com:mozilla/rust 2012-07-26 16:32:15 -07:00
Ben Blum
2fc2e2d5ea Add issue number #3039 to dlist destructor 2012-07-26 19:31:50 -04:00
Paul Stansifer
97422f0f0f Merge branch 'incoming' of github.com:mozilla/rust 2012-07-26 16:16:28 -07:00
Ben Blum
5cf99c585a dlist pop needs copy after all (#3024) 2012-07-26 18:20:38 -04:00
Ben Blum
de48b7d4c4 dlist: cleanup a little; pretend to implement "cycle-collecting" destructor 2012-07-26 18:20:38 -04:00
Patrick Walton
1dd8acd56a core: Mark a bunch of numeric functions as pure 2012-07-26 14:43:44 -07:00
Eric Holk
0a8b794a3a Add #[inline(never)], and also fixed inlining on vec::push 2012-07-26 11:37:57 -07:00
Paul Stansifer
f4c093c4af Change #macro to macro_rules! in some cases. 2012-07-26 10:14:01 -07:00
Patrick Walton
10d8a68791 libcore: Add missing ops.rs 2012-07-25 19:03:55 -07:00
Patrick Walton
da80bd17c3 rustc: Introduce a lang_items pass, part of coherence and operator overloading.
This will also help us remove kinds.
2012-07-25 18:37:03 -07:00
Eric Holk
3aee39a6ec Add #[inline(never)], and also fixed inlining on vec::push 2012-07-25 17:30:13 -07:00
Graydon Hoare
f8dc9283ad Reject non-UTF-8 files when reading as str. Close #2918. 2012-07-25 15:34:18 -07:00
Eric Holk
62d4f8fe82 Added a select2 trait. Fixes #2898 2012-07-25 15:15:46 -07:00
Eric Holk
531ea695f6 Remove shared_arc (unused) and fix trivial-message 2012-07-25 15:15:46 -07:00
Eric Holk
08a77e06a8 Rewrite task-comm-NN to use pipes 2012-07-25 15:15:46 -07:00
Ben Blum
4378e7ead1 Fix os::env race (#2870) 2012-07-25 18:03:00 -04:00
Eric Holk
1dde5e7fc2 Thread spans through the pipe compiler. They aren't perfect, but they make debugging far easier than core.rc:0:0.
Changed the is_bounded check, so we fail compiling core right now due to not supporting type parameters.
2012-07-25 12:12:25 -07:00
Eric Holk
7ecddb2771 More purity to make it easier to borrow strings in format strings. 2012-07-25 12:12:25 -07:00
Eric Holk
f5be06fa1f Added infrastructure to spin for a bit on recv. A spin count > 0 makes bench/pingpong.rs about 10x faster, but makes msgsend-ring-pipes unbearably slow. 2012-07-25 12:12:25 -07:00
Eric Holk
35576168dc Added a benchmark of bounded vs unbounded. Bounded is 8-12% faster. The macros currently don't work without pretty printing first. 2012-07-25 12:12:25 -07:00
Eric Holk
7f5f1f90a0 Compiled a bounded version of pingpong.
There are some failures in the other pipe tests, but these seem to just be a matter of generalizing the library code.

Updating pipes library so all tests pass again
2012-07-25 12:12:25 -07:00
Eric Holk
c28af26258 Refactor the bounded pingpong example to avoid needing to generate unsafe code.
Took some steps towards bounded codegen.
2012-07-25 12:12:25 -07:00
Eric Holk
88877effa8 Allow logging slices 2012-07-25 12:12:25 -07:00
Eric Holk
4f29814f2a Hand-written bounded pingpong implementation. 2012-07-25 12:12:25 -07:00
Eric Holk
d74fb9875b Refactoring pipes to allow implementing bounded protocols. 2012-07-25 12:12:25 -07:00
Eric Holk
6535da8417 Tighten pipe exports, and refactor traits. 2012-07-25 12:12:25 -07:00
Ben Blum
d9e8efca19 Handle notification channels in task.rs 2012-07-25 13:22:43 -04:00
Niko Matsakis
3bcd973419 from_fn and ref_set do not require copy bound 2012-07-25 05:45:52 -07:00
Niko Matsakis
f061560ce4 range() is pure 2012-07-25 05:45:52 -07:00
Ben Blum
a038d272b0 rust_cond_lock acquire/release should be inside the atomically { .. } 2012-07-24 20:28:30 -04:00
Ben Blum
bb5db3bc8a Add 2-degree familial relations linked failure tests & fix secondborn behaviour 2012-07-24 20:21:20 -04:00
Graydon Hoare
fada46c421 Add core::hash containing SipHash-2-4 implementation. Re: #1616 and #859. 2012-07-24 17:11:13 -07:00
Ben Blum
695ab09899 Change yield() and wait_event() to be MUST_CHECK and return the killed flag. (closes #2875) 2012-07-24 18:24:24 -04:00
Ben Blum
f42a5a1acd Remove unsupervise 2012-07-24 17:31:43 -04:00
Ben Blum
c0abe69993 task.rs remove old builder interface 2012-07-24 17:27:34 -04:00
Ben Blum
be3a71a1aa Add option::unwrap_expect 2012-07-24 17:27:34 -04:00
Graydon Hoare
160ffb0c2f Fix more windows breakage. 2012-07-24 14:08:34 -07:00
Graydon Hoare
b91da0945d Fix windows breakage. 2012-07-24 13:55:27 -07:00
Graydon Hoare
539a160bb7 Merge pull request #3003 from elliottslaughter/free-cant-fail
Don't emit invoke instructions inside landing pads.
2012-07-24 13:49:24 -07:00
Graydon Hoare
a63e0e47f0 Update some str functions to slices, merge as_buf and unpack_slice. 2012-07-24 12:35:52 -07:00
Ben Blum
ae094a7adc Add 'do atomically { .. }' for exclusives 2012-07-24 15:28:35 -04:00
Elliott Slaughter
c341eb9052 Don't emit invoke instructions inside landing pads.
We can't throw an exception from inside a landing pad without
corrupting the exception handler, so we have no hope of dealing with
these exceptions anyway. See:

http://llvm.org/docs/ExceptionHandling.html#cleanups

Part of #2861.
2012-07-24 12:20:39 -07:00
Paul Stansifer
1c472564e3 Add 5.timesi() |idx| { ... } 2012-07-24 11:44:58 -07:00
Ted Horst
78fa02106e call task::yield in comm::peek 2012-07-23 17:51:10 -07:00
Erick Tryzelaar
06ac0c2b1d Switch reader to work with preallocated vecs
This closes #2901.
2012-07-23 17:15:30 -07:00
Erick Tryzelaar
66ebdbb283 libcore: whitespace cleanup. 2012-07-23 17:15:30 -07:00
Erick Tryzelaar
971b59106a libcore: add vec memcpy and memmove fns 2012-07-23 17:15:30 -07:00
Erick Tryzelaar
9d4aab80a7 libcore: add vec::{mut_view, const_view}. 2012-07-23 17:15:30 -07:00
Erick Tryzelaar
a762c725b5 libcore: Modernize a docstring 2012-07-23 17:15:30 -07:00
Ben Blum
e0e9e451e7 Convert os/priv/uv to new task_builder interface 2012-07-23 20:09:17 -04:00
Ben Blum
c7a6a66e4b Get rid of task::future_task 2012-07-23 20:09:17 -04:00
Ben Blum
e6efb24f3f Add task::task_builder interface for improved spawning (related #2585) 2012-07-23 20:09:16 -04:00
Ben Blum
d0fb85359a Add task::spawn_unlinked and start migrating away from task::unsupervise 2012-07-23 16:06:29 -04:00
Ben Blum
6e21b5fd22 remove unneeded export local_data in task.rs (#2945) 2012-07-23 16:06:29 -04:00
Elliott Slaughter
d257382863 Moved malloc and free upcalls into rust runtime. 2012-07-23 10:45:58 -07:00
Elliott Slaughter
de82a9be61 Move fail upcall into rust libcore. 2012-07-23 10:45:58 -07:00
Ben Blum
d1e3e62300 *Properly* ignore the hanging linked failure test 2012-07-20 15:45:09 -04:00
Ben Blum
07bb1aefc9 task.rs rename supervise to linked internally 2012-07-20 14:32:18 -04:00
Tim Chevalier
ed62f441e9 Merge pull request #2939 from jld/randomfloat
Prevent random floats from occasionally being greater than 1.
2012-07-19 17:16:11 -07:00
Graydon Hoare
1e13626caa Switch io::print and io::println to take slices. 2012-07-19 14:37:27 -07:00
Ben Blum
569af8aa28 Add bonus linked failure test, #[ignore]d 2012-07-19 16:44:29 -04:00
Ben Blum
22f492ab09 Linked failure: add {un,}linked {un,}parented fail-{up,down} tests. 2012-07-18 21:57:56 -04:00
Ben Blum
20831d394a Linked failure: unidirectional failure with parented() (soon to be renamed) 2012-07-18 21:57:56 -04:00
Ben Blum
c936ae515b Linked failure: Make joining a taskgroup O(1) 2012-07-18 17:07:35 -04:00
Niko Matsakis
e0ea67a2a6 prevent regions from escaping in ifaces; remove &r.T syntax 2012-07-18 11:48:58 -07:00
Niko Matsakis
eb0a34c398 iterate only over immutable vectors; use newer region notation
Unfortunately, right now iterating over const vectors is
not safe.  This is because the callback expects an *immutable*
reference (in region terms: &T), not a const reference (&const T).
This was not being caught by the type system due to the use of
unsafe operations.  To fix this, we need to either (1) find a way
to parameterize over mutability or (2) add each_const, each_mut
etc
2012-07-18 11:48:58 -07:00
Michael Sullivan
7f3bbd57c0 Make task.rs export local_data. This is a hack to work around #2945. 2012-07-18 11:01:45 -07:00
Eric Holk
7b8171ef2d Added liveness analysis for protocols, and removed warnings about empty states. 2012-07-17 17:46:31 -07:00
Ben Blum
4cf6b4d3b4 Tasks should not hold a ref to their parent (Close #1789) 2012-07-17 20:45:07 -04:00