Skip to content

Commit da06894

Browse files
committed
Release 0.4.0
1 parent 816e3f0 commit da06894

File tree

7 files changed

+58
-18
lines changed

7 files changed

+58
-18
lines changed

CHANGELOG.md

+42-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,43 @@
11
# Unreleased
22

3+
# 0.4.0 - 2019-09-25
4+
5+
* [**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.
6+
7+
* `#[unsafe_project]` attribute has been replaced with `#[pin_project]` attribute. ([#18][18], [#33][33])
8+
9+
* [The `Unpin` argument has been removed - an `Unpin` impl is now generated by default.][18]
10+
11+
* Drop impls must be specified with `#[pinned_drop]` instead of via a normal `Drop` impl. ([#18][18], [#33][33], [#86][86])
12+
13+
* [`Unpin` impls must be specified with an impl of `UnsafeUnpin`, instead of implementing the normal `Unpin` trait.][18]
14+
15+
* [`#[pin_project]` attribute now determines the visibility of the projection type/method is based on the original type.][96]
16+
17+
* [`#[pin_project]` can now be used for public type with private field types.][53]
18+
19+
* [`#[pin_project]` can now interoperate with `#[cfg()]`.][77]
20+
21+
* [Added `project_ref` method to `#[pin_project]` types.][93]
22+
23+
* [Added `#[project_ref]` attribute.][93]
24+
25+
* [Removed "project_attr" feature and always enable `#[project]` attribute.][94]
26+
27+
* [`#[project]` attribute can now be used for `impl` blocks.][46]
28+
29+
* [`#[project]` attribute can now be used for `use` statements.][85]
30+
31+
* [`#[project]` attribute now supports `match` expressions at the position of the initializer expression of `let` expressions.][51]
32+
33+
Changes since the 0.4.0-beta.1 release:
34+
35+
* [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]
36+
37+
[18]: https://github.com/taiki-e/pin-project/pull/18
38+
[33]: https://github.com/taiki-e/pin-project/pull/107
39+
[107]: https://github.com/taiki-e/pin-project/pull/107
40+
341
# 0.4.0-beta.1 - 2019-09-21
442

543
* [Changed the argument type of project method back to `self: Pin<&mut Self>`.][90]
@@ -42,7 +80,7 @@
4280

4381
# 0.4.0-alpha.10 - 2019-09-07
4482

45-
* [pin-project can now interoperate with `#[cfg()]`.][77]
83+
* [`#[pin_project]` can now interoperate with `#[cfg()]`.][77]
4684

4785
* Improved documentation.
4886

@@ -123,7 +161,9 @@
123161

124162
* Made `#[project]` attribute disabled by default.
125163

126-
See also [tracking issue for 0.4 release](https://github.com/taiki-e/pin-project/issues/21).
164+
See also [tracking issue for 0.4 release][21].
165+
166+
[21]: https://github.com/taiki-e/pin-project/issues/21
127167

128168
# 0.3.5 - 2019-08-14
129169

Cargo.toml

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "pin-project"
3-
version = "0.4.0-beta.1"
3+
version = "0.4.0"
44
authors = ["Taiki Endo <te316e89@gmail.com>"]
55
edition = "2018"
66
license = "Apache-2.0/MIT"
@@ -20,7 +20,7 @@ all-features = true
2020
members = ["pin-project-internal"]
2121

2222
[dependencies]
23-
pin-project-internal = { version = "=0.4.0-beta.1", path = "pin-project-internal", default-features = false }
23+
pin-project-internal = { version = "=0.4.0", path = "pin-project-internal", default-features = false }
2424

2525
[dev-dependencies]
2626
compiletest = { version = "0.3.21", package = "compiletest_rs", features = ["stable", "tmp"] }

README.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ Add this to your `Cargo.toml`:
2929

3030
```toml
3131
[dependencies]
32-
pin-project = "0.4.0-beta.1"
32+
pin-project = "0.4"
3333
```
3434

3535
The current pin-project requires Rust 1.33 or later.
@@ -64,7 +64,7 @@ See [API documentation][docs-url] for more details.
6464

6565
Also, there are examples and generated code of each feature in [examples](examples/README.md) directory.
6666

67-
[`pin_project`]: https://docs.rs/pin-project-internal/0.4.0-beta.1/pin_project_internal/attr.pin_project.html
67+
[`pin_project`]: https://docs.rs/pin-project-internal/0.4.0/pin_project_internal/attr.pin_project.html
6868

6969
## License
7070

pin-project-internal/Cargo.toml

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "pin-project-internal"
3-
version = "0.4.0-beta.1"
3+
version = "0.4.0"
44
authors = ["Taiki Endo <te316e89@gmail.com>"]
55
edition = "2018"
66
license = "Apache-2.0/MIT"
@@ -24,4 +24,4 @@ quote = "1.0"
2424
syn = { version = "1.0", features = ["full", "visit-mut"] }
2525

2626
[dev-dependencies]
27-
pin-project = { version = "0.4.0-beta.1", path = ".." }
27+
pin-project = { version = "0.4.0", path = ".." }

pin-project-internal/src/lib.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
//! An internal crate to support pin_project - **do not use directly**
22
33
#![recursion_limit = "256"]
4-
#![doc(html_root_url = "https://docs.rs/pin-project-internal/0.4.0-beta.1")]
4+
#![doc(html_root_url = "https://docs.rs/pin-project-internal/0.4.0")]
55
#![doc(test(
66
no_crate_inject,
77
attr(deny(warnings, rust_2018_idioms, single_use_lifetimes), allow(dead_code))
@@ -61,7 +61,7 @@ use utils::{Immutable, Mutable};
6161
/// it is impossible to cause undefined behavior with this attribute.
6262
///
6363
/// This is accomplished by enforcing the four requirements for pin projection
64-
/// stated in [the Rust documentation](https://doc.rust-lang.org/beta/std/pin/index.html#projections-and-structural-pinning):
64+
/// stated in [the Rust documentation](https://doc.rust-lang.org/nightly/std/pin/index.html#projections-and-structural-pinning):
6565
///
6666
/// 1. The struct must only be Unpin if all the structural fields are Unpin.
6767
///
@@ -313,7 +313,7 @@ use utils::{Immutable, Mutable};
313313
/// [`Pin::as_mut`]: core::pin::Pin::as_mut
314314
/// [`Pin::set`]: core::pin::Pin::set
315315
/// [`drop`]: Drop::drop
316-
/// [`UnsafeUnpin`]: https://docs.rs/pin-project/0.4.0-beta.1/pin_project/trait.UnsafeUnpin.html
316+
/// [`UnsafeUnpin`]: https://docs.rs/pin-project/0.4.0/pin_project/trait.UnsafeUnpin.html
317317
/// [`project`]: ./attr.project.html
318318
/// [`project_ref`]: ./attr.project_ref.html
319319
/// [`pinned_drop`]: ./attr.pinned_drop.html

src/lib.rs

+6-6
Original file line numberDiff line numberDiff line change
@@ -34,13 +34,13 @@
3434
//!
3535
//! There are examples and generated code of each feature in [examples](https://github.com/taiki-e/pin-project/blob/master/examples/README.md) directory.
3636
//!
37-
//! [`pin_project`]: https://docs.rs/pin-project-internal/0.4.0-beta.1/pin_project_internal/attr.pin_project.html
38-
//! [`pinned_drop`]: https://docs.rs/pin-project-internal/0.4.0-beta.1/pin_project_internal/attr.pinned_drop.html
39-
//! [`project`]: https://docs.rs/pin-project-internal/0.4.0-beta.1/pin_project_internal/attr.project.html
37+
//! [`pin_project`]: https://docs.rs/pin-project-internal/0.4.0/pin_project_internal/attr.pin_project.html
38+
//! [`pinned_drop`]: https://docs.rs/pin-project-internal/0.4.0/pin_project_internal/attr.pinned_drop.html
39+
//! [`project`]: https://docs.rs/pin-project-internal/0.4.0/pin_project_internal/attr.project.html
4040
4141
#![no_std]
4242
#![recursion_limit = "256"]
43-
#![doc(html_root_url = "https://docs.rs/pin-project/0.4.0-beta.1")]
43+
#![doc(html_root_url = "https://docs.rs/pin-project/0.4.0")]
4444
#![doc(test(
4545
no_crate_inject,
4646
attr(deny(warnings, rust_2018_idioms, single_use_lifetimes), allow(dead_code))
@@ -78,7 +78,7 @@ pub use pin_project_internal::project_ref;
7878
///
7979
/// However, things change if you want to provide a custom [`Unpin`] impl
8080
/// for your `#[pin_project]` type. As stated in [the Rust
81-
/// documentation](https://doc.rust-lang.org/beta/std/pin/index.html#projections-and-structural-pinning),
81+
/// documentation](https://doc.rust-lang.org/nightly/std/pin/index.html#projections-and-structural-pinning),
8282
/// you must be sure to only implement [`Unpin`] when all of your `#[pin]` fields (i.e. struturally
8383
/// pinend fields) are also [`Unpin`].
8484
///
@@ -116,7 +116,7 @@ pub use pin_project_internal::project_ref;
116116
/// ```
117117
///
118118
/// [`PhantomPinned`]: core::marker::PhantomPinned
119-
/// [`pin_project`]: https://docs.rs/pin-project-internal/0.4.0-beta.1/pin_project_internal/attr.pin_project.html
119+
/// [`pin_project`]: https://docs.rs/pin-project-internal/0.4.0/pin_project_internal/attr.pin_project.html
120120
#[allow(unsafe_code)]
121121
pub unsafe trait UnsafeUnpin {}
122122

tests/cfg.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
#![warn(rust_2018_idioms, single_use_lifetimes)]
33
#![allow(dead_code)]
44

5-
// Refs: https://doc.rust-lang.org/reference/attributes.html
5+
// Refs: https://doc.rust-lang.org/nightly/reference/attributes.html
66

77
use pin_project::pin_project;
88
use std::marker::PhantomPinned;

0 commit comments

Comments
 (0)