Commit Graph

2174 Commits

Author SHA1 Message Date
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
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
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
bors
d324014c6c auto merge of #7521 : thestinger/rust/vec, r=Aatch
continued from #7495
2013-07-01 02:26:46 -07:00
Huon Wilson
c437a16c5d rustc: add a lint to enforce uppercase statics. 2013-07-01 17:52:57 +10:00
bors
07feeb95c5 auto merge of #7487 : huonw/rust/vec-kill, r=cmr
Continuation of #7430.

I haven't removed the `map` method, since the replacement `v.iter().transform(f).collect::<~[SomeType]>()` is a little ridiculous at the moment.
2013-06-30 21:14:13 -07:00
Daniel Micay
5b40f2ae5b pass exchange_malloc an alignment, not a tydesc 2013-06-30 23:30:40 -04:00
Daniel Micay
0d7799d304 global_heap: inline get_box_size and align_to 2013-06-30 22:41:51 -04:00
Daniel Micay
b731d96b4f vec: implement exchange vector reserve in Rust 2013-06-30 22:30:37 -04:00
Daniel Micay
80ab877841 global_heap: inline malloc_raw and add realloc_raw 2013-06-30 22:22:52 -04:00
bors
1c48aac9aa auto merge of #7517 : brson/rust/0.7, r=brson 2013-06-30 17:34:58 -07:00
Jordi Boggiano
3fe05a987c Move most iter functionality to extra, fixes #7343 2013-07-01 01:50:40 +02:00
Brian Anderson
a766a955a9 Bump version from 0.7-pre to 0.7 2013-06-30 16:36:48 -07:00
bors
040ac2a932 auto merge of #7495 : thestinger/rust/exchange, r=cmr
With these changes, exchange allocator headers are never initialized, read or written to. Removing the header will now just involve updating the code in trans using an offset to only do it if the type contained is managed.

The only thing blocking removing the initialization of the last field in the header was ~fn since it uses it to store the dynamic size/types due to captures. I temporarily switched it to a `closure_exchange_alloc` lang item (it uses the same `exchange_free`) and #7496 is filed about removing that.

Since the `exchange_free` call is now inlined all over the codebase, I don't think we should have an assert for null. It doesn't currently ever happen, but it would be fine if we started generating code that did do it. The `exchange_free` function also had a comment declaring that it must not fail, but a regular assert would cause a failure. I also removed the atomic counter because valgrind can already find these leaks, and we have valgrind bots now.

Note that exchange free does not currently print an error an out-of-memory when it aborts, because our `io` code may allocate. We could probably get away with a `#[rust_stack]` call to a `stdio` function but it would be better to make a write system call.
2013-06-30 15:02:05 -07:00
Daniel Micay
4a29d6eb3f add a closure_exchange_malloc lang item
this makes the exchange allocation header completely unused, and leaves
it uninitialized
2013-06-30 16:24:47 -04:00
Daniel Micay
7f3752c7f9 managed: rm RC_EXCHANGE_UNIQUE constant
this is no longer used, exchange allocations do not set ref_count
2013-06-30 16:22:58 -04:00
Daniel Micay
408eef0d89 stop initializing ref_count in exchange_alloc
this is never read anymore
2013-06-30 16:22:55 -04:00
Alex Crichton
d3155faede Specialize to_str_common for floats/integers in strconv
This allows the integral paths to avoid allocations on the heap

Closes #4424, #4423
2013-06-30 09:19:25 -07:00
Alex Crichton
8fe6fc11de Change char::escape_{default,unicode} to take callbacks instead of allocating
strings
2013-06-30 09:19:02 -07:00
Huon Wilson
c0a20d2929 Remove vec::{map, mapi, zip_map} and the methods, except for .map, since this
is very common, and the replacement (.iter().transform().collect()) is very
ugly.
2013-06-30 21:59:44 +10:00
Huon Wilson
a396e1e2e9 Convert vec::{grow, grow_fn, grow_set} to methods. 2013-06-30 21:17:47 +10:00
Huon Wilson
2eea642c30 Convert vec::dedup to a method. 2013-06-30 21:17:09 +10:00
Huon Wilson
faa8f8ff8b Convert vec::{bsearch, bsearch_elem} to methods. 2013-06-30 21:15:25 +10:00
Huon Wilson
562dea1820 etc: update etc/unicode.py for the changes made to std::unicode. 2013-06-30 21:15:25 +10:00
Huon Wilson
9e83b2fe55 Convert vec::{reverse, swap} to methods. 2013-06-30 21:15:25 +10:00
Huon Wilson
a890c2cbf1 Convert vec::{rposition, rposition_elem, position_elem, contains} to methods. 2013-06-30 21:15:24 +10:00
Huon Wilson
45940ed988 Remove vec::[r]position_between, replaced by slices & iterators. 2013-06-30 21:06:48 +10:00
Huon Wilson
5d46bcc0e4 Remove vec::{rfind, rfind_between, find_between}, replaced by slices and iterator adapators. 2013-06-30 21:06:47 +10:00
Daniel Micay
350a5c0b72 vec: use contains_managed instead of box header 2013-06-30 03:45:39 -04:00
Daniel Micay
b91416214e add a contains_managed intrinsic 2013-06-30 03:45:39 -04:00
Daniel Micay
b883d6a54c simplify the exchange allocator
* stop using an atomic counter, this has a significant cost and
  valgrind will already catch these leaks
* remove the extra layer of function calls
* remove the assert of non-null in free, freeing null is well defined
  but throwing a failure from free will not be
* stop initializing the `prev`/`next` pointers
* abort on out-of-memory, failing won't necessarily work
2013-06-30 03:45:36 -04:00
bors
b4bb36490d auto merge of #7490 : mozilla/rust/rollup, r=thestinger
603137c r=cmr
fe10db2 r=bstrie
2013-06-29 23:34:43 -07:00
bors
c6b0d4f516 auto merge of #7475 : Seldaek/rust/fixsplit, r=cmr
I almost got locked out of my machine because I misunderstood the purpose of the function and called it with a limit of uint::max_value, which turned this function into an almost endless loop.
2013-06-29 21:13:31 -07:00
Daniel Micay
052f28a808 minor vec cleanup
* hide the rustrt module in the docs
* remove the useless `traits` module wrapping the `Add` impl
2013-06-29 17:37:03 -04:00
Daniel Micay
d820355213 fix code block syntax in two docstrings 2013-06-29 17:33:18 -04:00
bors
439b13f071 auto merge of #7449 : yichoi/rust/std_test, r=cmr
adjust run.rs test for android to pass check std
2013-06-29 14:31:41 -07:00
Alex Crichton
b29c368674 Removing a lot of usage of '&const' 2013-06-29 08:35:48 -07:00
Ben Blum
ff4ab9e147 'Borrow' stack closures rather than copying them (e.g., "|x|f(x)"), in prep for making them noncopyable. 2013-06-29 04:39:34 -04:00
Ben Blum
5784c0912f Change taskgroup key type to fn:Copy in prep for noncopyable stack closures. 2013-06-29 03:58:50 -04:00
bors
4e78c1e2a8 auto merge of #7479 : mozilla/rust/rollup, r=thestinger
22b7eb3 r=thestinger 
28a3613 r=cmr
a0c31ec r=bstrie
ee7307e r=thestinger
b9cf6a3 r=thestinger
2013-06-28 22:25:48 -07:00