about summary refs log tree commit diff
path: root/src/libcore
AgeCommit message (Collapse)AuthorLines
2015-04-16Fix Debug impl for RangeFullUlrik Sverdrup-1/+1
The Debug impl was using quotes, which was inconsistent: => (.., 1.., 2..3, ..4) ("..", 1.., 2..3, ..4) Fix to use just ..
2015-04-16Auto merge of #23682 - tamird:DRY-is-empty, r=alexcrichtonbors-13/+13
r? @alexcrichton
2015-04-15Rollup merge of #24465 - steveklabnik:intoiteratordocfix, r=alexcrichtonSteve Klabnik-1/+1
2015-04-15Rollup merge of #24440 - nham:improve_enumerate_doc, r=alexcrichtonSteve Klabnik-2/+3
I found that the current description of `enumerate()` doesn't actually tell you what, specifically, the method does, and you have to look at the example to figure it out. Here's a description that I think is better.
2015-04-15Rollup merge of #24435 - killercup:patch-9, r=steveklabnikSteve Klabnik-3/+3
The link works on the `std/ptr/index.html` docs page, but not the `std/primitive.pointer.html` page. Instead of leaving it half-broken, it is removed. I tried fixing this in #24432, but @alexcrichton mentioned that this doc string was used in two places (with different base paths unfortunately). r? @alexcrichton
2015-04-15Describe the Iterator enumerate() method more clearly.Nick Hamann-2/+3
2015-04-15Fix link in intoiterator docsSteve Klabnik-1/+1
2015-04-14Negative case of `len()` -> `is_empty()`Tamir Duberstein-2/+2
`s/([^\(\s]+\.)len\(\) [(?:!=)>] 0/!$1is_empty()/g`
2015-04-14Positive case of `len()` -> `is_empty()`Tamir Duberstein-11/+11
`s/(?<!\{ self)(?<=\.)len\(\) == 0/is_empty()/g`
2015-04-14Remove Incorrect Link from std::ptr::null DocsPascal Hertleif-3/+3
The link works on the std::ptr docs page, but not the primitive.ptr.html page. Instead of leaving it half-broken, it is removed.
2015-04-14rollup merge of #24377: apasel422/docsAlex Crichton-113/+113
Conflicts: src/libstd/net/ip.rs src/libstd/sys/unix/fs.rs src/libstd/sys/unix/mod.rs src/libstd/sys/windows/mod.rs
2015-04-14rollup merge of #24379: rkruppe/fmt-negative-zeroAlex Crichton-114/+52
Fixes #20596 by making `Debug` render negative zero with a `-` without affecting the behavior of `Display`. While I was at it, I also removed some dead code from `float_to_str_bytes_common` (the one from `libcore/fmt/float.rs`, not the function of the same name in `libstd/num/strconv.rs`). It had support for different bases, and for negative numbers, but the function is internal to core and the couple places that call it (all in `libcore/fmt/mod.rs`) never use those features: They pass in `num.abs()` and base 10.
2015-04-14rollup merge of #24329: GuillaumeGomez/atomicboolAlex Crichton-0/+20
Fixes #24319.
2015-04-14rollup merge of #24310: alexcrichton/stabilize-utf8-errorAlex Crichton-22/+17
The meaning of each variant of this enum was somewhat ambiguous and it's uncler that we wouldn't even want to add more enumeration values in the future. As a result this error has been altered to instead become an opaque structure. Learning about the "first invalid byte index" is still an unstable feature, but the type itself is now stable.
2015-04-14rollup merge of #24303: alexcrichton/remove-deprecatedAlex Crichton-70/+52
This commit removes these long deprecated modules. Such a nice diff stat!
2015-04-14rollup merge of #24048: frewsxcv/patch-11Alex Crichton-1/+1
Since it doesn't utilize the parameter, it's not very idiomatic since it could just use the `Result::or` method. So this changes the example to utilize the parameter. As far as I can tell, all the numbers in this example are completely arbitrary.
2015-04-14core: Update all Result docsAlex Crichton-70/+52
2015-04-14Fix bug in `wrapping_div`Felix S. Klock II-1/+1
See discussion, albeit one-sided, in: https://github.com/rust-lang/rfcs/issues/964
2015-04-14Auto merge of #24312 - rprichard:destabilize-format-args, r=alexcrichtonbors-29/+36
Fixes #22953.
2015-04-14Remaining API additions for int overflow:Felix S. Klock II-0/+155
`wrapping_div`, `wrapping_rem`, `wrapping_neg`, `wrapping_shl`, `wrapping_shr`. All marked unstable under `core` feature for now (with expectation of being marked as stable by 1.0 release).
2015-04-14RebasedNick Cameron-1/+1
2015-04-13pluralize doc comment verbs and add missing periodsAndrew Paseltiner-113/+113
2015-04-13Auto merge of #24323 - rprichard:panic-line-type, r=alexcrichtonbors-4/+4
There are syntax extensions that call `std::rt::begin_unwind` passing it a `usize`. I updated the syntax extension to instead pass `u32`, but for bootstrapping reasons, I needed to create a `#[cfg(stage0)]` version of `std::rt::begin_unwind` and therefore also `panic!`.
2015-04-12Destabilize format_args! internals.Ryan Prichard-29/+36
Arguments, Formatters, and the various format traits remain stable. The format_args! macro uses #[allow_internal_unstable] to allow it access to the unstable things in core::fmt. Destabilized things include a "v1" in their name: * core::fmt::rt * core::fmt::rt::v1 (the module and all contents) * core::fmt::ArgumentV1 * core::fmt::ArgumentV1::new * core::fmt::ArgumentV1::from_usize * core::fmt::Arguments::new_v1 * core::fmt::Arguments::new_v1_formatted The unstable message was copied from that of std::io::_print.
2015-04-12Make Debug include the - in -0.0Robin Kruppe-114/+52
2015-04-13Rollup merge of #24347 - xamgore:master, r=huonwManish Goregaokar-2/+2
Docs meant that ParseIntError is returned though the function returns ParseFloatError.
2015-04-12mod.rs documentary fixIgor Strebezhev-2/+2
Docs meant that Option is returned though the function returns Result.
2015-04-11Simplify iterator logic for FuseCorey Farwell-14/+6
2015-04-11Rollup merge of #24298 - White-Oak:master, r=alexcrichtonManish Goregaokar-11/+8
Fixes 'fn from_str_radix' documentation where docs meant that Option is returned, though the function returns Result.
2015-04-11Rollup merge of #24291 - xamgore:patch-1, r=steveklabnikManish Goregaokar-6/+6
From [here](http://doc.rust-lang.org/nightly/std/primitive.i8.html): > `fn rotate_right(self, n: u32) -> i8` > Shifts the bits to the right by a specified __amount amount__, n, wrapping the truncated bits to the beginning of the resulting integer.
2015-04-11Rollup merge of #24274 - steveklabnik:fix_pow_docs, r=nikomatsakisManish Goregaokar-4/+3
This is very confusing now that these are inherent methods.
2015-04-11Rollup merge of #24121 - steveklabnik:gh24107, r=steveklabnikManish Goregaokar-5/+51
2015-04-11Rollup merge of #24269 - benashford:formatting-fix, r=alexcrichtonManish Goregaokar-1/+1
This fixes the bug described in issue #23150. This affected formatting any floating point number into a string in a formatting pattern that: a) required rounding up, and b) required an extra digit on the front. So `format!(\"{:.0}\", 9.9)` would fail, but `format!(\"{:.0}\", 8.9)` would succeed. This was due to a negative integer being cast to a `usize` resulting in an 'arithmetic operation overflowed' panic. The fix was to change the order of operations so that the number is zero before casting.
2015-04-11Change the rt::unwind line argument type from usize to u32.Ryan Prichard-4/+4
2015-04-11Auto merge of #24254 - aturon:join-handle-debug, r=alexcrichtonbors-0/+10
Make `Box<Any + Send>` implement `Debug`. Fixes #21291
2015-04-11Auto merge of #24186 - richo:pad-pointers, r=alexcrichtonbors-1/+24
This pads out the printing of pointers to their native width. Extracted from and rebased on top of #24144
2015-04-10Auto merge of #24270 - pnkfelix:use-disr-val-for-derive-ord, r=brsonbors-0/+7
Use `discriminant_value` intrinsic for `derive(PartialOrd)` [breaking-change] This is a [breaking-change] because it can change the result of comparison operators when enum discriminants have been explicitly assigned. Notably in a case like: ```rust #[derive(PartialOrd)] enum E { A = 2, B = 1} ``` Under the old deriving, `A < B` held, because `A` came before `B` in the order of declaration. But now we use the ordering according to the provided values, and thus `A > B`. (However, this change is very unlikely to break much, if any, code, since the orderings themselves should all remain well-defined, total, etc.) Fix #15523
2015-04-10std: Stabilize the Utf8Error typeAlex Crichton-22/+17
The meaning of each variant of this enum was somewhat ambiguous and it's uncler that we wouldn't even want to add more enumeration values in the future. As a result this error has been altered to instead become an opaque structure. Learning about the "first invalid byte index" is still an unstable feature, but the type itself is now stable.
2015-04-10mod.rs docs fix - for floatsOak-5/+4
Same with integers — docs meant that Option is returned though the function returns Result.
2015-04-10mod.rs docs fixOak-6/+4
Docs meant that Option is returned though the function returns Result.
2015-04-10Fix mistake in documentationIgor Strebezhev-6/+6
2015-04-10Add Default trait for AtomicBool, AtomicIsize and AtomicUsizeGuillaume Gomez-0/+20
2015-04-10Add examples for ConvertSteve Klabnik-5/+51
2015-04-10Auto merge of #24177 - alexcrichton:rustdoc, r=aturonbors-1/+5
This commit series starts out with more official test harness support for rustdoc tests, and then each commit afterwards adds a test (where appropriate). Each commit should also test and finish independently of all others (they're all pretty separable). I've uploaded a [copy of the documentation](http://people.mozilla.org/~acrichton/doc/std/) generated after all these commits were applied, and a double check on issues being closed would be greatly appreciated! I'll also browse the docs a bit and make sure nothing regressed too horribly.
2015-04-10Fix pow docs to not use IntSteve Klabnik-4/+3
This is very confusing now that these are inherent methods.
2015-04-10Change `derive` expansions to use `discriminant_value` intrinsic.Felix S. Klock II-0/+1
Fix #15523.
2015-04-10Fix for #23150Ben Ashford-1/+1
2015-04-10Implement `discriminant_value` intrinsicJames Miller-0/+6
Implements an intrinsic for extracting the value of the discriminant enum variant values. For non-enum types, this returns zero, otherwise it returns the value we use for discriminant comparisons. This means that enum types that do not have a discriminant will also work in this arrangement. This is (at least part of) the work on Issue #24263
2015-04-10Auto merge of #24180 - huonw:optimise-max-etc, r=alexcrichtonbors-36/+57
The main change in this patch is removing the use of `Option` inside the inner loops of those functions to avoid comparisons where one branch will only trigger on the first pass through the loop. The included benchmarks go from: test bench_max ... bench: 372 ns/iter (+/- 118) test bench_max_by ... bench: 428 ns/iter (+/- 33) test bench_max_by2 ... bench: 7128 ns/iter (+/- 326) to: test bench_max ... bench: 317 ns/iter (+/- 64) test bench_max_by ... bench: 356 ns/iter (+/- 270) test bench_max_by2 ... bench: 1387 ns/iter (+/- 183) Problem noticed in http://www.reddit.com/r/rust/comments/31syce/using_iterators_to_find_the_index_of_the_min_or/
2015-04-10Optimise Iterator::{max, max_by, min, min_by}.Huon Wilson-36/+57
The main change in this patch is removing the use of `Option` inside the inner loops of those functions to avoid comparisons where one branch will only trigger on the first pass through the loop. The included benchmarks go from: test bench_max ... bench: 372 ns/iter (+/- 118) test bench_max_by ... bench: 428 ns/iter (+/- 33) test bench_max_by2 ... bench: 7128 ns/iter (+/- 326) to: test bench_max ... bench: 317 ns/iter (+/- 64) test bench_max_by ... bench: 356 ns/iter (+/- 270) test bench_max_by2 ... bench: 1387 ns/iter (+/- 183) Problem noticed in http://www.reddit.com/r/rust/comments/31syce/using_iterators_to_find_the_index_of_the_min_or/