-
-
Notifications
You must be signed in to change notification settings - Fork 36
Labels
A-unpinArea: Unpin and UnsafeUnpinArea: Unpin and UnsafeUnpinC-bugCategory: related to a bug.Category: related to a bug.C-enhancementCategory: A new feature or an improvement for an existing oneCategory: A new feature or an improvement for an existing oneregression-from-0.3-to-0.4Regression from 0.3 to 0.4Regression from 0.3 to 0.4
Milestone
Description
Unless I misunderstand something, it seems the logic to put the field in __UnpinStruct is reversed, as it checks that the #[pin]'ed field are Unpin.
For example:
// This structure cannot be moved
struct Property {
pin: std::marker::PhantomPinned
}
#[pin_project::pin_project]
struct Container {
#[pin]
xxx : Property
}
Result in this error:
error[E0277]: the trait bound `std::marker::PhantomPinned: std::marker::Unpin` is not satisfied in `__unpin_scope_Container::__UnpinStructContainer`
|
20 | #[pin_project::pin_project]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^ within `__unpin_scope_Container::__UnpinStructContainer`, the trait `std::marker::Unpin` is not implemented for `std::marker::PhantomPinned`
|
__UnpinStruct constraints all the pin'ed types. But I believe it should be the opposite, only the types that are not pinned should satisfy Unpin.
Metadata
Metadata
Assignees
Labels
A-unpinArea: Unpin and UnsafeUnpinArea: Unpin and UnsafeUnpinC-bugCategory: related to a bug.Category: related to a bug.C-enhancementCategory: A new feature or an improvement for an existing oneCategory: A new feature or an improvement for an existing oneregression-from-0.3-to-0.4Regression from 0.3 to 0.4Regression from 0.3 to 0.4