add comparison warning to RawWakerVTable as well
This commit is contained in:
parent
1383657a46
commit
aaa6d3bec2
1 changed files with 6 additions and 0 deletions
|
|
@ -99,6 +99,12 @@ impl RawWaker {
|
|||
/// [`RawWaker`] implementation. Calling one of the contained functions using
|
||||
/// any other `data` pointer will cause undefined behavior.
|
||||
///
|
||||
/// Note that while this type implements `PartialEq`, comparing function pointers, and hence
|
||||
/// comparing structs like this that contain 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).
|
||||
///
|
||||
/// # Thread safety
|
||||
/// If the [`RawWaker`] will be used to construct a [`Waker`] then
|
||||
/// these functions must all be thread-safe (even though [`RawWaker`] is
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue