summary refs log tree commit diff
path: root/src/libcore
AgeCommit message (Collapse)AuthorLines
2015-05-13doc: unwrap is discouraged, so use SomeTshepang Lekhonkhobe-35/+35
2015-05-11Merge pull request #25299 from alexcrichton/beta-backportBrian Anderson-10/+54
Backport mem::forget to beta
2015-05-12Please the `make tidy`Barosl Lee-1/+2
2015-05-12Squeeze the last bits of `task`s in documentation in favor of `thread`Barosl Lee-8/+8
An automated script was run against the `.rs` and `.md` files, subsituting every occurrence of `task` with `thread`. In the `.rs` files, only the texts in the comment blocks were affected.
2015-05-10core: impl AsRef<[u8]> for strSean McArthur-0/+9
2015-05-10std: Mark `mem::forget` as a safe functionAlex Crichton-10/+45
This commit is an implementation of [RFC 1066][rfc] where the conclusion was that leaking a value is a safe operation in Rust code, so updating the signature of this function follows suit. [rfc]: https://github.com/rust-lang/rfcs/blob/master/text/1066-safe-mem-forget.md Closes #25186
2015-05-10Make From::from example more idiomatic / simplerCorey Farwell-3/+1
2015-05-10Indicate function call is code-like in doc-commentCorey Farwell-2/+2
2015-05-10IMO better borrow_mut() documentation on RefCellgareins-1/+1
Previous borrow() is enough to make borrow_mut() panic, no need to have borrow_mut() twice. [This](http://is.gd/woKKAW)
2015-05-07Merge pull request #25192 from alexcrichton/beta-backportBrian Anderson-119/+4
Backport of PRs to Beta
2015-05-07std: Remove index notation on slice iteratorsAlex Crichton-119/+4
These implementations were intended to be unstable, but currently the stability attributes cannot handle a stable trait with an unstable `impl` block. This commit also audits the rest of the standard library for explicitly-`#[unstable]` impl blocks. No others were removed but some annotations were changed to `#[stable]` as they're defacto stable anyway. One particularly interesting `impl` marked `#[stable]` as part of this commit is the `Add<&[T]>` impl for `Vec<T>`, which uses `push_all` and implicitly clones all elements of the vector provided. Closes #24791 Conflicts: src/libcoretest/slice.rs src/librustc_driver/lib.rs
2015-05-05Add downcasting to std::error::ErrorAaron Turon-4/+4
This commit brings the `Error` trait in line with the [Error interoperation RFC](https://github.com/rust-lang/rfcs/pull/201) by adding downcasting, which has long been intended. This change means that for any `Error` trait objects that are `'static`, you can downcast to concrete error types. To make this work, it is necessary for `Error` to inherit from `Reflect` (which is currently used to mark concrete types as "permitted for reflection, aka downcasting"). This is a breaking change: it means that impls like ```rust impl<T> Error for MyErrorType<T> { ... } ``` must change to something like ```rust impl<T: Reflect> Error for MyErrorType<T> { ... } ``` except that `Reflect` is currently unstable (and should remain so for the time being). For now, code can instead bound by `Any`: ```rust impl<T: Any> Error for MyErrorType<T> { ... } ``` which *is* stable and has `Reflect` as a super trait. The downside is that this imposes a `'static` constraint, but that only constrains *when* `Error` is implemented -- it does not actually constrain the types that can implement `Error`. [breaking-change] Conflicts: src/libcore/marker.rs
2015-04-25Indicate None is code-like in doc commentsCorey Farwell-5/+5
2015-04-25Fix broken links in the docsFlorian Hartwig-4/+4
2015-04-25Indicate keywords are code-like in Fuse::reset_fuse doc commentCorey Farwell-2/+3
2015-04-25Improve doc for `Result::unwrap()`York Xiang-2/+2
2015-04-25Make iterator struct docs more consistent.Steve Klabnik-13/+13
Fixes #24008.
2015-04-25remove bad example from PartialEq docsSteve Klabnik-21/+0
Fixes #24173
2015-04-25Remove doc-comment default::Default importsCorey Farwell-9/+0
In 8f5b5f94dcdb9884737dfbc8efd893d1d70f0b14, `default::Default` was added to the prelude, so these imports are no longer necessary.
2015-04-24Fix fallout from wrapping_neg revertBrian Anderson-1/+1
2015-04-23std: Bring back f32::from_str_radix as an unstable APIAlex Crichton-239/+175
This API was exercised in a few tests and mirrors the `from_str_radix` functionality of the integer types. Conflicts: src/doc/trpl/traits.md src/libstd/sys/windows/fs2.rs
2015-04-23std: Remove deprecated/unstable num functionalityAlex Crichton-1849/+226
This commit removes all the old casting/generic traits from `std::num` that are no longer in use by the standard library. This additionally removes the old `strconv` module which has not seen much use in quite a long time. All generic functionality has been supplanted with traits in the `num` crate and the `strconv` module is supplanted with the [rust-strconv crate][rust-strconv]. [rust-strconv]: https://github.com/lifthrasiir/rust-strconv This is a breaking change due to the removal of these deprecated crates, and the alternative crates are listed above. [breaking-change] Conflicts: src/libstd/num/strconv.rs
2015-04-23std: Remove deprecated AsOsStr/Str/AsSlice traitsAlex Crichton-77/+0
Cleaning out more deprecated items Conflicts: src/libcore/result.rs
2015-04-23std: Add Default/IntoIterator/ToOwned to the preludeAlex Crichton-43/+50
This is an implementation of [RFC 1030][rfc] which adds these traits to the prelude and additionally removes all inherent `into_iter` methods on collections in favor of the trait implementation (which is now accessible by default). [rfc]: https://github.com/rust-lang/rfcs/pull/1030 This is technically a breaking change due to the prelude additions and removal of inherent methods, but it is expected that essentially no code breaks in practice. [breaking-change] Closes #24538
2015-04-23side-step potentially panic'ing negate in `fn abs`.Felix S. Klock II-1/+5
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-14Auto merge of #24312 - rprichard:destabilize-format-args, r=alexcrichtonbors-29/+36
Fixes #22953.
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