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
Context<dyn HasDisplayHandle> was mentioned there, but if you try to specify that type anywhere, it errors because Context and ContextDispatch do not have D: ?Sized bounds. So the public API doesn't actually allow that.
Adding those bounds is easy, but is there a way to construct a Context<dyn HasDisplayHandle>?
If ?Sized is useful, we should make sure it works and have a test that it continues working on all platforms. Otherwise, it can be removed, which may make other refactoring easier.
I don't think it should be an issue with anything, but ?Sized may need to be added in more places, and some care may be needed not to break this use case, so if it's possible it would be good to have a test for it.
It's also possible to use Context<Box<dyn HasDisplayHandle>>, so the advantage is saving an extra boxing, I guess.
I don't think Rust could allow a coercion from Context<T> to Context<dyn HasDisplayHandle<T>> since type type signature doesn't express exactly how the T is used.
I think if it's possible we'd at least need to provide some kind of conversion for that to work. And I don't know exactly how that works when we have a boxed/ref-counted custom unsized type containing the T.
#132 added trait bonds with
?Sized
.Context<dyn HasDisplayHandle>
was mentioned there, but if you try to specify that type anywhere, it errors becauseContext
andContextDispatch
do not haveD: ?Sized
bounds. So the public API doesn't actually allow that.Adding those bounds is easy, but is there a way to construct a
Context<dyn HasDisplayHandle>
?If
?Sized
is useful, we should make sure it works and have a test that it continues working on all platforms. Otherwise, it can be removed, which may make other refactoring easier.CC @notgull
The text was updated successfully, but these errors were encountered: