diff options
| author | bors <bors@rust-lang.org> | 2020-04-16 18:02:11 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2020-04-16 18:02:11 +0000 |
| commit | 7f3df5772439eee1c512ed2eb540beef1124d236 (patch) | |
| tree | f98ee8dd5a131d5222e94b1428318569dfcdabd3 /src/liballoc | |
| parent | 7fb5187d0423f4cd0441526571b8cd61927123c9 (diff) | |
| parent | 9d28dfee78b5b9a69ee90ec35d24b6342a8cbdfa (diff) | |
| download | rust-7f3df5772439eee1c512ed2eb540beef1124d236.tar.gz rust-7f3df5772439eee1c512ed2eb540beef1124d236.zip | |
Auto merge of #71201 - Dylan-DPC:rollup-23202uf, r=Dylan-DPC
Rollup of 5 pull requests Successful merges: - #70566 (Don't bail out before linting in generic contexts.) - #71141 (Provide better compiler output when using `?` on `Option` in fn returning `Result` and vice-versa) - #71149 (remove an impossible branch from check_consts) - #71179 (fix more clippy warnings) - #71191 (Clean up E0520 explanation) Failed merges: r? @ghost
Diffstat (limited to 'src/liballoc')
| -rw-r--r-- | src/liballoc/vec.rs | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/liballoc/vec.rs b/src/liballoc/vec.rs index 7ef281ff208..b4a9da84787 100644 --- a/src/liballoc/vec.rs +++ b/src/liballoc/vec.rs @@ -971,7 +971,7 @@ impl<T> Vec<T> { } let len = self.len(); - if !(index < len) { + if index >= len { assert_failed(index, len); } unsafe { @@ -1010,7 +1010,7 @@ impl<T> Vec<T> { } let len = self.len(); - if !(index <= len) { + if index > len { assert_failed(index, len); } @@ -1058,7 +1058,7 @@ impl<T> Vec<T> { } let len = self.len(); - if !(index < len) { + if index >= len { assert_failed(index, len); } unsafe { @@ -1331,10 +1331,10 @@ impl<T> Vec<T> { panic!("end drain index (is {}) should be <= len (is {})", end, len); } - if !(start <= end) { + if start > end { start_assert_failed(start, end); } - if !(end <= len) { + if end > len { end_assert_failed(end, len); } @@ -1432,7 +1432,7 @@ impl<T> Vec<T> { panic!("`at` split index (is {}) should be <= len (is {})", at, len); } - if !(at <= self.len()) { + if at > self.len() { assert_failed(at, self.len()); } |
