summary refs log tree commit diff
path: root/src/libstd
AgeCommit message (Collapse)AuthorLines
2013-10-03auto merge of #9691 : alexcrichton/rust/rustdoc, r=cmrbors-1/+2
This slurps in the commits from #9684 as well as closing #9539.
2013-10-03Close out #9155Steven Fackler-13/+9
Add a test to make sure it works and switch a private struct over to a newtype. Closes #9155
2013-10-02auto merge of #9693 : sfackler/rust/newtype-removal, r=alexcrichtonbors-30/+48
UnboundedPipeStream is still a newtype since process::set_stdio needs to look into its internals. Closes #9667
2013-10-02Stop using newtype wrappers in std::rt::ioSteven Fackler-30/+48
UnboundedPipeStream is still a newtype since process::set_stdio needs to look into its internals. Closes #9667
2013-10-02auto merge of #9681 : skade/rust/str-from-str, r=huonwbors-1/+21
This fixes an issue for APIs that return FromStr. Before this change, they would have to offer a seperate function for returning the source string.
2013-10-02rustdoc: Generate hyperlinks between cratesAlex Crichton-1/+2
The general idea of hyperlinking between crates is that it should require as little configuration as possible, if any at all. In this vein, there are two separate ways to generate hyperlinks between crates: 1. When you're generating documentation for a crate 'foo' into folder 'doc', then if foo's external crate dependencies already have documented in the folder 'doc', then hyperlinks will be generated. This will work because all documentation is in the same folder, allowing links to work seamlessly both on the web and on the local filesystem browser. The rationale for this use case is a package with multiple libraries/crates that all want to link to one another, and you don't want to have to deal with going to the web. In theory this could be extended to have a RUST_PATH-style searching situtation, but I'm not sure that it would work seamlessly on the web as it does on the local filesystem, so I'm not attempting to explore this case in this pull request. I believe to fully realize this potential rustdoc would have to be acting as a server instead of a static site generator. 2. One of foo's external dependencies has a #[doc(html_root_url = "...")] attribute. This means that all hyperlinks to the dependency will be rooted at this url. This use case encompasses all packages using libstd/libextra. These two crates now have this attribute encoded (currently at the /doc/master url) and will be read by anything which has a dependency on libstd/libextra. This should also work for arbitrary crates in the wild that have online documentation. I don't like how the version is hard-wired into the url, but I think that this may be a case-by-case thing which doesn't end up being too bad in the long run. Closes #9539
2013-10-02auto merge of #9675 : sfackler/rust/lint, r=alexcrichtonbors-0/+8
Closes #9671
2013-10-02Check enums in missing_doc lintSteven Fackler-0/+8
Closes #9671
2013-10-02std: Swap {To,From}Primitive to use the 64bit as the unimplemented versionErick Tryzelaar-32/+36
One downside with this current implementation is that since BigInt's default is now 64 bit, we can convert larger BigInt's to a primitive, however the current implementation on 32 bit architectures does not take advantage of this fact.
2013-10-02std: Replace num::IntConvertible with {To,From}PrimitiveErick Tryzelaar-99/+357
2013-10-02Add an implementation of FromStr for ~str and @strFlorian Gilcher-1/+21
This fixes an issue for APIs that return FromStr. Before this change, they would have to offer a seperate function for returning the source string.
2013-10-02auto merge of #9665 : alexcrichton/rust/snapshot, r=brsonbors-12/+12
Uses the new snapshots to kill the old `loop` and introduce the new `continue`.
2013-10-02auto merge of #9638 : ↵bors-0/+2
pnkfelix/rust/fsk-issue7526-attempt-to-catch-nonuc-statics-in-match-patterns, r=alexcrichton r? anyone Address scariest part of #7526 by adding a new more specific lint (that is set to warn by default, rather than allow).
2013-10-01auto merge of #9578 : alexcrichton/rust/un-ignore-libuv-process-tests, r=brsonbors-142/+2
Closes #9341
2013-10-01Move the rt::io::process tests to run-passAlex Crichton-142/+2
Closes #9341
2013-10-01Migrate users of 'loop' to 'continue'Alex Crichton-12/+12
Closes #9467
2013-10-01remove the `float` typeDaniel Micay-1502/+27
It is simply defined as `f64` across every platform right now. A use case hasn't been presented for a `float` type defined as the highest precision floating point type implemented in hardware on the platform. Performance-wise, using the smallest precision correct for the use case greatly saves on cache space and allows for fitting more numbers into SSE/AVX registers. If there was a use case, this could be implemented as simply a type alias or a struct thanks to `#[cfg(...)]`. Closes #6592 The mailing list thread, for reference: https://mail.mozilla.org/pipermail/rust-dev/2013-July/004632.html
2013-10-01auto merge of #9644 : alexcrichton/rust/clarify, r=huonwbors-19/+42
It was a little ambiguous before how explicitl positional parameters and implicit positional parameters intermingled, and this clarifies how the two intermingle. This also updates a little bit of documentation/code examples elsewhere as well.
2013-10-01auto merge of #9576 : FlaPer87/rust/issue/9125, r=alexcrichtonbors-19/+29
Fixes #9125
2013-10-01Merge fall out of removing fmt!Alex Crichton-4/+4
2013-10-01Update std::task::mod docstringFlavio Percoco-19/+29
2013-09-30std: Remove usage of fmt!Alex Crichton-509/+497
2013-09-30Clarify format! implicit positional referencesAlex Crichton-19/+42
It was a little ambiguous before how explicitl positional parameters and implicit positional parameters intermingled, and this clarifies how the two intermingle. This also updates a little bit of documentation/code examples elsewhere as well.
2013-10-01Add new lint: non_uppercase_pattern_statics, for #7526.Felix S. Klock II-0/+2
This tries to warn about code like: ```rust match (0,0) { (0, aha) => { ... }, ... } ``` where `aha` is actually a static constant, not a binding.
2013-09-30std::iter: Introduce .by_ref() adaptorblake2-ppc-0/+44
Creates a wrapper around a mutable reference to the iterator. This is useful to allow applying iterator adaptors while still retaining ownership of the original iterator value. Example:: let mut xs = range(0, 10); // sum the first five values let partial_sum = xs.by_ref().take(5).fold(0, |a, b| a + b); assert!(partial_sum == 10); // xs.next() is now `5` assert!(xs.next() == Some(5));
2013-09-30auto merge of #9619 : toffaletti/rust/mmap, r=huonwbors-7/+7
2013-09-29reduce heap allocations for MemoryMapJason Toffaletti-7/+7
2013-09-30std::rt::uv::net: Enable tests on Win32klutzy-4/+0
Closes #8815.
2013-09-29Put a newline after each logging messageAlex Crichton-1/+1
2013-09-29Add get_opt to std::vecHarry Marr-0/+18
2013-09-28auto merge of #9583 : blake2-ppc/rust/connect-vec, r=huonwbors-46/+38
std::vec: Sane implementations for connect_vec and concat_vec Avoid unnecessary copying of subvectors, and calculate the needed space beforehand. These implementations are simple but better than the previous. Also only implement it once, for all `Vector<T>` using: impl<'self, T: Clone, V: Vector<T>> VectorVector<T> for &'self [V] Closes #9581
2013-09-27auto merge of #9574 : FlaPer87/rust/suppress_warnings, r=metajackbors-1/+0
Small change that suppresses a warning because of an unused import.
2013-09-27auto merge of #9562 : alexcrichton/rust/snapshots, r=thestingerbors-50/+0
2013-09-28std::vec: Remove functions concat, connectblake2-ppc-20/+5
std::vec::{concat, connect, concat_slices, connect_slices} are replaced by the already existing trait methods .concat_vec() and .connect_vec().
2013-09-27auto merge of #9559 : sfackler/rust/more-visibility, r=alexcrichtonbors-11/+11
2013-09-28std::vec: Sane implementations for connect_vec and concat_vecblake2-ppc-26/+15
Avoid unnecessary copying of subvectors, and calculate the needed space beforehand. These implementations are simple but better than the previous. Also only implement it once, for all `Vector<T>` using: impl<'self, T: Clone, V: Vector<T>> VectorVector<T> for &'self [V] performance improved according to the bench test: before test vec::bench::concat ... bench: 74818 ns/iter (+/- 408) test vec::bench::connect ... bench: 87066 ns/iter (+/- 376) after test vec::bench::concat ... bench: 17724 ns/iter (+/- 126) test vec::bench::connect ... bench: 18353 ns/iter (+/- 691) Closes #9581
2013-09-28std::vec: Add benchmark for .concat_vec and .connect_vecblake2-ppc-0/+18
2013-09-27auto merge of #9557 : blake2-ppc/rust/vec-lifetime-token, r=thestingerbors-6/+6
std::vec: Use a valid value as lifetime dummy in iterator The current implementation uses `&v[0]` for the lifetime struct field, but that is a dangling pointer for iterators derived from zero-length slices. Example: let v: [int, ..0] = []; println!("{:?}", v.iter()) std::vec::VecIterator<,int>{ptr: (0x7f3768626100 as *()), end: (0x7f3768626100 as *()), lifetime: &139875951207128} To replace this parameter, use a field of type `Option<&'self ()>` that is simply initialized with `None`, but still allows the iterator to have a lifetime parameter.
2013-09-27auto merge of #9552 : brson/rust/0.9-pre, r=alexcrichtonbors-2/+2
2013-09-27Suppress warning by removing unused importFlavio Percoco-1/+0
2013-09-27auto merge of #9550 : alexcrichton/rust/remove-printf, r=thestingerbors-24/+24
The 0.8 release was cut, down with printf!
2013-09-27Register new snapshotsAlex Crichton-50/+0
2013-09-26std: simplify vec.with_c_strErick Tryzelaar-28/+20
This also fixes a bug in `vec.with_c_str_unchecked` where we were not calling `.to_c_str_unchecked()` for long strings.
2013-09-26std: add micro optimization to vec.with_c_str_uncheckedErick Tryzelaar-0/+47
before: test c_str::bench::bench_with_c_str_unchecked_long ... bench: 361 ns/iter (+/- 9) test c_str::bench::bench_with_c_str_unchecked_medium ... bench: 75 ns/iter (+/- 2) test c_str::bench::bench_with_c_str_unchecked_short ... bench: 60 ns/iter (+/- 9) after: test c_str::bench::bench_with_c_str_unchecked_long ... bench: 362 ns/iter (+/- test c_str::bench::bench_with_c_str_unchecked_medium ... bench: 30 ns/iter (+/- 7) test c_str::bench::bench_with_c_str_unchecked_short ... bench: 12 ns/iter (+/- 4)
2013-09-26std: Up vec.with_c_str's stack buffer to 128Erick Tryzelaar-1/+1
This matches @graydon's recommendation.
2013-09-26std: Remove an unnecessary comment from c_strErick Tryzelaar-3/+0
The documentation for `.with_c_str()` already says that the pointer will be deallocated before returning from the function.
2013-09-26std: Micro-optimize vec.with_c_str for short vectorsErick Tryzelaar-14/+52
This now makes it unsafe to save the pointer returned by .with_c_str as that pointer now may be pointing at a stack allocated array. I arbitrarily chose 32 bytes as the length of the stack vector, and so it might not be the most optimal size. before: test c_str::bench::bench_with_c_str_long ... bench: 539 ns/iter (+/- 91) test c_str::bench::bench_with_c_str_medium ... bench: 97 ns/iter (+/- 2) test c_str::bench::bench_with_c_str_short ... bench: 70 ns/iter (+/- 5) after: test c_str::bench::bench_with_c_str_long ... bench: 542 ns/iter (+/- 13) test c_str::bench::bench_with_c_str_medium ... bench: 53 ns/iter (+/- 6) test c_str::bench::bench_with_c_str_short ... bench: 19 ns/iter (+/- 0)
2013-09-26std: Add benchmarks to c_strErick Tryzelaar-0/+103
2013-09-26std: implement Container for CStringErick Tryzelaar-2/+10
2013-09-26std: removed some warnings in tests.Erick Tryzelaar-7/+6