Skip to content

Commit

Permalink
Merge #109
Browse files Browse the repository at this point in the history
109: Release 0.4.0 r=taiki-e a=taiki-e

cc #21

### Changes since the latest 0.3 release:

* **Pin projection has become a safe operation.** In the absence of other unsafe code that you write, it is impossible to cause undefined behavior. (#18)

* `#[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. (#18)

* Drop impls must be specified with `#[pinned_drop]` instead of via a normal `Drop` impl. (#18, #33, #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)


Co-authored-by: Taiki Endo <[email protected]>
  • Loading branch information
bors[bot] and taiki-e authored Sep 25, 2019
2 parents 816e3f0 + da06894 commit 04ba1a9
Show file tree
Hide file tree
Showing 7 changed files with 58 additions and 18 deletions.
44 changes: 42 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -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]
Expand Down Expand Up @@ -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.

Expand Down Expand Up @@ -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

Expand Down
4 changes: 2 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "pin-project"
version = "0.4.0-beta.1"
version = "0.4.0"
authors = ["Taiki Endo <[email protected]>"]
edition = "2018"
license = "Apache-2.0/MIT"
Expand All @@ -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"] }
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -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

Expand Down
4 changes: 2 additions & 2 deletions pin-project-internal/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "pin-project-internal"
version = "0.4.0-beta.1"
version = "0.4.0"
authors = ["Taiki Endo <[email protected]>"]
edition = "2018"
license = "Apache-2.0/MIT"
Expand All @@ -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 = ".." }
6 changes: 3 additions & 3 deletions pin-project-internal/src/lib.rs
Original file line number Diff line number Diff line change
@@ -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))
Expand Down Expand Up @@ -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.
///
Expand Down Expand Up @@ -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
Expand Down
12 changes: 6 additions & 6 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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))
Expand Down Expand Up @@ -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`].
///
Expand Down Expand Up @@ -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 {}

Expand Down
2 changes: 1 addition & 1 deletion tests/cfg.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 04ba1a9

Please sign in to comment.