We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent b0889cb commit 34ea540Copy full SHA for 34ea540
library/core/src/ptr/mod.rs
@@ -1864,6 +1864,7 @@ pub(crate) const unsafe fn align_offset<T: Sized>(p: *const T, a: usize) -> usiz
1864
/// ```
1865
#[stable(feature = "ptr_eq", since = "1.17.0")]
1866
#[inline(always)]
1867
+#[must_use = "pointer comparison produces a value"]
1868
pub fn eq<T: ?Sized>(a: *const T, b: *const T) -> bool {
1869
a == b
1870
}
@@ -1886,6 +1887,7 @@ pub fn eq<T: ?Sized>(a: *const T, b: *const T) -> bool {
1886
1887
1888
#[unstable(feature = "ptr_addr_eq", issue = "116324")]
1889
1890
1891
pub fn addr_eq<T: ?Sized, U: ?Sized>(p: *const T, q: *const U) -> bool {
1892
(p as *const ()) == (q as *const ())
1893
0 commit comments