0.4.17
-
Support naming the projection types.
By passing an argument with the same name as the method to the attribute, you can name the projection type returned from the method:
use pin_project::pin_project; use std::pin::Pin; #[pin_project(project = EnumProj)] enum Enum<T> { Variant(#[pin] T), } fn func<T>(x: Pin<&mut Enum<T>>) { match x.project() { EnumProj::Variant(y) => { let _: Pin<&mut T> = y; } } }