ipc-channel icon indicating copy to clipboard operation
ipc-channel copied to clipboard

Relax Debug bounds on IpcReceiver and IpcSender

Open nox opened this issue 9 years ago • 5 comments

Their Debug impls shouldn't require T: Debug.

nox avatar Jul 18 '16 11:07 nox

I think the actual problem is that for some reason deriving Debug on something with PhantomData<T> requires T:Debug? Not sure why it does though -- doesn't make sense to me...

antrik avatar Jul 18 '16 19:07 antrik

No that's only because we derive their implementation, we don't need the bound if we implement it ourselves.

nox avatar Jul 18 '16 19:07 nox

@nox yes -- my point was that I don't see why the derived implementation has to impose these bounds, if a custom implementation doing exactly the same doesn't need it... Unless the derived implementation actually does something else that I'm missing? Otherwise I consider it a shortcoming in Rust, that should be fixed rather than working around it.

antrik avatar Aug 20 '16 17:08 antrik

@antrik It's not really fixable easily in Rust, so we work around it here, nothing too surprising. It's hard for rustc to know which bounds to use for which types.

nox avatar Aug 20 '16 17:08 nox

I think a recent nightly does it better, but that means that stable won't derive the same thing for now AFAIK.

nox avatar Aug 20 '16 17:08 nox