summary refs log tree commit diff
path: root/src/libcoretest
AgeCommit message (Collapse)AuthorLines
2017-01-27Rollup merge of #39307 - alexcrichton:stabilize-1.16, r=brsonAlex Crichton-1/+0
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-25std: Stabilize APIs for the 1.16.0 releaseAlex Crichton-1/+0
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-22Remove a FIXME in core/hash testsWesley Wiser-3/+2
2017-01-14Auto merge of #38982 - clarcharr:expect_err, r=aturonbors-0/+14
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/+14
2017-01-11Implement Display for char Escape*, To*case.Clar Charr-125/+99
2017-01-10Implement `iter::Sum` and `iter::Product` for `Result`Jake Goulding-0/+16
This introduces a private iterator adapter `ResultShunt`, which allows treating an iterator of `Result<T, E>` as an iterator of `T`.
2016-12-16Address falloutAaron Turon-19/+22
2016-12-13Auto merge of #38309 - sfackler:rfc-1725, r=alexcrichtonbors-0/+24
Implement RFC #1725 (read_unaligned, write_unaligned) cc #37955 r? @alexcrichton
2016-12-12Implement RFC #1725Steven Fackler-0/+24
cc #37955
2016-11-30Rename 'librustc_unicode' crate to 'libstd_unicode'.Corey Farwell-1/+1
Fixes #26554.
2016-11-26Overload get{,_mut}{,_unchecked}Steven Fackler-0/+44
2016-11-22Auto merge of #37834 - bluss:peek-none, r=BurntSushibors-0/+68
Make Peekable remember peeking a None Peekable should remember if a None has been seen in the `.peek()` method. It ensures that `.peek(); .peek();` or `.peek(); .next();` only advances the underlying iterator at most once. This does not by itself make the iterator fused. Thanks to @s3bk for the code in `fn peek()` itself. Fixes #37784
2016-11-21Auto merge of #37127 - jseyfried:stabilize_RFC_1560, r=nrcbors-2/+0
Stabilize RFC 1560 Fixes #13598, fixes #23157, fixes #32303. cc #35120 r? @nrc
2016-11-21Stabilize RFC 1560.Jeffrey Seyfried-2/+0
2016-11-18Fix `fmt::Debug` for strings, e.g. for Chinese charactersTobias Bucher-0/+2
The problem occured due to lines like ``` 3400;<CJK Ideograph Extension A, First>;Lo;0;L;;;;;N;;;;; 4DB5;<CJK Ideograph Extension A, Last>;Lo;0;L;;;;;N;;;;; ``` in `UnicodeData.txt`, which the script previously interpreted as two characters, although it represents the whole range. Fixes #34318.
2016-11-17core::iter: Peekable should remember peeking a NoneUlrik Sverdrup-0/+68
Peekable must remember if a None has been seen in the `.peek()` method. It ensures that `.peek(); .peek();` or `.peek(); .next();` only advances the underlying iterator at most once. This does not by itself make the iterator fused.
2016-11-01Merge branch 'master' of https://github.com/rust-lang/rustMarcin Fatyga-9/+60
Conflicts: src/libcoretest/lib.rs
2016-11-01Auto merge of #37299 - devonhollowood:result-unwrap-or-default, r=alexcrichtonbors-0/+7
Add `unwrap_or_default` method to `Result` Fixes #37025
2016-10-27Rename ordering chaining functions.Marcin Fatyga-20/+20
2016-10-26Auto merge of #37315 - bluss:fold-more, r=alexcrichtonbors-0/+12
Implement Iterator::fold for .chain(), .cloned(), .map() and the VecDeque iterators. Chain can do something interesting here where it passes on the fold into its inner iterators. The lets the underlying iterator's custom fold() be used, and skips the regular chain logic in next. Also implement .fold() specifically for .map() and .cloned() so that any inner fold improvements are available through map and cloned. The same way, a VecDeque iterator fold can be turned into two slice folds. These changes lend the power of the slice iterator's loop codegen to VecDeque, and to chains of slice iterators, and so on. It's an improvement for .sum() and .product(), and other uses of fold.
2016-10-25iter: Implement .fold() for .chain()Ulrik Sverdrup-0/+12
Chain can do something interesting here where it passes on the fold into its inner iterators. The lets the underlying iterator's custom fold() be used, and skips the regular chain logic in next.
2016-10-25Small improvement to SipHasherarthurprs-0/+21
2016-10-21Fix use of `result_unwrap_or_default` featureDevon Hollowood-2/+1
2016-10-21Fix `test_unwrap_or_default`Devon Hollowood-0/+2
2016-10-19Add `unwrap_or_default` method to `Result`Devon Hollowood-0/+6
2016-10-09Add or and or_else for ordering.Marcin Fatyga-0/+27
2016-10-03Auto merge of #36815 - alexcrichton:stabilize-1.13, r=aturonbors-0/+3
std: Stabilize and deprecate APIs for 1.13 This commit is intended to be backported to the 1.13 branch, and works with the following APIs: Stabilized * `i32::checked_abs` * `i32::wrapping_abs` * `i32::overflowing_abs` * `RefCell::try_borrow` * `RefCell::try_borrow_mut` Deprecated * `BinaryHeap::push_pop` * `BinaryHeap::replace` * `SipHash13` * `SipHash24` * `SipHasher` - use `DefaultHasher` instead in the `std::collections::hash_map` module Closes #28147 Closes #34767 Closes #35057 Closes #35070
2016-10-03std: Stabilize and deprecate APIs for 1.13Alex Crichton-0/+3
This commit is intended to be backported to the 1.13 branch, and works with the following APIs: Stabilized * `i32::checked_abs` * `i32::wrapping_abs` * `i32::overflowing_abs` * `RefCell::try_borrow` * `RefCell::try_borrow_mut` * `DefaultHasher` * `DefaultHasher::new` * `DefaultHasher::default` Deprecated * `BinaryHeap::push_pop` * `BinaryHeap::replace` * `SipHash13` * `SipHash24` * `SipHasher` - use `DefaultHasher` instead in the `std::collections::hash_map` module Closes #28147 Closes #34767 Closes #35057 Closes #35070
2016-09-30Call emcc with ERROR_ON_UNDEFINED_SYMBOLSBrian Anderson-2/+5
2016-09-30Ignore another emscripten test because missing intrinsicsBrian Anderson-0/+2
2016-09-28[breaking-change] std: change `encode_utf{8,16}()` to take a buffer and ↵tormol-9/+12
return a slice They panic if the buffer is too small.
2016-09-02Auto merge of #35856 - phimuemue:master, r=brsonbors-0/+14
Introduce max_by/min_by on iterators See https://github.com/rust-lang/rfcs/issues/1722 for reference. It seems that there is `min`, `max` (simple computation of min/max), `min_by_key`, `max_by_key` (min/max by comparing mapped values) but no `min_by` and `max_by` (min/max according to comparison function). However, e.g. on vectors or slices there is `sort`, `sort_by_key` and `sort_by`.
2016-09-01Auto merge of #35755 - SimonSapin:char_convert, r=alexcrichtonbors-0/+18
Implement std::convert traits for char This is motivated by avoiding the `as` operator, which sometimes silently truncates, and instead use conversions that are explicitly lossless and infallible. I’m less certain that `From<u8> for char` should be implemented: while it matches an existing behavior of `as`, it’s not necessarily the right thing to use for non-ASCII bytes. It effectively decodes bytes as ISO/IEC 8859-1 (since Unicode designed its first 256 code points to be compatible with that encoding), but that is not apparent in the API name.
2016-08-29Fix the test_variadic_ptr fn on printf-less sysSimonas Kazlauskas-4/+8
Fixes #36076
2016-08-29Implement TryFrom<u32> for charSimon Sapin-0/+10
For symmetry with From<char> for u32.
2016-08-29Implement From<char> for u32, and From<u8> for charSimon Sapin-0/+8
These fit with other From implementations between integer types. This helps the coding style of avoiding the 'as' operator that sometimes silently truncates, and signals that these specific conversions are lossless and infaillible.
2016-08-23Yield Err in char::decode_utf8 per Unicode, like String::from_utf8_lossySimon Sapin-1/+20
2016-08-23Use a macro in test_decode_utf8 to preserve line numbers in panic messages.Simon Sapin-24/+26
2016-08-20Introduce max_by/min_by on iteratorsphilipp-0/+14
2016-08-19std: Stabilize APIs for the 1.12 releaseAlex Crichton-6/+5
Stabilized * `Cell::as_ptr` * `RefCell::as_ptr` * `IpAddr::is_{unspecified,loopback,multicast}` * `Ipv6Addr::octets` * `LinkedList::contains` * `VecDeque::contains` * `ExitStatusExt::from_raw` - both on Unix and Windows * `Receiver::recv_timeout` * `RecvTimeoutError` * `BinaryHeap::peek_mut` * `PeekMut` * `iter::Product` * `iter::Sum` * `OccupiedEntry::remove_entry` * `VacantEntry::into_key` Deprecated * `Cell::as_unsafe_cell` * `RefCell::as_unsafe_cell` * `OccupiedEntry::remove_pair` Closes #27708 cc #27709 Closes #32313 Closes #32630 Closes #32713 Closes #34029 Closes #34392 Closes #34285 Closes #34529
2016-07-31Don't gate methods `Fn(Mut,Once)::call(mut,once)` with feature ↵Vadim Petrochenkov-1/+0
`unboxed_closures` They are already gated with feature `fn_traits`
2016-07-28Rename `char::escape` to `char::escape_debug` and add tracking issueTobias Bucher-3/+4
2016-07-26Restore `char::escape_default` and add `char::escape` insteadTobias Bucher-2/+45
2016-07-23Escape fewer Unicode codepoints in `Debug` impl of `str`Tobias Bucher-3/+13
Use the same procedure as Python to determine whether a character is printable, described in [PEP 3138]. In particular, this means that the following character classes are escaped: - Cc (Other, Control) - Cf (Other, Format) - Cs (Other, Surrogate), even though they can't appear in Rust strings - Co (Other, Private Use) - Cn (Other, Not Assigned) - Zl (Separator, Line) - Zp (Separator, Paragraph) - Zs (Separator, Space), except for the ASCII space `' '` (`0x20`) This allows for user-friendly inspection of strings that are not English (e.g. compare `"\u{e9}\u{e8}\u{ea}"` to `"éèê"`). Fixes #34318. [PEP 3138]: https://www.python.org/dev/peps/pep-3138/
2016-07-17Implement traits for variadic function pointersVadim Petrochenkov-0/+14
2016-07-14Auto merge of #33907 - strake:decode_utf8, r=alexcrichtonbors-0/+30
add core::char::DecodeUtf8 See [issue](https://github.com/rust-lang/rust/issues/33906)
2016-07-13add core::char::DecodeUtf8M Farkas-Dyck-0/+30
2016-07-03Auto merge of #34530 - alexcrichton:stabilize-1.11, r=aturonbors-22/+45
std: Stabilize APIs for the 1.11.0 release Although the set of APIs being stabilized this release is relatively small, the trains keep going! Listed below are the APIs in the standard library which have either transitioned from unstable to stable or those from unstable to deprecated. Stable * `BTreeMap::{append, split_off}` * `BTreeSet::{append, split_off}` * `Cell::get_mut` * `RefCell::get_mut` * `BinaryHeap::append` * `{f32, f64}::{to_degrees, to_radians}` - libcore stabilizations mirroring past libstd stabilizations * `Iterator::sum` * `Iterator::product` Deprecated * `{f32, f64}::next_after` * `{f32, f64}::integer_decode` * `{f32, f64}::ldexp` * `{f32, f64}::frexp` * `num::One` * `num::Zero` Added APIs (all unstable) * `iter::Sum` * `iter::Product` * `iter::Step` - a few methods were added to accomodate deprecation of One/Zero Removed APIs * `From<Range<T>> for RangeInclusive<T>` - everything about `RangeInclusive` is unstable Closes #27739 Closes #27752 Closes #32526 Closes #33444 Closes #34152 cc #34529 (new tracking issue)
2016-07-03std: Stabilize APIs for the 1.11.0 releaseAlex Crichton-22/+45
Although the set of APIs being stabilized this release is relatively small, the trains keep going! Listed below are the APIs in the standard library which have either transitioned from unstable to stable or those from unstable to deprecated. Stable * `BTreeMap::{append, split_off}` * `BTreeSet::{append, split_off}` * `Cell::get_mut` * `RefCell::get_mut` * `BinaryHeap::append` * `{f32, f64}::{to_degrees, to_radians}` - libcore stabilizations mirroring past libstd stabilizations * `Iterator::sum` * `Iterator::product` Deprecated * `{f32, f64}::next_after` * `{f32, f64}::integer_decode` * `{f32, f64}::ldexp` * `{f32, f64}::frexp` * `num::One` * `num::Zero` Added APIs (all unstable) * `iter::Sum` * `iter::Product` * `iter::Step` - a few methods were added to accomodate deprecation of One/Zero Removed APIs * `From<Range<T>> for RangeInclusive<T>` - everything about `RangeInclusive` is unstable Closes #27739 Closes #27752 Closes #32526 Closes #33444 Closes #34152 cc #34529 (new tracking issue)