Commit Graph

20389 Commits

Author SHA1 Message Date
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
Erick Tryzelaar
9a950802ed std: str.as_bytes_with_null_consume() => str.to_bytes_with_null() 2013-07-24 12:33:49 -07:00
bors
766eb950c6 auto merge of #7997 : omasanori/rust/cleanup, r=cmr
Just an minor cleanup.
2013-07-24 11:16:33 -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
blake2-ppc
8f86fa3b31 rc: Use ~T for allocation
Simplify Rc<T>/RcMut<T> by using ~T when allocating a reference counted
box.
2013-07-24 10:22:55 -04: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
8d3bb7eb30 rustc: Remove some dead code from method resolution 2013-07-24 09:45:21 -04:00
Björn Steinbrink
7fbe8002d5 Fix a crash when transmuting non-immediate to immediate types
The code to build the transmute intrinsic currently makes the invalid
assumption that if the in-type is non-immediate, the out-type is
non-immediate as well. But this is wrong, for example when transmuting
[int, ..1] to int. So we need to handle this fourth case as well.

Fixes #7988
2013-07-24 09:45:21 -04:00
Daniel Micay
254339fd39 fix fmt! usage 2013-07-24 09:45:20 -04:00
Birunthan Mohanathas
5afb3d20aa Disallow non-comma-delimited arguments to fmt! and bytes!
Closes #4982.
2013-07-24 09:45:20 -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
206ae5752e Change 'print(fmt!(...))' to printf!/printfln! in src/test/ 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
af5a17b7d0 document random-access iterators 2013-07-24 09:45:20 -04:00
Daniel Micay
8c02272512 expand on double-ended iterators in the tutorial 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
3ee423858a auto merge of #7992 : huonw/rust/un-xfail, r=z0w0
...(they still don't work).
2013-07-24 04:22:36 -07:00
bors
b5799e1eb5 auto merge of #7987 : alexcrichton/rust/tests-for-closed-issues, r=huonw
Closes #5844
2013-07-24 01:34:38 -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
bors
af78e23006 auto merge of #7958 : kemurphy/rust/link-section, r=alexcrichton
This allows for control over the section placement of static, static
mut, and fn items.  One caveat is that if a static and a static mut are
placed in the same section, the static is declared first, and the static
mut is assigned to, the generated program crashes.  For example:

#[link_section=".boot"]
static foo : uint = 0xdeadbeef;

#[link_section=".boot"]
static mut bar : uint = 0xcafebabe;

Declaring bar first would mark .bootdata as writable, preventing the
crash when bar is written to.
2013-07-23 20:04:53 -07:00
bors
359755a39a auto merge of #7885 : graydon/rust/workcache-fixes-1, r=pcwalton
This just redoes various parts of workcache to support context-cloning (eventually quite crudely, via ARCs), the absence of which was blocking rustpkg from being able to use it. Better versions of this are possible (notably removing the ARCs on everything except the database) but it ought to work well enough for now.
2013-07-23 17:49:54 -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
d573ecd1f9 rustc: remove unused variables 2013-07-23 16:57:00 -07:00
Erick Tryzelaar
1354cfa07f clean up warnings 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
Graydon Hoare
ff0c2ae812 extra: rebase fallout. 2013-07-23 15:59:24 -07:00
bors
9954409438 auto merge of #7964 : pnkfelix/rust/fsk-issue3994-readme-note, r=huonw
See #3994.
2013-07-23 15:40:53 -07:00
Graydon Hoare
ff8d65eb37 extra: give up trying to make more fields of context cloneable, just use ARCs. 2013-07-23 15:23:02 -07:00
Graydon Hoare
fa8553e417 extra: switch json from hashmaps to treemaps 2013-07-23 15:23:02 -07:00
Graydon Hoare
9e4ebdb9d6 extra: add consume iter to treemap. 2013-07-23 15:23:02 -07:00
Graydon Hoare
31c180e5f5 extra: clean up workcache to use & in place of @ most places. 2013-07-23 15:23:02 -07:00
Graydon Hoare
1d9181bd76 extra: remove a @ in workcache config. 2013-07-23 15:23:02 -07:00
Graydon Hoare
9a093ab70a extra: change workcache::Work::unwrap to move out of self. 2013-07-23 15:23:02 -07:00
Graydon Hoare
d5803e67ee extra: access workcache db via RWARC. 2013-07-23 15:16:14 -07:00
Graydon Hoare
48dd72888c extra: use deriving more in workcache, switch to treemaps. 2013-07-23 15:16:14 -07:00
Kevin Murphy
c6c1472c68 Add simple link_section test to exercise it 2013-07-23 17:23:22 -04:00