diff options
| author | bors <bors@rust-lang.org> | 2020-09-04 12:21:43 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2020-09-04 12:21:43 +0000 |
| commit | ef55a0a92f3cb6572ef67d99f4aefbdeb7b6b804 (patch) | |
| tree | f811be6020731d8ff158e0e4d6b0265c9662370d /src | |
| parent | 4ffb5c5954a304daf47a567b34e74e421db86d98 (diff) | |
| parent | d9e877fb98212a47dd425e145b8b3e4283e6b487 (diff) | |
| download | rust-ef55a0a92f3cb6572ef67d99f4aefbdeb7b6b804.tar.gz rust-ef55a0a92f3cb6572ef67d99f4aefbdeb7b6b804.zip | |
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](https://github.com/rust-lang/rust/blob/22ee68dc586440f96b76b32fbd6087507c6afdb9/src/librustc_data_structures/sorted_map.rs#L214) [many](https://github.com/rust-lang/rust/blob/22ee68dc586440f96b76b32fbd6087507c6afdb9/library/alloc/src/vec.rs#L1299) [times](https://github.com/rust-lang/rust/blob/22ee68dc586440f96b76b32fbd6087507c6afdb9/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
Diffstat (limited to 'src')
| -rw-r--r-- | src/tools/linkchecker/main.rs | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/src/tools/linkchecker/main.rs b/src/tools/linkchecker/main.rs index b7ceba1e282..7ec12116c2c 100644 --- a/src/tools/linkchecker/main.rs +++ b/src/tools/linkchecker/main.rs @@ -39,6 +39,7 @@ const LINKCHECK_EXCEPTIONS: &[(&str, &[&str])] = &[ "#method.sort_by_key", "#method.make_ascii_uppercase", "#method.make_ascii_lowercase", + "#method.get_unchecked_mut", ], ), // These try to link to std::collections, but are defined in alloc |
