From da068941d15b1dcb2ab0ea7da50f0e1ae27bb881 Mon Sep 17 00:00:00 2001 From: Taiki Endo Date: Thu, 26 Sep 2019 01:28:19 +0900 Subject: [PATCH] Release 0.4.0 --- CHANGELOG.md | 44 +++++++++++++++++++++++++++++++-- Cargo.toml | 4 +-- README.md | 4 +-- pin-project-internal/Cargo.toml | 4 +-- pin-project-internal/src/lib.rs | 6 ++--- src/lib.rs | 12 ++++----- tests/cfg.rs | 2 +- 7 files changed, 58 insertions(+), 18 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index bb7673fe..056ca309 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,43 @@ # Unreleased +# 0.4.0 - 2019-09-25 + +* [**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. + +* `#[unsafe_project]` attribute has been replaced with `#[pin_project]` attribute. ([#18][18], [#33][33]) + +* [The `Unpin` argument has been removed - an `Unpin` impl is now generated by default.][18] + +* Drop impls must be specified with `#[pinned_drop]` instead of via a normal `Drop` impl. ([#18][18], [#33][33], [#86][86]) + +* [`Unpin` impls must be specified with an impl of `UnsafeUnpin`, instead of implementing the normal `Unpin` trait.][18] + +* [`#[pin_project]` attribute now determines the visibility of the projection type/method is based on the original type.][96] + +* [`#[pin_project]` can now be used for public type with private field types.][53] + +* [`#[pin_project]` can now interoperate with `#[cfg()]`.][77] + +* [Added `project_ref` method to `#[pin_project]` types.][93] + +* [Added `#[project_ref]` attribute.][93] + +* [Removed "project_attr" feature and always enable `#[project]` attribute.][94] + +* [`#[project]` attribute can now be used for `impl` blocks.][46] + +* [`#[project]` attribute can now be used for `use` statements.][85] + +* [`#[project]` attribute now supports `match` expressions at the position of the initializer expression of `let` expressions.][51] + +Changes since the 0.4.0-beta.1 release: + +* [Fixed an issue that caused an error when using `#[pin_project(UnsafeUnpin)]` and not providing a manual `UnsafeUnpin` implementation on a type with no generics or lifetime.][107] + +[18]: https://github.com/taiki-e/pin-project/pull/18 +[33]: https://github.com/taiki-e/pin-project/pull/107 +[107]: https://github.com/taiki-e/pin-project/pull/107 + # 0.4.0-beta.1 - 2019-09-21 * [Changed the argument type of project method back to `self: Pin<&mut Self>`.][90] @@ -42,7 +80,7 @@ # 0.4.0-alpha.10 - 2019-09-07 -* [pin-project can now interoperate with `#[cfg()]`.][77] +* [`#[pin_project]` can now interoperate with `#[cfg()]`.][77] * Improved documentation. @@ -123,7 +161,9 @@ * Made `#[project]` attribute disabled by default. -See also [tracking issue for 0.4 release](https://github.com/taiki-e/pin-project/issues/21). +See also [tracking issue for 0.4 release][21]. + +[21]: https://github.com/taiki-e/pin-project/issues/21 # 0.3.5 - 2019-08-14 diff --git a/Cargo.toml b/Cargo.toml index 17f14891..1b58cb3e 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "pin-project" -version = "0.4.0-beta.1" +version = "0.4.0" authors = ["Taiki Endo "] edition = "2018" license = "Apache-2.0/MIT" @@ -20,7 +20,7 @@ all-features = true members = ["pin-project-internal"] [dependencies] -pin-project-internal = { version = "=0.4.0-beta.1", path = "pin-project-internal", default-features = false } +pin-project-internal = { version = "=0.4.0", path = "pin-project-internal", default-features = false } [dev-dependencies] compiletest = { version = "0.3.21", package = "compiletest_rs", features = ["stable", "tmp"] } diff --git a/README.md b/README.md index 0a2bd3a2..c6a18687 100644 --- a/README.md +++ b/README.md @@ -29,7 +29,7 @@ Add this to your `Cargo.toml`: ```toml [dependencies] -pin-project = "0.4.0-beta.1" +pin-project = "0.4" ``` The current pin-project requires Rust 1.33 or later. @@ -64,7 +64,7 @@ See [API documentation][docs-url] for more details. Also, there are examples and generated code of each feature in [examples](examples/README.md) directory. -[`pin_project`]: https://docs.rs/pin-project-internal/0.4.0-beta.1/pin_project_internal/attr.pin_project.html +[`pin_project`]: https://docs.rs/pin-project-internal/0.4.0/pin_project_internal/attr.pin_project.html ## License diff --git a/pin-project-internal/Cargo.toml b/pin-project-internal/Cargo.toml index 3d6f812a..d2d391b3 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.0-beta.1" +version = "0.4.0" authors = ["Taiki Endo "] edition = "2018" license = "Apache-2.0/MIT" @@ -24,4 +24,4 @@ quote = "1.0" syn = { version = "1.0", features = ["full", "visit-mut"] } [dev-dependencies] -pin-project = { version = "0.4.0-beta.1", path = ".." } +pin-project = { version = "0.4.0", path = ".." } diff --git a/pin-project-internal/src/lib.rs b/pin-project-internal/src/lib.rs index 770e6a94..53803630 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.0-beta.1")] +#![doc(html_root_url = "https://docs.rs/pin-project-internal/0.4.0")] #![doc(test( no_crate_inject, attr(deny(warnings, rust_2018_idioms, single_use_lifetimes), allow(dead_code)) @@ -61,7 +61,7 @@ use utils::{Immutable, Mutable}; /// it is impossible to cause undefined behavior with this attribute. /// /// This is accomplished by enforcing the four requirements for pin projection -/// stated in [the Rust documentation](https://doc.rust-lang.org/beta/std/pin/index.html#projections-and-structural-pinning): +/// stated in [the Rust documentation](https://doc.rust-lang.org/nightly/std/pin/index.html#projections-and-structural-pinning): /// /// 1. The struct must only be Unpin if all the structural fields are Unpin. /// @@ -313,7 +313,7 @@ use utils::{Immutable, Mutable}; /// [`Pin::as_mut`]: core::pin::Pin::as_mut /// [`Pin::set`]: core::pin::Pin::set /// [`drop`]: Drop::drop -/// [`UnsafeUnpin`]: https://docs.rs/pin-project/0.4.0-beta.1/pin_project/trait.UnsafeUnpin.html +/// [`UnsafeUnpin`]: https://docs.rs/pin-project/0.4.0/pin_project/trait.UnsafeUnpin.html /// [`project`]: ./attr.project.html /// [`project_ref`]: ./attr.project_ref.html /// [`pinned_drop`]: ./attr.pinned_drop.html diff --git a/src/lib.rs b/src/lib.rs index 23c59ea1..d6c38b9c 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -34,13 +34,13 @@ //! //! There are examples and generated code of each feature in [examples](https://github.com/taiki-e/pin-project/blob/master/examples/README.md) directory. //! -//! [`pin_project`]: https://docs.rs/pin-project-internal/0.4.0-beta.1/pin_project_internal/attr.pin_project.html -//! [`pinned_drop`]: https://docs.rs/pin-project-internal/0.4.0-beta.1/pin_project_internal/attr.pinned_drop.html -//! [`project`]: https://docs.rs/pin-project-internal/0.4.0-beta.1/pin_project_internal/attr.project.html +//! [`pin_project`]: https://docs.rs/pin-project-internal/0.4.0/pin_project_internal/attr.pin_project.html +//! [`pinned_drop`]: https://docs.rs/pin-project-internal/0.4.0/pin_project_internal/attr.pinned_drop.html +//! [`project`]: https://docs.rs/pin-project-internal/0.4.0/pin_project_internal/attr.project.html #![no_std] #![recursion_limit = "256"] -#![doc(html_root_url = "https://docs.rs/pin-project/0.4.0-beta.1")] +#![doc(html_root_url = "https://docs.rs/pin-project/0.4.0")] #![doc(test( no_crate_inject, attr(deny(warnings, rust_2018_idioms, single_use_lifetimes), allow(dead_code)) @@ -78,7 +78,7 @@ pub use pin_project_internal::project_ref; /// /// However, things change if you want to provide a custom [`Unpin`] impl /// for your `#[pin_project]` type. As stated in [the Rust -/// documentation](https://doc.rust-lang.org/beta/std/pin/index.html#projections-and-structural-pinning), +/// documentation](https://doc.rust-lang.org/nightly/std/pin/index.html#projections-and-structural-pinning), /// you must be sure to only implement [`Unpin`] when all of your `#[pin]` fields (i.e. struturally /// pinend fields) are also [`Unpin`]. /// @@ -116,7 +116,7 @@ pub use pin_project_internal::project_ref; /// ``` /// /// [`PhantomPinned`]: core::marker::PhantomPinned -/// [`pin_project`]: https://docs.rs/pin-project-internal/0.4.0-beta.1/pin_project_internal/attr.pin_project.html +/// [`pin_project`]: https://docs.rs/pin-project-internal/0.4.0/pin_project_internal/attr.pin_project.html #[allow(unsafe_code)] pub unsafe trait UnsafeUnpin {} diff --git a/tests/cfg.rs b/tests/cfg.rs index 623818a2..201a94eb 100644 --- a/tests/cfg.rs +++ b/tests/cfg.rs @@ -2,7 +2,7 @@ #![warn(rust_2018_idioms, single_use_lifetimes)] #![allow(dead_code)] -// Refs: https://doc.rust-lang.org/reference/attributes.html +// Refs: https://doc.rust-lang.org/nightly/reference/attributes.html use pin_project::pin_project; use std::marker::PhantomPinned;