You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
As UnsafeWake::clone_raw returns an Waker the LocalWaker code just takes the inner value. However because of this the Waker will be dropped and hence the erroneous extra call to drop_raw.
The text was updated successfully, but these errors were encountered:
… r=cramertj
Forget Waker when cloning LocalWaker
Since NonNull is Copy the inner field of the cloned Waker was copied for
use in the new LocalWaker, however this left Waker to be dropped. Which
means that when cloning LocalWaker would also erroneously call drop_raw.
This change forgets the Waker, rather then dropping it, leaving the
inner field to be used by the returned LocalWaker.
Closesrust-lang#52629.
Running the following code:
Prints the following:
It has an extra call to
drop_raw
.I think it's because of the
Clone
implementation ofLocalWaker
:As
UnsafeWake::clone_raw
returns anWaker
theLocalWaker
code just takes the inner value. However because of this theWaker
will be dropped and hence the erroneous extra call todrop_raw
.The text was updated successfully, but these errors were encountered: