diff --git a/CHANGELOG.md b/CHANGELOG.md index 28f705cf..ed7cfbcc 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,32 @@ This project adheres to [Semantic Versioning](https://semver.org). ## [Unreleased] +## [0.4.17] - 2020-05-18 + +* [Allowed naming the projected types.][202] + + By passing an argument with the same name as the method to the attribute, you can name the projection type returned from the method: + + ```rust + use pin_project::pin_project; + use std::pin::Pin; + + #[pin_project(project = EnumProj)] + enum Enum { + Variant(#[pin] T), + } + + fn func(x: Pin<&mut Enum>) { + match x.project() { + EnumProj::Variant(y) => { + let _: Pin<&mut T> = y; + } + } + } + ``` + +[202]: https://github.com/taiki-e/pin-project/pull/202 + ## [0.4.16] - 2020-05-11 * [Fixed an issue that users can call internal function generated by `#[pinned_drop]`.][223] @@ -411,7 +437,8 @@ See also [tracking issue for 0.4 release][21]. Initial release -[Unreleased]: https://github.com/taiki-e/pin-project/compare/v0.4.16...HEAD +[Unreleased]: https://github.com/taiki-e/pin-project/compare/v0.4.17...HEAD +[0.4.17]: https://github.com/taiki-e/pin-project/compare/v0.4.16...v0.4.17 [0.4.16]: https://github.com/taiki-e/pin-project/compare/v0.4.15...v0.4.16 [0.4.15]: https://github.com/taiki-e/pin-project/compare/v0.4.14...v0.4.15 [0.4.14]: https://github.com/taiki-e/pin-project/compare/v0.4.13...v0.4.14 diff --git a/Cargo.toml b/Cargo.toml index 7f176d40..a7bb174b 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "pin-project" -version = "0.4.16" +version = "0.4.17" authors = ["Taiki Endo "] edition = "2018" license = "Apache-2.0 OR MIT" @@ -27,7 +27,7 @@ members = [ ] [dependencies] -pin-project-internal = { version = "=0.4.16", path = "pin-project-internal", default-features = false } +pin-project-internal = { version = "=0.4.17", path = "pin-project-internal", default-features = false } [dev-dependencies] auxiliary-macros = { version = "0.1", path = "tests/ui/auxiliary" } diff --git a/pin-project-internal/Cargo.toml b/pin-project-internal/Cargo.toml index 2866c10e..597a134a 100644 --- a/pin-project-internal/Cargo.toml +++ b/pin-project-internal/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "pin-project-internal" -version = "0.4.16" +version = "0.4.17" authors = ["Taiki Endo "] edition = "2018" license = "Apache-2.0 OR MIT" @@ -25,5 +25,5 @@ quote = "1.0" syn = { version = "1.0.13", features = ["full", "visit-mut"] } [dev-dependencies] -pin-project = { version = "0.4.16", path = ".." } +pin-project = { version = "0.4.17", path = ".." } rustversion = "1.0" diff --git a/pin-project-internal/src/lib.rs b/pin-project-internal/src/lib.rs index a6aecafe..b73888c2 100644 --- a/pin-project-internal/src/lib.rs +++ b/pin-project-internal/src/lib.rs @@ -1,7 +1,7 @@ //! An internal crate to support pin_project - **do not use directly** #![recursion_limit = "256"] -#![doc(html_root_url = "https://docs.rs/pin-project-internal/0.4.16")] +#![doc(html_root_url = "https://docs.rs/pin-project-internal/0.4.17")] #![doc(test( no_crate_inject, attr(deny(warnings, rust_2018_idioms, single_use_lifetimes), allow(dead_code)) diff --git a/src/lib.rs b/src/lib.rs index 02c82b73..42005ccf 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -34,7 +34,7 @@ #![no_std] #![recursion_limit = "256"] -#![doc(html_root_url = "https://docs.rs/pin-project/0.4.16")] +#![doc(html_root_url = "https://docs.rs/pin-project/0.4.17")] #![doc(test( no_crate_inject, attr(deny(warnings, rust_2018_idioms, single_use_lifetimes), allow(dead_code))