Skip to content

Commit

Permalink
add #[must_use] to functions of slice and its iterators.
Browse files Browse the repository at this point in the history
  • Loading branch information
jendrikw committed Mar 26, 2022
1 parent dcdde01 commit 5f88c23
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions library/core/tests/slice.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2344,31 +2344,31 @@ fn slice_rsplit_array_mut() {
fn slice_split_array_ref_out_of_bounds() {
let v = &[1, 2, 3, 4, 5, 6][..];

v.split_array_ref::<7>();
let _ = v.split_array_ref::<7>();
}

#[should_panic]
#[test]
fn slice_split_array_mut_out_of_bounds() {
let v = &mut [1, 2, 3, 4, 5, 6][..];

v.split_array_mut::<7>();
let _ = v.split_array_mut::<7>();
}

#[should_panic]
#[test]
fn slice_rsplit_array_ref_out_of_bounds() {
let v = &[1, 2, 3, 4, 5, 6][..];

v.rsplit_array_ref::<7>();
let _ = v.rsplit_array_ref::<7>();
}

#[should_panic]
#[test]
fn slice_rsplit_array_mut_out_of_bounds() {
let v = &mut [1, 2, 3, 4, 5, 6][..];

v.rsplit_array_mut::<7>();
let _ = v.rsplit_array_mut::<7>();
}

macro_rules! take_tests {
Expand Down

0 comments on commit 5f88c23

Please sign in to comment.