Skip to content

Unpin trait impl conflict with pin-project crate #92

@glingy

Description

@glingy

Is your feature request related to a problem? Please describe.
When using this crate with the pin-project crate, multiple Unpin impls are created by both crates and it will not compile.

Using pin-project and pinned-init crates:

use pin_project::pin_project;
use pinned_init::pin_data;

#[pin_project]
#[pin_data]
pub struct Test1 {
    #[pin]
    data: u32,
}
error[E0119]: conflicting implementations of trait `Unpin` for type `Test1`
 --> src/sim/test2.rs:4:1
  |
4 | #[pin_project]
  | ^^^^^^^^^^^^^^ conflicting implementation for `Test1`
5 | #[pin_data]
  | ----------- first implementation here
  |
  = note: this error originates in the derive macro `::pin_project::__private::__PinProjectInternalDerive` (in Nightly builds, run with -Z macro-backtrace for more info)

For more information about this error, try `rustc --explain E0119`.

Describe the solution you'd like
I originally tried the pin-init crate at https://crates.io/crates/pin-init, which specifically states compatibility with pin-project, and if this crate is taking over the name (and the old one hasn't been updated in several years), I'm hoping that this can be used with pin-project in the future. I am aware that the kernel is not directly looking for this support as pin-project uses syn, but it would be useful for us non-kernel folk :)

I do not know which project should work with the other, but it's worth a shot to ask and see what happens.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions