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
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
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
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
Michael Sullivan
a9e51f5f70
Make default method handling not choke on self region params. Closes #7341 .
2013-06-28 16:12:08 -07:00
Patrick Walton
f9b54541ee
librustc: Disallow "mut" from distributing over bindings.
...
This is the backwards-incompatible part of per-binding-site "mut".
2013-06-28 10:44:15 -04:00
Huon Wilson
366ca44cc8
std: silence some test warnings.
2013-06-28 01:45:24 +10:00
Huon Wilson
32d655916f
Convert vec::{reserve, reserve_at_least, capacity} to methods.
2013-06-28 00:40:47 +10:00
Huon Wilson
ae2f185349
Convert vec::{partition, partitioned} to methods.
2013-06-28 00:20:43 +10:00
Huon Wilson
206d4f00dc
Convert vec::retain to a method.
2013-06-28 00:20:42 +10:00
Huon Wilson
4470d14388
Convert vec::truncate to a method.
2013-06-28 00:20:42 +10:00
Huon Wilson
29b0649a6a
Convert vec::{push, push_all, push_all_move} to methods.
2013-06-28 00:20:42 +10:00
Huon Wilson
1cb0a567d1
Convert vec::{pop, shift, unshift, insert, remove, swap_remove} to methods.
2013-06-28 00:20:42 +10:00
Huon Wilson
d2e3e1e52b
Convert vec::{head, tail, init, last} (and similar fns) to methods.
2013-06-27 22:37:00 +10:00
Huon Wilson
d0512b1055
Convert vec::[mut_]slice to methods, remove vec::const_slice.
2013-06-27 22:36:09 +10:00
Daniel Micay
9f5f609b1c
vec: remove superseded reverse_part function
...
`reverse(xs.mut_slice(a, b))` replaces `reverse_part(xs, a, b)`
2013-06-26 19:42:34 -04:00
Kevin Ballard
3df37326cf
Add methods .move_from() and .copy_from() to vec
...
Add method .move_from() to MutableVector, which consumes another vector
and moves elements into the receiver.
Add new trait MutableCloneableVector with one method .copy_from(), which
clones elements from another vector into the receiver.
2013-06-26 18:12:29 -04:00
Kevin Ballard
524a92c72f
Add method .set_memory in vec::bytes for &[u8]
...
Add new trait vec::bytes::MutableByteVector which currently defines one
method .set_memory().
2013-06-26 18:11:18 -04:00
Daniel Micay
e67c48a591
remove each
from vec, HashMap and HashSet
2013-06-25 16:28:02 -04:00
bors
7aee5da08d
auto merge of #7254 : Blei/rust/intrinsic-overhaul, r=cmr
...
This sets the `get_tydesc()` return type correctly and removes the intrinsic module. See #3730 , #3475 .
Update: this now also removes the unused shape fields in tydescs.
2013-06-25 04:38:06 -07:00
James Miller
caa50ce15d
Remove stage0 cfgs
2013-06-25 17:08:26 +12:00
Brian Anderson
aa9210d25a
std: Rewrite vec_reserve_shared_actual in Rust
2013-06-24 17:07:01 -07:00
Daniel Micay
da1a9a30fd
work around ICE from default method
...
issue #7341
2013-06-24 01:58:10 -04:00
Daniel Micay
3ab5ec4b7c
iterator: implement collect
with FromIterator
...
This makes it take advantage of the size hint for pre-allocation.
2013-06-24 01:35:15 -04:00
Daniel Micay
e2e39234cc
remove old_iter
...
the `test/run-pass/class-trait-bounded-param.rs` test was xfailed and
written in an ancient dialect of Rust so I've just removed it
this also removes `to_vec` from DList because it's provided by
`std::iter::to_vec`
an Iterator implementation is added for OptVec but some transitional
internal iterator methods are still left
2013-06-24 01:35:11 -04:00
Philipp Brüschweiler
469f394b25
Remove intrinsic module
...
To achieve this, the following changes were made:
* Move TyDesc, TyVisitor and Opaque to std::unstable::intrinsics
* Convert TyDesc, TyVisitor and Opaque to lang items instead of specially
handling the intrinsics module
* Removed TypeDesc, FreeGlue and get_type_desc() from sys
Fixes #3475 .
2013-06-23 12:49:16 +02:00
Daniel Micay
d2e9912aea
vec: remove BaseIter implementation
...
I removed the `static-method-test.rs` test because it was heavily based
on `BaseIter` and there are plenty of other more complex uses of static
methods anyway.
2013-06-23 02:05:20 -04:00
Daniel Micay
c9342663df
iterator: add a FromIterator trait
...
This is able to take advantage of the lower bound from the size hint.
2013-06-22 15:59:59 -04:00
Daniel Micay
468cbd9d01
iterator: add a size_hint default method
...
also adds an implementation for the vector iterators
2013-06-22 15:59:59 -04:00
Daniel Micay
06bec77faf
replace vec::find with the IteratorUtil method
2013-06-21 03:24:03 -04:00
Daniel Micay
883c966d5c
vec: replace position
with iter().position_
2013-06-21 03:23:59 -04:00
Daniel Micay
49c74524e2
vec: rm old_iter implementations, except BaseIter
...
The removed test for issue #2611 is well covered by the `std::iterator`
module itself.
This adds the `count` method to `IteratorUtil` to replace `EqIter`.
2013-06-21 03:20:22 -04:00
Daniel Micay
cbad1da3db
vec: remove eachi
...
replaced by the `enumerate` method from std::iterator
2013-06-21 03:20:22 -04:00
Daniel Micay
62dc4e0d4c
vec: remove each_const
...
An Iterator implementation can be made for &const [T] if it turns out
to be necessary for some use case.
2013-06-21 03:20:22 -04:00
James Miller
0702e53576
libstd: cleanup warnings
2013-06-21 02:43:02 +12:00
Graydon Hoare
d904c72af8
replace #[inline(always)] with #[inline]. r=burningtree.
2013-06-18 14:48:48 -07:00
bors
90b999aea1
auto merge of #7198 : huonw/rust/slice-zeros, r=Aatch
2013-06-17 00:16:03 -07:00
Huon Wilson
f1d971ae18
std: add Zero impls for &[] and &str.
2013-06-17 17:05:51 +10:00
Niko Matsakis
eb48c29681
Add copies to type params with Copy bound
2013-06-16 12:47:36 -04:00
bors
08c1155a22
auto merge of #7142 : alexcrichton/rust/deriving-zero, r=pcwalton
...
This allows mass-initialization of large structs without having to specify all the fields.
I'm a bit hesitant, but I wanted to get this out there. I don't really like using the `Zero` trait, because it doesn't really make sense for a type like `HashMap` to use `Zero` as the 'blank allocation' trait. In theory there'd be a new trait, but then that's adding cruft to the language which may not necessarily need to be there.
I do think that this can be useful, but I only implemented `Zero` on the basic types where I thought it made sense, so it may not be all that usable yet. (opinions?)
2013-06-16 01:52:09 -07:00
bors
d1927d2950
auto merge of #7137 : erickt/rust/from-elem-fixme, r=thestinger
...
This is to make sure we track optimizing `vec::from_elem`.
2013-06-16 00:58:09 -07:00
Daniel Micay
e097d5eaba
rm CopyableOrderedIter
...
replaced with OrdIterator
2013-06-15 22:16:21 -04:00