Snap for 8249732 from 23166d66dc01778780a8d46bd0bc4ebf2033f2ef to tm-release

Change-Id: I6d2ac9e888b1027a6efe347be401b356bec47642
diff --git a/.cargo_vcs_info.json b/.cargo_vcs_info.json
index 759ab72..9e9e67a 100644
--- a/.cargo_vcs_info.json
+++ b/.cargo_vcs_info.json
@@ -1,5 +1,6 @@
 {
   "git": {
-    "sha1": "6bd40906acb8574a3a0bbadc7cf1349fadac7d3c"
-  }
-}
+    "sha1": "0273e6ecd64057f47c3b2ada6fb4e5c37357c185"
+  },
+  "path_in_vcs": ""
+}
\ No newline at end of file
diff --git a/Android.bp b/Android.bp
index 00c36e3..3ebadd0 100644
--- a/Android.bp
+++ b/Android.bp
@@ -42,7 +42,7 @@
     host_supported: true,
     crate_name: "pin_project",
     cargo_env_compat: true,
-    cargo_pkg_version: "1.0.8",
+    cargo_pkg_version: "1.0.10",
     srcs: ["src/lib.rs"],
     edition: "2018",
     proc_macros: ["libpin_project_internal"],
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 7568f0a..ebac043 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -5,11 +5,21 @@
 This project adheres to [Semantic Versioning](https://semver.org).
 
 <!--
-Note: In this file, do not use the hard wrap in the middle of a sentence for compatibility with GitHub comment style markdown rendering.
+NOTE: In this file, do not use the hard wrap in the middle of a sentence for compatibility with GitHub comment style markdown rendering.
 -->
 
 ## [Unreleased]
 
+## [1.0.10] - 2021-12-31
+
+- Revert the increase of the minimal version of `syn` that was done in 1.0.9.
+
+## [1.0.9] - 2021-12-26
+
+- [Prevent abuse of private module.](https://github.com/taiki-e/pin-project/pull/336)
+
+- Update minimal version of `syn` to 1.0.84.
+
 ## [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)
@@ -40,10 +50,14 @@
 
 ## [1.0.1] - 2020-10-15
 
+**NOTE:** This release has been yanked because it [failed to compile with syn 1.0.84 and later](https://github.com/taiki-e/pin-project/commit/ddcd88079ba2d82857c365f2a3543ad146ade54c).
+
 - [Fix warnings when `#[pin_project]` attribute used within `macro_rules!` macros.](https://github.com/taiki-e/pin-project/pull/298)
 
 ## [1.0.0] - 2020-10-13
 
+**NOTE:** This release has been yanked because it [failed to compile with syn 1.0.84 and later](https://github.com/taiki-e/pin-project/commit/ddcd88079ba2d82857c365f2a3543ad146ade54c).
+
 - [Remove deprecated `#[project]`, `#[project_ref]`, and `#[project_replace]` attributes.](https://github.com/taiki-e/pin-project/pull/265)
 
   Name the projected type by passing an argument with the same name as the method to the `#[pin_project]` attribute instead:
@@ -79,7 +93,7 @@
 
 - [Fix drop order of pinned fields in `project_replace`.](https://github.com/taiki-e/pin-project/pull/287)
 
-- Update minimal version of `syn` to 1.0.44
+- Update minimal version of `syn` to 1.0.44.
 
 ## [1.0.0-alpha.1] - 2020-09-22
 
@@ -114,43 +128,63 @@
 
 See also [tracking issue for 1.0 release](https://github.com/taiki-e/pin-project/issues/264).
 
+## [0.4.29] - 2021-12-26
+
+- [Fix compile error with `syn` 1.0.84 and later.](https://github.com/taiki-e/pin-project/pull/335)
+
 ## [0.4.28] - 2021-03-28
 
+**NOTE:** This release has been yanked because it [failed to compile with syn 1.0.84 and later](https://github.com/taiki-e/pin-project/pull/335).
+
 - [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.)
+  (NOTE: 1.0 does not have this problem.)
 
 ## [0.4.27] - 2020-10-11
 
-- Update minimal version of `syn` to 1.0.44
+**NOTE:** This release has been yanked because it [failed to compile with syn 1.0.84 and later](https://github.com/taiki-e/pin-project/pull/335).
+
+- Update minimal version of `syn` to 1.0.44.
 
 ## [0.4.26] - 2020-10-04
 
+**NOTE:** This release has been yanked because it [failed to compile with syn 1.0.84 and later](https://github.com/taiki-e/pin-project/pull/335).
+
 - [Fix drop order of pinned fields in `project_replace`.](https://github.com/taiki-e/pin-project/pull/287)
 
 ## [0.4.25] - 2020-10-01
 
+**NOTE:** This release has been yanked because it [failed to compile with syn 1.0.84 and later](https://github.com/taiki-e/pin-project/pull/335).
+
 - [Suppress `drop_bounds` lint, which will be added to rustc in the future.](https://github.com/taiki-e/pin-project/pull/273) See [#272](https://github.com/taiki-e/pin-project/issues/272) for more details.
 
-  (Note: 1.0.0-alpha.1 already contains this change.)
+  (NOTE: 1.0.0-alpha.1 already contains this change.)
 
 ## [0.4.24] - 2020-09-26
 
+**NOTE:** This release has been yanked because it [failed to compile with syn 1.0.84 and later](https://github.com/taiki-e/pin-project/pull/335).
+
 - [Fix compatibility of generated code with `forbid(future_incompatible)`.](https://github.com/taiki-e/pin-project/pull/282)
 
-  Note: This does not guarantee compatibility with `forbid(future_incompatible)` in the future.
+  NOTE: This does not guarantee compatibility with `forbid(future_incompatible)` in the future.
   If rustc adds a new lint, we may not be able to keep this.
 
 ## [0.4.23] - 2020-07-27
 
+**NOTE:** This release has been yanked because it [failed to compile with syn 1.0.84 and later](https://github.com/taiki-e/pin-project/pull/335).
+
 - [Fix compile error with `?Sized` type parameters.](https://github.com/taiki-e/pin-project/pull/263)
 
 ## [0.4.22] - 2020-06-14
 
+**NOTE:** This release has been yanked because it [failed to compile with syn 1.0.84 and later](https://github.com/taiki-e/pin-project/pull/335).
+
 - Documentation improvements.
 
 ## [0.4.21] - 2020-06-13
 
+**NOTE:** This release has been yanked because it [failed to compile with syn 1.0.84 and later](https://github.com/taiki-e/pin-project/pull/335).
+
 - [Deprecated `#[project]`, `#[project_ref]`, and `#[project_replace]` attributes due to some unfixable limitations.](https://github.com/taiki-e/pin-project/pull/244)
 
   Consider naming the projected type by passing an argument with the same name as the method to the `#[pin_project]` attribute instead.
@@ -180,6 +214,8 @@
 
 ## [0.4.20] - 2020-06-07
 
+**NOTE:** This release has been yanked because it [failed to compile with syn 1.0.84 and later](https://github.com/taiki-e/pin-project/pull/335).
+
 - [You can now use `project_replace` argument without Replace argument.](https://github.com/taiki-e/pin-project/pull/243)
   This used to require you to specify both.
 
@@ -206,10 +242,14 @@
 
 ## [0.4.19] - 2020-06-04
 
+**NOTE:** This release has been yanked because it [failed to compile with syn 1.0.84 and later](https://github.com/taiki-e/pin-project/pull/335).
+
 - [Suppress `unused_results` lint in generated code.](https://github.com/taiki-e/pin-project/pull/239)
 
 ## [0.4.18] - 2020-06-04
 
+**NOTE:** This release has been yanked because it [failed to compile with syn 1.0.84 and later](https://github.com/taiki-e/pin-project/pull/335).
+
 - [Support `Self` in more syntax positions inside `#[pinned_drop]` impl.](https://github.com/taiki-e/pin-project/pull/230)
 
 - [Suppress `clippy::type_repetition_in_bounds` and `clippy::used_underscore_binding` lints in generated code.](https://github.com/taiki-e/pin-project/pull/233)
@@ -220,6 +260,8 @@
 
 ## [0.4.17] - 2020-05-18
 
+**NOTE:** This release has been yanked because it [failed to compile with syn 1.0.84 and later](https://github.com/taiki-e/pin-project/pull/335).
+
 - [Support naming the projection types.](https://github.com/taiki-e/pin-project/pull/202)
 
   By passing an argument with the same name as the method to the attribute, you can name the projection type returned from the method:
@@ -241,14 +283,20 @@
 
 ## [0.4.16] - 2020-05-11
 
+**NOTE:** This release has been yanked because it [failed to compile with syn 1.0.84 and later](https://github.com/taiki-e/pin-project/pull/335).
+
 - [Fix 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
 
+**NOTE:** This release has been yanked because it [failed to compile with syn 1.0.84 and later](https://github.com/taiki-e/pin-project/pull/335).
+
 - [`#[project]` attribute can now handle all `project*` attributes in that scope with one wrapper attribute.](https://github.com/taiki-e/pin-project/pull/220)
 
 ## [0.4.14] - 2020-05-09
 
+**NOTE:** This release has been yanked because it [failed to compile with syn 1.0.84 and later](https://github.com/taiki-e/pin-project/pull/335).
+
 - [Add `!Unpin` option to `#[pin_project]` attribute for guarantee the type is `!Unpin`.](https://github.com/taiki-e/pin-project/pull/219)
 
   ```rust
@@ -269,7 +317,7 @@
   }
   ```
 
-  *[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)*
+  *[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)
 
@@ -283,6 +331,8 @@
 
 ## [0.4.13] - 2020-05-07
 
+**NOTE:** This release has been yanked because it [failed to compile with syn 1.0.84 and later](https://github.com/taiki-e/pin-project/pull/335).
+
 - [Fix 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):
@@ -299,11 +349,13 @@
 
 ## [0.4.12] - 2020-05-07
 
+**NOTE:** This release has been yanked because it [failed to compile with syn 1.0.84 and later](https://github.com/taiki-e/pin-project/pull/335).
+
 - A release to avoid [a regression in 0.4.11](https://github.com/taiki-e/pin-project/issues/206). No code changes from [0.4.10](https://github.com/taiki-e/pin-project/releases/tag/v0.4.10).
 
 ## [0.4.11] - 2020-05-07
 
-**Note: This release has been yanked.** See [#206](https://github.com/taiki-e/pin-project/issues/206) for details.
+**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)
 
@@ -317,6 +369,8 @@
 
 ## [0.4.10] - 2020-05-04
 
+**NOTE:** This release has been yanked because it [failed to compile with syn 1.0.84 and later](https://github.com/taiki-e/pin-project/pull/335).
+
 - [Add `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.
@@ -327,6 +381,8 @@
 
 ## [0.4.9] - 2020-04-14
 
+**NOTE:** This release has been yanked because it [failed to compile with syn 1.0.84 and later](https://github.com/taiki-e/pin-project/pull/335).
+
 - [Fix 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)
@@ -335,29 +391,39 @@
 
 ## [0.4.8] - 2020-01-27
 
+**NOTE:** This release has been yanked because it [failed to compile with syn 1.0.84 and later](https://github.com/taiki-e/pin-project/pull/335).
+
 - [Ensure 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)
 
 ## [0.4.7] - 2020-01-20
 
+**NOTE:** This release has been yanked because it [failed to compile with syn 1.0.84 and later](https://github.com/taiki-e/pin-project/pull/335).
+
 - [Fix support for lifetime bounds.](https://github.com/taiki-e/pin-project/pull/176)
 
 ## [0.4.6] - 2019-11-20
 
+**NOTE:** This release has been yanked because it [failed to compile with syn 1.0.84 and later](https://github.com/taiki-e/pin-project/pull/335).
+
 - [Fix 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
 
+**NOTE:** This release has been yanked because it [failed to compile with syn 1.0.84 and later](https://github.com/taiki-e/pin-project/pull/335).
+
 - [Fix compile error with `dyn` types.](https://github.com/taiki-e/pin-project/pull/158)
 
 ## [0.4.4] - 2019-10-17
 
+**NOTE:** This release has been yanked because it [failed to compile with syn 1.0.84 and later](https://github.com/taiki-e/pin-project/pull/335).
+
 - [Fix 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
 
-**Note: This release has been yanked.** See [#148](https://github.com/taiki-e/pin-project/pull/148) for details.
+**NOTE:** This release has been yanked. See [#148](https://github.com/taiki-e/pin-project/pull/148) for details.
 
 - [`#[pin_project]` can now interoperate with `#[cfg_attr()]`.](https://github.com/taiki-e/pin-project/pull/135)
 
@@ -369,19 +435,19 @@
 
 ## [0.4.2] - 2019-09-29
 
-**Note: This release has been yanked.** See [#148](https://github.com/taiki-e/pin-project/pull/148) for details.
+**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)
 
 ## [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.
+**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)
 
 ## [0.4.0] - 2019-09-25
 
-**Note: This release has been yanked.** See [#148](https://github.com/taiki-e/pin-project/pull/148) for details.
+**NOTE:** This release has been yanked. See [#148](https://github.com/taiki-e/pin-project/pull/148) for details.
 
 - [**Pin projection has become a safe operation.**](https://github.com/taiki-e/pin-project/pull/18) In the absence of other unsafe code that you write, it is impossible to cause undefined behavior.
 
@@ -524,7 +590,7 @@
 
 ## [0.3.3] - 2019-07-15
 
-**Note: This release has been yanked.** See [#16](https://github.com/taiki-e/pin-project/issues/16) for details.
+**NOTE:** This release has been yanked. See [#16](https://github.com/taiki-e/pin-project/issues/16) for details.
 
 - Diagnostic improvements.
 
@@ -598,11 +664,13 @@
 
 ## [0.1.0] - 2019-01-08
 
-**Note: This release has been yanked.**
+**NOTE:** This release has been yanked.
 
 Initial release
 
-[Unreleased]: https://github.com/taiki-e/pin-project/compare/v1.0.8...HEAD
+[Unreleased]: https://github.com/taiki-e/pin-project/compare/v1.0.10...HEAD
+[1.0.10]: https://github.com/taiki-e/pin-project/compare/v1.0.9...v1.0.10
+[1.0.9]: https://github.com/taiki-e/pin-project/compare/v1.0.8...v1.0.9
 [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
 [1.0.6]: https://github.com/taiki-e/pin-project/compare/v1.0.5...v1.0.6
@@ -613,6 +681,7 @@
 [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.29]: https://github.com/taiki-e/pin-project/compare/v0.4.28...v0.4.29
 [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
diff --git a/Cargo.toml b/Cargo.toml
index be5c598..cc234e1 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -3,21 +3,19 @@
 # When uploading crates to the registry Cargo will automatically
 # "normalize" Cargo.toml files for maximal compatibility
 # with all versions of Cargo and also rewrite `path` dependencies
-# to registry (e.g., crates.io) dependencies
+# to registry (e.g., crates.io) dependencies.
 #
-# If you believe there's an error in this file please file an
-# issue against the rust-lang/cargo repository. If you're
-# editing this file be aware that the upstream Cargo.toml
-# will likely look very different (and much more reasonable)
+# If you are reading this file be aware that the original Cargo.toml
+# will likely look very different (and much more reasonable).
+# See Cargo.toml.orig for the original contents.
 
 [package]
 edition = "2018"
+rust-version = "1.37"
 name = "pin-project"
-version = "1.0.8"
-authors = ["Taiki Endo <te316e89@gmail.com>"]
+version = "1.0.10"
 exclude = ["/.*", "/ci", "/tools"]
 description = "A crate for safe and ergonomic pin-projection.\n"
-documentation = "https://docs.rs/pin-project"
 keywords = ["pin", "macros", "attribute"]
 categories = ["no-std", "rust-patterns"]
 license = "Apache-2.0 OR MIT"
@@ -25,8 +23,7 @@
 [package.metadata.docs.rs]
 targets = ["x86_64-unknown-linux-gnu"]
 [dependencies.pin-project-internal]
-version = "=1.0.8"
-default-features = false
+version = "=1.0.10"
 [dev-dependencies.macrotest]
 version = "1.0.8"
 
@@ -37,4 +34,4 @@
 version = "1"
 
 [dev-dependencies.trybuild]
-version = "1"
+version = "1.0.49"
diff --git a/Cargo.toml.orig b/Cargo.toml.orig
index 6ba9e9b..120858b 100644
--- a/Cargo.toml.orig
+++ b/Cargo.toml.orig
@@ -1,11 +1,10 @@
 [package]
 name = "pin-project"
-version = "1.0.8"
-authors = ["Taiki Endo <te316e89@gmail.com>"]
+version = "1.0.10"
 edition = "2018"
+rust-version = "1.37"
 license = "Apache-2.0 OR MIT"
 repository = "https://github.com/taiki-e/pin-project"
-documentation = "https://docs.rs/pin-project"
 keywords = ["pin", "macros", "attribute"]
 categories = ["no-std", "rust-patterns"]
 exclude = ["/.*", "/ci", "/tools"]
@@ -27,11 +26,11 @@
 ]
 
 [dependencies]
-pin-project-internal = { version = "=1.0.8", path = "pin-project-internal", default-features = false }
+pin-project-internal = { version = "=1.0.10", path = "pin-project-internal" }
 
 [dev-dependencies]
 pin-project-auxiliary-macro = { path = "tests/auxiliary/macro" }
 macrotest = "1.0.8"
 rustversion = "1"
 static_assertions = "1"
-trybuild = "1"
+trybuild = "1.0.49"
diff --git a/METADATA b/METADATA
index 0e4271b..5087552 100644
--- a/METADATA
+++ b/METADATA
@@ -7,13 +7,13 @@
   }
   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.10.crate"
   }
-  version: "1.0.8"
+  version: "1.0.10"
   license_type: NOTICE
   last_upgrade_date {
-    year: 2021
-    month: 8
-    day: 9
+    year: 2022
+    month: 3
+    day: 1
   }
 }
diff --git a/examples/project_replace-expanded.rs b/examples/project_replace-expanded.rs
index ebb8e00..445e570 100644
--- a/examples/project_replace-expanded.rs
+++ b/examples/project_replace-expanded.rs
@@ -79,10 +79,8 @@
 
                 // Destructors will run in reverse order, so next create a guard to overwrite
                 // `self` with the replacement value without calling destructors.
-                let __guard = ::pin_project::__private::UnsafeOverwriteGuard {
-                    target: __self_ptr,
-                    value: ::pin_project::__private::ManuallyDrop::new(__replacement),
-                };
+                let __guard =
+                    ::pin_project::__private::UnsafeOverwriteGuard::new(__self_ptr, __replacement);
 
                 let Self { pinned, unpinned } = &mut *__self_ptr;
 
@@ -98,7 +96,7 @@
                 // this must be in its own scope, or else `__result` will not be dropped
                 // if any of the destructors panic.
                 {
-                    let __guard = ::pin_project::__private::UnsafeDropInPlaceGuard(pinned);
+                    let __guard = ::pin_project::__private::UnsafeDropInPlaceGuard::new(pinned);
                 }
 
                 // Finally, return the result
diff --git a/src/lib.rs b/src/lib.rs
index 24a6c19..00bc931 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -74,7 +74,7 @@
         allow(dead_code, unused_variables)
     )
 ))]
-#![warn(future_incompatible, missing_docs, rust_2018_idioms, single_use_lifetimes, unreachable_pub)]
+#![warn(missing_docs, rust_2018_idioms, single_use_lifetimes, unreachable_pub)]
 #![warn(clippy::default_trait_access, clippy::wildcard_imports)]
 #![allow(clippy::needless_doctest_main)]
 
@@ -91,6 +91,8 @@
 /// This trait is used in conjunction with the `UnsafeUnpin` argument to
 /// the [`#[pin_project]`][macro@pin_project] attribute.
 ///
+/// # Safety
+///
 /// 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.
@@ -149,10 +151,10 @@
 // Not public API.
 #[doc(hidden)]
 pub mod __private {
+    use core::mem::ManuallyDrop;
     #[doc(hidden)]
     pub use core::{
         marker::{PhantomData, PhantomPinned, Unpin},
-        mem::ManuallyDrop,
         ops::Drop,
         pin::Pin,
         ptr,
@@ -256,7 +258,14 @@
 
     // This is an internal helper used to ensure a value is dropped.
     #[doc(hidden)]
-    pub struct UnsafeDropInPlaceGuard<T: ?Sized>(pub *mut T);
+    pub struct UnsafeDropInPlaceGuard<T: ?Sized>(*mut T);
+
+    impl<T: ?Sized> UnsafeDropInPlaceGuard<T> {
+        #[doc(hidden)]
+        pub unsafe fn new(ptr: *mut T) -> Self {
+            Self(ptr)
+        }
+    }
 
     impl<T: ?Sized> Drop for UnsafeDropInPlaceGuard<T> {
         fn drop(&mut self) {
@@ -270,8 +279,15 @@
     // its destructor being called.
     #[doc(hidden)]
     pub struct UnsafeOverwriteGuard<T> {
-        pub value: ManuallyDrop<T>,
-        pub target: *mut T,
+        target: *mut T,
+        value: ManuallyDrop<T>,
+    }
+
+    impl<T> UnsafeOverwriteGuard<T> {
+        #[doc(hidden)]
+        pub unsafe fn new(target: *mut T, value: T) -> Self {
+            Self { target, value: ManuallyDrop::new(value) }
+        }
     }
 
     impl<T> Drop for UnsafeOverwriteGuard<T> {
diff --git a/tests/README.md b/tests/README.md
new file mode 100644
index 0000000..b109e71
--- /dev/null
+++ b/tests/README.md
@@ -0,0 +1,44 @@
+# Tests
+
+To run all tests, run the following command:
+
+```sh
+cargo +nightly test --all
+```
+
+## UI tests (`ui`, `compiletest.rs`)
+
+This checks errors detected by the macro or the Rust compiler in the resulting
+expanded code.
+
+To run this test, run the following command:
+
+```sh
+cargo +nightly test --test compiletest
+```
+
+Locally, this test updates the files in the `ui` directory if there are
+changes to the generated code. If there are any changes to the files in the
+`ui` directory after running the test, please commit them.
+
+See also [`trybuild` documentation](https://docs.rs/trybuild).
+
+## Expansion tests (`expand`, `expandtest.rs`)
+
+Similar to ui tests, but instead of checking the compiler output, this checks
+the code generated by macros.
+
+See [examples](../examples/README.md) for descriptions of what the generated
+code does, and why it needs to be generated.
+
+To run this test, run the following command:
+
+```sh
+cargo +nightly test --test expandtest
+```
+
+Locally, this test updates the files in the `expand` directory if there are
+changes to the generated code. If there are any changes to the files in the
+`expand` directory after running the test, please commit them.
+
+See also [`macrotest` documentation](https://docs.rs/macrotest).
diff --git a/tests/compiletest.rs b/tests/compiletest.rs
index c1c6be0..70d2358 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(not(nightly), ignore)]
 #[test]
 fn ui() {
     if env::var_os("CI").is_none() {
@@ -11,5 +11,5 @@
     }
 
     let t = trybuild::TestCases::new();
-    t.compile_fail("tests/ui/*/*.rs");
+    t.compile_fail("tests/ui/**/*.rs");
 }
diff --git a/tests/expand/README.md b/tests/expand/README.md
deleted file mode 100644
index e3e708d..0000000
--- a/tests/expand/README.md
+++ /dev/null
@@ -1,17 +0,0 @@
-# Expansion tests
-
-Similar to ui tests, but instead of checking the compiler output, this checks
-the code generated by macros.
-
-See [examples](../../examples/README.md) for descriptions of what the generated
-code does, and why it needs to be generated.
-
-To run this test, run the following command:
-
-```sh
-cargo +nightly test --test expandtest
-```
-
-Locally, this test updates the files in the `expand` directory if there are
-changes to the generated code. If there are any changes to the files in the
-`expand` directory after running the test, please commit them.
diff --git a/tests/expand/default/enum.expanded.rs b/tests/expand/default/enum.expanded.rs
index 75ec2fe..a3b0338 100644
--- a/tests/expand/default/enum.expanded.rs
+++ b/tests/expand/default/enum.expanded.rs
@@ -62,22 +62,25 @@
 #[allow(clippy::pattern_type_mismatch)]
 #[allow(clippy::redundant_pub_crate)]
 #[allow(clippy::type_repetition_in_bounds)]
+#[allow(unused_qualifications)]
 #[allow(clippy::semicolon_if_nothing_returned)]
 #[allow(clippy::use_self)]
 #[allow(clippy::used_underscore_binding)]
 const _: () = {
+    #[allow(unused_extern_crates)]
+    extern crate pin_project as _pin_project;
     impl<T, U> Enum<T, U> {
         fn project<'pin>(
-            self: ::pin_project::__private::Pin<&'pin mut Self>,
+            self: _pin_project::__private::Pin<&'pin mut Self>,
         ) -> EnumProj<'pin, T, U> {
             unsafe {
                 match self.get_unchecked_mut() {
                     Self::Struct { pinned, unpinned } => EnumProj::Struct {
-                        pinned: ::pin_project::__private::Pin::new_unchecked(pinned),
+                        pinned: _pin_project::__private::Pin::new_unchecked(pinned),
                         unpinned,
                     },
                     Self::Tuple(_0, _1) => {
-                        EnumProj::Tuple(::pin_project::__private::Pin::new_unchecked(_0), _1)
+                        EnumProj::Tuple(_pin_project::__private::Pin::new_unchecked(_0), _1)
                     }
                     Self::Unit => EnumProj::Unit,
                 }
@@ -85,16 +88,16 @@
         }
         #[allow(clippy::missing_const_for_fn)]
         fn project_ref<'pin>(
-            self: ::pin_project::__private::Pin<&'pin Self>,
+            self: _pin_project::__private::Pin<&'pin Self>,
         ) -> EnumProjRef<'pin, T, U> {
             unsafe {
                 match self.get_ref() {
                     Self::Struct { pinned, unpinned } => EnumProjRef::Struct {
-                        pinned: ::pin_project::__private::Pin::new_unchecked(pinned),
+                        pinned: _pin_project::__private::Pin::new_unchecked(pinned),
                         unpinned,
                     },
                     Self::Tuple(_0, _1) => {
-                        EnumProjRef::Tuple(::pin_project::__private::Pin::new_unchecked(_0), _1)
+                        EnumProjRef::Tuple(_pin_project::__private::Pin::new_unchecked(_0), _1)
                     }
                     Self::Unit => EnumProjRef::Unit,
                 }
@@ -103,32 +106,32 @@
     }
     #[allow(missing_debug_implementations)]
     struct __Enum<'pin, T, U> {
-        __pin_project_use_generics: ::pin_project::__private::AlwaysUnpin<
+        __pin_project_use_generics: _pin_project::__private::AlwaysUnpin<
             'pin,
             (
-                ::pin_project::__private::PhantomData<T>,
-                ::pin_project::__private::PhantomData<U>,
+                _pin_project::__private::PhantomData<T>,
+                _pin_project::__private::PhantomData<U>,
             ),
         >,
         __field0: T,
         __field1: T,
     }
-    impl<'pin, T, U> ::pin_project::__private::Unpin for Enum<T, U> where
-        __Enum<'pin, T, U>: ::pin_project::__private::Unpin
+    impl<'pin, T, U> _pin_project::__private::Unpin for Enum<T, U> where
+        __Enum<'pin, T, U>: _pin_project::__private::Unpin
     {
     }
     #[doc(hidden)]
-    unsafe impl<'pin, T, U> ::pin_project::UnsafeUnpin for Enum<T, U> where
-        __Enum<'pin, T, U>: ::pin_project::__private::Unpin
+    unsafe impl<'pin, T, U> _pin_project::UnsafeUnpin for Enum<T, U> where
+        __Enum<'pin, T, U>: _pin_project::__private::Unpin
     {
     }
     trait EnumMustNotImplDrop {}
     #[allow(clippy::drop_bounds, drop_bounds)]
-    impl<T: ::pin_project::__private::Drop> EnumMustNotImplDrop for T {}
+    impl<T: _pin_project::__private::Drop> EnumMustNotImplDrop for T {}
     impl<T, U> EnumMustNotImplDrop for Enum<T, U> {}
     #[doc(hidden)]
-    impl<T, U> ::pin_project::__private::PinnedDrop for Enum<T, U> {
-        unsafe fn drop(self: ::pin_project::__private::Pin<&mut Self>) {}
+    impl<T, U> _pin_project::__private::PinnedDrop for Enum<T, U> {
+        unsafe fn drop(self: _pin_project::__private::Pin<&mut Self>) {}
     }
 };
 fn main() {}
diff --git a/tests/expand/default/struct.expanded.rs b/tests/expand/default/struct.expanded.rs
index 794675a..3089a54 100644
--- a/tests/expand/default/struct.expanded.rs
+++ b/tests/expand/default/struct.expanded.rs
@@ -14,10 +14,13 @@
 #[allow(clippy::pattern_type_mismatch)]
 #[allow(clippy::redundant_pub_crate)]
 #[allow(clippy::type_repetition_in_bounds)]
+#[allow(unused_qualifications)]
 #[allow(clippy::semicolon_if_nothing_returned)]
 #[allow(clippy::use_self)]
 #[allow(clippy::used_underscore_binding)]
 const _: () = {
+    #[allow(unused_extern_crates)]
+    extern crate pin_project as _pin_project;
     #[allow(dead_code)]
     #[allow(clippy::mut_mut)]
     struct __StructProjection<'pin, T, U>
@@ -38,24 +41,24 @@
     }
     impl<T, U> Struct<T, U> {
         fn project<'pin>(
-            self: ::pin_project::__private::Pin<&'pin mut Self>,
+            self: _pin_project::__private::Pin<&'pin mut Self>,
         ) -> __StructProjection<'pin, T, U> {
             unsafe {
                 let Self { pinned, unpinned } = self.get_unchecked_mut();
                 __StructProjection {
-                    pinned: ::pin_project::__private::Pin::new_unchecked(pinned),
+                    pinned: _pin_project::__private::Pin::new_unchecked(pinned),
                     unpinned,
                 }
             }
         }
         #[allow(clippy::missing_const_for_fn)]
         fn project_ref<'pin>(
-            self: ::pin_project::__private::Pin<&'pin Self>,
+            self: _pin_project::__private::Pin<&'pin Self>,
         ) -> __StructProjectionRef<'pin, T, U> {
             unsafe {
                 let Self { pinned, unpinned } = self.get_ref();
                 __StructProjectionRef {
-                    pinned: ::pin_project::__private::Pin::new_unchecked(pinned),
+                    pinned: _pin_project::__private::Pin::new_unchecked(pinned),
                     unpinned,
                 }
             }
@@ -68,31 +71,31 @@
     }
     #[allow(missing_debug_implementations)]
     struct __Struct<'pin, T, U> {
-        __pin_project_use_generics: ::pin_project::__private::AlwaysUnpin<
+        __pin_project_use_generics: _pin_project::__private::AlwaysUnpin<
             'pin,
             (
-                ::pin_project::__private::PhantomData<T>,
-                ::pin_project::__private::PhantomData<U>,
+                _pin_project::__private::PhantomData<T>,
+                _pin_project::__private::PhantomData<U>,
             ),
         >,
         __field0: T,
     }
-    impl<'pin, T, U> ::pin_project::__private::Unpin for Struct<T, U> where
-        __Struct<'pin, T, U>: ::pin_project::__private::Unpin
+    impl<'pin, T, U> _pin_project::__private::Unpin for Struct<T, U> where
+        __Struct<'pin, T, U>: _pin_project::__private::Unpin
     {
     }
     #[doc(hidden)]
-    unsafe impl<'pin, T, U> ::pin_project::UnsafeUnpin for Struct<T, U> where
-        __Struct<'pin, T, U>: ::pin_project::__private::Unpin
+    unsafe impl<'pin, T, U> _pin_project::UnsafeUnpin for Struct<T, U> where
+        __Struct<'pin, T, U>: _pin_project::__private::Unpin
     {
     }
     trait StructMustNotImplDrop {}
     #[allow(clippy::drop_bounds, drop_bounds)]
-    impl<T: ::pin_project::__private::Drop> StructMustNotImplDrop for T {}
+    impl<T: _pin_project::__private::Drop> StructMustNotImplDrop for T {}
     impl<T, U> StructMustNotImplDrop for Struct<T, U> {}
     #[doc(hidden)]
-    impl<T, U> ::pin_project::__private::PinnedDrop for Struct<T, U> {
-        unsafe fn drop(self: ::pin_project::__private::Pin<&mut Self>) {}
+    impl<T, U> _pin_project::__private::PinnedDrop for Struct<T, U> {
+        unsafe fn drop(self: _pin_project::__private::Pin<&mut Self>) {}
     }
 };
 fn main() {}
diff --git a/tests/expand/default/tuple_struct.expanded.rs b/tests/expand/default/tuple_struct.expanded.rs
index 6a3dfbf..cc9b75e 100644
--- a/tests/expand/default/tuple_struct.expanded.rs
+++ b/tests/expand/default/tuple_struct.expanded.rs
@@ -10,10 +10,13 @@
 #[allow(clippy::pattern_type_mismatch)]
 #[allow(clippy::redundant_pub_crate)]
 #[allow(clippy::type_repetition_in_bounds)]
+#[allow(unused_qualifications)]
 #[allow(clippy::semicolon_if_nothing_returned)]
 #[allow(clippy::use_self)]
 #[allow(clippy::used_underscore_binding)]
 const _: () = {
+    #[allow(unused_extern_crates)]
+    extern crate pin_project as _pin_project;
     #[allow(dead_code)]
     #[allow(clippy::mut_mut)]
     struct __TupleStructProjection<'pin, T, U>(
@@ -32,20 +35,20 @@
         TupleStruct<T, U>: 'pin;
     impl<T, U> TupleStruct<T, U> {
         fn project<'pin>(
-            self: ::pin_project::__private::Pin<&'pin mut Self>,
+            self: _pin_project::__private::Pin<&'pin mut Self>,
         ) -> __TupleStructProjection<'pin, T, U> {
             unsafe {
                 let Self(_0, _1) = self.get_unchecked_mut();
-                __TupleStructProjection(::pin_project::__private::Pin::new_unchecked(_0), _1)
+                __TupleStructProjection(_pin_project::__private::Pin::new_unchecked(_0), _1)
             }
         }
         #[allow(clippy::missing_const_for_fn)]
         fn project_ref<'pin>(
-            self: ::pin_project::__private::Pin<&'pin Self>,
+            self: _pin_project::__private::Pin<&'pin Self>,
         ) -> __TupleStructProjectionRef<'pin, T, U> {
             unsafe {
                 let Self(_0, _1) = self.get_ref();
-                __TupleStructProjectionRef(::pin_project::__private::Pin::new_unchecked(_0), _1)
+                __TupleStructProjectionRef(_pin_project::__private::Pin::new_unchecked(_0), _1)
             }
         }
     }
@@ -56,31 +59,31 @@
     }
     #[allow(missing_debug_implementations)]
     struct __TupleStruct<'pin, T, U> {
-        __pin_project_use_generics: ::pin_project::__private::AlwaysUnpin<
+        __pin_project_use_generics: _pin_project::__private::AlwaysUnpin<
             'pin,
             (
-                ::pin_project::__private::PhantomData<T>,
-                ::pin_project::__private::PhantomData<U>,
+                _pin_project::__private::PhantomData<T>,
+                _pin_project::__private::PhantomData<U>,
             ),
         >,
         __field0: T,
     }
-    impl<'pin, T, U> ::pin_project::__private::Unpin for TupleStruct<T, U> where
-        __TupleStruct<'pin, T, U>: ::pin_project::__private::Unpin
+    impl<'pin, T, U> _pin_project::__private::Unpin for TupleStruct<T, U> where
+        __TupleStruct<'pin, T, U>: _pin_project::__private::Unpin
     {
     }
     #[doc(hidden)]
-    unsafe impl<'pin, T, U> ::pin_project::UnsafeUnpin for TupleStruct<T, U> where
-        __TupleStruct<'pin, T, U>: ::pin_project::__private::Unpin
+    unsafe impl<'pin, T, U> _pin_project::UnsafeUnpin for TupleStruct<T, U> where
+        __TupleStruct<'pin, T, U>: _pin_project::__private::Unpin
     {
     }
     trait TupleStructMustNotImplDrop {}
     #[allow(clippy::drop_bounds, drop_bounds)]
-    impl<T: ::pin_project::__private::Drop> TupleStructMustNotImplDrop for T {}
+    impl<T: _pin_project::__private::Drop> TupleStructMustNotImplDrop for T {}
     impl<T, U> TupleStructMustNotImplDrop for TupleStruct<T, U> {}
     #[doc(hidden)]
-    impl<T, U> ::pin_project::__private::PinnedDrop for TupleStruct<T, U> {
-        unsafe fn drop(self: ::pin_project::__private::Pin<&mut Self>) {}
+    impl<T, U> _pin_project::__private::PinnedDrop for TupleStruct<T, U> {
+        unsafe fn drop(self: _pin_project::__private::Pin<&mut Self>) {}
     }
 };
 fn main() {}
diff --git a/tests/expand/multifields/enum.expanded.rs b/tests/expand/multifields/enum.expanded.rs
index 6ccbd9d..fd31201 100644
--- a/tests/expand/multifields/enum.expanded.rs
+++ b/tests/expand/multifields/enum.expanded.rs
@@ -106,13 +106,16 @@
 #[allow(clippy::pattern_type_mismatch)]
 #[allow(clippy::redundant_pub_crate)]
 #[allow(clippy::type_repetition_in_bounds)]
+#[allow(unused_qualifications)]
 #[allow(clippy::semicolon_if_nothing_returned)]
 #[allow(clippy::use_self)]
 #[allow(clippy::used_underscore_binding)]
 const _: () = {
+    #[allow(unused_extern_crates)]
+    extern crate pin_project as _pin_project;
     impl<T, U> Enum<T, U> {
         fn project<'pin>(
-            self: ::pin_project::__private::Pin<&'pin mut Self>,
+            self: _pin_project::__private::Pin<&'pin mut Self>,
         ) -> EnumProj<'pin, T, U> {
             unsafe {
                 match self.get_unchecked_mut() {
@@ -122,14 +125,14 @@
                         unpinned1,
                         unpinned2,
                     } => EnumProj::Struct {
-                        pinned1: ::pin_project::__private::Pin::new_unchecked(pinned1),
-                        pinned2: ::pin_project::__private::Pin::new_unchecked(pinned2),
+                        pinned1: _pin_project::__private::Pin::new_unchecked(pinned1),
+                        pinned2: _pin_project::__private::Pin::new_unchecked(pinned2),
                         unpinned1,
                         unpinned2,
                     },
                     Self::Tuple(_0, _1, _2, _3) => EnumProj::Tuple(
-                        ::pin_project::__private::Pin::new_unchecked(_0),
-                        ::pin_project::__private::Pin::new_unchecked(_1),
+                        _pin_project::__private::Pin::new_unchecked(_0),
+                        _pin_project::__private::Pin::new_unchecked(_1),
                         _2,
                         _3,
                     ),
@@ -139,7 +142,7 @@
         }
         #[allow(clippy::missing_const_for_fn)]
         fn project_ref<'pin>(
-            self: ::pin_project::__private::Pin<&'pin Self>,
+            self: _pin_project::__private::Pin<&'pin Self>,
         ) -> EnumProjRef<'pin, T, U> {
             unsafe {
                 match self.get_ref() {
@@ -149,14 +152,14 @@
                         unpinned1,
                         unpinned2,
                     } => EnumProjRef::Struct {
-                        pinned1: ::pin_project::__private::Pin::new_unchecked(pinned1),
-                        pinned2: ::pin_project::__private::Pin::new_unchecked(pinned2),
+                        pinned1: _pin_project::__private::Pin::new_unchecked(pinned1),
+                        pinned2: _pin_project::__private::Pin::new_unchecked(pinned2),
                         unpinned1,
                         unpinned2,
                     },
                     Self::Tuple(_0, _1, _2, _3) => EnumProjRef::Tuple(
-                        ::pin_project::__private::Pin::new_unchecked(_0),
-                        ::pin_project::__private::Pin::new_unchecked(_1),
+                        _pin_project::__private::Pin::new_unchecked(_0),
+                        _pin_project::__private::Pin::new_unchecked(_1),
                         _2,
                         _3,
                     ),
@@ -165,15 +168,13 @@
             }
         }
         fn project_replace(
-            self: ::pin_project::__private::Pin<&mut Self>,
+            self: _pin_project::__private::Pin<&mut Self>,
             __replacement: Self,
         ) -> EnumProjOwn<T, U> {
             unsafe {
                 let __self_ptr: *mut Self = self.get_unchecked_mut();
-                let __guard = ::pin_project::__private::UnsafeOverwriteGuard {
-                    target: __self_ptr,
-                    value: ::pin_project::__private::ManuallyDrop::new(__replacement),
-                };
+                let __guard =
+                    _pin_project::__private::UnsafeOverwriteGuard::new(__self_ptr, __replacement);
                 match &mut *__self_ptr {
                     Self::Struct {
                         pinned1,
@@ -182,27 +183,29 @@
                         unpinned2,
                     } => {
                         let __result = EnumProjOwn::Struct {
-                            pinned1: ::pin_project::__private::PhantomData,
-                            pinned2: ::pin_project::__private::PhantomData,
-                            unpinned1: ::pin_project::__private::ptr::read(unpinned1),
-                            unpinned2: ::pin_project::__private::ptr::read(unpinned2),
+                            pinned1: _pin_project::__private::PhantomData,
+                            pinned2: _pin_project::__private::PhantomData,
+                            unpinned1: _pin_project::__private::ptr::read(unpinned1),
+                            unpinned2: _pin_project::__private::ptr::read(unpinned2),
                         };
                         {
-                            let __guard = ::pin_project::__private::UnsafeDropInPlaceGuard(pinned2);
-                            let __guard = ::pin_project::__private::UnsafeDropInPlaceGuard(pinned1);
+                            let __guard =
+                                _pin_project::__private::UnsafeDropInPlaceGuard::new(pinned2);
+                            let __guard =
+                                _pin_project::__private::UnsafeDropInPlaceGuard::new(pinned1);
                         }
                         __result
                     }
                     Self::Tuple(_0, _1, _2, _3) => {
                         let __result = EnumProjOwn::Tuple(
-                            ::pin_project::__private::PhantomData,
-                            ::pin_project::__private::PhantomData,
-                            ::pin_project::__private::ptr::read(_2),
-                            ::pin_project::__private::ptr::read(_3),
+                            _pin_project::__private::PhantomData,
+                            _pin_project::__private::PhantomData,
+                            _pin_project::__private::ptr::read(_2),
+                            _pin_project::__private::ptr::read(_3),
                         );
                         {
-                            let __guard = ::pin_project::__private::UnsafeDropInPlaceGuard(_1);
-                            let __guard = ::pin_project::__private::UnsafeDropInPlaceGuard(_0);
+                            let __guard = _pin_project::__private::UnsafeDropInPlaceGuard::new(_1);
+                            let __guard = _pin_project::__private::UnsafeDropInPlaceGuard::new(_0);
                         }
                         __result
                     }
@@ -217,11 +220,11 @@
     }
     #[allow(missing_debug_implementations)]
     struct __Enum<'pin, T, U> {
-        __pin_project_use_generics: ::pin_project::__private::AlwaysUnpin<
+        __pin_project_use_generics: _pin_project::__private::AlwaysUnpin<
             'pin,
             (
-                ::pin_project::__private::PhantomData<T>,
-                ::pin_project::__private::PhantomData<U>,
+                _pin_project::__private::PhantomData<T>,
+                _pin_project::__private::PhantomData<U>,
             ),
         >,
         __field0: T,
@@ -229,22 +232,22 @@
         __field2: T,
         __field3: T,
     }
-    impl<'pin, T, U> ::pin_project::__private::Unpin for Enum<T, U> where
-        __Enum<'pin, T, U>: ::pin_project::__private::Unpin
+    impl<'pin, T, U> _pin_project::__private::Unpin for Enum<T, U> where
+        __Enum<'pin, T, U>: _pin_project::__private::Unpin
     {
     }
     #[doc(hidden)]
-    unsafe impl<'pin, T, U> ::pin_project::UnsafeUnpin for Enum<T, U> where
-        __Enum<'pin, T, U>: ::pin_project::__private::Unpin
+    unsafe impl<'pin, T, U> _pin_project::UnsafeUnpin for Enum<T, U> where
+        __Enum<'pin, T, U>: _pin_project::__private::Unpin
     {
     }
     trait EnumMustNotImplDrop {}
     #[allow(clippy::drop_bounds, drop_bounds)]
-    impl<T: ::pin_project::__private::Drop> EnumMustNotImplDrop for T {}
+    impl<T: _pin_project::__private::Drop> EnumMustNotImplDrop for T {}
     impl<T, U> EnumMustNotImplDrop for Enum<T, U> {}
     #[doc(hidden)]
-    impl<T, U> ::pin_project::__private::PinnedDrop for Enum<T, U> {
-        unsafe fn drop(self: ::pin_project::__private::Pin<&mut Self>) {}
+    impl<T, U> _pin_project::__private::PinnedDrop for Enum<T, U> {
+        unsafe fn drop(self: _pin_project::__private::Pin<&mut Self>) {}
     }
 };
 fn main() {}
diff --git a/tests/expand/multifields/struct.expanded.rs b/tests/expand/multifields/struct.expanded.rs
index 7e3505b..7ed1f3e 100644
--- a/tests/expand/multifields/struct.expanded.rs
+++ b/tests/expand/multifields/struct.expanded.rs
@@ -17,10 +17,13 @@
 #[allow(clippy::pattern_type_mismatch)]
 #[allow(clippy::redundant_pub_crate)]
 #[allow(clippy::type_repetition_in_bounds)]
+#[allow(unused_qualifications)]
 #[allow(clippy::semicolon_if_nothing_returned)]
 #[allow(clippy::use_self)]
 #[allow(clippy::used_underscore_binding)]
 const _: () = {
+    #[allow(unused_extern_crates)]
+    extern crate pin_project as _pin_project;
     #[allow(dead_code)]
     #[allow(clippy::mut_mut)]
     struct __StructProjection<'pin, T, U>
@@ -52,7 +55,7 @@
     }
     impl<T, U> Struct<T, U> {
         fn project<'pin>(
-            self: ::pin_project::__private::Pin<&'pin mut Self>,
+            self: _pin_project::__private::Pin<&'pin mut Self>,
         ) -> __StructProjection<'pin, T, U> {
             unsafe {
                 let Self {
@@ -62,8 +65,8 @@
                     unpinned2,
                 } = self.get_unchecked_mut();
                 __StructProjection {
-                    pinned1: ::pin_project::__private::Pin::new_unchecked(pinned1),
-                    pinned2: ::pin_project::__private::Pin::new_unchecked(pinned2),
+                    pinned1: _pin_project::__private::Pin::new_unchecked(pinned1),
+                    pinned2: _pin_project::__private::Pin::new_unchecked(pinned2),
                     unpinned1,
                     unpinned2,
                 }
@@ -71,7 +74,7 @@
         }
         #[allow(clippy::missing_const_for_fn)]
         fn project_ref<'pin>(
-            self: ::pin_project::__private::Pin<&'pin Self>,
+            self: _pin_project::__private::Pin<&'pin Self>,
         ) -> __StructProjectionRef<'pin, T, U> {
             unsafe {
                 let Self {
@@ -81,23 +84,21 @@
                     unpinned2,
                 } = self.get_ref();
                 __StructProjectionRef {
-                    pinned1: ::pin_project::__private::Pin::new_unchecked(pinned1),
-                    pinned2: ::pin_project::__private::Pin::new_unchecked(pinned2),
+                    pinned1: _pin_project::__private::Pin::new_unchecked(pinned1),
+                    pinned2: _pin_project::__private::Pin::new_unchecked(pinned2),
                     unpinned1,
                     unpinned2,
                 }
             }
         }
         fn project_replace(
-            self: ::pin_project::__private::Pin<&mut Self>,
+            self: _pin_project::__private::Pin<&mut Self>,
             __replacement: Self,
         ) -> __StructProjectionOwned<T, U> {
             unsafe {
                 let __self_ptr: *mut Self = self.get_unchecked_mut();
-                let __guard = ::pin_project::__private::UnsafeOverwriteGuard {
-                    target: __self_ptr,
-                    value: ::pin_project::__private::ManuallyDrop::new(__replacement),
-                };
+                let __guard =
+                    _pin_project::__private::UnsafeOverwriteGuard::new(__self_ptr, __replacement);
                 let Self {
                     pinned1,
                     pinned2,
@@ -105,14 +106,14 @@
                     unpinned2,
                 } = &mut *__self_ptr;
                 let __result = __StructProjectionOwned {
-                    pinned1: ::pin_project::__private::PhantomData,
-                    pinned2: ::pin_project::__private::PhantomData,
-                    unpinned1: ::pin_project::__private::ptr::read(unpinned1),
-                    unpinned2: ::pin_project::__private::ptr::read(unpinned2),
+                    pinned1: _pin_project::__private::PhantomData,
+                    pinned2: _pin_project::__private::PhantomData,
+                    unpinned1: _pin_project::__private::ptr::read(unpinned1),
+                    unpinned2: _pin_project::__private::ptr::read(unpinned2),
                 };
                 {
-                    let __guard = ::pin_project::__private::UnsafeDropInPlaceGuard(pinned2);
-                    let __guard = ::pin_project::__private::UnsafeDropInPlaceGuard(pinned1);
+                    let __guard = _pin_project::__private::UnsafeDropInPlaceGuard::new(pinned2);
+                    let __guard = _pin_project::__private::UnsafeDropInPlaceGuard::new(pinned1);
                 }
                 __result
             }
@@ -127,32 +128,32 @@
     }
     #[allow(missing_debug_implementations)]
     struct __Struct<'pin, T, U> {
-        __pin_project_use_generics: ::pin_project::__private::AlwaysUnpin<
+        __pin_project_use_generics: _pin_project::__private::AlwaysUnpin<
             'pin,
             (
-                ::pin_project::__private::PhantomData<T>,
-                ::pin_project::__private::PhantomData<U>,
+                _pin_project::__private::PhantomData<T>,
+                _pin_project::__private::PhantomData<U>,
             ),
         >,
         __field0: T,
         __field1: T,
     }
-    impl<'pin, T, U> ::pin_project::__private::Unpin for Struct<T, U> where
-        __Struct<'pin, T, U>: ::pin_project::__private::Unpin
+    impl<'pin, T, U> _pin_project::__private::Unpin for Struct<T, U> where
+        __Struct<'pin, T, U>: _pin_project::__private::Unpin
     {
     }
     #[doc(hidden)]
-    unsafe impl<'pin, T, U> ::pin_project::UnsafeUnpin for Struct<T, U> where
-        __Struct<'pin, T, U>: ::pin_project::__private::Unpin
+    unsafe impl<'pin, T, U> _pin_project::UnsafeUnpin for Struct<T, U> where
+        __Struct<'pin, T, U>: _pin_project::__private::Unpin
     {
     }
     trait StructMustNotImplDrop {}
     #[allow(clippy::drop_bounds, drop_bounds)]
-    impl<T: ::pin_project::__private::Drop> StructMustNotImplDrop for T {}
+    impl<T: _pin_project::__private::Drop> StructMustNotImplDrop for T {}
     impl<T, U> StructMustNotImplDrop for Struct<T, U> {}
     #[doc(hidden)]
-    impl<T, U> ::pin_project::__private::PinnedDrop for Struct<T, U> {
-        unsafe fn drop(self: ::pin_project::__private::Pin<&mut Self>) {}
+    impl<T, U> _pin_project::__private::PinnedDrop for Struct<T, U> {
+        unsafe fn drop(self: _pin_project::__private::Pin<&mut Self>) {}
     }
 };
 fn main() {}
diff --git a/tests/expand/multifields/tuple_struct.expanded.rs b/tests/expand/multifields/tuple_struct.expanded.rs
index 7b47899..351c084 100644
--- a/tests/expand/multifields/tuple_struct.expanded.rs
+++ b/tests/expand/multifields/tuple_struct.expanded.rs
@@ -10,10 +10,13 @@
 #[allow(clippy::pattern_type_mismatch)]
 #[allow(clippy::redundant_pub_crate)]
 #[allow(clippy::type_repetition_in_bounds)]
+#[allow(unused_qualifications)]
 #[allow(clippy::semicolon_if_nothing_returned)]
 #[allow(clippy::use_self)]
 #[allow(clippy::used_underscore_binding)]
 const _: () = {
+    #[allow(unused_extern_crates)]
+    extern crate pin_project as _pin_project;
     #[allow(dead_code)]
     #[allow(clippy::mut_mut)]
     struct __TupleStructProjection<'pin, T, U>(
@@ -43,13 +46,13 @@
     );
     impl<T, U> TupleStruct<T, U> {
         fn project<'pin>(
-            self: ::pin_project::__private::Pin<&'pin mut Self>,
+            self: _pin_project::__private::Pin<&'pin mut Self>,
         ) -> __TupleStructProjection<'pin, T, U> {
             unsafe {
                 let Self(_0, _1, _2, _3) = self.get_unchecked_mut();
                 __TupleStructProjection(
-                    ::pin_project::__private::Pin::new_unchecked(_0),
-                    ::pin_project::__private::Pin::new_unchecked(_1),
+                    _pin_project::__private::Pin::new_unchecked(_0),
+                    _pin_project::__private::Pin::new_unchecked(_1),
                     _2,
                     _3,
                 )
@@ -57,38 +60,36 @@
         }
         #[allow(clippy::missing_const_for_fn)]
         fn project_ref<'pin>(
-            self: ::pin_project::__private::Pin<&'pin Self>,
+            self: _pin_project::__private::Pin<&'pin Self>,
         ) -> __TupleStructProjectionRef<'pin, T, U> {
             unsafe {
                 let Self(_0, _1, _2, _3) = self.get_ref();
                 __TupleStructProjectionRef(
-                    ::pin_project::__private::Pin::new_unchecked(_0),
-                    ::pin_project::__private::Pin::new_unchecked(_1),
+                    _pin_project::__private::Pin::new_unchecked(_0),
+                    _pin_project::__private::Pin::new_unchecked(_1),
                     _2,
                     _3,
                 )
             }
         }
         fn project_replace(
-            self: ::pin_project::__private::Pin<&mut Self>,
+            self: _pin_project::__private::Pin<&mut Self>,
             __replacement: Self,
         ) -> __TupleStructProjectionOwned<T, U> {
             unsafe {
                 let __self_ptr: *mut Self = self.get_unchecked_mut();
-                let __guard = ::pin_project::__private::UnsafeOverwriteGuard {
-                    target: __self_ptr,
-                    value: ::pin_project::__private::ManuallyDrop::new(__replacement),
-                };
+                let __guard =
+                    _pin_project::__private::UnsafeOverwriteGuard::new(__self_ptr, __replacement);
                 let Self(_0, _1, _2, _3) = &mut *__self_ptr;
                 let __result = __TupleStructProjectionOwned(
-                    ::pin_project::__private::PhantomData,
-                    ::pin_project::__private::PhantomData,
-                    ::pin_project::__private::ptr::read(_2),
-                    ::pin_project::__private::ptr::read(_3),
+                    _pin_project::__private::PhantomData,
+                    _pin_project::__private::PhantomData,
+                    _pin_project::__private::ptr::read(_2),
+                    _pin_project::__private::ptr::read(_3),
                 );
                 {
-                    let __guard = ::pin_project::__private::UnsafeDropInPlaceGuard(_1);
-                    let __guard = ::pin_project::__private::UnsafeDropInPlaceGuard(_0);
+                    let __guard = _pin_project::__private::UnsafeDropInPlaceGuard::new(_1);
+                    let __guard = _pin_project::__private::UnsafeDropInPlaceGuard::new(_0);
                 }
                 __result
             }
@@ -103,32 +104,32 @@
     }
     #[allow(missing_debug_implementations)]
     struct __TupleStruct<'pin, T, U> {
-        __pin_project_use_generics: ::pin_project::__private::AlwaysUnpin<
+        __pin_project_use_generics: _pin_project::__private::AlwaysUnpin<
             'pin,
             (
-                ::pin_project::__private::PhantomData<T>,
-                ::pin_project::__private::PhantomData<U>,
+                _pin_project::__private::PhantomData<T>,
+                _pin_project::__private::PhantomData<U>,
             ),
         >,
         __field0: T,
         __field1: T,
     }
-    impl<'pin, T, U> ::pin_project::__private::Unpin for TupleStruct<T, U> where
-        __TupleStruct<'pin, T, U>: ::pin_project::__private::Unpin
+    impl<'pin, T, U> _pin_project::__private::Unpin for TupleStruct<T, U> where
+        __TupleStruct<'pin, T, U>: _pin_project::__private::Unpin
     {
     }
     #[doc(hidden)]
-    unsafe impl<'pin, T, U> ::pin_project::UnsafeUnpin for TupleStruct<T, U> where
-        __TupleStruct<'pin, T, U>: ::pin_project::__private::Unpin
+    unsafe impl<'pin, T, U> _pin_project::UnsafeUnpin for TupleStruct<T, U> where
+        __TupleStruct<'pin, T, U>: _pin_project::__private::Unpin
     {
     }
     trait TupleStructMustNotImplDrop {}
     #[allow(clippy::drop_bounds, drop_bounds)]
-    impl<T: ::pin_project::__private::Drop> TupleStructMustNotImplDrop for T {}
+    impl<T: _pin_project::__private::Drop> TupleStructMustNotImplDrop for T {}
     impl<T, U> TupleStructMustNotImplDrop for TupleStruct<T, U> {}
     #[doc(hidden)]
-    impl<T, U> ::pin_project::__private::PinnedDrop for TupleStruct<T, U> {
-        unsafe fn drop(self: ::pin_project::__private::Pin<&mut Self>) {}
+    impl<T, U> _pin_project::__private::PinnedDrop for TupleStruct<T, U> {
+        unsafe fn drop(self: _pin_project::__private::Pin<&mut Self>) {}
     }
 };
 fn main() {}
diff --git a/tests/expand/naming/enum-all.expanded.rs b/tests/expand/naming/enum-all.expanded.rs
index 21c1c59..7259a13 100644
--- a/tests/expand/naming/enum-all.expanded.rs
+++ b/tests/expand/naming/enum-all.expanded.rs
@@ -82,20 +82,23 @@
 #[allow(clippy::pattern_type_mismatch)]
 #[allow(clippy::redundant_pub_crate)]
 #[allow(clippy::type_repetition_in_bounds)]
+#[allow(unused_qualifications)]
 #[allow(clippy::semicolon_if_nothing_returned)]
 #[allow(clippy::use_self)]
 #[allow(clippy::used_underscore_binding)]
 const _: () = {
+    #[allow(unused_extern_crates)]
+    extern crate pin_project as _pin_project;
     impl<T, U> Enum<T, U> {
-        fn project<'pin>(self: ::pin_project::__private::Pin<&'pin mut Self>) -> Proj<'pin, T, U> {
+        fn project<'pin>(self: _pin_project::__private::Pin<&'pin mut Self>) -> Proj<'pin, T, U> {
             unsafe {
                 match self.get_unchecked_mut() {
                     Self::Struct { pinned, unpinned } => Proj::Struct {
-                        pinned: ::pin_project::__private::Pin::new_unchecked(pinned),
+                        pinned: _pin_project::__private::Pin::new_unchecked(pinned),
                         unpinned,
                     },
                     Self::Tuple(_0, _1) => {
-                        Proj::Tuple(::pin_project::__private::Pin::new_unchecked(_0), _1)
+                        Proj::Tuple(_pin_project::__private::Pin::new_unchecked(_0), _1)
                     }
                     Self::Unit => Proj::Unit,
                 }
@@ -103,49 +106,48 @@
         }
         #[allow(clippy::missing_const_for_fn)]
         fn project_ref<'pin>(
-            self: ::pin_project::__private::Pin<&'pin Self>,
+            self: _pin_project::__private::Pin<&'pin Self>,
         ) -> ProjRef<'pin, T, U> {
             unsafe {
                 match self.get_ref() {
                     Self::Struct { pinned, unpinned } => ProjRef::Struct {
-                        pinned: ::pin_project::__private::Pin::new_unchecked(pinned),
+                        pinned: _pin_project::__private::Pin::new_unchecked(pinned),
                         unpinned,
                     },
                     Self::Tuple(_0, _1) => {
-                        ProjRef::Tuple(::pin_project::__private::Pin::new_unchecked(_0), _1)
+                        ProjRef::Tuple(_pin_project::__private::Pin::new_unchecked(_0), _1)
                     }
                     Self::Unit => ProjRef::Unit,
                 }
             }
         }
         fn project_replace(
-            self: ::pin_project::__private::Pin<&mut Self>,
+            self: _pin_project::__private::Pin<&mut Self>,
             __replacement: Self,
         ) -> ProjOwn<T, U> {
             unsafe {
                 let __self_ptr: *mut Self = self.get_unchecked_mut();
-                let __guard = ::pin_project::__private::UnsafeOverwriteGuard {
-                    target: __self_ptr,
-                    value: ::pin_project::__private::ManuallyDrop::new(__replacement),
-                };
+                let __guard =
+                    _pin_project::__private::UnsafeOverwriteGuard::new(__self_ptr, __replacement);
                 match &mut *__self_ptr {
                     Self::Struct { pinned, unpinned } => {
                         let __result = ProjOwn::Struct {
-                            pinned: ::pin_project::__private::PhantomData,
-                            unpinned: ::pin_project::__private::ptr::read(unpinned),
+                            pinned: _pin_project::__private::PhantomData,
+                            unpinned: _pin_project::__private::ptr::read(unpinned),
                         };
                         {
-                            let __guard = ::pin_project::__private::UnsafeDropInPlaceGuard(pinned);
+                            let __guard =
+                                _pin_project::__private::UnsafeDropInPlaceGuard::new(pinned);
                         }
                         __result
                     }
                     Self::Tuple(_0, _1) => {
                         let __result = ProjOwn::Tuple(
-                            ::pin_project::__private::PhantomData,
-                            ::pin_project::__private::ptr::read(_1),
+                            _pin_project::__private::PhantomData,
+                            _pin_project::__private::ptr::read(_1),
                         );
                         {
-                            let __guard = ::pin_project::__private::UnsafeDropInPlaceGuard(_0);
+                            let __guard = _pin_project::__private::UnsafeDropInPlaceGuard::new(_0);
                         }
                         __result
                     }
@@ -160,32 +162,32 @@
     }
     #[allow(missing_debug_implementations)]
     struct __Enum<'pin, T, U> {
-        __pin_project_use_generics: ::pin_project::__private::AlwaysUnpin<
+        __pin_project_use_generics: _pin_project::__private::AlwaysUnpin<
             'pin,
             (
-                ::pin_project::__private::PhantomData<T>,
-                ::pin_project::__private::PhantomData<U>,
+                _pin_project::__private::PhantomData<T>,
+                _pin_project::__private::PhantomData<U>,
             ),
         >,
         __field0: T,
         __field1: T,
     }
-    impl<'pin, T, U> ::pin_project::__private::Unpin for Enum<T, U> where
-        __Enum<'pin, T, U>: ::pin_project::__private::Unpin
+    impl<'pin, T, U> _pin_project::__private::Unpin for Enum<T, U> where
+        __Enum<'pin, T, U>: _pin_project::__private::Unpin
     {
     }
     #[doc(hidden)]
-    unsafe impl<'pin, T, U> ::pin_project::UnsafeUnpin for Enum<T, U> where
-        __Enum<'pin, T, U>: ::pin_project::__private::Unpin
+    unsafe impl<'pin, T, U> _pin_project::UnsafeUnpin for Enum<T, U> where
+        __Enum<'pin, T, U>: _pin_project::__private::Unpin
     {
     }
     trait EnumMustNotImplDrop {}
     #[allow(clippy::drop_bounds, drop_bounds)]
-    impl<T: ::pin_project::__private::Drop> EnumMustNotImplDrop for T {}
+    impl<T: _pin_project::__private::Drop> EnumMustNotImplDrop for T {}
     impl<T, U> EnumMustNotImplDrop for Enum<T, U> {}
     #[doc(hidden)]
-    impl<T, U> ::pin_project::__private::PinnedDrop for Enum<T, U> {
-        unsafe fn drop(self: ::pin_project::__private::Pin<&mut Self>) {}
+    impl<T, U> _pin_project::__private::PinnedDrop for Enum<T, U> {
+        unsafe fn drop(self: _pin_project::__private::Pin<&mut Self>) {}
     }
 };
 fn main() {}
diff --git a/tests/expand/naming/enum-mut.expanded.rs b/tests/expand/naming/enum-mut.expanded.rs
index 7324372..09271fd 100644
--- a/tests/expand/naming/enum-mut.expanded.rs
+++ b/tests/expand/naming/enum-mut.expanded.rs
@@ -40,20 +40,23 @@
 #[allow(clippy::pattern_type_mismatch)]
 #[allow(clippy::redundant_pub_crate)]
 #[allow(clippy::type_repetition_in_bounds)]
+#[allow(unused_qualifications)]
 #[allow(clippy::semicolon_if_nothing_returned)]
 #[allow(clippy::use_self)]
 #[allow(clippy::used_underscore_binding)]
 const _: () = {
+    #[allow(unused_extern_crates)]
+    extern crate pin_project as _pin_project;
     impl<T, U> Enum<T, U> {
-        fn project<'pin>(self: ::pin_project::__private::Pin<&'pin mut Self>) -> Proj<'pin, T, U> {
+        fn project<'pin>(self: _pin_project::__private::Pin<&'pin mut Self>) -> Proj<'pin, T, U> {
             unsafe {
                 match self.get_unchecked_mut() {
                     Self::Struct { pinned, unpinned } => Proj::Struct {
-                        pinned: ::pin_project::__private::Pin::new_unchecked(pinned),
+                        pinned: _pin_project::__private::Pin::new_unchecked(pinned),
                         unpinned,
                     },
                     Self::Tuple(_0, _1) => {
-                        Proj::Tuple(::pin_project::__private::Pin::new_unchecked(_0), _1)
+                        Proj::Tuple(_pin_project::__private::Pin::new_unchecked(_0), _1)
                     }
                     Self::Unit => Proj::Unit,
                 }
@@ -62,32 +65,32 @@
     }
     #[allow(missing_debug_implementations)]
     struct __Enum<'pin, T, U> {
-        __pin_project_use_generics: ::pin_project::__private::AlwaysUnpin<
+        __pin_project_use_generics: _pin_project::__private::AlwaysUnpin<
             'pin,
             (
-                ::pin_project::__private::PhantomData<T>,
-                ::pin_project::__private::PhantomData<U>,
+                _pin_project::__private::PhantomData<T>,
+                _pin_project::__private::PhantomData<U>,
             ),
         >,
         __field0: T,
         __field1: T,
     }
-    impl<'pin, T, U> ::pin_project::__private::Unpin for Enum<T, U> where
-        __Enum<'pin, T, U>: ::pin_project::__private::Unpin
+    impl<'pin, T, U> _pin_project::__private::Unpin for Enum<T, U> where
+        __Enum<'pin, T, U>: _pin_project::__private::Unpin
     {
     }
     #[doc(hidden)]
-    unsafe impl<'pin, T, U> ::pin_project::UnsafeUnpin for Enum<T, U> where
-        __Enum<'pin, T, U>: ::pin_project::__private::Unpin
+    unsafe impl<'pin, T, U> _pin_project::UnsafeUnpin for Enum<T, U> where
+        __Enum<'pin, T, U>: _pin_project::__private::Unpin
     {
     }
     trait EnumMustNotImplDrop {}
     #[allow(clippy::drop_bounds, drop_bounds)]
-    impl<T: ::pin_project::__private::Drop> EnumMustNotImplDrop for T {}
+    impl<T: _pin_project::__private::Drop> EnumMustNotImplDrop for T {}
     impl<T, U> EnumMustNotImplDrop for Enum<T, U> {}
     #[doc(hidden)]
-    impl<T, U> ::pin_project::__private::PinnedDrop for Enum<T, U> {
-        unsafe fn drop(self: ::pin_project::__private::Pin<&mut Self>) {}
+    impl<T, U> _pin_project::__private::PinnedDrop for Enum<T, U> {
+        unsafe fn drop(self: _pin_project::__private::Pin<&mut Self>) {}
     }
 };
 fn main() {}
diff --git a/tests/expand/naming/enum-none.expanded.rs b/tests/expand/naming/enum-none.expanded.rs
index 3410001..54cd1f8 100644
--- a/tests/expand/naming/enum-none.expanded.rs
+++ b/tests/expand/naming/enum-none.expanded.rs
@@ -18,39 +18,42 @@
 #[allow(clippy::pattern_type_mismatch)]
 #[allow(clippy::redundant_pub_crate)]
 #[allow(clippy::type_repetition_in_bounds)]
+#[allow(unused_qualifications)]
 #[allow(clippy::semicolon_if_nothing_returned)]
 #[allow(clippy::use_self)]
 #[allow(clippy::used_underscore_binding)]
 const _: () = {
+    #[allow(unused_extern_crates)]
+    extern crate pin_project as _pin_project;
     impl<T, U> Enum<T, U> {}
     #[allow(missing_debug_implementations)]
     struct __Enum<'pin, T, U> {
-        __pin_project_use_generics: ::pin_project::__private::AlwaysUnpin<
+        __pin_project_use_generics: _pin_project::__private::AlwaysUnpin<
             'pin,
             (
-                ::pin_project::__private::PhantomData<T>,
-                ::pin_project::__private::PhantomData<U>,
+                _pin_project::__private::PhantomData<T>,
+                _pin_project::__private::PhantomData<U>,
             ),
         >,
         __field0: T,
         __field1: T,
     }
-    impl<'pin, T, U> ::pin_project::__private::Unpin for Enum<T, U> where
-        __Enum<'pin, T, U>: ::pin_project::__private::Unpin
+    impl<'pin, T, U> _pin_project::__private::Unpin for Enum<T, U> where
+        __Enum<'pin, T, U>: _pin_project::__private::Unpin
     {
     }
     #[doc(hidden)]
-    unsafe impl<'pin, T, U> ::pin_project::UnsafeUnpin for Enum<T, U> where
-        __Enum<'pin, T, U>: ::pin_project::__private::Unpin
+    unsafe impl<'pin, T, U> _pin_project::UnsafeUnpin for Enum<T, U> where
+        __Enum<'pin, T, U>: _pin_project::__private::Unpin
     {
     }
     trait EnumMustNotImplDrop {}
     #[allow(clippy::drop_bounds, drop_bounds)]
-    impl<T: ::pin_project::__private::Drop> EnumMustNotImplDrop for T {}
+    impl<T: _pin_project::__private::Drop> EnumMustNotImplDrop for T {}
     impl<T, U> EnumMustNotImplDrop for Enum<T, U> {}
     #[doc(hidden)]
-    impl<T, U> ::pin_project::__private::PinnedDrop for Enum<T, U> {
-        unsafe fn drop(self: ::pin_project::__private::Pin<&mut Self>) {}
+    impl<T, U> _pin_project::__private::PinnedDrop for Enum<T, U> {
+        unsafe fn drop(self: _pin_project::__private::Pin<&mut Self>) {}
     }
 };
 fn main() {}
diff --git a/tests/expand/naming/enum-own.expanded.rs b/tests/expand/naming/enum-own.expanded.rs
index a63a874..19ec570 100644
--- a/tests/expand/naming/enum-own.expanded.rs
+++ b/tests/expand/naming/enum-own.expanded.rs
@@ -38,39 +38,41 @@
 #[allow(clippy::pattern_type_mismatch)]
 #[allow(clippy::redundant_pub_crate)]
 #[allow(clippy::type_repetition_in_bounds)]
+#[allow(unused_qualifications)]
 #[allow(clippy::semicolon_if_nothing_returned)]
 #[allow(clippy::use_self)]
 #[allow(clippy::used_underscore_binding)]
 const _: () = {
+    #[allow(unused_extern_crates)]
+    extern crate pin_project as _pin_project;
     impl<T, U> Enum<T, U> {
         fn project_replace(
-            self: ::pin_project::__private::Pin<&mut Self>,
+            self: _pin_project::__private::Pin<&mut Self>,
             __replacement: Self,
         ) -> ProjOwn<T, U> {
             unsafe {
                 let __self_ptr: *mut Self = self.get_unchecked_mut();
-                let __guard = ::pin_project::__private::UnsafeOverwriteGuard {
-                    target: __self_ptr,
-                    value: ::pin_project::__private::ManuallyDrop::new(__replacement),
-                };
+                let __guard =
+                    _pin_project::__private::UnsafeOverwriteGuard::new(__self_ptr, __replacement);
                 match &mut *__self_ptr {
                     Self::Struct { pinned, unpinned } => {
                         let __result = ProjOwn::Struct {
-                            pinned: ::pin_project::__private::PhantomData,
-                            unpinned: ::pin_project::__private::ptr::read(unpinned),
+                            pinned: _pin_project::__private::PhantomData,
+                            unpinned: _pin_project::__private::ptr::read(unpinned),
                         };
                         {
-                            let __guard = ::pin_project::__private::UnsafeDropInPlaceGuard(pinned);
+                            let __guard =
+                                _pin_project::__private::UnsafeDropInPlaceGuard::new(pinned);
                         }
                         __result
                     }
                     Self::Tuple(_0, _1) => {
                         let __result = ProjOwn::Tuple(
-                            ::pin_project::__private::PhantomData,
-                            ::pin_project::__private::ptr::read(_1),
+                            _pin_project::__private::PhantomData,
+                            _pin_project::__private::ptr::read(_1),
                         );
                         {
-                            let __guard = ::pin_project::__private::UnsafeDropInPlaceGuard(_0);
+                            let __guard = _pin_project::__private::UnsafeDropInPlaceGuard::new(_0);
                         }
                         __result
                     }
@@ -85,32 +87,32 @@
     }
     #[allow(missing_debug_implementations)]
     struct __Enum<'pin, T, U> {
-        __pin_project_use_generics: ::pin_project::__private::AlwaysUnpin<
+        __pin_project_use_generics: _pin_project::__private::AlwaysUnpin<
             'pin,
             (
-                ::pin_project::__private::PhantomData<T>,
-                ::pin_project::__private::PhantomData<U>,
+                _pin_project::__private::PhantomData<T>,
+                _pin_project::__private::PhantomData<U>,
             ),
         >,
         __field0: T,
         __field1: T,
     }
-    impl<'pin, T, U> ::pin_project::__private::Unpin for Enum<T, U> where
-        __Enum<'pin, T, U>: ::pin_project::__private::Unpin
+    impl<'pin, T, U> _pin_project::__private::Unpin for Enum<T, U> where
+        __Enum<'pin, T, U>: _pin_project::__private::Unpin
     {
     }
     #[doc(hidden)]
-    unsafe impl<'pin, T, U> ::pin_project::UnsafeUnpin for Enum<T, U> where
-        __Enum<'pin, T, U>: ::pin_project::__private::Unpin
+    unsafe impl<'pin, T, U> _pin_project::UnsafeUnpin for Enum<T, U> where
+        __Enum<'pin, T, U>: _pin_project::__private::Unpin
     {
     }
     trait EnumMustNotImplDrop {}
     #[allow(clippy::drop_bounds, drop_bounds)]
-    impl<T: ::pin_project::__private::Drop> EnumMustNotImplDrop for T {}
+    impl<T: _pin_project::__private::Drop> EnumMustNotImplDrop for T {}
     impl<T, U> EnumMustNotImplDrop for Enum<T, U> {}
     #[doc(hidden)]
-    impl<T, U> ::pin_project::__private::PinnedDrop for Enum<T, U> {
-        unsafe fn drop(self: ::pin_project::__private::Pin<&mut Self>) {}
+    impl<T, U> _pin_project::__private::PinnedDrop for Enum<T, U> {
+        unsafe fn drop(self: _pin_project::__private::Pin<&mut Self>) {}
     }
 };
 fn main() {}
diff --git a/tests/expand/naming/enum-ref.expanded.rs b/tests/expand/naming/enum-ref.expanded.rs
index 6197557..4565d08 100644
--- a/tests/expand/naming/enum-ref.expanded.rs
+++ b/tests/expand/naming/enum-ref.expanded.rs
@@ -40,23 +40,26 @@
 #[allow(clippy::pattern_type_mismatch)]
 #[allow(clippy::redundant_pub_crate)]
 #[allow(clippy::type_repetition_in_bounds)]
+#[allow(unused_qualifications)]
 #[allow(clippy::semicolon_if_nothing_returned)]
 #[allow(clippy::use_self)]
 #[allow(clippy::used_underscore_binding)]
 const _: () = {
+    #[allow(unused_extern_crates)]
+    extern crate pin_project as _pin_project;
     impl<T, U> Enum<T, U> {
         #[allow(clippy::missing_const_for_fn)]
         fn project_ref<'pin>(
-            self: ::pin_project::__private::Pin<&'pin Self>,
+            self: _pin_project::__private::Pin<&'pin Self>,
         ) -> ProjRef<'pin, T, U> {
             unsafe {
                 match self.get_ref() {
                     Self::Struct { pinned, unpinned } => ProjRef::Struct {
-                        pinned: ::pin_project::__private::Pin::new_unchecked(pinned),
+                        pinned: _pin_project::__private::Pin::new_unchecked(pinned),
                         unpinned,
                     },
                     Self::Tuple(_0, _1) => {
-                        ProjRef::Tuple(::pin_project::__private::Pin::new_unchecked(_0), _1)
+                        ProjRef::Tuple(_pin_project::__private::Pin::new_unchecked(_0), _1)
                     }
                     Self::Unit => ProjRef::Unit,
                 }
@@ -65,32 +68,32 @@
     }
     #[allow(missing_debug_implementations)]
     struct __Enum<'pin, T, U> {
-        __pin_project_use_generics: ::pin_project::__private::AlwaysUnpin<
+        __pin_project_use_generics: _pin_project::__private::AlwaysUnpin<
             'pin,
             (
-                ::pin_project::__private::PhantomData<T>,
-                ::pin_project::__private::PhantomData<U>,
+                _pin_project::__private::PhantomData<T>,
+                _pin_project::__private::PhantomData<U>,
             ),
         >,
         __field0: T,
         __field1: T,
     }
-    impl<'pin, T, U> ::pin_project::__private::Unpin for Enum<T, U> where
-        __Enum<'pin, T, U>: ::pin_project::__private::Unpin
+    impl<'pin, T, U> _pin_project::__private::Unpin for Enum<T, U> where
+        __Enum<'pin, T, U>: _pin_project::__private::Unpin
     {
     }
     #[doc(hidden)]
-    unsafe impl<'pin, T, U> ::pin_project::UnsafeUnpin for Enum<T, U> where
-        __Enum<'pin, T, U>: ::pin_project::__private::Unpin
+    unsafe impl<'pin, T, U> _pin_project::UnsafeUnpin for Enum<T, U> where
+        __Enum<'pin, T, U>: _pin_project::__private::Unpin
     {
     }
     trait EnumMustNotImplDrop {}
     #[allow(clippy::drop_bounds, drop_bounds)]
-    impl<T: ::pin_project::__private::Drop> EnumMustNotImplDrop for T {}
+    impl<T: _pin_project::__private::Drop> EnumMustNotImplDrop for T {}
     impl<T, U> EnumMustNotImplDrop for Enum<T, U> {}
     #[doc(hidden)]
-    impl<T, U> ::pin_project::__private::PinnedDrop for Enum<T, U> {
-        unsafe fn drop(self: ::pin_project::__private::Pin<&mut Self>) {}
+    impl<T, U> _pin_project::__private::PinnedDrop for Enum<T, U> {
+        unsafe fn drop(self: _pin_project::__private::Pin<&mut Self>) {}
     }
 };
 fn main() {}
diff --git a/tests/expand/naming/struct-all.expanded.rs b/tests/expand/naming/struct-all.expanded.rs
index 54b63f5..4b46e34 100644
--- a/tests/expand/naming/struct-all.expanded.rs
+++ b/tests/expand/naming/struct-all.expanded.rs
@@ -64,49 +64,50 @@
 #[allow(clippy::pattern_type_mismatch)]
 #[allow(clippy::redundant_pub_crate)]
 #[allow(clippy::type_repetition_in_bounds)]
+#[allow(unused_qualifications)]
 #[allow(clippy::semicolon_if_nothing_returned)]
 #[allow(clippy::use_self)]
 #[allow(clippy::used_underscore_binding)]
 const _: () = {
+    #[allow(unused_extern_crates)]
+    extern crate pin_project as _pin_project;
     impl<T, U> Struct<T, U> {
-        fn project<'pin>(self: ::pin_project::__private::Pin<&'pin mut Self>) -> Proj<'pin, T, U> {
+        fn project<'pin>(self: _pin_project::__private::Pin<&'pin mut Self>) -> Proj<'pin, T, U> {
             unsafe {
                 let Self { pinned, unpinned } = self.get_unchecked_mut();
                 Proj {
-                    pinned: ::pin_project::__private::Pin::new_unchecked(pinned),
+                    pinned: _pin_project::__private::Pin::new_unchecked(pinned),
                     unpinned,
                 }
             }
         }
         #[allow(clippy::missing_const_for_fn)]
         fn project_ref<'pin>(
-            self: ::pin_project::__private::Pin<&'pin Self>,
+            self: _pin_project::__private::Pin<&'pin Self>,
         ) -> ProjRef<'pin, T, U> {
             unsafe {
                 let Self { pinned, unpinned } = self.get_ref();
                 ProjRef {
-                    pinned: ::pin_project::__private::Pin::new_unchecked(pinned),
+                    pinned: _pin_project::__private::Pin::new_unchecked(pinned),
                     unpinned,
                 }
             }
         }
         fn project_replace(
-            self: ::pin_project::__private::Pin<&mut Self>,
+            self: _pin_project::__private::Pin<&mut Self>,
             __replacement: Self,
         ) -> ProjOwn<T, U> {
             unsafe {
                 let __self_ptr: *mut Self = self.get_unchecked_mut();
-                let __guard = ::pin_project::__private::UnsafeOverwriteGuard {
-                    target: __self_ptr,
-                    value: ::pin_project::__private::ManuallyDrop::new(__replacement),
-                };
+                let __guard =
+                    _pin_project::__private::UnsafeOverwriteGuard::new(__self_ptr, __replacement);
                 let Self { pinned, unpinned } = &mut *__self_ptr;
                 let __result = ProjOwn {
-                    pinned: ::pin_project::__private::PhantomData,
-                    unpinned: ::pin_project::__private::ptr::read(unpinned),
+                    pinned: _pin_project::__private::PhantomData,
+                    unpinned: _pin_project::__private::ptr::read(unpinned),
                 };
                 {
-                    let __guard = ::pin_project::__private::UnsafeDropInPlaceGuard(pinned);
+                    let __guard = _pin_project::__private::UnsafeDropInPlaceGuard::new(pinned);
                 }
                 __result
             }
@@ -119,31 +120,31 @@
     }
     #[allow(missing_debug_implementations)]
     struct __Struct<'pin, T, U> {
-        __pin_project_use_generics: ::pin_project::__private::AlwaysUnpin<
+        __pin_project_use_generics: _pin_project::__private::AlwaysUnpin<
             'pin,
             (
-                ::pin_project::__private::PhantomData<T>,
-                ::pin_project::__private::PhantomData<U>,
+                _pin_project::__private::PhantomData<T>,
+                _pin_project::__private::PhantomData<U>,
             ),
         >,
         __field0: T,
     }
-    impl<'pin, T, U> ::pin_project::__private::Unpin for Struct<T, U> where
-        __Struct<'pin, T, U>: ::pin_project::__private::Unpin
+    impl<'pin, T, U> _pin_project::__private::Unpin for Struct<T, U> where
+        __Struct<'pin, T, U>: _pin_project::__private::Unpin
     {
     }
     #[doc(hidden)]
-    unsafe impl<'pin, T, U> ::pin_project::UnsafeUnpin for Struct<T, U> where
-        __Struct<'pin, T, U>: ::pin_project::__private::Unpin
+    unsafe impl<'pin, T, U> _pin_project::UnsafeUnpin for Struct<T, U> where
+        __Struct<'pin, T, U>: _pin_project::__private::Unpin
     {
     }
     trait StructMustNotImplDrop {}
     #[allow(clippy::drop_bounds, drop_bounds)]
-    impl<T: ::pin_project::__private::Drop> StructMustNotImplDrop for T {}
+    impl<T: _pin_project::__private::Drop> StructMustNotImplDrop for T {}
     impl<T, U> StructMustNotImplDrop for Struct<T, U> {}
     #[doc(hidden)]
-    impl<T, U> ::pin_project::__private::PinnedDrop for Struct<T, U> {
-        unsafe fn drop(self: ::pin_project::__private::Pin<&mut Self>) {}
+    impl<T, U> _pin_project::__private::PinnedDrop for Struct<T, U> {
+        unsafe fn drop(self: _pin_project::__private::Pin<&mut Self>) {}
     }
 };
 fn main() {}
diff --git a/tests/expand/naming/struct-mut.expanded.rs b/tests/expand/naming/struct-mut.expanded.rs
index ee641d6..5803d6b 100644
--- a/tests/expand/naming/struct-mut.expanded.rs
+++ b/tests/expand/naming/struct-mut.expanded.rs
@@ -32,10 +32,13 @@
 #[allow(clippy::pattern_type_mismatch)]
 #[allow(clippy::redundant_pub_crate)]
 #[allow(clippy::type_repetition_in_bounds)]
+#[allow(unused_qualifications)]
 #[allow(clippy::semicolon_if_nothing_returned)]
 #[allow(clippy::use_self)]
 #[allow(clippy::used_underscore_binding)]
 const _: () = {
+    #[allow(unused_extern_crates)]
+    extern crate pin_project as _pin_project;
     #[allow(dead_code)]
     #[allow(clippy::ref_option_ref)]
     struct __StructProjectionRef<'pin, T, U>
@@ -46,23 +49,23 @@
         unpinned: &'pin (U),
     }
     impl<T, U> Struct<T, U> {
-        fn project<'pin>(self: ::pin_project::__private::Pin<&'pin mut Self>) -> Proj<'pin, T, U> {
+        fn project<'pin>(self: _pin_project::__private::Pin<&'pin mut Self>) -> Proj<'pin, T, U> {
             unsafe {
                 let Self { pinned, unpinned } = self.get_unchecked_mut();
                 Proj {
-                    pinned: ::pin_project::__private::Pin::new_unchecked(pinned),
+                    pinned: _pin_project::__private::Pin::new_unchecked(pinned),
                     unpinned,
                 }
             }
         }
         #[allow(clippy::missing_const_for_fn)]
         fn project_ref<'pin>(
-            self: ::pin_project::__private::Pin<&'pin Self>,
+            self: _pin_project::__private::Pin<&'pin Self>,
         ) -> __StructProjectionRef<'pin, T, U> {
             unsafe {
                 let Self { pinned, unpinned } = self.get_ref();
                 __StructProjectionRef {
-                    pinned: ::pin_project::__private::Pin::new_unchecked(pinned),
+                    pinned: _pin_project::__private::Pin::new_unchecked(pinned),
                     unpinned,
                 }
             }
@@ -75,31 +78,31 @@
     }
     #[allow(missing_debug_implementations)]
     struct __Struct<'pin, T, U> {
-        __pin_project_use_generics: ::pin_project::__private::AlwaysUnpin<
+        __pin_project_use_generics: _pin_project::__private::AlwaysUnpin<
             'pin,
             (
-                ::pin_project::__private::PhantomData<T>,
-                ::pin_project::__private::PhantomData<U>,
+                _pin_project::__private::PhantomData<T>,
+                _pin_project::__private::PhantomData<U>,
             ),
         >,
         __field0: T,
     }
-    impl<'pin, T, U> ::pin_project::__private::Unpin for Struct<T, U> where
-        __Struct<'pin, T, U>: ::pin_project::__private::Unpin
+    impl<'pin, T, U> _pin_project::__private::Unpin for Struct<T, U> where
+        __Struct<'pin, T, U>: _pin_project::__private::Unpin
     {
     }
     #[doc(hidden)]
-    unsafe impl<'pin, T, U> ::pin_project::UnsafeUnpin for Struct<T, U> where
-        __Struct<'pin, T, U>: ::pin_project::__private::Unpin
+    unsafe impl<'pin, T, U> _pin_project::UnsafeUnpin for Struct<T, U> where
+        __Struct<'pin, T, U>: _pin_project::__private::Unpin
     {
     }
     trait StructMustNotImplDrop {}
     #[allow(clippy::drop_bounds, drop_bounds)]
-    impl<T: ::pin_project::__private::Drop> StructMustNotImplDrop for T {}
+    impl<T: _pin_project::__private::Drop> StructMustNotImplDrop for T {}
     impl<T, U> StructMustNotImplDrop for Struct<T, U> {}
     #[doc(hidden)]
-    impl<T, U> ::pin_project::__private::PinnedDrop for Struct<T, U> {
-        unsafe fn drop(self: ::pin_project::__private::Pin<&mut Self>) {}
+    impl<T, U> _pin_project::__private::PinnedDrop for Struct<T, U> {
+        unsafe fn drop(self: _pin_project::__private::Pin<&mut Self>) {}
     }
 };
 fn main() {}
diff --git a/tests/expand/naming/struct-none.expanded.rs b/tests/expand/naming/struct-none.expanded.rs
index 794675a..3089a54 100644
--- a/tests/expand/naming/struct-none.expanded.rs
+++ b/tests/expand/naming/struct-none.expanded.rs
@@ -14,10 +14,13 @@
 #[allow(clippy::pattern_type_mismatch)]
 #[allow(clippy::redundant_pub_crate)]
 #[allow(clippy::type_repetition_in_bounds)]
+#[allow(unused_qualifications)]
 #[allow(clippy::semicolon_if_nothing_returned)]
 #[allow(clippy::use_self)]
 #[allow(clippy::used_underscore_binding)]
 const _: () = {
+    #[allow(unused_extern_crates)]
+    extern crate pin_project as _pin_project;
     #[allow(dead_code)]
     #[allow(clippy::mut_mut)]
     struct __StructProjection<'pin, T, U>
@@ -38,24 +41,24 @@
     }
     impl<T, U> Struct<T, U> {
         fn project<'pin>(
-            self: ::pin_project::__private::Pin<&'pin mut Self>,
+            self: _pin_project::__private::Pin<&'pin mut Self>,
         ) -> __StructProjection<'pin, T, U> {
             unsafe {
                 let Self { pinned, unpinned } = self.get_unchecked_mut();
                 __StructProjection {
-                    pinned: ::pin_project::__private::Pin::new_unchecked(pinned),
+                    pinned: _pin_project::__private::Pin::new_unchecked(pinned),
                     unpinned,
                 }
             }
         }
         #[allow(clippy::missing_const_for_fn)]
         fn project_ref<'pin>(
-            self: ::pin_project::__private::Pin<&'pin Self>,
+            self: _pin_project::__private::Pin<&'pin Self>,
         ) -> __StructProjectionRef<'pin, T, U> {
             unsafe {
                 let Self { pinned, unpinned } = self.get_ref();
                 __StructProjectionRef {
-                    pinned: ::pin_project::__private::Pin::new_unchecked(pinned),
+                    pinned: _pin_project::__private::Pin::new_unchecked(pinned),
                     unpinned,
                 }
             }
@@ -68,31 +71,31 @@
     }
     #[allow(missing_debug_implementations)]
     struct __Struct<'pin, T, U> {
-        __pin_project_use_generics: ::pin_project::__private::AlwaysUnpin<
+        __pin_project_use_generics: _pin_project::__private::AlwaysUnpin<
             'pin,
             (
-                ::pin_project::__private::PhantomData<T>,
-                ::pin_project::__private::PhantomData<U>,
+                _pin_project::__private::PhantomData<T>,
+                _pin_project::__private::PhantomData<U>,
             ),
         >,
         __field0: T,
     }
-    impl<'pin, T, U> ::pin_project::__private::Unpin for Struct<T, U> where
-        __Struct<'pin, T, U>: ::pin_project::__private::Unpin
+    impl<'pin, T, U> _pin_project::__private::Unpin for Struct<T, U> where
+        __Struct<'pin, T, U>: _pin_project::__private::Unpin
     {
     }
     #[doc(hidden)]
-    unsafe impl<'pin, T, U> ::pin_project::UnsafeUnpin for Struct<T, U> where
-        __Struct<'pin, T, U>: ::pin_project::__private::Unpin
+    unsafe impl<'pin, T, U> _pin_project::UnsafeUnpin for Struct<T, U> where
+        __Struct<'pin, T, U>: _pin_project::__private::Unpin
     {
     }
     trait StructMustNotImplDrop {}
     #[allow(clippy::drop_bounds, drop_bounds)]
-    impl<T: ::pin_project::__private::Drop> StructMustNotImplDrop for T {}
+    impl<T: _pin_project::__private::Drop> StructMustNotImplDrop for T {}
     impl<T, U> StructMustNotImplDrop for Struct<T, U> {}
     #[doc(hidden)]
-    impl<T, U> ::pin_project::__private::PinnedDrop for Struct<T, U> {
-        unsafe fn drop(self: ::pin_project::__private::Pin<&mut Self>) {}
+    impl<T, U> _pin_project::__private::PinnedDrop for Struct<T, U> {
+        unsafe fn drop(self: _pin_project::__private::Pin<&mut Self>) {}
     }
 };
 fn main() {}
diff --git a/tests/expand/naming/struct-own.expanded.rs b/tests/expand/naming/struct-own.expanded.rs
index 2853838..d05c7d6 100644
--- a/tests/expand/naming/struct-own.expanded.rs
+++ b/tests/expand/naming/struct-own.expanded.rs
@@ -28,10 +28,13 @@
 #[allow(clippy::pattern_type_mismatch)]
 #[allow(clippy::redundant_pub_crate)]
 #[allow(clippy::type_repetition_in_bounds)]
+#[allow(unused_qualifications)]
 #[allow(clippy::semicolon_if_nothing_returned)]
 #[allow(clippy::use_self)]
 #[allow(clippy::used_underscore_binding)]
 const _: () = {
+    #[allow(unused_extern_crates)]
+    extern crate pin_project as _pin_project;
     #[allow(dead_code)]
     #[allow(clippy::mut_mut)]
     struct __StructProjection<'pin, T, U>
@@ -52,45 +55,43 @@
     }
     impl<T, U> Struct<T, U> {
         fn project<'pin>(
-            self: ::pin_project::__private::Pin<&'pin mut Self>,
+            self: _pin_project::__private::Pin<&'pin mut Self>,
         ) -> __StructProjection<'pin, T, U> {
             unsafe {
                 let Self { pinned, unpinned } = self.get_unchecked_mut();
                 __StructProjection {
-                    pinned: ::pin_project::__private::Pin::new_unchecked(pinned),
+                    pinned: _pin_project::__private::Pin::new_unchecked(pinned),
                     unpinned,
                 }
             }
         }
         #[allow(clippy::missing_const_for_fn)]
         fn project_ref<'pin>(
-            self: ::pin_project::__private::Pin<&'pin Self>,
+            self: _pin_project::__private::Pin<&'pin Self>,
         ) -> __StructProjectionRef<'pin, T, U> {
             unsafe {
                 let Self { pinned, unpinned } = self.get_ref();
                 __StructProjectionRef {
-                    pinned: ::pin_project::__private::Pin::new_unchecked(pinned),
+                    pinned: _pin_project::__private::Pin::new_unchecked(pinned),
                     unpinned,
                 }
             }
         }
         fn project_replace(
-            self: ::pin_project::__private::Pin<&mut Self>,
+            self: _pin_project::__private::Pin<&mut Self>,
             __replacement: Self,
         ) -> ProjOwn<T, U> {
             unsafe {
                 let __self_ptr: *mut Self = self.get_unchecked_mut();
-                let __guard = ::pin_project::__private::UnsafeOverwriteGuard {
-                    target: __self_ptr,
-                    value: ::pin_project::__private::ManuallyDrop::new(__replacement),
-                };
+                let __guard =
+                    _pin_project::__private::UnsafeOverwriteGuard::new(__self_ptr, __replacement);
                 let Self { pinned, unpinned } = &mut *__self_ptr;
                 let __result = ProjOwn {
-                    pinned: ::pin_project::__private::PhantomData,
-                    unpinned: ::pin_project::__private::ptr::read(unpinned),
+                    pinned: _pin_project::__private::PhantomData,
+                    unpinned: _pin_project::__private::ptr::read(unpinned),
                 };
                 {
-                    let __guard = ::pin_project::__private::UnsafeDropInPlaceGuard(pinned);
+                    let __guard = _pin_project::__private::UnsafeDropInPlaceGuard::new(pinned);
                 }
                 __result
             }
@@ -103,31 +104,31 @@
     }
     #[allow(missing_debug_implementations)]
     struct __Struct<'pin, T, U> {
-        __pin_project_use_generics: ::pin_project::__private::AlwaysUnpin<
+        __pin_project_use_generics: _pin_project::__private::AlwaysUnpin<
             'pin,
             (
-                ::pin_project::__private::PhantomData<T>,
-                ::pin_project::__private::PhantomData<U>,
+                _pin_project::__private::PhantomData<T>,
+                _pin_project::__private::PhantomData<U>,
             ),
         >,
         __field0: T,
     }
-    impl<'pin, T, U> ::pin_project::__private::Unpin for Struct<T, U> where
-        __Struct<'pin, T, U>: ::pin_project::__private::Unpin
+    impl<'pin, T, U> _pin_project::__private::Unpin for Struct<T, U> where
+        __Struct<'pin, T, U>: _pin_project::__private::Unpin
     {
     }
     #[doc(hidden)]
-    unsafe impl<'pin, T, U> ::pin_project::UnsafeUnpin for Struct<T, U> where
-        __Struct<'pin, T, U>: ::pin_project::__private::Unpin
+    unsafe impl<'pin, T, U> _pin_project::UnsafeUnpin for Struct<T, U> where
+        __Struct<'pin, T, U>: _pin_project::__private::Unpin
     {
     }
     trait StructMustNotImplDrop {}
     #[allow(clippy::drop_bounds, drop_bounds)]
-    impl<T: ::pin_project::__private::Drop> StructMustNotImplDrop for T {}
+    impl<T: _pin_project::__private::Drop> StructMustNotImplDrop for T {}
     impl<T, U> StructMustNotImplDrop for Struct<T, U> {}
     #[doc(hidden)]
-    impl<T, U> ::pin_project::__private::PinnedDrop for Struct<T, U> {
-        unsafe fn drop(self: ::pin_project::__private::Pin<&mut Self>) {}
+    impl<T, U> _pin_project::__private::PinnedDrop for Struct<T, U> {
+        unsafe fn drop(self: _pin_project::__private::Pin<&mut Self>) {}
     }
 };
 fn main() {}
diff --git a/tests/expand/naming/struct-ref.expanded.rs b/tests/expand/naming/struct-ref.expanded.rs
index baee324..c131ec4 100644
--- a/tests/expand/naming/struct-ref.expanded.rs
+++ b/tests/expand/naming/struct-ref.expanded.rs
@@ -32,10 +32,13 @@
 #[allow(clippy::pattern_type_mismatch)]
 #[allow(clippy::redundant_pub_crate)]
 #[allow(clippy::type_repetition_in_bounds)]
+#[allow(unused_qualifications)]
 #[allow(clippy::semicolon_if_nothing_returned)]
 #[allow(clippy::use_self)]
 #[allow(clippy::used_underscore_binding)]
 const _: () = {
+    #[allow(unused_extern_crates)]
+    extern crate pin_project as _pin_project;
     #[allow(dead_code)]
     #[allow(clippy::mut_mut)]
     struct __StructProjection<'pin, T, U>
@@ -47,24 +50,24 @@
     }
     impl<T, U> Struct<T, U> {
         fn project<'pin>(
-            self: ::pin_project::__private::Pin<&'pin mut Self>,
+            self: _pin_project::__private::Pin<&'pin mut Self>,
         ) -> __StructProjection<'pin, T, U> {
             unsafe {
                 let Self { pinned, unpinned } = self.get_unchecked_mut();
                 __StructProjection {
-                    pinned: ::pin_project::__private::Pin::new_unchecked(pinned),
+                    pinned: _pin_project::__private::Pin::new_unchecked(pinned),
                     unpinned,
                 }
             }
         }
         #[allow(clippy::missing_const_for_fn)]
         fn project_ref<'pin>(
-            self: ::pin_project::__private::Pin<&'pin Self>,
+            self: _pin_project::__private::Pin<&'pin Self>,
         ) -> ProjRef<'pin, T, U> {
             unsafe {
                 let Self { pinned, unpinned } = self.get_ref();
                 ProjRef {
-                    pinned: ::pin_project::__private::Pin::new_unchecked(pinned),
+                    pinned: _pin_project::__private::Pin::new_unchecked(pinned),
                     unpinned,
                 }
             }
@@ -77,31 +80,31 @@
     }
     #[allow(missing_debug_implementations)]
     struct __Struct<'pin, T, U> {
-        __pin_project_use_generics: ::pin_project::__private::AlwaysUnpin<
+        __pin_project_use_generics: _pin_project::__private::AlwaysUnpin<
             'pin,
             (
-                ::pin_project::__private::PhantomData<T>,
-                ::pin_project::__private::PhantomData<U>,
+                _pin_project::__private::PhantomData<T>,
+                _pin_project::__private::PhantomData<U>,
             ),
         >,
         __field0: T,
     }
-    impl<'pin, T, U> ::pin_project::__private::Unpin for Struct<T, U> where
-        __Struct<'pin, T, U>: ::pin_project::__private::Unpin
+    impl<'pin, T, U> _pin_project::__private::Unpin for Struct<T, U> where
+        __Struct<'pin, T, U>: _pin_project::__private::Unpin
     {
     }
     #[doc(hidden)]
-    unsafe impl<'pin, T, U> ::pin_project::UnsafeUnpin for Struct<T, U> where
-        __Struct<'pin, T, U>: ::pin_project::__private::Unpin
+    unsafe impl<'pin, T, U> _pin_project::UnsafeUnpin for Struct<T, U> where
+        __Struct<'pin, T, U>: _pin_project::__private::Unpin
     {
     }
     trait StructMustNotImplDrop {}
     #[allow(clippy::drop_bounds, drop_bounds)]
-    impl<T: ::pin_project::__private::Drop> StructMustNotImplDrop for T {}
+    impl<T: _pin_project::__private::Drop> StructMustNotImplDrop for T {}
     impl<T, U> StructMustNotImplDrop for Struct<T, U> {}
     #[doc(hidden)]
-    impl<T, U> ::pin_project::__private::PinnedDrop for Struct<T, U> {
-        unsafe fn drop(self: ::pin_project::__private::Pin<&mut Self>) {}
+    impl<T, U> _pin_project::__private::PinnedDrop for Struct<T, U> {
+        unsafe fn drop(self: _pin_project::__private::Pin<&mut Self>) {}
     }
 };
 fn main() {}
diff --git a/tests/expand/naming/tuple_struct-all.expanded.rs b/tests/expand/naming/tuple_struct-all.expanded.rs
index 125d483..042a798 100644
--- a/tests/expand/naming/tuple_struct-all.expanded.rs
+++ b/tests/expand/naming/tuple_struct-all.expanded.rs
@@ -49,43 +49,44 @@
 #[allow(clippy::pattern_type_mismatch)]
 #[allow(clippy::redundant_pub_crate)]
 #[allow(clippy::type_repetition_in_bounds)]
+#[allow(unused_qualifications)]
 #[allow(clippy::semicolon_if_nothing_returned)]
 #[allow(clippy::use_self)]
 #[allow(clippy::used_underscore_binding)]
 const _: () = {
+    #[allow(unused_extern_crates)]
+    extern crate pin_project as _pin_project;
     impl<T, U> TupleStruct<T, U> {
-        fn project<'pin>(self: ::pin_project::__private::Pin<&'pin mut Self>) -> Proj<'pin, T, U> {
+        fn project<'pin>(self: _pin_project::__private::Pin<&'pin mut Self>) -> Proj<'pin, T, U> {
             unsafe {
                 let Self(_0, _1) = self.get_unchecked_mut();
-                Proj(::pin_project::__private::Pin::new_unchecked(_0), _1)
+                Proj(_pin_project::__private::Pin::new_unchecked(_0), _1)
             }
         }
         #[allow(clippy::missing_const_for_fn)]
         fn project_ref<'pin>(
-            self: ::pin_project::__private::Pin<&'pin Self>,
+            self: _pin_project::__private::Pin<&'pin Self>,
         ) -> ProjRef<'pin, T, U> {
             unsafe {
                 let Self(_0, _1) = self.get_ref();
-                ProjRef(::pin_project::__private::Pin::new_unchecked(_0), _1)
+                ProjRef(_pin_project::__private::Pin::new_unchecked(_0), _1)
             }
         }
         fn project_replace(
-            self: ::pin_project::__private::Pin<&mut Self>,
+            self: _pin_project::__private::Pin<&mut Self>,
             __replacement: Self,
         ) -> ProjOwn<T, U> {
             unsafe {
                 let __self_ptr: *mut Self = self.get_unchecked_mut();
-                let __guard = ::pin_project::__private::UnsafeOverwriteGuard {
-                    target: __self_ptr,
-                    value: ::pin_project::__private::ManuallyDrop::new(__replacement),
-                };
+                let __guard =
+                    _pin_project::__private::UnsafeOverwriteGuard::new(__self_ptr, __replacement);
                 let Self(_0, _1) = &mut *__self_ptr;
                 let __result = ProjOwn(
-                    ::pin_project::__private::PhantomData,
-                    ::pin_project::__private::ptr::read(_1),
+                    _pin_project::__private::PhantomData,
+                    _pin_project::__private::ptr::read(_1),
                 );
                 {
-                    let __guard = ::pin_project::__private::UnsafeDropInPlaceGuard(_0);
+                    let __guard = _pin_project::__private::UnsafeDropInPlaceGuard::new(_0);
                 }
                 __result
             }
@@ -98,31 +99,31 @@
     }
     #[allow(missing_debug_implementations)]
     struct __TupleStruct<'pin, T, U> {
-        __pin_project_use_generics: ::pin_project::__private::AlwaysUnpin<
+        __pin_project_use_generics: _pin_project::__private::AlwaysUnpin<
             'pin,
             (
-                ::pin_project::__private::PhantomData<T>,
-                ::pin_project::__private::PhantomData<U>,
+                _pin_project::__private::PhantomData<T>,
+                _pin_project::__private::PhantomData<U>,
             ),
         >,
         __field0: T,
     }
-    impl<'pin, T, U> ::pin_project::__private::Unpin for TupleStruct<T, U> where
-        __TupleStruct<'pin, T, U>: ::pin_project::__private::Unpin
+    impl<'pin, T, U> _pin_project::__private::Unpin for TupleStruct<T, U> where
+        __TupleStruct<'pin, T, U>: _pin_project::__private::Unpin
     {
     }
     #[doc(hidden)]
-    unsafe impl<'pin, T, U> ::pin_project::UnsafeUnpin for TupleStruct<T, U> where
-        __TupleStruct<'pin, T, U>: ::pin_project::__private::Unpin
+    unsafe impl<'pin, T, U> _pin_project::UnsafeUnpin for TupleStruct<T, U> where
+        __TupleStruct<'pin, T, U>: _pin_project::__private::Unpin
     {
     }
     trait TupleStructMustNotImplDrop {}
     #[allow(clippy::drop_bounds, drop_bounds)]
-    impl<T: ::pin_project::__private::Drop> TupleStructMustNotImplDrop for T {}
+    impl<T: _pin_project::__private::Drop> TupleStructMustNotImplDrop for T {}
     impl<T, U> TupleStructMustNotImplDrop for TupleStruct<T, U> {}
     #[doc(hidden)]
-    impl<T, U> ::pin_project::__private::PinnedDrop for TupleStruct<T, U> {
-        unsafe fn drop(self: ::pin_project::__private::Pin<&mut Self>) {}
+    impl<T, U> _pin_project::__private::PinnedDrop for TupleStruct<T, U> {
+        unsafe fn drop(self: _pin_project::__private::Pin<&mut Self>) {}
     }
 };
 fn main() {}
diff --git a/tests/expand/naming/tuple_struct-mut.expanded.rs b/tests/expand/naming/tuple_struct-mut.expanded.rs
index f7daaff..60218d6 100644
--- a/tests/expand/naming/tuple_struct-mut.expanded.rs
+++ b/tests/expand/naming/tuple_struct-mut.expanded.rs
@@ -24,10 +24,13 @@
 #[allow(clippy::pattern_type_mismatch)]
 #[allow(clippy::redundant_pub_crate)]
 #[allow(clippy::type_repetition_in_bounds)]
+#[allow(unused_qualifications)]
 #[allow(clippy::semicolon_if_nothing_returned)]
 #[allow(clippy::use_self)]
 #[allow(clippy::used_underscore_binding)]
 const _: () = {
+    #[allow(unused_extern_crates)]
+    extern crate pin_project as _pin_project;
     #[allow(dead_code)]
     #[allow(clippy::ref_option_ref)]
     struct __TupleStructProjectionRef<'pin, T, U>(
@@ -37,19 +40,19 @@
     where
         TupleStruct<T, U>: 'pin;
     impl<T, U> TupleStruct<T, U> {
-        fn project<'pin>(self: ::pin_project::__private::Pin<&'pin mut Self>) -> Proj<'pin, T, U> {
+        fn project<'pin>(self: _pin_project::__private::Pin<&'pin mut Self>) -> Proj<'pin, T, U> {
             unsafe {
                 let Self(_0, _1) = self.get_unchecked_mut();
-                Proj(::pin_project::__private::Pin::new_unchecked(_0), _1)
+                Proj(_pin_project::__private::Pin::new_unchecked(_0), _1)
             }
         }
         #[allow(clippy::missing_const_for_fn)]
         fn project_ref<'pin>(
-            self: ::pin_project::__private::Pin<&'pin Self>,
+            self: _pin_project::__private::Pin<&'pin Self>,
         ) -> __TupleStructProjectionRef<'pin, T, U> {
             unsafe {
                 let Self(_0, _1) = self.get_ref();
-                __TupleStructProjectionRef(::pin_project::__private::Pin::new_unchecked(_0), _1)
+                __TupleStructProjectionRef(_pin_project::__private::Pin::new_unchecked(_0), _1)
             }
         }
     }
@@ -60,31 +63,31 @@
     }
     #[allow(missing_debug_implementations)]
     struct __TupleStruct<'pin, T, U> {
-        __pin_project_use_generics: ::pin_project::__private::AlwaysUnpin<
+        __pin_project_use_generics: _pin_project::__private::AlwaysUnpin<
             'pin,
             (
-                ::pin_project::__private::PhantomData<T>,
-                ::pin_project::__private::PhantomData<U>,
+                _pin_project::__private::PhantomData<T>,
+                _pin_project::__private::PhantomData<U>,
             ),
         >,
         __field0: T,
     }
