mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-22 14:55:26 +00:00
Add "not guaranteed to be equal"
Co-authored-by: Urgau <3616612+Urgau@users.noreply.github.com>
This commit is contained in:
parent
8e2ac498f4
commit
5280f152b0
@ -2180,7 +2180,7 @@ pub fn addr_eq<T: ?Sized, U: ?Sized>(p: *const T, q: *const U) -> bool {
|
||||
/// let f: fn(i32) -> i32 = |x| x;
|
||||
/// let g: fn(i32) -> i32 = |x| x + 0; // different closure, different body
|
||||
/// let h: fn(u32) -> u32 = |x| x + 0; // different signature too
|
||||
/// dbg!(std::ptr::fn_addr_eq(f, g), std::ptr::fn_addr_eq(f, h));
|
||||
/// dbg!(std::ptr::fn_addr_eq(f, g), std::ptr::fn_addr_eq(f, h)); // not guaranteed to be equal
|
||||
/// ```
|
||||
///
|
||||
/// * May return `false` in any case.
|
||||
|
Loading…
Reference in New Issue
Block a user