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
Connection is a trait, so "*const Connection" is a fat pointer (128
bits, 64 bits pointing to the instance, 64 bits pointing to the vtable).
For some reason (a bug?), in Router::remove(), the connection passed as
argument has a vtable different from the (same) connection stored in the
"connections" field.
This has the unexpected consequence that for some x and y:
println!("{:p} == {:p} ? {}", x, y, ptr::eq(x, y));
prints:
0x7f87a8c3a618 == 0x7f87a8c3a618 ? false
Thus, the connection to remove was not found, leading to the panic
"Removing an unknown connection".
Instead, compare only the data part, by casting the fat pointers to thin
pointers.
See <#61 (comment)>
Thanks to mbrubeck on IRC freenode/##rust, who helped a lot to
understand the issue.
0 commit comments