Closed
Description
Current prerelease: 0.4.0-beta.1
The most important fix of this release is that pin projection has become a safe operation (#18, thanks @Aaron1011)
Changes
#[unsafe_project]
has been replaced with#[pin_project]
. (Replaceunsafe_project
with safepin_projectable
attribute #18, Remove pin_project! macro and add #[pinned_drop] attribute #33)- The
Unpin
argument has been removed - anUnpin
impl is now generated by default. (Replaceunsafe_project
with safepin_projectable
attribute #18) - Drop impls must be specified with
#[pinned_drop]
attribute instead of via a normalDrop
impl. (Replaceunsafe_project
with safepin_projectable
attribute #18, Remove pin_project! macro and add #[pinned_drop] attribute #33, Change #[pinned_drop] to trait implementation #86) Unpin
impls must be specified with an impl ofUnsafeUnpin
, instead of implementing the normalUnpin
trait. (Replaceunsafe_project
with safepin_projectable
attribute #18)ChangedEDIT: reverted in Change the argument type of project method back toproject
method generated by#[pin_project]
attribute to take an&mut Pin<&mut Self>
argument. (Make generated 'project' reference take an '&mut Pin<&mut Self>' #47)self: Pin<&mut Self>
#90- Removed "project_attr" feature and always enable
#[project]
attribute (Remove "project_attr" feature and always enable #[project] attribute #94) #[project]
attribute can now be used forimpl
blocks. (Add impl block support to #[project] attribute #46)#[project]
attribute can now be used foruse
statements. (Add use statements support to #[project] attribute #85)MadeEDIT: replaced with Remove "project_attr" feature and always enable #[project] attribute #94#[project]
attribute disabled by default. (Should #[project] attribute be disabled by default? #36, Make #[project] attribute disabled by default #41)- Added
project_ref
method and#[project_ref]
attribute. (Add project_ref method and #[project_ref] attribute #93) #[pin_project]
attribute now determines the visibility of the projection type/method is based on the original type. (Determine the visibility based on the original type #96)
TODO
Some adjustments are needed.
- Make error message more obvious (Replace
unsafe_project
with safepin_projectable
attribute #18 (comment)); done in Cleanup #22 -
unsafe_Unpin
vsUnsafeUnpin
vsunsafe_unpin
(Replaceunsafe_project
with safepin_projectable
attribute #18 (comment)); done in Change 'unsafe_Unpin' to UpperCamelCase (UnsafeUnpin) #40 (AdoptedUnsafeUnpin
). - Update proc-macro2, syn, and quote to 1.0; done in Update proc-macro2, syn, and quote to 1.0 #23
-
Test code examples in README (Test code examples in README #19)EDIT: see Test code examples in README #19 (comment) - Mention Can bypass
repr(packed)
checking by hiding it in a proc-macro-attribute #32 in the documents; done in Ensure that #[repr(packed)] cannot be used on #[pin_projectable] structs #34 - pin-project does not interoperate well with #[cfg()] (pin-project does not interoperate well with #[cfg()] #68)
Unresolved issues
- Different approach to
Unpin
vsDrop
(Weirdly different approach toUnpin
vsDrop
#26); done in Change #[pinned_drop] to trait implementation #86 - Change the argument type of project method back to
self: Pin<&mut Self>
(Change the argument type of project method back toself: Pin<&mut Self>
#89)
Blockers
-
Whether or notEDIT: replaced with Change the argument type of project method back toself: &mut Pin<&mut Self>
stabilizes in Rust 1.39 (Stabilize nested self receivers in 1.41.0 rust-lang/rust#64325)self: Pin<&mut Self>
#89 - Rustdoc issues (will be fixed in Improve Rustdoc's handling of procedural macros rust-lang/rust#62855); see Properly inline documentation and use intra-crate lints #98
- 1.0 release of proc-macro2, syn, and quote
I plan to have a few alpha releases before the blockers are resolved.