blake2-ppc
310e0b6e92
extra: Use external iterators in bitv implementation
...
Convert some internally used functions to use a external iterators.
Change all uses of remaining internal iterators to use `do` expr
2013-08-01 16:54:22 +02:00
blake2-ppc
dbcb74e247
extra: Replace for
with do { .. }
expr where internal iterators are used
2013-08-01 16:54:22 +02:00
blake2-ppc
b18bd785ec
std: Replace for
with do { .. }
expr where internal iterators are used
2013-08-01 16:54:22 +02:00
blake2-ppc
02bdf90cf6
extra: Use do
instead of for
in extra::iter
2013-08-01 16:54:22 +02:00
bors
fe28ac6891
auto merge of #8164 : brson/rust/noportset, r=pcwalton
...
...haredChan.
2013-08-01 07:46:38 -07:00
Daniel Micay
1fc4db2d08
migrate many for
loops to foreach
2013-08-01 05:34:55 -04:00
Daniel Micay
5f59c46e0f
rc: from_{owned,const} -> from_{send,freeze}
2013-08-01 04:39:00 -04:00
Daniel Micay
dabd476203
make in
and foreach
get treated as keywords
2013-08-01 00:21:13 -04:00
Brian Anderson
05eff5f731
extra: Remove dbg module and rt support code
...
This stuff is ancient, unused, and tied to oldsched
2013-07-31 18:51:57 -07:00
Brian Anderson
ebd14c92f8
std: Remove PortSet. Not supported by new scheduler. Replace uses with SharedChan.
2013-07-31 14:59:49 -07:00
bors
8b7e241e02
auto merge of #8139 : brson/rust/rm-old-task-apis, r=pcwalton
...
This removes a bunch of options from the task builder interface that are irrelevant to the new scheduler and were generally unused anyway. It also bumps the stack size of new scheduler tasks so that there's enough room to run rustc and changes the interface to `Thread` to not implicitly join threads on destruction, but instead require an explicit, and mandatory, call to `join`.
2013-07-31 02:10:24 -07:00
bors
4fbd37d4bd
auto merge of #8135 : dim-an/rust/master, r=pcwalton
...
Fix std::getopt::opts_str
Closes #6492 (std::getopt::opts_str fails for arguments other than the first one).
2013-07-30 22:34:20 -07:00
bors
5633a5363b
auto merge of #8008 : bblum/rust/select, r=brson
...
Main logic in ```Implement select() for new runtime pipes.```. The guts of the ```PortOne::try_recv()``` implementation are now split up across several functions, ```optimistic_check```, ```block_on```, and ```recv_ready```.
There is one weird FIXME I left open here, in the "implement select" commit -- an assertion I couldn't get to work in the receive path, on an invariant that for some reason doesn't hold with ```SharedPort```. Still investigating this.
2013-07-30 18:58:17 -07:00
OGINO Masanori
5ec1d5b69d
FALSE is not 1u8 but 0u8, of cource.
...
Signed-off-by: OGINO Masanori <masanori.ogino@gmail.com>
2013-07-31 07:13:38 +09:00
Brian Anderson
cb9ee7f5be
std: Remove ManualThreads spawn mode
2013-07-30 14:23:45 -07:00
Dmitry Ermolov
ef7e94550c
Fix comment.
2013-07-31 00:08:53 +04:00
Dmitry Ermolov
ed0f014935
Fix opts_str.
...
opt_val doesn't not fail! for missing options.
Closes #6492
2013-07-30 23:26:52 +04:00
Dmitry Ermolov
0ed8713d79
Modify test to expose issue #6492 .
2013-07-30 23:23:19 +04:00
Ben Blum
6b75e92afe
UnsafeArc methods return unsafe pointers, so are not themselves unsafe.
2013-07-30 13:19:26 -04:00
Ben Blum
fa8102ab4a
Unkillable is not unsafe. Close #7832 .
2013-07-30 13:19:25 -04:00
Jordi Boggiano
f7ebab4403
Do not enforce two newlines after the options
2013-07-30 18:40:01 +02:00
bors
576f395ddf
auto merge of #8121 : thestinger/rust/offset, r=alexcrichton
...
Closes #8118 , #7136
~~~rust
extern mod extra;
use std::vec;
use std::ptr;
fn bench_from_elem(b: &mut extra::test::BenchHarness) {
do b.iter {
let v: ~[u8] = vec::from_elem(1024, 0u8);
}
}
fn bench_set_memory(b: &mut extra::test::BenchHarness) {
do b.iter {
let mut v: ~[u8] = vec::with_capacity(1024);
unsafe {
let vp = vec::raw::to_mut_ptr(v);
ptr::set_memory(vp, 0, 1024);
vec::raw::set_len(&mut v, 1024);
}
}
}
fn bench_vec_repeat(b: &mut extra::test::BenchHarness) {
do b.iter {
let v: ~[u8] = ~[0u8, ..1024];
}
}
~~~
Before:
test bench_from_elem ... bench: 415 ns/iter (+/- 17)
test bench_set_memory ... bench: 85 ns/iter (+/- 4)
test bench_vec_repeat ... bench: 83 ns/iter (+/- 3)
After:
test bench_from_elem ... bench: 84 ns/iter (+/- 2)
test bench_set_memory ... bench: 84 ns/iter (+/- 5)
test bench_vec_repeat ... bench: 84 ns/iter (+/- 3)
2013-07-30 07:01:19 -07:00
Marvin Löbel
e33fca9ffe
Added str::char_offset_iter() and str::rev_char_offset_iter()
...
Renamed bytes_iter to byte_iter to match other iterators
Refactored str Iterators to use DoubleEnded Iterators and typedefs instead of wrapper structs
Reordered the Iterator section
Whitespace fixup
Moved clunky `each_split_within` function to the one place in the tree where it's actually needed
Replaced all block doccomments in str with line doccomments
2013-07-30 12:55:48 +02:00
Daniel Micay
ef870d37a5
implement pointer arithmetic with GEP
...
Closes #8118 , #7136
~~~rust
extern mod extra;
use std::vec;
use std::ptr;
fn bench_from_elem(b: &mut extra::test::BenchHarness) {
do b.iter {
let v: ~[u8] = vec::from_elem(1024, 0u8);
}
}
fn bench_set_memory(b: &mut extra::test::BenchHarness) {
do b.iter {
let mut v: ~[u8] = vec::with_capacity(1024);
unsafe {
let vp = vec::raw::to_mut_ptr(v);
ptr::set_memory(vp, 0, 1024);
vec::raw::set_len(&mut v, 1024);
}
}
}
fn bench_vec_repeat(b: &mut extra::test::BenchHarness) {
do b.iter {
let v: ~[u8] = ~[0u8, ..1024];
}
}
~~~
Before:
test bench_from_elem ... bench: 415 ns/iter (+/- 17)
test bench_set_memory ... bench: 85 ns/iter (+/- 4)
test bench_vec_repeat ... bench: 83 ns/iter (+/- 3)
After:
test bench_from_elem ... bench: 84 ns/iter (+/- 2)
test bench_set_memory ... bench: 84 ns/iter (+/- 5)
test bench_vec_repeat ... bench: 84 ns/iter (+/- 3)
2013-07-30 02:50:31 -04:00
blake2-ppc
ae09d95160
extra: Add .rev_iter() for bitv
2013-07-30 02:48:40 +02:00
blake2-ppc
f8ae526f70
extra: Implement iterator::Extendable
2013-07-30 02:06:49 +02:00
blake2-ppc
f68621326e
extra: Implement RandomAccessIterator for RingBuf
2013-07-30 01:48:17 +02:00
blake2-ppc
2f10d1e295
extra: Implement DoubleEnded and RandomAccess iterators for bitv
2013-07-30 01:48:17 +02:00
blake2-ppc
4b45f47881
std: Rename Iterator adaptor types to drop the -Iterator suffix
...
Drop the "Iterator" suffix for the the structs in std::iterator.
Filter, Zip, Chain etc. are shorter type names for when iterator
pipelines need their types written out in full in return value types, so
it's easier to read and write. the iterator module already forms enough
namespace.
2013-07-29 04:20:56 +02:00
jmgrosen
a0f0f3012e
Refactored vec and str iterators to remove prefixes
2013-07-28 13:37:35 -07:00
bors
20454da2db
auto merge of #8069 : erickt/rust/maikklein, r=erickt
...
Good evening,
This is a superset of @MaikKlein's #7969 commit, that I've fixed up to compile. I had a couple commits I wanted to do on top of @MaikKlein's work that I didn't want to bitrot.
2013-07-28 00:19:21 -07:00
Erick Tryzelaar
2a68c719f4
to_either + fixes
2013-07-27 23:41:09 -07:00
Erick Tryzelaar
e308167a2f
cleanup .unwrap and .unwrap_err fixing io tests
2013-07-27 23:41:09 -07:00
Steven Stewart-Gallus
39b3a0561f
Fix nits.
2013-07-27 22:06:29 -07:00
Steven Stewart-Gallus
d0b7515aed
Change concurrency primitives to standard naming conventions
...
To be more specific:
`UPPERCASETYPE` was changed to `UppercaseType`
`type_new` was changed to `Type::new`
`type_function(value)` was changed to `value.method()`
2013-07-27 22:06:29 -07:00
bors
b027c5fce3
auto merge of #8074 : thestinger/rust/iterator, r=cmr
...
d7c9bb4 r=alexcrichton
7ae17e0 r=huonw
2013-07-27 16:37:27 -07:00
blake2-ppc
7ae17e0964
Remove dummy type parameters from iterator adaptors
...
With the recent fixes to method resolution, we can now remove the
dummy type parameters used as crutches in the iterator module.
For example, the zip adaptor type is just ZipIterator<T, U> now.
2013-07-27 14:37:55 -04:00
Steven Fackler
feb18fe8da
Added default impls for container methods
...
A couple of implementations of Container::is_empty weren't exactly
self.len() == 0 so I left them alone (e.g. Treemap).
2013-07-25 15:17:30 -07:00
bors
906264b50f
auto merge of #8015 : msullivan/rust/default-methods, r=nikomatsakis
...
Lots of changes to vtable resolution, handling of super/self method calls in default methods. Fix a lot of trait inheritance bugs.
r? @nikomatsakis
2013-07-25 03:07:44 -07:00
bors
330378d1a1
auto merge of #7996 : erickt/rust/cleanup-strs, r=erickt
...
This is a cleanup pull request that does:
* removes `os::as_c_charp`
* moves `str::as_buf` and `str::as_c_str` into `StrSlice`
* converts some functions from `StrSlice::as_buf` to `StrSlice::as_c_str`
* renames `StrSlice::as_buf` to `StrSlice::as_imm_buf` (and adds `StrSlice::as_mut_buf` to match `vec.rs`.
* renames `UniqueStr::as_bytes_with_null_consume` to `UniqueStr::to_bytes`
* and other misc cleanups and minor optimizations
2013-07-24 13:25:36 -07:00
blake2-ppc
8f86fa3b31
rc: Use ~T for allocation
...
Simplify Rc<T>/RcMut<T> by using ~T when allocating a reference counted
box.
2013-07-24 10:22:55 -04:00
Birunthan Mohanathas
d047cf1ec6
Change 'print(fmt!(...))' to printf!/printfln! in src/lib*
2013-07-24 09:45:20 -04:00
Michael Sullivan
a0f8540c95
Fix some impls such that all supertraits are actually implemented.
2013-07-23 17:06:32 -07:00
Erick Tryzelaar
1354cfa07f
clean up warnings
2013-07-23 16:57:00 -07:00
Erick Tryzelaar
31b77aecfc
std: remove str::to_owned and str::raw::slice_bytes_owned
2013-07-23 16:56:23 -07:00
Erick Tryzelaar
7af56bb921
std: move StrUtil::as_c_str into StrSlice
2013-07-23 16:56:22 -07:00
Erick Tryzelaar
9ad815e063
std: rename str.as_bytes_with_null_consume to str.to_bytes_with_null
2013-07-23 16:56:17 -07:00
Graydon Hoare
ff0c2ae812
extra: rebase fallout.
2013-07-23 15:59:24 -07:00
Graydon Hoare
ff8d65eb37
extra: give up trying to make more fields of context cloneable, just use ARCs.
2013-07-23 15:23:02 -07:00
Graydon Hoare
fa8553e417
extra: switch json from hashmaps to treemaps
2013-07-23 15:23:02 -07:00