aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHaibo Huang <hhb@google.com>2021-01-06 23:00:22 +0000
committerAutomerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>2021-01-06 23:00:22 +0000
commitf14d6a686a8e9eb9359369569e06983a10e5d694 (patch)
treeb4a59a0bf295d7cc3837dd372b5068cb95023fc6
parent932883e65ccd882ab2f97188ef66a0aa7cf339a7 (diff)
parent1f8d1834e3d402e53170cd757f0554d2984688ab (diff)
downloadpin-project-f14d6a686a8e9eb9359369569e06983a10e5d694.tar.gz
Upgrade rust/crates/pin-project to 1.0.3 am: 803535edf4 am: edabc1003f am: 1f8d1834e3
Original change: https://android-review.googlesource.com/c/platform/external/rust/crates/pin-project/+/1541052 MUST ONLY BE SUBMITTED BY AUTOMERGER Change-Id: Ib29efe0f160a29b3b80e05e765a40ad617cb9208
-rw-r--r--.cargo_vcs_info.json2
-rw-r--r--.clippy.toml1
-rw-r--r--.editorconfig8
-rw-r--r--.gitattributes1
-rw-r--r--.github/CODEOWNERS1
-rw-r--r--.github/FUNDING.yml1
-rw-r--r--.github/bors.toml2
-rw-r--r--.github/workflows/ci.yml154
-rw-r--r--.github/workflows/release.yml16
-rw-r--r--.rustfmt.toml (renamed from rustfmt.toml)7
-rw-r--r--Android.bp6
-rw-r--r--CHANGELOG.md291
-rw-r--r--Cargo.toml12
-rw-r--r--Cargo.toml.orig9
-rw-r--r--METADATA10
-rw-r--r--README.md35
-rw-r--r--examples/README.md37
-rw-r--r--scripts/README.md3
-rwxr-xr-xscripts/check-minimal-versions.sh61
-rwxr-xr-xscripts/ci.sh37
-rw-r--r--src/lib.rs15
-rw-r--r--src/lib.rs.orig15
-rw-r--r--tests/auxiliary/mod.rs32
-rw-r--r--tests/compiletest.rs2
-rw-r--r--tests/lint.rs43
-rw-r--r--tests/lint.txt11
-rw-r--r--tests/ui/pin_project/remove-attr-from-struct.stderr8
-rw-r--r--tests/ui/unstable-features/README.md6
28 files changed, 279 insertions, 547 deletions
diff --git a/.cargo_vcs_info.json b/.cargo_vcs_info.json
index 9b071c7..3ee260d 100644
--- a/.cargo_vcs_info.json
+++ b/.cargo_vcs_info.json
@@ -1,5 +1,5 @@
{
"git": {
- "sha1": "9bdd6cf28180109a9add57d27428c66470f19c09"
+ "sha1": "eaebdd63756a9eb509be14d601f85293ab78a95c"
}
}
diff --git a/.clippy.toml b/.clippy.toml
new file mode 100644
index 0000000..983eb57
--- /dev/null
+++ b/.clippy.toml
@@ -0,0 +1 @@
+msrv = "1.37"
diff --git a/.editorconfig b/.editorconfig
index ea2a033..a73a88d 100644
--- a/.editorconfig
+++ b/.editorconfig
@@ -1,20 +1,20 @@
# EditorConfig configuration
# https://editorconfig.org
-# Top-most EditorConfig file
root = true
[*]
+charset = utf-8
end_of_line = lf
+indent_size = 4
+indent_style = space
insert_final_newline = true
trim_trailing_whitespace = true
-charset = utf-8
-indent_style = space
-indent_size = 4
[*.{json,yml,md}]
indent_size = 2
[*.sh]
indent_size = 2
+binary_next_line = true
switch_case_indent = true
diff --git a/.gitattributes b/.gitattributes
index 7e4a4f0..6313b56 100644
--- a/.gitattributes
+++ b/.gitattributes
@@ -1,2 +1 @@
* text=auto eol=lf
-*.rs text eol=lf whitespace=tab-in-indent,trailing-space,tabwidth=4
diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS
deleted file mode 100644
index 2fdc28f..0000000
--- a/.github/CODEOWNERS
+++ /dev/null
@@ -1 +0,0 @@
-* @taiki-e
diff --git a/.github/FUNDING.yml b/.github/FUNDING.yml
deleted file mode 100644
index 8204219..0000000
--- a/.github/FUNDING.yml
+++ /dev/null
@@ -1 +0,0 @@
-github: taiki-e
diff --git a/.github/bors.toml b/.github/bors.toml
deleted file mode 100644
index 1779788..0000000
--- a/.github/bors.toml
+++ /dev/null
@@ -1,2 +0,0 @@
-status = ["ci"]
-delete_merged_branches = true
diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml
deleted file mode 100644
index 6932c06..0000000
--- a/.github/workflows/ci.yml
+++ /dev/null
@@ -1,154 +0,0 @@
-name: CI
-
-on:
- pull_request:
- push:
- branches:
- - master
- - staging
- schedule:
- - cron: '0 1 * * *'
-
-env:
- CARGO_INCREMENTAL: 0
- RUSTFLAGS: -D warnings
- RUST_BACKTRACE: 1
-
-defaults:
- run:
- shell: bash
-
-jobs:
- test:
- strategy:
- matrix:
- rust:
- # This is the minimum supported Rust version of this crate.
- # When updating this, the reminder to update the minimum supported Rust version in README.md.
- - 1.37.0
- - stable
- - beta
- include:
- - os: ubuntu-latest
- rust: nightly
- # pin-project itself has no platform-dependent implementation.
- # macOS is only used to check that pin-project can interoperate
- # correctly with `#[cfg()]`.
- - os: macos-latest
- rust: nightly
- runs-on: ${{ matrix.os || 'ubuntu-latest' }}
- steps:
- - uses: actions/checkout@v2
- - uses: taiki-e/github-actions/install-rust@main
- with:
- toolchain: ${{ matrix.rust }}
- - if: startsWith(matrix.rust, 'nightly')
- run: cargo install cargo-hack
- - run: rustup target add thumbv7m-none-eabi
- - run: cargo test --all --all-features --exclude expandtest
- - run: cargo check --manifest-path tests/no-std/Cargo.toml --target thumbv7m-none-eabi
- - run: cargo check --manifest-path tests/rust-2015/Cargo.toml --target thumbv7m-none-eabi
- - if: startsWith(matrix.rust, 'nightly')
- run: bash scripts/check-minimal-versions.sh
-
- expandtest:
- runs-on: ubuntu-latest
- steps:
- - uses: actions/checkout@v2
- - uses: taiki-e/github-actions/install-rust@main
- with:
- component: rustfmt
- - name: Fetch latest release version of cargo-expand
- run: |
- mkdir -p .github/caching
- curl -LsSf https://api.github.com/repos/dtolnay/cargo-expand/releases/latest | jq -r '.name' > .github/caching/cargo-expand.lock
- - name: Cache cargo-expand
- id: cache-cargo-expand
- uses: actions/cache@v2
- with:
- path: ${{ runner.tool_cache }}/cargo-expand/bin
- key: cargo-expand-bin-${{ hashFiles('.github/caching/cargo-expand.lock') }}
- - name: Install cargo-expand
- if: steps.cache-cargo-expand.outputs.cache-hit != 'true'
- run: cargo install -f cargo-expand --root ${{ runner.tool_cache }}/cargo-expand
- - run: echo "${{ runner.tool_cache }}/cargo-expand/bin" >> "${GITHUB_PATH}"
- - run: cargo test -p expandtest
-
- miri:
- runs-on: ubuntu-latest
- steps:
- - uses: actions/checkout@v2
- - uses: taiki-e/github-actions/install-rust@main
- with:
- component: miri
- - run: cargo miri test
-
- clippy:
- runs-on: ubuntu-latest
- steps:
- - uses: actions/checkout@v2
- - uses: taiki-e/github-actions/install-rust@main
- with:
- component: clippy
- - run: cargo clippy --all --all-features --all-targets
-
- rustfmt:
- runs-on: ubuntu-latest
- steps:
- - uses: actions/checkout@v2
- - uses: taiki-e/github-actions/install-rust@main
- with:
- component: rustfmt
- - run: cargo fmt --all -- --check
-
- rustdoc:
- env:
- RUSTDOCFLAGS: -D warnings
- runs-on: ubuntu-latest
- steps:
- - uses: actions/checkout@v2
- - uses: taiki-e/github-actions/install-rust@main
- - run: cargo doc --no-deps --all --all-features
-
- shellcheck:
- runs-on: ubuntu-latest
- steps:
- - uses: actions/checkout@v2
- - run: shellcheck **/*.sh
-
- # These jobs don't actually test anything, but they're used to tell bors the
- # build completed, as there is no practical way to detect when a workflow is
- # successful listening to webhooks only.
- #
- # ALL THE PREVIOUS JOBS NEEDS TO BE ADDED TO THE `needs` SECTION OF THIS JOB!
-
- ci-success:
- name: ci
- if: github.event_name == 'push' && success()
- needs:
- - test
- - expandtest
- - miri
- - clippy
- - rustfmt
- - rustdoc
- - shellcheck
- runs-on: ubuntu-latest
- steps:
- - name: Mark the job as a success
- run: exit 0
- ci-failure:
- name: ci
- if: github.event_name == 'push' && !success()
- needs:
- - test
- - expandtest
- - miri
- - clippy
- - rustfmt
- - rustdoc
- - shellcheck
- runs-on: ubuntu-latest
- steps:
- - name: Mark the job as a failure
- run: exit 1
diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml
deleted file mode 100644
index 5f7c998..0000000
--- a/.github/workflows/release.yml
+++ /dev/null
@@ -1,16 +0,0 @@
-name: Release
-
-on:
- push:
- tags:
- - 'v*'
-
-jobs:
- create-release:
- if: github.repository_owner == 'taiki-e'
- runs-on: ubuntu-latest
- steps:
- - uses: actions/checkout@v2
- - uses: taiki-e/github-actions/create-release@main
- env:
- GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
diff --git a/rustfmt.toml b/.rustfmt.toml
index 75456c3..6604f5c 100644
--- a/rustfmt.toml
+++ b/.rustfmt.toml
@@ -1,10 +1,11 @@
# Rustfmt configuration
-# https://github.com/rust-lang/rustfmt/blob/master/Configurations.md
+# https://github.com/rust-lang/rustfmt/blob/HEAD/Configurations.md
# This is required for bug-fixes, which technically can't be made to the stable
# first version.
# This is unstable (tracking issue: https://github.com/rust-lang/rustfmt/issues/3383).
version = "Two"
+# Rustfmt cannot format long lines inside macros, but this option detects this.
# This is unstable (tracking issue: https://github.com/rust-lang/rustfmt/issues/3391)
error_on_line_overflow = true
@@ -21,6 +22,10 @@ merge_imports = true
# This is unstable (tracking issue: https://github.com/rust-lang/rustfmt/issues/3348).
format_code_in_doc_comments = true
+# Automatically fix deprecated style.
+use_field_init_shorthand = true
+use_try_shorthand = true
+
# Set the default settings again to always apply the proper formatting without
# being affected by the editor settings.
edition = "2018"
diff --git a/Android.bp b/Android.bp
index ce9cdd3..b549a77 100644
--- a/Android.bp
+++ b/Android.bp
@@ -14,8 +14,8 @@ rust_library {
}
// dependent_library ["feature_list"]
-// pin-project-internal-1.0.2
+// pin-project-internal-1.0.3
// proc-macro2-1.0.24 "default,proc-macro"
-// quote-1.0.7 "default,proc-macro"
-// syn-1.0.53 "clone-impls,default,derive,full,parsing,printing,proc-macro,quote,visit,visit-mut"
+// quote-1.0.8 "default,proc-macro"
+// syn-1.0.58 "clone-impls,default,derive,full,parsing,printing,proc-macro,quote,visit,visit-mut"
// unicode-xid-0.2.1 "default"
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 0810aae..6551813 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -4,19 +4,27 @@ All notable changes to this project will be documented in this file.
This project adheres to [Semantic Versioning](https://semver.org).
+<!--
+Note: In this file, do not use the hard wrap in the middle of a sentence for compatibility with GitHub comment style markdown rendering.
+-->
+
## [Unreleased]
-## [1.0.2] - 2020-10-19
+## [1.0.3] - 2021-01-05
+
+- Exclude unneeded files from crates.io.
+
+## [1.0.2] - 2020-11-18
-* [Suppress `clippy::unknown_clippy_lints` lint in generated code.](https://github.com/taiki-e/pin-project/pull/303)
+- [Suppress `clippy::unknown_clippy_lints` lint in generated code.](https://github.com/taiki-e/pin-project/pull/303)
## [1.0.1] - 2020-10-15
-* [Fix warnings when `#[pin_project]` attribute used within `macro_rules!` macros.](https://github.com/taiki-e/pin-project/pull/298)
+- [Fix warnings when `#[pin_project]` attribute used within `macro_rules!` macros.](https://github.com/taiki-e/pin-project/pull/298)
## [1.0.0] - 2020-10-13
-* [Remove deprecated `#[project]`, `#[project_ref]`, and `#[project_replace]` attributes.](https://github.com/taiki-e/pin-project/pull/265)
+- [Remove deprecated `#[project]`, `#[project_ref]`, and `#[project_replace]` attributes.](https://github.com/taiki-e/pin-project/pull/265)
Name the projected type by passing an argument with the same name as the method to the `#[pin_project]` attribute instead:
@@ -37,25 +45,25 @@ This project adheres to [Semantic Versioning](https://semver.org).
}
```
-* [Remove deprecated `Replace` argument from `#[pin_project]` attribute.](https://github.com/taiki-e/pin-project/pull/266) Use `project_replace` argument instead.
+- [Remove deprecated `Replace` argument from `#[pin_project]` attribute.](https://github.com/taiki-e/pin-project/pull/266) Use `project_replace` argument instead.
-* [Optimize code generation when used on enums.](https://github.com/taiki-e/pin-project/pull/270)
+- [Optimize code generation when used on enums.](https://github.com/taiki-e/pin-project/pull/270)
-* [Raise the minimum supported Rust version of this crate from Rust 1.34 to Rust 1.37.](https://github.com/taiki-e/pin-project/pull/292)
+- [Raise the minimum supported Rust version of this crate from Rust 1.34 to Rust 1.37.](https://github.com/taiki-e/pin-project/pull/292)
-* Suppress `explicit_outlives_requirements`, `box_pointers`, `clippy::large_enum_variant`, `clippy::pattern_type_mismatch`, `clippy::implicit_return`, and `clippy::redundant_pub_crate` lints in generated code. ([#276](https://github.com/taiki-e/pin-project/pull/276), [#277](https://github.com/taiki-e/pin-project/pull/277), [#284](https://github.com/taiki-e/pin-project/pull/284))
+- Suppress `explicit_outlives_requirements`, `box_pointers`, `clippy::large_enum_variant`, `clippy::pattern_type_mismatch`, `clippy::implicit_return`, and `clippy::redundant_pub_crate` lints in generated code. ([#276](https://github.com/taiki-e/pin-project/pull/276), [#277](https://github.com/taiki-e/pin-project/pull/277), [#284](https://github.com/taiki-e/pin-project/pull/284))
-* Diagnostic improvements.
+- Diagnostic improvements.
Changes since the 1.0.0-alpha.1 release:
-* [Fix drop order of pinned fields in project_replace](https://github.com/taiki-e/pin-project/pull/287)
+- [Fix drop order of pinned fields in project_replace](https://github.com/taiki-e/pin-project/pull/287)
-* Update minimal version of `syn` to 1.0.44
+- Update minimal version of `syn` to 1.0.44
## [1.0.0-alpha.1] - 2020-09-22
-* [Remove deprecated `#[project]`, `#[project_ref]`, and `#[project_replace]` attributes.](https://github.com/taiki-e/pin-project/pull/265)
+- [Remove deprecated `#[project]`, `#[project_ref]`, and `#[project_replace]` attributes.](https://github.com/taiki-e/pin-project/pull/265)
Name the projected type by passing an argument with the same name as the method to the `#[pin_project]` attribute instead:
@@ -76,50 +84,50 @@ Changes since the 1.0.0-alpha.1 release:
}
```
-* [Remove deprecated `Replace` argument from `#[pin_project]` attribute.](https://github.com/taiki-e/pin-project/pull/266) Use `project_replace` argument instead.
+- [Remove deprecated `Replace` argument from `#[pin_project]` attribute.](https://github.com/taiki-e/pin-project/pull/266) Use `project_replace` argument instead.
-* [Optimize code generation when used on enums.](https://github.com/taiki-e/pin-project/pull/270)
+- [Optimize code generation when used on enums.](https://github.com/taiki-e/pin-project/pull/270)
-* Suppress `explicit_outlives_requirements`, `box_pointers`, `clippy::large_enum_variant`, `clippy::pattern_type_mismatch`, and `clippy::implicit_return` lints in generated code. ([#276](https://github.com/taiki-e/pin-project/pull/276), [#277](https://github.com/taiki-e/pin-project/pull/277))
+- Suppress `explicit_outlives_requirements`, `box_pointers`, `clippy::large_enum_variant`, `clippy::pattern_type_mismatch`, and `clippy::implicit_return` lints in generated code. ([#276](https://github.com/taiki-e/pin-project/pull/276), [#277](https://github.com/taiki-e/pin-project/pull/277))
-* Diagnostic improvements.
+- Diagnostic improvements.
See also [tracking issue for 1.0 release](https://github.com/taiki-e/pin-project/issues/264).
## [0.4.27] - 2020-10-11
-* Update minimal version of `syn` to 1.0.44
+- Update minimal version of `syn` to 1.0.44
## [0.4.26] - 2020-10-04
-* [Fix drop order of pinned fields in project_replace](https://github.com/taiki-e/pin-project/pull/287)
+- [Fix drop order of pinned fields in project_replace](https://github.com/taiki-e/pin-project/pull/287)
## [0.4.25] - 2020-10-01
-* Suppress `drop_bounds` lint, which will be added to rustc in the future. See [#272](https://github.com/taiki-e/pin-project/issues/272) for more details.
+- Suppress `drop_bounds` lint, which will be added to rustc in the future. See [#272](https://github.com/taiki-e/pin-project/issues/272) for more details.
(Note: 1.0.0-alpha.1 already contains this change.)
## [0.4.24] - 2020-09-26
-* Fix compatibility of generated code with `forbid(future_incompatible)`
+- Fix compatibility of generated code with `forbid(future_incompatible)`
Note: This does not guarantee compatibility with `forbid(future_incompatible)` in the future.
If rustc adds a new lint, we may not be able to keep this.
## [0.4.23] - 2020-07-27
-* [Fix compile error with `?Sized` type parameters.][263]
+- [Fix compile error with `?Sized` type parameters.][263]
[263]: https://github.com/taiki-e/pin-project/pull/263
## [0.4.22] - 2020-06-14
-* Documentation improvements.
+- Documentation improvements.
## [0.4.21] - 2020-06-13
-* [Deprecated `#[project]`, `#[project_ref]`, and `#[project_replace]` attributes due to some unfixable limitations.][244]
+- [Deprecated `#[project]`, `#[project_ref]`, and `#[project_replace]` attributes due to some unfixable limitations.][244]
Consider naming the projected type by passing an argument with the same name as the method to the `#[pin_project]` attribute instead.
@@ -140,11 +148,11 @@ See also [tracking issue for 1.0 release](https://github.com/taiki-e/pin-project
See [#225][225] for more details.
-* [Support `Self` in fields and generics in type definitions.][245]
+- [Support `Self` in fields and generics in type definitions.][245]
-* [Fix errors involving *"`self` value is a keyword only available in methods with `self` parameter"* in apparently correct code.][250]
+- [Fix errors involving *"`self` value is a keyword only available in methods with `self` parameter"* in apparently correct code.][250]
-* Diagnostic improvements.
+- Diagnostic improvements.
[225]: https://github.com/taiki-e/pin-project/pull/225
[244]: https://github.com/taiki-e/pin-project/pull/244
@@ -153,7 +161,7 @@ See also [tracking issue for 1.0 release](https://github.com/taiki-e/pin-project
## [0.4.20] - 2020-06-07
-* [You can now use project_replace argument without Replace argument.][243]
+- [You can now use project_replace argument without Replace argument.][243]
This used to require you to specify both.
```diff
@@ -164,7 +172,7 @@ See also [tracking issue for 1.0 release](https://github.com/taiki-e/pin-project
}
```
-* [Makes `project_replace` argument an alias for `Replace` argument so that it can be used without a value.][243]
+- [Makes `project_replace` argument an alias for `Replace` argument so that it can be used without a value.][243]
```rust
#[pin_project(project_replace)]
@@ -175,32 +183,32 @@ See also [tracking issue for 1.0 release](https://github.com/taiki-e/pin-project
*The `Replace` argument will be deprecated in the future.*
-* Suppress `unreachable_pub` lint in generated code.
+- Suppress `unreachable_pub` lint in generated code.
[243]: https://github.com/taiki-e/pin-project/pull/243
## [0.4.19] - 2020-06-04
-* [Fix `unused_results` lint in generated code.][239]
+- [Fix `unused_results` lint in generated code.][239]
[239]: https://github.com/taiki-e/pin-project/pull/239
## [0.4.18] - 2020-06-04
-* [Support `Self` in more syntax positions inside `#[pinned_drop]` impl.][230]
+- [Support `Self` in more syntax positions inside `#[pinned_drop]` impl.][230]
-* [Suppress `clippy::type_repetition_in_bounds` and `clippy::used_underscore_binding` lints in generated code.][233]
+- [Suppress `clippy::type_repetition_in_bounds` and `clippy::used_underscore_binding` lints in generated code.][233]
-* Documentation improvements.
+- Documentation improvements.
-* Diagnostic improvements.
+- Diagnostic improvements.
[230]: https://github.com/taiki-e/pin-project/pull/230
[233]: https://github.com/taiki-e/pin-project/pull/233
## [0.4.17] - 2020-05-18
-* [Support naming the projection types.][202]
+- [Support naming the projection 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:
@@ -223,19 +231,19 @@ See also [tracking issue for 1.0 release](https://github.com/taiki-e/pin-project
## [0.4.16] - 2020-05-11
-* [Fixed an issue that users can call internal function generated by `#[pinned_drop]`.][223]
+- [Fixed an issue that users can call internal function generated by `#[pinned_drop]`.][223]
[223]: https://github.com/taiki-e/pin-project/pull/223
## [0.4.15] - 2020-05-10
-* [`#[project]` attribute can now handle all project* attributes in that scope with one wrapper attribute.][220]
+- [`#[project]` attribute can now handle all project\* attributes in that scope with one wrapper attribute.][220]
[220]: https://github.com/taiki-e/pin-project/pull/220
## [0.4.14] - 2020-05-09
-* [Added `!Unpin` option to `#[pin_project]` attribute for guarantee the type is `!Unpin`.][219]
+- [Added `!Unpin` option to `#[pin_project]` attribute for guarantee the type is `!Unpin`.][219]
```rust
#[pin_project(!Unpin)]
@@ -257,15 +265,15 @@ See also [tracking issue for 1.0 release](https://github.com/taiki-e/pin-project
*[Note: This raises the minimum supported Rust version of this crate from Rust 1.33 to Rust 1.34.](https://github.com/taiki-e/pin-project/pull/219#pullrequestreview-408644187)*
-* [Fixed an issue where duplicate `#[project]` attributes were ignored.][218]
+- [Fixed an issue where duplicate `#[project]` attributes were ignored.][218]
-* [Suppress `single_use_lifetimes` lint in generated code.][217]
+- [Suppress `single_use_lifetimes` lint in generated code.][217]
-* [Support overlapping lifetime names in HRTB.][217]
+- [Support overlapping lifetime names in HRTB.][217]
-* [Hide generated items from --document-private-items.][211] See [#211][211] for details.
+- [Hide generated items from --document-private-items.][211] See [#211][211] for details.
-* Documentation improvements.
+- Documentation improvements.
[211]: https://github.com/taiki-e/pin-project/pull/211
[217]: https://github.com/taiki-e/pin-project/pull/217
@@ -274,25 +282,25 @@ See also [tracking issue for 1.0 release](https://github.com/taiki-e/pin-project
## [0.4.13] - 2020-05-07
-* [Fixed a regression in 0.4.11.][207]
+- [Fixed a regression in 0.4.11.][207]
Changes from [0.4.10](https://github.com/taiki-e/pin-project/releases/tag/v0.4.10) and [0.4.12](https://github.com/taiki-e/pin-project/releases/tag/v0.4.12):
- * [Fixed an issue that `#[project]` on non-statement expression does not work without unstable features.][197]
+ - [Fixed an issue that `#[project]` on non-statement expression does not work without unstable features.][197]
- * [Support overwriting the name of core crate.][199]
+ - [Support overwriting the name of core crate.][199]
- * [Suppress `clippy::needless_pass_by_value` lint in generated code of `#[pinned_drop]`.][200]
+ - [Suppress `clippy::needless_pass_by_value` lint in generated code of `#[pinned_drop]`.][200]
- * Documentation improvements.
+ - Documentation improvements.
- * Diagnostic improvements.
+ - Diagnostic improvements.
[207]: https://github.com/taiki-e/pin-project/pull/207
## [0.4.12] - 2020-05-07
-* A release to avoid [a regression in 0.4.11][206]. No code changes from [0.4.10](https://github.com/taiki-e/pin-project/releases/tag/v0.4.10).
+- A release to avoid [a regression in 0.4.11][206]. No code changes from [0.4.10](https://github.com/taiki-e/pin-project/releases/tag/v0.4.10).
[206]: https://github.com/taiki-e/pin-project/issues/206
@@ -300,15 +308,15 @@ See also [tracking issue for 1.0 release](https://github.com/taiki-e/pin-project
**Note: This release has been yanked.** See [#206][206] for details.
-* [Fixed an issue that `#[project]` on non-statement expression does not work without unstable features.][197]
+- [Fixed an issue that `#[project]` on non-statement expression does not work without unstable features.][197]
-* [Support overwriting the name of core crate.][199]
+- [Support overwriting the name of core crate.][199]
-* [Suppress `clippy::needless_pass_by_value` lint in generated code of `#[pinned_drop]`.][200]
+- [Suppress `clippy::needless_pass_by_value` lint in generated code of `#[pinned_drop]`.][200]
-* Documentation improvements.
+- Documentation improvements.
-* Diagnostic improvements.
+- Diagnostic improvements.
[197]: https://github.com/taiki-e/pin-project/pull/197
[199]: https://github.com/taiki-e/pin-project/pull/199
@@ -316,13 +324,13 @@ See also [tracking issue for 1.0 release](https://github.com/taiki-e/pin-project
## [0.4.10] - 2020-05-04
-* [Added `project_replace` method and `#[project_replace]` attribute.][194]
+- [Added `project_replace` method and `#[project_replace]` attribute.][194]
`project_replace` method is optional and can be enabled by passing the `Replace` argument to `#[pin_project]` attribute.
See [the documentation](https://docs.rs/pin-project/0.4/pin_project/attr.pin_project.html#project_replace) for more details.
-* [Support `Self` and `self` in more syntax positions inside `#[pinned_drop]` impl.][190]
+- [Support `Self` and `self` in more syntax positions inside `#[pinned_drop]` impl.][190]
-* [Hided all generated items except for projected types from calling code.][192] See [#192][192] for details.
+- [Hided all generated items except for projected types from calling code.][192] See [#192][192] for details.
[190]: https://github.com/taiki-e/pin-project/pull/190
[192]: https://github.com/taiki-e/pin-project/pull/192
@@ -330,11 +338,11 @@ See also [tracking issue for 1.0 release](https://github.com/taiki-e/pin-project
## [0.4.9] - 2020-04-14
-* [Fixed lifetime inference error when associated types are used in fields.][188]
+- [Fixed lifetime inference error when associated types are used in fields.][188]
-* [Fixed compile error with tuple structs with `where` clauses.][186]
+- [Fixed compile error with tuple structs with `where` clauses.][186]
-* [`#[project]` attribute can now be used for `if let` expressions.][181]
+- [`#[project]` attribute can now be used for `if let` expressions.][181]
[181]: https://github.com/taiki-e/pin-project/pull/181
[186]: https://github.com/taiki-e/pin-project/pull/186
@@ -342,34 +350,34 @@ See also [tracking issue for 1.0 release](https://github.com/taiki-e/pin-project
## [0.4.8] - 2020-01-27
-* [Ensured that users cannot implement `PinnedDrop` without proper attribute argument.][180]
+- [Ensured that users cannot implement `PinnedDrop` without proper attribute argument.][180]
-* [Fixed use of `Self` in expression position inside `#[pinned_drop]` impl.][177]
+- [Fixed use of `Self` in expression position inside `#[pinned_drop]` impl.][177]
[177]: https://github.com/taiki-e/pin-project/pull/180
[180]: https://github.com/taiki-e/pin-project/pull/180
## [0.4.7] - 2020-01-20
-* [Fixed support for lifetime bounds.][176]
+- [Fixed support for lifetime bounds.][176]
[176]: https://github.com/taiki-e/pin-project/pull/176
## [0.4.6] - 2019-11-20
-* [Fixed compile error when there is `Self` in the where clause.][169]
+- [Fixed compile error when there is `Self` in the where clause.][169]
[169]: https://github.com/taiki-e/pin-project/pull/169
## [0.4.5] - 2019-10-21
-* [Fixed compile error with `dyn` types.][158]
+- [Fixed compile error with `dyn` types.][158]
[158]: https://github.com/taiki-e/pin-project/pull/158
## [0.4.4] - 2019-10-17
-* [Fixed an issue where `PinnedDrop` implementations can call unsafe code without an unsafe block.][149]
+- [Fixed an issue where `PinnedDrop` implementations can call unsafe code without an unsafe block.][149]
[149]: https://github.com/taiki-e/pin-project/pull/149
@@ -377,13 +385,13 @@ See also [tracking issue for 1.0 release](https://github.com/taiki-e/pin-project
**Note: This release has been yanked.** See [#148] for details.
-* [`#[pin_project]` can now interoperate with `#[cfg_attr()]`.][135]
+- [`#[pin_project]` can now interoperate with `#[cfg_attr()]`.][135]
-* [`#[pin_project]` can now interoperate with `#[cfg()]` on tuple structs and tuple variants.][135]
+- [`#[pin_project]` can now interoperate with `#[cfg()]` on tuple structs and tuple variants.][135]
-* [Fixed support for DSTs(Dynamically Sized Types) on `#[pin_project(UnsafeUnpin)]`][120]
+- [Fixed support for DSTs(Dynamically Sized Types) on `#[pin_project(UnsafeUnpin)]`][120]
-* Diagnostic improvements.
+- Diagnostic improvements.
[#148]: https://github.com/taiki-e/pin-project/pull/148
[120]: https://github.com/taiki-e/pin-project/pull/120
@@ -393,7 +401,7 @@ See also [tracking issue for 1.0 release](https://github.com/taiki-e/pin-project
**Note: This release has been yanked.** See [#148] for details.
-* [Fixed support for DSTs(Dynamically Sized Types).][113]
+- [Fixed support for DSTs(Dynamically Sized Types).][113]
[113]: https://github.com/taiki-e/pin-project/pull/113
@@ -401,7 +409,7 @@ See also [tracking issue for 1.0 release](https://github.com/taiki-e/pin-project
**Note: This release has been yanked.** See [#148] for details.
-* [Fixed an issue that caused an error when using `#[pin_project]` on a type that has `#[pin]` + `!Unpin` field with no generics or lifetime.][111]
+- [Fixed an issue that caused an error when using `#[pin_project]` on a type that has `#[pin]` + `!Unpin` field with no generics or lifetime.][111]
[111]: https://github.com/taiki-e/pin-project/pull/111
@@ -409,37 +417,37 @@ See also [tracking issue for 1.0 release](https://github.com/taiki-e/pin-project
**Note: This release has been yanked.** See [#148] for details.
-* [**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.
+- [**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])
+- `#[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]
+- [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])
+- 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]
+- [`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]` 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 be used for public type with private field types.][53]
-* [`#[pin_project]` can now interoperate with `#[cfg()]`.][77]
+- [`#[pin_project]` can now interoperate with `#[cfg()]`.][77]
-* [Added `project_ref` method to `#[pin_project]` types.][93]
+- [Added `project_ref` method to `#[pin_project]` types.][93]
-* [Added `#[project_ref]` attribute.][93]
+- [Added `#[project_ref]` attribute.][93]
-* [Removed "project_attr" feature and always enable `#[project]` attribute.][94]
+- [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 `impl` blocks.][46]
-* [`#[project]` attribute can now be used for `use` statements.][85]
+- [`#[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]
+- [`#[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]
+- [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
@@ -447,17 +455,17 @@ Changes since the 0.4.0-beta.1 release:
## [0.4.0-beta.1] - 2019-09-21
-* [Changed the argument type of project method back to `self: Pin<&mut Self>`.][90]
+- [Changed the argument type of project method back to `self: Pin<&mut Self>`.][90]
-* [Removed "project_attr" feature and always enable `#[project]` attribute.][94]
+- [Removed "project_attr" feature and always enable `#[project]` attribute.][94]
-* [Removed "renamed" feature.][100]
+- [Removed "renamed" feature.][100]
-* [`#[project]` attribute can now be used for `use` statements.][85]
+- [`#[project]` attribute can now be used for `use` statements.][85]
-* [Added `project_ref` method and `#[project_ref]` attribute.][93]
+- [Added `project_ref` method and `#[project_ref]` attribute.][93]
-* [`#[pin_project]` attribute now determines the visibility of the projection type/method is based on the original type.][96]
+- [`#[pin_project]` attribute now determines the visibility of the projection type/method is based on the original type.][96]
[85]: https://github.com/taiki-e/pin-project/pull/85
[90]: https://github.com/taiki-e/pin-project/pull/90
@@ -468,7 +476,7 @@ Changes since the 0.4.0-beta.1 release:
## [0.4.0-alpha.11] - 2019-09-11
-* [Changed #[pinned_drop] to trait implementation.][86]
+- [Changed #[pinned_drop] to trait implementation.][86]
```rust
#[pinned_drop]
@@ -479,23 +487,23 @@ Changes since the 0.4.0-beta.1 release:
}
```
-* Added some examples and generated code.
+- Added some examples and generated code.
-* Diagnostic improvements.
+- Diagnostic improvements.
[86]: https://github.com/taiki-e/pin-project/pull/86
## [0.4.0-alpha.10] - 2019-09-07
-* [`#[pin_project]` can now interoperate with `#[cfg()]`.][77]
+- [`#[pin_project]` can now interoperate with `#[cfg()]`.][77]
-* Documentation improvements.
+- Documentation improvements.
[77]: https://github.com/taiki-e/pin-project/pull/77
## [0.4.0-alpha.9] - 2019-09-05
-* [Added 'project_into' method to `#[pin_project]` types][69]. This can be useful when returning a pin projection from a method.
+- [Added 'project_into' method to `#[pin_project]` types][69]. This can be useful when returning a pin projection from a method.
```rust
fn get_pin_mut(self: Pin<&mut Self>) -> Pin<&mut T> {
@@ -503,49 +511,49 @@ Changes since the 0.4.0-beta.1 release:
}
```
-* [Prevented UnpinStruct from appearing in the document by default.][71] See [#71][71] for more details.
+- [Prevented UnpinStruct from appearing in the document by default.][71] See [#71][71] for more details.
[69]: https://github.com/taiki-e/pin-project/pull/69
[71]: https://github.com/taiki-e/pin-project/pull/69
## [0.4.0-alpha.8] - 2019-09-03
-* [Improved document of generated code.][62]. Also added an option to control the document of generated code. See [#62][62] for more details.
+- [Improved document of generated code.][62]. Also added an option to control the document of generated code. See [#62][62] for more details.
-* [Diagnostic improvements.][61]
+- [Diagnostic improvements.][61]
[61]: https://github.com/taiki-e/pin-project/pull/61
[62]: https://github.com/taiki-e/pin-project/pull/62
## [0.4.0-alpha.7] - 2019-09-02
-* [Suppress `dead_code` lint in generated types.][57]
+- [Suppress `dead_code` lint in generated types.][57]
[57]: https://github.com/taiki-e/pin-project/pull/57
## [0.4.0-alpha.6] - 2019-09-01
-* [Allowed using `#[pin_project]` type with private field types][53]
+- [Allowed using `#[pin_project]` type with private field types][53]
[53]: https://github.com/taiki-e/pin-project/pull/53
## [0.4.0-alpha.5] - 2019-08-24
-* [`#[project]` attribute now supports `match` expressions at the position of the initializer expression of `let` expressions.][51]
+- [`#[project]` attribute now supports `match` expressions at the position of the initializer expression of `let` expressions.][51]
[51]: https://github.com/taiki-e/pin-project/pull/51
## [0.4.0-alpha.4] - 2019-08-23
-* Suppress `clippy::drop_bounds` lint in generated code.
+- Suppress `clippy::drop_bounds` lint in generated code.
## [0.4.0-alpha.3] - 2019-08-23
-* [Changed `project` method generated by `#[pin_project]` attribute to take an `&mut Pin<&mut Self>` argument.][47]
+- [Changed `project` method generated by `#[pin_project]` attribute to take an `&mut Pin<&mut Self>` argument.][47]
-* [`#[project]` attribute can now be used for impl blocks.][46]
+- [`#[project]` attribute can now be used for impl blocks.][46]
-* [`#[pin_project]` attribute can now detect that the type used does not have its own drop implementation without actually implementing drop.][48] This removed some restrictions.
+- [`#[pin_project]` attribute can now detect that the type used does not have its own drop implementation without actually implementing drop.][48] This removed some restrictions.
[46]: https://github.com/taiki-e/pin-project/pull/46
[47]: https://github.com/taiki-e/pin-project/pull/47
@@ -553,21 +561,21 @@ Changes since the 0.4.0-beta.1 release:
## [0.4.0-alpha.2] - 2019-08-13
-* Updated `proc-macro2`, `syn`, and `quote` to 1.0.
+- Updated `proc-macro2`, `syn`, and `quote` to 1.0.
## [0.4.0-alpha.1] - 2019-08-11
-* **Pin projection has become a safe operation.**
+- **Pin projection has become a safe operation.**
-* `#[unsafe_project]` has been replaced with `#[pin_project]`.
+- `#[unsafe_project]` has been replaced with `#[pin_project]`.
-* The `Unpin` argument has been removed - an `Unpin` impl is now generated by default.
+- The `Unpin` argument has been removed - an `Unpin` impl is now generated by default.
-* Drop impls must be specified with `#[pinned_drop]` instead of via a normal `Drop` impl.
+- Drop impls must be specified with `#[pinned_drop]` instead of via a normal `Drop` impl.
-* `Unpin` impls must be specified with an impl of `UnsafeUnpin`, instead of implementing the normal `Unpin` trait.
+- `Unpin` impls must be specified with an impl of `UnsafeUnpin`, instead of implementing the normal `Unpin` trait.
-* Made `#[project]` attribute disabled by default.
+- Made `#[project]` attribute disabled by default.
See also [tracking issue for 0.4 release][21].
@@ -575,87 +583,87 @@ See also [tracking issue for 0.4 release][21].
## [0.3.5] - 2019-08-14
-* Updated `proc-macro2`, `syn`, and `quote` to 1.0.
+- Updated `proc-macro2`, `syn`, and `quote` to 1.0.
## [0.3.4] - 2019-07-21
-* Diagnostic improvements.
+- Diagnostic improvements.
## [0.3.3] - 2019-07-15
**Note: This release has been yanked.** See [#16] for details.
-* Diagnostic improvements.
+- Diagnostic improvements.
[#16]: https://github.com/taiki-e/pin-project/issues/16
## [0.3.2] - 2019-03-30
-* Avoided suffixes on tuple index.
+- Avoided suffixes on tuple index.
## [0.3.1] - 2019-03-02
-* Documentation improvements.
+- Documentation improvements.
-* Updated minimum `syn` version to 0.15.22.
+- Updated minimum `syn` version to 0.15.22.
## [0.3.0] - 2019-02-20
-* Removed `unsafe_fields` attribute.
+- Removed `unsafe_fields` attribute.
-* Removed `unsafe_variants` attribute.
+- Removed `unsafe_variants` attribute.
## [0.2.2] - 2019-02-20
-* Fixed a bug that generates incorrect code for the some structures with trait bounds on type generics.
+- Fixed a bug that generates incorrect code for the some structures with trait bounds on type generics.
## [0.2.1] - 2019-02-20
-* Fixed a bug that generates incorrect code for the structures with where clause and associated type fields.
+- Fixed a bug that generates incorrect code for the structures with where clause and associated type fields.
## [0.2.0] - 2019-02-11
-* Made `unsafe_fields` optional.
+- Made `unsafe_fields` optional.
-* Documentation improvements.
+- Documentation improvements.
## [0.1.8] - 2019-02-02
-* Added the feature to create projected enums to `unsafe_project`.
+- Added the feature to create projected enums to `unsafe_project`.
-* Added `project` attribute to support pattern matching.
+- Added `project` attribute to support pattern matching.
## [0.1.7] - 2019-01-19
-* Fixed documentation.
+- Fixed documentation.
## [0.1.6] - 2019-01-19
-* `unsafe_fields` can now opt-out.
+- `unsafe_fields` can now opt-out.
-* Added `unsafe_variants` attribute. This attribute is available if pin-project is built with the "unsafe_variants" feature.
+- Added `unsafe_variants` attribute. This attribute is available if pin-project is built with the "unsafe_variants" feature.
## [0.1.5] - 2019-01-17
-* Added support for tuple struct to `unsafe_project`.
+- Added support for tuple struct to `unsafe_project`.
## [0.1.4] - 2019-01-12
-* Added options for automatically implementing `Unpin` to both `unsafe_project` and `unsafe_fields`.
+- Added options for automatically implementing `Unpin` to both `unsafe_project` and `unsafe_fields`.
## [0.1.3] - 2019-01-11
-* Fixed dependencies.
+- Fixed dependencies.
-* Added `unsafe_fields` attribute.
+- Added `unsafe_fields` attribute.
## [0.1.2] - 2019-01-09
-* Documentation improvements.
+- Documentation improvements.
## [0.1.1] - 2019-01-08
-* Renamed from `unsafe_pin_project` to `unsafe_project`.
+- Renamed from `unsafe_pin_project` to `unsafe_project`.
## [0.1.0] - 2019-01-08
@@ -663,7 +671,8 @@ See also [tracking issue for 0.4 release][21].
Initial release
-[Unreleased]: https://github.com/taiki-e/pin-project/compare/v1.0.2...HEAD
+[Unreleased]: https://github.com/taiki-e/pin-project/compare/v1.0.3...HEAD
+[1.0.3]: https://github.com/taiki-e/pin-project/compare/v1.0.2...v1.0.3
[1.0.2]: https://github.com/taiki-e/pin-project/compare/v1.0.1...v1.0.2
[1.0.1]: https://github.com/taiki-e/pin-project/compare/v1.0.0...v1.0.1
[1.0.0]: https://github.com/taiki-e/pin-project/compare/v1.0.0-alpha.1...v1.0.0
diff --git a/Cargo.toml b/Cargo.toml
index 88db287..79ba823 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -13,10 +13,10 @@
[package]
edition = "2018"
name = "pin-project"
-version = "1.0.2"
+version = "1.0.3"
authors = ["Taiki Endo <te316e89@gmail.com>"]
+exclude = ["/.github", "/ci", "/scripts"]
description = "A crate for safe and ergonomic pin-projection.\n"
-homepage = "https://github.com/taiki-e/pin-project"
documentation = "https://docs.rs/pin-project"
readme = "README.md"
keywords = ["pin", "macros", "attribute"]
@@ -26,16 +26,16 @@ repository = "https://github.com/taiki-e/pin-project"
[package.metadata.docs.rs]
targets = ["x86_64-unknown-linux-gnu"]
[dependencies.pin-project-internal]
-version = "=1.0.2"
+version = "=1.0.3"
default-features = false
-[dev-dependencies.pin-project-auxiliary-macro]
-version = "0"
-
[dev-dependencies.rustversion]
version = "1"
[dev-dependencies.static_assertions]
version = "1"
+[dev-dependencies.tempfile]
+version = "3"
+
[dev-dependencies.trybuild]
version = "1"
diff --git a/Cargo.toml.orig b/Cargo.toml.orig
index 7d31bb0..401635c 100644
--- a/Cargo.toml.orig
+++ b/Cargo.toml.orig
@@ -1,15 +1,15 @@
[package]
name = "pin-project"
-version = "1.0.2"
+version = "1.0.3"
authors = ["Taiki Endo <te316e89@gmail.com>"]
edition = "2018"
license = "Apache-2.0 OR MIT"
repository = "https://github.com/taiki-e/pin-project"
-homepage = "https://github.com/taiki-e/pin-project"
documentation = "https://docs.rs/pin-project"
keywords = ["pin", "macros", "attribute"]
categories = ["no-std", "rust-patterns"]
readme = "README.md"
+exclude = ["/.github", "/ci", "/scripts"]
description = """
A crate for safe and ergonomic pin-projection.
"""
@@ -29,10 +29,11 @@ members = [
]
[dependencies]
-pin-project-internal = { version = "=1.0.2", path = "pin-project-internal", default-features = false }
+pin-project-internal = { version = "=1.0.3", path = "pin-project-internal", default-features = false }
[dev-dependencies]
-pin-project-auxiliary-macro = { version = "0", path = "tests/auxiliary/macro" }
+pin-project-auxiliary-macro = { path = "tests/auxiliary/macro" }
rustversion = "1"
static_assertions = "1"
+tempfile = "3"
trybuild = "1"
diff --git a/METADATA b/METADATA
index 4490183..b15e8a5 100644
--- a/METADATA
+++ b/METADATA
@@ -7,13 +7,13 @@ third_party {
}
url {
type: ARCHIVE
- value: "https://static.crates.io/crates/pin-project/pin-project-1.0.2.crate"
+ value: "https://static.crates.io/crates/pin-project/pin-project-1.0.3.crate"
}
- version: "1.0.2"
+ version: "1.0.3"
license_type: NOTICE
last_upgrade_date {
- year: 2020
- month: 11
- day: 18
+ year: 2021
+ month: 1
+ day: 5
}
}
diff --git a/README.md b/README.md
index 689ec95..e98bff2 100644
--- a/README.md
+++ b/README.md
@@ -1,18 +1,10 @@
# pin-project
-[![crates-badge]][crates-url]
-[![docs-badge]][docs-url]
-[![license-badge]][license]
-[![rustc-badge]][rustc-url]
-
-[crates-badge]: https://img.shields.io/crates/v/pin-project.svg
-[crates-url]: https://crates.io/crates/pin-project
-[docs-badge]: https://docs.rs/pin-project/badge.svg
-[docs-url]: https://docs.rs/pin-project
-[license-badge]: https://img.shields.io/badge/license-Apache--2.0%20OR%20MIT-blue.svg
-[license]: #license
-[rustc-badge]: https://img.shields.io/badge/rustc-1.37+-lightgray.svg
-[rustc-url]: https://blog.rust-lang.org/2019/08/15/Rust-1.37.0.html
+[![crates.io](https://img.shields.io/crates/v/pin-project.svg?style=flat-square&logo=rust)](https://crates.io/crates/pin-project)
+[![docs.rs](https://img.shields.io/badge/docs.rs-pin--project-blue?style=flat-square)](https://docs.rs/pin-project)
+[![license](https://img.shields.io/badge/license-Apache--2.0_OR_MIT-blue.svg?style=flat-square)](#license)
+[![rustc](https://img.shields.io/badge/rustc-1.37+-blue.svg?style=flat-square)](https://www.rust-lang.org)
+[![build status](https://img.shields.io/github/workflow/status/taiki-e/pin-project/CI/master?style=flat-square)](https://github.com/taiki-e/pin-project/actions?query=workflow%3ACI+branch%3Amaster)
A crate for safe and ergonomic [pin-projection].
@@ -25,7 +17,7 @@ Add this to your `Cargo.toml`:
pin-project = "1"
```
-The current pin-project requires Rust 1.37 or later.
+*Compiler support: requires rustc 1.37+*
## Examples
@@ -83,25 +75,26 @@ impl<T, U> Enum<T, U> {
[*code like this will be generated*][enum-default-expanded]
-See [documentation][docs-url] for more details, and
+See [documentation](https://docs.rs/pin-project) for more details, and
see [examples] directory for more examples and generated code.
[`pin_project`]: https://docs.rs/pin-project/1/pin_project/attr.pin_project.html
[enum-default-expanded]: examples/enum-default-expanded.rs
[examples]: examples/README.md
-[pin-projection]: https://doc.rust-lang.org/nightly/std/pin/index.html#projections-and-structural-pinning
+[pin-projection]: https://doc.rust-lang.org/std/pin/index.html#projections-and-structural-pinning
[struct-default-expanded]: examples/struct-default-expanded.rs
## Related Projects
-* [pin-project-lite]: A lightweight version of pin-project written with declarative macros.
+- [pin-project-lite]: A lightweight version of pin-project written with declarative macros.
[pin-project-lite]: https://github.com/taiki-e/pin-project-lite
## License
-Licensed under either of [Apache License, Version 2.0](LICENSE-APACHE) or [MIT license](LICENSE-MIT) at your option.
+Licensed under either of [Apache License, Version 2.0](LICENSE-APACHE) or
+[MIT license](LICENSE-MIT) at your option.
-### Contribution
-
-Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.
+Unless you explicitly state otherwise, any contribution intentionally submitted
+for inclusion in the work by you, as defined in the Apache-2.0 license, shall
+be dual licensed as above, without any additional terms or conditions.
diff --git a/examples/README.md b/examples/README.md
index 3f0d87e..9324dc6 100644
--- a/examples/README.md
+++ b/examples/README.md
@@ -2,37 +2,38 @@
### Basic usage of `#[pin_project]` on structs
- * [example](struct-default.rs)
- * [generated code](struct-default-expanded.rs)
+- [example](struct-default.rs)
+- [generated code](struct-default-expanded.rs)
### Basic usage of `#[pin_project]` on enums
- * [example](enum-default.rs)
- * [generated code](enum-default-expanded.rs)
+- [example](enum-default.rs)
+- [generated code](enum-default-expanded.rs)
### Manual implementation of `Unpin` by `UnsafeUnpin`
- * [example](unsafe_unpin.rs)
- * [generated code](unsafe_unpin-expanded.rs)
- * [`UnsafeUnpin` documentation](https://docs.rs/pin-project/1/pin_project/trait.UnsafeUnpin.html)
+- [example](unsafe_unpin.rs)
+- [generated code](unsafe_unpin-expanded.rs)
+- [`UnsafeUnpin` documentation](https://docs.rs/pin-project/1/pin_project/trait.UnsafeUnpin.html)
### Manual implementation of `Drop` by `#[pinned_drop]`
- * [example](pinned_drop.rs)
- * [generated code](pinned_drop-expanded.rs)
- * [`#[pinned_drop]` documentation](https://docs.rs/pin-project/1/pin_project/attr.pinned_drop.html)
+- [example](pinned_drop.rs)
+- [generated code](pinned_drop-expanded.rs)
+- [`#[pinned_drop]` documentation](https://docs.rs/pin-project/1/pin_project/attr.pinned_drop.html)
### `project_replace()` method
- * [example](project_replace.rs)
- * [generated code](project_replace-expanded.rs)
- * [`project_replace()` documentation](https://docs.rs/pin-project/1/pin_project/attr.pin_project.html#project_replace)
+- [example](project_replace.rs)
+- [generated code](project_replace-expanded.rs)
+- [`project_replace()` documentation](https://docs.rs/pin-project/1/pin_project/attr.pin_project.html#project_replace)
### Ensure `!Unpin` by `#[pin_project(!Unpin)]`
- * [example](not_unpin.rs)
- * [generated code](not_unpin-expanded.rs)
- * [`!Unpin` documentation](https://docs.rs/pin-project/1/pin_project/attr.pin_project.html#unpin)
+- [example](not_unpin.rs)
+- [generated code](not_unpin-expanded.rs)
+- [`!Unpin` documentation](https://docs.rs/pin-project/1/pin_project/attr.pin_project.html#unpin)
-Note: These generated code examples are the little simplified version of the actual generated code.
-See [expansion tests](../tests/expand/README.md) if you want to see the exact version of the actual generated code.
+Note: These generated code examples are the little simplified version of the
+actual generated code. See [expansion tests](../tests/expand/README.md) if you
+want to see the exact version of the actual generated code.
diff --git a/scripts/README.md b/scripts/README.md
deleted file mode 100644
index 671a9b1..0000000
--- a/scripts/README.md
+++ /dev/null
@@ -1,3 +0,0 @@
-This directory contains scripts used by the developers of this project.
-
-Some scripts in this directory are also used in CI, but scripts intended to be used only in CI and scripts not intended to be used directly by the developers are basically in the `ci` directory.
diff --git a/scripts/check-minimal-versions.sh b/scripts/check-minimal-versions.sh
deleted file mode 100755
index 56fadee..0000000
--- a/scripts/check-minimal-versions.sh
+++ /dev/null
@@ -1,61 +0,0 @@
-#!/bin/bash
-
-# Check all public crates with minimal version dependencies.
-#
-# Usage:
-# bash scripts/check-minimal-versions.sh [+toolchain] [check|test]
-#
-# Note:
-# - This script modifies Cargo.toml and Cargo.lock while running
-# - This script exits with 1 if there are any unstaged changes
-# - This script requires nightly Rust and cargo-hack
-#
-# Refs: https://github.com/rust-lang/cargo/issues/5657
-
-set -euo pipefail
-IFS=$'\n\t'
-
-cd "$(cd "$(dirname "${0}")" && pwd)"/..
-
-# Decide Rust toolchain.
-# Nightly is used by default if the `CI` environment variable is unset.
-if [[ "${1:-}" == "+"* ]]; then
- toolchain="${1}"
- shift
-elif [[ -z "${CI:-}" ]]; then
- toolchain="+nightly"
-fi
-# Make sure toolchain is installed.
-cargo ${toolchain:-} -V >/dev/null
-# This script requires nightly Rust and cargo-hack
-if [[ "${toolchain:-+nightly}" != "+nightly"* ]] || ! cargo hack -V &>/dev/null; then
- echo "error: check-minimal-versions.sh requires nightly Rust and cargo-hack"
- exit 1
-fi
-
-# Parse subcommand.
-subcmd="${1:-check}"
-if [[ ! "${subcmd}" =~ ^(check|test)$ ]]; then
- echo "error: invalid argument: ${1}"
- exit 1
-elif [[ -n "${2:-}" ]]; then
- echo "error: invalid argument: ${2}"
- exit 1
-fi
-
-# This script modifies Cargo.toml and Cargo.lock, so make sure there are no
-# unstaged changes.
-git diff --exit-code
-# Restore original Cargo.toml and Cargo.lock on exit.
-trap 'git checkout .' EXIT
-
-if [[ "${subcmd}" == "check" ]]; then
- # Remove dev-dependencies from Cargo.toml to prevent the next `cargo update`
- # from determining minimal versions based on dev-dependencies.
- cargo hack --remove-dev-deps --workspace
-fi
-
-# Update Cargo.lock to minimal version dependencies.
-cargo ${toolchain:-} update -Z minimal-versions
-# Run check for all public members of the workspace.
-cargo ${toolchain:-} hack "${subcmd}" --workspace --all-features --ignore-private -Z features=all
diff --git a/scripts/ci.sh b/scripts/ci.sh
deleted file mode 100755
index b6a1a74..0000000
--- a/scripts/ci.sh
+++ /dev/null
@@ -1,37 +0,0 @@
-#!/bin/bash
-
-# A script to run a simplified version of the checks done by CI.
-#
-# Usage:
-# bash scripts/ci.sh
-#
-# Note: This script requires nightly Rust, rustfmt, clippy, and cargo-expand
-
-set -euo pipefail
-IFS=$'\n\t'
-
-# Decide Rust toolchain. Nightly is used by default.
-toolchain="+nightly"
-if [[ "${1:-}" == "+"* ]]; then
- toolchain="${1}"
- shift
-fi
-# Make sure toolchain is installed.
-cargo "${toolchain}" -V >/dev/null
-
-if [[ "${toolchain:-+nightly}" != "+nightly"* ]] || ! rustfmt -V &>/dev/null || ! cargo clippy -V &>/dev/null || ! cargo expand -V &>/dev/null; then
- echo "error: ci.sh requires nightly Rust, rustfmt, clippy, and cargo-expand"
- exit 1
-fi
-
-echo "Running 'cargo ${toolchain} fmt --all'"
-cargo "${toolchain}" fmt --all
-
-echo "Running 'cargo ${toolchain} clippy --all --all-targets'"
-cargo "${toolchain}" clippy --all --all-features --all-targets -Z unstable-options
-
-echo "Running 'cargo ${toolchain} test --all'"
-cargo "${toolchain}" test --all --all-features
-
-echo "Running 'cargo ${toolchain} doc --no-deps --all'"
-cargo "${toolchain}" doc --no-deps --all --all-features
diff --git a/src/lib.rs b/src/lib.rs
index 39e8faa..37e33e6 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -65,23 +65,16 @@
//! [struct-default-expanded]: https://github.com/taiki-e/pin-project/blob/master/examples/struct-default-expanded.rs
#![no_std]
-#![doc(html_root_url = "https://docs.rs/pin-project/1.0.2")]
#![doc(test(
no_crate_inject,
- attr(deny(warnings, rust_2018_idioms, single_use_lifetimes), allow(dead_code))
+ attr(
+ deny(warnings, rust_2018_idioms, single_use_lifetimes),
+ allow(dead_code, unused_variables)
+ )
))]
#![warn(future_incompatible, rust_2018_idioms, single_use_lifetimes, unreachable_pub)]
#![warn(missing_docs)]
#![warn(clippy::all, clippy::default_trait_access)]
-// mem::take, #[non_exhaustive], and Option::{as_deref, as_deref_mut} require Rust 1.40,
-// matches! requires Rust 1.42, str::{strip_prefix, strip_suffix} requires Rust 1.45
-#![allow(
- clippy::mem_replace_with_default,
- clippy::manual_non_exhaustive,
- clippy::option_as_ref_deref,
- clippy::match_like_matches_macro,
- clippy::manual_strip
-)]
#![allow(clippy::needless_doctest_main)]
// ANDROID: Use std to allow building as a dylib.
diff --git a/src/lib.rs.orig b/src/lib.rs.orig
index 5750c2b..b7a20ed 100644
--- a/src/lib.rs.orig
+++ b/src/lib.rs.orig
@@ -65,23 +65,16 @@
//! [struct-default-expanded]: https://github.com/taiki-e/pin-project/blob/master/examples/struct-default-expanded.rs
#![no_std]
-#![doc(html_root_url = "https://docs.rs/pin-project/1.0.2")]
#![doc(test(
no_crate_inject,
- attr(deny(warnings, rust_2018_idioms, single_use_lifetimes), allow(dead_code))
+ attr(
+ deny(warnings, rust_2018_idioms, single_use_lifetimes),
+ allow(dead_code, unused_variables)
+ )
))]
#![warn(future_incompatible, rust_2018_idioms, single_use_lifetimes, unreachable_pub)]
#![warn(missing_docs)]
#![warn(clippy::all, clippy::default_trait_access)]
-// mem::take, #[non_exhaustive], and Option::{as_deref, as_deref_mut} require Rust 1.40,
-// matches! requires Rust 1.42, str::{strip_prefix, strip_suffix} requires Rust 1.45
-#![allow(
- clippy::mem_replace_with_default,
- clippy::manual_non_exhaustive,
- clippy::option_as_ref_deref,
- clippy::match_like_matches_macro,
- clippy::manual_strip
-)]
#![allow(clippy::needless_doctest_main)]
#[doc(inline)]
diff --git a/tests/auxiliary/mod.rs b/tests/auxiliary/mod.rs
index 1457099..a0eb7c2 100644
--- a/tests/auxiliary/mod.rs
+++ b/tests/auxiliary/mod.rs
@@ -1,4 +1,9 @@
#![allow(dead_code, unused_macros)]
+#![allow(box_pointers, unreachable_pub)]
+#![allow(clippy::restriction)]
+
+use std::{env, fs, path::Path, process::Command};
+use tempfile::Builder;
macro_rules! assert_unpin {
($ty:ty) => {
@@ -10,3 +15,30 @@ macro_rules! assert_not_unpin {
static_assertions::assert_not_impl_all!($ty: Unpin);
};
}
+
+#[rustversion::attr(since(1.46), track_caller)]
+pub fn assert_diff(expected_path: impl AsRef<Path>, actual: impl AsRef<str>) {
+ let actual = actual.as_ref();
+ let manifest_dir = Path::new(env!("CARGO_MANIFEST_DIR"));
+ let expected_path = &manifest_dir.join(expected_path);
+ (|| -> Result<(), Box<dyn std::error::Error>> {
+ let expected = fs::read_to_string(expected_path)?;
+ if expected != actual {
+ if env::var_os("CI").is_some() {
+ let outdir = Builder::new().prefix("assert_diff").tempdir()?;
+ let actual_path = &outdir.path().join(expected_path.file_name().unwrap());
+ fs::write(actual_path, actual)?;
+ let status = Command::new("git")
+ .args(&["--no-pager", "diff", "--no-index", "--"])
+ .args(&[expected_path, actual_path])
+ .status()?;
+ assert!(!status.success());
+ panic!("assertion failed");
+ } else {
+ fs::write(expected_path, actual)?;
+ }
+ }
+ Ok(())
+ })()
+ .unwrap_or_else(|e| panic!("{}", e))
+}
diff --git a/tests/compiletest.rs b/tests/compiletest.rs
index 057df7c..85b1db8 100644
--- a/tests/compiletest.rs
+++ b/tests/compiletest.rs
@@ -4,7 +4,7 @@
use std::env;
// Run `./dev.sh +$toolchain test --test compiletest` to update this.
-#[rustversion::attr(before(2020-10-28), ignore)] // Note: This date is commit-date and the day before the toolchain date.
+#[rustversion::attr(before(2020-11-25), ignore)] // Note: This date is commit-date and the day before the toolchain date.
#[test]
fn ui() {
if env::var_os("CI").is_none() {
diff --git a/tests/lint.rs b/tests/lint.rs
index c7f1380..b577e0e 100644
--- a/tests/lint.rs
+++ b/tests/lint.rs
@@ -39,6 +39,8 @@
// Check interoperability with rustc and clippy lints.
+mod auxiliary;
+
pub mod basic {
include!("include/basic.rs");
@@ -1023,42 +1025,15 @@ pub mod clippy_used_underscore_binding {
// Run `./dev.sh +$toolchain test --test lint` to update this.
#[cfg(not(miri))]
-#[allow(box_pointers)]
#[allow(clippy::restriction)]
-#[rustversion::attr(before(2020-11-08), ignore)] // Note: This date is commit-date and the day before the toolchain date.
+#[rustversion::attr(before(2020-12-25), ignore)] // Note: This date is commit-date and the day before the toolchain date.
#[test]
fn check_lint_list() {
- use std::{env, fs, path::Path, process::Command, str};
-
- type Result<T, E = Box<dyn std::error::Error>> = std::result::Result<T, E>;
-
- fn assert_eq(expected_path: &str, actual: &str) -> Result<()> {
- let manifest_dir = Path::new(env!("CARGO_MANIFEST_DIR"));
- let expected_path = &manifest_dir.join(expected_path);
- let expected = fs::read_to_string(expected_path)?;
- if expected != actual {
- if env::var_os("CI").is_some() {
- let actual_path =
- &manifest_dir.join("target").join(expected_path.file_name().unwrap());
- fs::write(actual_path, actual)?;
- let status = Command::new("git")
- .args(&["--no-pager", "diff", "--no-index", "--"])
- .args(&[expected_path, actual_path])
- .status()?;
- assert!(!status.success());
- panic!("assertion failed");
- } else {
- fs::write(expected_path, actual)?;
- }
- }
- Ok(())
- }
+ use auxiliary::assert_diff;
+ use std::{env, process::Command, str};
- (|| -> Result<()> {
- let rustc = env::var_os("RUSTC").unwrap_or_else(|| "rustc".into());
- let output = Command::new(rustc).args(&["-W", "help"]).output()?;
- let new = str::from_utf8(&output.stdout)?;
- assert_eq("tests/lint.txt", new)
- })()
- .unwrap_or_else(|e| panic!("{}", e));
+ let rustc = env::var_os("RUSTC").unwrap_or_else(|| "rustc".into());
+ let output = Command::new(rustc).args(&["-W", "help"]).output().unwrap();
+ let new = str::from_utf8(&output.stdout).unwrap();
+ assert_diff("tests/lint.txt", new);
}
diff --git a/tests/lint.txt b/tests/lint.txt
index a258fb8..8983ad7 100644
--- a/tests/lint.txt
+++ b/tests/lint.txt
@@ -79,7 +79,8 @@ Lint checks provided by rustc:
non-snake-case warn variables, methods, functions, lifetime parameters and modules should have snake case names
non-upper-case-globals warn static constants should have uppercase identifiers
no-mangle-generic-items warn generic items must be mangled
- overlapping-patterns warn detects overlapping patterns
+ overlapping-range-endpoints warn detects range patterns with overlapping endpoints
+ panic-fmt warn detect braces in single-argument panic!() invocations
path-statements warn path statements with no effect
private-intra-doc-links warn linking from a public item to a private one
private-in-public warn detect private items in public interfaces not caught by the old implementation
@@ -100,6 +101,7 @@ Lint checks provided by rustc:
unreachable-code warn detects unreachable code paths
unreachable-patterns warn detects unreachable patterns
unstable-name-collisions warn detects name collision with an existing but unstable method
+ unsupported-naked-functions warn unsupported naked function definitions
unused-allocation warn detects unnecessary allocations that can be eliminated
unused-assignments warn detect assignments that will never be read
unused-attributes warn detects attributes that were not used by the compiler
@@ -126,6 +128,7 @@ Lint checks provided by rustc:
incomplete-include deny trailing content in included file
invalid-type-param-default deny type parameter default erroneously allowed in invalid location
macro-expanded-macro-exports-accessed-by-absolute-paths deny macro-expanded `macro_export` macros from the current crate cannot be referred to by absolute paths
+ missing-fragment-specifier deny detects missing fragment specifiers in unused `macro_rules!` patterns
mutable-transmutes deny mutating transmuted &mut T from &T may cause undefined behavior
no-mangle-const-items deny const items will not have their symbols exported
order-dependent-trait-objects deny trait-object types were treated as different depending on marker-trait order
@@ -143,12 +146,12 @@ Lint groups provided by rustc:
name sub-lints
---- ---------
warnings all lints that are set to issue warnings
- future-incompatible keyword-idents, anonymous-parameters, illegal-floating-point-literal-pattern, private-in-public, pub-use-of-private-extern-crate, invalid-type-param-default, safe-packed-borrows, patterns-in-fns-without-body, late-bound-lifetime-arguments, order-dependent-trait-objects, coherence-leak-check, tyvar-behind-raw-pointer, absolute-paths-not-starting-with-crate, unstable-name-collisions, where-clauses-object-safety, proc-macro-derive-resolution-fallback, macro-expanded-macro-exports-accessed-by-absolute-paths, ill-formed-attribute-input, conflicting-repr-hints, ambiguous-associated-items, mutable-borrow-reservation-conflict, indirect-structural-match, pointer-structural-match, nontrivial-structural-match, soft-unstable, cenum-impl-drop-cast, const-evaluatable-unchecked, uninhabited-static, array-into-iter
+ future-incompatible keyword-idents, anonymous-parameters, illegal-floating-point-literal-pattern, private-in-public, pub-use-of-private-extern-crate, invalid-type-param-default, safe-packed-borrows, patterns-in-fns-without-body, missing-fragment-specifier, late-bound-lifetime-arguments, order-dependent-trait-objects, coherence-leak-check, tyvar-behind-raw-pointer, absolute-paths-not-starting-with-crate, unstable-name-collisions, where-clauses-object-safety, proc-macro-derive-resolution-fallback, macro-expanded-macro-exports-accessed-by-absolute-paths, ill-formed-attribute-input, conflicting-repr-hints, ambiguous-associated-items, mutable-borrow-reservation-conflict, indirect-structural-match, pointer-structural-match, nontrivial-structural-match, soft-unstable, cenum-impl-drop-cast, const-evaluatable-unchecked, uninhabited-static, unsupported-naked-functions, array-into-iter
nonstandard-style non-camel-case-types, non-snake-case, non-upper-case-globals
rust-2018-compatibility keyword-idents, anonymous-parameters, tyvar-behind-raw-pointer, absolute-paths-not-starting-with-crate
rust-2018-idioms bare-trait-objects, unused-extern-crates, ellipsis-inclusive-range-patterns, elided-lifetimes-in-paths, explicit-outlives-requirements
rustdoc non-autolinks, broken-intra-doc-links, private-intra-doc-links, invalid-codeblock-attributes, missing-doc-code-examples, private-doc-tests, invalid-html-tags
- unused unused-imports, unused-variables, unused-assignments, dead-code, unused-mut, unreachable-code, unreachable-patterns, overlapping-patterns, unused-must-use, unused-unsafe, path-statements, unused-attributes, unused-macros, unused-allocation, unused-doc-comments, unused-extern-crates, unused-features, unused-labels, unused-parens, unused-braces, redundant-semicolons
+ unused unused-imports, unused-variables, unused-assignments, dead-code, unused-mut, unreachable-code, unreachable-patterns, unused-must-use, unused-unsafe, path-statements, unused-attributes, unused-macros, unused-allocation, unused-doc-comments, unused-extern-crates, unused-features, unused-labels, unused-parens, unused-braces, redundant-semicolons
-Compiler plugins can provide additional lints and lint groups. To see a listing of these, re-run `rustc -W help` with a crate filename.
+Lint tools like Clippy can provide additional lints and lint groups.
diff --git a/tests/ui/pin_project/remove-attr-from-struct.stderr b/tests/ui/pin_project/remove-attr-from-struct.stderr
index 97d9c23..4652b66 100644
--- a/tests/ui/pin_project/remove-attr-from-struct.stderr
+++ b/tests/ui/pin_project/remove-attr-from-struct.stderr
@@ -7,15 +7,15 @@ error: #[pin_project] attribute has been removed
= note: this error originates in a derive macro (in Nightly builds, run with -Z macro-backtrace for more info)
error: cannot find attribute `pin` in this scope
- --> $DIR/remove-attr-from-struct.rs:10:7
+ --> $DIR/remove-attr-from-struct.rs:17:7
|
-10 | #[pin] //~ ERROR cannot find attribute `pin` in this scope
+17 | #[pin] //~ ERROR cannot find attribute `pin` in this scope
| ^^^
error: cannot find attribute `pin` in this scope
- --> $DIR/remove-attr-from-struct.rs:17:7
+ --> $DIR/remove-attr-from-struct.rs:10:7
|
-17 | #[pin] //~ ERROR cannot find attribute `pin` in this scope
+10 | #[pin] //~ ERROR cannot find attribute `pin` in this scope
| ^^^
error[E0277]: `PhantomPinned` cannot be unpinned
diff --git a/tests/ui/unstable-features/README.md b/tests/ui/unstable-features/README.md
index b9215b6..96f370c 100644
--- a/tests/ui/unstable-features/README.md
+++ b/tests/ui/unstable-features/README.md
@@ -1,5 +1,7 @@
# UI tests for unstable features
-These tests check how the guarantees and features provided by pin-project interact with unstable language features.
+These tests check how the guarantees and features provided by pin-project
+interact with unstable language features.
-The names of the files contained in this directory need to begin with the name of the feature.
+The names of the files contained in this directory need to begin with the name
+of the feature.