All notable changes to this project will be documented in this file.
This project adheres to Semantic Versioning.
Releases may yanked if there is a security bug, a soundness bug, or a regression.
1.1.7 - 2024-10-24
- Work around an issue on negative_impls that allows unsound overlapping
Unpin
implementations. (#357)
1.1.6 - 2024-10-05
-
Suppress
clippy::needless_lifetimes
lint in generated code. -
Disable
derive
feature ofsyn
dependency.
1.1.5 - 2024-03-05
- Suppress
unused_qualifications
lint in generated code.
1.1.4 - 2024-01-25
- Suppress
clippy::missing_docs_in_private_items
andclippy::missing_inline_in_public_items
lints in generated code. (#356, thanks @daxpedda)
1.1.3 - 2023-08-06
- Hide documentation of the
Unpin
implementation for!Unpin
option to work around rustdoc issue. (#355, thanks @matheus-consoli)
1.1.2 - 2023-07-02
- Inline project methods.
1.1.1 - 2023-06-29
- Fix build error from dependency when built with
-Z minimal-versions
.
1.1.0 - 2023-05-13
- 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)
1.0.12 - 2022-08-15
- Suppress
unused_tuple_struct_fields
lint in generated code.
1.0.11 - 2022-07-02
1.0.10 - 2021-12-31
- Revert the increase of the minimal version of
syn
that was done in 1.0.9.
1.0.9 - 2021-12-26
-
Update minimal version of
syn
to 1.0.84.
1.0.8 - 2021-07-21
1.0.7 - 2021-04-16
1.0.6 - 2021-03-25
1.0.5 - 2021-02-03
1.0.4 - 2021-01-09
1.0.3 - 2021-01-05
- Exclude unneeded files from crates.io.
1.0.2 - 2020-11-18
1.0.1 - 2020-10-15
Note: This release has been yanked because it failed to compile with syn 1.0.84 and later.
1.0.0 - 2020-10-13
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. Useproject_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
, andclippy::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.
1.0.0-alpha.1 - 2020-09-22
-
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. Useproject_replace
argument instead. -
Suppress
explicit_outlives_requirements
,box_pointers
,clippy::large_enum_variant
,clippy::pattern_type_mismatch
, andclippy::implicit_return
lints in generated code. (#276, #277) -
Diagnostic improvements.
See also tracking issue for 1.0 release.
0.4.30 - 2022-07-02
0.4.29 - 2021-12-26
0.4.28 - 2021-03-28
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.)
0.4.27 - 2020-10-11
Note: This release has been yanked because it failed to compile with syn 1.0.84 and later.
- Update minimal version of
syn
to 1.0.44.
0.4.26 - 2020-10-04
Note: This release has been yanked because it failed to compile with syn 1.0.84 and later.
0.4.25 - 2020-10-01
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.)
0.4.24 - 2020-09-26
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.
0.4.23 - 2020-07-27
Note: This release has been yanked because it failed to compile with syn 1.0.84 and later.
0.4.22 - 2020-06-14
Note: This release has been yanked because it failed to compile with syn 1.0.84 and later.
- Documentation improvements.
0.4.21 - 2020-06-13
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.
0.4.20 - 2020-06-07
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 forReplace
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.
0.4.19 - 2020-06-04
Note: This release has been yanked because it failed to compile with syn 1.0.84 and later.
0.4.18 - 2020-06-04
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.
0.4.17 - 2020-05-18
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; } } }
0.4.16 - 2020-05-11
Note: This release has been yanked because it failed to compile with syn 1.0.84 and later.
0.4.15 - 2020-05-10
Note: This release has been yanked because it failed to compile with syn 1.0.84 and later.
0.4.14 - 2020-05-09
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 forPhantomPinned
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.
0.4.13 - 2020-05-07
Note: This release has been yanked because it failed to compile with syn 1.0.84 and later.
0.4.12 - 2020-05-07
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. No code changes from 0.4.10.
0.4.11 - 2020-05-07
Note: This release has been yanked. See #206 for details.
-
Fix an issue that
#[project]
on non-statement expression does not work without unstable features. -
Suppress
clippy::needless_pass_by_value
lint in generated code of#[pinned_drop]
. -
Documentation improvements.
-
Diagnostic improvements.
0.4.10 - 2020-05-04
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 theReplace
argument to#[pin_project]
attribute. See the documentation for more details. -
Support
Self
andself
in more syntax positions inside#[pinned_drop]
impl. -
Hide all generated items except for projected types from calling code. See #192 for details.
0.4.9 - 2020-04-14
Note: This release has been yanked because it failed to compile with syn 1.0.84 and later.
-
Fix lifetime inference error when associated types are used in fields.
-
#[project]
attribute can now be used forif let
expressions.
0.4.8 - 2020-01-27
Note: This release has been yanked because it failed to compile with syn 1.0.84 and later.
-
Ensure that users cannot implement
PinnedDrop
without proper attribute argument. -
Fix use of
Self
in expression position inside#[pinned_drop]
impl.
0.4.7 - 2020-01-20
Note: This release has been yanked because it failed to compile with syn 1.0.84 and later.
0.4.6 - 2019-11-20
Note: This release has been yanked because it failed to compile with syn 1.0.84 and later.
0.4.5 - 2019-10-21
Note: This release has been yanked because it failed to compile with syn 1.0.84 and later.
0.4.4 - 2019-10-17
Note: This release has been yanked because it failed to compile with syn 1.0.84 and later.
0.4.3 - 2019-10-15
Note: This release has been yanked. See #148 for details.
-
#[pin_project]
can now interoperate with#[cfg()]
on tuple structs and tuple variants. -
Fix support for DSTs(Dynamically Sized Types) on
#[pin_project(UnsafeUnpin)]
-
Diagnostic improvements.
0.4.2 - 2019-09-29
Note: This release has been yanked. See #148 for details.
0.4.1 - 2019-09-26
Note: This release has been yanked. See #148 for details.
0.4.0 - 2019-09-25
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 - anUnpin
impl is now generated by default. -
Drop impls must be specified with
#[pinned_drop]
instead of via a normalDrop
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:
0.4.0-beta.1 - 2019-09-21
-
Change the argument type of project method back to
self: Pin<&mut Self>
. -
Remove "project_attr" feature and always enable
#[project]
attribute.
0.4.0-alpha.11 - 2019-09-11
-
Change #[pinned_drop] to trait implementation.
#[pinned_drop] impl<T> PinnedDrop for Foo<'_, T> { fn drop(mut self: Pin<&mut Self>) { **self.project().was_dropped = true; } }
-
Add some examples and generated code.
-
Diagnostic improvements.
0.4.0-alpha.10 - 2019-09-07
-
Documentation improvements.
0.4.0-alpha.9 - 2019-09-05
-
Add
project_into
method to#[pin_project]
types. This can be useful when returning a pin projection from a method.fn get_pin_mut(self: Pin<&mut Self>) -> Pin<&mut T> { self.project_into().pinned }
-
Prevent
UnpinStruct
from appearing in the document by default. See #71 for more details.
0.4.0-alpha.8 - 2019-09-03
-
Improve document of generated code.. Also added an option to control the document of generated code. See #62 for more details.
0.4.0-alpha.7 - 2019-09-02
0.4.0-alpha.6 - 2019-09-01
0.4.0-alpha.5 - 2019-08-24
0.4.0-alpha.4 - 2019-08-23
- Suppress
clippy::drop_bounds
lint in generated code.
0.4.0-alpha.3 - 2019-08-23
-
Change
project
method generated by#[pin_project]
attribute to take an&mut Pin<&mut Self>
argument. -
#[pin_project]
attribute can now detect that the type used does not have its own drop implementation without actually implementing drop. This removed some restrictions.
0.4.0-alpha.2 - 2019-08-13
- Update
proc-macro2
,syn
, andquote
to 1.0.
0.4.0-alpha.1 - 2019-08-11
-
Pin projection has become a safe operation.
-
#[unsafe_project]
has been replaced with#[pin_project]
. -
The
Unpin
argument has been removed - anUnpin
impl is now generated by default. -
Drop impls must be specified with
#[pinned_drop]
instead of via a normalDrop
impl. -
Unpin
impls must be specified with an impl ofUnsafeUnpin
, instead of implementing the normalUnpin
trait. -
Make
#[project]
attribute disabled by default.
See also tracking issue for 0.4 release.
0.3.5 - 2019-08-14
- Update
proc-macro2
,syn
, andquote
to 1.0.
0.3.4 - 2019-07-21
- Diagnostic improvements.
0.3.3 - 2019-07-15
Note: This release has been yanked. See #16 for details.
- Diagnostic improvements.
0.3.2 - 2019-03-30
- Avoid suffixes on tuple index.
0.3.1 - 2019-03-02
-
Documentation improvements.
-
Update minimum
syn
version to 0.15.22.
0.3.0 - 2019-02-20
-
Remove
unsafe_fields
attribute. -
Remove
unsafe_variants
attribute.
0.2.2 - 2019-02-20
- Fix a bug that generates incorrect code for the some structures with trait bounds on type generics.
0.2.1 - 2019-02-20
- Fix a bug that generates incorrect code for the structures with where clause and associated type fields.
0.2.0 - 2019-02-11
-
Make
unsafe_fields
optional. -
Documentation improvements.
0.1.8 - 2019-02-02
-
Add the feature to create projected enums to
unsafe_project
. -
Add
project
attribute to support pattern matching.
0.1.7 - 2019-01-19
- Fix documentation.
0.1.6 - 2019-01-19
-
unsafe_fields
can now opt-out. -
Add
unsafe_variants
attribute. This attribute is available if pin-project is built with the "unsafe_variants" feature.
0.1.5 - 2019-01-17
- Add support for tuple struct to
unsafe_project
.
0.1.4 - 2019-01-12
- Add options for automatically implementing
Unpin
to bothunsafe_project
andunsafe_fields
.
0.1.3 - 2019-01-11
-
Fix dependencies.
-
Add
unsafe_fields
attribute.
0.1.2 - 2019-01-09
- Documentation improvements.
0.1.1 - 2019-01-08
- Rename from
unsafe_pin_project
tounsafe_project
.
0.1.0 - 2019-01-08
Note: This release has been yanked.
Initial release