diff --git a/library/alloc/src/collections/binary_heap/mod.rs b/library/alloc/src/collections/binary_heap/mod.rs index 34de563fe4f33..98192e1fb5b01 100644 --- a/library/alloc/src/collections/binary_heap/mod.rs +++ b/library/alloc/src/collections/binary_heap/mod.rs @@ -1258,7 +1258,7 @@ impl BinaryHeap { /// /// Ok(heap.pop()) /// } - /// # find_max_slow(&[1, 2, 3]).expect("why is the test harness OOMing on 12 bytes?"); + /// # find_max_slow(&[1, 2, 3]).expect("reserving capacity for 12 bytes should never fail"); /// ``` #[stable(feature = "try_reserve_2", since = "1.63.0")] pub fn try_reserve_exact(&mut self, additional: usize) -> Result<(), TryReserveError> { @@ -1294,7 +1294,7 @@ impl BinaryHeap { /// /// Ok(heap.pop()) /// } - /// # find_max_slow(&[1, 2, 3]).expect("why is the test harness OOMing on 12 bytes?"); + /// # find_max_slow(&[1, 2, 3]).expect("reserving capacity for 12 bytes should never fail"); /// ``` #[stable(feature = "try_reserve_2", since = "1.63.0")] pub fn try_reserve(&mut self, additional: usize) -> Result<(), TryReserveError> { diff --git a/library/alloc/src/collections/vec_deque/mod.rs b/library/alloc/src/collections/vec_deque/mod.rs index 9eac8bcde1d1c..940fce7377938 100644 --- a/library/alloc/src/collections/vec_deque/mod.rs +++ b/library/alloc/src/collections/vec_deque/mod.rs @@ -1153,7 +1153,7 @@ impl VecDeque { /// /// Ok(output) /// } - /// # process_data(&[1, 2, 3]).expect("why is the test harness OOMing on 12 bytes?"); + /// # process_data(&[1, 2, 3]).expect("reserving capacity for 12 bytes should never fail"); /// ``` #[stable(feature = "try_reserve", since = "1.57.0")] pub fn try_reserve_exact(&mut self, additional: usize) -> Result<(), TryReserveError> { @@ -1201,7 +1201,7 @@ impl VecDeque { /// /// Ok(output) /// } - /// # process_data(&[1, 2, 3]).expect("why is the test harness OOMing on 12 bytes?"); + /// # process_data(&[1, 2, 3]).expect("reserving capacity for 12 bytes should never fail"); /// ``` #[stable(feature = "try_reserve", since = "1.57.0")] pub fn try_reserve(&mut self, additional: usize) -> Result<(), TryReserveError> { @@ -3871,7 +3871,7 @@ impl Index for VecDeque { #[inline] fn index(&self, index: usize) -> &T { - self.get(index).expect("Out of bounds access") + self.get(index).expect("out of bounds access") } } @@ -3879,7 +3879,7 @@ impl Index for VecDeque { impl IndexMut for VecDeque { #[inline] fn index_mut(&mut self, index: usize) -> &mut T { - self.get_mut(index).expect("Out of bounds access") + self.get_mut(index).expect("out of bounds access") } }