Commit Graph

2298 Commits

Author SHA1 Message Date
Brian Anderson
fae3336769 Merge remote-tracking branch 'mozilla/master'
Conflicts:
	src/libextra/test.rs
	src/libstd/rt/global_heap.rs
	src/libstd/unstable/lang.rs
	src/libstd/vec.rs
2013-07-08 16:29:54 -07:00
Brian Anderson
b227583dad Merge remote-tracking branch 'anasazi/io'
Conflicts:
	src/libstd/rt/test.rs
2013-07-08 15:53:11 -07:00
Brian Anderson
4282539523 std::rt: Add a hack to allocate different test port ranges to different bots 2013-07-08 14:41:07 -07:00
bors
f503e539bf auto merge of #7608 : glinscott/rust/json_perf, r=pcwalton
Avoids the overhead of read_char for every character.

Benchmark reading example.json 10 times from
https://code.google.com/p/rapidjson/wiki/Performance

Before: 2.55s
After:  0.16s

Regression testing is already done by isrustfastyet.
2013-07-08 14:34:54 -07:00
Eric Reed
5e0be46852 changed .each() to .iter().advance() 2013-07-08 14:19:39 -07:00
Eric Reed
6b2abcaa0f renamed finalize to drop in Drop impl for UvUdpSocket 2013-07-08 14:19:19 -07:00
Eric Reed
cf23292010 Merge remote-tracking branch 'upstream/io' into io
Conflicts:
	src/libstd/rt/uvio.rs
2013-07-08 13:03:18 -07:00
bors
f7b293bc75 auto merge of #7577 : brson/rust/vers, r=cmr 2013-07-08 12:59:21 -07:00
Brian Anderson
b0a9d8193f Bump version numbers to 0.8-pre 2013-07-08 10:25:45 -07:00
bors
2a8ae0eb4a auto merge of #7604 : apasel422/rust/peek, r=huonw
This can be useful for inserting debugging code at different steps in an iterator pipeline.
2013-07-08 10:22:57 -07:00
bors
48ad726f2a auto merge of #7605 : thestinger/rust/vec, r=Aatch
This is work continued from the now landed #7495 and #7521 pulls.

Removing the headers from unique vectors is another project, so I've separated the allocator.
2013-07-08 02:52:56 -07:00
Daniel Micay
90f1db10fa remove headers from exchange allocations 2013-07-08 04:54:41 -04:00
Daniel Micay
44770ae3a8 Merge pull request #7595 from thestinger/iterator
remove some method resolve workarounds
2013-07-08 01:42:07 -07:00
Daniel Micay
0aedecf96b add a temporary vector_exchange_malloc lang item 2013-07-08 03:41:21 -04:00
Daniel Micay
7bf34c3437 vec: make vec_reserve_shared_actual private 2013-07-08 03:41:21 -04:00
bors
96ae000812 auto merge of #7497 : alexcrichton/rust/issue-7394, r=huonw 2013-07-07 21:34:51 -07:00
Daniel Micay
641aec7407 remove some method resolve workarounds 2013-07-07 19:51:13 -04:00
Andrew Paseltiner
7bb4ff6267 iterator: Add IteratorUtil::peek_ method 2013-07-07 19:29:37 -04:00
bors
ddf8247d7f auto merge of #7629 : thestinger/rust/rope, r=graydon
It's broken/unmaintained and needs to be rewritten to avoid managed
pointers and needless copies. A full rewrite is necessary and the API
will need to be redone so it's not worth keeping this around (#7628).

Closes #2236, #2744
2013-07-07 15:20:01 -07:00
bors
3c44265d87 auto merge of #7602 : blake2-ppc/rust/vec-pop-opt, r=cmr
Implement methods `.pop_opt() -> Option<T>` and `.shift_opt() -> Option<T>` to allow retrieval of front/back of a vec in one operation without fail. .pop() and .shift() are changed to reuse the former two methods.

Follows the naming of the previous method .head_opt()
2013-07-07 09:35:04 -07:00
bors
a9f178c148 auto merge of #7570 : kballard/rust/iterator-size-hint, r=thestinger
Change the signature of Iterator.size_hint() to always have a lower bound.

Implement .size_hint() on all remaining iterators (if it differs from the default).
2013-07-06 14:59:09 -07:00
Daniel Micay
01833de7ea remove extra::rope
It's broken/unmaintained and needs to be rewritten to avoid managed
pointers and needless copies. A full rewrite is necessary and the API
will need to be redone so it's not worth keeping this around.

Closes #2236, #2744
2013-07-06 17:06:30 -04:00
bors
3e933b199c auto merge of #7194 : jensnockert/rust/endian, r=cmr
They simply byte-swap an integer to a specific endian, like the hton* functions in C.

These intrinsics are synthesized, so maybe they should be in another file. But since they are just a single line of code each, based on the bswap intrinsics and aren't really intended for public consumption I thought they would fit in the intrinsics file.

The next step working on this could be to expose a trait / generic function for byteswapping.
2013-07-06 08:32:10 -07:00
Gary Linscott
52949fbf18 Faster check for ascii-space
Since ' ' is by far one of the most common characters, it is worthwhile
to put it first, and short-circuit the rest of the function.

On the same JSON benchmark, as the json_perf improvement, reading example.json
10 times from https://code.google.com/p/rapidjson/wiki/Performance.