-    impl<'pin, T, U> ::pin_project::__private::Unpin for TupleStruct<T, U> where
-        __TupleStruct<'pin, T, U>: ::pin_project::__private::Unpin
+    impl<'pin, T, U> _pin_project::__private::Unpin for TupleStruct<T, U> where
+        __TupleStruct<'pin, T, U>: _pin_project::__private::Unpin
     {
     }
     #[doc(hidden)]
-    unsafe impl<'pin, T, U> ::pin_project::UnsafeUnpin for TupleStruct<T, U> where
-        __TupleStruct<'pin, T, U>: ::pin_project::__private::Unpin
+    unsafe impl<'pin, T, U> _pin_project::UnsafeUnpin for TupleStruct<T, U> where
+        __TupleStruct<'pin, T, U>: _pin_project::__private::Unpin
     {
     }
     trait TupleStructMustNotImplDrop {}
     #[allow(clippy::drop_bounds, drop_bounds)]
-    impl<T: ::pin_project::__private::Drop> TupleStructMustNotImplDrop for T {}
+    impl<T: _pin_project::__private::Drop> TupleStructMustNotImplDrop for T {}
     impl<T, U> TupleStructMustNotImplDrop for TupleStruct<T, U> {}
     #[doc(hidden)]
-    impl<T, U> ::pin_project::__private::PinnedDrop for TupleStruct<T, U> {
-        unsafe fn drop(self: ::pin_project::__private::Pin<&mut Self>) {}
+    impl<T, U> _pin_project::__private::PinnedDrop for TupleStruct<T, U> {
+        unsafe fn drop(self: _pin_project::__private::Pin<&mut Self>) {}
     }
 };
 fn main() {}
diff --git a/tests/expand/naming/tuple_struct-none.expanded.rs b/tests/expand/naming/tuple_struct-none.expanded.rs
index 6a3dfbf..cc9b75e 100644
--- a/tests/expand/naming/tuple_struct-none.expanded.rs
+++ b/tests/expand/naming/tuple_struct-none.expanded.rs
@@ -10,10 +10,13 @@
 #[allow(clippy::pattern_type_mismatch)]
 #[allow(clippy::redundant_pub_crate)]
 #[allow(clippy::type_repetition_in_bounds)]
+#[allow(unused_qualifications)]
 #[allow(clippy::semicolon_if_nothing_returned)]
 #[allow(clippy::use_self)]
 #[allow(clippy::used_underscore_binding)]
 const _: () = {
+    #[allow(unused_extern_crates)]
+    extern crate pin_project as _pin_project;
     #[allow(dead_code)]
     #[allow(clippy::mut_mut)]
     struct __TupleStructProjection<'pin, T, U>(
@@ -32,20 +35,20 @@
         TupleStruct<T, U>: 'pin;
     impl<T, U> TupleStruct<T, U> {
         fn project<'pin>(
-            self: ::pin_project::__private::Pin<&'pin mut Self>,
+            self: _pin_project::__private::Pin<&'pin mut Self>,
         ) -> __TupleStructProjection<'pin, T, U> {
             unsafe {
                 let Self(_0, _1) = self.get_unchecked_mut();
-                __TupleStructProjection(::pin_project::__private::Pin::new_unchecked(_0), _1)
+                __TupleStructProjection(_pin_project::__private::Pin::new_unchecked(_0), _1)
             }
         }
         #[allow(clippy::missing_const_for_fn)]
         fn project_ref<'pin>(
