Rollup merge of #120880 - RalfJung:vtable-fnptr-partialeq, r=cuviper
add note on comparing vtables / function pointers Fixes https://github.com/rust-lang/rust/issues/99388 Fixes https://github.com/rust-lang/rust/issues/117047
This commit is contained in:
@@ -1660,6 +1660,11 @@ mod prim_ref {}
|
||||
/// * [`UnwindSafe`]
|
||||
/// * [`RefUnwindSafe`]
|
||||
///
|
||||
/// Note that while this type implements `PartialEq`, comparing function pointers is unreliable:
|
||||
/// pointers to the same function can compare inequal (because functions are duplicated in multiple
|
||||
/// codegen units), and pointers to *different* functions can compare equal (since identical
|
||||
/// functions can be deduplicated within a codegen unit).
|
||||
///
|
||||
/// [`Hash`]: hash::Hash
|
||||
/// [`Pointer`]: fmt::Pointer
|
||||
/// [`UnwindSafe`]: panic::UnwindSafe
|
||||
|
||||
Reference in New Issue
Block a user