summary refs log tree commit diff
path: root/src/libcore/ops
AgeCommit message (Collapse)AuthorLines
2018-04-01Update drop.rsAnders Pitman-1/+1
2018-03-30Rollup merge of #49446 - frewsxcv:frewsxcv-mention-optiono, r=GuillaumeGomezkennytm-1/+1
Explicitly mention `Option` in `?` error message. Save users the time/effort of having to lookup what types implement the `Try` trait.
2018-03-29impl RangeBounds<T> for Range{,From,To,Inclusive,ToInclusive}<&T>Simon Sapin-0/+60
2018-03-29Move RangeArguments to {core::std}::ops and rename to RangeBoundsSimon Sapin-2/+155
These unstable items are deprecated: * The `std::collections::range::RangeArgument` reexport * The `std::collections::range` module.
2018-03-29Move alloc::Bound to {core,std}::opsSimon Sapin-1/+52
The stable reexport `std::collections::Bound` is now deprecated. Another deprecated reexport could be added in `alloc`, but that crate is unstable.
2018-03-28Explicitly mention `Option` in `?` error message.Corey Farwell-1/+1
Save users the time/effort of having to lookup what types implement the `Try` trait.
2018-03-21Make resuming generators unsafe instead of the creation of immovable ↵John Kåre Alsaker-4/+8
generators. Fixes #47787
2018-03-15Keep the fields of RangeInclusive unstable.kennytm-2/+4
2018-03-15Stabilize `inclusive_range_syntax` language feature.kennytm-13/+6
Stabilize the syntax `a..=b` and `..=b`.
2018-03-15Stabilize `inclusive_range` library feature.kennytm-16/+10
Stabilize std::ops::RangeInclusive and std::ops::RangeInclusiveTo.
2018-02-14Rollup merge of #48151 - echochamber:update_range_example, r=estebankkennytm-5/+5
Update ops range example to avoid confusion between indexes and values. Makes clearer the numbers in the range refer to indexes, not the values at those indexes.
2018-02-14Rollup merge of #48087 - scottmcm:range_is_empty, r=kennytm,alexcrichtonkennytm-4/+76
Add Range[Inclusive]::is_empty During https://github.com/rust-lang/rfcs/pull/1980, it was discussed that figuring out whether a range is empty was subtle, and thus there should be a clear and obvious way to do it. It can't just be ExactSizeIterator::is_empty (also unstable) because not all ranges are ExactSize -- such as `Range<i64>` and `RangeInclusive<usize>`. Things to ponder: - Unless this is stabilized first, this makes stabilizing ExactSizeIterator::is_empty more icky, since this hides that. - This is only on `Range` and `RangeInclusive`, as those are the only ones where it's interesting. But one could argue that it should be on more for consistency, or on RangeArgument instead. - The bound on this is PartialOrd, since that works ok (see tests for float examples) and is consistent with `contains`. But ranges like `NAN..=NAN`_are_ kinda weird. - [x] ~~There's not a real issue number on this yet~~
2018-02-11Update ops range example to avoid confusion between indexes and values.Jason Schein-5/+5
2018-02-10Add the emptiness condition to the docs; add a PartialOrd example with NANScott McMurray-2/+24
2018-02-09range_is_empty tracking issue is #48111Scott McMurray-2/+2
2018-02-09Use is_empty in range iteration exhaustion testsScott McMurray-0/+18
2018-02-10fix typo: substract -> subtract.Matthias Krüger-2/+2
2018-02-09Add Range[Inclusive]::is_emptyScott McMurray-2/+34
During the RFC, it was discussed that figuring out whether a range is empty was subtle, and thus there should be a clear and obvious way to do it. It can't just be ExactSizeIterator::is_empty (also unstable) because not all ranges are ExactSize -- not even Range<i32> or RangeInclusive<usize>.
2018-02-01Remove cast suggestionsEsteban Küber-72/+0
2018-02-01Change rustc_on_unimplemented for Iterator and binopsEsteban Küber-6/+3
2018-02-01Add filtering options to `rustc_on_unimplemented`Esteban Küber-20/+125
- filter error on the evaluated value of `Self` - filter error on the evaluated value of the type arguments - add argument to include custom note in diagnostic - allow the parser to parse `Self` when processing attributes - add custom message to binops
2018-01-16Adjust wording of Placer trait safety requirementsTaylor Cramer-2/+2
2018-01-09Make core::ops::Place an unsafe traitTaylor Cramer-1/+4
2017-12-09Use a better link for method resolution in Deref docsmatthewjasper-4/+4
2017-11-20Update books for next releasesteveklabnik-1/+1
Also includes a fix in std::ops
2017-11-02Fix typoLance John-2/+2
`accomodate` -> `accommodate`
2017-10-26Bump to 1.23 and update bootstrapAlex Crichton-20/+15
This commit updates the bootstrap compiler, bumps the version to 1.23, updates Cargo, updates books, and updates crates.io dependencies
2017-10-02update books for next releasesteveklabnik-3/+3
Also fixes some stdlib links to the reference which have changed.
2017-09-29Rollup merge of #44900 - Havvy:normalize-lang-attribute-spacing, r=sfacklerMark Simulacrum-1/+1
Normalize spaces in lang attributes. So, like, I grepped for all `lang` attributes for *reasons* and I noticed that they all share the same spacing of `#[lang = "item_name"]` except these five instances. So I decided to fix that. So enjoy this PR of exactly ten spaces.
2017-09-29Rollup merge of #44287 - Eh2406:master, r=aturonMark Simulacrum-0/+20
Allow T op= &T for built-in numeric types T v2 Manually rebase of @Migi https://github.com/rust-lang/rust/pull/41336
2017-09-28Normalize spaces in lang attributes.Havvy-1/+1
2017-09-22Add support for `..=` syntaxAlex Burka-25/+25
Add ..= to the parser Add ..= to libproc_macro Add ..= to ICH Highlight ..= in rustdoc Update impl Debug for RangeInclusive to ..= Replace `...` to `..=` in range docs Make the dotdoteq warning point to the ... Add warning for ... in expressions Updated more tests to the ..= syntax Updated even more tests to the ..= syntax Updated the inclusive_range entry in unstable book
2017-09-03Manuall rebase of @Migi pull/41336Eh2406-0/+20
2017-09-03add error message for the other case tooAriel Ben-Yehuda-1/+6
2017-09-03on_unimplemented: add method-name checks and use them in TryAriel Ben-Yehuda-1/+3
2017-09-03address review commentsAriel Ben-Yehuda-2/+3
2017-09-03enable desugaring-sensitive error messages and use them in TryAriel Ben-Yehuda-2/+10
Maybe I should allow error messages to check the *specific* desugaring? Thanks @huntiep for the idea!
2017-08-17Merge remote-tracking branch 'origin/master' into genAlex Crichton-1/+1
2017-08-16Merge remote-tracking branch 'origin/master' into genAlex Crichton-0/+2
2017-08-15Fix typos & us spellingsFourchaux-1/+1
2017-08-14Merge remote-tracking branch 'origin/master' into genAlex Crichton-531/+617
2017-08-14Add missing newline in Deref docs to fix renderinglukaramu-0/+2
Fixes #43866.
2017-08-13Rollup merge of #43814 - Eijebong:fix_typos2, r=petrochenkovGuillaume Gomez-1/+1
Fix some typos Follow up of #43794 If refined my script a little bit and found some more.
2017-08-12Auto merge of #43724 - lukaramu:std-ops-docs, r=QuietMisdreavusbors-529/+615
Improve std::ops docs Fixes #29365. (This fixes all but one point from @steveklabnik's list, but that point was referring to examples of implementing range traits, but there are no range traits in std::ops.) The main changes are quite a bit of copyediting, adding more "real" examples for some of the traits, incorporating some guidance from the API docs, more linking (cross-docs and to the book & reference), cleaning up examples, moving things around, and so on. Refer to the commit messages for more details. Note: I decided to link to the second edition of the book since I think it's more appropriate now for the sections I linked, if this is not okay, please say so!
2017-08-12std::ops docs: incorporated changes suggested in reviewlukaramu-58/+82
* fixed link typos and copy-paster errors * rewrote Fn* explanations * `RHS = Self` -> `RHS` is `Self` (added that to all applicable places as well) * fixed up some links * s/MutDeref/DerefMut * removed remaining superfluous `fn main()`s * fixed some minor phrasings and factual errors and inaccuracies std::ops docs: Fix phrasing and factual errors/inaccuracies
2017-08-12Fix some typosBastien Orivel-1/+1
2017-08-12Auto merge of #43794 - Eijebong:fix_typos, r=lukaramu,steveklanik,imperiobors-1/+1
Fix some typos I wrote a really naive script and found those typos in the documentation.
2017-08-11Fix some more typos, this time words that are duplicated.Bastien Orivel-1/+1
2017-08-10Merge remote-tracking branch 'origin/master' into genAlex Crichton-1/+1
2017-08-08Added to core::ops module docslukaramu-5/+12
Part of #29365. * Added paragraph adapted from API guidelines that operator implementations should be unsurprising * Modified Point example to be more clear when just reading it