Before: 0.16s
After: 0.11s
2013-07-06 01:54:29 -04:00
blake2-ppc
fc17d4371f vec: Add .shift_opt() -> Option<T>
Add a function to safely retrieve the first element of a ~[T], as
Option<T>. Implement shift() using shift_opt().

Add tests for both .shift() and .shift_opt()
2013-07-05 20:32:25 +02:00
blake2-ppc
d805b832f5 vec: Add .pop_opt() -> Option<T>
Add a function to safely retrieve the last element of a ~[T], as
Option<T>. Implement pop() using pop_opt(); it benches the same as the
old implementation when tested with optimization level 2.
2013-07-05 20:32:25 +02:00
Kevin Ballard
20016b92c8 Implement .size_hint() on the remaining Iterator adaptors
Every iterator adaptor now has an implementation of .size_hint() that
makes sense, except for when the default of (0, None) is correct.
2013-07-05 01:56:48 -07:00
Kevin Ballard
dc9b3ff1b3 Change signature of Iterator.size_hint
Remove the Option wrapper around the lower bound. None is semantically
the same as Size(0), so there's no point in having a distinction.
2013-07-05 01:56:48 -07:00
bors
e89dcb887b auto merge of #7549 : sfackler/rust/docs, r=msullivan
I'm leaving the Sized kind undocumented since it isn't fully implemented
yet.
2013-07-04 19:01:54 -07:00
Daniel Micay
dd4f6bb2a2 Merge pull request #7565 from Blei/fix-rev-size-hint
vec: Fix size_hint() of reverse iterators
2013-07-03 22:07:20 -07:00
Brian Anderson
1098d6980b Merge remote-tracking branch 'mozilla/master'
Conflicts:
	src/libextra/test.rs
	src/libstd/at_vec.rs
	src/libstd/cleanup.rs
	src/libstd/rt/comm.rs
	src/libstd/rt/global_heap.rs
	src/libstd/task/spawn.rs
	src/libstd/unstable/lang.rs
	src/libstd/vec.rs
	src/rt/rustrt.def.in
	src/test/run-pass/extern-pub.rs
2013-07-03 14:49:13 -07:00
Huon Wilson
cdea73cf5b Convert vec::{as_imm_buf, as_mut_buf} to methods. 2013-07-04 00:46:50 +10:00
Huon Wilson
a732a2daff Convert vec::windowed to an external iterator, and add an n-at-a-time chunk iterator. 2013-07-04 00:46:50 +10:00
Huon Wilson
944d904ad4 Convert vec::{split, splitn, rsplit, rsplitn} to external iterators. 2013-07-04 00:46:50 +10:00
Huon Wilson
f19fb2459f Remove standalone comparison functions in vec, make the trait impls better. 2013-07-04 00:46:50 +10:00
Huon Wilson
9207802589 Remove vec::reversed, replaced by iterators. 2013-07-04 00:46:50 +10:00
Huon Wilson
de0d696561 Remove vec::{filter, filtered, filter_map, filter_mapped}, replaced by iterators. 2013-07-04 00:46:49 +10:00
Huon Wilson
eee6775642 Implement consuming iterators for ~[], remove vec::{consume, consume_reverse, map_consume}. 2013-07-04 00:46:49 +10:00
Philipp Brüschweiler
6ee8fee730 vec: Fix size_hint() of reverse iterators
Fixes #7558
2013-07-03 14:56:26 +02:00
bors
55f155521d auto merge of #7523 : huonw/rust/uppercase-statics-lint, r=cmr
Adds a lint for `static some_lowercase_name: uint = 1;`. Warning by default since it causes confusion, e.g. `static a: uint = 1; ... let a = 2;` => `error: only refutable patterns allowed here`.
2013-07-03 04:31:50 -07:00
bors
ea31b9cca1 auto merge of #7474 : Seldaek/rust/clean-iter, r=thestinger
I think it's WIP - but I wanted to ask for feedback (/cc @thestinger)

I had to move the impl of FromIter for vec into extra::iter because I don't think std can depend on extra, but that's a bit messed up. Similarly some FromIter uses are gone now, not sure if this is fixable or if I made a complete mess here..
2013-07-03 01:07:55 -07:00
Eric Reed
b60cf0c5b0 converted TODOs into XXXs 2013-07-02 17:27:46 -07:00
Eric Reed
6a1a7819c9 Merge remote-tracking branch 'upstream/io' into io
Conflicts:
	src/libstd/rt/test.rs
	src/rt/rustrt.def.in
2013-07-02 16:55:56 -07:00
Eric Reed
e6c57793be IPv6 support for UDP and TCP. 2013-07-02 16:40:57 -07:00
Brian Anderson
f8a4d09f7e std: Use the same task failure message as C++ rt 2013-07-02 16:04:45 -07:00
toddaaro
0607178280 A missing ! made it so that the testcase schedule_home_states was throwing spurious assert failures. Why this did not result in the test case failing previously is beyond me. 2013-07-02 11:44:51 -07:00
Steven Fackler
3e265e7842 Small documentation changes
I'm leaving the Sized kind undocumented since it isn't fully implemented
yet.
2013-07-01 23:37:11 -07:00
toddaaro
27818ea7c4 removed unnecessary import that slipped in during merge 2013-07-01 16:51:59 -07:00
toddaaro
062bfd310a merging task/coroutine refactoring back into upstream 2013-07-01 16:41:17 -07:00
toddaaro
5cfad4b6de Refactored the runtime to view coroutines as a component of tasks, instead of tasks as a component of coroutines. 2013-07-01 16:14:56 -07:00