Commit graph

2552 commits

Author SHA1 Message Date
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
3078e83c3f auto merge of #8076 : omasanori/rust/cleanup, r=huonw
A cleanup suggested on #7922.
2013-07-27 20:13:22 -07:00
bors
82b29ae5a5 auto merge of #7864 : brson/rust/start-on-main-thread, r=brson
Applications that need to use the GUI can override start and set up the runtime using
this function.
2013-07-27 18:25:24 -07:00
Brian Anderson
34a27db8bf std::rt: Add start_on_main_thread function
Applications that need to use the GUI can override start and set up the runtime using
this function.
2013-07-27 17:36:14 -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
Daniel Micay
fe955e7b06 iterator: add an Extendable trait 2013-07-27 17:42:10 -04:00
Daniel Micay
ffe549daf5 vec: replace some as_mut_buf with to_mut_ptr 2013-07-27 17:30:29 -04: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
Daniel Micay
d7c9bb4b68 vec: add mut_slice_{to,from}
Closes #8066
2013-07-27 14:36:52 -04:00
Daniel Micay
d6bc438bbc make RandomAccessIterator inherit from Iterator 2013-07-27 14:36:52 -04:00
bors
5157e05049 auto merge of #8036 : sfackler/rust/container-impls, r=msullivan
A couple of implementations of Container::is_empty weren't exactly
self.len() == 0 so I left them alone (e.g. Treemap).
2013-07-27 11:16:31 -07:00
bors
15310ba7c2 auto merge of #8040 : luqmana/rust/rtn, r=brson
Implements various missing tcp & udp methods.. Also fixes handling ipv4-mapped/compatible ipv6 addresses and addresses the XXX on `status_to_maybe_uv_error`.

r? @brson
2013-07-27 01:49:35 -07:00
OGINO Masanori
8d654fc41d Remove unnecessary #[path = "***/mod.rs"] lines.
Fixes #7922.

Signed-off-by: OGINO Masanori <masanori.ogino@gmail.com>
2013-07-27 15:53:30 +09:00
bors
4989799799 auto merge of #7986 : alexcrichton/rust/raw-repr, r=brson
This moves the raw struct layout of closures, vectors, boxes, and strings into a
new `unstable::raw` module. This is meant to be a centralized location to find
information for the layout of these values.

As safe method, `unwrap`, is provided to convert a rust value to its raw
representation. Unsafe methods to convert back are not provided because they are
rarely used and too numerous to write an implementation for each (not much of a
common pattern).

This is progress on #6790. I tried to get a nice interface for a trait to implement in the raw module, but I was unable to come up with one. The hard part is that there are so many different directions to go from one way to another that it's difficult to find a pattern to follow to implement a trait with. Someone else might have some better luck though.
2013-07-26 19:46:36 -07:00
Alex Crichton
5aaaca0c6a Consolidate raw representations of rust values
This moves the raw struct layout of closures, vectors, boxes, and strings into a
new `unstable::raw` module. This is meant to be a centralized location to find
information for the layout of these values.

As safe method, `repr`, is provided to convert a rust value to its raw
representation. Unsafe methods to convert back are not provided because they are
rarely used and too numerous to write an implementation for each (not much of a
common pattern).
2013-07-26 09:53:03 -07:00
bors
15ab6fde7f auto merge of #8039 : Xazax-hun/rust/master, r=brson
Added some more atomic operations. https://github.com/mozilla/rust/issues/7421
2013-07-26 08:02:06 -07:00
Luqman Aden
df67942dcc libstd: Tests for {peer, socket}_name. 2013-07-26 05:02:53 -04:00
Luqman Aden
037bf3757c libstd: Implement some missing udp methods. 2013-07-25 22:21:46 -04:00
Luqman Aden
a5c6b85091 libstd: Implement some missing tcp methods. 2013-07-25 19:42:19 -04:00
Luqman Aden
005ea3b173 libstd: Add ToStr impl for IpAddr. 2013-07-25 18:27:18 -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
0012b5008b auto merge of #8030 : thestinger/rust/iterator, r=huonw 2013-07-25 13:49:43 -07:00
Luqman Aden
d6e1a6b237 libstd: Get rid of duplication in {peer, socket}_name and remove extra *. 2013-07-25 15:50:19 -04:00
bors
4cf30729f0 auto merge of #8026 : poiru/rust/issue-8024, r=alexcrichton
Closes #8024.
2013-07-25 05:22:44 -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
Luqman Aden
e2bb32bea1 libstd: Handle IPv4-Mapped/Compatible IPv6 addresses. 2013-07-25 05:57:52 -04:00
Luqman Aden
ac40d5323d libstd: Fix errors when rtdebug! is not a noop. 2013-07-25 05:57:52 -04:00
Luqman Aden
61e741cf71 libstd: Implement {peer, socket}_name for new rt tcp & udp. 2013-07-25 05:57:52 -04:00
Gábor Horváth
7cc8f4bae0 Added some more atomic operations. 2013-07-25 10:46:31 +02:00
Alex Crichton
7fd23e4fe2 Convert uses of transmute which don't need it 2013-07-24 23:12:28 -07:00
bors
467d381d3a auto merge of #7931 : blake2-ppc/rust/chain-mut-ref, r=pcwalton
First, clean up the uses of "None" and "Some" to always use consistent title case matching the variant names.

Add .chain_mut_ref() which is a missing method. A use case example for this method is extraction of an optional value from an Option\<Container\> value.
2013-07-24 19:25:38 -07:00
Daniel Micay
4517e39125 rm default method lint
default methods are enabled by default, so there's not much point in
keeping around a lint to report them as being experimental
2013-07-24 18:44:16 -04: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
Birunthan Mohanathas
f73bb2bfe6 Implement std::num::Zero for bool
Closes #8024.
2013-07-24 22:54:32 +03:00
Erick Tryzelaar
9a950802ed std: str.as_bytes_with_null_consume() => str.to_bytes_with_null() 2013-07-24 12:33:49 -07:00
bors
f132401a0b auto merge of #7982 : thestinger/rust/iterator, r=thestinger
f0f4dcc r=huonw
25e9c4c r=graydon
a87c2d1 r=brson
16f369d r=cmr
9f05cc8 r=bstrie
e858055 r=huonw
5d80938 r=thestinger
05d03e7 r=cmr
8f86fa3 r=thestinger
2013-07-24 08:52:36 -07:00
Daniel Micay
4a2d22bdb1 fix compilation on macos/windows 2013-07-24 09:45:21 -04:00
Stepan Koltsov
c50d3e3fca ToStr for HashMap does not need value to implement Eq or Hash 2013-07-24 09:45:21 -04:00
Brian Anderson
6c88e46d4d std:rt: args module is not used by win/mac. #7951 2013-07-24 09:45:20 -04:00
Birunthan Mohanathas
d047cf1ec6 Change 'print(fmt!(...))' to printf!/printfln! in src/lib* 2013-07-24 09:45:20 -04:00
Daniel Micay
626bb5a866 add a RandomAccessIterator trait 2013-07-24 09:45:20 -04:00
bors
51028532d7 auto merge of #7993 : Xazax-hun/rust/master, r=bblum
Added missing memory orderings for atomic types. https://github.com/mozilla/rust/issues/7422
2013-07-24 06:37:36 -07:00
bors
7f96eb58d2 auto merge of #7980 : graydon/rust/misc-benchmarks, r=catamorphism
Some machinery for enabling #[bench] benchmarks in std and some examples showing how to write them.
2013-07-23 22:46:39 -07:00
Michael Sullivan
a0f8540c95 Fix some impls such that all supertraits are actually implemented. 2013-07-23 17:06:32 -07:00
Michael Sullivan
4b9759e20f Add a to_owned_vec method to IteratorUtil. 2013-07-23 17:06:32 -07:00
Erick Tryzelaar
9c3679a9a2 std: make str::append move self
This eliminates a copy and fixes a FIXME.
2013-07-23 16:57:00 -07:00
Erick Tryzelaar
bbedbc0450 std: inline str::with_capacity and vec::with_capacity 2013-07-23 16:57:00 -07:00
Erick Tryzelaar
cced3c9013 std: simplify str::as_imm_buf and vec::as_{imm,mut}_buf 2013-07-23 16:57:00 -07:00
Erick Tryzelaar
037a5b1af4 str: move as_mut_buf into OwnedStr, and make it self 2013-07-23 16:56:58 -07:00