Releases: taiki-e/pin-project
1.0.0-alpha.1
-
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.23
0.4.22
0.4.21
-
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.
0.4.20
-
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 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. -
Suppress
unreachable_pub
lint in generated code.
0.4.19
0.4.18
-
Support
Self
in more syntax positions inside#[pinned_drop]
impl. -
Documentation improvements.
-
Diagnostic improvements.
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; } } }