rust/library/core/tests
bors ef55a0a92f Auto merge of #75207 - dylni:add-slice-check-range, r=KodrAus
Add `slice::check_range`

This method is useful for [`RangeBounds`] parameters. It's even been [rewritten](22ee68dc58/src/librustc_data_structures/sorted_map.rs (L214)) [many](22ee68dc58/library/alloc/src/vec.rs (L1299)) [times](22ee68dc58/library/core/src/slice/mod.rs (L2441)) in the standard library, sometimes assuming that the bounds won't be [`usize::MAX`].

For example, [`Vec::drain`] creates an empty iterator when [`usize::MAX`] is used as an inclusive end bound:

```rust
assert!(vec![1].drain(..=usize::max_value()).eq(iter::empty()));
```

If this PR is merged, I'll create another to use it for those methods.

[`RangeBounds`]: https://doc.rust-lang.org/std/ops/trait.RangeBounds.html
[`usize::MAX`]: https://doc.rust-lang.org/std/primitive.usize.html#associatedconstant.MAX
[`Vec::drain`]: https://doc.rust-lang.org/std/vec/struct.Vec.html#method.drain
2020-09-04 12:21:43 +00:00
..
fmt
hash
num flt2dec: properly handle uninitialized memory 2020-09-02 12:41:38 +02:00
alloc.rs
any.rs
array.rs Add drop check test & MaybeUninit::first_ptr_mut 2020-08-13 03:51:08 +00:00
ascii.rs enable align_to tests in Miri 2020-08-19 10:41:51 +02:00
atomic.rs
bool.rs
cell.rs
char.rs
clone.rs
cmp.rs
intrinsics.rs
iter.rs Use min_specialization in libcore 2020-08-19 20:08:02 +01:00
lazy.rs Make OnceCell<T> transparent to dropck 2020-08-18 00:34:54 +02:00
lib.rs Fix tests using FixedSizeArray methods (which are now shadowed) 2020-08-30 21:08:18 +02:00
manually_drop.rs
mem.rs
nonzero.rs
ops.rs
option.rs Fix tests using FixedSizeArray methods (which are now shadowed) 2020-08-30 21:08:18 +02:00
pattern.rs
ptr.rs enable align_to tests in Miri 2020-08-19 10:41:51 +02:00
result.rs Fix tests using FixedSizeArray methods (which are now shadowed) 2020-08-30 21:08:18 +02:00
slice.rs Auto merge of #75207 - dylni:add-slice-check-range, r=KodrAus 2020-09-04 12:21:43 +00:00
str_lossy.rs
str.rs
time.rs
tuple.rs