Update pin-project-lite to 0.2.15
Test: m
Change-Id: Ia878d1004249c241eb77cf580d8ce3e8b0f3d70d
diff --git a/crates/pin-project-lite/.android-checksum.json b/crates/pin-project-lite/.android-checksum.json
new file mode 100644
index 0000000..04c0fec
--- /dev/null
+++ b/crates/pin-project-lite/.android-checksum.json
@@ -0,0 +1 @@
+{"package":null,"files":{"tests/ui/pin_project/invalid.stderr":"0eabecbd93628b7db7bdaa093ac583f544b9d6775562d704859804a87594b102","tests/ui/pin_project/conflict-drop.stderr":"d07fe5978baced640d867d9ee5180d87e772f8dd784c550697e0aff5532cb756","Android.bp":"10a84b518dcfa172f94a9f14c67838754d072501894d67b499ad3c119b89eb1c","tests/expand/naming/enum-none.expanded.rs":"80f89ac4178910e2a248106808c5ddbe8541d9cf52baca41f8fb31eec03a81d4","tests/include/basic.rs":"42f25555c556af51a73dbc7177478f5794de468ed5f3338ee89fbc68f3f1e0ec","tests/expand/multifields/enum.expanded.rs":"ee283cc26483792e365b597e5feffe0606599bf0cd35375472234b7ebea5ff47","tests/ui/pin_project/unsupported.stderr":"55e7cd3eeeddd80bb17e550b687ed9b305195e4302e7f4a52c6d1c4291b61438","tests/expand/default/enum.expanded.rs":"2c9fc23eb9ad1f1c832643c2efe7d0532b85888eaba3b1f69cfe605ae3301a6c","tests/ui/pin_project/overlapping_unpin_struct.stderr":"906a3342f3637f128f6113d0a4f61533d26d961e4eb8bb1f48e67dcb39cc2b6e","tests/expand/not_unpin/enum.rs":"191352cd03e7a532be4639d28eb4e0a5a73865ce923e1c0a21401cb4a4c55c1b",".cargo-checksum.json":"edeedfad6ff89efdb853f8676d1d3f453524ecd80e59e2b7d480d7103d24ca7d","tests/ui/pin_project/unsupported.rs":"7d5c54f06ba524bbedcd94f1507f173f8bcf30126904b5e3dd495098a2df3170","tests/expand/pub/enum.rs":"1bafd1b6c800def9c7b1c0efb57f2aefb8305192324d5314594c53110dfbe7fd","src/lib.rs":"58000cb827913425da7ee226aebc645861b48ddcafb4d9b5f10a69e0b6b856e9","tests/ui/pin_project/packed.stderr":"3dbc000b874047c948b95e6994264556a8e6380c0dbbef7342ebb49dc3c74386","tests/expand/naming/enum-all.expanded.rs":"2c9fc23eb9ad1f1c832643c2efe7d0532b85888eaba3b1f69cfe605ae3301a6c","tests/expand/naming/struct-all.rs":"940e60e1b9a35e4cae29d143fc258794a0eaffd25066be823fc2916756c18ee7","tests/ui/pin_project/conflict-drop.rs":"bbb43d4661d07c788e20415fa1f692f30e3d21d20a21dd5b41c616d5e94417d5","tests/expand/pinned_drop/enum.expanded.rs":"14823c89cb39bad0342a814151688f9ae44e6d20da704bdf9844d15f6b2ce233","tests/ui/pin_project/overlapping_unpin_struct.rs":"ca3f206c0375a1007f2e5adcb3e9f62b0b5681db503f2edaf3ca95f97874638c","TEST_MAPPING":"3a59053b725fc10646541d412127125a53c7b78e607a733de7034b9dd0dd2dcf","tests/expand/naming/struct-ref.rs":"d1294ae61b439b0b3aadb0b40528b8d9f94881a30539b68234b80df5e51d64a7","tests/expand/naming/enum-mut.expanded.rs":"86f444d7e8ebf87067de4eb065e79d03eb8401b0a84c09da62541c68be82b21a","tests/expand/pinned_drop/struct.rs":"446abeed04cf533c8ca8bd2caa9647f443874cdd2ed86bf125c2c67aeb349a3f","tests/compiletest.rs":"5d782c030d298dfcb7f94c9df2549dcc54df4ef1a1bd8be034c767d13ac31310","tests/ui/pinned_drop/conditional-drop-impl.stderr":"80ef024c48aee4f1d1c7adbd8b495689038a069176341143cd7dae77416288e3","tests/ui/pin_project/overlapping_lifetime_names.rs":"e982b3522ff740554d652aea18f243541ba96197fa6258dbcead296c7af36064","tests/drop_order.rs":"0b6c5232c99aee274d18cc00f0f4688cd962f28ba9f2463fe1353c0ca0c1e358","tests/expand/not_unpin/struct.rs":"fad586a4a105b64375127f6dfcdee8026795112d8dfcbcdb496930e78bf7e22a","tests/ui/pinned_drop/conditional-drop-impl.rs":"aa8516686209f3e2cdefe2790f76fa96b4366ee827377a3c6a8273756b0ffd53","tests/ui/pin_project/invalid-bounds.stderr":"1ae0967a7c1399047b92062c68f72b82d5cb758a3dc9050e70fbcae6f7d660d5","tests/ui/pin_project/negative_impls_stable.stderr":"6a32ebaffb04a8baf4b9115750b6a629db3c7b714afdb56a8cd348165db7a5e5","tests/expand/naming/struct-mut.expanded.rs":"0dda121cd3be2bf035041ac3360a2498a81f6c7f420f3f1218c7e56b57c633f8","LICENSE":"83ecae571fc46eed7fa5cfb5e930b6b1dd0a6d79c24912fecacc955318987b3d","tests/proper_unpin.rs":"88ea8e48fe02b1f0a0feef5e22b1c66d5aa357ec5fdef6c64ef63333668cec00","tests/expand/default/enum.rs":"9e6341518300a75d3fab84009f989c844c10b2ec9410909c2515a9a89bc0a2bc","tests/ui/pin_project/invalid-bounds.rs":"1f11784a3e7a1a09d7a1e661fe52869f26e59bdd0955f57753f7faaaa0253cef","tests/ui/pin_project/negative_impls_stable.rs":"c885486321b2597dd4ce6b081b6a5223c5792e4b0b9005ece326f416b4c43124","tests/expand/naming/struct-none.expanded.rs":"5ea9628c5ec0ed5f0258213d68297b16a1a8bc1fe326b010f5228abd86bf6c57","tests/ui/pin_project/conflict-unpin.stderr":"bc050d2c91992c82bd07146e1554c3ab988c209207d24e98557b0fd048c5dea4","tests/expand/naming/enum-none.rs":"ed209be3443497c3d6e47726ca24253aa91ae1907ff0a8bdcce75a34bd5b0777","tests/expand/pub/struct.rs":"343fa27a94ed011fc26bd97ae7a4b673b2f5a8fb560ebec1bf66847cf9906eb9","tests/expand/not_unpin/enum.expanded.rs":"355387fca8ef817a736f4a86a8b048e42bf96fe28aad071fb48caec980233e3d","tests/ui/pinned_drop/call-drop-inner.rs":"b98e2df3523acb40dc2e0ab0b6b114b71c48f5b65e481f8e82af0efe272ae376","tests/ui/pin_project/conflict-unpin.rs":"29556f97618552512cf8f96000a533593c2d8a7aba0b1db43a1fb0a475e5e235","LICENSE-APACHE":"83ecae571fc46eed7fa5cfb5e930b6b1dd0a6d79c24912fecacc955318987b3d","tests/expand/naming/enum-ref.expanded.rs":"c7be5ec61f8289729788429d17b19734d792b5db2aa46a6ab2fefe82e6c3d1d1","tests/expand/naming/struct-none.rs":"1301d6c330c6591f867c8064822894bc5d48ad39fdce4638c6a15e4d08c37fc1","tests/expand/default/struct.expanded.rs":"5ea9628c5ec0ed5f0258213d68297b16a1a8bc1fe326b010f5228abd86bf6c57","CHANGELOG.md":"861a56232aa2aae47637e440b7242738b5dc906f35b56a14a2d56482afabc0a9","tests/ui/pin_project/unpin_sneaky.rs":"64837c6f6018fe1e21732942481ee601d1c609d68ac486f557327466c7de860c","tests/expand/naming/struct-all.expanded.rs":"c63c1b03dd9fefd3146ceca1b9ac3a87f2a244ca22747c8953a47d7c5b78a9b0","tests/expand/multifields/struct.rs":"992dcf6b86157cea1f1bac72e5dd285b70d841046fc09b98ef32843af9baffb3","tests/ui/pin_project/unpin_sneaky.stderr":"9215699280f8e54adfd35e94fd4b2dddeed0a40f960a248d9a7a59d18c0c8d78","tests/ui/pin_project/invalid.rs":"52458fe9d97a19b37503374a2cdc048391e3cf22a2296b32e26dc103ea916c5d","tests/expandtest.rs":"887e324f6173b55f2ef70105aced9dedaf68888a7025f6375742dbc8640e9a86","METADATA":"9efad21e8e8e28a1009bdb593c0fef66cf21ce4a412e1ce1959f34258de4b5f2","tests/expand/naming/enum-ref.rs":"1ab02ef239b5162eb830d2dec5d16ff4f95cbb688f237f9b8c36c89adb99fba4","tests/expand/naming/struct-ref.expanded.rs":"0e1f9e3108fb25e971926a7d3360f62259ca286de8f2bd514d19518640045c31","tests/expand/pub/enum.expanded.rs":"9fb953bddfbad4d4e7013d5005dd95cbb84eda817cbc6c95d6da28fdb90c0872","tests/test.rs":"72c3cda31bb40d987cb44736eb721d0371dca0c77e0128894924ed89467f63b7","MODULE_LICENSE_APACHE2":"0d6f8afa3940b7f06bebee651376d43bc8b0d5b437337be2696d30377451e93a","tests/ui/pin_project/overlapping_lifetime_names.stderr":"64dec85f37923d2c2fbbebd4a7e56f79d5c7dc4d551daeaf451d3805c19eed9b","tests/expand/multifields/struct.expanded.rs":"04784b6a22463fa22a8c41e0cdfbef203c68bd412e7f149859db532553a89234","tests/expand/default/struct.rs":"1301d6c330c6591f867c8064822894bc5d48ad39fdce4638c6a15e4d08c37fc1","tests/expand/pub/struct.expanded.rs":"cd736caa5c3abc0d36c1a569c8dcc54d9ac1ebccfc354cff909dcb7458737dca","tests/expand/pinned_drop/struct.expanded.rs":"99f48024333fde1b202d1bb29b663c205bd6310d854335fba6a63d0e4e91df07","patches/std.diff":"f7e2db60742438892d4fe53cef1044d3340ab49e6e96a25832d8a9f5c6e8964c","tests/expand/naming/enum-all.rs":"9e6341518300a75d3fab84009f989c844c10b2ec9410909c2515a9a89bc0a2bc","tests/expand/pinned_drop/enum.rs":"378fa2c60f3e4f76354641e005a7d85d76a966a4d6ab456ed14463c57680a0f4","Cargo.toml":"1ce4634d64a20710602e4e66f6b3a009292646bef72221f395ee2cd60329aad4","tests/expand/naming/struct-mut.rs":"9e5cbf70ab0e7ad1682dc971b528fb3bc96b45b3086392842a2cf2d78ffecba2","cargo_embargo.json":"1c412d446965f40b1f2eb1d39291bb0e0732cc3b9c5fb36737f432d930e23c6e","LICENSE-MIT":"38620a3cfaeec97a9197e8c39e436ea7f0bc86699b1f1c35f1aa41785b6d4eac","tests/expand/not_unpin/struct.expanded.rs":"d7465185c3328affcef459a6b6edbac5319a7d3c21f24ec104bb65290ad643b3","README.md":"615f1135d0a22ad0204fcb44f36e4bd0f4200ac6f1b1c16d09586057058dc486","tests/expand/naming/enum-mut.rs":"15bd5b05ab4abea3e9c58d3c97eadfff3e2f336658c8c8d7bfed29bb6cb17027","tests/auxiliary/mod.rs":"b9123395fed2c3dadfa0305d42345a4bcb9cb67d3dfe9cbde23b381341829378","tests/ui/pinned_drop/call-drop-inner.stderr":"8a65e819f3d0f2d4b2b467bfb7473b4ccace15d34f69f4cc1d5e4cb82df9c3cc","tests/expand/multifields/enum.rs":"7c4961b7f7ee7e8424e2e70374984b0559664f9f3212bcb05696c3bacdf539a2","tests/ui/pin_project/packed.rs":"de3d2400582c3f9a605cdbbc6af4bf8ce24de6e4d0e91ffe0c202747df84d9c0"}}
\ No newline at end of file
diff --git a/crates/pin-project-lite/.cargo-checksum.json b/crates/pin-project-lite/.cargo-checksum.json
index f13fc41..12a71fb 100644
--- a/crates/pin-project-lite/.cargo-checksum.json
+++ b/crates/pin-project-lite/.cargo-checksum.json
@@ -1 +1 @@
-{"files":{"CHANGELOG.md":"8746b4b5d094fb8998c411987f4145ece4b11107d1eab24fce3f8075f1d3dbb5","Cargo.toml":"39e8ac3108dc0099ea98f012927dba1eb4b93220f23e3366896bb2fa2f66870d","LICENSE-APACHE":"0d542e0c8804e39aa7f37eb00da5a762149dc682d7829451287e11b938e94594","LICENSE-MIT":"23f18e03dc49df91622fe2a76176497404e46ced8a715d9d2b67a7446571cca3","README.md":"84c64307110253c7348fb56e22ff36460b4b0c797fc931dbb748bef6921a8009","src/lib.rs":"94c2eb6f58fea1ecba2ada4c8e6d7a62f9ee54e0844200c5d6609549c896e8b5","tests/auxiliary/mod.rs":"7e263e987e09b77e384f734384a00a71c5b70230bb1b5376446ef003a8da9372","tests/compiletest.rs":"af34ced23541134e26259a52cae588520c7111e98bff59e0c2e2d73faf43ca3f","tests/drop_order.rs":"2cb31a8cd5cf4d9a4ba9faf25f99f0e85f9bd7b4778649f843d9c617c6af43fc","tests/expand/default/enum.expanded.rs":"7944e0ff3a49ef1bccff5681a32a0b306c5eaa7a5f4838132eca8e9a62d40722","tests/expand/default/enum.rs":"493d5752c4baa87ed4c48bd41b8e5e263fd5e3f43c4f9195818ef6d26951f63e","tests/expand/default/struct.expanded.rs":"c0a2a411462f2570340e095963c277da229f7b7dcbe661512ac5f051478d5905","tests/expand/default/struct.rs":"5a6e57d9b6d00cfd4e1e69f37ce0c9d5165a21230d0363f0791665b1015870ce","tests/expand/multifields/enum.expanded.rs":"fc3a86d536060cbd1aa58a2e565d00033f677c0e02f1dd1ee6e30e8379b152fe","tests/expand/multifields/enum.rs":"9c79270a7d6d1d42cf8194b579d79e7d44a3fd003243742f0a568ecf0a4f3be3","tests/expand/multifields/struct.expanded.rs":"cf2dd15e6a0a66afcb8c5d7fef235964a4326c91732de65597f880285fdffe2a","tests/expand/multifields/struct.rs":"17f0447d522d48f14d516808bd66baacebdf3ac38188df72f649702a893cda68","tests/expand/naming/enum-all.expanded.rs":"7944e0ff3a49ef1bccff5681a32a0b306c5eaa7a5f4838132eca8e9a62d40722","tests/expand/naming/enum-all.rs":"493d5752c4baa87ed4c48bd41b8e5e263fd5e3f43c4f9195818ef6d26951f63e","tests/expand/naming/enum-mut.expanded.rs":"49bd8b7e0a469823e1e7d4dbfcb7108ef5db16844ef7d4686cb6600768123877","tests/expand/naming/enum-mut.rs":"c1ff4ade049ebbceb2acb99dbc1af5db14de3ba9710ea1ff1b64348766a9e080","tests/expand/naming/enum-none.expanded.rs":"dbac25a5370153bad9165346c49f831d051b22f0c40bc4d81aa1dd44346d04cc","tests/expand/naming/enum-none.rs":"ff22be4ecf4168e2bc68ab249a0ed809a37e3b8e840ef8977d24209ef28ac839","tests/expand/naming/enum-ref.expanded.rs":"ec4dedf4618e6b9dc4e98a2846b769dc5c9ad9eb51cb645ebfcca09c9ec9458f","tests/expand/naming/enum-ref.rs":"394cbd5d872449e9226cd0834ce7117c395a582567584218dabbef4eb2c1fbac","tests/expand/naming/struct-all.expanded.rs":"1573eb22f4f68b2d2621a5b3d4bda0edfd38ef16efc7f29d9697fc5564a9f615","tests/expand/naming/struct-all.rs":"c13c0aacee85b8fca58f85d2d75d2e3907b3e7642f8710ed8c8e54d6015881cc","tests/expand/naming/struct-mut.expanded.rs":"6e52a2d4c9fe105307d2cf07882897027713ebcac94249aab7ba0a1ffc2f2f77","tests/expand/naming/struct-mut.rs":"9a7752a6d30e0b7033f3577a72676676900a642cdaf59f942179d1f2a8ba2bb0","tests/expand/naming/struct-none.expanded.rs":"c0a2a411462f2570340e095963c277da229f7b7dcbe661512ac5f051478d5905","tests/expand/naming/struct-none.rs":"5a6e57d9b6d00cfd4e1e69f37ce0c9d5165a21230d0363f0791665b1015870ce","tests/expand/naming/struct-ref.expanded.rs":"b8744cb83e6764c4c9718c4ad6898ce2c80420730456579ce250e1839bad6027","tests/expand/naming/struct-ref.rs":"33c4fd344b65650dee44087ada31d4b5acd9d122123360fb7d41718c46699574","tests/expand/not_unpin/enum.expanded.rs":"c71d04b6c6ed0c334724b395e44679111703adaf19f3d697f5bfce58f8313cfc","tests/expand/not_unpin/enum.rs":"b626f3390a6afa36ec3505bdb61457e8eb2a6eee58dc8ab5a85c9e1a10699b20","tests/expand/not_unpin/struct.expanded.rs":"e3bb42319076fa8ecfec3e47356bb5afc95da5454467a2b0b471f76ced0f284f","tests/expand/not_unpin/struct.rs":"84af744f600ef0c0276a64a07d427b28e0b649fb634fa9880a9fd8cd475517c9","tests/expand/pinned_drop/enum.expanded.rs":"9b7d9d0c16045400c93de9a47f39aae3859d922f81432f76f96e7dd81f27cdb8","tests/expand/pinned_drop/enum.rs":"3178d479b9b42dc74c5a2207f70c9959070672c03009021e335c34290ef620ba","tests/expand/pinned_drop/struct.expanded.rs":"e802ab01b59f09d6397f9235eab51e07859b2582465a39f5621fa4d33e270fd3","tests/expand/pinned_drop/struct.rs":"cf6a7b04451c59ce697c3ef15855c7740b0e72a6005b1f47db326bd93b1849c3","tests/expand/pub/enum.expanded.rs":"ddc80984cc8cfd30a27c385c3e53ae7c178d774a717040d0e791e81adc7004fe","tests/expand/pub/enum.rs":"5b60dd354a489b0326f5c4f1026b89d1471ddbb45906bc3046a65425c4e5e160","tests/expand/pub/struct.expanded.rs":"435a2322ab580327bfecd40b309b3f2079667ed627bc25bdb41ee03dae0596bb","tests/expand/pub/struct.rs":"15b7940ce0ad1d5d133dde1870319f2f96a000bfcf29508b8cce1a62876cbd80","tests/expandtest.rs":"66bd80992a1696994ec2d14c3edc36350a0cb896d8081f1c0f8893ebeed72d03","tests/include/basic.rs":"9e399b682bc74c899d26924c2cab52a911f7392e29300defb6521e561fafafe4","tests/lint.rs":"36005c64524a2ed4f738d22d5310539e063e75833e8ab1b81afa6c9d1ba14bf6","tests/proper_unpin.rs":"35894ab482a5409aa32b261ff729c0ce23230232ecf43b3227a401fd218828e1","tests/test.rs":"b5c1bde0fa45513b6a0f0f2126e70aa41a8f5aba2bdf55bfb2b8b6b415c0e98b","tests/ui/pin_project/conflict-drop.rs":"55e6809b5f59dd81e32c2c89b742c0c76db6b099a1d2621e5b882c0d20f92837","tests/ui/pin_project/conflict-drop.stderr":"7cadbfe2b8e9659c69e8d61d45128d3589444f563e1f179d6d4c9bd1d98e96e1","tests/ui/pin_project/conflict-unpin.rs":"eae4f6b2084e32001a5a965b4a9ebf76a3a628830ca5f93bf4799eea96accbf9","tests/ui/pin_project/conflict-unpin.stderr":"c5bc8f97a5917548eb66e6099adf9371416a02ffc4feb2e20432c60782cd6ba2","tests/ui/pin_project/invalid-bounds.rs":"f86f23d377df015182f2f5dae6464a4f98c37f2198e0646f721fedc4017cb82c","tests/ui/pin_project/invalid-bounds.stderr":"200e6fab99f8ebd75116294ba9c43ae9487563239f2d57462157f5cc47c37cc3","tests/ui/pin_project/invalid.rs":"7304bd4a5bac1419382742432cfa8af83535d7be8cfad52c661410e0e9e8207a","tests/ui/pin_project/invalid.stderr":"6e8693c3341972e329e7c7a1836f308c433e0ba677fc99808d75a53e695654b1","tests/ui/pin_project/overlapping_lifetime_names.rs":"36c849a4570c8c0c32ca6c01aa75afbe1136ef73d45f17eb66175e1936678722","tests/ui/pin_project/overlapping_lifetime_names.stderr":"6958a5c0c983f3ed782203d8f221e80e154b71cb4fe2a9fb633058ec636c4cbc","tests/ui/pin_project/overlapping_unpin_struct.rs":"9a126182d1fe15a30ac60bb223b376aad747d11293d3cf512ad2dce546e3725c","tests/ui/pin_project/overlapping_unpin_struct.stderr":"406feb5169cd79293853b76a5cc599e692d2af3b5169fca32cb5cf1cb2ad0fc0","tests/ui/pin_project/packed.rs":"1f1a34aafbff9a59b94cdf3a53df03e9fc661d9e27e0f9962bad7f9bdad03b14","tests/ui/pin_project/packed.stderr":"5c5f08d339d4e5e2596f1f8a64158d8c2df2ea7116c04a578004f30f48ca7b0a","tests/ui/pin_project/unpin_sneaky.rs":"12e97a387ce1af6ee6a567687674aab70e96962a48f2433c39976d0b3e2c3341","tests/ui/pin_project/unpin_sneaky.stderr":"7a540e26a0e9c66794bcc10cbc337b3459a9208d32b0012f0b55fb84cfc15cf1","tests/ui/pin_project/unsupported.rs":"14defa90e736f314bbbc219973929b77bdd22e5f7e4c4c88403db764f4d167d6","tests/ui/pin_project/unsupported.stderr":"7b161bda371caeb26df426fde4dadcff61a807ffd476b2344c6b77072d6c0cc0","tests/ui/pinned_drop/call-drop-inner.rs":"032260da1fc0e649d97167a8a4ac47eea915000efebdfdc490f050b6f9351027","tests/ui/pinned_drop/call-drop-inner.stderr":"abec9d82aeb49c860e313db0a3ad0d2024d7500750d4f9a0f8b0ce00478dbcbf","tests/ui/pinned_drop/conditional-drop-impl.rs":"0b28c74213cee83e7b27223d7d37f903f79abd3dddcc0f969e14047674908085","tests/ui/pinned_drop/conditional-drop-impl.stderr":"a845afaa89054f7c516029090a201f3beecf59d6e9e4fca18ca3678d27666a92"},"package":"8afb450f006bf6385ca15ef45d71d2288452bc3683ce2e2cacc0d18e4be60b58"}
\ No newline at end of file
+{"files":{"CHANGELOG.md":"ce90bf658911da3fc5c7b16b4f0ec16a0f73910f234037500ca62074e2cbe877","Cargo.toml":"49a816e2857280a1a7cfb3796b0d12147dc45ee62a57b6811daaca96f5b25480","LICENSE-APACHE":"0d542e0c8804e39aa7f37eb00da5a762149dc682d7829451287e11b938e94594","LICENSE-MIT":"23f18e03dc49df91622fe2a76176497404e46ced8a715d9d2b67a7446571cca3","README.md":"11841d1d294b58cb7c77b561fa5c3de1e71f32a347b73637e36f69ff32adf55b","src/lib.rs":"da067d2f204533733f06d06b567bfcc7ee6664c03e67a40402e0fc04856ee1b7","tests/auxiliary/mod.rs":"52a78b77be05c67737c56865fbce4477eaacc6482d6377af2a5822f05a2ce061","tests/compiletest.rs":"48cfd92c7271345d57a6c222a7a61e00449f38e6ba379130813c45b31a5589c9","tests/drop_order.rs":"9b13b6461e44be1c1beca6ec47387de83efcb988326e4ff832183b8fad17a3f4","tests/expand/default/enum.expanded.rs":"eb1b44354e8c6accfcab7fd5326f6a09e4e89205494981b71ab90e59f65b7359","tests/expand/default/enum.rs":"ebe6b6403e35459420f6fe979243c382972d2d582376d69f6c630ab5ba2599b5","tests/expand/default/struct.expanded.rs":"8fcd5e14e7f1e3c267adb258cbdd64b751ab1396cf8f65c5bbf7697f26893f62","tests/expand/default/struct.rs":"05767cd68ec5cddc481cff5ad677b5146f7d6fd1effcf1ff131d24c334d85032","tests/expand/multifields/enum.expanded.rs":"5e328b5aee4ef5c5e4c56b6e741a5aa13a4786e444b2968c2022202094702b89","tests/expand/multifields/enum.rs":"d38eb301c86307edbf5cb07ed434b64a10a68aaef32dfb8b15029b5cc5586b0b","tests/expand/multifields/struct.expanded.rs":"7f6bfdf010bf514f2cecd8c679cbd74db721a8eb99cc093759d460c18ce911b7","tests/expand/multifields/struct.rs":"1fe2b911e8782eaac5952d9e0914473d46d82db45b1da859bdc6b8dc3978e549","tests/expand/naming/enum-all.expanded.rs":"eb1b44354e8c6accfcab7fd5326f6a09e4e89205494981b71ab90e59f65b7359","tests/expand/naming/enum-all.rs":"ebe6b6403e35459420f6fe979243c382972d2d582376d69f6c630ab5ba2599b5","tests/expand/naming/enum-mut.expanded.rs":"874e1ddd948d33993c772dd4e890aa3ca41f08f83630cbb568fbd3191e14cd0b","tests/expand/naming/enum-mut.rs":"bf215d055b29a7f9fdb84cabf34576d9dec8e87c33cebe2b553d1fe5e5cb0882","tests/expand/naming/enum-none.expanded.rs":"c771bbd9970684224cb64f4111801d14fd10e7da2a202fef9c366ab390a01c69","tests/expand/naming/enum-none.rs":"115968816e1a1a6b3634b8594dde4815d4641d817d69ebdd90879b96a8a2808e","tests/expand/naming/enum-ref.expanded.rs":"598894365be54d3678b6cd23a102cad9d9141a9ea4206ad30459743ec4fe9d5a","tests/expand/naming/enum-ref.rs":"e09ce2ca812b9fcf7dc59b486e5b50b84db08860a2ceda63ba094d7351bb391f","tests/expand/naming/struct-all.expanded.rs":"021112da5dff423ac628100260a2ee6aeeec5c63dbb68d168042b0e9d55b7afc","tests/expand/naming/struct-all.rs":"0d6b64bc687fbc19329a5558461329e3d2cfa367ff8adb7be76efe2d3160d33e","tests/expand/naming/struct-mut.expanded.rs":"1b3ae70bcd56a8665550953b3d998a34ca92a55de6612db111590bbdad5b02d0","tests/expand/naming/struct-mut.rs":"36edd8db816c122c80ccb139b4305cad8edfdf9b7ee4aebacafa1180613a5075","tests/expand/naming/struct-none.expanded.rs":"8fcd5e14e7f1e3c267adb258cbdd64b751ab1396cf8f65c5bbf7697f26893f62","tests/expand/naming/struct-none.rs":"05767cd68ec5cddc481cff5ad677b5146f7d6fd1effcf1ff131d24c334d85032","tests/expand/naming/struct-ref.expanded.rs":"093fb921ac0aeaf4bb641f1cc48157102b6a4638b36ddf82637a4ca4a0b8ec65","tests/expand/naming/struct-ref.rs":"dd249875f962d16dd9ec821acf0c2b5c1ed0ed05569f6e874ccd5caca2759acf","tests/expand/not_unpin/enum.expanded.rs":"c71d04b6c6ed0c334724b395e44679111703adaf19f3d697f5bfce58f8313cfc","tests/expand/not_unpin/enum.rs":"c65aac4d2083e83d2dfc3bec8ce243e3e9169ef5f986f077f0a8b4226d39f7c3","tests/expand/not_unpin/struct.expanded.rs":"e3bb42319076fa8ecfec3e47356bb5afc95da5454467a2b0b471f76ced0f284f","tests/expand/not_unpin/struct.rs":"99d77727393e4a050d2ceb99710172dfdd13dfcb6e6416f63de39e5df3a9f03f","tests/expand/pinned_drop/enum.expanded.rs":"abad8810838dc856024cb4d9e5d3b41da482c19633c6b64ca667c1edeb64e7b2","tests/expand/pinned_drop/enum.rs":"8f590791cb4693bb077c562f0d93128f9452e6a5f60c631b5fd624a221883ebd","tests/expand/pinned_drop/struct.expanded.rs":"daf6bcd2276853546c151f09de2b4433d885a75e7deb0ec0ece51fe6e55e9f61","tests/expand/pinned_drop/struct.rs":"8da271d7d3182b33be297d985a1e3b57d6067406db21eca8ac2c448ef1a0869a","tests/expand/pub/enum.expanded.rs":"045c0a21bad8a63c9846749d9ba3a8335508284e227209726735c17c84aa27ac","tests/expand/pub/enum.rs":"fdbd806e92cfad4e67737d1f782544aa4e3116bae702161c43b5c22bfbf3a208","tests/expand/pub/struct.expanded.rs":"6560a3e6447885d2d7d6a4bdbb8c3c4f550cf4079d261371c7c8c4183ef41172","tests/expand/pub/struct.rs":"05cb3f03ef9801fecf0a7c86bbd236c97218b34ac01ee507cb7de9a78efaeffa","tests/expandtest.rs":"a4336ab879d79824ab3144ea385a7a00ba77604c3b6639ae53b6283850b421df","tests/include/basic.rs":"271a8c75e2e937d8ffcaa8c43fdf051c5cdf86c1b6b8c216ce0b4ad37977c571","tests/proper_unpin.rs":"83790eb38ae2fd5aed97fc67da79d91c1071f08d1e5aaef0c71e65d8b5767403","tests/test.rs":"37faf4f378b43c58f7aad09b05bcc520dcfd058be85c3bd0da93623139d48e01","tests/ui/pin_project/conflict-drop.rs":"a1964fa136080cc354479ff55b8428e5fa79305681fb2475cc37d6071cd64112","tests/ui/pin_project/conflict-drop.stderr":"ab20853a39525cdb5532a2aa51950339b8f51e9b6e7c72487e0739f1876fc4de","tests/ui/pin_project/conflict-unpin.rs":"37e7b2f9ab1be70d0521c9dbbc954067f22a2321511e008f0f72e13d0edb4afe","tests/ui/pin_project/conflict-unpin.stderr":"c55767dc44c46179fefacc99e261477ce3a3cb759daa21559d9267fb103c3c17","tests/ui/pin_project/invalid-bounds.rs":"4068e272a4f5d44851e0901dd6cfa806ead000c2e1a507a2b42be51d26d17056","tests/ui/pin_project/invalid-bounds.stderr":"da18e686a0dd677dc53ee9be2aa7588da7077cc158d41958ddca7fc4cd1d7404","tests/ui/pin_project/invalid.rs":"1c84cc089623dd31f483011ed6543f169af341b028a212fcf00146bc96dd792f","tests/ui/pin_project/invalid.stderr":"3a194617321918aca05a3e12e10c2f98f196fce50ef340a9d648d6c71af14b68","tests/ui/pin_project/negative_impls_stable.rs":"1e70055fbec4bc0a53454fd93a0663f8785440d37dcf359ab29958d97fd51e9d","tests/ui/pin_project/negative_impls_stable.stderr":"19ea9df3c7d76dddd169f081755098764ed12b5139bf22cd012017ef46466524","tests/ui/pin_project/overlapping_lifetime_names.rs":"ac9c29b389e8e067e9e384cf04be69c0e5bb862cf373de0e3b4296fe2007809b","tests/ui/pin_project/overlapping_lifetime_names.stderr":"1df727ff5129e07c4c213352bc18dec9390a562726186596c07d4cc38a2f114a","tests/ui/pin_project/overlapping_unpin_struct.rs":"cb3d6d4087b8b4c917bc71e55764775f6bb018a77cda5c6b726afacd66789859","tests/ui/pin_project/overlapping_unpin_struct.stderr":"1f236a6d235432a624258ff85faf8c3e5472652154fd35f688340f74d4105b8b","tests/ui/pin_project/packed.rs":"6a24ac14e61e5d3e3b495f49d226318ec500e5aa46f34acf8e4f3e0827bd9604","tests/ui/pin_project/packed.stderr":"15ed6f57e7d582a0476f25e7247c078f619f255a33ac9caed127181b2d81f4dc","tests/ui/pin_project/unpin_sneaky.rs":"6e6385e067679c3bf5233163b3fa99ff2fc28bcb93fe594a5c987c0db7c0eaa6","tests/ui/pin_project/unpin_sneaky.stderr":"d2b305d2ee117a4734390fbd6d9b9c6214443b61cdc15bef44ef6789bc66352a","tests/ui/pin_project/unsupported.rs":"3ad5f584f9e56be3573133fba026a7bb378595d0a4b7b1bcbb6b78e37cef20a7","tests/ui/pin_project/unsupported.stderr":"2270c873047b1039ca9d0c4a7ac914e2e9b7d4bc365b54b48cc6a7d80b524df6","tests/ui/pinned_drop/call-drop-inner.rs":"0618b60a450c99b5953b302e26c68df1abe7632af3d9baf3639eb60091e4ff4e","tests/ui/pinned_drop/call-drop-inner.stderr":"0a938f3a3f640872ae3dc86bdc9d558503d501381f9cbf9bf8fffa8ec87ee6d7","tests/ui/pinned_drop/conditional-drop-impl.rs":"df03f38b2a331f339af2734fdd4ad2f637b2e2189d9928599adebe04ebee517f","tests/ui/pinned_drop/conditional-drop-impl.stderr":"568146640b57700c470fc94db12768b1b4bf6f4d7aa14d8f8bd807d7eef0b2ef"},"package":"915a1e146535de9163f3987b8944ed8cf49a18bb0056bcebcdcece385cece4ff"}
\ No newline at end of file
diff --git a/crates/pin-project-lite/Android.bp b/crates/pin-project-lite/Android.bp
index 39faee6..ef511ee 100644
--- a/crates/pin-project-lite/Android.bp
+++ b/crates/pin-project-lite/Android.bp
@@ -18,7 +18,7 @@
host_supported: true,
crate_name: "pin_project_lite",
cargo_env_compat: true,
- cargo_pkg_version: "0.2.13",
+ cargo_pkg_version: "0.2.15",
crate_root: "src/lib.rs",
edition: "2018",
apex_available: [
diff --git a/crates/pin-project-lite/CHANGELOG.md b/crates/pin-project-lite/CHANGELOG.md
index dc463fc..50d61cc 100644
--- a/crates/pin-project-lite/CHANGELOG.md
+++ b/crates/pin-project-lite/CHANGELOG.md
@@ -4,12 +4,22 @@
This project adheres to [Semantic Versioning](https://semver.org).
+Releases may yanked if there is a security bug, a soundness bug, or a regression.
+
<!--
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]
+## [0.2.15] - 2024-10-24
+
+- Work around an issue on negative_impls that allows unsound overlapping `Unpin` implementations. ([#84](https://github.com/taiki-e/pin-project-lite/pull/84))
+
+## [0.2.14] - 2024-03-29
+
+- Document `PinnedDrop`. ([#83](https://github.com/taiki-e/pin-project-lite/pull/83), thanks @jbr)
+
## [0.2.13] - 2023-08-25
- Allow attributes in impl and method of `PinnedDrop` implementation.
@@ -212,7 +222,9 @@
Initial release
-[Unreleased]: https://github.com/taiki-e/pin-project-lite/compare/v0.2.13...HEAD
+[Unreleased]: https://github.com/taiki-e/pin-project-lite/compare/v0.2.15...HEAD
+[0.2.15]: https://github.com/taiki-e/pin-project-lite/compare/v0.2.14...v0.2.15
+[0.2.14]: https://github.com/taiki-e/pin-project-lite/compare/v0.2.13...v0.2.14
[0.2.13]: https://github.com/taiki-e/pin-project-lite/compare/v0.2.12...v0.2.13
[0.2.12]: https://github.com/taiki-e/pin-project-lite/compare/v0.2.11...v0.2.12
[0.2.11]: https://github.com/taiki-e/pin-project-lite/compare/v0.2.10...v0.2.11
diff --git a/crates/pin-project-lite/Cargo.toml b/crates/pin-project-lite/Cargo.toml
index ae3d4fb..4370a2e 100644
--- a/crates/pin-project-lite/Cargo.toml
+++ b/crates/pin-project-lite/Cargo.toml
@@ -13,12 +13,17 @@
edition = "2018"
rust-version = "1.37"
name = "pin-project-lite"
-version = "0.2.13"
+version = "0.2.15"
+build = false
exclude = [
"/.*",
"/tools",
"/DEVELOPMENT.md",
]
+autobins = false
+autoexamples = false
+autotests = false
+autobenches = false
description = """
A lightweight version of pin-project written with declarative macros.
"""
@@ -35,35 +40,160 @@
license = "Apache-2.0 OR MIT"
repository = "https://github.com/taiki-e/pin-project-lite"
+[package.metadata.cargo_check_external_types]
+allowed_external_types = []
+
[package.metadata.docs.rs]
targets = ["x86_64-unknown-linux-gnu"]
[lib]
+name = "pin_project_lite"
+path = "src/lib.rs"
doc-scrape-examples = false
-[dev-dependencies.macrotest]
-version = "1.0.9"
+[[test]]
+name = "compiletest"
+path = "tests/compiletest.rs"
-[dev-dependencies.once_cell]
-version = "=1.14"
+[[test]]
+name = "drop_order"
+path = "tests/drop_order.rs"
-[dev-dependencies.proc-macro2]
-version = "=1.0.65"
+[[test]]
+name = "expandtest"
+path = "tests/expandtest.rs"
-[dev-dependencies.quote]
-version = "=1.0.30"
+[[test]]
+name = "proper_unpin"
+path = "tests/proper_unpin.rs"
+
+[[test]]
+name = "test"
+path = "tests/test.rs"
[dev-dependencies.rustversion]
version = "1"
-[dev-dependencies.serde]
-version = "=1.0.156"
-
[dev-dependencies.static_assertions]
version = "1"
-[dev-dependencies.toml]
-version = "=0.5.9"
+[lints.clippy]
+all = "warn"
+as_ptr_cast_mut = "warn"
+as_underscore = "warn"
+default_union_representation = "warn"
+inline_asm_x86_att_syntax = "warn"
+pedantic = "warn"
+trailing_empty_array = "warn"
+transmute_undefined_repr = "warn"
+undocumented_unsafe_blocks = "warn"
-[dev-dependencies.trybuild]
-version = "=1.0.67"
+[lints.clippy.bool_assert_comparison]
+level = "allow"
+priority = 1
+
+[lints.clippy.borrow_as_ptr]
+level = "allow"
+priority = 1
+
+[lints.clippy.cast_lossless]
+level = "allow"
+priority = 1
+
+[lints.clippy.declare_interior_mutable_const]
+level = "allow"
+priority = 1
+
+[lints.clippy.doc_markdown]
+level = "allow"
+priority = 1
+
+[lints.clippy.float_cmp]
+level = "allow"
+priority = 1
+
+[lints.clippy.incompatible_msrv]
+level = "allow"
+priority = 1
+
+[lints.clippy.lint_groups_priority]
+level = "allow"
+priority = 1
+
+[lints.clippy.manual_assert]
+level = "allow"
+priority = 1
+
+[lints.clippy.manual_range_contains]
+level = "allow"
+priority = 1
+
+[lints.clippy.missing_errors_doc]
+level = "allow"
+priority = 1
+
+[lints.clippy.module_name_repetitions]
+level = "allow"
+priority = 1
+
+[lints.clippy.naive_bytecount]
+level = "allow"
+priority = 1
+
+[lints.clippy.nonminimal_bool]
+level = "allow"
+priority = 1
+
+[lints.clippy.range_plus_one]
+level = "allow"
+priority = 1
+
+[lints.clippy.similar_names]
+level = "allow"
+priority = 1
+
+[lints.clippy.single_match]
+level = "allow"
+priority = 1
+
+[lints.clippy.single_match_else]
+level = "allow"
+priority = 1
+
+[lints.clippy.struct_excessive_bools]
+level = "allow"
+priority = 1
+
+[lints.clippy.struct_field_names]
+level = "allow"
+priority = 1
+
+[lints.clippy.too_many_arguments]
+level = "allow"
+priority = 1
+
+[lints.clippy.too_many_lines]
+level = "allow"
+priority = 1
+
+[lints.clippy.type_complexity]
+level = "allow"
+priority = 1
+
+[lints.clippy.unreadable_literal]
+level = "allow"
+priority = 1
+
+[lints.rust]
+deprecated_safe = "warn"
+improper_ctypes = "warn"
+improper_ctypes_definitions = "warn"
+non_ascii_idents = "warn"
+rust_2018_idioms = "warn"
+single_use_lifetimes = "warn"
+unreachable_pub = "warn"
+
+[lints.rust.unexpected_cfgs]
+level = "warn"
+priority = 0
+check-cfg = []
diff --git a/crates/pin-project-lite/METADATA b/crates/pin-project-lite/METADATA
index cec00e4..2eff223 100644
--- a/crates/pin-project-lite/METADATA
+++ b/crates/pin-project-lite/METADATA
@@ -1,17 +1,17 @@
name: "pin-project-lite"
description: "A lightweight version of pin-project written with declarative macros."
third_party {
- version: "0.2.13"
+ version: "0.2.15"
license_type: NOTICE
last_upgrade_date {
- year: 2023
- month: 10
- day: 25
+ year: 2024
+ month: 12
+ day: 20
}
homepage: "https://crates.io/crates/pin-project-lite"
identifier {
type: "Archive"
- value: "https://static.crates.io/crates/pin-project-lite/pin-project-lite-0.2.13.crate"
- version: "0.2.13"
+ value: "https://static.crates.io/crates/pin-project-lite/pin-project-lite-0.2.15.crate"
+ version: "0.2.15"
}
}
diff --git a/crates/pin-project-lite/README.md b/crates/pin-project-lite/README.md
index 40b909a..0500fd8 100644
--- a/crates/pin-project-lite/README.md
+++ b/crates/pin-project-lite/README.md
@@ -3,8 +3,8 @@
[](https://crates.io/crates/pin-project-lite)
[](https://docs.rs/pin-project-lite)
[](#license)
-[](https://www.rust-lang.org)
-[](https://github.com/taiki-e/pin-project-lite/actions)
+[](https://www.rust-lang.org)
+[](https://github.com/taiki-e/pin-project-lite/actions)
<!-- tidy:crate-doc:start -->
A lightweight version of [pin-project] written with declarative macros.
@@ -18,8 +18,6 @@
pin-project-lite = "0.2"
```
-*Compiler support: requires rustc 1.37+*
-
## Examples
[`pin_project!`] macro creates a projection type covering all the fields of
@@ -111,14 +109,14 @@
pin-project supports this.
-[not-unpin]: https://docs.rs/pin-project/1/pin_project/attr.pin_project.html#unpin
-[not-unpin-lite]: https://docs.rs/pin-project-lite/0.2/pin_project_lite/macro.pin_project.html#unpin
+[not-unpin]: https://docs.rs/pin-project/latest/pin_project/attr.pin_project.html#unpin
[pin-project]: https://github.com/taiki-e/pin-project
-[unsafe-unpin]: https://docs.rs/pin-project/1/pin_project/attr.pin_project.html#unsafeunpin
+[unsafe-unpin]: https://docs.rs/pin-project/latest/pin_project/attr.pin_project.html#unsafeunpin
<!-- tidy:crate-doc:end -->
-[`pin_project!`]: https://docs.rs/pin-project-lite/0.2/pin_project_lite/macro.pin_project.html
+[not-unpin-lite]: https://docs.rs/pin-project-lite/latest/pin_project_lite/macro.pin_project.html#unpin
+[`pin_project!`]: https://docs.rs/pin-project-lite/latest/pin_project_lite/macro.pin_project.html
## License
diff --git a/crates/pin-project-lite/src/lib.rs b/crates/pin-project-lite/src/lib.rs
index 785c42e..9442afc 100644
--- a/crates/pin-project-lite/src/lib.rs
+++ b/crates/pin-project-lite/src/lib.rs
@@ -1,3 +1,5 @@
+// SPDX-License-Identifier: Apache-2.0 OR MIT
+
/*!
<!-- tidy:crate-doc:start -->
A lightweight version of [pin-project] written with declarative macros.
@@ -11,8 +13,6 @@
pin-project-lite = "0.2"
```
-*Compiler support: requires rustc 1.37+*
-
## Examples
[`pin_project!`] macro creates a projection type covering all the fields of
@@ -104,12 +104,13 @@
pin-project supports this.
-[not-unpin]: https://docs.rs/pin-project/1/pin_project/attr.pin_project.html#unpin
-[not-unpin-lite]: https://docs.rs/pin-project-lite/0.2/pin_project_lite/macro.pin_project.html#unpin
+[not-unpin]: https://docs.rs/pin-project/latest/pin_project/attr.pin_project.html#unpin
[pin-project]: https://github.com/taiki-e/pin-project
-[unsafe-unpin]: https://docs.rs/pin-project/1/pin_project/attr.pin_project.html#unsafeunpin
+[unsafe-unpin]: https://docs.rs/pin-project/latest/pin_project/attr.pin_project.html#unsafeunpin
<!-- tidy:crate-doc:end -->
+
+[not-unpin-lite]: pin_project#unpin
*/
#![no_std]
@@ -120,21 +121,18 @@
allow(dead_code, unused_variables)
)
))]
-#![warn(rust_2018_idioms, single_use_lifetimes, unreachable_pub)]
+// #![warn(unsafe_op_in_unsafe_fn)] // requires Rust 1.52
#![warn(
- clippy::pedantic,
- // lints for public library
+ // Lints that may help when writing public library.
+ missing_debug_implementations,
+ missing_docs,
clippy::alloc_instead_of_core,
clippy::exhaustive_enums,
clippy::exhaustive_structs,
+ clippy::impl_trait_in_params,
+ // clippy::missing_inline_in_public_items,
clippy::std_instead_of_alloc,
clippy::std_instead_of_core,
- // lints that help writing unsafe code
- clippy::as_ptr_cast_mut,
- clippy::default_union_representation,
- clippy::trailing_empty_array,
- clippy::transmute_undefined_repr,
- clippy::undocumented_unsafe_blocks,
)]
// ANDROID: Use std to allow building as a dylib.
@@ -150,7 +148,7 @@
///
/// And the following methods are implemented on the original type:
///
-/// ```rust
+/// ```
/// # use std::pin::Pin;
/// # type Projection<'a> = &'a ();
/// # type ProjectionRef<'a> = &'a ();
@@ -164,7 +162,7 @@
/// you can name the projection type returned from the method. This allows you
/// to use pattern matching on the projected types.
///
-/// ```rust
+/// ```
/// # use pin_project_lite::pin_project;
/// # use std::pin::Pin;
/// pin_project! {
@@ -190,7 +188,7 @@
/// method which allows the contents of `Pin<&mut Self>` to be replaced while simultaneously moving
/// out all unpinned fields in `Self`.
///
-/// ```rust
+/// ```
/// # use std::pin::Pin;
/// # type MyProjReplace = ();
/// # trait Dox {
@@ -220,7 +218,7 @@
///
/// # Examples
///
-/// ```rust
+/// ```
/// use std::pin::Pin;
///
/// use pin_project_lite::pin_project;
@@ -245,7 +243,7 @@
/// To use `pin_project!` on enums, you need to name the projection type
/// returned from the method.
///
-/// ```rust
+/// ```
/// use std::pin::Pin;
///
/// use pin_project_lite::pin_project;
@@ -277,7 +275,7 @@
/// original [`Pin`] type, it needs to use [`.as_mut()`][`Pin::as_mut`] to avoid
/// consuming the [`Pin`].
///
-/// ```rust
+/// ```
/// use std::pin::Pin;
///
/// use pin_project_lite::pin_project;
@@ -317,7 +315,7 @@
///
/// This is equivalent to using `#[pin]` attribute for a [`PhantomPinned`] field.
///
-/// ```rust
+/// ```
/// use std::marker::PhantomPinned;
///
/// use pin_project_lite::pin_project;
@@ -334,6 +332,52 @@
/// Note that using [`PhantomPinned`] without `#[pin]` or `#[project(!Unpin)]`
/// attribute has no effect.
///
+/// # Pinned Drop
+///
+/// In order to correctly implement pin projections, a type’s [`Drop`] impl must not move out of any
+/// structurally pinned fields. Unfortunately, [`Drop::drop`] takes `&mut Self`, not `Pin<&mut
+/// Self>`.
+///
+/// To implement [`Drop`] for type that has pin, add an `impl PinnedDrop` block at the end of the
+/// [`pin_project`] macro block. PinnedDrop has the following interface:
+///
+/// ```rust
+/// # use std::pin::Pin;
+/// trait PinnedDrop {
+/// fn drop(this: Pin<&mut Self>);
+/// }
+/// ```
+///
+/// Note that the argument to `PinnedDrop::drop` cannot be named `self`.
+///
+/// `pin_project!` implements the actual [`Drop`] trait via PinnedDrop you implemented. To
+/// explicitly drop a type that implements PinnedDrop, use the [drop] function just like dropping a
+/// type that directly implements [`Drop`].
+///
+/// `PinnedDrop::drop` will never be called more than once, just like [`Drop::drop`].
+///
+/// ```rust
+/// use pin_project_lite::pin_project;
+///
+/// pin_project! {
+/// pub struct Struct<'a> {
+/// was_dropped: &'a mut bool,
+/// #[pin]
+/// field: u8,
+/// }
+///
+/// impl PinnedDrop for Struct<'_> {
+/// fn drop(this: Pin<&mut Self>) { // <----- NOTE: this is not `self`
+/// **this.project().was_dropped = true;
+/// }
+/// }
+/// }
+///
+/// let mut was_dropped = false;
+/// drop(Struct { was_dropped: &mut was_dropped, field: 42 });
+/// assert!(was_dropped);
+/// ```
+///
/// [`PhantomPinned`]: core::marker::PhantomPinned
/// [`Pin::as_mut`]: core::pin::Pin::as_mut
/// [`Pin`]: core::pin::Pin
@@ -1158,7 +1202,7 @@
// Automatically create the appropriate conditional `Unpin` implementation.
//
// Basically this is equivalent to the following code:
- // ```rust
+ // ```
// impl<T, U> Unpin for Struct<T, U> where T: Unpin {}
// ```
//
@@ -1166,7 +1210,7 @@
// this would cause an E0446 (private type in public interface).
//
// When RFC 2145 is implemented (rust-lang/rust#48054),
- // this will become a lint, rather then a hard error.
+ // this will become a lint, rather than a hard error.
//
// As a workaround for this, we generate a new struct, containing all of the pinned
// fields from our #[pin_project] type. This struct is declared within
@@ -1181,7 +1225,7 @@
//
// See also https://github.com/taiki-e/pin-project/pull/53.
#[allow(non_snake_case)]
- $vis struct __Origin <'__pin, $($impl_generics)*>
+ $vis struct __Origin<'__pin, $($impl_generics)*>
$(where
$($where_clause)*)?
{
@@ -1190,7 +1234,8 @@
}
impl <'__pin, $($impl_generics)*> $crate::__private::Unpin for $ident <$($ty_generics)*>
where
- __Origin <'__pin, $($ty_generics)*>: $crate::__private::Unpin
+ $crate::__private::PinnedFieldsOf<__Origin<'__pin, $($ty_generics)*>>:
+ $crate::__private::Unpin
$(, $($where_clause)*)?
{
}
@@ -1621,7 +1666,9 @@
};
}
+// Not public API.
#[doc(hidden)]
+#[allow(missing_debug_implementations)]
pub mod __private {
use core::mem::ManuallyDrop;
#[doc(hidden)]
@@ -1632,23 +1679,37 @@
ptr,
};
+ // Workaround for issue on unstable negative_impls feature that allows unsound overlapping Unpin
+ // implementations and rustc bug that leaks unstable negative_impls into stable.
+ // See https://github.com/taiki-e/pin-project/issues/340#issuecomment-2432146009 for details.
+ #[doc(hidden)]
+ pub type PinnedFieldsOf<T> =
+ <PinnedFieldsOfHelperStruct<T> as PinnedFieldsOfHelperTrait>::Actual;
+ // We cannot use <Option<T> as IntoIterator>::Item or similar since we should allow ?Sized in T.
+ #[doc(hidden)]
+ pub trait PinnedFieldsOfHelperTrait {
+ type Actual: ?Sized;
+ }
+ #[doc(hidden)]
+ pub struct PinnedFieldsOfHelperStruct<T: ?Sized>(T);
+ impl<T: ?Sized> PinnedFieldsOfHelperTrait for PinnedFieldsOfHelperStruct<T> {
+ type Actual = T;
+ }
+
// This is an internal helper struct used by `pin_project!`.
#[doc(hidden)]
pub struct AlwaysUnpin<T: ?Sized>(PhantomData<T>);
-
impl<T: ?Sized> Unpin for AlwaysUnpin<T> {}
// This is an internal helper used to ensure a value is dropped.
#[doc(hidden)]
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) {
// SAFETY: the caller of `UnsafeDropInPlaceGuard::new` must guarantee
@@ -1666,14 +1727,12 @@
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> {
fn drop(&mut self) {
// SAFETY: the caller of `UnsafeOverwriteGuard::new` must guarantee
diff --git a/crates/pin-project-lite/tests/auxiliary/mod.rs b/crates/pin-project-lite/tests/auxiliary/mod.rs
index 1457099..4ccd0a8 100644
--- a/crates/pin-project-lite/tests/auxiliary/mod.rs
+++ b/crates/pin-project-lite/tests/auxiliary/mod.rs
@@ -1,3 +1,5 @@
+// SPDX-License-Identifier: Apache-2.0 OR MIT
+
#![allow(dead_code, unused_macros)]
macro_rules! assert_unpin {
diff --git a/crates/pin-project-lite/tests/compiletest.rs b/crates/pin-project-lite/tests/compiletest.rs
index 06712d0..7ed69c8 100644
--- a/crates/pin-project-lite/tests/compiletest.rs
+++ b/crates/pin-project-lite/tests/compiletest.rs
@@ -1,16 +1,11 @@
-#![cfg(not(miri))]
-#![cfg(not(careful))]
-#![warn(rust_2018_idioms, single_use_lifetimes)]
+// SPDX-License-Identifier: Apache-2.0 OR MIT
-use std::env;
+#![cfg(not(miri))]
#[rustversion::attr(not(nightly), ignore)]
#[test]
fn ui() {
- if env::var_os("CI").is_none() {
- env::set_var("TRYBUILD", "overwrite");
- }
-
let t = trybuild::TestCases::new();
t.compile_fail("tests/ui/**/*.rs");
+ t.pass("tests/run-pass/**/*.rs");
}
diff --git a/crates/pin-project-lite/tests/drop_order.rs b/crates/pin-project-lite/tests/drop_order.rs
index 6e5deaf..ccceb8e 100644
--- a/crates/pin-project-lite/tests/drop_order.rs
+++ b/crates/pin-project-lite/tests/drop_order.rs
@@ -1,4 +1,4 @@
-#![warn(rust_2018_idioms, single_use_lifetimes)]
+// SPDX-License-Identifier: Apache-2.0 OR MIT
// Refs: https://doc.rust-lang.org/reference/destructors.html
diff --git a/crates/pin-project-lite/tests/expand/default/enum.expanded.rs b/crates/pin-project-lite/tests/expand/default/enum.expanded.rs
index 456b8cc..b01e4a8 100644
--- a/crates/pin-project-lite/tests/expand/default/enum.expanded.rs
+++ b/crates/pin-project-lite/tests/expand/default/enum.expanded.rs
@@ -133,7 +133,9 @@
}
impl<'__pin, T, U> ::pin_project_lite::__private::Unpin for Enum<T, U>
where
- __Origin<'__pin, T, U>: ::pin_project_lite::__private::Unpin,
+ ::pin_project_lite::__private::PinnedFieldsOf<
+ __Origin<'__pin, T, U>,
+ >: ::pin_project_lite::__private::Unpin,
{}
trait MustNotImplDrop {}
#[allow(clippy::drop_bounds, drop_bounds)]
diff --git a/crates/pin-project-lite/tests/expand/default/enum.rs b/crates/pin-project-lite/tests/expand/default/enum.rs
index 90d6860..c9d9851 100644
--- a/crates/pin-project-lite/tests/expand/default/enum.rs
+++ b/crates/pin-project-lite/tests/expand/default/enum.rs
@@ -1,3 +1,5 @@
+// SPDX-License-Identifier: Apache-2.0 OR MIT
+
use pin_project_lite::pin_project;
pin_project! {
diff --git a/crates/pin-project-lite/tests/expand/default/struct.expanded.rs b/crates/pin-project-lite/tests/expand/default/struct.expanded.rs
index a9792e1..4c86c89 100644
--- a/crates/pin-project-lite/tests/expand/default/struct.expanded.rs
+++ b/crates/pin-project-lite/tests/expand/default/struct.expanded.rs
@@ -75,7 +75,9 @@
}
impl<'__pin, T, U> ::pin_project_lite::__private::Unpin for Struct<T, U>
where
- __Origin<'__pin, T, U>: ::pin_project_lite::__private::Unpin,
+ ::pin_project_lite::__private::PinnedFieldsOf<
+ __Origin<'__pin, T, U>,
+ >: ::pin_project_lite::__private::Unpin,
{}
trait MustNotImplDrop {}
#[allow(clippy::drop_bounds, drop_bounds)]
diff --git a/crates/pin-project-lite/tests/expand/default/struct.rs b/crates/pin-project-lite/tests/expand/default/struct.rs
index e5447c7..e4245d1 100644
--- a/crates/pin-project-lite/tests/expand/default/struct.rs
+++ b/crates/pin-project-lite/tests/expand/default/struct.rs
@@ -1,3 +1,5 @@
+// SPDX-License-Identifier: Apache-2.0 OR MIT
+
use pin_project_lite::pin_project;
pin_project! {
diff --git a/crates/pin-project-lite/tests/expand/multifields/enum.expanded.rs b/crates/pin-project-lite/tests/expand/multifields/enum.expanded.rs
index f722a14..f65dd3e 100644
--- a/crates/pin-project-lite/tests/expand/multifields/enum.expanded.rs
+++ b/crates/pin-project-lite/tests/expand/multifields/enum.expanded.rs
@@ -79,7 +79,9 @@
}
impl<'__pin, T, U> ::pin_project_lite::__private::Unpin for Enum<T, U>
where
- __Origin<'__pin, T, U>: ::pin_project_lite::__private::Unpin,
+ ::pin_project_lite::__private::PinnedFieldsOf<
+ __Origin<'__pin, T, U>,
+ >: ::pin_project_lite::__private::Unpin,
{}
trait MustNotImplDrop {}
#[allow(clippy::drop_bounds, drop_bounds)]
diff --git a/crates/pin-project-lite/tests/expand/multifields/enum.rs b/crates/pin-project-lite/tests/expand/multifields/enum.rs
index c713362..1357c2f 100644
--- a/crates/pin-project-lite/tests/expand/multifields/enum.rs
+++ b/crates/pin-project-lite/tests/expand/multifields/enum.rs
@@ -1,3 +1,5 @@
+// SPDX-License-Identifier: Apache-2.0 OR MIT
+
use pin_project_lite::pin_project;
pin_project! {
diff --git a/crates/pin-project-lite/tests/expand/multifields/struct.expanded.rs b/crates/pin-project-lite/tests/expand/multifields/struct.expanded.rs
index 83ebefe..30716b1 100644
--- a/crates/pin-project-lite/tests/expand/multifields/struct.expanded.rs
+++ b/crates/pin-project-lite/tests/expand/multifields/struct.expanded.rs
@@ -134,7 +134,9 @@
}
impl<'__pin, T, U> ::pin_project_lite::__private::Unpin for Struct<T, U>
where
- __Origin<'__pin, T, U>: ::pin_project_lite::__private::Unpin,
+ ::pin_project_lite::__private::PinnedFieldsOf<
+ __Origin<'__pin, T, U>,
+ >: ::pin_project_lite::__private::Unpin,
{}
trait MustNotImplDrop {}
#[allow(clippy::drop_bounds, drop_bounds)]
diff --git a/crates/pin-project-lite/tests/expand/multifields/struct.rs b/crates/pin-project-lite/tests/expand/multifields/struct.rs
index a1d45d1..2bff55d 100644
--- a/crates/pin-project-lite/tests/expand/multifields/struct.rs
+++ b/crates/pin-project-lite/tests/expand/multifields/struct.rs
@@ -1,3 +1,5 @@
+// SPDX-License-Identifier: Apache-2.0 OR MIT
+
use pin_project_lite::pin_project;
pin_project! {
diff --git a/crates/pin-project-lite/tests/expand/naming/enum-all.expanded.rs b/crates/pin-project-lite/tests/expand/naming/enum-all.expanded.rs
index 456b8cc..b01e4a8 100644
--- a/crates/pin-project-lite/tests/expand/naming/enum-all.expanded.rs
+++ b/crates/pin-project-lite/tests/expand/naming/enum-all.expanded.rs
@@ -133,7 +133,9 @@
}
impl<'__pin, T, U> ::pin_project_lite::__private::Unpin for Enum<T, U>
where
- __Origin<'__pin, T, U>: ::pin_project_lite::__private::Unpin,
+ ::pin_project_lite::__private::PinnedFieldsOf<
+ __Origin<'__pin, T, U>,
+ >: ::pin_project_lite::__private::Unpin,
{}
trait MustNotImplDrop {}
#[allow(clippy::drop_bounds, drop_bounds)]
diff --git a/crates/pin-project-lite/tests/expand/naming/enum-all.rs b/crates/pin-project-lite/tests/expand/naming/enum-all.rs
index 90d6860..c9d9851 100644
--- a/crates/pin-project-lite/tests/expand/naming/enum-all.rs
+++ b/crates/pin-project-lite/tests/expand/naming/enum-all.rs
@@ -1,3 +1,5 @@
+// SPDX-License-Identifier: Apache-2.0 OR MIT
+
use pin_project_lite::pin_project;
pin_project! {
diff --git a/crates/pin-project-lite/tests/expand/naming/enum-mut.expanded.rs b/crates/pin-project-lite/tests/expand/naming/enum-mut.expanded.rs
index 342588c..7143c74 100644
--- a/crates/pin-project-lite/tests/expand/naming/enum-mut.expanded.rs
+++ b/crates/pin-project-lite/tests/expand/naming/enum-mut.expanded.rs
@@ -54,7 +54,9 @@
}
impl<'__pin, T, U> ::pin_project_lite::__private::Unpin for Enum<T, U>
where
- __Origin<'__pin, T, U>: ::pin_project_lite::__private::Unpin,
+ ::pin_project_lite::__private::PinnedFieldsOf<
+ __Origin<'__pin, T, U>,
+ >: ::pin_project_lite::__private::Unpin,
{}
trait MustNotImplDrop {}
#[allow(clippy::drop_bounds, drop_bounds)]
diff --git a/crates/pin-project-lite/tests/expand/naming/enum-mut.rs b/crates/pin-project-lite/tests/expand/naming/enum-mut.rs
index 69beecd..1e68532 100644
--- a/crates/pin-project-lite/tests/expand/naming/enum-mut.rs
+++ b/crates/pin-project-lite/tests/expand/naming/enum-mut.rs
@@ -1,3 +1,5 @@
+// SPDX-License-Identifier: Apache-2.0 OR MIT
+
use pin_project_lite::pin_project;
pin_project! {
diff --git a/crates/pin-project-lite/tests/expand/naming/enum-none.expanded.rs b/crates/pin-project-lite/tests/expand/naming/enum-none.expanded.rs
index fc3b3dc..b03fb6d 100644
--- a/crates/pin-project-lite/tests/expand/naming/enum-none.expanded.rs
+++ b/crates/pin-project-lite/tests/expand/naming/enum-none.expanded.rs
@@ -16,7 +16,9 @@
}
impl<'__pin, T, U> ::pin_project_lite::__private::Unpin for Enum<T, U>
where
- __Origin<'__pin, T, U>: ::pin_project_lite::__private::Unpin,
+ ::pin_project_lite::__private::PinnedFieldsOf<
+ __Origin<'__pin, T, U>,
+ >: ::pin_project_lite::__private::Unpin,
{}
trait MustNotImplDrop {}
#[allow(clippy::drop_bounds, drop_bounds)]
diff --git a/crates/pin-project-lite/tests/expand/naming/enum-none.rs b/crates/pin-project-lite/tests/expand/naming/enum-none.rs
index b2e3f9d..0228135 100644
--- a/crates/pin-project-lite/tests/expand/naming/enum-none.rs
+++ b/crates/pin-project-lite/tests/expand/naming/enum-none.rs
@@ -1,3 +1,5 @@
+// SPDX-License-Identifier: Apache-2.0 OR MIT
+
use pin_project_lite::pin_project;
pin_project! {
diff --git a/crates/pin-project-lite/tests/expand/naming/enum-ref.expanded.rs b/crates/pin-project-lite/tests/expand/naming/enum-ref.expanded.rs
index 5270e12..27476d2 100644
--- a/crates/pin-project-lite/tests/expand/naming/enum-ref.expanded.rs
+++ b/crates/pin-project-lite/tests/expand/naming/enum-ref.expanded.rs
@@ -54,7 +54,9 @@
}
impl<'__pin, T, U> ::pin_project_lite::__private::Unpin for Enum<T, U>
where
- __Origin<'__pin, T, U>: ::pin_project_lite::__private::Unpin,
+ ::pin_project_lite::__private::PinnedFieldsOf<
+ __Origin<'__pin, T, U>,
+ >: ::pin_project_lite::__private::Unpin,
{}
trait MustNotImplDrop {}
#[allow(clippy::drop_bounds, drop_bounds)]
diff --git a/crates/pin-project-lite/tests/expand/naming/enum-ref.rs b/crates/pin-project-lite/tests/expand/naming/enum-ref.rs
index 480d592..8f81d38 100644
--- a/crates/pin-project-lite/tests/expand/naming/enum-ref.rs
+++ b/crates/pin-project-lite/tests/expand/naming/enum-ref.rs
@@ -1,3 +1,5 @@
+// SPDX-License-Identifier: Apache-2.0 OR MIT
+
use pin_project_lite::pin_project;
pin_project! {
diff --git a/crates/pin-project-lite/tests/expand/naming/struct-all.expanded.rs b/crates/pin-project-lite/tests/expand/naming/struct-all.expanded.rs
index 13c4079..e9abe0f 100644
--- a/crates/pin-project-lite/tests/expand/naming/struct-all.expanded.rs
+++ b/crates/pin-project-lite/tests/expand/naming/struct-all.expanded.rs
@@ -113,7 +113,9 @@
}
impl<'__pin, T, U> ::pin_project_lite::__private::Unpin for Struct<T, U>
where
- __Origin<'__pin, T, U>: ::pin_project_lite::__private::Unpin,
+ ::pin_project_lite::__private::PinnedFieldsOf<
+ __Origin<'__pin, T, U>,
+ >: ::pin_project_lite::__private::Unpin,
{}
trait MustNotImplDrop {}
#[allow(clippy::drop_bounds, drop_bounds)]
diff --git a/crates/pin-project-lite/tests/expand/naming/struct-all.rs b/crates/pin-project-lite/tests/expand/naming/struct-all.rs
index cb08753..c4b2e34 100644
--- a/crates/pin-project-lite/tests/expand/naming/struct-all.rs
+++ b/crates/pin-project-lite/tests/expand/naming/struct-all.rs
@@ -1,3 +1,5 @@
+// SPDX-License-Identifier: Apache-2.0 OR MIT
+
use pin_project_lite::pin_project;
pin_project! {
diff --git a/crates/pin-project-lite/tests/expand/naming/struct-mut.expanded.rs b/crates/pin-project-lite/tests/expand/naming/struct-mut.expanded.rs
index 9b6dae8..5655548 100644
--- a/crates/pin-project-lite/tests/expand/naming/struct-mut.expanded.rs
+++ b/crates/pin-project-lite/tests/expand/naming/struct-mut.expanded.rs
@@ -75,7 +75,9 @@
}
impl<'__pin, T, U> ::pin_project_lite::__private::Unpin for Struct<T, U>
where
- __Origin<'__pin, T, U>: ::pin_project_lite::__private::Unpin,
+ ::pin_project_lite::__private::PinnedFieldsOf<
+ __Origin<'__pin, T, U>,
+ >: ::pin_project_lite::__private::Unpin,
{}
trait MustNotImplDrop {}
#[allow(clippy::drop_bounds, drop_bounds)]
diff --git a/crates/pin-project-lite/tests/expand/naming/struct-mut.rs b/crates/pin-project-lite/tests/expand/naming/struct-mut.rs
index 59db445..e28a03a 100644
--- a/crates/pin-project-lite/tests/expand/naming/struct-mut.rs
+++ b/crates/pin-project-lite/tests/expand/naming/struct-mut.rs
@@ -1,3 +1,5 @@
+// SPDX-License-Identifier: Apache-2.0 OR MIT
+
use pin_project_lite::pin_project;
pin_project! {
diff --git a/crates/pin-project-lite/tests/expand/naming/struct-none.expanded.rs b/crates/pin-project-lite/tests/expand/naming/struct-none.expanded.rs
index a9792e1..4c86c89 100644
--- a/crates/pin-project-lite/tests/expand/naming/struct-none.expanded.rs
+++ b/crates/pin-project-lite/tests/expand/naming/struct-none.expanded.rs
@@ -75,7 +75,9 @@
}
impl<'__pin, T, U> ::pin_project_lite::__private::Unpin for Struct<T, U>
where
- __Origin<'__pin, T, U>: ::pin_project_lite::__private::Unpin,
+ ::pin_project_lite::__private::PinnedFieldsOf<
+ __Origin<'__pin, T, U>,
+ >: ::pin_project_lite::__private::Unpin,
{}
trait MustNotImplDrop {}
#[allow(clippy::drop_bounds, drop_bounds)]
diff --git a/crates/pin-project-lite/tests/expand/naming/struct-none.rs b/crates/pin-project-lite/tests/expand/naming/struct-none.rs
index e5447c7..e4245d1 100644
--- a/crates/pin-project-lite/tests/expand/naming/struct-none.rs
+++ b/crates/pin-project-lite/tests/expand/naming/struct-none.rs
@@ -1,3 +1,5 @@
+// SPDX-License-Identifier: Apache-2.0 OR MIT
+
use pin_project_lite::pin_project;
pin_project! {
diff --git a/crates/pin-project-lite/tests/expand/naming/struct-ref.expanded.rs b/crates/pin-project-lite/tests/expand/naming/struct-ref.expanded.rs
index 9fea20d..5c834b6 100644
--- a/crates/pin-project-lite/tests/expand/naming/struct-ref.expanded.rs
+++ b/crates/pin-project-lite/tests/expand/naming/struct-ref.expanded.rs
@@ -75,7 +75,9 @@
}
impl<'__pin, T, U> ::pin_project_lite::__private::Unpin for Struct<T, U>
where
- __Origin<'__pin, T, U>: ::pin_project_lite::__private::Unpin,
+ ::pin_project_lite::__private::PinnedFieldsOf<
+ __Origin<'__pin, T, U>,
+ >: ::pin_project_lite::__private::Unpin,
{}
trait MustNotImplDrop {}
#[allow(clippy::drop_bounds, drop_bounds)]
diff --git a/crates/pin-project-lite/tests/expand/naming/struct-ref.rs b/crates/pin-project-lite/tests/expand/naming/struct-ref.rs
index 6821af8..ce0d946 100644
--- a/crates/pin-project-lite/tests/expand/naming/struct-ref.rs
+++ b/crates/pin-project-lite/tests/expand/naming/struct-ref.rs
@@ -1,3 +1,5 @@
+// SPDX-License-Identifier: Apache-2.0 OR MIT
+
use pin_project_lite::pin_project;
pin_project! {
diff --git a/crates/pin-project-lite/tests/expand/not_unpin/enum.rs b/crates/pin-project-lite/tests/expand/not_unpin/enum.rs
index 0896716..1c970b8 100644
--- a/crates/pin-project-lite/tests/expand/not_unpin/enum.rs
+++ b/crates/pin-project-lite/tests/expand/not_unpin/enum.rs
@@ -1,3 +1,5 @@
+// SPDX-License-Identifier: Apache-2.0 OR MIT
+
use pin_project_lite::pin_project;
pin_project! {
diff --git a/crates/pin-project-lite/tests/expand/not_unpin/struct.rs b/crates/pin-project-lite/tests/expand/not_unpin/struct.rs
index 0a2967f..f15ef2b 100644
--- a/crates/pin-project-lite/tests/expand/not_unpin/struct.rs
+++ b/crates/pin-project-lite/tests/expand/not_unpin/struct.rs
@@ -1,3 +1,5 @@
+// SPDX-License-Identifier: Apache-2.0 OR MIT
+
use pin_project_lite::pin_project;
pin_project! {
diff --git a/crates/pin-project-lite/tests/expand/pinned_drop/enum.expanded.rs b/crates/pin-project-lite/tests/expand/pinned_drop/enum.expanded.rs
index 03901ce..c591a32 100644
--- a/crates/pin-project-lite/tests/expand/pinned_drop/enum.expanded.rs
+++ b/crates/pin-project-lite/tests/expand/pinned_drop/enum.expanded.rs
@@ -1,4 +1,3 @@
-use std::pin::Pin;
use pin_project_lite::pin_project;
enum Enum<T, U> {
Struct { pinned: T, unpinned: U },
@@ -92,7 +91,9 @@
}
impl<'__pin, T, U> ::pin_project_lite::__private::Unpin for Enum<T, U>
where
- __Origin<'__pin, T, U>: ::pin_project_lite::__private::Unpin,
+ ::pin_project_lite::__private::PinnedFieldsOf<
+ __Origin<'__pin, T, U>,
+ >: ::pin_project_lite::__private::Unpin,
{}
impl<T, U> ::pin_project_lite::__private::Drop for Enum<T, U> {
fn drop(&mut self) {
diff --git a/crates/pin-project-lite/tests/expand/pinned_drop/enum.rs b/crates/pin-project-lite/tests/expand/pinned_drop/enum.rs
index 5f3508c..1449c9a 100644
--- a/crates/pin-project-lite/tests/expand/pinned_drop/enum.rs
+++ b/crates/pin-project-lite/tests/expand/pinned_drop/enum.rs
@@ -1,4 +1,4 @@
-use std::pin::Pin;
+// SPDX-License-Identifier: Apache-2.0 OR MIT
use pin_project_lite::pin_project;
diff --git a/crates/pin-project-lite/tests/expand/pinned_drop/struct.expanded.rs b/crates/pin-project-lite/tests/expand/pinned_drop/struct.expanded.rs
index f3fa923..366171f 100644
--- a/crates/pin-project-lite/tests/expand/pinned_drop/struct.expanded.rs
+++ b/crates/pin-project-lite/tests/expand/pinned_drop/struct.expanded.rs
@@ -1,4 +1,3 @@
-use std::pin::Pin;
use pin_project_lite::pin_project;
struct Struct<T, U> {
pinned: T,
@@ -76,7 +75,9 @@
}
impl<'__pin, T, U> ::pin_project_lite::__private::Unpin for Struct<T, U>
where
- __Origin<'__pin, T, U>: ::pin_project_lite::__private::Unpin,
+ ::pin_project_lite::__private::PinnedFieldsOf<
+ __Origin<'__pin, T, U>,
+ >: ::pin_project_lite::__private::Unpin,
{}
impl<T, U> ::pin_project_lite::__private::Drop for Struct<T, U> {
fn drop(&mut self) {
diff --git a/crates/pin-project-lite/tests/expand/pinned_drop/struct.rs b/crates/pin-project-lite/tests/expand/pinned_drop/struct.rs
index 5400ecb..0a61c20 100644
--- a/crates/pin-project-lite/tests/expand/pinned_drop/struct.rs
+++ b/crates/pin-project-lite/tests/expand/pinned_drop/struct.rs
@@ -1,4 +1,4 @@
-use std::pin::Pin;
+// SPDX-License-Identifier: Apache-2.0 OR MIT
use pin_project_lite::pin_project;
diff --git a/crates/pin-project-lite/tests/expand/pub/enum.expanded.rs b/crates/pin-project-lite/tests/expand/pub/enum.expanded.rs
index 85c7770..eddb690 100644
--- a/crates/pin-project-lite/tests/expand/pub/enum.expanded.rs
+++ b/crates/pin-project-lite/tests/expand/pub/enum.expanded.rs
@@ -91,7 +91,9 @@
}
impl<'__pin, T, U> ::pin_project_lite::__private::Unpin for Enum<T, U>
where
- __Origin<'__pin, T, U>: ::pin_project_lite::__private::Unpin,
+ ::pin_project_lite::__private::PinnedFieldsOf<
+ __Origin<'__pin, T, U>,
+ >: ::pin_project_lite::__private::Unpin,
{}
trait MustNotImplDrop {}
#[allow(clippy::drop_bounds, drop_bounds)]
diff --git a/crates/pin-project-lite/tests/expand/pub/enum.rs b/crates/pin-project-lite/tests/expand/pub/enum.rs
index d3968af..789f019 100644
--- a/crates/pin-project-lite/tests/expand/pub/enum.rs
+++ b/crates/pin-project-lite/tests/expand/pub/enum.rs
@@ -1,3 +1,5 @@
+// SPDX-License-Identifier: Apache-2.0 OR MIT
+
use pin_project_lite::pin_project;
pin_project! {
diff --git a/crates/pin-project-lite/tests/expand/pub/struct.expanded.rs b/crates/pin-project-lite/tests/expand/pub/struct.expanded.rs
index a06783d..7df7e3f 100644
--- a/crates/pin-project-lite/tests/expand/pub/struct.expanded.rs
+++ b/crates/pin-project-lite/tests/expand/pub/struct.expanded.rs
@@ -75,7 +75,9 @@
}
impl<'__pin, T, U> ::pin_project_lite::__private::Unpin for Struct<T, U>
where
- __Origin<'__pin, T, U>: ::pin_project_lite::__private::Unpin,
+ ::pin_project_lite::__private::PinnedFieldsOf<
+ __Origin<'__pin, T, U>,
+ >: ::pin_project_lite::__private::Unpin,
{}
trait MustNotImplDrop {}
#[allow(clippy::drop_bounds, drop_bounds)]
diff --git a/crates/pin-project-lite/tests/expand/pub/struct.rs b/crates/pin-project-lite/tests/expand/pub/struct.rs
index 6659096..a87d4b8 100644
--- a/crates/pin-project-lite/tests/expand/pub/struct.rs
+++ b/crates/pin-project-lite/tests/expand/pub/struct.rs
@@ -1,3 +1,5 @@
+// SPDX-License-Identifier: Apache-2.0 OR MIT
+
use pin_project_lite::pin_project;
pin_project! {
diff --git a/crates/pin-project-lite/tests/expandtest.rs b/crates/pin-project-lite/tests/expandtest.rs
index 04a0666..832a0ea 100644
--- a/crates/pin-project-lite/tests/expandtest.rs
+++ b/crates/pin-project-lite/tests/expandtest.rs
@@ -1,44 +1,10 @@
+// SPDX-License-Identifier: Apache-2.0 OR MIT
+
#![cfg(not(miri))]
-#![cfg(not(careful))]
-#![warn(rust_2018_idioms, single_use_lifetimes)]
-
-use std::{
- env,
- process::{Command, ExitStatus, Stdio},
-};
-
-const PATH: &str = "tests/expand/**/*.rs";
#[rustversion::attr(not(nightly), ignore)]
#[test]
fn expandtest() {
- let is_ci = env::var_os("CI").is_some();
- let cargo = &*env::var("CARGO").unwrap_or_else(|_| "cargo".into());
- if !has_command(&[cargo, "expand"]) {
- if is_ci {
- panic!("expandtest requires cargo-expand");
- }
- return;
- }
-
let args = &["--all-features"];
- if is_ci {
- macrotest::expand_without_refresh_args(PATH, args);
- } else {
- env::set_var("MACROTEST", "overwrite");
- macrotest::expand_args(PATH, args);
- }
-}
-
-fn has_command(command: &[&str]) -> bool {
- Command::new(command[0])
- .args(&command[1..])
- .arg("--version")
- .stdin(Stdio::null())
- .stdout(Stdio::null())
- .stderr(Stdio::null())
- .status()
- .as_ref()
- .map(ExitStatus::success)
- .unwrap_or(false)
+ macrotest::expand_args("tests/expand/**/*.rs", args);
}
diff --git a/crates/pin-project-lite/tests/include/basic.rs b/crates/pin-project-lite/tests/include/basic.rs
index 25121f2..bfd7d8f 100644
--- a/crates/pin-project-lite/tests/include/basic.rs
+++ b/crates/pin-project-lite/tests/include/basic.rs
@@ -1,6 +1,9 @@
+// SPDX-License-Identifier: Apache-2.0 OR MIT
+
// default pin_project! is completely safe.
::pin_project_lite::pin_project! {
+ /// Testing default struct.
#[derive(Debug)]
pub struct DefaultStruct<T, U> {
#[pin]
@@ -10,6 +13,7 @@
}
::pin_project_lite::pin_project! {
+ /// Testing named struct.
#[project = DefaultStructProj]
#[project_ref = DefaultStructProjRef]
#[derive(Debug)]
@@ -21,15 +25,18 @@
}
::pin_project_lite::pin_project! {
+ /// Testing enum.
#[project = DefaultEnumProj]
#[project_ref = DefaultEnumProjRef]
#[derive(Debug)]
pub enum DefaultEnum<T, U> {
+ /// Struct variant.
Struct {
#[pin]
pinned: T,
unpinned: U,
},
+ /// Unit variant.
Unit,
}
}
diff --git a/crates/pin-project-lite/tests/lint.rs b/crates/pin-project-lite/tests/lint.rs
deleted file mode 100644
index 94f72fd..0000000
--- a/crates/pin-project-lite/tests/lint.rs
+++ /dev/null
@@ -1,281 +0,0 @@
-// Check interoperability with rustc and clippy lints.
-
-#![forbid(unsafe_code)]
-// for old compilers
-#![allow(unknown_lints)]
-#![warn(nonstandard_style, rust_2018_idioms, unused)]
-// Note: This does not guarantee compatibility with forbidding these lints in the future.
-// If rustc adds a new lint, we may not be able to keep this.
-#![forbid(future_incompatible, rust_2018_compatibility, rust_2021_compatibility)]
-// lints forbidden as a part of future_incompatible, rust_2018_compatibility, and rust_2021_compatibility are not included in the list below.
-// elided_lifetimes_in_paths, explicit_outlives_requirements, unused_extern_crates: as a part of rust_2018_idioms
-// unsafe_op_in_unsafe_fn: requires Rust 1.52. and, we don't generate unsafe fn.
-// non_exhaustive_omitted_patterns, multiple_supertrait_upcastable: 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, must_not_suspend: unrelated
-// unsafe_code: checked in forbid_unsafe module
-#![warn(
- box_pointers,
- deprecated_in_future,
- fuzzy_provenance_casts,
- invalid_reference_casting,
- let_underscore_drop,
- lossy_provenance_casts,
- macro_use_extern_crate,
- meta_variable_misuse,
- missing_abi,
- missing_copy_implementations,
- missing_debug_implementations,
- missing_docs,
- non_ascii_idents,
- noop_method_call,
- private_bounds,
- private_interfaces,
- single_use_lifetimes,
- trivial_casts,
- trivial_numeric_casts,
- unnameable_types,
- unreachable_pub,
- unused_import_braces,
- unused_lifetimes,
- unused_qualifications,
- unused_results,
- unused_tuple_struct_fields,
- variant_size_differences
-)]
-#![warn(clippy::all, clippy::pedantic, clippy::nursery, clippy::restriction)]
-#![allow(clippy::blanket_clippy_restriction_lints)] // this is a test, so enable all restriction lints intentionally.
-#![allow(
- clippy::exhaustive_enums,
- clippy::exhaustive_structs,
- clippy::min_ident_chars,
- clippy::single_char_lifetime_names
-)] // TODO
-
-pub mod basic {
- include!("include/basic.rs");
-}
-
-pub mod box_pointers {
- use pin_project_lite::pin_project;
-
- pin_project! {
- #[derive(Debug)]
- pub struct Struct {
- #[pin]
- pub p: Box<isize>,
- pub u: Box<isize>,
- }
- }
-
- pin_project! {
- #[project = EnumProj]
- #[project_ref = EnumProjRef]
- #[project(!Unpin)]
- #[derive(Debug)]
- pub enum Enum {
- Struct {
- #[pin]
- p: Box<isize>,
- u: Box<isize>,
- },
- Unit,
- }
- }
-}
-
-pub mod explicit_outlives_requirements {
- use pin_project_lite::pin_project;
-
- pin_project! {
- #[derive(Debug)]
- pub struct Struct<'a, T, U>
- where
- T: ?Sized,
- U: ?Sized,
- {
- #[pin]
- pub pinned: &'a mut T,
- pub unpinned: &'a mut U,
- }
- }
-
- pin_project! {
- #[project = EnumProj]
- #[project_ref = EnumProjRef]
- #[project(!Unpin)]
- #[derive(Debug)]
- pub enum Enum<'a, T, U>
- where
- T: ?Sized,
- U: ?Sized,
- {
- Struct {
- #[pin]
- pinned: &'a mut T,
- unpinned: &'a mut U,
- },
- Unit,
- }
- }
-}
-
-pub mod variant_size_differences {
- use pin_project_lite::pin_project;
-
- pin_project! {
- #[project = EnumProj]
- #[project_ref = EnumProjRef]
- #[project(!Unpin)]
- #[allow(missing_debug_implementations, missing_copy_implementations)] // https://github.com/rust-lang/rust/pull/74060
- #[allow(variant_size_differences)] // for the type itself
- #[allow(clippy::large_enum_variant)] // for the type itself
- pub enum Enum {
- V1 { f: u8 },
- V2 { f: [u8; 1024] },
- }
- }
-}
-
-pub mod clippy_mut_mut {
- use pin_project_lite::pin_project;
-
- pin_project! {
- #[derive(Debug)]
- pub struct Struct<'a, T, U> {
- #[pin]
- pub pinned: &'a mut T,
- pub unpinned: &'a mut U,
- }
- }
-
- pin_project! {
- #[project = EnumProj]
- #[project_ref = EnumProjRef]
- #[project(!Unpin)]
- #[derive(Debug)]
- pub enum Enum<'a, T, U> {
- Struct {
- #[pin]
- pinned: &'a mut T,
- unpinned: &'a mut U,
- },
- Unit,
- }
- }
-}
-
-#[allow(unreachable_pub)]
-mod clippy_redundant_pub_crate {
- use pin_project_lite::pin_project;
-
- pin_project! {
- #[derive(Debug)]
- pub struct Struct<T, U> {
- #[pin]
- pub pinned: T,
- pub unpinned: U,
- }
- }
-
- pin_project! {
- #[project = EnumProj]
- #[project_ref = EnumProjRef]
- #[project(!Unpin)]
- #[derive(Debug)]
- pub enum Enum<T, U> {
- Struct {
- #[pin]
- pinned: T,
- unpinned: U,
- },
- Unit,
- }
- }
-}
-
-#[allow(clippy::use_self)]
-pub mod clippy_type_repetition_in_bounds {
- use pin_project_lite::pin_project;
-
- pin_project! {
- #[derive(Debug)]
- pub struct Struct<T, U>
- where
- Struct<T, U>: Sized,
- {
- #[pin]
- pub pinned: T,
- pub unpinned: U,
- }
- }
-
- pin_project! {
- #[project = EnumProj]
- #[project_ref = EnumProjRef]
- #[project(!Unpin)]
- #[derive(Debug)]
- pub enum Enum<T, U>
- where
- Enum<T, U>: Sized,
- {
- Struct {
- #[pin]
- pinned: T,
- unpinned: U,
- },
- Unit,
- }
- }
-}
-
-#[allow(missing_debug_implementations)]
-pub mod clippy_used_underscore_binding {
- use pin_project_lite::pin_project;
-
- pin_project! {
- pub struct Struct<T, U> {
- #[pin]
- pub _pinned: T,
- pub _unpinned: U,
- }
- }
-
- pin_project! {
- #[project = EnumProj]
- #[project_ref = EnumProjRef]
- #[project(!Unpin)]
- pub enum Enum<T, U> {
- Struct {
- #[pin]
- _pinned: T,
- _unpinned: U,
- },
- }
- }
-}
-
-pub mod clippy_ref_option_ref {
- use pin_project_lite::pin_project;
-
- pin_project! {
- pub struct Struct<'a> {
- #[pin]
- pub _pinned: Option<&'a ()>,
- pub _unpinned: Option<&'a ()>,
- }
- }
-
- pin_project! {
- #[project = EnumProj]
- #[project_ref = EnumProjRef]
- #[project(!Unpin)]
- pub enum Enum<'a> {
- Struct {
- #[pin]
- _pinned: Option<&'a ()>,
- _unpinned: Option<&'a ()>,
- },
- }
- }
-}
diff --git a/crates/pin-project-lite/tests/proper_unpin.rs b/crates/pin-project-lite/tests/proper_unpin.rs
index 89235a4..6dcf4bd 100644
--- a/crates/pin-project-lite/tests/proper_unpin.rs
+++ b/crates/pin-project-lite/tests/proper_unpin.rs
@@ -1,4 +1,5 @@
-#![warn(rust_2018_idioms, single_use_lifetimes)]
+// SPDX-License-Identifier: Apache-2.0 OR MIT
+
#![allow(dead_code)]
#[macro_use]
diff --git a/crates/pin-project-lite/tests/test.rs b/crates/pin-project-lite/tests/test.rs
index d128930..219efae 100644
--- a/crates/pin-project-lite/tests/test.rs
+++ b/crates/pin-project-lite/tests/test.rs
@@ -1,5 +1,6 @@
-#![warn(rust_2018_idioms, single_use_lifetimes)]
-#![allow(dead_code)]
+// SPDX-License-Identifier: Apache-2.0 OR MIT
+
+#![allow(dead_code, unreachable_pub, clippy::no_effect_underscore_binding)]
#[macro_use]
mod auxiliary;
@@ -448,7 +449,7 @@
}
let mut x = Struct1 { f: 0_u8 };
- let x: Pin<&mut Struct1<dyn core::fmt::Debug>> = Pin::new(&mut x as _);
+ let x: Pin<&mut Struct1<dyn core::fmt::Debug>> = Pin::new(&mut x);
let _: &mut (dyn core::fmt::Debug) = x.project().f;
pin_project! {
@@ -459,7 +460,7 @@
}
let mut x = Struct2 { f: 0_u8 };
- let x: Pin<&mut Struct2<dyn core::fmt::Debug + Unpin>> = Pin::new(&mut x as _);
+ let x: Pin<&mut Struct2<dyn core::fmt::Debug + Unpin>> = Pin::new(&mut x);
let _: Pin<&mut (dyn core::fmt::Debug + Unpin)> = x.project().f;
pin_project! {
diff --git a/crates/pin-project-lite/tests/ui/pin_project/conflict-drop.rs b/crates/pin-project-lite/tests/ui/pin_project/conflict-drop.rs
index 870059d..724d7d6 100644
--- a/crates/pin-project-lite/tests/ui/pin_project/conflict-drop.rs
+++ b/crates/pin-project-lite/tests/ui/pin_project/conflict-drop.rs
@@ -1,3 +1,5 @@
+// SPDX-License-Identifier: Apache-2.0 OR MIT
+
use pin_project_lite::pin_project;
pin_project! { //~ ERROR E0119
diff --git a/crates/pin-project-lite/tests/ui/pin_project/conflict-drop.stderr b/crates/pin-project-lite/tests/ui/pin_project/conflict-drop.stderr
index 8c870d7..13d89c0 100644
--- a/crates/pin-project-lite/tests/ui/pin_project/conflict-drop.stderr
+++ b/crates/pin-project-lite/tests/ui/pin_project/conflict-drop.stderr
@@ -1,16 +1,16 @@
error[E0119]: conflicting implementations of trait `MustNotImplDrop` for type `Foo<_, _>`
- --> tests/ui/pin_project/conflict-drop.rs:3:1
- |
-3 | / pin_project! { //~ ERROR E0119
-4 | | struct Foo<T, U> {
-5 | | #[pin]
-6 | | future: T,
-7 | | field: U,
-8 | | }
-9 | | }
- | | ^
- | | |
- | |_first implementation here
- | conflicting implementation for `Foo<_, _>`
- |
- = note: this error originates in the macro `$crate::__pin_project_make_drop_impl` which comes from the expansion of the macro `pin_project` (in Nightly builds, run with -Z macro-backtrace for more info)
+ --> tests/ui/pin_project/conflict-drop.rs:5:1
+ |
+5 | / pin_project! { //~ ERROR E0119
+6 | | struct Foo<T, U> {
+7 | | #[pin]
+8 | | future: T,
+9 | | field: U,
+10 | | }
+11 | | }
+ | | ^
+ | | |
+ | |_first implementation here
+ | conflicting implementation for `Foo<_, _>`
+ |
+ = note: this error originates in the macro `$crate::__pin_project_make_drop_impl` which comes from the expansion of the macro `pin_project` (in Nightly builds, run with -Z macro-backtrace for more info)
diff --git a/crates/pin-project-lite/tests/ui/pin_project/conflict-unpin.rs b/crates/pin-project-lite/tests/ui/pin_project/conflict-unpin.rs
index bdab20f..b3564b0 100644
--- a/crates/pin-project-lite/tests/ui/pin_project/conflict-unpin.rs
+++ b/crates/pin-project-lite/tests/ui/pin_project/conflict-unpin.rs
@@ -1,3 +1,5 @@
+// SPDX-License-Identifier: Apache-2.0 OR MIT
+
use pin_project_lite::pin_project;
// The same implementation.
diff --git a/crates/pin-project-lite/tests/ui/pin_project/conflict-unpin.stderr b/crates/pin-project-lite/tests/ui/pin_project/conflict-unpin.stderr
index cf9818e..44aa959 100644
--- a/crates/pin-project-lite/tests/ui/pin_project/conflict-unpin.stderr
+++ b/crates/pin-project-lite/tests/ui/pin_project/conflict-unpin.stderr
@@ -1,84 +1,86 @@
error[E0119]: conflicting implementations of trait `Unpin` for type `Foo<_, _>`
- --> tests/ui/pin_project/conflict-unpin.rs:5:1
+ --> tests/ui/pin_project/conflict-unpin.rs:7:1
|
-5 | / pin_project! { //~ ERROR E0119
-6 | | struct Foo<T, U> {
-7 | | #[pin]
-8 | | future: T,
-9 | | field: U,
-10 | | }
-11 | | }
+7 | / pin_project! { //~ ERROR E0119
+8 | | struct Foo<T, U> {
+9 | | #[pin]
+10 | | future: T,
+11 | | field: U,
+12 | | }
+13 | | }
| |_^ conflicting implementation for `Foo<_, _>`
...
-14 | impl<T, U> Unpin for Foo<T, U> where T: Unpin {} // Conditional Unpin impl
- | ------------------------------ first implementation here
+16 | impl<T, U> Unpin for Foo<T, U> where T: Unpin {} // Conditional Unpin impl
+ | --------------------------------------------- first implementation here
|
= note: this error originates in the macro `$crate::__pin_project_make_unpin_impl` which comes from the expansion of the macro `pin_project` (in Nightly builds, run with -Z macro-backtrace for more info)
error[E0119]: conflicting implementations of trait `Unpin` for type `Bar<_, _>`
- --> tests/ui/pin_project/conflict-unpin.rs:18:1
+ --> tests/ui/pin_project/conflict-unpin.rs:20:1
|
-18 | / pin_project! { //~ ERROR E0119
-19 | | struct Bar<T, U> {
-20 | | #[pin]
-21 | | future: T,
-22 | | field: U,
-23 | | }
-24 | | }
+20 | / pin_project! { //~ ERROR E0119
+21 | | struct Bar<T, U> {
+22 | | #[pin]
+23 | | future: T,
+24 | | field: U,
+25 | | }
+26 | | }
| |_^ conflicting implementation for `Bar<_, _>`
...
-27 | impl<T, U> Unpin for Bar<T, U> {} // Non-conditional Unpin impl
+29 | impl<T, U> Unpin for Bar<T, U> {} // Non-conditional Unpin impl
| ------------------------------ first implementation here
|
= note: this error originates in the macro `$crate::__pin_project_make_unpin_impl` which comes from the expansion of the macro `pin_project` (in Nightly builds, run with -Z macro-backtrace for more info)
error[E0119]: conflicting implementations of trait `Unpin` for type `Baz<_, _>`
- --> tests/ui/pin_project/conflict-unpin.rs:29:1
+ --> tests/ui/pin_project/conflict-unpin.rs:31:1
|
-29 | / pin_project! { //~ ERROR E0119
-30 | | struct Baz<T, U> {
-31 | | #[pin]
-32 | | future: T,
-33 | | field: U,
-34 | | }
-35 | | }
+31 | / pin_project! { //~ ERROR E0119
+32 | | struct Baz<T, U> {
+33 | | #[pin]
+34 | | future: T,
+35 | | field: U,
+36 | | }
+37 | | }
| |_^ conflicting implementation for `Baz<_, _>`
...
-38 | impl<T: Unpin, U: Unpin> Unpin for Baz<T, U> {} // Conditional Unpin impl
+40 | impl<T: Unpin, U: Unpin> Unpin for Baz<T, U> {} // Conditional Unpin impl
| -------------------------------------------- first implementation here
|
= note: this error originates in the macro `$crate::__pin_project_make_unpin_impl` which comes from the expansion of the macro `pin_project` (in Nightly builds, run with -Z macro-backtrace for more info)
error[E0119]: conflicting implementations of trait `Unpin` for type `Qux<_, _>`
- --> tests/ui/pin_project/conflict-unpin.rs:40:1
+ --> tests/ui/pin_project/conflict-unpin.rs:42:1
|
-40 | / pin_project! { //~ ERROR E0119
-41 | | #[project(!Unpin)]
-42 | | struct Qux<T, U> {
-43 | | #[pin]
+42 | / pin_project! { //~ ERROR E0119
+43 | | #[project(!Unpin)]
+44 | | struct Qux<T, U> {
+45 | | #[pin]
... |
-46 | | }
-47 | | }
+48 | | }
+49 | | }
| |_^ conflicting implementation for `Qux<_, _>`
...
-50 | impl<T, U> Unpin for Qux<T, U> {} // Non-conditional Unpin impl
+52 | impl<T, U> Unpin for Qux<T, U> {} // Non-conditional Unpin impl
| ------------------------------ first implementation here
|
+ = note: upstream crates may add a new impl of trait `std::marker::Unpin` for type `(std::marker::PhantomData<&()>, std::marker::PhantomPinned)` in future versions
= note: this error originates in the macro `$crate::__pin_project_make_unpin_impl` which comes from the expansion of the macro `pin_project` (in Nightly builds, run with -Z macro-backtrace for more info)
error[E0119]: conflicting implementations of trait `Unpin` for type `Fred<_, _>`
- --> tests/ui/pin_project/conflict-unpin.rs:52:1
+ --> tests/ui/pin_project/conflict-unpin.rs:54:1
|
-52 | / pin_project! { //~ ERROR E0119
-53 | | #[project(!Unpin)]
-54 | | struct Fred<T, U> {
-55 | | #[pin]
+54 | / pin_project! { //~ ERROR E0119
+55 | | #[project(!Unpin)]
+56 | | struct Fred<T, U> {
+57 | | #[pin]
... |
-58 | | }
-59 | | }
+60 | | }
+61 | | }
| |_^ conflicting implementation for `Fred<_, _>`
...
-62 | impl<T: Unpin, U: Unpin> Unpin for Fred<T, U> {} // Conditional Unpin impl
+64 | impl<T: Unpin, U: Unpin> Unpin for Fred<T, U> {} // Conditional Unpin impl
| --------------------------------------------- first implementation here
|
+ = note: upstream crates may add a new impl of trait `std::marker::Unpin` for type `(std::marker::PhantomData<&()>, std::marker::PhantomPinned)` in future versions
= note: this error originates in the macro `$crate::__pin_project_make_unpin_impl` which comes from the expansion of the macro `pin_project` (in Nightly builds, run with -Z macro-backtrace for more info)
diff --git a/crates/pin-project-lite/tests/ui/pin_project/invalid-bounds.rs b/crates/pin-project-lite/tests/ui/pin_project/invalid-bounds.rs
index 64b397a..7b0e8c4 100644
--- a/crates/pin-project-lite/tests/ui/pin_project/invalid-bounds.rs
+++ b/crates/pin-project-lite/tests/ui/pin_project/invalid-bounds.rs
@@ -1,3 +1,5 @@
+// SPDX-License-Identifier: Apache-2.0 OR MIT
+
use pin_project_lite::pin_project;
pin_project! {
diff --git a/crates/pin-project-lite/tests/ui/pin_project/invalid-bounds.stderr b/crates/pin-project-lite/tests/ui/pin_project/invalid-bounds.stderr
index ae15b7a..084ff47 100644
--- a/crates/pin-project-lite/tests/ui/pin_project/invalid-bounds.stderr
+++ b/crates/pin-project-lite/tests/ui/pin_project/invalid-bounds.stderr
@@ -1,7 +1,7 @@
error: no rules expected the token `:`
- --> tests/ui/pin_project/invalid-bounds.rs:4:33
+ --> tests/ui/pin_project/invalid-bounds.rs:6:33
|
-4 | struct Generics1<T: 'static : Sized> { //~ ERROR no rules expected the token `:`
+6 | struct Generics1<T: 'static : Sized> { //~ ERROR no rules expected the token `:`
| ^ no rules expected this token in macro call
|
note: while trying to match `>`
@@ -11,9 +11,9 @@
| ^
error: no rules expected the token `:`
- --> tests/ui/pin_project/invalid-bounds.rs:10:33
+ --> tests/ui/pin_project/invalid-bounds.rs:12:33
|
-10 | struct Generics2<T: 'static : ?Sized> { //~ ERROR no rules expected the token `:`
+12 | struct Generics2<T: 'static : ?Sized> { //~ ERROR no rules expected the token `:`
| ^ no rules expected this token in macro call
|
note: while trying to match `>`
@@ -23,13 +23,13 @@
| ^
error: expected one of `+`, `,`, `=`, or `>`, found `:`
- --> tests/ui/pin_project/invalid-bounds.rs:15:1
+ --> tests/ui/pin_project/invalid-bounds.rs:17:1
|
-15 | / pin_project! {
-16 | | struct Generics3<T: Sized : 'static> { //~ ERROR expected one of `+`, `,`, `=`, or `>`, found `:`
-17 | | field: T,
-18 | | }
-19 | | }
+17 | / pin_project! {
+18 | | struct Generics3<T: Sized : 'static> { //~ ERROR expected one of `+`, `,`, `=`, or `>`, found `:`
+19 | | field: T,
+20 | | }
+21 | | }
| | ^
| | |
| | expected one of `+`, `,`, `=`, or `>`
@@ -37,15 +37,20 @@
| in this macro invocation
|
= note: this error originates in the macro `$crate::__pin_project_parse_generics` which comes from the expansion of the macro `pin_project` (in Nightly builds, run with -Z macro-backtrace for more info)
+help: you might have meant to end the type parameters here
+ --> src/lib.rs
+ |
+ | $(: $generics_bound>)?
+ | +
error: expected one of `+`, `,`, `=`, or `>`, found `:`
- --> tests/ui/pin_project/invalid-bounds.rs:15:1
+ --> tests/ui/pin_project/invalid-bounds.rs:17:1
|
-15 | / pin_project! {
-16 | | struct Generics3<T: Sized : 'static> { //~ ERROR expected one of `+`, `,`, `=`, or `>`, found `:`
-17 | | field: T,
-18 | | }
-19 | | }
+17 | / pin_project! {
+18 | | struct Generics3<T: Sized : 'static> { //~ ERROR expected one of `+`, `,`, `=`, or `>`, found `:`
+19 | | field: T,
+20 | | }
+21 | | }
| | ^
| | |
| |_expected one of `+`, `,`, `=`, or `>`
@@ -53,15 +58,20 @@
|
= note: type ascription syntax has been removed, see issue #101728 <https://github.com/rust-lang/rust/issues/101728>
= note: this error originates in the macro `$crate::__pin_project_parse_generics` which comes from the expansion of the macro `pin_project` (in Nightly builds, run with -Z macro-backtrace for more info)
+help: you might have meant to end the type parameters here
+ --> src/lib.rs
+ |
+ | $(: $generics_bound>)?
+ | +
error: expected one of `+`, `,`, `=`, or `>`, found `:`
- --> tests/ui/pin_project/invalid-bounds.rs:15:1
+ --> tests/ui/pin_project/invalid-bounds.rs:17:1
|
-15 | / pin_project! {
-16 | | struct Generics3<T: Sized : 'static> { //~ ERROR expected one of `+`, `,`, `=`, or `>`, found `:`
-17 | | field: T,
-18 | | }
-19 | | }
+17 | / pin_project! {
+18 | | struct Generics3<T: Sized : 'static> { //~ ERROR expected one of `+`, `,`, `=`, or `>`, found `:`
+19 | | field: T,
+20 | | }
+21 | | }
| | ^
| | |
| | expected one of `+`, `,`, `=`, or `>`
@@ -69,15 +79,20 @@
| in this macro invocation
|
= note: this error originates in the macro `$crate::__pin_project_parse_generics` which comes from the expansion of the macro `pin_project` (in Nightly builds, run with -Z macro-backtrace for more info)
+help: you might have meant to end the type parameters here
+ --> src/lib.rs
+ |
+ | $(: $generics_bound>)?
+ | +
error: expected one of `+`, `,`, `=`, or `>`, found `:`
- --> tests/ui/pin_project/invalid-bounds.rs:15:1
+ --> tests/ui/pin_project/invalid-bounds.rs:17:1
|
-15 | / pin_project! {
-16 | | struct Generics3<T: Sized : 'static> { //~ ERROR expected one of `+`, `,`, `=`, or `>`, found `:`
-17 | | field: T,
-18 | | }
-19 | | }
+17 | / pin_project! {
+18 | | struct Generics3<T: Sized : 'static> { //~ ERROR expected one of `+`, `,`, `=`, or `>`, found `:`
+19 | | field: T,
+20 | | }
+21 | | }
| | ^
| | |
| | expected one of `+`, `,`, `=`, or `>`
@@ -85,15 +100,20 @@
| in this macro invocation
|
= note: this error originates in the macro `$crate::__pin_project_parse_generics` which comes from the expansion of the macro `pin_project` (in Nightly builds, run with -Z macro-backtrace for more info)
+help: you might have meant to end the type parameters here
+ --> src/lib.rs
+ |
+ | $(: $generics_bound>)?
+ | +
error: expected one of `+`, `,`, `=`, or `>`, found `:`
- --> tests/ui/pin_project/invalid-bounds.rs:21:1
+ --> tests/ui/pin_project/invalid-bounds.rs:23:1
|
-21 | / pin_project! {
-22 | | struct Generics4<T: ?Sized : 'static> { //~ ERROR expected one of `+`, `,`, `=`, or `>`, found `:`
-23 | | field: T,
-24 | | }
-25 | | }
+23 | / pin_project! {
+24 | | struct Generics4<T: ?Sized : 'static> { //~ ERROR expected one of `+`, `,`, `=`, or `>`, found `:`
+25 | | field: T,
+26 | | }
+27 | | }
| | ^
| | |
| | expected one of `+`, `,`, `=`, or `>`
@@ -101,15 +121,20 @@
| in this macro invocation
|
= note: this error originates in the macro `$crate::__pin_project_parse_generics` which comes from the expansion of the macro `pin_project` (in Nightly builds, run with -Z macro-backtrace for more info)
+help: you might have meant to end the type parameters here
+ --> src/lib.rs
+ |
+ | $(: ?$generics_unsized_bound>)?
+ | +
error: expected one of `+`, `,`, `=`, or `>`, found `:`
- --> tests/ui/pin_project/invalid-bounds.rs:21:1
+ --> tests/ui/pin_project/invalid-bounds.rs:23:1
|
-21 | / pin_project! {
-22 | | struct Generics4<T: ?Sized : 'static> { //~ ERROR expected one of `+`, `,`, `=`, or `>`, found `:`
-23 | | field: T,
-24 | | }
-25 | | }
+23 | / pin_project! {
+24 | | struct Generics4<T: ?Sized : 'static> { //~ ERROR expected one of `+`, `,`, `=`, or `>`, found `:`
+25 | | field: T,
+26 | | }
+27 | | }
| | ^
| | |
| |_expected one of `+`, `,`, `=`, or `>`
@@ -117,15 +142,20 @@
|
= note: type ascription syntax has been removed, see issue #101728 <https://github.com/rust-lang/rust/issues/101728>
= note: this error originates in the macro `$crate::__pin_project_parse_generics` which comes from the expansion of the macro `pin_project` (in Nightly builds, run with -Z macro-backtrace for more info)
+help: you might have meant to end the type parameters here
+ --> src/lib.rs
+ |
+ | $(: ?$generics_unsized_bound>)?
+ | +
error: expected one of `+`, `,`, `=`, or `>`, found `:`
- --> tests/ui/pin_project/invalid-bounds.rs:21:1
+ --> tests/ui/pin_project/invalid-bounds.rs:23:1
|
-21 | / pin_project! {
-22 | | struct Generics4<T: ?Sized : 'static> { //~ ERROR expected one of `+`, `,`, `=`, or `>`, found `:`
-23 | | field: T,
-24 | | }
-25 | | }
+23 | / pin_project! {
+24 | | struct Generics4<T: ?Sized : 'static> { //~ ERROR expected one of `+`, `,`, `=`, or `>`, found `:`
+25 | | field: T,
+26 | | }
+27 | | }
| | ^
| | |
| | expected one of `+`, `,`, `=`, or `>`
@@ -133,15 +163,20 @@
| in this macro invocation
|
= note: this error originates in the macro `$crate::__pin_project_parse_generics` which comes from the expansion of the macro `pin_project` (in Nightly builds, run with -Z macro-backtrace for more info)
+help: you might have meant to end the type parameters here
+ --> src/lib.rs
+ |
+ | $(: ?$generics_unsized_bound>)?
+ | +
error: expected one of `+`, `,`, `=`, or `>`, found `:`
- --> tests/ui/pin_project/invalid-bounds.rs:21:1
+ --> tests/ui/pin_project/invalid-bounds.rs:23:1
|
-21 | / pin_project! {
-22 | | struct Generics4<T: ?Sized : 'static> { //~ ERROR expected one of `+`, `,`, `=`, or `>`, found `:`
-23 | | field: T,
-24 | | }
-25 | | }
+23 | / pin_project! {
+24 | | struct Generics4<T: ?Sized : 'static> { //~ ERROR expected one of `+`, `,`, `=`, or `>`, found `:`
+25 | | field: T,
+26 | | }
+27 | | }
| | ^
| | |
| | expected one of `+`, `,`, `=`, or `>`
@@ -149,15 +184,20 @@
| in this macro invocation
|
= note: this error originates in the macro `$crate::__pin_project_parse_generics` which comes from the expansion of the macro `pin_project` (in Nightly builds, run with -Z macro-backtrace for more info)
+help: you might have meant to end the type parameters here
+ --> src/lib.rs
+ |
+ | $(: ?$generics_unsized_bound>)?
+ | +
error: expected one of `+`, `,`, `=`, or `>`, found `:`
- --> tests/ui/pin_project/invalid-bounds.rs:27:1
+ --> tests/ui/pin_project/invalid-bounds.rs:29:1
|
-27 | / pin_project! {
-28 | | struct Generics5<T: Sized : ?Sized> { //~ ERROR expected one of `+`, `,`, `=`, or `>`, found `:`
-29 | | field: T,
-30 | | }
-31 | | }
+29 | / pin_project! {
+30 | | struct Generics5<T: Sized : ?Sized> { //~ ERROR expected one of `+`, `,`, `=`, or `>`, found `:`
+31 | | field: T,
+32 | | }
+33 | | }
| | ^
| | |
| | expected one of `+`, `,`, `=`, or `>`
@@ -165,15 +205,20 @@
| in this macro invocation
|
= note: this error originates in the macro `$crate::__pin_project_parse_generics` which comes from the expansion of the macro `pin_project` (in Nightly builds, run with -Z macro-backtrace for more info)
+help: you might have meant to end the type parameters here
+ --> src/lib.rs
+ |
+ | $(: $generics_bound>)?
+ | +
error: expected one of `+`, `,`, `=`, or `>`, found `:`
- --> tests/ui/pin_project/invalid-bounds.rs:27:1
+ --> tests/ui/pin_project/invalid-bounds.rs:29:1
|
-27 | / pin_project! {
-28 | | struct Generics5<T: Sized : ?Sized> { //~ ERROR expected one of `+`, `,`, `=`, or `>`, found `:`
-29 | | field: T,
-30 | | }
-31 | | }
+29 | / pin_project! {
+30 | | struct Generics5<T: Sized : ?Sized> { //~ ERROR expected one of `+`, `,`, `=`, or `>`, found `:`
+31 | | field: T,
+32 | | }
+33 | | }
| | ^
| | |
| |_expected one of `+`, `,`, `=`, or `>`
@@ -181,15 +226,20 @@
|
= note: type ascription syntax has been removed, see issue #101728 <https://github.com/rust-lang/rust/issues/101728>
= note: this error originates in the macro `$crate::__pin_project_parse_generics` which comes from the expansion of the macro `pin_project` (in Nightly builds, run with -Z macro-backtrace for more info)
+help: you might have meant to end the type parameters here
+ --> src/lib.rs
+ |
+ | $(: $generics_bound>)?
+ | +
error: expected one of `+`, `,`, `=`, or `>`, found `:`
- --> tests/ui/pin_project/invalid-bounds.rs:27:1
+ --> tests/ui/pin_project/invalid-bounds.rs:29:1
|
-27 | / pin_project! {
-28 | | struct Generics5<T: Sized : ?Sized> { //~ ERROR expected one of `+`, `,`, `=`, or `>`, found `:`
-29 | | field: T,
-30 | | }
-31 | | }
+29 | / pin_project! {
+30 | | struct Generics5<T: Sized : ?Sized> { //~ ERROR expected one of `+`, `,`, `=`, or `>`, found `:`
+31 | | field: T,
+32 | | }
+33 | | }
| | ^
| | |
| | expected one of `+`, `,`, `=`, or `>`
@@ -197,15 +247,20 @@
| in this macro invocation
|
= note: this error originates in the macro `$crate::__pin_project_parse_generics` which comes from the expansion of the macro `pin_project` (in Nightly builds, run with -Z macro-backtrace for more info)
+help: you might have meant to end the type parameters here
+ --> src/lib.rs
+ |
+ | $(: $generics_bound>)?
+ | +
error: expected one of `+`, `,`, `=`, or `>`, found `:`
- --> tests/ui/pin_project/invalid-bounds.rs:27:1
+ --> tests/ui/pin_project/invalid-bounds.rs:29:1
|
-27 | / pin_project! {
-28 | | struct Generics5<T: Sized : ?Sized> { //~ ERROR expected one of `+`, `,`, `=`, or `>`, found `:`
-29 | | field: T,
-30 | | }
-31 | | }
+29 | / pin_project! {
+30 | | struct Generics5<T: Sized : ?Sized> { //~ ERROR expected one of `+`, `,`, `=`, or `>`, found `:`
+31 | | field: T,
+32 | | }
+33 | | }
| | ^
| | |
| | expected one of `+`, `,`, `=`, or `>`
@@ -213,11 +268,16 @@
| in this macro invocation
|
= note: this error originates in the macro `$crate::__pin_project_parse_generics` which comes from the expansion of the macro `pin_project` (in Nightly builds, run with -Z macro-backtrace for more info)
+help: you might have meant to end the type parameters here
+ --> src/lib.rs
+ |
+ | $(: $generics_bound>)?
+ | +
error: no rules expected the token `Sized`
- --> tests/ui/pin_project/invalid-bounds.rs:34:34
+ --> tests/ui/pin_project/invalid-bounds.rs:36:34
|
-34 | struct Generics6<T: ?Sized : Sized> { //~ ERROR no rules expected the token `Sized`
+36 | struct Generics6<T: ?Sized : Sized> { //~ ERROR no rules expected the token `Sized`
| ^^^^^ no rules expected this token in macro call
|
note: while trying to match meta-variable `$generics_lifetime_bound:lifetime`
@@ -227,9 +287,9 @@
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
error: no rules expected the token `:`
- --> tests/ui/pin_project/invalid-bounds.rs:42:20
+ --> tests/ui/pin_project/invalid-bounds.rs:44:20
|
-42 | T: 'static : Sized //~ ERROR no rules expected the token `:`
+44 | T: 'static : Sized //~ ERROR no rules expected the token `:`
| ^ no rules expected this token in macro call
|
note: while trying to match `{`
@@ -239,9 +299,9 @@
| ^
error: no rules expected the token `:`
- --> tests/ui/pin_project/invalid-bounds.rs:51:20
+ --> tests/ui/pin_project/invalid-bounds.rs:53:20
|
-51 | T: 'static : ?Sized //~ ERROR no rules expected the token `:`
+53 | T: 'static : ?Sized //~ ERROR no rules expected the token `:`
| ^ no rules expected this token in macro call
|
note: while trying to match `{`
@@ -251,15 +311,15 @@
| ^
error: expected `{` after struct name, found `:`
- --> tests/ui/pin_project/invalid-bounds.rs:57:1
+ --> tests/ui/pin_project/invalid-bounds.rs:59:1
|
-57 | / pin_project! {
-58 | | struct WhereClause3<T>
-59 | | where
-60 | | T: Sized : 'static //~ ERROR expected `where`, or `{` after struct name, found `:`
+59 | / pin_project! {
+60 | | struct WhereClause3<T>
+61 | | where
+62 | | T: Sized : 'static //~ ERROR expected `where`, or `{` after struct name, found `:`
... |
-63 | | }
-64 | | }
+65 | | }
+66 | | }
| | ^
| | |
| |_expected `{` after struct name
@@ -268,15 +328,15 @@
= note: this error originates in the macro `$crate::__pin_project_parse_generics` which comes from the expansion of the macro `pin_project` (in Nightly builds, run with -Z macro-backtrace for more info)
error: expected one of `+`, `,`, or `{`, found `:`
- --> tests/ui/pin_project/invalid-bounds.rs:57:1
+ --> tests/ui/pin_project/invalid-bounds.rs:59:1
|
-57 | / pin_project! {
-58 | | struct WhereClause3<T>
-59 | | where
-60 | | T: Sized : 'static //~ ERROR expected `where`, or `{` after struct name, found `:`
+59 | / pin_project! {
+60 | | struct WhereClause3<T>
+61 | | where
+62 | | T: Sized : 'static //~ ERROR expected `where`, or `{` after struct name, found `:`
... |
-63 | | }
-64 | | }
+65 | | }
+66 | | }
| | ^
| | |
| |_expected one of `+`, `,`, or `{`
@@ -286,15 +346,15 @@
= note: this error originates in the macro `$crate::__pin_project_parse_generics` which comes from the expansion of the macro `pin_project` (in Nightly builds, run with -Z macro-backtrace for more info)
error: expected `{` after struct name, found `:`
- --> tests/ui/pin_project/invalid-bounds.rs:57:1
+ --> tests/ui/pin_project/invalid-bounds.rs:59:1
|
-57 | / pin_project! {
-58 | | struct WhereClause3<T>
-59 | | where
-60 | | T: Sized : 'static //~ ERROR expected `where`, or `{` after struct name, found `:`
+59 | / pin_project! {
+60 | | struct WhereClause3<T>
+61 | | where
+62 | | T: Sized : 'static //~ ERROR expected `where`, or `{` after struct name, found `:`
... |
-63 | | }
-64 | | }
+65 | | }
+66 | | }
| | ^
| | |
| |_expected `{` after struct name
@@ -303,15 +363,15 @@
= note: this error originates in the macro `$crate::__pin_project_parse_generics` which comes from the expansion of the macro `pin_project` (in Nightly builds, run with -Z macro-backtrace for more info)
error: expected `{` after struct name, found `:`
- --> tests/ui/pin_project/invalid-bounds.rs:57:1
+ --> tests/ui/pin_project/invalid-bounds.rs:59:1
|
-57 | / pin_project! {
-58 | | struct WhereClause3<T>
-59 | | where
-60 | | T: Sized : 'static //~ ERROR expected `where`, or `{` after struct name, found `:`
+59 | / pin_project! {
+60 | | struct WhereClause3<T>
+61 | | where
+62 | | T: Sized : 'static //~ ERROR expected `where`, or `{` after struct name, found `:`
... |
-63 | | }
-64 | | }
+65 | | }
+66 | | }
| | ^
| | |
| |_expected `{` after struct name
@@ -320,15 +380,15 @@
= note: this error originates in the macro `$crate::__pin_project_parse_generics` which comes from the expansion of the macro `pin_project` (in Nightly builds, run with -Z macro-backtrace for more info)
error: expected `{` after struct name, found `:`
- --> tests/ui/pin_project/invalid-bounds.rs:66:1
+ --> tests/ui/pin_project/invalid-bounds.rs:68:1
|
-66 | / pin_project! {
-67 | | struct WhereClause4<T>
-68 | | where
-69 | | T: ?Sized : 'static //~ ERROR expected `where`, or `{` after struct name, found `:`
+68 | / pin_project! {
+69 | | struct WhereClause4<T>
+70 | | where
+71 | | T: ?Sized : 'static //~ ERROR expected `where`, or `{` after struct name, found `:`
... |
-72 | | }
-73 | | }
+74 | | }
+75 | | }
| | ^
| | |
| |_expected `{` after struct name
@@ -337,15 +397,15 @@
= note: this error originates in the macro `$crate::__pin_project_parse_generics` which comes from the expansion of the macro `pin_project` (in Nightly builds, run with -Z macro-backtrace for more info)
error: expected one of `+`, `,`, or `{`, found `:`
- --> tests/ui/pin_project/invalid-bounds.rs:66:1
+ --> tests/ui/pin_project/invalid-bounds.rs:68:1
|
-66 | / pin_project! {
-67 | | struct WhereClause4<T>
-68 | | where
-69 | | T: ?Sized : 'static //~ ERROR expected `where`, or `{` after struct name, found `:`
+68 | / pin_project! {
+69 | | struct WhereClause4<T>
+70 | | where
+71 | | T: ?Sized : 'static //~ ERROR expected `where`, or `{` after struct name, found `:`
... |
-72 | | }
-73 | | }
+74 | | }
+75 | | }
| | ^
| | |
| |_expected one of `+`, `,`, or `{`
@@ -355,15 +415,15 @@
= note: this error originates in the macro `$crate::__pin_project_parse_generics` which comes from the expansion of the macro `pin_project` (in Nightly builds, run with -Z macro-backtrace for more info)
error: expected `{` after struct name, found `:`
- --> tests/ui/pin_project/invalid-bounds.rs:66:1
+ --> tests/ui/pin_project/invalid-bounds.rs:68:1
|
-66 | / pin_project! {
-67 | | struct WhereClause4<T>
-68 | | where
-69 | | T: ?Sized : 'static //~ ERROR expected `where`, or `{` after struct name, found `:`
+68 | / pin_project! {
+69 | | struct WhereClause4<T>
+70 | | where
+71 | | T: ?Sized : 'static //~ ERROR expected `where`, or `{` after struct name, found `:`
... |
-72 | | }
-73 | | }
+74 | | }
+75 | | }
| | ^
| | |
| |_expected `{` after struct name
@@ -372,15 +432,15 @@
= note: this error originates in the macro `$crate::__pin_project_parse_generics` which comes from the expansion of the macro `pin_project` (in Nightly builds, run with -Z macro-backtrace for more info)
error: expected `{` after struct name, found `:`
- --> tests/ui/pin_project/invalid-bounds.rs:66:1
+ --> tests/ui/pin_project/invalid-bounds.rs:68:1
|
-66 | / pin_project! {
-67 | | struct WhereClause4<T>
-68 | | where
-69 | | T: ?Sized : 'static //~ ERROR expected `where`, or `{` after struct name, found `:`
+68 | / pin_project! {
+69 | | struct WhereClause4<T>
+70 | | where
+71 | | T: ?Sized : 'static //~ ERROR expected `where`, or `{` after struct name, found `:`
... |
-72 | | }
-73 | | }
+74 | | }
+75 | | }
| | ^
| | |
| |_expected `{` after struct name
@@ -389,15 +449,15 @@
= note: this error originates in the macro `$crate::__pin_project_parse_generics` which comes from the expansion of the macro `pin_project` (in Nightly builds, run with -Z macro-backtrace for more info)
error: expected `{` after struct name, found `:`
- --> tests/ui/pin_project/invalid-bounds.rs:75:1
+ --> tests/ui/pin_project/invalid-bounds.rs:77:1
|
-75 | / pin_project! {
-76 | | struct WhereClause5<T>
-77 | | where
-78 | | T: Sized : ?Sized //~ ERROR expected `where`, or `{` after struct name, found `:`
+77 | / pin_project! {
+78 | | struct WhereClause5<T>
+79 | | where
+80 | | T: Sized : ?Sized //~ ERROR expected `where`, or `{` after struct name, found `:`
... |
-81 | | }
-82 | | }
+83 | | }
+84 | | }
| | ^
| | |
| |_expected `{` after struct name
@@ -406,15 +466,15 @@
= note: this error originates in the macro `$crate::__pin_project_parse_generics` which comes from the expansion of the macro `pin_project` (in Nightly builds, run with -Z macro-backtrace for more info)
error: expected one of `+`, `,`, or `{`, found `:`
- --> tests/ui/pin_project/invalid-bounds.rs:75:1
+ --> tests/ui/pin_project/invalid-bounds.rs:77:1
|
-75 | / pin_project! {
-76 | | struct WhereClause5<T>
-77 | | where
-78 | | T: Sized : ?Sized //~ ERROR expected `where`, or `{` after struct name, found `:`
+77 | / pin_project! {
+78 | | struct WhereClause5<T>
+79 | | where
+80 | | T: Sized : ?Sized //~ ERROR expected `where`, or `{` after struct name, found `:`
... |
-81 | | }
-82 | | }
+83 | | }
+84 | | }
| | ^
| | |
| |_expected one of `+`, `,`, or `{`
@@ -424,15 +484,15 @@
= note: this error originates in the macro `$crate::__pin_project_parse_generics` which comes from the expansion of the macro `pin_project` (in Nightly builds, run with -Z macro-backtrace for more info)
error: expected `{` after struct name, found `:`
- --> tests/ui/pin_project/invalid-bounds.rs:75:1
+ --> tests/ui/pin_project/invalid-bounds.rs:77:1
|
-75 | / pin_project! {
-76 | | struct WhereClause5<T>
-77 | | where
-78 | | T: Sized : ?Sized //~ ERROR expected `where`, or `{` after struct name, found `:`
+77 | / pin_project! {
+78 | | struct WhereClause5<T>
+79 | | where
+80 | | T: Sized : ?Sized //~ ERROR expected `where`, or `{` after struct name, found `:`
... |
-81 | | }
-82 | | }
+83 | | }
+84 | | }
| | ^
| | |
| |_expected `{` after struct name
@@ -441,15 +501,15 @@
= note: this error originates in the macro `$crate::__pin_project_parse_generics` which comes from the expansion of the macro `pin_project` (in Nightly builds, run with -Z macro-backtrace for more info)
error: expected `{` after struct name, found `:`
- --> tests/ui/pin_project/invalid-bounds.rs:75:1
+ --> tests/ui/pin_project/invalid-bounds.rs:77:1
|
-75 | / pin_project! {
-76 | | struct WhereClause5<T>
-77 | | where
-78 | | T: Sized : ?Sized //~ ERROR expected `where`, or `{` after struct name, found `:`
+77 | / pin_project! {
+78 | | struct WhereClause5<T>
+79 | | where
+80 | | T: Sized : ?Sized //~ ERROR expected `where`, or `{` after struct name, found `:`
... |
-81 | | }
-82 | | }
+83 | | }
+84 | | }
| | ^
| | |
| |_expected `{` after struct name
@@ -458,9 +518,9 @@
= note: this error originates in the macro `$crate::__pin_project_parse_generics` which comes from the expansion of the macro `pin_project` (in Nightly builds, run with -Z macro-backtrace for more info)
error: no rules expected the token `Sized`
- --> tests/ui/pin_project/invalid-bounds.rs:87:21
+ --> tests/ui/pin_project/invalid-bounds.rs:89:21
|
-87 | T: ?Sized : Sized //~ ERROR no rules expected the token `Sized`
+89 | T: ?Sized : Sized //~ ERROR no rules expected the token `Sized`
| ^^^^^ no rules expected this token in macro call
|
note: while trying to match meta-variable `$where_clause_lifetime_bound:lifetime`
diff --git a/crates/pin-project-lite/tests/ui/pin_project/invalid.rs b/crates/pin-project-lite/tests/ui/pin_project/invalid.rs
index e0ea61d..a8d2736 100644
--- a/crates/pin-project-lite/tests/ui/pin_project/invalid.rs
+++ b/crates/pin-project-lite/tests/ui/pin_project/invalid.rs
@@ -1,3 +1,5 @@
+// SPDX-License-Identifier: Apache-2.0 OR MIT
+
use pin_project_lite::pin_project;
pin_project! {
diff --git a/crates/pin-project-lite/tests/ui/pin_project/invalid.stderr b/crates/pin-project-lite/tests/ui/pin_project/invalid.stderr
index 5d2e305..3dfc90c 100644
--- a/crates/pin-project-lite/tests/ui/pin_project/invalid.stderr
+++ b/crates/pin-project-lite/tests/ui/pin_project/invalid.stderr
@@ -1,7 +1,7 @@
error: no rules expected the token `(`
- --> tests/ui/pin_project/invalid.rs:5:14
+ --> tests/ui/pin_project/invalid.rs:7:14
|
-5 | #[pin()] //~ ERROR no rules expected the token `(`
+7 | #[pin()] //~ ERROR no rules expected the token `(`
| ^ no rules expected this token in macro call
|
note: while trying to match `]`
@@ -11,9 +11,9 @@
| ^
error: no rules expected the token `(`
- --> tests/ui/pin_project/invalid.rs:5:14
+ --> tests/ui/pin_project/invalid.rs:7:14
|
-5 | #[pin()] //~ ERROR no rules expected the token `(`
+7 | #[pin()] //~ ERROR no rules expected the token `(`
| ^ no rules expected this token in macro call
|
note: while trying to match `]`
@@ -23,9 +23,9 @@
| ^
error: no rules expected the token `#`
- --> tests/ui/pin_project/invalid.rs:20:9
+ --> tests/ui/pin_project/invalid.rs:22:9
|
-20 | #[pin] //~ ERROR no rules expected the token `#`
+22 | #[pin] //~ ERROR no rules expected the token `#`
| ^ no rules expected this token in macro call
|
note: while trying to match meta-variable `$field_vis:vis`
@@ -35,9 +35,9 @@
| ^^^^^^^^^^^^^^
error: no rules expected the token `#`
- --> tests/ui/pin_project/invalid.rs:20:9
+ --> tests/ui/pin_project/invalid.rs:22:9
|
-20 | #[pin] //~ ERROR no rules expected the token `#`
+22 | #[pin] //~ ERROR no rules expected the token `#`
| ^ no rules expected this token in macro call
|
note: while trying to match meta-variable `$field_vis:vis`
@@ -47,7 +47,7 @@
| ^^^^^^^^^^^^^^
error: cannot find attribute `pin` in this scope
- --> tests/ui/pin_project/invalid.rs:11:7
+ --> tests/ui/pin_project/invalid.rs:13:7
|
-11 | #[pin] //~ ERROR cannot find attribute `pin` in this scope
+13 | #[pin] //~ ERROR cannot find attribute `pin` in this scope
| ^^^
diff --git a/crates/pin-project-lite/tests/ui/pin_project/negative_impls_stable.rs b/crates/pin-project-lite/tests/ui/pin_project/negative_impls_stable.rs
new file mode 100644
index 0000000..03cd92e
--- /dev/null
+++ b/crates/pin-project-lite/tests/ui/pin_project/negative_impls_stable.rs
@@ -0,0 +1,21 @@
+// SPDX-License-Identifier: Apache-2.0 OR MIT
+
+// https://github.com/taiki-e/pin-project/issues/340#issuecomment-2428002670
+
+pin_project_lite::pin_project! {
+ struct Foo<Pinned, Unpinned> {
+ #[pin]
+ pinned: Pinned,
+ unpinned: Unpinned,
+ }
+}
+
+struct MyPhantomPinned(::core::marker::PhantomPinned);
+impl Unpin for MyPhantomPinned where for<'cursed> str: Sized {}
+impl Unpin for Foo<MyPhantomPinned, ()> {}
+
+fn is_unpin<T: Unpin>() {}
+
+fn main() {
+ is_unpin::<Foo<MyPhantomPinned, ()>>()
+}
diff --git a/crates/pin-project-lite/tests/ui/pin_project/negative_impls_stable.stderr b/crates/pin-project-lite/tests/ui/pin_project/negative_impls_stable.stderr
new file mode 100644
index 0000000..3059cc7
--- /dev/null
+++ b/crates/pin-project-lite/tests/ui/pin_project/negative_impls_stable.stderr
@@ -0,0 +1,16 @@
+error[E0119]: conflicting implementations of trait `Unpin` for type `Foo<MyPhantomPinned, ()>`
+ --> tests/ui/pin_project/negative_impls_stable.rs:5:1
+ |
+5 | / pin_project_lite::pin_project! {
+6 | | struct Foo<Pinned, Unpinned> {
+7 | | #[pin]
+8 | | pinned: Pinned,
+9 | | unpinned: Unpinned,
+10 | | }
+11 | | }
+ | |_^ conflicting implementation for `Foo<MyPhantomPinned, ()>`
+...
+15 | impl Unpin for Foo<MyPhantomPinned, ()> {}
+ | --------------------------------------- first implementation here
+ |
+ = note: this error originates in the macro `$crate::__pin_project_make_unpin_impl` which comes from the expansion of the macro `pin_project_lite::pin_project` (in Nightly builds, run with -Z macro-backtrace for more info)
diff --git a/crates/pin-project-lite/tests/ui/pin_project/overlapping_lifetime_names.rs b/crates/pin-project-lite/tests/ui/pin_project/overlapping_lifetime_names.rs
index 117c18d..ef23558 100644
--- a/crates/pin-project-lite/tests/ui/pin_project/overlapping_lifetime_names.rs
+++ b/crates/pin-project-lite/tests/ui/pin_project/overlapping_lifetime_names.rs
@@ -1,3 +1,5 @@
+// SPDX-License-Identifier: Apache-2.0 OR MIT
+
use pin_project_lite::pin_project;
pin_project! { //~ ERROR E0263,E0496
diff --git a/crates/pin-project-lite/tests/ui/pin_project/overlapping_lifetime_names.stderr b/crates/pin-project-lite/tests/ui/pin_project/overlapping_lifetime_names.stderr
index cfdffb2..0bca51d 100644
--- a/crates/pin-project-lite/tests/ui/pin_project/overlapping_lifetime_names.stderr
+++ b/crates/pin-project-lite/tests/ui/pin_project/overlapping_lifetime_names.stderr
@@ -1,75 +1,75 @@
error[E0403]: the name `'__pin` is already used for a generic parameter in this item's generic parameters
- --> tests/ui/pin_project/overlapping_lifetime_names.rs:4:20
- |
-3 | / pin_project! { //~ ERROR E0263,E0496
-4 | | pub struct Foo<'__pin, T> {
- | | ^^^^^^ already used
-5 | | #[pin]
-6 | | field: &'__pin mut T,
-7 | | }
-8 | | }
- | |_- first use of `'__pin`
+ --> tests/ui/pin_project/overlapping_lifetime_names.rs:6:20
+ |
+5 | / pin_project! { //~ ERROR E0263,E0496
+6 | | pub struct Foo<'__pin, T> {
+ | | ^^^^^^ already used
+7 | | #[pin]
+8 | | field: &'__pin mut T,
+9 | | }
+10 | | }
+ | |_- first use of `'__pin`
error[E0403]: the name `'__pin` is already used for a generic parameter in this item's generic parameters
- --> tests/ui/pin_project/overlapping_lifetime_names.rs:4:20
- |
-3 | / pin_project! { //~ ERROR E0263,E0496
-4 | | pub struct Foo<'__pin, T> {
- | | ^^^^^^ already used
-5 | | #[pin]
-6 | | field: &'__pin mut T,
-7 | | }
-8 | | }
- | |_- first use of `'__pin`
+ --> tests/ui/pin_project/overlapping_lifetime_names.rs:6:20
+ |
+5 | / pin_project! { //~ ERROR E0263,E0496
+6 | | pub struct Foo<'__pin, T> {
+ | | ^^^^^^ already used
+7 | | #[pin]
+8 | | field: &'__pin mut T,
+9 | | }
+10 | | }
+ | |_- first use of `'__pin`
error[E0496]: lifetime name `'__pin` shadows a lifetime name that is already in scope
- --> tests/ui/pin_project/overlapping_lifetime_names.rs:3:1
- |
-3 | / pin_project! { //~ ERROR E0263,E0496
-4 | | pub struct Foo<'__pin, T> {
- | | ------ first declared here
-5 | | #[pin]
-6 | | field: &'__pin mut T,
-7 | | }
-8 | | }
- | |_^ lifetime `'__pin` already in scope
- |
- = note: this error originates in the macro `$crate::__pin_project_struct_make_proj_method` which comes from the expansion of the macro `pin_project` (in Nightly builds, run with -Z macro-backtrace for more info)
+ --> tests/ui/pin_project/overlapping_lifetime_names.rs:5:1
+ |
+5 | / pin_project! { //~ ERROR E0263,E0496
+6 | | pub struct Foo<'__pin, T> {
+ | | ------ first declared here
+7 | | #[pin]
+8 | | field: &'__pin mut T,
+9 | | }
+10 | | }
+ | |_^ lifetime `'__pin` already in scope
+ |
+ = note: this error originates in the macro `$crate::__pin_project_struct_make_proj_method` which comes from the expansion of the macro `pin_project` (in Nightly builds, run with -Z macro-backtrace for more info)
error[E0496]: lifetime name `'__pin` shadows a lifetime name that is already in scope
- --> tests/ui/pin_project/overlapping_lifetime_names.rs:3:1
- |
-3 | / pin_project! { //~ ERROR E0263,E0496
-4 | | pub struct Foo<'__pin, T> {
- | | ------ first declared here
-5 | | #[pin]
-6 | | field: &'__pin mut T,
-7 | | }
-8 | | }
- | |_^ lifetime `'__pin` already in scope
- |
- = note: this error originates in the macro `$crate::__pin_project_struct_make_proj_method` which comes from the expansion of the macro `pin_project` (in Nightly builds, run with -Z macro-backtrace for more info)
+ --> tests/ui/pin_project/overlapping_lifetime_names.rs:5:1
+ |
+5 | / pin_project! { //~ ERROR E0263,E0496
+6 | | pub struct Foo<'__pin, T> {
+ | | ------ first declared here
+7 | | #[pin]
+8 | | field: &'__pin mut T,
+9 | | }
+10 | | }
+ | |_^ lifetime `'__pin` already in scope
+ |
+ = note: this error originates in the macro `$crate::__pin_project_struct_make_proj_method` which comes from the expansion of the macro `pin_project` (in Nightly builds, run with -Z macro-backtrace for more info)
error[E0403]: the name `'__pin` is already used for a generic parameter in this item's generic parameters
- --> tests/ui/pin_project/overlapping_lifetime_names.rs:4:20
- |
-3 | / pin_project! { //~ ERROR E0263,E0496
-4 | | pub struct Foo<'__pin, T> {
- | | ^^^^^^ already used
-5 | | #[pin]
-6 | | field: &'__pin mut T,
-7 | | }
-8 | | }
- | |_- first use of `'__pin`
+ --> tests/ui/pin_project/overlapping_lifetime_names.rs:6:20
+ |
+5 | / pin_project! { //~ ERROR E0263,E0496
+6 | | pub struct Foo<'__pin, T> {
+ | | ^^^^^^ already used
+7 | | #[pin]
+8 | | field: &'__pin mut T,
+9 | | }
+10 | | }
+ | |_- first use of `'__pin`
error[E0403]: the name `'__pin` is already used for a generic parameter in this item's generic parameters
- --> tests/ui/pin_project/overlapping_lifetime_names.rs:4:20
- |
-3 | / pin_project! { //~ ERROR E0263,E0496
-4 | | pub struct Foo<'__pin, T> {
- | | ^^^^^^ already used
-5 | | #[pin]
-6 | | field: &'__pin mut T,
-7 | | }
-8 | | }
- | |_- first use of `'__pin`
+ --> tests/ui/pin_project/overlapping_lifetime_names.rs:6:20
+ |
+5 | / pin_project! { //~ ERROR E0263,E0496
+6 | | pub struct Foo<'__pin, T> {
+ | | ^^^^^^ already used
+7 | | #[pin]
+8 | | field: &'__pin mut T,
+9 | | }
+10 | | }
+ | |_- first use of `'__pin`
diff --git a/crates/pin-project-lite/tests/ui/pin_project/overlapping_unpin_struct.rs b/crates/pin-project-lite/tests/ui/pin_project/overlapping_unpin_struct.rs
index 25131d1..3eec4cf 100644
--- a/crates/pin-project-lite/tests/ui/pin_project/overlapping_unpin_struct.rs
+++ b/crates/pin-project-lite/tests/ui/pin_project/overlapping_unpin_struct.rs
@@ -1,3 +1,5 @@
+// SPDX-License-Identifier: Apache-2.0 OR MIT
+
use std::marker::PhantomPinned;
use pin_project_lite::pin_project;
diff --git a/crates/pin-project-lite/tests/ui/pin_project/overlapping_unpin_struct.stderr b/crates/pin-project-lite/tests/ui/pin_project/overlapping_unpin_struct.stderr
index fd7d64f..9ec1abc 100644
--- a/crates/pin-project-lite/tests/ui/pin_project/overlapping_unpin_struct.stderr
+++ b/crates/pin-project-lite/tests/ui/pin_project/overlapping_unpin_struct.stderr
@@ -1,34 +1,34 @@
error[E0277]: `PhantomPinned` cannot be unpinned
- --> tests/ui/pin_project/overlapping_unpin_struct.rs:19:16
+ --> tests/ui/pin_project/overlapping_unpin_struct.rs:21:16
|
-19 | is_unpin::<Foo<PhantomPinned>>(); //~ ERROR E0277
- | ^^^^^^^^^^^^^^^^^^ within `_::__Origin<'_, PhantomPinned>`, the trait `Unpin` is not implemented for `PhantomPinned`
+21 | is_unpin::<Foo<PhantomPinned>>(); //~ ERROR E0277
+ | ^^^^^^^^^^^^^^^^^^ within `_::__Origin<'_, PhantomPinned>`, the trait `Unpin` is not implemented for `PhantomPinned`, which is required by `Foo<PhantomPinned>: Unpin`
|
= note: consider using the `pin!` macro
consider using `Box::pin` if you need to access the pinned value outside of the current scope
-note: required because it appears within the type `__Origin<'_, PhantomPinned>`
- --> tests/ui/pin_project/overlapping_unpin_struct.rs:5:1
+note: required because it appears within the type `_::__Origin<'_, PhantomPinned>`
+ --> tests/ui/pin_project/overlapping_unpin_struct.rs:7:1
|
-5 | / pin_project! {
-6 | | struct Foo<T> {
-7 | | #[pin]
-8 | | inner: T,
-9 | | }
-10 | | }
+7 | / pin_project! {
+8 | | struct Foo<T> {
+9 | | #[pin]
+10 | | inner: T,
+11 | | }
+12 | | }
| |_^
note: required for `Foo<PhantomPinned>` to implement `Unpin`
- --> tests/ui/pin_project/overlapping_unpin_struct.rs:5:1
+ --> tests/ui/pin_project/overlapping_unpin_struct.rs:7:1
|
-5 | / pin_project! {
-6 | | struct Foo<T> {
-7 | | #[pin]
-8 | | inner: T,
-9 | | }
-10 | | }
+7 | / pin_project! {
+8 | | struct Foo<T> {
+9 | | #[pin]
+10 | | inner: T,
+11 | | }
+12 | | }
| |_^ unsatisfied trait bound introduced here
note: required by a bound in `is_unpin`
- --> tests/ui/pin_project/overlapping_unpin_struct.rs:16:16
+ --> tests/ui/pin_project/overlapping_unpin_struct.rs:18:16
|
-16 | fn is_unpin<T: Unpin>() {}
+18 | fn is_unpin<T: Unpin>() {}
| ^^^^^ required by this bound in `is_unpin`
= note: this error originates in the macro `$crate::__pin_project_make_unpin_impl` which comes from the expansion of the macro `pin_project` (in Nightly builds, run with -Z macro-backtrace for more info)
diff --git a/crates/pin-project-lite/tests/ui/pin_project/packed.rs b/crates/pin-project-lite/tests/ui/pin_project/packed.rs
index 507a038..90045a1 100644
--- a/crates/pin-project-lite/tests/ui/pin_project/packed.rs
+++ b/crates/pin-project-lite/tests/ui/pin_project/packed.rs
@@ -1,3 +1,5 @@
+// SPDX-License-Identifier: Apache-2.0 OR MIT
+
use pin_project_lite::pin_project;
pin_project! { //~ ERROR reference to packed field is unaligned
diff --git a/crates/pin-project-lite/tests/ui/pin_project/packed.stderr b/crates/pin-project-lite/tests/ui/pin_project/packed.stderr
index 710ec08..b9025cc 100644
--- a/crates/pin-project-lite/tests/ui/pin_project/packed.stderr
+++ b/crates/pin-project-lite/tests/ui/pin_project/packed.stderr
@@ -1,64 +1,13 @@
error[E0793]: reference to packed field is unaligned
- --> tests/ui/pin_project/packed.rs:3:1
- |
-3 | / pin_project! { //~ ERROR reference to packed field is unaligned
-4 | | #[repr(packed, C)]
-5 | | struct Packed {
-6 | | #[pin]
-7 | | field: u16,
-8 | | }
-9 | | }
- | |_^
- |
- = note: packed structs are only aligned by one byte, and many modern architectures penalize unaligned field accesses
- = note: 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)
- = note: this error originates in the macro `$crate::__pin_project_struct_make_proj_method` which comes from the expansion of the macro `pin_project` (in Nightly builds, run with -Z macro-backtrace for more info)
-
-error[E0793]: reference to packed field is unaligned
- --> tests/ui/pin_project/packed.rs:3:1
- |
-3 | / pin_project! { //~ ERROR reference to packed field is unaligned
-4 | | #[repr(packed, C)]
-5 | | struct Packed {
-6 | | #[pin]
-7 | | field: u16,
-8 | | }
-9 | | }
- | |_^
- |
- = note: packed structs are only aligned by one byte, and many modern architectures penalize unaligned field accesses
- = note: 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)
- = note: this error originates in the macro `$crate::__pin_project_struct_make_proj_method` which comes from the expansion of the macro `pin_project` (in Nightly builds, run with -Z macro-backtrace for more info)
-
-error[E0793]: reference to packed field is unaligned
- --> tests/ui/pin_project/packed.rs:3:1
- |
-3 | / pin_project! { //~ ERROR reference to packed field is unaligned
-4 | | #[repr(packed, C)]
-5 | | struct Packed {
-6 | | #[pin]
-7 | | field: u16,
-8 | | }
-9 | | }
- | |_^
- |
- = note: packed structs are only aligned by one byte, and many modern architectures penalize unaligned field accesses
- = note: 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)
- = note: this error originates in the macro `$crate::__pin_project_constant` which comes from the expansion of the macro `pin_project` (in Nightly builds, run with -Z macro-backtrace for more info)
-
-error[E0793]: reference to packed field is unaligned
- --> tests/ui/pin_project/packed.rs:11:1
+ --> tests/ui/pin_project/packed.rs:5:1
|
-11 | / pin_project! { //~ ERROR reference to packed field is unaligned
-12 | | #[repr(packed(2))]
-13 | | struct PackedN {
-14 | | #[pin]
-15 | | field: u32,
-16 | | }
-17 | | }
+5 | / pin_project! { //~ ERROR reference to packed field is unaligned
+6 | | #[repr(packed, C)]
+7 | | struct Packed {
+8 | | #[pin]
+9 | | field: u16,
+10 | | }
+11 | | }
| |_^
|
= note: packed structs are only aligned by one byte, and many modern architectures penalize unaligned field accesses
@@ -67,15 +16,15 @@
= note: this error originates in the macro `$crate::__pin_project_struct_make_proj_method` which comes from the expansion of the macro `pin_project` (in Nightly builds, run with -Z macro-backtrace for more info)
error[E0793]: reference to packed field is unaligned
- --> tests/ui/pin_project/packed.rs:11:1
+ --> tests/ui/pin_project/packed.rs:5:1
|
-11 | / pin_project! { //~ ERROR reference to packed field is unaligned
-12 | | #[repr(packed(2))]
-13 | | struct PackedN {
-14 | | #[pin]
-15 | | field: u32,
-16 | | }
-17 | | }
+5 | / pin_project! { //~ ERROR reference to packed field is unaligned
+6 | | #[repr(packed, C)]
+7 | | struct Packed {
+8 | | #[pin]
+9 | | field: u16,
+10 | | }
+11 | | }
| |_^
|
= note: packed structs are only aligned by one byte, and many modern architectures penalize unaligned field accesses
@@ -84,15 +33,66 @@
= note: this error originates in the macro `$crate::__pin_project_struct_make_proj_method` which comes from the expansion of the macro `pin_project` (in Nightly builds, run with -Z macro-backtrace for more info)
error[E0793]: reference to packed field is unaligned
- --> tests/ui/pin_project/packed.rs:11:1
+ --> tests/ui/pin_project/packed.rs:5:1
|
-11 | / pin_project! { //~ ERROR reference to packed field is unaligned
-12 | | #[repr(packed(2))]
-13 | | struct PackedN {
-14 | | #[pin]
-15 | | field: u32,
-16 | | }
-17 | | }
+5 | / pin_project! { //~ ERROR reference to packed field is unaligned
+6 | | #[repr(packed, C)]
+7 | | struct Packed {
+8 | | #[pin]
+9 | | field: u16,
+10 | | }
+11 | | }
+ | |_^
+ |
+ = note: packed structs are only aligned by one byte, and many modern architectures penalize unaligned field accesses
+ = note: 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)
+ = note: this error originates in the macro `$crate::__pin_project_constant` which comes from the expansion of the macro `pin_project` (in Nightly builds, run with -Z macro-backtrace for more info)
+
+error[E0793]: reference to packed field is unaligned
+ --> tests/ui/pin_project/packed.rs:13:1
+ |
+13 | / pin_project! { //~ ERROR reference to packed field is unaligned
+14 | | #[repr(packed(2))]
+15 | | struct PackedN {
+16 | | #[pin]
+17 | | field: u32,
+18 | | }
+19 | | }
+ | |_^
+ |
+ = note: packed structs are only aligned by one byte, and many modern architectures penalize unaligned field accesses
+ = note: 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)
+ = note: this error originates in the macro `$crate::__pin_project_struct_make_proj_method` which comes from the expansion of the macro `pin_project` (in Nightly builds, run with -Z macro-backtrace for more info)
+
+error[E0793]: reference to packed field is unaligned
+ --> tests/ui/pin_project/packed.rs:13:1
+ |
+13 | / pin_project! { //~ ERROR reference to packed field is unaligned
+14 | | #[repr(packed(2))]
+15 | | struct PackedN {
+16 | | #[pin]
+17 | | field: u32,
+18 | | }
+19 | | }
+ | |_^
+ |
+ = note: packed structs are only aligned by one byte, and many modern architectures penalize unaligned field accesses
+ = note: 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)
+ = note: this error originates in the macro `$crate::__pin_project_struct_make_proj_method` which comes from the expansion of the macro `pin_project` (in Nightly builds, run with -Z macro-backtrace for more info)
+
+error[E0793]: reference to packed field is unaligned
+ --> tests/ui/pin_project/packed.rs:13:1
+ |
+13 | / pin_project! { //~ ERROR reference to packed field is unaligned
+14 | | #[repr(packed(2))]
+15 | | struct PackedN {
+16 | | #[pin]
+17 | | field: u32,
+18 | | }
+19 | | }
| |_^
|
= note: packed structs are only aligned by one byte, and many modern architectures penalize unaligned field accesses
diff --git a/crates/pin-project-lite/tests/ui/pin_project/unpin_sneaky.rs b/crates/pin-project-lite/tests/ui/pin_project/unpin_sneaky.rs
index 984cc2a..9ad1b70 100644
--- a/crates/pin-project-lite/tests/ui/pin_project/unpin_sneaky.rs
+++ b/crates/pin-project-lite/tests/ui/pin_project/unpin_sneaky.rs
@@ -1,3 +1,5 @@
+// SPDX-License-Identifier: Apache-2.0 OR MIT
+
use pin_project_lite::pin_project;
pin_project! {
diff --git a/crates/pin-project-lite/tests/ui/pin_project/unpin_sneaky.stderr b/crates/pin-project-lite/tests/ui/pin_project/unpin_sneaky.stderr
index aadd1f9..8e4deaa 100644
--- a/crates/pin-project-lite/tests/ui/pin_project/unpin_sneaky.stderr
+++ b/crates/pin-project-lite/tests/ui/pin_project/unpin_sneaky.stderr
@@ -1,5 +1,5 @@
error[E0412]: cannot find type `__Origin` in this scope
- --> tests/ui/pin_project/unpin_sneaky.rs:10:16
+ --> tests/ui/pin_project/unpin_sneaky.rs:12:16
|
-10 | impl Unpin for __Origin {} //~ ERROR E0412,E0321
+12 | impl Unpin for __Origin {} //~ ERROR E0412,E0321
| ^^^^^^^^ not found in this scope
diff --git a/crates/pin-project-lite/tests/ui/pin_project/unsupported.rs b/crates/pin-project-lite/tests/ui/pin_project/unsupported.rs
index 2f80836..6532e50 100644
--- a/crates/pin-project-lite/tests/ui/pin_project/unsupported.rs
+++ b/crates/pin-project-lite/tests/ui/pin_project/unsupported.rs
@@ -1,3 +1,5 @@
+// SPDX-License-Identifier: Apache-2.0 OR MIT
+
use pin_project_lite::pin_project;
pin_project! {
diff --git a/crates/pin-project-lite/tests/ui/pin_project/unsupported.stderr b/crates/pin-project-lite/tests/ui/pin_project/unsupported.stderr
index f1d3b9c..909a671 100644
--- a/crates/pin-project-lite/tests/ui/pin_project/unsupported.stderr
+++ b/crates/pin-project-lite/tests/ui/pin_project/unsupported.stderr
@@ -1,9 +1,9 @@
error: no rules expected the token `}`
- --> tests/ui/pin_project/unsupported.rs:3:1
+ --> tests/ui/pin_project/unsupported.rs:5:1
|
-3 | / pin_project! {
-4 | | struct Struct1 {} //~ ERROR no rules expected the token `}`
-5 | | }
+5 | / pin_project! {
+6 | | struct Struct1 {} //~ ERROR no rules expected the token `}`
+7 | | }
| |_^ no rules expected this token in macro call
|
note: while trying to match meta-variable `$field_vis:vis`
@@ -14,11 +14,11 @@
= note: this error originates in the macro `$crate::__pin_project_expand` which comes from the expansion of the macro `pin_project` (in Nightly builds, run with -Z macro-backtrace for more info)
error: no rules expected the token `}`
- --> tests/ui/pin_project/unsupported.rs:3:1
+ --> tests/ui/pin_project/unsupported.rs:5:1
|
-3 | / pin_project! {
-4 | | struct Struct1 {} //~ ERROR no rules expected the token `}`
-5 | | }
+5 | / pin_project! {
+6 | | struct Struct1 {} //~ ERROR no rules expected the token `}`
+7 | | }
| |_^ no rules expected this token in macro call
|
note: while trying to match meta-variable `$field_vis:vis`
@@ -29,21 +29,21 @@
= note: this error originates in the macro `$crate::__pin_project_expand` which comes from the expansion of the macro `pin_project` (in Nightly builds, run with -Z macro-backtrace for more info)
error: no rules expected the token `(`
- --> tests/ui/pin_project/unsupported.rs:8:19
- |
-8 | struct Struct2(); //~ ERROR no rules expected the token `(`
- | ^ no rules expected this token in macro call
- |
+ --> tests/ui/pin_project/unsupported.rs:10:19
+ |
+10 | struct Struct2(); //~ ERROR no rules expected the token `(`
+ | ^ no rules expected this token in macro call
+ |
note: while trying to match `{`
- --> src/lib.rs
- |
- | {
- | ^
+ --> src/lib.rs
+ |
+ | {
+ | ^
error: no rules expected the token `;`
- --> tests/ui/pin_project/unsupported.rs:12:19
+ --> tests/ui/pin_project/unsupported.rs:14:19
|
-12 | struct Struct3; //~ ERROR no rules expected the token `;`
+14 | struct Struct3; //~ ERROR no rules expected the token `;`
| ^ no rules expected this token in macro call
|
note: while trying to match `{`
@@ -53,9 +53,9 @@
| ^
error: no rules expected the token `(`
- --> tests/ui/pin_project/unsupported.rs:17:10
+ --> tests/ui/pin_project/unsupported.rs:19:10
|
-17 | A(u8)
+19 | A(u8)
| ^ no rules expected this token in macro call
|
note: while trying to match `}`
@@ -65,9 +65,9 @@
| ^
error: no rules expected the token `(`
- --> tests/ui/pin_project/unsupported.rs:17:10
+ --> tests/ui/pin_project/unsupported.rs:19:10
|
-17 | A(u8)
+19 | A(u8)
| ^ no rules expected this token in macro call
|
note: while trying to match `}`
@@ -77,13 +77,13 @@
| ^
error: no rules expected the token `union`
- --> tests/ui/pin_project/unsupported.rs:21:1
+ --> tests/ui/pin_project/unsupported.rs:23:1
|
-21 | / pin_project! {
-22 | | union Union { //~ ERROR no rules expected the token `union`
-23 | | x: u8,
-24 | | }
-25 | | }
+23 | / pin_project! {
+24 | | union Union { //~ ERROR no rules expected the token `union`
+25 | | x: u8,
+26 | | }
+27 | | }
| |_^ no rules expected this token in macro call
|
note: while trying to match `struct`
@@ -91,18 +91,16 @@
|
| [$(#[$attrs:meta])* $vis:vis struct $ident:ident]
| ^^^^^^
- = note: captured metavariables except for `:tt`, `:ident` and `:lifetime` cannot be compared to other tokens
- = note: see <https://doc.rust-lang.org/nightly/reference/macros-by-example.html#forwarding-a-matched-fragment> for more information
= note: this error originates in the macro `$crate::__pin_project_expand` which comes from the expansion of the macro `pin_project` (in Nightly builds, run with -Z macro-backtrace for more info)
error: no rules expected the token `union`
- --> tests/ui/pin_project/unsupported.rs:21:1
+ --> tests/ui/pin_project/unsupported.rs:23:1
|
-21 | / pin_project! {
-22 | | union Union { //~ ERROR no rules expected the token `union`
-23 | | x: u8,
-24 | | }
-25 | | }
+23 | / pin_project! {
+24 | | union Union { //~ ERROR no rules expected the token `union`
+25 | | x: u8,
+26 | | }
+27 | | }
| |_^ no rules expected this token in macro call
|
note: while trying to match `struct`
@@ -110,6 +108,4 @@
|
| [$(#[$attrs:meta])* $vis:vis struct $ident:ident]
| ^^^^^^
- = note: captured metavariables except for `:tt`, `:ident` and `:lifetime` cannot be compared to other tokens
- = note: see <https://doc.rust-lang.org/nightly/reference/macros-by-example.html#forwarding-a-matched-fragment> for more information
= note: this error originates in the macro `$crate::__pin_project_expand` which comes from the expansion of the macro `pin_project` (in Nightly builds, run with -Z macro-backtrace for more info)
diff --git a/crates/pin-project-lite/tests/ui/pinned_drop/call-drop-inner.rs b/crates/pin-project-lite/tests/ui/pinned_drop/call-drop-inner.rs
index 609b3be..9ee8aee 100644
--- a/crates/pin-project-lite/tests/ui/pinned_drop/call-drop-inner.rs
+++ b/crates/pin-project-lite/tests/ui/pinned_drop/call-drop-inner.rs
@@ -1,3 +1,5 @@
+// SPDX-License-Identifier: Apache-2.0 OR MIT
+
use pin_project_lite::pin_project;
pin_project! {
diff --git a/crates/pin-project-lite/tests/ui/pinned_drop/call-drop-inner.stderr b/crates/pin-project-lite/tests/ui/pinned_drop/call-drop-inner.stderr
index a622621..93f9d19 100644
--- a/crates/pin-project-lite/tests/ui/pinned_drop/call-drop-inner.stderr
+++ b/crates/pin-project-lite/tests/ui/pinned_drop/call-drop-inner.stderr
@@ -1,21 +1,23 @@
error[E0061]: this function takes 0 arguments but 1 argument was supplied
- --> tests/ui/pinned_drop/call-drop-inner.rs:10:13
+ --> tests/ui/pinned_drop/call-drop-inner.rs:12:13
|
-10 | __drop_inner(this);
- | ^^^^^^^^^^^^ ----
- | |
- | unexpected argument of type `Pin<&mut S>`
- | help: remove the extra argument
+12 | __drop_inner(this);
+ | ^^^^^^^^^^^^ ---- unexpected argument of type `Pin<&mut S>`
|
note: function defined here
- --> tests/ui/pinned_drop/call-drop-inner.rs:3:1
+ --> tests/ui/pinned_drop/call-drop-inner.rs:5:1
|
-3 | / pin_project! {
-4 | | pub struct S {
-5 | | #[pin]
-6 | | field: u8,
+5 | / pin_project! {
+6 | | pub struct S {
+7 | | #[pin]
+8 | | field: u8,
... |
-12 | | }
-13 | | }
+14 | | }
+15 | | }
| |_^
= note: this error originates in the macro `$crate::__pin_project_make_drop_impl` which comes from the expansion of the macro `pin_project` (in Nightly builds, run with -Z macro-backtrace for more info)
+help: remove the extra argument
+ |
+12 - __drop_inner(this);
+12 + __drop_inner();
+ |
diff --git a/crates/pin-project-lite/tests/ui/pinned_drop/conditional-drop-impl.rs b/crates/pin-project-lite/tests/ui/pinned_drop/conditional-drop-impl.rs
index 68b01b2..1bf5677 100644
--- a/crates/pin-project-lite/tests/ui/pinned_drop/conditional-drop-impl.rs
+++ b/crates/pin-project-lite/tests/ui/pinned_drop/conditional-drop-impl.rs
@@ -1,3 +1,5 @@
+// SPDX-License-Identifier: Apache-2.0 OR MIT
+
use pin_project_lite::pin_project;
// In `Drop` impl, the implementor must specify the same requirement as type definition.
diff --git a/crates/pin-project-lite/tests/ui/pinned_drop/conditional-drop-impl.stderr b/crates/pin-project-lite/tests/ui/pinned_drop/conditional-drop-impl.stderr
index fe0ee79..b78ab75 100644
--- a/crates/pin-project-lite/tests/ui/pinned_drop/conditional-drop-impl.stderr
+++ b/crates/pin-project-lite/tests/ui/pinned_drop/conditional-drop-impl.stderr
@@ -1,36 +1,36 @@
error[E0367]: `Drop` impl requires `T: Unpin` but the struct it is implemented for does not
- --> tests/ui/pinned_drop/conditional-drop-impl.rs:9:9
- |
-9 | impl<T: Unpin> Drop for DropImpl<T> {
- | ^^^^^
- |
+ --> 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
- --> tests/ui/pinned_drop/conditional-drop-impl.rs:5:1
- |
-5 | struct DropImpl<T> {
- | ^^^^^^^^^^^^^^^^^^
+ --> tests/ui/pinned_drop/conditional-drop-impl.rs:7:1
+ |
+7 | struct DropImpl<T> {
+ | ^^^^^^^^^^^^^^^^^^
error[E0367]: `Drop` impl requires `T: Unpin` but the struct it is implemented for does not
- --> tests/ui/pinned_drop/conditional-drop-impl.rs:14:1
+ --> tests/ui/pinned_drop/conditional-drop-impl.rs:16:1
|
-14 | / pin_project! {
-15 | | //~^ ERROR E0367
-16 | | struct PinnedDropImpl<T> {
-17 | | #[pin]
+16 | / pin_project! {
+17 | | //~^ ERROR E0367
+18 | | struct PinnedDropImpl<T> {
+19 | | #[pin]
... |
-23 | | }
-24 | | }
+25 | | }
+26 | | }
| |_^
|
note: the implementor must specify the same requirement
- --> tests/ui/pinned_drop/conditional-drop-impl.rs:14:1
+ --> tests/ui/pinned_drop/conditional-drop-impl.rs:16:1
|
-14 | / pin_project! {
-15 | | //~^ ERROR E0367
-16 | | struct PinnedDropImpl<T> {
-17 | | #[pin]
+16 | / pin_project! {
+17 | | //~^ ERROR E0367
+18 | | struct PinnedDropImpl<T> {
+19 | | #[pin]
... |
-23 | | }
-24 | | }
+25 | | }
+26 | | }
| |_^
= note: this error originates in the macro `$crate::__pin_project_make_drop_impl` which comes from the expansion of the macro `pin_project` (in Nightly builds, run with -Z macro-backtrace for more info)
diff --git a/pseudo_crate/Cargo.lock b/pseudo_crate/Cargo.lock
index 8b5def0..385e48f 100644
--- a/pseudo_crate/Cargo.lock
+++ b/pseudo_crate/Cargo.lock
@@ -3909,9 +3909,9 @@
[[package]]
name = "pin-project-lite"
-version = "0.2.13"
+version = "0.2.15"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "8afb450f006bf6385ca15ef45d71d2288452bc3683ce2e2cacc0d18e4be60b58"
+checksum = "915a1e146535de9163f3987b8944ed8cf49a18bb0056bcebcdcece385cece4ff"
[[package]]
name = "pin-utils"
diff --git a/pseudo_crate/Cargo.toml b/pseudo_crate/Cargo.toml
index 6484aad..faf6199 100644
--- a/pseudo_crate/Cargo.toml
+++ b/pseudo_crate/Cargo.toml
@@ -241,7 +241,7 @@
petgraph = "=0.6.5"
pin-project = "=1.1.3"
pin-project-internal = "=1.1.3"
-pin-project-lite = "=0.2.13"
+pin-project-lite = "=0.2.15"
pin-utils = "=0.1.0"
pkcs1 = "=0.7.5"
pkcs8 = "=0.10.2"