about summary refs log tree commit diff
path: root/src/libcore/ops
AgeCommit message (Collapse)AuthorLines
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-28Auto merge of #50149 - aaronaaeng:master, r=estebankbors-0/+13
Added warning for unused arithmetic expressions The compiler now displays a warning when a binary arithmetic operation is evaluated but not used. This resolves #50124 by following the instructions outlined in the issue. The changes are as follows: - Added new pattern matching for unused arithmetic expressions in `src/librustc_lint/unused.rs` - Added `#[must_use]` attributes to the binary operation methods in `src/libcore/internal_macros.rs` - Added `#[must_use]` attributes to the non-assigning binary operators in `src/libcore/ops/arith.rs`
2018-04-26Add more doc aliasesGuillaume Gomez-0/+19
2018-04-22Make must_use lint cover all binary/unary operatorsAaron Aaeng-0/+13
2018-04-21add more aliasesGuillaume Gomez-0/+23
2018-04-19Auto merge of #49630 - npmccallum:shl, r=alexcrichtonbors-3/+3
Update Rhs on ShlAssign to default to Self This matches the behavior on ShrAssign and all other *Assign operations.
2018-04-16Auto merge of #49130 - smmalis37:range, r=alexcrichtonbors-34/+123
Move Range*::contains to a single default impl on RangeBounds Per the ongoing discussion in #32311. This is my first PR to Rust (woo!), so I don't know if this requires an amendment to the original range_contains RFC, or not, or if we can just do a psuedo-RFC here. While this may no longer follow the explicit decision made in that RFC, I believe this better follows its spirit by adding the new contains method to all Ranges. It also allows users to be generic over all ranges and use this method without writing it themselves (my personal desired use case). This also somewhat answers the unanswered question about Wrapping ranges in the above issue by instead just punting it to the question of what those types should return for start() & end(), or if they should implement RangeArgument at all. Those types could also implement their own contains method without implementing this trait, in which case the question remains the same. This does add a new contains method to types that already implemented RangeArgument but not contains. These types are RangeFull, (Bound<T>, Bound<T>), (Bound<&'a T>, Bound<&'a T>). No tests have been added for these types yet. No inherent method has been added either. r? @alexcrichton
2018-04-13[doc] note the special type inference handling for shiftsAndre Bogus-2/+12
2018-04-10Add symmetric requirement of PartialOrd.Steven Malis-8/+8
2018-04-07Add float NaN tests.Steven Malis-21/+59
2018-04-07fix testsSteven Malis-22/+22
2018-04-07Update based on RangeBounds trait being moved to libcore.Steven Malis-12/+63
2018-04-06Consistently default operator Rhs/RHS to SelfNathaniel McCallum-3/+3
Operator traits seem to be inconsistent regarding the right hand side generic. Most default Rhs/RHS to Self, but a few omit this. This patch modifies them all to default to Self. This should not have any backwards compatibility issues because we are only enabling code that previously wouldn't compile.
2018-04-03Remove all unstable placement featuresAidan Hobson Sayers-147/+0
Closes #22181, #27779
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.