Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Compare thin pointers to find the connection
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.
- Loading branch information