diff options
| author | bors <bors@rust-lang.org> | 2025-03-21 04:59:08 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2025-03-21 04:59:08 +0000 |
| commit | 4f2ee8ca2ab3e76b5fe509358069904a58bf9083 (patch) | |
| tree | 288e05aaac5f250ee7a7c9341f52a0583c54b08e /tests/ui/ptr_eq.fixed | |
| parent | 25f1f902f9054fd5405f76764825842f9339e9ab (diff) | |
| parent | c86216ebe708d88dec9772e1f84556f5f529c6c6 (diff) | |
Auto merge of #138761 - flip1995:clippy-subtree-update, r=Manishearth
Clippy subtree update r? `@Manishearth` Cargo.lock update is because of the `ui_test` dependency bump in Clippy.
Diffstat (limited to 'tests/ui/ptr_eq.fixed')
| -rw-r--r-- | tests/ui/ptr_eq.fixed | 23 |
1 files changed, 19 insertions, 4 deletions
diff --git a/tests/ui/ptr_eq.fixed b/tests/ui/ptr_eq.fixed index 1ccd2c2237d..df6305ed497 100644 --- a/tests/ui/ptr_eq.fixed +++ b/tests/ui/ptr_eq.fixed @@ -20,8 +20,10 @@ fn main() { //~^ ptr_eq let _ = std::ptr::eq(a, b); //~^ ptr_eq - let _ = a.as_ptr() == b as *const _; - let _ = a.as_ptr() == b.as_ptr(); + let _ = std::ptr::eq(a.as_ptr(), b as *const _); + //~^ ptr_eq + let _ = std::ptr::eq(a.as_ptr(), b.as_ptr()); + //~^ ptr_eq // Do not lint @@ -31,9 +33,22 @@ fn main() { let a = &mut [1, 2, 3]; let b = &mut [1, 2, 3]; - let _ = a.as_mut_ptr() == b as *mut [i32] as *mut _; - let _ = a.as_mut_ptr() == b.as_mut_ptr(); + let _ = std::ptr::eq(a.as_mut_ptr(), b as *mut [i32] as *mut _); + //~^ ptr_eq + let _ = std::ptr::eq(a.as_mut_ptr(), b.as_mut_ptr()); + //~^ ptr_eq let _ = a == b; let _ = core::ptr::eq(a, b); + + let (x, y) = (&0u32, &mut 1u32); + let _ = std::ptr::eq(x, y); + //~^ ptr_eq + + let _ = !std::ptr::eq(x, y); + //~^ ptr_eq + + #[allow(clippy::eq_op)] + let _issue14337 = std::ptr::eq(main as *const (), main as *const ()); + //~^ ptr_eq } |
