about summary refs log tree commit diff
path: root/src/libcore/ops
AgeCommit message (Collapse)AuthorLines
2018-11-01fix docs on traitMichael Hewson-4/+4
tests were failing because I didn't wrap code snippets like in backticks. fixed that now, so hopefully tests will pass on travis
2018-11-01Add CoerceSized trait and lang itemMichael Hewson-1/+35
This trait is more-or-less the reverse of CoerceUnsized, and will be used for object-safety checks. Receiver types like `Rc` will have to implement `CoerceSized` so that methods that use `Rc<Self>` as the receiver will be considered object-safe.
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-14/+14
2018-08-15When closure with no arguments was expected, suggest wrappingEsteban Küber-0/+15
2018-07-31Fix a typo in unsize.rspravic-1/+1
RfC -> RFC
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-06-19Add message to `rustc_on_unimplemented` attributes in coreEsteban Küber-2/+8
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