Brian Anderson
d261bb32d9
core: More tweaks to the thread-local scheduler interface
2013-04-19 12:05:18 -07:00
Brian Anderson
15ece0c23e
core: Wire up spawn
to the new scheduler
...
It will check which scheduler it is running under and create the
correct type of task as appropriate. Most options aren't supported
but basic spawning works.
2013-04-19 12:05:18 -07:00
Brian Anderson
6773b63671
core: Don't use managed boxes in TaskBuilder
2013-04-19 12:05:18 -07:00
Brian Anderson
b96765179e
core: Add rt::context for figuring out what runtime services are available
...
Conflicts:
src/libcore/rt/sched/mod.rs
2013-04-19 12:05:18 -07:00
Brian Anderson
c44d7a6486
core::rt: Declare large parts of the I/O API
2013-04-19 12:05:18 -07:00
bors
10e6869a54
auto merge of #5955 : thestinger/rust/iterator, r=graydon
2013-04-19 09:48:50 -07:00
Daniel Micay
a2e5350284
iterator: add a bit of documentation
2013-04-19 12:42:59 -04:00
Daniel Micay
1d81b7b286
iterator: add a chain adaptor
2013-04-19 11:50:50 -04:00
Huon Wilson
90313b789c
libcore: add an UnfoldrIterator like Haskell's unfoldr
2013-04-19 10:37:15 -04:00
Daniel Micay
d7a2ae6c42
re-organize the iterator module a bit
2013-04-19 09:18:22 -04:00
Daniel Micay
ae1c9ebf3c
move iterator adaptor tests to iterator module
2013-04-19 09:01:40 -04:00
Huon Wilson
8ae6b33ed0
libcore: clarify documentation for char_at(_reverse)
2013-04-19 22:30:49 +10:00
Daniel Micay
962a753890
takewhile -> take_while, dropwhile -> skip_while
2013-04-19 07:28:51 -04:00
Daniel Micay
0f85cf180a
iterator: add skip and take
2013-04-19 07:22:20 -04:00
bors
9618e5b459
auto merge of #5938 : thestinger/rust/iterator, r=pcwalton
2013-04-18 18:51:49 -07:00
Brian Anderson
decd3901d5
core::comm: Modernize constructors to use new
2013-04-18 14:07:35 -07:00
Brian Anderson
bc60d84507
core::pipes: Just reordering declarations
2013-04-18 14:07:35 -07:00
Brian Anderson
0617d580e6
core::comm: Remove functions in favor of methods
...
`send`, etc. are never used. I've left the functions for oneshot pipes
because by-value methods don't work.
2013-04-18 14:07:35 -07:00
Brian Anderson
4e22461cd8
core: Remove a stray #[doc(hidden)] attribute
2013-04-18 14:07:35 -07:00
Brian Anderson
056164ac19
core: Inline the protocol definitions of sendp and oneshot
...
I want to be able to see what is going on
2013-04-18 14:07:35 -07:00
Brian Anderson
3dce936753
core: Remove #[doc(hidden)] attributes and atomic wrapper functions from pipes
...
Neither are needed
2013-04-18 14:07:35 -07:00
Brian Anderson
8f2d21dc0d
core: Just reordering some code
2013-04-18 14:07:35 -07:00
Brian Anderson
ab08b4fbfd
core: Remove pipes::spawn_service, spawn_service_recv
...
These are only used in test cases; pipes isn't the right place for them;
they are unnecessary.
Conflicts:
src/libcore/rt/uv/mod.rs
2013-04-18 14:07:35 -07:00
Daniel Micay
a523abd75c
add dropwhile and takewhile iterators
2013-04-18 13:22:38 -04:00
bors
8796c9fe2d
auto merge of #5935 : bjz/rust/master, r=thestinger
2013-04-18 09:03:55 -07:00
Brendan Zabarauskas
a7f6ec8542
Use assert_eq! instead of assert! and remove extraneous parentheses
2013-04-19 01:37:21 +10:00
bors
e4f35a7326
auto merge of #5933 : huonw/rust/core-read-until-byte, r=thestinger
...
`read_until` is just doing a bytewise comparison. This means the following program prints `xyå12`, not `xy`, which it should if it was actually checking chars.
```rust
fn main() {
do io::with_str_reader("xyå12") |r| {
io::println(r.read_until('å', false));
}
}
```
This patch makes the type of read_until match what it is actually doing.
2013-04-18 08:09:55 -07:00
bors
24fb719b8c
auto merge of #5932 : huonw/rust/core-str-iterator, r=thestinger
2013-04-18 07:12:55 -07:00
Huon Wilson
19cc352302
core: io: the read_until function checks bytes not chars, so type should reflect that.
2013-04-18 23:36:38 +10:00
Brendan Zabarauskas
939a97f5cb
Add #[inline(always)] to each operator method
2013-04-18 23:24:24 +10:00
Huon Wilson
c967f2bb1e
core: add a str iterator
2013-04-18 22:56:21 +10:00
bors
bd75463839
auto merge of #5928 : huonw/rust/core-task-spawn-supervised-doc, r=thestinger
...
The doc-comment didn't reflect the [tasks tutorial](http://static.rust-lang.org/doc/tutorial-tasks.html#failure-modes ), or how it works in practice.
2013-04-18 04:30:54 -07:00
Brendan Zabarauskas
d2a81b95c3
Implement bitwise operator traits for ints and uints
2013-04-18 20:58:58 +10:00
Huon Wilson
f43fc5fff8
libcore: make spawn_supervised documentation reflect its behaviour.
2013-04-18 20:46:23 +10:00
Huon Wilson
0ff568a3c1
libcore: add an EnumerateIterator, like Python's enumerate
.
2013-04-18 20:37:27 +10:00
bors
d32d4d1209
auto merge of #5923 : thestinger/rust/iterator, r=graydon
2013-04-18 01:36:53 -07:00
bors
d4daee453c
auto merge of #5918 : catamorphism/rust/Warnings, r=catamorphism
2013-04-17 23:45:57 -07:00
bors
3b48063373
auto merge of #5912 : Dretch/rust/issue-2626, r=graydon
...
which does currently seem to work on win32 (and linux).
Just mentioning issue #2626 again to make sure github picks it up.
2013-04-17 21:39:56 -07:00
bors
16652c9c17
auto merge of #5909 : brson/rust/rt4, r=graydon
...
This is just a bunch of minor changes and simplifications to the structure of core::rt. It makes ownership of the ~Scheduler more strict (though it is still mutably aliased sometimes), turns the scheduler cleanup_jobs vector into just a single job, shunts the thread-local scheduler code off to its own file.
2013-04-17 20:42:58 -07:00
Daniel Micay
c98f0cb362
vec: add an external iterator
2013-04-17 21:53:23 -04:00
bors
fdb4ef321e
auto merge of #5726 : brson/rust/struct-return, r=brson
...
r? @nikomatsakis
This doesn't completely fix the x86 ABI for structs, but it does fix some cases. On linux, structs appear to be returned correctly now. On windows, structs are only returned by pointer when they are greater than 8 bytes. That scenario works now.
In the case where the struct is less than 8 bytes our generated code looks peculiar. When returning a pair of u16, C packs both variables into %eax to return them. Our generated code though expects to find one of the pair in %ax and the other in %dx. Similar for u8. I haven't looked into it yet.
There appears to also be struct passing problems on linux, where my `extern-pass-TwoU8s` and `extern-pass-TwoU16s` tests are failing.
2013-04-17 18:45:58 -07:00
Brian Anderson
a5ddc00982
rustc: Use an out pointer to return structs in x86 C ABI. #5347
...
This Adds a bunch of tests for passing and returning structs
of various sizes to C. It fixes the struct return rules on unix,
and on windows for structs of size > 8 bytes. Struct passing
on unix for structs under a certain size appears to still be broken.
2013-04-17 15:49:19 -07:00
Tim Chevalier
f86bf0ee6e
Warning police
2013-04-17 13:42:43 -07:00
gareth
caffe127c7
Fix issue 2626 by un-ignoring the mysterious test_leaks,
...
which does currently seem to work on win32 (and linux).
2013-04-16 21:23:44 +01:00
Brian Anderson
7bfd0e5035
Merge remote-tracking branch 'brson/sched-cleanup'
...
Conflicts:
src/libcore/rt/sched/mod.rs
2013-04-16 11:23:13 -07:00
Huon Wilson
21723d5bdc
libcore: vec::windowed iterates, not allocates.
2013-04-16 23:07:46 +10:00
bors
76e77af380
auto merge of #5901 : thestinger/rust/iterator, r=sanxiyn
...
Can now use them like `x.transform(|i| i + 3).zip(y.filter(|i| i % 2)`.
2013-04-15 21:03:55 -07:00
Huon Wilson
40e3577b08
libcore: missed an import for a test
2013-04-16 12:04:49 +10:00
Brian Anderson
1f94364aef
core::rt: Clean up some more hacks
2013-04-15 18:56:39 -07:00
Brian Anderson
ed74ac169e
core::rt: Narrow down the unsafety of the thread-local scheduler
...
Only when borrowing the I/O implementation do we need unsafety
2013-04-15 18:54:02 -07:00