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
It seems to me that the requirements of TrustedHandle::new being correct are exactly that the handle matches the invariants on HasRawWindowHandle, i.e.
implTrustedWindowHandle{fnfrom_handle<T:HasRawWindowHandle>(has_handle:&T){// Safe: `impl HasRawWindowHandle` requires that `raw_window_handle`// returns a valid handleunsafe{Self::new(has_handle.raw_window_handle())};}}
(I need this for bevyengine/bevy#1279, which is currently assuming that the impl could be correct, so I would like to know if that assumption is wrong anyway. That PR is otherwise blocked on #58 anyway)
The text was updated successfully, but these errors were encountered:
It seems to me that the requirements of
TrustedHandle::new
being correct are exactly that the handle matches the invariants onHasRawWindowHandle
, i.e.would be valid (and useful)
Original comment from (#52 (comment))
Would it be possible to have a safe impl of new or equivalent for any T: HasRawWindowHandle?
Specifically, an implementation which would replace https://github.com/bevyengine/bevy/blob/a68c78cef5fb2112617de095efd4e64cba1587eb/crates/bevy_winit/src/winit_windows.rs#L117-L119
(I need this for bevyengine/bevy#1279, which is currently assuming that the impl could be correct, so I would like to know if that assumption is wrong anyway. That PR is otherwise blocked on #58 anyway)
The text was updated successfully, but these errors were encountered: