diff --git a/src/bytes_mut.rs b/src/bytes_mut.rs index aa79f8652..a6fb830e7 100644 --- a/src/bytes_mut.rs +++ b/src/bytes_mut.rs @@ -1090,7 +1090,7 @@ unsafe impl BufMut for BytesMut { unsafe fn advance_mut(&mut self, cnt: usize) { let remaining = self.cap - self.len(); if cnt > remaining { - panic_advance(cnt, remaining); + super::panic_advance(cnt, remaining); } // Addition won't overflow since it is at most `self.cap`. self.len = self.len() + cnt; diff --git a/tests/test_buf_mut.rs b/tests/test_buf_mut.rs index 33aa68038..0abeb9f7a 100644 --- a/tests/test_buf_mut.rs +++ b/tests/test_buf_mut.rs @@ -83,7 +83,7 @@ fn test_put_int_le_nbytes_overflow() { } #[test] -#[should_panic(expected = "cannot advance")] +#[should_panic(expected = "advance out of bounds: the len is 8 but advancing by 12")] fn test_vec_advance_mut() { // Verify fix for #354 let mut buf = Vec::with_capacity(8);