Skip to content

Commit

Permalink
Track caller of Vec::remove()
Browse files Browse the repository at this point in the history
  • Loading branch information
kornelski committed Jul 26, 2021
1 parent fc24bce commit 624df18
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions library/alloc/src/vec/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1372,9 +1372,11 @@ impl<T, A: Allocator> Vec<T, A> {
/// assert_eq!(v, [1, 3]);
/// ```
#[stable(feature = "rust1", since = "1.0.0")]
#[track_caller]
pub fn remove(&mut self, index: usize) -> T {
#[cold]
#[inline(never)]
#[track_caller]
fn assert_failed(index: usize, len: usize) -> ! {
panic!("removal index (is {}) should be < len (is {})", index, len);
}
Expand Down

0 comments on commit 624df18

Please sign in to comment.