If the reload::Subscriber was used with a filtered Subscribe, the filters panicked with debug_assertions because nothing cleared interests of the filters. This is because on_subscribe was not called and so the Registry didn't know there were filters involved.
See the new test for an example of what currently panics on master.
downcast_raw also did not special-case the magic filter marker so even if the inner subscriber was filtered, other layers could never find out.
Solution
I've added an implementation for on_subscribe in reload::Subscriber so that filters are properly registered within the Registry.
I've also added an unsafe implementation to downcasting to special-case the magic marker. I've tried to make sure for this to be completely safe even if the caller decides to dereference the returned pointer. This implementation is needed so that Layered and others can tell whether the reload::Subscriber uses psf or not.
Motivation
If the
reload::Subscriber
was used with a filteredSubscribe
, the filters panicked withdebug_assertions
because nothing cleared interests of the filters. This is becauseon_subscribe
was not called and so theRegistry
didn't know there were filters involved.See the new test for an example of what currently panics on
master
.downcast_raw
also did not special-case the magic filter marker so even if the inner subscriber was filtered, other layers could never find out.Solution
I've added an implementation for
on_subscribe
inreload::Subscriber
so that filters are properly registered within theRegistry
.I've also added an unsafe implementation to downcasting to special-case the magic marker. I've tried to make sure for this to be completely safe even if the caller decides to dereference the returned pointer. This implementation is needed so that
Layered
and others can tell whether thereload::Subscriber
uses psf or not.