NewYour coding agent can read the release notes before it upgrades.Set up the MCP server →
crates.io, #225 most downloaded on crates.io
Implementation detail of the `pin-project` crate.
Latest stable
1.2.0
Last release 3 days ago
19 Nov 2026
Release timing varies
gaps range from 8 days to 12 months
Nearly every release is documented
notes for 59 of 59 stable releases
Nothing withdrawn
no release was ever pulled
7 years old
72 releases · first in 2019
Drag across the ruler to compare, or tap a release to open it.
Fix Drop impl check with always unsized type. ( #375 , thanks @jadenfix )
Suppress clippy::missing_trait_methods lint in generated code.
clippy::missing_trait_methods lint in generated code.Your coding agent can read these notes before it upgrades. Set up the MCP server →
Documentation improvements.
- Enable release immutability.
Suppress clippy::elidable_lifetime_names lint in generated code.
clippy::elidable_lifetime_names lint in generated code.Suppress clippy::missing_const_for_fn lint in generated code.
clippy::missing_const_for_fn lint in generated code.Suppress unnameable_types, clippy::absolute_paths, clippy::min_ident_chars, clippy::pub_with_shorthand, clippy::single_call_fn, clippy::single_char_li
unnameable_types, clippy::absolute_paths, clippy::min_ident_chars, clippy::pub_with_shorthand, clippy::single_call_fn, clippy::single_char_lifetime_names lints in generated code.Work around an issue on negative_impls that allows unsound overlapping Unpin implementations.
Unpin implementations. (#357)Suppress clippy::needless_lifetimes lint in generated code.
Suppress clippy::needless_lifetimes lint in generated code.
Disable derive feature of syn dependency.
Suppress unused_qualifications lint in generated code.
unused_qualifications lint in generated code.Suppress clippy::missing_docs_in_private_items and clippy::missing_inline_in_public_items lints in generated code. (#356, thanks @daxpedda)
clippy::missing_docs_in_private_items and clippy::missing_inline_in_public_items lints in generated code. (#356, thanks @daxpedda)Hide documentation of the Unpin implementation for !Unpin option to work around rustdoc issue. (#355, thanks @matheus-consoli)
Unpin implementation for !Unpin option to work around rustdoc issue. (#355, thanks @matheus-consoli)- Inline project methods.
Fix build error from dependency when built with -Z minimal-versions.
-Z minimal-versions.Update syn dependency to 2. This increase the minimum supported Rust version from Rust 1.37 to Rust 1.56. (#352, #354, thanks @maurer and @daxpedda)
Suppress unused_tuple_struct_fields lint in generated code.
unused_tuple_struct_fields lint in generated code.Suppress `dead_code` lint in generated code.
Revert the increase of the minimal version of syn that was done in 1.0.9.
syn that was done in 1.0.9.Prevent abuse of private module.
Update minimal version of syn to 1.0.84.
Suppress `clippy::use_self` and `clippy::type_repetition_in_bounds` lints in generated code.
[Fix compile error when using self:: as prefix of path inside #[pinned_drop] impl.]
Suppress `clippy::semicolon_if_nothing_returned` lint in generated code.
Suppress `deprecated` lint in generated code.
Suppress `clippy::ref_option_ref` lint in generated code.
Exclude unneeded files from crates.io.
Suppress `clippy::unknown_clippy_lints` lint in generated code.
[Fix warnings when #[pin_project] attribute used within macro_rules! macros.]
Note: This release has been yanked because it failed to compile with syn 1.0.84 and later.
[Remove deprecated #[project], #[project_ref], and #[project_replace] attributes.]
Remove deprecated #[project], #[project_ref], and #[project_replace] attributes.
Name the projected type by passing an argument with the same name as the method to the #[pin_project] attribute instead:
- #[pin_project]
+ #[pin_project(project = EnumProj)]
enum Enum<T> {
Variant(#[pin] T),
}
- #[project]
fn func<T>(x: Pin<&mut Enum<T>>) {
- #[project]
match x.project() {
- Enum::Variant(_) => { /* ... */ }
+ EnumProj::Variant(_) => { /* ... */ }
}
}
Remove deprecated Replace argument from #[pin_project] attribute. Use project_replace argument instead.
Raise the minimum supported Rust version of this crate from Rust 1.34 to Rust 1.37.
Suppress explicit_outlives_requirements, box_pointers, clippy::large_enum_variant, clippy::pattern_type_mismatch, clippy::implicit_return, and clippy::redundant_pub_crate lints in generated code. (#276, #277, #284)
Diagnostic improvements.
Changes since the 1.0.0-alpha.1 release:
Update minimal version of syn to 1.0.44
Note: This release has been yanked because it failed to compile with syn 1.0.84 and later.
Remove deprecated #[project], #[project_ref], and #[project_replace] attributes.
Name the projected type by passing an argument with the same name as the method to the #[pin_project] attribute instead:
- #[pin_project]
+ #[pin_project(project = EnumProj)]
enum Enum<T> {
Variant(#[pin] T),
}
- #[project]
fn func<T>(x: Pin<&mut Enum<T>>) {
- #[project]
match x.project() {
- Enum::Variant(_) => { /* ... */ }
+ EnumProj::Variant(_) => { /* ... */ }
}
}
Remove deprecated Replace argument from #[pin_project] attribute. Use project_replace argument instead.
Raise the minimum supported Rust version of this crate from Rust 1.34 to Rust 1.37.
Suppress explicit_outlives_requirements, box_pointers, clippy::large_enum_variant, clippy::pattern_type_mismatch, clippy::implicit_return, and clippy::redundant_pub_crate lints in generated code. (#276, #277, #284)
Diagnostic improvements.
Changes since the 1.0.0-alpha.1 release:
Update minimal version of syn to 1.0.44.
[Remove deprecated #[project], #[project_ref], and #[project_replace] attributes.]
Remove deprecated #[project], #[project_ref], and #[project_replace] attributes.
Name the projected type by passing an argument with the same name as the method to the #[pin_project] attribute instead:
- #[pin_project]
+ #[pin_project(project = EnumProj)]
enum Enum<T> {
Variant(#[pin] T),
}
- #[project]
fn func<T>(x: Pin<&mut Enum<T>>) {
- #[project]
match x.project() {
- Enum::Variant(_) => { /* ... */ }
+ EnumProj::Variant(_) => { /* ... */ }
}
}
Remove deprecated Replace argument from #[pin_project] attribute. Use project_replace argument instead.
Suppress explicit_outlives_requirements, box_pointers, clippy::large_enum_variant, clippy::pattern_type_mismatch, and clippy::implicit_return lints in generated code. (#276, #277)
Diagnostic improvements.
See also tracking issue for 1.0 release.
Suppress `dead_code` lint in generated code.
Fix compile error with `syn` 1.0.84 and later.
Fix `unused_must_use` warning on unused borrows, which will be added to rustc in the future. See #322 for more details.
Fix unused_must_use warning on unused borrows, which will be added to rustc in the future. See #322 for more details.
(Note: 1.0 does not have this problem.)
Note: This release has been yanked because it failed to compile with syn 1.0.84 and later.
Fix unused_must_use warning on unused borrows, which will be added to rustc in the future. See #322 for more details.
(Note: 1.0 does not have this problem.)
Update minimal version of syn to 1.0.44
Note: This release has been yanked because it failed to compile with syn 1.0.84 and later.
syn to 1.0.44.Fix drop order of pinned fields in project_replace
Note: This release has been yanked because it failed to compile with syn 1.0.84 and later.
Suppress drop_bounds lint, which will be added to rustc in the future. See #272 for more details.
Suppress drop_bounds lint, which will be added to rustc in the future. See #272 for more details.
(Note: 1.0.0-alpha.1 already contains this change.)
Note: This release has been yanked because it failed to compile with syn 1.0.84 and later.
Suppress drop_bounds lint, which will be added to rustc in the future. See #272 for more details.
(Note: 1.0.0-alpha.1 already contains this change.)
Fix compatibility of generated code with forbid(future_incompatible)
Fix compatibility of generated code with forbid(future_incompatible)
Note: This does not guarantee compatibility with forbid(future_incompatible) in the future.
If rustc adds a new lint, we may not be able to keep this.
Note: This release has been yanked because it failed to compile with syn 1.0.84 and later.
Fix compatibility of generated code with forbid(future_incompatible).
Note: This does not guarantee compatibility with forbid(future_incompatible) in the future.
If rustc adds a new lint, we may not be able to keep this.
[Fix compile error with ?Sized type parameters.][263]
Note: This release has been yanked because it failed to compile with syn 1.0.84 and later.
Note: This release has been yanked because it failed to compile with syn 1.0.84 and later.
Note: This release has been yanked because it failed to compile with syn 1.0.84 and later.
[Deprecated #[project], #[project_ref], and #[project_replace] attributes due to some unfixable limitations.][244]
Consider naming the projected type by passing an argument with the same name as the method to the #[pin_project] attribute instead.
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;
}
}
}
See #225 for more details.
Diagnostic improvements.
Note: This release has been yanked because it failed to compile with syn 1.0.84 and later.
Consider naming the projected type by passing an argument with the same name as the method to the #[pin_project] attribute instead.
#[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;
}
}
}
See #225 for more details.
Diagnostic improvements.
*The Replace argument will be deprecated in the future.*
You can now use project_replace argument without Replace argument. This used to require you to specify both.
- #[pin_project(Replace, project_replace = EnumProjOwn)]
+ #[pin_project(project_replace = EnumProjOwn)]
enum Enum<T> {
Variant(#[pin] T)
}
Makes project_replace argument an alias for Replace argument so that it can be used without a value.
#[pin_project(project_replace)]
enum Enum<T> {
Variant(#[pin] T)
}
The Replace argument will be deprecated in the future.
Suppress unreachable_pub lint in generated code.
Note: This release has been yanked because it failed to compile with syn 1.0.84 and later.
You can now use project_replace argument without Replace argument.
This used to require you to specify both.
- #[pin_project(Replace, project_replace = EnumProjOwn)]
+ #[pin_project(project_replace = EnumProjOwn)]
enum Enum<T> {
Variant(#[pin] T)
}
Make project_replace argument an alias for Replace argument so that it can be used without a value.
#[pin_project(project_replace)]
enum Enum<T> {
Variant(#[pin] T)
}
The Replace argument will be deprecated in the future.
[Fix unused_results lint in generated code.][239]
Note: This release has been yanked because it failed to compile with syn 1.0.84 and later.
[Support Self in more syntax positions inside #[pinned_drop] impl.][230]
Support Self in more syntax positions inside #[pinned_drop] impl.
Documentation improvements.
Diagnostic improvements.
Note: This release has been yanked because it failed to compile with syn 1.0.84 and later.
Support Self in more syntax positions inside #[pinned_drop] impl.
Documentation improvements.
Diagnostic improvements.
[Support naming the projection types.][202]
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;
}
}
}
Note: This release has been yanked because it failed to compile with syn 1.0.84 and later.
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:
#[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;
}
}
}
[Fixed an issue that users can call internal function generated by #[pinned_drop].][223]
Note: This release has been yanked because it failed to compile with syn 1.0.84 and later.
[#[project] attribute can now handle all project* attributes in that scope with one wrapper attribute.][220]
Note: This release has been yanked because it failed to compile with syn 1.0.84 and later.
[Added !Unpin option to #[pin_project] attribute for guarantee the type is !Unpin.][219]
Added !Unpin option to #[pin_project] attribute for guarantee the type is !Unpin.
use pin_project::pin_project;
#[pin_project(!Unpin)]
struct Struct<T, U> {
field: T,
}
This is equivalent to use #[pin] attribute for PhantomPinned field.
use pin_project::pin_project;
use std::marker::PhantomPinned;
#[pin_project]
struct Struct<T, U> {
field: T,
#[pin] // Note that using `PhantomPinned` without `#[pin]` attribute has no effect.
_pin: PhantomPinned,
}
Note: This raises the minimum supported Rust version of this crate from rustc 1.33 to rustc 1.34.
Fixed an issue where duplicate #[project] attributes were ignored.
Hide generated items from --document-private-items. See #211 for more details.
Improve documentation
Note: This release has been yanked because it failed to compile with syn 1.0.84 and later.
Add !Unpin option to #[pin_project] attribute for guarantee the type is !Unpin.
#[pin_project(!Unpin)]
struct Struct<T, U> {
field: T,
}
This is equivalent to use #[pin] attribute for PhantomPinned field.
#[pin_project]
struct Struct<T, U> {
field: T,
#[pin] // Note that using `PhantomPinned` without `#[pin]` attribute has no effect.
_pin: PhantomPinned,
}
Note: This raises the minimum supported Rust version of this crate from Rust 1.33 to Rust 1.34.
Fix an issue where duplicate #[project] attributes were ignored.
Hide generated items from --document-private-items. See #211 for details.
Documentation improvements.
[Fixed a regression in 0.4.11.][207]
Note: This release has been yanked because it failed to compile with syn 1.0.84 and later.
A release to avoid [a regression in 0.4.11][206]. No code changes from 0.4.10.
Note: This release has been yanked because it failed to compile with syn 1.0.84 and later.
[Fixed an issue that #[project] on non-statement expression does not work without unstable features.][197]
[Added project_replace method and #[project_replace] attribute.][194] project_replace method is optional and can be enabled by passing the Replace arg
project_replace method and #[project_replace] attribute.
project_replace method is optional and can be enabled by passing the Replace argument to #[pin_project] attribute.
See the documentation for more details.Note: This release has been yanked because it failed to compile with syn 1.0.84 and later.
Add project_replace method and #[project_replace] attribute.
project_replace method is optional and can be enabled by passing the Replace argument to #[pin_project] attribute.
See the documentation for more details.
Support Self and self in more syntax positions inside #[pinned_drop] impl.
Hide all generated items except for projected types from calling code. See #192 for details.
[Fixed lifetime inference error when associated types are used in fields.][188]
Note: This release has been yanked because it failed to compile with syn 1.0.84 and later.
[Ensured that users cannot implement PinnedDrop without proper attribute argument.][180]
Note: This release has been yanked because it failed to compile with syn 1.0.84 and later.
[Fixed support for lifetime bounds.][176]
Note: This release has been yanked because it failed to compile with syn 1.0.84 and later.
[Fixed compile error when there is Self in the where clause.][169]
Note: This release has been yanked because it failed to compile with syn 1.0.84 and later.
[Fixed compile error with dyn types.][158]
Note: This release has been yanked because it failed to compile with syn 1.0.84 and later.
[Fixed an issue where PinnedDrop implementations can call unsafe code without an unsafe block.][149]
Note: This release has been yanked because it failed to compile with syn 1.0.84 and later.
[#[pin_project] can now interoperate with #[cfg_attr()].][135]
[Fixed support for DSTs(Dynamically Sized Types).][113]
[Fixed an issue that caused an error when using #[pin_project] on a type that has #[pin] + !Unpin field with no generics or lifetime.][111]
[Pin projection has become a safe operation.][18] In the absence of other unsafe code that you write, it is impossible to cause undefined behavior.
Pin projection has become a safe operation. In the absence of other unsafe code that you write, it is impossible to cause undefined behavior.
#[unsafe_project] attribute has been replaced with #[pin_project] attribute. (#18, #33)
The Unpin argument has been removed - an Unpin impl is now generated by default.
Drop impls must be specified with #[pinned_drop] instead of via a normal Drop impl. (#18, #33, #86)
#[pin_project] can now be used for public type with private field types.
Removed "project_attr" feature and always enable #[project] attribute.
Changes since the 0.4.0-beta.1 release:
Note: This release has been yanked. See #148 for details.
Pin projection has become a safe operation. In the absence of other unsafe code that you write, it is impossible to cause undefined behavior.
#[unsafe_project] attribute has been replaced with #[pin_project] attribute. (#18, #33)
The Unpin argument has been removed - an Unpin impl is now generated by default.
Drop impls must be specified with #[pinned_drop] instead of via a normal Drop impl. (#18, #33, #86)
#[pin_project] can now be used for public type with private field types.
Remove "project_attr" feature and always enable #[project] attribute.
Changes since the 0.4.0-beta.1 release:
One column per quarter.