-            self: ::pin_project::__private::Pin<&'pin Self>,
+            self: _pin_project::__private::Pin<&'pin Self>,
         ) -> __TupleStructProjectionRef<'pin, T, U> {
             unsafe {
                 let Self(_0, _1) = self.get_ref();
-                __TupleStructProjectionRef(::pin_project::__private::Pin::new_unchecked(_0), _1)
+                __TupleStructProjectionRef(_pin_project::__private::Pin::new_unchecked(_0), _1)
             }
         }
     }
@@ -56,31 +59,31 @@
     }
     #[allow(missing_debug_implementations)]
     struct __TupleStruct<'pin, T, U> {
-        __pin_project_use_generics: ::pin_project::__private::AlwaysUnpin<
+        __pin_project_use_generics: _pin_project::__private::AlwaysUnpin<
             'pin,
             (
-                ::pin_project::__private::PhantomData<T>,
-                ::pin_project::__private::PhantomData<U>,
+                _pin_project::__private::PhantomData<T>,
+                _pin_project::__private::PhantomData<U>,
             ),
         >,
         __field0: T,
     }
-    impl<'pin, T, U> ::pin_project::__private::Unpin for TupleStruct<T, U> where
-        __TupleStruct<'pin, T, U>: ::pin_project::__private::Unpin
+    impl<'pin, T, U> _pin_project::__private::Unpin for TupleStruct<T, U> where
+        __TupleStruct<'pin, T, U>: _pin_project::__private::Unpin
     {
     }
     #[doc(hidden)]
-    unsafe impl<'pin, T, U> ::pin_project::UnsafeUnpin for TupleStruct<T, U> where
-        __TupleStruct<'pin, T, U>: ::pin_project::__private::Unpin
+    unsafe impl<'pin, T, U> _pin_project::UnsafeUnpin for TupleStruct<T, U> where
+        __TupleStruct<'pin, T, U>: _pin_project::__private::Unpin
     {
     }
     trait TupleStructMustNotImplDrop {}
     #[allow(clippy::drop_bounds, drop_bounds)]
-    impl<T: ::pin_project::__private::Drop> TupleStructMustNotImplDrop for T {}
+    impl<T: _pin_project::__private::Drop> TupleStructMustNotImplDrop for T {}
     impl<T, U> TupleStructMustNotImplDrop for TupleStruct<T, U> {}
     #[doc(hidden)]
-    impl<T, U> ::pin_project::__private::PinnedDrop for TupleStruct<T, U> {
-        unsafe fn drop(self: ::pin_project::__private::Pin<&mut Self>) {}
+    impl<T, U> _pin_project::__private::PinnedDrop for TupleStruct<T, U> {
+        unsafe fn drop(self: _pin_project::__private::Pin<&mut Self>) {}
     }
 };
 fn main() {}
diff --git a/tests/expand/naming/tuple_struct-own.expanded.rs b/tests/expand/naming/tuple_struct-own.expanded.rs
index 5f18045..21e12de 100644
--- a/tests/expand/naming/tuple_struct-own.expanded.rs
+++ b/tests/expand/naming/tuple_struct-own.expanded.rs
@@ -21,10 +21,13 @@
 #[allow(clippy::pattern_type_mismatch)]
 #[allow(clippy::redundant_pub_crate)]
 #[allow(clippy::type_repetition_in_bounds)]
+#[allow(unused_qualifications)]
 #[allow(clippy::semicolon_if_nothing_returned)]
 #[allow(clippy::use_self)]
 #[allow(clippy::used_underscore_binding)]
 const _: () = {
+    #[allow(unused_extern_crates)]
+    extern crate pin_project as _pin_project;
     #[allow(dead_code)]
     #[allow(clippy::mut_mut)]
     struct __TupleStructProjection<'pin, T, U>(
@@ -43,39 +46,37 @@
         TupleStruct<T, U>: 'pin;
     impl<T, U> TupleStruct<T, U> {
         fn project<'pin>(
-            self: ::pin_project::__private::Pin<&'pin mut Self>,
+            self: _pin_project::__private::Pin<&'pin mut Self>,
         ) -> __TupleStructProjection<'pin, T, U> {
             unsafe {
                 let Self(_0, _1) = self.get_unchecked_mut();
-                __TupleStructProjection(::pin_project::__private::Pin::new_unchecked(_0), _1)
+                __TupleStructProjection(_pin_project::__private::Pin::new_unchecked(_0), _1)
             }
         }
         #[allow(clippy::missing_const_for_fn)]
         fn project_ref<'pin>(
-            self: ::pin_project::__private::Pin<&'pin Self>,
+            self: _pin_project::__private::Pin<&'pin Self>,
         ) -> __TupleStructProjectionRef<'pin, T, U> {
             unsafe {
                 let Self(_0, _1) = self.get_ref();
-                __TupleStructProjectionRef(::pin_project::__private::Pin::new_unchecked(_0), _1)
+                __TupleStructProjectionRef(_pin_project::__private::Pin::new_unchecked(_0), _1)
             }
         }
         fn project_replace(
-            self: ::pin_project::__private::Pin<&mut Self>,
+            self: _pin_project::__private::Pin<&mut Self>,
             __replacement: Self,
         ) -> ProjOwn<T, U> {
             unsafe {
                 let __self_ptr: *mut Self = self.get_unchecked_mut();
-                let __guard = ::pin_project::__private::UnsafeOverwriteGuard {
-                    target: __self_ptr,
-                    value: ::pin_project::__private::ManuallyDrop::new(__replacement),
-                };
+                let __guard =
+                    _pin_project::__private::UnsafeOverwriteGuard::new(__self_ptr, __replacement);
                 let Self(_0, _1) = &mut *__self_ptr;
                 let __result = ProjOwn(
-                    ::pin_project::__private::PhantomData,
-                    ::pin_project::__private::ptr::read(_1),
+                    _pin_project::__private::PhantomData,
+                    _pin_project::__private::ptr::read(_1),
                 );
                 {
-                    let __guard = ::pin_project::__private::UnsafeDropInPlaceGuard(_0);
+                    let __guard = _pin_project::__private::UnsafeDropInPlaceGuard::new(_0);
                 }
                 __result
             }
@@ -88,31 +89,31 @@
     }
     #[allow(missing_debug_implementations)]
     struct __TupleStruct<'pin, T, U> {
-        __pin_project_use_generics: ::pin_project::__private::AlwaysUnpin<
+        __pin_project_use_generics: _pin_project::__private::AlwaysUnpin<
             'pin,
             (
-                ::pin_project::__private::PhantomData<T>,
-                ::pin_project::__private::PhantomData<U>,
+                _pin_project::__private::PhantomData<T>,
+                _pin_project::__private::PhantomData<U>,
             ),
         >,
         __field0: T,
     }
-    impl<'pin, T, U> ::pin_project::__private::Unpin for TupleStruct<T, U> where
-        __TupleStruct<'pin, T, U>: ::pin_project::__private::Unpin
+    impl<'pin, T, U> _pin_project::__private::Unpin for TupleStruct<T, U> where
+        __TupleStruct<'pin, T, U>: _pin_project::__private::Unpin
     {
     }
     #[doc(hidden)]
-    unsafe impl<'pin, T, U> ::pin_project::UnsafeUnpin for TupleStruct<T, U> where
-        __TupleStruct<'pin, T, U>: ::pin_project::__private::Unpin
+    unsafe impl<'pin, T, U> _pin_project::UnsafeUnpin for TupleStruct<T, U> where
+        __TupleStruct<'pin, T, U>: _pin_project::__private::Unpin
     {
     }
     trait TupleStructMustNotImplDrop {}
     #[allow(clippy::drop_bounds, drop_bounds)]
-    impl<T: ::pin_project::__private::Drop> TupleStructMustNotImplDrop for T {}
+    impl<T: _pin_project::__private::Drop> TupleStructMustNotImplDrop for T {}
     impl<T, U> TupleStructMustNotImplDrop for TupleStruct<T, U> {}
     #[doc(hidden)]
-    impl<T, U> ::pin_project::__private::PinnedDrop for TupleStruct<T, U> {
-        unsafe fn drop(self: ::pin_project::__private::Pin<&mut Self>) {}
+    impl<T, U> _pin_project::__private::PinnedDrop for TupleStruct<T, U> {
+        unsafe fn drop(self: _pin_project::__private::Pin<&mut Self>) {}
     }
 };
 fn main() {}
diff --git a/tests/expand/naming/tuple_struct-ref.expanded.rs b/tests/expand/naming/tuple_struct-ref.expanded.rs
index d8d5008..ea11b6a 100644
--- a/tests/expand/naming/tuple_struct-ref.expanded.rs
+++ b/tests/expand/naming/tuple_struct-ref.expanded.rs
@@ -24,10 +24,13 @@
 #[allow(clippy::pattern_type_mismatch)]
 #[allow(clippy::redundant_pub_crate)]
 #[allow(clippy::type_repetition_in_bounds)]
+#[allow(unused_qualifications)]
 #[allow(clippy::semicolon_if_nothing_returned)]
 #[allow(clippy::use_self)]
 #[allow(clippy::used_underscore_binding)]
 const _: () = {
+    #[allow(unused_extern_crates)]
+    extern crate pin_project as _pin_project;
     #[allow(dead_code)]
     #[allow(clippy::mut_mut)]
     struct __TupleStructProjection<'pin, T, U>(
@@ -38,20 +41,20 @@
         TupleStruct<T, U>: 'pin;
     impl<T, U> TupleStruct<T, U> {
         fn project<'pin>(
-            self: ::pin_project::__private::Pin<&'pin mut Self>,
+            self: _pin_project::__private::Pin<&'pin mut Self>,
         ) -> __TupleStructProjection<'pin, T, U> {
             unsafe {
                 let Self(_0, _1) = self.get_unchecked_mut();
-                __TupleStructProjection(::pin_project::__private::Pin::new_unchecked(_0), _1)
+                __TupleStructProjection(_pin_project::__private::Pin::new_unchecked(_0), _1)
             }
         }
         #[allow(clippy::missing_const_for_fn)]
         fn project_ref<'pin>(
-            self: ::pin_project::__private::Pin<&'pin Self>,
+            self: _pin_project::__private::Pin<&'pin Self>,
         ) -> ProjRef<'pin, T, U> {
             unsafe {
                 let Self(_0, _1) = self.get_ref();
-                ProjRef(::pin_project::__private::Pin::new_unchecked(_0), _1)
+                ProjRef(_pin_project::__private::Pin::new_unchecked(_0), _1)
             }
         }
     }
@@ -62,31 +65,31 @@
     }
     #[allow(missing_debug_implementations)]
     struct __TupleStruct<'pin, T, U> {
-        __pin_project_use_generics: ::pin_project::__private::AlwaysUnpin<
+        __pin_project_use_generics: _pin_project::__private::AlwaysUnpin<
             'pin,
             (
-                ::pin_project::__private::PhantomData<T>,
-                ::pin_project::__private::PhantomData<U>,
+                _pin_project::__private::PhantomData<T>,
+                _pin_project::__private::PhantomData<U>,
             ),
         >,
         __field0: T,
     }
-    impl<'pin, T, U> ::pin_project::__private::Unpin for TupleStruct<T, U> where
-        __TupleStruct<'pin, T, U>: ::pin_project::__private::Unpin
+    impl<'pin, T, U> _pin_project::__private::Unpin for TupleStruct<T, U> where
+        __TupleStruct<'pin, T, U>: _pin_project::__private::Unpin
     {
     }
     #[doc(hidden)]
-    unsafe impl<'pin, T, U> ::pin_project::UnsafeUnpin for TupleStruct<T, U> where
-        __TupleStruct<'pin, T, U>: ::pin_project::__private::Unpin
+    unsafe impl<'pin, T, U> _pin_project::UnsafeUnpin for TupleStruct<T, U> where
+        __TupleStruct<'pin, T, U>: _pin_project::__private::Unpin
     {
     }
     trait TupleStructMustNotImplDrop {}
     #[allow(clippy::drop_bounds, drop_bounds)]
-    impl<T: ::pin_project::__private::Drop> TupleStructMustNotImplDrop for T {}
+    impl<T: _pin_project::__private::Drop> TupleStructMustNotImplDrop for T {}
     impl<T, U> TupleStructMustNotImplDrop for TupleStruct<T, U> {}
     #[doc(hidden)]
-    impl<T, U> ::pin_project::__private::PinnedDrop for TupleStruct<T, U> {
-        unsafe fn drop(self: ::pin_project::__private::Pin<&mut Self>) {}
+    impl<T, U> _pin_project::__private::PinnedDrop for TupleStruct<T, U> {
+        unsafe fn drop(self: _pin_project::__private::Pin<&mut Self>) {}
     }
 };
 fn main() {}
diff --git a/tests/expand/not_unpin/enum.expanded.rs b/tests/expand/not_unpin/enum.expanded.rs
index 3414a10..5173b54 100644
--- a/tests/expand/not_unpin/enum.expanded.rs
+++ b/tests/expand/not_unpin/enum.expanded.rs
@@ -62,22 +62,25 @@
 #[allow(clippy::pattern_type_mismatch)]
 #[allow(clippy::redundant_pub_crate)]
 #[allow(clippy::type_repetition_in_bounds)]
+#[allow(unused_qualifications)]
 #[allow(clippy::semicolon_if_nothing_returned)]
 #[allow(clippy::use_self)]
 #[allow(clippy::used_underscore_binding)]
 const _: () = {
+    #[allow(unused_extern_crates)]
+    extern crate pin_project as _pin_project;
     impl<T, U> Enum<T, U> {
         fn project<'pin>(
-            self: ::pin_project::__private::Pin<&'pin mut Self>,
+            self: _pin_project::__private::Pin<&'pin mut Self>,
         ) -> EnumProj<'pin, T, U> {
             unsafe {
                 match self.get_unchecked_mut() {
                     Self::Struct { pinned, unpinned } => EnumProj::Struct {
-                        pinned: ::pin_project::__private::Pin::new_unchecked(pinned),
+                        pinned: _pin_project::__private::Pin::new_unchecked(pinned),
                         unpinned,
                     },
                     Self::Tuple(_0, _1) => {
-                        EnumProj::Tuple(::pin_project::__private::Pin::new_unchecked(_0), _1)
+                        EnumProj::Tuple(_pin_project::__private::Pin::new_unchecked(_0), _1)
                     }
                     Self::Unit => EnumProj::Unit,
                 }
@@ -85,40 +88,40 @@
         }
         #[allow(clippy::missing_const_for_fn)]
         fn project_ref<'pin>(
-            self: ::pin_project::__private::Pin<&'pin Self>,
+            self: _pin_project::__private::Pin<&'pin Self>,
         ) -> EnumProjRef<'pin, T, U> {
             unsafe {
                 match self.get_ref() {
                     Self::Struct { pinned, unpinned } => EnumProjRef::Struct {
-                        pinned: ::pin_project::__private::Pin::new_unchecked(pinned),
+                        pinned: _pin_project::__private::Pin::new_unchecked(pinned),
                         unpinned,
                     },
                     Self::Tuple(_0, _1) => {
-                        EnumProjRef::Tuple(::pin_project::__private::Pin::new_unchecked(_0), _1)
+                        EnumProjRef::Tuple(_pin_project::__private::Pin::new_unchecked(_0), _1)
                     }
                     Self::Unit => EnumProjRef::Unit,
                 }
             }
         }
     }
-    impl<'pin, T, U> ::pin_project::__private::Unpin for Enum<T, U> where
-        ::pin_project::__private::Wrapper<'pin, ::pin_project::__private::PhantomPinned>:
-            ::pin_project::__private::Unpin
+    impl<'pin, T, U> _pin_project::__private::Unpin for Enum<T, U> where
+        _pin_project::__private::Wrapper<'pin, _pin_project::__private::PhantomPinned>:
+            _pin_project::__private::Unpin
     {
     }
     #[doc(hidden)]
-    unsafe impl<'pin, T, U> ::pin_project::UnsafeUnpin for Enum<T, U> where
-        ::pin_project::__private::Wrapper<'pin, ::pin_project::__private::PhantomPinned>:
-            ::pin_project::__private::Unpin
+    unsafe impl<'pin, T, U> _pin_project::UnsafeUnpin for Enum<T, U> where
+        _pin_project::__private::Wrapper<'pin, _pin_project::__private::PhantomPinned>:
+            _pin_project::__private::Unpin
     {
     }
     trait EnumMustNotImplDrop {}
     #[allow(clippy::drop_bounds, drop_bounds)]
-    impl<T: ::pin_project::__private::Drop> EnumMustNotImplDrop for T {}
+    impl<T: _pin_project::__private::Drop> EnumMustNotImplDrop for T {}
     impl<T, U> EnumMustNotImplDrop for Enum<T, U> {}
     #[doc(hidden)]
-    impl<T, U> ::pin_project::__private::PinnedDrop for Enum<T, U> {
-        unsafe fn drop(self: ::pin_project::__private::Pin<&mut Self>) {}
+    impl<T, U> _pin_project::__private::PinnedDrop for Enum<T, U> {
+        unsafe fn drop(self: _pin_project::__private::Pin<&mut Self>) {}
     }
 };
 fn main() {}
diff --git a/tests/expand/not_unpin/struct.expanded.rs b/tests/expand/not_unpin/struct.expanded.rs
index b701af5..e9d8922 100644
--- a/tests/expand/not_unpin/struct.expanded.rs
+++ b/tests/expand/not_unpin/struct.expanded.rs
@@ -14,10 +14,13 @@
 #[allow(clippy::pattern_type_mismatch)]
 #[allow(clippy::redundant_pub_crate)]
 #[allow(clippy::type_repetition_in_bounds)]
+#[allow(unused_qualifications)]
 #[allow(clippy::semicolon_if_nothing_returned)]
 #[allow(clippy::use_self)]
 #[allow(clippy::used_underscore_binding)]
 const _: () = {
+    #[allow(unused_extern_crates)]
+    extern crate pin_project as _pin_project;
     #[allow(dead_code)]
     #[allow(clippy::mut_mut)]
     struct __StructProjection<'pin, T, U>
@@ -38,24 +41,24 @@
     }
     impl<T, U> Struct<T, U> {
         fn project<'pin>(
-            self: ::pin_project::__private::Pin<&'pin mut Self>,
+            self: _pin_project::__private::Pin<&'pin mut Self>,
         ) -> __StructProjection<'pin, T, U> {
             unsafe {
                 let Self { pinned, unpinned } = self.get_unchecked_mut();
                 __StructProjection {
-                    pinned: ::pin_project::__private::Pin::new_unchecked(pinned),
+                    pinned: _pin_project::__private::Pin::new_unchecked(pinned),
                     unpinned,
                 }
             }
         }
         #[allow(clippy::missing_const_for_fn)]
         fn project_ref<'pin>(
-            self: ::pin_project::__private::Pin<&'pin Self>,
+            self: _pin_project::__private::Pin<&'pin Self>,
         ) -> __StructProjectionRef<'pin, T, U> {
             unsafe {
                 let Self { pinned, unpinned } = self.get_ref();
                 __StructProjectionRef {
-                    pinned: ::pin_project::__private::Pin::new_unchecked(pinned),
+                    pinned: _pin_project::__private::Pin::new_unchecked(pinned),
                     unpinned,
                 }
             }
@@ -66,24 +69,24 @@
         let _ = &this.pinned;
         let _ = &this.unpinned;
     }
-    impl<'pin, T, U> ::pin_project::__private::Unpin for Struct<T, U> where
-        ::pin_project::__private::Wrapper<'pin, ::pin_project::__private::PhantomPinned>:
-            ::pin_project::__private::Unpin
+    impl<'pin, T, U> _pin_project::__private::Unpin for Struct<T, U> where
+        _pin_project::__private::Wrapper<'pin, _pin_project::__private::PhantomPinned>:
+            _pin_project::__private::Unpin
     {
     }
     #[doc(hidden)]
-    unsafe impl<'pin, T, U> ::pin_project::UnsafeUnpin for Struct<T, U> where
-        ::pin_project::__private::Wrapper<'pin, ::pin_project::__private::PhantomPinned>:
-            ::pin_project::__private::Unpin
+    unsafe impl<'pin, T, U> _pin_project::UnsafeUnpin for Struct<T, U> where
+        _pin_project::__private::Wrapper<'pin, _pin_project::__private::PhantomPinned>:
+            _pin_project::__private::Unpin
     {
     }
     trait StructMustNotImplDrop {}
     #[allow(clippy::drop_bounds, drop_bounds)]
-    impl<T: ::pin_project::__private::Drop> StructMustNotImplDrop for T {}
+    impl<T: _pin_project::__private::Drop> StructMustNotImplDrop for T {}
     impl<T, U> StructMustNotImplDrop for Struct<T, U> {}
     #[doc(hidden)]
-    impl<T, U> ::pin_project::__private::PinnedDrop for Struct<T, U> {
-        unsafe fn drop(self: ::pin_project::__private::Pin<&mut Self>) {}
+    impl<T, U> _pin_project::__private::PinnedDrop for Struct<T, U> {
+        unsafe fn drop(self: _pin_project::__private::Pin<&mut Self>) {}
     }
 };
 fn main() {}
diff --git a/tests/expand/not_unpin/tuple_struct.expanded.rs b/tests/expand/not_unpin/tuple_struct.expanded.rs
index 4b73483..cefb61d 100644
--- a/tests/expand/not_unpin/tuple_struct.expanded.rs
+++ b/tests/expand/not_unpin/tuple_struct.expanded.rs
@@ -10,10 +10,13 @@
 #[allow(clippy::pattern_type_mismatch)]
 #[allow(clippy::redundant_pub_crate)]
 #[allow(clippy::type_repetition_in_bounds)]
+#[allow(unused_qualifications)]
 #[allow(clippy::semicolon_if_nothing_returned)]
 #[allow(clippy::use_self)]
 #[allow(clippy::used_underscore_binding)]
 const _: () = {
+    #[allow(unused_extern_crates)]
+    extern crate pin_project as _pin_project;
     #[allow(dead_code)]
     #[allow(clippy::mut_mut)]
     struct __TupleStructProjection<'pin, T, U>(
@@ -32,20 +35,20 @@
         TupleStruct<T, U>: 'pin;
     impl<T, U> TupleStruct<T, U> {
         fn project<'pin>(
-            self: ::pin_project::__private::Pin<&'pin mut Self>,
+            self: _pin_project::__private::Pin<&'pin mut Self>,
         ) -> __TupleStructProjection<'pin, T, U> {
             unsafe {
                 let Self(_0, _1) = self.get_unchecked_mut();
-                __TupleStructProjection(::pin_project::__private::Pin::new_unchecked(_0), _1)
+                __TupleStructProjection(_pin_project::__private::Pin::new_unchecked(_0), _1)
             }
         }
         #[allow(clippy::missing_const_for_fn)]
         fn project_ref<'pin>(
-            self: ::pin_project::__private::Pin<&'pin Self>,
+            self: _pin_project::__private::Pin<&'pin Self>,
         ) -> __TupleStructProjectionRef<'pin, T, U> {
             unsafe {
                 let Self(_0, _1) = self.get_ref();
-                __TupleStructProjectionRef(::pin_project::__private::Pin::new_unchecked(_0), _1)
+                __TupleStructProjectionRef(_pin_project::__private::Pin::new_unchecked(_0), _1)
             }
         }
     }
@@ -54,24 +57,24 @@
         let _ = &this.0;
         let _ = &this.1;
     }
-    impl<'pin, T, U> ::pin_project::__private::Unpin for TupleStruct<T, U> where
-        ::pin_project::__private::Wrapper<'pin, ::pin_project::__private::PhantomPinned>:
-            ::pin_project::__private::Unpin
+    impl<'pin, T, U> _pin_project::__private::Unpin for TupleStruct<T, U> where
+        _pin_project::__private::Wrapper<'pin, _pin_project::__private::PhantomPinned>:
+            _pin_project::__private::Unpin
     {
     }
     #[doc(hidden)]
-    unsafe impl<'pin, T, U> ::pin_project::UnsafeUnpin for TupleStruct<T, U> where
-        ::pin_project::__private::Wrapper<'pin, ::pin_project::__private::PhantomPinned>:
-            ::pin_project::__private::Unpin
+    unsafe impl<'pin, T, U> _pin_project::UnsafeUnpin for TupleStruct<T, U> where
+        _pin_project::__private::Wrapper<'pin, _pin_project::__private::PhantomPinned>:
+            _pin_project::__private::Unpin
     {
     }
     trait TupleStructMustNotImplDrop {}
     #[allow(clippy::drop_bounds, drop_bounds)]
-    impl<T: ::pin_project::__private::Drop> TupleStructMustNotImplDrop for T {}
+    impl<T: _pin_project::__private::Drop> TupleStructMustNotImplDrop for T {}
     impl<T, U> TupleStructMustNotImplDrop for TupleStruct<T, U> {}
     #[doc(hidden)]
-    impl<T, U> ::pin_project::__private::PinnedDrop for TupleStruct<T, U> {
-        unsafe fn drop(self: ::pin_project::__private::Pin<&mut Self>) {}
+    impl<T, U> _pin_project::__private::PinnedDrop for TupleStruct<T, U> {
+        unsafe fn drop(self: _pin_project::__private::Pin<&mut Self>) {}
     }
 };
 fn main() {}
diff --git a/tests/expand/pinned_drop/enum.expanded.rs b/tests/expand/pinned_drop/enum.expanded.rs
index a968b72..e1bc486 100644
--- a/tests/expand/pinned_drop/enum.expanded.rs
+++ b/tests/expand/pinned_drop/enum.expanded.rs
@@ -63,22 +63,25 @@
 #[allow(clippy::pattern_type_mismatch)]
 #[allow(clippy::redundant_pub_crate)]
 #[allow(clippy::type_repetition_in_bounds)]
+#[allow(unused_qualifications)]
 #[allow(clippy::semicolon_if_nothing_returned)]
 #[allow(clippy::use_self)]
 #[allow(clippy::used_underscore_binding)]
 const _: () = {
+    #[allow(unused_extern_crates)]
+    extern crate pin_project as _pin_project;
     impl<T, U> Enum<T, U> {
         fn project<'pin>(
-            self: ::pin_project::__private::Pin<&'pin mut Self>,
+            self: _pin_project::__private::Pin<&'pin mut Self>,
         ) -> EnumProj<'pin, T, U> {
             unsafe {
                 match self.get_unchecked_mut() {
                     Self::Struct { pinned, unpinned } => EnumProj::Struct {
-                        pinned: ::pin_project::__private::Pin::new_unchecked(pinned),
+                        pinned: _pin_project::__private::Pin::new_unchecked(pinned),
                         unpinned,
                     },
                     Self::Tuple(_0, _1) => {
-                        EnumProj::Tuple(::pin_project::__private::Pin::new_unchecked(_0), _1)
+                        EnumProj::Tuple(_pin_project::__private::Pin::new_unchecked(_0), _1)
                     }
                     Self::Unit => EnumProj::Unit,
                 }
@@ -86,16 +89,16 @@
         }
         #[allow(clippy::missing_const_for_fn)]
         fn project_ref<'pin>(
-            self: ::pin_project::__private::Pin<&'pin Self>,
+            self: _pin_project::__private::Pin<&'pin Self>,
         ) -> EnumProjRef<'pin, T, U> {
             unsafe {
                 match self.get_ref() {
                     Self::Struct { pinned, unpinned } => EnumProjRef::Struct {
-                        pinned: ::pin_project::__private::Pin::new_unchecked(pinned),
+                        pinned: _pin_project::__private::Pin::new_unchecked(pinned),
                         unpinned,
                     },
                     Self::Tuple(_0, _1) => {
-                        EnumProjRef::Tuple(::pin_project::__private::Pin::new_unchecked(_0), _1)
+                        EnumProjRef::Tuple(_pin_project::__private::Pin::new_unchecked(_0), _1)
                     }
                     Self::Unit => EnumProjRef::Unit,
                 }
@@ -104,30 +107,30 @@
     }
     #[allow(missing_debug_implementations)]
     struct __Enum<'pin, T, U> {
-        __pin_project_use_generics: ::pin_project::__private::AlwaysUnpin<
+        __pin_project_use_generics: _pin_project::__private::AlwaysUnpin<
             'pin,
             (
-                ::pin_project::__private::PhantomData<T>,
-                ::pin_project::__private::PhantomData<U>,
+                _pin_project::__private::PhantomData<T>,
+                _pin_project::__private::PhantomData<U>,
             ),
         >,
         __field0: T,
         __field1: T,
     }
-    impl<'pin, T, U> ::pin_project::__private::Unpin for Enum<T, U> where
-        __Enum<'pin, T, U>: ::pin_project::__private::Unpin
+    impl<'pin, T, U> _pin_project::__private::Unpin for Enum<T, U> where
+        __Enum<'pin, T, U>: _pin_project::__private::Unpin
     {
     }
     #[doc(hidden)]
-    unsafe impl<'pin, T, U> ::pin_project::UnsafeUnpin for Enum<T, U> where
-        __Enum<'pin, T, U>: ::pin_project::__private::Unpin
+    unsafe impl<'pin, T, U> _pin_project::UnsafeUnpin for Enum<T, U> where
+        __Enum<'pin, T, U>: _pin_project::__private::Unpin
     {
     }
-    impl<T, U> ::pin_project::__private::Drop for Enum<T, U> {
+    impl<T, U> _pin_project::__private::Drop for Enum<T, U> {
         fn drop(&mut self) {
             unsafe {
-                let __pinned_self = ::pin_project::__private::Pin::new_unchecked(self);
-                ::pin_project::__private::PinnedDrop::drop(__pinned_self);
+                let __pinned_self = _pin_project::__private::Pin::new_unchecked(self);
+                _pin_project::__private::PinnedDrop::drop(__pinned_self);
             }
         }
     }
diff --git a/tests/expand/pinned_drop/struct.expanded.rs b/tests/expand/pinned_drop/struct.expanded.rs
index 630389b..2227442 100644
--- a/tests/expand/pinned_drop/struct.expanded.rs
+++ b/tests/expand/pinned_drop/struct.expanded.rs
@@ -15,10 +15,13 @@
 #[allow(clippy::pattern_type_mismatch)]
 #[allow(clippy::redundant_pub_crate)]
 #[allow(clippy::type_repetition_in_bounds)]
+#[allow(unused_qualifications)]
 #[allow(clippy::semicolon_if_nothing_returned)]
 #[allow(clippy::use_self)]
 #[allow(clippy::used_underscore_binding)]
 const _: () = {
+    #[allow(unused_extern_crates)]
+    extern crate pin_project as _pin_project;
     #[allow(dead_code)]
     #[allow(clippy::mut_mut)]
     struct __StructProjection<'pin, T, U>
@@ -39,24 +42,24 @@
     }
     impl<T, U> Struct<T, U> {
         fn project<'pin>(
-            self: ::pin_project::__private::Pin<&'pin mut Self>,
+            self: _pin_project::__private::Pin<&'pin mut Self>,
         ) -> __StructProjection<'pin, T, U> {
             unsafe {
                 let Self { pinned, unpinned } = self.get_unchecked_mut();
                 __StructProjection {
-                    pinned: ::pin_project::__private::Pin::new_unchecked(pinned),
+                    pinned: _pin_project::__private::Pin::new_unchecked(pinned),
                     unpinned,
                 }
             }
         }
         #[allow(clippy::missing_const_for_fn)]
         fn project_ref<'pin>(
-            self: ::pin_project::__private::Pin<&'pin Self>,
+            self: _pin_project::__private::Pin<&'pin Self>,
         ) -> __StructProjectionRef<'pin, T, U> {
             unsafe {
                 let Self { pinned, unpinned } = self.get_ref();
                 __StructProjectionRef {
-                    pinned: ::pin_project::__private::Pin::new_unchecked(pinned),
+                    pinned: _pin_project::__private::Pin::new_unchecked(pinned),
                     unpinned,
                 }
             }
@@ -69,29 +72,29 @@
     }
     #[allow(missing_debug_implementations)]
     struct __Struct<'pin, T, U> {
-        __pin_project_use_generics: ::pin_project::__private::AlwaysUnpin<
+        __pin_project_use_generics: _pin_project::__private::AlwaysUnpin<
             'pin,
             (
-                ::pin_project::__private::PhantomData<T>,
-                ::pin_project::__private::PhantomData<U>,
+                _pin_project::__private::PhantomData<T>,
+                _pin_project::__private::PhantomData<U>,
             ),
         >,
         __field0: T,
     }
-    impl<'pin, T, U> ::pin_project::__private::Unpin for Struct<T, U> where
-        __Struct<'pin, T, U>: ::pin_project::__private::Unpin
+    impl<'pin, T, U> _pin_project::__private::Unpin for Struct<T, U> where
+        __Struct<'pin, T, U>: _pin_project::__private::Unpin
     {
     }
     #[doc(hidden)]
-    unsafe impl<'pin, T, U> ::pin_project::UnsafeUnpin for Struct<T, U> where
-        __Struct<'pin, T, U>: ::pin_project::__private::Unpin
+    unsafe impl<'pin, T, U> _pin_project::UnsafeUnpin for Struct<T, U> where
+        __Struct<'pin, T, U>: _pin_project::__private::Unpin
     {
     }
-    impl<T, U> ::pin_project::__private::Drop for Struct<T, U> {
+    impl<T, U> _pin_project::__private::Drop for Struct<T, U> {
         fn drop(&mut self) {
             unsafe {
-                let __pinned_self = ::pin_project::__private::Pin::new_unchecked(self);
-                ::pin_project::__private::PinnedDrop::drop(__pinned_self);
+                let __pinned_self = _pin_project::__private::Pin::new_unchecked(self);
+                _pin_project::__private::PinnedDrop::drop(__pinned_self);
             }
         }
     }
diff --git a/tests/expand/pinned_drop/tuple_struct.expanded.rs b/tests/expand/pinned_drop/tuple_struct.expanded.rs
index f06f2ae..8c7433e 100644
--- a/tests/expand/pinned_drop/tuple_struct.expanded.rs
+++ b/tests/expand/pinned_drop/tuple_struct.expanded.rs
@@ -11,10 +11,13 @@
 #[allow(clippy::pattern_type_mismatch)]
 #[allow(clippy::redundant_pub_crate)]
 #[allow(clippy::type_repetition_in_bounds)]
+#[allow(unused_qualifications)]
 #[allow(clippy::semicolon_if_nothing_returned)]
 #[allow(clippy::use_self)]
 #[allow(clippy::used_underscore_binding)]
 const _: () = {
+    #[allow(unused_extern_crates)]
+    extern crate pin_project as _pin_project;
     #[allow(dead_code)]
     #[allow(clippy::mut_mut)]
     struct __TupleStructProjection<'pin, T, U>(
@@ -33,20 +36,20 @@
         TupleStruct<T, U>: 'pin;
     impl<T, U> TupleStruct<T, U> {
         fn project<'pin>(
-            self: ::pin_project::__private::Pin<&'pin mut Self>,
+            self: _pin_project::__private::Pin<&'pin mut Self>,
         ) -> __TupleStructProjection<'pin, T, U> {
             unsafe {
                 let Self(_0, _1) = self.get_unchecked_mut();
-                __TupleStructProjection(::pin_project::__private::Pin::new_unchecked(_0), _1)
+                __TupleStructProjection(_pin_project::__private::Pin::new_unchecked(_0), _1)
             }
         }
         #[allow(clippy::missing_const_for_fn)]
         fn project_ref<'pin>(
-            self: ::pin_project::__private::Pin<&'pin Self>,
+            self: _pin_project::__private::Pin<&'pin Self>,
         ) -> __TupleStructProjectionRef<'pin, T, U> {
             unsafe {
                 let Self(_0, _1) = self.get_ref();
-                __TupleStructProjectionRef(::pin_project::__private::Pin::new_unchecked(_0), _1)
+                __TupleStructProjectionRef(_pin_project::__private::Pin::new_unchecked(_0), _1)
             }
         }
     }
@@ -57,29 +60,29 @@
     }
     #[allow(missing_debug_implementations)]
     struct __TupleStruct<'pin, T, U> {
-        __pin_project_use_generics: ::pin_project::__private::AlwaysUnpin<
+        __pin_project_use_generics: _pin_project::__private::AlwaysUnpin<
             'pin,
             (
-                ::pin_project::__private::PhantomData<T>,
-                ::pin_project::__private::PhantomData<U>,
+                _pin_project::__private::PhantomData<T>,
+                _pin_project::__private::PhantomData<U>,
             ),
         >,
         __field0: T,
     }
-    impl<'pin, T, U> ::pin_project::__private::Unpin for TupleStruct<T, U> where
-        __TupleStruct<'pin, T, U>: ::pin_project::__private::Unpin
+    impl<'pin, T, U> _pin_project::__private::Unpin for TupleStruct<T, U> where
+        __TupleStruct<'pin, T, U>: _pin_project::__private::Unpin
     {
     }
     #[doc(hidden)]
-    unsafe impl<'pin, T, U> ::pin_project::UnsafeUnpin for TupleStruct<T, U> where
-        __TupleStruct<'pin, T, U>: ::pin_project::__private::Unpin
+    unsafe impl<'pin, T, U> _pin_project::UnsafeUnpin for TupleStruct<T, U> where
+        __TupleStruct<'pin, T, U>: _pin_project::__private::Unpin
     {
     }
-    impl<T, U> ::pin_project::__private::Drop for TupleStruct<T, U> {
+    impl<T, U> _pin_project::__private::Drop for TupleStruct<T, U> {
         fn drop(&mut self) {
             unsafe {
-                let __pinned_self = ::pin_project::__private::Pin::new_unchecked(self);
-                ::pin_project::__private::PinnedDrop::drop(__pinned_self);
+                let __pinned_self = _pin_project::__private::Pin::new_unchecked(self);
+                _pin_project::__private::PinnedDrop::drop(__pinned_self);
             }
         }
     }
diff --git a/tests/expand/project_replace/enum.expanded.rs b/tests/expand/project_replace/enum.expanded.rs
index 27ff08a..d2b2094 100644
--- a/tests/expand/project_replace/enum.expanded.rs
+++ b/tests/expand/project_replace/enum.expanded.rs
@@ -38,39 +38,41 @@
 #[allow(clippy::pattern_type_mismatch)]
 #[allow(clippy::redundant_pub_crate)]
 #[allow(clippy::type_repetition_in_bounds)]
+#[allow(unused_qualifications)]
 #[allow(clippy::semicolon_if_nothing_returned)]
 #[allow(clippy::use_self)]
 #[allow(clippy::used_underscore_binding)]
 const _: () = {
+    #[allow(unused_extern_crates)]
+    extern crate pin_project as _pin_project;
     impl<T, U> Enum<T, U> {
         fn project_replace(
-            self: ::pin_project::__private::Pin<&mut Self>,
+            self: _pin_project::__private::Pin<&mut Self>,
             __replacement: Self,
         ) -> EnumProjOwn<T, U> {
             unsafe {
                 let __self_ptr: *mut Self = self.get_unchecked_mut();
-                let __guard = ::pin_project::__private::UnsafeOverwriteGuard {
-                    target: __self_ptr,
-                    value: ::pin_project::__private::ManuallyDrop::new(__replacement),
-                };
+                let __guard =
+                    _pin_project::__private::UnsafeOverwriteGuard::new(__self_ptr, __replacement);
                 match &mut *__self_ptr {
                     Self::Struct { pinned, unpinned } => {
                         let __result = EnumProjOwn::Struct {
-                            pinned: ::pin_project::__private::PhantomData,
-                            unpinned: ::pin_project::__private::ptr::read(unpinned),
+                            pinned: _pin_project::__private::PhantomData,
+                            unpinned: _pin_project::__private::ptr::read(unpinned),
                         };
                         {
-                            let __guard = ::pin_project::__private::UnsafeDropInPlaceGuard(pinned);
+                            let __guard =
+                                _pin_project::__private::UnsafeDropInPlaceGuard::new(pinned);
                         }
                         __result
                     }
                     Self::Tuple(_0, _1) => {
                         let __result = EnumProjOwn::Tuple(
-                            ::pin_project::__private::PhantomData,
-                            ::pin_project::__private::ptr::read(_1),
+                            _pin_project::__private::PhantomData,
+                            _pin_project::__private::ptr::read(_1),
                         );
                         {
-                            let __guard = ::pin_project::__private::UnsafeDropInPlaceGuard(_0);
+                            let __guard = _pin_project::__private::UnsafeDropInPlaceGuard::new(_0);
                         }
                         __result
                     }
@@ -85,32 +87,32 @@
     }
     #[allow(missing_debug_implementations)]
     struct __Enum<'pin, T, U> {
-        __pin_project_use_generics: ::pin_project::__private::AlwaysUnpin<
+        __pin_project_use_generics: _pin_project::__private::AlwaysUnpin<
             'pin,
             (
-                ::pin_project::__private::PhantomData<T>,
-                ::pin_project::__private::PhantomData<U>,
+                _pin_project::__private::PhantomData<T>,
+                _pin_project::__private::PhantomData<U>,
             ),
         >,
         __field0: T,
         __field1: T,
     }
-    impl<'pin, T, U> ::pin_project::__private::Unpin for Enum<T, U> where
-        __Enum<'pin, T, U>: ::pin_project::__private::Unpin
+    impl<'pin, T, U> _pin_project::__private::Unpin for Enum<T, U> where
+        __Enum<'pin, T, U>: _pin_project::__private::Unpin
     {
     }
     #[doc(hidden)]
-    unsafe impl<'pin, T, U> ::pin_project::UnsafeUnpin for Enum<T, U> where
-        __Enum<'pin, T, U>: ::pin_project::__private::Unpin
+    unsafe impl<'pin, T, U> _pin_project::UnsafeUnpin for Enum<T, U> where
+        __Enum<'pin, T, U>: _pin_project::__private::Unpin
     {
     }
     trait EnumMustNotImplDrop {}
     #[allow(clippy::drop_bounds, drop_bounds)]
-    impl<T: ::pin_project::__private::Drop> EnumMustNotImplDrop for T {}
+    impl<T: _pin_project::__private::Drop> EnumMustNotImplDrop for T {}
     impl<T, U> EnumMustNotImplDrop for Enum<T, U> {}
     #[doc(hidden)]
-    impl<T, U> ::pin_project::__private::PinnedDrop for Enum<T, U> {
-        unsafe fn drop(self: ::pin_project::__private::Pin<&mut Self>) {}
+    impl<T, U> _pin_project::__private::PinnedDrop for Enum<T, U> {
+        unsafe fn drop(self: _pin_project::__private::Pin<&mut Self>) {}
     }
 };
 fn main() {}
diff --git a/tests/expand/project_replace/struct.expanded.rs b/tests/expand/project_replace/struct.expanded.rs
index bad4984..aa5fd54 100644
--- a/tests/expand/project_replace/struct.expanded.rs
+++ b/tests/expand/project_replace/struct.expanded.rs
@@ -14,10 +14,13 @@
 #[allow(clippy::pattern_type_mismatch)]
 #[allow(clippy::redundant_pub_crate)]
 #[allow(clippy::type_repetition_in_bounds)]
+#[allow(unused_qualifications)]
 #[allow(clippy::semicolon_if_nothing_returned)]
 #[allow(clippy::use_self)]
 #[allow(clippy::used_underscore_binding)]
 const _: () = {
+    #[allow(unused_extern_crates)]
+    extern crate pin_project as _pin_project;
     #[allow(dead_code)]
     #[allow(clippy::mut_mut)]
     struct __StructProjection<'pin, T, U>
@@ -43,45 +46,43 @@
     }
     impl<T, U> Struct<T, U> {
         fn project<'pin>(
-            self: ::pin_project::__private::Pin<&'pin mut Self>,
+            self: _pin_project::__private::Pin<&'pin mut Self>,
         ) -> __StructProjection<'pin, T, U> {
             unsafe {
                 let Self { pinned, unpinned } = self.get_unchecked_mut();
                 __StructProjection {
-                    pinned: ::pin_project::__private::Pin::new_unchecked(pinned),
+                    pinned: _pin_project::__private::Pin::new_unchecked(pinned),
                     unpinned,
                 }
             }
         }
         #[allow(clippy::missing_const_for_fn)]
         fn project_ref<'pin>(
-            self: ::pin_project::__private::Pin<&'pin Self>,
+            self: _pin_project::__private::Pin<&'pin Self>,
         ) -> __StructProjectionRef<'pin, T, U> {
             unsafe {
                 let Self { pinned, unpinned } = self.get_ref();
                 __StructProjectionRef {
-                    pinned: ::pin_project::__private::Pin::new_unchecked(pinned),
+                    pinned: _pin_project::__private::Pin::new_unchecked(pinned),
                     unpinned,
                 }
             }
         }
         fn project_replace(
-            self: ::pin_project::__private::Pin<&mut Self>,
+            self: _pin_project::__private::Pin<&mut Self>,
             __replacement: Self,
         ) -> __StructProjectionOwned<T, U> {
             unsafe {
                 let __self_ptr: *mut Self = self.get_unchecked_mut();
-                let __guard = ::pin_project::__private::UnsafeOverwriteGuard {
-                    target: __self_ptr,
-                    value: ::pin_project::__private::ManuallyDrop::new(__replacement),
-                };
+                let __guard =
+                    _pin_project::__private::UnsafeOverwriteGuard::new(__self_ptr, __replacement);
                 let Self { pinned, unpinned } = &mut *__self_ptr;
                 let __result = __StructProjectionOwned {
-                    pinned: ::pin_project::__private::PhantomData,
-                    unpinned: ::pin_project::__private::ptr::read(unpinned),
+                    pinned: _pin_project::__private::PhantomData,
+                    unpinned: _pin_project::__private::ptr::read(unpinned),
                 };
                 {
-                    let __guard = ::pin_project::__private::UnsafeDropInPlaceGuard(pinned);
+                    let __guard = _pin_project::__private::UnsafeDropInPlaceGuard::new(pinned);
                 }
                 __result
             }
@@ -94,31 +95,31 @@
     }
     #[allow(missing_debug_implementations)]
     struct __Struct<'pin, T, U> {
-        __pin_project_use_generics: ::pin_project::__private::AlwaysUnpin<
+        __pin_project_use_generics: _pin_project::__private::AlwaysUnpin<
             'pin,
             (
-                ::pin_project::__private::PhantomData<T>,
-                ::pin_project::__private::PhantomData<U>,
+                _pin_project::__private::PhantomData<T>,
+                _pin_project::__private::PhantomData<U>,
             ),
         >,
         __field0: T,
     }
-    impl<'pin, T, U> ::pin_project::__private::Unpin for Struct<T, U> where
-        __Struct<'pin, T, U>: ::pin_project::__private::Unpin
+    impl<'pin, T, U> _pin_project::__private::Unpin for Struct<T, U> where
+        __Struct<'pin, T, U>: _pin_project::__private::Unpin
     {
     }
     #[doc(hidden)]
-    unsafe impl<'pin, T, U> ::pin_project::UnsafeUnpin for Struct<T, U> where
-        __Struct<'pin, T, U>: ::pin_project::__private::Unpin
+    unsafe impl<'pin, T, U> _pin_project::UnsafeUnpin for Struct<T, U> where
+        __Struct<'pin, T, U>: _pin_project::__private::Unpin
     {
     }
     trait StructMustNotImplDrop {}
     #[allow(clippy::drop_bounds, drop_bounds)]
-    impl<T: ::pin_project::__private::Drop> StructMustNotImplDrop for T {}
+    impl<T: _pin_project::__private::Drop> StructMustNotImplDrop for T {}
     impl<T, U> StructMustNotImplDrop for Struct<T, U> {}
     #[doc(hidden)]
-    impl<T, U> ::pin_project::__private::PinnedDrop for Struct<T, U> {
-        unsafe fn drop(self: ::pin_project::__private::Pin<&mut Self>) {}
+    impl<T, U> _pin_project::__private::PinnedDrop for Struct<T, U> {
+        unsafe fn drop(self: _pin_project::__private::Pin<&mut Self>) {}
     }
 };
 fn main() {}
diff --git a/tests/expand/project_replace/tuple_struct.expanded.rs b/tests/expand/project_replace/tuple_struct.expanded.rs
index bc5a6e5..529f0b2 100644
--- a/tests/expand/project_replace/tuple_struct.expanded.rs
+++ b/tests/expand/project_replace/tuple_struct.expanded.rs
@@ -10,10 +10,13 @@
 #[allow(clippy::pattern_type_mismatch)]
 #[allow(clippy::redundant_pub_crate)]
 #[allow(clippy::type_repetition_in_bounds)]
+#[allow(unused_qualifications)]
 #[allow(clippy::semicolon_if_nothing_returned)]
 #[allow(clippy::use_self)]
 #[allow(clippy::used_underscore_binding)]
 const _: () = {
+    #[allow(unused_extern_crates)]
+    extern crate pin_project as _pin_project;
     #[allow(dead_code)]
     #[allow(clippy::mut_mut)]
     struct __TupleStructProjection<'pin, T, U>(
@@ -34,39 +37,37 @@
     struct __TupleStructProjectionOwned<T, U>(::pin_project::__private::PhantomData<T>, U);
     impl<T, U> TupleStruct<T, U> {
         fn project<'pin>(
-            self: ::pin_project::__private::Pin<&'pin mut Self>,
+            self: _pin_project::__private::Pin<&'pin mut Self>,
         ) -> __TupleStructProjection<'pin, T, U> {
             unsafe {
                 let Self(_0, _1) = self.get_unchecked_mut();
-                __TupleStructProjection(::pin_project::__private::Pin::new_unchecked(_0), _1)
+                __TupleStructProjection(_pin_project::__private::Pin::new_unchecked(_0), _1)
             }
         }
         #[allow(clippy::missing_const_for_fn)]
         fn project_ref<'pin>(
-            self: ::pin_project::__private::Pin<&'pin Self>,
+            self: _pin_project::__private::Pin<&'pin Self>,
         ) -> __TupleStructProjectionRef<'pin, T, U> {
             unsafe {
                 let Self(_0, _1) = self.get_ref();
-                __TupleStructProjectionRef(::pin_project::__private::Pin::new_unchecked(_0), _1)
+                __TupleStructProjectionRef(_pin_project::__private::Pin::new_unchecked(_0), _1)
             }
         }
         fn project_replace(
-            self: ::pin_project::__private::Pin<&mut Self>,
+            self: _pin_project::__private::Pin<&mut Self>,
             __replacement: Self,
         ) -> __TupleStructProjectionOwned<T, U> {
             unsafe {
                 let __self_ptr: *mut Self = self.get_unchecked_mut();
-                let __guard = ::pin_project::__private::UnsafeOverwriteGuard {
-                    target: __self_ptr,
-                    value: ::pin_project::__private::ManuallyDrop::new(__replacement),
-                };
+                let __guard =
+                    _pin_project::__private::UnsafeOverwriteGuard::new(__self_ptr, __replacement);
                 let Self(_0, _1) = &mut *__self_ptr;
                 let __result = __TupleStructProjectionOwned(
-                    ::pin_project::__private::PhantomData,
-                    ::pin_project::__private::ptr::read(_1),
+                    _pin_project::__private::PhantomData,
+                    _pin_project::__private::ptr::read(_1),
                 );
                 {
-                    let __guard = ::pin_project::__private::UnsafeDropInPlaceGuard(_0);
+                    let __guard = _pin_project::__private::UnsafeDropInPlaceGuard::new(_0);
                 }
                 __result
             }
@@ -79,31 +80,31 @@
     }
     #[allow(missing_debug_implementations)]
     struct __TupleStruct<'pin, T, U> {
-        __pin_project_use_generics: ::pin_project::__private::AlwaysUnpin<
+        __pin_project_use_generics: _pin_project::__private::AlwaysUnpin<
             'pin,
             (
-                ::pin_project::__private::PhantomData<T>,
-                ::pin_project::__private::PhantomData<U>,
+                _pin_project::__private::PhantomData<T>,
+                _pin_project::__private::PhantomData<U>,
             ),
         >,
         __field0: T,
     }
-    impl<'pin, T, U> ::pin_project::__private::Unpin for TupleStruct<T, U> where
-        __TupleStruct<'pin, T, U>: ::pin_project::__private::Unpin
+    impl<'pin, T, U> _pin_project::__private::Unpin for TupleStruct<T, U> where
+        __TupleStruct<'pin, T, U>: _pin_project::__private::Unpin
     {
     }
     #[doc(hidden)]
-    unsafe impl<'pin, T, U> ::pin_project::UnsafeUnpin for TupleStruct<T, U> where
-        __TupleStruct<'pin, T, U>: ::pin_project::__private::Unpin
+    unsafe impl<'pin, T, U> _pin_project::UnsafeUnpin for TupleStruct<T, U> where
+        __TupleStruct<'pin, T, U>: _pin_project::__private::Unpin
     {
     }
     trait TupleStructMustNotImplDrop {}
     #[allow(clippy::drop_bounds, drop_bounds)]
-    impl<T: ::pin_project::__private::Drop> TupleStructMustNotImplDrop for T {}
+    impl<T: _pin_project::__private::Drop> TupleStructMustNotImplDrop for T {}
     impl<T, U> TupleStructMustNotImplDrop for TupleStruct<T, U> {}
     #[doc(hidden)]
-    impl<T, U> ::pin_project::__private::PinnedDrop for TupleStruct<T, U> {
-        unsafe fn drop(self: ::pin_project::__private::Pin<&mut Self>) {}
+    impl<T, U> _pin_project::__private::PinnedDrop for TupleStruct<T, U> {
+        unsafe fn drop(self: _pin_project::__private::Pin<&mut Self>) {}
     }
 };
 fn main() {}
diff --git a/tests/expand/pub/enum.expanded.rs b/tests/expand/pub/enum.expanded.rs
index f9bd9fe..530eca9 100644
--- a/tests/expand/pub/enum.expanded.rs
+++ b/tests/expand/pub/enum.expanded.rs
@@ -62,22 +62,25 @@
 #[allow(clippy::pattern_type_mismatch)]
 #[allow(clippy::redundant_pub_crate)]
 #[allow(clippy::type_repetition_in_bounds)]
+#[allow(unused_qualifications)]
 #[allow(clippy::semicolon_if_nothing_returned)]
 #[allow(clippy::use_self)]
 #[allow(clippy::used_underscore_binding)]
 const _: () = {
+    #[allow(unused_extern_crates)]
+    extern crate pin_project as _pin_project;
     impl<T, U> Enum<T, U> {
         pub(crate) fn project<'pin>(
-            self: ::pin_project::__private::Pin<&'pin mut Self>,
+            self: _pin_project::__private::Pin<&'pin mut Self>,
         ) -> EnumProj<'pin, T, U> {
             unsafe {
                 match self.get_unchecked_mut() {
                     Self::Struct { pinned, unpinned } => EnumProj::Struct {
-                        pinned: ::pin_project::__private::Pin::new_unchecked(pinned),
+                        pinned: _pin_project::__private::Pin::new_unchecked(pinned),
                         unpinned,
                     },
                     Self::Tuple(_0, _1) => {
-                        EnumProj::Tuple(::pin_project::__private::Pin::new_unchecked(_0), _1)
+                        EnumProj::Tuple(_pin_project::__private::Pin::new_unchecked(_0), _1)
                     }
                     Self::Unit => EnumProj::Unit,
                 }
@@ -85,16 +88,16 @@
         }
         #[allow(clippy::missing_const_for_fn)]
         pub(crate) fn project_ref<'pin>(
-            self: ::pin_project::__private::Pin<&'pin Self>,
+            self: _pin_project::__private::Pin<&'pin Self>,
         ) -> EnumProjRef<'pin, T, U> {
             unsafe {
                 match self.get_ref() {
                     Self::Struct { pinned, unpinned } => EnumProjRef::Struct {
-                        pinned: ::pin_project::__private::Pin::new_unchecked(pinned),
+                        pinned: _pin_project::__private::Pin::new_unchecked(pinned),
                         unpinned,
                     },
                     Self::Tuple(_0, _1) => {
-                        EnumProjRef::Tuple(::pin_project::__private::Pin::new_unchecked(_0), _1)
+                        EnumProjRef::Tuple(_pin_project::__private::Pin::new_unchecked(_0), _1)
                     }
                     Self::Unit => EnumProjRef::Unit,
                 }
@@ -103,32 +106,32 @@
     }
     #[allow(missing_debug_implementations)]
     pub struct __Enum<'pin, T, U> {
-        __pin_project_use_generics: ::pin_project::__private::AlwaysUnpin<
+        __pin_project_use_generics: _pin_project::__private::AlwaysUnpin<
             'pin,
             (
-                ::pin_project::__private::PhantomData<T>,
-                ::pin_project::__private::PhantomData<U>,
+                _pin_project::__private::PhantomData<T>,
+                _pin_project::__private::PhantomData<U>,
             ),
         >,
         __field0: T,
         __field1: T,
     }
-    impl<'pin, T, U> ::pin_project::__private::Unpin for Enum<T, U> where
-        __Enum<'pin, T, U>: ::pin_project::__private::Unpin
+    impl<'pin, T, U> _pin_project::__private::Unpin for Enum<T, U> where
+        __Enum<'pin, T, U>: _pin_project::__private::Unpin
     {
     }
     #[doc(hidden)]
-    unsafe impl<'pin, T, U> ::pin_project::UnsafeUnpin for Enum<T, U> where
-        __Enum<'pin, T, U>: ::pin_project::__private::Unpin
+    unsafe impl<'pin, T, U> _pin_project::UnsafeUnpin for Enum<T, U> where
+        __Enum<'pin, T, U>: _pin_project::__private::Unpin
     {
     }
     trait EnumMustNotImplDrop {}
     #[allow(clippy::drop_bounds, drop_bounds)]
-    impl<T: ::pin_project::__private::Drop> EnumMustNotImplDrop for T {}
+    impl<T: _pin_project::__private::Drop> EnumMustNotImplDrop for T {}
     impl<T, U> EnumMustNotImplDrop for Enum<T, U> {}
     #[doc(hidden)]
-    impl<T, U> ::pin_project::__private::PinnedDrop for Enum<T, U> {
-        unsafe fn drop(self: ::pin_project::__private::Pin<&mut Self>) {}
+    impl<T, U> _pin_project::__private::PinnedDrop for Enum<T, U> {
+        unsafe fn drop(self: _pin_project::__private::Pin<&mut Self>) {}
     }
 };
 fn main() {}
diff --git a/tests/expand/pub/struct.expanded.rs b/tests/expand/pub/struct.expanded.rs
index 8abd9a1..71ae3a3 100644
--- a/tests/expand/pub/struct.expanded.rs
+++ b/tests/expand/pub/struct.expanded.rs
@@ -14,10 +14,13 @@
 #[allow(clippy::pattern_type_mismatch)]
 #[allow(clippy::redundant_pub_crate)]
 #[allow(clippy::type_repetition_in_bounds)]
+#[allow(unused_qualifications)]
 #[allow(clippy::semicolon_if_nothing_returned)]
 #[allow(clippy::use_self)]
 #[allow(clippy::used_underscore_binding)]
 const _: () = {
+    #[allow(unused_extern_crates)]
+    extern crate pin_project as _pin_project;
     #[allow(dead_code)]
     #[allow(clippy::mut_mut)]
     pub(crate) struct __StructProjection<'pin, T, U>
@@ -38,24 +41,24 @@
     }
     impl<T, U> Struct<T, U> {
         pub(crate) fn project<'pin>(
-            self: ::pin_project::__private::Pin<&'pin mut Self>,
+            self: _pin_project::__private::Pin<&'pin mut Self>,
         ) -> __StructProjection<'pin, T, U> {
             unsafe {
                 let Self { pinned, unpinned } = self.get_unchecked_mut();
                 __StructProjection {
-                    pinned: ::pin_project::__private::Pin::new_unchecked(pinned),
+                    pinned: _pin_project::__private::Pin::new_unchecked(pinned),
                     unpinned,
                 }
             }
         }
         #[allow(clippy::missing_const_for_fn)]
         pub(crate) fn project_ref<'pin>(
-            self: ::pin_project::__private::Pin<&'pin Self>,
+            self: _pin_project::__private::Pin<&'pin Self>,
         ) -> __StructProjectionRef<'pin, T, U> {
             unsafe {
                 let Self { pinned, unpinned } = self.get_ref();
                 __StructProjectionRef {
-                    pinned: ::pin_project::__private::Pin::new_unchecked(pinned),
+                    pinned: _pin_project::__private::Pin::new_unchecked(pinned),
                     unpinned,
                 }
             }
@@ -68,31 +71,31 @@
     }
     #[allow(missing_debug_implementations)]
     pub struct __Struct<'pin, T, U> {
-        __pin_project_use_generics: ::pin_project::__private::AlwaysUnpin<
+        __pin_project_use_generics: _pin_project::__private::AlwaysUnpin<
             'pin,
             (
-                ::pin_project::__private::PhantomData<T>,
-                ::pin_project::__private::PhantomData<U>,
+                _pin_project::__private::PhantomData<T>,
+                _pin_project::__private::PhantomData<U>,
             ),
         >,
         __field0: T,
     }
-    impl<'pin, T, U> ::pin_project::__private::Unpin for Struct<T, U> where
-        __Struct<'pin, T, U>: ::pin_project::__private::Unpin
+    impl<'pin, T, U> _pin_project::__private::Unpin for Struct<T, U> where
+        __Struct<'pin, T, U>: _pin_project::__private::Unpin
     {
     }
     #[doc(hidden)]
-    unsafe impl<'pin, T, U> ::pin_project::UnsafeUnpin for Struct<T, U> where
-        __Struct<'pin, T, U>: ::pin_project::__private::Unpin
+    unsafe impl<'pin, T, U> _pin_project::UnsafeUnpin for Struct<T, U> where
+        __Struct<'pin, T, U>: _pin_project::__private::Unpin
     {
     }
     trait StructMustNotImplDrop {}
     #[allow(clippy::drop_bounds, drop_bounds)]
-    impl<T: ::pin_project::__private::Drop> StructMustNotImplDrop for T {}
+    impl<T: _pin_project::__private::Drop> StructMustNotImplDrop for T {}
     impl<T, U> StructMustNotImplDrop for Struct<T, U> {}
     #[doc(hidden)]
-    impl<T, U> ::pin_project::__private::PinnedDrop for Struct<T, U> {
-        unsafe fn drop(self: ::pin_project::__private::Pin<&mut Self>) {}
+    impl<T, U> _pin_project::__private::PinnedDrop for Struct<T, U> {
+        unsafe fn drop(self: _pin_project::__private::Pin<&mut Self>) {}
     }
 };
 fn main() {}
diff --git a/tests/expand/pub/tuple_struct.expanded.rs b/tests/expand/pub/tuple_struct.expanded.rs
index 2641d16..02c3f24 100644
--- a/tests/expand/pub/tuple_struct.expanded.rs
+++ b/tests/expand/pub/tuple_struct.expanded.rs
@@ -10,10 +10,13 @@
 #[allow(clippy::pattern_type_mismatch)]
 #[allow(clippy::redundant_pub_crate)]
 #[allow(clippy::type_repetition_in_bounds)]
+#[allow(unused_qualifications)]
 #[allow(clippy::semicolon_if_nothing_returned)]
 #[allow(clippy::use_self)]
 #[allow(clippy::used_underscore_binding)]
 const _: () = {
+    #[allow(unused_extern_crates)]
+    extern crate pin_project as _pin_project;
     #[allow(dead_code)]
     #[allow(clippy::mut_mut)]
     pub(crate) struct __TupleStructProjection<'pin, T, U>(
@@ -32,20 +35,20 @@
         TupleStruct<T, U>: 'pin;
     impl<T, U> TupleStruct<T, U> {
         pub(crate) fn project<'pin>(
-            self: ::pin_project::__private::Pin<&'pin mut Self>,
+            self: _pin_project::__private::Pin<&'pin mut Self>,
         ) -> __TupleStructProjection<'pin, T, U> {
             unsafe {
                 let Self(_0, _1) = self.get_unchecked_mut();
-                __TupleStructProjection(::pin_project::__private::Pin::new_unchecked(_0), _1)
+                __TupleStructProjection(_pin_project::__private::Pin::new_unchecked(_0), _1)
             }
         }
         #[allow(clippy::missing_const_for_fn)]
         pub(crate) fn project_ref<'pin>(
-            self: ::pin_project::__private::Pin<&'pin Self>,
+            self: _pin_project::__private::Pin<&'pin Self>,
         ) -> __TupleStructProjectionRef<'pin, T, U> {
             unsafe {
                 let Self(_0, _1) = self.get_ref();
-                __TupleStructProjectionRef(::pin_project::__private::Pin::new_unchecked(_0), _1)
+                __TupleStructProjectionRef(_pin_project::__private::Pin::new_unchecked(_0), _1)
             }
         }
     }
@@ -56,31 +59,31 @@
     }
     #[allow(missing_debug_implementations)]
     pub struct __TupleStruct<'pin, T, U> {
-        __pin_project_use_generics: ::pin_project::__private::AlwaysUnpin<
+        __pin_project_use_generics: _pin_project::__private::AlwaysUnpin<
             'pin,
             (
-                ::pin_project::__private::PhantomData<T>,
-                ::pin_project::__private::PhantomData<U>,
+                _pin_project::__private::PhantomData<T>,
+                _pin_project::__private::PhantomData<U>,
             ),
         >,
         __field0: T,
     }
-    impl<'pin, T, U> ::pin_project::__private::Unpin for TupleStruct<T, U> where
-        __TupleStruct<'pin, T, U>: ::pin_project::__private::Unpin
+    impl<'pin, T, U> _pin_project::__private::Unpin for TupleStruct<T, U> where
+        __TupleStruct<'pin, T, U>: _pin_project::__private::Unpin
     {
     }
     #[doc(hidden)]
-    unsafe impl<'pin, T, U> ::pin_project::UnsafeUnpin for TupleStruct<T, U> where
-        __TupleStruct<'pin, T, U>: ::pin_project::__private::Unpin
+    unsafe impl<'pin, T, U> _pin_project::UnsafeUnpin for TupleStruct<T, U> where
+        __TupleStruct<'pin, T, U>: _pin_project::__private::Unpin
     {
     }
     trait TupleStructMustNotImplDrop {}
     #[allow(clippy::drop_bounds, drop_bounds)]
-    impl<T: ::pin_project::__private::Drop> TupleStructMustNotImplDrop for T {}
+    impl<T: _pin_project::__private::Drop> TupleStructMustNotImplDrop for T {}
     impl<T, U> TupleStructMustNotImplDrop for TupleStruct<T, U> {}
     #[doc(hidden)]
-    impl<T, U> ::pin_project::__private::PinnedDrop for TupleStruct<T, U> {
-        unsafe fn drop(self: ::pin_project::__private::Pin<&mut Self>) {}
+    impl<T, U> _pin_project::__private::PinnedDrop for TupleStruct<T, U> {
+        unsafe fn drop(self: _pin_project::__private::Pin<&mut Self>) {}
     }
 };
 fn main() {}
diff --git a/tests/expand/unsafe_unpin/enum.expanded.rs b/tests/expand/unsafe_unpin/enum.expanded.rs
index 1c51df0..3d53a1e 100644
--- a/tests/expand/unsafe_unpin/enum.expanded.rs
+++ b/tests/expand/unsafe_unpin/enum.expanded.rs
@@ -62,22 +62,25 @@
 #[allow(clippy::pattern_type_mismatch)]
 #[allow(clippy::redundant_pub_crate)]
 #[allow(clippy::type_repetition_in_bounds)]
+#[allow(unused_qualifications)]
 #[allow(clippy::semicolon_if_nothing_returned)]
 #[allow(clippy::use_self)]
 #[allow(clippy::used_underscore_binding)]
 const _: () = {
+    #[allow(unused_extern_crates)]
+    extern crate pin_project as _pin_project;
     impl<T, U> Enum<T, U> {
         fn project<'pin>(
-            self: ::pin_project::__private::Pin<&'pin mut Self>,
+            self: _pin_project::__private::Pin<&'pin mut Self>,
         ) -> EnumProj<'pin, T, U> {
             unsafe {
                 match self.get_unchecked_mut() {
                     Self::Struct { pinned, unpinned } => EnumProj::Struct {
-                        pinned: ::pin_project::__private::Pin::new_unchecked(pinned),
+                        pinned: _pin_project::__private::Pin::new_unchecked(pinned),
                         unpinned,
                     },
                     Self::Tuple(_0, _1) => {
-                        EnumProj::Tuple(::pin_project::__private::Pin::new_unchecked(_0), _1)
+                        EnumProj::Tuple(_pin_project::__private::Pin::new_unchecked(_0), _1)
                     }
                     Self::Unit => EnumProj::Unit,
                 }
@@ -85,33 +88,33 @@
         }
         #[allow(clippy::missing_const_for_fn)]
         fn project_ref<'pin>(
-            self: ::pin_project::__private::Pin<&'pin Self>,
+            self: _pin_project::__private::Pin<&'pin Self>,
         ) -> EnumProjRef<'pin, T, U> {
             unsafe {
                 match self.get_ref() {
                     Self::Struct { pinned, unpinned } => EnumProjRef::Struct {
-                        pinned: ::pin_project::__private::Pin::new_unchecked(pinned),
+                        pinned: _pin_project::__private::Pin::new_unchecked(pinned),
                         unpinned,
                     },
                     Self::Tuple(_0, _1) => {
-                        EnumProjRef::Tuple(::pin_project::__private::Pin::new_unchecked(_0), _1)
+                        EnumProjRef::Tuple(_pin_project::__private::Pin::new_unchecked(_0), _1)
                     }
                     Self::Unit => EnumProjRef::Unit,
                 }
             }
         }
     }
-    impl<'pin, T, U> ::pin_project::__private::Unpin for Enum<T, U> where
-        ::pin_project::__private::Wrapper<'pin, Self>: ::pin_project::UnsafeUnpin
+    impl<'pin, T, U> _pin_project::__private::Unpin for Enum<T, U> where
+        _pin_project::__private::Wrapper<'pin, Self>: _pin_project::UnsafeUnpin
     {
     }
     trait EnumMustNotImplDrop {}
     #[allow(clippy::drop_bounds, drop_bounds)]
-    impl<T: ::pin_project::__private::Drop> EnumMustNotImplDrop for T {}
+    impl<T: _pin_project::__private::Drop> EnumMustNotImplDrop for T {}
     impl<T, U> EnumMustNotImplDrop for Enum<T, U> {}
     #[doc(hidden)]
-    impl<T, U> ::pin_project::__private::PinnedDrop for Enum<T, U> {
-        unsafe fn drop(self: ::pin_project::__private::Pin<&mut Self>) {}
+    impl<T, U> _pin_project::__private::PinnedDrop for Enum<T, U> {
+        unsafe fn drop(self: _pin_project::__private::Pin<&mut Self>) {}
     }
 };
 unsafe impl<T: Unpin, U> UnsafeUnpin for Enum<T, U> {}
diff --git a/tests/expand/unsafe_unpin/struct.expanded.rs b/tests/expand/unsafe_unpin/struct.expanded.rs
index 67ede39..a866ab3 100644
--- a/tests/expand/unsafe_unpin/struct.expanded.rs
+++ b/tests/expand/unsafe_unpin/struct.expanded.rs
@@ -14,10 +14,13 @@
 #[allow(clippy::pattern_type_mismatch)]
 #[allow(clippy::redundant_pub_crate)]
 #[allow(clippy::type_repetition_in_bounds)]
+#[allow(unused_qualifications)]
 #[allow(clippy::semicolon_if_nothing_returned)]
 #[allow(clippy::use_self)]
 #[allow(clippy::used_underscore_binding)]
 const _: () = {
+    #[allow(unused_extern_crates)]
+    extern crate pin_project as _pin_project;
     #[allow(dead_code)]
     #[allow(clippy::mut_mut)]
     struct __StructProjection<'pin, T, U>
@@ -38,24 +41,24 @@
     }
     impl<T, U> Struct<T, U> {
         fn project<'pin>(
-            self: ::pin_project::__private::Pin<&'pin mut Self>,
+            self: _pin_project::__private::Pin<&'pin mut Self>,
         ) -> __StructProjection<'pin, T, U> {
             unsafe {
                 let Self { pinned, unpinned } = self.get_unchecked_mut();
                 __StructProjection {
-                    pinned: ::pin_project::__private::Pin::new_unchecked(pinned),
+                    pinned: _pin_project::__private::Pin::new_unchecked(pinned),
                     unpinned,
                 }
             }
         }
         #[allow(clippy::missing_const_for_fn)]
         fn project_ref<'pin>(
-            self: ::pin_project::__private::Pin<&'pin Self>,
+            self: _pin_project::__private::Pin<&'pin Self>,
         ) -> __StructProjectionRef<'pin, T, U> {
             unsafe {
                 let Self { pinned, unpinned } = self.get_ref();
                 __StructProjectionRef {
-                    pinned: ::pin_project::__private::Pin::new_unchecked(pinned),
+                    pinned: _pin_project::__private::Pin::new_unchecked(pinned),
                     unpinned,
                 }
             }
@@ -66,17 +69,17 @@
         let _ = &this.pinned;
         let _ = &this.unpinned;
     }
-    impl<'pin, T, U> ::pin_project::__private::Unpin for Struct<T, U> where
-        ::pin_project::__private::Wrapper<'pin, Self>: ::pin_project::UnsafeUnpin
+    impl<'pin, T, U> _pin_project::__private::Unpin for Struct<T, U> where
+        _pin_project::__private::Wrapper<'pin, Self>: _pin_project::UnsafeUnpin
     {
     }
     trait StructMustNotImplDrop {}
     #[allow(clippy::drop_bounds, drop_bounds)]
-    impl<T: ::pin_project::__private::Drop> StructMustNotImplDrop for T {}
+    impl<T: _pin_project::__private::Drop> StructMustNotImplDrop for T {}
     impl<T, U> StructMustNotImplDrop for Struct<T, U> {}
     #[doc(hidden)]
-    impl<T, U> ::pin_project::__private::PinnedDrop for Struct<T, U> {
-        unsafe fn drop(self: ::pin_project::__private::Pin<&mut Self>) {}
+    impl<T, U> _pin_project::__private::PinnedDrop for Struct<T, U> {
+        unsafe fn drop(self: _pin_project::__private::Pin<&mut Self>) {}
     }
 };
 unsafe impl<T: Unpin, U> UnsafeUnpin for Struct<T, U> {}
diff --git a/tests/expand/unsafe_unpin/tuple_struct.expanded.rs b/tests/expand/unsafe_unpin/tuple_struct.expanded.rs
index 512f139..1a41976 100644
--- a/tests/expand/unsafe_unpin/tuple_struct.expanded.rs
+++ b/tests/expand/unsafe_unpin/tuple_struct.expanded.rs
@@ -10,10 +10,13 @@
 #[allow(clippy::pattern_type_mismatch)]
 #[allow(clippy::redundant_pub_crate)]
 #[allow(clippy::type_repetition_in_bounds)]
+#[allow(unused_qualifications)]
 #[allow(clippy::semicolon_if_nothing_returned)]
 #[allow(clippy::use_self)]
 #[allow(clippy::used_underscore_binding)]
 const _: () = {
+    #[allow(unused_extern_crates)]
+    extern crate pin_project as _pin_project;
     #[allow(dead_code)]
     #[allow(clippy::mut_mut)]
     struct __TupleStructProjection<'pin, T, U>(
@@ -32,20 +35,20 @@
         TupleStruct<T, U>: 'pin;
     impl<T, U> TupleStruct<T, U> {
         fn project<'pin>(
-            self: ::pin_project::__private::Pin<&'pin mut Self>,
+            self: _pin_project::__private::Pin<&'pin mut Self>,
         ) -> __TupleStructProjection<'pin, T, U> {
             unsafe {
                 let Self(_0, _1) = self.get_unchecked_mut();
-                __TupleStructProjection(::pin_project::__private::Pin::new_unchecked(_0), _1)
+                __TupleStructProjection(_pin_project::__private::Pin::new_unchecked(_0), _1)
             }
         }
         #[allow(clippy::missing_const_for_fn)]
         fn project_ref<'pin>(
-            self: ::pin_project::__private::Pin<&'pin Self>,
+            self: _pin_project::__private::Pin<&'pin Self>,
         ) -> __TupleStructProjectionRef<'pin, T, U> {
             unsafe {
                 let Self(_0, _1) = self.get_ref();
-                __TupleStructProjectionRef(::pin_project::__private::Pin::new_unchecked(_0), _1)
+                __TupleStructProjectionRef(_pin_project::__private::Pin::new_unchecked(_0), _1)
             }
         }
     }
@@ -54,17 +57,17 @@
         let _ = &this.0;
         let _ = &this.1;
     }
-    impl<'pin, T, U> ::pin_project::__private::Unpin for TupleStruct<T, U> where
-        ::pin_project::__private::Wrapper<'pin, Self>: ::pin_project::UnsafeUnpin
+    impl<'pin, T, U> _pin_project::__private::Unpin for TupleStruct<T, U> where
+        _pin_project::__private::Wrapper<'pin, Self>: _pin_project::UnsafeUnpin
     {
     }
     trait TupleStructMustNotImplDrop {}
     #[allow(clippy::drop_bounds, drop_bounds)]
-    impl<T: ::pin_project::__private::Drop> TupleStructMustNotImplDrop for T {}
+    impl<T: _pin_project::__private::Drop> TupleStructMustNotImplDrop for T {}
     impl<T, U> TupleStructMustNotImplDrop for TupleStruct<T, U> {}
     #[doc(hidden)]
-    impl<T, U> ::pin_project::__private::PinnedDrop for TupleStruct<T, U> {
-        unsafe fn drop(self: ::pin_project::__private::Pin<&mut Self>) {}
+    impl<T, U> _pin_project::__private::PinnedDrop for TupleStruct<T, U> {
+        unsafe fn drop(self: _pin_project::__private::Pin<&mut Self>) {}
     }
 };
 unsafe impl<T: Unpin, U> UnsafeUnpin for Struct<T, U> {}
diff --git a/tests/lint.rs b/tests/lint.rs
index 5cdd2c6..6a75461 100644
--- a/tests/lint.rs
+++ b/tests/lint.rs
@@ -8,7 +8,8 @@
 #![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.
+// unsafe_block_in_unsafe_fn: requires Rust 1.52. and, we don't generate unsafe fn.
+// non_exhaustive_omitted_patterns: unstable
 // 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
@@ -772,7 +773,7 @@
         for<'pin, 'pin_, 'pin__> &'pin &'pin_ &'pin__ T: Unpin,
     {
         #[pin]
-        f: &'pin___ mut T,
+        _f: &'pin___ mut T,
     }
 
     pub mod inside_macro {
@@ -795,7 +796,7 @@
                     for<'pin, 'pin_, 'pin__> &'pin &'pin_ &'pin__ T: Unpin,
                 {
                     #[pin]
-                    f: &'pin___ mut T,
+                    _f: &'pin___ mut T,
                 }
             };
         }
diff --git a/tests/ui/cfg/cfg_attr-resolve.stderr b/tests/ui/cfg/cfg_attr-resolve.stderr
index 12bcc67..0393c14 100644
--- a/tests/ui/cfg/cfg_attr-resolve.stderr
+++ b/tests/ui/cfg/cfg_attr-resolve.stderr
@@ -1,5 +1,5 @@
 error[E0599]: no method named `project` found for struct `Pin<&mut Foo<u8>>` in the current scope
-  --> $DIR/cfg_attr-resolve.rs:10:30
+  --> tests/ui/cfg/cfg_attr-resolve.rs:10:30
    |
 10 |     let _ = Pin::new(&mut x).project(); //~ ERROR E0599
    |                              ^^^^^^^ method not found in `Pin<&mut Foo<u8>>`
diff --git a/tests/ui/cfg/cfg_attr-type-mismatch.stderr b/tests/ui/cfg/cfg_attr-type-mismatch.stderr
index 576a08c..366d9c7 100644
--- a/tests/ui/cfg/cfg_attr-type-mismatch.stderr
+++ b/tests/ui/cfg/cfg_attr-type-mismatch.stderr
@@ -1,5 +1,5 @@
 error[E0308]: mismatched types
-  --> $DIR/cfg_attr-type-mismatch.rs:20:27
+  --> tests/ui/cfg/cfg_attr-type-mismatch.rs:20:27
    |
 20 |     let _: Pin<&mut u8> = x.f; //~ ERROR E0308
    |            ------------   ^^^ expected struct `Pin`, found `&mut u8`
@@ -10,7 +10,7 @@
            found mutable reference `&mut u8`
 
 error[E0308]: mismatched types
-  --> $DIR/cfg_attr-type-mismatch.rs:24:22
+  --> tests/ui/cfg/cfg_attr-type-mismatch.rs:24:22
    |
 24 |     let _: &mut u8 = x.f; //~ ERROR E0308
    |            -------   ^^^
diff --git a/tests/ui/cfg/packed_sneaky-span-issue-1.stderr b/tests/ui/cfg/packed_sneaky-span-issue-1.stderr
index c98d3ee..4f3acc3 100644
--- a/tests/ui/cfg/packed_sneaky-span-issue-1.stderr
+++ b/tests/ui/cfg/packed_sneaky-span-issue-1.stderr
@@ -1,5 +1,5 @@
 error: #[pin_project] attribute may not be used on #[repr(packed)] types
- --> $DIR/packed_sneaky-span-issue-1.rs:5:15
+ --> tests/ui/cfg/packed_sneaky-span-issue-1.rs:5:15
   |
 5 | #[hidden_repr(packed)] //~ ERROR may not be used on #[repr(packed)] types
   |               ^^^^^^
diff --git a/tests/ui/cfg/packed_sneaky-span-issue-2.stderr b/tests/ui/cfg/packed_sneaky-span-issue-2.stderr
index 25b9cdc..cc2795a 100644
--- a/tests/ui/cfg/packed_sneaky-span-issue-2.stderr
+++ b/tests/ui/cfg/packed_sneaky-span-issue-2.stderr
@@ -1,5 +1,5 @@
 error: #[pin_project] attribute may not be used on #[repr(packed)] types
- --> $DIR/packed_sneaky-span-issue-2.rs:5:15
+ --> tests/ui/cfg/packed_sneaky-span-issue-2.rs:5:15
   |
 5 | #[hidden_repr(packed)] //~ ERROR may not be used on #[repr(packed)] types
   |               ^^^^^^
diff --git a/tests/ui/cfg/packed_sneaky.stderr b/tests/ui/cfg/packed_sneaky.stderr
index b0d4d93..a54c2ec 100644
--- a/tests/ui/cfg/packed_sneaky.stderr
+++ b/tests/ui/cfg/packed_sneaky.stderr
@@ -1,5 +1,5 @@
 error: #[pin_project] attribute may not be used on #[repr(packed)] types
- --> $DIR/packed_sneaky.rs:6:27
+ --> tests/ui/cfg/packed_sneaky.rs:6:27
   |
 6 | #[hidden_repr_cfg_not_any(packed)] //~ ERROR may not be used on #[repr(packed)] types
   |                           ^^^^^^
diff --git a/tests/ui/cfg/unsupported.stderr b/tests/ui/cfg/unsupported.stderr
index 7ad20d1..e1c871c 100644
--- a/tests/ui/cfg/unsupported.stderr
+++ b/tests/ui/cfg/unsupported.stderr
@@ -1,5 +1,5 @@
 error: #[pin_project] attribute may not be used on structs with zero fields
