diff --git a/Cargo.lock b/Cargo.lock index f13a2d86cbff..7946c7209c33 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -4572,9 +4572,9 @@ dependencies = [ [[package]] name = "pin-project-lite" -version = "0.2.9" +version = "0.2.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e0a7ae3ac2f1173085d398531c705756c94a4c56843785df85a60c1a0afac116" +checksum = "bda66fc9667c18cb2758a2ac84d1167245054bcf85d5d1aaa6923f45801bdd02" [[package]] name = "pin-utils" diff --git a/supply-chain/audits.toml b/supply-chain/audits.toml index e7be954e9f15..1e439a42e2db 100644 --- a/supply-chain/audits.toml +++ b/supply-chain/audits.toml @@ -3422,6 +3422,11 @@ who = "Mike Hommey " criteria = "safe-to-run" delta = "1.0.12 -> 1.1.0" +[[audits.pin-project-lite]] +who = "Mike Hommey " +criteria = "safe-to-deploy" +delta = "0.2.13 -> 0.2.14" + [[audits.pkcs11-bindings]] who = "Dana Keeler " criteria = "safe-to-deploy" diff --git a/supply-chain/imports.lock b/supply-chain/imports.lock index 7cd0c457d36f..72accafe58fa 100644 --- a/supply-chain/imports.lock +++ b/supply-chain/imports.lock @@ -1312,6 +1312,13 @@ version = "0.2.9" notes = "Reviewed on https://fxrev.dev/824504" aggregated-from = "https://fuchsia.googlesource.com/fuchsia/+/refs/heads/main/third_party/rust_crates/supply-chain/audits.toml?format=TEXT" +[[audits.google.audits.pin-project-lite]] +who = "David Koloski " +criteria = "safe-to-deploy" +delta = "0.2.9 -> 0.2.13" +notes = "Audited at https://fxrev.dev/946396" +aggregated-from = "https://fuchsia.googlesource.com/fuchsia/+/refs/heads/main/third_party/rust_crates/supply-chain/audits.toml?format=TEXT" + [[audits.google.audits.proc-macro2]] who = "danakj@chromium.org" criteria = "safe-to-deploy" diff --git a/third_party/rust/pin-project-lite/.cargo-checksum.json b/third_party/rust/pin-project-lite/.cargo-checksum.json index 249c55e4be4f..d27d8a1db9e0 100644 --- a/third_party/rust/pin-project-lite/.cargo-checksum.json +++ b/third_party/rust/pin-project-lite/.cargo-checksum.json @@ -1 +1 @@ -{"files":{"CHANGELOG.md":"0da6eac8d8957a8aea735942d2e6e226b5cb178a363fe77b87c23272f2e63b1c","Cargo.toml":"b0b0099d5e8af1ffbe68c0b4e367a00602dbf1acab35f8c956129918b17a5425","LICENSE-APACHE":"0d542e0c8804e39aa7f37eb00da5a762149dc682d7829451287e11b938e94594","LICENSE-MIT":"23f18e03dc49df91622fe2a76176497404e46ced8a715d9d2b67a7446571cca3","README.md":"609412221520fc16f47e76131927e4dd11aef38f7c69d92a1116130654f0ee90","src/lib.rs":"7b76a04ae98aa1e9ee85b9a2e1f054384b39df74cdfb375ff46649af8ec4b5b3","tests/README.md":"71fc84264ec08d2b7f1c74c1ba5140a376121b72145cc630b616e6f2536aeafa","tests/auxiliary/mod.rs":"7e263e987e09b77e384f734384a00a71c5b70230bb1b5376446ef003a8da9372","tests/compiletest.rs":"f764ff03c73c8a21c35ee30cf851b9266b2987e88d646d9bd086fc71944eb945","tests/drop_order.rs":"2cb31a8cd5cf4d9a4ba9faf25f99f0e85f9bd7b4778649f843d9c617c6af43fc","tests/expand/default/enum.expanded.rs":"c4db8e05cfe6eab3be39301abf77689f79fdaff52605350a2aee464b2756180e","tests/expand/default/enum.rs":"493d5752c4baa87ed4c48bd41b8e5e263fd5e3f43c4f9195818ef6d26951f63e","tests/expand/default/struct.expanded.rs":"c158632984eaf6ab8ae60b76ff2bf32b20ba10a3cbc4237c9a6ea28c614cdb01","tests/expand/default/struct.rs":"5a6e57d9b6d00cfd4e1e69f37ce0c9d5165a21230d0363f0791665b1015870ce","tests/expand/multifields/enum.expanded.rs":"8bba6a5a2279469bf94c486a6efb2f8c9ed965b716d66ac0660662e11ca0bddb","tests/expand/multifields/enum.rs":"9c79270a7d6d1d42cf8194b579d79e7d44a3fd003243742f0a568ecf0a4f3be3","tests/expand/multifields/struct.expanded.rs":"46ac58981d4ee4eba61b879ba62b313ceac59f9a223ae4984450f72a9173cbd2","tests/expand/multifields/struct.rs":"17f0447d522d48f14d516808bd66baacebdf3ac38188df72f649702a893cda68","tests/expand/naming/enum-all.expanded.rs":"c4db8e05cfe6eab3be39301abf77689f79fdaff52605350a2aee464b2756180e","tests/expand/naming/enum-all.rs":"493d5752c4baa87ed4c48bd41b8e5e263fd5e3f43c4f9195818ef6d26951f63e","tests/expand/naming/enum-mut.expanded.rs":"ce1a12428d3906c8d98516b3afdcbbbda64776e2f0c039e90f3de8f734ab1878","tests/expand/naming/enum-mut.rs":"c1ff4ade049ebbceb2acb99dbc1af5db14de3ba9710ea1ff1b64348766a9e080","tests/expand/naming/enum-none.expanded.rs":"cf8ea074b8079af453a2f98e2217704e96174433e4ac0e07577f9242ad3d5de2","tests/expand/naming/enum-none.rs":"ff22be4ecf4168e2bc68ab249a0ed809a37e3b8e840ef8977d24209ef28ac839","tests/expand/naming/enum-ref.expanded.rs":"277e9642e49f4dc312ea09b4d9f8012994662f565529865102be0fe1657c2b13","tests/expand/naming/enum-ref.rs":"394cbd5d872449e9226cd0834ce7117c395a582567584218dabbef4eb2c1fbac","tests/expand/naming/struct-all.expanded.rs":"807c74c57928e068725fa8272a1d1c671401ed213ce8abf1a405a35b1fb47673","tests/expand/naming/struct-all.rs":"c13c0aacee85b8fca58f85d2d75d2e3907b3e7642f8710ed8c8e54d6015881cc","tests/expand/naming/struct-mut.expanded.rs":"f08b34f7d49ad45ae0a1ae8b64995d63e7e4eed2910a912f6c622a0b8e410b89","tests/expand/naming/struct-mut.rs":"9a7752a6d30e0b7033f3577a72676676900a642cdaf59f942179d1f2a8ba2bb0","tests/expand/naming/struct-none.expanded.rs":"c158632984eaf6ab8ae60b76ff2bf32b20ba10a3cbc4237c9a6ea28c614cdb01","tests/expand/naming/struct-none.rs":"5a6e57d9b6d00cfd4e1e69f37ce0c9d5165a21230d0363f0791665b1015870ce","tests/expand/naming/struct-ref.expanded.rs":"dabc3fda847ab2f4e4ca0ec6f6dc4da43f8de087117dcafb3c15780cebc7af45","tests/expand/naming/struct-ref.rs":"33c4fd344b65650dee44087ada31d4b5acd9d122123360fb7d41718c46699574","tests/expand/pinned_drop/enum.expanded.rs":"56d709a0cfc0c951fe303bf2b034e7fae4fc5271b9a11ade9c6a9c20c89471b3","tests/expand/pinned_drop/enum.rs":"d7e087b6852338fabe7edf39529c8f893a426b4d0c6aba2d2a6be0d95f739cdc","tests/expand/pinned_drop/struct.expanded.rs":"c9b26224339f126ce5f0d36cd8d6c6e84970bf39b94dc11bc42743ad5bdba6be","tests/expand/pinned_drop/struct.rs":"164a25e12b9898c093b5dee2c47a40dd549e6f49ba1c6bb22f4e4c4b98fe76b2","tests/expand/pub/enum.expanded.rs":"56c81c0535f8fb9b83662fc3753f7c07b96eb12392669bb1ae23ffc82b7c4a2c","tests/expand/pub/enum.rs":"5b60dd354a489b0326f5c4f1026b89d1471ddbb45906bc3046a65425c4e5e160","tests/expand/pub/struct.expanded.rs":"525c52bf7185493046618ee0dc1b18bdc0c0a56383f5c7b11c98738211d024a7","tests/expand/pub/struct.rs":"15b7940ce0ad1d5d133dde1870319f2f96a000bfcf29508b8cce1a62876cbd80","tests/expandtest.rs":"898df948c7ee82df0e0823cbde16ccc2b9dba455475665e6d2c7c0a84493e9fb","tests/include/basic.rs":"9e399b682bc74c899d26924c2cab52a911f7392e29300defb6521e561fafafe4","tests/lint.rs":"513ffda15a1e8e64076e8a1b7db709d5de8eebaf7952839974056e99afedde82","tests/proper_unpin.rs":"57a9e8c9029ba7920ec23670b66758916e067c9cecf4d3f8b0035bec25cdb570","tests/test.rs":"8d0ee300af17535dc7fd488433630911ddc3147a3e3ccf0b9dce9f0ccdb10dc3","tests/ui/pin_project/conflict-drop.rs":"55e6809b5f59dd81e32c2c89b742c0c76db6b099a1d2621e5b882c0d20f92837","tests/ui/pin_project/conflict-drop.stderr":"d22314903c031c1dad5fba81b8819fd9a1459ed4f750534032eaa3296db9e4ac","tests/ui/pin_project/conflict-unpin.rs":"51b3b6720fa581b63167d6ac941a1ea1bf739b09954931b2bc2f7abe2d934f26","tests/ui/pin_project/conflict-unpin.stderr":"4ca72632a5926cc70cb489311f6ac2e16b13fb5508cc2afb3b873071b37f3ba4","tests/ui/pin_project/invalid-bounds.rs":"f86f23d377df015182f2f5dae6464a4f98c37f2198e0646f721fedc4017cb82c","tests/ui/pin_project/invalid-bounds.stderr":"12009b6b91820cf199b0b1663d70ddb03c01c4645f0937a6812abe2e0112101c","tests/ui/pin_project/invalid.rs":"7304bd4a5bac1419382742432cfa8af83535d7be8cfad52c661410e0e9e8207a","tests/ui/pin_project/invalid.stderr":"c690c368166c588501f7af306915a5ad131e3d4c5e6c519387f27dc7daaf9e84","tests/ui/pin_project/overlapping_lifetime_names.rs":"36c849a4570c8c0c32ca6c01aa75afbe1136ef73d45f17eb66175e1936678722","tests/ui/pin_project/overlapping_lifetime_names.stderr":"93646dd1a0a9b5106a189d2dbf11ad6010f91ba6adc545fe9fb350d05e5565b9","tests/ui/pin_project/overlapping_unpin_struct.rs":"9a126182d1fe15a30ac60bb223b376aad747d11293d3cf512ad2dce546e3725c","tests/ui/pin_project/overlapping_unpin_struct.stderr":"a7297c94c18c582eba24f801a69dc9ee25f28e58b9c15493ae89aa62bfae045a","tests/ui/pin_project/packed.rs":"2ede405a0d101eb843ea83c2836cc8399da54c105776f2c795f3138e03a1e5ef","tests/ui/pin_project/packed.stderr":"7601fac825e3715b4cc8024bd489c35edbb98baa270a3ac1d591fc683afc5c56","tests/ui/pin_project/unpin_sneaky.rs":"12e97a387ce1af6ee6a567687674aab70e96962a48f2433c39976d0b3e2c3341","tests/ui/pin_project/unpin_sneaky.stderr":"972e313b129ff58d05c1de4ace8f41da18e3813abeda8173cf5e9fdfdbea2251","tests/ui/pin_project/unsupported.rs":"14defa90e736f314bbbc219973929b77bdd22e5f7e4c4c88403db764f4d167d6","tests/ui/pin_project/unsupported.stderr":"2602db59fed6be1ac66e573b2a44e88b7d9ed18674d04fa62f97ee7ad21eaa30","tests/ui/pinned_drop/call-drop-inner.rs":"032260da1fc0e649d97167a8a4ac47eea915000efebdfdc490f050b6f9351027","tests/ui/pinned_drop/call-drop-inner.stderr":"18e4d2be8a25ea7092c91e311cbdd5fae20dee494a168caa01abe01527ed07ce","tests/ui/pinned_drop/conditional-drop-impl.rs":"0b28c74213cee83e7b27223d7d37f903f79abd3dddcc0f969e14047674908085","tests/ui/pinned_drop/conditional-drop-impl.stderr":"a0e102a8746c1d078348d7447d1bd8073afe537fb18c199ec020f0bfd63cfd07"},"package":"e0a7ae3ac2f1173085d398531c705756c94a4c56843785df85a60c1a0afac116"} \ No newline at end of file +{"files":{"CHANGELOG.md":"35b8a3b1fd9ed1a7269a636ced18d5cdcdc10548bf46f923b57fb1e50bb4b386","Cargo.toml":"a1581793c17650b9bfd84ced69926b167ce8a6fc8034b4fe95662e11b60a4cea","LICENSE-APACHE":"0d542e0c8804e39aa7f37eb00da5a762149dc682d7829451287e11b938e94594","LICENSE-MIT":"23f18e03dc49df91622fe2a76176497404e46ced8a715d9d2b67a7446571cca3","README.md":"221f66b9790f31511d2d441b51800cd788fcda3874d84464fb5d1719a0f9d9ea","src/lib.rs":"7aa33bbd38dab8ca1374c35b473278464d8960708a2cfe0d1393e66a40ee4ea0","tests/auxiliary/mod.rs":"52a78b77be05c67737c56865fbce4477eaacc6482d6377af2a5822f05a2ce061","tests/compiletest.rs":"9d8603153ed6b0f9eb4a935a294ab45ec0a2d564d2a1f20b3db026612d0c1d78","tests/drop_order.rs":"9b13b6461e44be1c1beca6ec47387de83efcb988326e4ff832183b8fad17a3f4","tests/expand/default/enum.expanded.rs":"7944e0ff3a49ef1bccff5681a32a0b306c5eaa7a5f4838132eca8e9a62d40722","tests/expand/default/enum.rs":"ebe6b6403e35459420f6fe979243c382972d2d582376d69f6c630ab5ba2599b5","tests/expand/default/struct.expanded.rs":"c0a2a411462f2570340e095963c277da229f7b7dcbe661512ac5f051478d5905","tests/expand/default/struct.rs":"05767cd68ec5cddc481cff5ad677b5146f7d6fd1effcf1ff131d24c334d85032","tests/expand/multifields/enum.expanded.rs":"fc3a86d536060cbd1aa58a2e565d00033f677c0e02f1dd1ee6e30e8379b152fe","tests/expand/multifields/enum.rs":"d38eb301c86307edbf5cb07ed434b64a10a68aaef32dfb8b15029b5cc5586b0b","tests/expand/multifields/struct.expanded.rs":"cf2dd15e6a0a66afcb8c5d7fef235964a4326c91732de65597f880285fdffe2a","tests/expand/multifields/struct.rs":"1fe2b911e8782eaac5952d9e0914473d46d82db45b1da859bdc6b8dc3978e549","tests/expand/naming/enum-all.expanded.rs":"7944e0ff3a49ef1bccff5681a32a0b306c5eaa7a5f4838132eca8e9a62d40722","tests/expand/naming/enum-all.rs":"ebe6b6403e35459420f6fe979243c382972d2d582376d69f6c630ab5ba2599b5","tests/expand/naming/enum-mut.expanded.rs":"49bd8b7e0a469823e1e7d4dbfcb7108ef5db16844ef7d4686cb6600768123877","tests/expand/naming/enum-mut.rs":"bf215d055b29a7f9fdb84cabf34576d9dec8e87c33cebe2b553d1fe5e5cb0882","tests/expand/naming/enum-none.expanded.rs":"dbac25a5370153bad9165346c49f831d051b22f0c40bc4d81aa1dd44346d04cc","tests/expand/naming/enum-none.rs":"115968816e1a1a6b3634b8594dde4815d4641d817d69ebdd90879b96a8a2808e","tests/expand/naming/enum-ref.expanded.rs":"ec4dedf4618e6b9dc4e98a2846b769dc5c9ad9eb51cb645ebfcca09c9ec9458f","tests/expand/naming/enum-ref.rs":"e09ce2ca812b9fcf7dc59b486e5b50b84db08860a2ceda63ba094d7351bb391f","tests/expand/naming/struct-all.expanded.rs":"1573eb22f4f68b2d2621a5b3d4bda0edfd38ef16efc7f29d9697fc5564a9f615","tests/expand/naming/struct-all.rs":"0d6b64bc687fbc19329a5558461329e3d2cfa367ff8adb7be76efe2d3160d33e","tests/expand/naming/struct-mut.expanded.rs":"6e52a2d4c9fe105307d2cf07882897027713ebcac94249aab7ba0a1ffc2f2f77","tests/expand/naming/struct-mut.rs":"36edd8db816c122c80ccb139b4305cad8edfdf9b7ee4aebacafa1180613a5075","tests/expand/naming/struct-none.expanded.rs":"c0a2a411462f2570340e095963c277da229f7b7dcbe661512ac5f051478d5905","tests/expand/naming/struct-none.rs":"05767cd68ec5cddc481cff5ad677b5146f7d6fd1effcf1ff131d24c334d85032","tests/expand/naming/struct-ref.expanded.rs":"b8744cb83e6764c4c9718c4ad6898ce2c80420730456579ce250e1839bad6027","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":"7c2b49675d7832e2813415b30a5fadcadacd0bc6873f14163b711477e608a93b","tests/expand/pinned_drop/enum.rs":"8f590791cb4693bb077c562f0d93128f9452e6a5f60c631b5fd624a221883ebd","tests/expand/pinned_drop/struct.expanded.rs":"fbb4ad31d81003112d702472c9b519b27a8ce7f3d8067db019270ec9c907be53","tests/expand/pinned_drop/struct.rs":"8da271d7d3182b33be297d985a1e3b57d6067406db21eca8ac2c448ef1a0869a","tests/expand/pub/enum.expanded.rs":"ddc80984cc8cfd30a27c385c3e53ae7c178d774a717040d0e791e81adc7004fe","tests/expand/pub/enum.rs":"fdbd806e92cfad4e67737d1f782544aa4e3116bae702161c43b5c22bfbf3a208","tests/expand/pub/struct.expanded.rs":"435a2322ab580327bfecd40b309b3f2079667ed627bc25bdb41ee03dae0596bb","tests/expand/pub/struct.rs":"05cb3f03ef9801fecf0a7c86bbd236c97218b34ac01ee507cb7de9a78efaeffa","tests/expandtest.rs":"57a43a1efdaabfe516f15dad419c3df64033e36320dd316eb60f98b9099e5de9","tests/include/basic.rs":"271a8c75e2e937d8ffcaa8c43fdf051c5cdf86c1b6b8c216ce0b4ad37977c571","tests/proper_unpin.rs":"83790eb38ae2fd5aed97fc67da79d91c1071f08d1e5aaef0c71e65d8b5767403","tests/test.rs":"8649f0c032f80f4fa48808bb4430a29878ec1f4c9231cf283c0529f36df122c6","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":"721718f4790481ea7eeeda685a36a04e44a48ab34de90c539588da55c50973fe","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/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":"eb795a72a1864d695c11908d9ca7a032fb263e517567415e1c05e702144ed667","tests/ui/pinned_drop/call-drop-inner.rs":"0618b60a450c99b5953b302e26c68df1abe7632af3d9baf3639eb60091e4ff4e","tests/ui/pinned_drop/call-drop-inner.stderr":"3dd0254ed167ebf48c8b056bffe0539c54dde771e63f39499e8f809c37dc87b4","tests/ui/pinned_drop/conditional-drop-impl.rs":"df03f38b2a331f339af2734fdd4ad2f637b2e2189d9928599adebe04ebee517f","tests/ui/pinned_drop/conditional-drop-impl.stderr":"568146640b57700c470fc94db12768b1b4bf6f4d7aa14d8f8bd807d7eef0b2ef"},"package":"bda66fc9667c18cb2758a2ac84d1167245054bcf85d5d1aaa6923f45801bdd02"} \ No newline at end of file diff --git a/third_party/rust/pin-project-lite/CHANGELOG.md b/third_party/rust/pin-project-lite/CHANGELOG.md index 127e467989f9..8a8fbef26451 100644 --- a/third_party/rust/pin-project-lite/CHANGELOG.md +++ b/third_party/rust/pin-project-lite/CHANGELOG.md @@ -10,9 +10,29 @@ Note: In this file, do not use the hard wrap in the middle of a sentence for com ## [Unreleased] +## [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. + +## [0.2.12] - 2023-08-09 + +- Work around an issue where the projected types/methods appear in the documentation as if they were part of the public API if the visibility is not correctly parsed due to the rustc bug. See [#77](https://github.com/taiki-e/pin-project-lite/issues/77#issuecomment-1671540180) for details. + +## [0.2.11] - 2023-08-06 + +- Add support for `#[project(!Unpin)]`. This is equivalent to pin-project's [!Unpin](https://docs.rs/pin-project/latest/pin_project/attr.pin_project.html#unpin) option. ([#76](https://github.com/taiki-e/pin-project-lite/pull/76), thanks @matheus-consoli) + +## [0.2.10] - 2023-07-02 + +- Inline project methods. ([#74](https://github.com/taiki-e/pin-project-lite/pull/74), thanks @EFanZh) + ## [0.2.9] - 2022-04-26 -- Improve compile time of `pin_project!` calls. (#71, thanks @nnethercote) +- Improve compile time of `pin_project!` calls. ([#71](https://github.com/taiki-e/pin-project-lite/pull/71), thanks @nnethercote) ## [0.2.8] - 2021-12-31 @@ -196,7 +216,12 @@ Note: In this file, do not use the hard wrap in the middle of a sentence for com Initial release -[Unreleased]: https://github.com/taiki-e/pin-project-lite/compare/v0.2.9...HEAD +[Unreleased]: https://github.com/taiki-e/pin-project-lite/compare/v0.2.14...HEAD +[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 +[0.2.10]: https://github.com/taiki-e/pin-project-lite/compare/v0.2.9...v0.2.10 [0.2.9]: https://github.com/taiki-e/pin-project-lite/compare/v0.2.8...v0.2.9 [0.2.8]: https://github.com/taiki-e/pin-project-lite/compare/v0.2.7...v0.2.8 [0.2.7]: https://github.com/taiki-e/pin-project-lite/compare/v0.2.6...v0.2.7 diff --git a/third_party/rust/pin-project-lite/Cargo.toml b/third_party/rust/pin-project-lite/Cargo.toml index 8a9436d877d7..9b87534294b9 100644 --- a/third_party/rust/pin-project-lite/Cargo.toml +++ b/third_party/rust/pin-project-lite/Cargo.toml @@ -13,33 +13,125 @@ edition = "2018" rust-version = "1.37" name = "pin-project-lite" -version = "0.2.9" +version = "0.2.14" exclude = [ "/.*", "/tools", + "/DEVELOPMENT.md", ] description = """ A lightweight version of pin-project written with declarative macros. """ +readme = "README.md" keywords = [ "pin", "macros", ] categories = [ "no-std", + "no-std::no-alloc", "rust-patterns", ] 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] +doc-scrape-examples = false + [dev-dependencies.rustversion] version = "1" [dev-dependencies.static_assertions] version = "1" -[dev-dependencies.trybuild] -version = "1.0.49" +[lints.clippy] +all = "warn" +as_ptr_cast_mut = "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" + +[lints.clippy.bool_assert_comparison] +level = "allow" +priority = 1 + +[lints.clippy.borrow_as_ptr] +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.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.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.rust] +improper_ctypes = "warn" +improper_ctypes_definitions = "warn" +non_ascii_idents = "warn" +rust_2018_idioms = "warn" +single_use_lifetimes = "warn" +unreachable_pub = "warn" diff --git a/third_party/rust/pin-project-lite/README.md b/third_party/rust/pin-project-lite/README.md index 78adb7e364fb..8d3150de42a7 100644 --- a/third_party/rust/pin-project-lite/README.md +++ b/third_party/rust/pin-project-lite/README.md @@ -1,11 +1,12 @@ # pin-project-lite [![crates.io](https://img.shields.io/crates/v/pin-project-lite?style=flat-square&logo=rust)](https://crates.io/crates/pin-project-lite) -[![docs.rs](https://img.shields.io/badge/docs.rs-pin--project--lite-blue?style=flat-square)](https://docs.rs/pin-project-lite) +[![docs.rs](https://img.shields.io/badge/docs.rs-pin--project--lite-blue?style=flat-square&logo=docs.rs)](https://docs.rs/pin-project-lite) [![license](https://img.shields.io/badge/license-Apache--2.0_OR_MIT-blue?style=flat-square)](#license) -[![rustc](https://img.shields.io/badge/rustc-1.37+-blue?style=flat-square&logo=rust)](https://www.rust-lang.org) -[![build status](https://img.shields.io/github/workflow/status/taiki-e/pin-project-lite/CI/main?style=flat-square&logo=github)](https://github.com/taiki-e/pin-project-lite/actions) +[![rust version](https://img.shields.io/badge/rustc-1.37+-blue?style=flat-square&logo=rust)](https://www.rust-lang.org) +[![github actions](https://img.shields.io/github/actions/workflow/status/taiki-e/pin-project-lite/ci.yml?branch=main&style=flat-square&logo=github)](https://github.com/taiki-e/pin-project-lite/actions) + A lightweight version of [pin-project] written with declarative macros. ## Usage @@ -104,17 +105,21 @@ description of the compile error. ### Different: No support for custom Unpin implementation -pin-project supports this by [`UnsafeUnpin`][unsafe-unpin] and [`!Unpin`][not-unpin]. +pin-project supports this by [`UnsafeUnpin`][unsafe-unpin]. (`!Unpin` is supported by both [pin-project][not-unpin] and [pin-project-lite][not-unpin-lite].) ### Different: No support for tuple structs and tuple variants pin-project supports this. -[`pin_project!`]: https://docs.rs/pin-project-lite/0.2/pin_project_lite/macro.pin_project.html [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 [pin-project]: https://github.com/taiki-e/pin-project [unsafe-unpin]: https://docs.rs/pin-project/1/pin_project/attr.pin_project.html#unsafeunpin + + +[`pin_project!`]: https://docs.rs/pin-project-lite/0.2/pin_project_lite/macro.pin_project.html + ## License Licensed under either of [Apache License, Version 2.0](LICENSE-APACHE) or diff --git a/third_party/rust/pin-project-lite/src/lib.rs b/third_party/rust/pin-project-lite/src/lib.rs index f5ecc990d62d..ed7c31e620b9 100644 --- a/third_party/rust/pin-project-lite/src/lib.rs +++ b/third_party/rust/pin-project-lite/src/lib.rs @@ -1,98 +1,118 @@ -//! A lightweight version of [pin-project] written with declarative macros. -//! -//! # Examples -//! -//! [`pin_project!`] macro creates a projection type covering all the fields of struct. -//! -//! ```rust -//! use std::pin::Pin; -//! -//! use pin_project_lite::pin_project; -//! -//! pin_project! { -//! struct Struct { -//! #[pin] -//! pinned: T, -//! unpinned: U, -//! } -//! } -//! -//! impl Struct { -//! fn method(self: Pin<&mut Self>) { -//! let this = self.project(); -//! let _: Pin<&mut T> = this.pinned; // Pinned reference to the field -//! let _: &mut U = this.unpinned; // Normal reference to the field -//! } -//! } -//! ``` -//! -//! 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; -//! -//! pin_project! { -//! #[project = EnumProj] -//! enum Enum { -//! Variant { #[pin] pinned: T, unpinned: U }, -//! } -//! } -//! -//! impl Enum { -//! fn method(self: Pin<&mut Self>) { -//! match self.project() { -//! EnumProj::Variant { pinned, unpinned } => { -//! let _: Pin<&mut T> = pinned; -//! let _: &mut U = unpinned; -//! } -//! } -//! } -//! } -//! ``` -//! -//! # [pin-project] vs pin-project-lite -//! -//! Here are some similarities and differences compared to [pin-project]. -//! -//! ## Similar: Safety -//! -//! pin-project-lite guarantees safety in much the same way as [pin-project]. -//! Both are completely safe unless you write other unsafe code. -//! -//! ## Different: Minimal design -//! -//! This library does not tackle as expansive of a range of use cases as -//! [pin-project] does. If your use case is not already covered, please use -//! [pin-project]. -//! -//! ## Different: No proc-macro related dependencies -//! -//! This is the **only** reason to use this crate. However, **if you already -//! have proc-macro related dependencies in your crate's dependency graph, there -//! is no benefit from using this crate.** (Note: There is almost no difference -//! in the amount of code generated between [pin-project] and pin-project-lite.) -//! -//! ## Different: No useful error messages -//! -//! This macro does not handle any invalid input. So error messages are not to -//! be useful in most cases. If you do need useful error messages, then upon -//! error you can pass the same input to [pin-project] to receive a helpful -//! description of the compile error. -//! -//! ## Different: No support for custom Unpin implementation -//! -//! pin-project supports this by [`UnsafeUnpin`][unsafe-unpin] and [`!Unpin`][not-unpin]. -//! -//! ## Different: No support for tuple structs and tuple variants -//! -//! pin-project supports this. -//! -//! [not-unpin]: https://docs.rs/pin-project/1/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 +// SPDX-License-Identifier: Apache-2.0 OR MIT + +/*! + +A lightweight version of [pin-project] written with declarative macros. + +## Usage + +Add this to your `Cargo.toml`: + +```toml +[dependencies] +pin-project-lite = "0.2" +``` + +*Compiler support: requires rustc 1.37+* + +## Examples + +[`pin_project!`] macro creates a projection type covering all the fields of +struct. + +```rust +use std::pin::Pin; + +use pin_project_lite::pin_project; + +pin_project! { + struct Struct { + #[pin] + pinned: T, + unpinned: U, + } +} + +impl Struct { + fn method(self: Pin<&mut Self>) { + let this = self.project(); + let _: Pin<&mut T> = this.pinned; // Pinned reference to the field + let _: &mut U = this.unpinned; // Normal reference to the field + } +} +``` + +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; + +pin_project! { + #[project = EnumProj] + enum Enum { + Variant { #[pin] pinned: T, unpinned: U }, + } +} + +impl Enum { + fn method(self: Pin<&mut Self>) { + match self.project() { + EnumProj::Variant { pinned, unpinned } => { + let _: Pin<&mut T> = pinned; + let _: &mut U = unpinned; + } + } + } +} +``` + +## [pin-project] vs pin-project-lite + +Here are some similarities and differences compared to [pin-project]. + +### Similar: Safety + +pin-project-lite guarantees safety in much the same way as [pin-project]. +Both are completely safe unless you write other unsafe code. + +### Different: Minimal design + +This library does not tackle as expansive of a range of use cases as +[pin-project] does. If your use case is not already covered, please use +[pin-project]. + +### Different: No proc-macro related dependencies + +This is the **only** reason to use this crate. However, **if you already +have proc-macro related dependencies in your crate's dependency graph, there +is no benefit from using this crate.** (Note: There is almost no difference +in the amount of code generated between [pin-project] and pin-project-lite.) + +### Different: No useful error messages + +This macro does not handle any invalid input. So error messages are not to +be useful in most cases. If you do need useful error messages, then upon +error you can pass the same input to [pin-project] to receive a helpful +description of the compile error. + +### Different: No support for custom Unpin implementation + +pin-project supports this by [`UnsafeUnpin`][unsafe-unpin]. (`!Unpin` is supported by both [pin-project][not-unpin] and [pin-project-lite][not-unpin-lite].) + +### Different: No support for tuple structs and tuple variants + +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 +[pin-project]: https://github.com/taiki-e/pin-project +[unsafe-unpin]: https://docs.rs/pin-project/1/pin_project/attr.pin_project.html#unsafeunpin + + +*/ #![no_std] #![doc(test( @@ -102,8 +122,19 @@ allow(dead_code, unused_variables) ) ))] -#![warn(rust_2018_idioms, single_use_lifetimes, unreachable_pub)] -#![warn(clippy::default_trait_access, clippy::wildcard_imports)] +// #![warn(unsafe_op_in_unsafe_fn)] // requires Rust 1.52 +#![warn( + // 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, +)] /// A macro that creates a projection type covering all the fields of struct. /// @@ -114,7 +145,7 @@ /// /// And the following methods are implemented on the original type: /// -/// ```rust +/// ``` /// # use std::pin::Pin; /// # type Projection<'a> = &'a (); /// # type ProjectionRef<'a> = &'a (); @@ -128,7 +159,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! { @@ -154,7 +185,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 { @@ -184,7 +215,7 @@ /// /// # Examples /// -/// ```rust +/// ``` /// use std::pin::Pin; /// /// use pin_project_lite::pin_project; @@ -209,7 +240,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; @@ -241,7 +272,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; @@ -264,10 +295,24 @@ /// /// # `!Unpin` /// -/// If you want to ensure that [`Unpin`] is not implemented, use `#[pin]` -/// attribute for a [`PhantomPinned`] field. +/// If you want to make sure `Unpin` is not implemented, use the `#[project(!Unpin)]` +/// attribute. /// -/// ```rust +/// ``` +/// use pin_project_lite::pin_project; +/// +/// pin_project! { +/// #[project(!Unpin)] +/// struct Struct { +/// #[pin] +/// field: T, +/// } +/// } +/// ``` +/// +/// This is equivalent to using `#[pin]` attribute for a [`PhantomPinned`] field. +/// +/// ``` /// use std::marker::PhantomPinned; /// /// use pin_project_lite::pin_project; @@ -275,13 +320,60 @@ /// pin_project! { /// struct Struct { /// field: T, -/// #[pin] // <------ This `#[pin]` is required to make `Struct` to `!Unpin`. +/// #[pin] /// _pin: PhantomPinned, /// } /// } /// ``` /// -/// Note that using [`PhantomPinned`] without `#[pin]` attribute has no effect. +/// 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 @@ -291,7 +383,7 @@ macro_rules! pin_project { ($($tt:tt)*) => { $crate::__pin_project_internal! { - [][][][] + [][][][][] $($tt)* } }; @@ -313,6 +405,7 @@ macro_rules! __pin_project_expand { [$($proj_mut_ident:ident)?] [$($proj_ref_ident:ident)?] [$($proj_replace_ident:ident)?] + [$($proj_not_unpin_mark:ident)?] [$proj_vis:vis] [$(#[$attrs:meta])* $vis:vis $struct_ty_ident:ident $ident:ident] [$($def_generics:tt)*] @@ -320,7 +413,7 @@ macro_rules! __pin_project_expand { { $($body_data:tt)* } - $(impl $($pinned_drop:tt)*)? + $($(#[$drop_impl_attrs:meta])* impl $($pinned_drop:tt)*)? ) => { $crate::__pin_project_reconstruct! { [$(#[$attrs])* $vis $struct_ty_ident $ident] @@ -362,13 +455,14 @@ macro_rules! __pin_project_expand { $crate::__pin_project_constant! { [$(#[$attrs])* $vis $struct_ty_ident $ident] [$($proj_mut_ident)?] [$($proj_ref_ident)?] [$($proj_replace_ident)?] + [$($proj_not_unpin_mark)?] [$proj_vis] [$($def_generics)*] [$($impl_generics)*] [$($ty_generics)*] [$(where $($where_clause)*)?] { $($body_data)* } - $(impl $($pinned_drop)*)? + $($(#[$drop_impl_attrs])* impl $($pinned_drop)*)? } }; } @@ -379,6 +473,7 @@ macro_rules! __pin_project_constant { ( [$(#[$attrs:meta])* $vis:vis struct $ident:ident] [$($proj_mut_ident:ident)?] [$($proj_ref_ident:ident)?] [$($proj_replace_ident:ident)?] + [$($proj_not_unpin_mark:ident)?] [$proj_vis:vis] [$($def_generics:tt)*] [$($impl_generics:tt)*] [$($ty_generics:tt)*] [$(where $($where_clause:tt)*)?] @@ -388,7 +483,7 @@ macro_rules! __pin_project_constant { $field_vis:vis $field:ident: $field_ty:ty ),+ $(,)? } - $(impl $($pinned_drop:tt)*)? + $($(#[$drop_impl_attrs:meta])* impl $($pinned_drop:tt)*)? ) => { #[allow(explicit_outlives_requirements)] // https://github.com/rust-lang/rust/issues/60993 #[allow(single_use_lifetimes)] // https://github.com/rust-lang/rust/issues/55058 @@ -466,6 +561,7 @@ macro_rules! __pin_project_constant { } $crate::__pin_project_make_unpin_impl! { + [$($proj_not_unpin_mark)?] [$vis $ident] [$($impl_generics)*] [$($ty_generics)*] [$(where $($where_clause)*)?] $( @@ -478,7 +574,7 @@ macro_rules! __pin_project_constant { $crate::__pin_project_make_drop_impl! { [$ident] [$($impl_generics)*] [$($ty_generics)*] [$(where $($where_clause)*)?] - $(impl $($pinned_drop)*)? + $($(#[$drop_impl_attrs])* impl $($pinned_drop)*)? } // Ensure that it's impossible to use pin projections on a #[repr(packed)] struct. @@ -515,6 +611,7 @@ macro_rules! __pin_project_constant { ( [$(#[$attrs:meta])* $vis:vis enum $ident:ident] [$($proj_mut_ident:ident)?] [$($proj_ref_ident:ident)?] [$($proj_replace_ident:ident)?] + [$($proj_not_unpin_mark:ident)?] [$proj_vis:vis] [$($def_generics:tt)*] [$($impl_generics:tt)*] [$($ty_generics:tt)*] [$(where $($where_clause:tt)*)?] @@ -529,7 +626,7 @@ macro_rules! __pin_project_constant { })? ),+ $(,)? } - $(impl $($pinned_drop:tt)*)? + $($(#[$drop_impl_attrs:meta])* impl $($pinned_drop:tt)*)? ) => { #[allow(single_use_lifetimes)] // https://github.com/rust-lang/rust/issues/55058 // This lint warns of `clippy::*` generated by external macros. @@ -591,6 +688,7 @@ macro_rules! __pin_project_constant { } $crate::__pin_project_make_unpin_impl! { + [$($proj_not_unpin_mark)?] [$vis $ident] [$($impl_generics)*] [$($ty_generics)*] [$(where $($where_clause)*)?] $( @@ -607,7 +705,7 @@ macro_rules! __pin_project_constant { $crate::__pin_project_make_drop_impl! { [$ident] [$($impl_generics)*] [$($ty_generics)*] [$(where $($where_clause)*)?] - $(impl $($pinned_drop)*)? + $($(#[$drop_impl_attrs])* impl $($pinned_drop)*)? } // We don't need to check for '#[repr(packed)]', @@ -752,6 +850,7 @@ macro_rules! __pin_project_make_proj_ty_body { [$($impl_generics:tt)*] [$($ty_generics:tt)*] [$(where $($where_clause:tt)*)?] [$($body_data:tt)+] ) => { + #[doc(hidden)] // Workaround for rustc bug: see https://github.com/taiki-e/pin-project-lite/issues/77#issuecomment-1671540180 for more. #[allow(dead_code)] // This lint warns unused fields/variants. #[allow(single_use_lifetimes)] // https://github.com/rust-lang/rust/issues/55058 // This lint warns of `clippy::*` generated by external macros. @@ -845,6 +944,7 @@ macro_rules! __pin_project_make_proj_replace_ty_body { [$($impl_generics:tt)*] [$($ty_generics:tt)*] [$(where $($where_clause:tt)*)?] [$($body_data:tt)+] ) => { + #[doc(hidden)] // Workaround for rustc bug: see https://github.com/taiki-e/pin-project-lite/issues/77#issuecomment-1671540180 for more. #[allow(dead_code)] // This lint warns unused fields/variants. #[allow(single_use_lifetimes)] // https://github.com/rust-lang/rust/issues/55058 #[allow(clippy::mut_mut)] // This lint warns `&mut &mut `. (only needed for project) @@ -923,6 +1023,8 @@ macro_rules! __pin_project_struct_make_proj_method { ),+ } ) => { + #[doc(hidden)] // Workaround for rustc bug: see https://github.com/taiki-e/pin-project-lite/issues/77#issuecomment-1671540180 for more. + #[inline] $proj_vis fn $method_ident<'__pin>( self: $crate::__private::Pin<&'__pin $($mut)? Self>, ) -> $proj_ty_ident <'__pin, $($ty_generics)*> { @@ -956,6 +1058,8 @@ macro_rules! __pin_project_struct_make_proj_replace_method { ),+ } ) => { + #[doc(hidden)] // Workaround for rustc bug: see https://github.com/taiki-e/pin-project-lite/issues/77#issuecomment-1671540180 for more. + #[inline] $proj_vis fn project_replace( self: $crate::__private::Pin<&mut Self>, replacement: Self, @@ -1003,6 +1107,8 @@ macro_rules! __pin_project_enum_make_proj_method { ),+ } ) => { + #[doc(hidden)] // Workaround for rustc bug: see https://github.com/taiki-e/pin-project-lite/issues/77#issuecomment-1671540180 for more. + #[inline] $proj_vis fn $method_ident<'__pin>( self: $crate::__private::Pin<&'__pin $($mut)? Self>, ) -> $proj_ty_ident <'__pin, $($ty_generics)*> { @@ -1046,6 +1152,8 @@ macro_rules! __pin_project_enum_make_proj_replace_method { ),+ } ) => { + #[doc(hidden)] // Workaround for rustc bug: see https://github.com/taiki-e/pin-project-lite/issues/77#issuecomment-1671540180 for more. + #[inline] $proj_vis fn project_replace( self: $crate::__private::Pin<&mut Self>, replacement: Self, @@ -1083,6 +1191,7 @@ macro_rules! __pin_project_enum_make_proj_replace_method { #[macro_export] macro_rules! __pin_project_make_unpin_impl { ( + [] [$vis:vis $ident:ident] [$($impl_generics:tt)*] [$($ty_generics:tt)*] [$(where $($where_clause:tt)*)?] $($field:tt)* @@ -1090,7 +1199,7 @@ macro_rules! __pin_project_make_unpin_impl { // Automatically create the appropriate conditional `Unpin` implementation. // // Basically this is equivalent to the following code: - // ```rust + // ``` // impl Unpin for Struct where T: Unpin {} // ``` // @@ -1127,6 +1236,23 @@ macro_rules! __pin_project_make_unpin_impl { { } }; + ( + [$proj_not_unpin_mark:ident] + [$vis:vis $ident:ident] + [$($impl_generics:tt)*] [$($ty_generics:tt)*] [$(where $($where_clause:tt)*)?] + $($field:tt)* + ) => { + #[doc(hidden)] + impl <'__pin, $($impl_generics)*> $crate::__private::Unpin for $ident <$($ty_generics)*> + where + ( + ::core::marker::PhantomData<&'__pin ()>, + ::core::marker::PhantomPinned, + ): $crate::__private::Unpin + $(, $($where_clause)*)? + { + } + } } #[doc(hidden)] @@ -1135,6 +1261,7 @@ macro_rules! __pin_project_make_drop_impl { ( [$_ident:ident] [$($_impl_generics:tt)*] [$($_ty_generics:tt)*] [$(where $($_where_clause:tt)*)?] + $(#[$drop_impl_attrs:meta])* impl $(< $( $lifetime:lifetime $(: $lifetime_bound:lifetime)? ),* $(,)? $( $generics:ident @@ -1151,11 +1278,13 @@ macro_rules! __pin_project_make_drop_impl { ),* $(,)? )? { + $(#[$drop_fn_attrs:meta])* fn drop($($arg:ident)+: Pin<&mut Self>) { $($tt:tt)* } } ) => { + $(#[$drop_impl_attrs])* impl $(< $( $lifetime $(: $lifetime_bound)? ,)* $( $generics @@ -1172,6 +1301,7 @@ macro_rules! __pin_project_make_drop_impl { ),* )? { + $(#[$drop_fn_attrs])* fn drop(&mut self) { // Implementing `__DropInner::__drop_inner` is safe, but calling it is not safe. // This is because destructors can be called multiple times in safe code and @@ -1325,6 +1455,7 @@ macro_rules! __pin_project_internal { [] [$($proj_ref_ident:ident)?] [$($proj_replace_ident:ident)?] + [$( ! $proj_not_unpin_mark:ident)?] [$($attrs:tt)*] #[project = $proj_mut_ident:ident] @@ -1334,6 +1465,7 @@ macro_rules! __pin_project_internal { [$proj_mut_ident] [$($proj_ref_ident)?] [$($proj_replace_ident)?] + [$( ! $proj_not_unpin_mark)?] [$($attrs)*] $($tt)* } @@ -1343,6 +1475,7 @@ macro_rules! __pin_project_internal { [$($proj_mut_ident:ident)?] [] [$($proj_replace_ident:ident)?] + [$( ! $proj_not_unpin_mark:ident)?] [$($attrs:tt)*] #[project_ref = $proj_ref_ident:ident] @@ -1352,6 +1485,7 @@ macro_rules! __pin_project_internal { [$($proj_mut_ident)?] [$proj_ref_ident] [$($proj_replace_ident)?] + [$( ! $proj_not_unpin_mark)?] [$($attrs)*] $($tt)* } @@ -1361,6 +1495,7 @@ macro_rules! __pin_project_internal { [$($proj_mut_ident:ident)?] [$($proj_ref_ident:ident)?] [] + [$( ! $proj_not_unpin_mark:ident)?] [$($attrs:tt)*] #[project_replace = $proj_replace_ident:ident] @@ -1370,6 +1505,27 @@ macro_rules! __pin_project_internal { [$($proj_mut_ident)?] [$($proj_ref_ident)?] [$proj_replace_ident] + [$( ! $proj_not_unpin_mark)?] + [$($attrs)*] + $($tt)* + } + }; + // parsing !Unpin + ( + [$($proj_mut_ident:ident)?] + [$($proj_ref_ident:ident)?] + [$($proj_replace_ident:ident)?] + [] + [$($attrs:tt)*] + + #[project( ! $proj_not_unpin_mark:ident)] + $($tt:tt)* + ) => { + $crate::__pin_project_internal! { + [$($proj_mut_ident)?] + [$($proj_ref_ident)?] + [$($proj_replace_ident)?] + [ ! $proj_not_unpin_mark] [$($attrs)*] $($tt)* } @@ -1380,6 +1536,7 @@ macro_rules! __pin_project_internal { [$($proj_mut_ident:ident)?] [$($proj_ref_ident:ident)?] [$($proj_replace_ident:ident)?] + [$( ! $proj_not_unpin_mark:ident)?] [$($attrs:tt)*] #[$($attr:tt)*] @@ -1389,6 +1546,7 @@ macro_rules! __pin_project_internal { [$($proj_mut_ident)?] [$($proj_ref_ident)?] [$($proj_replace_ident)?] + [$( ! $proj_not_unpin_mark)?] [$($attrs)* #[$($attr)*]] $($tt)* } @@ -1399,6 +1557,7 @@ macro_rules! __pin_project_internal { [$($proj_mut_ident:ident)?] [$($proj_ref_ident:ident)?] [$($proj_replace_ident:ident)?] + [$( ! $proj_not_unpin_mark:ident)?] [$($attrs:tt)*] pub $struct_ty_ident:ident $ident:ident $($tt:tt)* @@ -1407,6 +1566,7 @@ macro_rules! __pin_project_internal { [$($proj_mut_ident)?] [$($proj_ref_ident)?] [$($proj_replace_ident)?] + [$($proj_not_unpin_mark)?] [$($attrs)*] [pub $struct_ty_ident $ident pub(crate)] $($tt)* @@ -1416,6 +1576,7 @@ macro_rules! __pin_project_internal { [$($proj_mut_ident:ident)?] [$($proj_ref_ident:ident)?] [$($proj_replace_ident:ident)?] + [$( ! $proj_not_unpin_mark:ident)?] [$($attrs:tt)*] $vis:vis $struct_ty_ident:ident $ident:ident $($tt:tt)* @@ -1424,6 +1585,7 @@ macro_rules! __pin_project_internal { [$($proj_mut_ident)?] [$($proj_ref_ident)?] [$($proj_replace_ident)?] + [$($proj_not_unpin_mark)?] [$($attrs)*] [$vis $struct_ty_ident $ident $vis] $($tt)* @@ -1438,8 +1600,9 @@ macro_rules! __pin_project_parse_generics { [$($proj_mut_ident:ident)?] [$($proj_ref_ident:ident)?] [$($proj_replace_ident:ident)?] + [$($proj_not_unpin_mark:ident)?] [$($attrs:tt)*] - [$vis:vis $struct_ty_ident:ident $ident:ident $proj_ty_vis:vis] + [$vis:vis $struct_ty_ident:ident $ident:ident $proj_vis:vis] $(< $( $lifetime:lifetime $(: $lifetime_bound:lifetime)? ),* $(,)? $( $generics:ident @@ -1459,13 +1622,14 @@ macro_rules! __pin_project_parse_generics { { $($body_data:tt)* } - $(impl $($pinned_drop:tt)*)? + $($(#[$drop_impl_attrs:meta])* impl $($pinned_drop:tt)*)? ) => { $crate::__pin_project_expand! { [$($proj_mut_ident)?] [$($proj_ref_ident)?] [$($proj_replace_ident)?] - [$proj_ty_vis] + [$($proj_not_unpin_mark)?] + [$proj_vis] [$($attrs)* $vis $struct_ty_ident $ident] [$(< $( $lifetime $(: $lifetime_bound)? ,)* @@ -1493,12 +1657,14 @@ macro_rules! __pin_project_parse_generics { { $($body_data)* } - $(impl $($pinned_drop)*)? + $($(#[$drop_impl_attrs])* impl $($pinned_drop)*)? } }; } +// Not public API. #[doc(hidden)] +#[allow(missing_debug_implementations)] pub mod __private { use core::mem::ManuallyDrop; #[doc(hidden)] @@ -1528,6 +1694,8 @@ pub mod __private { impl Drop for UnsafeDropInPlaceGuard { fn drop(&mut self) { + // SAFETY: the caller of `UnsafeDropInPlaceGuard::new` must guarantee + // that `ptr` is valid for drop when this guard is destructed. unsafe { ptr::drop_in_place(self.0); } @@ -1551,6 +1719,8 @@ pub mod __private { impl Drop for UnsafeOverwriteGuard { fn drop(&mut self) { + // SAFETY: the caller of `UnsafeOverwriteGuard::new` must guarantee + // that `target` is valid for writes when this guard is destructed. unsafe { ptr::write(self.target, ptr::read(&*self.value)); } diff --git a/third_party/rust/pin-project-lite/tests/README.md b/third_party/rust/pin-project-lite/tests/README.md deleted file mode 100644 index 47216165df35..000000000000 --- a/third_party/rust/pin-project-lite/tests/README.md +++ /dev/null @@ -1,46 +0,0 @@ -# Tests - -Many of the tests in this repository are based on [pin-project's tests](https://github.com/taiki-e/pin-project/tree/HEAD/tests). - -To run all tests, run the following command: - -```sh -cargo +nightly test --all -``` - -## UI tests (`ui`, `compiletest.rs`) - -This checks errors detected by the macro or the Rust compiler in the resulting -expanded code. - -To run this test, run the following command: - -```sh -cargo +nightly test --test compiletest -``` - -Locally, this test updates the files in the `ui` directory if there are -changes to the generated code. If there are any changes to the files in the -`ui` directory after running the test, please commit them. - -See also [`trybuild` documentation](https://docs.rs/trybuild). - -## Expansion tests (`expand`, `expandtest.rs`) - -Similar to ui tests, but instead of checking the compiler output, this checks -the code generated by macros. - -See pin-project's [examples](https://github.com/taiki-e/pin-project/tree/HEAD/examples) -for descriptions of what the generated code does, and why it needs to be generated. - -To run this test, run the following command: - -```sh -cargo +nightly test --test expandtest -``` - -Locally, this test updates the files in the `expand` directory if there are -changes to the generated code. If there are any changes to the files in the -`expand` directory after running the test, please commit them. - -See also [`macrotest` documentation](https://docs.rs/macrotest). diff --git a/third_party/rust/pin-project-lite/tests/auxiliary/mod.rs b/third_party/rust/pin-project-lite/tests/auxiliary/mod.rs index 145709916011..4ccd0a87739e 100644 --- a/third_party/rust/pin-project-lite/tests/auxiliary/mod.rs +++ b/third_party/rust/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/third_party/rust/pin-project-lite/tests/compiletest.rs b/third_party/rust/pin-project-lite/tests/compiletest.rs index 70d2358943a1..ff86f1fdc5dc 100644 --- a/third_party/rust/pin-project-lite/tests/compiletest.rs +++ b/third_party/rust/pin-project-lite/tests/compiletest.rs @@ -1,15 +1,12 @@ -#![cfg(not(miri))] -#![warn(rust_2018_idioms, single_use_lifetimes)] +// SPDX-License-Identifier: Apache-2.0 OR MIT -use std::env; +#![cfg(not(miri))] +#![cfg(not(careful))] #[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/third_party/rust/pin-project-lite/tests/drop_order.rs b/third_party/rust/pin-project-lite/tests/drop_order.rs index 6e5deaf15464..ccceb8e7f8db 100644 --- a/third_party/rust/pin-project-lite/tests/drop_order.rs +++ b/third_party/rust/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/third_party/rust/pin-project-lite/tests/expand/default/enum.expanded.rs b/third_party/rust/pin-project-lite/tests/expand/default/enum.expanded.rs index eae0aac85e91..456b8cc1bef0 100644 --- a/third_party/rust/pin-project-lite/tests/expand/default/enum.expanded.rs +++ b/third_party/rust/pin-project-lite/tests/expand/default/enum.expanded.rs @@ -3,6 +3,7 @@ enum Enum { Struct { pinned: T, unpinned: U }, Unit, } +#[doc(hidden)] #[allow(dead_code)] #[allow(single_use_lifetimes)] #[allow(clippy::unknown_clippy_lints)] @@ -20,6 +21,7 @@ where }, Unit, } +#[doc(hidden)] #[allow(dead_code)] #[allow(single_use_lifetimes)] #[allow(clippy::unknown_clippy_lints)] @@ -37,16 +39,14 @@ where }, Unit, } +#[doc(hidden)] #[allow(dead_code)] #[allow(single_use_lifetimes)] #[allow(clippy::mut_mut)] #[allow(clippy::redundant_pub_crate)] #[allow(clippy::type_repetition_in_bounds)] enum EnumProjReplace { - Struct { - pinned: ::pin_project_lite::__private::PhantomData, - unpinned: U, - }, + Struct { pinned: ::pin_project_lite::__private::PhantomData, unpinned: U }, Unit, } #[allow(single_use_lifetimes)] @@ -54,32 +54,46 @@ enum EnumProjReplace { #[allow(clippy::used_underscore_binding)] const _: () = { impl Enum { + #[doc(hidden)] + #[inline] fn project<'__pin>( self: ::pin_project_lite::__private::Pin<&'__pin mut Self>, ) -> EnumProj<'__pin, T, U> { unsafe { match self.get_unchecked_mut() { - Self::Struct { pinned, unpinned } => EnumProj::Struct { - pinned: ::pin_project_lite::__private::Pin::new_unchecked(pinned), - unpinned: unpinned, - }, + Self::Struct { pinned, unpinned } => { + EnumProj::Struct { + pinned: ::pin_project_lite::__private::Pin::new_unchecked( + pinned, + ), + unpinned: unpinned, + } + } Self::Unit => EnumProj::Unit, } } } + #[doc(hidden)] + #[inline] fn project_ref<'__pin>( self: ::pin_project_lite::__private::Pin<&'__pin Self>, ) -> EnumProjRef<'__pin, T, U> { unsafe { match self.get_ref() { - Self::Struct { pinned, unpinned } => EnumProjRef::Struct { - pinned: ::pin_project_lite::__private::Pin::new_unchecked(pinned), - unpinned: unpinned, - }, + Self::Struct { pinned, unpinned } => { + EnumProjRef::Struct { + pinned: ::pin_project_lite::__private::Pin::new_unchecked( + pinned, + ), + unpinned: unpinned, + } + } Self::Unit => EnumProjRef::Unit, } } } + #[doc(hidden)] + #[inline] fn project_replace( self: ::pin_project_lite::__private::Pin<&mut Self>, replacement: Self, @@ -98,7 +112,9 @@ const _: () = { }; { ( - ::pin_project_lite::__private::UnsafeDropInPlaceGuard::new(pinned), + ::pin_project_lite::__private::UnsafeDropInPlaceGuard::new( + pinned, + ), (), ); } @@ -115,10 +131,10 @@ const _: () = { Struct: (T, ::pin_project_lite::__private::AlwaysUnpin), Unit: (), } - impl<'__pin, T, U> ::pin_project_lite::__private::Unpin for Enum where - __Origin<'__pin, T, U>: ::pin_project_lite::__private::Unpin - { - } + impl<'__pin, T, U> ::pin_project_lite::__private::Unpin for Enum + where + __Origin<'__pin, T, U>: ::pin_project_lite::__private::Unpin, + {} trait MustNotImplDrop {} #[allow(clippy::drop_bounds, drop_bounds)] impl MustNotImplDrop for T {} diff --git a/third_party/rust/pin-project-lite/tests/expand/default/enum.rs b/third_party/rust/pin-project-lite/tests/expand/default/enum.rs index 90d6860a8191..c9d98519b927 100644 --- a/third_party/rust/pin-project-lite/tests/expand/default/enum.rs +++ b/third_party/rust/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/third_party/rust/pin-project-lite/tests/expand/default/struct.expanded.rs b/third_party/rust/pin-project-lite/tests/expand/default/struct.expanded.rs index 8ab318cfb894..a9792e1f692d 100644 --- a/third_party/rust/pin-project-lite/tests/expand/default/struct.expanded.rs +++ b/third_party/rust/pin-project-lite/tests/expand/default/struct.expanded.rs @@ -9,6 +9,7 @@ struct Struct { #[allow(clippy::redundant_pub_crate)] #[allow(clippy::used_underscore_binding)] const _: () = { + #[doc(hidden)] #[allow(dead_code)] #[allow(single_use_lifetimes)] #[allow(clippy::unknown_clippy_lints)] @@ -23,6 +24,7 @@ const _: () = { pinned: ::pin_project_lite::__private::Pin<&'__pin mut (T)>, unpinned: &'__pin mut (U), } + #[doc(hidden)] #[allow(dead_code)] #[allow(single_use_lifetimes)] #[allow(clippy::unknown_clippy_lints)] @@ -38,6 +40,8 @@ const _: () = { unpinned: &'__pin (U), } impl Struct { + #[doc(hidden)] + #[inline] fn project<'__pin>( self: ::pin_project_lite::__private::Pin<&'__pin mut Self>, ) -> Projection<'__pin, T, U> { @@ -49,6 +53,8 @@ const _: () = { } } } + #[doc(hidden)] + #[inline] fn project_ref<'__pin>( self: ::pin_project_lite::__private::Pin<&'__pin Self>, ) -> ProjectionRef<'__pin, T, U> { @@ -67,10 +73,10 @@ const _: () = { pinned: T, unpinned: ::pin_project_lite::__private::AlwaysUnpin, } - impl<'__pin, T, U> ::pin_project_lite::__private::Unpin for Struct where - __Origin<'__pin, T, U>: ::pin_project_lite::__private::Unpin - { - } + impl<'__pin, T, U> ::pin_project_lite::__private::Unpin for Struct + where + __Origin<'__pin, T, U>: ::pin_project_lite::__private::Unpin, + {} trait MustNotImplDrop {} #[allow(clippy::drop_bounds, drop_bounds)] impl MustNotImplDrop for T {} diff --git a/third_party/rust/pin-project-lite/tests/expand/default/struct.rs b/third_party/rust/pin-project-lite/tests/expand/default/struct.rs index e5447c70a64a..e4245d163ad1 100644 --- a/third_party/rust/pin-project-lite/tests/expand/default/struct.rs +++ b/third_party/rust/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/third_party/rust/pin-project-lite/tests/expand/multifields/enum.expanded.rs b/third_party/rust/pin-project-lite/tests/expand/multifields/enum.expanded.rs index fca0febcda04..f722a142040b 100644 --- a/third_party/rust/pin-project-lite/tests/expand/multifields/enum.expanded.rs +++ b/third_party/rust/pin-project-lite/tests/expand/multifields/enum.expanded.rs @@ -1,13 +1,9 @@ use pin_project_lite::pin_project; enum Enum { - Struct { - pinned1: T, - pinned2: T, - unpinned1: U, - unpinned2: U, - }, + Struct { pinned1: T, pinned2: T, unpinned1: U, unpinned2: U }, Unit, } +#[doc(hidden)] #[allow(dead_code)] #[allow(single_use_lifetimes)] #[allow(clippy::mut_mut)] @@ -27,6 +23,8 @@ enum EnumProjReplace { #[allow(clippy::used_underscore_binding)] const _: () = { impl Enum { + #[doc(hidden)] + #[inline] fn project_replace( self: ::pin_project_lite::__private::Pin<&mut Self>, replacement: Self, @@ -38,22 +36,25 @@ const _: () = { replacement, ); match &mut *__self_ptr { - Self::Struct { - pinned1, - pinned2, - unpinned1, - unpinned2, - } => { + Self::Struct { pinned1, pinned2, unpinned1, unpinned2 } => { let result = EnumProjReplace::Struct { pinned1: ::pin_project_lite::__private::PhantomData, pinned2: ::pin_project_lite::__private::PhantomData, - unpinned1: ::pin_project_lite::__private::ptr::read(unpinned1), - unpinned2: ::pin_project_lite::__private::ptr::read(unpinned2), + unpinned1: ::pin_project_lite::__private::ptr::read( + unpinned1, + ), + unpinned2: ::pin_project_lite::__private::ptr::read( + unpinned2, + ), }; { ( - ::pin_project_lite::__private::UnsafeDropInPlaceGuard::new(pinned1), - ::pin_project_lite::__private::UnsafeDropInPlaceGuard::new(pinned2), + ::pin_project_lite::__private::UnsafeDropInPlaceGuard::new( + pinned1, + ), + ::pin_project_lite::__private::UnsafeDropInPlaceGuard::new( + pinned2, + ), (), (), ); @@ -76,10 +77,10 @@ const _: () = { ), Unit: (), } - impl<'__pin, T, U> ::pin_project_lite::__private::Unpin for Enum where - __Origin<'__pin, T, U>: ::pin_project_lite::__private::Unpin - { - } + impl<'__pin, T, U> ::pin_project_lite::__private::Unpin for Enum + where + __Origin<'__pin, T, U>: ::pin_project_lite::__private::Unpin, + {} trait MustNotImplDrop {} #[allow(clippy::drop_bounds, drop_bounds)] impl MustNotImplDrop for T {} diff --git a/third_party/rust/pin-project-lite/tests/expand/multifields/enum.rs b/third_party/rust/pin-project-lite/tests/expand/multifields/enum.rs index c713362ad661..1357c2f5446b 100644 --- a/third_party/rust/pin-project-lite/tests/expand/multifields/enum.rs +++ b/third_party/rust/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/third_party/rust/pin-project-lite/tests/expand/multifields/struct.expanded.rs b/third_party/rust/pin-project-lite/tests/expand/multifields/struct.expanded.rs index 4320f6843824..83ebefe90ef3 100644 --- a/third_party/rust/pin-project-lite/tests/expand/multifields/struct.expanded.rs +++ b/third_party/rust/pin-project-lite/tests/expand/multifields/struct.expanded.rs @@ -5,6 +5,7 @@ struct Struct { unpinned1: U, unpinned2: U, } +#[doc(hidden)] #[allow(dead_code)] #[allow(single_use_lifetimes)] #[allow(clippy::mut_mut)] @@ -22,6 +23,7 @@ struct StructProjReplace { #[allow(clippy::redundant_pub_crate)] #[allow(clippy::used_underscore_binding)] const _: () = { + #[doc(hidden)] #[allow(dead_code)] #[allow(single_use_lifetimes)] #[allow(clippy::unknown_clippy_lints)] @@ -38,6 +40,7 @@ const _: () = { unpinned1: &'__pin mut (U), unpinned2: &'__pin mut (U), } + #[doc(hidden)] #[allow(dead_code)] #[allow(single_use_lifetimes)] #[allow(clippy::unknown_clippy_lints)] @@ -55,16 +58,14 @@ const _: () = { unpinned2: &'__pin (U), } impl Struct { + #[doc(hidden)] + #[inline] fn project<'__pin>( self: ::pin_project_lite::__private::Pin<&'__pin mut Self>, ) -> Projection<'__pin, T, U> { unsafe { - let Self { - pinned1, - pinned2, - unpinned1, - unpinned2, - } = self.get_unchecked_mut(); + let Self { pinned1, pinned2, unpinned1, unpinned2 } = self + .get_unchecked_mut(); Projection { pinned1: ::pin_project_lite::__private::Pin::new_unchecked(pinned1), pinned2: ::pin_project_lite::__private::Pin::new_unchecked(pinned2), @@ -73,16 +74,13 @@ const _: () = { } } } + #[doc(hidden)] + #[inline] fn project_ref<'__pin>( self: ::pin_project_lite::__private::Pin<&'__pin Self>, ) -> ProjectionRef<'__pin, T, U> { unsafe { - let Self { - pinned1, - pinned2, - unpinned1, - unpinned2, - } = self.get_ref(); + let Self { pinned1, pinned2, unpinned1, unpinned2 } = self.get_ref(); ProjectionRef { pinned1: ::pin_project_lite::__private::Pin::new_unchecked(pinned1), pinned2: ::pin_project_lite::__private::Pin::new_unchecked(pinned2), @@ -91,6 +89,8 @@ const _: () = { } } } + #[doc(hidden)] + #[inline] fn project_replace( self: ::pin_project_lite::__private::Pin<&mut Self>, replacement: Self, @@ -101,12 +101,7 @@ const _: () = { __self_ptr, replacement, ); - let Self { - pinned1, - pinned2, - unpinned1, - unpinned2, - } = &mut *__self_ptr; + let Self { pinned1, pinned2, unpinned1, unpinned2 } = &mut *__self_ptr; let result = StructProjReplace { pinned1: ::pin_project_lite::__private::PhantomData, pinned2: ::pin_project_lite::__private::PhantomData, @@ -115,8 +110,12 @@ const _: () = { }; { ( - ::pin_project_lite::__private::UnsafeDropInPlaceGuard::new(pinned1), - ::pin_project_lite::__private::UnsafeDropInPlaceGuard::new(pinned2), + ::pin_project_lite::__private::UnsafeDropInPlaceGuard::new( + pinned1, + ), + ::pin_project_lite::__private::UnsafeDropInPlaceGuard::new( + pinned2, + ), (), (), ); @@ -133,10 +132,10 @@ const _: () = { unpinned1: ::pin_project_lite::__private::AlwaysUnpin, unpinned2: ::pin_project_lite::__private::AlwaysUnpin, } - impl<'__pin, T, U> ::pin_project_lite::__private::Unpin for Struct where - __Origin<'__pin, T, U>: ::pin_project_lite::__private::Unpin - { - } + impl<'__pin, T, U> ::pin_project_lite::__private::Unpin for Struct + where + __Origin<'__pin, T, U>: ::pin_project_lite::__private::Unpin, + {} trait MustNotImplDrop {} #[allow(clippy::drop_bounds, drop_bounds)] impl MustNotImplDrop for T {} diff --git a/third_party/rust/pin-project-lite/tests/expand/multifields/struct.rs b/third_party/rust/pin-project-lite/tests/expand/multifields/struct.rs index a1d45d168eee..2bff55d77870 100644 --- a/third_party/rust/pin-project-lite/tests/expand/multifields/struct.rs +++ b/third_party/rust/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/third_party/rust/pin-project-lite/tests/expand/naming/enum-all.expanded.rs b/third_party/rust/pin-project-lite/tests/expand/naming/enum-all.expanded.rs index eae0aac85e91..456b8cc1bef0 100644 --- a/third_party/rust/pin-project-lite/tests/expand/naming/enum-all.expanded.rs +++ b/third_party/rust/pin-project-lite/tests/expand/naming/enum-all.expanded.rs @@ -3,6 +3,7 @@ enum Enum { Struct { pinned: T, unpinned: U }, Unit, } +#[doc(hidden)] #[allow(dead_code)] #[allow(single_use_lifetimes)] #[allow(clippy::unknown_clippy_lints)] @@ -20,6 +21,7 @@ where }, Unit, } +#[doc(hidden)] #[allow(dead_code)] #[allow(single_use_lifetimes)] #[allow(clippy::unknown_clippy_lints)] @@ -37,16 +39,14 @@ where }, Unit, } +#[doc(hidden)] #[allow(dead_code)] #[allow(single_use_lifetimes)] #[allow(clippy::mut_mut)] #[allow(clippy::redundant_pub_crate)] #[allow(clippy::type_repetition_in_bounds)] enum EnumProjReplace { - Struct { - pinned: ::pin_project_lite::__private::PhantomData, - unpinned: U, - }, + Struct { pinned: ::pin_project_lite::__private::PhantomData, unpinned: U }, Unit, } #[allow(single_use_lifetimes)] @@ -54,32 +54,46 @@ enum EnumProjReplace { #[allow(clippy::used_underscore_binding)] const _: () = { impl Enum { + #[doc(hidden)] + #[inline] fn project<'__pin>( self: ::pin_project_lite::__private::Pin<&'__pin mut Self>, ) -> EnumProj<'__pin, T, U> { unsafe { match self.get_unchecked_mut() { - Self::Struct { pinned, unpinned } => EnumProj::Struct { - pinned: ::pin_project_lite::__private::Pin::new_unchecked(pinned), - unpinned: unpinned, - }, + Self::Struct { pinned, unpinned } => { + EnumProj::Struct { + pinned: ::pin_project_lite::__private::Pin::new_unchecked( + pinned, + ), + unpinned: unpinned, + } + } Self::Unit => EnumProj::Unit, } } } + #[doc(hidden)] + #[inline] fn project_ref<'__pin>( self: ::pin_project_lite::__private::Pin<&'__pin Self>, ) -> EnumProjRef<'__pin, T, U> { unsafe { match self.get_ref() { - Self::Struct { pinned, unpinned } => EnumProjRef::Struct { - pinned: ::pin_project_lite::__private::Pin::new_unchecked(pinned), - unpinned: unpinned, - }, + Self::Struct { pinned, unpinned } => { + EnumProjRef::Struct { + pinned: ::pin_project_lite::__private::Pin::new_unchecked( + pinned, + ), + unpinned: unpinned, + } + } Self::Unit => EnumProjRef::Unit, } } } + #[doc(hidden)] + #[inline] fn project_replace( self: ::pin_project_lite::__private::Pin<&mut Self>, replacement: Self, @@ -98,7 +112,9 @@ const _: () = { }; { ( - ::pin_project_lite::__private::UnsafeDropInPlaceGuard::new(pinned), + ::pin_project_lite::__private::UnsafeDropInPlaceGuard::new( + pinned, + ), (), ); } @@ -115,10 +131,10 @@ const _: () = { Struct: (T, ::pin_project_lite::__private::AlwaysUnpin), Unit: (), } - impl<'__pin, T, U> ::pin_project_lite::__private::Unpin for Enum where - __Origin<'__pin, T, U>: ::pin_project_lite::__private::Unpin - { - } + impl<'__pin, T, U> ::pin_project_lite::__private::Unpin for Enum + where + __Origin<'__pin, T, U>: ::pin_project_lite::__private::Unpin, + {} trait MustNotImplDrop {} #[allow(clippy::drop_bounds, drop_bounds)] impl MustNotImplDrop for T {} diff --git a/third_party/rust/pin-project-lite/tests/expand/naming/enum-all.rs b/third_party/rust/pin-project-lite/tests/expand/naming/enum-all.rs index 90d6860a8191..c9d98519b927 100644 --- a/third_party/rust/pin-project-lite/tests/expand/naming/enum-all.rs +++ b/third_party/rust/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/third_party/rust/pin-project-lite/tests/expand/naming/enum-mut.expanded.rs b/third_party/rust/pin-project-lite/tests/expand/naming/enum-mut.expanded.rs index 7c4d6afbf986..342588cf61ae 100644 --- a/third_party/rust/pin-project-lite/tests/expand/naming/enum-mut.expanded.rs +++ b/third_party/rust/pin-project-lite/tests/expand/naming/enum-mut.expanded.rs @@ -3,6 +3,7 @@ enum Enum { Struct { pinned: T, unpinned: U }, Unit, } +#[doc(hidden)] #[allow(dead_code)] #[allow(single_use_lifetimes)] #[allow(clippy::unknown_clippy_lints)] @@ -25,15 +26,21 @@ where #[allow(clippy::used_underscore_binding)] const _: () = { impl Enum { + #[doc(hidden)] + #[inline] fn project<'__pin>( self: ::pin_project_lite::__private::Pin<&'__pin mut Self>, ) -> EnumProj<'__pin, T, U> { unsafe { match self.get_unchecked_mut() { - Self::Struct { pinned, unpinned } => EnumProj::Struct { - pinned: ::pin_project_lite::__private::Pin::new_unchecked(pinned), - unpinned: unpinned, - }, + Self::Struct { pinned, unpinned } => { + EnumProj::Struct { + pinned: ::pin_project_lite::__private::Pin::new_unchecked( + pinned, + ), + unpinned: unpinned, + } + } Self::Unit => EnumProj::Unit, } } @@ -45,10 +52,10 @@ const _: () = { Struct: (T, ::pin_project_lite::__private::AlwaysUnpin), Unit: (), } - impl<'__pin, T, U> ::pin_project_lite::__private::Unpin for Enum where - __Origin<'__pin, T, U>: ::pin_project_lite::__private::Unpin - { - } + impl<'__pin, T, U> ::pin_project_lite::__private::Unpin for Enum + where + __Origin<'__pin, T, U>: ::pin_project_lite::__private::Unpin, + {} trait MustNotImplDrop {} #[allow(clippy::drop_bounds, drop_bounds)] impl MustNotImplDrop for T {} diff --git a/third_party/rust/pin-project-lite/tests/expand/naming/enum-mut.rs b/third_party/rust/pin-project-lite/tests/expand/naming/enum-mut.rs index 69beecd1d9e8..1e68532d2826 100644 --- a/third_party/rust/pin-project-lite/tests/expand/naming/enum-mut.rs +++ b/third_party/rust/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/third_party/rust/pin-project-lite/tests/expand/naming/enum-none.expanded.rs b/third_party/rust/pin-project-lite/tests/expand/naming/enum-none.expanded.rs index 28ce97da7b10..fc3b3dcaf926 100644 --- a/third_party/rust/pin-project-lite/tests/expand/naming/enum-none.expanded.rs +++ b/third_party/rust/pin-project-lite/tests/expand/naming/enum-none.expanded.rs @@ -14,10 +14,10 @@ const _: () = { Struct: (T, ::pin_project_lite::__private::AlwaysUnpin), Unit: (), } - impl<'__pin, T, U> ::pin_project_lite::__private::Unpin for Enum where - __Origin<'__pin, T, U>: ::pin_project_lite::__private::Unpin - { - } + impl<'__pin, T, U> ::pin_project_lite::__private::Unpin for Enum + where + __Origin<'__pin, T, U>: ::pin_project_lite::__private::Unpin, + {} trait MustNotImplDrop {} #[allow(clippy::drop_bounds, drop_bounds)] impl MustNotImplDrop for T {} diff --git a/third_party/rust/pin-project-lite/tests/expand/naming/enum-none.rs b/third_party/rust/pin-project-lite/tests/expand/naming/enum-none.rs index b2e3f9d76a30..02281358e5f3 100644 --- a/third_party/rust/pin-project-lite/tests/expand/naming/enum-none.rs +++ b/third_party/rust/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/third_party/rust/pin-project-lite/tests/expand/naming/enum-ref.expanded.rs b/third_party/rust/pin-project-lite/tests/expand/naming/enum-ref.expanded.rs index a1a013bda4cd..5270e1290f63 100644 --- a/third_party/rust/pin-project-lite/tests/expand/naming/enum-ref.expanded.rs +++ b/third_party/rust/pin-project-lite/tests/expand/naming/enum-ref.expanded.rs @@ -3,6 +3,7 @@ enum Enum { Struct { pinned: T, unpinned: U }, Unit, } +#[doc(hidden)] #[allow(dead_code)] #[allow(single_use_lifetimes)] #[allow(clippy::unknown_clippy_lints)] @@ -25,15 +26,21 @@ where #[allow(clippy::used_underscore_binding)] const _: () = { impl Enum { + #[doc(hidden)] + #[inline] fn project_ref<'__pin>( self: ::pin_project_lite::__private::Pin<&'__pin Self>, ) -> EnumProjRef<'__pin, T, U> { unsafe { match self.get_ref() { - Self::Struct { pinned, unpinned } => EnumProjRef::Struct { - pinned: ::pin_project_lite::__private::Pin::new_unchecked(pinned), - unpinned: unpinned, - }, + Self::Struct { pinned, unpinned } => { + EnumProjRef::Struct { + pinned: ::pin_project_lite::__private::Pin::new_unchecked( + pinned, + ), + unpinned: unpinned, + } + } Self::Unit => EnumProjRef::Unit, } } @@ -45,10 +52,10 @@ const _: () = { Struct: (T, ::pin_project_lite::__private::AlwaysUnpin), Unit: (), } - impl<'__pin, T, U> ::pin_project_lite::__private::Unpin for Enum where - __Origin<'__pin, T, U>: ::pin_project_lite::__private::Unpin - { - } + impl<'__pin, T, U> ::pin_project_lite::__private::Unpin for Enum + where + __Origin<'__pin, T, U>: ::pin_project_lite::__private::Unpin, + {} trait MustNotImplDrop {} #[allow(clippy::drop_bounds, drop_bounds)] impl MustNotImplDrop for T {} diff --git a/third_party/rust/pin-project-lite/tests/expand/naming/enum-ref.rs b/third_party/rust/pin-project-lite/tests/expand/naming/enum-ref.rs index 480d592d6829..8f81d386ee21 100644 --- a/third_party/rust/pin-project-lite/tests/expand/naming/enum-ref.rs +++ b/third_party/rust/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/third_party/rust/pin-project-lite/tests/expand/naming/struct-all.expanded.rs b/third_party/rust/pin-project-lite/tests/expand/naming/struct-all.expanded.rs index b91c24eb2a36..13c4079f2b1f 100644 --- a/third_party/rust/pin-project-lite/tests/expand/naming/struct-all.expanded.rs +++ b/third_party/rust/pin-project-lite/tests/expand/naming/struct-all.expanded.rs @@ -3,6 +3,7 @@ struct Struct { pinned: T, unpinned: U, } +#[doc(hidden)] #[allow(dead_code)] #[allow(single_use_lifetimes)] #[allow(clippy::unknown_clippy_lints)] @@ -17,6 +18,7 @@ where pinned: ::pin_project_lite::__private::Pin<&'__pin mut (T)>, unpinned: &'__pin mut (U), } +#[doc(hidden)] #[allow(dead_code)] #[allow(single_use_lifetimes)] #[allow(clippy::unknown_clippy_lints)] @@ -31,6 +33,7 @@ where pinned: ::pin_project_lite::__private::Pin<&'__pin (T)>, unpinned: &'__pin (U), } +#[doc(hidden)] #[allow(dead_code)] #[allow(single_use_lifetimes)] #[allow(clippy::mut_mut)] @@ -47,6 +50,8 @@ struct StructProjReplace { #[allow(clippy::used_underscore_binding)] const _: () = { impl Struct { + #[doc(hidden)] + #[inline] fn project<'__pin>( self: ::pin_project_lite::__private::Pin<&'__pin mut Self>, ) -> StructProj<'__pin, T, U> { @@ -58,6 +63,8 @@ const _: () = { } } } + #[doc(hidden)] + #[inline] fn project_ref<'__pin>( self: ::pin_project_lite::__private::Pin<&'__pin Self>, ) -> StructProjRef<'__pin, T, U> { @@ -69,6 +76,8 @@ const _: () = { } } } + #[doc(hidden)] + #[inline] fn project_replace( self: ::pin_project_lite::__private::Pin<&mut Self>, replacement: Self, @@ -86,7 +95,9 @@ const _: () = { }; { ( - ::pin_project_lite::__private::UnsafeDropInPlaceGuard::new(pinned), + ::pin_project_lite::__private::UnsafeDropInPlaceGuard::new( + pinned, + ), (), ); } @@ -100,10 +111,10 @@ const _: () = { pinned: T, unpinned: ::pin_project_lite::__private::AlwaysUnpin, } - impl<'__pin, T, U> ::pin_project_lite::__private::Unpin for Struct where - __Origin<'__pin, T, U>: ::pin_project_lite::__private::Unpin - { - } + impl<'__pin, T, U> ::pin_project_lite::__private::Unpin for Struct + where + __Origin<'__pin, T, U>: ::pin_project_lite::__private::Unpin, + {} trait MustNotImplDrop {} #[allow(clippy::drop_bounds, drop_bounds)] impl MustNotImplDrop for T {} diff --git a/third_party/rust/pin-project-lite/tests/expand/naming/struct-all.rs b/third_party/rust/pin-project-lite/tests/expand/naming/struct-all.rs index cb087530fe74..c4b2e3497737 100644 --- a/third_party/rust/pin-project-lite/tests/expand/naming/struct-all.rs +++ b/third_party/rust/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/third_party/rust/pin-project-lite/tests/expand/naming/struct-mut.expanded.rs b/third_party/rust/pin-project-lite/tests/expand/naming/struct-mut.expanded.rs index aaa41cd0809c..9b6dae89ab12 100644 --- a/third_party/rust/pin-project-lite/tests/expand/naming/struct-mut.expanded.rs +++ b/third_party/rust/pin-project-lite/tests/expand/naming/struct-mut.expanded.rs @@ -3,6 +3,7 @@ struct Struct { pinned: T, unpinned: U, } +#[doc(hidden)] #[allow(dead_code)] #[allow(single_use_lifetimes)] #[allow(clippy::unknown_clippy_lints)] @@ -23,6 +24,7 @@ where #[allow(clippy::redundant_pub_crate)] #[allow(clippy::used_underscore_binding)] const _: () = { + #[doc(hidden)] #[allow(dead_code)] #[allow(single_use_lifetimes)] #[allow(clippy::unknown_clippy_lints)] @@ -38,6 +40,8 @@ const _: () = { unpinned: &'__pin (U), } impl Struct { + #[doc(hidden)] + #[inline] fn project<'__pin>( self: ::pin_project_lite::__private::Pin<&'__pin mut Self>, ) -> StructProj<'__pin, T, U> { @@ -49,6 +53,8 @@ const _: () = { } } } + #[doc(hidden)] + #[inline] fn project_ref<'__pin>( self: ::pin_project_lite::__private::Pin<&'__pin Self>, ) -> ProjectionRef<'__pin, T, U> { @@ -67,10 +73,10 @@ const _: () = { pinned: T, unpinned: ::pin_project_lite::__private::AlwaysUnpin, } - impl<'__pin, T, U> ::pin_project_lite::__private::Unpin for Struct where - __Origin<'__pin, T, U>: ::pin_project_lite::__private::Unpin - { - } + impl<'__pin, T, U> ::pin_project_lite::__private::Unpin for Struct + where + __Origin<'__pin, T, U>: ::pin_project_lite::__private::Unpin, + {} trait MustNotImplDrop {} #[allow(clippy::drop_bounds, drop_bounds)] impl MustNotImplDrop for T {} diff --git a/third_party/rust/pin-project-lite/tests/expand/naming/struct-mut.rs b/third_party/rust/pin-project-lite/tests/expand/naming/struct-mut.rs index 59db44530a69..e28a03a68e03 100644 --- a/third_party/rust/pin-project-lite/tests/expand/naming/struct-mut.rs +++ b/third_party/rust/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/third_party/rust/pin-project-lite/tests/expand/naming/struct-none.expanded.rs b/third_party/rust/pin-project-lite/tests/expand/naming/struct-none.expanded.rs index 8ab318cfb894..a9792e1f692d 100644 --- a/third_party/rust/pin-project-lite/tests/expand/naming/struct-none.expanded.rs +++ b/third_party/rust/pin-project-lite/tests/expand/naming/struct-none.expanded.rs @@ -9,6 +9,7 @@ struct Struct { #[allow(clippy::redundant_pub_crate)] #[allow(clippy::used_underscore_binding)] const _: () = { + #[doc(hidden)] #[allow(dead_code)] #[allow(single_use_lifetimes)] #[allow(clippy::unknown_clippy_lints)] @@ -23,6 +24,7 @@ const _: () = { pinned: ::pin_project_lite::__private::Pin<&'__pin mut (T)>, unpinned: &'__pin mut (U), } + #[doc(hidden)] #[allow(dead_code)] #[allow(single_use_lifetimes)] #[allow(clippy::unknown_clippy_lints)] @@ -38,6 +40,8 @@ const _: () = { unpinned: &'__pin (U), } impl Struct { + #[doc(hidden)] + #[inline] fn project<'__pin>( self: ::pin_project_lite::__private::Pin<&'__pin mut Self>, ) -> Projection<'__pin, T, U> { @@ -49,6 +53,8 @@ const _: () = { } } } + #[doc(hidden)] + #[inline] fn project_ref<'__pin>( self: ::pin_project_lite::__private::Pin<&'__pin Self>, ) -> ProjectionRef<'__pin, T, U> { @@ -67,10 +73,10 @@ const _: () = { pinned: T, unpinned: ::pin_project_lite::__private::AlwaysUnpin, } - impl<'__pin, T, U> ::pin_project_lite::__private::Unpin for Struct where - __Origin<'__pin, T, U>: ::pin_project_lite::__private::Unpin - { - } + impl<'__pin, T, U> ::pin_project_lite::__private::Unpin for Struct + where + __Origin<'__pin, T, U>: ::pin_project_lite::__private::Unpin, + {} trait MustNotImplDrop {} #[allow(clippy::drop_bounds, drop_bounds)] impl MustNotImplDrop for T {} diff --git a/third_party/rust/pin-project-lite/tests/expand/naming/struct-none.rs b/third_party/rust/pin-project-lite/tests/expand/naming/struct-none.rs index e5447c70a64a..e4245d163ad1 100644 --- a/third_party/rust/pin-project-lite/tests/expand/naming/struct-none.rs +++ b/third_party/rust/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/third_party/rust/pin-project-lite/tests/expand/naming/struct-ref.expanded.rs b/third_party/rust/pin-project-lite/tests/expand/naming/struct-ref.expanded.rs index 3d97ab8faef7..9fea20d3560e 100644 --- a/third_party/rust/pin-project-lite/tests/expand/naming/struct-ref.expanded.rs +++ b/third_party/rust/pin-project-lite/tests/expand/naming/struct-ref.expanded.rs @@ -3,6 +3,7 @@ struct Struct { pinned: T, unpinned: U, } +#[doc(hidden)] #[allow(dead_code)] #[allow(single_use_lifetimes)] #[allow(clippy::unknown_clippy_lints)] @@ -23,6 +24,7 @@ where #[allow(clippy::redundant_pub_crate)] #[allow(clippy::used_underscore_binding)] const _: () = { + #[doc(hidden)] #[allow(dead_code)] #[allow(single_use_lifetimes)] #[allow(clippy::unknown_clippy_lints)] @@ -38,6 +40,8 @@ const _: () = { unpinned: &'__pin mut (U), } impl Struct { + #[doc(hidden)] + #[inline] fn project<'__pin>( self: ::pin_project_lite::__private::Pin<&'__pin mut Self>, ) -> Projection<'__pin, T, U> { @@ -49,6 +53,8 @@ const _: () = { } } } + #[doc(hidden)] + #[inline] fn project_ref<'__pin>( self: ::pin_project_lite::__private::Pin<&'__pin Self>, ) -> StructProjRef<'__pin, T, U> { @@ -67,10 +73,10 @@ const _: () = { pinned: T, unpinned: ::pin_project_lite::__private::AlwaysUnpin, } - impl<'__pin, T, U> ::pin_project_lite::__private::Unpin for Struct where - __Origin<'__pin, T, U>: ::pin_project_lite::__private::Unpin - { - } + impl<'__pin, T, U> ::pin_project_lite::__private::Unpin for Struct + where + __Origin<'__pin, T, U>: ::pin_project_lite::__private::Unpin, + {} trait MustNotImplDrop {} #[allow(clippy::drop_bounds, drop_bounds)] impl MustNotImplDrop for T {} diff --git a/third_party/rust/pin-project-lite/tests/expand/naming/struct-ref.rs b/third_party/rust/pin-project-lite/tests/expand/naming/struct-ref.rs index 6821af82745c..ce0d946270d1 100644 --- a/third_party/rust/pin-project-lite/tests/expand/naming/struct-ref.rs +++ b/third_party/rust/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/third_party/rust/pin-project-lite/tests/expand/not_unpin/enum.expanded.rs b/third_party/rust/pin-project-lite/tests/expand/not_unpin/enum.expanded.rs new file mode 100644 index 000000000000..02cdc239cc62 --- /dev/null +++ b/third_party/rust/pin-project-lite/tests/expand/not_unpin/enum.expanded.rs @@ -0,0 +1,99 @@ +use pin_project_lite::pin_project; +enum Enum { + Struct { pinned: T, unpinned: U }, + Unit, +} +#[doc(hidden)] +#[allow(dead_code)] +#[allow(single_use_lifetimes)] +#[allow(clippy::unknown_clippy_lints)] +#[allow(clippy::mut_mut)] +#[allow(clippy::redundant_pub_crate)] +#[allow(clippy::ref_option_ref)] +#[allow(clippy::type_repetition_in_bounds)] +enum EnumProj<'__pin, T, U> +where + Enum: '__pin, +{ + Struct { + pinned: ::pin_project_lite::__private::Pin<&'__pin mut (T)>, + unpinned: &'__pin mut (U), + }, + Unit, +} +#[doc(hidden)] +#[allow(dead_code)] +#[allow(single_use_lifetimes)] +#[allow(clippy::unknown_clippy_lints)] +#[allow(clippy::mut_mut)] +#[allow(clippy::redundant_pub_crate)] +#[allow(clippy::ref_option_ref)] +#[allow(clippy::type_repetition_in_bounds)] +enum EnumProjRef<'__pin, T, U> +where + Enum: '__pin, +{ + Struct { + pinned: ::pin_project_lite::__private::Pin<&'__pin (T)>, + unpinned: &'__pin (U), + }, + Unit, +} +#[allow(single_use_lifetimes)] +#[allow(clippy::unknown_clippy_lints)] +#[allow(clippy::used_underscore_binding)] +const _: () = { + impl Enum { + #[doc(hidden)] + #[inline] + fn project<'__pin>( + self: ::pin_project_lite::__private::Pin<&'__pin mut Self>, + ) -> EnumProj<'__pin, T, U> { + unsafe { + match self.get_unchecked_mut() { + Self::Struct { pinned, unpinned } => { + EnumProj::Struct { + pinned: ::pin_project_lite::__private::Pin::new_unchecked( + pinned, + ), + unpinned: unpinned, + } + } + Self::Unit => EnumProj::Unit, + } + } + } + #[doc(hidden)] + #[inline] + fn project_ref<'__pin>( + self: ::pin_project_lite::__private::Pin<&'__pin Self>, + ) -> EnumProjRef<'__pin, T, U> { + unsafe { + match self.get_ref() { + Self::Struct { pinned, unpinned } => { + EnumProjRef::Struct { + pinned: ::pin_project_lite::__private::Pin::new_unchecked( + pinned, + ), + unpinned: unpinned, + } + } + Self::Unit => EnumProjRef::Unit, + } + } + } + } + #[doc(hidden)] + impl<'__pin, T, U> ::pin_project_lite::__private::Unpin for Enum + where + ( + ::core::marker::PhantomData<&'__pin ()>, + ::core::marker::PhantomPinned, + ): ::pin_project_lite::__private::Unpin, + {} + trait MustNotImplDrop {} + #[allow(clippy::drop_bounds, drop_bounds)] + impl MustNotImplDrop for T {} + impl MustNotImplDrop for Enum {} +}; +fn main() {} diff --git a/third_party/rust/pin-project-lite/tests/expand/not_unpin/enum.rs b/third_party/rust/pin-project-lite/tests/expand/not_unpin/enum.rs new file mode 100644 index 000000000000..1c970b834c9b --- /dev/null +++ b/third_party/rust/pin-project-lite/tests/expand/not_unpin/enum.rs @@ -0,0 +1,19 @@ +// SPDX-License-Identifier: Apache-2.0 OR MIT + +use pin_project_lite::pin_project; + +pin_project! { + #[project(!Unpin)] + #[project = EnumProj] + #[project_ref = EnumProjRef] + enum Enum { + Struct { + #[pin] + pinned: T, + unpinned: U, + }, + Unit, + } +} + +fn main() {} diff --git a/third_party/rust/pin-project-lite/tests/expand/not_unpin/struct.expanded.rs b/third_party/rust/pin-project-lite/tests/expand/not_unpin/struct.expanded.rs new file mode 100644 index 000000000000..2e590b6bfd25 --- /dev/null +++ b/third_party/rust/pin-project-lite/tests/expand/not_unpin/struct.expanded.rs @@ -0,0 +1,88 @@ +use pin_project_lite::pin_project; +struct Struct { + pinned: T, + unpinned: U, +} +#[doc(hidden)] +#[allow(dead_code)] +#[allow(single_use_lifetimes)] +#[allow(clippy::unknown_clippy_lints)] +#[allow(clippy::mut_mut)] +#[allow(clippy::redundant_pub_crate)] +#[allow(clippy::ref_option_ref)] +#[allow(clippy::type_repetition_in_bounds)] +struct StructProj<'__pin, T, U> +where + Struct: '__pin, +{ + pinned: ::pin_project_lite::__private::Pin<&'__pin mut (T)>, + unpinned: &'__pin mut (U), +} +#[doc(hidden)] +#[allow(dead_code)] +#[allow(single_use_lifetimes)] +#[allow(clippy::unknown_clippy_lints)] +#[allow(clippy::mut_mut)] +#[allow(clippy::redundant_pub_crate)] +#[allow(clippy::ref_option_ref)] +#[allow(clippy::type_repetition_in_bounds)] +struct StructProjRef<'__pin, T, U> +where + Struct: '__pin, +{ + pinned: ::pin_project_lite::__private::Pin<&'__pin (T)>, + unpinned: &'__pin (U), +} +#[allow(explicit_outlives_requirements)] +#[allow(single_use_lifetimes)] +#[allow(clippy::unknown_clippy_lints)] +#[allow(clippy::redundant_pub_crate)] +#[allow(clippy::used_underscore_binding)] +const _: () = { + impl Struct { + #[doc(hidden)] + #[inline] + fn project<'__pin>( + self: ::pin_project_lite::__private::Pin<&'__pin mut Self>, + ) -> StructProj<'__pin, T, U> { + unsafe { + let Self { pinned, unpinned } = self.get_unchecked_mut(); + StructProj { + pinned: ::pin_project_lite::__private::Pin::new_unchecked(pinned), + unpinned: unpinned, + } + } + } + #[doc(hidden)] + #[inline] + fn project_ref<'__pin>( + self: ::pin_project_lite::__private::Pin<&'__pin Self>, + ) -> StructProjRef<'__pin, T, U> { + unsafe { + let Self { pinned, unpinned } = self.get_ref(); + StructProjRef { + pinned: ::pin_project_lite::__private::Pin::new_unchecked(pinned), + unpinned: unpinned, + } + } + } + } + #[doc(hidden)] + impl<'__pin, T, U> ::pin_project_lite::__private::Unpin for Struct + where + ( + ::core::marker::PhantomData<&'__pin ()>, + ::core::marker::PhantomPinned, + ): ::pin_project_lite::__private::Unpin, + {} + trait MustNotImplDrop {} + #[allow(clippy::drop_bounds, drop_bounds)] + impl MustNotImplDrop for T {} + impl MustNotImplDrop for Struct {} + #[forbid(unaligned_references, safe_packed_borrows)] + fn __assert_not_repr_packed(this: &Struct) { + let _ = &this.pinned; + let _ = &this.unpinned; + } +}; +fn main() {} diff --git a/third_party/rust/pin-project-lite/tests/expand/not_unpin/struct.rs b/third_party/rust/pin-project-lite/tests/expand/not_unpin/struct.rs new file mode 100644 index 000000000000..f15ef2b6f70e --- /dev/null +++ b/third_party/rust/pin-project-lite/tests/expand/not_unpin/struct.rs @@ -0,0 +1,16 @@ +// SPDX-License-Identifier: Apache-2.0 OR MIT + +use pin_project_lite::pin_project; + +pin_project! { + #[project = StructProj] + #[project(!Unpin)] + #[project_ref = StructProjRef] + struct Struct { + #[pin] + pinned: T, + unpinned: U, + } +} + +fn main() {} diff --git a/third_party/rust/pin-project-lite/tests/expand/pinned_drop/enum.expanded.rs b/third_party/rust/pin-project-lite/tests/expand/pinned_drop/enum.expanded.rs index 665ff633865a..ce513eabd928 100644 --- a/third_party/rust/pin-project-lite/tests/expand/pinned_drop/enum.expanded.rs +++ b/third_party/rust/pin-project-lite/tests/expand/pinned_drop/enum.expanded.rs @@ -1,9 +1,9 @@ use pin_project_lite::pin_project; -use std::pin::Pin; enum Enum { Struct { pinned: T, unpinned: U }, Unit, } +#[doc(hidden)] #[allow(dead_code)] #[allow(single_use_lifetimes)] #[allow(clippy::unknown_clippy_lints)] @@ -21,6 +21,7 @@ where }, Unit, } +#[doc(hidden)] #[allow(dead_code)] #[allow(single_use_lifetimes)] #[allow(clippy::unknown_clippy_lints)] @@ -43,28 +44,40 @@ where #[allow(clippy::used_underscore_binding)] const _: () = { impl Enum { + #[doc(hidden)] + #[inline] fn project<'__pin>( self: ::pin_project_lite::__private::Pin<&'__pin mut Self>, ) -> EnumProj<'__pin, T, U> { unsafe { match self.get_unchecked_mut() { - Self::Struct { pinned, unpinned } => EnumProj::Struct { - pinned: ::pin_project_lite::__private::Pin::new_unchecked(pinned), - unpinned: unpinned, - }, + Self::Struct { pinned, unpinned } => { + EnumProj::Struct { + pinned: ::pin_project_lite::__private::Pin::new_unchecked( + pinned, + ), + unpinned: unpinned, + } + } Self::Unit => EnumProj::Unit, } } } + #[doc(hidden)] + #[inline] fn project_ref<'__pin>( self: ::pin_project_lite::__private::Pin<&'__pin Self>, ) -> EnumProjRef<'__pin, T, U> { unsafe { match self.get_ref() { - Self::Struct { pinned, unpinned } => EnumProjRef::Struct { - pinned: ::pin_project_lite::__private::Pin::new_unchecked(pinned), - unpinned: unpinned, - }, + Self::Struct { pinned, unpinned } => { + EnumProjRef::Struct { + pinned: ::pin_project_lite::__private::Pin::new_unchecked( + pinned, + ), + unpinned: unpinned, + } + } Self::Unit => EnumProjRef::Unit, } } @@ -76,18 +89,21 @@ const _: () = { Struct: (T, ::pin_project_lite::__private::AlwaysUnpin), Unit: (), } - impl<'__pin, T, U> ::pin_project_lite::__private::Unpin for Enum where - __Origin<'__pin, T, U>: ::pin_project_lite::__private::Unpin - { - } + impl<'__pin, T, U> ::pin_project_lite::__private::Unpin for Enum + where + __Origin<'__pin, T, U>: ::pin_project_lite::__private::Unpin, + {} impl ::pin_project_lite::__private::Drop for Enum { fn drop(&mut self) { - fn __drop_inner(this: ::pin_project_lite::__private::Pin<&mut Enum>) { + fn __drop_inner( + this: ::pin_project_lite::__private::Pin<&mut Enum>, + ) { fn __drop_inner() {} let _ = this; } - let pinned_self: ::pin_project_lite::__private::Pin<&mut Self> = - unsafe { ::pin_project_lite::__private::Pin::new_unchecked(self) }; + let pinned_self: ::pin_project_lite::__private::Pin<&mut Self> = unsafe { + ::pin_project_lite::__private::Pin::new_unchecked(self) + }; __drop_inner(pinned_self); } } diff --git a/third_party/rust/pin-project-lite/tests/expand/pinned_drop/enum.rs b/third_party/rust/pin-project-lite/tests/expand/pinned_drop/enum.rs index 1855cb7a1648..1449c9aedae9 100644 --- a/third_party/rust/pin-project-lite/tests/expand/pinned_drop/enum.rs +++ b/third_party/rust/pin-project-lite/tests/expand/pinned_drop/enum.rs @@ -1,5 +1,6 @@ +// SPDX-License-Identifier: Apache-2.0 OR MIT + use pin_project_lite::pin_project; -use std::pin::Pin; pin_project! { #[project = EnumProj] diff --git a/third_party/rust/pin-project-lite/tests/expand/pinned_drop/struct.expanded.rs b/third_party/rust/pin-project-lite/tests/expand/pinned_drop/struct.expanded.rs index 5b82b7a19c2b..47f19123dd4b 100644 --- a/third_party/rust/pin-project-lite/tests/expand/pinned_drop/struct.expanded.rs +++ b/third_party/rust/pin-project-lite/tests/expand/pinned_drop/struct.expanded.rs @@ -1,5 +1,4 @@ use pin_project_lite::pin_project; -use std::pin::Pin; struct Struct { pinned: T, unpinned: U, @@ -10,6 +9,7 @@ struct Struct { #[allow(clippy::redundant_pub_crate)] #[allow(clippy::used_underscore_binding)] const _: () = { + #[doc(hidden)] #[allow(dead_code)] #[allow(single_use_lifetimes)] #[allow(clippy::unknown_clippy_lints)] @@ -24,6 +24,7 @@ const _: () = { pinned: ::pin_project_lite::__private::Pin<&'__pin mut (T)>, unpinned: &'__pin mut (U), } + #[doc(hidden)] #[allow(dead_code)] #[allow(single_use_lifetimes)] #[allow(clippy::unknown_clippy_lints)] @@ -39,6 +40,8 @@ const _: () = { unpinned: &'__pin (U), } impl Struct { + #[doc(hidden)] + #[inline] fn project<'__pin>( self: ::pin_project_lite::__private::Pin<&'__pin mut Self>, ) -> Projection<'__pin, T, U> { @@ -50,6 +53,8 @@ const _: () = { } } } + #[doc(hidden)] + #[inline] fn project_ref<'__pin>( self: ::pin_project_lite::__private::Pin<&'__pin Self>, ) -> ProjectionRef<'__pin, T, U> { @@ -68,18 +73,21 @@ const _: () = { pinned: T, unpinned: ::pin_project_lite::__private::AlwaysUnpin, } - impl<'__pin, T, U> ::pin_project_lite::__private::Unpin for Struct where - __Origin<'__pin, T, U>: ::pin_project_lite::__private::Unpin - { - } + impl<'__pin, T, U> ::pin_project_lite::__private::Unpin for Struct + where + __Origin<'__pin, T, U>: ::pin_project_lite::__private::Unpin, + {} impl ::pin_project_lite::__private::Drop for Struct { fn drop(&mut self) { - fn __drop_inner(this: ::pin_project_lite::__private::Pin<&mut Struct>) { + fn __drop_inner( + this: ::pin_project_lite::__private::Pin<&mut Struct>, + ) { fn __drop_inner() {} let _ = this; } - let pinned_self: ::pin_project_lite::__private::Pin<&mut Self> = - unsafe { ::pin_project_lite::__private::Pin::new_unchecked(self) }; + let pinned_self: ::pin_project_lite::__private::Pin<&mut Self> = unsafe { + ::pin_project_lite::__private::Pin::new_unchecked(self) + }; __drop_inner(pinned_self); } } diff --git a/third_party/rust/pin-project-lite/tests/expand/pinned_drop/struct.rs b/third_party/rust/pin-project-lite/tests/expand/pinned_drop/struct.rs index 0cc7567690f8..0a61c20f1289 100644 --- a/third_party/rust/pin-project-lite/tests/expand/pinned_drop/struct.rs +++ b/third_party/rust/pin-project-lite/tests/expand/pinned_drop/struct.rs @@ -1,5 +1,6 @@ +// SPDX-License-Identifier: Apache-2.0 OR MIT + use pin_project_lite::pin_project; -use std::pin::Pin; pin_project! { struct Struct { diff --git a/third_party/rust/pin-project-lite/tests/expand/pub/enum.expanded.rs b/third_party/rust/pin-project-lite/tests/expand/pub/enum.expanded.rs index 6f190cba08be..85c7770df042 100644 --- a/third_party/rust/pin-project-lite/tests/expand/pub/enum.expanded.rs +++ b/third_party/rust/pin-project-lite/tests/expand/pub/enum.expanded.rs @@ -3,6 +3,7 @@ pub enum Enum { Struct { pinned: T, unpinned: U }, Unit, } +#[doc(hidden)] #[allow(dead_code)] #[allow(single_use_lifetimes)] #[allow(clippy::unknown_clippy_lints)] @@ -20,6 +21,7 @@ where }, Unit, } +#[doc(hidden)] #[allow(dead_code)] #[allow(single_use_lifetimes)] #[allow(clippy::unknown_clippy_lints)] @@ -42,28 +44,40 @@ where #[allow(clippy::used_underscore_binding)] const _: () = { impl Enum { + #[doc(hidden)] + #[inline] pub(crate) fn project<'__pin>( self: ::pin_project_lite::__private::Pin<&'__pin mut Self>, ) -> EnumProj<'__pin, T, U> { unsafe { match self.get_unchecked_mut() { - Self::Struct { pinned, unpinned } => EnumProj::Struct { - pinned: ::pin_project_lite::__private::Pin::new_unchecked(pinned), - unpinned: unpinned, - }, + Self::Struct { pinned, unpinned } => { + EnumProj::Struct { + pinned: ::pin_project_lite::__private::Pin::new_unchecked( + pinned, + ), + unpinned: unpinned, + } + } Self::Unit => EnumProj::Unit, } } } + #[doc(hidden)] + #[inline] pub(crate) fn project_ref<'__pin>( self: ::pin_project_lite::__private::Pin<&'__pin Self>, ) -> EnumProjRef<'__pin, T, U> { unsafe { match self.get_ref() { - Self::Struct { pinned, unpinned } => EnumProjRef::Struct { - pinned: ::pin_project_lite::__private::Pin::new_unchecked(pinned), - unpinned: unpinned, - }, + Self::Struct { pinned, unpinned } => { + EnumProjRef::Struct { + pinned: ::pin_project_lite::__private::Pin::new_unchecked( + pinned, + ), + unpinned: unpinned, + } + } Self::Unit => EnumProjRef::Unit, } } @@ -75,10 +89,10 @@ const _: () = { Struct: (T, ::pin_project_lite::__private::AlwaysUnpin), Unit: (), } - impl<'__pin, T, U> ::pin_project_lite::__private::Unpin for Enum where - __Origin<'__pin, T, U>: ::pin_project_lite::__private::Unpin - { - } + impl<'__pin, T, U> ::pin_project_lite::__private::Unpin for Enum + where + __Origin<'__pin, T, U>: ::pin_project_lite::__private::Unpin, + {} trait MustNotImplDrop {} #[allow(clippy::drop_bounds, drop_bounds)] impl MustNotImplDrop for T {} diff --git a/third_party/rust/pin-project-lite/tests/expand/pub/enum.rs b/third_party/rust/pin-project-lite/tests/expand/pub/enum.rs index d3968afdf255..789f019144ca 100644 --- a/third_party/rust/pin-project-lite/tests/expand/pub/enum.rs +++ b/third_party/rust/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/third_party/rust/pin-project-lite/tests/expand/pub/struct.expanded.rs b/third_party/rust/pin-project-lite/tests/expand/pub/struct.expanded.rs index 7b5826d14986..a06783dc55c3 100644 --- a/third_party/rust/pin-project-lite/tests/expand/pub/struct.expanded.rs +++ b/third_party/rust/pin-project-lite/tests/expand/pub/struct.expanded.rs @@ -9,6 +9,7 @@ pub struct Struct { #[allow(clippy::redundant_pub_crate)] #[allow(clippy::used_underscore_binding)] const _: () = { + #[doc(hidden)] #[allow(dead_code)] #[allow(single_use_lifetimes)] #[allow(clippy::unknown_clippy_lints)] @@ -23,6 +24,7 @@ const _: () = { pub pinned: ::pin_project_lite::__private::Pin<&'__pin mut (T)>, pub unpinned: &'__pin mut (U), } + #[doc(hidden)] #[allow(dead_code)] #[allow(single_use_lifetimes)] #[allow(clippy::unknown_clippy_lints)] @@ -38,6 +40,8 @@ const _: () = { pub unpinned: &'__pin (U), } impl Struct { + #[doc(hidden)] + #[inline] pub(crate) fn project<'__pin>( self: ::pin_project_lite::__private::Pin<&'__pin mut Self>, ) -> Projection<'__pin, T, U> { @@ -49,6 +53,8 @@ const _: () = { } } } + #[doc(hidden)] + #[inline] pub(crate) fn project_ref<'__pin>( self: ::pin_project_lite::__private::Pin<&'__pin Self>, ) -> ProjectionRef<'__pin, T, U> { @@ -67,10 +73,10 @@ const _: () = { pinned: T, unpinned: ::pin_project_lite::__private::AlwaysUnpin, } - impl<'__pin, T, U> ::pin_project_lite::__private::Unpin for Struct where - __Origin<'__pin, T, U>: ::pin_project_lite::__private::Unpin - { - } + impl<'__pin, T, U> ::pin_project_lite::__private::Unpin for Struct + where + __Origin<'__pin, T, U>: ::pin_project_lite::__private::Unpin, + {} trait MustNotImplDrop {} #[allow(clippy::drop_bounds, drop_bounds)] impl MustNotImplDrop for T {} diff --git a/third_party/rust/pin-project-lite/tests/expand/pub/struct.rs b/third_party/rust/pin-project-lite/tests/expand/pub/struct.rs index 665909690950..a87d4b8450d4 100644 --- a/third_party/rust/pin-project-lite/tests/expand/pub/struct.rs +++ b/third_party/rust/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/third_party/rust/pin-project-lite/tests/expandtest.rs b/third_party/rust/pin-project-lite/tests/expandtest.rs index 3f0d5c11214a..3c23d8b6569f 100644 --- a/third_party/rust/pin-project-lite/tests/expandtest.rs +++ b/third_party/rust/pin-project-lite/tests/expandtest.rs @@ -1,43 +1,11 @@ +// SPDX-License-Identifier: Apache-2.0 OR MIT + #![cfg(not(miri))] -#![warn(rust_2018_idioms, single_use_lifetimes)] - -use std::{ - env, - process::{Command, ExitStatus, Stdio}, -}; - -const PATH: &str = "tests/expand/**/*.rs"; +#![cfg(not(careful))] #[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"]) || !has_command(&[cargo, "fmt"]) { - if is_ci { - panic!("expandtest requires rustfmt and 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/third_party/rust/pin-project-lite/tests/include/basic.rs b/third_party/rust/pin-project-lite/tests/include/basic.rs index 25121f210b3c..bfd7d8fbf6be 100644 --- a/third_party/rust/pin-project-lite/tests/include/basic.rs +++ b/third_party/rust/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 { #[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 { + /// Struct variant. Struct { #[pin] pinned: T, unpinned: U, }, + /// Unit variant. Unit, } } diff --git a/third_party/rust/pin-project-lite/tests/lint.rs b/third_party/rust/pin-project-lite/tests/lint.rs deleted file mode 100644 index 852f940bcfde..000000000000 --- a/third_party/rust/pin-project-lite/tests/lint.rs +++ /dev/null @@ -1,263 +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: 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, - 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, - single_use_lifetimes, - trivial_casts, - trivial_numeric_casts, - unreachable_pub, - unused_import_braces, - unused_lifetimes, - unused_qualifications, - unused_results, - 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_structs, clippy::exhaustive_enums, 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, - pub u: Box, - } - } - - pin_project! { - #[project = EnumProj] - #[project_ref = EnumProjRef] - #[derive(Debug)] - pub enum Enum { - Struct { - #[pin] - p: Box, - u: Box, - }, - 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] - #[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] - #[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] - #[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 { - #[pin] - pub pinned: T, - pub unpinned: U, - } - } - - pin_project! { - #[project = EnumProj] - #[project_ref = EnumProjRef] - #[derive(Debug)] - pub enum Enum { - 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 - where - Struct: Sized, - { - #[pin] - pub pinned: T, - pub unpinned: U, - } - } - - pin_project! { - #[project = EnumProj] - #[project_ref = EnumProjRef] - #[derive(Debug)] - pub enum Enum - where - Enum: Sized, - { - Struct { - #[pin] - pinned: T, - unpinned: U, - }, - Unit, - } - } -} - -pub mod clippy_used_underscore_binding { - use pin_project_lite::pin_project; - - pin_project! { - #[derive(Debug)] - pub struct Struct { - #[pin] - pub _pinned: T, - pub _unpinned: U, - } - } - - pin_project! { - #[project = EnumProj] - #[project_ref = EnumProjRef] - #[derive(Debug)] - pub enum Enum { - 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] - pub enum Enum<'a> { - Struct { - #[pin] - _pinned: Option<&'a ()>, - _unpinned: Option<&'a ()>, - }, - } - } -} diff --git a/third_party/rust/pin-project-lite/tests/proper_unpin.rs b/third_party/rust/pin-project-lite/tests/proper_unpin.rs index 668e975ba991..6dcf4bd099f6 100644 --- a/third_party/rust/pin-project-lite/tests/proper_unpin.rs +++ b/third_party/rust/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] @@ -46,6 +47,18 @@ pub mod default { assert_not_unpin!(Enum); assert_not_unpin!(Enum); + pin_project! { + #[project(!Unpin)] + enum NotUnpinEnum { + V1 { + #[pin] f1: Inner, + f2: U, + } + } + } + + assert_not_unpin!(NotUnpinEnum<(), ()>); + pin_project! { struct TrivialBounds { #[pin] @@ -64,4 +77,25 @@ pub mod default { } assert_unpin!(PinRef<'_, PhantomPinned, PhantomPinned>); + + pin_project! { + #[project(!Unpin)] + struct NotUnpin { + #[pin] + u: U + } + } + + assert_not_unpin!(NotUnpin<()>); + + pin_project! { + #[project(!Unpin)] + struct NotUnpinRef<'a, T, U> { + #[pin] + f1: &'a mut Inner, + f2: U + } + } + + assert_not_unpin!(NotUnpinRef<'_, (), ()>); } diff --git a/third_party/rust/pin-project-lite/tests/test.rs b/third_party/rust/pin-project-lite/tests/test.rs index ed9b75c42c22..915acda5caa4 100644 --- a/third_party/rust/pin-project-lite/tests/test.rs +++ b/third_party/rust/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; @@ -616,6 +617,7 @@ fn attrs() { pin_project! { /// dox1 #[derive(Clone)] + #[project(!Unpin)] #[project = Enum2Proj] #[project_ref = Enum2ProjRef] /// dox2 @@ -682,11 +684,13 @@ fn pinned_drop() { req: Request, } + /// dox1 impl PinnedDrop for Struct3<'_, T, Request> where T: Service, T::Error: std::error::Error, { + /// dox2 fn drop(mut this: Pin<&mut Self>) { **this.as_mut().project().was_dropped = true; } diff --git a/third_party/rust/pin-project-lite/tests/ui/pin_project/conflict-drop.rs b/third_party/rust/pin-project-lite/tests/ui/pin_project/conflict-drop.rs index 870059d62f98..724d7d66de71 100644 --- a/third_party/rust/pin-project-lite/tests/ui/pin_project/conflict-drop.rs +++ b/third_party/rust/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/third_party/rust/pin-project-lite/tests/ui/pin_project/conflict-drop.stderr b/third_party/rust/pin-project-lite/tests/ui/pin_project/conflict-drop.stderr index 66872bd4bd20..13d89c0afbd9 100644 --- a/third_party/rust/pin-project-lite/tests/ui/pin_project/conflict-drop.stderr +++ b/third_party/rust/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 { -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` (in Nightly builds, run with -Z macro-backtrace for more info) +error[E0119]: conflicting implementations of trait `MustNotImplDrop` for type `Foo<_, _>` + --> tests/ui/pin_project/conflict-drop.rs:5:1 + | +5 | / pin_project! { //~ ERROR E0119 +6 | | struct Foo { +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/third_party/rust/pin-project-lite/tests/ui/pin_project/conflict-unpin.rs b/third_party/rust/pin-project-lite/tests/ui/pin_project/conflict-unpin.rs index f702f064deb6..b3564b0ba580 100644 --- a/third_party/rust/pin-project-lite/tests/ui/pin_project/conflict-unpin.rs +++ b/third_party/rust/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. @@ -37,4 +39,28 @@ pin_project! { //~ ERROR E0119 // conflicting implementations impl Unpin for Baz {} // Conditional Unpin impl +pin_project! { //~ ERROR E0119 + #[project(!Unpin)] + struct Qux { + #[pin] + future: T, + field: U, + } +} + +// conflicting implementations +impl Unpin for Qux {} // Non-conditional Unpin impl + +pin_project! { //~ ERROR E0119 + #[project(!Unpin)] + struct Fred { + #[pin] + future: T, + field: U, + } +} + +// conflicting implementations +impl Unpin for Fred {} // Conditional Unpin impl + fn main() {} diff --git a/third_party/rust/pin-project-lite/tests/ui/pin_project/conflict-unpin.stderr b/third_party/rust/pin-project-lite/tests/ui/pin_project/conflict-unpin.stderr index bd30fafdd3b6..ce62b8b06630 100644 --- a/third_party/rust/pin-project-lite/tests/ui/pin_project/conflict-unpin.stderr +++ b/third_party/rust/pin-project-lite/tests/ui/pin_project/conflict-unpin.stderr @@ -1,50 +1,84 @@ -error[E0119]: conflicting implementations of trait `std::marker::Unpin` for type `Foo<_, _>` - --> tests/ui/pin_project/conflict-unpin.rs:5:1 +error[E0119]: conflicting implementations of trait `Unpin` for type `Foo<_, _>` + --> tests/ui/pin_project/conflict-unpin.rs:7:1 | -5 | / pin_project! { //~ ERROR E0119 -6 | | struct Foo { -7 | | #[pin] -8 | | future: T, -9 | | field: U, -10 | | } -11 | | } +7 | / pin_project! { //~ ERROR E0119 +8 | | struct Foo { +9 | | #[pin] +10 | | future: T, +11 | | field: U, +12 | | } +13 | | } | |_^ conflicting implementation for `Foo<_, _>` ... -14 | impl Unpin for Foo where T: Unpin {} // Conditional Unpin impl +16 | impl Unpin for Foo where T: Unpin {} // Conditional Unpin impl | --------------------------------------------- first implementation here | - = note: this error originates in the macro `$crate::__pin_project_make_unpin_impl` (in Nightly builds, run with -Z macro-backtrace for more info) + = 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 `std::marker::Unpin` for type `Bar<_, _>` - --> tests/ui/pin_project/conflict-unpin.rs:18:1 +error[E0119]: conflicting implementations of trait `Unpin` for type `Bar<_, _>` + --> tests/ui/pin_project/conflict-unpin.rs:20:1 | -18 | / pin_project! { //~ ERROR E0119 -19 | | struct Bar { -20 | | #[pin] -21 | | future: T, -22 | | field: U, -23 | | } -24 | | } +20 | / pin_project! { //~ ERROR E0119 +21 | | struct Bar { +22 | | #[pin] +23 | | future: T, +24 | | field: U, +25 | | } +26 | | } | |_^ conflicting implementation for `Bar<_, _>` ... -27 | impl Unpin for Bar {} // Non-conditional Unpin impl +29 | impl Unpin for Bar {} // Non-conditional Unpin impl | ------------------------------ first implementation here | - = note: this error originates in the macro `$crate::__pin_project_make_unpin_impl` (in Nightly builds, run with -Z macro-backtrace for more info) + = 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 `std::marker::Unpin` for type `Baz<_, _>` - --> tests/ui/pin_project/conflict-unpin.rs:29:1 +error[E0119]: conflicting implementations of trait `Unpin` for type `Baz<_, _>` + --> tests/ui/pin_project/conflict-unpin.rs:31:1 | -29 | / pin_project! { //~ ERROR E0119 -30 | | struct Baz { -31 | | #[pin] -32 | | future: T, -33 | | field: U, -34 | | } -35 | | } +31 | / pin_project! { //~ ERROR E0119 +32 | | struct Baz { +33 | | #[pin] +34 | | future: T, +35 | | field: U, +36 | | } +37 | | } | |_^ conflicting implementation for `Baz<_, _>` ... -38 | impl Unpin for Baz {} // Conditional Unpin impl +40 | impl Unpin for Baz {} // Conditional Unpin impl | -------------------------------------------- first implementation here | - = note: this error originates in the macro `$crate::__pin_project_make_unpin_impl` (in Nightly builds, run with -Z macro-backtrace for more info) + = 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:42:1 + | +42 | / pin_project! { //~ ERROR E0119 +43 | | #[project(!Unpin)] +44 | | struct Qux { +45 | | #[pin] +... | +48 | | } +49 | | } + | |_^ conflicting implementation for `Qux<_, _>` +... +52 | impl Unpin for Qux {} // 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 `Fred<_, _>` + --> tests/ui/pin_project/conflict-unpin.rs:54:1 + | +54 | / pin_project! { //~ ERROR E0119 +55 | | #[project(!Unpin)] +56 | | struct Fred { +57 | | #[pin] +... | +60 | | } +61 | | } + | |_^ conflicting implementation for `Fred<_, _>` +... +64 | impl Unpin for Fred {} // 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) diff --git a/third_party/rust/pin-project-lite/tests/ui/pin_project/invalid-bounds.rs b/third_party/rust/pin-project-lite/tests/ui/pin_project/invalid-bounds.rs index 64b397a37ed1..7b0e8c463e6d 100644 --- a/third_party/rust/pin-project-lite/tests/ui/pin_project/invalid-bounds.rs +++ b/third_party/rust/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/third_party/rust/pin-project-lite/tests/ui/pin_project/invalid-bounds.stderr b/third_party/rust/pin-project-lite/tests/ui/pin_project/invalid-bounds.stderr index 40e79bf92839..084ff477b267 100644 --- a/third_party/rust/pin-project-lite/tests/ui/pin_project/invalid-bounds.stderr +++ b/third_party/rust/pin-project-lite/tests/ui/pin_project/invalid-bounds.stderr @@ -1,428 +1,530 @@ 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 { //~ ERROR no rules expected the token `:` +6 | struct Generics1 { //~ ERROR no rules expected the token `:` | ^ no rules expected this token in macro call + | +note: while trying to match `>` + --> src/lib.rs + | + | >)? + | ^ 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 { //~ ERROR no rules expected the token `:` +12 | struct Generics2 { //~ ERROR no rules expected the token `:` | ^ no rules expected this token in macro call + | +note: while trying to match `>` + --> src/lib.rs + | + | >)? + | ^ 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 { //~ ERROR expected one of `+`, `,`, `=`, or `>`, found `:` -17 | | field: T, -18 | | } -19 | | } +17 | / pin_project! { +18 | | struct Generics3 { //~ ERROR expected one of `+`, `,`, `=`, or `>`, found `:` +19 | | field: T, +20 | | } +21 | | } | | ^ | | | | | expected one of `+`, `,`, `=`, or `>` | |_unexpected token | in this macro invocation | - = note: this error originates in the macro `$crate::__pin_project_parse_generics` (in Nightly builds, run with -Z macro-backtrace for more info) + = 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 { //~ ERROR expected one of `+`, `,`, `=`, or `>`, found `:` -17 | | field: T, -18 | | } -19 | | } +17 | / pin_project! { +18 | | struct Generics3 { //~ ERROR expected one of `+`, `,`, `=`, or `>`, found `:` +19 | | field: T, +20 | | } +21 | | } | | ^ | | | | |_expected one of `+`, `,`, `=`, or `>` | unexpected token | - = note: this error originates in the macro `$crate::__pin_project_parse_generics` (in Nightly builds, run with -Z macro-backtrace for more info) + = note: type ascription syntax has been removed, see issue #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 { //~ ERROR expected one of `+`, `,`, `=`, or `>`, found `:` -17 | | field: T, -18 | | } -19 | | } +17 | / pin_project! { +18 | | struct Generics3 { //~ ERROR expected one of `+`, `,`, `=`, or `>`, found `:` +19 | | field: T, +20 | | } +21 | | } | | ^ | | | | | expected one of `+`, `,`, `=`, or `>` | |_unexpected token | in this macro invocation | - = note: this error originates in the macro `$crate::__pin_project_parse_generics` (in Nightly builds, run with -Z macro-backtrace for more info) + = 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 { //~ ERROR expected one of `+`, `,`, `=`, or `>`, found `:` -17 | | field: T, -18 | | } -19 | | } +17 | / pin_project! { +18 | | struct Generics3 { //~ ERROR expected one of `+`, `,`, `=`, or `>`, found `:` +19 | | field: T, +20 | | } +21 | | } | | ^ | | | | | expected one of `+`, `,`, `=`, or `>` | |_unexpected token | in this macro invocation | - = note: this error originates in the macro `$crate::__pin_project_parse_generics` (in Nightly builds, run with -Z macro-backtrace for more info) + = 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 { //~ ERROR expected one of `+`, `,`, `=`, or `>`, found `:` -23 | | field: T, -24 | | } -25 | | } +23 | / pin_project! { +24 | | struct Generics4 { //~ ERROR expected one of `+`, `,`, `=`, or `>`, found `:` +25 | | field: T, +26 | | } +27 | | } | | ^ | | | | | expected one of `+`, `,`, `=`, or `>` | |_unexpected token | in this macro invocation | - = note: this error originates in the macro `$crate::__pin_project_parse_generics` (in Nightly builds, run with -Z macro-backtrace for more info) + = 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 { //~ ERROR expected one of `+`, `,`, `=`, or `>`, found `:` -23 | | field: T, -24 | | } -25 | | } +23 | / pin_project! { +24 | | struct Generics4 { //~ ERROR expected one of `+`, `,`, `=`, or `>`, found `:` +25 | | field: T, +26 | | } +27 | | } | | ^ | | | | |_expected one of `+`, `,`, `=`, or `>` | unexpected token | - = note: this error originates in the macro `$crate::__pin_project_parse_generics` (in Nightly builds, run with -Z macro-backtrace for more info) + = note: type ascription syntax has been removed, see issue #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 { //~ ERROR expected one of `+`, `,`, `=`, or `>`, found `:` -23 | | field: T, -24 | | } -25 | | } +23 | / pin_project! { +24 | | struct Generics4 { //~ ERROR expected one of `+`, `,`, `=`, or `>`, found `:` +25 | | field: T, +26 | | } +27 | | } | | ^ | | | | | expected one of `+`, `,`, `=`, or `>` | |_unexpected token | in this macro invocation | - = note: this error originates in the macro `$crate::__pin_project_parse_generics` (in Nightly builds, run with -Z macro-backtrace for more info) + = 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 { //~ ERROR expected one of `+`, `,`, `=`, or `>`, found `:` -23 | | field: T, -24 | | } -25 | | } +23 | / pin_project! { +24 | | struct Generics4 { //~ ERROR expected one of `+`, `,`, `=`, or `>`, found `:` +25 | | field: T, +26 | | } +27 | | } | | ^ | | | | | expected one of `+`, `,`, `=`, or `>` | |_unexpected token | in this macro invocation | - = note: this error originates in the macro `$crate::__pin_project_parse_generics` (in Nightly builds, run with -Z macro-backtrace for more info) + = 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 { //~ ERROR expected one of `+`, `,`, `=`, or `>`, found `:` -29 | | field: T, -30 | | } -31 | | } +29 | / pin_project! { +30 | | struct Generics5 { //~ ERROR expected one of `+`, `,`, `=`, or `>`, found `:` +31 | | field: T, +32 | | } +33 | | } | | ^ | | | | | expected one of `+`, `,`, `=`, or `>` | |_unexpected token | in this macro invocation | - = note: this error originates in the macro `$crate::__pin_project_parse_generics` (in Nightly builds, run with -Z macro-backtrace for more info) + = 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 { //~ ERROR expected one of `+`, `,`, `=`, or `>`, found `:` -29 | | field: T, -30 | | } -31 | | } +29 | / pin_project! { +30 | | struct Generics5 { //~ ERROR expected one of `+`, `,`, `=`, or `>`, found `:` +31 | | field: T, +32 | | } +33 | | } | | ^ | | | | |_expected one of `+`, `,`, `=`, or `>` | unexpected token | - = note: this error originates in the macro `$crate::__pin_project_parse_generics` (in Nightly builds, run with -Z macro-backtrace for more info) + = note: type ascription syntax has been removed, see issue #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 { //~ ERROR expected one of `+`, `,`, `=`, or `>`, found `:` -29 | | field: T, -30 | | } -31 | | } +29 | / pin_project! { +30 | | struct Generics5 { //~ ERROR expected one of `+`, `,`, `=`, or `>`, found `:` +31 | | field: T, +32 | | } +33 | | } | | ^ | | | | | expected one of `+`, `,`, `=`, or `>` | |_unexpected token | in this macro invocation | - = note: this error originates in the macro `$crate::__pin_project_parse_generics` (in Nightly builds, run with -Z macro-backtrace for more info) + = 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 { //~ ERROR expected one of `+`, `,`, `=`, or `>`, found `:` -29 | | field: T, -30 | | } -31 | | } +29 | / pin_project! { +30 | | struct Generics5 { //~ ERROR expected one of `+`, `,`, `=`, or `>`, found `:` +31 | | field: T, +32 | | } +33 | | } | | ^ | | | | | expected one of `+`, `,`, `=`, or `>` | |_unexpected token | in this macro invocation | - = note: this error originates in the macro `$crate::__pin_project_parse_generics` (in Nightly builds, run with -Z macro-backtrace for more info) + = 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 { //~ ERROR no rules expected the token `Sized` +36 | struct Generics6 { //~ 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` + --> src/lib.rs + | + | $(: $generics_lifetime_bound:lifetime)? + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 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 `{` + --> src/lib.rs + | + | { + | ^ 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 `{` + --> src/lib.rs + | + | { + | ^ 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 -59 | | where -60 | | T: Sized : 'static //~ ERROR expected `where`, or `{` after struct name, found `:` +59 | / pin_project! { +60 | | struct WhereClause3 +61 | | where +62 | | T: Sized : 'static //~ ERROR expected `where`, or `{` after struct name, found `:` ... | -63 | | } -64 | | } +65 | | } +66 | | } | | ^ | | | | |_expected `{` after struct name | in this macro invocation | - = note: this error originates in the macro `$crate::__pin_project_parse_generics` (in Nightly builds, run with -Z macro-backtrace for more info) + = 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 -59 | | where -60 | | T: Sized : 'static //~ ERROR expected `where`, or `{` after struct name, found `:` +59 | / pin_project! { +60 | | struct WhereClause3 +61 | | where +62 | | T: Sized : 'static //~ ERROR expected `where`, or `{` after struct name, found `:` ... | -63 | | } -64 | | } +65 | | } +66 | | } | | ^ | | | | |_expected one of `+`, `,`, or `{` | unexpected token | - = note: this error originates in the macro `$crate::__pin_project_parse_generics` (in Nightly builds, run with -Z macro-backtrace for more info) + = note: type ascription syntax has been removed, see issue #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) 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 -59 | | where -60 | | T: Sized : 'static //~ ERROR expected `where`, or `{` after struct name, found `:` +59 | / pin_project! { +60 | | struct WhereClause3 +61 | | where +62 | | T: Sized : 'static //~ ERROR expected `where`, or `{` after struct name, found `:` ... | -63 | | } -64 | | } +65 | | } +66 | | } | | ^ | | | | |_expected `{` after struct name | in this macro invocation | - = note: this error originates in the macro `$crate::__pin_project_parse_generics` (in Nightly builds, run with -Z macro-backtrace for more info) + = 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 -59 | | where -60 | | T: Sized : 'static //~ ERROR expected `where`, or `{` after struct name, found `:` +59 | / pin_project! { +60 | | struct WhereClause3 +61 | | where +62 | | T: Sized : 'static //~ ERROR expected `where`, or `{` after struct name, found `:` ... | -63 | | } -64 | | } +65 | | } +66 | | } | | ^ | | | | |_expected `{` after struct name | in this macro invocation | - = note: this error originates in the macro `$crate::__pin_project_parse_generics` (in Nightly builds, run with -Z macro-backtrace for more info) + = 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 -68 | | where -69 | | T: ?Sized : 'static //~ ERROR expected `where`, or `{` after struct name, found `:` +68 | / pin_project! { +69 | | struct WhereClause4 +70 | | where +71 | | T: ?Sized : 'static //~ ERROR expected `where`, or `{` after struct name, found `:` ... | -72 | | } -73 | | } +74 | | } +75 | | } | | ^ | | | | |_expected `{` after struct name | in this macro invocation | - = note: this error originates in the macro `$crate::__pin_project_parse_generics` (in Nightly builds, run with -Z macro-backtrace for more info) + = 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 -68 | | where -69 | | T: ?Sized : 'static //~ ERROR expected `where`, or `{` after struct name, found `:` +68 | / pin_project! { +69 | | struct WhereClause4 +70 | | where +71 | | T: ?Sized : 'static //~ ERROR expected `where`, or `{` after struct name, found `:` ... | -72 | | } -73 | | } +74 | | } +75 | | } | | ^ | | | | |_expected one of `+`, `,`, or `{` | unexpected token | - = note: this error originates in the macro `$crate::__pin_project_parse_generics` (in Nightly builds, run with -Z macro-backtrace for more info) + = note: type ascription syntax has been removed, see issue #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) 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 -68 | | where -69 | | T: ?Sized : 'static //~ ERROR expected `where`, or `{` after struct name, found `:` +68 | / pin_project! { +69 | | struct WhereClause4 +70 | | where +71 | | T: ?Sized : 'static //~ ERROR expected `where`, or `{` after struct name, found `:` ... | -72 | | } -73 | | } +74 | | } +75 | | } | | ^ | | | | |_expected `{` after struct name | in this macro invocation | - = note: this error originates in the macro `$crate::__pin_project_parse_generics` (in Nightly builds, run with -Z macro-backtrace for more info) + = 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 -68 | | where -69 | | T: ?Sized : 'static //~ ERROR expected `where`, or `{` after struct name, found `:` +68 | / pin_project! { +69 | | struct WhereClause4 +70 | | where +71 | | T: ?Sized : 'static //~ ERROR expected `where`, or `{` after struct name, found `:` ... | -72 | | } -73 | | } +74 | | } +75 | | } | | ^ | | | | |_expected `{` after struct name | in this macro invocation | - = note: this error originates in the macro `$crate::__pin_project_parse_generics` (in Nightly builds, run with -Z macro-backtrace for more info) + = 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 -77 | | where -78 | | T: Sized : ?Sized //~ ERROR expected `where`, or `{` after struct name, found `:` +77 | / pin_project! { +78 | | struct WhereClause5 +79 | | where +80 | | T: Sized : ?Sized //~ ERROR expected `where`, or `{` after struct name, found `:` ... | -81 | | } -82 | | } +83 | | } +84 | | } | | ^ | | | | |_expected `{` after struct name | in this macro invocation | - = note: this error originates in the macro `$crate::__pin_project_parse_generics` (in Nightly builds, run with -Z macro-backtrace for more info) + = 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 -77 | | where -78 | | T: Sized : ?Sized //~ ERROR expected `where`, or `{` after struct name, found `:` +77 | / pin_project! { +78 | | struct WhereClause5 +79 | | where +80 | | T: Sized : ?Sized //~ ERROR expected `where`, or `{` after struct name, found `:` ... | -81 | | } -82 | | } +83 | | } +84 | | } | | ^ | | | | |_expected one of `+`, `,`, or `{` | unexpected token | - = note: this error originates in the macro `$crate::__pin_project_parse_generics` (in Nightly builds, run with -Z macro-backtrace for more info) + = note: type ascription syntax has been removed, see issue #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) 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 -77 | | where -78 | | T: Sized : ?Sized //~ ERROR expected `where`, or `{` after struct name, found `:` +77 | / pin_project! { +78 | | struct WhereClause5 +79 | | where +80 | | T: Sized : ?Sized //~ ERROR expected `where`, or `{` after struct name, found `:` ... | -81 | | } -82 | | } +83 | | } +84 | | } | | ^ | | | | |_expected `{` after struct name | in this macro invocation | - = note: this error originates in the macro `$crate::__pin_project_parse_generics` (in Nightly builds, run with -Z macro-backtrace for more info) + = 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 -77 | | where -78 | | T: Sized : ?Sized //~ ERROR expected `where`, or `{` after struct name, found `:` +77 | / pin_project! { +78 | | struct WhereClause5 +79 | | where +80 | | T: Sized : ?Sized //~ ERROR expected `where`, or `{` after struct name, found `:` ... | -81 | | } -82 | | } +83 | | } +84 | | } | | ^ | | | | |_expected `{` after struct name | in this macro invocation | - = note: this error originates in the macro `$crate::__pin_project_parse_generics` (in Nightly builds, run with -Z macro-backtrace for more info) + = 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` + --> src/lib.rs + | + | $(: $where_clause_lifetime_bound:lifetime)? + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ diff --git a/third_party/rust/pin-project-lite/tests/ui/pin_project/invalid.rs b/third_party/rust/pin-project-lite/tests/ui/pin_project/invalid.rs index e0ea61d4f77a..a8d2736accdf 100644 --- a/third_party/rust/pin-project-lite/tests/ui/pin_project/invalid.rs +++ b/third_party/rust/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/third_party/rust/pin-project-lite/tests/ui/pin_project/invalid.stderr b/third_party/rust/pin-project-lite/tests/ui/pin_project/invalid.stderr index 623a886722b8..3dfc90c4dcd5 100644 --- a/third_party/rust/pin-project-lite/tests/ui/pin_project/invalid.stderr +++ b/third_party/rust/pin-project-lite/tests/ui/pin_project/invalid.stderr @@ -1,59 +1,53 @@ -error: no rules expected the token `struct` - --> tests/ui/pin_project/invalid.rs:3:1 +error: no rules expected the token `(` + --> tests/ui/pin_project/invalid.rs:7:14 | -3 | / pin_project! { -4 | | struct A { -5 | | #[pin()] //~ ERROR no rules expected the token `(` -6 | | pinned: T, -7 | | } -8 | | } - | |_^ no rules expected this token in macro call +7 | #[pin()] //~ ERROR no rules expected the token `(` + | ^ no rules expected this token in macro call | - = note: this error originates in the macro `$crate::__pin_project_expand` (in Nightly builds, run with -Z macro-backtrace for more info) +note: while trying to match `]` + --> src/lib.rs + | + | $(#[$pin:ident])? + | ^ -error: no rules expected the token `struct` - --> tests/ui/pin_project/invalid.rs:3:1 +error: no rules expected the token `(` + --> tests/ui/pin_project/invalid.rs:7:14 | -3 | / pin_project! { -4 | | struct A { -5 | | #[pin()] //~ ERROR no rules expected the token `(` -6 | | pinned: T, -7 | | } -8 | | } - | |_^ no rules expected this token in macro call +7 | #[pin()] //~ ERROR no rules expected the token `(` + | ^ no rules expected this token in macro call | - = note: this error originates in the macro `$crate::__pin_project_expand` (in Nightly builds, run with -Z macro-backtrace for more info) +note: while trying to match `]` + --> src/lib.rs + | + | $(#[$pin:ident])? + | ^ -error: no rules expected the token `struct` - --> tests/ui/pin_project/invalid.rs:17:1 +error: no rules expected the token `#` + --> tests/ui/pin_project/invalid.rs:22:9 | -17 | / pin_project! { -18 | | struct C { -19 | | #[pin] -20 | | #[pin] //~ ERROR no rules expected the token `#` -21 | | pinned: T, -22 | | } -23 | | } - | |_^ no rules expected this token in macro call +22 | #[pin] //~ ERROR no rules expected the token `#` + | ^ no rules expected this token in macro call | - = note: this error originates in the macro `$crate::__pin_project_expand` (in Nightly builds, run with -Z macro-backtrace for more info) +note: while trying to match meta-variable `$field_vis:vis` + --> src/lib.rs + | + | $field_vis:vis $field:ident: $field_ty:ty + | ^^^^^^^^^^^^^^ -error: no rules expected the token `struct` - --> tests/ui/pin_project/invalid.rs:17:1 +error: no rules expected the token `#` + --> tests/ui/pin_project/invalid.rs:22:9 | -17 | / pin_project! { -18 | | struct C { -19 | | #[pin] -20 | | #[pin] //~ ERROR no rules expected the token `#` -21 | | pinned: T, -22 | | } -23 | | } - | |_^ no rules expected this token in macro call +22 | #[pin] //~ ERROR no rules expected the token `#` + | ^ no rules expected this token in macro call | - = note: this error originates in the macro `$crate::__pin_project_expand` (in Nightly builds, run with -Z macro-backtrace for more info) +note: while trying to match meta-variable `$field_vis:vis` + --> src/lib.rs + | + | $field_vis:vis $field:ident: $field_ty:ty + | ^^^^^^^^^^^^^^ 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/third_party/rust/pin-project-lite/tests/ui/pin_project/overlapping_lifetime_names.rs b/third_party/rust/pin-project-lite/tests/ui/pin_project/overlapping_lifetime_names.rs index 117c18d74c4d..ef23558ba948 100644 --- a/third_party/rust/pin-project-lite/tests/ui/pin_project/overlapping_lifetime_names.rs +++ b/third_party/rust/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/third_party/rust/pin-project-lite/tests/ui/pin_project/overlapping_lifetime_names.stderr b/third_party/rust/pin-project-lite/tests/ui/pin_project/overlapping_lifetime_names.stderr index 35074d07534d..0bca51d59f1b 100644 --- a/third_party/rust/pin-project-lite/tests/ui/pin_project/overlapping_lifetime_names.stderr +++ b/third_party/rust/pin-project-lite/tests/ui/pin_project/overlapping_lifetime_names.stderr @@ -1,75 +1,75 @@ -error[E0263]: lifetime name `'__pin` declared twice in the same scope - --> tests/ui/pin_project/overlapping_lifetime_names.rs:4:20 - | -3 | / pin_project! { //~ ERROR E0263,E0496 -4 | | pub struct Foo<'__pin, T> { - | | ^^^^^^ declared twice -5 | | #[pin] -6 | | field: &'__pin mut T, -7 | | } -8 | | } - | |_- previous declaration here +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: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[E0263]: lifetime name `'__pin` declared twice in the same scope - --> tests/ui/pin_project/overlapping_lifetime_names.rs:4:20 - | -3 | / pin_project! { //~ ERROR E0263,E0496 -4 | | pub struct Foo<'__pin, T> { - | | ^^^^^^ declared twice -5 | | #[pin] -6 | | field: &'__pin mut T, -7 | | } -8 | | } - | |_- previous declaration here - -error[E0263]: lifetime name `'__pin` declared twice in the same scope - --> tests/ui/pin_project/overlapping_lifetime_names.rs:4:20 - | -3 | / pin_project! { //~ ERROR E0263,E0496 -4 | | pub struct Foo<'__pin, T> { - | | ^^^^^^ declared twice -5 | | #[pin] -6 | | field: &'__pin mut T, -7 | | } -8 | | } - | |_- previous declaration here +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: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` (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` (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[E0263]: lifetime name `'__pin` declared twice in the same scope - --> tests/ui/pin_project/overlapping_lifetime_names.rs:4:20 - | -3 | / pin_project! { //~ ERROR E0263,E0496 -4 | | pub struct Foo<'__pin, T> { - | | ^^^^^^ declared twice -5 | | #[pin] -6 | | field: &'__pin mut T, -7 | | } -8 | | } - | |_- previous declaration here +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: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: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/third_party/rust/pin-project-lite/tests/ui/pin_project/overlapping_unpin_struct.rs b/third_party/rust/pin-project-lite/tests/ui/pin_project/overlapping_unpin_struct.rs index 25131d17d1bd..3eec4cff2f7f 100644 --- a/third_party/rust/pin-project-lite/tests/ui/pin_project/overlapping_unpin_struct.rs +++ b/third_party/rust/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/third_party/rust/pin-project-lite/tests/ui/pin_project/overlapping_unpin_struct.stderr b/third_party/rust/pin-project-lite/tests/ui/pin_project/overlapping_unpin_struct.stderr index 303e7cbb58a2..9ec1abc49ff4 100644 --- a/third_party/rust/pin-project-lite/tests/ui/pin_project/overlapping_unpin_struct.stderr +++ b/third_party/rust/pin-project-lite/tests/ui/pin_project/overlapping_unpin_struct.stderr @@ -1,33 +1,34 @@ error[E0277]: `PhantomPinned` cannot be unpinned - --> tests/ui/pin_project/overlapping_unpin_struct.rs:19:5 + --> tests/ui/pin_project/overlapping_unpin_struct.rs:21:16 | -19 | is_unpin::>(); //~ ERROR E0277 - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ within `_::__Origin<'_, PhantomPinned>`, the trait `Unpin` is not implemented for `PhantomPinned` +21 | is_unpin::>(); //~ ERROR E0277 + | ^^^^^^^^^^^^^^^^^^ within `_::__Origin<'_, PhantomPinned>`, the trait `Unpin` is not implemented for `PhantomPinned`, which is required by `Foo: Unpin` | - = note: consider using `Box::pin` + = 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 + --> tests/ui/pin_project/overlapping_unpin_struct.rs:7:1 | -5 | / pin_project! { -6 | | struct Foo { -7 | | #[pin] -8 | | inner: T, -9 | | } -10 | | } +7 | / pin_project! { +8 | | struct Foo { +9 | | #[pin] +10 | | inner: T, +11 | | } +12 | | } | |_^ -note: required because of the requirements on the impl of `Unpin` for `Foo` - --> tests/ui/pin_project/overlapping_unpin_struct.rs:5:1 +note: required for `Foo` to implement `Unpin` + --> tests/ui/pin_project/overlapping_unpin_struct.rs:7:1 | -5 | / pin_project! { -6 | | struct Foo { -7 | | #[pin] -8 | | inner: T, -9 | | } -10 | | } - | |_^ +7 | / pin_project! { +8 | | struct Foo { +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() {} +18 | fn is_unpin() {} | ^^^^^ required by this bound in `is_unpin` - = note: this error originates in the macro `$crate::__pin_project_make_unpin_impl` (in Nightly builds, run with -Z macro-backtrace for more info) + = 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/third_party/rust/pin-project-lite/tests/ui/pin_project/packed.rs b/third_party/rust/pin-project-lite/tests/ui/pin_project/packed.rs index 50afb118c888..90045a15a604 100644 --- a/third_party/rust/pin-project-lite/tests/ui/pin_project/packed.rs +++ b/third_party/rust/pin-project-lite/tests/ui/pin_project/packed.rs @@ -1,4 +1,4 @@ -#![allow(unaligned_references)] +// SPDX-License-Identifier: Apache-2.0 OR MIT use pin_project_lite::pin_project; diff --git a/third_party/rust/pin-project-lite/tests/ui/pin_project/packed.stderr b/third_party/rust/pin-project-lite/tests/ui/pin_project/packed.stderr index 81fb4f1fcc56..b9025ccc598a 100644 --- a/third_party/rust/pin-project-lite/tests/ui/pin_project/packed.stderr +++ b/third_party/rust/pin-project-lite/tests/ui/pin_project/packed.stderr @@ -1,4 +1,4 @@ -error: reference to packed field is unaligned +error[E0793]: reference to packed field is unaligned --> tests/ui/pin_project/packed.rs:5:1 | 5 | / pin_project! { //~ ERROR reference to packed field is unaligned @@ -10,48 +10,92 @@ error: reference to packed field is unaligned 11 | | } | |_^ | -note: the lint level is defined here - --> tests/ui/pin_project/packed.rs:5:1 - | -5 | / pin_project! { //~ ERROR reference to packed field is unaligned -6 | | #[repr(packed, C)] -7 | | struct Packed { -8 | | #[pin] -9 | | field: u16, -10 | | } -11 | | } - | |_^ - = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! - = note: for more information, see issue #82523 - = note: fields of packed structs are not properly aligned, and creating a misaligned reference is undefined behavior (even if that reference is never dereferenced) + = 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` (in Nightly builds, run with -Z macro-backtrace for more info) + = 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: reference to packed field is unaligned - --> tests/ui/pin_project/packed.rs:13:1 +error[E0793]: reference to packed field is unaligned + --> tests/ui/pin_project/packed.rs:5: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 | | } +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: the lint level is defined here - --> 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 | | } - | |_^ - = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! - = note: for more information, see issue #82523 - = note: fields of packed structs are not properly aligned, and creating a misaligned reference is undefined behavior (even if that reference is never dereferenced) + = 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` (in Nightly builds, run with -Z macro-backtrace for more info) + = 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:5:1 + | +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 + = 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) diff --git a/third_party/rust/pin-project-lite/tests/ui/pin_project/unpin_sneaky.rs b/third_party/rust/pin-project-lite/tests/ui/pin_project/unpin_sneaky.rs index 984cc2a21909..9ad1b70cbd29 100644 --- a/third_party/rust/pin-project-lite/tests/ui/pin_project/unpin_sneaky.rs +++ b/third_party/rust/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/third_party/rust/pin-project-lite/tests/ui/pin_project/unpin_sneaky.stderr b/third_party/rust/pin-project-lite/tests/ui/pin_project/unpin_sneaky.stderr index 4eb6eff96f11..8e4deaa09624 100644 --- a/third_party/rust/pin-project-lite/tests/ui/pin_project/unpin_sneaky.stderr +++ b/third_party/rust/pin-project-lite/tests/ui/pin_project/unpin_sneaky.stderr @@ -1,11 +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 - -error[E0321]: cross-crate traits with a default impl, like `Unpin`, can only be implemented for a struct/enum type, not `[type error]` - --> tests/ui/pin_project/unpin_sneaky.rs:10:1 - | -10 | impl Unpin for __Origin {} //~ ERROR E0412,E0321 - | ^^^^^^^^^^^^^^^^^^^^^^^ can't implement cross-crate trait with a default impl for non-struct/enum type diff --git a/third_party/rust/pin-project-lite/tests/ui/pin_project/unsupported.rs b/third_party/rust/pin-project-lite/tests/ui/pin_project/unsupported.rs index 2f808362756e..6532e5099679 100644 --- a/third_party/rust/pin-project-lite/tests/ui/pin_project/unsupported.rs +++ b/third_party/rust/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/third_party/rust/pin-project-lite/tests/ui/pin_project/unsupported.stderr b/third_party/rust/pin-project-lite/tests/ui/pin_project/unsupported.stderr index a7d215a43e6c..1cc373641809 100644 --- a/third_party/rust/pin-project-lite/tests/ui/pin_project/unsupported.stderr +++ b/third_party/rust/pin-project-lite/tests/ui/pin_project/unsupported.stderr @@ -1,79 +1,125 @@ 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: this error originates in the macro `$crate::__pin_project_expand` (in Nightly builds, run with -Z macro-backtrace for more info) +note: while trying to match meta-variable `$field_vis:vis` + --> src/lib.rs + | + | $field_vis:vis $field:ident: $field_ty:ty + | ^^^^^^^^^^^^^^ + = 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: this error originates in the macro `$crate::__pin_project_expand` (in Nightly builds, run with -Z macro-backtrace for more info) +note: while trying to match meta-variable `$field_vis:vis` + --> src/lib.rs + | + | $field_vis:vis $field:ident: $field_ty:ty + | ^^^^^^^^^^^^^^ + = 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 + | + | { + | ^ 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 `{` + --> src/lib.rs + | + | { + | ^ -error: no rules expected the token `enum` - --> tests/ui/pin_project/unsupported.rs:15:1 +error: no rules expected the token `(` + --> tests/ui/pin_project/unsupported.rs:19:10 | -15 | / pin_project! { -16 | | enum Enum { //~ ERROR no rules expected the token `enum` -17 | | A(u8) -18 | | } -19 | | } - | |_^ no rules expected this token in macro call +19 | A(u8) + | ^ no rules expected this token in macro call | - = note: this error originates in the macro `$crate::__pin_project_expand` (in Nightly builds, run with -Z macro-backtrace for more info) +note: while trying to match `}` + --> src/lib.rs + | + | } + | ^ -error: no rules expected the token `enum` - --> tests/ui/pin_project/unsupported.rs:15:1 +error: no rules expected the token `(` + --> tests/ui/pin_project/unsupported.rs:19:10 | -15 | / pin_project! { -16 | | enum Enum { //~ ERROR no rules expected the token `enum` -17 | | A(u8) -18 | | } -19 | | } - | |_^ no rules expected this token in macro call +19 | A(u8) + | ^ no rules expected this token in macro call | - = note: this error originates in the macro `$crate::__pin_project_expand` (in Nightly builds, run with -Z macro-backtrace for more info) +note: while trying to match `}` + --> src/lib.rs + | + | } + | ^ 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: this error originates in the macro `$crate::__pin_project_expand` (in Nightly builds, run with -Z macro-backtrace for more info) + ::: src/lib.rs + | + | [$(#[$attrs:meta])* $vis:vis $struct_ty_ident:ident $ident:ident] + | ---------------------- + | +note: while trying to match `struct` + --> src/lib.rs + | + | [$(#[$attrs:meta])* $vis:vis struct $ident:ident] + | ^^^^^^ + = note: captured metavariables except for `:tt`, `:ident` and `:lifetime` cannot be compared to other tokens + = note: see 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: this error originates in the macro `$crate::__pin_project_expand` (in Nightly builds, run with -Z macro-backtrace for more info) + ::: src/lib.rs + | + | [$(#[$attrs:meta])* $vis:vis $struct_ty_ident:ident $ident:ident] + | ---------------------- + | +note: while trying to match `struct` + --> src/lib.rs + | + | [$(#[$attrs:meta])* $vis:vis struct $ident:ident] + | ^^^^^^ + = note: captured metavariables except for `:tt`, `:ident` and `:lifetime` cannot be compared to other tokens + = note: see 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/third_party/rust/pin-project-lite/tests/ui/pinned_drop/call-drop-inner.rs b/third_party/rust/pin-project-lite/tests/ui/pinned_drop/call-drop-inner.rs index 609b3bebad07..9ee8aee227df 100644 --- a/third_party/rust/pin-project-lite/tests/ui/pinned_drop/call-drop-inner.rs +++ b/third_party/rust/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/third_party/rust/pin-project-lite/tests/ui/pinned_drop/call-drop-inner.stderr b/third_party/rust/pin-project-lite/tests/ui/pinned_drop/call-drop-inner.stderr index 597f67c84f10..ff3c8f5056ac 100644 --- a/third_party/rust/pin-project-lite/tests/ui/pinned_drop/call-drop-inner.stderr +++ b/third_party/rust/pin-project-lite/tests/ui/pinned_drop/call-drop-inner.stderr @@ -1,22 +1,21 @@ 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); - | ^^^^^^^^^^^^ ---- argument unexpected +12 | __drop_inner(this); + | ^^^^^^^^^^^^ ---- + | | + | unexpected argument of type `Pin<&mut S>` + | help: remove the extra argument | 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` (in Nightly builds, run with -Z macro-backtrace for more info) -help: remove the extra argument - | -10 | __drop_inner(); - | ~~~~~~~~~~~~~~ + = 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/third_party/rust/pin-project-lite/tests/ui/pinned_drop/conditional-drop-impl.rs b/third_party/rust/pin-project-lite/tests/ui/pinned_drop/conditional-drop-impl.rs index 68b01b265ed3..1bf5677227b0 100644 --- a/third_party/rust/pin-project-lite/tests/ui/pinned_drop/conditional-drop-impl.rs +++ b/third_party/rust/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/third_party/rust/pin-project-lite/tests/ui/pinned_drop/conditional-drop-impl.stderr b/third_party/rust/pin-project-lite/tests/ui/pinned_drop/conditional-drop-impl.stderr index d70009c97a9f..b78ab7556159 100644 --- a/third_party/rust/pin-project-lite/tests/ui/pinned_drop/conditional-drop-impl.stderr +++ b/third_party/rust/pin-project-lite/tests/ui/pinned_drop/conditional-drop-impl.stderr @@ -1,38 +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 Drop for DropImpl { - | ^^^^^ - | + --> tests/ui/pinned_drop/conditional-drop-impl.rs:11:9 + | +11 | impl Drop for DropImpl { + | ^^^^^ + | note: the implementor must specify the same requirement - --> tests/ui/pinned_drop/conditional-drop-impl.rs:5:1 - | -5 | / struct DropImpl { -6 | | f: T, -7 | | } - | |_^ + --> tests/ui/pinned_drop/conditional-drop-impl.rs:7:1 + | +7 | struct DropImpl { + | ^^^^^^^^^^^^^^^^^^ 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 { -17 | | #[pin] +16 | / pin_project! { +17 | | //~^ ERROR E0367 +18 | | struct PinnedDropImpl { +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 { -17 | | #[pin] +16 | / pin_project! { +17 | | //~^ ERROR E0367 +18 | | struct PinnedDropImpl { +19 | | #[pin] ... | -23 | | } -24 | | } +25 | | } +26 | | } | |_^ - = note: this error originates in the macro `$crate::__pin_project_make_drop_impl` (in Nightly builds, run with -Z macro-backtrace for more info) + = 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)