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
Improve Box<T> -> Pin<Box<T>> conversion
I found the `From` trait conversion for this very hard to find, having a named function for it is much more discoverable. Also fixesrust-lang#56256 as I need that in the place I'm using this.
Has a placeholder tracking issue, will file an issue once I get feedback.
Currently, the implementation for
From<Box<T>> for Pin<Box<T>>
is defined as:https://doc.rust-lang.org/nightly/std/pin/struct.Pin.html#impl-From%3CBox%3CT%3E%3E
This does not allow trait objects to be pinned. It is however possible to call
Box::pinned
, and convert that into a trait object.Is it intentional that T is required to be Sized on the From implementation?
Defining it as this:
allows to call
Pin::from(trait_object)
The text was updated successfully, but these errors were encountered: