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
Erick Tryzelaar
2dd3c44a56
std: remove a malloc from os::fill_charp_buf
2013-07-23 16:56:23 -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
cc9666f68f
std: rename str.as_buf to as_imm_buf, add str.as_mut_buf
2013-07-23 16:56:22 -07:00
Erick Tryzelaar
3b818edeba
std and extra: use as_c_str instead of as_buf in a couple places
...
These uses are assuming the strings are null terminated, so it
should be using `as_c_str` instead of `as_buf`
2013-07-23 16:56:22 -07:00
Erick Tryzelaar
cf75330807
std: add test for str::as_c_str
2013-07-23 16:56:22 -07:00
Erick Tryzelaar
7af56bb921
std: move StrUtil::as_c_str into StrSlice
2013-07-23 16:56:22 -07:00
Erick Tryzelaar
9fdec67a67
std: move str::as_buf into StrSlice
2013-07-23 16:56:22 -07:00
Erick Tryzelaar
cfd89c4075
std: remove os::as_c_charp
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
978e5d94bc
std: wrap "long" utf8 lines.
2013-07-23 16:02:14 -07:00
Gábor Horváth
1ce14116cc
Added missing memory orderings for atomic types.
2013-07-23 12:34:40 +02:00
bors
0a5d1a1b81
auto merge of #7875 : sstewartgallus/rust/fubar, r=alexcrichton
2013-07-22 23:13:41 -07:00
bors
ff34064aa3
auto merge of #7916 : olsonjeffery/rust/newrt_timer, r=brson
...
My first bit of newsched IO work. Pretty simple and limited in scope.
the RtioTimer trait only has a `sleep(msecs: u64)` method, for now. Taking requests on what else ought to be here.
oh yeah: this resolves #6435
2013-07-22 17:28:35 -07:00
Graydon Hoare
d9c0634536
std: various additional language benchmarks in util.
2013-07-22 16:56:11 -07:00
Graydon Hoare
ca5ed4cc49
std: add benchmark for allocating-and-dropping a struct with a dtor.
2013-07-22 16:56:11 -07:00