rust/src/libcore/ops
kennytm bd3674e4de
Rollup merge of #48087 - scottmcm:range_is_empty, r=kennytm,alexcrichton
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-14 16:14:33 +08:00
..
arith.rs fix typo: substract -> subtract. 2018-02-10 00:56:33 +01:00
bit.rs Add filtering options to rustc_on_unimplemented 2018-02-01 15:06:20 -08:00
deref.rs Use a better link for method resolution in Deref docs 2017-12-09 13:50:07 +00:00
drop.rs Revise Drop docs 2017-08-07 23:10:16 +02:00
function.rs Auto merge of #43724 - lukaramu:std-ops-docs, r=QuietMisdreavus 2017-08-12 19:40:49 +00:00
generator.rs Bump to 1.23 and update bootstrap 2017-10-26 13:59:18 -07:00
index.rs std::ops docs: incorporated changes suggested in review 2017-08-12 19:53:04 +02:00
mod.rs Update books for next release 2017-11-20 08:30:22 -05:00
place.rs Adjust wording of Placer trait safety requirements 2018-01-16 08:51:24 -08:00
range.rs Add the emptiness condition to the docs; add a PartialOrd example with NAN 2018-02-10 16:32:05 -08:00
try.rs Bump to 1.23 and update bootstrap 2017-10-26 13:59:18 -07:00
unsize.rs Normalize spaces in lang attributes. 2017-09-28 01:30:25 -07:00