about summary refs log tree commit diff
path: root/src/libcore
AgeCommit message (Collapse)AuthorLines
2018-06-04Move slice::exact_chunks directly above exact_chunks_mut for more consistent ↵Sebastian Dröge-35/+35
docs order See https://github.com/rust-lang/rust/issues/47115#issuecomment-392532855
2018-06-03Rollup merge of #51326 - sdroege:slice-iter-cleanup, r=dtolnayMark Simulacrum-16/+22
Various minor slice iterator cleanups See individual commits
2018-06-03Rollup merge of #51299 - faern:const-int-ops, r=oli-obkMark Simulacrum-14/+281
const fn integer operations A follow up to #51171 Fixes #51267 Makes a lot of the integer methods (`swap_bytes`, `count_ones` etc) `const fn`s. See #51267 for a discussion about why this is wanted and the solution used.
2018-06-03Implement TrustedLen for Windows and the 4 Chunks iteratorsSebastian Dröge-0/+15
2018-06-03Remove mention of Slice/SliceMut traits from IterMut documentationSebastian Dröge-3/+1
These don't exist anymore.
2018-06-03Move TrustedLen and FusedIterator impl of Iter/IterMut into macroSebastian Dröge-13/+6
2018-06-03undo payload in core::panic! changesJorge Aparicio-47/+7
2018-06-03document that `panic_impl` never passes the FFI boundaryJorge Aparicio-1/+2
2018-06-03remove unused `struct NoPayload`Jorge Aparicio-2/+0
2018-06-03s/panic_fmt/panic_impl/g in docsJorge Aparicio-1/+1
2018-06-03implement #[panic_implementation]Jorge Aparicio-2/+66
2018-06-02Rollup merge of #51306 - kennytm:impl-default-for-mut-str, r=SimonSapinMark Simulacrum-0/+6
impl Default for &mut str Rationale: There is already `impl Default for &mut [T]`. Note: This impl is insta-stable.
2018-06-02Rollup merge of #51226 - gnzlbg:nonzero_align, r=SimonSapinMark Simulacrum-37/+43
Make Layout's align a NonZeroUsize This PR makes the `Layout`'s align field a `NonZeroUsize` since it cannot ever be zero, not even while building a `Layout`. It also contains some drive-by minor cleanups over the docs and the code, like updating the documented error types, or using the `size()` and `align()` methods instead of accessing the fields directly (the latter was required for the `NonZeroUsize` change anyways). r? @SimonSapin cc @Amanieu
2018-06-02Rollup merge of #51147 - tmccombs:sliceindex, r=SimonSapinMark Simulacrum-2/+30
Stabilize SliceIndex trait. CC #35729 According to recommendations in https://github.com/rust-lang/rust/issues/35729#issuecomment-377784884
2018-06-02Rollup merge of #51124 - frewsxcv:frewsxcv-replace, r=QuietMisdreavusMark Simulacrum-4/+6
Reword {ptr,mem}::replace docs. Fixes https://github.com/rust-lang/rust/issues/50657.
2018-06-02Rollup merge of #50919 - frewsxcv:frewsxcv-epsilon, r=steveklabnikMark Simulacrum-2/+10
Provide more context for what the {f32,f64}::EPSILON values represent. Introduce the 'machine epsilon' term because if one googles 'epsilon', they might stumble upon https://en.wikipedia.org/wiki/Epsilon_numbers_(mathematics) instead of https://en.wikipedia.org/wiki/Machine_epsilon
2018-06-02Rollup merge of #50167 - fintelia:duration-nanos, r=sfacklerMark Simulacrum-0/+51
Add as_nanos function to Duration Duration has historically lacked a way to get the actual number of nanoseconds it contained as a normal Rust type because u64 was of insufficient range, and f64 of insufficient precision. The u128 type solves both issues, so I propose adding an `as_nanos` function to expose the capability.
2018-06-03impl Default for &mut strkennytm-0/+6
2018-06-02add missing inline's and optimizationsgnzlbg-4/+11
2018-06-02remove debug_assert in padding_needed_forgnzlbg-3/+0
2018-06-02Make integer methods non-const in stage0Linus Färnstrand-0/+192
2018-06-02Make most integer operations const fnsLinus Färnstrand-40/+115
2018-06-02Auto merge of #50554 - clarcharr:from_bool, r=TimNNbors-2/+39
Add From<bool> for int types Fixes #46109.
2018-06-01Reword {ptr,mem}::replace docs.Corey Farwell-4/+6
Fixes https://github.com/rust-lang/rust/issues/50657.
2018-06-01Rollup merge of #51262 - GuillaumeGomez:add-missing-whitespace, ↵Mark Simulacrum-1/+1
r=QuietMisdreavus Add missing whitespace in num example r? @QuietMisdreavus
2018-06-01Rollup merge of #51152 - crlf0710:patch-1, r=kennytmMark Simulacrum-1/+1
Replace `if` with `if and only if` in the definition dox of `Sync` The old text was: "The precise definition is: a type `T` is `Sync` if `&T` is Send." Since we've also got ``` impl<'a, T> Send for &'a T where T: Sync + ?Sized, ``` I purpose we can change the `if` to `if and only if` to make it more precise.
2018-06-01Add @ithinuel's tests from #50597Clar Charr-0/+21
2018-06-01Fix ambiguity in Result testClar Charr-2/+4
2018-06-01Add From<bool> for int typesClar Charr-0/+14
2018-06-01Simplify HashMap layout calculation by using LayoutAmanieu d'Antras-0/+8
2018-06-01Stabilize SliceIndex trait.Thayne McCombs-2/+30
Fixes #35729 According to recommendations in https://github.com/rust-lang/rust/issues/35729#issuecomment-377784884
2018-06-01Replace `if` with `if and only if` in the definition dox of `Sync`CrLF0710-1/+1
The old text was: "The precise definition is: a type T is Sync if &T is Send." Since we've also got ``` impl<'a, T> Send for &'a T where T: Sync + ?Sized, ``` I purpose we can change the `if` to `if and only if` to make it more precise.
2018-06-01Auto merge of #50836 - jsgf:arc-downcast, r=SimonSapinbors-1/+91
Arc downcast Implement `downcast` for `Arc<Any + Send + Sync>` as part of #44608, and gated by the same `rc_downcast` feature. This PR is mostly lightly-edited cut'n'paste. This has two additional changes: - The `downcast` implementation needs `Any + Send + Sync` implementations for `is` and `Debug`, and I added `downcast_ref` and `downcast_mut` for completeness/consistency. (Can these be insta-stabilized?) - At @SimonSapin's suggestion, I converted `Arc` and `Rc` to use `NonNull::cast` to avoid an `unsafe` block in each which tidied things up nicely.
2018-06-01Add missing whitespace in num exampleGuillaume Gomez-1/+1
2018-05-31Fix up Any doc examplesJeremy Fitzhardinge-3/+3
Make the Any+Send+Sync examples use the right trait bounds, and fix a small whitespace issue.
2018-05-31Add implementations for Any + Send + SyncJeremy Fitzhardinge-0/+90
Implement `is`, `downcast_ref`, `downcast_mut` and `Debug` for `Any + Send + Sync`.
2018-05-31Rollup merge of #51227 - uuttff8:master, r=dtolnayGuillaume Gomez-4/+4
mod.rs isn't beautiful I hate this spaces.
2018-05-30Add doc link from discriminant struct to function.Corey Farwell-1/+3
2018-05-30mod.rs isn't beautifuluuttff8-4/+4
2018-05-30make Layout's align a NonZeroUsizegnzlbg-36/+38
2018-05-29Auto merge of #51134 - RalfJung:from_raw_parts, r=SimonSapinbors-38/+11
extend from_raw_parts docs for slices and strs to mention alignment requirement The documentation for `str::from_raw_parts_mut` seems to not be visible because that method is private, bit I figured it could still be fixed. I also removed the reference to the no-longer-existing `str::from_raw_parts` while I was at it. Alternatively, should I remove `str::from_raw_parts_mut` completely? it is only used in `str::split_at_mut`, where it might as well be inlined.
2018-05-29Auto merge of #51142 - nickbabcock:doc-inspect, r=frewsxcvbors-2/+29
Document additional use case for iter::inspect Adds docs for `iter::inspect` showing the non-debug use case Closes #49564
2018-05-28Document additional use case for iter::inspectNick Babcock-2/+29
2018-05-28Avoid 128-bit arithmetic where possibleJonathan Behrens-2/+2
2018-05-28Auto merge of #50465 - clarcharr:wrapping, r=KodrAusbors-199/+488
Add missing Wrapping methods, use doc_comment! Re-opened version of #49393 . Finishing touches for #32463. Note that this adds `Shl` and `Shr` implementations for `Wrapping<i128>` and `Wrapping<u128>`, which were previously missed. This is technically insta-stable, but I don't know why this would be a problem.
2018-05-28get rid of str::from_raw_parts_mutRalf Jung-31/+5
str::from_raw_parts has been removed long ago because it can be obtained via str::from_utf8_unchecked and slice::from_raw_parts. The same goes for str::from_raw_parts_mut.
2018-05-28extend from_raw_parts docs for slices and strs to mention alignment requirementRalf Jung-11/+10
2018-05-28Provide more context for what the {f32,f64}::EPSILON values represent.Corey Farwell-2/+10
2018-05-27Auto merge of #51078 - GuillaumeGomez:stabilize-formatter, r=SimonSapinbors-17/+18
Stabilize Formatter alignment Fixes #27726. cc @SimonSapin
2018-05-27Stabilize Formatter alignmentGuillaume Gomez-17/+18