about summary refs log tree commit diff
path: root/src/libcore
AgeCommit message (Collapse)AuthorLines
2019-02-23Rollup merge of #58595 - stjepang:make-duration-consts-associated, r=oli-obkMazdak Farrokhzad-16/+52
Turn duration consts into associated consts As suggested in https://github.com/rust-lang/rust/issues/57391#issuecomment-459658236, I'm moving `Duration` constants (`SECOND`, `MILLISECOND` and so on; currently behind unstable `duration_constants` feature) into the `impl Duration` block. cc @frewsxcv @SimonSapin
2019-02-23Rollup merge of #58122 - matthieu-m:range_incl_perf, r=dtolnayMazdak Farrokhzad-6/+81
RangeInclusive internal iteration performance improvement. Specialize `Iterator::try_fold` and `DoubleEndedIterator::try_rfold` to improve code generation in all internal iteration scenarios. This changes brings the performance of internal iteration with `RangeInclusive` on par with the performance of iteration with `Range`: - Single conditional jump in hot loop, - Unrolling and vectorization, - And even Closed Form substitution. Unfortunately, it only applies to internal iteration. Despite various attempts at stream-lining the implementation of `next` and `next_back`, LLVM has stubbornly refused to optimize external iteration appropriately, leaving me with a choice between: - The current implementation, for which Closed Form substitution is performed, but which uses 2 conditional jumps in the hot loop when optimization fail. - An implementation using a `is_done` boolean, which uses 1 conditional jump in the hot loop when optimization fail, allowing unrolling and vectorization, but for which Closed Form substitution fails. In the absence of any conclusive evidence as to which usecase matters most, and with no assurance that the lack of Closed Form substitution is not indicative of other optimizations being foiled, there is no way to pick one implementation over the other, and thus I defer to the statu quo as far as `next` and `next_back` are concerned.
2019-02-22Auto merge of #58644 - Centril:rollup, r=Centrilbors-0/+1
Rollup of 17 pull requests Successful merges: - #57656 (Deprecate the unstable Vec::resize_default) - #58059 (deprecate before_exec in favor of unsafe pre_exec) - #58064 (override `VecDeque::try_rfold`, also update iterator) - #58198 (Suggest removing parentheses surrounding lifetimes) - #58431 (fix overlapping references in BTree) - #58555 (Add a note about 2018e if someone uses `try {` in 2015e) - #58588 (remove a bit of dead code) - #58589 (cleanup macro after 2018 transition) - #58591 (Dedup a rustdoc diagnostic construction) - #58600 (fix small documentation typo) - #58601 (Search for target_triple.json only if builtin target not found) - #58606 (Docs: put Future trait into spotlight) - #58607 (Fixes #58586: Make E0505 erronous example fail for the 2018 edition) - #58615 (miri: explain why we use static alignment in ref-to-place conversion) - #58620 (introduce benchmarks of BTreeSet.intersection) - #58621 (Update miri links) - #58632 (Make std feature list sorted) Failed merges: r? @ghost
2019-02-22Rollup merge of #58606 - stjepang:put-future-into-spotlight, r=alexcrichtonMazdak Farrokhzad-0/+1
Docs: put Future trait into spotlight If a function returns a type that implements `Future`, there should be a small "i" symbol next to it indicating the return type implements an important trait.
2019-02-22Auto merge of #57997 - nitnelave:master, r=RalfJungbors-215/+249
Wrap write_bytes in a function. Move docs This will allow us to add debug assertions. See issue #53871.
2019-02-22Auto merge of #58574 - RalfJung:pin, r=Mark-Simulacrumbors-49/+310
improve Pin documentation Incorporates a bunch of the documentation-related comments that came up when discussing `Pin` stabilization. Cc @alexcrichton @withoutboats @cramertj @jonhoo Fixes https://github.com/rust-lang/rust/issues/58130
2019-02-22Auto merge of #58616 - vertexclique:destabilize-fixed-width-atomic-integers, ↵bors-1/+14
r=dtolnay Destabilize fixed-width const defined atomic integers With this PR version 1.34.0 onwards const declarations of atomic integers will be unstable. * Closes https://github.com/rust-lang/rust/issues/58089 * Reverts partially: https://github.com/rust-lang/rust/pull/57425
2019-02-21take a bit more space for new_unchecked examplesRalf Jung-4/+10
2019-02-21fix linkRalf Jung-1/+1
2019-02-21this is for you, tidyRalf Jung-2/+2
2019-02-21explain unsafeRalf Jung-2/+2
2019-02-21we only list some examples of basic typesRalf Jung-1/+1
2019-02-21tweaks and fix weird spaceRalf Jung-2/+2
2019-02-21Apply suggestions from code reviewMazdak Farrokhzad-39/+42
Co-Authored-By: RalfJung <post@ralfj.de>
2019-02-21Destabilize fixed-width const defined atomic integersMahmut Bulut-1/+14
* With this PR 1.34.0 onwards const declarations of atomic integers will be unstable.
2019-02-21final pin projections tweakingRalf Jung-27/+23
2019-02-21more pin projections tweakingRalf Jung-10/+17
2019-02-21Enable feature duration_constants in examplesStjepan Glavina-0/+4
2019-02-20Put Future trait into spotlightStjepan Glavina-0/+1
2019-02-20Add examples for duration constantsStjepan Glavina-0/+32
2019-02-20expand pinning projectionsRalf Jung-38/+41
2019-02-20tweak pinning projectionsRalf Jung-12/+21
2019-02-20Turn duration consts into associated constsStjepan Glavina-16/+16
2019-02-20tweaksRalf Jung-14/+15
2019-02-20Rollup merge of #58044 - Lokathor:lokathor, r=alexcrichtonkennytm-9/+5
Make overflowing and wrapping negation const Remember that the signed and unsigned versions are slightly different here, so there's four functions made const instead of just two.
2019-02-20Rollup merge of #58576 - SimonSapin:successors, r=Centrilkennytm-14/+13
Stabilize iter::successors and iter::from_fn FCP: https://github.com/rust-lang/rust/issues/58045#issuecomment-464674773, https://github.com/rust-lang/rust/issues/55977#issuecomment-463964234
2019-02-20Rollup merge of #58565 - thomaseizinger:typo-future-docs, r=frewsxcvkennytm-1/+1
Fix typo in std::future::Future docs I am not quite sure if this is actually a typo but 1. to me the sentence doesn't make sense if it says "expect" 2. I hope that `Future`s are not really allowed to cause memory unsafety if they are polled after completion.
2019-02-20Rollup merge of #58553 - scottmcm:more-ihle, r=Centrilkennytm-23/+23
Use more impl header lifetime elision Inspired by seeing explicit lifetimes on these two: - https://doc.rust-lang.org/nightly/std/slice/struct.Iter.html#impl-FusedIterator - https://doc.rust-lang.org/nightly/std/primitive.u32.html#impl-Not And a follow-up to https://github.com/rust-lang/rust/pull/54687, that started using IHLE in libcore. Most of the changes in here fall into two big categories: - Removing lifetimes from common traits that can essentially never user a lifetime from an input (particularly `Drop`, `Debug`, and `Clone`) - Forwarding impls that are only possible because the lifetime doesn't matter (like `impl<R: Read + ?Sized> Read for &mut R`) I omitted things that seemed like they could be more controversial, like the handful of iterators that have a `Item: 'static` despite the iterator having a lifetime or the `PartialEq` implementations [where the flipped one cannot elide the lifetime](https://internals.rust-lang.org/t/impl-type-parameter-aliases/9403/2?u=scottmcm). I also removed two lifetimes that turned out to be completely unused; see https://github.com/rust-lang/rust/issues/41960#issuecomment-464557423
2019-02-20Rollup merge of #58538 - GuillaumeGomez:fmt-examples, r=Centrilkennytm-10/+313
Add missing fmt structs examples r? @rust-lang/docs
2019-02-20Rollup merge of #58536 - xfix:remove-ub-in-pointer-tests, r=RalfJungkennytm-5/+6
Remove UB in pointer tests UB found by Miri.
2019-02-19expand Unpin exampleRalf Jung-3/+5
2019-02-19improve wordingRalf Jung-2/+2
2019-02-19improve linked list -> drop transitionRalf Jung-5/+6
2019-02-19please the mericless tidy, oh tidyRalf Jung-1/+1
2019-02-19mention interaction with Deref in introRalf Jung-9/+38
2019-02-19examplesRalf Jung-1/+3
2019-02-19rewrite pin module introRalf Jung-24/+27
2019-02-19more work on projections and RefCell exampleRalf Jung-12/+22
2019-02-19separate section for doubly-linked list, reword projections introRalf Jung-33/+43
2019-02-19Apply suggestions from code reviewRalf Jung-12/+12
Co-Authored-By: RalfJung <post@ralfj.de>
2019-02-19apply some of the feedbackRalf Jung-25/+34
2019-02-19Stabilize iter::from_fnSimon Sapin-7/+5
FCP: https://github.com/rust-lang/rust/issues/55977#issuecomment-463964234
2019-02-19Stabilize iter::successorsSimon Sapin-7/+8
FCP: https://github.com/rust-lang/rust/issues/58045#issuecomment-464674773
2019-02-19improve Pin documentationRalf Jung-20/+190
2019-02-19Add missing fmt structs examplesGuillaume Gomez-10/+313
2019-02-19Fix typo in std::future::Future docsThomas Eizinger-1/+1
2019-02-17Use more impl header lifetime elisionScott McMurray-23/+23
There are two big categories of changes in here - Removing lifetimes from common traits that can essentially never user a lifetime from an input (particularly `Drop` & `Debug`) - Forwarding impls that are only possible because the lifetime doesn't matter (like `impl<R: Read + ?Sized> Read for &mut R`) I omitted things that seemed like they could be more controversial, like the handful of iterators that have a `Item: 'static` despite the iterator having a lifetime or the `PartialEq` implementations where the flipped one cannot elide the lifetime.
2019-02-18Auto merge of #58373 - RalfJung:maybe-uninit, r=gnzlbgbors-8/+1
update stdsimd and remove now-unused MaybeUninit::into_inner That's a huge diff for stdsimd... Cc @gnzlbg @alexcrichton
2019-02-17Remove UB in test_ptr_subtraction testKonrad Borowski-2/+4
2019-02-17Remove UB in test_is_null testKonrad Borowski-3/+2