Skip to content

Commit

Permalink
Remove redundant check
Browse files Browse the repository at this point in the history
  • Loading branch information
celinval committed Jun 12, 2024
1 parent 8c3c80e commit b6d7ea2
Showing 1 changed file with 0 additions and 6 deletions.
6 changes: 0 additions & 6 deletions library/core/src/intrinsics.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3178,17 +3178,11 @@ mod verify {
pub fn check_swap<T: kani::Arbitrary + Copy + cmp::PartialEq + fmt::Debug>() {
let mut x = kani::any::<T>();
let old_x = x;
let x_addr = (&x as *const T).addr();

let mut y = kani::any::<T>();
let old_y = y;
let y_addr = (&y as *const T).addr();

unsafe { typed_swap(&mut x, &mut y) };

assert_eq!(y, old_x);
assert_eq!(x, old_y);
assert_eq!(y_addr, (&y as *const T).addr());
assert_eq!(x_addr, (&x as *const T).addr());
}
}

0 comments on commit b6d7ea2

Please sign in to comment.