We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent ce54852 commit 9bd7cc2Copy full SHA for 9bd7cc2
library/core/src/slice/memchr.rs
@@ -79,7 +79,7 @@ const fn memchr_aligned(x: u8, text: &[u8]) -> Option<usize> {
79
80
// search the body of the text
81
let repeated_x = usize::repeat_u8(x);
82
- #[safety::loop_invariant(len >= 2 * USIZE_BYTES && )]
+ #[safety::loop_invariant(len >= 2 * USIZE_BYTES && offset <= len)]
83
while offset <= len - 2 * USIZE_BYTES {
84
// SAFETY: the while's predicate guarantees a distance of at least 2 * usize_bytes
85
// between the offset and the end of the slice.
0 commit comments