Skip to content

tor-proto: find a way to avoid accidental drops in our tests

We sometimes run into bugs, often in tor-proto tests, when we say let _ = ... instead of let _reactor = ... or let _tx = .... Then, when the reactor or transmitter or whatever gets dropped, the test fails. Sometimes this failure is nondeterministic, depending on how our async backend executes everything.

On one such bug (#2005 (closed), fixed in !3005 (merged)), I suggested:

I wonder, is there any way we can check for other places that might have this bug, or prevent it in the future? I see other places in tor-proto that use let (something, _) = join!(...);, but I don't know if they're problematic.

I don't know if must_use annotations would do what we want here, or we can do some kind of ergonomics to make this kind of accidental drop harder to write in our tests.