about summary refs log tree commit diff
path: root/src/libcore
AgeCommit message (Collapse)AuthorLines
2017-01-29Add missing url in convert moduleGuillaume Gomez-10/+18
2017-01-29Add Iterator::rfind.Clar Charr-0/+58
2017-01-29Fix a few impl stability attributesOliver Middleton-37/+59
The versions show up in rustdoc.
2017-01-28use `String::with_capacity` in `format!`Michał Krasnoborski-0/+28
2017-01-27Rollup merge of #39344 - ollie27:links, r=steveklabnikAlex Crichton-5/+6
Fix a few links in the docs r? @steveklabnik
2017-01-27Rollup merge of #39307 - alexcrichton:stabilize-1.16, r=brsonAlex Crichton-7/+3
std: Stabilize APIs for the 1.16.0 release This commit applies the stabilization/deprecations of the 1.16.0 release, as tracked by the rust-lang/rust issue tracker and the final-comment-period tag. The following APIs were stabilized: * `VecDeque::truncate` * `VecDeque::resize` * `String::insert_str` * `Duration::checked_{add,sub,div,mul}` * `str::replacen` * `SocketAddr::is_ipv{4,6}` * `IpAddr::is_ipv{4,6}` * `str::repeat` * `Vec::dedup_by` * `Vec::dedup_by_key` * `Result::unwrap_or_default` * `<*const T>::wrapping_offset` * `<*mut T>::wrapping_offset` * `CommandExt::creation_flags` (on Windows) * `File::set_permissions` * `String::split_off` The following APIs were deprecated * `EnumSet` - replaced with other ecosystem abstractions, long since unstable Closes #27788 Closes #35553 Closes #35774 Closes #36436 Closes #36949 Closes #37079 Closes #37087 Closes #37516 Closes #37827 Closes #37916 Closes #37966 Closes #38080
2017-01-27Fix a few links in the docsOliver Middleton-5/+6
2017-01-26Move stability attributes per feedbackWesley Wiser-2/+3
2017-01-26Auto merge of #39075 - est31:remove_reflect, r=nikomatsakisbors-57/+0
Remove Reflect PR for removing the `Reflect` trait. Opened so that a crater run can be done for testing the impact: https://github.com/rust-lang/rust/issues/27749#issuecomment-272665163 Fixes #27749
2017-01-25std: Stabilize APIs for the 1.16.0 releaseAlex Crichton-7/+3
This commit applies the stabilization/deprecations of the 1.16.0 release, as tracked by the rust-lang/rust issue tracker and the final-comment-period tag. The following APIs were stabilized: * `VecDeque::truncate` * `VecDeque::resize` * `String::insert_str` * `Duration::checked_{add,sub,div,mul}` * `str::replacen` * `SocketAddr::is_ipv{4,6}` * `IpAddr::is_ipv{4,6}` * `str::repeat` * `Vec::dedup_by` * `Vec::dedup_by_key` * `Result::unwrap_or_default` * `<*const T>::wrapping_offset` * `<*mut T>::wrapping_offset` * `CommandExt::creation_flags` (on Windows) * `File::set_permissions` * `String::split_off` The following APIs were deprecated * `EnumSet` - replaced with other ecosystem abstractions, long since unstable Closes #27788 Closes #35553 Closes #35774 Closes #36436 Closes #36949 Closes #37079 Closes #37087 Closes #37516 Closes #37827 Closes #37916 Closes #37966 Closes #38080
2017-01-25Rollup merge of #38930 - insaneinside:place-left-arrow-syntax-docs, r=brsonGuillaume Gomez-8/+8
Updates to src/libcore/ops.rs docs for RFC#1228 (Placement Left Arrow) Also fixed a minor typo in docs for `core::ops::Place`.
2017-01-24Extend Cell to work with non-Copy typesWesley Wiser-36/+94
Part of #39264
2017-01-24Remove Reflectest31-57/+0
* Remove the Reflect trait * Remove the "reflect" lang feature
2017-01-24add explanation, fix testAndre Bogus-0/+11
2017-01-20Revert previous commitGeoff Yoerger-4/+0
2017-01-19Clarify the `default` option to useGeoff Yoerger-1/+6
2017-01-19Into item level docs (enum Ordering)Geoff Yoerger-0/+2
2017-01-19'.'Geoff Yoerger-1/+1
2017-01-19Module level docGeoff Yoerger-1/+2
2017-01-17Add warning about varying hashes/orderingsSean Leffler-0/+4
2017-01-17Auto merge of #37972 - bluss:iter-find-is-on-a-roll, r=sfacklerbors-14/+185
Improve the slice iterator's searching methods Improve all, any, find, position, rposition by explicitly unrolling the loop for the slice iterators. - Introduce a few extension methods and functions for raw pointers make the new code easy to express - Introduce helper methods `search_while, rsearch_while` that generalize all the searching methods LLVM doesn't unroll the loop in `.find()` by default (clang is the same), so performance benefits a lot from explicit unrolling here. An iterator method without conditional exits (like `.fold()`) does not need this on the other hand. One of the raw pointer extension methods is `fn post_inc(&mut self) -> Self` which is the rustic equivalent of “`ptr++`”, and it is a nice way to express the raw pointer loop (see commit 3). Specific development notes about `search_while`: I tried both computing an end pointer "rounded" to 4, as well as the `ptrdistance >= 4` loop condition, ptrdistance was better. I tried handling the last 0-3 elements unrolled or with a while loop, the loop was better.
2017-01-17fix style nitsAndre Bogus-7/+6
2017-01-16Rollup merge of #38247 - federicomenaquintero:assert-eq-argument-docs, ↵Guillaume Gomez-1/+12
r=GuillaumeGomez Document the optional extra arguments to assert_eq!() / assert_ne!() And clarify that those arguments in assert!() are in fact formattable.
2017-01-16branchless .filter(_).count()Andre Bogus-0/+10
2017-01-14Auto merge of #38982 - clarcharr:expect_err, r=aturonbors-0/+25
expect_err for Result. This adds an `expect_err` method to `Result`. Considering how `unwrap_err` already exists, this seems to make sense. Inconsistency noted in Manishearth/rust-clippy#1435.
2017-01-13expect_err for Result.Clar Charr-0/+25
2017-01-13Rollup merge of #39024 - stjepang:owned-to-string, r=steveklabnikGuillaume Gomez-8/+8
Change `to_owned` to `to_string` in docs We should teach conversion from `str` to `String` using `to_string` rather than the legacy `to_owned`.
2017-01-13Rollup merge of #38995 - petrochenkov:minmax, r=GuillaumeGomezGuillaume Gomez-10/+10
Fix docs for min/max algorithms I thought at first "what did they think about when stabilizing this!?", but it turned out it's just wrong docs. Phew. r? @steveklabnik Test: ``` use std::cmp::Ordering; struct S(u8, u8); impl PartialEq for S { fn eq(&self, other: &Self) -> bool { self.0 == other.0 } } impl PartialOrd for S { fn partial_cmp(&self, other: &Self) -> Option<Ordering> { Some(self.0.cmp(&other.0)) } } impl Ord for S { fn cmp(&self, other: &Self) -> Ordering { self.0.cmp(&other.0) } } fn main() { let arr = [S(0, 1), S(0, 2)]; println!("min {:?}", arr.iter().min()); println!("min_by {:?}", arr.iter().min_by(|x, y| x.0.cmp(&y.0))); println!("min_by_key {:?}", arr.iter().min_by_key(|x| x.0)); println!("max {:?}", arr.iter().max()); println!("max_by {:?}", arr.iter().max_by(|x, y| x.0.cmp(&y.0))); println!("max_by_key {:?}", arr.iter().max_by_key(|x| x.0)); } ``` Output: ``` rustc 1.15.0-beta.3 (a035041ba 2017-01-07) min Some(S(0, 1)) min_by Some(S(0, 1)) min_by_key Some(S(0, 1)) max Some(S(0, 2)) max_by Some(S(0, 2)) max_by_key Some(S(0, 2)) ```
2017-01-13Rollup merge of #38636 - shahn:extend, r=steveklabnikGuillaume Gomez-1/+4
Clarify Extend behaviour wrt existing keys This seems to be consistent with all the Extend implementations I found, and isn't documented anywhere else afaik.
2017-01-13Auto merge of #38909 - clarcharr:char_struct_display, r=alexcrichtonbors-1/+28
Implement Display for char Escape*, To*case. See: rust-lang/rfcs#1848. A good example of where this is useful would be in the example `print!("{}", 'ß'.to_uppercase())`. Not sure if this requires a formal RFC, but I decided to write the code for it anyway regardless.
2017-01-13Change `to_owned` to `to_string` in docsStjepan Glavina-8/+8
We should teach conversion from `str` to `String` using `to_string` rather than the legacy `to_owned`.
2017-01-12Auto merge of #37926 - bluss:from-utf8-small-simplification, r=sfacklerbors-27/+26
UTF-8 validation: Compute block end upfront Simplify the conditional used for ensuring that the whole word loop is only used if there are at least two whole words left to read. This makes the function slightly smaller and simpler, a 0-5% reduction in runtime for various test cases.
2017-01-11Document the optional extra arguments to assert_eq!() / assert_ne!()Federico Mena Quintero-1/+12
And clarify that those arguments in assert!() are in fact formattable.
2017-01-11Implement Display for char Escape*, To*case.Clar Charr-1/+28
2017-01-11Fix docs for min/max algorithmsVadim Petrochenkov-10/+10
2017-01-10Add PartialOrd, Ord derivations to TypeIdSean Leffler-1/+1
I want to be able to sort a `Vec` of types which contain `TypeId`s, so an `Ord` derivation would be very useful to me. `Hash` already exists, so the missing `PartialOrd` and `Ord` derivations feel like an oversight to me.
2017-01-10Implement `iter::Sum` and `iter::Product` for `Result`Jake Goulding-0/+81
This introduces a private iterator adapter `ResultShunt`, which allows treating an iterator of `Result<T, E>` as an iterator of `T`.
2017-01-10Add 128-bit atomicsAmanieu d'Antras-0/+18
2017-01-10Rollup merge of #38816 - Manishearth:coercion-doc, r=GuillaumeGomezSeo Sanghyeon-1/+43
Add more docs for CoerceUnsized and Unsize here be dragons r? @ubsan @steveklabnik
2017-01-09Auto merge of #38310 - frewsxcv:ctlz-cttz, r=pnkfelixbors-2/+50
Clarify zero-value behavior of `ctlz`/`cttz` intrinsics. Fixes https://github.com/rust-lang/rust/issues/34381.
2017-01-09Auto merge of #38910 - steveklabnik:update_docs, r=eddybbors-1/+4
Improve safety warning on ptr::swap r? @eddyb @bluss , who I asked about this on IRC
2017-01-08Updates to src/libcore/ops.rs for RFC#1228 (Placement Left Arrow)Collin J. Sutton-8/+8
Also fixed a minor typo in docs for `core::ops::Place`.
2017-01-08Auto merge of #38861 - est31:master, r=alexcrichtonbors-24/+26
Make members of {std,core}::{i128,u128} unstable Fixes #38860
2017-01-08Auto merge of #38679 - alexcrichton:always-deny-warnings, r=nrcbors-1/+1
Remove not(stage0) from deny(warnings) Historically this was done to accommodate bugs in lints, but there hasn't been a bug in a lint since this feature was added which the warnings affected. Let's completely purge warnings from all our stages by denying warnings in all stages. This will also assist in tracking down `stage0` code to be removed whenever we're updating the bootstrap compiler.
2017-01-07thanks @eddybSteve Klabnik-1/+1
2017-01-07Improve safety warning on ptr::swapSteve Klabnik-1/+4
2017-01-07Auto merge of #38469 - tbu-:pr_writeln_no_args, r=brsonbors-1/+5
Allow `writeln!` without arguments, in symmetry with `println!` CC #36825.
2017-01-06Make members of {std,core}::{i128,u128} unstableest31-24/+26
Adding it in a stable form was an accident. It thankfully only leaked to nightly. Fixes #38860
2017-01-05Auto merge of #38152 - arielb1:special-copy, r=nikomatsakisbors-4/+2
Fix associated types in copy implementations Fixes an ICE and an error in checking copy implementations. r? @nikomatsakis
2017-01-05For Extend, document collections allowing duplicate keysSebastian Hahn-1/+3