File tree Expand file tree Collapse file tree 1 file changed +2
-0
lines changed Expand file tree Collapse file tree 1 file changed +2
-0
lines changed Original file line number Diff line number Diff line change @@ -1864,6 +1864,7 @@ pub(crate) const unsafe fn align_offset<T: Sized>(p: *const T, a: usize) -> usiz
1864
1864
/// ```
1865
1865
#[ stable( feature = "ptr_eq" , since = "1.17.0" ) ]
1866
1866
#[ inline( always) ]
1867
+ #[ must_use = "pointer comparison produces a value" ]
1867
1868
pub fn eq < T : ?Sized > ( a : * const T , b : * const T ) -> bool {
1868
1869
a == b
1869
1870
}
@@ -1886,6 +1887,7 @@ pub fn eq<T: ?Sized>(a: *const T, b: *const T) -> bool {
1886
1887
/// ```
1887
1888
#[ unstable( feature = "ptr_addr_eq" , issue = "116324" ) ]
1888
1889
#[ inline( always) ]
1890
+ #[ must_use = "pointer comparison produces a value" ]
1889
1891
pub fn addr_eq < T : ?Sized , U : ?Sized > ( p : * const T , q : * const U ) -> bool {
1890
1892
( p as * const ( ) ) == ( q as * const ( ) )
1891
1893
}
You can’t perform that action at this time.
0 commit comments