- --> $DIR/unsupported.rs:4:10
+ --> tests/ui/cfg/unsupported.rs:4:10
   |
 4 |   struct S {
   |  __________^
diff --git a/tests/ui/not_unpin/conflict-unpin.stderr b/tests/ui/not_unpin/conflict-unpin.stderr
index 7b43b0f..d644bf7 100644
--- a/tests/ui/not_unpin/conflict-unpin.stderr
+++ b/tests/ui/not_unpin/conflict-unpin.stderr
@@ -1,5 +1,5 @@
 error[E0119]: conflicting implementations of trait `std::marker::Unpin` for type `Foo<_, _>`
-  --> $DIR/conflict-unpin.rs:3:15
+  --> tests/ui/not_unpin/conflict-unpin.rs:3:15
    |
 3  | #[pin_project(!Unpin)] //~ ERROR E0119
    |               ^^^^^^ conflicting implementation for `Foo<_, _>`
@@ -8,7 +8,7 @@
    | --------------------------------------------- first implementation here
 
 error[E0119]: conflicting implementations of trait `std::marker::Unpin` for type `Bar<_, _>`
-  --> $DIR/conflict-unpin.rs:12:15
+  --> tests/ui/not_unpin/conflict-unpin.rs:12:15
    |
 12 | #[pin_project(!Unpin)] //~ ERROR E0119
    |               ^^^^^^ conflicting implementation for `Bar<_, _>`
@@ -17,7 +17,7 @@
    | ------------------------------ first implementation here
 
 error[E0119]: conflicting implementations of trait `std::marker::Unpin` for type `Baz<_, _>`
-  --> $DIR/conflict-unpin.rs:21:15
+  --> tests/ui/not_unpin/conflict-unpin.rs:21:15
    |
 21 | #[pin_project(!Unpin)] //~ ERROR E0119
    |               ^^^^^^ conflicting implementation for `Baz<_, _>`
diff --git a/tests/ui/not_unpin/impl-unsafe-unpin.stderr b/tests/ui/not_unpin/impl-unsafe-unpin.stderr
index 7051bd8..a944e95 100644
--- a/tests/ui/not_unpin/impl-unsafe-unpin.stderr
+++ b/tests/ui/not_unpin/impl-unsafe-unpin.stderr
@@ -1,5 +1,5 @@
-error[E0119]: conflicting implementations of trait `pin_project::UnsafeUnpin` for type `Foo<_, _>`
-  --> $DIR/impl-unsafe-unpin.rs:3:1
+error[E0119]: conflicting implementations of trait `_::_pin_project::UnsafeUnpin` for type `Foo<_, _>`
+  --> tests/ui/not_unpin/impl-unsafe-unpin.rs:3:1
    |
 3  | #[pin_project(!Unpin)] //~ ERROR E0119
    | ^^^^^^^^^^^^^^^^^^^^^^ conflicting implementation for `Foo<_, _>`
@@ -9,8 +9,8 @@
    |
    = note: this error originates in the derive macro `::pin_project::__private::__PinProjectInternalDerive` (in Nightly builds, run with -Z macro-backtrace for more info)
 
-error[E0119]: conflicting implementations of trait `pin_project::UnsafeUnpin` for type `Bar<_, _>`
-  --> $DIR/impl-unsafe-unpin.rs:12:1
+error[E0119]: conflicting implementations of trait `_::_pin_project::UnsafeUnpin` for type `Bar<_, _>`
+  --> tests/ui/not_unpin/impl-unsafe-unpin.rs:12:1
    |
 12 | #[pin_project(!Unpin)] //~ ERROR E0119
    | ^^^^^^^^^^^^^^^^^^^^^^ conflicting implementation for `Bar<_, _>`
@@ -20,8 +20,8 @@
    |
    = note: this error originates in the derive macro `::pin_project::__private::__PinProjectInternalDerive` (in Nightly builds, run with -Z macro-backtrace for more info)
 
-error[E0119]: conflicting implementations of trait `pin_project::UnsafeUnpin` for type `Baz<_, _>`
-  --> $DIR/impl-unsafe-unpin.rs:21:1
+error[E0119]: conflicting implementations of trait `_::_pin_project::UnsafeUnpin` for type `Baz<_, _>`
+  --> tests/ui/not_unpin/impl-unsafe-unpin.rs:21:1
    |
 21 | #[pin_project(!Unpin)] //~ ERROR E0119
    | ^^^^^^^^^^^^^^^^^^^^^^ conflicting implementation for `Baz<_, _>`
diff --git a/tests/ui/pin_project/add-attr-to-struct.stderr b/tests/ui/pin_project/add-attr-to-struct.stderr
index b28559b..6fb88e8 100644
--- a/tests/ui/pin_project/add-attr-to-struct.stderr
+++ b/tests/ui/pin_project/add-attr-to-struct.stderr
@@ -1,5 +1,5 @@
 error: duplicate #[pin] attribute
- --> $DIR/add-attr-to-struct.rs:7:1
+ --> tests/ui/pin_project/add-attr-to-struct.rs:7:1
   |
 7 | #[add_pin_attr(struct)] //~ ERROR duplicate #[pin] attribute
   | ^^^^^^^^^^^^^^^^^^^^^^^
@@ -7,7 +7,7 @@
   = note: this error originates in the attribute macro `add_pin_attr` (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
+  --> tests/ui/pin_project/add-attr-to-struct.rs:13:1
    |
 13 | #[add_pin_attr(struct)] //~ ERROR #[pin] attribute may only be used on fields of structs or variants
    | ^^^^^^^^^^^^^^^^^^^^^^^
diff --git a/tests/ui/pin_project/add-pinned-field.stderr b/tests/ui/pin_project/add-pinned-field.stderr
index bdeafb8..d0832cc 100644
--- a/tests/ui/pin_project/add-pinned-field.stderr
+++ b/tests/ui/pin_project/add-pinned-field.stderr
@@ -1,48 +1,52 @@
 error[E0277]: `PhantomPinned` cannot be unpinned
-  --> $DIR/add-pinned-field.rs:21:5
+  --> tests/ui/pin_project/add-pinned-field.rs:21:5
    |
-4  | fn is_unpin<T: Unpin>() {}
-   |                ----- required by this bound in `is_unpin`
-...
 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
+  --> tests/ui/pin_project/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
+  --> tests/ui/pin_project/add-pinned-field.rs:6:1
    |
 6  | #[pin_project]
    | ^^^^^^^^^^^^^^
 7  | #[add_pinned_field]
 8  | struct Foo {
    |        ^^^
+note: required by a bound in `is_unpin`
+  --> tests/ui/pin_project/add-pinned-field.rs:4:16
+   |
+4  | fn is_unpin<T: Unpin>() {}
+   |                ^^^^^ required by this bound in `is_unpin`
    = note: this error originates in the derive macro `::pin_project::__private::__PinProjectInternalDerive` (in Nightly builds, run with -Z macro-backtrace for more info)
 
 error[E0277]: `PhantomPinned` cannot be unpinned
-  --> $DIR/add-pinned-field.rs:22:5
+  --> tests/ui/pin_project/add-pinned-field.rs:22:5
    |
-4  | fn is_unpin<T: Unpin>() {}
-   |                ----- required by this bound in `is_unpin`
-...
 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
+  --> tests/ui/pin_project/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
+  --> tests/ui/pin_project/add-pinned-field.rs:14:1
    |
 14 | #[pin_project]
    | ^^^^^^^^^^^^^^
 15 | struct Bar {
    |        ^^^
+note: required by a bound in `is_unpin`
+  --> tests/ui/pin_project/add-pinned-field.rs:4:16
+   |
+4  | fn is_unpin<T: Unpin>() {}
+   |                ^^^^^ required by this bound in `is_unpin`
    = note: this error originates in the derive macro `::pin_project::__private::__PinProjectInternalDerive` (in Nightly builds, run with -Z macro-backtrace for more info)
diff --git a/tests/ui/pin_project/conflict-drop.stderr b/tests/ui/pin_project/conflict-drop.stderr
index 25b0e00..4ae628d 100644
--- a/tests/ui/pin_project/conflict-drop.stderr
+++ b/tests/ui/pin_project/conflict-drop.stderr
@@ -1,5 +1,5 @@
 error[E0119]: conflicting implementations of trait `_::FooMustNotImplDrop` for type `Foo<_, _>`
- --> $DIR/conflict-drop.rs:5:1
+ --> tests/ui/pin_project/conflict-drop.rs:5:1
   |
 5 | #[pin_project] //~ ERROR E0119
   | ^^^^^^^^^^^^^^
@@ -10,7 +10,7 @@
   = note: this error originates in the derive macro `::pin_project::__private::__PinProjectInternalDerive` (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
+  --> tests/ui/pin_project/conflict-drop.rs:16:15
    |
 16 | #[pin_project(PinnedDrop)] //~ ERROR E0119
    |               ^^^^^^^^^^ conflicting implementation for `Bar<_, _>`
diff --git a/tests/ui/pin_project/conflict-unpin.stderr b/tests/ui/pin_project/conflict-unpin.stderr
index 5a16469..5e012c4 100644
--- a/tests/ui/pin_project/conflict-unpin.stderr
+++ b/tests/ui/pin_project/conflict-unpin.stderr
@@ -1,5 +1,5 @@
 error[E0119]: conflicting implementations of trait `std::marker::Unpin` for type `Foo<_, _>`
-  --> $DIR/conflict-unpin.rs:5:1
+  --> tests/ui/pin_project/conflict-unpin.rs:5:1
    |
 5  | #[pin_project] //~ ERROR E0119
    | ^^^^^^^^^^^^^^ conflicting implementation for `Foo<_, _>`
@@ -10,7 +10,7 @@
    = note: this error originates in the derive macro `::pin_project::__private::__PinProjectInternalDerive` (in Nightly builds, run with -Z macro-backtrace for more info)
 
 error[E0119]: conflicting implementations of trait `std::marker::Unpin` for type `Bar<_, _>`
-  --> $DIR/conflict-unpin.rs:17:1
+  --> tests/ui/pin_project/conflict-unpin.rs:17:1
    |
 17 | #[pin_project] //~ ERROR E0119
    | ^^^^^^^^^^^^^^ conflicting implementation for `Bar<_, _>`
@@ -21,7 +21,7 @@
    = note: this error originates in the derive macro `::pin_project::__private::__PinProjectInternalDerive` (in Nightly builds, run with -Z macro-backtrace for more info)
 
 error[E0119]: conflicting implementations of trait `std::marker::Unpin` for type `Baz<_, _>`
-  --> $DIR/conflict-unpin.rs:27:1
+  --> tests/ui/pin_project/conflict-unpin.rs:27:1
    |
 27 | #[pin_project] //~ ERROR E0119
    | ^^^^^^^^^^^^^^ conflicting implementation for `Baz<_, _>`
diff --git a/tests/ui/pin_project/impl-unsafe-unpin.stderr b/tests/ui/pin_project/impl-unsafe-unpin.stderr
index e97d31b..ba42303 100644
--- a/tests/ui/pin_project/impl-unsafe-unpin.stderr
+++ b/tests/ui/pin_project/impl-unsafe-unpin.stderr
@@ -1,5 +1,5 @@
-error[E0119]: conflicting implementations of trait `pin_project::UnsafeUnpin` for type `Foo<_, _>`
-  --> $DIR/impl-unsafe-unpin.rs:3:1
+error[E0119]: conflicting implementations of trait `_::_pin_project::UnsafeUnpin` for type `Foo<_, _>`
+  --> tests/ui/pin_project/impl-unsafe-unpin.rs:3:1
    |
 3  | #[pin_project] //~ ERROR E0119
    | ^^^^^^^^^^^^^^ conflicting implementation for `Foo<_, _>`
@@ -9,8 +9,8 @@
    |
    = note: this error originates in the derive macro `::pin_project::__private::__PinProjectInternalDerive` (in Nightly builds, run with -Z macro-backtrace for more info)
 
-error[E0119]: conflicting implementations of trait `pin_project::UnsafeUnpin` for type `Bar<_, _>`
-  --> $DIR/impl-unsafe-unpin.rs:12:1
+error[E0119]: conflicting implementations of trait `_::_pin_project::UnsafeUnpin` for type `Bar<_, _>`
+  --> tests/ui/pin_project/impl-unsafe-unpin.rs:12:1
    |
 12 | #[pin_project] //~ ERROR E0119
    | ^^^^^^^^^^^^^^ conflicting implementation for `Bar<_, _>`
@@ -20,8 +20,8 @@
    |
    = note: this error originates in the derive macro `::pin_project::__private::__PinProjectInternalDerive` (in Nightly builds, run with -Z macro-backtrace for more info)
 
-error[E0119]: conflicting implementations of trait `pin_project::UnsafeUnpin` for type `Baz<_, _>`
-  --> $DIR/impl-unsafe-unpin.rs:21:1
+error[E0119]: conflicting implementations of trait `_::_pin_project::UnsafeUnpin` for type `Baz<_, _>`
+  --> tests/ui/pin_project/impl-unsafe-unpin.rs:21:1
    |
 21 | #[pin_project] //~ ERROR E0119
    | ^^^^^^^^^^^^^^ conflicting implementation for `Baz<_, _>`
diff --git a/tests/ui/pin_project/import_unnamed.stderr b/tests/ui/pin_project/import_unnamed.stderr
index f54e4c4..260a35a 100644
--- a/tests/ui/pin_project/import_unnamed.stderr
+++ b/tests/ui/pin_project/import_unnamed.stderr
@@ -1,29 +1,29 @@
 error[E0432]: unresolved import `crate::pub_::__DefaultProjection`
-  --> $DIR/import_unnamed.rs:16:9
+  --> tests/ui/pin_project/import_unnamed.rs:16:9
    |
 16 |     use crate::pub_::__DefaultProjection; //~ ERROR E0432
    |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ no `__DefaultProjection` in `pub_`
 
 error[E0432]: unresolved import `crate::pub_::__DefaultProjectionRef`
-  --> $DIR/import_unnamed.rs:18:9
+  --> tests/ui/pin_project/import_unnamed.rs:18:9
    |
 18 |     use crate::pub_::__DefaultProjectionRef; //~ ERROR E0432
    |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ no `__DefaultProjectionRef` in `pub_`
 
 error[E0432]: unresolved import `crate::pub_::__ReplaceProjection`
-  --> $DIR/import_unnamed.rs:20:9
+  --> tests/ui/pin_project/import_unnamed.rs:20:9
    |
 20 |     use crate::pub_::__ReplaceProjection; //~ ERROR E0432
    |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ no `__ReplaceProjection` in `pub_`
 
 error[E0432]: unresolved import `crate::pub_::__ReplaceProjectionOwned`
-  --> $DIR/import_unnamed.rs:22:9
+  --> tests/ui/pin_project/import_unnamed.rs:22:9
    |
 22 |     use crate::pub_::__ReplaceProjectionOwned; //~ ERROR E0432
    |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ no `__ReplaceProjectionOwned` in `pub_`
 
 error[E0432]: unresolved import `crate::pub_::__ReplaceProjectionRef`
-  --> $DIR/import_unnamed.rs:24:9
+  --> tests/ui/pin_project/import_unnamed.rs:24:9
    |
 24 |     use crate::pub_::__ReplaceProjectionRef; //~ ERROR E0432
    |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ no `__ReplaceProjectionRef` in `pub_`
diff --git a/tests/ui/pin_project/invalid.stderr b/tests/ui/pin_project/invalid.stderr
index 35552bf..c43d363 100644
--- a/tests/ui/pin_project/invalid.stderr
+++ b/tests/ui/pin_project/invalid.stderr
@@ -1,329 +1,329 @@
-error: unexpected token: ()
- --> $DIR/invalid.rs:6:14
+error: unexpected token: `()`
+ --> tests/ui/pin_project/invalid.rs:6:14
   |
 6 |         #[pin()] //~ ERROR unexpected token
   |              ^^
 
-error: unexpected token: (foo)
-  --> $DIR/invalid.rs:11:29
+error: unexpected token: `(foo)`
+  --> tests/ui/pin_project/invalid.rs:11:29
    |
 11 |     struct TupleStruct(#[pin(foo)] ()); //~ ERROR unexpected token
    |                             ^^^^^
 
-error: unexpected token: (foo)
-  --> $DIR/invalid.rs:15:16
+error: unexpected token: `(foo)`
+  --> tests/ui/pin_project/invalid.rs:15:16
    |
 15 |         V(#[pin(foo)] ()), //~ ERROR unexpected token
    |                ^^^^^
 
-error: unexpected token: (foo)
-  --> $DIR/invalid.rs:21:18
+error: unexpected token: `(foo)`
+  --> tests/ui/pin_project/invalid.rs:21:18
    |
 21 |             #[pin(foo)] //~ ERROR unexpected token
    |                  ^^^^^
 
 error: duplicate #[pin] attribute
-  --> $DIR/invalid.rs:33:9
+  --> tests/ui/pin_project/invalid.rs:33:9
    |
 33 |         #[pin] //~ ERROR duplicate #[pin] attribute
    |         ^^^^^^
 
 error: duplicate #[pin] attribute
-  --> $DIR/invalid.rs:40:9
+  --> tests/ui/pin_project/invalid.rs:40:9
    |
 40 |         #[pin]
    |         ^^^^^^
 
 error: duplicate #[pin] attribute
-  --> $DIR/invalid.rs:49:13
+  --> tests/ui/pin_project/invalid.rs:49:13
    |
 49 |             #[pin]
    |             ^^^^^^
 
 error: duplicate #[pin] attribute
-  --> $DIR/invalid.rs:59:13
+  --> tests/ui/pin_project/invalid.rs:59:13
    |
 59 |             #[pin] //~ ERROR duplicate #[pin] attribute
    |             ^^^^^^
 
 error: #[pin] attribute may only be used on fields of structs or variants
-  --> $DIR/invalid.rs:69:5
+  --> tests/ui/pin_project/invalid.rs:69:5
    |
 69 |     #[pin] //~ ERROR may only be used on fields of structs or variants
    |     ^^^^^^
 
 error: #[pin] attribute may only be used on fields of structs or variants
-  --> $DIR/invalid.rs:77:9
+  --> tests/ui/pin_project/invalid.rs:77:9
    |
 77 |         #[pin] //~ ERROR may only be used on fields of structs or variants
    |         ^^^^^^
 
 error: #[pin] attribute may only be used on fields of structs or variants
-  --> $DIR/invalid.rs:82:5
+  --> tests/ui/pin_project/invalid.rs:82:5
    |
 82 |     #[pin] //~ ERROR may only be used on fields of structs or variants
    |     ^^^^^^
 
 error: `Replace` argument was removed, use `project_replace` argument instead
-  --> $DIR/invalid.rs:91:19
+  --> tests/ui/pin_project/invalid.rs:91:19
    |
 91 |     #[pin_project(Replace)] //~ ERROR `Replace` argument was removed, use `project_replace` argument instead
    |                   ^^^^^^^
 
 error: expected identifier
-  --> $DIR/invalid.rs:94:31
+  --> tests/ui/pin_project/invalid.rs:94:31
    |
 94 |     #[pin_project(UnsafeUnpin,,)] //~ ERROR expected identifier
    |                               ^
 
 error: unexpected argument: Foo
-  --> $DIR/invalid.rs:97:19
+  --> tests/ui/pin_project/invalid.rs:97:19
    |
 97 |     #[pin_project(Foo)] //~ ERROR unexpected argument
    |                   ^^^
 
 error: expected identifier
-   --> $DIR/invalid.rs:100:19
+   --> tests/ui/pin_project/invalid.rs:100:19
     |
 100 |     #[pin_project(,UnsafeUnpin)] //~ ERROR expected identifier
     |                   ^
 
 error: expected `,`
-   --> $DIR/invalid.rs:106:30
+   --> tests/ui/pin_project/invalid.rs:106:30
     |
 106 |     #[pin_project(PinnedDrop PinnedDrop)] //~ ERROR expected `,`
     |                              ^^^^^^^^^^
 
 error: duplicate `PinnedDrop` argument
-   --> $DIR/invalid.rs:109:31
+   --> tests/ui/pin_project/invalid.rs:109:31
     |
 109 |     #[pin_project(PinnedDrop, PinnedDrop)] //~ ERROR duplicate `PinnedDrop` argument
     |                               ^^^^^^^^^^
 
 error: duplicate `UnsafeUnpin` argument
-   --> $DIR/invalid.rs:112:32
+   --> tests/ui/pin_project/invalid.rs:112:32
     |
 112 |     #[pin_project(UnsafeUnpin, UnsafeUnpin)] //~ ERROR duplicate `UnsafeUnpin` argument
     |                                ^^^^^^^^^^^
 
 error: duplicate `!Unpin` argument
-   --> $DIR/invalid.rs:115:27
+   --> tests/ui/pin_project/invalid.rs:115:27
     |
 115 |     #[pin_project(!Unpin, !Unpin)] //~ ERROR duplicate `!Unpin` argument
     |                           ^^^^^^
 
 error: duplicate `UnsafeUnpin` argument
-   --> $DIR/invalid.rs:118:44
+   --> tests/ui/pin_project/invalid.rs:118:44
     |
 118 |     #[pin_project(PinnedDrop, UnsafeUnpin, UnsafeUnpin)] //~ ERROR duplicate `UnsafeUnpin` argument
     |                                            ^^^^^^^^^^^
 
 error: duplicate `PinnedDrop` argument
-   --> $DIR/invalid.rs:121:44
+   --> tests/ui/pin_project/invalid.rs:121:44
     |
 121 |     #[pin_project(PinnedDrop, UnsafeUnpin, PinnedDrop, UnsafeUnpin)] //~ ERROR duplicate `PinnedDrop` argument
     |                                            ^^^^^^^^^^
 
 error: duplicate `project` argument
-   --> $DIR/invalid.rs:124:32
+   --> tests/ui/pin_project/invalid.rs:124:32
     |
 124 |     #[pin_project(project = A, project = B)] //~ ERROR duplicate `project` argument
     |                                ^^^^^^^^^^^
 
 error: duplicate `project` argument
-   --> $DIR/invalid.rs:127:49
+   --> tests/ui/pin_project/invalid.rs:127:49
     |
 127 |     #[pin_project(project = A, project_ref = A, project = B)] //~ ERROR duplicate `project` argument
     |                                                 ^^^^^^^^^^^
 
 error: duplicate `project_ref` argument
-   --> $DIR/invalid.rs:130:36
+   --> tests/ui/pin_project/invalid.rs:130:36
     |
 130 |     #[pin_project(project_ref = A, project_ref = B)] //~ ERROR duplicate `project_ref` argument
     |                                    ^^^^^^^^^^^^^^^
 
 error: duplicate `project_replace` argument
-   --> $DIR/invalid.rs:133:40
+   --> tests/ui/pin_project/invalid.rs:133:40
     |
 133 |     #[pin_project(project_replace = A, project_replace = B)] //~ ERROR duplicate `project_replace` argument
     |                                        ^^^^^^^^^^^^^^^^^^^
 
 error: duplicate `project_replace` argument
-   --> $DIR/invalid.rs:136:36
+   --> tests/ui/pin_project/invalid.rs:136:36
     |
 136 |     #[pin_project(project_replace, project_replace = B)] //~ ERROR duplicate `project_replace` argument
     |                                    ^^^^^^^^^^^^^^^^^^^
 
 error: duplicate `project_replace` argument
-   --> $DIR/invalid.rs:139:40
+   --> tests/ui/pin_project/invalid.rs:139:40
     |
 139 |     #[pin_project(project_replace = A, project_replace)] //~ ERROR duplicate `project_replace` argument
     |                                        ^^^^^^^^^^^^^^^
 
 error: arguments `PinnedDrop` and `project_replace` are mutually exclusive
-   --> $DIR/invalid.rs:145:19
+   --> tests/ui/pin_project/invalid.rs:145:19
     |
 145 |     #[pin_project(PinnedDrop, project_replace)] //~ ERROR arguments `PinnedDrop` and `project_replace` are mutually exclusive
     |                   ^^^^^^^^^^
 
 error: arguments `PinnedDrop` and `project_replace` are mutually exclusive
-   --> $DIR/invalid.rs:148:49
+   --> tests/ui/pin_project/invalid.rs:148:49
     |
 148 |     #[pin_project(project_replace, UnsafeUnpin, PinnedDrop)] //~ ERROR arguments `PinnedDrop` and `project_replace` are mutually exclusive
     |                                                 ^^^^^^^^^^
 
 error: arguments `UnsafeUnpin` and `!Unpin` are mutually exclusive
-   --> $DIR/invalid.rs:151:19
+   --> tests/ui/pin_project/invalid.rs:151:19
     |
 151 |     #[pin_project(UnsafeUnpin, !Unpin)] //~ ERROR arguments `UnsafeUnpin` and `!Unpin` are mutually exclusive
     |                   ^^^^^^^^^^^
 
 error: arguments `UnsafeUnpin` and `!Unpin` are mutually exclusive
-   --> $DIR/invalid.rs:154:39
+   --> tests/ui/pin_project/invalid.rs:154:39
     |
 154 |     #[pin_project(!Unpin, PinnedDrop, UnsafeUnpin)] //~ ERROR arguments `UnsafeUnpin` and `!Unpin` are mutually exclusive
     |                                       ^^^^^^^^^^^
 
 error: expected `!Unpin`, found `!`
-   --> $DIR/invalid.rs:157:19
+   --> tests/ui/pin_project/invalid.rs:157:19
     |
 157 |     #[pin_project(!)] //~ ERROR expected `!Unpin`, found `!`
     |                   ^
 
 error: unexpected argument: Unpin
-   --> $DIR/invalid.rs:160:19
+   --> tests/ui/pin_project/invalid.rs:160:19
     |
 160 |     #[pin_project(Unpin)] //~ ERROR unexpected argument
     |                   ^^^^^
 
 error: expected `project = <identifier>`, found `project`
-   --> $DIR/invalid.rs:163:19
+   --> tests/ui/pin_project/invalid.rs:163:19
     |
 163 |     #[pin_project(project)] //~ ERROR expected `project = <identifier>`, found `project`
     |                   ^^^^^^^
 
 error: expected `project = <identifier>`, found `project =`
-   --> $DIR/invalid.rs:166:19
+   --> tests/ui/pin_project/invalid.rs:166:19
     |
 166 |     #[pin_project(project = )] //~ ERROR expected `project = <identifier>`, found `project =`
     |                   ^^^^^^^^^
 
 error: expected identifier
-   --> $DIR/invalid.rs:169:29
+   --> tests/ui/pin_project/invalid.rs:169:29
     |
 169 |     #[pin_project(project = !)] //~ ERROR expected identifier
     |                             ^
 
 error: expected `project_ref = <identifier>`, found `project_ref`
-   --> $DIR/invalid.rs:172:19
+   --> tests/ui/pin_project/invalid.rs:172:19
     |
 172 |     #[pin_project(project_ref)] //~ ERROR expected `project_ref = <identifier>`, found `project_ref`
     |                   ^^^^^^^^^^^
 
 error: expected `project_ref = <identifier>`, found `project_ref =`
-   --> $DIR/invalid.rs:175:19
+   --> tests/ui/pin_project/invalid.rs:175:19
     |
 175 |     #[pin_project(project_ref = )] //~ ERROR expected `project_ref = <identifier>`, found `project_ref =`
     |                   ^^^^^^^^^^^^^
 
 error: expected identifier
-   --> $DIR/invalid.rs:178:33
+   --> tests/ui/pin_project/invalid.rs:178:33
     |
 178 |     #[pin_project(project_ref = !)] //~ ERROR expected identifier
     |                                 ^
 
 error: expected `project_replace = <identifier>`, found `project_replace =`
-   --> $DIR/invalid.rs:184:19
+   --> tests/ui/pin_project/invalid.rs:184:19
     |
 184 |     #[pin_project(project_replace = )] //~ ERROR expected `project_replace = <identifier>`, found `project_replace =`
     |                   ^^^^^^^^^^^^^^^^^
 
 error: expected identifier
-   --> $DIR/invalid.rs:187:37
+   --> tests/ui/pin_project/invalid.rs:187:37
     |
 187 |     #[pin_project(project_replace = !)] //~ ERROR expected identifier
     |                                     ^
 
 error: `project_replace` argument requires a value when used on enums
-   --> $DIR/invalid.rs:190:19
+   --> tests/ui/pin_project/invalid.rs:190:19
     |
 190 |     #[pin_project(project_replace)] //~ ERROR `project_replace` argument requires a value when used on enums
     |                   ^^^^^^^^^^^^^^^
 
 error: name `OrigAndProj` is the same as the original type name
-   --> $DIR/invalid.rs:199:29
+   --> tests/ui/pin_project/invalid.rs:199:29
     |
 199 |     #[pin_project(project = OrigAndProj)] //~ ERROR name `OrigAndProj` is the same as the original type name
     |                             ^^^^^^^^^^^
 
 error: name `OrigAndProjRef` is the same as the original type name
-   --> $DIR/invalid.rs:202:33
+   --> tests/ui/pin_project/invalid.rs:202:33
     |
 202 |     #[pin_project(project_ref = OrigAndProjRef)] //~ ERROR name `OrigAndProjRef` is the same as the original type name
     |                                 ^^^^^^^^^^^^^^
 
 error: name `OrigAndProjOwn` is the same as the original type name
-   --> $DIR/invalid.rs:205:37
+   --> tests/ui/pin_project/invalid.rs:205:37
     |
 205 |     #[pin_project(project_replace = OrigAndProjOwn)] //~ ERROR name `OrigAndProjOwn` is the same as the original type name
     |                                     ^^^^^^^^^^^^^^
 
 error: name `A` is already specified by `project` argument
-   --> $DIR/invalid.rs:208:46
+   --> tests/ui/pin_project/invalid.rs:208:46
     |
 208 |     #[pin_project(project = A, project_ref = A)] //~ ERROR name `A` is already specified by `project` argument
     |                                              ^
 
 error: name `A` is already specified by `project` argument
-   --> $DIR/invalid.rs:211:50
+   --> tests/ui/pin_project/invalid.rs:211:50
     |
 211 |     #[pin_project(project = A, project_replace = A)] //~ ERROR name `A` is already specified by `project` argument
     |                                                  ^
 
 error: name `A` is already specified by `project_ref` argument
-   --> $DIR/invalid.rs:214:54
+   --> tests/ui/pin_project/invalid.rs:214:54
     |
 214 |     #[pin_project(project_ref = A, project_replace = A)] //~ ERROR name `A` is already specified by `project_ref` argument
     |                                                      ^
 
 error: duplicate #[pin_project] attribute
-   --> $DIR/invalid.rs:222:5
+   --> tests/ui/pin_project/invalid.rs:222:5
     |
 222 |     #[pin_project] //~ ERROR duplicate #[pin_project] attribute
     |     ^^^^^^^^^^^^^^
 
 error: #[pin_project] attribute may not be used on structs with zero fields
-   --> $DIR/invalid.rs:230:19
+   --> tests/ui/pin_project/invalid.rs:230:19
     |
 230 |     struct Struct {} //~ ERROR may not be used on structs with zero fields
     |                   ^^
 
 error: #[pin_project] attribute may not be used on structs with zero fields
-   --> $DIR/invalid.rs:233:23
+   --> tests/ui/pin_project/invalid.rs:233:23
     |
 233 |     struct TupleStruct(); //~ ERROR may not be used on structs with zero fields
     |                       ^^
 
 error: #[pin_project] attribute may not be used on structs with zero fields
-   --> $DIR/invalid.rs:236:12
+   --> tests/ui/pin_project/invalid.rs:236:12
     |
 236 |     struct UnitStruct; //~ ERROR may not be used on structs with zero fields
     |            ^^^^^^^^^^
 
 error: #[pin_project] attribute may not be used on enums without variants
-   --> $DIR/invalid.rs:239:20
+   --> tests/ui/pin_project/invalid.rs:239:20
     |
 239 |     enum EnumEmpty {} //~ ERROR may not be used on enums without variants
     |                    ^^
 
 error: #[pin_project] attribute may not be used on enums with discriminants
-   --> $DIR/invalid.rs:243:13
+   --> tests/ui/pin_project/invalid.rs:243:13
     |
 243 |         V = 2, //~ ERROR may not be used on enums with discriminants
     |             ^
 
 error: #[pin_project] attribute may not be used on enums with zero fields
-   --> $DIR/invalid.rs:248:9
+   --> tests/ui/pin_project/invalid.rs:248:9
     |
 248 | /         Unit, //~ ERROR may not be used on enums with zero fields
 249 | |         Tuple(),
@@ -331,7 +331,7 @@
     | |__________________^
 
 error: #[pin_project] attribute may only be used on structs or enums
-   --> $DIR/invalid.rs:254:5
+   --> tests/ui/pin_project/invalid.rs:254:5
     |
 254 | /     union Union {
 255 | |         //~^ ERROR may only be used on structs or enums
@@ -340,25 +340,25 @@
     | |_____^
 
 error: #[pin_project] attribute may only be used on structs or enums
-   --> $DIR/invalid.rs:260:5
+   --> tests/ui/pin_project/invalid.rs:260:5
     |
 260 |     impl Impl {} //~ ERROR may only be used on structs or enums
     |     ^^^^^^^^^^^^
 
 error: #[pin_project] attribute may not be used on #[repr(packed)] types
-   --> $DIR/invalid.rs:268:12
+   --> tests/ui/pin_project/invalid.rs:268:12
     |
 268 |     #[repr(packed)]
     |            ^^^^^^
 
 error: #[pin_project] attribute may not be used on #[repr(packed)] types
-   --> $DIR/invalid.rs:272:12
+   --> tests/ui/pin_project/invalid.rs:272:12
     |
 272 |     #[repr(packed)]
     |            ^^^^^^
 
 error: #[pin_project] attribute may not be used on #[repr(packed)] types
-   --> $DIR/invalid.rs:276:12
+   --> tests/ui/pin_project/invalid.rs:276:12
     |
 276 |     #[repr(packed)]
     |            ^^^^^^
diff --git a/tests/ui/pin_project/overlapping_unpin_struct.stderr b/tests/ui/pin_project/overlapping_unpin_struct.stderr
index bb33944..1bd200d 100644
--- a/tests/ui/pin_project/overlapping_unpin_struct.stderr
+++ b/tests/ui/pin_project/overlapping_unpin_struct.stderr
@@ -1,23 +1,25 @@
 error[E0277]: `PhantomPinned` cannot be unpinned
-  --> $DIR/overlapping_unpin_struct.rs:18:5
+  --> tests/ui/pin_project/overlapping_unpin_struct.rs:18:5
    |
-15 | fn is_unpin<T: Unpin>() {}
-   |                ----- required by this bound in `is_unpin`
-...
 18 |     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
+  --> tests/ui/pin_project/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
+  --> tests/ui/pin_project/overlapping_unpin_struct.rs:5:1
    |
 5  | #[pin_project]
    | ^^^^^^^^^^^^^^
 6  | struct S<T> {
    |        ^^^^
+note: required by a bound in `is_unpin`
+  --> tests/ui/pin_project/overlapping_unpin_struct.rs:15:16
+   |
+15 | fn is_unpin<T: Unpin>() {}
+   |                ^^^^^ required by this bound in `is_unpin`
    = note: this error originates in the derive macro `::pin_project::__private::__PinProjectInternalDerive` (in Nightly builds, run with -Z macro-backtrace for more info)
diff --git a/tests/ui/pin_project/override-priv-mod.rs b/tests/ui/pin_project/override-priv-mod.rs
new file mode 100644
index 0000000..890fd5b
--- /dev/null
+++ b/tests/ui/pin_project/override-priv-mod.rs
@@ -0,0 +1,32 @@
+// https://discord.com/channels/273534239310479360/512792629516173323/870075511009857617
+
+extern crate pin_project as pin_project_orig;
+extern crate self as pin_project;
+
+pub use ::pin_project_orig::*;
+mod __private {
+    pub use ::pin_project_orig::__private::*;
+    pub trait Drop {}
+}
+
+use std::{marker::PhantomPinned, mem};
+
+#[pin_project] //~ ERROR conflicting implementations of trait `_::FooMustNotImplDrop`
+struct S {
+    #[pin]
+    f: (u8, PhantomPinned),
+}
+
+impl Drop for S {
+    fn drop(&mut self) {
+        let prev = &self.f.0 as *const _ as usize;
+        let moved = mem::take(&mut self.f); // move pinned field
+        let moved = &moved.0 as *const _ as usize;
+        assert_eq!(prev, moved); // panic
+    }
+}
+
+fn main() {
+    let mut x = Box::pin(S { f: (1, PhantomPinned) });
+    let _f = x.as_mut().project().f; // first mutable access
+}
diff --git a/tests/ui/pin_project/override-priv-mod.stderr b/tests/ui/pin_project/override-priv-mod.stderr
new file mode 100644
index 0000000..8a3fb9b
--- /dev/null
+++ b/tests/ui/pin_project/override-priv-mod.stderr
@@ -0,0 +1,10 @@
+error[E0119]: conflicting implementations of trait `_::SMustNotImplDrop` for type `S`
+  --> tests/ui/pin_project/override-priv-mod.rs:14:1
+   |
+14 | #[pin_project] //~ ERROR conflicting implementations of trait `_::FooMustNotImplDrop`
+   | ^^^^^^^^^^^^^^
+   | |
+   | first implementation here
+   | conflicting implementation for `S`
+   |
+   = note: this error originates in the derive macro `::pin_project::__private::__PinProjectInternalDerive` (in Nightly builds, run with -Z macro-backtrace for more info)
diff --git a/tests/ui/pin_project/packed-enum.stderr b/tests/ui/pin_project/packed-enum.stderr
index 0951944..1872211 100644
--- a/tests/ui/pin_project/packed-enum.stderr
+++ b/tests/ui/pin_project/packed-enum.stderr
@@ -1,17 +1,17 @@
 error: #[repr(packed)] attribute should be applied to a struct or union
-  --> $DIR/packed-enum.rs:13:8
+  --> tests/ui/pin_project/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
+  --> tests/ui/pin_project/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
+  --> tests/ui/pin_project/packed-enum.rs:7:8
    |
 7  |   #[repr(packed)] //~ ERROR E0517
    |          ^^^^^^
@@ -21,7 +21,7 @@
    | |_- not a struct or union
 
 error[E0517]: attribute should be applied to a struct or union
-  --> $DIR/packed-enum.rs:13:8
+  --> tests/ui/pin_project/packed-enum.rs:13:8
    |
 13 |   #[repr(packed)] //~ ERROR E0517
    |          ^^^^^^
@@ -31,7 +31,7 @@
    | |_- not a struct or union
 
 error[E0517]: attribute should be applied to a struct or union
-  --> $DIR/packed-enum.rs:18:8
+  --> tests/ui/pin_project/packed-enum.rs:18:8
    |
 18 |   #[repr(packed)] //~ ERROR E0517
    |          ^^^^^^
diff --git a/tests/ui/pin_project/packed-name-value.stderr b/tests/ui/pin_project/packed-name-value.stderr
index 18137d4..d8b2194 100644
--- a/tests/ui/pin_project/packed-name-value.stderr
+++ b/tests/ui/pin_project/packed-name-value.stderr
@@ -1,23 +1,23 @@
 error: #[repr(packed)] attribute should not be name-value pair
-  --> $DIR/packed-name-value.rs:16:8
+  --> tests/ui/pin_project/packed-name-value.rs:16:8
    |
 16 | #[repr(packed = "")] //~ ERROR attribute should not be name-value pair
    |        ^^^^^^^^^^^
 
 error: #[repr(packed)] attribute should not be name-value pair
-  --> $DIR/packed-name-value.rs:21:8
+  --> tests/ui/pin_project/packed-name-value.rs:21:8
    |
 21 | #[repr(packed = "")] //~ ERROR attribute should not be name-value pair
    |        ^^^^^^^^^^^
 
 error[E0693]: incorrect `repr(packed)` attribute format
-  --> $DIR/packed-name-value.rs:16:8
+  --> tests/ui/pin_project/packed-name-value.rs:16: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
+  --> tests/ui/pin_project/packed-name-value.rs:21:8
    |
 21 | #[repr(packed = "")] //~ ERROR attribute should not be name-value pair
    |        ^^^^^^^^^^^ help: use parentheses instead: `packed()`
diff --git a/tests/ui/pin_project/packed.stderr b/tests/ui/pin_project/packed.stderr
index e5b9e55..25ea5f4 100644
--- a/tests/ui/pin_project/packed.stderr
+++ b/tests/ui/pin_project/packed.stderr
@@ -1,23 +1,23 @@
 error: #[pin_project] attribute may not be used on #[repr(packed)] types
- --> $DIR/packed.rs:4:8
+ --> tests/ui/pin_project/packed.rs:4:8
   |
 4 | #[repr(packed, C)] //~ ERROR may not be used on #[repr(packed)] types
   |        ^^^^^^
 
 error: #[pin_project] attribute may not be used on #[repr(packed)] types
-  --> $DIR/packed.rs:11:8
+  --> tests/ui/pin_project/packed.rs:11:8
    |
 11 | #[repr(packed, C)] //~ ERROR may not be used on #[repr(packed)] types
    |        ^^^^^^
 
 error: #[pin_project] attribute may not be used on #[repr(packed)] types
-  --> $DIR/packed.rs:19:8
+  --> tests/ui/pin_project/packed.rs:19:8
    |
 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
+  --> tests/ui/pin_project/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.stderr b/tests/ui/pin_project/packed_sneaky-1.stderr
index 67bcd1b..32fe407 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
+ --> tests/ui/pin_project/packed_sneaky-1.rs:7:15
   |
 7 | #[hidden_repr(packed)]
   |               ^^^^^^
 
 error: #[pin_project] attribute may not be used on #[repr(packed)] types
-  --> $DIR/packed_sneaky-1.rs:14:15
+  --> tests/ui/pin_project/packed_sneaky-1.rs:14:15
    |
 14 | #[hidden_repr(packed)]
    |               ^^^^^^
 
 error: #[pin_project] attribute may not be used on #[repr(packed)] types
-  --> $DIR/packed_sneaky-1.rs:23:15
+  --> tests/ui/pin_project/packed_sneaky-1.rs:23:15
    |
 23 | #[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..d643052 100644
--- a/tests/ui/pin_project/packed_sneaky-2.stderr
+++ b/tests/ui/pin_project/packed_sneaky-2.stderr
@@ -1,5 +1,5 @@
 error: #[pin_project] attribute may not be used on #[repr(packed)] types
-  --> $DIR/packed_sneaky-2.rs:4:1
+  --> tests/ui/pin_project/packed_sneaky-2.rs:4:1
    |
 4  | / hidden_repr_macro! { //~ ERROR may not be used on #[repr(packed)] types
 5  | |     #[pin_project]
diff --git a/tests/ui/pin_project/packed_sneaky-3.stderr b/tests/ui/pin_project/packed_sneaky-3.stderr
index 1a5a3ec..c97f18b 100644
--- a/tests/ui/pin_project/packed_sneaky-3.stderr
+++ b/tests/ui/pin_project/packed_sneaky-3.stderr
@@ -1,5 +1,5 @@
 error: expected item after attributes
- --> $DIR/packed_sneaky-3.rs:4:1
+ --> tests/ui/pin_project/packed_sneaky-3.rs:4:1
   |
 4 | hidden_repr_macro! {} //~ ERROR expected item after attributes
   | ^^^^^^^^^^^^^^^^^^^^^
@@ -7,7 +7,7 @@
   = note: this error originates in the macro `hidden_repr_macro` (in Nightly builds, run with -Z macro-backtrace for more info)
 
 error: expected item after attributes
-  --> $DIR/packed_sneaky-3.rs:13:9
+  --> tests/ui/pin_project/packed_sneaky-3.rs:13:9
    |
 13 |         #[repr(packed)] //~ ERROR expected item after attributes
    |         ^^^^^^^^^^^^^^^
@@ -18,7 +18,7 @@
    = note: this error originates in the macro `hidden_repr_macro2` (in Nightly builds, run with -Z macro-backtrace for more info)
 
 error: expected item after attributes
-  --> $DIR/packed_sneaky-3.rs:24:10
+  --> tests/ui/pin_project/packed_sneaky-3.rs:24:10
    |
 24 | #[derive(HiddenRepr)] //~ ERROR expected item after attributes
    |          ^^^^^^^^^^
@@ -26,7 +26,7 @@
    = note: this error originates in the derive macro `HiddenRepr` (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
+  --> tests/ui/pin_project/packed_sneaky-3.rs:24:10
    |
 24 | #[derive(HiddenRepr)] //~ ERROR expected item after attributes
    |          ^^^^^^^^^^
diff --git a/tests/ui/pin_project/private_in_public-enum.stderr b/tests/ui/pin_project/private_in_public-enum.stderr
index 6e3316c..c93b265 100644
--- a/tests/ui/pin_project/private_in_public-enum.stderr
+++ b/tests/ui/pin_project/private_in_public-enum.stderr
@@ -1,5 +1,5 @@
 error[E0446]: private type `PrivateEnum` in public interface
- --> $DIR/private_in_public-enum.rs:6:7
+ --> tests/ui/pin_project/private_in_public-enum.rs:6:7
   |
 6 |     V(PrivateEnum), //~ ERROR E0446
   |       ^^^^^^^^^^^ can't leak private type
@@ -8,7 +8,7 @@
   | ---------------- `PrivateEnum` declared as private
 
 error[E0446]: private type `foo::PrivateEnum` in public interface
-  --> $DIR/private_in_public-enum.rs:15:11
+  --> tests/ui/pin_project/private_in_public-enum.rs:15:11
    |
 15 |         V(PrivateEnum), //~ ERROR E0446
    |           ^^^^^^^^^^^ can't leak private type
diff --git a/tests/ui/pin_project/project_replace_unsized.stderr b/tests/ui/pin_project/project_replace_unsized.stderr
index d20d858..86cc148 100644
--- a/tests/ui/pin_project/project_replace_unsized.stderr
+++ b/tests/ui/pin_project/project_replace_unsized.stderr
@@ -1,5 +1,5 @@
 error[E0277]: the size for values of type `T` cannot be known at compilation time
- --> $DIR/project_replace_unsized.rs:3:15
+ --> tests/ui/pin_project/project_replace_unsized.rs:3:15
   |
 3 | #[pin_project(project_replace)] //~ ERROR E0277
   |               ^^^^^^^^^^^^^^^ doesn't have a size known at compile-time
@@ -7,18 +7,23 @@
   |               - 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
+ --> tests/ui/pin_project/project_replace_unsized.rs:4:8
   |
 4 | struct Struct<T: ?Sized> {
   |        ^^^^^^
   = help: unsized fn params are gated as an unstable feature
+help: consider removing the `?Sized` bound to make the type parameter `Sized`
+  |
+4 - struct Struct<T: ?Sized> {
+4 + struct Struct<T> {
+  |
 help: function arguments must have a statically known size, borrowed types always have a known size
   |
 3 | #[pin_project(&project_replace)] //~ ERROR E0277
-  |               ^
+  |               +
 
 error[E0277]: the size for values of type `T` cannot be known at compilation time
-   --> $DIR/project_replace_unsized.rs:3:1
+   --> tests/ui/pin_project/project_replace_unsized.rs:3:1
     |
 3   | #[pin_project(project_replace)] //~ ERROR E0277
     | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ doesn't have a size known at compile-time
@@ -26,27 +31,45 @@
     |               - 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
+   --> tests/ui/pin_project/project_replace_unsized.rs:4:8
     |
 4   | struct Struct<T: ?Sized> {
     |        ^^^^^^
-note: required by `UnsafeOverwriteGuard`
-   --> $DIR/lib.rs:269:5
+note: required by a bound in `UnsafeOverwriteGuard::<T>::new`
+   --> src/lib.rs
     |
-269 |     pub struct UnsafeOverwriteGuard<T> {
-    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+    |     impl<T> UnsafeOverwriteGuard<T> {
+    |          ^ required by this bound in `UnsafeOverwriteGuard::<T>::new`
     = note: this error originates in the derive macro `::pin_project::__private::__PinProjectInternalDerive` (in Nightly builds, run with -Z macro-backtrace for more info)
+help: consider removing the `?Sized` bound to make the type parameter `Sized`
+    |
+4   - struct Struct<T: ?Sized> {
+4   + struct Struct<T> {
+    |
 
 error[E0277]: the size for values of type `T` cannot be known at compilation time
-   --> $DIR/project_replace_unsized.rs:5:5
+   --> tests/ui/pin_project/project_replace_unsized.rs:5:5
     |
+3   | #[pin_project(project_replace)] //~ ERROR E0277
+    | ------------------------------- required by a bound introduced by this call
 4   | struct Struct<T: ?Sized> {
     |               - this type parameter needs to be `std::marker::Sized`
 5   |     f: T,
     |     ^ doesn't have a size known at compile-time
+    |
+note: required by a bound in `std::ptr::read`
+   --> $RUST/core/src/ptr/mod.rs
+    |
+    | pub const unsafe fn read<T>(src: *const T) -> T {
+    |                          ^ required by this bound in `std::ptr::read`
+help: consider removing the `?Sized` bound to make the type parameter `Sized`
+    |
+4   - struct Struct<T: ?Sized> {
+4   + struct Struct<T> {
+    |
 
 error[E0277]: the size for values of type `T` cannot be known at compilation time
- --> $DIR/project_replace_unsized.rs:8:15
+ --> tests/ui/pin_project/project_replace_unsized.rs:8:15
   |
 8 | #[pin_project(project_replace)] //~ ERROR E0277
   |               ^^^^^^^^^^^^^^^ doesn't have a size known at compile-time
@@ -54,18 +77,23 @@
   |                    - 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
+ --> tests/ui/pin_project/project_replace_unsized.rs:9:8
   |
 9 | struct TupleStruct<T: ?Sized>(T);
   |        ^^^^^^^^^^^
   = help: unsized fn params are gated as an unstable feature
+help: consider removing the `?Sized` bound to make the type parameter `Sized`
+  |
+9 - struct TupleStruct<T: ?Sized>(T);
+9 + struct TupleStruct<T>(T);
+  |
 help: function arguments must have a statically known size, borrowed types always have a known size
   |
 8 | #[pin_project(&project_replace)] //~ ERROR E0277
-  |               ^
+  |               +
 
 error[E0277]: the size for values of type `T` cannot be known at compilation time
-   --> $DIR/project_replace_unsized.rs:8:1
+   --> tests/ui/pin_project/project_replace_unsized.rs:8:1
     |
 8   | #[pin_project(project_replace)] //~ ERROR E0277
     | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ doesn't have a size known at compile-time
@@ -73,24 +101,18 @@
     |                    - 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
+   --> tests/ui/pin_project/project_replace_unsized.rs:9:8
     |
 9   | struct TupleStruct<T: ?Sized>(T);
     |        ^^^^^^^^^^^
-note: required by `UnsafeOverwriteGuard`
-   --> $DIR/lib.rs:269:5
+note: required by a bound in `UnsafeOverwriteGuard::<T>::new`
+   --> src/lib.rs
     |
-269 |     pub struct UnsafeOverwriteGuard<T> {
-    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+    |     impl<T> UnsafeOverwriteGuard<T> {
+    |          ^ required by this bound in `UnsafeOverwriteGuard::<T>::new`
     = note: this error originates in the derive macro `::pin_project::__private::__PinProjectInternalDerive` (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`
-  |        |
-  |        doesn't have a size known at compile-time
-  |
-  = note: all function arguments must have a statically known size
-  = help: unsized fn params are gated as an unstable feature
+help: consider removing the `?Sized` bound to make the type parameter `Sized`
+    |
+9   - struct TupleStruct<T: ?Sized>(T);
+9   + struct TupleStruct<T>(T);
+    |
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..e398ca4 100644
--- a/tests/ui/pin_project/project_replace_unsized_fn_params.stderr
+++ b/tests/ui/pin_project/project_replace_unsized_fn_params.stderr
@@ -1,5 +1,5 @@
 error[E0277]: the size for values of type `T` cannot be known at compilation time
- --> $DIR/project_replace_unsized_fn_params.rs:6:8
+ --> tests/ui/pin_project/project_replace_unsized_fn_params.rs:6:8
   |
 6 | struct Struct<T: ?Sized> {
   |        ^^^^^^^-^^^^^^^^^
@@ -8,14 +8,19 @@
   |        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
+ --> tests/ui/pin_project/project_replace_unsized_fn_params.rs:6:8
   |
 6 | struct Struct<T: ?Sized> {
   |        ^^^^^^
   = note: the return type of a function must have a statically known size
+help: consider removing the `?Sized` bound to make the type parameter `Sized`
+  |
+6 - struct Struct<T: ?Sized> {
+6 + struct Struct<T> {
+  |
 
 error[E0277]: the size for values of type `T` cannot be known at compilation time
-   --> $DIR/project_replace_unsized_fn_params.rs:5:1
+   --> tests/ui/pin_project/project_replace_unsized_fn_params.rs:5:1
     |
 5   | #[pin_project(project_replace)] //~ ERROR E0277
     | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ doesn't have a size known at compile-time
@@ -23,27 +28,45 @@
     |               - 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
+   --> tests/ui/pin_project/project_replace_unsized_fn_params.rs:6:8
     |
 6   | struct Struct<T: ?Sized> {
     |        ^^^^^^
-note: required by `UnsafeOverwriteGuard`
-   --> $DIR/lib.rs:269:5
+note: required by a bound in `UnsafeOverwriteGuard::<T>::new`
+   --> src/lib.rs
     |
-269 |     pub struct UnsafeOverwriteGuard<T> {
-    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+    |     impl<T> UnsafeOverwriteGuard<T> {
+    |          ^ required by this bound in `UnsafeOverwriteGuard::<T>::new`
     = note: this error originates in the derive macro `::pin_project::__private::__PinProjectInternalDerive` (in Nightly builds, run with -Z macro-backtrace for more info)
+help: consider removing the `?Sized` bound to make the type parameter `Sized`
+    |
+6   - struct Struct<T: ?Sized> {
+6   + struct Struct<T> {
+    |
 
 error[E0277]: the size for values of type `T` cannot be known at compilation time
-   --> $DIR/project_replace_unsized_fn_params.rs:7:5
+   --> tests/ui/pin_project/project_replace_unsized_fn_params.rs:7:5
     |
+5   | #[pin_project(project_replace)] //~ ERROR E0277
+    | ------------------------------- required by a bound introduced by this call
 6   | struct Struct<T: ?Sized> {
     |               - this type parameter needs to be `std::marker::Sized`
 7   |     f: T,
     |     ^ doesn't have a size known at compile-time
+    |
+note: required by a bound in `std::ptr::read`
+   --> $RUST/core/src/ptr/mod.rs
+    |
+    | pub const unsafe fn read<T>(src: *const T) -> T {
+    |                          ^ required by this bound in `std::ptr::read`
+help: consider removing the `?Sized` bound to make the type parameter `Sized`
+    |
+6   - struct Struct<T: ?Sized> {
+6   + struct Struct<T> {
+    |
 
 error[E0277]: the size for values of type `T` cannot be known at compilation time
-  --> $DIR/project_replace_unsized_fn_params.rs:11:8
+  --> tests/ui/pin_project/project_replace_unsized_fn_params.rs:11:8
    |
 11 | struct TupleStruct<T: ?Sized>(T);
    |        ^^^^^^^^^^^^-^^^^^^^^^
@@ -52,14 +75,19 @@
    |        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
+  --> tests/ui/pin_project/project_replace_unsized_fn_params.rs:11:8
    |
 11 | struct TupleStruct<T: ?Sized>(T);
    |        ^^^^^^^^^^^
    = note: the return type of a function must have a statically known size
+help: consider removing the `?Sized` bound to make the type parameter `Sized`
+   |
+11 - struct TupleStruct<T: ?Sized>(T);
+11 + struct TupleStruct<T>(T);
+   |
 
 error[E0277]: the size for values of type `T` cannot be known at compilation time
-   --> $DIR/project_replace_unsized_fn_params.rs:10:1
+   --> tests/ui/pin_project/project_replace_unsized_fn_params.rs:10:1
     |
 10  | #[pin_project(project_replace)] //~ ERROR E0277
     | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ doesn't have a size known at compile-time
@@ -67,13 +95,18 @@
     |                    - 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
+   --> tests/ui/pin_project/project_replace_unsized_fn_params.rs:11:8
     |
 11  | struct TupleStruct<T: ?Sized>(T);
     |        ^^^^^^^^^^^
-note: required by `UnsafeOverwriteGuard`
-   --> $DIR/lib.rs:269:5
+note: required by a bound in `UnsafeOverwriteGuard::<T>::new`
+   --> src/lib.rs
     |
-269 |     pub struct UnsafeOverwriteGuard<T> {
-    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+    |     impl<T> UnsafeOverwriteGuard<T> {
+    |          ^ required by this bound in `UnsafeOverwriteGuard::<T>::new`
     = note: this error originates in the derive macro `::pin_project::__private::__PinProjectInternalDerive` (in Nightly builds, run with -Z macro-backtrace for more info)
+help: consider removing the `?Sized` bound to make the type parameter `Sized`
+    |
+11  - struct TupleStruct<T: ?Sized>(T);
+11  + struct TupleStruct<T>(T);
+    |
diff --git a/tests/ui/pin_project/remove-attr-from-field.stderr b/tests/ui/pin_project/remove-attr-from-field.stderr
index 486bc00..697cd63 100644
--- a/tests/ui/pin_project/remove-attr-from-field.stderr
+++ b/tests/ui/pin_project/remove-attr-from-field.stderr
@@ -1,5 +1,5 @@
 error[E0308]: mismatched types
-  --> $DIR/remove-attr-from-field.rs:28:38
+  --> tests/ui/pin_project/remove-attr-from-field.rs:28:38
    |
 28 |     let _: Pin<&mut PhantomPinned> = x.f; //~ ERROR E0308
    |            -----------------------   ^^^ expected struct `Pin`, found `&mut PhantomPinned`
@@ -10,7 +10,7 @@
            found mutable reference `&mut PhantomPinned`
 
 error[E0308]: mismatched types
-  --> $DIR/remove-attr-from-field.rs:32:38
+  --> tests/ui/pin_project/remove-attr-from-field.rs:32:38
    |
 32 |     let _: Pin<&mut PhantomPinned> = x.f; //~ ERROR E0308
    |            -----------------------   ^^^ expected struct `Pin`, found `&mut PhantomPinned`
diff --git a/tests/ui/pin_project/remove-attr-from-struct.stderr b/tests/ui/pin_project/remove-attr-from-struct.stderr
index 57cf21d..1a9cd42 100644
--- a/tests/ui/pin_project/remove-attr-from-struct.stderr
+++ b/tests/ui/pin_project/remove-attr-from-struct.stderr
@@ -1,5 +1,5 @@
 error: #[pin_project] attribute has been removed
-  --> $DIR/remove-attr-from-struct.rs:22:1
+  --> tests/ui/pin_project/remove-attr-from-struct.rs:22:1
    |
 22 | #[pin_project] //~ ERROR has been removed
    | ^^^^^^^^^^^^^^
@@ -7,85 +7,101 @@
    = note: this error originates in the derive macro `::pin_project::__private::__PinProjectInternalDerive` (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
+  --> tests/ui/pin_project/remove-attr-from-struct.rs:18:7
    |
 18 |     #[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
+  --> tests/ui/pin_project/remove-attr-from-struct.rs:11:7
    |
 11 |     #[pin] //~ ERROR cannot find attribute `pin` in this scope
    |       ^^^
 
 error[E0277]: `PhantomPinned` cannot be unpinned
-  --> $DIR/remove-attr-from-struct.rs:35:5
+  --> tests/ui/pin_project/remove-attr-from-struct.rs:35:5
    |
-6  | fn is_unpin<T: Unpin>() {}
-   |                ----- required by this bound in `is_unpin`
-...
 35 |     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
+  --> tests/ui/pin_project/remove-attr-from-struct.rs:10:8
    |
 10 | struct A {
    |        ^
-
-error[E0277]: `PhantomPinned` cannot be unpinned
-  --> $DIR/remove-attr-from-struct.rs:36:5
+note: required by a bound in `is_unpin`
+  --> tests/ui/pin_project/remove-attr-from-struct.rs:6:16
    |
 6  | fn is_unpin<T: Unpin>() {}
-   |                ----- required by this bound in `is_unpin`
-...
+   |                ^^^^^ required by this bound in `is_unpin`
+
+error[E0277]: `PhantomPinned` cannot be unpinned
+  --> tests/ui/pin_project/remove-attr-from-struct.rs:36:5
+   |
 36 |     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
+  --> tests/ui/pin_project/remove-attr-from-struct.rs:17:8
    |
 17 | struct B {
    |        ^
+note: required by a bound in `is_unpin`
+  --> tests/ui/pin_project/remove-attr-from-struct.rs:6:16
+   |
+6  | fn is_unpin<T: Unpin>() {}
+   |                ^^^^^ required by this bound in `is_unpin`
 
 error[E0277]: `PhantomPinned` cannot be unpinned
-   --> $DIR/remove-attr-from-struct.rs:40:13
+   --> tests/ui/pin_project/remove-attr-from-struct.rs:40:22
     |
 40  |     let _ = Pin::new(&mut x).project(); //~ ERROR E0277,E0599
-    |             ^^^^^^^^ within `A`, the trait `Unpin` is not implemented for `PhantomPinned`
+    |             -------- ^^^^^^ within `A`, the trait `Unpin` is not implemented for `PhantomPinned`
+    |             |
+    |             required by a bound introduced by this call
     |
     = note: consider using `Box::pin`
 note: required because it appears within the type `A`
-   --> $DIR/remove-attr-from-struct.rs:10:8
+   --> tests/ui/pin_project/remove-attr-from-struct.rs:10:8
     |
 10  | struct A {
     |        ^
-note: required by `Pin::<P>::new`
+note: required by a bound in `Pin::<P>::new`
+   --> $RUST/core/src/pin.rs
+    |
+    | impl<P: Deref<Target: Unpin>> Pin<P> {
+    |                       ^^^^^ required by this bound in `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
+  --> tests/ui/pin_project/remove-attr-from-struct.rs:40:30
    |
 40 |     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
+   --> tests/ui/pin_project/remove-attr-from-struct.rs:43:22
     |
 43  |     let _ = Pin::new(&mut x).project(); //~ ERROR E0277,E0599
-    |             ^^^^^^^^ within `B`, the trait `Unpin` is not implemented for `PhantomPinned`
+    |             -------- ^^^^^^ within `B`, the trait `Unpin` is not implemented for `PhantomPinned`
+    |             |
+    |             required by a bound introduced by this call
     |
     = note: consider using `Box::pin`
 note: required because it appears within the type `B`
-   --> $DIR/remove-attr-from-struct.rs:17:8
+   --> tests/ui/pin_project/remove-attr-from-struct.rs:17:8
     |
 17  | struct B {
     |        ^
-note: required by `Pin::<P>::new`
+note: required by a bound in `Pin::<P>::new`
+   --> $RUST/core/src/pin.rs
+    |
+    | impl<P: Deref<Target: Unpin>> Pin<P> {
+    |                       ^^^^^ required by this bound in `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
+  --> tests/ui/pin_project/remove-attr-from-struct.rs:43:30
    |
 43 |     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..de8181c 100644
--- a/tests/ui/pin_project/safe_packed_borrows.rs
+++ b/tests/ui/pin_project/safe_packed_borrows.rs
@@ -19,10 +19,8 @@
 
 fn main() {
     let a = Packed { f: 1 };
-    &a.f;
     let _ = &a.f;
 
     let b = PackedN { f: 1 };
-    &b.f;
     let _ = &b.f;
 }
diff --git a/tests/ui/pin_project/safe_packed_borrows.stderr b/tests/ui/pin_project/safe_packed_borrows.stderr
index 4048eaa..f483b6d 100644
--- a/tests/ui/pin_project/safe_packed_borrows.stderr
+++ b/tests/ui/pin_project/safe_packed_borrows.stderr
@@ -1,11 +1,11 @@
 error: lint `safe_packed_borrows` has been renamed to `unaligned_references`
- --> $DIR/safe_packed_borrows.rs:2:9
+ --> tests/ui/pin_project/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`
   |
 note: the lint level is defined here
- --> $DIR/safe_packed_borrows.rs:1:9
+ --> tests/ui/pin_project/safe_packed_borrows.rs:1:9
   |
 1 | #![deny(renamed_and_removed_lints)]
   |         ^^^^^^^^^^^^^^^^^^^^^^^^^
diff --git a/tests/ui/pin_project/unaligned_references.rs b/tests/ui/pin_project/unaligned_references.rs
index 23dd71d..eaf185d 100644
--- a/tests/ui/pin_project/unaligned_references.rs
+++ b/tests/ui/pin_project/unaligned_references.rs
@@ -14,10 +14,8 @@
 
 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
index 17600de..8d5ddfc 100644
--- a/tests/ui/pin_project/unaligned_references.stderr
+++ b/tests/ui/pin_project/unaligned_references.stderr
@@ -1,44 +1,26 @@
 error: reference to packed field is unaligned
-  --> $DIR/unaligned_references.rs:17:5
+  --> tests/ui/pin_project/unaligned_references.rs:17:13
    |
-17 |     &a.f; //~ ERROR reference to packed field is unaligned
-   |     ^^^^
+17 |     let _ = &a.f; //~ ERROR reference to packed field is unaligned
+   |             ^^^^
    |
 note: the lint level is defined here
-  --> $DIR/unaligned_references.rs:1:11
+  --> tests/ui/pin_project/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)
+   = help: copy the field contents to a local variable, or replace the reference with a raw pointer and use `read_unaligned`/`write_unaligned` (loads and stores via `*p` must be properly aligned even when using raw pointers)
 
 error: reference to packed field is unaligned
-  --> $DIR/unaligned_references.rs:18:13
+  --> tests/ui/pin_project/unaligned_references.rs:20:13
    |
-18 |     let _ = &a.f; //~ ERROR reference to packed field is unaligned
+20 |     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)
-
-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)
+   = help: copy the field contents to a local variable, or replace the reference with a raw pointer and use `read_unaligned`/`write_unaligned` (loads and stores via `*p` must be properly aligned even when using raw pointers)
diff --git a/tests/ui/pin_project/unpin_sneaky.stderr b/tests/ui/pin_project/unpin_sneaky.stderr
index ab5e794..ddf700d 100644
--- a/tests/ui/pin_project/unpin_sneaky.stderr
+++ b/tests/ui/pin_project/unpin_sneaky.stderr
@@ -1,11 +1,11 @@
 error[E0412]: cannot find type `__S` in this scope
- --> $DIR/unpin_sneaky.rs:9:16
+ --> tests/ui/pin_project/unpin_sneaky.rs:9:16
   |
 9 | impl Unpin for __S {} //~ ERROR E0412,E0321
   |                ^^^ not found in this scope
 
 error[E0321]: cross-crate traits with a default impl, like `Unpin`, can only be implemented for a struct/enum type, not `[type error]`
- --> $DIR/unpin_sneaky.rs:9:1
+ --> tests/ui/pin_project/unpin_sneaky.rs:9:1
   |
 9 | impl Unpin for __S {} //~ ERROR E0412,E0321
   | ^^^^^^^^^^^^^^^^^^ can't implement cross-crate trait with a default impl for non-struct/enum type
diff --git a/tests/ui/pin_project/visibility.stderr b/tests/ui/pin_project/visibility.stderr
index a1f0423..4d1b722 100644
--- a/tests/ui/pin_project/visibility.stderr
+++ b/tests/ui/pin_project/visibility.stderr
@@ -1,39 +1,39 @@
-error[E0365]: `DProj` is private, and cannot be re-exported
-  --> $DIR/visibility.rs:15:13
+error[E0365]: `DProj` is only public within the crate, and cannot be re-exported outside
+  --> tests/ui/pin_project/visibility.rs:15:13
    |
 15 |     pub use crate::pub_::DProj; //~ ERROR E0365
-   |             ^^^^^^^^^^^^^^^^^^ re-export of private `DProj`
+   |             ^^^^^^^^^^^^^^^^^^ re-export of crate public `DProj`
    |
    = note: consider declaring type or module `DProj` with `pub`
 
-error[E0365]: `DProjRef` is private, and cannot be re-exported
-  --> $DIR/visibility.rs:17:13
+error[E0365]: `DProjRef` is only public within the crate, and cannot be re-exported outside
+  --> tests/ui/pin_project/visibility.rs:17:13
    |
 17 |     pub use crate::pub_::DProjRef; //~ ERROR E0365
-   |             ^^^^^^^^^^^^^^^^^^^^^ re-export of private `DProjRef`
+   |             ^^^^^^^^^^^^^^^^^^^^^ re-export of crate public `DProjRef`
    |
    = note: consider declaring type or module `DProjRef` with `pub`
 
-error[E0365]: `RProj` is private, and cannot be re-exported
-  --> $DIR/visibility.rs:19:13
+error[E0365]: `RProj` is only public within the crate, and cannot be re-exported outside
+  --> tests/ui/pin_project/visibility.rs:19:13
    |
 19 |     pub use crate::pub_::RProj; //~ ERROR E0365
-   |             ^^^^^^^^^^^^^^^^^^ re-export of private `RProj`
+   |             ^^^^^^^^^^^^^^^^^^ re-export of crate public `RProj`
    |
    = note: consider declaring type or module `RProj` with `pub`
 
-error[E0365]: `RProjOwn` is private, and cannot be re-exported
-  --> $DIR/visibility.rs:21:13
+error[E0365]: `RProjOwn` is only public within the crate, and cannot be re-exported outside
+  --> tests/ui/pin_project/visibility.rs:21:13
    |
 21 |     pub use crate::pub_::RProjOwn; //~ ERROR E0365
-   |             ^^^^^^^^^^^^^^^^^^^^^ re-export of private `RProjOwn`
+   |             ^^^^^^^^^^^^^^^^^^^^^ re-export of crate public `RProjOwn`
    |
    = note: consider declaring type or module `RProjOwn` with `pub`
 
-error[E0365]: `RProjRef` is private, and cannot be re-exported
-  --> $DIR/visibility.rs:23:13
+error[E0365]: `RProjRef` is only public within the crate, and cannot be re-exported outside
+  --> tests/ui/pin_project/visibility.rs:23:13
    |
 23 |     pub use crate::pub_::RProjRef; //~ ERROR E0365
-   |             ^^^^^^^^^^^^^^^^^^^^^ re-export of private `RProjRef`
+   |             ^^^^^^^^^^^^^^^^^^^^^ re-export of crate public `RProjRef`
    |
    = note: consider declaring type or module `RProjRef` with `pub`
diff --git a/tests/ui/pinned_drop/call-drop-inner.stderr b/tests/ui/pinned_drop/call-drop-inner.stderr
index 8fbe2dc..b11bee5 100644
--- a/tests/ui/pinned_drop/call-drop-inner.stderr
+++ b/tests/ui/pinned_drop/call-drop-inner.stderr
@@ -1,5 +1,5 @@
 error[E0061]: this function takes 0 arguments but 1 argument was supplied
-  --> $DIR/call-drop-inner.rs:13:9
+  --> tests/ui/pinned_drop/call-drop-inner.rs:13:9
    |
 13 |         __drop_inner(__self);
    |         ^^^^^^^^^^^^ ------ supplied 1 argument
@@ -7,7 +7,7 @@
    |         expected 0 arguments
    |
 note: function defined here
-  --> $DIR/call-drop-inner.rs:10:1
+  --> tests/ui/pinned_drop/call-drop-inner.rs:10:1
    |
 10 | #[pinned_drop]
    | ^^^^^^^^^^^^^^
diff --git a/tests/ui/pinned_drop/conditional-drop-impl.stderr b/tests/ui/pinned_drop/conditional-drop-impl.stderr
index a512578..0c55bc2 100644
--- a/tests/ui/pinned_drop/conditional-drop-impl.stderr
+++ b/tests/ui/pinned_drop/conditional-drop-impl.stderr
@@ -1,11 +1,11 @@
 error[E0367]: `Drop` impl requires `T: Unpin` but the struct it is implemented for does not
-  --> $DIR/conditional-drop-impl.rs:11:9
+  --> tests/ui/pinned_drop/conditional-drop-impl.rs:11:9
    |
 11 | impl<T: Unpin> Drop for DropImpl<T> {
    |         ^^^^^
    |
 note: the implementor must specify the same requirement
-  --> $DIR/conditional-drop-impl.rs:7:1
+  --> tests/ui/pinned_drop/conditional-drop-impl.rs:7:1
    |
 7  | / struct DropImpl<T> {
 8  | |     f: T,
@@ -13,23 +13,18 @@
    | |_^
 
 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`
+  --> tests/ui/pinned_drop/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>);
-    |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+  --> tests/ui/pinned_drop/conditional-drop-impl.rs:23:16
+   |
+23 | impl<T: Unpin> PinnedDrop for PinnedDropImpl<T> {
+   |                ^^^^^^^^^^     ^^^^^^^^^^^^^^^^^
 help: consider restricting type parameter `T`
-    |
-17  | struct PinnedDropImpl<T: std::marker::Unpin> {
-    |                        ^^^^^^^^^^^^^^^^^^^^
+   |
+17 | struct PinnedDropImpl<T: std::marker::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..ef8a7bf 100644
--- a/tests/ui/pinned_drop/forget-pinned-drop-impl.stderr
+++ b/tests/ui/pinned_drop/forget-pinned-drop-impl.stderr
@@ -1,11 +1,5 @@
 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>);
-    |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ --> tests/ui/pinned_drop/forget-pinned-drop-impl.rs:3:15
+  |
+3 | #[pin_project(PinnedDrop)] //~ ERROR E0277
+  |               ^^^^^^^^^^ the trait `PinnedDrop` is not implemented for `Struct`
diff --git a/tests/ui/pinned_drop/invalid-self.stderr b/tests/ui/pinned_drop/invalid-self.stderr
index 3248704..464be5e 100644
--- a/tests/ui/pinned_drop/invalid-self.stderr
+++ b/tests/ui/pinned_drop/invalid-self.stderr
@@ -1,23 +1,23 @@
 error: expected identifier, found keyword `self`
- --> $DIR/invalid-self.rs:8:26
+ --> tests/ui/pinned_drop/invalid-self.rs:8:26
   |
 8 |     fn take_ref_self(ref self: Pin<&mut Self>) {} //~ ERROR expected identifier, found keyword `self`
   |                          ^^^^ expected identifier, found keyword
 
 error: expected identifier, found keyword `self`
- --> $DIR/invalid-self.rs:9:34
+ --> tests/ui/pinned_drop/invalid-self.rs:9:34
   |
 9 |     fn take_ref_mut_self(ref mut self: Pin<&mut Self>) {} //~ ERROR expected identifier, found keyword `self`
   |                                  ^^^^ expected identifier, found keyword
 
 error: expected parameter name, found `@`
-  --> $DIR/invalid-self.rs:11:25
+  --> tests/ui/pinned_drop/invalid-self.rs:11:25
    |
 11 |     fn self_subpat(self @ S {}: Self) {} //~ ERROR expected one of `)`, `,`, or `:`, found `@`
    |                         ^ expected parameter name
 
 error: expected one of `)`, `,`, or `:`, found `@`
-  --> $DIR/invalid-self.rs:11:25
+  --> tests/ui/pinned_drop/invalid-self.rs:11:25
    |
 11 |     fn self_subpat(self @ S {}: Self) {} //~ ERROR expected one of `)`, `,`, or `:`, found `@`
    |                        -^ expected one of `)`, `,`, or `:`
diff --git a/tests/ui/pinned_drop/invalid.stderr b/tests/ui/pinned_drop/invalid.stderr
index 499b0d9..d509964 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
+error: unexpected token: `foo`
+ --> tests/ui/pinned_drop/invalid.rs:9:19
   |
 9 |     #[pinned_drop(foo)] //~ ERROR unexpected token
   |                   ^^^
 
 error: duplicate #[pinned_drop] attribute
-  --> $DIR/invalid.rs:30:5
+  --> tests/ui/pinned_drop/invalid.rs:30:5
    |
 30 |     #[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
+  --> tests/ui/pinned_drop/invalid.rs:43:10
    |
 43 |     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
+  --> tests/ui/pinned_drop/invalid.rs:49:10
    |
 49 |     impl InherentImpl {} //~ ERROR may only be used on implementation for the `PinnedDrop` trait
    |          ^^^^^^^^^^^^
 
 error: expected `impl`
-  --> $DIR/invalid.rs:52:5
+  --> tests/ui/pinned_drop/invalid.rs:52:5
    |
 52 |     fn func(_: Pin<&mut ()>) {} //~ ERROR expected `impl`
    |     ^^
 
 error: implementing the trait `PinnedDrop` is not unsafe
-  --> $DIR/invalid.rs:62:5
+  --> tests/ui/pinned_drop/invalid.rs:62:5
    |
 62 |     unsafe impl PinnedDrop for Impl {
    |     ^^^^^^
 
 error: implementing the method `drop` is not unsafe
-  --> $DIR/invalid.rs:72:9
+  --> tests/ui/pinned_drop/invalid.rs:72:9
    |
 72 |         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
+  --> tests/ui/pinned_drop/invalid.rs:83:5
    |
 83 |     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
+  --> tests/ui/pinned_drop/invalid.rs:90:9
    |
 90 |         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
+   --> tests/ui/pinned_drop/invalid.rs:100:9
     |
 100 |         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
+   --> tests/ui/pinned_drop/invalid.rs:108:9
     |
 108 |         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
+   --> tests/ui/pinned_drop/invalid.rs:118:9
     |
 118 |         type A = u8; //~ ERROR type `A` is not a member of trait `PinnedDrop`
     |         ^^^^^^^^^^^^
 
 error: duplicate definitions with name `drop`
-   --> $DIR/invalid.rs:127:9
+   --> tests/ui/pinned_drop/invalid.rs:127:9
     |
 127 |         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
+   --> tests/ui/pinned_drop/invalid.rs:149:42
     |
 149 |         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
+   --> tests/ui/pinned_drop/invalid.rs:157:16
     |
 157 |         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
+   --> tests/ui/pinned_drop/invalid.rs:165:17
     |
 165 |         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
+   --> tests/ui/pinned_drop/invalid.rs:173:17
     |
 173 |         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
+   --> tests/ui/pinned_drop/invalid.rs:181:17
     |
 181 |         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
+   --> tests/ui/pinned_drop/invalid.rs:189:17
     |
 189 |         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
+   --> tests/ui/pinned_drop/invalid.rs:197:17
     |
 197 |         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
+   --> tests/ui/pinned_drop/invalid.rs:205:12
     |
 205 |         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
+   --> tests/ui/pinned_drop/invalid.rs:213:25
     |
 213 |     impl PinnedDrop for () {
     |                         ^^
 
 error: implementing the trait `PinnedDrop` on this type is unsupported
-   --> $DIR/invalid.rs:219:25
+   --> tests/ui/pinned_drop/invalid.rs:219:25
     |
 219 |     impl PinnedDrop for &mut A {
     |                         ^^^^^^
 
 error: implementing the trait `PinnedDrop` on this type is unsupported
-   --> $DIR/invalid.rs:225:25
+   --> tests/ui/pinned_drop/invalid.rs:225:25
     |
 225 |     impl PinnedDrop for [A] {
     |                         ^^^
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..2542254 100644
--- a/tests/ui/pinned_drop/pinned-drop-no-attr-arg.stderr
+++ b/tests/ui/pinned_drop/pinned-drop-no-attr-arg.stderr
@@ -1,5 +1,5 @@
-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`
+  --> tests/ui/pinned_drop/pinned-drop-no-attr-arg.rs:12:1
    |
 5  | #[pin_project]
    | -------------- first implementation here
diff --git a/tests/ui/pinned_drop/self.stderr b/tests/ui/pinned_drop/self.stderr
index 7de286f..0f96dc9 100644
--- a/tests/ui/pinned_drop/self.stderr
+++ b/tests/ui/pinned_drop/self.stderr
@@ -1,29 +1,29 @@
 error: `self` parameter is only allowed in associated functions
-  --> $DIR/self.rs:18:26
+  --> tests/ui/pinned_drop/self.rs:18:26
    |
 18 |                     fn f(self: ()) {} //~ ERROR `self` parameter is only allowed in associated functions
    |                          ^^^^ not semantically valid as function parameter
 ...
 21 |             t!();
-   |             ----- in this macro invocation
+   |             ---- 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)
 
 error[E0434]: can't capture dynamic environment in a fn item
-  --> $DIR/self.rs:16:29
+  --> tests/ui/pinned_drop/self.rs:16:29
    |
 16 |                     let _ = self; //~ ERROR E0434
    |                             ^^^^
 ...
 21 |             t!();
-   |             ----- in this macro invocation
+   |             ---- 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)
 
 error[E0423]: expected value, found struct `S`
-  --> $DIR/self.rs:40:27
+  --> tests/ui/pinned_drop/self.rs:40:27
    |
 32 | /     pub struct S {
 33 | |         f: (),
@@ -34,7 +34,7 @@
    |                             ^^^^ help: use struct literal syntax instead: `S { f: val }`
 
 error[E0308]: mismatched types
-  --> $DIR/self.rs:39:25
+  --> tests/ui/pinned_drop/self.rs:39:25
    |
 39 |             let _: () = self; //~ ERROR E0308
    |                    --   ^^^^ expected `()`, found struct `Pin`
@@ -45,7 +45,7 @@
                  found struct `Pin<&mut self_span::S>`
 
 error[E0308]: mismatched types
-  --> $DIR/self.rs:52:25
+  --> tests/ui/pinned_drop/self.rs:52:25
    |
 52 |             let _: () = self; //~ ERROR E0308
    |                    --   ^^^^ expected `()`, found struct `Pin`
@@ -56,7 +56,7 @@
                  found struct `Pin<&mut E>`
 
 error[E0533]: expected unit struct, unit variant or constant, found struct variant `Self::V`
-  --> $DIR/self.rs:53:27
+  --> tests/ui/pinned_drop/self.rs:53:27
    |
 53 |             let _: Self = Self::V; //~ ERROR E0533
    |                           ^^^^^^^
diff --git a/tests/ui/pinned_drop/unsafe-call.stderr b/tests/ui/pinned_drop/unsafe-call.stderr
index 6216200..9f7dd44 100644
--- a/tests/ui/pinned_drop/unsafe-call.stderr
+++ b/tests/ui/pinned_drop/unsafe-call.stderr
@@ -1,5 +1,5 @@
 error[E0133]: call to unsafe function is unsafe and requires unsafe function or block
-  --> $DIR/unsafe-call.rs:14:9
+  --> tests/ui/pinned_drop/unsafe-call.rs:14:9
    |
 14 |         self.project().f.get_unchecked_mut(); //~ ERROR call to unsafe function is unsafe and requires unsafe function or block [E0133]
    |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ call to unsafe function
diff --git a/tests/ui/unsafe_unpin/conflict-unpin.stderr b/tests/ui/unsafe_unpin/conflict-unpin.stderr
index 078ac71..20d4e08 100644
--- a/tests/ui/unsafe_unpin/conflict-unpin.stderr
+++ b/tests/ui/unsafe_unpin/conflict-unpin.stderr
@@ -1,5 +1,5 @@
 error[E0119]: conflicting implementations of trait `std::marker::Unpin` for type `Foo<_, _>`
-  --> $DIR/conflict-unpin.rs:3:15
+  --> tests/ui/unsafe_unpin/conflict-unpin.rs:3:15
    |
 3  | #[pin_project(UnsafeUnpin)] //~ ERROR E0119
    |               ^^^^^^^^^^^ conflicting implementation for `Foo<_, _>`
@@ -7,10 +7,10 @@
 10 | impl<T, U> Unpin for Foo<T, U> where T: Unpin {}
    | --------------------------------------------- first implementation here
    |
-   = note: upstream crates may add a new impl of trait `pin_project::UnsafeUnpin` for type `pin_project::__private::Wrapper<'_, Foo<_, _>>` in future versions
+   = 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<_, _>`
-  --> $DIR/conflict-unpin.rs:12:15
+  --> tests/ui/unsafe_unpin/conflict-unpin.rs:12:15
    |
 12 | #[pin_project(UnsafeUnpin)] //~ ERROR E0119
    |               ^^^^^^^^^^^ conflicting implementation for `Bar<_, _>`
@@ -18,10 +18,10 @@
 19 | impl<T, U> Unpin for Bar<T, U> {}
    | ------------------------------ first implementation here
    |
-   = note: upstream crates may add a new impl of trait `pin_project::UnsafeUnpin` for type `pin_project::__private::Wrapper<'_, Bar<_, _>>` in future versions
+   = 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<_, _>`
-  --> $DIR/conflict-unpin.rs:21:15
+  --> tests/ui/unsafe_unpin/conflict-unpin.rs:21:15
    |
 21 | #[pin_project(UnsafeUnpin)] //~ ERROR E0119
    |               ^^^^^^^^^^^ conflicting implementation for `Baz<_, _>`
@@ -29,4 +29,4 @@
 28 | impl<T: Unpin, U: Unpin> Unpin for Baz<T, U> {}
    | -------------------------------------------- first implementation here
    |
-   = note: upstream crates may add a new impl of trait `pin_project::UnsafeUnpin` for type `pin_project::__private::Wrapper<'_, Baz<_, _>>` in future versions
+   = note: upstream crates may add a new impl of trait `_::_pin_project::UnsafeUnpin` for type `_::_pin_project::__private::Wrapper<'_, Baz<_, _>>` in future versions
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..3412f2e 100644
--- a/tests/ui/unstable-features/marker_trait_attr-feature-gate.stderr
+++ b/tests/ui/unstable-features/marker_trait_attr-feature-gate.stderr
@@ -1,5 +1,5 @@
 error[E0119]: conflicting implementations of trait `std::marker::Unpin` for type `Struct<_>`
-  --> $DIR/marker_trait_attr-feature-gate.rs:7:1
+  --> tests/ui/unstable-features/marker_trait_attr-feature-gate.rs:7:1
    |
 7  | #[pin_project] //~ ERROR E0119
    | ^^^^^^^^^^^^^^ conflicting implementation for `Struct<_>`
diff --git a/tests/ui/unstable-features/marker_trait_attr.stderr b/tests/ui/unstable-features/marker_trait_attr.stderr
index fbc2d9d..2b68c80 100644
--- a/tests/ui/unstable-features/marker_trait_attr.stderr
+++ b/tests/ui/unstable-features/marker_trait_attr.stderr
@@ -1,5 +1,5 @@
 error[E0119]: conflicting implementations of trait `std::marker::Unpin` for type `Struct<_>`
-  --> $DIR/marker_trait_attr.rs:13:1
+  --> tests/ui/unstable-features/marker_trait_attr.rs:13:1
    |
 13 | #[pin_project] //~ ERROR E0119
    | ^^^^^^^^^^^^^^ conflicting implementation for `Struct<_>`
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..918d804 100644
--- a/tests/ui/unstable-features/overlapping_marker_traits-feature-gate.stderr
+++ b/tests/ui/unstable-features/overlapping_marker_traits-feature-gate.stderr
@@ -1,5 +1,5 @@
 error[E0119]: conflicting implementations of trait `std::marker::Unpin` for type `Struct<_>`
-  --> $DIR/overlapping_marker_traits-feature-gate.rs:7:1
+  --> tests/ui/unstable-features/overlapping_marker_traits-feature-gate.rs:7:1
    |
 7  | #[pin_project] //~ ERROR E0119
    | ^^^^^^^^^^^^^^ conflicting implementation for `Struct<_>`
diff --git a/tests/ui/unstable-features/overlapping_marker_traits.stderr b/tests/ui/unstable-features/overlapping_marker_traits.stderr
index 706d6c9..3e8411d 100644
--- a/tests/ui/unstable-features/overlapping_marker_traits.stderr
+++ b/tests/ui/unstable-features/overlapping_marker_traits.stderr
@@ -1,5 +1,5 @@
 error[E0557]: feature has been removed
-  --> $DIR/overlapping_marker_traits.rs:11:12
+  --> tests/ui/unstable-features/overlapping_marker_traits.rs:11:12
    |
 11 | #![feature(overlapping_marker_traits)]
    |            ^^^^^^^^^^^^^^^^^^^^^^^^^ feature has been removed
@@ -7,7 +7,7 @@
    = 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
+  --> tests/ui/unstable-features/overlapping_marker_traits.rs:17:1
    |
 17 | #[pin_project]
    | ^^^^^^^^^^^^^^ conflicting implementation for `Struct<_>`
diff --git a/tests/ui/unstable-features/trivial_bounds-bug.rs b/tests/ui/unstable-features/trivial_bounds-bug.rs
deleted file mode 100644
index 5e821c4..0000000
--- a/tests/ui/unstable-features/trivial_bounds-bug.rs
+++ /dev/null
@@ -1,33 +0,0 @@
-// Note: If you change this test, change 'trivial_bounds-feature-gate.rs' at the same time.
-
-// trivial_bounds
-// Tracking issue: https://github.com/rust-lang/rust/issues/48214
-#![feature(trivial_bounds)]
-
-mod phantom_pinned {
-    use std::marker::{PhantomData, PhantomPinned};
-
-    struct A(PhantomPinned);
-
-    // bug of trivial_bounds?
-    impl Unpin for A where PhantomPinned: Unpin {} //~ ERROR E0277
-
-    struct Wrapper<T>(T);
-
-    impl<T> Unpin for Wrapper<T> where T: Unpin {}
-
-    struct B(PhantomPinned);
-
-    impl Unpin for B where Wrapper<PhantomPinned>: Unpin {} // Ok
-
-    struct WrapperWithLifetime<'a, T>(PhantomData<&'a ()>, T);
-
-    impl<T> Unpin for WrapperWithLifetime<'_, T> where T: Unpin {}
-
-    struct C(PhantomPinned);
-
-    // Ok
-    impl<'a> Unpin for C where WrapperWithLifetime<'a, PhantomPinned>: Unpin {}
-}
-
-fn main() {}
diff --git a/tests/ui/unstable-features/trivial_bounds-bug.stderr b/tests/ui/unstable-features/trivial_bounds-bug.stderr
deleted file mode 100644
index f2407d0..0000000
--- a/tests/ui/unstable-features/trivial_bounds-bug.stderr
+++ /dev/null
@@ -1,7 +0,0 @@
-error[E0277]: `PhantomPinned` cannot be unpinned
-   --> $DIR/trivial_bounds-bug.rs:13:43
-    |
-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..2e31658 100644
--- a/tests/ui/unstable-features/trivial_bounds-feature-gate.stderr
+++ b/tests/ui/unstable-features/trivial_bounds-feature-gate.stderr
@@ -1,30 +1,22 @@
 error[E0277]: `PhantomPinned` cannot be unpinned
- --> $DIR/trivial_bounds-feature-gate.rs:8:5
+ --> tests/ui/unstable-features/trivial_bounds-feature-gate.rs:8:28
   |
 8 |     impl Unpin for A where PhantomPinned: Unpin {} //~ ERROR E0277
-  |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `Unpin` is not implemented for `PhantomPinned`
+  |                            ^^^^^^^^^^^^^^^^^^^^ 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
 
 error[E0277]: `PhantomPinned` cannot be unpinned
-   --> $DIR/trivial_bounds-feature-gate.rs:8:43
-    |
-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
+  --> tests/ui/unstable-features/trivial_bounds-feature-gate.rs:16:28
    |
 16 |     impl Unpin for B where Wrapper<PhantomPinned>: Unpin {} //~ ERROR E0277
-   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `Unpin` is not implemented for `PhantomPinned`
+   |                            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 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
+  --> tests/ui/unstable-features/trivial_bounds-feature-gate.rs:12:13
    |
 12 |     impl<T> Unpin for Wrapper<T> where T: Unpin {}
    |             ^^^^^     ^^^^^^^^^^
@@ -32,14 +24,14 @@
    = help: add `#![feature(trivial_bounds)]` to the crate attributes to enable
 
 error[E0277]: `PhantomPinned` cannot be unpinned
-  --> $DIR/trivial_bounds-feature-gate.rs:34:5
+  --> tests/ui/unstable-features/trivial_bounds-feature-gate.rs:34:28
    |
 34 |     impl Unpin for A where Inner: Unpin {} //~ ERROR E0277
-   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ within `Inner`, the trait `Unpin` is not implemented for `PhantomPinned`
+   |                            ^^^^^^^^^^^^ 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
+  --> tests/ui/unstable-features/trivial_bounds-feature-gate.rs:30:12
    |
 30 |     struct Inner(PhantomPinned);
    |            ^^^^^
@@ -47,19 +39,19 @@
    = help: add `#![feature(trivial_bounds)]` to the crate attributes to enable
 
 error[E0277]: `PhantomPinned` cannot be unpinned
-  --> $DIR/trivial_bounds-feature-gate.rs:42:5
+  --> tests/ui/unstable-features/trivial_bounds-feature-gate.rs:42:28
    |
 42 |     impl Unpin for B where Wrapper<Inner>: Unpin {} //~ ERROR E0277
-   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ within `Inner`, the trait `Unpin` is not implemented for `PhantomPinned`
+   |                            ^^^^^^^^^^^^^^^^^^^^^ 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
+  --> tests/ui/unstable-features/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
+  --> tests/ui/unstable-features/trivial_bounds-feature-gate.rs:38:13
    |
 38 |     impl<T> Unpin for Wrapper<T> where T: Unpin {}
    |             ^^^^^     ^^^^^^^^^^
diff --git a/tests/ui/unstable-features/trivial_bounds.rs b/tests/ui/unstable-features/trivial_bounds.rs
index 2323bab..41f885d 100644
--- a/tests/ui/unstable-features/trivial_bounds.rs
+++ b/tests/ui/unstable-features/trivial_bounds.rs
@@ -10,25 +10,29 @@
 fn inner() {
     struct Inner(PhantomPinned);
 
-    struct A(Inner);
+    struct A(PhantomPinned);
 
-    impl Unpin for A where Inner: Unpin {} //~ ERROR std::marker::Unpin does not depend on any type or lifetime parameters
+    impl Unpin for A where PhantomPinned: Unpin {} //~ ERROR Unpin does not depend on any type or lifetime parameters
+
+    struct B(Inner);
+
+    impl Unpin for B where Inner: Unpin {} //~ ERROR Unpin does not depend on any type or lifetime parameters
 
     struct Wrapper<T>(T);
 
     impl<T> Unpin for Wrapper<T> where T: Unpin {}
 
-    struct B(Inner);
+    struct C(Inner);
 
-    impl Unpin for B where Wrapper<Inner>: Unpin {} //~ ERROR std::marker::Unpin does not depend on any type or lifetime parameters
+    impl Unpin for C where Wrapper<Inner>: Unpin {} //~ ERROR Unpin does not depend on any type or lifetime parameters
 
     struct WrapperWithLifetime<'a, T>(PhantomData<&'a ()>, T);
 
     impl<T> Unpin for WrapperWithLifetime<'_, T> where T: Unpin {}
 
-    struct C(Inner);
+    struct D(Inner);
 
-    impl<'a> Unpin for C where WrapperWithLifetime<'a, Inner>: Unpin {} // Ok
+    impl<'a> Unpin for D where WrapperWithLifetime<'a, Inner>: Unpin {} // Ok
 }
 
 fn main() {}
diff --git a/tests/ui/unstable-features/trivial_bounds.stderr b/tests/ui/unstable-features/trivial_bounds.stderr
index 6a3bb94..23f45c7 100644
--- a/tests/ui/unstable-features/trivial_bounds.stderr
+++ b/tests/ui/unstable-features/trivial_bounds.stderr
@@ -1,17 +1,23 @@
-error: Trait bound Inner: Unpin does not depend on any type or lifetime parameters
-  --> $DIR/trivial_bounds.rs:15:35
+error: trait bound PhantomPinned: Unpin does not depend on any type or lifetime parameters
+  --> tests/ui/unstable-features/trivial_bounds.rs:15:43
    |
-15 |     impl Unpin for A where Inner: Unpin {} //~ ERROR std::marker::Unpin does not depend on any type or lifetime parameters
-   |                                   ^^^^^
+15 |     impl Unpin for A where PhantomPinned: Unpin {} //~ ERROR Unpin does not depend on any type or lifetime parameters
+   |                                           ^^^^^
    |
 note: the lint level is defined here
-  --> $DIR/trivial_bounds.rs:6:9
+  --> tests/ui/unstable-features/trivial_bounds.rs:6:9
    |
 6  | #![deny(trivial_bounds)]
    |         ^^^^^^^^^^^^^^
 
-error: Trait bound Wrapper<Inner>: Unpin does not depend on any type or lifetime parameters
-  --> $DIR/trivial_bounds.rs:23:44
+error: trait bound Inner: Unpin does not depend on any type or lifetime parameters
+  --> tests/ui/unstable-features/trivial_bounds.rs:19:35
    |
-23 |     impl Unpin for B where Wrapper<Inner>: Unpin {} //~ ERROR std::marker::Unpin does not depend on any type or lifetime parameters
+19 |     impl Unpin for B where Inner: Unpin {} //~ ERROR Unpin does not depend on any type or lifetime parameters
+   |                                   ^^^^^
+
+error: trait bound Wrapper<Inner>: Unpin does not depend on any type or lifetime parameters
+  --> tests/ui/unstable-features/trivial_bounds.rs:27:44
+   |
+27 |     impl Unpin for C where Wrapper<Inner>: Unpin {} //~ ERROR Unpin does not depend on any type or lifetime parameters
    |                                            ^^^^^