about summary refs log tree commit diff
path: root/src/libcore
AgeCommit message (Collapse)AuthorLines
2019-08-09Miri is really slowRalf Jung-4/+5
2019-08-09enable flt2dec tests in MiriRalf Jung-7/+41
2019-08-09Merge pull request #1 from rust-lang/masterSayan Nandan-5655/+10841
Merge recent changes into master
2019-08-09Improve tests for libcore/sliceSayan Nandan-8/+8
2019-08-09Improve test output for libcore/timeSayan Nandan-3/+1
2019-08-09Auto merge of #61937 - AaronKutch:master, r=scottmcmbors-69/+216
Improve `ptr_rotate` performance, tests, and benches The corresponding issue is #61784. I am not actually sure if miri can handle the test, but I can change the commit if necessary.
2019-08-09Postpone deprecating try! until 1.39.0Lzu Tao-1/+1
2019-08-09Deprecate `try!` macroBO41-0/+1
Co-Authored-By: Mazdak Farrokhzad <twingoow@gmail.com> Co-Authored-By: Oliver Middleton <olliemail27@gmail.com>
2019-08-09Rollup merge of #63374 - RalfJung:pin-packed, r=cramertjMazdak Farrokhzad-1/+2
move of packed fields might or might not occur when they actually are sufficiently aligned See https://github.com/taiki-e/pin-project/pull/34, where it was pointed out that we actually don't move fields of 1-aligned types when dropping a packed struct -- but e.g. in a `packed(2)` struct, we don't do something similar for 2-aligned types. The code for that is [here](https://github.com/rust-lang/rust/blob/db7c773a6be2f050d1d1504763819ea3916f5428/src/librustc_mir/util/alignment.rs#L7).
2019-08-08Use associated_type_bounds where applicable - closes #61738Ilija Tovilo-80/+119
2019-08-08remove confusing remarkRalf Jung-1/+1
2019-08-08Rollup merge of #63377 - SOF3:issues/63375, r=CentrilMazdak Farrokhzad-1/+1
Improved documentation for compile_error!() Fixes #63375
2019-08-08Rollup merge of #63366 - lzutao:fix-float-to-le-bytes-typo, r=CentrilMazdak Farrokhzad-4/+4
doc: Fix typo in float from bytes methods Thanks @That3Percent for pointing it out. r? @Centril
2019-08-08Rollup merge of #63261 - RalfJung:rand, r=nikomatsakisMazdak Farrokhzad-10/+10
bump rand in libcore/liballoc test suites This pulls in the fix for https://github.com/rust-random/rand/issues/779, which trips Miri when running these test suites. `SmallRng` (formerly used by libcore) is no longer built by default, it needs a feature gate. I opted to switch to `StdRng` instead. Or should I enable the feature gate?
2019-08-08Improved documentation for compile_error!()SOFe-1/+1
Fixes #63375
2019-08-08move of packed fields might or might not occur when they actually are ↵Ralf Jung-1/+2
sufficiently aligned
2019-08-08doc: Fix typo in float from bytes methodsLzu Tao-4/+4
2019-08-07Rollup merge of #63034 - tmandry:reduce-generator-size-regressions, r=cramertjMazdak Farrokhzad-0/+2
Fix generator size regressions due to optimization I tested the generator optimizations in #60187 and #61922 on the Fuchsia build, and noticed that some small generators (about 8% of the async fns in our build) increased in size slightly. This is because in #60187 we split the fields into two groups, a "prefix" non-overlap region and an overlap region, and lay them out separately. This can introduce unnecessary padding bytes between the two groups. In every single case in the Fuchsia build, it was due to there being only a single variant being used in the overlap region. This means that we aren't doing any overlapping, period. So it's better to combine the two regions into one and lay out all the fields at once, which is what this change does. r? @cramertj cc @eddyb @Zoxc
2019-08-06Improve `ptr_rotate` performance, tests, and benchmarksAaron Kutch-69/+216
2019-08-06Rollup merge of #63298 - RalfJung:assume_init, r=Mark-Simulacrum,CentrilMazdak Farrokhzad-1/+10
assume_init: warn about valid != safe We have this warning in the type-level docs, but it seems worth repeating it on the function.
2019-08-06Rollup merge of #62459 - timvermeulen:result_sum_internal_iteration, r=scottmcmMazdak Farrokhzad-119/+67
Use internal iteration in the Sum and Product impls of Result and Option This PR adds internal iteration to the `ResultShunt` iterator type underlying the `Sum` and `Product` impls of `Result`. I had to change `ResultShunt` to hold a mutable reference to an error instead, similar to `itertools::ProcessResults`, in order to be able to pass the `ResultShunt` itself by value (which is necessary for internal iteration). `ResultShunt::process` can unfortunately no longer be an associated function because that would make it generic over the lifetime of the error reference, which wouldn't work, so I turned it into the free function `process_results`. I removed the `OptionShunt` type and forwarded the `Sum` and `Product` impls of `Option` to their respective impls of `Result` instead, to avoid having to repeat the internal iteration logic.
2019-08-06clarifyRalf Jung-2/+2
2019-08-06be clear that 1-init Vec being valid (but not safe) is not a stable guaranteeRalf Jung-2/+4
2019-08-06Rollup merge of #63295 - RalfJung:align_offset, r=dtolnayMazdak Farrokhzad-4/+8
improve align_offset docs Cc @shepmaster
2019-08-06Rollup merge of #63293 - shepmaster:align-to-doc, r=RalfJungMazdak Farrokhzad-6/+8
Clarify align_to's requirements and obligations Based on discussions with @RalfJung around my misunderstandings when using this. r? @RalfJung
2019-08-06Rollup merge of #63260 - RalfJung:ptr-test, r=matkladMazdak Farrokhzad-2/+1
fix UB in a test We used to compare two mutable references that were supposed to point to the same thing. That's no good. Compare them as raw pointers instead.
2019-08-06Rollup merge of #61457 - timvermeulen:double_ended_iters, r=scottmcmMazdak Farrokhzad-13/+296
Implement DoubleEndedIterator for iter::{StepBy, Peekable, Take} Now that `DoubleEndedIterator::nth_back` has landed, `StepBy` and `Take` can have an efficient `DoubleEndedIterator` implementation. I don't know if there was any particular reason for `Peekable` not having a `DoubleEndedIterator` implementation, but it's quite trivial and I don't see any drawbacks to having it. I'm not very happy about the implementation of `Peekable::try_rfold`, but I didn't see another way to only take the value out of `self.peeked` in case `self.iter.try_rfold` didn't exit early. I only added `Peekable::rfold` (in addition to `try_rfold`) because its `Iterator` implementation has both `fold` and `try_fold` (and for similar reasons I added `Take::try_rfold` but not `Take::rfold`). Do we have any guidelines on whether we want both? If we do want both, maybe we should investigate which iterator adaptors override `try_fold` but not `fold` and add the missing implementations. At the moment I think that it's better to always have iterator adaptors implement both, because some iterators have a simpler `fold` implementation than their `try_fold` implementation. The tests that I added may not be sufficient because they're all just existing tests where `next`/`nth`/`fold`/`try_fold` are replaced by their DEI counterparts, but I do think all paths are covered. Is there anything in particular that I should probably also test?
2019-08-05Clarify align_to's requirements and obligationsJake Goulding-6/+8
2019-08-05Remove gensym from format_argsMatthew Jasper-2/+0
2019-08-05Make some items in core::unicode privateMatthew Jasper-20/+20
They were reachable through opaque macros defined in `core`
2019-08-05assume_init: warn about valid != safeRalf Jung-0/+7
2019-08-05improve wrapping_ docsRalf Jung-26/+112
2019-08-05note about stack-allocated variables being allocated objectsRalf Jung-8/+16
2019-08-05improve align_offset docsRalf Jung-4/+8
2019-08-05fix slice comparisonRalf Jung-1/+1
Co-Authored-By: Aleksey Kladov <aleksey.kladov@gmail.com>
2019-08-05Test content, not valueRalf Jung-1/+1
Co-Authored-By: Aleksey Kladov <aleksey.kladov@gmail.com>
2019-08-05Implement nth_back for ChunksExactMutYuki Okushi-0/+35
2019-08-04bump libcore tests to rand 0.7Ralf Jung-10/+10
2019-08-04fix UB in a testRalf Jung-2/+1
2019-08-04fix linksRalf Jung-2/+2
relative links do not work because this is included in several places
2019-08-03Apply suggestions from code reviewRalf Jung-8/+12
Co-Authored-By: Mazdak Farrokhzad <twingoow@gmail.com>
2019-08-03clarify that unchecked indexing is UB even if the reference is never usedRalf Jung-4/+12
2019-08-03Rollup merge of #63215 - gnzlbg:patch-6, r=CentrilMazdak Farrokhzad-3/+6
Clarify semantics of mem::zeroed Clarifies the semantics of `mem::zeroed`. r? @Centril cc @RalfJung
2019-08-02Consistency.gnzlbg-1/+1
2019-08-02Remove trailing whitespacegnzlbg-1/+1
I had one job...
2019-08-02Clarify semantics of mem::zeroedgnzlbg-3/+6
2019-08-02Rollup merge of #63189 - waywardmonkeys:doc-improvements, r=CentrilMazdak Farrokhzad-6/+11
Doc improvements Miscellaneous documentation fixes.
2019-08-02Rollup merge of #62663 - llogiq:more-questionmark-docs, r=GuillaumeGomezMazdak Farrokhzad-16/+27
More questionmarks in doctests This removes the other `unwrap`s in the macro doctests, replacing them with `?`. For now, we need to specify the main function including the return type, we can get rid of that once the return type suggestion for `fn main() { .. }` works correctly. r? @QuietMisdreavus
2019-08-02Remove Err variants of cloned and copiedksqsf-79/+0
2019-08-02Futures: Add link to Waker in trait doc.Bruce Mitchener-1/+3