about summary refs log tree commit diff
path: root/src/libcore/ops/range.rs
AgeCommit message (Collapse)AuthorLines
2020-07-27mv std libs to library/mark-885/+0
2020-07-10Remove some Default implsCaio-4/+4
2020-06-09Impl Default for rangesCaio-6/+6
2020-05-19Resolve overflow behavior for RangeFromCAD97-4/+10
2020-04-05Stop importing the float modules. Use assoc constsLinus Färnstrand-12/+0
2020-04-03Replace float module consts with assoc consts in documentationLinus Färnstrand-6/+4
2020-03-19Removed unused `Hasher` import.CDirkx-1/+1
2020-03-19Derive PartialEq, Eq and Hash for RangeInclusiveCDirkx-21/+1
The manual implementation of PartialEq, Eq and Hash for RangeInclusive was functionally equivalent to a derived implementation. This change removes the manual implementation and adds the respective derives. A side effect of this change is that the derives also add implementations for StructuralPartialEq and StructuralEq, which enables RangeInclusive to be used in const generics.
2020-02-08Remove problematic specialization from RangeInclusiveCAD97-31/+14
2020-02-01Remove some unsound specializationsMatthew Jasper-23/+15
2019-12-21Document privacy of RangeInclusive fieldsMark Rousskov-0/+5
2019-12-18Propagate cfg bootstrapMark Rousskov-9/+3
2019-12-13Require stable/unstable annotations for the constness of all stable ↵Oliver Scherer-0/+9
functions with a `const` modifier
2019-11-26Format libcore with rustfmtDavid Tolnay-5/+1
This commit applies rustfmt with default settings to files in src/libcore *that are not involved in any currently open PR* to minimize merge conflicts. The list of files involved in open PRs was determined by querying GitHub's GraphQL API with this script: https://gist.github.com/dtolnay/aa9c34993dc051a4f344d1b10e4487e8 With the list of files from the script in `outstanding_files`, the relevant commands were: $ find src/libcore -name '*.rs' | xargs rustfmt --edition=2018 $ rg libcore outstanding_files | xargs git checkout -- Repeating this process several months apart should get us coverage of most of the rest of libcore.
2019-06-05Remove dereferenceChris Gregory-1/+1
Co-Authored-By: Steven Fackler <sfackler@gmail.com>
2019-06-05Take self by value (Self is Copy here)Chris Gregory-1/+1
2019-06-01Enable feature bound_cloned for testsChris Gregory-0/+1
2019-05-31Make Bound::cloned publicChris Gregory-1/+1
2019-05-30Fix compilation errorsChris Gregory-2/+2
2019-05-30Add Bound::cloned()Chris Gregory-0/+22
2019-04-19libcore: deny more...Mazdak Farrokhzad-6/+6
2019-04-18libcore => 2018Taiki Endo-2/+2
2019-04-01Forward formatter settings to bounds of `Range<T>` in `fmt::Debug` implLukas Kalbertodt-5/+17
Before this change, formatter settings were lost when printing a `Range`. For example, printing a `Range<f32>` with `{:.2?}` would not apply the precision modifier when printing the floats. Now the `Debug` impls look a bit more verbose, but modifier are not lost.
2019-03-16Rollup merge of #59152 - smmalis37:range_contains, r=SimonSapinkennytm-30/+19
Stabilize Range*::contains. Closes https://github.com/rust-lang/rust/issues/32311. There's also a bit of rustfmt on range.rs thrown in for good measure (I forgot to turn off format-on-save in VSCode).
2019-03-12Stabilize Range*::contains.Steven Malis-30/+19
2019-03-11Fix RangeBounds documentation to include inclusive operationsChris Gregory-1/+1
2019-03-11Standardize `Range*` documentationChris Gregory-26/+42
This updates the final example in the documentation for the types `Range`, `RangeFrom`, `RangeFull`, `RangeInclusive`, `RangeTo`, `RangeToInclusive`.
2019-02-23Rollup merge of #58122 - matthieu-m:range_incl_perf, r=dtolnayMazdak Farrokhzad-0/+2
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-10libs: doc commentsAlexander Regueiro-2/+2
2019-02-03RangeInclusive internal iteration performance improvement.Matthieu M-0/+2
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.
2018-12-25Remove licensesMark Rousskov-10/+0
2018-11-10constify parts of libcore.Mazdak Farrokhzad-2/+2
2018-10-31Bump nightly to 1.32.0Alex Crichton-1/+1
* Also update the bootstrap compiler * Update cargo to 1.32.0 * Clean out stage0 annotations
2018-10-21Fix a typo in the documentation of RangeInclusiveJakub Kądziołka-1/+1
2018-10-03Only promote calls to `#[rustc_promotable]` const fnsOliver Schneider-0/+1
2018-09-29Use impl_header_lifetime_elision in libcoreScott McMurray-5/+5
2018-07-13Changed implementation of the third field to make LLVM optimize it better.kennytm-6/+14
2018-07-13Include is_empty() in PartialEq and Hash.kennytm-0/+19
When the index is not PartialOrd, always treat the range as empty.
2018-07-13Change RangeInclusive to a three-field struct.kennytm-7/+31
Fix #45222.
2018-05-24stabilize RangeBounds collections_range #30877Cory Sherman-85/+53
rename RangeBounds::start() -> start_bound() rename RangeBounds::end() -> end_bound()
2018-05-17Add doc comments mentioning unspecified behaviour upon exhaustionvarkor-1/+10
2018-05-17Stabilise into_innervarkor-3/+1
2018-05-17Stabilise inclusive_range_methodsvarkor-10/+3
2018-05-17Switch to 1.26 bootstrap compilerMark Simulacrum-10/+0
2018-05-09add fn `into_inner(self) -> (Idx, Idx)` to RangeInclusive (#49022)Sebastian Köln-0/+15
2018-05-01new() should be const; start()/end() after iteration is unspecified.kennytm-1/+17
2018-05-01Removed direct field usage of RangeInclusive in rustc itself.kennytm-1/+1
2018-04-30Make the fields of RangeInclusive private.kennytm-1/+59
Added new()/start()/end() methods to RangeInclusive. Changed the lowering of `..=` to use RangeInclusive::new().
2018-04-26Add more doc aliasesGuillaume Gomez-0/+6
2018-04-10Add symmetric requirement of PartialOrd.Steven Malis-8/+8