summary refs log tree commit diff
path: root/src/libstd
AgeCommit message (Collapse)AuthorLines
2014-01-14auto merge of #11535 : thestinger/rust/header, r=alexcrichtonbors-9/+114
Unique pointers and vectors currently contain a reference counting header when containing a managed pointer. This `{ ref_count, type_desc, prev, next }` header is not necessary and not a sensible foundation for tracing. It adds needless complexity to library code and is responsible for breakage in places where the branch has been left out. The `borrow_offset` field can now be removed from `TyDesc` along with the associated handling in the compiler. Closes #9510 Closes #11533
2014-01-14Flag failure functions as inline(never)Alex Crichton-0/+2
The failure functions are generic, meaning they're candidates for getting inlined across crates. This has been happening, leading to monstrosities like that found in #11549. I have verified that the codegen is *much* better now that we're not inlining the failure path (the slow path).
2014-01-14Mark LineIterator as public so its docs get generated.a_m0d-1/+1
2014-01-14add implementation of `Repr` for `~[T]`Daniel Micay-1/+2
2014-01-14remove `borrow_offset` as ~ is now free of headersDaniel Micay-7/+0
2014-01-14remove reference counting headers from ~Daniel Micay-1/+112
Unique pointers and vectors currently contain a reference counting header when containing a managed pointer. This `{ ref_count, type_desc, prev, next }` header is not necessary and not a sensible foundation for tracing. It adds needless complexity to library code and is responsible for breakage in places where the branch has been left out. The `borrow_offset` field can now be removed from `TyDesc` along with the associated handling in the compiler. Closes #9510 Closes #11533
2014-01-15std::trie: optimise insert slightly.Huon Wilson-34/+36
This reduces the number of moves/memcpy's we do, which makes insert faster, especially in cases of keys with long equal prefixes (the _low_bits tests): Before: bench_insert_large ... bench: 553966 ns/iter (+/- 64050) bench_insert_large_low_bits ... bench: 1048151 ns/iter (+/- 92484) bench_insert_small ... bench: 168840 ns/iter (+/- 22410) bench_insert_small_low_bits ... bench: 185069 ns/iter (+/- 38332) After: bench_insert_large ... bench: 422132 ns/iter (+/- 35112) bench_insert_large_low_bits ... bench: 339083 ns/iter (+/- 34421) bench_insert_small ... bench: 134539 ns/iter (+/- 15254) bench_insert_small_low_bits ... bench: 88775 ns/iter (+/- 5746)
2014-01-15std::trie: add benchmarks for insert.Huon Wilson-0/+48
2014-01-14add an experimental tag for Gc<T> due to cyclesDaniel Micay-0/+5
This type isn't yet very useful since it only pretends cycles won't be a problem. Anyone using it should be made aware that they're going to leak.
2014-01-14auto merge of #11485 : eddyb/rust/sweep-old-rust, r=nikomatsakisbors-10/+6
2014-01-14Fix the representation of C void pointers in LLVM IRBjörn Steinbrink-1/+12
Currently, we have c_void defined to be represented as an empty struct, but LLVM expects C's void* to be represented as i8*. That means we currently generate code in which LLVM doesn't recognize malloc() and free() and can't apply certain optimization that would remove calls to those functions.
2014-01-14renamed empty() to is_empty()Shamir Khodzha-4/+4
2014-01-13std: Ignore bind error tests on android. #11530Brian Anderson-2/+4
2014-01-12Bump version to 0.10-preBrian Anderson-0/+1
2014-01-13Clean up std::num::cmath and remove stale commentsBrendan Zabarauskas-186/+79
2014-01-13Remove RealExtBrendan Zabarauskas-49/+1
These functions are of little utility outside a small subset of use cases. If people need them for their own projects then they can use their own bindings for libm (which aren't hard to make).
2014-01-12Removed remnants of `@mut` and `~mut` from comments and the type system.Eduard Burtescu-10/+6
2014-01-11added empty() to PeekableShamir Khodzha-1/+15
2014-01-11auto merge of #11472 : kud1ing/rust/iOS, r=alexcrichtonbors-0/+1
This fixes #11336 I guess the type sizes are correct for both OS X and iOS, but i am not certain. In any case, i'd rather have any iOS build at all, so that we have something to improve upon.
2014-01-11Removed free_glue from tydesc (the code is still generated, but inlined in ↵Eduard Burtescu-2/+31
drop_glue).
2014-01-11define arch for iOS/ARMkud1ing-0/+1
2014-01-10auto merge of #11416 : bjz/rust/remove-print-fns, r=alexcrichtonbors-31/+31
The `print!` and `println!` macros are now the preferred method of printing, and so there is no reason to export the `stdio` functions in the prelude. The functions have also been replaced by their macro counterparts in the tutorial and other documentation so that newcomers don't get confused about what they should be using.
2014-01-11Remove re-exports of std::io::stdio::{print, println} in the prelude.Brendan Zabarauskas-31/+31
The `print!` and `println!` macros are now the preferred method of printing, and so there is no reason to export the `stdio` functions in the prelude. The functions have also been replaced by their macro counterparts in the tutorial and other documentation so that newcomers don't get confused about what they should be using.
2014-01-10std::io: Optimize u64_from_be_bytes()Carl-Anton Ingmarsson-11/+19
Instead of reading a byte at a time in a loop we copy the relevant bytes into a temporary vector of size eight. We can then read the value from the temporary vector using a single u64 read. LLVM seems to be able to optimize this almost scarily good.
2014-01-10std::io: Add tests and benchmarks for u64_from_be_bytes()Carl-Anton Ingmarsson-0/+82
2014-01-10auto merge of #11437 : sfackler/rust/mem-eof, r=alexcrichtonbors-2/+12
It's easy to figure out and useful as a sanity check sometimes.
2014-01-09Add eof to MemReader and BufReaderSteven Fackler-2/+12
It's easy to figure out and useful as a sanity check sometimes.
2014-01-09auto merge of #11360 : huonw/rust/stack_bounds, r=alexcrichtonbors-2/+3
We just approximate with a 2MB stack for native::start.
2014-01-09auto merge of #10926 : thestinger/rust/rc, r=cmrbors-97/+108
2014-01-09port over the old tests to the new `Rc`Daniel Micay-2/+43
2014-01-09auto merge of #11055 : pcwalton/rust/placement-box, r=pcwaltonbors-0/+36
r? @nikomatsakis
2014-01-09librustc: Implement placement `box` for GC and unique pointers.Patrick Walton-0/+36
2014-01-09rename Strong -> Rc, replacing `rc` with `weak`Daniel Micay-287/+102
2014-01-09add a strong/weak reference counted pointer typeDaniel Micay-0/+191
2014-01-09stop treating `Rc` cycles as unsafeDaniel Micay-45/+9
2014-01-09Remove eof() from io::ReaderAlex Crichton-142/+18
2014-01-09auto merge of #11412 : bjz/rust/num-cleanups, r=alexcrichtonbors-279/+237
The methods contained in `std::num::{Algebraic, Trigonometric, Exponential, Hyperbolic}` have now been moved into `std::num::Real`. This is part of an ongoing effort to simplify `std::num` (see issue #10387). `std::num::RealExt` has also been removed from the prelude because it is not a commonly used trait. r? @alexcrichton
2014-01-09auto merge of #11402 : bjz/rust/remove-approx, r=alexcrichtonbors-114/+25
This trait seems to stray too far from the mandate of a standard library as implementations may vary between use cases. Third party libraries should implement their own if they need something like it. This closes #5316. r? @alexcrichton, @pcwalton
2014-01-09auto merge of #11394 : alexcrichton/rust/no-decorator, r=cmrbors-198/+121
This is just an unnecessary trait that no one's ever going to parameterize over and it's more useful to just define the methods directly on the types themselves. The implementors of this type almost always don't want inner_mut_ref() but they're forced to define it as well.
2014-01-08Remove the io::Decorator traitAlex Crichton-198/+121
This is just an unnecessary trait that no one's ever going to parameterize over and it's more useful to just define the methods directly on the types themselves. The implementors of this type almost always don't want inner_mut_ref() but they're forced to define it as well.
2014-01-09Remove ApproxEq and assert_approx_eq!Brendan Zabarauskas-114/+25
This trait seems to stray too far from the mandate of a standard library as implementations may vary between use cases.
2014-01-09Merge some numeric traits with Real and don't re-export RealExtBrendan Zabarauskas-279/+237
The methods contained in `std::num::{Algebraic, Trigonometric, Exponential, Hyperbolic}` have now been moved into `std::num::Real`. This is part of an ongoing effort to simplify `std::num` (see issue #10387). `std::num::RealExt` has also been removed from the prelude because it is not a commonly used trait.
2014-01-08Robustly read remaining bytes in a characterAlex Crichton-4/+16
Closes #11372
2014-01-08auto merge of #11370 : alexcrichton/rust/issue-10465, r=pwaltonbors-128/+147
Turned out to be a 2-line fix, but the compiler fallout was huge.
2014-01-08auto merge of #11405 : huonw/rust/moredocs, r=huonwbors-6/+6
Various documentation changes, change the 'borrowed pointer' terminology to 'reference', fix a problem with 'make dist' on windows.
2014-01-07Fixup the rest of the tests in the compilerAlex Crichton-2/+1
2014-01-07extratest: Fix all leaked trait importsAlex Crichton-1/+2
2014-01-07stdtest: Fix all leaked trait importsAlex Crichton-99/+65
2014-01-07Fix remaining cases of leaking importsAlex Crichton-5/+17
2014-01-07std: Fill in all missing importsAlex Crichton-24/+65
Fallout from the previous commits