diff options
author | Android Build Coastguard Worker <android-build-coastguard-worker@google.com> | 2022-02-16 01:14:38 +0000 |
---|---|---|
committer | Android Build Coastguard Worker <android-build-coastguard-worker@google.com> | 2022-02-16 01:14:38 +0000 |
commit | 749199f8ee1a39c08b2b229b706d3a7513e488bb (patch) | |
tree | 468b171d04d12d79930f58d6efc7ec3a45854589 | |
parent | 410b9e3b15bab1e68feb13f22a5240053b1363c5 (diff) | |
parent | 97a2c271155cd6741cfdd59484a6a8ab0d04fb78 (diff) | |
download | pin-project-749199f8ee1a39c08b2b229b706d3a7513e488bb.tar.gz |
Snap for 8188146 from 97a2c271155cd6741cfdd59484a6a8ab0d04fb78 to tm-frc-media-swcodec-release
Change-Id: I84bb3012323deb0dca6dfc7a2f3446454ad385bc
122 files changed, 1250 insertions, 981 deletions
diff --git a/.cargo_vcs_info.json b/.cargo_vcs_info.json index 759ab72..6cfdedc 100644 --- a/.cargo_vcs_info.json +++ b/.cargo_vcs_info.json @@ -1,5 +1,5 @@ { "git": { - "sha1": "6bd40906acb8574a3a0bbadc7cf1349fadac7d3c" + "sha1": "a51d39fcdb31fe78cc61c0053ead2beb65a4156d" } } @@ -41,8 +41,6 @@ rust_library { name: "libpin_project", host_supported: true, crate_name: "pin_project", - cargo_env_compat: true, - cargo_pkg_version: "1.0.8", srcs: ["src/lib.rs"], edition: "2018", proc_macros: ["libpin_project_internal"], @@ -51,3 +49,10 @@ rust_library { "com.android.virt", ], } + +// dependent_library ["feature_list"] +// pin-project-internal-1.0.6 +// proc-macro2-1.0.26 "default,proc-macro" +// quote-1.0.9 "default,proc-macro" +// syn-1.0.71 "clone-impls,default,derive,full,parsing,printing,proc-macro,quote,visit-mut" +// unicode-xid-0.2.1 "default" diff --git a/CHANGELOG.md b/CHANGELOG.md index 7568f0a..a9b56e1 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,14 +10,6 @@ Note: In this file, do not use the hard wrap in the middle of a sentence for com ## [Unreleased] -## [1.0.8] - 2021-07-21 - -- [Suppress `clippy::use_self` and `clippy::type_repetition_in_bounds` lints in generated code.](https://github.com/taiki-e/pin-project/pull/331) - -## [1.0.7] - 2021-04-16 - -- [Fix compile error when using `self::` as prefix of path inside `#[pinned_drop]` impl.](https://github.com/taiki-e/pin-project/pull/326) - ## [1.0.6] - 2021-03-25 - [Suppress `clippy::semicolon_if_nothing_returned` lint in generated code.](https://github.com/taiki-e/pin-project/pull/318) @@ -114,12 +106,6 @@ Changes since the 1.0.0-alpha.1 release: See also [tracking issue for 1.0 release](https://github.com/taiki-e/pin-project/issues/264). -## [0.4.28] - 2021-03-28 - -- [Fix `unused_must_use` warning on unused borrows, which will be added to rustc in the future.](https://github.com/taiki-e/pin-project/pull/322) See [#322](https://github.com/taiki-e/pin-project/pull/322) for more details. - - (Note: 1.0 does not have this problem.) - ## [0.4.27] - 2020-10-11 - Update minimal version of `syn` to 1.0.44 @@ -191,7 +177,7 @@ See also [tracking issue for 1.0 release](https://github.com/taiki-e/pin-project } ``` -- [Make `project_replace` argument an alias for `Replace` argument so that it can be used without a value.](https://github.com/taiki-e/pin-project/pull/243) +- [Makes `project_replace` argument an alias for `Replace` argument so that it can be used without a value.](https://github.com/taiki-e/pin-project/pull/243) ```rust #[pin_project(project_replace)] @@ -241,7 +227,7 @@ See also [tracking issue for 1.0 release](https://github.com/taiki-e/pin-project ## [0.4.16] - 2020-05-11 -- [Fix an issue that users can call internal function generated by `#[pinned_drop]`.](https://github.com/taiki-e/pin-project/pull/223) +- [Fixed an issue that users can call internal function generated by `#[pinned_drop]`.](https://github.com/taiki-e/pin-project/pull/223) ## [0.4.15] - 2020-05-10 @@ -249,7 +235,7 @@ See also [tracking issue for 1.0 release](https://github.com/taiki-e/pin-project ## [0.4.14] - 2020-05-09 -- [Add `!Unpin` option to `#[pin_project]` attribute for guarantee the type is `!Unpin`.](https://github.com/taiki-e/pin-project/pull/219) +- [Added `!Unpin` option to `#[pin_project]` attribute for guarantee the type is `!Unpin`.](https://github.com/taiki-e/pin-project/pull/219) ```rust #[pin_project(!Unpin)] @@ -271,7 +257,7 @@ 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)* -- [Fix an issue where duplicate `#[project]` attributes were ignored.](https://github.com/taiki-e/pin-project/pull/218) +- [Fixed an issue where duplicate `#[project]` attributes were ignored.](https://github.com/taiki-e/pin-project/pull/218) - [Suppress `single_use_lifetimes` lint in generated code.](https://github.com/taiki-e/pin-project/pull/217) @@ -283,11 +269,11 @@ See also [tracking issue for 1.0 release](https://github.com/taiki-e/pin-project ## [0.4.13] - 2020-05-07 -- [Fix a regression in 0.4.11.](https://github.com/taiki-e/pin-project/pull/207) +- [Fixed a regression in 0.4.11.](https://github.com/taiki-e/pin-project/pull/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): - - [Fix an issue that `#[project]` on non-statement expression does not work without unstable features.](https://github.com/taiki-e/pin-project/pull/197) + - [Fixed an issue that `#[project]` on non-statement expression does not work without unstable features.](https://github.com/taiki-e/pin-project/pull/197) - [Support overwriting the name of core crate.](https://github.com/taiki-e/pin-project/pull/199) @@ -305,7 +291,7 @@ See also [tracking issue for 1.0 release](https://github.com/taiki-e/pin-project **Note: This release has been yanked.** See [#206](https://github.com/taiki-e/pin-project/issues/206) for details. -- [Fix an issue that `#[project]` on non-statement expression does not work without unstable features.](https://github.com/taiki-e/pin-project/pull/197) +- [Fixed an issue that `#[project]` on non-statement expression does not work without unstable features.](https://github.com/taiki-e/pin-project/pull/197) - [Support overwriting the name of core crate.](https://github.com/taiki-e/pin-project/pull/199) @@ -317,43 +303,43 @@ See also [tracking issue for 1.0 release](https://github.com/taiki-e/pin-project ## [0.4.10] - 2020-05-04 -- [Add `project_replace` method and `#[project_replace]` attribute.](https://github.com/taiki-e/pin-project/pull/194) +- [Added `project_replace` method and `#[project_replace]` attribute.](https://github.com/taiki-e/pin-project/pull/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.](https://github.com/taiki-e/pin-project/pull/190) -- [Hide all generated items except for projected types from calling code.](https://github.com/taiki-e/pin-project/pull/192) See [#192](https://github.com/taiki-e/pin-project/pull/192) for details. +- [Hided all generated items except for projected types from calling code.](https://github.com/taiki-e/pin-project/pull/192) See [#192](https://github.com/taiki-e/pin-project/pull/192) for details. ## [0.4.9] - 2020-04-14 -- [Fix lifetime inference error when associated types are used in fields.](https://github.com/taiki-e/pin-project/pull/188) +- [Fixed lifetime inference error when associated types are used in fields.](https://github.com/taiki-e/pin-project/pull/188) -- [Fix compile error with tuple structs with `where` clauses.](https://github.com/taiki-e/pin-project/pull/186) +- [Fixed compile error with tuple structs with `where` clauses.](https://github.com/taiki-e/pin-project/pull/186) - [`#[project]` attribute can now be used for `if let` expressions.](https://github.com/taiki-e/pin-project/pull/181) ## [0.4.8] - 2020-01-27 -- [Ensure that users cannot implement `PinnedDrop` without proper attribute argument.](https://github.com/taiki-e/pin-project/pull/180) +- [Ensured that users cannot implement `PinnedDrop` without proper attribute argument.](https://github.com/taiki-e/pin-project/pull/180) -- [Fix use of `Self` in expression position inside `#[pinned_drop]` impl.](https://github.com/taiki-e/pin-project/pull/177) +- [Fixed use of `Self` in expression position inside `#[pinned_drop]` impl.](https://github.com/taiki-e/pin-project/pull/177) ## [0.4.7] - 2020-01-20 -- [Fix support for lifetime bounds.](https://github.com/taiki-e/pin-project/pull/176) +- [Fixed support for lifetime bounds.](https://github.com/taiki-e/pin-project/pull/176) ## [0.4.6] - 2019-11-20 -- [Fix compile error when there is `Self` in the where clause.](https://github.com/taiki-e/pin-project/pull/169) +- [Fixed compile error when there is `Self` in the where clause.](https://github.com/taiki-e/pin-project/pull/169) ## [0.4.5] - 2019-10-21 -- [Fix compile error with `dyn` types.](https://github.com/taiki-e/pin-project/pull/158) +- [Fixed compile error with `dyn` types.](https://github.com/taiki-e/pin-project/pull/158) ## [0.4.4] - 2019-10-17 -- [Fix an issue where `PinnedDrop` implementations can call unsafe code without an unsafe block.](https://github.com/taiki-e/pin-project/pull/149) +- [Fixed an issue where `PinnedDrop` implementations can call unsafe code without an unsafe block.](https://github.com/taiki-e/pin-project/pull/149) ## [0.4.3] - 2019-10-15 @@ -363,7 +349,7 @@ See also [tracking issue for 1.0 release](https://github.com/taiki-e/pin-project - [`#[pin_project]` can now interoperate with `#[cfg()]` on tuple structs and tuple variants.](https://github.com/taiki-e/pin-project/pull/135) -- [Fix support for DSTs(Dynamically Sized Types) on `#[pin_project(UnsafeUnpin)]`](https://github.com/taiki-e/pin-project/pull/120) +- [Fixed support for DSTs(Dynamically Sized Types) on `#[pin_project(UnsafeUnpin)]`](https://github.com/taiki-e/pin-project/pull/120) - Diagnostic improvements. @@ -371,13 +357,13 @@ See also [tracking issue for 1.0 release](https://github.com/taiki-e/pin-project **Note: This release has been yanked.** See [#148](https://github.com/taiki-e/pin-project/pull/148) for details. -- [Fix support for DSTs(Dynamically Sized Types).](https://github.com/taiki-e/pin-project/pull/113) +- [Fixed support for DSTs(Dynamically Sized Types).](https://github.com/taiki-e/pin-project/pull/113) ## [0.4.1] - 2019-09-26 **Note: This release has been yanked.** See [#148](https://github.com/taiki-e/pin-project/pull/148) for details. -- [Fix an issue that caused an error when using `#[pin_project]` on a type that has `#[pin]` + `!Unpin` field with no generics or lifetime.](https://github.com/taiki-e/pin-project/pull/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.](https://github.com/taiki-e/pin-project/pull/111) ## [0.4.0] - 2019-09-25 @@ -399,11 +385,11 @@ See also [tracking issue for 1.0 release](https://github.com/taiki-e/pin-project - [`#[pin_project]` can now interoperate with `#[cfg()]`.](https://github.com/taiki-e/pin-project/pull/77) -- [Add `project_ref` method to `#[pin_project]` types.](https://github.com/taiki-e/pin-project/pull/93) +- [Added `project_ref` method to `#[pin_project]` types.](https://github.com/taiki-e/pin-project/pull/93) -- [Add `#[project_ref]` attribute.](https://github.com/taiki-e/pin-project/pull/93) +- [Added `#[project_ref]` attribute.](https://github.com/taiki-e/pin-project/pull/93) -- [Remove "project_attr" feature and always enable `#[project]` attribute.](https://github.com/taiki-e/pin-project/pull/94) +- [Removed "project_attr" feature and always enable `#[project]` attribute.](https://github.com/taiki-e/pin-project/pull/94) - [`#[project]` attribute can now be used for `impl` blocks.](https://github.com/taiki-e/pin-project/pull/46) @@ -413,25 +399,25 @@ See also [tracking issue for 1.0 release](https://github.com/taiki-e/pin-project Changes since the 0.4.0-beta.1 release: -- [Fix 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.](https://github.com/taiki-e/pin-project/pull/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.](https://github.com/taiki-e/pin-project/pull/107) ## [0.4.0-beta.1] - 2019-09-21 -- [Change the argument type of project method back to `self: Pin<&mut Self>`.](https://github.com/taiki-e/pin-project/pull/90) +- [Changed the argument type of project method back to `self: Pin<&mut Self>`.](https://github.com/taiki-e/pin-project/pull/90) -- [Remove "project_attr" feature and always enable `#[project]` attribute.](https://github.com/taiki-e/pin-project/pull/94) +- [Removed "project_attr" feature and always enable `#[project]` attribute.](https://github.com/taiki-e/pin-project/pull/94) -- [Remove "renamed" feature.](https://github.com/taiki-e/pin-project/pull/100) +- [Removed "renamed" feature.](https://github.com/taiki-e/pin-project/pull/100) - [`#[project]` attribute can now be used for `use` statements.](https://github.com/taiki-e/pin-project/pull/85) -- [Add `project_ref` method and `#[project_ref]` attribute.](https://github.com/taiki-e/pin-project/pull/93) +- [Added `project_ref` method and `#[project_ref]` attribute.](https://github.com/taiki-e/pin-project/pull/93) - [`#[pin_project]` attribute now determines the visibility of the projection type/method is based on the original type.](https://github.com/taiki-e/pin-project/pull/96) ## [0.4.0-alpha.11] - 2019-09-11 -- [Change #[pinned_drop] to trait implementation.](https://github.com/taiki-e/pin-project/pull/86) +- [Changed #[pinned_drop] to trait implementation.](https://github.com/taiki-e/pin-project/pull/86) ```rust #[pinned_drop] @@ -442,7 +428,7 @@ Changes since the 0.4.0-beta.1 release: } ``` -- Add some examples and generated code. +- Added some examples and generated code. - Diagnostic improvements. @@ -454,7 +440,7 @@ Changes since the 0.4.0-beta.1 release: ## [0.4.0-alpha.9] - 2019-09-05 -- [Add `project_into` method to `#[pin_project]` types](https://github.com/taiki-e/pin-project/pull/69). This can be useful when returning a pin projection from a method. +- [Added 'project_into' method to `#[pin_project]` types](https://github.com/taiki-e/pin-project/pull/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> { @@ -462,11 +448,11 @@ Changes since the 0.4.0-beta.1 release: } ``` -- [Prevent `UnpinStruct` from appearing in the document by default.](https://github.com/taiki-e/pin-project/pull/71) See [#71](https://github.com/taiki-e/pin-project/pull/71) for more details. +- [Prevented UnpinStruct from appearing in the document by default.](https://github.com/taiki-e/pin-project/pull/71) See [#71](https://github.com/taiki-e/pin-project/pull/71) for more details. ## [0.4.0-alpha.8] - 2019-09-03 -- [Improve document of generated code.](https://github.com/taiki-e/pin-project/pull/62). Also added an option to control the document of generated code. See [#62](https://github.com/taiki-e/pin-project/pull/62) for more details. +- [Improved document of generated code.](https://github.com/taiki-e/pin-project/pull/62). Also added an option to control the document of generated code. See [#62](https://github.com/taiki-e/pin-project/pull/62) for more details. - [Diagnostic improvements.](https://github.com/taiki-e/pin-project/pull/61) @@ -476,7 +462,7 @@ Changes since the 0.4.0-beta.1 release: ## [0.4.0-alpha.6] - 2019-09-01 -- [Allow using `#[pin_project]` type with private field types](https://github.com/taiki-e/pin-project/pull/53) +- [Allowed using `#[pin_project]` type with private field types](https://github.com/taiki-e/pin-project/pull/53) ## [0.4.0-alpha.5] - 2019-08-24 @@ -488,7 +474,7 @@ Changes since the 0.4.0-beta.1 release: ## [0.4.0-alpha.3] - 2019-08-23 -- [Change `project` method generated by `#[pin_project]` attribute to take an `&mut Pin<&mut Self>` argument.](https://github.com/taiki-e/pin-project/pull/47) +- [Changed `project` method generated by `#[pin_project]` attribute to take an `&mut Pin<&mut Self>` argument.](https://github.com/taiki-e/pin-project/pull/47) - [`#[project]` attribute can now be used for impl blocks.](https://github.com/taiki-e/pin-project/pull/46) @@ -496,7 +482,7 @@ Changes since the 0.4.0-beta.1 release: ## [0.4.0-alpha.2] - 2019-08-13 -- Update `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 @@ -510,13 +496,13 @@ Changes since the 0.4.0-beta.1 release: - `Unpin` impls must be specified with an impl of `UnsafeUnpin`, instead of implementing the normal `Unpin` trait. -- Make `#[project]` attribute disabled by default. +- Made `#[project]` attribute disabled by default. See also [tracking issue for 0.4 release](https://github.com/taiki-e/pin-project/issues/21). ## [0.3.5] - 2019-08-14 -- Update `proc-macro2`, `syn`, and `quote` to 1.0. +- Updated `proc-macro2`, `syn`, and `quote` to 1.0. ## [0.3.4] - 2019-07-21 @@ -530,63 +516,63 @@ See also [tracking issue for 0.4 release](https://github.com/taiki-e/pin-project ## [0.3.2] - 2019-03-30 -- Avoid suffixes on tuple index. +- Avoided suffixes on tuple index. ## [0.3.1] - 2019-03-02 - Documentation improvements. -- Update minimum `syn` version to 0.15.22. +- Updated minimum `syn` version to 0.15.22. ## [0.3.0] - 2019-02-20 -- Remove `unsafe_fields` attribute. +- Removed `unsafe_fields` attribute. -- Remove `unsafe_variants` attribute. +- Removed `unsafe_variants` attribute. ## [0.2.2] - 2019-02-20 -- Fix 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 -- Fix 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 -- Make `unsafe_fields` optional. +- Made `unsafe_fields` optional. - Documentation improvements. ## [0.1.8] - 2019-02-02 -- Add the feature to create projected enums to `unsafe_project`. +- Added the feature to create projected enums to `unsafe_project`. -- Add `project` attribute to support pattern matching. +- Added `project` attribute to support pattern matching. ## [0.1.7] - 2019-01-19 -- Fix documentation. +- Fixed documentation. ## [0.1.6] - 2019-01-19 - `unsafe_fields` can now opt-out. -- Add `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 -- Add support for tuple struct to `unsafe_project`. +- Added support for tuple struct to `unsafe_project`. ## [0.1.4] - 2019-01-12 -- Add 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 -- Fix dependencies. +- Fixed dependencies. -- Add `unsafe_fields` attribute. +- Added `unsafe_fields` attribute. ## [0.1.2] - 2019-01-09 @@ -594,7 +580,7 @@ See also [tracking issue for 0.4 release](https://github.com/taiki-e/pin-project ## [0.1.1] - 2019-01-08 -- Rename from `unsafe_pin_project` to `unsafe_project`. +- Renamed from `unsafe_pin_project` to `unsafe_project`. ## [0.1.0] - 2019-01-08 @@ -602,9 +588,7 @@ See also [tracking issue for 0.4 release](https://github.com/taiki-e/pin-project Initial release -[Unreleased]: https://github.com/taiki-e/pin-project/compare/v1.0.8...HEAD -[1.0.8]: https://github.com/taiki-e/pin-project/compare/v1.0.7...v1.0.8 -[1.0.7]: https://github.com/taiki-e/pin-project/compare/v1.0.6...v1.0.7 +[Unreleased]: https://github.com/taiki-e/pin-project/compare/v1.0.6...HEAD [1.0.6]: https://github.com/taiki-e/pin-project/compare/v1.0.5...v1.0.6 [1.0.5]: https://github.com/taiki-e/pin-project/compare/v1.0.4...v1.0.5 [1.0.4]: https://github.com/taiki-e/pin-project/compare/v1.0.3...v1.0.4 @@ -613,7 +597,6 @@ Initial release [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 [1.0.0-alpha.1]: https://github.com/taiki-e/pin-project/compare/v0.4.23...v1.0.0-alpha.1 -[0.4.28]: https://github.com/taiki-e/pin-project/compare/v0.4.27...v0.4.28 [0.4.27]: https://github.com/taiki-e/pin-project/compare/v0.4.26...v0.4.27 [0.4.26]: https://github.com/taiki-e/pin-project/compare/v0.4.25...v0.4.26 [0.4.25]: https://github.com/taiki-e/pin-project/compare/v0.4.24...v0.4.25 @@ -13,7 +13,7 @@ [package] edition = "2018" name = "pin-project" -version = "1.0.8" +version = "1.0.6" authors = ["Taiki Endo <te316e89@gmail.com>"] exclude = ["/.*", "/ci", "/tools"] description = "A crate for safe and ergonomic pin-projection.\n" @@ -25,7 +25,7 @@ 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.8" +version = "=1.0.6" default-features = false [dev-dependencies.macrotest] version = "1.0.8" diff --git a/Cargo.toml.orig b/Cargo.toml.orig index 6ba9e9b..ef46030 100644 --- a/Cargo.toml.orig +++ b/Cargo.toml.orig @@ -1,6 +1,6 @@ [package] name = "pin-project" -version = "1.0.8" +version = "1.0.6" authors = ["Taiki Endo <te316e89@gmail.com>"] edition = "2018" license = "Apache-2.0 OR MIT" @@ -27,7 +27,7 @@ members = [ ] [dependencies] -pin-project-internal = { version = "=1.0.8", path = "pin-project-internal", default-features = false } +pin-project-internal = { version = "=1.0.6", path = "pin-project-internal", default-features = false } [dev-dependencies] pin-project-auxiliary-macro = { path = "tests/auxiliary/macro" } @@ -7,13 +7,13 @@ third_party { } url { type: ARCHIVE - value: "https://static.crates.io/crates/pin-project/pin-project-1.0.8.crate" + value: "https://static.crates.io/crates/pin-project/pin-project-1.0.6.crate" } - version: "1.0.8" + version: "1.0.6" license_type: NOTICE last_upgrade_date { year: 2021 - month: 8 - day: 9 + month: 4 + day: 1 } } diff --git a/TEST_MAPPING b/TEST_MAPPING new file mode 100644 index 0000000..7e10dd0 --- /dev/null +++ b/TEST_MAPPING @@ -0,0 +1,8 @@ +// Generated by update_crate_tests.py for tests that depend on this crate. +{ + "presubmit": [ + { + "name": "futures-util_device_test_src_lib" + } + ] +} diff --git a/examples/enum-default-expanded.rs b/examples/enum-default-expanded.rs index 459ca39..2153592 100644 --- a/examples/enum-default-expanded.rs +++ b/examples/enum-default-expanded.rs @@ -15,11 +15,7 @@ // ``` #![allow(dead_code, unused_imports, unused_parens, unknown_lints, renamed_and_removed_lints)] -#![allow( - clippy::needless_lifetimes, - clippy::just_underscores_and_digits, - clippy::used_underscore_binding -)] +#![allow(clippy::needless_lifetimes, clippy::just_underscores_and_digits)] use pin_project::pin_project; diff --git a/examples/not_unpin-expanded.rs b/examples/not_unpin-expanded.rs index 5700c12..aa5209d 100644 --- a/examples/not_unpin-expanded.rs +++ b/examples/not_unpin-expanded.rs @@ -76,7 +76,7 @@ const _: () = { // // See ./struct-default-expanded.rs and https://github.com/taiki-e/pin-project/pull/34 // for details. - #[forbid(unaligned_references, safe_packed_borrows)] + #[forbid(safe_packed_borrows)] fn __assert_not_repr_packed<T, U>(this: &Struct<T, U>) { let _ = &this.pinned; let _ = &this.unpinned; diff --git a/examples/pinned_drop-expanded.rs b/examples/pinned_drop-expanded.rs index 82207b6..48eb7fc 100644 --- a/examples/pinned_drop-expanded.rs +++ b/examples/pinned_drop-expanded.rs @@ -23,7 +23,7 @@ // ``` #![allow(dead_code, unused_imports, unused_parens, unknown_lints, renamed_and_removed_lints)] -#![allow(clippy::needless_lifetimes, clippy::mut_mut)] +#![allow(clippy::needless_lifetimes)] use std::pin::Pin; @@ -82,7 +82,7 @@ const _: () = { // // See ./struct-default-expanded.rs and https://github.com/taiki-e/pin-project/pull/34 // for details. - #[forbid(unaligned_references, safe_packed_borrows)] + #[forbid(safe_packed_borrows)] fn __assert_not_repr_packed<'a, T>(this: &Struct<'a, T>) { let _ = &this.was_dropped; let _ = &this.field; @@ -135,7 +135,6 @@ const _: () = { // Users can implement [`Drop`] safely using `#[pinned_drop]` and can drop a // type that implements `PinnedDrop` using the [`drop`] function safely. // **Do not call or implement this trait directly.** -#[doc(hidden)] impl<T> ::pin_project::__private::PinnedDrop for Struct<'_, T> { // Since calling it twice on the same object would be UB, // this method is unsafe. diff --git a/examples/project_replace-expanded.rs b/examples/project_replace-expanded.rs index ebb8e00..4f43bda 100644 --- a/examples/project_replace-expanded.rs +++ b/examples/project_replace-expanded.rs @@ -112,7 +112,7 @@ const _: () = { // // See ./struct-default-expanded.rs and https://github.com/taiki-e/pin-project/pull/34 // for details. - #[forbid(unaligned_references, safe_packed_borrows)] + #[forbid(safe_packed_borrows)] fn __assert_not_repr_packed<T, U>(this: &Struct<T, U>) { let _ = &this.pinned; let _ = &this.unpinned; diff --git a/examples/struct-default-expanded.rs b/examples/struct-default-expanded.rs index d661099..3d0e4ab 100644 --- a/examples/struct-default-expanded.rs +++ b/examples/struct-default-expanded.rs @@ -71,8 +71,10 @@ const _: () = { // Ensure that it's impossible to use pin projections on a #[repr(packed)] // struct. // - // Taking a reference to a packed field is UB, and applying - // `#[forbid(unaligned_references)]` makes sure that doing this is a hard error. + // Taking a reference to a packed field is unsafe, and applying + // #[forbid(safe_packed_borrows)] makes sure that doing this without + // an 'unsafe' block (which we deliberately do not generate) + // is a hard error. // // If the struct ends up having #[repr(packed)] applied somehow, // this will generate an (unfriendly) error message. Under all reasonable @@ -80,7 +82,7 @@ const _: () = { // a much nicer error above. // // See https://github.com/taiki-e/pin-project/pull/34 for more details. - #[forbid(unaligned_references, safe_packed_borrows)] + #[forbid(safe_packed_borrows)] fn __assert_not_repr_packed<T, U>(this: &Struct<T, U>) { let _ = &this.pinned; let _ = &this.unpinned; diff --git a/examples/unsafe_unpin-expanded.rs b/examples/unsafe_unpin-expanded.rs index e9c7abc..2ea1f37 100644 --- a/examples/unsafe_unpin-expanded.rs +++ b/examples/unsafe_unpin-expanded.rs @@ -75,7 +75,7 @@ const _: () = { // // See ./struct-default-expanded.rs and https://github.com/taiki-e/pin-project/pull/34 // for details. - #[forbid(unaligned_references, safe_packed_borrows)] + #[forbid(safe_packed_borrows)] fn __assert_not_repr_packed<T, U>(this: &Struct<T, U>) { let _ = &this.pinned; let _ = &this.unpinned; @@ -74,8 +74,9 @@ allow(dead_code, unused_variables) ) ))] -#![warn(future_incompatible, missing_docs, rust_2018_idioms, single_use_lifetimes, unreachable_pub)] -#![warn(clippy::default_trait_access, clippy::wildcard_imports)] +#![warn(future_incompatible, rust_2018_idioms, single_use_lifetimes, unreachable_pub)] +#![warn(missing_docs)] +#![warn(clippy::all, clippy::default_trait_access)] #![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 new file mode 100644 index 0000000..24cd303 --- /dev/null +++ b/src/lib.rs.orig @@ -0,0 +1,282 @@ +//! A crate for safe and ergonomic [pin-projection]. +//! +//! # Examples +//! +//! [`#[pin_project]`][`pin_project`] attribute creates projection types +//! covering all the fields of struct or enum. +//! +//! ```rust +//! use std::pin::Pin; +//! +//! use pin_project::pin_project; +//! +//! #[pin_project] +//! struct Struct<T, U> { +//! #[pin] +//! pinned: T, +//! unpinned: U, +//! } +//! +//! impl<T, U> Struct<T, U> { +//! fn method(self: Pin<&mut Self>) { +//! let this = self.project(); +//! let _: Pin<&mut T> = this.pinned; // Pinned reference to the field +//! let _: &mut U = this.unpinned; // Normal reference to the field +//! } +//! } +//! ``` +//! +//! [*code like this will be generated*][struct-default-expanded] +//! +//! To use `#[pin_project]` on enums, you need to name the projection type +//! returned from the method. +//! +//! ```rust +//! use std::pin::Pin; +//! +//! use pin_project::pin_project; +//! +//! #[pin_project(project = EnumProj)] +//! enum Enum<T, U> { +//! Pinned(#[pin] T), +//! Unpinned(U), +//! } +//! +//! impl<T, U> Enum<T, U> { +//! fn method(self: Pin<&mut Self>) { +//! match self.project() { +//! EnumProj::Pinned(x) => { +//! let _: Pin<&mut T> = x; +//! } +//! EnumProj::Unpinned(y) => { +//! let _: &mut U = y; +//! } +//! } +//! } +//! } +//! ``` +//! +//! [*code like this will be generated*][enum-default-expanded] +//! +//! See [`#[pin_project]`][`pin_project`] attribute for more details, and +//! see [examples] directory for more examples and generated code. +//! +//! [examples]: https://github.com/taiki-e/pin-project/blob/HEAD/examples/README.md +//! [enum-default-expanded]: https://github.com/taiki-e/pin-project/blob/HEAD/examples/enum-default-expanded.rs +//! [pin-projection]: core::pin#projections-and-structural-pinning +//! [struct-default-expanded]: https://github.com/taiki-e/pin-project/blob/HEAD/examples/struct-default-expanded.rs + +#![no_std] +#![doc(test( + no_crate_inject, + 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)] +#![allow(clippy::needless_doctest_main)] + +#[doc(inline)] +pub use pin_project_internal::pin_project; +#[doc(inline)] +pub use pin_project_internal::pinned_drop; + +/// A trait used for custom implementations of [`Unpin`]. +/// +/// This trait is used in conjunction with the `UnsafeUnpin` argument to +/// the [`#[pin_project]`][macro@pin_project] attribute. +/// +/// The Rust [`Unpin`] trait is safe to implement - by itself, +/// implementing it cannot lead to [undefined behavior][undefined-behavior]. +/// Undefined behavior can only occur when other unsafe code is used. +/// +/// It turns out that using pin projections, which requires unsafe code, +/// imposes additional requirements on an [`Unpin`] impl. Normally, all of this +/// unsafety is contained within this crate, ensuring that it's impossible for +/// you to violate any of the guarantees required by pin projection. +/// +/// However, things change if you want to provide a custom [`Unpin`] impl +/// for your `#[pin_project]` type. As stated in [the Rust +/// documentation][pin-projection], you must be sure to only implement [`Unpin`] +/// when all of your `#[pin]` fields (i.e. structurally pinned fields) are also +/// [`Unpin`]. +/// +/// To help highlight this unsafety, the `UnsafeUnpin` trait is provided. +/// Implementing this trait is logically equivalent to implementing [`Unpin`] - +/// this crate will generate an [`Unpin`] impl for your type that 'forwards' to +/// your `UnsafeUnpin` impl. However, this trait is `unsafe` - since your type +/// uses structural pinning (otherwise, you wouldn't be using this crate!), +/// you must be sure that your `UnsafeUnpin` impls follows all of +/// the requirements for an [`Unpin`] impl of a structurally-pinned type. +/// +/// Note that if you specify `#[pin_project(UnsafeUnpin)]`, but do *not* +/// provide an impl of `UnsafeUnpin`, your type will never implement [`Unpin`]. +/// This is effectively the same thing as adding a [`PhantomPinned`] to your +/// type. +/// +/// Since this trait is `unsafe`, impls of it will be detected by the +/// `unsafe_code` lint, and by tools like [`cargo geiger`][cargo-geiger]. +/// +/// # Examples +/// +/// An `UnsafeUnpin` impl which, in addition to requiring that structurally +/// pinned fields be [`Unpin`], imposes an additional requirement: +/// +/// ```rust +/// use pin_project::{pin_project, UnsafeUnpin}; +/// +/// #[pin_project(UnsafeUnpin)] +/// struct Struct<K, V> { +/// #[pin] +/// field_1: K, +/// field_2: V, +/// } +/// +/// unsafe impl<K, V> UnsafeUnpin for Struct<K, V> where K: Unpin + Clone {} +/// ``` +/// +/// [`PhantomPinned`]: core::marker::PhantomPinned +/// [cargo-geiger]: https://github.com/rust-secure-code/cargo-geiger +/// [pin-projection]: core::pin#projections-and-structural-pinning +/// [undefined-behavior]: https://doc.rust-lang.org/reference/behavior-considered-undefined.html +pub unsafe trait UnsafeUnpin {} + +// Not public API. +#[doc(hidden)] +pub mod __private { + #[doc(hidden)] + pub use core::{ + marker::{PhantomData, PhantomPinned, Unpin}, + mem::ManuallyDrop, + ops::Drop, + pin::Pin, + ptr, + }; + + #[doc(hidden)] + pub use pin_project_internal::__PinProjectInternalDerive; + + use super::UnsafeUnpin; + + // An internal trait used for custom implementations of [`Drop`]. + // + // **Do not call or implement this trait directly.** + // + // # Why this trait is private and `#[pinned_drop]` attribute is needed? + // + // Implementing `PinnedDrop::drop` is safe, but calling it is not safe. + // This is because destructors can be called multiple times in safe code and + // [double dropping is unsound][rust-lang/rust#62360]. + // + // Ideally, it would be desirable to be able to forbid manual calls in + // the same way as [`Drop::drop`], but the library cannot do it. So, by using + // macros and replacing them with private traits, + // this crate prevent users from calling `PinnedDrop::drop` in safe code. + // + // This allows implementing [`Drop`] safely using `#[pinned_drop]`. + // Also by using the [`drop`] function just like dropping a type that directly + // implements [`Drop`], can drop safely a type that implements `PinnedDrop`. + // + // [rust-lang/rust#62360]: https://github.com/rust-lang/rust/pull/62360 + #[doc(hidden)] + pub trait PinnedDrop { + #[doc(hidden)] + unsafe fn drop(self: Pin<&mut Self>); + } + + // This is an internal helper struct used by `pin-project-internal`. + // This allows us to force an error if the user tries to provide + // a regular `Unpin` impl when they specify the `UnsafeUnpin` argument. + // This is why we need Wrapper: + // + // Supposed we have the following code: + // + // ```rust + // #[pin_project(UnsafeUnpin)] + // struct MyStruct<T> { + // #[pin] field: T + // } + // + // impl<T> Unpin for MyStruct<T> where MyStruct<T>: UnsafeUnpin {} // generated by pin-project-internal + // impl<T> Unpin for MyStruct<T> where T: Copy // written by the user + // ``` + // + // We want this code to be rejected - the user is completely bypassing + // `UnsafeUnpin`, and providing an unsound Unpin impl in safe code! + // + // Unfortunately, the Rust compiler will accept the above code. + // Because MyStruct is declared in the same crate as the user-provided impl, + // the compiler will notice that `MyStruct<T>: UnsafeUnpin` never holds. + // + // The solution is to introduce the `Wrapper` struct, which is defined + // in the `pin-project` crate. + // + // We now have code that looks like this: + // + // ```rust + // impl<T> Unpin for MyStruct<T> where Wrapper<MyStruct<T>>: UnsafeUnpin {} // generated by pin-project-internal + // impl<T> Unpin for MyStruct<T> where T: Copy // written by the user + // ``` + // + // We also have `unsafe impl<T> UnsafeUnpin for Wrapper<T> where T: UnsafeUnpin {}` + // in the `pin-project` crate. + // + // Now, our generated impl has a bound involving a type defined in another + // crate - Wrapper. This will cause rust to conservatively assume that + // `Wrapper<MyStruct<T>>: UnsafeUnpin` holds, in the interest of preserving + // forwards compatibility (in case such an impl is added for Wrapper<T> in + // a new version of the crate). + // + // This will cause rust to reject any other `Unpin` impls for MyStruct<T>, + // since it will assume that our generated impl could potentially apply in + // any situation. + // + // This achieves the desired effect - when the user writes + // `#[pin_project(UnsafeUnpin)]`, the user must either provide no impl of + // `UnsafeUnpin` (which is equivalent to making the type never implement + // Unpin), or provide an impl of `UnsafeUnpin`. It is impossible for them to + // provide an impl of `Unpin` + #[doc(hidden)] + pub struct Wrapper<'a, T: ?Sized>(PhantomData<&'a ()>, T); + + unsafe impl<T: ?Sized> UnsafeUnpin for Wrapper<'_, T> where T: UnsafeUnpin {} + + // This is an internal helper struct used by `pin-project-internal`. + // + // See https://github.com/taiki-e/pin-project/pull/53 for more details. + #[doc(hidden)] + pub struct AlwaysUnpin<'a, T>(PhantomData<&'a ()>, PhantomData<T>); + + impl<T> Unpin for AlwaysUnpin<'_, T> {} + + // This is an internal helper used to ensure a value is dropped. + #[doc(hidden)] + pub struct UnsafeDropInPlaceGuard<T: ?Sized>(pub *mut T); + + impl<T: ?Sized> Drop for UnsafeDropInPlaceGuard<T> { + fn drop(&mut self) { + unsafe { + ptr::drop_in_place(self.0); + } + } + } + + // This is an internal helper used to ensure a value is overwritten without + // its destructor being called. + #[doc(hidden)] + pub struct UnsafeOverwriteGuard<T> { + pub value: ManuallyDrop<T>, + pub target: *mut T, + } + + impl<T> Drop for UnsafeOverwriteGuard<T> { + fn drop(&mut self) { + unsafe { + ptr::write(self.target, ptr::read(&*self.value)); + } + } + } +} diff --git a/tests/compiletest.rs b/tests/compiletest.rs index c1c6be0..b06cb02 100644 --- a/tests/compiletest.rs +++ b/tests/compiletest.rs @@ -3,7 +3,7 @@ use std::env; -#[rustversion::attr(before(2021-07-19), ignore)] // Note: This date is commit-date and the day before the toolchain date. +#[rustversion::attr(before(2021-02-07), 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/expand/default/enum.expanded.rs b/tests/expand/default/enum.expanded.rs index 75ec2fe..e042f8c 100644 --- a/tests/expand/default/enum.expanded.rs +++ b/tests/expand/default/enum.expanded.rs @@ -17,9 +17,9 @@ enum Enum<T, U> { #[allow(clippy::unknown_clippy_lints)] #[allow(clippy::pattern_type_mismatch)] #[allow(clippy::redundant_pub_crate)] -#[allow(clippy::type_repetition_in_bounds)] #[allow(dead_code)] #[allow(clippy::mut_mut)] +#[allow(clippy::type_repetition_in_bounds)] enum EnumProj<'pin, T, U> where Enum<T, U>: 'pin, @@ -39,9 +39,9 @@ where #[allow(clippy::unknown_clippy_lints)] #[allow(clippy::pattern_type_mismatch)] #[allow(clippy::redundant_pub_crate)] -#[allow(clippy::type_repetition_in_bounds)] #[allow(dead_code)] #[allow(clippy::ref_option_ref)] +#[allow(clippy::type_repetition_in_bounds)] enum EnumProjRef<'pin, T, U> where Enum<T, U>: 'pin, @@ -61,9 +61,7 @@ where #[allow(clippy::unknown_clippy_lints)] #[allow(clippy::pattern_type_mismatch)] #[allow(clippy::redundant_pub_crate)] -#[allow(clippy::type_repetition_in_bounds)] #[allow(clippy::semicolon_if_nothing_returned)] -#[allow(clippy::use_self)] #[allow(clippy::used_underscore_binding)] const _: () = { impl<T, U> Enum<T, U> { diff --git a/tests/expand/default/struct.expanded.rs b/tests/expand/default/struct.expanded.rs index 794675a..2528ece 100644 --- a/tests/expand/default/struct.expanded.rs +++ b/tests/expand/default/struct.expanded.rs @@ -13,13 +13,20 @@ struct Struct<T, U> { #[allow(clippy::unknown_clippy_lints)] #[allow(clippy::pattern_type_mismatch)] #[allow(clippy::redundant_pub_crate)] -#[allow(clippy::type_repetition_in_bounds)] #[allow(clippy::semicolon_if_nothing_returned)] -#[allow(clippy::use_self)] #[allow(clippy::used_underscore_binding)] const _: () = { + #[allow(box_pointers)] + #[allow(deprecated)] + #[allow(explicit_outlives_requirements)] + #[allow(single_use_lifetimes)] + #[allow(unreachable_pub)] + #[allow(clippy::unknown_clippy_lints)] + #[allow(clippy::pattern_type_mismatch)] + #[allow(clippy::redundant_pub_crate)] #[allow(dead_code)] #[allow(clippy::mut_mut)] + #[allow(clippy::type_repetition_in_bounds)] struct __StructProjection<'pin, T, U> where Struct<T, U>: 'pin, @@ -27,8 +34,17 @@ const _: () = { pinned: ::pin_project::__private::Pin<&'pin mut (T)>, unpinned: &'pin mut (U), } + #[allow(box_pointers)] + #[allow(deprecated)] + #[allow(explicit_outlives_requirements)] + #[allow(single_use_lifetimes)] + #[allow(unreachable_pub)] + #[allow(clippy::unknown_clippy_lints)] + #[allow(clippy::pattern_type_mismatch)] + #[allow(clippy::redundant_pub_crate)] #[allow(dead_code)] #[allow(clippy::ref_option_ref)] + #[allow(clippy::type_repetition_in_bounds)] struct __StructProjectionRef<'pin, T, U> where Struct<T, U>: 'pin, @@ -61,7 +77,7 @@ const _: () = { } } } - #[forbid(unaligned_references, safe_packed_borrows)] + #[forbid(safe_packed_borrows)] fn __assert_not_repr_packed<T, U>(this: &Struct<T, U>) { let _ = &this.pinned; let _ = &this.unpinned; diff --git a/tests/expand/default/tuple_struct.expanded.rs b/tests/expand/default/tuple_struct.expanded.rs index 6a3dfbf..3e8e306 100644 --- a/tests/expand/default/tuple_struct.expanded.rs +++ b/tests/expand/default/tuple_struct.expanded.rs @@ -9,21 +9,37 @@ struct TupleStruct<T, U>(#[pin] T, U); #[allow(clippy::unknown_clippy_lints)] #[allow(clippy::pattern_type_mismatch)] #[allow(clippy::redundant_pub_crate)] -#[allow(clippy::type_repetition_in_bounds)] #[allow(clippy::semicolon_if_nothing_returned)] -#[allow(clippy::use_self)] #[allow(clippy::used_underscore_binding)] const _: () = { + #[allow(box_pointers)] + #[allow(deprecated)] + #[allow(explicit_outlives_requirements)] + #[allow(single_use_lifetimes)] + #[allow(unreachable_pub)] + #[allow(clippy::unknown_clippy_lints)] + #[allow(clippy::pattern_type_mismatch)] + #[allow(clippy::redundant_pub_crate)] #[allow(dead_code)] #[allow(clippy::mut_mut)] + #[allow(clippy::type_repetition_in_bounds)] struct __TupleStructProjection<'pin, T, U>( ::pin_project::__private::Pin<&'pin mut (T)>, &'pin mut (U), ) where TupleStruct<T, U>: 'pin; + #[allow(box_pointers)] + #[allow(deprecated)] + #[allow(explicit_outlives_requirements)] + #[allow(single_use_lifetimes)] + #[allow(unreachable_pub)] + #[allow(clippy::unknown_clippy_lints)] + #[allow(clippy::pattern_type_mismatch)] + #[allow(clippy::redundant_pub_crate)] #[allow(dead_code)] #[allow(clippy::ref_option_ref)] + #[allow(clippy::type_repetition_in_bounds)] struct __TupleStructProjectionRef<'pin, T, U>( ::pin_project::__private::Pin<&'pin (T)>, &'pin (U), @@ -49,7 +65,7 @@ const _: () = { } } } - #[forbid(unaligned_references, safe_packed_borrows)] + #[forbid(safe_packed_borrows)] fn __assert_not_repr_packed<T, U>(this: &TupleStruct<T, U>) { let _ = &this.0; let _ = &this.1; diff --git a/tests/expand/multifields/enum.expanded.rs b/tests/expand/multifields/enum.expanded.rs index 6ccbd9d..4c935d7 100644 --- a/tests/expand/multifields/enum.expanded.rs +++ b/tests/expand/multifields/enum.expanded.rs @@ -20,9 +20,9 @@ enum Enum<T, U> { #[allow(clippy::unknown_clippy_lints)] #[allow(clippy::pattern_type_mismatch)] #[allow(clippy::redundant_pub_crate)] -#[allow(clippy::type_repetition_in_bounds)] #[allow(dead_code)] #[allow(clippy::mut_mut)] +#[allow(clippy::type_repetition_in_bounds)] enum EnumProj<'pin, T, U> where Enum<T, U>: 'pin, @@ -49,9 +49,9 @@ where #[allow(clippy::unknown_clippy_lints)] #[allow(clippy::pattern_type_mismatch)] #[allow(clippy::redundant_pub_crate)] -#[allow(clippy::type_repetition_in_bounds)] #[allow(dead_code)] #[allow(clippy::ref_option_ref)] +#[allow(clippy::type_repetition_in_bounds)] enum EnumProjRef<'pin, T, U> where Enum<T, U>: 'pin, @@ -78,7 +78,6 @@ where #[allow(clippy::unknown_clippy_lints)] #[allow(clippy::pattern_type_mismatch)] #[allow(clippy::redundant_pub_crate)] -#[allow(clippy::type_repetition_in_bounds)] #[allow(dead_code)] #[allow(variant_size_differences)] #[allow(clippy::large_enum_variant)] @@ -105,9 +104,7 @@ enum EnumProjOwn<T, U> { #[allow(clippy::unknown_clippy_lints)] #[allow(clippy::pattern_type_mismatch)] #[allow(clippy::redundant_pub_crate)] -#[allow(clippy::type_repetition_in_bounds)] #[allow(clippy::semicolon_if_nothing_returned)] -#[allow(clippy::use_self)] #[allow(clippy::used_underscore_binding)] const _: () = { impl<T, U> Enum<T, U> { diff --git a/tests/expand/multifields/struct.expanded.rs b/tests/expand/multifields/struct.expanded.rs index 7e3505b..17dab6a 100644 --- a/tests/expand/multifields/struct.expanded.rs +++ b/tests/expand/multifields/struct.expanded.rs @@ -16,13 +16,20 @@ struct Struct<T, U> { #[allow(clippy::unknown_clippy_lints)] #[allow(clippy::pattern_type_mismatch)] #[allow(clippy::redundant_pub_crate)] -#[allow(clippy::type_repetition_in_bounds)] #[allow(clippy::semicolon_if_nothing_returned)] -#[allow(clippy::use_self)] #[allow(clippy::used_underscore_binding)] const _: () = { + #[allow(box_pointers)] + #[allow(deprecated)] + #[allow(explicit_outlives_requirements)] + #[allow(single_use_lifetimes)] + #[allow(unreachable_pub)] + #[allow(clippy::unknown_clippy_lints)] + #[allow(clippy::pattern_type_mismatch)] + #[allow(clippy::redundant_pub_crate)] #[allow(dead_code)] #[allow(clippy::mut_mut)] + #[allow(clippy::type_repetition_in_bounds)] struct __StructProjection<'pin, T, U> where Struct<T, U>: 'pin, @@ -32,8 +39,17 @@ const _: () = { unpinned1: &'pin mut (U), unpinned2: &'pin mut (U), } + #[allow(box_pointers)] + #[allow(deprecated)] + #[allow(explicit_outlives_requirements)] + #[allow(single_use_lifetimes)] + #[allow(unreachable_pub)] + #[allow(clippy::unknown_clippy_lints)] + #[allow(clippy::pattern_type_mismatch)] + #[allow(clippy::redundant_pub_crate)] #[allow(dead_code)] #[allow(clippy::ref_option_ref)] + #[allow(clippy::type_repetition_in_bounds)] struct __StructProjectionRef<'pin, T, U> where Struct<T, U>: 'pin, @@ -43,6 +59,14 @@ const _: () = { unpinned1: &'pin (U), unpinned2: &'pin (U), } + #[allow(box_pointers)] + #[allow(deprecated)] + #[allow(explicit_outlives_requirements)] + #[allow(single_use_lifetimes)] + #[allow(unreachable_pub)] + #[allow(clippy::unknown_clippy_lints)] + #[allow(clippy::pattern_type_mismatch)] + #[allow(clippy::redundant_pub_crate)] #[allow(dead_code)] struct __StructProjectionOwned<T, U> { pinned1: ::pin_project::__private::PhantomData<T>, @@ -118,7 +142,7 @@ const _: () = { } } } - #[forbid(unaligned_references, safe_packed_borrows)] + #[forbid(safe_packed_borrows)] fn __assert_not_repr_packed<T, U>(this: &Struct<T, U>) { let _ = &this.pinned1; let _ = &this.pinned2; diff --git a/tests/expand/multifields/tuple_struct.expanded.rs b/tests/expand/multifields/tuple_struct.expanded.rs index 7b47899..28e7fd8 100644 --- a/tests/expand/multifields/tuple_struct.expanded.rs +++ b/tests/expand/multifields/tuple_struct.expanded.rs @@ -9,13 +9,20 @@ struct TupleStruct<T, U>(#[pin] T, #[pin] T, U, U); #[allow(clippy::unknown_clippy_lints)] #[allow(clippy::pattern_type_mismatch)] #[allow(clippy::redundant_pub_crate)] -#[allow(clippy::type_repetition_in_bounds)] #[allow(clippy::semicolon_if_nothing_returned)] -#[allow(clippy::use_self)] #[allow(clippy::used_underscore_binding)] const _: () = { + #[allow(box_pointers)] + #[allow(deprecated)] + #[allow(explicit_outlives_requirements)] + #[allow(single_use_lifetimes)] + #[allow(unreachable_pub)] + #[allow(clippy::unknown_clippy_lints)] + #[allow(clippy::pattern_type_mismatch)] + #[allow(clippy::redundant_pub_crate)] #[allow(dead_code)] #[allow(clippy::mut_mut)] + #[allow(clippy::type_repetition_in_bounds)] struct __TupleStructProjection<'pin, T, U>( ::pin_project::__private::Pin<&'pin mut (T)>, ::pin_project::__private::Pin<&'pin mut (T)>, @@ -24,8 +31,17 @@ const _: () = { ) where TupleStruct<T, U>: 'pin; + #[allow(box_pointers)] + #[allow(deprecated)] + #[allow(explicit_outlives_requirements)] + #[allow(single_use_lifetimes)] + #[allow(unreachable_pub)] + #[allow(clippy::unknown_clippy_lints)] + #[allow(clippy::pattern_type_mismatch)] + #[allow(clippy::redundant_pub_crate)] #[allow(dead_code)] #[allow(clippy::ref_option_ref)] + #[allow(clippy::type_repetition_in_bounds)] struct __TupleStructProjectionRef<'pin, T, U>( ::pin_project::__private::Pin<&'pin (T)>, ::pin_project::__private::Pin<&'pin (T)>, @@ -34,6 +50,14 @@ const _: () = { ) where TupleStruct<T, U>: 'pin; + #[allow(box_pointers)] + #[allow(deprecated)] + #[allow(explicit_outlives_requirements)] + #[allow(single_use_lifetimes)] + #[allow(unreachable_pub)] + #[allow(clippy::unknown_clippy_lints)] + #[allow(clippy::pattern_type_mismatch)] + #[allow(clippy::redundant_pub_crate)] #[allow(dead_code)] struct __TupleStructProjectionOwned<T, U>( ::pin_project::__private::PhantomData<T>, @@ -94,7 +118,7 @@ const _: () = { } } } - #[forbid(unaligned_references, safe_packed_borrows)] + #[forbid(safe_packed_borrows)] fn __assert_not_repr_packed<T, U>(this: &TupleStruct<T, U>) { let _ = &this.0; let _ = &this.1; diff --git a/tests/expand/naming/enum-all.expanded.rs b/tests/expand/naming/enum-all.expanded.rs index 21c1c59..561bb89 100644 --- a/tests/expand/naming/enum-all.expanded.rs +++ b/tests/expand/naming/enum-all.expanded.rs @@ -17,9 +17,9 @@ enum Enum<T, U> { #[allow(clippy::unknown_clippy_lints)] #[allow(clippy::pattern_type_mismatch)] #[allow(clippy::redundant_pub_crate)] -#[allow(clippy::type_repetition_in_bounds)] #[allow(dead_code)] #[allow(clippy::mut_mut)] +#[allow(clippy::type_repetition_in_bounds)] enum Proj<'pin, T, U> where Enum<T, U>: 'pin, @@ -39,9 +39,9 @@ where #[allow(clippy::unknown_clippy_lints)] #[allow(clippy::pattern_type_mismatch)] #[allow(clippy::redundant_pub_crate)] -#[allow(clippy::type_repetition_in_bounds)] #[allow(dead_code)] #[allow(clippy::ref_option_ref)] +#[allow(clippy::type_repetition_in_bounds)] enum ProjRef<'pin, T, U> where Enum<T, U>: 'pin, @@ -61,7 +61,6 @@ where #[allow(clippy::unknown_clippy_lints)] #[allow(clippy::pattern_type_mismatch)] #[allow(clippy::redundant_pub_crate)] -#[allow(clippy::type_repetition_in_bounds)] #[allow(dead_code)] #[allow(variant_size_differences)] #[allow(clippy::large_enum_variant)] @@ -81,9 +80,7 @@ enum ProjOwn<T, U> { #[allow(clippy::unknown_clippy_lints)] #[allow(clippy::pattern_type_mismatch)] #[allow(clippy::redundant_pub_crate)] -#[allow(clippy::type_repetition_in_bounds)] #[allow(clippy::semicolon_if_nothing_returned)] -#[allow(clippy::use_self)] #[allow(clippy::used_underscore_binding)] const _: () = { impl<T, U> Enum<T, U> { diff --git a/tests/expand/naming/enum-mut.expanded.rs b/tests/expand/naming/enum-mut.expanded.rs index 7324372..3489c6e 100644 --- a/tests/expand/naming/enum-mut.expanded.rs +++ b/tests/expand/naming/enum-mut.expanded.rs @@ -17,9 +17,9 @@ enum Enum<T, U> { #[allow(clippy::unknown_clippy_lints)] #[allow(clippy::pattern_type_mismatch)] #[allow(clippy::redundant_pub_crate)] -#[allow(clippy::type_repetition_in_bounds)] #[allow(dead_code)] #[allow(clippy::mut_mut)] +#[allow(clippy::type_repetition_in_bounds)] enum Proj<'pin, T, U> where Enum<T, U>: 'pin, @@ -39,9 +39,7 @@ where #[allow(clippy::unknown_clippy_lints)] #[allow(clippy::pattern_type_mismatch)] #[allow(clippy::redundant_pub_crate)] -#[allow(clippy::type_repetition_in_bounds)] #[allow(clippy::semicolon_if_nothing_returned)] -#[allow(clippy::use_self)] #[allow(clippy::used_underscore_binding)] const _: () = { impl<T, U> Enum<T, U> { diff --git a/tests/expand/naming/enum-none.expanded.rs b/tests/expand/naming/enum-none.expanded.rs index 3410001..a33491e 100644 --- a/tests/expand/naming/enum-none.expanded.rs +++ b/tests/expand/naming/enum-none.expanded.rs @@ -17,9 +17,7 @@ enum Enum<T, U> { #[allow(clippy::unknown_clippy_lints)] #[allow(clippy::pattern_type_mismatch)] #[allow(clippy::redundant_pub_crate)] -#[allow(clippy::type_repetition_in_bounds)] #[allow(clippy::semicolon_if_nothing_returned)] -#[allow(clippy::use_self)] #[allow(clippy::used_underscore_binding)] const _: () = { impl<T, U> Enum<T, U> {} diff --git a/tests/expand/naming/enum-own.expanded.rs b/tests/expand/naming/enum-own.expanded.rs index a63a874..6ca558b 100644 --- a/tests/expand/naming/enum-own.expanded.rs +++ b/tests/expand/naming/enum-own.expanded.rs @@ -17,7 +17,6 @@ enum Enum<T, U> { #[allow(clippy::unknown_clippy_lints)] #[allow(clippy::pattern_type_mismatch)] #[allow(clippy::redundant_pub_crate)] -#[allow(clippy::type_repetition_in_bounds)] #[allow(dead_code)] #[allow(variant_size_differences)] #[allow(clippy::large_enum_variant)] @@ -37,9 +36,7 @@ enum ProjOwn<T, U> { #[allow(clippy::unknown_clippy_lints)] #[allow(clippy::pattern_type_mismatch)] #[allow(clippy::redundant_pub_crate)] -#[allow(clippy::type_repetition_in_bounds)] #[allow(clippy::semicolon_if_nothing_returned)] -#[allow(clippy::use_self)] #[allow(clippy::used_underscore_binding)] const _: () = { impl<T, U> Enum<T, U> { diff --git a/tests/expand/naming/enum-ref.expanded.rs b/tests/expand/naming/enum-ref.expanded.rs index 6197557..0dcb829 100644 --- a/tests/expand/naming/enum-ref.expanded.rs +++ b/tests/expand/naming/enum-ref.expanded.rs @@ -17,9 +17,9 @@ enum Enum<T, U> { #[allow(clippy::unknown_clippy_lints)] #[allow(clippy::pattern_type_mismatch)] #[allow(clippy::redundant_pub_crate)] -#[allow(clippy::type_repetition_in_bounds)] #[allow(dead_code)] #[allow(clippy::ref_option_ref)] +#[allow(clippy::type_repetition_in_bounds)] enum ProjRef<'pin, T, U> where Enum<T, U>: 'pin, @@ -39,9 +39,7 @@ where #[allow(clippy::unknown_clippy_lints)] #[allow(clippy::pattern_type_mismatch)] #[allow(clippy::redundant_pub_crate)] -#[allow(clippy::type_repetition_in_bounds)] #[allow(clippy::semicolon_if_nothing_returned)] -#[allow(clippy::use_self)] #[allow(clippy::used_underscore_binding)] const _: () = { impl<T, U> Enum<T, U> { diff --git a/tests/expand/naming/struct-all.expanded.rs b/tests/expand/naming/struct-all.expanded.rs index 54b63f5..6506928 100644 --- a/tests/expand/naming/struct-all.expanded.rs +++ b/tests/expand/naming/struct-all.expanded.rs @@ -13,9 +13,9 @@ struct Struct<T, U> { #[allow(clippy::unknown_clippy_lints)] #[allow(clippy::pattern_type_mismatch)] #[allow(clippy::redundant_pub_crate)] -#[allow(clippy::type_repetition_in_bounds)] #[allow(dead_code)] #[allow(clippy::mut_mut)] +#[allow(clippy::type_repetition_in_bounds)] struct Proj<'pin, T, U> where Struct<T, U>: 'pin, @@ -31,9 +31,9 @@ where #[allow(clippy::unknown_clippy_lints)] #[allow(clippy::pattern_type_mismatch)] #[allow(clippy::redundant_pub_crate)] -#[allow(clippy::type_repetition_in_bounds)] #[allow(dead_code)] #[allow(clippy::ref_option_ref)] +#[allow(clippy::type_repetition_in_bounds)] struct ProjRef<'pin, T, U> where Struct<T, U>: 'pin, @@ -49,7 +49,6 @@ where #[allow(clippy::unknown_clippy_lints)] #[allow(clippy::pattern_type_mismatch)] #[allow(clippy::redundant_pub_crate)] -#[allow(clippy::type_repetition_in_bounds)] #[allow(dead_code)] struct ProjOwn<T, U> { pinned: ::pin_project::__private::PhantomData<T>, @@ -63,9 +62,7 @@ struct ProjOwn<T, U> { #[allow(clippy::unknown_clippy_lints)] #[allow(clippy::pattern_type_mismatch)] #[allow(clippy::redundant_pub_crate)] -#[allow(clippy::type_repetition_in_bounds)] #[allow(clippy::semicolon_if_nothing_returned)] -#[allow(clippy::use_self)] #[allow(clippy::used_underscore_binding)] const _: () = { impl<T, U> Struct<T, U> { @@ -112,7 +109,7 @@ const _: () = { } } } - #[forbid(unaligned_references, safe_packed_borrows)] + #[forbid(safe_packed_borrows)] fn __assert_not_repr_packed<T, U>(this: &Struct<T, U>) { let _ = &this.pinned; let _ = &this.unpinned; diff --git a/tests/expand/naming/struct-mut.expanded.rs b/tests/expand/naming/struct-mut.expanded.rs index ee641d6..53c5212 100644 --- a/tests/expand/naming/struct-mut.expanded.rs +++ b/tests/expand/naming/struct-mut.expanded.rs @@ -13,9 +13,9 @@ struct Struct<T, U> { #[allow(clippy::unknown_clippy_lints)] #[allow(clippy::pattern_type_mismatch)] #[allow(clippy::redundant_pub_crate)] -#[allow(clippy::type_repetition_in_bounds)] #[allow(dead_code)] #[allow(clippy::mut_mut)] +#[allow(clippy::type_repetition_in_bounds)] struct Proj<'pin, T, U> where Struct<T, U>: 'pin, @@ -31,13 +31,20 @@ where #[allow(clippy::unknown_clippy_lints)] #[allow(clippy::pattern_type_mismatch)] #[allow(clippy::redundant_pub_crate)] -#[allow(clippy::type_repetition_in_bounds)] #[allow(clippy::semicolon_if_nothing_returned)] -#[allow(clippy::use_self)] #[allow(clippy::used_underscore_binding)] const _: () = { + #[allow(box_pointers)] + #[allow(deprecated)] + #[allow(explicit_outlives_requirements)] + #[allow(single_use_lifetimes)] + #[allow(unreachable_pub)] + #[allow(clippy::unknown_clippy_lints)] + #[allow(clippy::pattern_type_mismatch)] + #[allow(clippy::redundant_pub_crate)] #[allow(dead_code)] #[allow(clippy::ref_option_ref)] + #[allow(clippy::type_repetition_in_bounds)] struct __StructProjectionRef<'pin, T, U> where Struct<T, U>: 'pin, @@ -68,7 +75,7 @@ const _: () = { } } } - #[forbid(unaligned_references, safe_packed_borrows)] + #[forbid(safe_packed_borrows)] fn __assert_not_repr_packed<T, U>(this: &Struct<T, U>) { let _ = &this.pinned; let _ = &this.unpinned; diff --git a/tests/expand/naming/struct-none.expanded.rs b/tests/expand/naming/struct-none.expanded.rs index 794675a..2528ece 100644 --- a/tests/expand/naming/struct-none.expanded.rs +++ b/tests/expand/naming/struct-none.expanded.rs @@ -13,13 +13,20 @@ struct Struct<T, U> { #[allow(clippy::unknown_clippy_lints)] #[allow(clippy::pattern_type_mismatch)] #[allow(clippy::redundant_pub_crate)] -#[allow(clippy::type_repetition_in_bounds)] #[allow(clippy::semicolon_if_nothing_returned)] -#[allow(clippy::use_self)] #[allow(clippy::used_underscore_binding)] const _: () = { + #[allow(box_pointers)] + #[allow(deprecated)] + #[allow(explicit_outlives_requirements)] + #[allow(single_use_lifetimes)] + #[allow(unreachable_pub)] + #[allow(clippy::unknown_clippy_lints)] + #[allow(clippy::pattern_type_mismatch)] + #[allow(clippy::redundant_pub_crate)] #[allow(dead_code)] #[allow(clippy::mut_mut)] + #[allow(clippy::type_repetition_in_bounds)] struct __StructProjection<'pin, T, U> where Struct<T, U>: 'pin, @@ -27,8 +34,17 @@ const _: () = { pinned: ::pin_project::__private::Pin<&'pin mut (T)>, unpinned: &'pin mut (U), } + #[allow(box_pointers)] + #[allow(deprecated)] + #[allow(explicit_outlives_requirements)] + #[allow(single_use_lifetimes)] + #[allow(unreachable_pub)] + #[allow(clippy::unknown_clippy_lints)] + #[allow(clippy::pattern_type_mismatch)] + #[allow(clippy::redundant_pub_crate)] #[allow(dead_code)] #[allow(clippy::ref_option_ref)] + #[allow(clippy::type_repetition_in_bounds)] struct __StructProjectionRef<'pin, T, U> where Struct<T, U>: 'pin, @@ -61,7 +77,7 @@ const _: () = { } } } - #[forbid(unaligned_references, safe_packed_borrows)] + #[forbid(safe_packed_borrows)] fn __assert_not_repr_packed<T, U>(this: &Struct<T, U>) { let _ = &this.pinned; let _ = &this.unpinned; diff --git a/tests/expand/naming/struct-own.expanded.rs b/tests/expand/naming/struct-own.expanded.rs index 2853838..0c1fc76 100644 --- a/tests/expand/naming/struct-own.expanded.rs +++ b/tests/expand/naming/struct-own.expanded.rs @@ -13,7 +13,6 @@ struct Struct<T, U> { #[allow(clippy::unknown_clippy_lints)] #[allow(clippy::pattern_type_mismatch)] #[allow(clippy::redundant_pub_crate)] -#[allow(clippy::type_repetition_in_bounds)] #[allow(dead_code)] struct ProjOwn<T, U> { pinned: ::pin_project::__private::PhantomData<T>, @@ -27,13 +26,20 @@ struct ProjOwn<T, U> { #[allow(clippy::unknown_clippy_lints)] #[allow(clippy::pattern_type_mismatch)] #[allow(clippy::redundant_pub_crate)] -#[allow(clippy::type_repetition_in_bounds)] #[allow(clippy::semicolon_if_nothing_returned)] -#[allow(clippy::use_self)] #[allow(clippy::used_underscore_binding)] const _: () = { + #[allow(box_pointers)] + #[allow(deprecated)] + #[allow(explicit_outlives_requirements)] + #[allow(single_use_lifetimes)] + #[allow(unreachable_pub)] + #[allow(clippy::unknown_clippy_lints)] + #[allow(clippy::pattern_type_mismatch)] + #[allow(clippy::redundant_pub_crate)] #[allow(dead_code)] #[allow(clippy::mut_mut)] + #[allow(clippy::type_repetition_in_bounds)] struct __StructProjection<'pin, T, U> where Struct<T, U>: 'pin, @@ -41,8 +47,17 @@ const _: () = { pinned: ::pin_project::__private::Pin<&'pin mut (T)>, unpinned: &'pin mut (U), } + #[allow(box_pointers)] + #[allow(deprecated)] + #[allow(explicit_outlives_requirements)] + #[allow(single_use_lifetimes)] + #[allow(unreachable_pub)] + #[allow(clippy::unknown_clippy_lints)] + #[allow(clippy::pattern_type_mismatch)] + #[allow(clippy::redundant_pub_crate)] #[allow(dead_code)] #[allow(clippy::ref_option_ref)] + #[allow(clippy::type_repetition_in_bounds)] struct __StructProjectionRef<'pin, T, U> where Struct<T, U>: 'pin, @@ -96,7 +111,7 @@ const _: () = { } } } - #[forbid(unaligned_references, safe_packed_borrows)] + #[forbid(safe_packed_borrows)] fn __assert_not_repr_packed<T, U>(this: &Struct<T, U>) { let _ = &this.pinned; let _ = &this.unpinned; diff --git a/tests/expand/naming/struct-ref.expanded.rs b/tests/expand/naming/struct-ref.expanded.rs index baee324..3f52ac5 100644 --- a/tests/expand/naming/struct-ref.expanded.rs +++ b/tests/expand/naming/struct-ref.expanded.rs @@ -13,9 +13,9 @@ struct Struct<T, U> { #[allow(clippy::unknown_clippy_lints)] #[allow(clippy::pattern_type_mismatch)] #[allow(clippy::redundant_pub_crate)] -#[allow(clippy::type_repetition_in_bounds)] #[allow(dead_code)] #[allow(clippy::ref_option_ref)] +#[allow(clippy::type_repetition_in_bounds)] struct ProjRef<'pin, T, U> where Struct<T, U>: 'pin, @@ -31,13 +31,20 @@ where #[allow(clippy::unknown_clippy_lints)] #[allow(clippy::pattern_type_mismatch)] #[allow(clippy::redundant_pub_crate)] -#[allow(clippy::type_repetition_in_bounds)] #[allow(clippy::semicolon_if_nothing_returned)] -#[allow(clippy::use_self)] #[allow(clippy::used_underscore_binding)] const _: () = { + #[allow(box_pointers)] + #[allow(deprecated)] + #[allow(explicit_outlives_requirements)] + #[allow(single_use_lifetimes)] + #[allow(unreachable_pub)] + #[allow(clippy::unknown_clippy_lints)] + #[allow(clippy::pattern_type_mismatch)] + #[allow(clippy::redundant_pub_crate)] #[allow(dead_code)] #[allow(clippy::mut_mut)] + #[allow(clippy::type_repetition_in_bounds)] struct __StructProjection<'pin, T, U> where Struct<T, U>: 'pin, @@ -70,7 +77,7 @@ const _: () = { } } } - #[forbid(unaligned_references, safe_packed_borrows)] + #[forbid(safe_packed_borrows)] fn __assert_not_repr_packed<T, U>(this: &Struct<T, U>) { let _ = &this.pinned; let _ = &this.unpinned; diff --git a/tests/expand/naming/tuple_struct-all.expanded.rs b/tests/expand/naming/tuple_struct-all.expanded.rs index 125d483..325b9db 100644 --- a/tests/expand/naming/tuple_struct-all.expanded.rs +++ b/tests/expand/naming/tuple_struct-all.expanded.rs @@ -9,9 +9,9 @@ struct TupleStruct<T, U>(#[pin] T, U); #[allow(clippy::unknown_clippy_lints)] #[allow(clippy::pattern_type_mismatch)] #[allow(clippy::redundant_pub_crate)] -#[allow(clippy::type_repetition_in_bounds)] #[allow(dead_code)] #[allow(clippy::mut_mut)] +#[allow(clippy::type_repetition_in_bounds)] struct Proj<'pin, T, U>(::pin_project::__private::Pin<&'pin mut (T)>, &'pin mut (U)) where TupleStruct<T, U>: 'pin; @@ -23,9 +23,9 @@ where #[allow(clippy::unknown_clippy_lints)] #[allow(clippy::pattern_type_mismatch)] #[allow(clippy::redundant_pub_crate)] -#[allow(clippy::type_repetition_in_bounds)] #[allow(dead_code)] #[allow(clippy::ref_option_ref)] +#[allow(clippy::type_repetition_in_bounds)] struct ProjRef<'pin, T, U>(::pin_project::__private::Pin<&'pin (T)>, &'pin (U)) where TupleStruct<T, U>: 'pin; @@ -37,7 +37,6 @@ where #[allow(clippy::unknown_clippy_lints)] #[allow(clippy::pattern_type_mismatch)] #[allow(clippy::redundant_pub_crate)] -#[allow(clippy::type_repetition_in_bounds)] #[allow(dead_code)] struct ProjOwn<T, U>(::pin_project::__private::PhantomData<T>, U); #[allow(box_pointers)] @@ -48,9 +47,7 @@ struct ProjOwn<T, U>(::pin_project::__private::PhantomData<T>, U); #[allow(clippy::unknown_clippy_lints)] #[allow(clippy::pattern_type_mismatch)] #[allow(clippy::redundant_pub_crate)] -#[allow(clippy::type_repetition_in_bounds)] #[allow(clippy::semicolon_if_nothing_returned)] -#[allow(clippy::use_self)] #[allow(clippy::used_underscore_binding)] const _: () = { impl<T, U> TupleStruct<T, U> { @@ -91,7 +88,7 @@ const _: () = { } } } - #[forbid(unaligned_references, safe_packed_borrows)] + #[forbid(safe_packed_borrows)] fn __assert_not_repr_packed<T, U>(this: &TupleStruct<T, U>) { let _ = &this.0; let _ = &this.1; diff --git a/tests/expand/naming/tuple_struct-mut.expanded.rs b/tests/expand/naming/tuple_struct-mut.expanded.rs index f7daaff..8cbb11f 100644 --- a/tests/expand/naming/tuple_struct-mut.expanded.rs +++ b/tests/expand/naming/tuple_struct-mut.expanded.rs @@ -9,9 +9,9 @@ struct TupleStruct<T, U>(#[pin] T, U); #[allow(clippy::unknown_clippy_lints)] #[allow(clippy::pattern_type_mismatch)] #[allow(clippy::redundant_pub_crate)] -#[allow(clippy::type_repetition_in_bounds)] #[allow(dead_code)] #[allow(clippy::mut_mut)] +#[allow(clippy::type_repetition_in_bounds)] struct Proj<'pin, T, U>(::pin_project::__private::Pin<&'pin mut (T)>, &'pin mut (U)) where TupleStruct<T, U>: 'pin; @@ -23,13 +23,20 @@ where #[allow(clippy::unknown_clippy_lints)] #[allow(clippy::pattern_type_mismatch)] #[allow(clippy::redundant_pub_crate)] -#[allow(clippy::type_repetition_in_bounds)] #[allow(clippy::semicolon_if_nothing_returned)] -#[allow(clippy::use_self)] #[allow(clippy::used_underscore_binding)] const _: () = { + #[allow(box_pointers)] + #[allow(deprecated)] + #[allow(explicit_outlives_requirements)] + #[allow(single_use_lifetimes)] + #[allow(unreachable_pub)] + #[allow(clippy::unknown_clippy_lints)] + #[allow(clippy::pattern_type_mismatch)] + #[allow(clippy::redundant_pub_crate)] #[allow(dead_code)] #[allow(clippy::ref_option_ref)] + #[allow(clippy::type_repetition_in_bounds)] struct __TupleStructProjectionRef<'pin, T, U>( ::pin_project::__private::Pin<&'pin (T)>, &'pin (U), @@ -53,7 +60,7 @@ const _: () = { } } } - #[forbid(unaligned_references, safe_packed_borrows)] + #[forbid(safe_packed_borrows)] fn __assert_not_repr_packed<T, U>(this: &TupleStruct<T, U>) { let _ = &this.0; let _ = &this.1; diff --git a/tests/expand/naming/tuple_struct-none.expanded.rs b/tests/expand/naming/tuple_struct-none.expanded.rs index 6a3dfbf..3e8e306 100644 --- a/tests/expand/naming/tuple_struct-none.expanded.rs +++ b/tests/expand/naming/tuple_struct-none.expanded.rs @@ -9,21 +9,37 @@ struct TupleStruct<T, U>(#[pin] T, U); #[allow(clippy::unknown_clippy_lints)] #[allow(clippy::pattern_type_mismatch)] #[allow(clippy::redundant_pub_crate)] -#[allow(clippy::type_repetition_in_bounds)] #[allow(clippy::semicolon_if_nothing_returned)] -#[allow(clippy::use_self)] #[allow(clippy::used_underscore_binding)] const _: () = { + #[allow(box_pointers)] + #[allow(deprecated)] + #[allow(explicit_outlives_requirements)] + #[allow(single_use_lifetimes)] + #[allow(unreachable_pub)] + #[allow(clippy::unknown_clippy_lints)] + #[allow(clippy::pattern_type_mismatch)] + #[allow(clippy::redundant_pub_crate)] #[allow(dead_code)] #[allow(clippy::mut_mut)] + #[allow(clippy::type_repetition_in_bounds)] struct __TupleStructProjection<'pin, T, U>( ::pin_project::__private::Pin<&'pin mut (T)>, &'pin mut (U), ) where TupleStruct<T, U>: 'pin; + #[allow(box_pointers)] + #[allow(deprecated)] + #[allow(explicit_outlives_requirements)] + #[allow(single_use_lifetimes)] + #[allow(unreachable_pub)] + #[allow(clippy::unknown_clippy_lints)] + #[allow(clippy::pattern_type_mismatch)] + #[allow(clippy::redundant_pub_crate)] #[allow(dead_code)] #[allow(clippy::ref_option_ref)] + #[allow(clippy::type_repetition_in_bounds)] struct __TupleStructProjectionRef<'pin, T, U>( ::pin_project::__private::Pin<&'pin (T)>, &'pin (U), @@ -49,7 +65,7 @@ const _: () = { } } } - #[forbid(unaligned_references, safe_packed_borrows)] + #[forbid(safe_packed_borrows)] fn __assert_not_repr_packed<T, U>(this: &TupleStruct<T, U>) { let _ = &this.0; let _ = &this.1; diff --git a/tests/expand/naming/tuple_struct-own.expanded.rs b/tests/expand/naming/tuple_struct-own.expanded.rs index 5f18045..84bc14b 100644 --- a/tests/expand/naming/tuple_struct-own.expanded.rs +++ b/tests/expand/naming/tuple_struct-own.expanded.rs @@ -9,7 +9,6 @@ struct TupleStruct<T, U>(#[pin] T, U); #[allow(clippy::unknown_clippy_lints)] #[allow(clippy::pattern_type_mismatch)] #[allow(clippy::redundant_pub_crate)] -#[allow(clippy::type_repetition_in_bounds)] #[allow(dead_code)] struct ProjOwn<T, U>(::pin_project::__private::PhantomData<T>, U); #[allow(box_pointers)] @@ -20,21 +19,37 @@ struct ProjOwn<T, U>(::pin_project::__private::PhantomData<T>, U); #[allow(clippy::unknown_clippy_lints)] #[allow(clippy::pattern_type_mismatch)] #[allow(clippy::redundant_pub_crate)] -#[allow(clippy::type_repetition_in_bounds)] #[allow(clippy::semicolon_if_nothing_returned)] -#[allow(clippy::use_self)] #[allow(clippy::used_underscore_binding)] const _: () = { + #[allow(box_pointers)] + #[allow(deprecated)] + #[allow(explicit_outlives_requirements)] + #[allow(single_use_lifetimes)] + #[allow(unreachable_pub)] + #[allow(clippy::unknown_clippy_lints)] + #[allow(clippy::pattern_type_mismatch)] + #[allow(clippy::redundant_pub_crate)] #[allow(dead_code)] #[allow(clippy::mut_mut)] + #[allow(clippy::type_repetition_in_bounds)] struct __TupleStructProjection<'pin, T, U>( ::pin_project::__private::Pin<&'pin mut (T)>, &'pin mut (U), ) where TupleStruct<T, U>: 'pin; + #[allow(box_pointers)] + #[allow(deprecated)] + #[allow(explicit_outlives_requirements)] + #[allow(single_use_lifetimes)] + #[allow(unreachable_pub)] + #[allow(clippy::unknown_clippy_lints)] + #[allow(clippy::pattern_type_mismatch)] + #[allow(clippy::redundant_pub_crate)] #[allow(dead_code)] #[allow(clippy::ref_option_ref)] + #[allow(clippy::type_repetition_in_bounds)] struct __TupleStructProjectionRef<'pin, T, U>( ::pin_project::__private::Pin<&'pin (T)>, &'pin (U), @@ -81,7 +96,7 @@ const _: () = { } } } - #[forbid(unaligned_references, safe_packed_borrows)] + #[forbid(safe_packed_borrows)] fn __assert_not_repr_packed<T, U>(this: &TupleStruct<T, U>) { let _ = &this.0; let _ = &this.1; diff --git a/tests/expand/naming/tuple_struct-ref.expanded.rs b/tests/expand/naming/tuple_struct-ref.expanded.rs index d8d5008..587d741 100644 --- a/tests/expand/naming/tuple_struct-ref.expanded.rs +++ b/tests/expand/naming/tuple_struct-ref.expanded.rs @@ -9,9 +9,9 @@ struct TupleStruct<T, U>(#[pin] T, U); #[allow(clippy::unknown_clippy_lints)] #[allow(clippy::pattern_type_mismatch)] #[allow(clippy::redundant_pub_crate)] -#[allow(clippy::type_repetition_in_bounds)] #[allow(dead_code)] #[allow(clippy::ref_option_ref)] +#[allow(clippy::type_repetition_in_bounds)] struct ProjRef<'pin, T, U>(::pin_project::__private::Pin<&'pin (T)>, &'pin (U)) where TupleStruct<T, U>: 'pin; @@ -23,13 +23,20 @@ where #[allow(clippy::unknown_clippy_lints)] #[allow(clippy::pattern_type_mismatch)] #[allow(clippy::redundant_pub_crate)] -#[allow(clippy::type_repetition_in_bounds)] #[allow(clippy::semicolon_if_nothing_returned)] -#[allow(clippy::use_self)] #[allow(clippy::used_underscore_binding)] const _: () = { + #[allow(box_pointers)] + #[allow(deprecated)] + #[allow(explicit_outlives_requirements)] + #[allow(single_use_lifetimes)] + #[allow(unreachable_pub)] + #[allow(clippy::unknown_clippy_lints)] + #[allow(clippy::pattern_type_mismatch)] + #[allow(clippy::redundant_pub_crate)] #[allow(dead_code)] #[allow(clippy::mut_mut)] + #[allow(clippy::type_repetition_in_bounds)] struct __TupleStructProjection<'pin, T, U>( ::pin_project::__private::Pin<&'pin mut (T)>, &'pin mut (U), @@ -55,7 +62,7 @@ const _: () = { } } } - #[forbid(unaligned_references, safe_packed_borrows)] + #[forbid(safe_packed_borrows)] fn __assert_not_repr_packed<T, U>(this: &TupleStruct<T, U>) { let _ = &this.0; let _ = &this.1; diff --git a/tests/expand/not_unpin/enum.expanded.rs b/tests/expand/not_unpin/enum.expanded.rs index 3414a10..6305b78 100644 --- a/tests/expand/not_unpin/enum.expanded.rs +++ b/tests/expand/not_unpin/enum.expanded.rs @@ -17,9 +17,9 @@ enum Enum<T, U> { #[allow(clippy::unknown_clippy_lints)] #[allow(clippy::pattern_type_mismatch)] #[allow(clippy::redundant_pub_crate)] -#[allow(clippy::type_repetition_in_bounds)] #[allow(dead_code)] #[allow(clippy::mut_mut)] +#[allow(clippy::type_repetition_in_bounds)] enum EnumProj<'pin, T, U> where Enum<T, U>: 'pin, @@ -39,9 +39,9 @@ where #[allow(clippy::unknown_clippy_lints)] #[allow(clippy::pattern_type_mismatch)] #[allow(clippy::redundant_pub_crate)] -#[allow(clippy::type_repetition_in_bounds)] #[allow(dead_code)] #[allow(clippy::ref_option_ref)] +#[allow(clippy::type_repetition_in_bounds)] enum EnumProjRef<'pin, T, U> where Enum<T, U>: 'pin, @@ -61,9 +61,7 @@ where #[allow(clippy::unknown_clippy_lints)] #[allow(clippy::pattern_type_mismatch)] #[allow(clippy::redundant_pub_crate)] -#[allow(clippy::type_repetition_in_bounds)] #[allow(clippy::semicolon_if_nothing_returned)] -#[allow(clippy::use_self)] #[allow(clippy::used_underscore_binding)] const _: () = { impl<T, U> Enum<T, U> { diff --git a/tests/expand/not_unpin/struct.expanded.rs b/tests/expand/not_unpin/struct.expanded.rs index b701af5..efa660f 100644 --- a/tests/expand/not_unpin/struct.expanded.rs +++ b/tests/expand/not_unpin/struct.expanded.rs @@ -13,13 +13,20 @@ struct Struct<T, U> { #[allow(clippy::unknown_clippy_lints)] #[allow(clippy::pattern_type_mismatch)] #[allow(clippy::redundant_pub_crate)] -#[allow(clippy::type_repetition_in_bounds)] #[allow(clippy::semicolon_if_nothing_returned)] -#[allow(clippy::use_self)] #[allow(clippy::used_underscore_binding)] const _: () = { + #[allow(box_pointers)] + #[allow(deprecated)] + #[allow(explicit_outlives_requirements)] + #[allow(single_use_lifetimes)] + #[allow(unreachable_pub)] + #[allow(clippy::unknown_clippy_lints)] + #[allow(clippy::pattern_type_mismatch)] + #[allow(clippy::redundant_pub_crate)] #[allow(dead_code)] #[allow(clippy::mut_mut)] + #[allow(clippy::type_repetition_in_bounds)] struct __StructProjection<'pin, T, U> where Struct<T, U>: 'pin, @@ -27,8 +34,17 @@ const _: () = { pinned: ::pin_project::__private::Pin<&'pin mut (T)>, unpinned: &'pin mut (U), } + #[allow(box_pointers)] + #[allow(deprecated)] + #[allow(explicit_outlives_requirements)] + #[allow(single_use_lifetimes)] + #[allow(unreachable_pub)] + #[allow(clippy::unknown_clippy_lints)] + #[allow(clippy::pattern_type_mismatch)] + #[allow(clippy::redundant_pub_crate)] #[allow(dead_code)] #[allow(clippy::ref_option_ref)] + #[allow(clippy::type_repetition_in_bounds)] struct __StructProjectionRef<'pin, T, U> where Struct<T, U>: 'pin, @@ -61,7 +77,7 @@ const _: () = { } } } - #[forbid(unaligned_references, safe_packed_borrows)] + #[forbid(safe_packed_borrows)] fn __assert_not_repr_packed<T, U>(this: &Struct<T, U>) { let _ = &this.pinned; let _ = &this.unpinned; diff --git a/tests/expand/not_unpin/tuple_struct.expanded.rs b/tests/expand/not_unpin/tuple_struct.expanded.rs index 4b73483..89a257e 100644 --- a/tests/expand/not_unpin/tuple_struct.expanded.rs +++ b/tests/expand/not_unpin/tuple_struct.expanded.rs @@ -9,21 +9,37 @@ struct TupleStruct<T, U>(#[pin] T, U); #[allow(clippy::unknown_clippy_lints)] #[allow(clippy::pattern_type_mismatch)] #[allow(clippy::redundant_pub_crate)] -#[allow(clippy::type_repetition_in_bounds)] #[allow(clippy::semicolon_if_nothing_returned)] -#[allow(clippy::use_self)] #[allow(clippy::used_underscore_binding)] const _: () = { + #[allow(box_pointers)] + #[allow(deprecated)] + #[allow(explicit_outlives_requirements)] + #[allow(single_use_lifetimes)] + #[allow(unreachable_pub)] + #[allow(clippy::unknown_clippy_lints)] + #[allow(clippy::pattern_type_mismatch)] + #[allow(clippy::redundant_pub_crate)] #[allow(dead_code)] #[allow(clippy::mut_mut)] + #[allow(clippy::type_repetition_in_bounds)] struct __TupleStructProjection<'pin, T, U>( ::pin_project::__private::Pin<&'pin mut (T)>, &'pin mut (U), ) where TupleStruct<T, U>: 'pin; + #[allow(box_pointers)] + #[allow(deprecated)] + #[allow(explicit_outlives_requirements)] + #[allow(single_use_lifetimes)] + #[allow(unreachable_pub)] + #[allow(clippy::unknown_clippy_lints)] + #[allow(clippy::pattern_type_mismatch)] + #[allow(clippy::redundant_pub_crate)] #[allow(dead_code)] #[allow(clippy::ref_option_ref)] + #[allow(clippy::type_repetition_in_bounds)] struct __TupleStructProjectionRef<'pin, T, U>( ::pin_project::__private::Pin<&'pin (T)>, &'pin (U), @@ -49,7 +65,7 @@ const _: () = { } } } - #[forbid(unaligned_references, safe_packed_borrows)] + #[forbid(safe_packed_borrows)] fn __assert_not_repr_packed<T, U>(this: &TupleStruct<T, U>) { let _ = &this.0; let _ = &this.1; diff --git a/tests/expand/pinned_drop/enum.expanded.rs b/tests/expand/pinned_drop/enum.expanded.rs index a968b72..c8eb0e4 100644 --- a/tests/expand/pinned_drop/enum.expanded.rs +++ b/tests/expand/pinned_drop/enum.expanded.rs @@ -1,5 +1,5 @@ -use std::pin::Pin; use pin_project::{pin_project, pinned_drop}; +use std::pin::Pin; # [pin (__private (PinnedDrop , project = EnumProj , project_ref = EnumProjRef))] enum Enum<T, U> { Struct { @@ -18,9 +18,9 @@ enum Enum<T, U> { #[allow(clippy::unknown_clippy_lints)] #[allow(clippy::pattern_type_mismatch)] #[allow(clippy::redundant_pub_crate)] -#[allow(clippy::type_repetition_in_bounds)] #[allow(dead_code)] #[allow(clippy::mut_mut)] +#[allow(clippy::type_repetition_in_bounds)] enum EnumProj<'pin, T, U> where Enum<T, U>: 'pin, @@ -40,9 +40,9 @@ where #[allow(clippy::unknown_clippy_lints)] #[allow(clippy::pattern_type_mismatch)] #[allow(clippy::redundant_pub_crate)] -#[allow(clippy::type_repetition_in_bounds)] #[allow(dead_code)] #[allow(clippy::ref_option_ref)] +#[allow(clippy::type_repetition_in_bounds)] enum EnumProjRef<'pin, T, U> where Enum<T, U>: 'pin, @@ -62,9 +62,7 @@ where #[allow(clippy::unknown_clippy_lints)] #[allow(clippy::pattern_type_mismatch)] #[allow(clippy::redundant_pub_crate)] -#[allow(clippy::type_repetition_in_bounds)] #[allow(clippy::semicolon_if_nothing_returned)] -#[allow(clippy::use_self)] #[allow(clippy::used_underscore_binding)] const _: () = { impl<T, U> Enum<T, U> { @@ -132,7 +130,6 @@ const _: () = { } } }; -#[doc(hidden)] impl<T, U> ::pin_project::__private::PinnedDrop for Enum<T, U> { unsafe fn drop(self: Pin<&mut Self>) { #[allow(clippy::needless_pass_by_value)] diff --git a/tests/expand/pinned_drop/enum.rs b/tests/expand/pinned_drop/enum.rs index c162ef6..f5b8aa4 100644 --- a/tests/expand/pinned_drop/enum.rs +++ b/tests/expand/pinned_drop/enum.rs @@ -1,6 +1,5 @@ -use std::pin::Pin; - use pin_project::{pin_project, pinned_drop}; +use std::pin::Pin; #[pin_project(PinnedDrop, project = EnumProj, project_ref = EnumProjRef)] enum Enum<T, U> { diff --git a/tests/expand/pinned_drop/struct.expanded.rs b/tests/expand/pinned_drop/struct.expanded.rs index 630389b..9d7f489 100644 --- a/tests/expand/pinned_drop/struct.expanded.rs +++ b/tests/expand/pinned_drop/struct.expanded.rs @@ -1,5 +1,5 @@ -use std::pin::Pin; use pin_project::{pin_project, pinned_drop}; +use std::pin::Pin; #[pin(__private(PinnedDrop))] struct Struct<T, U> { #[pin] @@ -14,13 +14,20 @@ struct Struct<T, U> { #[allow(clippy::unknown_clippy_lints)] #[allow(clippy::pattern_type_mismatch)] #[allow(clippy::redundant_pub_crate)] -#[allow(clippy::type_repetition_in_bounds)] #[allow(clippy::semicolon_if_nothing_returned)] -#[allow(clippy::use_self)] #[allow(clippy::used_underscore_binding)] const _: () = { + #[allow(box_pointers)] + #[allow(deprecated)] + #[allow(explicit_outlives_requirements)] + #[allow(single_use_lifetimes)] + #[allow(unreachable_pub)] + #[allow(clippy::unknown_clippy_lints)] + #[allow(clippy::pattern_type_mismatch)] + #[allow(clippy::redundant_pub_crate)] #[allow(dead_code)] #[allow(clippy::mut_mut)] + #[allow(clippy::type_repetition_in_bounds)] struct __StructProjection<'pin, T, U> where Struct<T, U>: 'pin, @@ -28,8 +35,17 @@ const _: () = { pinned: ::pin_project::__private::Pin<&'pin mut (T)>, unpinned: &'pin mut (U), } + #[allow(box_pointers)] + #[allow(deprecated)] + #[allow(explicit_outlives_requirements)] + #[allow(single_use_lifetimes)] + #[allow(unreachable_pub)] + #[allow(clippy::unknown_clippy_lints)] + #[allow(clippy::pattern_type_mismatch)] + #[allow(clippy::redundant_pub_crate)] #[allow(dead_code)] #[allow(clippy::ref_option_ref)] + #[allow(clippy::type_repetition_in_bounds)] struct __StructProjectionRef<'pin, T, U> where Struct<T, U>: 'pin, @@ -62,7 +78,7 @@ const _: () = { } } } - #[forbid(unaligned_references, safe_packed_borrows)] + #[forbid(safe_packed_borrows)] fn __assert_not_repr_packed<T, U>(this: &Struct<T, U>) { let _ = &this.pinned; let _ = &this.unpinned; @@ -96,7 +112,6 @@ const _: () = { } } }; -#[doc(hidden)] impl<T, U> ::pin_project::__private::PinnedDrop for Struct<T, U> { unsafe fn drop(self: Pin<&mut Self>) { #[allow(clippy::needless_pass_by_value)] diff --git a/tests/expand/pinned_drop/struct.rs b/tests/expand/pinned_drop/struct.rs index 691d3cb..948e6cc 100644 --- a/tests/expand/pinned_drop/struct.rs +++ b/tests/expand/pinned_drop/struct.rs @@ -1,6 +1,5 @@ -use std::pin::Pin; - use pin_project::{pin_project, pinned_drop}; +use std::pin::Pin; #[pin_project(PinnedDrop)] struct Struct<T, U> { diff --git a/tests/expand/pinned_drop/tuple_struct.expanded.rs b/tests/expand/pinned_drop/tuple_struct.expanded.rs index f06f2ae..b30ee66 100644 --- a/tests/expand/pinned_drop/tuple_struct.expanded.rs +++ b/tests/expand/pinned_drop/tuple_struct.expanded.rs @@ -1,5 +1,5 @@ -use std::pin::Pin; use pin_project::{pin_project, pinned_drop}; +use std::pin::Pin; #[pin(__private(PinnedDrop))] struct TupleStruct<T, U>(#[pin] T, U); #[allow(box_pointers)] @@ -10,21 +10,37 @@ struct TupleStruct<T, U>(#[pin] T, U); #[allow(clippy::unknown_clippy_lints)] #[allow(clippy::pattern_type_mismatch)] #[allow(clippy::redundant_pub_crate)] -#[allow(clippy::type_repetition_in_bounds)] #[allow(clippy::semicolon_if_nothing_returned)] -#[allow(clippy::use_self)] #[allow(clippy::used_underscore_binding)] const _: () = { + #[allow(box_pointers)] + #[allow(deprecated)] + #[allow(explicit_outlives_requirements)] + #[allow(single_use_lifetimes)] + #[allow(unreachable_pub)] + #[allow(clippy::unknown_clippy_lints)] + #[allow(clippy::pattern_type_mismatch)] + #[allow(clippy::redundant_pub_crate)] #[allow(dead_code)] #[allow(clippy::mut_mut)] + #[allow(clippy::type_repetition_in_bounds)] struct __TupleStructProjection<'pin, T, U>( ::pin_project::__private::Pin<&'pin mut (T)>, &'pin mut (U), ) where TupleStruct<T, U>: 'pin; + #[allow(box_pointers)] + #[allow(deprecated)] + #[allow(explicit_outlives_requirements)] + #[allow(single_use_lifetimes)] + #[allow(unreachable_pub)] + #[allow(clippy::unknown_clippy_lints)] + #[allow(clippy::pattern_type_mismatch)] + #[allow(clippy::redundant_pub_crate)] #[allow(dead_code)] #[allow(clippy::ref_option_ref)] + #[allow(clippy::type_repetition_in_bounds)] struct __TupleStructProjectionRef<'pin, T, U>( ::pin_project::__private::Pin<&'pin (T)>, &'pin (U), @@ -50,7 +66,7 @@ const _: () = { } } } - #[forbid(unaligned_references, safe_packed_borrows)] + #[forbid(safe_packed_borrows)] fn __assert_not_repr_packed<T, U>(this: &TupleStruct<T, U>) { let _ = &this.0; let _ = &this.1; @@ -84,7 +100,6 @@ const _: () = { } } }; -#[doc(hidden)] impl<T, U> ::pin_project::__private::PinnedDrop for TupleStruct<T, U> { unsafe fn drop(self: Pin<&mut Self>) { #[allow(clippy::needless_pass_by_value)] diff --git a/tests/expand/pinned_drop/tuple_struct.rs b/tests/expand/pinned_drop/tuple_struct.rs index 1f4917c..a536039 100644 --- a/tests/expand/pinned_drop/tuple_struct.rs +++ b/tests/expand/pinned_drop/tuple_struct.rs @@ -1,6 +1,5 @@ -use std::pin::Pin; - use pin_project::{pin_project, pinned_drop}; +use std::pin::Pin; #[pin_project(PinnedDrop)] struct TupleStruct<T, U>(#[pin] T, U); diff --git a/tests/expand/project_replace/enum.expanded.rs b/tests/expand/project_replace/enum.expanded.rs index 27ff08a..304e0a7 100644 --- a/tests/expand/project_replace/enum.expanded.rs +++ b/tests/expand/project_replace/enum.expanded.rs @@ -17,7 +17,6 @@ enum Enum<T, U> { #[allow(clippy::unknown_clippy_lints)] #[allow(clippy::pattern_type_mismatch)] #[allow(clippy::redundant_pub_crate)] -#[allow(clippy::type_repetition_in_bounds)] #[allow(dead_code)] #[allow(variant_size_differences)] #[allow(clippy::large_enum_variant)] @@ -37,9 +36,7 @@ enum EnumProjOwn<T, U> { #[allow(clippy::unknown_clippy_lints)] #[allow(clippy::pattern_type_mismatch)] #[allow(clippy::redundant_pub_crate)] -#[allow(clippy::type_repetition_in_bounds)] #[allow(clippy::semicolon_if_nothing_returned)] -#[allow(clippy::use_self)] #[allow(clippy::used_underscore_binding)] const _: () = { impl<T, U> Enum<T, U> { diff --git a/tests/expand/project_replace/struct.expanded.rs b/tests/expand/project_replace/struct.expanded.rs index bad4984..476c0ab 100644 --- a/tests/expand/project_replace/struct.expanded.rs +++ b/tests/expand/project_replace/struct.expanded.rs @@ -13,13 +13,20 @@ struct Struct<T, U> { #[allow(clippy::unknown_clippy_lints)] #[allow(clippy::pattern_type_mismatch)] #[allow(clippy::redundant_pub_crate)] -#[allow(clippy::type_repetition_in_bounds)] #[allow(clippy::semicolon_if_nothing_returned)] -#[allow(clippy::use_self)] #[allow(clippy::used_underscore_binding)] const _: () = { + #[allow(box_pointers)] + #[allow(deprecated)] + #[allow(explicit_outlives_requirements)] + #[allow(single_use_lifetimes)] + #[allow(unreachable_pub)] + #[allow(clippy::unknown_clippy_lints)] + #[allow(clippy::pattern_type_mismatch)] + #[allow(clippy::redundant_pub_crate)] #[allow(dead_code)] #[allow(clippy::mut_mut)] + #[allow(clippy::type_repetition_in_bounds)] struct __StructProjection<'pin, T, U> where Struct<T, U>: 'pin, @@ -27,8 +34,17 @@ const _: () = { pinned: ::pin_project::__private::Pin<&'pin mut (T)>, unpinned: &'pin mut (U), } + #[allow(box_pointers)] + #[allow(deprecated)] + #[allow(explicit_outlives_requirements)] + #[allow(single_use_lifetimes)] + #[allow(unreachable_pub)] + #[allow(clippy::unknown_clippy_lints)] + #[allow(clippy::pattern_type_mismatch)] + #[allow(clippy::redundant_pub_crate)] #[allow(dead_code)] #[allow(clippy::ref_option_ref)] + #[allow(clippy::type_repetition_in_bounds)] struct __StructProjectionRef<'pin, T, U> where Struct<T, U>: 'pin, @@ -36,6 +52,14 @@ const _: () = { pinned: ::pin_project::__private::Pin<&'pin (T)>, unpinned: &'pin (U), } + #[allow(box_pointers)] + #[allow(deprecated)] + #[allow(explicit_outlives_requirements)] + #[allow(single_use_lifetimes)] + #[allow(unreachable_pub)] + #[allow(clippy::unknown_clippy_lints)] + #[allow(clippy::pattern_type_mismatch)] + #[allow(clippy::redundant_pub_crate)] #[allow(dead_code)] struct __StructProjectionOwned<T, U> { pinned: ::pin_project::__private::PhantomData<T>, @@ -87,7 +111,7 @@ const _: () = { } } } - #[forbid(unaligned_references, safe_packed_borrows)] + #[forbid(safe_packed_borrows)] fn __assert_not_repr_packed<T, U>(this: &Struct<T, U>) { let _ = &this.pinned; let _ = &this.unpinned; diff --git a/tests/expand/project_replace/tuple_struct.expanded.rs b/tests/expand/project_replace/tuple_struct.expanded.rs index bc5a6e5..0026a9f 100644 --- a/tests/expand/project_replace/tuple_struct.expanded.rs +++ b/tests/expand/project_replace/tuple_struct.expanded.rs @@ -9,27 +9,51 @@ struct TupleStruct<T, U>(#[pin] T, U); #[allow(clippy::unknown_clippy_lints)] #[allow(clippy::pattern_type_mismatch)] #[allow(clippy::redundant_pub_crate)] -#[allow(clippy::type_repetition_in_bounds)] #[allow(clippy::semicolon_if_nothing_returned)] -#[allow(clippy::use_self)] #[allow(clippy::used_underscore_binding)] const _: () = { + #[allow(box_pointers)] + #[allow(deprecated)] + #[allow(explicit_outlives_requirements)] + #[allow(single_use_lifetimes)] + #[allow(unreachable_pub)] + #[allow(clippy::unknown_clippy_lints)] + #[allow(clippy::pattern_type_mismatch)] + #[allow(clippy::redundant_pub_crate)] #[allow(dead_code)] #[allow(clippy::mut_mut)] + #[allow(clippy::type_repetition_in_bounds)] struct __TupleStructProjection<'pin, T, U>( ::pin_project::__private::Pin<&'pin mut (T)>, &'pin mut (U), ) where TupleStruct<T, U>: 'pin; + #[allow(box_pointers)] + #[allow(deprecated)] + #[allow(explicit_outlives_requirements)] + #[allow(single_use_lifetimes)] + #[allow(unreachable_pub)] + #[allow(clippy::unknown_clippy_lints)] + #[allow(clippy::pattern_type_mismatch)] + #[allow(clippy::redundant_pub_crate)] #[allow(dead_code)] #[allow(clippy::ref_option_ref)] + #[allow(clippy::type_repetition_in_bounds)] struct __TupleStructProjectionRef<'pin, T, U>( ::pin_project::__private::Pin<&'pin (T)>, &'pin (U), ) where TupleStruct<T, U>: 'pin; + #[allow(box_pointers)] + #[allow(deprecated)] + #[allow(explicit_outlives_requirements)] + #[allow(single_use_lifetimes)] + #[allow(unreachable_pub)] + #[allow(clippy::unknown_clippy_lints)] + #[allow(clippy::pattern_type_mismatch)] + #[allow(clippy::redundant_pub_crate)] #[allow(dead_code)] struct __TupleStructProjectionOwned<T, U>(::pin_project::__private::PhantomData<T>, U); impl<T, U> TupleStruct<T, U> { @@ -72,7 +96,7 @@ const _: () = { } } } - #[forbid(unaligned_references, safe_packed_borrows)] + #[forbid(safe_packed_borrows)] fn __assert_not_repr_packed<T, U>(this: &TupleStruct<T, U>) { let _ = &this.0; let _ = &this.1; diff --git a/tests/expand/pub/enum.expanded.rs b/tests/expand/pub/enum.expanded.rs index f9bd9fe..5026bad 100644 --- a/tests/expand/pub/enum.expanded.rs +++ b/tests/expand/pub/enum.expanded.rs @@ -17,9 +17,9 @@ pub enum Enum<T, U> { #[allow(clippy::unknown_clippy_lints)] #[allow(clippy::pattern_type_mismatch)] #[allow(clippy::redundant_pub_crate)] -#[allow(clippy::type_repetition_in_bounds)] #[allow(dead_code)] #[allow(clippy::mut_mut)] +#[allow(clippy::type_repetition_in_bounds)] pub(crate) enum EnumProj<'pin, T, U> where Enum<T, U>: 'pin, @@ -39,9 +39,9 @@ where #[allow(clippy::unknown_clippy_lints)] #[allow(clippy::pattern_type_mismatch)] #[allow(clippy::redundant_pub_crate)] -#[allow(clippy::type_repetition_in_bounds)] #[allow(dead_code)] #[allow(clippy::ref_option_ref)] +#[allow(clippy::type_repetition_in_bounds)] pub(crate) enum EnumProjRef<'pin, T, U> where Enum<T, U>: 'pin, @@ -61,9 +61,7 @@ where #[allow(clippy::unknown_clippy_lints)] #[allow(clippy::pattern_type_mismatch)] #[allow(clippy::redundant_pub_crate)] -#[allow(clippy::type_repetition_in_bounds)] #[allow(clippy::semicolon_if_nothing_returned)] -#[allow(clippy::use_self)] #[allow(clippy::used_underscore_binding)] const _: () = { impl<T, U> Enum<T, U> { diff --git a/tests/expand/pub/struct.expanded.rs b/tests/expand/pub/struct.expanded.rs index 8abd9a1..246d9b6 100644 --- a/tests/expand/pub/struct.expanded.rs +++ b/tests/expand/pub/struct.expanded.rs @@ -13,13 +13,20 @@ pub struct Struct<T, U> { #[allow(clippy::unknown_clippy_lints)] #[allow(clippy::pattern_type_mismatch)] #[allow(clippy::redundant_pub_crate)] -#[allow(clippy::type_repetition_in_bounds)] #[allow(clippy::semicolon_if_nothing_returned)] -#[allow(clippy::use_self)] #[allow(clippy::used_underscore_binding)] const _: () = { + #[allow(box_pointers)] + #[allow(deprecated)] + #[allow(explicit_outlives_requirements)] + #[allow(single_use_lifetimes)] + #[allow(unreachable_pub)] + #[allow(clippy::unknown_clippy_lints)] + #[allow(clippy::pattern_type_mismatch)] + #[allow(clippy::redundant_pub_crate)] #[allow(dead_code)] #[allow(clippy::mut_mut)] + #[allow(clippy::type_repetition_in_bounds)] pub(crate) struct __StructProjection<'pin, T, U> where Struct<T, U>: 'pin, @@ -27,8 +34,17 @@ const _: () = { pub pinned: ::pin_project::__private::Pin<&'pin mut (T)>, pub unpinned: &'pin mut (U), } + #[allow(box_pointers)] + #[allow(deprecated)] + #[allow(explicit_outlives_requirements)] + #[allow(single_use_lifetimes)] + #[allow(unreachable_pub)] + #[allow(clippy::unknown_clippy_lints)] + #[allow(clippy::pattern_type_mismatch)] + #[allow(clippy::redundant_pub_crate)] #[allow(dead_code)] #[allow(clippy::ref_option_ref)] + #[allow(clippy::type_repetition_in_bounds)] pub(crate) struct __StructProjectionRef<'pin, T, U> where Struct<T, U>: 'pin, @@ -61,7 +77,7 @@ const _: () = { } } } - #[forbid(unaligned_references, safe_packed_borrows)] + #[forbid(safe_packed_borrows)] fn __assert_not_repr_packed<T, U>(this: &Struct<T, U>) { let _ = &this.pinned; let _ = &this.unpinned; diff --git a/tests/expand/pub/tuple_struct.expanded.rs b/tests/expand/pub/tuple_struct.expanded.rs index 2641d16..033fbaf 100644 --- a/tests/expand/pub/tuple_struct.expanded.rs +++ b/tests/expand/pub/tuple_struct.expanded.rs @@ -9,21 +9,37 @@ pub struct TupleStruct<T, U>(#[pin] pub T, pub U); #[allow(clippy::unknown_clippy_lints)] #[allow(clippy::pattern_type_mismatch)] #[allow(clippy::redundant_pub_crate)] -#[allow(clippy::type_repetition_in_bounds)] #[allow(clippy::semicolon_if_nothing_returned)] -#[allow(clippy::use_self)] #[allow(clippy::used_underscore_binding)] const _: () = { + #[allow(box_pointers)] + #[allow(deprecated)] + #[allow(explicit_outlives_requirements)] + #[allow(single_use_lifetimes)] + #[allow(unreachable_pub)] + #[allow(clippy::unknown_clippy_lints)] + #[allow(clippy::pattern_type_mismatch)] + #[allow(clippy::redundant_pub_crate)] #[allow(dead_code)] #[allow(clippy::mut_mut)] + #[allow(clippy::type_repetition_in_bounds)] pub(crate) struct __TupleStructProjection<'pin, T, U>( pub ::pin_project::__private::Pin<&'pin mut (T)>, pub &'pin mut (U), ) where TupleStruct<T, U>: 'pin; + #[allow(box_pointers)] + #[allow(deprecated)] + #[allow(explicit_outlives_requirements)] + #[allow(single_use_lifetimes)] + #[allow(unreachable_pub)] + #[allow(clippy::unknown_clippy_lints)] + #[allow(clippy::pattern_type_mismatch)] + #[allow(clippy::redundant_pub_crate)] #[allow(dead_code)] #[allow(clippy::ref_option_ref)] + #[allow(clippy::type_repetition_in_bounds)] pub(crate) struct __TupleStructProjectionRef<'pin, T, U>( pub ::pin_project::__private::Pin<&'pin (T)>, pub &'pin (U), @@ -49,7 +65,7 @@ const _: () = { } } } - #[forbid(unaligned_references, safe_packed_borrows)] + #[forbid(safe_packed_borrows)] fn __assert_not_repr_packed<T, U>(this: &TupleStruct<T, U>) { let _ = &this.0; let _ = &this.1; diff --git a/tests/expand/unsafe_unpin/enum.expanded.rs b/tests/expand/unsafe_unpin/enum.expanded.rs index 1c51df0..df962d0 100644 --- a/tests/expand/unsafe_unpin/enum.expanded.rs +++ b/tests/expand/unsafe_unpin/enum.expanded.rs @@ -17,9 +17,9 @@ enum Enum<T, U> { #[allow(clippy::unknown_clippy_lints)] #[allow(clippy::pattern_type_mismatch)] #[allow(clippy::redundant_pub_crate)] -#[allow(clippy::type_repetition_in_bounds)] #[allow(dead_code)] #[allow(clippy::mut_mut)] +#[allow(clippy::type_repetition_in_bounds)] enum EnumProj<'pin, T, U> where Enum<T, U>: 'pin, @@ -39,9 +39,9 @@ where #[allow(clippy::unknown_clippy_lints)] #[allow(clippy::pattern_type_mismatch)] #[allow(clippy::redundant_pub_crate)] -#[allow(clippy::type_repetition_in_bounds)] #[allow(dead_code)] #[allow(clippy::ref_option_ref)] +#[allow(clippy::type_repetition_in_bounds)] enum EnumProjRef<'pin, T, U> where Enum<T, U>: 'pin, @@ -61,9 +61,7 @@ where #[allow(clippy::unknown_clippy_lints)] #[allow(clippy::pattern_type_mismatch)] #[allow(clippy::redundant_pub_crate)] -#[allow(clippy::type_repetition_in_bounds)] #[allow(clippy::semicolon_if_nothing_returned)] -#[allow(clippy::use_self)] #[allow(clippy::used_underscore_binding)] const _: () = { impl<T, U> Enum<T, U> { diff --git a/tests/expand/unsafe_unpin/struct.expanded.rs b/tests/expand/unsafe_unpin/struct.expanded.rs index 67ede39..4066d49 100644 --- a/tests/expand/unsafe_unpin/struct.expanded.rs +++ b/tests/expand/unsafe_unpin/struct.expanded.rs @@ -13,13 +13,20 @@ struct Struct<T, U> { #[allow(clippy::unknown_clippy_lints)] #[allow(clippy::pattern_type_mismatch)] #[allow(clippy::redundant_pub_crate)] -#[allow(clippy::type_repetition_in_bounds)] #[allow(clippy::semicolon_if_nothing_returned)] -#[allow(clippy::use_self)] #[allow(clippy::used_underscore_binding)] const _: () = { + #[allow(box_pointers)] + #[allow(deprecated)] + #[allow(explicit_outlives_requirements)] + #[allow(single_use_lifetimes)] + #[allow(unreachable_pub)] + #[allow(clippy::unknown_clippy_lints)] + #[allow(clippy::pattern_type_mismatch)] + #[allow(clippy::redundant_pub_crate)] #[allow(dead_code)] #[allow(clippy::mut_mut)] + #[allow(clippy::type_repetition_in_bounds)] struct __StructProjection<'pin, T, U> where Struct<T, U>: 'pin, @@ -27,8 +34,17 @@ const _: () = { pinned: ::pin_project::__private::Pin<&'pin mut (T)>, unpinned: &'pin mut (U), } + #[allow(box_pointers)] + #[allow(deprecated)] + #[allow(explicit_outlives_requirements)] + #[allow(single_use_lifetimes)] + #[allow(unreachable_pub)] + #[allow(clippy::unknown_clippy_lints)] + #[allow(clippy::pattern_type_mismatch)] + #[allow(clippy::redundant_pub_crate)] #[allow(dead_code)] #[allow(clippy::ref_option_ref)] + #[allow(clippy::type_repetition_in_bounds)] struct __StructProjectionRef<'pin, T, U> where Struct<T, U>: 'pin, @@ -61,7 +77,7 @@ const _: () = { } } } - #[forbid(unaligned_references, safe_packed_borrows)] + #[forbid(safe_packed_borrows)] fn __assert_not_repr_packed<T, U>(this: &Struct<T, U>) { let _ = &this.pinned; let _ = &this.unpinned; diff --git a/tests/expand/unsafe_unpin/tuple_struct.expanded.rs b/tests/expand/unsafe_unpin/tuple_struct.expanded.rs index 512f139..59a40da 100644 --- a/tests/expand/unsafe_unpin/tuple_struct.expanded.rs +++ b/tests/expand/unsafe_unpin/tuple_struct.expanded.rs @@ -9,21 +9,37 @@ struct TupleStruct<T, U>(#[pin] T, U); #[allow(clippy::unknown_clippy_lints)] #[allow(clippy::pattern_type_mismatch)] #[allow(clippy::redundant_pub_crate)] -#[allow(clippy::type_repetition_in_bounds)] #[allow(clippy::semicolon_if_nothing_returned)] -#[allow(clippy::use_self)] #[allow(clippy::used_underscore_binding)] const _: () = { + #[allow(box_pointers)] + #[allow(deprecated)] + #[allow(explicit_outlives_requirements)] + #[allow(single_use_lifetimes)] + #[allow(unreachable_pub)] + #[allow(clippy::unknown_clippy_lints)] + #[allow(clippy::pattern_type_mismatch)] + #[allow(clippy::redundant_pub_crate)] #[allow(dead_code)] #[allow(clippy::mut_mut)] + #[allow(clippy::type_repetition_in_bounds)] struct __TupleStructProjection<'pin, T, U>( ::pin_project::__private::Pin<&'pin mut (T)>, &'pin mut (U), ) where TupleStruct<T, U>: 'pin; + #[allow(box_pointers)] + #[allow(deprecated)] + #[allow(explicit_outlives_requirements)] + #[allow(single_use_lifetimes)] + #[allow(unreachable_pub)] + #[allow(clippy::unknown_clippy_lints)] + #[allow(clippy::pattern_type_mismatch)] + #[allow(clippy::redundant_pub_crate)] #[allow(dead_code)] #[allow(clippy::ref_option_ref)] + #[allow(clippy::type_repetition_in_bounds)] struct __TupleStructProjectionRef<'pin, T, U>( ::pin_project::__private::Pin<&'pin (T)>, &'pin (U), @@ -49,7 +65,7 @@ const _: () = { } } } - #[forbid(unaligned_references, safe_packed_borrows)] + #[forbid(safe_packed_borrows)] fn __assert_not_repr_packed<T, U>(this: &TupleStruct<T, U>) { let _ = &this.0; let _ = &this.1; diff --git a/tests/expandtest.rs b/tests/expandtest.rs index 3f0d5c1..adf8dde 100644 --- a/tests/expandtest.rs +++ b/tests/expandtest.rs @@ -6,8 +6,6 @@ use std::{ process::{Command, ExitStatus, Stdio}, }; -const PATH: &str = "tests/expand/**/*.rs"; - #[rustversion::attr(not(nightly), ignore)] #[test] fn expandtest() { @@ -15,17 +13,17 @@ fn expandtest() { let cargo = &*env::var("CARGO").unwrap_or_else(|_| "cargo".into()); if !has_command(&[cargo, "expand"]) || !has_command(&[cargo, "fmt"]) { if is_ci { - panic!("expandtest requires rustfmt and cargo-expand"); + panic!("expandtest requires rustfmt and cargo-expand") } return; } - let args = &["--all-features"]; + let path = "tests/expand/*/*.rs"; if is_ci { - macrotest::expand_without_refresh_args(PATH, args); + macrotest::expand_without_refresh(path); } else { env::set_var("MACROTEST", "overwrite"); - macrotest::expand_args(PATH, args); + macrotest::expand(path); } } diff --git a/tests/lint.rs b/tests/lint.rs index 5cdd2c6..e7aee5a 100644 --- a/tests/lint.rs +++ b/tests/lint.rs @@ -1,20 +1,14 @@ -// Check interoperability with rustc and clippy lints. - -// for old compilers -#![allow(unknown_lints)] #![warn(nonstandard_style, rust_2018_idioms, unused)] // Note: This does not guarantee compatibility with forbidding these lints in the future. // If rustc adds a new lint, we may not be able to keep this. -#![forbid(future_incompatible, rust_2018_compatibility, rust_2021_compatibility)] -// lints forbidden as a part of future_incompatible, rust_2018_compatibility, and rust_2021_compatibility are not included in the list below. -// elided_lifetimes_in_paths, explicit_outlives_requirements, unused_extern_crates: as a part of rust_2018_idioms -// unsafe_block_in_unsafe_fn: unsafe_block_in_unsafe_fn: requires Rust 1.52. and, we don't generate unsafe fn. -// unstable_features: no way to generate #![feature(..)] by macros, expect for unstable inner attribute. and this lint is deprecated: https://doc.rust-lang.org/rustc/lints/listing/allowed-by-default.html#unstable-features -// unused_crate_dependencies: unrelated -// unsafe_code: checked in forbid_unsafe module +#![forbid(future_incompatible, rust_2018_compatibility)] +#![allow(unknown_lints)] // for old compilers #![warn( box_pointers, deprecated_in_future, + disjoint_capture_drop_reorder, + elided_lifetimes_in_paths, + explicit_outlives_requirements, macro_use_extern_crate, meta_variable_misuse, missing_abi, @@ -26,17 +20,27 @@ single_use_lifetimes, trivial_casts, trivial_numeric_casts, + unaligned_references, unreachable_pub, + unused_extern_crates, unused_import_braces, unused_lifetimes, unused_qualifications, unused_results, variant_size_differences )] -#![warn(clippy::all, clippy::pedantic, clippy::nursery, clippy::restriction)] +// absolute_paths_not_starting_with_crate, anonymous_parameters, keyword_idents, pointer_structural_match, semicolon_in_expressions_from_macros: forbidden as a part of future_incompatible +// unsafe_block_in_unsafe_fn: unstable: https://github.com/rust-lang/rust/issues/71668 +// unsafe_code: checked in forbid_unsafe module +// unstable_features: deprecated: https://doc.rust-lang.org/beta/rustc/lints/listing/allowed-by-default.html#unstable-features +// unused_crate_dependencies: unrelated +#![warn(clippy::all, clippy::pedantic, clippy::nursery)] +#![warn(clippy::restriction)] #![allow(clippy::blanket_clippy_restriction_lints)] // this is a test, so enable all restriction lints intentionally. #![allow(clippy::exhaustive_structs, clippy::exhaustive_enums)] // TODO +// Check interoperability with rustc and clippy lints. + pub mod basic { include!("include/basic.rs"); @@ -1077,45 +1081,6 @@ pub mod clippy_type_repetition_in_bounds { } } -pub mod clippy_use_self { - use pin_project::pin_project; - - pub trait Trait { - type Assoc; - } - - #[pin_project(project_replace)] - #[derive(Debug)] - pub struct Generics<T: Trait<Assoc = Self>> - where - Self: Trait<Assoc = Self>, - { - _f: T, - } - - pub mod inside_macro { - use pin_project::pin_project; - - use super::Trait; - - #[rustfmt::skip] - macro_rules! mac { - () => { - #[pin_project(project_replace)] - #[derive(Debug)] - pub struct Generics<T: Trait<Assoc = Self>> - where - Self: Trait<Assoc = Self>, - { - _f: T, - } - }; - } - - mac!(); - } -} - pub mod clippy_used_underscore_binding { use pin_project::pin_project; diff --git a/tests/pin_project.rs b/tests/pin_project.rs index aa08056..c6aaf94 100644 --- a/tests/pin_project.rs +++ b/tests/pin_project.rs @@ -94,7 +94,7 @@ fn projection() { EnumProj::Struct { f1, f2 } => { let _: Pin<&mut i32> = f1; let _: &mut i32 = f2; - unreachable!(); + unreachable!() } EnumProj::Unit => unreachable!(), } @@ -108,7 +108,7 @@ fn projection() { EnumProj::Tuple(x, y) => { let _: Pin<&mut i32> = x; let _: &mut i32 = y; - unreachable!(); + unreachable!() } EnumProj::Struct { f1, f2 } => { let _: Pin<&mut i32> = f1; @@ -723,7 +723,6 @@ fn parse_self() { type Assoc; } - #[allow(clippy::type_repetition_in_bounds)] #[pin_project(project_replace)] pub struct Generics<T: Trait<Assoc = Self>> where @@ -847,7 +846,7 @@ fn project_replace_panic() { fn drop(&mut self) { *self.0 = true; if self.1 { - panic!(); + panic!() } } } diff --git a/tests/pinned_drop.rs b/tests/pinned_drop.rs index 99273c4..9e7287d 100644 --- a/tests/pinned_drop.rs +++ b/tests/pinned_drop.rs @@ -70,10 +70,10 @@ fn self_ty() { // pat match *self { - Self { f: () } => {} + Self { f: _ } => {} } - if let Self { f: () } = *self {} - let Self { f: () } = *self; + if let Self { f: _ } = *self {} + let Self { f: _ } = *self; } } @@ -113,11 +113,11 @@ fn self_ty() { // pat match *self { - Self::Struct { f: () } => {} + Self::Struct { f: _ } => {} Self::Tuple(_) => {} Self::Unit => {} } - if let Self::Struct { f: () } = *self {} + if let Self::Struct { f: _ } = *self {} if let Self::Tuple(_) = *self {} if let Self::Unit = *self {} } @@ -138,7 +138,7 @@ fn self_inside_macro_containing_fn() { #[pinned_drop] impl PinnedDrop for S { fn drop(self: Pin<&mut Self>) { - mac!({ + let _ = mac!({ impl S { pub fn _f(self) -> Self { self @@ -213,7 +213,7 @@ fn self_ty_inside_macro_call() { } impl<T: Send> Trait for Struct<T> { - type Assoc2 = u8; + type Assoc2 = (); const ASSOC2: usize = 2; fn assoc2() {} } @@ -262,23 +262,3 @@ fn inside_macro() { mac!(1); } - -pub mod self_path { - use super::*; - - #[pin_project(PinnedDrop)] - pub struct S<T: Unpin>(T); - - fn f() {} - - #[pinned_drop] - impl<T: Unpin> PinnedDrop for self::S<T> { - fn drop(mut self: Pin<&mut Self>) { - self::f(); - let _: self::S<()> = self::S(()); - let _: self::S<Pin<&mut Self>> = self::S(self.as_mut()); - let self::S(()) = self::S(()); - let self::S(&mut Self(_)) = self::S(&mut *self); - } - } -} diff --git a/tests/repr_packed.rs b/tests/repr_packed.rs index be7cab9..a0d8bdc 100644 --- a/tests/repr_packed.rs +++ b/tests/repr_packed.rs @@ -1,8 +1,5 @@ #![warn(rust_2018_idioms, single_use_lifetimes)] -// unaligned_references did not exist in older compilers and safe_packed_borrows was removed in the latest compilers. -// https://github.com/rust-lang/rust/pull/82525 -#![allow(unknown_lints, renamed_and_removed_lints)] -#![forbid(unaligned_references, safe_packed_borrows)] +#![forbid(safe_packed_borrows)] use std::cell::Cell; @@ -33,7 +30,7 @@ fn weird_repr_packed() { fn drop(&mut self) { FIELD_ADDR.with(|f| { f.set(&self.field as *const u8 as usize); - }); + }) } } @@ -48,5 +45,5 @@ fn weird_repr_packed() { let field_addr = &x.field as *const u8 as usize; field_addr }; - assert_eq!(field_addr, FIELD_ADDR.with(Cell::get)); + assert_eq!(field_addr, FIELD_ADDR.with(|f| f.get())); } diff --git a/tests/ui/cfg/cfg_attr-type-mismatch.rs b/tests/ui/cfg/cfg_attr-type-mismatch.rs index 1b9664b..b075af9 100644 --- a/tests/ui/cfg/cfg_attr-type-mismatch.rs +++ b/tests/ui/cfg/cfg_attr-type-mismatch.rs @@ -1,6 +1,5 @@ -use std::pin::Pin; - use pin_project::pin_project; +use std::pin::Pin; #[cfg_attr(not(any()), pin_project)] struct Foo<T> { diff --git a/tests/ui/cfg/cfg_attr-type-mismatch.stderr b/tests/ui/cfg/cfg_attr-type-mismatch.stderr index 576a08c..89172a2 100644 --- a/tests/ui/cfg/cfg_attr-type-mismatch.stderr +++ b/tests/ui/cfg/cfg_attr-type-mismatch.stderr @@ -1,7 +1,7 @@ error[E0308]: mismatched types - --> $DIR/cfg_attr-type-mismatch.rs:20:27 + --> $DIR/cfg_attr-type-mismatch.rs:19:27 | -20 | let _: Pin<&mut u8> = x.f; //~ ERROR E0308 +19 | let _: Pin<&mut u8> = x.f; //~ ERROR E0308 | ------------ ^^^ expected struct `Pin`, found `&mut u8` | | | expected due to this @@ -10,9 +10,9 @@ error[E0308]: mismatched types found mutable reference `&mut u8` error[E0308]: mismatched types - --> $DIR/cfg_attr-type-mismatch.rs:24:22 + --> $DIR/cfg_attr-type-mismatch.rs:23:22 | -24 | let _: &mut u8 = x.f; //~ ERROR E0308 +23 | let _: &mut u8 = x.f; //~ ERROR E0308 | ------- ^^^ | | | | | expected `&mut u8`, found struct `Pin` diff --git a/tests/ui/cfg/packed_sneaky-span-issue-1.rs b/tests/ui/cfg/packed_sneaky-span-issue-1.rs index 7e19952..42f57b5 100644 --- a/tests/ui/cfg/packed_sneaky-span-issue-1.rs +++ b/tests/ui/cfg/packed_sneaky-span-issue-1.rs @@ -2,8 +2,9 @@ use auxiliary_macro::hidden_repr; use pin_project::pin_project; #[pin_project] -#[hidden_repr(packed)] //~ ERROR may not be used on #[repr(packed)] types +#[hidden_repr(packed)] struct S { + //~^ ERROR may not be used on #[repr(packed)] types #[cfg(not(any()))] #[pin] f: u32, diff --git a/tests/ui/cfg/packed_sneaky-span-issue-1.stderr b/tests/ui/cfg/packed_sneaky-span-issue-1.stderr index c98d3ee..abe3ecd 100644 --- a/tests/ui/cfg/packed_sneaky-span-issue-1.stderr +++ b/tests/ui/cfg/packed_sneaky-span-issue-1.stderr @@ -1,5 +1,11 @@ error: #[pin_project] attribute may not be used on #[repr(packed)] types - --> $DIR/packed_sneaky-span-issue-1.rs:5:15 - | -5 | #[hidden_repr(packed)] //~ ERROR may not be used on #[repr(packed)] types - | ^^^^^^ + --> $DIR/packed_sneaky-span-issue-1.rs:6:1 + | +6 | / struct S { +7 | | //~^ ERROR may not be used on #[repr(packed)] types +8 | | #[cfg(not(any()))] +9 | | #[pin] +... | +13 | | f: u8, +14 | | } + | |_^ diff --git a/tests/ui/cfg/packed_sneaky-span-issue-2.rs b/tests/ui/cfg/packed_sneaky-span-issue-2.rs index fcea76b..948d72c 100644 --- a/tests/ui/cfg/packed_sneaky-span-issue-2.rs +++ b/tests/ui/cfg/packed_sneaky-span-issue-2.rs @@ -2,8 +2,9 @@ use auxiliary_macro::hidden_repr; use pin_project::pin_project; #[pin_project] -#[hidden_repr(packed)] //~ ERROR may not be used on #[repr(packed)] types +#[hidden_repr(packed)] struct S { + //~^ ERROR may not be used on #[repr(packed)] types #[cfg(any())] #[pin] f: u32, diff --git a/tests/ui/cfg/packed_sneaky-span-issue-2.stderr b/tests/ui/cfg/packed_sneaky-span-issue-2.stderr index 25b9cdc..a957ceb 100644 --- a/tests/ui/cfg/packed_sneaky-span-issue-2.stderr +++ b/tests/ui/cfg/packed_sneaky-span-issue-2.stderr @@ -1,5 +1,11 @@ error: #[pin_project] attribute may not be used on #[repr(packed)] types - --> $DIR/packed_sneaky-span-issue-2.rs:5:15 - | -5 | #[hidden_repr(packed)] //~ ERROR may not be used on #[repr(packed)] types - | ^^^^^^ + --> $DIR/packed_sneaky-span-issue-2.rs:6:1 + | +6 | / struct S { +7 | | //~^ ERROR may not be used on #[repr(packed)] types +8 | | #[cfg(any())] +9 | | #[pin] +... | +13 | | f: u8, +14 | | } + | |_^ diff --git a/tests/ui/cfg/unsupported.stderr b/tests/ui/cfg/unsupported.stderr index 7ad20d1..b3bd1ae 100644 --- a/tests/ui/cfg/unsupported.stderr +++ b/tests/ui/cfg/unsupported.stderr @@ -1,8 +1,7 @@ error: #[pin_project] attribute may not be used on structs with zero fields - --> $DIR/unsupported.rs:4:10 + --> $DIR/unsupported.rs:4:1 | -4 | struct S { - | __________^ +4 | / struct S { 5 | | //~^ ERROR may not be used on structs with zero fields 6 | | #[cfg(any())] 7 | | #[pin] diff --git a/tests/ui/not_unpin/conflict-unpin.stderr b/tests/ui/not_unpin/conflict-unpin.stderr index 7b43b0f..e90a574 100644 --- a/tests/ui/not_unpin/conflict-unpin.stderr +++ b/tests/ui/not_unpin/conflict-unpin.stderr @@ -1,4 +1,4 @@ -error[E0119]: conflicting implementations of trait `std::marker::Unpin` for type `Foo<_, _>` +error[E0119]: conflicting implementations of trait `std::marker::Unpin` for type `Foo<_, _>`: --> $DIR/conflict-unpin.rs:3:15 | 3 | #[pin_project(!Unpin)] //~ ERROR E0119 @@ -7,7 +7,7 @@ error[E0119]: conflicting implementations of trait `std::marker::Unpin` for type 10 | impl<T, U> Unpin for Foo<T, U> where T: Unpin {} | --------------------------------------------- first implementation here -error[E0119]: conflicting implementations of trait `std::marker::Unpin` for type `Bar<_, _>` +error[E0119]: conflicting implementations of trait `std::marker::Unpin` for type `Bar<_, _>`: --> $DIR/conflict-unpin.rs:12:15 | 12 | #[pin_project(!Unpin)] //~ ERROR E0119 @@ -16,7 +16,7 @@ error[E0119]: conflicting implementations of trait `std::marker::Unpin` for type 19 | impl<T, U> Unpin for Bar<T, U> {} | ------------------------------ first implementation here -error[E0119]: conflicting implementations of trait `std::marker::Unpin` for type `Baz<_, _>` +error[E0119]: conflicting implementations of trait `std::marker::Unpin` for type `Baz<_, _>`: --> $DIR/conflict-unpin.rs:21:15 | 21 | #[pin_project(!Unpin)] //~ ERROR E0119 diff --git a/tests/ui/not_unpin/impl-unsafe-unpin.stderr b/tests/ui/not_unpin/impl-unsafe-unpin.stderr index 7051bd8..ba80d5e 100644 --- a/tests/ui/not_unpin/impl-unsafe-unpin.stderr +++ b/tests/ui/not_unpin/impl-unsafe-unpin.stderr @@ -1,4 +1,4 @@ -error[E0119]: conflicting implementations of trait `pin_project::UnsafeUnpin` for type `Foo<_, _>` +error[E0119]: conflicting implementations of trait `pin_project::UnsafeUnpin` for type `Foo<_, _>`: --> $DIR/impl-unsafe-unpin.rs:3:1 | 3 | #[pin_project(!Unpin)] //~ ERROR E0119 @@ -7,9 +7,9 @@ error[E0119]: conflicting implementations of trait `pin_project::UnsafeUnpin` fo 10 | unsafe impl<T, U> UnsafeUnpin for Foo<T, U> where T: Unpin {} | ---------------------------------------------------------- first implementation here | - = note: this error originates in the derive macro `::pin_project::__private::__PinProjectInternalDerive` (in Nightly builds, run with -Z macro-backtrace for more info) + = note: this error originates in a derive macro (in Nightly builds, run with -Z macro-backtrace for more info) -error[E0119]: conflicting implementations of trait `pin_project::UnsafeUnpin` for type `Bar<_, _>` +error[E0119]: conflicting implementations of trait `pin_project::UnsafeUnpin` for type `Bar<_, _>`: --> $DIR/impl-unsafe-unpin.rs:12:1 | 12 | #[pin_project(!Unpin)] //~ ERROR E0119 @@ -18,9 +18,9 @@ error[E0119]: conflicting implementations of trait `pin_project::UnsafeUnpin` fo 19 | unsafe impl<T, U> UnsafeUnpin for Bar<T, U> {} | ------------------------------------------- first implementation here | - = note: this error originates in the derive macro `::pin_project::__private::__PinProjectInternalDerive` (in Nightly builds, run with -Z macro-backtrace for more info) + = note: this error originates in a derive macro (in Nightly builds, run with -Z macro-backtrace for more info) -error[E0119]: conflicting implementations of trait `pin_project::UnsafeUnpin` for type `Baz<_, _>` +error[E0119]: conflicting implementations of trait `pin_project::UnsafeUnpin` for type `Baz<_, _>`: --> $DIR/impl-unsafe-unpin.rs:21:1 | 21 | #[pin_project(!Unpin)] //~ ERROR E0119 @@ -29,4 +29,4 @@ error[E0119]: conflicting implementations of trait `pin_project::UnsafeUnpin` fo 28 | unsafe impl<T: Unpin, U: Unpin> UnsafeUnpin for Baz<T, U> {} | --------------------------------------------------------- first implementation here | - = note: this error originates in the derive macro `::pin_project::__private::__PinProjectInternalDerive` (in Nightly builds, run with -Z macro-backtrace for more info) + = note: this error originates in a derive macro (in Nightly builds, run with -Z macro-backtrace for more info) diff --git a/tests/ui/pin_project/add-attr-to-struct.rs b/tests/ui/pin_project/add-attr-to-struct.rs index 045e796..55f1561 100644 --- a/tests/ui/pin_project/add-attr-to-struct.rs +++ b/tests/ui/pin_project/add-attr-to-struct.rs @@ -1,7 +1,6 @@ -use std::marker::PhantomPinned; - use auxiliary_macro::add_pin_attr; use pin_project::pin_project; +use std::marker::PhantomPinned; #[pin_project] #[add_pin_attr(struct)] //~ ERROR duplicate #[pin] attribute diff --git a/tests/ui/pin_project/add-attr-to-struct.stderr b/tests/ui/pin_project/add-attr-to-struct.stderr index b28559b..27656d6 100644 --- a/tests/ui/pin_project/add-attr-to-struct.stderr +++ b/tests/ui/pin_project/add-attr-to-struct.stderr @@ -1,15 +1,15 @@ error: duplicate #[pin] attribute - --> $DIR/add-attr-to-struct.rs:7:1 + --> $DIR/add-attr-to-struct.rs:6:1 | -7 | #[add_pin_attr(struct)] //~ ERROR duplicate #[pin] attribute +6 | #[add_pin_attr(struct)] //~ ERROR duplicate #[pin] attribute | ^^^^^^^^^^^^^^^^^^^^^^^ | - = note: this error originates in the attribute macro `add_pin_attr` (in Nightly builds, run with -Z macro-backtrace for more info) + = note: this error originates in an attribute macro (in Nightly builds, run with -Z macro-backtrace for more info) error: #[pin] attribute may only be used on fields of structs or variants - --> $DIR/add-attr-to-struct.rs:13:1 + --> $DIR/add-attr-to-struct.rs:12:1 | -13 | #[add_pin_attr(struct)] //~ ERROR #[pin] attribute may only be used on fields of structs or variants +12 | #[add_pin_attr(struct)] //~ ERROR #[pin] attribute may only be used on fields of structs or variants | ^^^^^^^^^^^^^^^^^^^^^^^ | - = note: this error originates in the attribute macro `add_pin_attr` (in Nightly builds, run with -Z macro-backtrace for more info) + = note: this error originates in an attribute macro (in Nightly builds, run with -Z macro-backtrace for more info) diff --git a/tests/ui/pin_project/add-pinned-field.stderr b/tests/ui/pin_project/add-pinned-field.stderr index bdeafb8..a140694 100644 --- a/tests/ui/pin_project/add-pinned-field.stderr +++ b/tests/ui/pin_project/add-pinned-field.stderr @@ -7,21 +7,8 @@ error[E0277]: `PhantomPinned` cannot be unpinned 21 | is_unpin::<Foo>(); //~ ERROR E0277 | ^^^^^^^^^^^^^^^ within `__Foo<'_>`, the trait `Unpin` is not implemented for `PhantomPinned` | - = note: consider using `Box::pin` -note: required because it appears within the type `__Foo<'_>` - --> $DIR/add-pinned-field.rs:8:8 - | -8 | struct Foo { - | ^^^ -note: required because of the requirements on the impl of `Unpin` for `Foo` - --> $DIR/add-pinned-field.rs:6:1 - | -6 | #[pin_project] - | ^^^^^^^^^^^^^^ -7 | #[add_pinned_field] -8 | struct Foo { - | ^^^ - = note: this error originates in the derive macro `::pin_project::__private::__PinProjectInternalDerive` (in Nightly builds, run with -Z macro-backtrace for more info) + = note: required because it appears within the type `__Foo<'_>` + = note: required because of the requirements on the impl of `Unpin` for `Foo` error[E0277]: `PhantomPinned` cannot be unpinned --> $DIR/add-pinned-field.rs:22:5 @@ -32,17 +19,5 @@ error[E0277]: `PhantomPinned` cannot be unpinned 22 | is_unpin::<Bar>(); //~ ERROR E0277 | ^^^^^^^^^^^^^^^ within `__Bar<'_>`, the trait `Unpin` is not implemented for `PhantomPinned` | - = note: consider using `Box::pin` -note: required because it appears within the type `__Bar<'_>` - --> $DIR/add-pinned-field.rs:15:8 - | -15 | struct Bar { - | ^^^ -note: required because of the requirements on the impl of `Unpin` for `Bar` - --> $DIR/add-pinned-field.rs:14:1 - | -14 | #[pin_project] - | ^^^^^^^^^^^^^^ -15 | struct Bar { - | ^^^ - = note: this error originates in the derive macro `::pin_project::__private::__PinProjectInternalDerive` (in Nightly builds, run with -Z macro-backtrace for more info) + = note: required because it appears within the type `__Bar<'_>` + = note: required because of the requirements on the impl of `Unpin` for `Bar` diff --git a/tests/ui/pin_project/conflict-drop.rs b/tests/ui/pin_project/conflict-drop.rs index 4fdb118..908f5c0 100644 --- a/tests/ui/pin_project/conflict-drop.rs +++ b/tests/ui/pin_project/conflict-drop.rs @@ -1,6 +1,5 @@ -use std::pin::Pin; - use pin_project::{pin_project, pinned_drop}; +use std::pin::Pin; #[pin_project] //~ ERROR E0119 struct Foo<T, U> { diff --git a/tests/ui/pin_project/conflict-drop.stderr b/tests/ui/pin_project/conflict-drop.stderr index 25b0e00..d5ca7b3 100644 --- a/tests/ui/pin_project/conflict-drop.stderr +++ b/tests/ui/pin_project/conflict-drop.stderr @@ -1,19 +1,19 @@ -error[E0119]: conflicting implementations of trait `_::FooMustNotImplDrop` for type `Foo<_, _>` - --> $DIR/conflict-drop.rs:5:1 +error[E0119]: conflicting implementations of trait `_::FooMustNotImplDrop` for type `Foo<_, _>`: + --> $DIR/conflict-drop.rs:4:1 | -5 | #[pin_project] //~ ERROR E0119 +4 | #[pin_project] //~ ERROR E0119 | ^^^^^^^^^^^^^^ | | | first implementation here | conflicting implementation for `Foo<_, _>` | - = note: this error originates in the derive macro `::pin_project::__private::__PinProjectInternalDerive` (in Nightly builds, run with -Z macro-backtrace for more info) + = note: this error originates in a derive macro (in Nightly builds, run with -Z macro-backtrace for more info) -error[E0119]: conflicting implementations of trait `std::ops::Drop` for type `Bar<_, _>` - --> $DIR/conflict-drop.rs:16:15 +error[E0119]: conflicting implementations of trait `std::ops::Drop` for type `Bar<_, _>`: + --> $DIR/conflict-drop.rs:15:15 | -16 | #[pin_project(PinnedDrop)] //~ ERROR E0119 +15 | #[pin_project(PinnedDrop)] //~ ERROR E0119 | ^^^^^^^^^^ conflicting implementation for `Bar<_, _>` ... -28 | impl<T, U> Drop for Bar<T, U> { +27 | impl<T, U> Drop for Bar<T, U> { | ----------------------------- first implementation here diff --git a/tests/ui/pin_project/conflict-unpin.stderr b/tests/ui/pin_project/conflict-unpin.stderr index 5a16469..0d6f439 100644 --- a/tests/ui/pin_project/conflict-unpin.stderr +++ b/tests/ui/pin_project/conflict-unpin.stderr @@ -1,4 +1,4 @@ -error[E0119]: conflicting implementations of trait `std::marker::Unpin` for type `Foo<_, _>` +error[E0119]: conflicting implementations of trait `std::marker::Unpin` for type `Foo<_, _>`: --> $DIR/conflict-unpin.rs:5:1 | 5 | #[pin_project] //~ ERROR E0119 @@ -7,9 +7,9 @@ error[E0119]: conflicting implementations of trait `std::marker::Unpin` for type 13 | impl<T, U> Unpin for Foo<T, U> where T: Unpin {} // Conditional Unpin impl | --------------------------------------------- first implementation here | - = note: this error originates in the derive macro `::pin_project::__private::__PinProjectInternalDerive` (in Nightly builds, run with -Z macro-backtrace for more info) + = note: this error originates in a derive macro (in Nightly builds, run with -Z macro-backtrace for more info) -error[E0119]: conflicting implementations of trait `std::marker::Unpin` for type `Bar<_, _>` +error[E0119]: conflicting implementations of trait `std::marker::Unpin` for type `Bar<_, _>`: --> $DIR/conflict-unpin.rs:17:1 | 17 | #[pin_project] //~ ERROR E0119 @@ -18,9 +18,9 @@ error[E0119]: conflicting implementations of trait `std::marker::Unpin` for type 25 | impl<T, U> Unpin for Bar<T, U> {} // Non-conditional Unpin impl | ------------------------------ first implementation here | - = note: this error originates in the derive macro `::pin_project::__private::__PinProjectInternalDerive` (in Nightly builds, run with -Z macro-backtrace for more info) + = note: this error originates in a derive macro (in Nightly builds, run with -Z macro-backtrace for more info) -error[E0119]: conflicting implementations of trait `std::marker::Unpin` for type `Baz<_, _>` +error[E0119]: conflicting implementations of trait `std::marker::Unpin` for type `Baz<_, _>`: --> $DIR/conflict-unpin.rs:27:1 | 27 | #[pin_project] //~ ERROR E0119 @@ -29,4 +29,4 @@ error[E0119]: conflicting implementations of trait `std::marker::Unpin` for type 35 | impl<T: Unpin, U: Unpin> Unpin for Baz<T, U> {} // Conditional Unpin impl | -------------------------------------------- first implementation here | - = note: this error originates in the derive macro `::pin_project::__private::__PinProjectInternalDerive` (in Nightly builds, run with -Z macro-backtrace for more info) + = note: this error originates in a derive macro (in Nightly builds, run with -Z macro-backtrace for more info) diff --git a/tests/ui/pin_project/impl-unsafe-unpin.stderr b/tests/ui/pin_project/impl-unsafe-unpin.stderr index e97d31b..78545c2 100644 --- a/tests/ui/pin_project/impl-unsafe-unpin.stderr +++ b/tests/ui/pin_project/impl-unsafe-unpin.stderr @@ -1,4 +1,4 @@ -error[E0119]: conflicting implementations of trait `pin_project::UnsafeUnpin` for type `Foo<_, _>` +error[E0119]: conflicting implementations of trait `pin_project::UnsafeUnpin` for type `Foo<_, _>`: --> $DIR/impl-unsafe-unpin.rs:3:1 | 3 | #[pin_project] //~ ERROR E0119 @@ -7,9 +7,9 @@ error[E0119]: conflicting implementations of trait `pin_project::UnsafeUnpin` fo 10 | unsafe impl<T, U> UnsafeUnpin for Foo<T, U> where T: Unpin {} | ---------------------------------------------------------- first implementation here | - = note: this error originates in the derive macro `::pin_project::__private::__PinProjectInternalDerive` (in Nightly builds, run with -Z macro-backtrace for more info) + = note: this error originates in a derive macro (in Nightly builds, run with -Z macro-backtrace for more info) -error[E0119]: conflicting implementations of trait `pin_project::UnsafeUnpin` for type `Bar<_, _>` +error[E0119]: conflicting implementations of trait `pin_project::UnsafeUnpin` for type `Bar<_, _>`: --> $DIR/impl-unsafe-unpin.rs:12:1 | 12 | #[pin_project] //~ ERROR E0119 @@ -18,9 +18,9 @@ error[E0119]: conflicting implementations of trait `pin_project::UnsafeUnpin` fo 19 | unsafe impl<T, U> UnsafeUnpin for Bar<T, U> {} | ------------------------------------------- first implementation here | - = note: this error originates in the derive macro `::pin_project::__private::__PinProjectInternalDerive` (in Nightly builds, run with -Z macro-backtrace for more info) + = note: this error originates in a derive macro (in Nightly builds, run with -Z macro-backtrace for more info) -error[E0119]: conflicting implementations of trait `pin_project::UnsafeUnpin` for type `Baz<_, _>` +error[E0119]: conflicting implementations of trait `pin_project::UnsafeUnpin` for type `Baz<_, _>`: --> $DIR/impl-unsafe-unpin.rs:21:1 | 21 | #[pin_project] //~ ERROR E0119 @@ -29,4 +29,4 @@ error[E0119]: conflicting implementations of trait `pin_project::UnsafeUnpin` fo 28 | unsafe impl<T: Unpin, U: Unpin> UnsafeUnpin for Baz<T, U> {} | --------------------------------------------------------- first implementation here | - = note: this error originates in the derive macro `::pin_project::__private::__PinProjectInternalDerive` (in Nightly builds, run with -Z macro-backtrace for more info) + = note: this error originates in a derive macro (in Nightly builds, run with -Z macro-backtrace for more info) diff --git a/tests/ui/pin_project/overlapping_unpin_struct.rs b/tests/ui/pin_project/overlapping_unpin_struct.rs index abfd5d1..8db0855 100644 --- a/tests/ui/pin_project/overlapping_unpin_struct.rs +++ b/tests/ui/pin_project/overlapping_unpin_struct.rs @@ -1,6 +1,5 @@ -use std::marker::PhantomPinned; - use pin_project::pin_project; +use std::marker::PhantomPinned; #[pin_project] struct S<T> { diff --git a/tests/ui/pin_project/overlapping_unpin_struct.stderr b/tests/ui/pin_project/overlapping_unpin_struct.stderr index bb33944..296b063 100644 --- a/tests/ui/pin_project/overlapping_unpin_struct.stderr +++ b/tests/ui/pin_project/overlapping_unpin_struct.stderr @@ -1,23 +1,11 @@ error[E0277]: `PhantomPinned` cannot be unpinned - --> $DIR/overlapping_unpin_struct.rs:18:5 + --> $DIR/overlapping_unpin_struct.rs:17:5 | -15 | fn is_unpin<T: Unpin>() {} +14 | fn is_unpin<T: Unpin>() {} | ----- required by this bound in `is_unpin` ... -18 | is_unpin::<S<PhantomPinned>>(); //~ ERROR E0277 +17 | is_unpin::<S<PhantomPinned>>(); //~ ERROR E0277 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ within `_::__S<'_, PhantomPinned>`, the trait `Unpin` is not implemented for `PhantomPinned` | - = note: consider using `Box::pin` -note: required because it appears within the type `_::__S<'_, PhantomPinned>` - --> $DIR/overlapping_unpin_struct.rs:6:8 - | -6 | struct S<T> { - | ^ -note: required because of the requirements on the impl of `Unpin` for `S<PhantomPinned>` - --> $DIR/overlapping_unpin_struct.rs:5:1 - | -5 | #[pin_project] - | ^^^^^^^^^^^^^^ -6 | struct S<T> { - | ^^^^ - = note: this error originates in the derive macro `::pin_project::__private::__PinProjectInternalDerive` (in Nightly builds, run with -Z macro-backtrace for more info) + = note: required because it appears within the type `_::__S<'_, PhantomPinned>` + = note: required because of the requirements on the impl of `Unpin` for `S<PhantomPinned>` diff --git a/tests/ui/pin_project/packed-enum.rs b/tests/ui/pin_project/packed-enum.rs index 023c08d..9d4a4c3 100644 --- a/tests/ui/pin_project/packed-enum.rs +++ b/tests/ui/pin_project/packed-enum.rs @@ -1,9 +1,5 @@ use pin_project::pin_project; -// #[repr(packed)] cannot be apply on enums and will be rejected by rustc. -// However, we should not rely on the behavior of rustc that rejects this. -// https://github.com/taiki-e/pin-project/pull/324#discussion_r612388001 - #[repr(packed)] //~ ERROR E0517 enum E1 { V(()), diff --git a/tests/ui/pin_project/packed-enum.stderr b/tests/ui/pin_project/packed-enum.stderr index 0951944..afc8b30 100644 --- a/tests/ui/pin_project/packed-enum.stderr +++ b/tests/ui/pin_project/packed-enum.stderr @@ -1,42 +1,30 @@ -error: #[repr(packed)] attribute should be applied to a struct or union - --> $DIR/packed-enum.rs:13:8 - | -13 | #[repr(packed)] //~ ERROR E0517 - | ^^^^^^ - -error: #[repr(packed)] attribute should be applied to a struct or union - --> $DIR/packed-enum.rs:18:8 - | -18 | #[repr(packed)] //~ ERROR E0517 - | ^^^^^^ - error[E0517]: attribute should be applied to a struct or union - --> $DIR/packed-enum.rs:7:8 - | -7 | #[repr(packed)] //~ ERROR E0517 - | ^^^^^^ -8 | / enum E1 { -9 | | V(()), -10 | | } - | |_- not a struct or union + --> $DIR/packed-enum.rs:3:8 + | +3 | #[repr(packed)] //~ ERROR E0517 + | ^^^^^^ +4 | / enum E1 { +5 | | V(()), +6 | | } + | |_- not a struct or union error[E0517]: attribute should be applied to a struct or union - --> $DIR/packed-enum.rs:13:8 + --> $DIR/packed-enum.rs:9:8 | -13 | #[repr(packed)] //~ ERROR E0517 +9 | #[repr(packed)] //~ ERROR E0517 | ^^^^^^ -14 | / enum E2 { -15 | | V(()), -16 | | } +10 | / enum E2 { +11 | | V(()), +12 | | } | |_- not a struct or union error[E0517]: attribute should be applied to a struct or union - --> $DIR/packed-enum.rs:18:8 + --> $DIR/packed-enum.rs:14:8 | -18 | #[repr(packed)] //~ ERROR E0517 +14 | #[repr(packed)] //~ ERROR E0517 | ^^^^^^ -19 | #[pin_project] -20 | / enum E3 { -21 | | V(()), -22 | | } +15 | #[pin_project] +16 | / enum E3 { +17 | | V(()), +18 | | } | |_- not a struct or union diff --git a/tests/ui/pin_project/packed-name-value.rs b/tests/ui/pin_project/packed-name-value.rs index dedc403..ed819ca 100644 --- a/tests/ui/pin_project/packed-name-value.rs +++ b/tests/ui/pin_project/packed-name-value.rs @@ -1,24 +1,17 @@ use pin_project::pin_project; -// #[repr(packed = "")] is not valid format of #[repr(packed)] and will be -// rejected by rustc. -// However, we should not rely on the behavior of rustc that rejects this. -// https://github.com/taiki-e/pin-project/pull/324#discussion_r612388001 - -// https://github.com/taiki-e/pin-project/pull/324#discussion_r612388001 -// https://github.com/rust-lang/rust/issues/83921 -// #[repr(packed = "")] //~ ERROR E0552 -// struct S1 { -// f: (), -// } +#[repr(packed = "")] //~ ERROR E0552 +struct S1 { + f: (), +} #[pin_project] -#[repr(packed = "")] //~ ERROR attribute should not be name-value pair +#[repr(packed = "")] //~ ERROR E0552 struct S2 { f: (), } -#[repr(packed = "")] //~ ERROR attribute should not be name-value pair +#[repr(packed = "")] //~ ERROR E0552 #[pin_project] struct S3 { f: (), diff --git a/tests/ui/pin_project/packed-name-value.stderr b/tests/ui/pin_project/packed-name-value.stderr index 18137d4..a3e2571 100644 --- a/tests/ui/pin_project/packed-name-value.stderr +++ b/tests/ui/pin_project/packed-name-value.stderr @@ -1,23 +1,17 @@ -error: #[repr(packed)] attribute should not be name-value pair - --> $DIR/packed-name-value.rs:16:8 - | -16 | #[repr(packed = "")] //~ ERROR attribute should not be name-value pair - | ^^^^^^^^^^^ +error[E0552]: unrecognized representation hint + --> $DIR/packed-name-value.rs:3:8 + | +3 | #[repr(packed = "")] //~ ERROR E0552 + | ^^^^^^^^^^^ -error: #[repr(packed)] attribute should not be name-value pair - --> $DIR/packed-name-value.rs:21:8 - | -21 | #[repr(packed = "")] //~ ERROR attribute should not be name-value pair - | ^^^^^^^^^^^ +error[E0552]: unrecognized representation hint + --> $DIR/packed-name-value.rs:9:8 + | +9 | #[repr(packed = "")] //~ ERROR E0552 + | ^^^^^^^^^^^ -error[E0693]: incorrect `repr(packed)` attribute format - --> $DIR/packed-name-value.rs:16:8 +error[E0552]: unrecognized representation hint + --> $DIR/packed-name-value.rs:14:8 | -16 | #[repr(packed = "")] //~ ERROR attribute should not be name-value pair - | ^^^^^^^^^^^ help: use parentheses instead: `packed()` - -error[E0693]: incorrect `repr(packed)` attribute format - --> $DIR/packed-name-value.rs:21:8 - | -21 | #[repr(packed = "")] //~ ERROR attribute should not be name-value pair - | ^^^^^^^^^^^ help: use parentheses instead: `packed()` +14 | #[repr(packed = "")] //~ ERROR E0552 + | ^^^^^^^^^^^ diff --git a/tests/ui/pin_project/packed.rs b/tests/ui/pin_project/packed.rs index dd3ebfd..f756605 100644 --- a/tests/ui/pin_project/packed.rs +++ b/tests/ui/pin_project/packed.rs @@ -2,7 +2,7 @@ use pin_project::pin_project; #[pin_project] #[repr(packed, C)] //~ ERROR may not be used on #[repr(packed)] types -struct Packed1 { +struct A { #[pin] f: u8, } @@ -10,22 +10,14 @@ struct Packed1 { // Test putting 'repr' before the 'pin_project' attribute #[repr(packed, C)] //~ ERROR may not be used on #[repr(packed)] types #[pin_project] -struct Packed2 { +struct B { #[pin] f: u8, } #[pin_project] #[repr(packed(2))] //~ ERROR may not be used on #[repr(packed)] types -struct PackedN1 { - #[pin] - f: u32, -} - -// Test putting 'repr' before the 'pin_project' attribute -#[repr(packed(2))] //~ ERROR may not be used on #[repr(packed)] types -#[pin_project] -struct PackedN2 { +struct C { #[pin] f: u32, } diff --git a/tests/ui/pin_project/packed.stderr b/tests/ui/pin_project/packed.stderr index e5b9e55..969faea 100644 --- a/tests/ui/pin_project/packed.stderr +++ b/tests/ui/pin_project/packed.stderr @@ -15,9 +15,3 @@ error: #[pin_project] attribute may not be used on #[repr(packed)] types | 19 | #[repr(packed(2))] //~ ERROR may not be used on #[repr(packed)] types | ^^^^^^^^^ - -error: #[pin_project] attribute may not be used on #[repr(packed)] types - --> $DIR/packed.rs:26:8 - | -26 | #[repr(packed(2))] //~ ERROR may not be used on #[repr(packed)] types - | ^^^^^^^^^ diff --git a/tests/ui/pin_project/packed_sneaky-1.rs b/tests/ui/pin_project/packed_sneaky-1.rs index 72d3d3e..38f6fe0 100644 --- a/tests/ui/pin_project/packed_sneaky-1.rs +++ b/tests/ui/pin_project/packed_sneaky-1.rs @@ -1,7 +1,6 @@ -use std::pin::Pin; - use auxiliary_macro::hidden_repr; use pin_project::{pin_project, pinned_drop, UnsafeUnpin}; +use std::pin::Pin; #[pin_project] //~ ERROR may not be used on #[repr(packed)] types #[hidden_repr(packed)] diff --git a/tests/ui/pin_project/packed_sneaky-1.stderr b/tests/ui/pin_project/packed_sneaky-1.stderr index 67bcd1b..510200e 100644 --- a/tests/ui/pin_project/packed_sneaky-1.stderr +++ b/tests/ui/pin_project/packed_sneaky-1.stderr @@ -1,17 +1,17 @@ error: #[pin_project] attribute may not be used on #[repr(packed)] types - --> $DIR/packed_sneaky-1.rs:7:15 + --> $DIR/packed_sneaky-1.rs:6:15 | -7 | #[hidden_repr(packed)] +6 | #[hidden_repr(packed)] | ^^^^^^ error: #[pin_project] attribute may not be used on #[repr(packed)] types - --> $DIR/packed_sneaky-1.rs:14:15 + --> $DIR/packed_sneaky-1.rs:13:15 | -14 | #[hidden_repr(packed)] +13 | #[hidden_repr(packed)] | ^^^^^^ error: #[pin_project] attribute may not be used on #[repr(packed)] types - --> $DIR/packed_sneaky-1.rs:23:15 + --> $DIR/packed_sneaky-1.rs:22:15 | -23 | #[hidden_repr(packed)] +22 | #[hidden_repr(packed)] | ^^^^^^ diff --git a/tests/ui/pin_project/packed_sneaky-2.stderr b/tests/ui/pin_project/packed_sneaky-2.stderr index 04d072a..51987a2 100644 --- a/tests/ui/pin_project/packed_sneaky-2.stderr +++ b/tests/ui/pin_project/packed_sneaky-2.stderr @@ -10,4 +10,4 @@ error: #[pin_project] attribute may not be used on #[repr(packed)] types 10 | | } | |_^ | - = note: this error originates in the macro `hidden_repr_macro` (in Nightly builds, run with -Z macro-backtrace for more info) + = note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info) diff --git a/tests/ui/pin_project/packed_sneaky-3.stderr b/tests/ui/pin_project/packed_sneaky-3.stderr index 1a5a3ec..b953e9f 100644 --- a/tests/ui/pin_project/packed_sneaky-3.stderr +++ b/tests/ui/pin_project/packed_sneaky-3.stderr @@ -4,7 +4,7 @@ error: expected item after attributes 4 | hidden_repr_macro! {} //~ ERROR expected item after attributes | ^^^^^^^^^^^^^^^^^^^^^ | - = note: this error originates in the macro `hidden_repr_macro` (in Nightly builds, run with -Z macro-backtrace for more info) + = note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info) error: expected item after attributes --> $DIR/packed_sneaky-3.rs:13:9 @@ -15,7 +15,7 @@ error: expected item after attributes 17 | hidden_repr_macro2! {} | ---------------------- in this macro invocation | - = note: this error originates in the macro `hidden_repr_macro2` (in Nightly builds, run with -Z macro-backtrace for more info) + = note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info) error: expected item after attributes --> $DIR/packed_sneaky-3.rs:24:10 @@ -23,7 +23,7 @@ error: expected item after attributes 24 | #[derive(HiddenRepr)] //~ ERROR expected item after attributes | ^^^^^^^^^^ | - = note: this error originates in the derive macro `HiddenRepr` (in Nightly builds, run with -Z macro-backtrace for more info) + = note: this error originates in a derive macro (in Nightly builds, run with -Z macro-backtrace for more info) error: proc-macro derive produced unparseable tokens --> $DIR/packed_sneaky-3.rs:24:10 diff --git a/tests/ui/pin_project/project_replace_unsized.stderr b/tests/ui/pin_project/project_replace_unsized.stderr index d20d858..26e416a 100644 --- a/tests/ui/pin_project/project_replace_unsized.stderr +++ b/tests/ui/pin_project/project_replace_unsized.stderr @@ -4,13 +4,9 @@ error[E0277]: the size for values of type `T` cannot be known at compilation tim 3 | #[pin_project(project_replace)] //~ ERROR E0277 | ^^^^^^^^^^^^^^^ doesn't have a size known at compile-time 4 | struct Struct<T: ?Sized> { - | - this type parameter needs to be `std::marker::Sized` + | - this type parameter needs to be `Sized` | -note: required because it appears within the type `Struct<T>` - --> $DIR/project_replace_unsized.rs:4:8 - | -4 | struct Struct<T: ?Sized> { - | ^^^^^^ + = note: required because it appears within the type `Struct<T>` = help: unsized fn params are gated as an unstable feature help: function arguments must have a statically known size, borrowed types always have a known size | @@ -18,30 +14,22 @@ help: function arguments must have a statically known size, borrowed types alway | ^ error[E0277]: the size for values of type `T` cannot be known at compilation time - --> $DIR/project_replace_unsized.rs:3:1 - | -3 | #[pin_project(project_replace)] //~ ERROR E0277 - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ doesn't have a size known at compile-time -4 | struct Struct<T: ?Sized> { - | - this type parameter needs to be `std::marker::Sized` - | -note: required because it appears within the type `Struct<T>` - --> $DIR/project_replace_unsized.rs:4:8 - | -4 | struct Struct<T: ?Sized> { - | ^^^^^^ -note: required by `UnsafeOverwriteGuard` - --> $DIR/lib.rs:269:5 - | -269 | pub struct UnsafeOverwriteGuard<T> { - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - = note: this error originates in the derive macro `::pin_project::__private::__PinProjectInternalDerive` (in Nightly builds, run with -Z macro-backtrace for more info) + --> $DIR/project_replace_unsized.rs:3:1 + | +3 | #[pin_project(project_replace)] //~ ERROR E0277 + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ doesn't have a size known at compile-time +4 | struct Struct<T: ?Sized> { + | - this type parameter needs to be `Sized` + | + = note: required because it appears within the type `Struct<T>` + = note: required by `UnsafeOverwriteGuard` + = note: this error originates in a derive macro (in Nightly builds, run with -Z macro-backtrace for more info) error[E0277]: the size for values of type `T` cannot be known at compilation time --> $DIR/project_replace_unsized.rs:5:5 | 4 | struct Struct<T: ?Sized> { - | - this type parameter needs to be `std::marker::Sized` + | - this type parameter needs to be `Sized` 5 | f: T, | ^ doesn't have a size known at compile-time @@ -51,13 +39,9 @@ error[E0277]: the size for values of type `T` cannot be known at compilation tim 8 | #[pin_project(project_replace)] //~ ERROR E0277 | ^^^^^^^^^^^^^^^ doesn't have a size known at compile-time 9 | struct TupleStruct<T: ?Sized>(T); - | - this type parameter needs to be `std::marker::Sized` + | - this type parameter needs to be `Sized` | -note: required because it appears within the type `TupleStruct<T>` - --> $DIR/project_replace_unsized.rs:9:8 - | -9 | struct TupleStruct<T: ?Sized>(T); - | ^^^^^^^^^^^ + = note: required because it appears within the type `TupleStruct<T>` = help: unsized fn params are gated as an unstable feature help: function arguments must have a statically known size, borrowed types always have a known size | @@ -65,30 +49,22 @@ help: function arguments must have a statically known size, borrowed types alway | ^ error[E0277]: the size for values of type `T` cannot be known at compilation time - --> $DIR/project_replace_unsized.rs:8:1 - | -8 | #[pin_project(project_replace)] //~ ERROR E0277 - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ doesn't have a size known at compile-time -9 | struct TupleStruct<T: ?Sized>(T); - | - this type parameter needs to be `std::marker::Sized` - | -note: required because it appears within the type `TupleStruct<T>` - --> $DIR/project_replace_unsized.rs:9:8 - | -9 | struct TupleStruct<T: ?Sized>(T); - | ^^^^^^^^^^^ -note: required by `UnsafeOverwriteGuard` - --> $DIR/lib.rs:269:5 - | -269 | pub struct UnsafeOverwriteGuard<T> { - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - = note: this error originates in the derive macro `::pin_project::__private::__PinProjectInternalDerive` (in Nightly builds, run with -Z macro-backtrace for more info) + --> $DIR/project_replace_unsized.rs:8:1 + | +8 | #[pin_project(project_replace)] //~ ERROR E0277 + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ doesn't have a size known at compile-time +9 | struct TupleStruct<T: ?Sized>(T); + | - this type parameter needs to be `Sized` + | + = note: required because it appears within the type `TupleStruct<T>` + = note: required by `UnsafeOverwriteGuard` + = note: this error originates in a derive macro (in Nightly builds, run with -Z macro-backtrace for more info) error[E0277]: the size for values of type `T` cannot be known at compilation time --> $DIR/project_replace_unsized.rs:9:8 | 9 | struct TupleStruct<T: ?Sized>(T); - | ^^^^^^^^^^^ - this type parameter needs to be `std::marker::Sized` + | ^^^^^^^^^^^ - this type parameter needs to be `Sized` | | | doesn't have a size known at compile-time | diff --git a/tests/ui/pin_project/project_replace_unsized_fn_params.stderr b/tests/ui/pin_project/project_replace_unsized_fn_params.stderr index 8ac4ad7..f0f9573 100644 --- a/tests/ui/pin_project/project_replace_unsized_fn_params.stderr +++ b/tests/ui/pin_project/project_replace_unsized_fn_params.stderr @@ -4,41 +4,29 @@ error[E0277]: the size for values of type `T` cannot be known at compilation tim 6 | struct Struct<T: ?Sized> { | ^^^^^^^-^^^^^^^^^ | | | - | | this type parameter needs to be `std::marker::Sized` + | | this type parameter needs to be `Sized` | doesn't have a size known at compile-time | -note: required because it appears within the type `__StructProjectionOwned<T>` - --> $DIR/project_replace_unsized_fn_params.rs:6:8 - | -6 | struct Struct<T: ?Sized> { - | ^^^^^^ + = note: required because it appears within the type `__StructProjectionOwned<T>` = note: the return type of a function must have a statically known size error[E0277]: the size for values of type `T` cannot be known at compilation time - --> $DIR/project_replace_unsized_fn_params.rs:5:1 - | -5 | #[pin_project(project_replace)] //~ ERROR E0277 - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ doesn't have a size known at compile-time -6 | struct Struct<T: ?Sized> { - | - this type parameter needs to be `std::marker::Sized` - | -note: required because it appears within the type `Struct<T>` - --> $DIR/project_replace_unsized_fn_params.rs:6:8 - | -6 | struct Struct<T: ?Sized> { - | ^^^^^^ -note: required by `UnsafeOverwriteGuard` - --> $DIR/lib.rs:269:5 - | -269 | pub struct UnsafeOverwriteGuard<T> { - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - = note: this error originates in the derive macro `::pin_project::__private::__PinProjectInternalDerive` (in Nightly builds, run with -Z macro-backtrace for more info) + --> $DIR/project_replace_unsized_fn_params.rs:5:1 + | +5 | #[pin_project(project_replace)] //~ ERROR E0277 + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ doesn't have a size known at compile-time +6 | struct Struct<T: ?Sized> { + | - this type parameter needs to be `Sized` + | + = note: required because it appears within the type `Struct<T>` + = note: required by `UnsafeOverwriteGuard` + = note: this error originates in a derive macro (in Nightly builds, run with -Z macro-backtrace for more info) error[E0277]: the size for values of type `T` cannot be known at compilation time --> $DIR/project_replace_unsized_fn_params.rs:7:5 | 6 | struct Struct<T: ?Sized> { - | - this type parameter needs to be `std::marker::Sized` + | - this type parameter needs to be `Sized` 7 | f: T, | ^ doesn't have a size known at compile-time @@ -48,32 +36,20 @@ error[E0277]: the size for values of type `T` cannot be known at compilation tim 11 | struct TupleStruct<T: ?Sized>(T); | ^^^^^^^^^^^^-^^^^^^^^^ | | | - | | this type parameter needs to be `std::marker::Sized` + | | this type parameter needs to be `Sized` | doesn't have a size known at compile-time | -note: required because it appears within the type `__TupleStructProjectionOwned<T>` - --> $DIR/project_replace_unsized_fn_params.rs:11:8 - | -11 | struct TupleStruct<T: ?Sized>(T); - | ^^^^^^^^^^^ + = note: required because it appears within the type `__TupleStructProjectionOwned<T>` = note: the return type of a function must have a statically known size error[E0277]: the size for values of type `T` cannot be known at compilation time - --> $DIR/project_replace_unsized_fn_params.rs:10:1 - | -10 | #[pin_project(project_replace)] //~ ERROR E0277 - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ doesn't have a size known at compile-time -11 | struct TupleStruct<T: ?Sized>(T); - | - this type parameter needs to be `std::marker::Sized` - | -note: required because it appears within the type `TupleStruct<T>` - --> $DIR/project_replace_unsized_fn_params.rs:11:8 - | -11 | struct TupleStruct<T: ?Sized>(T); - | ^^^^^^^^^^^ -note: required by `UnsafeOverwriteGuard` - --> $DIR/lib.rs:269:5 - | -269 | pub struct UnsafeOverwriteGuard<T> { - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - = note: this error originates in the derive macro `::pin_project::__private::__PinProjectInternalDerive` (in Nightly builds, run with -Z macro-backtrace for more info) + --> $DIR/project_replace_unsized_fn_params.rs:10:1 + | +10 | #[pin_project(project_replace)] //~ ERROR E0277 + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ doesn't have a size known at compile-time +11 | struct TupleStruct<T: ?Sized>(T); + | - this type parameter needs to be `Sized` + | + = note: required because it appears within the type `TupleStruct<T>` + = note: required by `UnsafeOverwriteGuard` + = note: this error originates in a derive macro (in Nightly builds, run with -Z macro-backtrace for more info) diff --git a/tests/ui/pin_project/remove-attr-from-field.rs b/tests/ui/pin_project/remove-attr-from-field.rs index fd14da3..bec8302 100644 --- a/tests/ui/pin_project/remove-attr-from-field.rs +++ b/tests/ui/pin_project/remove-attr-from-field.rs @@ -1,7 +1,6 @@ -use std::{marker::PhantomPinned, pin::Pin}; - use auxiliary_macro::remove_attr; use pin_project::pin_project; +use std::{marker::PhantomPinned, pin::Pin}; fn is_unpin<T: Unpin>() {} diff --git a/tests/ui/pin_project/remove-attr-from-field.stderr b/tests/ui/pin_project/remove-attr-from-field.stderr index 486bc00..5d8caac 100644 --- a/tests/ui/pin_project/remove-attr-from-field.stderr +++ b/tests/ui/pin_project/remove-attr-from-field.stderr @@ -1,7 +1,7 @@ error[E0308]: mismatched types - --> $DIR/remove-attr-from-field.rs:28:38 + --> $DIR/remove-attr-from-field.rs:27:38 | -28 | let _: Pin<&mut PhantomPinned> = x.f; //~ ERROR E0308 +27 | let _: Pin<&mut PhantomPinned> = x.f; //~ ERROR E0308 | ----------------------- ^^^ expected struct `Pin`, found `&mut PhantomPinned` | | | expected due to this @@ -10,9 +10,9 @@ error[E0308]: mismatched types found mutable reference `&mut PhantomPinned` error[E0308]: mismatched types - --> $DIR/remove-attr-from-field.rs:32:38 + --> $DIR/remove-attr-from-field.rs:31:38 | -32 | let _: Pin<&mut PhantomPinned> = x.f; //~ ERROR E0308 +31 | let _: Pin<&mut PhantomPinned> = x.f; //~ ERROR E0308 | ----------------------- ^^^ expected struct `Pin`, found `&mut PhantomPinned` | | | expected due to this diff --git a/tests/ui/pin_project/remove-attr-from-struct.rs b/tests/ui/pin_project/remove-attr-from-struct.rs index cbe5aba..0086cf9 100644 --- a/tests/ui/pin_project/remove-attr-from-struct.rs +++ b/tests/ui/pin_project/remove-attr-from-struct.rs @@ -1,7 +1,6 @@ -use std::{marker::PhantomPinned, pin::Pin}; - use auxiliary_macro::remove_attr; use pin_project::pin_project; +use std::{marker::PhantomPinned, pin::Pin}; fn is_unpin<T: Unpin>() {} diff --git a/tests/ui/pin_project/remove-attr-from-struct.stderr b/tests/ui/pin_project/remove-attr-from-struct.stderr index 57cf21d..4652b66 100644 --- a/tests/ui/pin_project/remove-attr-from-struct.stderr +++ b/tests/ui/pin_project/remove-attr-from-struct.stderr @@ -1,91 +1,71 @@ error: #[pin_project] attribute has been removed - --> $DIR/remove-attr-from-struct.rs:22:1 + --> $DIR/remove-attr-from-struct.rs:21:1 | -22 | #[pin_project] //~ ERROR has been removed +21 | #[pin_project] //~ ERROR has been removed | ^^^^^^^^^^^^^^ | - = note: this error originates in the derive macro `::pin_project::__private::__PinProjectInternalDerive` (in Nightly builds, run with -Z macro-backtrace for more info) + = 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:18:7 + --> $DIR/remove-attr-from-struct.rs:17:7 | -18 | #[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:11:7 + --> $DIR/remove-attr-from-struct.rs:10:7 | -11 | #[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 - --> $DIR/remove-attr-from-struct.rs:35:5 + --> $DIR/remove-attr-from-struct.rs:34:5 | -6 | fn is_unpin<T: Unpin>() {} +5 | fn is_unpin<T: Unpin>() {} | ----- required by this bound in `is_unpin` ... -35 | is_unpin::<A>(); //~ ERROR E0277 +34 | is_unpin::<A>(); //~ ERROR E0277 | ^^^^^^^^^^^^^ within `A`, the trait `Unpin` is not implemented for `PhantomPinned` | - = note: consider using `Box::pin` -note: required because it appears within the type `A` - --> $DIR/remove-attr-from-struct.rs:10:8 - | -10 | struct A { - | ^ + = note: required because it appears within the type `A` error[E0277]: `PhantomPinned` cannot be unpinned - --> $DIR/remove-attr-from-struct.rs:36:5 + --> $DIR/remove-attr-from-struct.rs:35:5 | -6 | fn is_unpin<T: Unpin>() {} +5 | fn is_unpin<T: Unpin>() {} | ----- required by this bound in `is_unpin` ... -36 | is_unpin::<B>(); //~ ERROR E0277 +35 | is_unpin::<B>(); //~ ERROR E0277 | ^^^^^^^^^^^^^ within `B`, the trait `Unpin` is not implemented for `PhantomPinned` | - = note: consider using `Box::pin` -note: required because it appears within the type `B` - --> $DIR/remove-attr-from-struct.rs:17:8 - | -17 | struct B { - | ^ + = note: required because it appears within the type `B` error[E0277]: `PhantomPinned` cannot be unpinned - --> $DIR/remove-attr-from-struct.rs:40:13 - | -40 | let _ = Pin::new(&mut x).project(); //~ ERROR E0277,E0599 - | ^^^^^^^^ within `A`, the trait `Unpin` is not implemented for `PhantomPinned` - | - = note: consider using `Box::pin` -note: required because it appears within the type `A` - --> $DIR/remove-attr-from-struct.rs:10:8 - | -10 | struct A { - | ^ -note: required by `Pin::<P>::new` + --> $DIR/remove-attr-from-struct.rs:39:13 + | +39 | let _ = Pin::new(&mut x).project(); //~ ERROR E0277,E0599 + | ^^^^^^^^ within `A`, the trait `Unpin` is not implemented for `PhantomPinned` + | + = note: required because it appears within the type `A` + = note: required by `Pin::<P>::new` error[E0599]: no method named `project` found for struct `Pin<&mut A>` in the current scope - --> $DIR/remove-attr-from-struct.rs:40:30 + --> $DIR/remove-attr-from-struct.rs:39:30 | -40 | let _ = Pin::new(&mut x).project(); //~ ERROR E0277,E0599 +39 | let _ = Pin::new(&mut x).project(); //~ ERROR E0277,E0599 | ^^^^^^^ method not found in `Pin<&mut A>` error[E0277]: `PhantomPinned` cannot be unpinned - --> $DIR/remove-attr-from-struct.rs:43:13 - | -43 | let _ = Pin::new(&mut x).project(); //~ ERROR E0277,E0599 - | ^^^^^^^^ within `B`, the trait `Unpin` is not implemented for `PhantomPinned` - | - = note: consider using `Box::pin` -note: required because it appears within the type `B` - --> $DIR/remove-attr-from-struct.rs:17:8 - | -17 | struct B { - | ^ -note: required by `Pin::<P>::new` + --> $DIR/remove-attr-from-struct.rs:42:13 + | +42 | let _ = Pin::new(&mut x).project(); //~ ERROR E0277,E0599 + | ^^^^^^^^ within `B`, the trait `Unpin` is not implemented for `PhantomPinned` + | + = note: required because it appears within the type `B` + = note: required by `Pin::<P>::new` error[E0599]: no method named `project` found for struct `Pin<&mut B>` in the current scope - --> $DIR/remove-attr-from-struct.rs:43:30 + --> $DIR/remove-attr-from-struct.rs:42:30 | -43 | let _ = Pin::new(&mut x).project(); //~ ERROR E0277,E0599 +42 | let _ = Pin::new(&mut x).project(); //~ ERROR E0277,E0599 | ^^^^^^^ method not found in `Pin<&mut B>` diff --git a/tests/ui/pin_project/safe_packed_borrows.rs b/tests/ui/pin_project/safe_packed_borrows.rs index 8f4f462..db4ac2d 100644 --- a/tests/ui/pin_project/safe_packed_borrows.rs +++ b/tests/ui/pin_project/safe_packed_borrows.rs @@ -1,28 +1,21 @@ -#![deny(renamed_and_removed_lints)] -#![deny(safe_packed_borrows)] //~ ERROR has been renamed to `unaligned_references` -#![allow(unaligned_references)] +#![forbid(safe_packed_borrows)] -// This lint was removed in https://github.com/rust-lang/rust/pull/82525 (nightly-2021-03-28). -// Refs: -// - https://github.com/rust-lang/rust/pull/82525 -// - https://github.com/rust-lang/rust/issues/46043 +// Refs: https://github.com/rust-lang/rust/issues/46043 #[repr(packed)] -struct Packed { +struct A { f: u32, } #[repr(packed(2))] -struct PackedN { +struct B { f: u32, } fn main() { - let a = Packed { f: 1 }; - &a.f; - let _ = &a.f; + let a = A { f: 1 }; + &a.f; //~ ERROR borrow of packed field is unsafe and requires unsafe function or block - let b = PackedN { f: 1 }; - &b.f; - let _ = &b.f; + let b = B { f: 1 }; + &b.f; //~ ERROR borrow of packed field is unsafe and requires unsafe function or block } diff --git a/tests/ui/pin_project/safe_packed_borrows.stderr b/tests/ui/pin_project/safe_packed_borrows.stderr index 4048eaa..c1f734a 100644 --- a/tests/ui/pin_project/safe_packed_borrows.stderr +++ b/tests/ui/pin_project/safe_packed_borrows.stderr @@ -1,11 +1,24 @@ -error: lint `safe_packed_borrows` has been renamed to `unaligned_references` - --> $DIR/safe_packed_borrows.rs:2:9 - | -2 | #![deny(safe_packed_borrows)] //~ ERROR has been renamed to `unaligned_references` - | ^^^^^^^^^^^^^^^^^^^ help: use the new name: `unaligned_references` - | +error: borrow of packed field is unsafe and requires unsafe function or block (error E0133) + --> $DIR/safe_packed_borrows.rs:17:5 + | +17 | &a.f; //~ ERROR borrow of packed field is unsafe and requires unsafe function or block + | ^^^^ + | note: the lint level is defined here - --> $DIR/safe_packed_borrows.rs:1:9 - | -1 | #![deny(renamed_and_removed_lints)] - | ^^^^^^^^^^^^^^^^^^^^^^^^^ + --> $DIR/safe_packed_borrows.rs:1:11 + | +1 | #![forbid(safe_packed_borrows)] + | ^^^^^^^^^^^^^^^^^^^ + = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! + = note: for more information, see issue #46043 <https://github.com/rust-lang/rust/issues/46043> + = note: fields of packed structs might be misaligned: dereferencing a misaligned pointer or even just creating a misaligned reference is undefined behavior + +error: borrow of packed field is unsafe and requires unsafe function or block (error E0133) + --> $DIR/safe_packed_borrows.rs:20:5 + | +20 | &b.f; //~ ERROR borrow of packed field is unsafe and requires unsafe function or block + | ^^^^ + | + = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! + = note: for more information, see issue #46043 <https://github.com/rust-lang/rust/issues/46043> + = note: fields of packed structs might be misaligned: dereferencing a misaligned pointer or even just creating a misaligned reference is undefined behavior diff --git a/tests/ui/pin_project/unaligned_references.rs b/tests/ui/pin_project/unaligned_references.rs deleted file mode 100644 index 23dd71d..0000000 --- a/tests/ui/pin_project/unaligned_references.rs +++ /dev/null @@ -1,23 +0,0 @@ -#![forbid(unaligned_references)] - -// Refs: https://github.com/rust-lang/rust/issues/82523 - -#[repr(packed)] -struct Packed { - f: u32, -} - -#[repr(packed(2))] -struct PackedN { - f: u32, -} - -fn main() { - let a = Packed { f: 1 }; - &a.f; //~ ERROR reference to packed field is unaligned - let _ = &a.f; //~ ERROR reference to packed field is unaligned - - let b = PackedN { f: 1 }; - &b.f; //~ ERROR reference to packed field is unaligned - let _ = &b.f; //~ ERROR reference to packed field is unaligned -} diff --git a/tests/ui/pin_project/unaligned_references.stderr b/tests/ui/pin_project/unaligned_references.stderr deleted file mode 100644 index 17600de..0000000 --- a/tests/ui/pin_project/unaligned_references.stderr +++ /dev/null @@ -1,44 +0,0 @@ -error: reference to packed field is unaligned - --> $DIR/unaligned_references.rs:17:5 - | -17 | &a.f; //~ ERROR reference to packed field is unaligned - | ^^^^ - | -note: the lint level is defined here - --> $DIR/unaligned_references.rs:1:11 - | -1 | #![forbid(unaligned_references)] - | ^^^^^^^^^^^^^^^^^^^^ - = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! - = note: for more information, see issue #82523 <https://github.com/rust-lang/rust/issues/82523> - = note: fields of packed structs are not properly aligned, and creating a misaligned reference is undefined behavior (even if that reference is never dereferenced) - -error: reference to packed field is unaligned - --> $DIR/unaligned_references.rs:18:13 - | -18 | let _ = &a.f; //~ ERROR reference to packed field is unaligned - | ^^^^ - | - = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! - = note: for more information, see issue #82523 <https://github.com/rust-lang/rust/issues/82523> - = note: fields of packed structs are not properly aligned, and creating a misaligned reference is undefined behavior (even if that reference is never dereferenced) - -error: reference to packed field is unaligned - --> $DIR/unaligned_references.rs:21:5 - | -21 | &b.f; //~ ERROR reference to packed field is unaligned - | ^^^^ - | - = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! - = note: for more information, see issue #82523 <https://github.com/rust-lang/rust/issues/82523> - = note: fields of packed structs are not properly aligned, and creating a misaligned reference is undefined behavior (even if that reference is never dereferenced) - -error: reference to packed field is unaligned - --> $DIR/unaligned_references.rs:22:13 - | -22 | let _ = &b.f; //~ ERROR reference to packed field is unaligned - | ^^^^ - | - = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! - = note: for more information, see issue #82523 <https://github.com/rust-lang/rust/issues/82523> - = note: fields of packed structs are not properly aligned, and creating a misaligned reference is undefined behavior (even if that reference is never dereferenced) diff --git a/tests/ui/pinned_drop/call-drop-inner.rs b/tests/ui/pinned_drop/call-drop-inner.rs index 9f89942..4171ed5 100644 --- a/tests/ui/pinned_drop/call-drop-inner.rs +++ b/tests/ui/pinned_drop/call-drop-inner.rs @@ -1,6 +1,5 @@ -use std::pin::Pin; - use pin_project::{pin_project, pinned_drop}; +use std::pin::Pin; #[pin_project(PinnedDrop)] struct Struct { diff --git a/tests/ui/pinned_drop/call-drop-inner.stderr b/tests/ui/pinned_drop/call-drop-inner.stderr index 8fbe2dc..53194b0 100644 --- a/tests/ui/pinned_drop/call-drop-inner.stderr +++ b/tests/ui/pinned_drop/call-drop-inner.stderr @@ -1,14 +1,14 @@ error[E0061]: this function takes 0 arguments but 1 argument was supplied - --> $DIR/call-drop-inner.rs:13:9 + --> $DIR/call-drop-inner.rs:12:9 | -13 | __drop_inner(__self); +12 | __drop_inner(__self); | ^^^^^^^^^^^^ ------ supplied 1 argument | | | expected 0 arguments | note: function defined here - --> $DIR/call-drop-inner.rs:10:1 + --> $DIR/call-drop-inner.rs:9:1 | -10 | #[pinned_drop] +9 | #[pinned_drop] | ^^^^^^^^^^^^^^ - = note: this error originates in the attribute macro `pinned_drop` (in Nightly builds, run with -Z macro-backtrace for more info) + = note: this error originates in an attribute macro (in Nightly builds, run with -Z macro-backtrace for more info) diff --git a/tests/ui/pinned_drop/conditional-drop-impl.rs b/tests/ui/pinned_drop/conditional-drop-impl.rs index 23d756d..fecfd50 100644 --- a/tests/ui/pinned_drop/conditional-drop-impl.rs +++ b/tests/ui/pinned_drop/conditional-drop-impl.rs @@ -1,6 +1,5 @@ -use std::pin::Pin; - use pin_project::{pin_project, pinned_drop}; +use std::pin::Pin; // In `Drop` impl, the implementor must specify the same requirement as type definition. diff --git a/tests/ui/pinned_drop/conditional-drop-impl.stderr b/tests/ui/pinned_drop/conditional-drop-impl.stderr index a512578..6381a29 100644 --- a/tests/ui/pinned_drop/conditional-drop-impl.stderr +++ b/tests/ui/pinned_drop/conditional-drop-impl.stderr @@ -1,35 +1,26 @@ error[E0367]: `Drop` impl requires `T: Unpin` but the struct it is implemented for does not - --> $DIR/conditional-drop-impl.rs:11:9 + --> $DIR/conditional-drop-impl.rs:10:9 | -11 | impl<T: Unpin> Drop for DropImpl<T> { +10 | impl<T: Unpin> Drop for DropImpl<T> { | ^^^^^ | note: the implementor must specify the same requirement - --> $DIR/conditional-drop-impl.rs:7:1 + --> $DIR/conditional-drop-impl.rs:6:1 | -7 | / struct DropImpl<T> { -8 | | f: T, -9 | | } +6 | / struct DropImpl<T> { +7 | | f: T, +8 | | } | |_^ error[E0277]: `T` cannot be unpinned - --> $DIR/conditional-drop-impl.rs:16:15 - | -16 | #[pin_project(PinnedDrop)] //~ ERROR E0277 - | ^^^^^^^^^^ the trait `Unpin` is not implemented for `T` - | - = note: consider using `Box::pin` -note: required because of the requirements on the impl of `PinnedDrop` for `PinnedDropImpl<T>` - --> $DIR/conditional-drop-impl.rs:23:16 - | -23 | impl<T: Unpin> PinnedDrop for PinnedDropImpl<T> { - | ^^^^^^^^^^ ^^^^^^^^^^^^^^^^^ -note: required by `pin_project::__private::PinnedDrop::drop` - --> $DIR/lib.rs:186:9 - | -186 | unsafe fn drop(self: Pin<&mut Self>); - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + --> $DIR/conditional-drop-impl.rs:15:15 + | +15 | #[pin_project(PinnedDrop)] //~ ERROR E0277 + | ^^^^^^^^^^ the trait `Unpin` is not implemented for `T` + | + = note: required because of the requirements on the impl of `PinnedDrop` for `PinnedDropImpl<T>` + = note: required by `pin_project::__private::PinnedDrop::drop` help: consider restricting type parameter `T` - | -17 | struct PinnedDropImpl<T: std::marker::Unpin> { - | ^^^^^^^^^^^^^^^^^^^^ + | +16 | struct PinnedDropImpl<T: Unpin> { + | ^^^^^^^ diff --git a/tests/ui/pinned_drop/forget-pinned-drop-impl.stderr b/tests/ui/pinned_drop/forget-pinned-drop-impl.stderr index d218545..9fd7cdb 100644 --- a/tests/ui/pinned_drop/forget-pinned-drop-impl.stderr +++ b/tests/ui/pinned_drop/forget-pinned-drop-impl.stderr @@ -1,11 +1,7 @@ error[E0277]: the trait bound `Struct: PinnedDrop` is not satisfied - --> $DIR/forget-pinned-drop-impl.rs:3:15 - | -3 | #[pin_project(PinnedDrop)] //~ ERROR E0277 - | ^^^^^^^^^^ the trait `PinnedDrop` is not implemented for `Struct` - | -note: required by `pin_project::__private::PinnedDrop::drop` - --> $DIR/lib.rs:186:9 - | -186 | unsafe fn drop(self: Pin<&mut Self>); - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + --> $DIR/forget-pinned-drop-impl.rs:3:15 + | +3 | #[pin_project(PinnedDrop)] //~ ERROR E0277 + | ^^^^^^^^^^ the trait `PinnedDrop` is not implemented for `Struct` + | + = note: required by `pin_project::__private::PinnedDrop::drop` diff --git a/tests/ui/pinned_drop/invalid.rs b/tests/ui/pinned_drop/invalid.rs index fdadf8a..7e36750 100644 --- a/tests/ui/pinned_drop/invalid.rs +++ b/tests/ui/pinned_drop/invalid.rs @@ -1,7 +1,6 @@ mod argument { - use std::pin::Pin; - use pin_project::{pin_project, pinned_drop}; + use std::pin::Pin; #[pin_project(PinnedDrop)] struct UnexpectedArg1(()); @@ -129,9 +128,8 @@ mod assoc_item { } mod method { - use std::pin::Pin; - use pin_project::{pin_project, pinned_drop}; + use std::pin::Pin; #[pin_project(PinnedDrop)] struct RetUnit(()); diff --git a/tests/ui/pinned_drop/invalid.stderr b/tests/ui/pinned_drop/invalid.stderr index 499b0d9..277a2fa 100644 --- a/tests/ui/pinned_drop/invalid.stderr +++ b/tests/ui/pinned_drop/invalid.stderr @@ -1,143 +1,143 @@ error: unexpected token: foo - --> $DIR/invalid.rs:9:19 + --> $DIR/invalid.rs:8:19 | -9 | #[pinned_drop(foo)] //~ ERROR unexpected token +8 | #[pinned_drop(foo)] //~ ERROR unexpected token | ^^^ error: duplicate #[pinned_drop] attribute - --> $DIR/invalid.rs:30:5 + --> $DIR/invalid.rs:29:5 | -30 | #[pinned_drop] //~ ERROR duplicate #[pinned_drop] attribute +29 | #[pinned_drop] //~ ERROR duplicate #[pinned_drop] attribute | ^^^^^^^^^^^^^^ error: #[pinned_drop] may only be used on implementation for the `PinnedDrop` trait - --> $DIR/invalid.rs:43:10 + --> $DIR/invalid.rs:42:10 | -43 | impl Drop for TraitImpl {} //~ ERROR may only be used on implementation for the `PinnedDrop` trait +42 | impl Drop for TraitImpl {} //~ ERROR may only be used on implementation for the `PinnedDrop` trait | ^^^^ error: #[pinned_drop] may only be used on implementation for the `PinnedDrop` trait - --> $DIR/invalid.rs:49:10 + --> $DIR/invalid.rs:48:10 | -49 | impl InherentImpl {} //~ ERROR may only be used on implementation for the `PinnedDrop` trait +48 | impl InherentImpl {} //~ ERROR may only be used on implementation for the `PinnedDrop` trait | ^^^^^^^^^^^^ error: expected `impl` - --> $DIR/invalid.rs:52:5 + --> $DIR/invalid.rs:51:5 | -52 | fn func(_: Pin<&mut ()>) {} //~ ERROR expected `impl` +51 | fn func(_: Pin<&mut ()>) {} //~ ERROR expected `impl` | ^^ error: implementing the trait `PinnedDrop` is not unsafe - --> $DIR/invalid.rs:62:5 + --> $DIR/invalid.rs:61:5 | -62 | unsafe impl PinnedDrop for Impl { +61 | unsafe impl PinnedDrop for Impl { | ^^^^^^ error: implementing the method `drop` is not unsafe - --> $DIR/invalid.rs:72:9 + --> $DIR/invalid.rs:71:9 | -72 | unsafe fn drop(self: Pin<&mut Self>) {} //~ ERROR implementing the method `drop` is not unsafe +71 | unsafe fn drop(self: Pin<&mut Self>) {} //~ ERROR implementing the method `drop` is not unsafe | ^^^^^^ error: not all trait items implemented, missing: `drop` - --> $DIR/invalid.rs:83:5 + --> $DIR/invalid.rs:82:5 | -83 | impl PinnedDrop for Empty {} //~ ERROR not all trait items implemented, missing: `drop` +82 | impl PinnedDrop for Empty {} //~ ERROR not all trait items implemented, missing: `drop` | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ error: const `A` is not a member of trait `PinnedDrop` - --> $DIR/invalid.rs:90:9 + --> $DIR/invalid.rs:89:9 | -90 | const A: u8 = 0; //~ ERROR const `A` is not a member of trait `PinnedDrop` +89 | const A: u8 = 0; //~ ERROR const `A` is not a member of trait `PinnedDrop` | ^^^^^^^^^^^^^^^^ error: const `A` is not a member of trait `PinnedDrop` - --> $DIR/invalid.rs:100:9 - | -100 | const A: u8 = 0; //~ ERROR const `A` is not a member of trait `PinnedDrop` - | ^^^^^^^^^^^^^^^^ + --> $DIR/invalid.rs:99:9 + | +99 | const A: u8 = 0; //~ ERROR const `A` is not a member of trait `PinnedDrop` + | ^^^^^^^^^^^^^^^^ error: type `A` is not a member of trait `PinnedDrop` - --> $DIR/invalid.rs:108:9 + --> $DIR/invalid.rs:107:9 | -108 | type A = u8; //~ ERROR type `A` is not a member of trait `PinnedDrop` +107 | type A = u8; //~ ERROR type `A` is not a member of trait `PinnedDrop` | ^^^^^^^^^^^^ error: type `A` is not a member of trait `PinnedDrop` - --> $DIR/invalid.rs:118:9 + --> $DIR/invalid.rs:117:9 | -118 | type A = u8; //~ ERROR type `A` is not a member of trait `PinnedDrop` +117 | type A = u8; //~ ERROR type `A` is not a member of trait `PinnedDrop` | ^^^^^^^^^^^^ error: duplicate definitions with name `drop` - --> $DIR/invalid.rs:127:9 + --> $DIR/invalid.rs:126:9 | -127 | fn drop(self: Pin<&mut Self>) {} //~ ERROR duplicate definitions with name `drop` +126 | fn drop(self: Pin<&mut Self>) {} //~ ERROR duplicate definitions with name `drop` | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ error: method `drop` must return the unit type - --> $DIR/invalid.rs:149:42 + --> $DIR/invalid.rs:147:42 | -149 | fn drop(self: Pin<&mut Self>) -> Self {} //~ ERROR method `drop` must return the unit type +147 | fn drop(self: Pin<&mut Self>) -> Self {} //~ ERROR method `drop` must return the unit type | ^^^^ error: method `drop` must take an argument `self: Pin<&mut Self>` - --> $DIR/invalid.rs:157:16 + --> $DIR/invalid.rs:155:16 | -157 | fn drop() {} //~ ERROR method `drop` must take an argument `self: Pin<&mut Self>` +155 | fn drop() {} //~ ERROR method `drop` must take an argument `self: Pin<&mut Self>` | ^^ error: method `drop` must take an argument `self: Pin<&mut Self>` - --> $DIR/invalid.rs:165:17 + --> $DIR/invalid.rs:163:17 | -165 | fn drop(self: Pin<&mut Self>, _: ()) {} //~ ERROR method `drop` must take an argument `self: Pin<&mut Self>` +163 | fn drop(self: Pin<&mut Self>, _: ()) {} //~ ERROR method `drop` must take an argument `self: Pin<&mut Self>` | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ error: method `drop` must take an argument `self: Pin<&mut Self>` - --> $DIR/invalid.rs:173:17 + --> $DIR/invalid.rs:171:17 | -173 | fn drop(&mut self) {} //~ ERROR method `drop` must take an argument `self: Pin<&mut Self>` +171 | fn drop(&mut self) {} //~ ERROR method `drop` must take an argument `self: Pin<&mut Self>` | ^^^^^^^^^ error: method `drop` must take an argument `self: Pin<&mut Self>` - --> $DIR/invalid.rs:181:17 + --> $DIR/invalid.rs:179:17 | -181 | fn drop(_: Pin<&mut Self>) {} //~ ERROR method `drop` must take an argument `self: Pin<&mut Self>` +179 | fn drop(_: Pin<&mut Self>) {} //~ ERROR method `drop` must take an argument `self: Pin<&mut Self>` | ^^^^^^^^^^^^^^^^^ error: method `drop` must take an argument `self: Pin<&mut Self>` - --> $DIR/invalid.rs:189:17 + --> $DIR/invalid.rs:187:17 | -189 | fn drop(self: Pin<&Self>) {} //~ ERROR method `drop` must take an argument `self: Pin<&mut Self>` +187 | fn drop(self: Pin<&Self>) {} //~ ERROR method `drop` must take an argument `self: Pin<&mut Self>` | ^^^^^^^^^^^^^^^^ error: method `drop` must take an argument `self: Pin<&mut Self>` - --> $DIR/invalid.rs:197:17 + --> $DIR/invalid.rs:195:17 | -197 | fn drop(self: Pin<&mut ()>) {} //~ ERROR method `drop` must take an argument `self: Pin<&mut Self>` +195 | fn drop(self: Pin<&mut ()>) {} //~ ERROR method `drop` must take an argument `self: Pin<&mut Self>` | ^^^^^^^^^^^^^^^^^^ error: method `pinned_drop` is not a member of trait `PinnedDrop - --> $DIR/invalid.rs:205:12 + --> $DIR/invalid.rs:203:12 | -205 | fn pinned_drop(self: Pin<&mut Self>) {} //~ ERROR method `pinned_drop` is not a member of trait `PinnedDrop +203 | fn pinned_drop(self: Pin<&mut Self>) {} //~ ERROR method `pinned_drop` is not a member of trait `PinnedDrop | ^^^^^^^^^^^ error: implementing the trait `PinnedDrop` on this type is unsupported - --> $DIR/invalid.rs:213:25 + --> $DIR/invalid.rs:211:25 | -213 | impl PinnedDrop for () { +211 | impl PinnedDrop for () { | ^^ error: implementing the trait `PinnedDrop` on this type is unsupported - --> $DIR/invalid.rs:219:25 + --> $DIR/invalid.rs:217:25 | -219 | impl PinnedDrop for &mut A { +217 | impl PinnedDrop for &mut A { | ^^^^^^ error: implementing the trait `PinnedDrop` on this type is unsupported - --> $DIR/invalid.rs:225:25 + --> $DIR/invalid.rs:223:25 | -225 | impl PinnedDrop for [A] { +223 | impl PinnedDrop for [A] { | ^^^ diff --git a/tests/ui/pinned_drop/pinned-drop-no-attr-arg.rs b/tests/ui/pinned_drop/pinned-drop-no-attr-arg.rs index 391f290..f9db79c 100644 --- a/tests/ui/pinned_drop/pinned-drop-no-attr-arg.rs +++ b/tests/ui/pinned_drop/pinned-drop-no-attr-arg.rs @@ -1,6 +1,5 @@ -use std::pin::Pin; - use pin_project::{pin_project, pinned_drop}; +use std::pin::Pin; #[pin_project] struct S { diff --git a/tests/ui/pinned_drop/pinned-drop-no-attr-arg.stderr b/tests/ui/pinned_drop/pinned-drop-no-attr-arg.stderr index 9f32149..6f868bf 100644 --- a/tests/ui/pinned_drop/pinned-drop-no-attr-arg.stderr +++ b/tests/ui/pinned_drop/pinned-drop-no-attr-arg.stderr @@ -1,8 +1,8 @@ -error[E0119]: conflicting implementations of trait `pin_project::__private::PinnedDrop` for type `S` - --> $DIR/pinned-drop-no-attr-arg.rs:12:1 +error[E0119]: conflicting implementations of trait `pin_project::__private::PinnedDrop` for type `S`: + --> $DIR/pinned-drop-no-attr-arg.rs:11:1 | -5 | #[pin_project] +4 | #[pin_project] | -------------- first implementation here ... -12 | impl PinnedDrop for S { +11 | impl PinnedDrop for S { | ^^^^^^^^^^^^^^^^^^^^^ conflicting implementation for `S` diff --git a/tests/ui/pinned_drop/self.rs b/tests/ui/pinned_drop/self.rs index ff63402..03825ca 100644 --- a/tests/ui/pinned_drop/self.rs +++ b/tests/ui/pinned_drop/self.rs @@ -1,7 +1,6 @@ pub mod self_in_macro_def { - use std::pin::Pin; - use pin_project::{pin_project, pinned_drop}; + use std::pin::Pin; #[pin_project(PinnedDrop)] pub struct S { @@ -24,9 +23,8 @@ pub mod self_in_macro_def { } pub mod self_span { - use std::pin::Pin; - use pin_project::{pin_project, pinned_drop}; + use std::pin::Pin; #[pin_project(PinnedDrop)] pub struct S { diff --git a/tests/ui/pinned_drop/self.stderr b/tests/ui/pinned_drop/self.stderr index 7de286f..edab117 100644 --- a/tests/ui/pinned_drop/self.stderr +++ b/tests/ui/pinned_drop/self.stderr @@ -1,42 +1,42 @@ error: `self` parameter is only allowed in associated functions - --> $DIR/self.rs:18:26 + --> $DIR/self.rs:17:26 | -18 | fn f(self: ()) {} //~ ERROR `self` parameter is only allowed in associated functions +17 | fn f(self: ()) {} //~ ERROR `self` parameter is only allowed in associated functions | ^^^^ not semantically valid as function parameter ... -21 | t!(); +20 | t!(); | ----- in this macro invocation | = note: associated functions are those in `impl` or `trait` definitions - = note: this error originates in the macro `t` (in Nightly builds, run with -Z macro-backtrace for more info) + = note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info) error[E0434]: can't capture dynamic environment in a fn item - --> $DIR/self.rs:16:29 + --> $DIR/self.rs:15:29 | -16 | let _ = self; //~ ERROR E0434 +15 | let _ = self; //~ ERROR E0434 | ^^^^ ... -21 | t!(); +20 | t!(); | ----- in this macro invocation | = help: use the `|| { ... }` closure form instead - = note: this error originates in the macro `t` (in Nightly builds, run with -Z macro-backtrace for more info) + = note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info) error[E0423]: expected value, found struct `S` - --> $DIR/self.rs:40:27 + --> $DIR/self.rs:38:27 | -32 | / pub struct S { -33 | | f: (), -34 | | } +30 | / pub struct S { +31 | | f: (), +32 | | } | |_____- `S` defined here ... -40 | let _: Self = Self; //~ ERROR E0423 +38 | let _: Self = Self; //~ ERROR E0423 | ^^^^ help: use struct literal syntax instead: `S { f: val }` error[E0308]: mismatched types - --> $DIR/self.rs:39:25 + --> $DIR/self.rs:37:25 | -39 | let _: () = self; //~ ERROR E0308 +37 | let _: () = self; //~ ERROR E0308 | -- ^^^^ expected `()`, found struct `Pin` | | | expected due to this @@ -45,9 +45,9 @@ error[E0308]: mismatched types found struct `Pin<&mut self_span::S>` error[E0308]: mismatched types - --> $DIR/self.rs:52:25 + --> $DIR/self.rs:50:25 | -52 | let _: () = self; //~ ERROR E0308 +50 | let _: () = self; //~ ERROR E0308 | -- ^^^^ expected `()`, found struct `Pin` | | | expected due to this @@ -56,7 +56,7 @@ error[E0308]: mismatched types found struct `Pin<&mut E>` error[E0533]: expected unit struct, unit variant or constant, found struct variant `Self::V` - --> $DIR/self.rs:53:27 + --> $DIR/self.rs:51:27 | -53 | let _: Self = Self::V; //~ ERROR E0533 +51 | let _: Self = Self::V; //~ ERROR E0533 | ^^^^^^^ diff --git a/tests/ui/pinned_drop/unsafe-call.rs b/tests/ui/pinned_drop/unsafe-call.rs index 3ee2b56..7faf0fa 100644 --- a/tests/ui/pinned_drop/unsafe-call.rs +++ b/tests/ui/pinned_drop/unsafe-call.rs @@ -1,6 +1,5 @@ -use std::pin::Pin; - use pin_project::{pin_project, pinned_drop}; +use std::pin::Pin; #[pin_project(PinnedDrop)] struct S { diff --git a/tests/ui/pinned_drop/unsafe-call.stderr b/tests/ui/pinned_drop/unsafe-call.stderr index 6216200..cd5e572 100644 --- a/tests/ui/pinned_drop/unsafe-call.stderr +++ b/tests/ui/pinned_drop/unsafe-call.stderr @@ -1,7 +1,7 @@ error[E0133]: call to unsafe function is unsafe and requires unsafe function or block - --> $DIR/unsafe-call.rs:14:9 + --> $DIR/unsafe-call.rs:13:9 | -14 | self.project().f.get_unchecked_mut(); //~ ERROR call to unsafe function is unsafe and requires unsafe function or block [E0133] +13 | self.project().f.get_unchecked_mut(); //~ ERROR call to unsafe function is unsafe and requires unsafe function or block [E0133] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ call to unsafe function | = note: consult the function's documentation for information on how to avoid undefined behavior diff --git a/tests/ui/unsafe_unpin/conflict-unpin.stderr b/tests/ui/unsafe_unpin/conflict-unpin.stderr index 078ac71..916c3f2 100644 --- a/tests/ui/unsafe_unpin/conflict-unpin.stderr +++ b/tests/ui/unsafe_unpin/conflict-unpin.stderr @@ -1,4 +1,4 @@ -error[E0119]: conflicting implementations of trait `std::marker::Unpin` for type `Foo<_, _>` +error[E0119]: conflicting implementations of trait `std::marker::Unpin` for type `Foo<_, _>`: --> $DIR/conflict-unpin.rs:3:15 | 3 | #[pin_project(UnsafeUnpin)] //~ ERROR E0119 @@ -9,7 +9,7 @@ error[E0119]: conflicting implementations of trait `std::marker::Unpin` for type | = note: upstream crates may add a new impl of trait `pin_project::UnsafeUnpin` for type `pin_project::__private::Wrapper<'_, Foo<_, _>>` in future versions -error[E0119]: conflicting implementations of trait `std::marker::Unpin` for type `Bar<_, _>` +error[E0119]: conflicting implementations of trait `std::marker::Unpin` for type `Bar<_, _>`: --> $DIR/conflict-unpin.rs:12:15 | 12 | #[pin_project(UnsafeUnpin)] //~ ERROR E0119 @@ -20,7 +20,7 @@ error[E0119]: conflicting implementations of trait `std::marker::Unpin` for type | = note: upstream crates may add a new impl of trait `pin_project::UnsafeUnpin` for type `pin_project::__private::Wrapper<'_, Bar<_, _>>` in future versions -error[E0119]: conflicting implementations of trait `std::marker::Unpin` for type `Baz<_, _>` +error[E0119]: conflicting implementations of trait `std::marker::Unpin` for type `Baz<_, _>`: --> $DIR/conflict-unpin.rs:21:15 | 21 | #[pin_project(UnsafeUnpin)] //~ ERROR E0119 diff --git a/tests/ui/unstable-features/marker_trait_attr-feature-gate.rs b/tests/ui/unstable-features/marker_trait_attr-feature-gate.rs index 542250b..127cd1a 100644 --- a/tests/ui/unstable-features/marker_trait_attr-feature-gate.rs +++ b/tests/ui/unstable-features/marker_trait_attr-feature-gate.rs @@ -1,8 +1,7 @@ // Note: If you change this test, change 'marker_trait_attr.rs' at the same time. -use std::marker::PhantomPinned; - use pin_project::pin_project; +use std::marker::PhantomPinned; #[pin_project] //~ ERROR E0119 struct Struct<T> { diff --git a/tests/ui/unstable-features/marker_trait_attr-feature-gate.stderr b/tests/ui/unstable-features/marker_trait_attr-feature-gate.stderr index 01e5080..bab534b 100644 --- a/tests/ui/unstable-features/marker_trait_attr-feature-gate.stderr +++ b/tests/ui/unstable-features/marker_trait_attr-feature-gate.stderr @@ -1,10 +1,10 @@ -error[E0119]: conflicting implementations of trait `std::marker::Unpin` for type `Struct<_>` - --> $DIR/marker_trait_attr-feature-gate.rs:7:1 +error[E0119]: conflicting implementations of trait `std::marker::Unpin` for type `Struct<_>`: + --> $DIR/marker_trait_attr-feature-gate.rs:6:1 | -7 | #[pin_project] //~ ERROR E0119 +6 | #[pin_project] //~ ERROR E0119 | ^^^^^^^^^^^^^^ conflicting implementation for `Struct<_>` ... -14 | impl<T> Unpin for Struct<T> {} +13 | impl<T> Unpin for Struct<T> {} | --------------------------- first implementation here | - = note: this error originates in the derive macro `::pin_project::__private::__PinProjectInternalDerive` (in Nightly builds, run with -Z macro-backtrace for more info) + = note: this error originates in a derive macro (in Nightly builds, run with -Z macro-backtrace for more info) diff --git a/tests/ui/unstable-features/marker_trait_attr.rs b/tests/ui/unstable-features/marker_trait_attr.rs index 9c8e664..d6eab21 100644 --- a/tests/ui/unstable-features/marker_trait_attr.rs +++ b/tests/ui/unstable-features/marker_trait_attr.rs @@ -6,9 +6,8 @@ // See https://github.com/taiki-e/pin-project/issues/105#issuecomment-535355974 -use std::marker::PhantomPinned; - use pin_project::pin_project; +use std::marker::PhantomPinned; #[pin_project] //~ ERROR E0119 struct Struct<T> { diff --git a/tests/ui/unstable-features/marker_trait_attr.stderr b/tests/ui/unstable-features/marker_trait_attr.stderr index fbc2d9d..9b3ec57 100644 --- a/tests/ui/unstable-features/marker_trait_attr.stderr +++ b/tests/ui/unstable-features/marker_trait_attr.stderr @@ -1,10 +1,10 @@ -error[E0119]: conflicting implementations of trait `std::marker::Unpin` for type `Struct<_>` - --> $DIR/marker_trait_attr.rs:13:1 +error[E0119]: conflicting implementations of trait `std::marker::Unpin` for type `Struct<_>`: + --> $DIR/marker_trait_attr.rs:12:1 | -13 | #[pin_project] //~ ERROR E0119 +12 | #[pin_project] //~ ERROR E0119 | ^^^^^^^^^^^^^^ conflicting implementation for `Struct<_>` ... -20 | impl<T> Unpin for Struct<T> {} +19 | impl<T> Unpin for Struct<T> {} | --------------------------- first implementation here | - = note: this error originates in the derive macro `::pin_project::__private::__PinProjectInternalDerive` (in Nightly builds, run with -Z macro-backtrace for more info) + = note: this error originates in a derive macro (in Nightly builds, run with -Z macro-backtrace for more info) diff --git a/tests/ui/unstable-features/overlapping_marker_traits-feature-gate.rs b/tests/ui/unstable-features/overlapping_marker_traits-feature-gate.rs index 012c870..9d1b8b8 100644 --- a/tests/ui/unstable-features/overlapping_marker_traits-feature-gate.rs +++ b/tests/ui/unstable-features/overlapping_marker_traits-feature-gate.rs @@ -1,8 +1,7 @@ // Note: If you change this test, change 'overlapping_marker_traits.rs' at the same time. -use std::marker::PhantomPinned; - use pin_project::pin_project; +use std::marker::PhantomPinned; #[pin_project] //~ ERROR E0119 struct Struct<T> { diff --git a/tests/ui/unstable-features/overlapping_marker_traits-feature-gate.stderr b/tests/ui/unstable-features/overlapping_marker_traits-feature-gate.stderr index 5eba425..4a8e238 100644 --- a/tests/ui/unstable-features/overlapping_marker_traits-feature-gate.stderr +++ b/tests/ui/unstable-features/overlapping_marker_traits-feature-gate.stderr @@ -1,10 +1,10 @@ -error[E0119]: conflicting implementations of trait `std::marker::Unpin` for type `Struct<_>` - --> $DIR/overlapping_marker_traits-feature-gate.rs:7:1 +error[E0119]: conflicting implementations of trait `std::marker::Unpin` for type `Struct<_>`: + --> $DIR/overlapping_marker_traits-feature-gate.rs:6:1 | -7 | #[pin_project] //~ ERROR E0119 +6 | #[pin_project] //~ ERROR E0119 | ^^^^^^^^^^^^^^ conflicting implementation for `Struct<_>` ... -14 | impl<T> Unpin for Struct<T> {} +13 | impl<T> Unpin for Struct<T> {} | --------------------------- first implementation here | - = note: this error originates in the derive macro `::pin_project::__private::__PinProjectInternalDerive` (in Nightly builds, run with -Z macro-backtrace for more info) + = note: this error originates in a derive macro (in Nightly builds, run with -Z macro-backtrace for more info) diff --git a/tests/ui/unstable-features/overlapping_marker_traits.rs b/tests/ui/unstable-features/overlapping_marker_traits.rs index 8dc27c1..0e0cddd 100644 --- a/tests/ui/unstable-features/overlapping_marker_traits.rs +++ b/tests/ui/unstable-features/overlapping_marker_traits.rs @@ -3,16 +3,15 @@ // This feature could break the guarantee for Unpin provided by pin-project, // but was removed in https://github.com/rust-lang/rust/pull/68544 (nightly-2020-02-06). // Refs: -// - https://github.com/rust-lang/rust/issues/29864#issuecomment-515780867 -// - https://github.com/taiki-e/pin-project/issues/105 +// * https://github.com/rust-lang/rust/issues/29864#issuecomment-515780867. +// * https://github.com/taiki-e/pin-project/issues/105 // overlapping_marker_traits // Tracking issue: https://github.com/rust-lang/rust/issues/29864 #![feature(overlapping_marker_traits)] -use std::marker::PhantomPinned; - use pin_project::pin_project; +use std::marker::PhantomPinned; #[pin_project] struct Struct<T> { diff --git a/tests/ui/unstable-features/overlapping_marker_traits.stderr b/tests/ui/unstable-features/overlapping_marker_traits.stderr index 706d6c9..91aaf6c 100644 --- a/tests/ui/unstable-features/overlapping_marker_traits.stderr +++ b/tests/ui/unstable-features/overlapping_marker_traits.stderr @@ -6,13 +6,13 @@ error[E0557]: feature has been removed | = note: removed in favor of `#![feature(marker_trait_attr)]` -error[E0119]: conflicting implementations of trait `std::marker::Unpin` for type `Struct<_>` - --> $DIR/overlapping_marker_traits.rs:17:1 +error[E0119]: conflicting implementations of trait `std::marker::Unpin` for type `Struct<_>`: + --> $DIR/overlapping_marker_traits.rs:16:1 | -17 | #[pin_project] +16 | #[pin_project] | ^^^^^^^^^^^^^^ conflicting implementation for `Struct<_>` ... -24 | impl<T> Unpin for Struct<T> {} +23 | impl<T> Unpin for Struct<T> {} | --------------------------- first implementation here | - = note: this error originates in the derive macro `::pin_project::__private::__PinProjectInternalDerive` (in Nightly builds, run with -Z macro-backtrace for more info) + = note: this error originates in a derive macro (in Nightly builds, run with -Z macro-backtrace for more info) diff --git a/tests/ui/unstable-features/trivial_bounds-bug.stderr b/tests/ui/unstable-features/trivial_bounds-bug.stderr index f2407d0..fff09f9 100644 --- a/tests/ui/unstable-features/trivial_bounds-bug.stderr +++ b/tests/ui/unstable-features/trivial_bounds-bug.stderr @@ -3,5 +3,3 @@ error[E0277]: `PhantomPinned` cannot be unpinned | 13 | impl Unpin for A where PhantomPinned: Unpin {} //~ ERROR E0277 | ^^^^^ the trait `Unpin` is not implemented for `PhantomPinned` - | - = note: consider using `Box::pin` diff --git a/tests/ui/unstable-features/trivial_bounds-feature-gate.stderr b/tests/ui/unstable-features/trivial_bounds-feature-gate.stderr index cf3b075..dd151b0 100644 --- a/tests/ui/unstable-features/trivial_bounds-feature-gate.stderr +++ b/tests/ui/unstable-features/trivial_bounds-feature-gate.stderr @@ -4,7 +4,6 @@ error[E0277]: `PhantomPinned` cannot be unpinned 8 | impl Unpin for A where PhantomPinned: Unpin {} //~ ERROR E0277 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `Unpin` is not implemented for `PhantomPinned` | - = note: consider using `Box::pin` = help: see issue #48214 = help: add `#![feature(trivial_bounds)]` to the crate attributes to enable @@ -13,8 +12,6 @@ error[E0277]: `PhantomPinned` cannot be unpinned | 8 | impl Unpin for A where PhantomPinned: Unpin {} //~ ERROR E0277 | ^^^^^ the trait `Unpin` is not implemented for `PhantomPinned` - | - = note: consider using `Box::pin` error[E0277]: `PhantomPinned` cannot be unpinned --> $DIR/trivial_bounds-feature-gate.rs:16:5 @@ -22,12 +19,7 @@ error[E0277]: `PhantomPinned` cannot be unpinned 16 | impl Unpin for B where Wrapper<PhantomPinned>: Unpin {} //~ ERROR E0277 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `Unpin` is not implemented for `PhantomPinned` | - = note: consider using `Box::pin` -note: required because of the requirements on the impl of `Unpin` for `phantom_pinned::Wrapper<PhantomPinned>` - --> $DIR/trivial_bounds-feature-gate.rs:12:13 - | -12 | impl<T> Unpin for Wrapper<T> where T: Unpin {} - | ^^^^^ ^^^^^^^^^^ + = note: required because of the requirements on the impl of `Unpin` for `phantom_pinned::Wrapper<PhantomPinned>` = help: see issue #48214 = help: add `#![feature(trivial_bounds)]` to the crate attributes to enable @@ -37,12 +29,7 @@ error[E0277]: `PhantomPinned` cannot be unpinned 34 | impl Unpin for A where Inner: Unpin {} //~ ERROR E0277 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ within `Inner`, the trait `Unpin` is not implemented for `PhantomPinned` | - = note: consider using `Box::pin` -note: required because it appears within the type `Inner` - --> $DIR/trivial_bounds-feature-gate.rs:30:12 - | -30 | struct Inner(PhantomPinned); - | ^^^^^ + = note: required because it appears within the type `Inner` = help: see issue #48214 = help: add `#![feature(trivial_bounds)]` to the crate attributes to enable @@ -52,16 +39,7 @@ error[E0277]: `PhantomPinned` cannot be unpinned 42 | impl Unpin for B where Wrapper<Inner>: Unpin {} //~ ERROR E0277 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ within `Inner`, the trait `Unpin` is not implemented for `PhantomPinned` | - = note: consider using `Box::pin` -note: required because it appears within the type `Inner` - --> $DIR/trivial_bounds-feature-gate.rs:30:12 - | -30 | struct Inner(PhantomPinned); - | ^^^^^ -note: required because of the requirements on the impl of `Unpin` for `inner::Wrapper<Inner>` - --> $DIR/trivial_bounds-feature-gate.rs:38:13 - | -38 | impl<T> Unpin for Wrapper<T> where T: Unpin {} - | ^^^^^ ^^^^^^^^^^ + = note: required because it appears within the type `Inner` + = note: required because of the requirements on the impl of `Unpin` for `inner::Wrapper<Inner>` = help: see issue #48214 = help: add `#![feature(trivial_bounds)]` to the crate attributes to enable |