about summary refs log tree commit diff
path: root/src/libcore
AgeCommit message (Collapse)AuthorLines
2018-03-19Auto merge of #49108 - SimonSapin:sip, r=TimNNbors-53/+22
Remove or hide deprecated unstable SipHasher{13,24} Deprecated since Rust 1.13.0.
2018-03-19Fix trailing whitespacePhlosioneer-1/+1
2018-03-19Make Wrapping::pow use wrapping_pow, add examplePhlosioneer-4/+14
2018-03-19Impl Integer methods for WrappingPhlosioneer-0/+299
Wrapping<T> now implements: count_ones, count_zeros, leading_zeros, trailing_zeros, rotate_left, rotate_right, swap_bytes, from_be, from_le, to_be, to_le, and pow where T is: u8, u16, u32, u64, usize, i8, i16, i32, i64, or isize. Docs were written for all these methods, as well as examples. The examples mirror the ones on u8, u16, etc... for consistency. Closes #32463
2018-03-19Auto merge of #48978 - SimonSapin:debug-hex, r=KodrAusbors-2/+20
Add hexadecimal formatting of integers with fmt::Debug This can be used for integers within a larger types which implements Debug (possibly through derive) but not fmt::UpperHex or fmt::LowerHex. ```rust assert!(format!("{:02x?}", b"Foo\0") == "[46, 6f, 6f, 00]"); assert!(format!("{:02X?}", b"Foo\0") == "[46, 6F, 6F, 00]"); ``` RFC: https://github.com/rust-lang/rfcs/pull/2226 The new formatting string syntax (`x?` and `X?`) is insta-stable in this PR because I don’t know how to change a built-in proc macro’s behavior based of a feature gate. I can look into adding that, but I also strongly suspect that keeping this feature unstable for a time period would not be useful as possibly no-one would use it during that time. This PR does not add the new (public) `fmt::Formatter` proposed in the API because: * There was some skepticism on response to this part of the RFC * It is not possible to implement as-is without larger changes to `fmt`, because `Formatter` at the moment has no easy way to tell apart for example `Octal` from `Binary`: it only has a function pointer for the relevant `fmt()` method. If some integer-like type outside of `std` want to implement this behavior, another RFC will likely need to propose a different public API for `Formatter`.
2018-03-18Update tracking issue.boats-15/+15
2018-03-18num::NonZero* types now have their own tracking issue: #49137Simon Sapin-8/+3
Fixes #27730
2018-03-18Fix formatting.Martin Hoffmann-2/+0
2018-03-17Remove deprecated unstable ptr::Shared type alias.Simon Sapin-8/+2
It has been deprecated for about one release cycle.
2018-03-17Test NonZero in a const item in a pattern.Simon Sapin-0/+23
(This was buggy before https://github.com/rust-lang/rust/pull/46882)
2018-03-17Stop using deprecated NonZero APIsSimon Sapin-10/+18
These will eventually be removed (though the NonZero<T> lang item will likely stay).
2018-03-17Deprecate core::nonzero in favor of ptr::NonNull and num::NonZero*Simon Sapin-4/+16
2018-03-17Use num::NonZero* instead of NonZero<_> in rustc and testsSimon Sapin-7/+7
2018-03-17Add 12 num::NonZero* types for each primitive integerSimon Sapin-1/+88
RFC: https://github.com/rust-lang/rfcs/pull/2307
2018-03-17update FIXME(#23442) to point to issue 45742 (Blanket impl of AsRef for Deref)Niv Kaminer-2/+2
2018-03-17update FIXME(#6393) to point to issue 43234 (tracking issue for non-lexical ↵Niv Kaminer-1/+1
lifetimes)
2018-03-17Rewrite the documentation for BorrowMut.Martin Hoffmann-1/+5
2018-03-17Bring back the phrase 'borrowing as' for what Borrow does.Martin Hoffmann-25/+22
2018-03-17Mark deprecated unstable SipHasher13 as a doc-hidden impl detail of HashMap.Simon Sapin-7/+9
It stays in libcore rather than being private in HashMap’s module because it shares code with the deprecated *stable* `SipHasher` type.
2018-03-17Add an example of lossy decoding to str::Utf8Error docsSimon Sapin-0/+31
2018-03-17Make the deprecated unstable SipHasher24 type private.Simon Sapin-46/+13
It is still used by the deprecated *stable* `SipHasher` type.
2018-03-17Use associated consts for GenericRadix base and prefixMike Hommey-17/+15
2018-03-17Use an uninitialized buffer in GenericRadix::fmt_int, like in Display::fmt ↵Mike Hommey-1/+1
for numeric types The code using a slice of that buffer is only ever going to use bytes that are subsequently initialized.
2018-03-17Remove core::fmt::num::DecimalMike Hommey-5/+0
Before ebf9e1aaf6, it was used for Display::fmt, but ebf9e1aaf6 replaced that with a faster implementation, and nothing else uses it.
2018-03-16Add From<!> for TryFromIntErrorAndrew Cann-0/+7
2018-03-16Auto merge of #48813 - sinkuu:build_in_assert_macro, r=alexcrichtonbors-0/+15
Make `assert` a built-in procedural macro Makes `assert` macro a built-in one without touching its functionality. This is a prerequisite for RFC 2011 (#44838).
2018-03-16Auto merge of #49051 - kennytm:rollup, r=kennytmbors-1/+1
Rollup of 17 pull requests - Successful merges: #48706, #48875, #48892, #48922, #48957, #48959, #48961, #48965, #49007, #49024, #49042, #49050, #48853, #48990, #49037, #49049, #48972 - Failed merges:
2018-03-15Pin and PinBox are fundamental.boats-0/+1
2018-03-15unstabilize FusedIterator for Flatten since Flatten is unstableMazdak Farrokhzad-1/+1
2018-03-15Auto merge of #47813 - kennytm:stable-incl-range, r=nrcbors-57/+30
Stabilize inclusive range (`..=`) Stabilize the followings: * `inclusive_range` — The `std::ops::RangeInclusive` and `std::ops::RangeInclusiveTo` types, except its fields (tracked by #49022 separately). * `inclusive_range_syntax` — The `a..=b` and `..=b` expression syntax * `dotdoteq_in_patterns` — Using `a..=b` in a pattern cc #28237 r? @rust-lang/lang
2018-03-15Auto merge of #48138 - estebank:issue-45092, r=nikomatsakisbors-1/+14
Reword E0044 and message for `!Send` types - Reword E0044 help. - Change error message for types that don't implement `Send` CC #45092, #46678, #24909, #33307.
2018-03-15Keep the fields of RangeInclusive unstable.kennytm-2/+5
2018-03-15Stabilize `inclusive_range_syntax` language feature.kennytm-15/+8
Stabilize the syntax `a..=b` and `..=b`.
2018-03-15Stabilize `inclusive_range` library feature.kennytm-45/+22
Stabilize std::ops::RangeInclusive and std::ops::RangeInclusiveTo.
2018-03-15replace `convert::Infallible` with `!`Andrew Cann-33/+6
2018-03-14Review comment: remove mention of `move` closureEsteban Küber-8/+10
2018-03-14Make hint clearer, with the potential of being wrongEsteban Küber-2/+2
2018-03-14Suggest using `move` when trying to share `...::channel::{Receiver, Sender}`Esteban Küber-0/+8
Extend `rustc_on_unimplemented` to match on ADT without evaluating type arguments.
2018-03-14Reword E0044 and message for `!Send` typesEsteban Küber-1/+4
- Reword E0044 help. - Change error message for types that don't implement `Send`
2018-03-14Auto merge of #47630 - canndrew:exhaustive-patterns, r=nikomatsakisbors-7/+8
Stabilise feature(never_type). Introduce feature(exhaustive_patterns) This stabilizes `!`, removing the feature gate as well as the old defaulting-to-`()` behavior. The pattern exhaustiveness checks which were covered by `feature(never_type)` have been moved behind a new `feature(exhaustive_patterns)` gate.
2018-03-14Pin and Unpin in libcore.boats-2/+119
2018-03-15Rollup merge of #48970 - GuillaumeGomez:doc-examples, r=QuietMisdreavuskennytm-2/+134
Add missing examples r? @QuietMisdreavus
2018-03-14change never_type stabilisation versionAndrew Cann-6/+6
2018-03-14Fix version numberAndrew Cann-6/+6
2018-03-14stabilise feature(never_type)Andrew Cann-7/+8
Replace feature(never_type) with feature(exhaustive_patterns). feature(exhaustive_patterns) only covers the pattern-exhaustives checks that used to be covered by feature(never_type)
2018-03-13Auto merge of #48735 - 1011X:master, r=alexcrichtonbors-0/+510
Move ascii::escape_default to libcore As requested in #46409, the `ascii::escape_default` method has been added to the core library. All I did was copy over the `std::ascii` module file, remove the (redundant) `AsciiExt` trait, and change some of the documentation to match. None of the tests were changed. I wasn't sure how to handle the annotations. For `EscapeDefault` and `escape_default()`, I changed them to `#[unstable(feature = "core_ascii", issue = "46409")]`. Is that alright? Or should I leave them as they were?
2018-03-13Add hexadecimal formatting of integers with fmt::DebugSimon Sapin-2/+20
This can be used for integers within a larger types which implements Debug (possibly through derive) but not fmt::UpperHex or fmt::LowerHex. ```rust assert!(format!("{:02x?}", b"Foo\0") == "[46, 6f, 6f, 00]"); assert!(format!("{:02X?}", b"Foo\0") == "[46, 6F, 6F, 00]"); ``` RFC: https://github.com/rust-lang/rfcs/pull/2226
2018-03-12Add missing examplesGuillaume Gomez-2/+134
2018-03-13Rollup merge of #48954 - GuillaumeGomez:missing-links-fmt, r=QuietMisdreavuskennytm-4/+8
Add missing links
2018-03-12Add missing linksGuillaume Gomez-4/+8