diff --git a/Cargo.lock b/Cargo.lock index 976065044c08..2eccb48c85b8 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -565,7 +565,7 @@ dependencies = [ "cstr", "log", "malloc_size_of_derive", - "memmap2 0.3.0", + "memmap2 0.3.1", "moz_task", "nserror", "nsstring", @@ -948,7 +948,7 @@ dependencies = [ "cfg-if 1.0.0", "crossbeam-utils 0.8.5", "lazy_static", - "memoffset 0.6.4", + "memoffset 0.6.5", "scopeguard", ] @@ -1759,7 +1759,7 @@ dependencies = [ "futures-sink", "futures-task", "memchr", - "pin-project-lite 0.2.6", + "pin-project-lite 0.2.7", "pin-utils", "slab", ] @@ -2648,7 +2648,7 @@ dependencies = [ "fluent-bundle", "fluent-fallback", "futures 0.3.18", - "pin-project-lite 0.2.6", + "pin-project-lite 0.2.7", "replace_with", "rustc-hash", "unic-langid", @@ -2909,9 +2909,9 @@ dependencies = [ [[package]] name = "matches" -version = "0.1.8" +version = "0.1.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7ffc5c5338469d4d3ea17d269fa8ea3512ad247247c30bd2df69e68309ed0a08" +checksum = "a3e378b66a060d48947b590737b30a1be76706c8dd7b8ba0f2fe3989c68a853f" [[package]] name = "maybe-uninit" @@ -2932,9 +2932,9 @@ dependencies = [ [[package]] name = "memchr" -version = "2.4.0" +version = "2.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b16bd47d9e329435e309c58469fe0791c2d0d1ba96ec0954152a5ae2b04387dc" +checksum = "308cc39be01b73d0d18f82a0e7b2a3df85245f84af96fdddc5d202d27e47b86a" [[package]] name = "memmap2" @@ -2947,9 +2947,9 @@ dependencies = [ [[package]] name = "memmap2" -version = "0.3.0" +version = "0.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "20ff203f7bdc401350b1dbaa0355135777d25f41c0bbc601851bbd6cf61e8ff5" +checksum = "00b6c2ebff6180198788f5db08d7ce3bc1d0b617176678831a7510825973e357" dependencies = [ "libc", ] @@ -2965,9 +2965,9 @@ dependencies = [ [[package]] name = "memoffset" -version = "0.6.4" +version = "0.6.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "59accc507f1338036a0477ef61afdae33cde60840f4dfe481319ce3ad116ddf9" +checksum = "5aa361d4faea93603064a027415f07bd8e1d5c88c9fbf68bf56a285428fd79ce" dependencies = [ "autocfg", ] @@ -3523,9 +3523,9 @@ checksum = "692fcb63b64b1758029e0a96ee63e049ce8c5948587f2f7208df04625e5f6b56" [[package]] name = "opaque-debug" -version = "0.2.1" +version = "0.2.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "51ecbcb821e1bd256d456fe858aaa7f380b63863eab2eb86eee1bd9f33dd6682" +checksum = "2839e79665f131bdb5782e51f2c6c9599c133c6098982a54c794358bf432529c" [[package]] name = "ordered-float" @@ -3763,9 +3763,9 @@ checksum = "257b64915a082f7811703966789728173279bdebb956b143dbcd23f6f970a777" [[package]] name = "pin-project-lite" -version = "0.2.6" +version = "0.2.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dc0e1f259c92177c30a4c9d177246edd0a3568b25756a977d0632cf8fa37e905" +checksum = "8d31d11c69a6b52a174b42bdc0c30e5e11670f90788b2c471c31c1d17d449443" [[package]] name = "pin-utils" @@ -3785,9 +3785,9 @@ dependencies = [ [[package]] name = "pkg-config" -version = "0.3.19" +version = "0.3.23" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3831453b3449ceb48b6d9c7ad7c96d5ea673e9b470a1dc578c2ce6521230884c" +checksum = "d1a3ea4f0dd7f1f3e512cf97bf100819aa547f36a6eccac8dbaae839eb92363e" [[package]] name = "plain" @@ -3829,9 +3829,9 @@ checksum = "b18befed8bc2b61abc79a457295e7e838417326da1586050b919414073977f19" [[package]] name = "ppv-lite86" -version = "0.2.10" +version = "0.2.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ac74c624d6b2d21f425f752262f42188365d7b8ff1aff74c82e45136510a4857" +checksum = "ed0cfbc8191465bed66e1718596ee0b0b35d5ee1f41c5df2189d0fe8bde535ba" [[package]] name = "precomputed-hash" @@ -3875,9 +3875,9 @@ checksum = "dbf0c48bc1d91375ae5c3cd81e3722dff1abcf81a30960240640d223f59fe0e5" [[package]] name = "proc-macro2" -version = "1.0.27" +version = "1.0.33" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f0d8caf72986c1a598726adc988bb5984792ef84f5ee5aa50209145ee8077038" +checksum = "fb37d2df5df740e582f28f8560cf425f52bb267d872fe58358eadb554909f07a" dependencies = [ "unicode-xid", ] @@ -3905,7 +3905,7 @@ name = "profiler_helper" version = "0.1.0" dependencies = [ "goblin", - "memmap2 0.3.0", + "memmap2 0.3.1", "object", "rustc-demangle", "thin-vec", @@ -3914,9 +3914,9 @@ dependencies = [ [[package]] name = "profiling" -version = "1.0.2" +version = "1.0.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0a7c000c0ce9d9bb94c0fbacdf20e5087fbe652c556ffb2c9387d980e17d51fb" +checksum = "9926767b8b8244d7b6b64546585121d193c3d0b4856ccd656b7bfa9deb91ab6a" [[package]] name = "prost" @@ -3985,9 +3985,9 @@ checksum = "a1d01941d82fa2ab50be1e79e6714289dd7cde78eba4c074bc5a4374f650dfe0" [[package]] name = "quote" -version = "1.0.9" +version = "1.0.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c3d0b9745dc2debf507c8422de05d7226cc1f0644216dfdfead988f9b1ab32a7" +checksum = "38bc8cc6a5f2e3655e0899c1b848643b2562f853f114bfec7be120678e3ace05" dependencies = [ "proc-macro2", ] diff --git a/third_party/rust/matches/.cargo-checksum.json b/third_party/rust/matches/.cargo-checksum.json index 580390bc36be..65871b7ff7d7 100644 --- a/third_party/rust/matches/.cargo-checksum.json +++ b/third_party/rust/matches/.cargo-checksum.json @@ -1 +1 @@ -{"files":{"Cargo.toml":"b54a1f583b0b495de45e38e226e76827fd136dbda6f08e8aaab1131effa962ae","LICENSE":"d7b49708075b5f43f8e108464f1970c8c66fa8b6afce4f9c944da3af77cc1460","lib.rs":"a78ab8c8db5af687988fedf40e9de77e5f52b6891f4c87190103b852ba6bef4e","tests/macro_use_one.rs":"4f599fae16f1aef369050bf0ad74cbefec06c430b29e0c9ab0811ac9592e997a"},"package":"7ffc5c5338469d4d3ea17d269fa8ea3512ad247247c30bd2df69e68309ed0a08"} \ No newline at end of file +{"files":{"Cargo.toml":"194024a82bba1c84226ac827330511fba74474a7914b1319e6700285c15f5812","LICENSE":"d7b49708075b5f43f8e108464f1970c8c66fa8b6afce4f9c944da3af77cc1460","lib.rs":"9f4187510972f5fc356ca60d19daa0e69643dd6b530edf7c928cbd75a2b990c5","tests/macro_use_one.rs":"4f599fae16f1aef369050bf0ad74cbefec06c430b29e0c9ab0811ac9592e997a","tests/use_star.rs":"39a23b8002544f65e7a896e2cefe8e0af7404151fa65d327e748f5c1101badf8"},"package":"a3e378b66a060d48947b590737b30a1be76706c8dd7b8ba0f2fe3989c68a853f"} \ No newline at end of file diff --git a/third_party/rust/matches/Cargo.toml b/third_party/rust/matches/Cargo.toml index 030159e73d80..57a249a407e0 100644 --- a/third_party/rust/matches/Cargo.toml +++ b/third_party/rust/matches/Cargo.toml @@ -3,7 +3,7 @@ # When uploading crates to the registry Cargo will automatically # "normalize" Cargo.toml files for maximal compatibility # with all versions of Cargo and also rewrite `path` dependencies -# to registry (e.g. crates.io) dependencies +# to registry (e.g., crates.io) dependencies # # If you believe there's an error in this file please file an # issue against the rust-lang/cargo repository. If you're @@ -12,7 +12,7 @@ [package] name = "matches" -version = "0.1.8" +version = "0.1.9" authors = ["Simon Sapin "] description = "A macro to evaluate, as a boolean, whether an expression matches a pattern." documentation = "https://docs.rs/matches/" diff --git a/third_party/rust/matches/lib.rs b/third_party/rust/matches/lib.rs index b183925fb94a..3bcd6e2fe863 100644 --- a/third_party/rust/matches/lib.rs +++ b/third_party/rust/matches/lib.rs @@ -1,3 +1,5 @@ +#![no_std] + /// Check if an expression matches a refutable pattern. /// /// Syntax: `matches!(` *expression* `,` *pattern* `)` diff --git a/third_party/rust/matches/tests/use_star.rs b/third_party/rust/matches/tests/use_star.rs new file mode 100644 index 000000000000..58a670b93e52 --- /dev/null +++ b/third_party/rust/matches/tests/use_star.rs @@ -0,0 +1,10 @@ +//! https://github.com/SimonSapin/rust-std-candidates/issues/22 + +extern crate matches; + +use matches::*; + +#[test] +fn test_assert_matches() { + assert_matches!(4, 4) +} diff --git a/third_party/rust/memchr/.cargo-checksum.json b/third_party/rust/memchr/.cargo-checksum.json index a07e4189f191..53bacfda7887 100644 --- a/third_party/rust/memchr/.cargo-checksum.json +++ b/third_party/rust/memchr/.cargo-checksum.json @@ -1 +1 @@ -{"files":{"COPYING":"01c266bced4a434da0051174d6bee16a4c82cf634e2679b6155d40d75012390f","Cargo.toml":"7badd40099fd459f028cb7bd6ade03a4cbdcc4cdb1b1ea865e897a3a51cf8d43","LICENSE-MIT":"0f96a83840e146e43c0ec96a22ec1f392e0680e6c1226e6f3ba87e0740af850f","README.md":"f77810103b6c10bd2234828f0d4de14b7b6e0000dcdaa5dec907a1b7a1b1dcb9","UNLICENSE":"7e12e5df4bae12cb21581ba157ced20e1986a0508dd10d0e8a4ab9a4cf94e85c","build.rs":"740225b5280e53e8d73971c6ccc55152d6af32e94132bc6980fdc0eb1fb3ab48","rustfmt.toml":"1ca600239a27401c4a43f363cf3f38183a212affc1f31bff3ae93234bbaec228","src/cow.rs":"873d2349577b333e8ae0a925855285f2db32b652455983b4511b67d928af7485","src/lib.rs":"bd81de1030e6553d1b711e0482f00864e78ca8888147b26cc2d08384ffd4fb89","src/memchr/c.rs":"34f7caf79316f4b03908832fdbd4aff367f2bc30eae291478cc5a0a108ce6e76","src/memchr/fallback.rs":"48764f18b7ff1f00a9ac1c4ed8ec96ad11f7b09b2d062a8ed3fe81160add627d","src/memchr/iter.rs":"61463e7fa22ca8f212c2cbfb882af0c87b0fb1bc6b4676678a4822a581ec1037","src/memchr/mod.rs":"d5bfc881c7c089e1a0825209a4d21c3f792f38c6f16f3bc715d0d539477376b6","src/memchr/naive.rs":"c7453bc99cc4e58eb37cf5a50c88688833e50a270ee1849baefddb8acc0ccd94","src/memchr/x86/avx.rs":"3c2750174ce7ff033daa4096e7961bbee9a2da898068266b27dee22ef8cfddad","src/memchr/x86/mod.rs":"a642d5aefdb7452ead4ab7946b5c6cfb6cc6df636dcd0ebbd6f5e6e1ac8305c0","src/memchr/x86/sse2.rs":"79ede1aba71a655e86eb5873d682c5da26933bffa4fffd7042a2313f18cf4675","src/memchr/x86/sse42.rs":"de4c6f354dbfec170876cddb8d9157b35928f96ed2339a0c5d094cc953a2f52d","src/memmem/byte_frequencies.rs":"2fb85b381c038c1e44ce94294531cdcd339dca48b1e61f41455666e802cbbc9e","src/memmem/genericsimd.rs":"7d42f15f03cfec0bc387895b3a7b4ffd6a9c7517fdcd2d5bcd2018eb6b1a6aea","src/memmem/mod.rs":"c265518c0d9e6afca1536306de707e5817f81bc1528ca6956d92c8f5a1ed9248","src/memmem/prefilter/fallback.rs":"aa44ece210fbed15d2f61dd384f17b01cee9fcc1d20dfbf3472c57dc8f176f37","src/memmem/prefilter/genericsimd.rs":"57d5523cf0299b37ef1dd1b351e3d387d5070f2f7ecffc9a9ca66528101ebd3f","src/memmem/prefilter/mod.rs":"0e0c7d656497dc8a7d20cd446db1ebc05341fe2612d3864795704beae07df89f","src/memmem/prefilter/x86/avx.rs":"e344cae36a88b59c07a1c1d395edeb9c636a399e1528ce69b2bc7c94d8d8bb0b","src/memmem/prefilter/x86/mod.rs":"df2d84b23b22574383c281d33671a121b5faf7b1a48dd6f67c3085cd02cd4498","src/memmem/prefilter/x86/sse.rs":"d39af926e3d0f19dbf447f28d8b9833c470224fb3109f5500ef8de6f4bb1568b","src/memmem/rabinkarp.rs":"9b44eb092524a51792eba4deaca6c6d3cbc51db98cb548ea4fa7e5d8988cc71a","src/memmem/rarebytes.rs":"571082c71fc3dca5e4304171d41fb3c44e241df6dcd88bac4d7a15b52f9521e0","src/memmem/twoway.rs":"102f8bbb29696d5656cd2f5a1769a3af96d044fb09972881455cfb6424d6b50a","src/memmem/util.rs":"0194d40b912137e2352863af9cc1c0273baf97fdf6b27799628680846c06febd","src/memmem/vector.rs":"7925496f273e8d8837e7850d7d0592f5a3f0472a0e0f5d8852b6d6f8e2c45ecd","src/memmem/x86/avx.rs":"de85dbc415603c844baf94fbc92d676a738dd4b99246be468bd5f7be5921b25f","src/memmem/x86/mod.rs":"5012fca41b91caf229278aa221e8dd514ede497fe4938d64562d03fef2fc46e6","src/memmem/x86/sse.rs":"148a40c0952aca8b16d9eb3e724a5b9b60693bc7b2bcc5209bcc43c94faf560a","src/tests/memchr/iter.rs":"b68c7ecdb6222c5dbf61212e6863f78f98ad343868a74cb8612692fc790240b2","src/tests/memchr/memchr.rs":"09589c5899324c9b26ea4513c80389a2ffdf6ddc460031e2ca8da43bd493ae3f","src/tests/memchr/mod.rs":"29e0855f946c7babf603b3d610a29235a56a26a4c867fef0768542388eac4c95","src/tests/memchr/simple.rs":"b9997903ede972272c01c1750522a20692a28488cc7c5cf745ea83ff96d65fe3","src/tests/memchr/testdata.rs":"b74e613b1c7e89f2d78a13641607aafef5472b798162a55b15a736d6f961ef0a","src/tests/mod.rs":"9054a2a2f9af140f305ca29155d942fafbac9fb0874067611adc8a5990546be4","src/tests/x86_64-soft_float.json":"c0e416487fe9b4809534edb7db2a9eff3453dc40d9f1e23362c37f45a77ec717"},"package":"b16bd47d9e329435e309c58469fe0791c2d0d1ba96ec0954152a5ae2b04387dc"} \ No newline at end of file +{"files":{"COPYING":"01c266bced4a434da0051174d6bee16a4c82cf634e2679b6155d40d75012390f","Cargo.toml":"79d36439427134dd97c1a648579acb179dc594f960ab31abd0f447fdea4e7886","LICENSE-MIT":"0f96a83840e146e43c0ec96a22ec1f392e0680e6c1226e6f3ba87e0740af850f","README.md":"8e0a803533f359a91e0cedb0e664b4d880d5e571543eed2b58888dd84555cf0f","UNLICENSE":"7e12e5df4bae12cb21581ba157ced20e1986a0508dd10d0e8a4ab9a4cf94e85c","build.rs":"740225b5280e53e8d73971c6ccc55152d6af32e94132bc6980fdc0eb1fb3ab48","rustfmt.toml":"1ca600239a27401c4a43f363cf3f38183a212affc1f31bff3ae93234bbaec228","scripts/make-byte-frequency-table":"21d1ded41fe5a780507bb88e1910d471b4081cc626a48891a408712e45b7b2bf","src/cow.rs":"a23c3b009e5215b5c3ac46627a5dd844235bef0136d76b3fc1eeeb744565c125","src/lib.rs":"9430cd37b13399df8f8c27a752ccdf6422a563e24171d1b4802424f9193a8f37","src/memchr/c.rs":"34f7caf79316f4b03908832fdbd4aff367f2bc30eae291478cc5a0a108ce6e76","src/memchr/fallback.rs":"48764f18b7ff1f00a9ac1c4ed8ec96ad11f7b09b2d062a8ed3fe81160add627d","src/memchr/iter.rs":"61463e7fa22ca8f212c2cbfb882af0c87b0fb1bc6b4676678a4822a581ec1037","src/memchr/mod.rs":"d5bfc881c7c089e1a0825209a4d21c3f792f38c6f16f3bc715d0d539477376b6","src/memchr/naive.rs":"c7453bc99cc4e58eb37cf5a50c88688833e50a270ee1849baefddb8acc0ccd94","src/memchr/x86/avx.rs":"3c2750174ce7ff033daa4096e7961bbee9a2da898068266b27dee22ef8cfddad","src/memchr/x86/mod.rs":"a642d5aefdb7452ead4ab7946b5c6cfb6cc6df636dcd0ebbd6f5e6e1ac8305c0","src/memchr/x86/sse2.rs":"79ede1aba71a655e86eb5873d682c5da26933bffa4fffd7042a2313f18cf4675","src/memchr/x86/sse42.rs":"de4c6f354dbfec170876cddb8d9157b35928f96ed2339a0c5d094cc953a2f52d","src/memmem/byte_frequencies.rs":"2fb85b381c038c1e44ce94294531cdcd339dca48b1e61f41455666e802cbbc9e","src/memmem/genericsimd.rs":"9ce7283db0994438eb6df2bea6ad984e80512b6f643ebae7ae7d82eb5d39fa11","src/memmem/mod.rs":"c265518c0d9e6afca1536306de707e5817f81bc1528ca6956d92c8f5a1ed9248","src/memmem/prefilter/fallback.rs":"d32248c41aa09701c2410c52f948bbe009dd1b13a01b444ce0fb8c4b4e404ede","src/memmem/prefilter/genericsimd.rs":"57d5523cf0299b37ef1dd1b351e3d387d5070f2f7ecffc9a9ca66528101ebd3f","src/memmem/prefilter/mod.rs":"108bbab9ccca2843996c4e5def7db9210841c610d28493a18163ea1b63e6a785","src/memmem/prefilter/x86/avx.rs":"e344cae36a88b59c07a1c1d395edeb9c636a399e1528ce69b2bc7c94d8d8bb0b","src/memmem/prefilter/x86/mod.rs":"df2d84b23b22574383c281d33671a121b5faf7b1a48dd6f67c3085cd02cd4498","src/memmem/prefilter/x86/sse.rs":"d39af926e3d0f19dbf447f28d8b9833c470224fb3109f5500ef8de6f4bb1568b","src/memmem/rabinkarp.rs":"9b44eb092524a51792eba4deaca6c6d3cbc51db98cb548ea4fa7e5d8988cc71a","src/memmem/rarebytes.rs":"571082c71fc3dca5e4304171d41fb3c44e241df6dcd88bac4d7a15b52f9521e0","src/memmem/twoway.rs":"102f8bbb29696d5656cd2f5a1769a3af96d044fb09972881455cfb6424d6b50a","src/memmem/util.rs":"0194d40b912137e2352863af9cc1c0273baf97fdf6b27799628680846c06febd","src/memmem/vector.rs":"7925496f273e8d8837e7850d7d0592f5a3f0472a0e0f5d8852b6d6f8e2c45ecd","src/memmem/x86/avx.rs":"de85dbc415603c844baf94fbc92d676a738dd4b99246be468bd5f7be5921b25f","src/memmem/x86/mod.rs":"5012fca41b91caf229278aa221e8dd514ede497fe4938d64562d03fef2fc46e6","src/memmem/x86/sse.rs":"148a40c0952aca8b16d9eb3e724a5b9b60693bc7b2bcc5209bcc43c94faf560a","src/tests/memchr/iter.rs":"b68c7ecdb6222c5dbf61212e6863f78f98ad343868a74cb8612692fc790240b2","src/tests/memchr/memchr.rs":"09589c5899324c9b26ea4513c80389a2ffdf6ddc460031e2ca8da43bd493ae3f","src/tests/memchr/mod.rs":"29e0855f946c7babf603b3d610a29235a56a26a4c867fef0768542388eac4c95","src/tests/memchr/simple.rs":"b9997903ede972272c01c1750522a20692a28488cc7c5cf745ea83ff96d65fe3","src/tests/memchr/testdata.rs":"3e34377fe60eca3687d1ebc66127bd631af27ceaccc8f08806a293199b69a83f","src/tests/mod.rs":"9054a2a2f9af140f305ca29155d942fafbac9fb0874067611adc8a5990546be4","src/tests/x86_64-soft_float.json":"c0e416487fe9b4809534edb7db2a9eff3453dc40d9f1e23362c37f45a77ec717"},"package":"308cc39be01b73d0d18f82a0e7b2a3df85245f84af96fdddc5d202d27e47b86a"} \ No newline at end of file diff --git a/third_party/rust/memchr/Cargo.toml b/third_party/rust/memchr/Cargo.toml index ed97e9fee926..e739019be8f3 100644 --- a/third_party/rust/memchr/Cargo.toml +++ b/third_party/rust/memchr/Cargo.toml @@ -3,26 +3,25 @@ # When uploading crates to the registry Cargo will automatically # "normalize" Cargo.toml files for maximal compatibility # with all versions of Cargo and also rewrite `path` dependencies -# to registry (e.g., crates.io) dependencies +# to registry (e.g., crates.io) dependencies. # -# If you believe there's an error in this file please file an -# issue against the rust-lang/cargo repository. If you're -# editing this file be aware that the upstream Cargo.toml -# will likely look very different (and much more reasonable) +# If you are reading this file be aware that the original Cargo.toml +# will likely look very different (and much more reasonable). +# See Cargo.toml.orig for the original contents. [package] edition = "2018" name = "memchr" -version = "2.4.0" +version = "2.4.1" authors = ["Andrew Gallant ", "bluss"] exclude = ["/bench", "/.github", "/fuzz"] description = "Safe interface to memchr." -homepage = "https://github.com/BurntSushi/rust-memchr" +homepage = "https://github.com/BurntSushi/memchr" documentation = "https://docs.rs/memchr/" readme = "README.md" keywords = ["memchr", "char", "scan", "strchr", "string"] license = "Unlicense/MIT" -repository = "https://github.com/BurntSushi/rust-memchr" +repository = "https://github.com/BurntSushi/memchr" [profile.bench] debug = true @@ -36,6 +35,15 @@ debug = true [lib] name = "memchr" bench = false +[dependencies.compiler_builtins] +version = "0.1.2" +optional = true + +[dependencies.core] +version = "1.0.0" +optional = true +package = "rustc-std-workspace-core" + [dependencies.libc] version = "0.2.18" optional = true @@ -46,5 +54,6 @@ default-features = false [features] default = ["std"] +rustc-dep-of-std = ["core", "compiler_builtins"] std = [] use_std = ["std"] diff --git a/third_party/rust/memchr/README.md b/third_party/rust/memchr/README.md index 3b92e188a183..df758160365c 100644 --- a/third_party/rust/memchr/README.md +++ b/third_party/rust/memchr/README.md @@ -2,7 +2,7 @@ memchr ====== This library provides heavily optimized routines for string search primitives. -[![Build status](https://github.com/BurntSushi/rust-memchr/workflows/ci/badge.svg)](https://github.com/BurntSushi/rust-memchr/actions) +[![Build status](https://github.com/BurntSushi/memchr/workflows/ci/badge.svg)](https://github.com/BurntSushi/memchr/actions) [![](https://meritbadge.herokuapp.com/memchr)](https://crates.io/crates/memchr) Dual-licensed under MIT or the [UNLICENSE](https://unlicense.org/). @@ -84,4 +84,24 @@ approaches: * A huge suite of benchmarks that are also run as tests. Benchmarks always confirm that the expected result occurs. -Improvements to the testing infrastructue are very welcome. +Improvements to the testing infrastructure are very welcome. + + +### Algorithms used + +At time of writing, this crate's implementation of substring search actually +has a few different algorithms to choose from depending on the situation. + +* For very small haystacks, + [Rabin-Karp](https://en.wikipedia.org/wiki/Rabin%E2%80%93Karp_algorithm) + is used to reduce latency. Rabin-Karp has very small overhead and can often + complete before other searchers have even been constructed. +* For small needles, a variant of the + ["Generic SIMD"](http://0x80.pl/articles/simd-strfind.html#algorithm-1-generic-simd) + algorithm is used. Instead of using the first and last bytes, a heuristic is + used to select bytes based on a background distribution of byte frequencies. +* In all other cases, + [Two-Way](https://en.wikipedia.org/wiki/Two-way_string-matching_algorithm) + is used. If possible, a prefilter based on the "Generic SIMD" algorithm + linked above is used to find candidates quickly. A dynamic heuristic is used + to detect if the prefilter is ineffective, and if so, disables it. diff --git a/third_party/rust/memchr/scripts/make-byte-frequency-table b/third_party/rust/memchr/scripts/make-byte-frequency-table new file mode 100755 index 000000000000..37eeca7b7d56 --- /dev/null +++ b/third_party/rust/memchr/scripts/make-byte-frequency-table @@ -0,0 +1,74 @@ +#!/usr/bin/env python + +# This does simple normalized frequency analysis on UTF-8 encoded text. The +# result of the analysis is translated to a ranked list, where every byte is +# assigned a rank. This list is written to src/freqs.rs. +# +# Currently, the frequencies are generated from the following corpuses: +# +# * The CIA world fact book +# * The source code of rustc +# * Septuaginta + +from __future__ import absolute_import, division, print_function + +import argparse +from collections import Counter +import sys + +preamble = ''' +// NOTE: The following code was generated by "scripts/frequencies.py", do not +// edit directly +'''.lstrip() + + +def eprint(*args, **kwargs): + kwargs['file'] = sys.stderr + print(*args, **kwargs) + + +def main(): + p = argparse.ArgumentParser() + p.add_argument('corpus', metavar='FILE', nargs='+') + args = p.parse_args() + + # Get frequency counts of each byte. + freqs = Counter() + for i in range(0, 256): + freqs[i] = 0 + + eprint('reading entire corpus into memory') + corpus = [] + for fpath in args.corpus: + corpus.append(open(fpath, 'rb').read()) + + eprint('computing byte frequencies') + for c in corpus: + for byte in c: + freqs[byte] += 1.0 / float(len(c)) + + eprint('writing Rust code') + # Get the rank of each byte. A lower rank => lower relative frequency. + rank = [0] * 256 + for i, (byte, _) in enumerate(freqs.most_common()): + # print(byte) + rank[byte] = 255 - i + + # Forcefully set the highest rank possible for bytes that start multi-byte + # UTF-8 sequences. The idea here is that a continuation byte will be more + # discerning in a homogenous haystack. + for byte in range(0xC0, 0xFF + 1): + rank[byte] = 255 + + # Now write Rust. + olines = ['pub const BYTE_FREQUENCIES: [u8; 256] = ['] + for byte in range(256): + olines.append(' %3d, // %r' % (rank[byte], chr(byte))) + olines.append('];') + + print(preamble) + print('\n'.join(olines)) + + +if __name__ == '__main__': + main() diff --git a/third_party/rust/memchr/src/cow.rs b/third_party/rust/memchr/src/cow.rs index 95a08241aca7..0b7d0dad091c 100644 --- a/third_party/rust/memchr/src/cow.rs +++ b/third_party/rust/memchr/src/cow.rs @@ -5,7 +5,7 @@ use core::ops; /// The purpose of this type is to permit usage of a "borrowed or owned /// byte string" in a way that keeps std/no-std compatibility. That is, in /// no-std mode, this type devolves into a simple &[u8] with no owned variant -/// availble. We can't just use a plain Cow because Cow is not in core. +/// available. We can't just use a plain Cow because Cow is not in core. #[derive(Clone, Debug)] pub struct CowBytes<'a>(Imp<'a>); diff --git a/third_party/rust/memchr/src/lib.rs b/third_party/rust/memchr/src/lib.rs index c3154b60ddcd..e0b4ce3fda4e 100644 --- a/third_party/rust/memchr/src/lib.rs +++ b/third_party/rust/memchr/src/lib.rs @@ -160,7 +160,7 @@ standard library exposes a platform independent SIMD API. #![cfg_attr(miri, allow(dead_code, unused_macros))] // Supporting 8-bit (or others) would be fine. If you need it, please submit a -// bug report at https://github.com/BurntSushi/rust-memchr +// bug report at https://github.com/BurntSushi/memchr #[cfg(not(any( target_pointer_width = "16", target_pointer_width = "32", diff --git a/third_party/rust/memchr/src/memmem/genericsimd.rs b/third_party/rust/memchr/src/memmem/genericsimd.rs index 2417f917b6d4..28bfdab880c3 100644 --- a/third_party/rust/memchr/src/memmem/genericsimd.rs +++ b/third_party/rust/memchr/src/memmem/genericsimd.rs @@ -195,7 +195,9 @@ pub(crate) unsafe fn fwd_find( } /// Search for an occurrence of two rare bytes from the needle in the chunk -/// pointed to by ptr, with the end of the haystack pointed to by end_ptr. +/// pointed to by ptr, with the end of the haystack pointed to by end_ptr. When +/// an occurrence is found, memcmp is run to check if a match occurs at the +/// corresponding position. /// /// rare1chunk and rare2chunk correspond to vectors with the rare1 and rare2 /// bytes repeated in each 8-bit lane, respectively. @@ -210,7 +212,7 @@ pub(crate) unsafe fn fwd_find( /// /// It must be safe to do an unaligned read of size(V) bytes starting at both /// (ptr + rare1i) and (ptr + rare2i). It must also be safe to do unaligned -/// loads on ptr up to end_ptr. +/// loads on ptr up to (end_ptr - needle.len()). #[inline(always)] unsafe fn fwd_find_in_chunk( fwd: &Forward, diff --git a/third_party/rust/memchr/src/memmem/prefilter/fallback.rs b/third_party/rust/memchr/src/memmem/prefilter/fallback.rs index 8ae1f4e98b89..ae1bbccb32b4 100644 --- a/third_party/rust/memchr/src/memmem/prefilter/fallback.rs +++ b/third_party/rust/memchr/src/memmem/prefilter/fallback.rs @@ -20,7 +20,7 @@ make use of the background frequency distribution of bytes though.) This fallback implementation was originally formulated in regex many moons ago: https://github.com/rust-lang/regex/blob/3db8722d0b204a85380fe2a65e13d7065d7dd968/src/literal/imp.rs#L370-L501 -Prior to that, I'm not aware of anyone using this technique in any prominant +Prior to that, I'm not aware of anyone using this technique in any prominent substring search implementation. Although, I'm sure folks have had this same insight long before me. diff --git a/third_party/rust/memchr/src/memmem/prefilter/mod.rs b/third_party/rust/memchr/src/memmem/prefilter/mod.rs index 2481cfecc3ae..6461f338c040 100644 --- a/third_party/rust/memchr/src/memmem/prefilter/mod.rs +++ b/third_party/rust/memchr/src/memmem/prefilter/mod.rs @@ -18,7 +18,7 @@ const MAX_FALLBACK_RANK: usize = 250; /// instead of needing to pass around all three as distinct function /// parameters. pub(crate) struct Pre<'a> { - /// State that tracks the effectivess of a prefilter. + /// State that tracks the effectiveness of a prefilter. pub(crate) state: &'a mut PrefilterState, /// The actual prefilter function. pub(crate) prefn: PrefilterFn, @@ -146,7 +146,7 @@ impl core::fmt::Debug for PrefilterFn { /// The use of prefilters in this implementation does use a heuristic to detect /// when a prefilter might not be carrying its weight, and will dynamically /// disable its use. Nevertheless, this configuration option gives callers -/// the ability to disable pefilters if you have knowledge that they won't be +/// the ability to disable prefilters if you have knowledge that they won't be /// useful. #[derive(Clone, Copy, Debug)] #[non_exhaustive] diff --git a/third_party/rust/memchr/src/tests/memchr/testdata.rs b/third_party/rust/memchr/src/tests/memchr/testdata.rs index acb1fd8d6d36..6dda5246fd8d 100644 --- a/third_party/rust/memchr/src/tests/memchr/testdata.rs +++ b/third_party/rust/memchr/src/tests/memchr/testdata.rs @@ -160,7 +160,7 @@ impl MemchrTest { // // You might think this would cause most needles to not be found, but // we actually expand our tests to include corpus sizes all the way up - // to >500 bytes, so we should exericse most branches. + // to >500 bytes, so we should exercise most branches. for align in 0..130 { let corpus = self.corpus(align); assert_eq!( diff --git a/third_party/rust/memmap2/.cargo-checksum.json b/third_party/rust/memmap2/.cargo-checksum.json index c5832cb50a1d..1be0acbff5d5 100644 --- a/third_party/rust/memmap2/.cargo-checksum.json +++ b/third_party/rust/memmap2/.cargo-checksum.json @@ -1 +1 @@ -{"files":{"CHANGELOG.md":"10ef814dd214d3a2a02466d950c57eb275b02b61ace476ac5258b6932695e9d3","Cargo.lock":"3bdb2b8a0a0b28c11923a3e9c02880a26b71f7a112bdbd6ee0219a044176930b","Cargo.toml":"f9fa506d36e5644b6e334b85cf1b3df707f0b8df0224383125dc6984174af8c7","LICENSE-APACHE":"04ea4849dba9dcae07113850c6f1b1a69052c625210639914eee352023f750ad","LICENSE-MIT":"e9116f7228fce981d81aa680ae1add0cfb8122c35d801c4664d3d674ad0beda8","README.md":"4e70c39451ff48d9b60e2a0db4754fefc2fe349149b4baf4747ca3556ac7ae15","examples/cat.rs":"ab0b575d19662e2d5b6c7cea2756b57530e495d56acdb4fd2b56c0ba4d768dfd","src/lib.rs":"829cd8a727513888172fb158ed4efcdc9c3081ff9483301e9474a4369b8da5a0","src/stub.rs":"f64675e86e590aa5aea779a60c22153fe4ab47a3d021b74f6dd697227e9971b1","src/unix.rs":"4cabd924f8bd822a82e7d68dfaad8cc24c7e8f350bff5b24474ea2bdd60c29b7","src/windows.rs":"e5c1f1ba250e7d30cdf9c347dd9403ff2e65bcc427b0ec5e02fc387a6f7c6468"},"package":"20ff203f7bdc401350b1dbaa0355135777d25f41c0bbc601851bbd6cf61e8ff5"} \ No newline at end of file +{"files":{"CHANGELOG.md":"1d984b7fd11609a7dafd72c48ae294aa6c0cd202c45797c4e5bbb9e861ef4334","Cargo.lock":"589809de388088d9ef97fad54e41d817013fae9d861029bf564181ca3a4fd973","Cargo.toml":"f9e95c4b10ade059adbdc85235f631cb45fa5e6386cdc928713aa3e9f93319b8","LICENSE-APACHE":"04ea4849dba9dcae07113850c6f1b1a69052c625210639914eee352023f750ad","LICENSE-MIT":"0d25d03b5ab49576178ad0cae7a2648d12c17ad0452fe49c07e55e4b59aa5257","README.md":"a318cac19725dfbf39890da55f6a48fcb11a32790819c66d776eaeb20fb03d50","examples/cat.rs":"ab0b575d19662e2d5b6c7cea2756b57530e495d56acdb4fd2b56c0ba4d768dfd","src/lib.rs":"fd69a723368ccf3656877230328dbbbef5778061f0d73567c434c111e97078bd","src/stub.rs":"6041ed9bbc6186e05a04ed3a8e5dbcb7ad8feb0135e617a3b0f1f09134ebcdf8","src/unix.rs":"6e6871ccfe0b0d56ba23400c0b45878433eb033d1a080dbf9d524923d76e4b9a","src/windows.rs":"1028d14387456fa785d2a31d8198794e2d4fe109f9ce8422610cc1bd26ace57c"},"package":"00b6c2ebff6180198788f5db08d7ce3bc1d0b617176678831a7510825973e357"} \ No newline at end of file diff --git a/third_party/rust/memmap2/CHANGELOG.md b/third_party/rust/memmap2/CHANGELOG.md index c3cceb893a83..2e56a72518b9 100644 --- a/third_party/rust/memmap2/CHANGELOG.md +++ b/third_party/rust/memmap2/CHANGELOG.md @@ -6,14 +6,19 @@ and this project adheres to [Semantic Versioning](http://semver.org/). ## [Unreleased] +## [0.3.1] - 2021-08-15 +### Fixed +- Integer overflow during file length calculation on 32bit targets. +- Stub implementation. [@Mrmaxmeier](https://github.com/Mrmaxmeier) + ## [0.3.0] - 2021-06-10 ### Changed -- `MmapOptions` allows mapping using Unix descriptors and not only `std::fs:File` now. +- `MmapOptions` allows mapping using Unix descriptors and not only `std::fs::File` now. [@mripard](https://github.com/mripard) ## [0.2.3] - 2021-05-24 ### Added -- Allow compilation on unsupported platform. +- Allow compilation on unsupported platforms. The code will panic on access just like in `std`. [@jcaesar](https://github.com/jcaesar) @@ -45,7 +50,8 @@ and this project adheres to [Semantic Versioning](http://semver.org/). ### Removed - `winapi` dependency. [memmap-rs/pull/89](https://github.com/danburkert/memmap-rs/pull/89) -[Unreleased]: https://github.com/RazrFalcon/memmap2-rs/compare/v0.3.0...HEAD +[Unreleased]: https://github.com/RazrFalcon/memmap2-rs/compare/v0.3.1...HEAD +[0.3.1]: https://github.com/RazrFalcon/memmap2-rs/compare/v0.3.0...v0.3.1 [0.3.0]: https://github.com/RazrFalcon/memmap2-rs/compare/v0.2.3...v0.3.0 [0.2.3]: https://github.com/RazrFalcon/memmap2-rs/compare/v0.2.2...v0.2.3 [0.2.2]: https://github.com/RazrFalcon/memmap2-rs/compare/v0.2.1...v0.2.2 diff --git a/third_party/rust/memmap2/Cargo.lock b/third_party/rust/memmap2/Cargo.lock index 3b051c44c08e..f924140ebc7e 100644 --- a/third_party/rust/memmap2/Cargo.lock +++ b/third_party/rust/memmap2/Cargo.lock @@ -1,5 +1,7 @@ # This file is automatically @generated by Cargo. # It is not intended for manual editing. +version = 3 + [[package]] name = "fuchsia-cprng" version = "0.1.1" @@ -8,13 +10,13 @@ checksum = "a06f77d526c1a601b7c4cdd98f54b5eaabffc14d5f2f0296febdc7f357c6d3ba" [[package]] name = "libc" -version = "0.2.96" +version = "0.2.99" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5600b4e6efc5421841a2138a6b082e07fe12f9aaa12783d50e5d13325b26b4fc" +checksum = "a7f823d141fe0a24df1e23b4af4e3c7ba9e5966ec514ea068c93024aa7deb765" [[package]] name = "memmap2" -version = "0.3.0" +version = "0.3.1" dependencies = [ "libc", "tempdir", diff --git a/third_party/rust/memmap2/Cargo.toml b/third_party/rust/memmap2/Cargo.toml index 9fc5cbd55e46..a82faa9b81ea 100644 --- a/third_party/rust/memmap2/Cargo.toml +++ b/third_party/rust/memmap2/Cargo.toml @@ -13,8 +13,8 @@ [package] edition = "2018" name = "memmap2" -version = "0.3.0" -authors = ["Dan Burkert ", "Evgeniy Reizner "] +version = "0.3.1" +authors = ["Dan Burkert ", "Yevhenii Reizner "] description = "Cross-platform Rust API for memory-mapped file IO" documentation = "https://docs.rs/memmap2" keywords = ["mmap", "memory-map", "io", "file"] diff --git a/third_party/rust/memmap2/LICENSE-MIT b/third_party/rust/memmap2/LICENSE-MIT index 5cc9371f2e4b..6357f40d65af 100644 --- a/third_party/rust/memmap2/LICENSE-MIT +++ b/third_party/rust/memmap2/LICENSE-MIT @@ -1,4 +1,4 @@ -Copyright (c) 2020 Evgeniy Reizner +Copyright (c) 2020 Yevhenii Reizner Copyright (c) 2015 Dan Burkert Permission is hereby granted, free of charge, to any diff --git a/third_party/rust/memmap2/README.md b/third_party/rust/memmap2/README.md index 67490933c4d5..8ca85d74e472 100644 --- a/third_party/rust/memmap2/README.md +++ b/third_party/rust/memmap2/README.md @@ -28,6 +28,6 @@ Apache License (Version 2.0). See [LICENSE-APACHE](LICENSE-APACHE), [LICENSE-MIT](LICENSE-MIT) for details. -Copyright (c) 2020 Evgeniy Reizner +Copyright (c) 2020 Yevhenii Reizner Copyright (c) 2015 Dan Burkert diff --git a/third_party/rust/memmap2/src/lib.rs b/third_party/rust/memmap2/src/lib.rs index a63c478cd81e..c13170228694 100644 --- a/third_party/rust/memmap2/src/lib.rs +++ b/third_party/rust/memmap2/src/lib.rs @@ -1,6 +1,6 @@ //! A cross-platform Rust API for memory mapped buffers. -#![doc(html_root_url = "https://docs.rs/memmap2/0.3.0")] +#![doc(html_root_url = "https://docs.rs/memmap2/0.3.1")] #[cfg(windows)] mod windows; @@ -19,6 +19,8 @@ use crate::unix::MmapInner; #[cfg(not(any(unix, windows)))] mod stub; #[cfg(not(any(unix, windows)))] +use crate::stub::file_len; +#[cfg(not(any(unix, windows)))] use crate::stub::MmapInner; use std::fmt; @@ -36,6 +38,9 @@ pub struct MmapRawDescriptor<'a>(&'a File); #[cfg(unix)] pub struct MmapRawDescriptor(std::os::unix::io::RawFd); +#[cfg(not(any(unix, windows)))] +pub struct MmapRawDescriptor<'a>(&'a File); + pub trait MmapAsRawDesc { fn as_raw_desc(&self) -> MmapRawDescriptor; } @@ -61,6 +66,13 @@ impl MmapAsRawDesc for std::os::unix::io::RawFd { } } +#[cfg(not(any(unix, windows)))] +impl MmapAsRawDesc for &File { + fn as_raw_desc(&self) -> MmapRawDescriptor { + MmapRawDescriptor(self) + } +} + /// A memory map builder, providing advanced options and flags for specifying memory map behavior. /// /// `MmapOptions` can be used to create an anonymous memory map using [`map_anon()`], or a @@ -176,13 +188,26 @@ impl MmapOptions { self.len.map(Ok).unwrap_or_else(|| { let desc = file.as_raw_desc(); let file_len = file_len(desc.0)?; - let len = file_len as u64 - self.offset; - if len > (usize::MAX as u64) { + + if file_len < self.offset { return Err(Error::new( ErrorKind::InvalidData, - "memory map length overflows usize", + "memory map offset is larger than length", )); } + let len = file_len - self.offset; + + // This check it not relevant on 64bit targets, because usize == u64 + #[cfg(not(target_pointer_width = "64"))] + { + if len > (usize::MAX as u64) { + return Err(Error::new( + ErrorKind::InvalidData, + "memory map length overflows usize", + )); + } + } + Ok(len as usize) }) } @@ -1102,6 +1127,29 @@ mod test { assert_eq!(nulls, &read); } + // 32bit Linux cannot map a file larger than i32, but Windows can. + #[cfg(all(target_os = "linux", target_pointer_width = "32"))] + #[test] + fn map_offset() { + let tempdir = tempdir::TempDir::new("mmap").unwrap(); + let path = tempdir.path().join("mmap"); + + let file = OpenOptions::new() + .read(true) + .write(true) + .create(true) + .open(&path) + .unwrap(); + + let offset = u32::max_value() as u64 + 2; + let len = 5432; + file.set_len(offset + len as u64).unwrap(); + + let mmap = unsafe { MmapOptions::new().offset(offset).map_mut(&file) }; + assert!(mmap.is_err()); + } + + #[cfg(not(all(target_os = "linux", target_pointer_width = "32")))] #[test] fn map_offset() { let tempdir = tempdir::TempDir::new("mmap").unwrap(); diff --git a/third_party/rust/memmap2/src/stub.rs b/third_party/rust/memmap2/src/stub.rs index 0825c41f62ae..a555a4f353c5 100644 --- a/third_party/rust/memmap2/src/stub.rs +++ b/third_party/rust/memmap2/src/stub.rs @@ -15,23 +15,23 @@ impl MmapInner { )) } - pub fn map(_: usize, _: &File, _: u64) -> io::Result { + pub fn map(_: usize, _: &File, _: u64, _: bool) -> io::Result { MmapInner::new() } - pub fn map_exec(_: usize, _: &File, _: u64) -> io::Result { + pub fn map_exec(_: usize, _: &File, _: u64, _: bool) -> io::Result { MmapInner::new() } - pub fn map_mut(_: usize, _: &File, _: u64) -> io::Result { + pub fn map_mut(_: usize, _: &File, _: u64, _: bool) -> io::Result { MmapInner::new() } - pub fn map_copy(_: usize, _: &File, _: u64) -> io::Result { + pub fn map_copy(_: usize, _: &File, _: u64, _: bool) -> io::Result { MmapInner::new() } - pub fn map_copy_read_only(_: usize, _: &File, _: u64) -> io::Result { + pub fn map_copy_read_only(_: usize, _: &File, _: u64, _: bool) -> io::Result { MmapInner::new() } @@ -74,3 +74,7 @@ impl MmapInner { unreachable!("self unconstructable"); } } + +pub fn file_len(file: &File) -> io::Result { + Ok(file.metadata()?.len()) +} diff --git a/third_party/rust/memmap2/src/unix.rs b/third_party/rust/memmap2/src/unix.rs index 94f73ede7db8..97b318388db3 100644 --- a/third_party/rust/memmap2/src/unix.rs +++ b/third_party/rust/memmap2/src/unix.rs @@ -233,13 +233,13 @@ fn page_size() -> usize { unsafe { libc::sysconf(libc::_SC_PAGESIZE) as usize } } -pub fn file_len(file: RawFd) -> io::Result { +pub fn file_len(file: RawFd) -> io::Result { unsafe { let mut stat: libc::stat = std::mem::zeroed(); let result = libc::fstat(file, &mut stat); if result == 0 { - Ok(stat.st_size as usize) + Ok(stat.st_size as u64) } else { Err(io::Error::last_os_error()) } diff --git a/third_party/rust/memmap2/src/windows.rs b/third_party/rust/memmap2/src/windows.rs index 74ef86682093..7f13f683bd21 100644 --- a/third_party/rust/memmap2/src/windows.rs +++ b/third_party/rust/memmap2/src/windows.rs @@ -435,6 +435,6 @@ fn allocation_granularity() -> usize { } } -pub fn file_len(file: &File) -> io::Result { - Ok(file.metadata()?.len() as usize) +pub fn file_len(file: &File) -> io::Result { + Ok(file.metadata()?.len()) } diff --git a/third_party/rust/memoffset/.cargo-checksum.json b/third_party/rust/memoffset/.cargo-checksum.json index 940fc7b27eae..01e3e71cb8a2 100644 --- a/third_party/rust/memoffset/.cargo-checksum.json +++ b/third_party/rust/memoffset/.cargo-checksum.json @@ -1 +1 @@ -{"files":{"Cargo.toml":"3fd9136d039b26466b945ea2df9d1bbbff4070224c6c23985ba3e820a0a0de81","LICENSE":"3234ac55816264ee7b6c7ee27efd61cf0a1fe775806870e3d9b4c41ea73c5cb1","README.md":"4b12b99b8512f7da8178a33fdafe101e3342b82e035f41d1f354ee4926c3b4f5","build.rs":"6d677e33a1c98d588c97ec7985d4d5c3b954683e0a73c3dc53d79db4fbb5e638","ci/miri.sh":"ad7410b0a5bd6e346f55e9d96ec0719a085a2d1ce266bddfe6fe73333a1eb8ec","src/lib.rs":"abd194ab03259289876277152f7e26a6aadf12c877db8018743f976eae13d389","src/offset_of.rs":"fd69824267580c3a6981660fb533704e46850df64d756a4677239b6845e99ca6","src/raw_field.rs":"295cc971d64e51f3d053e56c692ae6ef3bb58915298f1ec49bb695b767daff46","src/span_of.rs":"e9e8eb985f51de0915351365f451d9b9e45385dc1d374f3d59373fa774939fe5"},"package":"59accc507f1338036a0477ef61afdae33cde60840f4dfe481319ce3ad116ddf9"} \ No newline at end of file +{"files":{"Cargo.toml":"2556143c764ef2315fe44ff0ec43af47ca70b260fd64aa53f57dc42760d7132d","LICENSE":"3234ac55816264ee7b6c7ee27efd61cf0a1fe775806870e3d9b4c41ea73c5cb1","README.md":"299c8957a769bac2a71f9c63064c58a8b54e613e3bf03d41a889f0b428eb4a9c","build.rs":"6d677e33a1c98d588c97ec7985d4d5c3b954683e0a73c3dc53d79db4fbb5e638","ci/miri.sh":"ad7410b0a5bd6e346f55e9d96ec0719a085a2d1ce266bddfe6fe73333a1eb8ec","src/lib.rs":"e7976d295371a3c1e0cf31b0d50210cd6b1135caba3a5111403a97ec6175c0a2","src/offset_of.rs":"e5e3062947f61418cb48220a0d17604411b5ce651b5945c06b876f26c50220b2","src/raw_field.rs":"295cc971d64e51f3d053e56c692ae6ef3bb58915298f1ec49bb695b767daff46","src/span_of.rs":"03bfb743c2dee2e5fbb9568bcbbe9f24ace3e18488a6924d26812fcb9e3c425a"},"package":"5aa361d4faea93603064a027415f07bd8e1d5c88c9fbf68bf56a285428fd79ce"} \ No newline at end of file diff --git a/third_party/rust/memoffset/Cargo.toml b/third_party/rust/memoffset/Cargo.toml index 5ea1a3768ce1..2874e3124fa8 100644 --- a/third_party/rust/memoffset/Cargo.toml +++ b/third_party/rust/memoffset/Cargo.toml @@ -3,16 +3,15 @@ # When uploading crates to the registry Cargo will automatically # "normalize" Cargo.toml files for maximal compatibility # with all versions of Cargo and also rewrite `path` dependencies -# to registry (e.g., crates.io) dependencies +# to registry (e.g., crates.io) dependencies. # -# If you believe there's an error in this file please file an -# issue against the rust-lang/cargo repository. If you're -# editing this file be aware that the upstream Cargo.toml -# will likely look very different (and much more reasonable) +# If you are reading this file be aware that the original Cargo.toml +# will likely look very different (and much more reasonable). +# See Cargo.toml.orig for the original contents. [package] name = "memoffset" -version = "0.6.4" +version = "0.6.5" authors = ["Gilad Naaman "] description = "offset_of functionality for Rust structs." readme = "README.md" diff --git a/third_party/rust/memoffset/README.md b/third_party/rust/memoffset/README.md index 52999e35f086..9e93c2bccd7e 100644 --- a/third_party/rust/memoffset/README.md +++ b/third_party/rust/memoffset/README.md @@ -1,6 +1,6 @@ # memoffset # -[![](http://meritbadge.herokuapp.com/memoffset)](https://crates.io/crates/memoffset) +[![](https://img.shields.io/crates/v/memoffset.svg)](https://crates.io/crates/memoffset) C-Like `offset_of` functionality for Rust structs. @@ -21,17 +21,9 @@ memoffset = "0.6" These versions will compile fine with rustc versions greater or equal to 1.19. -Add the following lines at the top of your `main.rs` or `lib.rs` files. - -```rust,ignore -#[macro_use] -extern crate memoffset; -``` - ## Examples ## ```rust -#[macro_use] -extern crate memoffset; +use memoffset::{offset_of, span_of}; #[repr(C, packed)] struct Foo { @@ -69,5 +61,5 @@ features = ["unstable_const"] Your crate root: (`lib.rs`/`main.rs`) ```rust,ignore -#![feature(const_ptr_offset_from, const_maybe_uninit_as_ptr, const_raw_ptr_deref, const_refs_to_cell)] +#![feature(const_ptr_offset_from, const_refs_to_cell)] ``` diff --git a/third_party/rust/memoffset/ci/miri.sh b/third_party/rust/memoffset/ci/miri.sh old mode 100644 new mode 100755 diff --git a/third_party/rust/memoffset/src/lib.rs b/third_party/rust/memoffset/src/lib.rs index 67de5e4e6509..d80ff17437f9 100644 --- a/third_party/rust/memoffset/src/lib.rs +++ b/third_party/rust/memoffset/src/lib.rs @@ -24,8 +24,7 @@ //! //! ## Examples //! ``` -//! #[macro_use] -//! extern crate memoffset; +//! use memoffset::{offset_of, span_of}; //! //! #[repr(C, packed)] //! struct HelpMeIAmTrappedInAStructFactory { @@ -59,12 +58,7 @@ #![no_std] #![cfg_attr( feature = "unstable_const", - feature( - const_ptr_offset_from, - const_maybe_uninit_as_ptr, - const_raw_ptr_deref, - const_refs_to_cell, - ) + feature(const_ptr_offset_from, const_refs_to_cell) )] #[macro_use] @@ -75,7 +69,7 @@ extern crate doc_comment; #[cfg(doctest)] doctest!("../README.md"); -/// Hiden module for things the macros need to access. +/// Hidden module for things the macros need to access. #[doc(hidden)] pub mod __priv { #[doc(hidden)] diff --git a/third_party/rust/memoffset/src/offset_of.rs b/third_party/rust/memoffset/src/offset_of.rs index d37649802384..8596e45cf614 100644 --- a/third_party/rust/memoffset/src/offset_of.rs +++ b/third_party/rust/memoffset/src/offset_of.rs @@ -72,8 +72,7 @@ macro_rules! _memoffset_offset_from_unsafe { /// /// ## Examples /// ``` -/// #[macro_use] -/// extern crate memoffset; +/// use memoffset::offset_of; /// /// #[repr(C, packed)] /// struct Foo { @@ -103,8 +102,7 @@ macro_rules! offset_of { /// /// ## Examples /// ``` -/// #[macro_use] -/// extern crate memoffset; +/// use memoffset::offset_of_tuple; /// /// fn main() { /// assert!(offset_of_tuple!((u8, u32), 1) >= 0, "Tuples do not have a defined layout"); diff --git a/third_party/rust/memoffset/src/span_of.rs b/third_party/rust/memoffset/src/span_of.rs index fe69e1e94b24..aab9d0acaf2f 100644 --- a/third_party/rust/memoffset/src/span_of.rs +++ b/third_party/rust/memoffset/src/span_of.rs @@ -59,8 +59,7 @@ macro_rules! _memoffset__compile_error { /// /// ## Examples /// ``` -/// #[macro_use] -/// extern crate memoffset; +/// use memoffset::span_of; /// /// #[repr(C)] /// struct Florp { diff --git a/third_party/rust/opaque-debug/.cargo-checksum.json b/third_party/rust/opaque-debug/.cargo-checksum.json index 3f1711dc2d02..e431ffb85c87 100644 --- a/third_party/rust/opaque-debug/.cargo-checksum.json +++ b/third_party/rust/opaque-debug/.cargo-checksum.json @@ -1 +1 @@ -{"files":{"Cargo.toml":"14c835bd1efdb7293220cb4d4ed2d332f2e7512a46e9a185bdb68d66f390fbc2","LICENSE-APACHE":"a9040321c3712d8fd0b09cf52b17445de04a23a10165049ae187cd39e5c86be5","LICENSE-MIT":"9e0dfd2dd4173a530e238cb6adb37aa78c34c6bc7444e0e10c1ab5d8881f63ba","src/lib.rs":"e4730f0693ba6e8a4e481bea655ede96775f8eb4c0f94f1af740acb2a11240be"},"package":"51ecbcb821e1bd256d456fe858aaa7f380b63863eab2eb86eee1bd9f33dd6682"} \ No newline at end of file +{"files":{"Cargo.toml":"316df812f280ae0c584b6132630119bea8de32864c29772100f9bb8352196381","LICENSE-APACHE":"a9040321c3712d8fd0b09cf52b17445de04a23a10165049ae187cd39e5c86be5","LICENSE-MIT":"d5c22aa3118d240e877ad41c5d9fa232f9c77d757d4aac0c2f943afc0a95e0ef","src/lib.rs":"2d7d563f4a4df4b0583d6370046642103e4909f0ec2002768308f951f2d7e05c"},"package":"2839e79665f131bdb5782e51f2c6c9599c133c6098982a54c794358bf432529c"} \ No newline at end of file diff --git a/third_party/rust/opaque-debug/Cargo.toml b/third_party/rust/opaque-debug/Cargo.toml index 987493bb57b7..a2f9f1736df5 100644 --- a/third_party/rust/opaque-debug/Cargo.toml +++ b/third_party/rust/opaque-debug/Cargo.toml @@ -3,7 +3,7 @@ # When uploading crates to the registry Cargo will automatically # "normalize" Cargo.toml files for maximal compatibility # with all versions of Cargo and also rewrite `path` dependencies -# to registry (e.g. crates.io) dependencies +# to registry (e.g., crates.io) dependencies # # If you believe there's an error in this file please file an # issue against the rust-lang/cargo repository. If you're @@ -12,11 +12,11 @@ [package] name = "opaque-debug" -version = "0.2.1" +version = "0.2.3" authors = ["RustCrypto Developers"] description = "Macro for opaque Debug trait implementation" documentation = "https://docs.rs/opaque-debug" -license = "MIT/Apache-2.0" +license = "MIT OR Apache-2.0" repository = "https://github.com/RustCrypto/utils" [dependencies] diff --git a/third_party/rust/opaque-debug/LICENSE-MIT b/third_party/rust/opaque-debug/LICENSE-MIT index 8dcb85b30273..502cee6e85dc 100644 --- a/third_party/rust/opaque-debug/LICENSE-MIT +++ b/third_party/rust/opaque-debug/LICENSE-MIT @@ -1,4 +1,4 @@ -Copyright (c) 2017 Artyom Pavlov +Copyright (c) 2018-2019 The RustCrypto Project Developers Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated diff --git a/third_party/rust/opaque-debug/src/lib.rs b/third_party/rust/opaque-debug/src/lib.rs index c3648c35f445..618626ead760 100644 --- a/third_party/rust/opaque-debug/src/lib.rs +++ b/third_party/rust/opaque-debug/src/lib.rs @@ -1,6 +1,9 @@ //! Macro for opaque `Debug` trait implementation. #![no_std] +#[doc(hidden)] +pub extern crate core as __core; + /// Macro for defining opaque `Debug` implementation. /// /// It will use the following format: "StructName { ... }". While it's @@ -10,19 +13,9 @@ #[macro_export] macro_rules! impl_opaque_debug { ($struct:ty) => { - #[cfg(feature = "std")] - impl ::std::fmt::Debug for $struct { - fn fmt(&self, f: &mut ::std::fmt::Formatter) - -> Result<(), ::std::fmt::Error> - { - write!(f, concat!(stringify!($struct), " {{ ... }}")) - } - } - - #[cfg(not(feature = "std"))] - impl ::core::fmt::Debug for $struct { - fn fmt(&self, f: &mut ::core::fmt::Formatter) - -> Result<(), ::core::fmt::Error> + impl $crate::__core::fmt::Debug for $struct { + fn fmt(&self, f: &mut $crate::__core::fmt::Formatter) + -> Result<(), $crate::__core::fmt::Error> { write!(f, concat!(stringify!($struct), " {{ ... }}")) } diff --git a/third_party/rust/pin-project-lite/.cargo-checksum.json b/third_party/rust/pin-project-lite/.cargo-checksum.json index 1d25094fb4c4..e64dec6bdfc9 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":"22171a2d3eb9a2463cb7241d2082a280eb61031921c3a5a831b7303ed3c9c7ed","Cargo.toml":"e48869c4019894d0458f0f70968c4da16c4af37ba98e1d3aaeece154e4063c1f","LICENSE-APACHE":"0d542e0c8804e39aa7f37eb00da5a762149dc682d7829451287e11b938e94594","LICENSE-MIT":"23f18e03dc49df91622fe2a76176497404e46ced8a715d9d2b67a7446571cca3","README.md":"94f60b0c293aaf34041640c7f407da96bc3824a9e1efe20bd12c23aee6c196f7","src/lib.rs":"675bded8e4b1eeff1594cf003bf2f470b80f68daaaa1cf398d844c23e4dfc3c4","tests/auxiliary/mod.rs":"7e263e987e09b77e384f734384a00a71c5b70230bb1b5376446ef003a8da9372","tests/compiletest.rs":"eb16ecdecd1c9d01534b749579ee6c03f9b829d5938dcb85ef9c2916176b5d1e","tests/drop_order.rs":"817c5a7aef9c149e7d09c8a26aeb3b9e333d79a60391c5badbc3e325cbabbd12","tests/expand/README.md":"060f1800da3356e601ba3995525cfa497b219930fe1dd9a2c5696d9a809b4268","tests/expand/default/enum.expanded.rs":"c3c209d45c02d22873e464a57d7342ec775b002e6f0056481909c8d56038e9be","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":"194b02f37b170f297fa39375cca71c378acf66b1729e2799434c48a5c7e34ace","tests/expand/multifields/enum.rs":"9c79270a7d6d1d42cf8194b579d79e7d44a3fd003243742f0a568ecf0a4f3be3","tests/expand/multifields/struct.expanded.rs":"0c98b4d085237f123c5455d558e495b2754ca84048f63df6416ef271610ee1c0","tests/expand/multifields/struct.rs":"17f0447d522d48f14d516808bd66baacebdf3ac38188df72f649702a893cda68","tests/expand/naming/enum-all.expanded.rs":"c3c209d45c02d22873e464a57d7342ec775b002e6f0056481909c8d56038e9be","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":"722a17838aa9734f58a23ee15ff478788af5998a1ffc97c28aa040bc50612118","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/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":"a091cc8b0684358e327992a2acc7b7e4738d725b0e643a5ee3e8f5f1d7415608","tests/include/basic.rs":"9e399b682bc74c899d26924c2cab52a911f7392e29300defb6521e561fafafe4","tests/lint.rs":"13ccf3b5e464d6506915c2c57555a3f293bd7405fde5aac008af913df327ffa4","tests/proper_unpin.rs":"57a9e8c9029ba7920ec23670b66758916e067c9cecf4d3f8b0035bec25cdb570","tests/test.rs":"ef4efe0ce333e6a0d4c8574d139e522e408d2a48db07e0015e3e9bc8734f79d2","tests/ui/pin_project/conflict-drop.rs":"55e6809b5f59dd81e32c2c89b742c0c76db6b099a1d2621e5b882c0d20f92837","tests/ui/pin_project/conflict-drop.stderr":"b29a458533f0312b2b04e9a0dfea17fce2ba423ef764ec3e2996a315c00a4cf8","tests/ui/pin_project/conflict-unpin.rs":"51b3b6720fa581b63167d6ac941a1ea1bf739b09954931b2bc2f7abe2d934f26","tests/ui/pin_project/conflict-unpin.stderr":"ab8e9acab4ffcdff1d0065e9504d64a0220267ab9f18b2840c97da8c0bbbf984","tests/ui/pin_project/invalid-bounds.rs":"f86f23d377df015182f2f5dae6464a4f98c37f2198e0646f721fedc4017cb82c","tests/ui/pin_project/invalid-bounds.stderr":"e93d9bc35080dacb837f2e626947b7ec57fea36c0246d839c295a93c33bf7e5b","tests/ui/pin_project/invalid.rs":"7304bd4a5bac1419382742432cfa8af83535d7be8cfad52c661410e0e9e8207a","tests/ui/pin_project/invalid.stderr":"a9da7ba0d2dc729137c1736d355c52de1d34fdf10eb4fa35be07b2644d6dfad3","tests/ui/pin_project/overlapping_lifetime_names.rs":"a64c42cc56fa4751d73a1db80a7deb568427dc96f30c1a29665067d8c0ecb2c9","tests/ui/pin_project/overlapping_lifetime_names.stderr":"ebfd5c08e7c472f49d49d67de9308e647a6a6b1e289308bf2d60d79d72521457","tests/ui/pin_project/overlapping_unpin_struct.rs":"5fde23ef628d2dbd27377ffa472fc19b1c6873122f38c3fb1f84fda8602f55f3","tests/ui/pin_project/overlapping_unpin_struct.stderr":"e83e99bacdf6564727c77dafe5eaf000b4de6e784e6032b9b0ecca831ecc528c","tests/ui/pin_project/packed.rs":"1f1a34aafbff9a59b94cdf3a53df03e9fc661d9e27e0f9962bad7f9bdad03b14","tests/ui/pin_project/packed.stderr":"4acb1514ca0a2c3b9448b28a71ab81d1dce37ba42f1af8b3220f926f0ca556e4","tests/ui/pin_project/unpin_sneaky.rs":"12e97a387ce1af6ee6a567687674aab70e96962a48f2433c39976d0b3e2c3341","tests/ui/pin_project/unpin_sneaky.stderr":"7b2bc76faca39f77968c798674f2321111a74a5754512149320ea4cdd3e278d5","tests/ui/pin_project/unsupported.rs":"14defa90e736f314bbbc219973929b77bdd22e5f7e4c4c88403db764f4d167d6","tests/ui/pin_project/unsupported.stderr":"562db085e5e01dedaa3cb11c592f61f33c5a6388a31e6f1ed9554874cfa2c673"},"package":"dc0e1f259c92177c30a4c9d177246edd0a3568b25756a977d0632cf8fa37e905"} \ No newline at end of file +{"files":{"CHANGELOG.md":"ec96e73a38410d7b26282cc53c41aecbbf65d5d799abc1438cb6dc6897188d15","Cargo.toml":"99321d72395cb43843563785603744c25500e127e3aa125c249ba631f0d2b5ee","LICENSE-APACHE":"0d542e0c8804e39aa7f37eb00da5a762149dc682d7829451287e11b938e94594","LICENSE-MIT":"23f18e03dc49df91622fe2a76176497404e46ced8a715d9d2b67a7446571cca3","README.md":"019a22e1809732ec43b9a5e4f664778ea7843173619041314b0b9f887a5df0d5","src/lib.rs":"34951f11e5586e6558a01a34225f2f6b7865c5f59f7378d445c81fd36f9acda6","tests/auxiliary/mod.rs":"7e263e987e09b77e384f734384a00a71c5b70230bb1b5376446ef003a8da9372","tests/compiletest.rs":"e68e2850534f1e590e92216835bbedaf4be2ebaa2371f18a766240dc3a14460a","tests/drop_order.rs":"2cb31a8cd5cf4d9a4ba9faf25f99f0e85f9bd7b4778649f843d9c617c6af43fc","tests/expand/README.md":"060f1800da3356e601ba3995525cfa497b219930fe1dd9a2c5696d9a809b4268","tests/expand/default/enum.expanded.rs":"c3c209d45c02d22873e464a57d7342ec775b002e6f0056481909c8d56038e9be","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":"194b02f37b170f297fa39375cca71c378acf66b1729e2799434c48a5c7e34ace","tests/expand/multifields/enum.rs":"9c79270a7d6d1d42cf8194b579d79e7d44a3fd003243742f0a568ecf0a4f3be3","tests/expand/multifields/struct.expanded.rs":"0c98b4d085237f123c5455d558e495b2754ca84048f63df6416ef271610ee1c0","tests/expand/multifields/struct.rs":"17f0447d522d48f14d516808bd66baacebdf3ac38188df72f649702a893cda68","tests/expand/naming/enum-all.expanded.rs":"c3c209d45c02d22873e464a57d7342ec775b002e6f0056481909c8d56038e9be","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":"722a17838aa9734f58a23ee15ff478788af5998a1ffc97c28aa040bc50612118","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":"471a10989664d84bb5d1c8753585de4dd701b2cdc24b71c0cb5f9ea192597c61","tests/proper_unpin.rs":"57a9e8c9029ba7920ec23670b66758916e067c9cecf4d3f8b0035bec25cdb570","tests/test.rs":"b58a8a938938bf46f1f710ecd551292f896f00ff9cbf84987967ed00e5d5107c","tests/ui/pin_project/conflict-drop.rs":"55e6809b5f59dd81e32c2c89b742c0c76db6b099a1d2621e5b882c0d20f92837","tests/ui/pin_project/conflict-drop.stderr":"9bbab8ff00a43104ce46f4e6d8a17b520997fea5a8f1743bab4fa1a995dcd24d","tests/ui/pin_project/conflict-unpin.rs":"51b3b6720fa581b63167d6ac941a1ea1bf739b09954931b2bc2f7abe2d934f26","tests/ui/pin_project/conflict-unpin.stderr":"827cb36a769110dc2844ff5c85d387f96a92ff95ac0066a60465caacb762f100","tests/ui/pin_project/invalid-bounds.rs":"f86f23d377df015182f2f5dae6464a4f98c37f2198e0646f721fedc4017cb82c","tests/ui/pin_project/invalid-bounds.stderr":"27c7b439575503d16617c37e36f5478e3803a5c958c37e438c4f1ce84a3991fe","tests/ui/pin_project/invalid.rs":"7304bd4a5bac1419382742432cfa8af83535d7be8cfad52c661410e0e9e8207a","tests/ui/pin_project/invalid.stderr":"b95ca63870e7687e3b1a1f69e470692d5bc3875c1c27958c6ccec0f636d70ed0","tests/ui/pin_project/overlapping_lifetime_names.rs":"36c849a4570c8c0c32ca6c01aa75afbe1136ef73d45f17eb66175e1936678722","tests/ui/pin_project/overlapping_lifetime_names.stderr":"19d61fbcaa9061224cf0f911d236c3552a5ff93e3cc138f231f267ce4ab92b2e","tests/ui/pin_project/overlapping_unpin_struct.rs":"9a126182d1fe15a30ac60bb223b376aad747d11293d3cf512ad2dce546e3725c","tests/ui/pin_project/overlapping_unpin_struct.stderr":"eb79df698bf9aaca8cd200d0e1064277cf5c56ed833ba7214b7bc78d94d2839c","tests/ui/pin_project/packed.rs":"2ede405a0d101eb843ea83c2836cc8399da54c105776f2c795f3138e03a1e5ef","tests/ui/pin_project/packed.stderr":"2c02336ae457222d87fb28197a8582528051ca13fdb74a615798fdf3da2f3db0","tests/ui/pin_project/unpin_sneaky.rs":"12e97a387ce1af6ee6a567687674aab70e96962a48f2433c39976d0b3e2c3341","tests/ui/pin_project/unpin_sneaky.stderr":"7b2bc76faca39f77968c798674f2321111a74a5754512149320ea4cdd3e278d5","tests/ui/pin_project/unsupported.rs":"14defa90e736f314bbbc219973929b77bdd22e5f7e4c4c88403db764f4d167d6","tests/ui/pin_project/unsupported.stderr":"982da28433932d3ea9458bd543d1c589a81e6011d3be830bf23e26a6f2486e6e","tests/ui/pinned_drop/call-drop-inner.rs":"032260da1fc0e649d97167a8a4ac47eea915000efebdfdc490f050b6f9351027","tests/ui/pinned_drop/call-drop-inner.stderr":"c4998f39aa6a6d18941d0806b0ff693b9f2f0ec3a8056b678e2d78470926634c","tests/ui/pinned_drop/conditional-drop-impl.rs":"0b28c74213cee83e7b27223d7d37f903f79abd3dddcc0f969e14047674908085","tests/ui/pinned_drop/conditional-drop-impl.stderr":"8e416b2c01632c33cec611beb5ffb4817a50b15ad08ab9d0175ee45ba1311900"},"package":"8d31d11c69a6b52a174b42bdc0c30e5e11670f90788b2c471c31c1d17d449443"} \ 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 666dd6b91fe3..aaa107bbf302 100644 --- a/third_party/rust/pin-project-lite/CHANGELOG.md +++ b/third_party/rust/pin-project-lite/CHANGELOG.md @@ -10,6 +10,10 @@ Note: In this file, do not use the hard wrap in the middle of a sentence for com ## [Unreleased] +## [0.2.7] - 2021-06-26 + +- [Support custom Drop implementation.](https://github.com/taiki-e/pin-project-lite/pull/25) See [#25](https://github.com/taiki-e/pin-project-lite/pull/25) for details. + ## [0.2.6] - 2021-03-04 - [Support item attributes in any order.](https://github.com/taiki-e/pin-project-lite/pull/57) @@ -184,7 +188,8 @@ 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.6...HEAD +[Unreleased]: https://github.com/taiki-e/pin-project-lite/compare/v0.2.7...HEAD +[0.2.7]: https://github.com/taiki-e/pin-project-lite/compare/v0.2.6...v0.2.7 [0.2.6]: https://github.com/taiki-e/pin-project-lite/compare/v0.2.5...v0.2.6 [0.2.5]: https://github.com/taiki-e/pin-project-lite/compare/v0.2.4...v0.2.5 [0.2.4]: https://github.com/taiki-e/pin-project-lite/compare/v0.2.3...v0.2.4 diff --git a/third_party/rust/pin-project-lite/Cargo.toml b/third_party/rust/pin-project-lite/Cargo.toml index b24f836741b6..fab9dbcf93f3 100644 --- a/third_party/rust/pin-project-lite/Cargo.toml +++ b/third_party/rust/pin-project-lite/Cargo.toml @@ -13,9 +13,9 @@ [package] edition = "2018" name = "pin-project-lite" -version = "0.2.6" +version = "0.2.7" authors = ["Taiki Endo "] -exclude = ["/.*", "/scripts"] +exclude = ["/.*", "/tools"] description = "A lightweight version of pin-project written with declarative macros.\n" documentation = "https://docs.rs/pin-project-lite" keywords = ["pin", "macros"] diff --git a/third_party/rust/pin-project-lite/README.md b/third_party/rust/pin-project-lite/README.md index fbdc9d1887e1..e185993b928c 100644 --- a/third_party/rust/pin-project-lite/README.md +++ b/third_party/rust/pin-project-lite/README.md @@ -100,10 +100,6 @@ 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 Drop implementation - -pin-project supports this by [`#[pinned_drop]`][pinned-drop]. - ### Different: No support for custom Unpin implementation pin-project supports this by [`UnsafeUnpin`][unsafe-unpin] and [`!Unpin`][not-unpin]. @@ -115,7 +111,6 @@ 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 [pin-project]: https://github.com/taiki-e/pin-project -[pinned-drop]: https://docs.rs/pin-project/1/pin_project/attr.pin_project.html#pinned_drop [unsafe-unpin]: https://docs.rs/pin-project/1/pin_project/attr.pin_project.html#unsafeunpin ## License diff --git a/third_party/rust/pin-project-lite/src/lib.rs b/third_party/rust/pin-project-lite/src/lib.rs index 86163919f671..9b69e64f22f4 100644 --- a/third_party/rust/pin-project-lite/src/lib.rs +++ b/third_party/rust/pin-project-lite/src/lib.rs @@ -82,10 +82,6 @@ //! error you can pass the same input to [pin-project] to receive a helpful //! description of the compile error. //! -//! ## Different: No support for custom Drop implementation -//! -//! pin-project supports this by [`#[pinned_drop]`][pinned-drop]. -//! //! ## Different: No support for custom Unpin implementation //! //! pin-project supports this by [`UnsafeUnpin`][unsafe-unpin] and [`!Unpin`][not-unpin]. @@ -96,7 +92,6 @@ //! //! [not-unpin]: https://docs.rs/pin-project/1/pin_project/attr.pin_project.html#unpin //! [pin-project]: https://github.com/taiki-e/pin-project -//! [pinned-drop]: https://docs.rs/pin-project/1/pin_project/attr.pin_project.html#pinned_drop //! [unsafe-unpin]: https://docs.rs/pin-project/1/pin_project/attr.pin_project.html#unsafeunpin #![no_std] @@ -108,7 +103,7 @@ ) ))] #![warn(future_incompatible, rust_2018_idioms, single_use_lifetimes, unreachable_pub)] -#![warn(clippy::all, clippy::default_trait_access)] +#![warn(clippy::default_trait_access, clippy::wildcard_imports)] /// A macro that creates a projection type covering all the fields of struct. /// @@ -331,6 +326,7 @@ macro_rules! __pin_project_internal { $field_vis:vis $field:ident: $field_ty:ty ),+ } + $(impl $($pinned_drop:tt)*)? ) => { $(#[$attrs])* $vis struct $ident $($def_generics)* @@ -374,6 +370,7 @@ macro_rules! __pin_project_internal { [make_proj_field_replace] [$ident] [$($impl_generics)*] [$($ty_generics)*] [$(where $($where_clause)*)?] + [$(impl $($pinned_drop)*)?] { $( $(#[$pin])? @@ -422,6 +419,7 @@ macro_rules! __pin_project_internal { [make_proj_field_replace] [$ident] [$($impl_generics)*] [$($ty_generics)*] [$(where $($where_clause)*)?] + [$(impl $($pinned_drop)*)?] { $( $(#[$pin])? @@ -484,6 +482,7 @@ macro_rules! __pin_project_internal { $crate::__pin_project_internal! { @make_drop_impl; [$ident] [$($impl_generics)*] [$($ty_generics)*] [$(where $($where_clause)*)?] + $(impl $($pinned_drop)*)? } // Ensure that it's impossible to use pin projections on a #[repr(packed)] struct. @@ -538,6 +537,7 @@ macro_rules! __pin_project_internal { })? ),+ } + $(impl $($pinned_drop:tt)*)? ) => { $(#[$attrs])* $vis enum $ident $($def_generics)* @@ -594,6 +594,7 @@ macro_rules! __pin_project_internal { [make_proj_field_replace] [$ident] [$($impl_generics)*] [$($ty_generics)*] [$(where $($where_clause)*)?] + [$(impl $($pinned_drop)*)?] { $( $variant $({ @@ -682,6 +683,7 @@ macro_rules! __pin_project_internal { $crate::__pin_project_internal! { @make_drop_impl; [$ident] [$($impl_generics)*] [$($ty_generics)*] [$(where $($where_clause)*)?] + $(impl $($pinned_drop)*)? } // We don't need to check for '#[repr(packed)]', @@ -765,6 +767,7 @@ macro_rules! __pin_project_internal { [$make_proj_field:ident] [$ident:ident] [$($impl_generics:tt)*] [$($ty_generics:tt)*] [$(where $($where_clause:tt)* )?] + [$(impl $($pinned_drop:tt)*)?] $($field:tt)* ) => {}; (@struct=>make_proj_replace_ty=>unnamed; @@ -773,15 +776,16 @@ macro_rules! __pin_project_internal { [$make_proj_field:ident] [$ident:ident] [$($impl_generics:tt)*] [$($ty_generics:tt)*] [$(where $($where_clause:tt)* )?] + [$(impl $($pinned_drop:tt)*)?] $($field:tt)* - ) => { - }; + ) => {}; (@struct=>make_proj_replace_ty=>named; [$proj_vis:vis] [$proj_ty_ident:ident] [$make_proj_field:ident] [$ident:ident] [$($impl_generics:tt)*] [$($ty_generics:tt)*] [$(where $($where_clause:tt)* )?] + [] { $( $(#[$pin:ident])? @@ -811,6 +815,7 @@ macro_rules! __pin_project_internal { [$make_proj_field:ident] [$ident:ident] [$($impl_generics:tt)*] [$($ty_generics:tt)*] [$(where $($where_clause:tt)* )?] + [$(impl $($pinned_drop:tt)*)?] $($field:tt)* ) => {}; // ============================================================================================= @@ -872,6 +877,7 @@ macro_rules! __pin_project_internal { [$make_proj_field:ident] [$ident:ident] [$($impl_generics:tt)*] [$($ty_generics:tt)*] [$(where $($where_clause:tt)* )?] + [] { $( $variant:ident $({ @@ -909,6 +915,7 @@ macro_rules! __pin_project_internal { [$make_proj_field:ident] [$ident:ident] [$($impl_generics:tt)*] [$($ty_generics:tt)*] [$(where $($where_clause:tt)* )?] + [$(impl $($pinned_drop:tt)*)?] $($variant:tt)* ) => {}; @@ -1164,11 +1171,11 @@ macro_rules! __pin_project_internal { // this will become a lint, rather then a hard error. // // As a workaround for this, we generate a new struct, containing all of the pinned - // fields from our #[pin_project] type. This struct is delcared within + // fields from our #[pin_project] type. This struct is declared within // a function, which makes it impossible to be named by user code. - // This guarnatees that it will use the default auto-trait impl for Unpin - + // This guarantees that it will use the default auto-trait impl for Unpin - // that is, it will implement Unpin iff all of its fields implement Unpin. - // This type can be safely declared as 'public', satisfiying the privacy + // This type can be safely declared as 'public', satisfying the privacy // checker without actually allowing user code to access it. // // This allows users to apply the #[pin_project] attribute to types @@ -1193,6 +1200,90 @@ macro_rules! __pin_project_internal { // ============================================================================================= // make_drop_impl + (@make_drop_impl; + [$_ident:ident] + [$($_impl_generics:tt)*] [$($_ty_generics:tt)*] [$(where $($_where_clause:tt)* )?] + impl $(< + $( $lifetime:lifetime $(: $lifetime_bound:lifetime)? ),* $(,)? + $( $generics:ident + $(: $generics_bound:path)? + $(: ?$generics_unsized_bound:path)? + $(: $generics_lifetime_bound:lifetime)? + ),* + >)? PinnedDrop for $self_ty:ty + $(where + $( $where_clause_ty:ty + $(: $where_clause_bound:path)? + $(: ?$where_clause_unsized_bound:path)? + $(: $where_clause_lifetime_bound:lifetime)? + ),* + )? + { + fn drop($($arg:ident)+: Pin<&mut Self>) { + $($tt:tt)* + } + } + ) => { + impl $(< + $( $lifetime $(: $lifetime_bound)? ,)* + $( $generics + $(: $generics_bound)? + $(: ?$generics_unsized_bound)? + $(: $generics_lifetime_bound)? + ),* + >)? $crate::__private::Drop for $self_ty + $(where + $( $where_clause_ty + $(: $where_clause_bound)? + $(: ?$where_clause_unsized_bound)? + $(: $where_clause_lifetime_bound)? + ),* + )? + { + 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 + // [double dropping is unsound](https://github.com/rust-lang/rust/pull/62360). + // + // `__drop_inner` is defined as a safe method, but this is fine since + // `__drop_inner` is not accessible by the users and we call `__drop_inner` only + // once. + // + // Users can implement [`Drop`] safely using `pin_project!` and can drop a + // type that implements `PinnedDrop` using the [`drop`] function safely. + fn __drop_inner $(< + $( $lifetime $(: $lifetime_bound)? ,)* + $( $generics + $(: $generics_bound)? + $(: ?$generics_unsized_bound)? + $(: $generics_lifetime_bound)? + ),* + >)? ( + $($arg)+: $crate::__private::Pin<&mut $self_ty>, + ) + $(where + $( $where_clause_ty + $(: $where_clause_bound)? + $(: ?$where_clause_unsized_bound)? + $(: $where_clause_lifetime_bound)? + ),* + )? + { + // A dummy `__drop_inner` function to prevent users call outer `__drop_inner`. + fn __drop_inner() {} + $($tt)* + } + + // Safety - we're in 'drop', so we know that 'self' will + // never move again. + let pinned_self: $crate::__private::Pin<&mut Self> + = unsafe { $crate::__private::Pin::new_unchecked(self) }; + // We call `__drop_inner` only once. Since `__DropInner::__drop_inner` + // is not accessible by the users, it is never called again. + __drop_inner(pinned_self); + } + } + }; (@make_drop_impl; [$ident:ident] [$($impl_generics:tt)*] [$($ty_generics:tt)*] [$(where $($where_clause:tt)* )?] @@ -1204,7 +1295,7 @@ macro_rules! __pin_project_internal { // the first blanked impl will not apply to it. This code // will compile, as there is only one impl of MustNotImplDrop for the user type // 2. The user type does impl Drop. This will make the blanket impl applicable, - // which will then comflict with the explicit MustNotImplDrop impl below. + // which will then conflict with the explicit MustNotImplDrop impl below. // This will result in a compilation error, which is exactly what we want. trait MustNotImplDrop {} #[allow(clippy::drop_bounds, drop_bounds)] @@ -1414,6 +1505,7 @@ macro_rules! __pin_project_internal { $field_vis:vis $field:ident: $field_ty:ty ),+ $(,)? } + $(impl $($pinned_drop:tt)*)? ) => { $crate::__pin_project_internal! { @struct=>internal; [$($proj_mut_ident)?] @@ -1450,6 +1542,7 @@ macro_rules! __pin_project_internal { $field_vis $field: $field_ty ),+ } + $(impl $($pinned_drop)*)? } }; ( @@ -1480,6 +1573,7 @@ macro_rules! __pin_project_internal { $field_vis:vis $field:ident: $field_ty:ty ),+ $(,)? } + $(impl $($pinned_drop:tt)*)? ) => { $crate::__pin_project_internal! { @struct=>internal; [$($proj_mut_ident)?] @@ -1516,6 +1610,7 @@ macro_rules! __pin_project_internal { $field_vis $field: $field_ty ),+ } + $(impl $($pinned_drop)*)? } }; // enum @@ -1552,6 +1647,7 @@ macro_rules! __pin_project_internal { })? ),+ $(,)? } + $(impl $($pinned_drop:tt)*)? ) => { $crate::__pin_project_internal! { @enum=>internal; [$($proj_mut_ident)?] @@ -1593,6 +1689,7 @@ macro_rules! __pin_project_internal { })? ),+ } + $(impl $($pinned_drop)*)? } }; ( @@ -1628,6 +1725,7 @@ macro_rules! __pin_project_internal { })? ),+ $(,)? } + $(impl $($pinned_drop:tt)*)? ) => { $crate::__pin_project_internal! { @enum=>internal; [$($proj_mut_ident)?] @@ -1669,6 +1767,7 @@ macro_rules! __pin_project_internal { })? ),+ } + $(impl $($pinned_drop)*)? } }; } diff --git a/third_party/rust/pin-project-lite/tests/compiletest.rs b/third_party/rust/pin-project-lite/tests/compiletest.rs index 77e913bc44ad..8970215e7d22 100644 --- a/third_party/rust/pin-project-lite/tests/compiletest.rs +++ b/third_party/rust/pin-project-lite/tests/compiletest.rs @@ -3,7 +3,7 @@ use std::env; -#[rustversion::attr(before(2020-12-03), ignore)] // Note: This date is commit-date and the day before the toolchain date. +#[rustversion::attr(before(2021-05-15), ignore)] // Note: This date is commit-date and the day before the toolchain date. #[test] fn ui() { if env::var_os("CI").is_none() { diff --git a/third_party/rust/pin-project-lite/tests/drop_order.rs b/third_party/rust/pin-project-lite/tests/drop_order.rs index 07120ccdb7f0..6e5deaf15464 100644 --- a/third_party/rust/pin-project-lite/tests/drop_order.rs +++ b/third_party/rust/pin-project-lite/tests/drop_order.rs @@ -129,7 +129,7 @@ fn project_replace_panic() { fn drop(&mut self) { *self.0 = true; if self.1 { - panic!() + panic!(); } } } 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 new file mode 100644 index 000000000000..665ff633865a --- /dev/null +++ b/third_party/rust/pin-project-lite/tests/expand/pinned_drop/enum.expanded.rs @@ -0,0 +1,95 @@ +use pin_project_lite::pin_project; +use std::pin::Pin; +enum Enum { + Struct { pinned: T, unpinned: U }, + Unit, +} +#[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, +} +#[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 { + 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, + } + } + } + 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, + } + } + } + } + #[allow(non_snake_case)] + struct __Origin<'__pin, T, U> { + __dummy_lifetime: ::pin_project_lite::__private::PhantomData<&'__pin ()>, + 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_project_lite::__private::Drop for Enum { + fn drop(&mut self) { + 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) }; + __drop_inner(pinned_self); + } + } +}; +fn main() {} 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 new file mode 100644 index 000000000000..1855cb7a1648 --- /dev/null +++ b/third_party/rust/pin-project-lite/tests/expand/pinned_drop/enum.rs @@ -0,0 +1,22 @@ +use pin_project_lite::pin_project; +use std::pin::Pin; + +pin_project! { + #[project = EnumProj] + #[project_ref = EnumProjRef] + enum Enum { + Struct { + #[pin] + pinned: T, + unpinned: U, + }, + Unit, + } + impl PinnedDrop for Enum { + fn drop(this: Pin<&mut Self>) { + let _ = this; + } + } +} + +fn main() {} 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 new file mode 100644 index 000000000000..5b82b7a19c2b --- /dev/null +++ b/third_party/rust/pin-project-lite/tests/expand/pinned_drop/struct.expanded.rs @@ -0,0 +1,92 @@ +use pin_project_lite::pin_project; +use std::pin::Pin; +struct Struct { + pinned: T, + unpinned: 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 _: () = { + #[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 Projection<'__pin, T, U> + where + Struct: '__pin, + { + pinned: ::pin_project_lite::__private::Pin<&'__pin mut (T)>, + unpinned: &'__pin mut (U), + } + #[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 ProjectionRef<'__pin, T, U> + where + Struct: '__pin, + { + pinned: ::pin_project_lite::__private::Pin<&'__pin (T)>, + unpinned: &'__pin (U), + } + impl Struct { + fn project<'__pin>( + self: ::pin_project_lite::__private::Pin<&'__pin mut Self>, + ) -> Projection<'__pin, T, U> { + unsafe { + let Self { pinned, unpinned } = self.get_unchecked_mut(); + Projection { + pinned: ::pin_project_lite::__private::Pin::new_unchecked(pinned), + unpinned: unpinned, + } + } + } + fn project_ref<'__pin>( + self: ::pin_project_lite::__private::Pin<&'__pin Self>, + ) -> ProjectionRef<'__pin, T, U> { + unsafe { + let Self { pinned, unpinned } = self.get_ref(); + ProjectionRef { + pinned: ::pin_project_lite::__private::Pin::new_unchecked(pinned), + unpinned: unpinned, + } + } + } + } + #[allow(non_snake_case)] + struct __Origin<'__pin, T, U> { + __dummy_lifetime: ::pin_project_lite::__private::PhantomData<&'__pin ()>, + 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_project_lite::__private::Drop for Struct { + fn drop(&mut self) { + 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) }; + __drop_inner(pinned_self); + } + } + #[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/pinned_drop/struct.rs b/third_party/rust/pin-project-lite/tests/expand/pinned_drop/struct.rs new file mode 100644 index 000000000000..0cc7567690f8 --- /dev/null +++ b/third_party/rust/pin-project-lite/tests/expand/pinned_drop/struct.rs @@ -0,0 +1,17 @@ +use pin_project_lite::pin_project; +use std::pin::Pin; + +pin_project! { + struct Struct { + #[pin] + pinned: T, + unpinned: U, + } + impl PinnedDrop for Struct { + fn drop(this: Pin<&mut Self>) { + let _ = this; + } + } +} + +fn main() {} diff --git a/third_party/rust/pin-project-lite/tests/expandtest.rs b/third_party/rust/pin-project-lite/tests/expandtest.rs index adf8dde40e86..3f0d5c11214a 100644 --- a/third_party/rust/pin-project-lite/tests/expandtest.rs +++ b/third_party/rust/pin-project-lite/tests/expandtest.rs @@ -6,6 +6,8 @@ use std::{ process::{Command, ExitStatus, Stdio}, }; +const PATH: &str = "tests/expand/**/*.rs"; + #[rustversion::attr(not(nightly), ignore)] #[test] fn expandtest() { @@ -13,17 +15,17 @@ fn expandtest() { let cargo = &*env::var("CARGO").unwrap_or_else(|_| "cargo".into()); if !has_command(&[cargo, "expand"]) || !has_command(&[cargo, "fmt"]) { if is_ci { - panic!("expandtest requires rustfmt and cargo-expand") + panic!("expandtest requires rustfmt and cargo-expand"); } return; } - let path = "tests/expand/*/*.rs"; + let args = &["--all-features"]; if is_ci { - macrotest::expand_without_refresh(path); + macrotest::expand_without_refresh_args(PATH, args); } else { env::set_var("MACROTEST", "overwrite"); - macrotest::expand(path); + macrotest::expand_args(PATH, args); } } diff --git a/third_party/rust/pin-project-lite/tests/lint.rs b/third_party/rust/pin-project-lite/tests/lint.rs index 381bb18cc80a..2324cd5fd75e 100644 --- a/third_party/rust/pin-project-lite/tests/lint.rs +++ b/third_party/rust/pin-project-lite/tests/lint.rs @@ -1,48 +1,44 @@ -#![forbid(unsafe_code)] -#![warn(nonstandard_style, rust_2018_idioms, rustdoc, unused)] +// Check interoperability with rustc and clippy 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)] +#![forbid(future_incompatible)] #![allow(unknown_lints)] // for old compilers +#![forbid(unsafe_code)] #![warn( box_pointers, deprecated_in_future, - disjoint_capture_drop_reorder, - elided_lifetimes_in_paths, - explicit_outlives_requirements, + disjoint_capture_migration, macro_use_extern_crate, meta_variable_misuse, missing_abi, missing_copy_implementations, - missing_crate_level_docs, missing_debug_implementations, missing_docs, non_ascii_idents, + noop_method_call, single_use_lifetimes, trivial_casts, trivial_numeric_casts, - unaligned_references, unreachable_pub, - unused_extern_crates, unused_import_braces, unused_lifetimes, unused_qualifications, unused_results, variant_size_differences )] -// absolute_paths_not_starting_with_crate, anonymous_parameters, keyword_idents, pointer_structural_match, semicolon_in_expressions_from_macros: forbidden as a part of future_incompatible -// missing_doc_code_examples, private_doc_tests, invalid_html_tags: warned as a part of rustdoc -// unsafe_block_in_unsafe_fn: unstable -// unsafe_code: forbidden -// unstable_features: deprecated: https://doc.rust-lang.org/beta/rustc/lints/listing/allowed-by-default.html#unstable-features +// rust_2018_compatibility, rust_2021_compatibility, absolute_paths_not_starting_with_crate, etc.: forbidden as a part of future_incompatible +// elided_lifetimes_in_paths, explicit_outlives_requirements, unused_extern_crates: warned as a part of rust_2018_idioms +// unsafe_block_in_unsafe_fn: unsafe_block_in_unsafe_fn: requires Rust 1.52. and, we don't generate unsafe fn. +// unstable_features: no way to generate #![feature(..)] by macros, expect for unstable inner attribute. and this lint is deprecated: https://doc.rust-lang.org/rustc/lints/listing/allowed-by-default.html#unstable-features // unused_crate_dependencies: unrelated +// unsafe_code: forbidden #![warn(clippy::all, clippy::pedantic, clippy::nursery)] #![warn(clippy::restriction)] #![allow(clippy::blanket_clippy_restriction_lints)] // this is a test, so enable all restriction lints intentionally. #![allow(clippy::exhaustive_structs, clippy::exhaustive_enums)] // TODO -// Check interoperability with rustc and clippy lints. - pub mod basic { include!("include/basic.rs"); } diff --git a/third_party/rust/pin-project-lite/tests/test.rs b/third_party/rust/pin-project-lite/tests/test.rs index d792bab46cf0..162fc20bc16f 100644 --- a/third_party/rust/pin-project-lite/tests/test.rs +++ b/third_party/rust/pin-project-lite/tests/test.rs @@ -52,7 +52,7 @@ fn projection() { { let StructProjReplace { f1: PhantomData, f2 } = - s.as_mut().project_replace(Default::default()); + s.as_mut().project_replace(Struct::default()); assert_eq!(f2, 2); let StructProj { f1, f2 } = s.project(); assert_eq!(*f1, 0); @@ -633,3 +633,36 @@ fn attrs() { } } } + +#[test] +fn pinned_drop() { + pin_project! { + pub struct Struct1<'a> { + was_dropped: &'a mut bool, + #[pin] + field: u8, + } + impl PinnedDrop for Struct1<'_> { + fn drop(this: Pin<&mut Self>) { + **this.project().was_dropped = true; + } + } + } + + let mut was_dropped = false; + drop(Struct1 { was_dropped: &mut was_dropped, field: 42 }); + assert!(was_dropped); + + pin_project! { + pub struct Struct2<'a> { + was_dropped: &'a mut bool, + #[pin] + field: u8, + } + impl PinnedDrop for Struct2<'_> { + 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.stderr b/third_party/rust/pin-project-lite/tests/ui/pin_project/conflict-drop.stderr index f97c92b6739a..bbfc9106ebfa 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,4 +1,4 @@ -error[E0119]: conflicting implementations of trait `_::MustNotImplDrop` for type `Foo<_, _>`: +error[E0119]: conflicting implementations of trait `_::MustNotImplDrop` for type `Foo<_, _>` --> $DIR/conflict-drop.rs:3:1 | 3 | / pin_project! { //~ ERROR E0119 @@ -13,4 +13,4 @@ error[E0119]: conflicting implementations of trait `_::MustNotImplDrop` for type | |_first implementation here | conflicting implementation for `Foo<_, _>` | - = note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info) + = note: this error originates in the macro `$crate::__pin_project_internal` (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.stderr b/third_party/rust/pin-project-lite/tests/ui/pin_project/conflict-unpin.stderr index 546dafdbbe03..18bdd9288be5 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,4 +1,4 @@ -error[E0119]: conflicting implementations of trait `std::marker::Unpin` for type `Foo<_, _>`: +error[E0119]: conflicting implementations of trait `std::marker::Unpin` for type `Foo<_, _>` --> $DIR/conflict-unpin.rs:5:1 | 5 | / pin_project! { //~ ERROR E0119 @@ -13,9 +13,9 @@ error[E0119]: conflicting implementations of trait `std::marker::Unpin` for type 14 | impl Unpin for Foo where T: Unpin {} // Conditional Unpin impl | --------------------------------------------- first implementation here | - = note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info) + = note: this error originates in the macro `$crate::__pin_project_internal` (in Nightly builds, run with -Z macro-backtrace for more info) -error[E0119]: conflicting implementations of trait `std::marker::Unpin` for type `Bar<_, _>`: +error[E0119]: conflicting implementations of trait `std::marker::Unpin` for type `Bar<_, _>` --> $DIR/conflict-unpin.rs:18:1 | 18 | / pin_project! { //~ ERROR E0119 @@ -30,9 +30,9 @@ error[E0119]: conflicting implementations of trait `std::marker::Unpin` for type 27 | impl Unpin for Bar {} // Non-conditional Unpin impl | ------------------------------ first implementation here | - = note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info) + = note: this error originates in the macro `$crate::__pin_project_internal` (in Nightly builds, run with -Z macro-backtrace for more info) -error[E0119]: conflicting implementations of trait `std::marker::Unpin` for type `Baz<_, _>`: +error[E0119]: conflicting implementations of trait `std::marker::Unpin` for type `Baz<_, _>` --> $DIR/conflict-unpin.rs:29:1 | 29 | / pin_project! { //~ ERROR E0119 @@ -47,4 +47,4 @@ error[E0119]: conflicting implementations of trait `std::marker::Unpin` for type 38 | impl Unpin for Baz {} // Conditional Unpin impl | -------------------------------------------- first implementation here | - = note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info) + = note: this error originates in the macro `$crate::__pin_project_internal` (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.stderr b/third_party/rust/pin-project-lite/tests/ui/pin_project/invalid-bounds.stderr index a565cce97836..b27698915d79 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 @@ -8,7 +8,7 @@ error: no rules expected the token `[` 7 | | } | |_^ no rules expected this token in macro call | - = note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info) + = note: this error originates in the macro `pin_project` (in Nightly builds, run with -Z macro-backtrace for more info) error: no rules expected the token `[` --> $DIR/invalid-bounds.rs:9:1 @@ -20,7 +20,7 @@ error: no rules expected the token `[` 13 | | } | |_^ no rules expected this token in macro call | - = note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info) + = note: this error originates in the macro `pin_project` (in Nightly builds, run with -Z macro-backtrace for more info) error: expected one of `+`, `,`, `=`, or `>`, found `:` --> $DIR/invalid-bounds.rs:15:1 @@ -36,7 +36,7 @@ error: expected one of `+`, `,`, `=`, or `>`, found `:` | |_unexpected token | in this macro invocation | - = note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info) + = note: this error originates in the macro `$crate::__pin_project_internal` (in Nightly builds, run with -Z macro-backtrace for more info) error: expected one of `+`, `,`, `=`, or `>`, found `:` --> $DIR/invalid-bounds.rs:21:1 @@ -52,7 +52,7 @@ error: expected one of `+`, `,`, `=`, or `>`, found `:` | |_unexpected token | in this macro invocation | - = note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info) + = note: this error originates in the macro `$crate::__pin_project_internal` (in Nightly builds, run with -Z macro-backtrace for more info) error: expected one of `+`, `,`, `=`, or `>`, found `:` --> $DIR/invalid-bounds.rs:27:1 @@ -68,7 +68,7 @@ error: expected one of `+`, `,`, `=`, or `>`, found `:` | |_unexpected token | in this macro invocation | - = note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info) + = note: this error originates in the macro `$crate::__pin_project_internal` (in Nightly builds, run with -Z macro-backtrace for more info) error: no rules expected the token `[` --> $DIR/invalid-bounds.rs:33:1 @@ -80,7 +80,7 @@ error: no rules expected the token `[` 37 | | } | |_^ no rules expected this token in macro call | - = note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info) + = note: this error originates in the macro `pin_project` (in Nightly builds, run with -Z macro-backtrace for more info) error: no rules expected the token `[` --> $DIR/invalid-bounds.rs:39:1 @@ -94,7 +94,7 @@ error: no rules expected the token `[` 46 | | } | |_^ no rules expected this token in macro call | - = note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info) + = note: this error originates in the macro `pin_project` (in Nightly builds, run with -Z macro-backtrace for more info) error: no rules expected the token `[` --> $DIR/invalid-bounds.rs:48:1 @@ -108,7 +108,7 @@ error: no rules expected the token `[` 55 | | } | |_^ no rules expected this token in macro call | - = note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info) + = note: this error originates in the macro `pin_project` (in Nightly builds, run with -Z macro-backtrace for more info) error: expected `where`, or `{` after struct name, found `:` --> $DIR/invalid-bounds.rs:57:1 @@ -125,7 +125,7 @@ error: expected `where`, or `{` after struct name, found `:` | |_expected `where`, or `{` after struct name | in this macro invocation | - = note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info) + = note: this error originates in the macro `$crate::__pin_project_internal` (in Nightly builds, run with -Z macro-backtrace for more info) error: expected `where`, or `{` after struct name, found `:` --> $DIR/invalid-bounds.rs:66:1 @@ -142,7 +142,7 @@ error: expected `where`, or `{` after struct name, found `:` | |_expected `where`, or `{` after struct name | in this macro invocation | - = note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info) + = note: this error originates in the macro `$crate::__pin_project_internal` (in Nightly builds, run with -Z macro-backtrace for more info) error: expected `where`, or `{` after struct name, found `:` --> $DIR/invalid-bounds.rs:75:1 @@ -159,7 +159,7 @@ error: expected `where`, or `{` after struct name, found `:` | |_expected `where`, or `{` after struct name | in this macro invocation | - = note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info) + = note: this error originates in the macro `$crate::__pin_project_internal` (in Nightly builds, run with -Z macro-backtrace for more info) error: no rules expected the token `[` --> $DIR/invalid-bounds.rs:84:1 @@ -173,4 +173,4 @@ error: no rules expected the token `[` 91 | | } | |_^ no rules expected this token in macro call | - = note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info) + = note: this error originates in 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.stderr b/third_party/rust/pin-project-lite/tests/ui/pin_project/invalid.stderr index 06f2d79e1a2c..38df5178d55a 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 @@ -9,7 +9,7 @@ error: no rules expected the token `[` 8 | | } | |_^ no rules expected this token in macro call | - = note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info) + = note: this error originates in the macro `pin_project` (in Nightly builds, run with -Z macro-backtrace for more info) error: no rules expected the token `[` --> $DIR/invalid.rs:17:1 @@ -23,7 +23,7 @@ error: no rules expected the token `[` 23 | | } | |_^ no rules expected this token in macro call | - = note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info) + = note: this error originates in the macro `pin_project` (in Nightly builds, run with -Z macro-backtrace for more info) error: cannot find attribute `pin` in this scope --> $DIR/invalid.rs:11:7 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 87a737e2fa1d..117c18d74c4d 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,7 +1,7 @@ use pin_project_lite::pin_project; -pin_project! { //~ ERROR E0496 - pub struct Foo<'__pin, T> { //~ ERROR E0263 +pin_project! { //~ ERROR E0263,E0496 + pub struct Foo<'__pin, T> { #[pin] field: &'__pin mut T, } 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 8a9bb4fc91b1..f87875d87633 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,8 +1,44 @@ +error[E0263]: lifetime name `'__pin` declared twice in the same scope + --> $DIR/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 + --> $DIR/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 + --> $DIR/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[E0496]: lifetime name `'__pin` shadows a lifetime name that is already in scope --> $DIR/overlapping_lifetime_names.rs:3:1 | -3 | / pin_project! { //~ ERROR E0496 -4 | | pub struct Foo<'__pin, T> { //~ ERROR E0263 +3 | / pin_project! { //~ ERROR E0263,E0496 +4 | | pub struct Foo<'__pin, T> { | | ------ first declared here 5 | | #[pin] 6 | | field: &'__pin mut T, @@ -10,13 +46,13 @@ error[E0496]: lifetime name `'__pin` shadows a lifetime name that is already in 8 | | } | |_^ lifetime `'__pin` already in scope | - = note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info) + = note: this error originates in the macro `$crate::__pin_project_internal` (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 --> $DIR/overlapping_lifetime_names.rs:3:1 | -3 | / pin_project! { //~ ERROR E0496 -4 | | pub struct Foo<'__pin, T> { //~ ERROR E0263 +3 | / pin_project! { //~ ERROR E0263,E0496 +4 | | pub struct Foo<'__pin, T> { | | ------ first declared here 5 | | #[pin] 6 | | field: &'__pin mut T, @@ -24,49 +60,13 @@ error[E0496]: lifetime name `'__pin` shadows a lifetime name that is already in 8 | | } | |_^ lifetime `'__pin` already in scope | - = note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info) + = note: this error originates in the macro `$crate::__pin_project_internal` (in Nightly builds, run with -Z macro-backtrace for more info) error[E0263]: lifetime name `'__pin` declared twice in the same scope --> $DIR/overlapping_lifetime_names.rs:4:20 | -3 | / pin_project! { //~ ERROR E0496 -4 | | pub struct Foo<'__pin, T> { //~ ERROR E0263 - | | ^^^^^^ 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 - --> $DIR/overlapping_lifetime_names.rs:4:20 - | -3 | / pin_project! { //~ ERROR E0496 -4 | | pub struct Foo<'__pin, T> { //~ ERROR E0263 - | | ^^^^^^ 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 - --> $DIR/overlapping_lifetime_names.rs:4:20 - | -3 | / pin_project! { //~ ERROR E0496 -4 | | pub struct Foo<'__pin, T> { //~ ERROR E0263 - | | ^^^^^^ 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 - --> $DIR/overlapping_lifetime_names.rs:4:20 - | -3 | / pin_project! { //~ ERROR E0496 -4 | | pub struct Foo<'__pin, T> { //~ ERROR E0263 +3 | / pin_project! { //~ ERROR E0263,E0496 +4 | | pub struct Foo<'__pin, T> { | | ^^^^^^ declared twice 5 | | #[pin] 6 | | field: &'__pin mut T, 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 13385243073f..25131d17d1bd 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,6 +1,7 @@ -use pin_project_lite::pin_project; use std::marker::PhantomPinned; +use pin_project_lite::pin_project; + pin_project! { struct Foo { #[pin] 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 ab76f81d9bdf..9486f9d1fffa 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,11 +1,22 @@ error[E0277]: `PhantomPinned` cannot be unpinned - --> $DIR/overlapping_unpin_struct.rs:18:5 + --> $DIR/overlapping_unpin_struct.rs:19:5 | -15 | fn is_unpin() {} +16 | fn is_unpin() {} | ----- required by this bound in `is_unpin` ... -18 | is_unpin::>(); //~ ERROR E0277 +19 | is_unpin::>(); //~ ERROR E0277 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ within `_::__Origin<'_, PhantomPinned>`, the trait `Unpin` is not implemented for `PhantomPinned` | - = note: required because it appears within the type `_::__Origin<'_, PhantomPinned>` + = note: consider using `Box::pin` +note: required because it appears within the type `_::__Origin<'_, PhantomPinned>` + --> $DIR/overlapping_unpin_struct.rs:5:1 + | +5 | / pin_project! { +6 | | struct Foo { +7 | | #[pin] +8 | | inner: T, +9 | | } +10 | | } + | |_^ = note: required because of the requirements on the impl of `Unpin` for `Foo` + = note: this error originates in the macro `$crate::__pin_project_internal` (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 507a0385fb16..50afb118c888 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,3 +1,5 @@ +#![allow(unaligned_references)] + use pin_project_lite::pin_project; pin_project! { //~ ERROR reference to packed field is unaligned 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 14ffc86d4244..85f84c21fc2b 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,107 +1,55 @@ error: reference to packed field is unaligned - --> $DIR/packed.rs:3:1 - | -3 | / pin_project! { //~ ERROR reference to packed field is unaligned -4 | | #[repr(packed, C)] -5 | | struct Packed { -6 | | #[pin] -7 | | field: u16, -8 | | } -9 | | } - | |_^ - | -note: the lint level is defined here - --> $DIR/packed.rs:3:1 - | -3 | / pin_project! { //~ ERROR reference to packed field is unaligned -4 | | #[repr(packed, C)] -5 | | struct Packed { -6 | | #[pin] -7 | | field: u16, -8 | | } -9 | | } - | |_^ - = note: fields of packed structs are not properly aligned, and creating a misaligned reference is undefined behavior (even if that reference is never dereferenced) - = note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info) - -error: reference to packed field is unaligned - --> $DIR/packed.rs:11:1 + --> $DIR/packed.rs:5:1 | -11 | / pin_project! { //~ ERROR reference to packed field is unaligned -12 | | #[repr(packed(2))] -13 | | struct PackedN { -14 | | #[pin] -15 | | field: u32, -16 | | } -17 | | } +5 | / pin_project! { //~ ERROR reference to packed field is unaligned +6 | | #[repr(packed, C)] +7 | | struct Packed { +8 | | #[pin] +9 | | field: u16, +10 | | } +11 | | } | |_^ | note: the lint level is defined here - --> $DIR/packed.rs:11:1 + --> $DIR/packed.rs:5:1 | -11 | / pin_project! { //~ ERROR reference to packed field is unaligned -12 | | #[repr(packed(2))] -13 | | struct PackedN { -14 | | #[pin] -15 | | field: u32, -16 | | } -17 | | } - | |_^ - = 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: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info) - -error: borrow of packed field is unsafe and requires unsafe function or block (error E0133) - --> $DIR/packed.rs:3:1 - | -3 | / pin_project! { //~ ERROR reference to packed field is unaligned -4 | | #[repr(packed, C)] -5 | | struct Packed { -6 | | #[pin] -7 | | field: u16, -8 | | } -9 | | } - | |_^ - | -note: the lint level is defined here - --> $DIR/packed.rs:3:1 - | -3 | / pin_project! { //~ ERROR reference to packed field is unaligned -4 | | #[repr(packed, C)] -5 | | struct Packed { -6 | | #[pin] -7 | | field: u16, -8 | | } -9 | | } - | |_^ - = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! - = note: for more information, see issue #46043 - = note: fields of packed structs might be misaligned: dereferencing a misaligned pointer or even just creating a misaligned reference is undefined behavior - = note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info) - -error: borrow of packed field is unsafe and requires unsafe function or block (error E0133) - --> $DIR/packed.rs:11:1 - | -11 | / pin_project! { //~ ERROR reference to packed field is unaligned -12 | | #[repr(packed(2))] -13 | | struct PackedN { -14 | | #[pin] -15 | | field: u32, -16 | | } -17 | | } - | |_^ - | -note: the lint level is defined here - --> $DIR/packed.rs:11:1 - | -11 | / pin_project! { //~ ERROR reference to packed field is unaligned -12 | | #[repr(packed(2))] -13 | | struct PackedN { -14 | | #[pin] -15 | | field: u32, -16 | | } -17 | | } +5 | / pin_project! { //~ ERROR reference to packed field is unaligned +6 | | #[repr(packed, C)] +7 | | struct Packed { +8 | | #[pin] +9 | | field: u16, +10 | | } +11 | | } | |_^ = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! - = note: for more information, see issue #46043 - = note: fields of packed structs might be misaligned: dereferencing a misaligned pointer or even just creating a misaligned reference is undefined behavior - = note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info) + = 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: this error originates in the macro `$crate::__pin_project_internal` (in Nightly builds, run with -Z macro-backtrace for more info) + +error: reference to packed field is unaligned + --> $DIR/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: the lint level is defined here + --> $DIR/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: this error originates in the macro `$crate::__pin_project_internal` (in Nightly builds, run with -Z macro-backtrace for more info) 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 2cd17df1ef7e..892e57c9000d 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 @@ -6,7 +6,7 @@ error: no rules expected the token `[` 5 | | } | |_^ no rules expected this token in macro call | - = note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info) + = note: this error originates in the macro `pin_project` (in Nightly builds, run with -Z macro-backtrace for more info) error: no rules expected the token `[` --> $DIR/unsupported.rs:7:1 @@ -16,7 +16,7 @@ error: no rules expected the token `[` 9 | | } | |_^ no rules expected this token in macro call | - = note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info) + = note: this error originates in the macro `pin_project` (in Nightly builds, run with -Z macro-backtrace for more info) error: no rules expected the token `[` --> $DIR/unsupported.rs:11:1 @@ -26,7 +26,7 @@ error: no rules expected the token `[` 13 | | } | |_^ no rules expected this token in macro call | - = note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info) + = note: this error originates in the macro `pin_project` (in Nightly builds, run with -Z macro-backtrace for more info) error: no rules expected the token `[` --> $DIR/unsupported.rs:15:1 @@ -38,7 +38,7 @@ error: no rules expected the token `[` 19 | | } | |_^ no rules expected this token in macro call | - = note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info) + = note: this error originates in the macro `pin_project` (in Nightly builds, run with -Z macro-backtrace for more info) error: no rules expected the token `[` --> $DIR/unsupported.rs:21:1 @@ -50,4 +50,4 @@ error: no rules expected the token `[` 25 | | } | |_^ no rules expected this token in macro call | - = note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info) + = note: this error originates in 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 new file mode 100644 index 000000000000..609b3bebad07 --- /dev/null +++ b/third_party/rust/pin-project-lite/tests/ui/pinned_drop/call-drop-inner.rs @@ -0,0 +1,17 @@ +use pin_project_lite::pin_project; + +pin_project! { + pub struct S { + #[pin] + field: u8, + } + impl PinnedDrop for S { + fn drop(this: Pin<&mut Self>) { + __drop_inner(this); + } + } +} + +fn main() { + let _x = S { field: 0 }; +} 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 new file mode 100644 index 000000000000..576e417fd17c --- /dev/null +++ b/third_party/rust/pin-project-lite/tests/ui/pinned_drop/call-drop-inner.stderr @@ -0,0 +1,20 @@ +error[E0061]: this function takes 0 arguments but 1 argument was supplied + --> $DIR/call-drop-inner.rs:10:13 + | +10 | __drop_inner(this); + | ^^^^^^^^^^^^ ---- supplied 1 argument + | | + | expected 0 arguments + | +note: function defined here + --> $DIR/call-drop-inner.rs:3:1 + | +3 | / pin_project! { +4 | | pub struct S { +5 | | #[pin] +6 | | field: u8, +... | +12 | | } +13 | | } + | |_^ + = note: this error originates in the macro `$crate::__pin_project_internal` (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 new file mode 100644 index 000000000000..68b01b265ed3 --- /dev/null +++ b/third_party/rust/pin-project-lite/tests/ui/pinned_drop/conditional-drop-impl.rs @@ -0,0 +1,26 @@ +use pin_project_lite::pin_project; + +// In `Drop` impl, the implementor must specify the same requirement as type definition. + +struct DropImpl { + f: T, +} + +impl Drop for DropImpl { + //~^ ERROR E0367 + fn drop(&mut self) {} +} + +pin_project! { + //~^ ERROR E0367 + struct PinnedDropImpl { + #[pin] + f: T, + } + + impl PinnedDrop for PinnedDropImpl { + fn drop(_this: Pin<&mut Self>) {} + } +} + +fn main() {} 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 new file mode 100644 index 000000000000..a67bc8d7a6f2 --- /dev/null +++ b/third_party/rust/pin-project-lite/tests/ui/pinned_drop/conditional-drop-impl.stderr @@ -0,0 +1,38 @@ +error[E0367]: `Drop` impl requires `T: Unpin` but the struct it is implemented for does not + --> $DIR/conditional-drop-impl.rs:9:9 + | +9 | impl Drop for DropImpl { + | ^^^^^ + | +note: the implementor must specify the same requirement + --> $DIR/conditional-drop-impl.rs:5:1 + | +5 | / struct DropImpl { +6 | | f: T, +7 | | } + | |_^ + +error[E0367]: `Drop` impl requires `T: Unpin` but the struct it is implemented for does not + --> $DIR/conditional-drop-impl.rs:14:1 + | +14 | / pin_project! { +15 | | //~^ ERROR E0367 +16 | | struct PinnedDropImpl { +17 | | #[pin] +... | +23 | | } +24 | | } + | |_^ + | +note: the implementor must specify the same requirement + --> $DIR/conditional-drop-impl.rs:14:1 + | +14 | / pin_project! { +15 | | //~^ ERROR E0367 +16 | | struct PinnedDropImpl { +17 | | #[pin] +... | +23 | | } +24 | | } + | |_^ + = note: this error originates in the macro `$crate::__pin_project_internal` (in Nightly builds, run with -Z macro-backtrace for more info) diff --git a/third_party/rust/pkg-config/.cargo-checksum.json b/third_party/rust/pkg-config/.cargo-checksum.json index 057ed9790eac..b2708748b637 100644 --- a/third_party/rust/pkg-config/.cargo-checksum.json +++ b/third_party/rust/pkg-config/.cargo-checksum.json @@ -1 +1 @@ -{"files":{"CHANGELOG.md":"76c3cdc468bd39843de5ed2e5d11cc2de3e2fa3cc099dd3137722105f94c8557","Cargo.toml":"a575e9c8b92c4b29fbf7bb4add0e77ec99464e3ae9248d42c5162e948ffa914d","LICENSE-APACHE":"a60eea817514531668d7e00765731449fe14d059d3249e0bc93b36de45f759f2","LICENSE-MIT":"378f5840b258e2779c39418f3f2d7b2ba96f1c7917dd6be0713f88305dbda397","README.md":"1e22446920533dea171fea3951cb4cf8db34bd4dd6414b688720410a9c414d3c","src/lib.rs":"cecbf5f9c982e21cba0391a4d73ad9aab10a0fbfcfcbb3bab4ecb05ee9467e32","tests/escape.pc":"00caa4136799dbe5bd504239ba90d1156c12def365c8d761da319fe8a83b398e","tests/foo.pc":"4a1c442c5d1c10761ea1644f8fd58f93cc5a706391bc67b04c243bbd35d70d79","tests/framework.pc":"304fdb6cea92973650e410ab1f70ce1ebeb7718af3f139e806efbf182acd565c","tests/test.rs":"5ed13fc28a1853d20d27798819a1228673cb1e57097951dbb892e51327a21adb"},"package":"3831453b3449ceb48b6d9c7ad7c96d5ea673e9b470a1dc578c2ce6521230884c"} \ No newline at end of file +{"files":{"CHANGELOG.md":"1c60eb6231812ffe4b276d94092d406e10cdf2cfb2f13005a11509b6fdd38d12","Cargo.toml":"301f08ce329cb75af34a9def9f93392db0d19ae62237e8ddb71e2ff0c0baf8d0","LICENSE-APACHE":"a60eea817514531668d7e00765731449fe14d059d3249e0bc93b36de45f759f2","LICENSE-MIT":"378f5840b258e2779c39418f3f2d7b2ba96f1c7917dd6be0713f88305dbda397","README.md":"37f11a56c969237dcfd15368e96bf686ec92b0254e38fb84636e178d632c0492","src/lib.rs":"da375f79b79233081a1cf0dfee29f71665fabad2ffaf1b9222a06eeb48f41831","tests/escape.pc":"00caa4136799dbe5bd504239ba90d1156c12def365c8d761da319fe8a83b398e","tests/foo.pc":"4a1c442c5d1c10761ea1644f8fd58f93cc5a706391bc67b04c243bbd35d70d79","tests/framework.pc":"304fdb6cea92973650e410ab1f70ce1ebeb7718af3f139e806efbf182acd565c","tests/test.rs":"5ed13fc28a1853d20d27798819a1228673cb1e57097951dbb892e51327a21adb"},"package":"d1a3ea4f0dd7f1f3e512cf97bf100819aa547f36a6eccac8dbaae839eb92363e"} \ No newline at end of file diff --git a/third_party/rust/pkg-config/CHANGELOG.md b/third_party/rust/pkg-config/CHANGELOG.md index 4a8e1883b49f..a2ab52c38a7a 100644 --- a/third_party/rust/pkg-config/CHANGELOG.md +++ b/third_party/rust/pkg-config/CHANGELOG.md @@ -2,8 +2,43 @@ All notable changes to this project will be documented in this file. -The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) -and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html). +The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/) +and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). + +## [0.3.23] - 2021-12-06 + +### Changed + +- Improve error messages when a `pkg-config` package can't be found (#127). + +## [0.3.22] - 2021-10-24 + +### Fixed + +- `pkg-config` compiles again with Rust 1.30 or newer. 0.3.21 accidentally + made use of API only available since 1.40 (#124, #125). + +### Changed + +- Switched from Travis to GitHub Actions for the CI. Travis is dysfunctional + since quite some time (#126). + +## [0.3.21] - 2021-10-22 + +### Fixed + +- Tests succeed again on macOS (#122). + +### Changed + +- Improve error message in case of missing pkg-config and provide instructions + how it can be installed (#121). + +## [0.3.20] - 2021-09-25 + +### Fixed + +- Use target-specific pkg-config consistently everywhere (#121, #118). ## [0.3.19] - 2020-10-13 diff --git a/third_party/rust/pkg-config/Cargo.toml b/third_party/rust/pkg-config/Cargo.toml index ef5a159b02a8..9b9ecbb9c686 100644 --- a/third_party/rust/pkg-config/Cargo.toml +++ b/third_party/rust/pkg-config/Cargo.toml @@ -3,16 +3,15 @@ # When uploading crates to the registry Cargo will automatically # "normalize" Cargo.toml files for maximal compatibility # with all versions of Cargo and also rewrite `path` dependencies -# to registry (e.g., crates.io) dependencies +# to registry (e.g., crates.io) dependencies. # -# If you believe there's an error in this file please file an -# issue against the rust-lang/cargo repository. If you're -# editing this file be aware that the upstream Cargo.toml -# will likely look very different (and much more reasonable) +# If you are reading this file be aware that the original Cargo.toml +# will likely look very different (and much more reasonable). +# See Cargo.toml.orig for the original contents. [package] name = "pkg-config" -version = "0.3.19" +version = "0.3.23" authors = ["Alex Crichton "] description = "A library to run the pkg-config system tool at build time in order to be used in\nCargo build scripts.\n" documentation = "https://docs.rs/pkg-config" diff --git a/third_party/rust/pkg-config/README.md b/third_party/rust/pkg-config/README.md index 3d8d2b04ccd3..61f1244c8dd0 100644 --- a/third_party/rust/pkg-config/README.md +++ b/third_party/rust/pkg-config/README.md @@ -1,6 +1,6 @@ # pkg-config-rs -[![Build Status](https://travis-ci.com/rust-lang/pkg-config-rs.svg?branch=master)](https://travis-ci.com/rust-lang/pkg-config-rs) +[![Build Status](https://github.com/rust-lang/pkg-config-rs/actions/workflows/ci.yml/badge.svg)](https://github.com/rust-lang/pkg-config-rs/actions) [![Rust](https://img.shields.io/badge/rust-1.30%2B-blue.svg?maxAge=3600)](https://github.com/rust-lang/pkg-config-rs/) [Documentation](https://docs.rs/pkg-config) @@ -10,7 +10,7 @@ order to use the system `pkg-config` tool (if available) to determine where a library is located. You can use this crate directly to probe for specific libraries, or use -[metadeps](https://github.com/joshtriplett/metadeps) to declare all your +[system-deps](https://github.com/gdesmott/system-deps) to declare all your `pkg-config` dependencies in `Cargo.toml`. This library requires Rust 1.30+. @@ -66,9 +66,9 @@ around for lack of cross-compilation support in `pkg-config`. This project is licensed under either of * Apache License, Version 2.0, ([LICENSE-APACHE](LICENSE-APACHE) or - http://www.apache.org/licenses/LICENSE-2.0) + https://www.apache.org/licenses/LICENSE-2.0) * MIT license ([LICENSE-MIT](LICENSE-MIT) or - http://opensource.org/licenses/MIT) + https://opensource.org/licenses/MIT) at your option. diff --git a/third_party/rust/pkg-config/src/lib.rs b/third_party/rust/pkg-config/src/lib.rs index d9574dc003c8..0eae62b14f5a 100644 --- a/third_party/rust/pkg-config/src/lib.rs +++ b/third_party/rust/pkg-config/src/lib.rs @@ -104,7 +104,6 @@ pub struct Library { } /// Represents all reasons `pkg-config` might not succeed or be run at all. -#[derive(Debug)] pub enum Error { /// Aborted because of `*_NO_PKG_CONFIG` environment variable. /// @@ -123,11 +122,20 @@ pub enum Error { /// Contains the command and the cause. Command { command: String, cause: io::Error }, - /// `pkg-config` did not exit sucessfully. + /// `pkg-config` did not exit sucessfully after probing a library. /// /// Contains the command and output. Failure { command: String, output: Output }, + /// `pkg-config` did not exit sucessfully on the first attempt to probe a library. + /// + /// Contains the command and output. + ProbeFailure { + name: String, + command: String, + output: Output, + }, + #[doc(hidden)] // please don't match on this, we're likely to add more variants over time __Nonexhaustive, @@ -135,46 +143,98 @@ pub enum Error { impl error::Error for Error {} +impl fmt::Debug for Error { + fn fmt(&self, f: &mut fmt::Formatter) -> Result<(), fmt::Error> { + // Failed `unwrap()` prints Debug representation, but the default debug format lacks helpful instructions for the end users + ::fmt(self, f) + } +} + impl fmt::Display for Error { fn fmt(&self, f: &mut fmt::Formatter) -> Result<(), fmt::Error> { match *self { Error::EnvNoPkgConfig(ref name) => write!(f, "Aborted because {} is set", name), Error::CrossCompilation => f.write_str( - "pkg-config has not been configured to support cross-compilation. - - Install a sysroot for the target platform and configure it via - PKG_CONFIG_SYSROOT_DIR and PKG_CONFIG_PATH, or install a - cross-compiling wrapper for pkg-config and set it via + "pkg-config has not been configured to support cross-compilation.\n\ + \n\ + Install a sysroot for the target platform and configure it via\n\ + PKG_CONFIG_SYSROOT_DIR and PKG_CONFIG_PATH, or install a\n\ + cross-compiling wrapper for pkg-config and set it via\n\ PKG_CONFIG environment variable.", ), Error::Command { ref command, ref cause, - } => write!(f, "Failed to run `{}`: {}", command, cause), + } => { + match cause.kind() { + io::ErrorKind::NotFound => { + let crate_name = + std::env::var("CARGO_PKG_NAME").unwrap_or_else(|_| "sys".to_owned()); + let instructions = if cfg!(target_os = "macos") || cfg!(target_os = "ios") { + "Try `brew install pkg-config` if you have Homebrew.\n" + } else if cfg!(unix) { + "Try `apt install pkg-config`, or `yum install pkg-config`,\n\ + or `pkg install pkg-config` depending on your distribution.\n" + } else { + "" // There's no easy fix for Windows users + }; + write!(f, "Could not run `{command}`\n\ + The pkg-config command could not be found.\n\ + \n\ + Most likely, you need to install a pkg-config package for your OS.\n\ + {instructions}\ + \n\ + If you've already installed it, ensure the pkg-config command is one of the\n\ + directories in the PATH environment variable.\n\ + \n\ + If you did not expect this build to link to a pre-installed system library,\n\ + then check documentation of the {crate_name} crate for an option to\n\ + build the library from source, or disable features or dependencies\n\ + that require pkg-config.", command = command, instructions = instructions, crate_name = crate_name) + } + _ => write!(f, "Failed to run command `{}`, because: {}", command, cause), + } + } + Error::ProbeFailure { + ref name, + ref command, + ref output, + } => { + write!( + f, + "`{}` did not exit successfully: {}\nerror: could not find system library '{}' required by the '{}' crate\n", + command, output.status, name, env::var("CARGO_PKG_NAME").unwrap_or_default(), + )?; + format_output(output, f) + } Error::Failure { ref command, ref output, } => { - let stdout = str::from_utf8(&output.stdout).unwrap(); - let stderr = str::from_utf8(&output.stderr).unwrap(); write!( f, "`{}` did not exit successfully: {}", command, output.status )?; - if !stdout.is_empty() { - write!(f, "\n--- stdout\n{}", stdout)?; - } - if !stderr.is_empty() { - write!(f, "\n--- stderr\n{}", stderr)?; - } - Ok(()) + format_output(output, f) } Error::__Nonexhaustive => panic!(), } } } +fn format_output(output: &Output, f: &mut fmt::Formatter) -> fmt::Result { + let stdout = String::from_utf8_lossy(&output.stdout); + if !stdout.is_empty() { + write!(f, "\n--- stdout\n{}", stdout)?; + } + let stderr = String::from_utf8_lossy(&output.stderr); + if !stderr.is_empty() { + write!(f, "\n--- stderr\n{}", stderr)?; + } + Ok(()) +} + /// Deprecated in favor of the probe_library function #[doc(hidden)] pub fn find_library(name: &str) -> Result { @@ -318,7 +378,14 @@ impl Config { let mut library = Library::new(); - let output = run(self.command(name, &["--libs", "--cflags"]))?; + let output = run(self.command(name, &["--libs", "--cflags"])).map_err(|e| match e { + Error::Failure { command, output } => Error::ProbeFailure { + name: name.to_owned(), + command, + output, + }, + other => other, + })?; library.parse_libs_cflags(name, &output, self); let output = run(self.command(name, &["--modversion"]))?; @@ -394,7 +461,7 @@ impl Config { fn command(&self, name: &str, args: &[&str]) -> Command { let exe = self - .env_var_os("PKG_CONFIG") + .targetted_env_var("PKG_CONFIG") .unwrap_or_else(|| OsString::from("pkg-config")); let mut cmd = Command::new(exe); if self.is_static(name) { @@ -677,23 +744,25 @@ fn split_flags(output: &[u8]) -> Vec { #[test] #[cfg(target_os = "macos")] fn system_library_mac_test() { + use std::path::Path; + let system_roots = vec![PathBuf::from("/Library"), PathBuf::from("/System")]; assert!(!is_static_available( "PluginManager", - system_roots, + &system_roots, &[PathBuf::from("/Library/Frameworks")] )); assert!(!is_static_available( "python2.7", - system_roots, + &system_roots, &[PathBuf::from( "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/config" )] )); assert!(!is_static_available( "ffi_convenience", - system_roots, + &system_roots, &[PathBuf::from( "/Library/Ruby/Gems/2.0.0/gems/ffi-1.9.10/ext/ffi_c/libffi-x86_64/.libs" )] @@ -703,7 +772,7 @@ fn system_library_mac_test() { if Path::new("/usr/local/lib/libpng16.a").exists() { assert!(is_static_available( "png16", - system_roots, + &system_roots, &[PathBuf::from("/usr/local/lib")] )); diff --git a/third_party/rust/ppv-lite86/.cargo-checksum.json b/third_party/rust/ppv-lite86/.cargo-checksum.json index b4ea624071ad..30d373cfaf4b 100644 --- a/third_party/rust/ppv-lite86/.cargo-checksum.json +++ b/third_party/rust/ppv-lite86/.cargo-checksum.json @@ -1 +1 @@ -{"files":{"Cargo.toml":"5d9b7092f252e3a6f7f50f6aeb1b873803b322cf5edbf0ae07e0a27d57df3fbf","LICENSE-APACHE":"0218327e7a480793ffdd4eb792379a9709e5c135c7ba267f709d6f6d4d70af0a","LICENSE-MIT":"4cada0bd02ea3692eee6f16400d86c6508bbd3bafb2b65fed0419f36d4f83e8f","src/generic.rs":"6f38250421846499c816c222d0b48155bfab09a9921e6c400d7b75567ab98f14","src/lib.rs":"bcf308d7037e259d6640a785556fcdb86653cb4f72f64fbfeda9899857c14479","src/soft.rs":"5cdee0e46c99a9d5078c0b3a733fe6fd1430ed0a888ef747bc2a1271265a1140","src/types.rs":"a354d2e3267c7c451a1420903314a358328346772ca964fa6c1ef7b96c983930","src/x86_64/mod.rs":"4d5a1da816f8e59bb385464f005075de889d1060e24dcee6709b321a3d6c92f7","src/x86_64/sse2.rs":"a9df3e7b3b8ffcd249a2cbed0e538042f7747dfa6ae7af0c9af364dc5a12d409"},"package":"ac74c624d6b2d21f425f752262f42188365d7b8ff1aff74c82e45136510a4857"} \ No newline at end of file +{"files":{"Cargo.toml":"a3b4c03b3b8faad8965a6177b8d10d005aaf72dba4e0460f7e4602da15f63bc2","LICENSE-APACHE":"0218327e7a480793ffdd4eb792379a9709e5c135c7ba267f709d6f6d4d70af0a","LICENSE-MIT":"4cada0bd02ea3692eee6f16400d86c6508bbd3bafb2b65fed0419f36d4f83e8f","src/generic.rs":"3fcf342f83e6410abb7be6b2e8cf7e0673c872d53ace794eaabd12929489beea","src/lib.rs":"bcf308d7037e259d6640a785556fcdb86653cb4f72f64fbfeda9899857c14479","src/soft.rs":"4cc23fa9451ea44a4e3c492c66627dae6008746aab6d5290712ecc66846f2ea0","src/types.rs":"d51ea12b78b771ce3823b4fd23b1df125f4719d2e3ac63c842813b0cfc6cdb8b","src/x86_64/mod.rs":"e868eab93b96df599667c6e5de0f253946aed691bc39ee4c4f8ed72a758105d9","src/x86_64/sse2.rs":"5d958d134fcb0a4a264aadc51abddc24baeeaef41ae9b36bd49d6ab8dcff5d2c"},"package":"ed0cfbc8191465bed66e1718596ee0b0b35d5ee1f41c5df2189d0fe8bde535ba"} \ No newline at end of file diff --git a/third_party/rust/ppv-lite86/Cargo.toml b/third_party/rust/ppv-lite86/Cargo.toml index 6ffa7bab2ad8..580b8a27573e 100644 --- a/third_party/rust/ppv-lite86/Cargo.toml +++ b/third_party/rust/ppv-lite86/Cargo.toml @@ -3,17 +3,16 @@ # When uploading crates to the registry Cargo will automatically # "normalize" Cargo.toml files for maximal compatibility # with all versions of Cargo and also rewrite `path` dependencies -# to registry (e.g., crates.io) dependencies +# to registry (e.g., crates.io) dependencies. # -# If you believe there's an error in this file please file an -# issue against the rust-lang/cargo repository. If you're -# editing this file be aware that the upstream Cargo.toml -# will likely look very different (and much more reasonable) +# If you are reading this file be aware that the original Cargo.toml +# will likely look very different (and much more reasonable). +# See Cargo.toml.orig for the original contents. [package] edition = "2018" name = "ppv-lite86" -version = "0.2.10" +version = "0.2.15" authors = ["The CryptoCorrosion Contributors"] description = "Implementation of the crypto-simd API for x86" keywords = ["crypto", "simd", "x86"] diff --git a/third_party/rust/ppv-lite86/src/generic.rs b/third_party/rust/ppv-lite86/src/generic.rs index f0e83d9638e8..473dab428d24 100644 --- a/third_party/rust/ppv-lite86/src/generic.rs +++ b/third_party/rust/ppv-lite86/src/generic.rs @@ -11,38 +11,38 @@ pub union vec128_storage { q: [u64; 2], } impl From<[u32; 4]> for vec128_storage { - #[inline] + #[inline(always)] fn from(d: [u32; 4]) -> Self { Self { d } } } impl From for [u32; 4] { - #[inline] + #[inline(always)] fn from(d: vec128_storage) -> Self { unsafe { d.d } } } impl From<[u64; 2]> for vec128_storage { - #[inline] + #[inline(always)] fn from(q: [u64; 2]) -> Self { Self { q } } } impl From for [u64; 2] { - #[inline] + #[inline(always)] fn from(q: vec128_storage) -> Self { unsafe { q.q } } } impl Default for vec128_storage { - #[inline] + #[inline(always)] fn default() -> Self { Self { q: [0, 0] } } } impl Eq for vec128_storage {} impl PartialEq for vec128_storage { - #[inline] + #[inline(always)] fn eq(&self, rhs: &Self) -> bool { unsafe { self.q == rhs.q } } @@ -62,7 +62,7 @@ impl vec256_storage { } } impl From for [u64; 4] { - #[inline] + #[inline(always)] fn from(q: vec256_storage) -> Self { let [a, b]: [u64; 2] = q.v128[0].into(); let [c, d]: [u64; 2] = q.v128[1].into(); @@ -84,6 +84,7 @@ impl vec512_storage { } } +#[inline(always)] fn dmap(t: T, f: F) -> T where T: Store + Into, @@ -117,6 +118,7 @@ where unsafe { T::unpack(d) } } +#[inline(always)] fn qmap(t: T, f: F) -> T where T: Store + Into, @@ -130,6 +132,7 @@ where unsafe { T::unpack(q) } } +#[inline(always)] fn qmap2(a: T, b: T, f: F) -> T where T: Store + Into, @@ -145,14 +148,17 @@ where unsafe { T::unpack(q) } } +#[inline(always)] fn o_of_q(q: [u64; 2]) -> u128 { u128::from(q[0]) | (u128::from(q[1]) << 64) } +#[inline(always)] fn q_of_o(o: u128) -> [u64; 2] { [o as u64, (o >> 64) as u64] } +#[inline(always)] fn omap(a: T, f: F) -> T where T: Store + Into, @@ -164,6 +170,7 @@ where unsafe { T::unpack(o) } } +#[inline(always)] fn omap2(a: T, b: T, f: F) -> T where T: Store + Into, @@ -247,39 +254,39 @@ macro_rules! impl_bitops { } impl Swap64 for $vec { - #[inline] + #[inline(always)] fn swap1(self) -> Self { qmap(self, |x| { ((x & 0x5555555555555555) << 1) | ((x & 0xaaaaaaaaaaaaaaaa) >> 1) }) } - #[inline] + #[inline(always)] fn swap2(self) -> Self { qmap(self, |x| { ((x & 0x3333333333333333) << 2) | ((x & 0xcccccccccccccccc) >> 2) }) } - #[inline] + #[inline(always)] fn swap4(self) -> Self { qmap(self, |x| { ((x & 0x0f0f0f0f0f0f0f0f) << 4) | ((x & 0xf0f0f0f0f0f0f0f0) >> 4) }) } - #[inline] + #[inline(always)] fn swap8(self) -> Self { qmap(self, |x| { ((x & 0x00ff00ff00ff00ff) << 8) | ((x & 0xff00ff00ff00ff00) >> 8) }) } - #[inline] + #[inline(always)] fn swap16(self) -> Self { dmap(self, |x| x.rotate_left(16)) } - #[inline] + #[inline(always)] fn swap32(self) -> Self { qmap(self, |x| x.rotate_left(32)) } - #[inline] + #[inline(always)] fn swap64(self) -> Self { omap(self, |x| (x << 64) | (x >> 64)) } @@ -291,82 +298,83 @@ impl_bitops!(u64x2_generic); impl_bitops!(u128x1_generic); impl RotateEachWord32 for u32x4_generic { - #[inline] + #[inline(always)] fn rotate_each_word_right7(self) -> Self { dmap(self, |x| x.rotate_right(7)) } - #[inline] + #[inline(always)] fn rotate_each_word_right8(self) -> Self { dmap(self, |x| x.rotate_right(8)) } - #[inline] + #[inline(always)] fn rotate_each_word_right11(self) -> Self { dmap(self, |x| x.rotate_right(11)) } - #[inline] + #[inline(always)] fn rotate_each_word_right12(self) -> Self { dmap(self, |x| x.rotate_right(12)) } - #[inline] + #[inline(always)] fn rotate_each_word_right16(self) -> Self { dmap(self, |x| x.rotate_right(16)) } - #[inline] + #[inline(always)] fn rotate_each_word_right20(self) -> Self { dmap(self, |x| x.rotate_right(20)) } - #[inline] + #[inline(always)] fn rotate_each_word_right24(self) -> Self { dmap(self, |x| x.rotate_right(24)) } - #[inline] + #[inline(always)] fn rotate_each_word_right25(self) -> Self { dmap(self, |x| x.rotate_right(25)) } } impl RotateEachWord32 for u64x2_generic { - #[inline] + #[inline(always)] fn rotate_each_word_right7(self) -> Self { qmap(self, |x| x.rotate_right(7)) } - #[inline] + #[inline(always)] fn rotate_each_word_right8(self) -> Self { qmap(self, |x| x.rotate_right(8)) } - #[inline] + #[inline(always)] fn rotate_each_word_right11(self) -> Self { qmap(self, |x| x.rotate_right(11)) } - #[inline] + #[inline(always)] fn rotate_each_word_right12(self) -> Self { qmap(self, |x| x.rotate_right(12)) } - #[inline] + #[inline(always)] fn rotate_each_word_right16(self) -> Self { qmap(self, |x| x.rotate_right(16)) } - #[inline] + #[inline(always)] fn rotate_each_word_right20(self) -> Self { qmap(self, |x| x.rotate_right(20)) } - #[inline] + #[inline(always)] fn rotate_each_word_right24(self) -> Self { qmap(self, |x| x.rotate_right(24)) } - #[inline] + #[inline(always)] fn rotate_each_word_right25(self) -> Self { qmap(self, |x| x.rotate_right(25)) } } impl RotateEachWord64 for u64x2_generic { - #[inline] + #[inline(always)] fn rotate_each_word_right32(self) -> Self { qmap(self, |x| x.rotate_right(32)) } } // workaround for koute/cargo-web#52 (u128::rotate_* broken with cargo web) +#[inline(always)] fn rotate_u128_right(x: u128, i: u32) -> u128 { (x >> i) | (x << (128 - i)) } @@ -377,41 +385,41 @@ fn test_rotate_u128() { } impl RotateEachWord32 for u128x1_generic { - #[inline] + #[inline(always)] fn rotate_each_word_right7(self) -> Self { Self([rotate_u128_right(self.0[0], 7)]) } - #[inline] + #[inline(always)] fn rotate_each_word_right8(self) -> Self { Self([rotate_u128_right(self.0[0], 8)]) } - #[inline] + #[inline(always)] fn rotate_each_word_right11(self) -> Self { Self([rotate_u128_right(self.0[0], 11)]) } - #[inline] + #[inline(always)] fn rotate_each_word_right12(self) -> Self { Self([rotate_u128_right(self.0[0], 12)]) } - #[inline] + #[inline(always)] fn rotate_each_word_right16(self) -> Self { Self([rotate_u128_right(self.0[0], 16)]) } - #[inline] + #[inline(always)] fn rotate_each_word_right20(self) -> Self { Self([rotate_u128_right(self.0[0], 20)]) } - #[inline] + #[inline(always)] fn rotate_each_word_right24(self) -> Self { Self([rotate_u128_right(self.0[0], 24)]) } - #[inline] + #[inline(always)] fn rotate_each_word_right25(self) -> Self { Self([rotate_u128_right(self.0[0], 25)]) } } impl RotateEachWord64 for u128x1_generic { - #[inline] + #[inline(always)] fn rotate_each_word_right32(self) -> Self { Self([rotate_u128_right(self.0[0], 32)]) } @@ -430,7 +438,7 @@ impl Machine for GenericMachine { type u32x4x4 = u32x4x4_generic; type u64x2x4 = u64x2x4_generic; type u128x4 = u128x4_generic; - #[inline] + #[inline(always)] unsafe fn instance() -> Self { Self } @@ -607,6 +615,22 @@ pub type u32x4x4_generic = x4; pub type u64x2x4_generic = x4; pub type u128x4_generic = x4; +impl Vector<[u32; 16]> for u32x4x4_generic { + fn to_scalars(self) -> [u32; 16] { + let [a, b, c, d] = self.0; + let a = a.0; + let b = b.0; + let c = c.0; + let d = d.0; + [ + a[0], a[1], a[2], a[3], + b[0], b[1], b[2], b[3], + c[0], c[1], c[2], c[3], + d[0], d[1], d[2], d[3], + ] + } +} + impl MultiLane<[u32; 4]> for u32x4_generic { #[inline(always)] fn to_lanes(self) -> [u32; 4] { @@ -747,7 +771,7 @@ impl u128x4 for u128x4_generic {} #[macro_export] macro_rules! dispatch { ($mach:ident, $MTy:ident, { $([$pub:tt$(($krate:tt))*])* fn $name:ident($($arg:ident: $argty:ty),* $(,)*) -> $ret:ty $body:block }) => { - #[inline] + #[inline(always)] $($pub$(($krate))*)* fn $name($($arg: $argty),*) -> $ret { let $mach = unsafe { $crate::generic::GenericMachine::instance() }; #[inline(always)] @@ -764,7 +788,7 @@ macro_rules! dispatch { #[macro_export] macro_rules! dispatch_light128 { ($mach:ident, $MTy:ident, { $([$pub:tt$(($krate:tt))*])* fn $name:ident($($arg:ident: $argty:ty),* $(,)*) -> $ret:ty $body:block }) => { - #[inline] + #[inline(always)] $($pub$(($krate))*)* fn $name($($arg: $argty),*) -> $ret { let $mach = unsafe { $crate::generic::GenericMachine::instance() }; #[inline(always)] @@ -781,7 +805,7 @@ macro_rules! dispatch_light128 { #[macro_export] macro_rules! dispatch_light256 { ($mach:ident, $MTy:ident, { $([$pub:tt$(($krate:tt))*])* fn $name:ident($($arg:ident: $argty:ty),* $(,)*) -> $ret:ty $body:block }) => { - #[inline] + #[inline(always)] $($pub$(($krate))*)* fn $name($($arg: $argty),*) -> $ret { let $mach = unsafe { $crate::generic::GenericMachine::instance() }; #[inline(always)] @@ -798,7 +822,7 @@ macro_rules! dispatch_light256 { #[macro_export] macro_rules! dispatch_light512 { ($mach:ident, $MTy:ident, { $([$pub:tt$(($krate:tt))*])* fn $name:ident($($arg:ident: $argty:ty),* $(,)*) -> $ret:ty $body:block }) => { - #[inline] + #[inline(always)] $($pub$(($krate))*)* fn $name($($arg: $argty),*) -> $ret { let $mach = unsafe { $crate::generic::GenericMachine::instance() }; #[inline(always)] diff --git a/third_party/rust/ppv-lite86/src/soft.rs b/third_party/rust/ppv-lite86/src/soft.rs index 8976c484ecef..4a88fccf7f9a 100644 --- a/third_party/rust/ppv-lite86/src/soft.rs +++ b/third_party/rust/ppv-lite86/src/soft.rs @@ -175,26 +175,50 @@ impl BSwap for x2 { impl StoreBytes for x2 { #[inline(always)] unsafe fn unsafe_read_le(input: &[u8]) -> Self { - let input = input.split_at(16); + let input = input.split_at(input.len() / 2); x2::new([W::unsafe_read_le(input.0), W::unsafe_read_le(input.1)]) } #[inline(always)] unsafe fn unsafe_read_be(input: &[u8]) -> Self { - x2::unsafe_read_le(input).bswap() + let input = input.split_at(input.len() / 2); + x2::new([W::unsafe_read_be(input.0), W::unsafe_read_be(input.1)]) } #[inline(always)] fn write_le(self, out: &mut [u8]) { - let out = out.split_at_mut(16); + let out = out.split_at_mut(out.len() / 2); self.0[0].write_le(out.0); self.0[1].write_le(out.1); } #[inline(always)] fn write_be(self, out: &mut [u8]) { - let out = out.split_at_mut(16); + let out = out.split_at_mut(out.len() / 2); self.0[0].write_be(out.0); self.0[1].write_be(out.1); } } +impl LaneWords4 for x2 { + #[inline(always)] + fn shuffle_lane_words2301(self) -> Self { + Self::new([ + self.0[0].shuffle_lane_words2301(), + self.0[1].shuffle_lane_words2301(), + ]) + } + #[inline(always)] + fn shuffle_lane_words1230(self) -> Self { + Self::new([ + self.0[0].shuffle_lane_words1230(), + self.0[1].shuffle_lane_words1230(), + ]) + } + #[inline(always)] + fn shuffle_lane_words3012(self) -> Self { + Self::new([ + self.0[0].shuffle_lane_words3012(), + self.0[1].shuffle_lane_words3012(), + ]) + } +} #[derive(Copy, Clone, Default)] #[allow(non_camel_case_types)] @@ -310,6 +334,17 @@ impl Vec4 for x4 { self } } +impl Vec4Ext for x4 { + #[inline(always)] + fn transpose4(a: Self, b: Self, c: Self, d: Self) -> (Self, Self, Self, Self) where Self: Sized { + ( + x4([a.0[0], b.0[0], c.0[0], d.0[0]]), + x4([a.0[1], b.0[1], c.0[1], d.0[1]]), + x4([a.0[2], b.0[2], c.0[2], d.0[2]]), + x4([a.0[3], b.0[3], c.0[3], d.0[3]]) + ) + } +} impl> Store for x4 { #[inline(always)] unsafe fn unpack(p: vec512_storage) -> Self { @@ -368,30 +403,39 @@ impl BSwap for x4 { impl StoreBytes for x4 { #[inline(always)] unsafe fn unsafe_read_le(input: &[u8]) -> Self { + let n = input.len() / 4; x4([ - W::unsafe_read_le(&input[0..16]), - W::unsafe_read_le(&input[16..32]), - W::unsafe_read_le(&input[32..48]), - W::unsafe_read_le(&input[48..64]), + W::unsafe_read_le(&input[..n]), + W::unsafe_read_le(&input[n..n * 2]), + W::unsafe_read_le(&input[n * 2..n * 3]), + W::unsafe_read_le(&input[n * 3..]), ]) } #[inline(always)] unsafe fn unsafe_read_be(input: &[u8]) -> Self { - x4::unsafe_read_le(input).bswap() + let n = input.len() / 4; + x4([ + W::unsafe_read_be(&input[..n]), + W::unsafe_read_be(&input[n..n * 2]), + W::unsafe_read_be(&input[n * 2..n * 3]), + W::unsafe_read_be(&input[n * 3..]), + ]) } #[inline(always)] fn write_le(self, out: &mut [u8]) { - self.0[0].write_le(&mut out[0..16]); - self.0[1].write_le(&mut out[16..32]); - self.0[2].write_le(&mut out[32..48]); - self.0[3].write_le(&mut out[48..64]); + let n = out.len() / 4; + self.0[0].write_le(&mut out[..n]); + self.0[1].write_le(&mut out[n..n * 2]); + self.0[2].write_le(&mut out[n * 2..n * 3]); + self.0[3].write_le(&mut out[n * 3..]); } #[inline(always)] fn write_be(self, out: &mut [u8]) { - self.0[0].write_be(&mut out[0..16]); - self.0[1].write_be(&mut out[16..32]); - self.0[2].write_be(&mut out[32..48]); - self.0[3].write_be(&mut out[48..64]); + let n = out.len() / 4; + self.0[0].write_be(&mut out[..n]); + self.0[1].write_be(&mut out[n..n * 2]); + self.0[2].write_be(&mut out[n * 2..n * 3]); + self.0[3].write_be(&mut out[n * 3..]); } } impl LaneWords4 for x4 { diff --git a/third_party/rust/ppv-lite86/src/types.rs b/third_party/rust/ppv-lite86/src/types.rs index a2826707d383..8a2acfcf16df 100644 --- a/third_party/rust/ppv-lite86/src/types.rs +++ b/third_party/rust/ppv-lite86/src/types.rs @@ -71,6 +71,15 @@ pub trait Vec4 { fn extract(self, i: u32) -> W; fn insert(self, w: W, i: u32) -> Self; } +/// Vec4 functions which may not be implemented yet for all Vec4 types. +/// NOTE: functions in this trait may be moved to Vec4 in any patch release. To avoid breakage, +/// import Vec4Ext only together with Vec4, and don't qualify its methods. +pub trait Vec4Ext { + fn transpose4(a: Self, b: Self, c: Self, d: Self) -> (Self, Self, Self, Self) where Self: Sized; +} +pub trait Vector { + fn to_scalars(self) -> T; +} // TODO: multiples of 4 should inherit this /// A vector composed of four words; depending on their size, operations may cross lanes. @@ -132,6 +141,7 @@ pub trait u32x4x2: + MultiLane<[M::u32x4; 2]> + ArithOps + Into + + StoreBytes { } pub trait u64x2x2: @@ -169,10 +179,13 @@ pub trait u32x4x4: BitOps32 + Store + Vec4 + + Vec4Ext + + Vector<[u32; 16]> + MultiLane<[M::u32x4; 4]> + ArithOps + LaneWords4 + Into + + StoreBytes { } pub trait u64x2x4: diff --git a/third_party/rust/ppv-lite86/src/x86_64/mod.rs b/third_party/rust/ppv-lite86/src/x86_64/mod.rs index d7455d0c6605..0538e3f7c5b4 100644 --- a/third_party/rust/ppv-lite86/src/x86_64/mod.rs +++ b/third_party/rust/ppv-lite86/src/x86_64/mod.rs @@ -79,7 +79,7 @@ where type u64x2 = sse2::u64x2_sse2; type u128x1 = sse2::u128x1_sse2; - type u32x4x2 = sse2::u32x4x2_sse2; + type u32x4x2 = sse2::avx2::u32x4x2_avx2; type u64x2x2 = sse2::u64x2x2_sse2; type u64x4 = sse2::u64x4_sse2; type u128x2 = sse2::u128x2_sse2; @@ -167,9 +167,11 @@ impl Default for vec256_storage { } } impl vec256_storage { + #[inline(always)] pub fn new128(xs: [vec128_storage; 2]) -> Self { Self { sse2: xs } } + #[inline(always)] pub fn split128(self) -> [vec128_storage; 2] { unsafe { self.sse2 } } @@ -200,9 +202,11 @@ impl Default for vec512_storage { } } impl vec512_storage { + #[inline(always)] pub fn new128(xs: [vec128_storage; 4]) -> Self { Self { sse2: xs } } + #[inline(always)] pub fn split128(self) -> [vec128_storage; 4] { unsafe { self.sse2 } } diff --git a/third_party/rust/ppv-lite86/src/x86_64/sse2.rs b/third_party/rust/ppv-lite86/src/x86_64/sse2.rs index bf0063fb64dc..853079010b13 100644 --- a/third_party/rust/ppv-lite86/src/x86_64/sse2.rs +++ b/third_party/rust/ppv-lite86/src/x86_64/sse2.rs @@ -880,6 +880,15 @@ pub type u64x2x4_sse2 = x4>; #[allow(non_camel_case_types)] pub type u128x4_sse2 = x4>; +impl Vector<[u32; 16]> for u32x4x4_sse2 { + #[inline(always)] + fn to_scalars(self) -> [u32; 16] { + unsafe { + core::mem::transmute(self) + } + } +} + impl u32x4x2> for u32x4x2_sse2 where u32x4_sse2: RotateEachWord32 + BSwap, @@ -983,6 +992,8 @@ where Machine86: Machine, u32x4x4_sse2: MultiLane<[ as Machine>::u32x4; 4]>, u32x4x4_sse2: Vec4< as Machine>::u32x4>, + u32x4x4_sse2: Vec4Ext< as Machine>::u32x4>, + u32x4x4_sse2: Vector<[u32; 16]>, { } impl u64x2x4> for u64x2x4_sse2 @@ -1004,14 +1015,6 @@ where { } -impl u32x4x4> for u32x4x4_sse2 -where - u32x4_sse2: RotateEachWord32 + BSwap, - Avx2Machine: Machine, - u32x4x4_sse2: MultiLane<[ as Machine>::u32x4; 4]>, - u32x4x4_sse2: Vec4< as Machine>::u32x4>, -{ -} impl u64x2x4> for u64x2x4_sse2 where u64x2_sse2: RotateEachWord64 + RotateEachWord32 + BSwap, @@ -1374,65 +1377,80 @@ mod test { pub mod avx2 { #![allow(non_camel_case_types)] - use crate::soft::x4; + use crate::soft::{x2, x4}; use crate::types::*; - use crate::x86_64::sse2::{u128x1_sse2, u32x4_sse2}; + use crate::x86_64::sse2::{u128x1_sse2, u32x4_sse2, G0}; use crate::x86_64::{vec256_storage, vec512_storage, Avx2Machine, YesS3, YesS4}; use core::arch::x86_64::*; use core::marker::PhantomData; use core::ops::*; #[derive(Copy, Clone)] - pub struct u32x4x4_avx2 { - x: [__m256i; 2], + pub struct u32x4x2_avx2 { + x: __m256i, ni: PhantomData, } - impl u32x4x4_avx2 { + impl u32x4x2_avx2 { #[inline(always)] - fn new(x: [__m256i; 2]) -> Self { + fn new(x: __m256i) -> Self { Self { x, ni: PhantomData } } } - impl u32x4x4> for u32x4x4_avx2 where NI: Copy {} - impl Store for u32x4x4_avx2 { + impl u32x4x2> for u32x4x2_avx2 where NI: Copy {} + impl Store for u32x4x2_avx2 { #[inline(always)] - unsafe fn unpack(p: vec512_storage) -> Self { - Self::new([p.avx[0].avx, p.avx[1].avx]) + unsafe fn unpack(p: vec256_storage) -> Self { + Self::new(p.avx) } } - impl MultiLane<[u32x4_sse2; 4]> for u32x4x4_avx2 { + impl StoreBytes for u32x4x2_avx2 { #[inline(always)] - fn to_lanes(self) -> [u32x4_sse2; 4] { + unsafe fn unsafe_read_le(input: &[u8]) -> Self { + assert_eq!(input.len(), 32); + Self::new(_mm256_loadu_si256(input.as_ptr() as *const _)) + } + #[inline(always)] + unsafe fn unsafe_read_be(input: &[u8]) -> Self { + Self::unsafe_read_le(input).bswap() + } + #[inline(always)] + fn write_le(self, out: &mut [u8]) { + unsafe { + assert_eq!(out.len(), 32); + _mm256_storeu_si256(out.as_mut_ptr() as *mut _, self.x) + } + } + #[inline(always)] + fn write_be(self, out: &mut [u8]) { + self.bswap().write_le(out) + } + } + impl MultiLane<[u32x4_sse2; 2]> for u32x4x2_avx2 { + #[inline(always)] + fn to_lanes(self) -> [u32x4_sse2; 2] { unsafe { [ - u32x4_sse2::new(_mm256_extracti128_si256(self.x[0], 0)), - u32x4_sse2::new(_mm256_extracti128_si256(self.x[0], 1)), - u32x4_sse2::new(_mm256_extracti128_si256(self.x[1], 0)), - u32x4_sse2::new(_mm256_extracti128_si256(self.x[1], 1)), + u32x4_sse2::new(_mm256_extracti128_si256(self.x, 0)), + u32x4_sse2::new(_mm256_extracti128_si256(self.x, 1)), ] } } #[inline(always)] - fn from_lanes(x: [u32x4_sse2; 4]) -> Self { + fn from_lanes(x: [u32x4_sse2; 2]) -> Self { Self::new(unsafe { - [ - _mm256_setr_m128i(x[0].x, x[1].x), - _mm256_setr_m128i(x[2].x, x[3].x), - ] + _mm256_setr_m128i(x[0].x, x[1].x) }) } } - impl Vec4> for u32x4x4_avx2 { + impl Vec2> for u32x4x2_avx2 { #[inline(always)] fn extract(self, i: u32) -> u32x4_sse2 { unsafe { match i { - 0 => u32x4_sse2::new(_mm256_extracti128_si256(self.x[0], 0)), - 1 => u32x4_sse2::new(_mm256_extracti128_si256(self.x[0], 1)), - 2 => u32x4_sse2::new(_mm256_extracti128_si256(self.x[1], 0)), - 3 => u32x4_sse2::new(_mm256_extracti128_si256(self.x[1], 1)), + 0 => u32x4_sse2::new(_mm256_extracti128_si256(self.x, 0)), + 1 => u32x4_sse2::new(_mm256_extracti128_si256(self.x, 1)), _ => panic!(), } } @@ -1441,55 +1459,21 @@ pub mod avx2 { fn insert(self, w: u32x4_sse2, i: u32) -> Self { Self::new(unsafe { match i { - 0 => [_mm256_inserti128_si256(self.x[0], w.x, 0), self.x[1]], - 1 => [_mm256_inserti128_si256(self.x[0], w.x, 1), self.x[1]], - 2 => [self.x[0], _mm256_inserti128_si256(self.x[1], w.x, 0)], - 3 => [self.x[0], _mm256_inserti128_si256(self.x[1], w.x, 1)], + 0 => _mm256_inserti128_si256(self.x, w.x, 0), + 1 => _mm256_inserti128_si256(self.x, w.x, 1), _ => panic!(), } }) } } - impl LaneWords4 for u32x4x4_avx2 { - #[inline(always)] - fn shuffle_lane_words1230(self) -> Self { - Self::new(unsafe { - [ - _mm256_shuffle_epi32(self.x[0], 0b1001_0011), - _mm256_shuffle_epi32(self.x[1], 0b1001_0011), - ] - }) - } - #[inline(always)] - fn shuffle_lane_words2301(self) -> Self { - Self::new(unsafe { - [ - _mm256_shuffle_epi32(self.x[0], 0b0100_1110), - _mm256_shuffle_epi32(self.x[1], 0b0100_1110), - ] - }) - } - #[inline(always)] - fn shuffle_lane_words3012(self) -> Self { - Self::new(unsafe { - [ - _mm256_shuffle_epi32(self.x[0], 0b0011_1001), - _mm256_shuffle_epi32(self.x[1], 0b0011_1001), - ] - }) - } - } - impl BitOps32 for u32x4x4_avx2 where NI: Copy {} - impl ArithOps for u32x4x4_avx2 where NI: Copy {} + impl BitOps32 for u32x4x2_avx2 where NI: Copy {} + impl ArithOps for u32x4x2_avx2 where NI: Copy {} macro_rules! shuf_lane_bytes { ($name:ident, $k0:expr, $k1:expr) => { #[inline(always)] fn $name(self) -> Self { Self::new(unsafe { - [ - _mm256_shuffle_epi8(self.x[0], _mm256_set_epi64x($k0, $k1, $k0, $k1)), - _mm256_shuffle_epi8(self.x[1], _mm256_set_epi64x($k0, $k1, $k0, $k1)), - ] + _mm256_shuffle_epi8(self.x, _mm256_set_epi64x($k0, $k1, $k0, $k1)) }) } }; @@ -1499,21 +1483,15 @@ pub mod avx2 { #[inline(always)] fn $name(self) -> Self { Self::new(unsafe { - [ - _mm256_or_si256( - _mm256_srli_epi32(self.x[0], $i as i32), - _mm256_slli_epi32(self.x[0], 32 - $i as i32), - ), - _mm256_or_si256( - _mm256_srli_epi32(self.x[1], $i as i32), - _mm256_slli_epi32(self.x[1], 32 - $i as i32), - ), - ] + _mm256_or_si256( + _mm256_srli_epi32(self.x, $i as i32), + _mm256_slli_epi32(self.x, 32 - $i as i32), + ) }) } }; } - impl RotateEachWord32 for u32x4x4_avx2 { + impl RotateEachWord32 for u32x4x2_avx2 { rotr_32!(rotate_each_word_right7, 7); shuf_lane_bytes!( rotate_each_word_right8, @@ -1535,15 +1513,12 @@ pub mod avx2 { ); rotr_32!(rotate_each_word_right25, 25); } - impl BitOps0 for u32x4x4_avx2 where NI: Copy {} - impl From> for vec512_storage { + impl BitOps0 for u32x4x2_avx2 where NI: Copy {} + impl From> for vec256_storage { #[inline(always)] - fn from(x: u32x4x4_avx2) -> Self { + fn from(x: u32x4x2_avx2) -> Self { Self { - avx: [ - vec256_storage { avx: x.x[0] }, - vec256_storage { avx: x.x[1] }, - ], + avx: x.x, } } } @@ -1561,55 +1536,182 @@ pub mod avx2 { } }; } - impl_assign!(u32x4x4_avx2, BitXorAssign, bitxor_assign, bitxor); - impl_assign!(u32x4x4_avx2, BitOrAssign, bitor_assign, bitor); - impl_assign!(u32x4x4_avx2, BitAndAssign, bitand_assign, bitand); - impl_assign!(u32x4x4_avx2, AddAssign, add_assign, add); + impl_assign!(u32x4x2_avx2, BitXorAssign, bitxor_assign, bitxor); + impl_assign!(u32x4x2_avx2, BitOrAssign, bitor_assign, bitor); + impl_assign!(u32x4x2_avx2, BitAndAssign, bitand_assign, bitand); + impl_assign!(u32x4x2_avx2, AddAssign, add_assign, add); - macro_rules! impl_bitop_x2 { + macro_rules! impl_bitop { ($vec:ident, $Op:ident, $op_fn:ident, $impl_fn:ident) => { impl $Op for $vec { type Output = Self; #[inline(always)] fn $op_fn(self, rhs: Self) -> Self::Output { Self::new(unsafe { - [$impl_fn(self.x[0], rhs.x[0]), $impl_fn(self.x[1], rhs.x[1])] + $impl_fn(self.x, rhs.x) }) } } }; } - impl_bitop_x2!(u32x4x4_avx2, BitXor, bitxor, _mm256_xor_si256); - impl_bitop_x2!(u32x4x4_avx2, BitOr, bitor, _mm256_or_si256); - impl_bitop_x2!(u32x4x4_avx2, BitAnd, bitand, _mm256_and_si256); - impl_bitop_x2!(u32x4x4_avx2, AndNot, andnot, _mm256_andnot_si256); - impl_bitop_x2!(u32x4x4_avx2, Add, add, _mm256_add_epi32); + impl_bitop!(u32x4x2_avx2, BitXor, bitxor, _mm256_xor_si256); + impl_bitop!(u32x4x2_avx2, BitOr, bitor, _mm256_or_si256); + impl_bitop!(u32x4x2_avx2, BitAnd, bitand, _mm256_and_si256); + impl_bitop!(u32x4x2_avx2, AndNot, andnot, _mm256_andnot_si256); + impl_bitop!(u32x4x2_avx2, Add, add, _mm256_add_epi32); - impl Not for u32x4x4_avx2 { + impl Not for u32x4x2_avx2 { type Output = Self; #[inline(always)] fn not(self) -> Self::Output { unsafe { let f = _mm256_set1_epi8(-0x7f); - Self::new([f, f]) ^ self + Self::new(f) ^ self } } } - impl BSwap for u32x4x4_avx2 { + impl BSwap for u32x4x2_avx2 { shuf_lane_bytes!(bswap, 0x0c0d_0e0f_0809_0a0b, 0x0405_0607_0001_0203); } - impl From>> for u32x4x4_avx2 + impl From, G0>> for u32x4x2_avx2 where NI: Copy, + { + #[inline(always)] + fn from(x: x2, G0>) -> Self { + Self::new(unsafe { + _mm256_setr_m128i(x.0[0].x, x.0[1].x) + }) + } + } + + impl LaneWords4 for u32x4x2_avx2 { + #[inline(always)] + fn shuffle_lane_words1230(self) -> Self { + Self::new(unsafe { + _mm256_shuffle_epi32(self.x, 0b1001_0011) + }) + } + #[inline(always)] + fn shuffle_lane_words2301(self) -> Self { + Self::new(unsafe { + _mm256_shuffle_epi32(self.x, 0b0100_1110) + }) + } + #[inline(always)] + fn shuffle_lane_words3012(self) -> Self { + Self::new(unsafe { + _mm256_shuffle_epi32(self.x, 0b0011_1001) + }) + } + } + + /////////////////////////////////////////////////////////////////////////////////////////// + + pub type u32x4x4_avx2 = x2, G0>; + impl u32x4x4> for u32x4x4_avx2 {} + + impl Store for u32x4x4_avx2 { + #[inline(always)] + unsafe fn unpack(p: vec512_storage) -> Self { + Self::new([u32x4x2_avx2::unpack(p.avx[0]), u32x4x2_avx2::unpack(p.avx[1])]) + } + } + impl MultiLane<[u32x4_sse2; 4]> for u32x4x4_avx2 { + #[inline(always)] + fn to_lanes(self) -> [u32x4_sse2; 4] { + let [a, b] = self.0[0].to_lanes(); + let [c, d] = self.0[1].to_lanes(); + [a, b, c, d] + } + #[inline(always)] + fn from_lanes(x: [u32x4_sse2; 4]) -> Self { + let ab = u32x4x2_avx2::from_lanes([x[0], x[1]]); + let cd = u32x4x2_avx2::from_lanes([x[2], x[3]]); + Self::new([ab, cd]) + } + } + impl Vec4> for u32x4x4_avx2 { + #[inline(always)] + fn extract(self, i: u32) -> u32x4_sse2 { + match i { + 0 => self.0[0].extract(0), + 1 => self.0[0].extract(1), + 2 => self.0[1].extract(0), + 3 => self.0[1].extract(1), + _ => panic!(), + } + } + #[inline(always)] + fn insert(self, w: u32x4_sse2, i: u32) -> Self { + Self::new(match i { + 0 | 1 => [self.0[0].insert(w, i), self.0[1]], + 2 | 3 => [self.0[0], self.0[1].insert(w, i - 2)], + _ => panic!(), + }) + } + } + impl Vec4Ext> for u32x4x4_avx2 { + #[inline(always)] + fn transpose4(a: Self, b: Self, c: Self, d: Self) -> (Self, Self, Self, Self) { + /* + * a00:a01 a10:a11 + * b00:b01 b10:b11 + * c00:c01 c10:c11 + * d00:d01 d10:d11 + * => + * a00:b00 c00:d00 + * a01:b01 c01:d01 + * a10:b10 c10:d10 + * a11:b11 c11:d11 + */ + unsafe { + let ab00 = u32x4x2_avx2::new(_mm256_permute2x128_si256(a.0[0].x, b.0[0].x, 0x20)); + let ab01 = u32x4x2_avx2::new(_mm256_permute2x128_si256(a.0[0].x, b.0[0].x, 0x31)); + let ab10 = u32x4x2_avx2::new(_mm256_permute2x128_si256(a.0[1].x, b.0[1].x, 0x20)); + let ab11 = u32x4x2_avx2::new(_mm256_permute2x128_si256(a.0[1].x, b.0[1].x, 0x31)); + let cd00 = u32x4x2_avx2::new(_mm256_permute2x128_si256(c.0[0].x, d.0[0].x, 0x20)); + let cd01 = u32x4x2_avx2::new(_mm256_permute2x128_si256(c.0[0].x, d.0[0].x, 0x31)); + let cd10 = u32x4x2_avx2::new(_mm256_permute2x128_si256(c.0[1].x, d.0[1].x, 0x20)); + let cd11 = u32x4x2_avx2::new(_mm256_permute2x128_si256(c.0[1].x, d.0[1].x, 0x31)); + ( + Self::new([ab00, cd00]), + Self::new([ab01, cd01]), + Self::new([ab10, cd10]), + Self::new([ab11, cd11]), + ) + } + } + } + impl Vector<[u32; 16]> for u32x4x4_avx2 { + #[inline(always)] + fn to_scalars(self) -> [u32; 16] { + unsafe { + core::mem::transmute(self) + } + } + } + impl From> for vec512_storage { + #[inline(always)] + fn from(x: u32x4x4_avx2) -> Self { + Self { + avx: [ + vec256_storage { avx: x.0[0].x }, + vec256_storage { avx: x.0[1].x }, + ], + } + } + } + impl From>> for u32x4x4_avx2 { #[inline(always)] fn from(x: x4>) -> Self { Self::new(unsafe { [ - _mm256_setr_m128i(x.0[0].x, x.0[1].x), - _mm256_setr_m128i(x.0[2].x, x.0[3].x), + u32x4x2_avx2::new(_mm256_setr_m128i(x.0[0].x, x.0[1].x)), + u32x4x2_avx2::new(_mm256_setr_m128i(x.0[2].x, x.0[3].x)), ] }) } diff --git a/third_party/rust/proc-macro2/.cargo-checksum.json b/third_party/rust/proc-macro2/.cargo-checksum.json index c253e3fcdc6b..75fb3b04b7b9 100644 --- a/third_party/rust/proc-macro2/.cargo-checksum.json +++ b/third_party/rust/proc-macro2/.cargo-checksum.json @@ -1 +1 @@ -{"files":{"Cargo.toml":"f146a19842771e569274bb49cc45bdec523f5684635e436fac722ca8acca9f1e","LICENSE-APACHE":"a60eea817514531668d7e00765731449fe14d059d3249e0bc93b36de45f759f2","LICENSE-MIT":"378f5840b258e2779c39418f3f2d7b2ba96f1c7917dd6be0713f88305dbda397","README.md":"e1f9d4fc22cff2c049f166a403b41458632a94357890d31cf0e3ad83807fb430","build.rs":"a71283fbc495095eebbbf46753df3fe2c19505c745b508dea157f65796b64dd7","src/detection.rs":"9d25d896889e65330858f2d6f6223c1b98cd1dad189813ad4161ff189fbda2b8","src/fallback.rs":"c161f65f18d7d19bcbd568f5c0bea1cfc1ce3bd9c66427b1fdb4944ad7966ce0","src/lib.rs":"233e3b81bd55cfc9ea03e3441750df43482f2542fb1ce766579b2b440b59a8c5","src/marker.rs":"87fce2d0357f5b7998b6d9dfb064f4a0cbc9dabb19e33d4b514a446243ebe2e8","src/parse.rs":"e9490087ca7d1c10a94c835e725a5189145647492be2735dcd842b6e5ae5b57c","src/wrapper.rs":"9b932595ff6534b1d54ed4917b1d7b63e748ac4786d5377bd6f3bc7da78c2f83","tests/comments.rs":"ea6cbe6f4c8852e6a0612893c7d4f2c144a2e6a134a6c3db641a320cbfc3c800","tests/features.rs":"a86deb8644992a4eb64d9fd493eff16f9cf9c5cb6ade3a634ce0c990cf87d559","tests/marker.rs":"652db9f25c69ffc65baa60cdca8f195aa2e254d4de0a9ddc85de4dc2470544b6","tests/test.rs":"597186c00ebf51191934c88ff970b5457ca0fb8e608bf896be1ebf8d74c17f4d","tests/test_fmt.rs":"745dfdc41d09c5308c221395eb43f2041f0a1413d2927a813bc2ad4554438fe2"},"package":"f0d8caf72986c1a598726adc988bb5984792ef84f5ee5aa50209145ee8077038"} \ No newline at end of file +{"files":{"Cargo.toml":"1f6a5d25accb4449c7427a27678f58c49d0d00ed7c2f60da787dd4353abdb5ee","LICENSE-APACHE":"a60eea817514531668d7e00765731449fe14d059d3249e0bc93b36de45f759f2","LICENSE-MIT":"378f5840b258e2779c39418f3f2d7b2ba96f1c7917dd6be0713f88305dbda397","README.md":"fb633ca229c17dc9802db9b66c3b31792e9da8877856c52729e71f7412338387","build.rs":"4f6f7f8fc825a73330cb0a88faced3d435ece640ee1e6c308ab2f19fd19d2c35","src/detection.rs":"813dbaefe98a2b993ee40ec130d4f0ed58430c15aa4661a2c9d2f0d105669409","src/fallback.rs":"a34fb3f1c6f73de26af3cbd5ba446a8cf04076c8570137edc0fe216ec3e4d6ae","src/lib.rs":"452140fa8be772bde4aa89ceb8c47430ff904b864585a9d01c96a23b68b4b9af","src/marker.rs":"87fce2d0357f5b7998b6d9dfb064f4a0cbc9dabb19e33d4b514a446243ebe2e8","src/parse.rs":"a7068413b1b7873543c704b9c494f47f94a7046553a6765e99d4a1ac4ae6501f","src/wrapper.rs":"ef5648598c132e0ca6f8c0056d5b82e1b7f47ae29701860bf1fc52b89371d27b","tests/comments.rs":"065132797580744767b7a854d5467757bd3433a990957f8dbccdfa779bfb275f","tests/features.rs":"a86deb8644992a4eb64d9fd493eff16f9cf9c5cb6ade3a634ce0c990cf87d559","tests/marker.rs":"cb6d776eba6a238d726b0f531883adf41957e06f2717ee8a069821c81e7081d6","tests/test.rs":"5ca52a1eb73ebe51368c3be1ad6898aa48dc8cfb1e76d170950c475b75dac743","tests/test_fmt.rs":"9357769945784354909259084ec8b34d2aa52081dd3967cac6dae3a5e3df3bc0"},"package":"fb37d2df5df740e582f28f8560cf425f52bb267d872fe58358eadb554909f07a"} \ No newline at end of file diff --git a/third_party/rust/proc-macro2/Cargo.toml b/third_party/rust/proc-macro2/Cargo.toml index 57fbf1b726e7..80d6aead645b 100644 --- a/third_party/rust/proc-macro2/Cargo.toml +++ b/third_party/rust/proc-macro2/Cargo.toml @@ -3,25 +3,25 @@ # When uploading crates to the registry Cargo will automatically # "normalize" Cargo.toml files for maximal compatibility # with all versions of Cargo and also rewrite `path` dependencies -# to registry (e.g., crates.io) dependencies +# to registry (e.g., crates.io) dependencies. # -# If you believe there's an error in this file please file an -# issue against the rust-lang/cargo repository. If you're -# editing this file be aware that the upstream Cargo.toml -# will likely look very different (and much more reasonable) +# If you are reading this file be aware that the original Cargo.toml +# will likely look very different (and much more reasonable). +# See Cargo.toml.orig for the original contents. [package] edition = "2018" +rust-version = "1.31" name = "proc-macro2" -version = "1.0.27" -authors = ["Alex Crichton ", "David Tolnay "] +version = "1.0.33" +authors = ["David Tolnay ", "Alex Crichton "] description = "A substitute implementation of the compiler's `proc_macro` API to decouple\ntoken-based libraries from the procedural macro use case.\n" documentation = "https://docs.rs/proc-macro2" readme = "README.md" keywords = ["macros"] categories = ["development-tools::procedural-macro-helpers"] license = "MIT OR Apache-2.0" -repository = "https://github.com/alexcrichton/proc-macro2" +repository = "https://github.com/dtolnay/proc-macro2" [package.metadata.docs.rs] rustc-args = ["--cfg", "procmacro2_semver_exempt"] rustdoc-args = ["--cfg", "procmacro2_semver_exempt", "--cfg", "doc_cfg"] diff --git a/third_party/rust/proc-macro2/README.md b/third_party/rust/proc-macro2/README.md index 3d05e871a70e..35e187621297 100644 --- a/third_party/rust/proc-macro2/README.md +++ b/third_party/rust/proc-macro2/README.md @@ -1,8 +1,9 @@ # proc-macro2 -[![Build Status](https://img.shields.io/github/workflow/status/alexcrichton/proc-macro2/build%20and%20test)](https://github.com/alexcrichton/proc-macro2/actions) -[![Latest Version](https://img.shields.io/crates/v/proc-macro2.svg)](https://crates.io/crates/proc-macro2) -[![Rust Documentation](https://img.shields.io/badge/api-rustdoc-blue.svg)](https://docs.rs/proc-macro2) +[github](https://github.com/dtolnay/proc-macro2) +[crates.io](https://crates.io/crates/proc-macro2) +[docs.rs](https://docs.rs/proc-macro2) +[build status](https://github.com/dtolnay/proc-macro2/actions?query=branch%3Amaster) A wrapper around the procedural macro API of the compiler's `proc_macro` crate. This library serves two purposes: diff --git a/third_party/rust/proc-macro2/build.rs b/third_party/rust/proc-macro2/build.rs index b247d874f6aa..178c75758b4a 100644 --- a/third_party/rust/proc-macro2/build.rs +++ b/third_party/rust/proc-macro2/build.rs @@ -33,8 +33,15 @@ // location of a token. Enabled by procmacro2_semver_exempt or the // "span-locations" Cargo cfg. This is behind a cfg because tracking // location inside spans is a performance hit. +// +// "is_available" +// Use proc_macro::is_available() to detect if the proc macro API is +// available or needs to be polyfilled instead of trying to use the proc +// macro API and catching a panic if it isn't available. Enabled on Rust +// 1.57+. use std::env; +use std::iter; use std::process::{self, Command}; use std::str; @@ -53,7 +60,7 @@ fn main() { let semver_exempt = cfg!(procmacro2_semver_exempt); if semver_exempt { - // https://github.com/alexcrichton/proc-macro2/issues/147 + // https://github.com/dtolnay/proc-macro2/issues/147 println!("cargo:rustc-cfg=procmacro2_semver_exempt"); } @@ -69,12 +76,24 @@ fn main() { println!("cargo:rustc-cfg=no_bind_by_move_pattern_guard"); } - if version.minor >= 44 { - println!("cargo:rustc-cfg=lexerror_display"); + if version.minor < 44 { + println!("cargo:rustc-cfg=no_lexerror_display"); } - if version.minor >= 45 { - println!("cargo:rustc-cfg=hygiene"); + if version.minor < 45 { + println!("cargo:rustc-cfg=no_hygiene"); + } + + if version.minor < 54 { + println!("cargo:rustc-cfg=no_literal_from_str"); + } + + if version.minor < 55 { + println!("cargo:rustc-cfg=no_group_open_close"); + } + + if version.minor < 57 { + println!("cargo:rustc-cfg=no_is_available"); } let target = env::var("TARGET").unwrap(); @@ -132,15 +151,33 @@ fn feature_allowed(feature: &str) -> bool { // // -Zallow-features=feature1,feature2 - if let Some(rustflags) = env::var_os("RUSTFLAGS") { - for mut flag in rustflags.to_string_lossy().split(' ') { - if flag.starts_with("-Z") { - flag = &flag["-Z".len()..]; - } - if flag.starts_with("allow-features=") { - flag = &flag["allow-features=".len()..]; - return flag.split(',').any(|allowed| allowed == feature); - } + let flags_var; + let flags_var_string; + let mut flags_var_split; + let mut flags_none; + let flags: &mut dyn Iterator = + if let Some(encoded_rustflags) = env::var_os("CARGO_ENCODED_RUSTFLAGS") { + flags_var = encoded_rustflags; + flags_var_string = flags_var.to_string_lossy(); + flags_var_split = flags_var_string.split('\x1f'); + &mut flags_var_split + } else if let Some(rustflags) = env::var_os("RUSTFLAGS") { + flags_var = rustflags; + flags_var_string = flags_var.to_string_lossy(); + flags_var_split = flags_var_string.split(' '); + &mut flags_var_split + } else { + flags_none = iter::empty(); + &mut flags_none + }; + + for mut flag in flags { + if flag.starts_with("-Z") { + flag = &flag["-Z".len()..]; + } + if flag.starts_with("allow-features=") { + flag = &flag["allow-features=".len()..]; + return flag.split(',').any(|allowed| allowed == feature); } } diff --git a/third_party/rust/proc-macro2/src/detection.rs b/third_party/rust/proc-macro2/src/detection.rs index c597bc99c667..e5f892d72c13 100644 --- a/third_party/rust/proc-macro2/src/detection.rs +++ b/third_party/rust/proc-macro2/src/detection.rs @@ -1,5 +1,4 @@ -use std::panic::{self, PanicInfo}; -use std::sync::atomic::*; +use std::sync::atomic::{AtomicUsize, Ordering}; use std::sync::Once; static WORKS: AtomicUsize = AtomicUsize::new(0); @@ -24,6 +23,12 @@ pub(crate) fn unforce_fallback() { initialize(); } +#[cfg(not(no_is_available))] +fn initialize() { + let available = proc_macro::is_available(); + WORKS.store(available as usize + 1, Ordering::SeqCst); +} + // Swap in a null panic hook to avoid printing "thread panicked" to stderr, // then use catch_unwind to determine whether the compiler's proc_macro is // working. When proc-macro2 is used from outside of a procedural macro all @@ -48,7 +53,10 @@ pub(crate) fn unforce_fallback() { // here. For now, if a user needs to guarantee that this failure mode does // not occur, they need to call e.g. `proc_macro2::Span::call_site()` from // the main thread before launching any other threads. +#[cfg(no_is_available)] fn initialize() { + use std::panic::{self, PanicInfo}; + type PanicHook = dyn Fn(&PanicInfo) + Sync + Send + 'static; let null_hook: Box = Box::new(|_panic_info| { /* ignore */ }); diff --git a/third_party/rust/proc-macro2/src/fallback.rs b/third_party/rust/proc-macro2/src/fallback.rs index 3d2feae151d9..ebceab948400 100644 --- a/third_party/rust/proc-macro2/src/fallback.rs +++ b/third_party/rust/proc-macro2/src/fallback.rs @@ -65,7 +65,7 @@ impl TokenStream { } fn push_token(&mut self, token: TokenTree) { - // https://github.com/alexcrichton/proc-macro2/issues/235 + // https://github.com/dtolnay/proc-macro2/issues/235 match token { #[cfg(not(no_bind_by_move_pattern_guard))] TokenTree::Literal(crate::Literal { @@ -119,7 +119,7 @@ impl Drop for TokenStream { #[cfg(wrap_proc_macro)] let group = match group { crate::imp::Group::Fallback(group) => group, - _ => continue, + crate::imp::Group::Compiler(_) => continue, }; let mut group = group; self.inner.extend(group.stream.take_inner()); @@ -179,7 +179,7 @@ impl Display for TokenStream { Display::fmt(tt, f) } TokenTree::Literal(tt) => Display::fmt(tt, f), - }? + }?; } Ok(()) @@ -426,7 +426,7 @@ impl Span { Span { lo: 0, hi: 0 } } - #[cfg(hygiene)] + #[cfg(not(no_hygiene))] pub fn mixed_site() -> Span { Span::call_site() } @@ -896,10 +896,20 @@ impl Literal { impl FromStr for Literal { type Err = LexError; - fn from_str(repr: &str) -> Result { + fn from_str(mut repr: &str) -> Result { + let negative = repr.starts_with('-'); + if negative { + repr = &repr[1..]; + if !repr.starts_with(|ch: char| ch.is_ascii_digit()) { + return Err(LexError::call_site()); + } + } let cursor = get_cursor(repr); - if let Ok((_rest, literal)) = parse::literal(cursor) { + if let Ok((_rest, mut literal)) = parse::literal(cursor) { if literal.text.len() == repr.len() { + if negative { + literal.text.insert(0, '-'); + } return Ok(literal); } } diff --git a/third_party/rust/proc-macro2/src/lib.rs b/third_party/rust/proc-macro2/src/lib.rs index 52d01f2db4fd..dd874528ceab 100644 --- a/third_party/rust/proc-macro2/src/lib.rs +++ b/third_party/rust/proc-macro2/src/lib.rs @@ -1,3 +1,11 @@ +//! [![github]](https://github.com/dtolnay/proc-macro2) [![crates-io]](https://crates.io/crates/proc-macro2) [![docs-rs]](crate) +//! +//! [github]: https://img.shields.io/badge/github-8da0cb?style=for-the-badge&labelColor=555555&logo=github +//! [crates-io]: https://img.shields.io/badge/crates.io-fc8d62?style=for-the-badge&labelColor=555555&logo=rust +//! [docs-rs]: https://img.shields.io/badge/docs.rs-66c2a5?style=for-the-badge&labelColor=555555&logoColor=white&logo=data:image/svg+xml;base64,PHN2ZyByb2xlPSJpbWciIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgdmlld0JveD0iMCAwIDUxMiA1MTIiPjxwYXRoIGZpbGw9IiNmNWY1ZjUiIGQ9Ik00ODguNiAyNTAuMkwzOTIgMjE0VjEwNS41YzAtMTUtOS4zLTI4LjQtMjMuNC0zMy43bC0xMDAtMzcuNWMtOC4xLTMuMS0xNy4xLTMuMS0yNS4zIDBsLTEwMCAzNy41Yy0xNC4xIDUuMy0yMy40IDE4LjctMjMuNCAzMy43VjIxNGwtOTYuNiAzNi4yQzkuMyAyNTUuNSAwIDI2OC45IDAgMjgzLjlWMzk0YzAgMTMuNiA3LjcgMjYuMSAxOS45IDMyLjJsMTAwIDUwYzEwLjEgNS4xIDIyLjEgNS4xIDMyLjIgMGwxMDMuOS01MiAxMDMuOSA1MmMxMC4xIDUuMSAyMi4xIDUuMSAzMi4yIDBsMTAwLTUwYzEyLjItNi4xIDE5LjktMTguNiAxOS45LTMyLjJWMjgzLjljMC0xNS05LjMtMjguNC0yMy40LTMzLjd6TTM1OCAyMTQuOGwtODUgMzEuOXYtNjguMmw4NS0zN3Y3My4zek0xNTQgMTA0LjFsMTAyLTM4LjIgMTAyIDM4LjJ2LjZsLTEwMiA0MS40LTEwMi00MS40di0uNnptODQgMjkxLjFsLTg1IDQyLjV2LTc5LjFsODUtMzguOHY3NS40em0wLTExMmwtMTAyIDQxLjQtMTAyLTQxLjR2LS42bDEwMi0zOC4yIDEwMiAzOC4ydi42em0yNDAgMTEybC04NSA0Mi41di03OS4xbDg1LTM4Ljh2NzUuNHptMC0xMTJsLTEwMiA0MS40LTEwMi00MS40di0uNmwxMDItMzguMiAxMDIgMzguMnYuNnoiPjwvcGF0aD48L3N2Zz4K +//! +//!
+//! //! A wrapper around the procedural macro API of the compiler's [`proc_macro`] //! crate. This library serves two purposes: //! @@ -78,11 +86,25 @@ //! a different thread. // Proc-macro2 types in rustdoc of other crates get linked to here. -#![doc(html_root_url = "https://docs.rs/proc-macro2/1.0.27")] +#![doc(html_root_url = "https://docs.rs/proc-macro2/1.0.33")] #![cfg_attr(any(proc_macro_span, super_unstable), feature(proc_macro_span))] -#![cfg_attr(super_unstable, feature(proc_macro_raw_ident, proc_macro_def_site))] +#![cfg_attr(super_unstable, feature(proc_macro_def_site))] #![cfg_attr(doc_cfg, feature(doc_cfg))] -#![allow(clippy::needless_doctest_main, clippy::vec_init_then_push)] +#![allow( + clippy::cast_lossless, + clippy::cast_possible_truncation, + clippy::doc_markdown, + clippy::items_after_statements, + clippy::manual_assert, + clippy::must_use_candidate, + clippy::needless_doctest_main, + clippy::shadow_unrelated, + clippy::trivially_copy_pass_by_ref, + clippy::unnecessary_wraps, + clippy::unused_self, + clippy::used_underscore_binding, + clippy::vec_init_then_push +)] #[cfg(use_proc_macro)] extern crate proc_macro; @@ -210,14 +232,14 @@ impl From for TokenStream { impl Extend for TokenStream { fn extend>(&mut self, streams: I) { - self.inner.extend(streams) + self.inner.extend(streams); } } impl Extend for TokenStream { fn extend>(&mut self, streams: I) { self.inner - .extend(streams.into_iter().map(|stream| stream.inner)) + .extend(streams.into_iter().map(|stream| stream.inner)); } } @@ -388,7 +410,7 @@ impl Span { /// of the macro. This is the same hygiene behavior as `macro_rules`. /// /// This function requires Rust 1.45 or later. - #[cfg(hygiene)] + #[cfg(not(no_hygiene))] pub fn mixed_site() -> Span { Span::_new(imp::Span::mixed_site()) } @@ -706,7 +728,7 @@ impl Group { /// by this group, but rather it will only set the span of the delimiter /// tokens at the level of the `Group`. pub fn set_span(&mut self, span: Span) { - self.inner.set_span(span.inner) + self.inner.set_span(span.inner); } } @@ -977,7 +999,7 @@ impl Ord for Ident { impl Hash for Ident { fn hash(&self, hasher: &mut H) { - self.to_string().hash(hasher) + self.to_string().hash(hasher); } } diff --git a/third_party/rust/proc-macro2/src/parse.rs b/third_party/rust/proc-macro2/src/parse.rs index 13a05a89a436..e6e2b44dc1dd 100644 --- a/third_party/rust/proc-macro2/src/parse.rs +++ b/third_party/rust/proc-macro2/src/parse.rs @@ -461,7 +461,7 @@ fn cooked_byte_string(mut input: Cursor) -> Result { fn raw_string(input: Cursor) -> Result { let mut chars = input.char_indices(); let mut n = 0; - while let Some((i, ch)) = chars.next() { + for (i, ch) in &mut chars { match ch { '"' => { n = i; @@ -621,8 +621,7 @@ fn float_digits(input: Cursor) -> Result { chars.next(); if chars .peek() - .map(|&ch| ch == '.' || is_ident_start(ch)) - .unwrap_or(false) + .map_or(false, |&ch| ch == '.' || is_ident_start(ch)) { return Err(Reject); } @@ -817,12 +816,12 @@ fn doc_comment(input: Cursor) -> PResult> { TokenTree::Punct(Punct::new('=', Spacing::Alone)), TokenTree::Literal(crate::Literal::string(comment)), ]; - for tt in stream.iter_mut() { + for tt in &mut stream { tt.set_span(span); } let group = Group::new(Delimiter::Bracket, stream.into_iter().collect()); trees.push(crate::Group::_new_stable(group).into()); - for tt in trees.iter_mut() { + for tt in &mut trees { tt.set_span(span); } Ok((rest, trees)) diff --git a/third_party/rust/proc-macro2/src/wrapper.rs b/third_party/rust/proc-macro2/src/wrapper.rs index 2829dd799ce3..8583ed91c8e3 100644 --- a/third_party/rust/proc-macro2/src/wrapper.rs +++ b/third_party/rust/proc-macro2/src/wrapper.rs @@ -284,9 +284,9 @@ impl Debug for LexError { impl Display for LexError { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { match self { - #[cfg(lexerror_display)] + #[cfg(not(no_lexerror_display))] LexError::Compiler(e) => Display::fmt(e, f), - #[cfg(not(lexerror_display))] + #[cfg(no_lexerror_display)] LexError::Compiler(_e) => Display::fmt( &fallback::LexError { span: fallback::Span::call_site(), @@ -416,7 +416,7 @@ impl Span { } } - #[cfg(hygiene)] + #[cfg(not(no_hygiene))] pub fn mixed_site() -> Span { if inside_proc_macro() { Span::Compiler(proc_macro::Span::mixed_site()) @@ -436,11 +436,11 @@ impl Span { pub fn resolved_at(&self, other: Span) -> Span { match (self, other) { - #[cfg(hygiene)] + #[cfg(not(no_hygiene))] (Span::Compiler(a), Span::Compiler(b)) => Span::Compiler(a.resolved_at(b)), // Name resolution affects semantics, but location is only cosmetic - #[cfg(not(hygiene))] + #[cfg(no_hygiene)] (Span::Compiler(_), Span::Compiler(_)) => other, (Span::Fallback(a), Span::Fallback(b)) => Span::Fallback(a.resolved_at(b)), @@ -450,11 +450,11 @@ impl Span { pub fn located_at(&self, other: Span) -> Span { match (self, other) { - #[cfg(hygiene)] + #[cfg(not(no_hygiene))] (Span::Compiler(a), Span::Compiler(b)) => Span::Compiler(a.located_at(b)), // Name resolution affects semantics, but location is only cosmetic - #[cfg(not(hygiene))] + #[cfg(no_hygiene)] (Span::Compiler(_), Span::Compiler(_)) => *self, (Span::Fallback(a), Span::Fallback(b)) => Span::Fallback(a.located_at(b)), @@ -620,9 +620,9 @@ impl Group { pub fn span_open(&self) -> Span { match self { - #[cfg(proc_macro_span)] + #[cfg(not(no_group_open_close))] Group::Compiler(g) => Span::Compiler(g.span_open()), - #[cfg(not(proc_macro_span))] + #[cfg(no_group_open_close)] Group::Compiler(g) => Span::Compiler(g.span()), Group::Fallback(g) => Span::Fallback(g.span_open()), } @@ -630,9 +630,9 @@ impl Group { pub fn span_close(&self) -> Span { match self { - #[cfg(proc_macro_span)] + #[cfg(not(no_group_open_close))] Group::Compiler(g) => Span::Compiler(g.span_close()), - #[cfg(not(proc_macro_span))] + #[cfg(no_group_open_close)] Group::Compiler(g) => Span::Compiler(g.span()), Group::Fallback(g) => Span::Fallback(g.span_close()), } @@ -921,18 +921,25 @@ impl FromStr for Literal { fn from_str(repr: &str) -> Result { if inside_proc_macro() { - // TODO: use libproc_macro's FromStr impl once it is available in - // rustc. https://github.com/rust-lang/rust/pull/84717 - let tokens = proc_macro_parse(repr)?; - let mut iter = tokens.into_iter(); - if let (Some(proc_macro::TokenTree::Literal(literal)), None) = - (iter.next(), iter.next()) + #[cfg(not(no_literal_from_str))] { - if literal.to_string().len() == repr.len() { - return Ok(Literal::Compiler(literal)); - } + proc_macro::Literal::from_str(repr) + .map(Literal::Compiler) + .map_err(LexError::Compiler) + } + #[cfg(no_literal_from_str)] + { + let tokens = proc_macro_parse(repr)?; + let mut iter = tokens.into_iter(); + if let (Some(proc_macro::TokenTree::Literal(literal)), None) = + (iter.next(), iter.next()) + { + if literal.to_string().len() == repr.len() { + return Ok(Literal::Compiler(literal)); + } + } + Err(LexError::call_site()) } - Err(LexError::call_site()) } else { let literal = fallback::Literal::from_str(repr)?; Ok(Literal::Fallback(literal)) diff --git a/third_party/rust/proc-macro2/tests/comments.rs b/third_party/rust/proc-macro2/tests/comments.rs index 708cccb880ba..71741080cd1c 100644 --- a/third_party/rust/proc-macro2/tests/comments.rs +++ b/third_party/rust/proc-macro2/tests/comments.rs @@ -1,16 +1,16 @@ use proc_macro2::{Delimiter, Literal, Spacing, TokenStream, TokenTree}; // #[doc = "..."] -> "..." -fn lit_of_outer_doc_comment(tokens: TokenStream) -> Literal { +fn lit_of_outer_doc_comment(tokens: &TokenStream) -> Literal { lit_of_doc_comment(tokens, false) } // #![doc = "..."] -> "..." -fn lit_of_inner_doc_comment(tokens: TokenStream) -> Literal { +fn lit_of_inner_doc_comment(tokens: &TokenStream) -> Literal { lit_of_doc_comment(tokens, true) } -fn lit_of_doc_comment(tokens: TokenStream, inner: bool) -> Literal { +fn lit_of_doc_comment(tokens: &TokenStream, inner: bool) -> Literal { let mut iter = tokens.clone().into_iter(); match iter.next().unwrap() { TokenTree::Punct(punct) => { @@ -71,30 +71,30 @@ fn incomplete() { #[test] fn lit() { let stream = "/// doc".parse::().unwrap(); - let lit = lit_of_outer_doc_comment(stream); + let lit = lit_of_outer_doc_comment(&stream); assert_eq!(lit.to_string(), "\" doc\""); let stream = "//! doc".parse::().unwrap(); - let lit = lit_of_inner_doc_comment(stream); + let lit = lit_of_inner_doc_comment(&stream); assert_eq!(lit.to_string(), "\" doc\""); let stream = "/** doc */".parse::().unwrap(); - let lit = lit_of_outer_doc_comment(stream); + let lit = lit_of_outer_doc_comment(&stream); assert_eq!(lit.to_string(), "\" doc \""); let stream = "/*! doc */".parse::().unwrap(); - let lit = lit_of_inner_doc_comment(stream); + let lit = lit_of_inner_doc_comment(&stream); assert_eq!(lit.to_string(), "\" doc \""); } #[test] fn carriage_return() { let stream = "///\r\n".parse::().unwrap(); - let lit = lit_of_outer_doc_comment(stream); + let lit = lit_of_outer_doc_comment(&stream); assert_eq!(lit.to_string(), "\"\""); let stream = "/**\r\n*/".parse::().unwrap(); - let lit = lit_of_outer_doc_comment(stream); + let lit = lit_of_outer_doc_comment(&stream); assert_eq!(lit.to_string(), "\"\\r\\n\""); "///\r".parse::().unwrap_err(); diff --git a/third_party/rust/proc-macro2/tests/marker.rs b/third_party/rust/proc-macro2/tests/marker.rs index 70e57677cd09..4fb2beb8e94e 100644 --- a/third_party/rust/proc-macro2/tests/marker.rs +++ b/third_party/rust/proc-macro2/tests/marker.rs @@ -1,4 +1,6 @@ -use proc_macro2::*; +use proc_macro2::{ + Delimiter, Group, Ident, LexError, Literal, Punct, Spacing, Span, TokenStream, TokenTree, +}; macro_rules! assert_impl { ($ty:ident is $($marker:ident) and +) => { @@ -51,7 +53,7 @@ assert_impl!(TokenTree is not Send or Sync); #[cfg(procmacro2_semver_exempt)] mod semver_exempt { - use super::*; + use proc_macro2::{LineColumn, SourceFile}; assert_impl!(LineColumn is Send and Sync); @@ -60,7 +62,11 @@ mod semver_exempt { #[cfg(not(no_libprocmacro_unwind_safe))] mod unwind_safe { - use super::*; + use proc_macro2::{ + Delimiter, Group, Ident, LexError, Literal, Punct, Spacing, Span, TokenStream, TokenTree, + }; + #[cfg(procmacro2_semver_exempt)] + use proc_macro2::{LineColumn, SourceFile}; use std::panic::{RefUnwindSafe, UnwindSafe}; macro_rules! assert_unwind_safe { diff --git a/third_party/rust/proc-macro2/tests/test.rs b/third_party/rust/proc-macro2/tests/test.rs index 75a880f5eae7..ab823907a603 100644 --- a/third_party/rust/proc-macro2/tests/test.rs +++ b/third_party/rust/proc-macro2/tests/test.rs @@ -1,3 +1,5 @@ +#![allow(clippy::non_ascii_literal)] + use proc_macro2::{Ident, Literal, Punct, Spacing, Span, TokenStream, TokenTree}; use std::panic; use std::str::{self, FromStr}; @@ -166,7 +168,11 @@ fn literal_iter_negative() { #[test] fn literal_parse() { assert!("1".parse::().is_ok()); + assert!("-1".parse::().is_ok()); + assert!("-1u12".parse::().is_ok()); assert!("1.0".parse::().is_ok()); + assert!("-1.0".parse::().is_ok()); + assert!("-1.0f12".parse::().is_ok()); assert!("'a'".parse::().is_ok()); assert!("\"\n\"".parse::().is_ok()); assert!("0 1".parse::().is_err()); @@ -175,6 +181,9 @@ fn literal_parse() { assert!("/* comment */0".parse::().is_err()); assert!("0/* comment */".parse::().is_err()); assert!("0// comment".parse::().is_err()); + assert!("- 1".parse::().is_err()); + assert!("- 1.0".parse::().is_err()); + assert!("-\"\"".parse::().is_err()); } #[test] @@ -183,7 +192,7 @@ fn roundtrip() { println!("parse: {}", p); let s = p.parse::().unwrap().to_string(); println!("first: {}", s); - let s2 = s.to_string().parse::().unwrap().to_string(); + let s2 = s.parse::().unwrap().to_string(); assert_eq!(s, s2); } roundtrip("a"); @@ -479,7 +488,7 @@ TokenStream [ #[test] fn default_tokenstream_is_empty() { - let default_token_stream: TokenStream = Default::default(); + let default_token_stream = ::default(); assert!(default_token_stream.is_empty()); } diff --git a/third_party/rust/proc-macro2/tests/test_fmt.rs b/third_party/rust/proc-macro2/tests/test_fmt.rs index 99a0aee5c864..93dd19e3c6f3 100644 --- a/third_party/rust/proc-macro2/tests/test_fmt.rs +++ b/third_party/rust/proc-macro2/tests/test_fmt.rs @@ -1,3 +1,5 @@ +#![allow(clippy::from_iter_instead_of_collect)] + use proc_macro2::{Delimiter, Group, Ident, Span, TokenStream, TokenTree}; use std::iter::{self, FromIterator}; @@ -12,7 +14,7 @@ fn test_fmt_group() { let braces_empty = Group::new(Delimiter::Brace, TokenStream::new()); let braces_nonempty = Group::new(Delimiter::Brace, inner.clone()); let none_empty = Group::new(Delimiter::None, TokenStream::new()); - let none_nonempty = Group::new(Delimiter::None, inner.clone()); + let none_nonempty = Group::new(Delimiter::None, inner); // Matches libproc_macro. assert_eq!("()", parens_empty.to_string()); diff --git a/third_party/rust/profiling/.cargo-checksum.json b/third_party/rust/profiling/.cargo-checksum.json index d372609c68d3..26c94f13bb4a 100644 --- a/third_party/rust/profiling/.cargo-checksum.json +++ b/third_party/rust/profiling/.cargo-checksum.json @@ -1 +1 @@ -{"files":{"CHANGELOG.md":"f51e0f29869f9a19db8c84c65a114eaff3815f1fb391f2269328c2b0ad6f439e","Cargo.lock":"35332957d477595735c0d32ae184327bcb3bfcced0b58c451f367f2025b3d6ea","Cargo.toml":"eae8ced983df9d1e137f1b050f33cf97244ea910201df85d94b68eb644bfc9f4","LICENSE-APACHE":"10d30a673cd5e9349bdc02aeb48f14b3386d27d0da32df8f0a555d4aa16aa551","LICENSE-MIT":"c8167fdeeed46d3f244d3f85c5bf998ce889343691c32be2c61a8bc4b5c08333","README.md":"d688bee6ba297331fbf12fdd2f7c0d4fb3465a5e81d9a47b6267ee019200e8e9","deny.toml":"b934c6446590feb984c68ddde5ec871ea3c2605586500d8a895b856f2158deb6","examples/puffin/NotoSans-Medium.ttf":"a0cf3e73ac27bff9a4c22f2807c84e1eb3d0740134e84f5455b0a39c14a76e11","examples/puffin/imgui_support.rs":"aa00824f2395b426d337df3b00ac94339237a7083d4ba498aa4b9b1e0f920165","examples/puffin/puffin.rs":"8ad5e4b37cc0c846287026dbd7523f65b5076dac12725f98566b20cddb29cba9","examples/puffin/renderer.rs":"3c5feca1a49932af6bd62887bdf29ac5ae8c45cf5c946653f060164cd39386f8","examples/puffin/shaders/compile_shaders.sh":"469d31610eb329b8d3dfb75b507f7dde309b8fb3d920794a7bfef47225843b84","examples/puffin/shaders/glsl/debug.frag":"e4a99b94f6d42aaf55b456e0afff41d3e0cf2e1217b9fa62a62d61f0b8d6ea4a","examples/puffin/shaders/glsl/debug.glsl":"e382ab582e1cc23d8f930f747856f3e264d1f63252e75e63feb37ba7cebb19b9","examples/puffin/shaders/glsl/debug.vert":"4a08d77df2f1093b25b10bae91404ca2215a2fbcb5874655073bc6610eec993a","examples/puffin/shaders/glsl/imgui.frag":"708cbf92892ff47129619fa4a1b49d8d92fd25c334ca1db297abdc3ff856bf75","examples/puffin/shaders/glsl/imgui.glsl":"f820afd23488f9f8923dc88d441fed7a8e8672167a478dde9c8da17ebe480f3a","examples/puffin/shaders/glsl/imgui.vert":"da01186c7a11792900e83288c1afbada7ecb880f72d119b0ae0b4fb96f1977ba","examples/puffin/shaders/out/debug.frag.cookedshaderpackage":"dafc932c79b08635aeeaa19afe659bed977b830aaaf9b1064214f9b6a3aeb82f","examples/puffin/shaders/out/debug.frag.metal":"7b65c0d5c8c5b9d3fa548b903eb79c217bf3f2edc9dbfd9bf16eb7af21c9cf7f","examples/puffin/shaders/out/debug.frag.spv":"e5b04a0e7688141e0fc8183b06a11ed71e55872e959f1b0f223a706776d65d0c","examples/puffin/shaders/out/debug.vert.cookedshaderpackage":"937348362eac750a2c47f1ef51ac450e95b2c07a458ac79bff6f9192b949f4c8","examples/puffin/shaders/out/debug.vert.metal":"00927df96045f93d2567f51d3078d86fafdd25e32d26815cd9ea29919eb7c66e","examples/puffin/shaders/out/debug.vert.spv":"587ee6f2f7ceec9eda19143accb17cc82a6174f43a7af78482d725ab5fcc3d32","examples/puffin/shaders/out/imgui.frag.cookedshaderpackage":"874a1a62fbd7eb789a7a3f5f17999fe8458322638dfe8331549dff55c7a93994","examples/puffin/shaders/out/imgui.frag.metal":"213cee127005db71b091249257d4363a5ace0b0871ea5107701491d386109899","examples/puffin/shaders/out/imgui.frag.spv":"1732a8debde7c60b17e2fc71eda5ce8fd8e53e8aa62202457e32be84dac9c111","examples/puffin/shaders/out/imgui.vert.cookedshaderpackage":"6d3a61514aadd55f4d2bd06b75650c0f2097c1627addbbb44bfa650f5fc439d5","examples/puffin/shaders/out/imgui.vert.metal":"92bf7b0b224420790d9e19b9de7aaa108697b09cb7fc2d6721c25f0fef4ca518","examples/puffin/shaders/out/imgui.vert.spv":"6677d81ef23ebaf8d140f749cd1b8ec9ec4089a6a2a2f93825e0b6d9d170b2cc","examples/simple.rs":"30bfbbd3c2af76e0284ec1e693cdcf19d8916ac0edabe08d85b2116c8e59c546","rustfmt.toml":"df025a0d166890f7b73df8596d0135a441d20311c9251e39df90e552675cebf3","screenshots/optick-small.png":"f7e7aacf4abb9c33be981104b2cb513990a70a1330b558a93fffce41e9e3a4d5","screenshots/optick.jpeg":"21eba8cc720f162b68bca2b04cc2de4e503df1d8391629cf2b119c8d0703063d","screenshots/superluminal-small.png":"2a0454927d791c18e581185f28e18ae3b7c58aeaa6ebcc624a4bc1e372e78b0d","screenshots/superluminal.jpeg":"cc2e35922f0663aa8e3cdb6f77593ee98692567c0b37a1b4f839fa5973eb600b","screenshots/tracing.png":"db48a29de2b848ca39ff70f7adcc777e7c098867fb923f0903a0eba2305b1eee","screenshots/tracy-small.png":"05ad7d07ca7a45605df5c176a7963237dc7ee4b7360f04474dcb700ca965dbb0","screenshots/tracy.jpeg":"011554c1da51ceb6262b17591a659464172396f270f2476535163509e2c919eb","src/empty_impl.rs":"341753cbc92275dc45184c22d60b5192854f35d6c57fdcd68b4ba17a6df59a27","src/lib.rs":"33fa9f148a2f80410ca71fad0b6ab1587c698f318175dfb0015aca9075e75694","src/optick_impl.rs":"167d92d27ac5c0e29b022f93c64d1d3b0e08db5bf0282f8874df465ab2fbe350","src/puffin_impl.rs":"70423e2e348ea0539b253841ad0ce594dd814f60d02ca5f8413a492a8f5cf0ec","src/superluminal_impl.rs":"9bf236c5435147b090cdb1e706f0480639590c6ca1a08ce795c9bcb714a7f1f8","src/tracing_impl.rs":"92bdbd9fc760d258287df13f301f999f678f9ef742c599f7e71b668746743119","src/tracy_impl.rs":"9a6bb2b880dc3a79db8f8e66b797f799cead5ff0f6a3f2002e6321e53e63a07a","src/type_check_impl.rs":"daf88bb080b6d68e38206667a3d725948a3c836a0c0577d09354bde1e4213920"},"package":"0a7c000c0ce9d9bb94c0fbacdf20e5087fbe652c556ffb2c9387d980e17d51fb"} \ No newline at end of file +{"files":{"CHANGELOG.md":"c320908658063f54ae86ca35f294de10ac415b6f9e3fe1e57eeff18e48ec87d6","Cargo.lock":"7bbcbb6cf05624f36376b785d3ed44fca9c65c4e1fedfe45a2adbd9e433bd5a4","Cargo.toml":"9af4a2b32ad39fe398e0d9d7a747ede6c0cb179c1d7e3c850b5ceb0853632552","LICENSE-APACHE":"10d30a673cd5e9349bdc02aeb48f14b3386d27d0da32df8f0a555d4aa16aa551","LICENSE-MIT":"c8167fdeeed46d3f244d3f85c5bf998ce889343691c32be2c61a8bc4b5c08333","README.md":"69072115dbf6226b692b61b59614859eec7da816d839ff15fb2e166350f747a7","deny.toml":"be7c9c5b7046ecf143b20cc24da1693528685d5a873c8274ec0a561e3ec716a8","examples/puffin/NotoSans-Medium.ttf":"a0cf3e73ac27bff9a4c22f2807c84e1eb3d0740134e84f5455b0a39c14a76e11","examples/puffin/imgui_support.rs":"2bd5ff8808466a4e1b58aa0b273f7f88fc734ee703c1cf9ff74c29bc9ffa852d","examples/puffin/puffin.rs":"8ad5e4b37cc0c846287026dbd7523f65b5076dac12725f98566b20cddb29cba9","examples/puffin/renderer.rs":"2c978496fe70593892efb13828423ecf9585f9699180f86a592d66bb82a86d79","examples/puffin/shaders/compile_shaders.sh":"deb05796110c34178b87495adb7aa0abd8c3637effbdf1309b407113975050b2","examples/puffin/shaders/glsl/debug.frag":"e4a99b94f6d42aaf55b456e0afff41d3e0cf2e1217b9fa62a62d61f0b8d6ea4a","examples/puffin/shaders/glsl/debug.glsl":"e382ab582e1cc23d8f930f747856f3e264d1f63252e75e63feb37ba7cebb19b9","examples/puffin/shaders/glsl/debug.vert":"4a08d77df2f1093b25b10bae91404ca2215a2fbcb5874655073bc6610eec993a","examples/puffin/shaders/glsl/imgui.frag":"708cbf92892ff47129619fa4a1b49d8d92fd25c334ca1db297abdc3ff856bf75","examples/puffin/shaders/glsl/imgui.glsl":"f820afd23488f9f8923dc88d441fed7a8e8672167a478dde9c8da17ebe480f3a","examples/puffin/shaders/glsl/imgui.vert":"da01186c7a11792900e83288c1afbada7ecb880f72d119b0ae0b4fb96f1977ba","examples/puffin/shaders/out/debug.frag.cookedshaderpackage":"2545b1dbeb0dda1d06b18b3ed09ba489fde562d079b1e2581e9ebff458f91c82","examples/puffin/shaders/out/debug.frag.metal":"f97c896976106bf73b4619ef778f268a21e30530eae8af49b9d81a1c5923e6a0","examples/puffin/shaders/out/debug.frag.spv":"e5b04a0e7688141e0fc8183b06a11ed71e55872e959f1b0f223a706776d65d0c","examples/puffin/shaders/out/debug.vert.cookedshaderpackage":"ade377d4d230ccbb73abf662966cb4cf432367b96d76db4fa5a6587c382580d2","examples/puffin/shaders/out/debug.vert.metal":"00927df96045f93d2567f51d3078d86fafdd25e32d26815cd9ea29919eb7c66e","examples/puffin/shaders/out/debug.vert.spv":"587ee6f2f7ceec9eda19143accb17cc82a6174f43a7af78482d725ab5fcc3d32","examples/puffin/shaders/out/imgui.frag.cookedshaderpackage":"f2f03a7c648ae4d9743956327a0829fbba394bc48aa630e967974b3691d9b9ad","examples/puffin/shaders/out/imgui.frag.metal":"680390c8fc6e3121bdd74b804d9cda9d0b5a3eb306736a9cde362aade21b459d","examples/puffin/shaders/out/imgui.frag.spv":"1732a8debde7c60b17e2fc71eda5ce8fd8e53e8aa62202457e32be84dac9c111","examples/puffin/shaders/out/imgui.vert.cookedshaderpackage":"922e712f108609aef66466d1d49ea821ad113837ce49e8254b7c37461507f98f","examples/puffin/shaders/out/imgui.vert.metal":"331ad807aa2146ff2dfe55ae247f4f2f35856b593b22cf20d85c4a2554f61952","examples/puffin/shaders/out/imgui.vert.spv":"6677d81ef23ebaf8d140f749cd1b8ec9ec4089a6a2a2f93825e0b6d9d170b2cc","examples/simple.rs":"30bfbbd3c2af76e0284ec1e693cdcf19d8916ac0edabe08d85b2116c8e59c546","rustfmt.toml":"df025a0d166890f7b73df8596d0135a441d20311c9251e39df90e552675cebf3","screenshots/optick-small.png":"f7e7aacf4abb9c33be981104b2cb513990a70a1330b558a93fffce41e9e3a4d5","screenshots/optick.jpeg":"21eba8cc720f162b68bca2b04cc2de4e503df1d8391629cf2b119c8d0703063d","screenshots/superluminal-small.png":"2a0454927d791c18e581185f28e18ae3b7c58aeaa6ebcc624a4bc1e372e78b0d","screenshots/superluminal.jpeg":"cc2e35922f0663aa8e3cdb6f77593ee98692567c0b37a1b4f839fa5973eb600b","screenshots/tracing.png":"db48a29de2b848ca39ff70f7adcc777e7c098867fb923f0903a0eba2305b1eee","screenshots/tracy-small.png":"05ad7d07ca7a45605df5c176a7963237dc7ee4b7360f04474dcb700ca965dbb0","screenshots/tracy.jpeg":"011554c1da51ceb6262b17591a659464172396f270f2476535163509e2c919eb","src/empty_impl.rs":"341753cbc92275dc45184c22d60b5192854f35d6c57fdcd68b4ba17a6df59a27","src/lib.rs":"33fa9f148a2f80410ca71fad0b6ab1587c698f318175dfb0015aca9075e75694","src/optick_impl.rs":"167d92d27ac5c0e29b022f93c64d1d3b0e08db5bf0282f8874df465ab2fbe350","src/puffin_impl.rs":"70423e2e348ea0539b253841ad0ce594dd814f60d02ca5f8413a492a8f5cf0ec","src/superluminal_impl.rs":"9bf236c5435147b090cdb1e706f0480639590c6ca1a08ce795c9bcb714a7f1f8","src/tracing_impl.rs":"92bdbd9fc760d258287df13f301f999f678f9ef742c599f7e71b668746743119","src/tracy_impl.rs":"9a6bb2b880dc3a79db8f8e66b797f799cead5ff0f6a3f2002e6321e53e63a07a","src/type_check_impl.rs":"daf88bb080b6d68e38206667a3d725948a3c836a0c0577d09354bde1e4213920"},"package":"9926767b8b8244d7b6b64546585121d193c3d0b4856ccd656b7bfa9deb91ab6a"} \ No newline at end of file diff --git a/third_party/rust/profiling/CHANGELOG.md b/third_party/rust/profiling/CHANGELOG.md index 282824cedf8c..d6fe21830b22 100644 --- a/third_party/rust/profiling/CHANGELOG.md +++ b/third_party/rust/profiling/CHANGELOG.md @@ -1,7 +1,17 @@ # Changelog -## Unpublished +## 1.0.4 + * Update puffin to 0.10 + +## 1.0.3 + * Update puffin to 0.6 and puffin-imgui to 0.8 + +## 1.0.2 + * Fix tracing backend failing to compile when tracing crate is not a dependency in the downstream crate + +## 1.0.1 * Rework feature flags so that downstream *libraries* no longer have to add feature flags per profiling backend. + * Add a backend that does type checking (for CI purposes) ## 1.0.0 * Republish 0.1.10 as 1.0.0 diff --git a/third_party/rust/profiling/Cargo.lock b/third_party/rust/profiling/Cargo.lock index d06a7a982d51..ecf1e5ea8d85 100644 --- a/third_party/rust/profiling/Cargo.lock +++ b/third_party/rust/profiling/Cargo.lock @@ -1,16 +1,33 @@ # This file is automatically @generated by Cargo. # It is not intended for manual editing. +version = 3 + [[package]] name = "ab_glyph_rasterizer" -version = "0.1.4" +version = "0.1.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d9fe5e32de01730eb1f6b7f5b51c17e03e2325bf40a74f754f04f130043affff" +checksum = "a13739d7177fbd22bb0ed28badfff9f372f8bef46c863db4e1c6248f6b223b6e" + +[[package]] +name = "addr2line" +version = "0.16.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3e61f2b7f93d2c7d2b08263acaa4a363b3e276806c68af6134c44f523bf1aacd" +dependencies = [ + "gimli", +] + +[[package]] +name = "adler" +version = "1.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f26201604c87b1e01bd3d98f8d5d9a8fcbb815e8cedb41ffccbeb4bf593a35fe" [[package]] name = "aho-corasick" -version = "0.7.15" +version = "0.7.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7404febffaa47dac81aa44dba71523c9d069b1bdc50a77db41195149e17f68e5" +checksum = "1e37cfd5e7657ada45f742d6e99ca5788580b5c529dc78faf11ece6dc702656f" dependencies = [ "memchr", ] @@ -34,7 +51,7 @@ version = "0.12.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d52a9bb7ec0cf484c551830a7ce27bd20d67eac647e1befb56b0be4ee39a55d2" dependencies = [ - "winapi 0.3.9", + "winapi", ] [[package]] @@ -45,11 +62,11 @@ checksum = "23b62fc65de8e4e7f52534fb52b0f3ed04746ae267519eef2a83941e8085068b" [[package]] name = "ash" -version = "0.32.0" +version = "0.32.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "77ea56be8250318e64923c7e65b82a35b5c29dfb6dc1c7d1c0b288c4b1bbb084" +checksum = "06063a002a77d2734631db74e8f4ce7148b77fe522e6bca46f2ae7774fd48112" dependencies = [ - "libloading 0.7.0", + "libloading 0.7.1", ] [[package]] @@ -71,7 +88,7 @@ checksum = "d9b39be18770d11421cdb1b9947a45dd3f37e93092cbf377614828a319d5fee8" dependencies = [ "hermit-abi", "libc", - "winapi 0.3.9", + "winapi", ] [[package]] @@ -81,20 +98,34 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "cdb031dd78e28731d87d56cc8ffef4a8f36ca26c38fe2de700543e627f8a464a" [[package]] -name = "bincode" -version = "1.3.2" +name = "backtrace" +version = "0.3.62" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d175dfa69e619905c4c3cdb7c3c203fa3bdd5d51184e3afdb2742c0280493772" +checksum = "091bcdf2da9950f96aa522681ce805e6857f6ca8df73833d35736ab2dc78e152" +dependencies = [ + "addr2line", + "cc", + "cfg-if 1.0.0", + "libc", + "miniz_oxide", + "object", + "rustc-demangle", +] + +[[package]] +name = "bincode" +version = "1.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b1f45e9417d87227c7a56d22e471c6206462cba514c7590c09aff4cf6d1ddcad" dependencies = [ - "byteorder", "serde", ] [[package]] name = "bitflags" -version = "1.2.1" +version = "1.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cf1de2fe8c75bc145a2f577add951f8134889b4795d47466a54a5c846d691693" +checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" [[package]] name = "block" @@ -103,10 +134,16 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0d8c1fef690941d3e7788d328517591fecc684c084084702d6ff1641e993699a" [[package]] -name = "byteorder" -version = "1.3.4" +name = "bumpalo" +version = "3.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "08c48aae112d48ed9f069b33538ea9e3e90aa263cfa3d1c24309612b1f7472de" +checksum = "8f1e260c3a9040a7c19a12468758f4c16f31a81a1fe087482be9570ec864bb6c" + +[[package]] +name = "byteorder" +version = "1.4.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "14c189c53d098945499cdfa7ecc63567cf3886b3332b312a5b4585d8d3a6a610" [[package]] name = "calloop" @@ -120,9 +157,9 @@ dependencies = [ [[package]] name = "cc" -version = "1.0.67" +version = "1.0.71" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e3c69b077ad434294d3ce9f1f6143a2a4b89a8a2d54ef813d85003a4fd1137fd" +checksum = "79c2681d6594606957bbb8631c4b90a7fcaaa72cdb714743a437b156d6a7eedd" [[package]] name = "cfg-if" @@ -151,7 +188,7 @@ dependencies = [ "libc", "num-integer", "num-traits", - "winapi 0.3.9", + "winapi", ] [[package]] @@ -163,7 +200,7 @@ dependencies = [ "bitflags", "block", "cocoa-foundation", - "core-foundation 0.9.1", + "core-foundation 0.9.2", "core-graphics 0.22.2", "foreign-types", "libc", @@ -178,7 +215,7 @@ checksum = "7ade49b65d560ca58c403a479bb396592b155c0185eada742ee323d1d68d6318" dependencies = [ "bitflags", "block", - "core-foundation 0.9.1", + "core-foundation 0.9.2", "core-graphics-types", "foreign-types", "libc", @@ -197,11 +234,11 @@ dependencies = [ [[package]] name = "core-foundation" -version = "0.9.1" +version = "0.9.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0a89e2ae426ea83155dccf10c0fa6b1463ef6d5fcb44cee0b224a408fa640a62" +checksum = "6888e10551bb93e424d8df1d07f1a8b4fceb0001a3a4b048bfc47554946f47b3" dependencies = [ - "core-foundation-sys 0.8.2", + "core-foundation-sys 0.8.3", "libc", ] @@ -213,9 +250,9 @@ checksum = "b3a71ab494c0b5b860bdc8407ae08978052417070c2ced38573a9157ad75b8ac" [[package]] name = "core-foundation-sys" -version = "0.8.2" +version = "0.8.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ea221b5284a47e40033bf9b66f35f984ec0ea2931eb03505246cd27a963f981b" +checksum = "5827cebf4670468b8772dd191856768aedcb1b0278a04f989f7766351917b9dc" [[package]] name = "core-graphics" @@ -236,7 +273,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "269f35f69b542b80e736a20a89a05215c0ce80c2c03c514abb2e318b78379d86" dependencies = [ "bitflags", - "core-foundation 0.9.1", + "core-foundation 0.9.2", "core-graphics-types", "foreign-types", "libc", @@ -249,7 +286,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3a68b68b3446082644c91ac778bf50cd4104bfb002b5a6a7c44cca5a2c70788b" dependencies = [ "bitflags", - "core-foundation 0.9.1", + "core-foundation 0.9.2", "foreign-types", "libc", ] @@ -268,10 +305,58 @@ dependencies = [ ] [[package]] -name = "crossbeam-channel" -version = "0.5.0" +name = "crossbeam" +version = "0.8.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dca26ee1f8d361640700bde38b2c37d8c22b3ce2d360e1fc1c74ea4b0aa7d775" +checksum = "4ae5588f6b3c3cb05239e90bd110f257254aecd01e4635400391aeae07497845" +dependencies = [ + "cfg-if 1.0.0", + "crossbeam-channel", + "crossbeam-deque", + "crossbeam-epoch", + "crossbeam-queue", + "crossbeam-utils", +] + +[[package]] +name = "crossbeam-channel" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "06ed27e177f16d65f0f0c22a213e17c696ace5dd64b14258b52f9417ccb52db4" +dependencies = [ + "cfg-if 1.0.0", + "crossbeam-utils", +] + +[[package]] +name = "crossbeam-deque" +version = "0.8.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6455c0ca19f0d2fbf751b908d5c55c1f5cbc65e03c4225427254b46890bdde1e" +dependencies = [ + "cfg-if 1.0.0", + "crossbeam-epoch", + "crossbeam-utils", +] + +[[package]] +name = "crossbeam-epoch" +version = "0.9.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4ec02e091aa634e2c3ada4a392989e7c3116673ef0ac5b72232439094d73b7fd" +dependencies = [ + "cfg-if 1.0.0", + "crossbeam-utils", + "lazy_static", + "memoffset", + "scopeguard", +] + +[[package]] +name = "crossbeam-queue" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9b10ddc024425c88c2ad148c1b0fd53f4c6d38db9697c9f1588381212fa657c9" dependencies = [ "cfg-if 1.0.0", "crossbeam-utils", @@ -279,11 +364,10 @@ dependencies = [ [[package]] name = "crossbeam-utils" -version = "0.8.3" +version = "0.8.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e7e9d99fa91428effe99c5c6d4634cdeba32b8cf784fc428a2a687f61a952c49" +checksum = "d82cfc11ce7f2c3faef78d8a684447b40d503d9681acebed6cb728d45940c4db" dependencies = [ - "autocfg", "cfg-if 1.0.0", "lazy_static", ] @@ -334,6 +418,26 @@ dependencies = [ "syn", ] +[[package]] +name = "dirs" +version = "3.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "30baa043103c9d0c2a57cf537cc2f35623889dc0d405e6c3cccfadbc81c71309" +dependencies = [ + "dirs-sys", +] + +[[package]] +name = "dirs-sys" +version = "0.3.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "03d86534ed367a67548dc68113a0f5db55432fdfbb6e6f9d77704397d95d5780" +dependencies = [ + "libc", + "redox_users", + "winapi", +] + [[package]] name = "dispatch" version = "0.2.0" @@ -355,7 +459,7 @@ version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ac1b7517328c04c2aa68422fc60a41b92208182142ed04a25879c26c8f878794" dependencies = [ - "libloading 0.7.0", + "libloading 0.7.1", ] [[package]] @@ -399,35 +503,64 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "00b0228411908ca8685dba7fc2cdd70ec9990a6e753e89b6ac91a84c40fbaf4b" [[package]] -name = "fuchsia-zircon" -version = "0.3.3" +name = "getrandom" +version = "0.2.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2e9763c69ebaae630ba35f74888db465e49e259ba1bc0eda7d06f4a067615d82" +checksum = "7fcd999463524c52659517fe2cea98493cfe485d10565e7b0fb07dbba7ad2753" dependencies = [ - "bitflags", - "fuchsia-zircon-sys", + "cfg-if 1.0.0", + "libc", + "wasi", ] [[package]] -name = "fuchsia-zircon-sys" -version = "0.3.3" +name = "gimli" +version = "0.25.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3dcaa9ae7725d12cdb85b3ad99a434db70b468c09ded17e012d86b5c1010f7a7" +checksum = "f0a01e0497841a3b2db4f8afa483cce65f7e96a3498bd6c541734792aeac8fe7" [[package]] name = "glam" version = "0.8.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b00572b5b10070ac495be20a25b4c8d379d20bcdec8ea0c870022b620ec79b20" + +[[package]] +name = "glam" +version = "0.13.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "70155b56080764b8b758e91e4c63d06da0262c0c939f2cd991cd1382087147df" dependencies = [ "serde", + "spirv-std", +] + +[[package]] +name = "gpu-allocator" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c6115dafe080f3f6ddab8250559d66990b596f2a235e57f7306daf5c5b5c199a" +dependencies = [ + "ash", + "backtrace", + "log", + "thiserror", +] + +[[package]] +name = "heck" +version = "0.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6d621efb26863f0e9924c6ac577e8275e5e6b77455db64ffa6c65c904e9e132c" +dependencies = [ + "unicode-segmentation", ] [[package]] name = "hermit-abi" -version = "0.1.18" +version = "0.1.19" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "322f4de77956e22ed0e5032c359a0f1273f1f7f0d79bfa3b8ffbc730d7fbcc5c" +checksum = "62b467343b94ba476dcb2500d242dadbb39557df889310ac77c5d99100aaac33" dependencies = [ "libc", ] @@ -449,9 +582,9 @@ checksum = "b9e0384b61958566e926dc50660321d12159025e767c18e043daf26b70104c39" [[package]] name = "imgui" -version = "0.7.0" +version = "0.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "24cfcf6e3326886321c5d637caf1ce217006651059015fae372b1c49c0e722b2" +checksum = "4edc4023dc7b1161e25ec9bcee478173f97d6f618a1d04eced2d559ce03119b4" dependencies = [ "bitflags", "imgui-sys", @@ -460,9 +593,9 @@ dependencies = [ [[package]] name = "imgui-sys" -version = "0.7.0" +version = "0.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "85ca00be6b78bf02b57e91468cf19d08dfcc11d0fb3c2f3dc491c29404d8d330" +checksum = "0914d5ebaec1086300b970defc7ed71edc2cf102bdc3dd75fd51179549d4455b" dependencies = [ "cc", "chlorine", @@ -470,9 +603,9 @@ dependencies = [ [[package]] name = "imgui-winit-support" -version = "0.7.0" +version = "0.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d632440e05c964e8a7f00f2659c4f71c97897d8c38a77a0c2dc1f3fe8d632208" +checksum = "86a8c368182829141da5d22c352684d01e64359daa1a4550df4a2976836aa8e3" dependencies = [ "imgui", "winit", @@ -480,27 +613,21 @@ dependencies = [ [[package]] name = "instant" -version = "0.1.9" +version = "0.1.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "61124eeebbd69b8190558df225adf7e4caafce0d743919e5d6b19652314ec5ec" +checksum = "7a5bbe824c507c5da5956355e86a746d82e0e1464f65d862cc5e71da70e94b2c" dependencies = [ "cfg-if 1.0.0", -] - -[[package]] -name = "iovec" -version = "0.1.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b2b3ea6ff95e175473f8ffe6a7eb7c00d054240321b84c57051175fe3c1e075e" -dependencies = [ - "libc", + "js-sys", + "wasm-bindgen", + "web-sys", ] [[package]] name = "itoa" -version = "0.4.7" +version = "0.4.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dd25036021b0de88a0aff6b850051563c6516d0bf53f8638938edbb9de732736" +checksum = "b71991ff56294aa922b450139ee08b3bfc70982c6b2c7562771375cf73542dd4" [[package]] name = "jni-sys" @@ -509,13 +636,12 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8eaf4bc02d17cbdd7ff4c7438cafcdf7fb9a4613313ad11b4f8fefe7d3fa0130" [[package]] -name = "kernel32-sys" -version = "0.2.2" +name = "js-sys" +version = "0.3.55" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7507624b29483431c0ba2d82aece8ca6cdba9382bff4ddd0f7490560c056098d" +checksum = "7cc9ffccd38c451a86bf13657df244e9c3f37493cce8e5e21e940963777acc84" dependencies = [ - "winapi 0.2.8", - "winapi-build", + "wasm-bindgen", ] [[package]] @@ -524,17 +650,11 @@ version = "1.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" -[[package]] -name = "lazycell" -version = "1.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "830d08ce1d1d941e6b30645f1a0eb5643013d835ce3779a5fc208261dbe10f55" - [[package]] name = "libc" -version = "0.2.88" +version = "0.2.106" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "03b07a082330a35e43f63177cc01689da34fbffa0105e1246cf0311472cac73a" +checksum = "a60553f9a9e039a333b4e9b20573b9e9b9c0bb3a11e201ccc48ef4283456d673" [[package]] name = "libloading" @@ -543,24 +663,30 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "351a32417a12d5f7e82c368a66781e307834dae04c6ce0cd4456d52989229883" dependencies = [ "cfg-if 1.0.0", - "winapi 0.3.9", + "winapi", ] [[package]] name = "libloading" -version = "0.7.0" +version = "0.7.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6f84d96438c15fcd6c3f244c8fce01d1e2b9c6b5623e9c711dc9286d8fc92d6a" +checksum = "c0cf036d15402bea3c5d4de17b3fce76b3e4a56ebc1f577be0e7a72f7c607cf0" dependencies = [ "cfg-if 1.0.0", - "winapi 0.3.9", + "winapi", ] [[package]] -name = "lock_api" -version = "0.4.2" +name = "libm" +version = "0.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dd96ffd135b2fd7b973ac026d28085defbe8983df057ced3eb4f2130b0831312" +checksum = "c7d73b3f436185384286bd8098d17ec07c9a7d2388a6599f824d8502b529702a" + +[[package]] +name = "lock_api" +version = "0.4.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "712a4d093c9976e24e7dbca41db895dabcbac38eb5f4045393d17a95bdfb1109" dependencies = [ "scopeguard", ] @@ -592,17 +718,11 @@ dependencies = [ "regex-automata", ] -[[package]] -name = "maybe-uninit" -version = "2.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "60302e4db3a61da70c0cb7991976248362f30319e88850c487b9b95bbf059e00" - [[package]] name = "memchr" -version = "2.3.4" +version = "2.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0ee1c47aaa256ecabcaea351eae4a9b01ef39ed810004e298d2511ed284b1525" +checksum = "308cc39be01b73d0d18f82a0e7b2a3df85245f84af96fdddc5d202d27e47b86a" [[package]] name = "memmap2" @@ -614,53 +734,75 @@ dependencies = [ ] [[package]] -name = "mio" -version = "0.6.23" +name = "memoffset" +version = "0.6.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4afd66f5b91bf2a3bc13fad0e21caedac168ca4c707504e75585648ae80e4cc4" +checksum = "59accc507f1338036a0477ef61afdae33cde60840f4dfe481319ce3ad116ddf9" dependencies = [ - "cfg-if 0.1.10", - "fuchsia-zircon", - "fuchsia-zircon-sys", - "iovec", - "kernel32-sys", - "libc", - "log", - "miow", - "net2", - "slab", - "winapi 0.2.8", + "autocfg", ] [[package]] -name = "mio-extras" -version = "2.0.6" +name = "minimal-lexical" +version = "0.1.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "52403fe290012ce777c4626790c8951324a2b9e3316b3143779c72b029742f19" +checksum = "9c64630dcdd71f1a64c435f54885086a0de5d6a12d104d69b165fb7d5286d677" + +[[package]] +name = "miniz_oxide" +version = "0.4.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a92518e98c078586bc6c934028adcca4c92a53d6a958196de835170a01d84e4b" dependencies = [ - "lazycell", + "adler", + "autocfg", +] + +[[package]] +name = "mio" +version = "0.7.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8067b404fe97c70829f082dec8bcf4f71225d7eaea1d8645349cb76fa06205cc" +dependencies = [ + "libc", + "log", + "miow", + "ntapi", + "winapi", +] + +[[package]] +name = "mio-misc" +version = "1.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0ddf05411bb159cdb5801bb10002afb66cb4572be656044315e363460ce69dc2" +dependencies = [ + "crossbeam", + "crossbeam-queue", "log", "mio", - "slab", ] [[package]] name = "miow" -version = "0.2.2" +version = "0.3.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ebd808424166322d4a38da87083bfddd3ac4c131334ed55856112eb06d46944d" +checksum = "b9f1c5b025cda876f66ef43a113f91ebc9f4ccef34843000e0adf6ebbab84e21" dependencies = [ - "kernel32-sys", - "net2", - "winapi 0.2.8", - "ws2_32-sys", + "winapi", ] [[package]] -name = "ndk" -version = "0.2.1" +name = "natord" +version = "1.0.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5eb167c1febed0a496639034d0c76b3b74263636045db5489eee52143c246e73" +checksum = "308d96db8debc727c3fd9744aac51751243420e46edf401010908da7f8d5e57c" + +[[package]] +name = "ndk" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8794322172319b972f528bf90c6b467be0079f1fa82780ffb431088e741a73ab" dependencies = [ "jni-sys", "ndk-sys", @@ -670,9 +812,9 @@ dependencies = [ [[package]] name = "ndk-glue" -version = "0.2.1" +version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bdf399b8b7a39c6fb153c4ec32c72fd5fe789df24a647f229c239aa7adb15241" +checksum = "c5caf0c24d51ac1c905c27d4eda4fa0635bbe0de596b8f79235e0b17a4d29385" dependencies = [ "lazy_static", "libc", @@ -689,7 +831,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "05d1c6307dc424d0f65b9b06e94f88248e6305726b14729fd67a5e47b2dc481d" dependencies = [ "darling", - "proc-macro-crate", + "proc-macro-crate 0.1.5", "proc-macro2", "quote", "syn", @@ -701,17 +843,6 @@ version = "0.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c44922cb3dbb1c70b5e5f443d63b64363a898564d739ba5198e3a9138442868d" -[[package]] -name = "net2" -version = "0.2.37" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "391630d12b68002ae1e25e8f974306474966550ad82dac6886fb8910c19568ae" -dependencies = [ - "cfg-if 0.1.10", - "libc", - "winapi 0.3.9", -] - [[package]] name = "nix" version = "0.18.0" @@ -738,14 +869,24 @@ dependencies = [ [[package]] name = "nom" -version = "6.1.2" +version = "7.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e7413f999671bd4745a7b624bd370a569fb6bc574b23c83a3c5ed2e453f3d5e2" +checksum = "7ffd9d26838a953b4af82cbeb9f1592c6798916983959be223a7124e992742c1" dependencies = [ "memchr", + "minimal-lexical", "version_check", ] +[[package]] +name = "ntapi" +version = "0.3.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3f6bb902e437b6d86e03cce10a7e2af662292c5dfef23b65899ea3ac9354ad44" +dependencies = [ + "winapi", +] + [[package]] name = "num-integer" version = "0.1.44" @@ -763,13 +904,14 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9a64b1ec5cda2586e284722486d802acf1f7dbdc623e2bfc57e65ca1cd099290" dependencies = [ "autocfg", + "libm", ] [[package]] name = "num_enum" -version = "0.4.3" +version = "0.5.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ca565a7df06f3d4b485494f25ba05da1435950f4dc263440eda7a6fa9b8e36e4" +checksum = "3f9bd055fb730c4f8f4f57d45d35cd6b3f0980535b056dc7ff119cee6a66ed6f" dependencies = [ "derivative", "num_enum_derive", @@ -777,11 +919,11 @@ dependencies = [ [[package]] name = "num_enum_derive" -version = "0.4.3" +version = "0.5.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ffa5a33ddddfee04c0283a7653987d634e880347e96b5b2ed64de07efb59db9d" +checksum = "486ea01961c4a818096de679a8b740b26d9033146ac5291b1c98557658f8cdd9" dependencies = [ - "proc-macro-crate", + "proc-macro-crate 1.1.0", "proc-macro2", "quote", "syn", @@ -797,10 +939,19 @@ dependencies = [ ] [[package]] -name = "once_cell" -version = "1.7.2" +name = "object" +version = "0.27.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "af8b08b04175473088b46763e51ee54da5f9a164bc162f615b91bc179dbf15a3" +checksum = "67ac1d3f9a1d3616fd9a60c8d74296f22406a238b6a72f5cc1e6f314df4ffbf9" +dependencies = [ + "memchr", +] + +[[package]] +name = "once_cell" +version = "1.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "692fcb63b64b1758029e0a96ee63e049ce8c5948587f2f7208df04625e5f6b56" [[package]] name = "optick" @@ -819,9 +970,9 @@ dependencies = [ [[package]] name = "parking_lot" -version = "0.11.1" +version = "0.11.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6d7744ac029df22dca6284efe4e898991d28e3085c706c972bcd7da4a27a15eb" +checksum = "7d17b78036a60663b797adeaee46f5c9dfebb86948d1255007a1d6be0271ff99" dependencies = [ "instant", "lock_api", @@ -830,16 +981,16 @@ dependencies = [ [[package]] name = "parking_lot_core" -version = "0.8.3" +version = "0.8.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fa7a782938e745763fe6907fc6ba86946d72f49fe7e21de074e08128a99fb018" +checksum = "d76e8e1493bcac0d2766c42737f34458f1c8c50c0d23bcb24ea953affb273216" dependencies = [ "cfg-if 1.0.0", "instant", "libc", "redox_syscall", "smallvec", - "winapi 0.3.9", + "winapi", ] [[package]] @@ -850,15 +1001,15 @@ checksum = "d4fd5641d01c8f18a23da7b6fe29298ff4b55afcccdf78973b24cf3175fee32e" [[package]] name = "pin-project-lite" -version = "0.2.6" +version = "0.2.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dc0e1f259c92177c30a4c9d177246edd0a3568b25756a977d0632cf8fa37e905" +checksum = "8d31d11c69a6b52a174b42bdc0c30e5e11670f90788b2c471c31c1d17d449443" [[package]] name = "pkg-config" -version = "0.3.19" +version = "0.3.22" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3831453b3449ceb48b6d9c7ad7c96d5ea673e9b470a1dc578c2ce6521230884c" +checksum = "12295df4f294471248581bc09bef3c38a5e46f1e36d6a37353621a0c6c357e1f" [[package]] name = "proc-macro-crate" @@ -870,36 +1021,46 @@ dependencies = [ ] [[package]] -name = "proc-macro2" -version = "1.0.24" +name = "proc-macro-crate" +version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1e0704ee1a7e00d7bb417d0770ea303c1bccbabf0ef1667dae92b5967f5f8a71" +checksum = "1ebace6889caf889b4d3f76becee12e90353f2b8c7d875534a71e5742f8f6f83" +dependencies = [ + "thiserror", + "toml", +] + +[[package]] +name = "proc-macro2" +version = "1.0.32" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ba508cc11742c0dc5c1659771673afbab7a0efab23aa17e854cbab0837ed0b43" dependencies = [ "unicode-xid", ] [[package]] name = "profiling" -version = "0.1.8" +version = "1.0.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1df4b2a38363b59c92b01c2c6e76178a0ab12948059e7e7f46bb27cb99d14b2d" +checksum = "87dfd5592a8eed7e74f56ad7b125f8234763b805c30f0c7c95c486920026a6ec" dependencies = [ - "profiling-procmacros 0.1.3", + "profiling-procmacros", ] [[package]] name = "profiling" -version = "1.0.2" +version = "1.0.4" dependencies = [ "bincode", "env_logger", - "glam", + "glam 0.8.7", "imgui", "imgui-winit-support", "lazy_static", "log", "optick", - "profiling-procmacros 1.0.2", + "profiling-procmacros", "puffin", "puffin-imgui", "rafx", @@ -907,25 +1068,15 @@ dependencies = [ "tracing", "tracing-subscriber", "tracing-tracy", - "tracy-client 0.12.0", + "tracy-client 0.12.5", "winit", ] [[package]] name = "profiling-procmacros" -version = "0.1.3" +version = "1.0.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d3995ce7da4b4c820aa5fc5fa43bc41bab0d642c8939d872c87c9f092540716b" -dependencies = [ - "quote", - "syn", -] - -[[package]] -name = "profiling-procmacros" -version = "1.0.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "466a51c03efbf023203c8d30ea41eaae0b08d9d3b045db8ee12db88898a31cb7" +checksum = "f899bc77213a95c5b7272c1f9889c1948eacafe06b035e976abbcadbb34fe517" dependencies = [ "quote", "syn", @@ -933,9 +1084,9 @@ dependencies = [ [[package]] name = "puffin" -version = "0.4.0" +version = "0.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f771f52585939392a9516a8b802662de3b717c515391c0945c28293867acf262" +checksum = "828f6bdc5edbbb9b2bfa603a29015bc0f09ee67cd30ed22621e675a171a54fe2" dependencies = [ "byteorder", "once_cell", @@ -943,11 +1094,12 @@ dependencies = [ [[package]] name = "puffin-imgui" -version = "0.7.0" +version = "0.13.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9f1fd5714f45cd6dd8b4964b59e4fc518abc9b4e47ba4dc92d5acd846909b4ec" +checksum = "69ec6138a8cdf377376a36f04d2e861637a782211c923e2050b59cbe8459bdaf" dependencies = [ "imgui", + "natord", "puffin", "serde", ] @@ -960,73 +1112,97 @@ checksum = "a1d01941d82fa2ab50be1e79e6714289dd7cde78eba4c074bc5a4374f650dfe0" [[package]] name = "quote" -version = "1.0.9" +version = "1.0.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c3d0b9745dc2debf507c8422de05d7226cc1f0644216dfdfead988f9b1ab32a7" +checksum = "38bc8cc6a5f2e3655e0899c1b848643b2562f853f114bfec7be120678e3ace05" dependencies = [ "proc-macro2", ] [[package]] name = "rafx" -version = "0.0.10" +version = "0.0.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2b14a08dc1564d1f2f3901e9f4ecd02c7580392e6f6fb07190ea6df3514ea151" +checksum = "2b2e69bc36f8ef495c23201b8cb154f196d84b206865758b67b378f37bcfc937" dependencies = [ "rafx-api", "rafx-base", "rafx-framework", + "rafx-visibility", ] [[package]] name = "rafx-api" -version = "0.0.10" +version = "0.0.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d68de45ff1b68ff03ddc3d81e8819620e3c4be7863401e76940080ade261934f" +checksum = "91860167246b7f469030e7793de87b592520cc984bf5ba5baa35ce6045e1f031" dependencies = [ "ash", "ash-window", "bitflags", "crossbeam-channel", "fnv", + "gpu-allocator", "log", - "profiling 0.1.8", + "profiling 1.0.3", "rafx-base", "raw-window-handle", "serde", "serde_bytes", - "vk-mem", + "wasm-bindgen", + "web-sys", ] [[package]] name = "rafx-base" -version = "0.0.10" +version = "0.0.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c812530293e6fca69b97061d7fc435d46759ef3af1d79d3841cebba38b3fe60a" +checksum = "a0c3e2b3d269da3e44c827cefb60674a25ce7b93b120141f33944002f5990164" dependencies = [ "crossbeam-channel", "downcast-rs", "fnv", + "instant", "log", ] [[package]] name = "rafx-framework" -version = "0.0.10" +version = "0.0.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "690c79b9859334b9af7532cb88d0dfa0a00e0417682070f3789c5427ac751dc6" +checksum = "5acf8d3b0f4bccb27f1a7decb72d7a6a372d262b7c6dfda7a6cd30877ec1f746" dependencies = [ "arrayvec", "bitflags", "crossbeam-channel", + "downcast-rs", "fnv", - "glam", + "glam 0.13.1", "log", - "profiling 0.1.8", + "parking_lot", + "profiling 1.0.3", "rafx-api", "rafx-base", + "rafx-visibility", "serde", "serde_bytes", + "slotmap", +] + +[[package]] +name = "rafx-visibility" +version = "0.0.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1caa54d71caa79bace6f1923b08010d7c0101da916cbf3c9b63d0f33df223228" +dependencies = [ + "crossbeam-channel", + "glam 0.13.1", + "log", + "parking_lot", + "profiling 1.0.3", + "rustc-hash", + "serde", + "slotmap", ] [[package]] @@ -1052,18 +1228,28 @@ dependencies = [ [[package]] name = "redox_syscall" -version = "0.2.5" +version = "0.2.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "94341e4e44e24f6b591b59e47a8a027df12e008d73fd5672dbea9cc22f4507d9" +checksum = "8383f39639269cde97d255a32bdb68c047337295414940c68bdd30c2e13203ff" dependencies = [ "bitflags", ] [[package]] -name = "regex" -version = "1.4.5" +name = "redox_users" +version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "957056ecddbeba1b26965114e191d2e8589ce74db242b6ea25fc4062427a5c19" +checksum = "528532f3d801c87aec9def2add9ca802fe569e44a544afe633765267840abe64" +dependencies = [ + "getrandom", + "redox_syscall", +] + +[[package]] +name = "regex" +version = "1.5.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d07a8629359eb56f1e2fb1652bb04212c072a87ba68546a04065d525673ac461" dependencies = [ "aho-corasick", "memchr", @@ -1072,19 +1258,30 @@ dependencies = [ [[package]] name = "regex-automata" -version = "0.1.9" +version = "0.1.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ae1ded71d66a4a97f5e961fd0cb25a5f366a42a41570d16a763a69c092c26ae4" +checksum = "6c230d73fb8d8c1b9c0b3135c5142a8acee3a0558fb8db5cf1cb65f8d7862132" dependencies = [ - "byteorder", "regex-syntax", ] [[package]] name = "regex-syntax" -version = "0.6.23" +version = "0.6.25" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "24d5f089152e60f62d28b835fbff2cd2e8dc0baf1ac13343bef92ab7eed84548" +checksum = "f497285884f3fcff424ffc933e56d7cbca511def0c9831a7f9b5f6153e3cc89b" + +[[package]] +name = "rustc-demangle" +version = "0.1.21" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7ef03e0a2b150c7a90d01faf6254c9c48a41e95fb2a8c2ac1c6f0d2b9aefc342" + +[[package]] +name = "rustc-hash" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "08d43f7aa6b08d49f382cde6a7982047c3426db949b1424bc4b7ec9ae12c6ce2" [[package]] name = "rusttype" @@ -1125,9 +1322,9 @@ checksum = "d29ab0c6d3fc0ee92fe66e2d99f700eab17a8d57d1c1d3b748380fb20baa78cd" [[package]] name = "serde" -version = "1.0.124" +version = "1.0.130" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bd761ff957cb2a45fbb9ab3da6512de9de55872866160b23c25f1a841e99d29f" +checksum = "f12d06de37cf59146fbdecab66aa99f9fe4f78722e3607577a5375d66bd0c913" dependencies = [ "serde_derive", ] @@ -1143,9 +1340,9 @@ dependencies = [ [[package]] name = "serde_derive" -version = "1.0.124" +version = "1.0.130" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1800f7693e94e186f5e25a28291ae1570da908aff7d97a095dec1e56ff99069b" +checksum = "d7bc1a1ab1961464eae040d96713baa5a724a8152c1222492465b54322ec508b" dependencies = [ "proc-macro2", "quote", @@ -1154,9 +1351,9 @@ dependencies = [ [[package]] name = "serde_json" -version = "1.0.64" +version = "1.0.68" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "799e97dc9fdae36a5c8b8f2cae9ce2ee9fdce2058c57a93e6099d919fd982f79" +checksum = "0f690853975602e1bfe1ccbf50504d67174e3bcf340f23b5ea9992e0587a52d8" dependencies = [ "itoa", "ryu", @@ -1165,24 +1362,27 @@ dependencies = [ [[package]] name = "sharded-slab" -version = "0.1.1" +version = "0.1.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "79c719719ee05df97490f80a45acfc99e5a30ce98a1e4fb67aee422745ae14e3" +checksum = "900fba806f70c630b0a382d0d825e17a0f19fcd059a2ade1ff237bcddf446b31" dependencies = [ "lazy_static", ] [[package]] -name = "slab" -version = "0.4.2" +name = "slotmap" +version = "1.0.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c111b5bd5695e56cffe5129854aa230b39c93a305372fdbb2668ca2394eea9f8" +checksum = "e1e08e261d0e8f5c43123b7adf3e4ca1690d655377ac93a03b2c9d3e98de1342" +dependencies = [ + "version_check", +] [[package]] name = "smallvec" -version = "1.6.1" +version = "1.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fe0f37c9e8f3c5a4a66ad655a93c74daac4ad00c441533bf5c6e7990bb42604e" +checksum = "1ecab6c735a6bb4139c0caafd0cc3635748bbb3acf4550e8138122099251f309" [[package]] name = "smithay-client-toolkit" @@ -1203,6 +1403,37 @@ dependencies = [ "wayland-protocols", ] +[[package]] +name = "spirv-std" +version = "0.4.0-alpha.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0e2676f3e58345b7c742b266b5bec022445b43e6471b9a00895faec03a52723e" +dependencies = [ + "bitflags", + "num-traits", + "spirv-std-macros", + "spirv-types", +] + +[[package]] +name = "spirv-std-macros" +version = "0.4.0-alpha.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "207e8515dfbb48bff03f64bf5f8388d4e0f2f526ee769cc6556df98477098ca5" +dependencies = [ + "heck", + "proc-macro2", + "quote", + "spirv-types", + "syn", +] + +[[package]] +name = "spirv-types" +version = "0.4.0-alpha.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "71cc4b8f7ec707459fdeddb4f137109947045592f5b0c139f7bf1360058bac6b" + [[package]] name = "strsim" version = "0.9.3" @@ -1226,9 +1457,9 @@ checksum = "0342a02bcc62538822a46f54294130677f026666c2e19d078fc213b7bc07ff16" [[package]] name = "syn" -version = "1.0.64" +version = "1.0.81" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3fd9d1e9976102a03c542daa2eff1b43f9d72306342f3f8b3ed5fb8908195d6f" +checksum = "f2afee18b8beb5a596ecb4a2dce128c719b4ba399d34126b9e4396e3f9860966" dependencies = [ "proc-macro2", "quote", @@ -1246,18 +1477,18 @@ dependencies = [ [[package]] name = "thiserror" -version = "1.0.24" +version = "1.0.30" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e0f4a65597094d4483ddaed134f409b2cb7c1beccf25201a9f73c719254fa98e" +checksum = "854babe52e4df1653706b98fcfc05843010039b406875930a70e4d9644e5c417" dependencies = [ "thiserror-impl", ] [[package]] name = "thiserror-impl" -version = "1.0.24" +version = "1.0.30" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7765189610d8241a44529806d6fd1f2e0a08734313a35d5b3a556f92b381f3c0" +checksum = "aa32fd3f627f367fe16f893e2597ae3c05020f8bba2666a4e6ea73d377e5714b" dependencies = [ "proc-macro2", "quote", @@ -1284,9 +1515,9 @@ dependencies = [ [[package]] name = "tracing" -version = "0.1.25" +version = "0.1.29" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "01ebdc2bb4498ab1ab5f5b73c5803825e60199229ccba0698170e3be0e7f959f" +checksum = "375a639232caf30edfc78e8d89b2d4c375515393e7af7e16f01cd96917fb2105" dependencies = [ "cfg-if 1.0.0", "pin-project-lite", @@ -1296,9 +1527,9 @@ dependencies = [ [[package]] name = "tracing-attributes" -version = "0.1.15" +version = "0.1.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c42e6fa53307c8a17e4ccd4dc81cf5ec38db9209f59b222210375b54ee40d1e2" +checksum = "f4f480b8f81512e825f337ad51e94c1eb5d3bbdf2b363dcd01e2b19a9ffe3f8e" dependencies = [ "proc-macro2", "quote", @@ -1307,9 +1538,9 @@ dependencies = [ [[package]] name = "tracing-core" -version = "0.1.17" +version = "0.1.21" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f50de3927f93d202783f4513cda820ab47ef17f624b03c096e86ef00c67e6b5f" +checksum = "1f4ed65637b8390770814083d20756f87bfa2c21bf2f110babdc5438351746e4" dependencies = [ "lazy_static", ] @@ -1337,9 +1568,9 @@ dependencies = [ [[package]] name = "tracing-subscriber" -version = "0.2.17" +version = "0.2.25" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "705096c6f83bf68ea5d357a6aa01829ddbdac531b357b45abeca842938085baa" +checksum = "0e0d2eaa99c3c2e41547cfa109e910a68ea03823cccad4a0525dcbc9b01e8c71" dependencies = [ "ansi_term", "chrono", @@ -1379,11 +1610,11 @@ dependencies = [ [[package]] name = "tracy-client" -version = "0.12.0" +version = "0.12.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2713f161977973291f474d75535d67bb655dee54456874aff4c1724555ffe1d3" +checksum = "a49133e2b4f358ddf7aff5288e0120eeb90d1a5200033fbc2ac4735347fc2b9c" dependencies = [ - "tracy-client-sys 0.13.0", + "tracy-client-sys 0.16.0", ] [[package]] @@ -1397,9 +1628,9 @@ dependencies = [ [[package]] name = "tracy-client-sys" -version = "0.13.0" +version = "0.16.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "47bee6f812f66f62b9d5f43c1c8f9f69afc9491e57dad0ea22544cbbc9851f29" +checksum = "6226e4e77f0d46ce7ebb0a4b1daa82790035248b75bbf605b932a1d7b3b22b6d" dependencies = [ "cc", ] @@ -1411,44 +1642,99 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3e5d7cd7ab3e47dda6e56542f4bbf3824c15234958c6e1bd6aaa347e93499fdc" [[package]] -name = "unicode-xid" -version = "0.2.1" +name = "unicode-segmentation" +version = "1.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f7fe0bb3479651439c9112f72b6c505038574c9fbb575ed1bf3b797fa39dd564" +checksum = "8895849a949e7845e06bd6dc1aa51731a103c42707010a5b591c0038fb73385b" + +[[package]] +name = "unicode-xid" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8ccb82d61f80a663efe1f787a51b16b5a51e3314d6ac365b08639f52387b33f3" [[package]] name = "version_check" -version = "0.9.2" +version = "0.9.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b5a972e5669d67ba988ce3dc826706fb0a8b01471c088cb0b6110b805cc36aed" - -[[package]] -name = "vk-mem" -version = "0.2.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7c89db58563ea4fb34bd0394eb977c9c7ff7d16bf605f4eb945db7cab8c0c16f" -dependencies = [ - "ash", - "bitflags", - "cc", -] +checksum = "5fecdca9a5291cc2b8dcf7dc02453fee791a280f3743cb0905f8822ae463b3fe" [[package]] name = "walkdir" -version = "2.3.1" +version = "2.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "777182bc735b6424e1a57516d35ed72cb8019d85c8c9bf536dccb3445c1a2f7d" +checksum = "808cf2735cd4b6866113f648b791c6adc5714537bc222d9347bb203386ffda56" dependencies = [ "same-file", - "winapi 0.3.9", + "winapi", "winapi-util", ] [[package]] -name = "wayland-client" -version = "0.28.5" +name = "wasi" +version = "0.10.2+wasi-snapshot-preview1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "06ca44d86554b85cf449f1557edc6cc7da935cc748c8e4bf1c507cbd43bae02c" +checksum = "fd6fbd9a79829dd1ad0cc20627bf1ed606756a7f77edff7b66b7064f9cb327c6" + +[[package]] +name = "wasm-bindgen" +version = "0.2.78" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "632f73e236b219150ea279196e54e610f5dbafa5d61786303d4da54f84e47fce" +dependencies = [ + "cfg-if 1.0.0", + "wasm-bindgen-macro", +] + +[[package]] +name = "wasm-bindgen-backend" +version = "0.2.78" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a317bf8f9fba2476b4b2c85ef4c4af8ff39c3c7f0cdfeed4f82c34a880aa837b" +dependencies = [ + "bumpalo", + "lazy_static", + "log", + "proc-macro2", + "quote", + "syn", + "wasm-bindgen-shared", +] + +[[package]] +name = "wasm-bindgen-macro" +version = "0.2.78" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d56146e7c495528bf6587663bea13a8eb588d39b36b679d83972e1a2dbbdacf9" +dependencies = [ + "quote", + "wasm-bindgen-macro-support", +] + +[[package]] +name = "wasm-bindgen-macro-support" +version = "0.2.78" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7803e0eea25835f8abdc585cd3021b3deb11543c6fe226dcd30b228857c5c5ab" +dependencies = [ + "proc-macro2", + "quote", + "syn", + "wasm-bindgen-backend", + "wasm-bindgen-shared", +] + +[[package]] +name = "wasm-bindgen-shared" +version = "0.2.78" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0237232789cf037d5480773fe568aac745bfe2afbc11a863e97901780a6b47cc" + +[[package]] +name = "wayland-client" +version = "0.28.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e3ab332350e502f159382201394a78e3cc12d0f04db863429260164ea40e0355" dependencies = [ "bitflags", "downcast-rs", @@ -1462,9 +1748,9 @@ dependencies = [ [[package]] name = "wayland-commons" -version = "0.28.5" +version = "0.28.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8bd75ae380325dbcff2707f0cd9869827ea1d2d6d534cff076858d3f0460fd5a" +checksum = "a21817947c7011bbd0a27e11b17b337bfd022e8544b071a2641232047966fbda" dependencies = [ "nix 0.20.0", "once_cell", @@ -1474,9 +1760,9 @@ dependencies = [ [[package]] name = "wayland-cursor" -version = "0.28.5" +version = "0.28.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b37e5455ec72f5de555ec39b5c3704036ac07c2ecd50d0bffe02d5fe2d4e65ab" +checksum = "be610084edd1586d45e7bdd275fe345c7c1873598caa464c4fb835dee70fa65a" dependencies = [ "nix 0.20.0", "wayland-client", @@ -1485,9 +1771,9 @@ dependencies = [ [[package]] name = "wayland-protocols" -version = "0.28.5" +version = "0.28.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "95df3317872bcf9eec096c864b69aa4769a1d5d6291a5b513f8ba0af0efbd52c" +checksum = "286620ea4d803bacf61fa087a4242ee316693099ee5a140796aaba02b29f861f" dependencies = [ "bitflags", "wayland-client", @@ -1497,9 +1783,9 @@ dependencies = [ [[package]] name = "wayland-scanner" -version = "0.28.5" +version = "0.28.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "389d680d7bd67512dc9c37f39560224327038deb0f0e8d33f870900441b68720" +checksum = "ce923eb2deb61de332d1f356ec7b6bf37094dc5573952e1c8936db03b54c03f1" dependencies = [ "proc-macro2", "quote", @@ -1508,9 +1794,9 @@ dependencies = [ [[package]] name = "wayland-sys" -version = "0.28.5" +version = "0.28.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2907bd297eef464a95ba9349ea771611771aa285b932526c633dc94d5400a8e2" +checksum = "d841fca9aed7febf9bed2e9796c49bf58d4152ceda8ac949ebe00868d8f0feb8" dependencies = [ "dlib 0.5.0", "lazy_static", @@ -1518,10 +1804,14 @@ dependencies = [ ] [[package]] -name = "winapi" -version = "0.2.8" +name = "web-sys" +version = "0.3.55" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "167dc9d6949a9b857f3451275e911c3f44255842c1f7a76f33c55103a909087a" +checksum = "38eb105f1c59d9eaa6b5cdc92b859d85b926e82cb2e0945cd0c9259faa6fe9fb" +dependencies = [ + "js-sys", + "wasm-bindgen", +] [[package]] name = "winapi" @@ -1533,12 +1823,6 @@ dependencies = [ "winapi-x86_64-pc-windows-gnu", ] -[[package]] -name = "winapi-build" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2d315eee3b34aca4797b2da6b13ed88266e6d612562a0c46390af8299fc699bc" - [[package]] name = "winapi-i686-pc-windows-gnu" version = "0.4.0" @@ -1551,7 +1835,7 @@ version = "0.1.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "70ec6ce85bb158151cae5e5c87f95a8e97d2c0c4b001223f33a334e3ce5de178" dependencies = [ - "winapi 0.3.9", + "winapi", ] [[package]] @@ -1562,13 +1846,13 @@ checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" [[package]] name = "winit" -version = "0.24.0" +version = "0.25.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "da4eda6fce0eb84bd0a33e3c8794eb902e1033d0a1d5a31bc4f19b1b4bbff597" +checksum = "79610794594d5e86be473ef7763f604f2159cbac8c94debd00df8fb41e86c2f8" dependencies = [ "bitflags", "cocoa", - "core-foundation 0.9.1", + "core-foundation 0.9.2", "core-graphics 0.22.2", "core-video-sys", "dispatch", @@ -1577,7 +1861,7 @@ dependencies = [ "libc", "log", "mio", - "mio-extras", + "mio-misc", "ndk", "ndk-glue", "ndk-sys", @@ -1585,51 +1869,44 @@ dependencies = [ "parking_lot", "percent-encoding", "raw-window-handle", + "scopeguard", "smithay-client-toolkit", "wayland-client", - "winapi 0.3.9", + "winapi", "x11-dl", ] -[[package]] -name = "ws2_32-sys" -version = "0.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d59cefebd0c892fa2dd6de581e937301d8552cb44489cdff035c6187cb63fa5e" -dependencies = [ - "winapi 0.2.8", - "winapi-build", -] - [[package]] name = "x11-dl" -version = "2.18.5" +version = "2.19.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2bf981e3a5b3301209754218f962052d4d9ee97e478f4d26d4a6eced34c1fef8" +checksum = "ea26926b4ce81a6f5d9d0f3a0bc401e5a37c6ae14a1bfaa8ff6099ca80038c59" dependencies = [ "lazy_static", "libc", - "maybe-uninit", "pkg-config", ] [[package]] name = "xcursor" -version = "0.3.3" +version = "0.3.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3a9a231574ae78801646617cefd13bfe94be907c0e4fa979cfd8b770aa3c5d08" +checksum = "463705a63313cd4301184381c5e8042f0a7e9b4bb63653f216311d4ae74690b7" dependencies = [ "nom", ] [[package]] name = "xdg" -version = "2.2.0" +version = "2.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d089681aa106a86fade1b0128fb5daf07d5867a509ab036d99988dec80429a57" +checksum = "3a23fe958c70412687039c86f578938b4a0bb50ec788e96bce4d6ab00ddd5803" +dependencies = [ + "dirs", +] [[package]] name = "xml-rs" -version = "0.8.3" +version = "0.8.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b07db065a5cf61a7e4ba64f29e67db906fb1787316516c4e6e5ff0fea1efcd8a" +checksum = "d2d7d3948613f75c98fd9328cfdcc45acc4d360655289d0a7d4ec931392200a3" diff --git a/third_party/rust/profiling/Cargo.toml b/third_party/rust/profiling/Cargo.toml index 68a762434100..07e600f53504 100644 --- a/third_party/rust/profiling/Cargo.toml +++ b/third_party/rust/profiling/Cargo.toml @@ -3,17 +3,16 @@ # When uploading crates to the registry Cargo will automatically # "normalize" Cargo.toml files for maximal compatibility # with all versions of Cargo and also rewrite `path` dependencies -# to registry (e.g., crates.io) dependencies +# to registry (e.g., crates.io) dependencies. # -# If you believe there's an error in this file please file an -# issue against the rust-lang/cargo repository. If you're -# editing this file be aware that the upstream Cargo.toml -# will likely look very different (and much more reasonable) +# If you are reading this file be aware that the original Cargo.toml +# will likely look very different (and much more reasonable). +# See Cargo.toml.orig for the original contents. [package] edition = "2018" name = "profiling" -version = "1.0.2" +version = "1.0.4" authors = ["Philip Degarmo "] description = "This crate provides a very thin abstraction over other profiler crates." homepage = "https://github.com/aclysma/profiling" @@ -37,11 +36,11 @@ version = "1.3" optional = true [dependencies.profiling-procmacros] -version = "1.0.2" +version = "1.0.4" optional = true [dependencies.puffin] -version = "0.4" +version = "0.10" optional = true [dependencies.superluminal-perf] @@ -65,10 +64,10 @@ version = "0.6" version = "0.8.6" [dev-dependencies.imgui] -version = "0.7" +version = "0.8" [dev-dependencies.imgui-winit-support] -version = "0.7" +version = "0.8" [dev-dependencies.lazy_static] version = "1" @@ -77,10 +76,10 @@ version = "1" version = "0.4" [dev-dependencies.puffin-imgui] -version = "0.7" +version = "0.13.1" [dev-dependencies.rafx] -version = "=0.0.10" +version = "=0.0.14" features = ["rafx-vulkan", "framework"] [dev-dependencies.tracing-subscriber] @@ -90,7 +89,7 @@ version = "0.2" version = "0.4.0" [dev-dependencies.winit] -version = "0.24" +version = "0.25" [features] default = ["procmacros"] diff --git a/third_party/rust/profiling/README.md b/third_party/rust/profiling/README.md index c7861feadb3d..64fe3a31b0c0 100644 --- a/third_party/rust/profiling/README.md +++ b/third_party/rust/profiling/README.md @@ -154,7 +154,7 @@ profile-with-puffin = ["profiling/profile-with-puffin"] profile-with-optick = ["profiling/profile-with-optick"] profile-with-superluminal = ["profiling/profile-with-superluminal"] profile-with-tracing = ["profiling/profile-with-tracing"] -profile-with-tracy = ["profiling/profile-with-tracing"] +profile-with-tracy = ["profiling/profile-with-tracy"] ``` * You can use the default feature to quickly/temporarily turn something on: `default = ["profile-with-optick"]` diff --git a/third_party/rust/profiling/deny.toml b/third_party/rust/profiling/deny.toml index ca4b212cb6d1..f1f66c6eedc8 100644 --- a/third_party/rust/profiling/deny.toml +++ b/third_party/rust/profiling/deny.toml @@ -36,7 +36,7 @@ db-path = "~/.cargo/advisory-db" # The url of the advisory database to use db-urls = ["https://github.com/rustsec/advisory-db"] # The lint level for security vulnerabilities -vulnerability = "deny" +vulnerability = "warn" # The lint level for unmaintained crates unmaintained = "warn" # The lint level for crates that have been yanked from their source registry @@ -73,6 +73,7 @@ allow = [ "MIT", "Apache-2.0", "BSD-3-Clause", + "Zlib" #"BSD-2-Clause" #"Apache-2.0 WITH LLVM-exception", ] diff --git a/third_party/rust/profiling/examples/puffin/imgui_support.rs b/third_party/rust/profiling/examples/puffin/imgui_support.rs index 26e9c5099339..1c6660918086 100644 --- a/third_party/rust/profiling/examples/puffin/imgui_support.rs +++ b/third_party/rust/profiling/examples/puffin/imgui_support.rs @@ -109,7 +109,7 @@ impl ImguiManager { // implemented upstream and I switch to using it } _ => { - platform.handle_event(context.io_mut(), &window, &event); + platform.handle_event(context.io_mut(), window, event); } } } @@ -309,12 +309,12 @@ fn init_imgui(window: &winit::window::Window) -> imgui::Context { } pub fn init_imgui_manager(window: &winit::window::Window) -> ImguiManager { - let mut imgui_context = init_imgui(&window); + let mut imgui_context = init_imgui(window); let mut imgui_platform = imgui_winit_support::WinitPlatform::init(&mut imgui_context); imgui_platform.attach_window( imgui_context.io_mut(), - &window, + window, imgui_winit_support::HiDpiMode::Rounded, ); diff --git a/third_party/rust/profiling/examples/puffin/renderer.rs b/third_party/rust/profiling/examples/puffin/renderer.rs index adcd802e964c..1eca5fe1eb49 100644 --- a/third_party/rust/profiling/examples/puffin/renderer.rs +++ b/third_party/rust/profiling/examples/puffin/renderer.rs @@ -1,6 +1,6 @@ use rafx::api::*; use rafx::framework::*; -use rafx::nodes::*; +use rafx::render_features::*; use std::sync::Arc; /// Vulkan renderer that creates and manages the vulkan instance, device, swapchain, and @@ -28,7 +28,7 @@ impl Renderer { height: window_size.height, }; - let api = RafxApi::new(window, &Default::default())?; + let api = unsafe { RafxApi::new(window, &Default::default())? }; let device_context = api.device_context(); let render_registry = RenderRegistryBuilder::default() @@ -445,7 +445,7 @@ impl Renderer { let fixed_function_state = Arc::new(fixed_function_state); let material_pass = MaterialPass::new( - &resource_context, + resource_context, fixed_function_state, vec![vertex_shader_module, fragment_shader_module], &[&vertex_entry_point, &fragment_entry_point], @@ -469,9 +469,8 @@ rafx::declare_render_phase!( opaque_render_phase_sort_submit_nodes ); -fn opaque_render_phase_sort_submit_nodes(submit_nodes: Vec) -> Vec { +fn opaque_render_phase_sort_submit_nodes(_submit_nodes: &mut Vec) { // No sort needed - submit_nodes } lazy_static::lazy_static! { @@ -484,7 +483,7 @@ lazy_static::lazy_static! { uv: Default::default() }; - VertexDataLayout::build_vertex_layout(&vertex, |builder, vertex| { + VertexDataLayout::build_vertex_layout(&vertex, RafxVertexAttributeRate::Vertex, |builder, vertex| { builder.add_member(&vertex.pos, "POSITION", RafxFormat::R32G32_SFLOAT); builder.add_member(&vertex.uv, "TEXCOORD", RafxFormat::R32G32_SFLOAT); builder.add_member(&vertex.col, "COLOR", RafxFormat::R8G8B8A8_UNORM); diff --git a/third_party/rust/profiling/examples/puffin/shaders/compile_shaders.sh b/third_party/rust/profiling/examples/puffin/shaders/compile_shaders.sh index 1c5f9ba12482..d6f913edc541 100755 --- a/third_party/rust/profiling/examples/puffin/shaders/compile_shaders.sh +++ b/third_party/rust/profiling/examples/puffin/shaders/compile_shaders.sh @@ -1,3 +1,3 @@ -rafx-shader-processor --glsl-path glsl/*.vert glsl/*.frag glsl/*.comp --metal-generated-src-path out --spv-path out --cooked-shaders-path out +rafx-shader-processor --glsl-path glsl/*.vert glsl/*.frag glsl/*.comp --metal-generated-src-path out --spv-path out --cooked-shaders-path out --package-vk diff --git a/third_party/rust/profiling/examples/puffin/shaders/out/debug.frag.cookedshaderpackage b/third_party/rust/profiling/examples/puffin/shaders/out/debug.frag.cookedshaderpackage index 97aee69cf1e3..b4d272ef051b 100644 Binary files a/third_party/rust/profiling/examples/puffin/shaders/out/debug.frag.cookedshaderpackage and b/third_party/rust/profiling/examples/puffin/shaders/out/debug.frag.cookedshaderpackage differ diff --git a/third_party/rust/profiling/examples/puffin/shaders/out/debug.frag.metal b/third_party/rust/profiling/examples/puffin/shaders/out/debug.frag.metal index 9819d08b349a..e07476d4d597 100644 --- a/third_party/rust/profiling/examples/puffin/shaders/out/debug.frag.metal +++ b/third_party/rust/profiling/examples/puffin/shaders/out/debug.frag.metal @@ -8,6 +8,11 @@ struct Args float4x4 mvp; }; +struct spvDescriptorSetBuffer0 +{ + constant Args* uniform_buffer [[id(0)]]; +}; + struct main0_out { float4 out_color [[color(0)]]; @@ -18,7 +23,7 @@ struct main0_in float4 in_color [[user(locn0)]]; }; -fragment main0_out main0(main0_in in [[stage_in]]) +fragment main0_out main0(main0_in in [[stage_in]], constant spvDescriptorSetBuffer0& spvDescriptorSet0 [[buffer(0)]]) { main0_out out = {}; out.out_color = in.in_color; diff --git a/third_party/rust/profiling/examples/puffin/shaders/out/debug.vert.cookedshaderpackage b/third_party/rust/profiling/examples/puffin/shaders/out/debug.vert.cookedshaderpackage index add9f99d9224..c0fea170214e 100644 Binary files a/third_party/rust/profiling/examples/puffin/shaders/out/debug.vert.cookedshaderpackage and b/third_party/rust/profiling/examples/puffin/shaders/out/debug.vert.cookedshaderpackage differ diff --git a/third_party/rust/profiling/examples/puffin/shaders/out/imgui.frag.cookedshaderpackage b/third_party/rust/profiling/examples/puffin/shaders/out/imgui.frag.cookedshaderpackage index ce4bd31bbb30..607dab38d27b 100644 Binary files a/third_party/rust/profiling/examples/puffin/shaders/out/imgui.frag.cookedshaderpackage and b/third_party/rust/profiling/examples/puffin/shaders/out/imgui.frag.cookedshaderpackage differ diff --git a/third_party/rust/profiling/examples/puffin/shaders/out/imgui.frag.metal b/third_party/rust/profiling/examples/puffin/shaders/out/imgui.frag.metal index 997aaceb1317..e8879684d212 100644 --- a/third_party/rust/profiling/examples/puffin/shaders/out/imgui.frag.metal +++ b/third_party/rust/profiling/examples/puffin/shaders/out/imgui.frag.metal @@ -11,6 +11,7 @@ struct Args struct spvDescriptorSetBuffer0 { texture2d tex [[id(1)]]; + constant Args* uniform_buffer [[id(2)]]; }; struct main0_out diff --git a/third_party/rust/profiling/examples/puffin/shaders/out/imgui.vert.cookedshaderpackage b/third_party/rust/profiling/examples/puffin/shaders/out/imgui.vert.cookedshaderpackage index 23aa6b7345b0..936b2f49b7d0 100644 Binary files a/third_party/rust/profiling/examples/puffin/shaders/out/imgui.vert.cookedshaderpackage and b/third_party/rust/profiling/examples/puffin/shaders/out/imgui.vert.cookedshaderpackage differ diff --git a/third_party/rust/profiling/examples/puffin/shaders/out/imgui.vert.metal b/third_party/rust/profiling/examples/puffin/shaders/out/imgui.vert.metal index 712ee5b64c84..4c734727be2f 100644 --- a/third_party/rust/profiling/examples/puffin/shaders/out/imgui.vert.metal +++ b/third_party/rust/profiling/examples/puffin/shaders/out/imgui.vert.metal @@ -10,6 +10,7 @@ struct Args struct spvDescriptorSetBuffer0 { + texture2d tex [[id(1)]]; constant Args* uniform_buffer [[id(2)]]; }; @@ -29,6 +30,7 @@ struct main0_in vertex main0_out main0(main0_in in [[stage_in]], constant spvDescriptorSetBuffer0& spvDescriptorSet0 [[buffer(0)]]) { + constexpr sampler smp(filter::linear, mip_filter::linear, address::repeat, compare_func::never, max_anisotropy(1)); main0_out out = {}; out.uv = in.in_uv; out.color = in.in_color; diff --git a/third_party/rust/quote/.cargo-checksum.json b/third_party/rust/quote/.cargo-checksum.json index 768055df4ea3..e0f72e40caa5 100644 --- a/third_party/rust/quote/.cargo-checksum.json +++ b/third_party/rust/quote/.cargo-checksum.json @@ -1 +1 @@ -{"files":{"Cargo.toml":"d1e6bb8b4ac54b84f367a4e1b46e7dca3b1a744017d8f7fa2f4c11a8730e657a","LICENSE-APACHE":"a60eea817514531668d7e00765731449fe14d059d3249e0bc93b36de45f759f2","LICENSE-MIT":"c9a75f18b9ab2927829a208fc6aa2cf4e63b8420887ba29cdb265d6619ae82d5","README.md":"9209682116de84bb9cc7be6ccf44478b46b909c7857f9e186d90bcff522af864","src/ext.rs":"a9fed3a1a4c9d3f2de717ba808af99291b995db2cbf8067f4b6927c39cc62bc6","src/format.rs":"a9c3e3a333c6dacf6e330d02b4c726862e273df1c2c6be6da199049cd1e521db","src/ident_fragment.rs":"e66a63f6e9020f2639a71f120d627bc6cfd60081a6caf8a1d735b59ee2413d29","src/lib.rs":"2500b1955d139e5b467df046cda4f2837fb1edace838aa190020752ab79314c4","src/runtime.rs":"f2d1fa6084764d98f98b96344cf675886a79b46a845c592e604f96bbde9aca07","src/spanned.rs":"adc0ed742ad17327c375879472d435cea168c208c303f53eb93cb2c0f10f3650","src/to_tokens.rs":"e589c1643479a9003d4dd1d9fa63714042b106f1b16d8ea3903cfe2f73a020f5","tests/compiletest.rs":"0a52a44786aea1c299c695bf948b2ed2081e4cc344e5c2cadceab4eb03d0010d","tests/test.rs":"6eb200350fa78405d4fd920ecf71d226e258c61aa88f850750efa99e065f06d6","tests/ui/does-not-have-iter-interpolated-dup.rs":"ad13eea21d4cdd2ab6c082f633392e1ff20fb0d1af5f2177041e0bf7f30da695","tests/ui/does-not-have-iter-interpolated.rs":"83a5b3f240651adcbe4b6e51076d76d653ad439b37442cf4054f1fd3c073f3b7","tests/ui/does-not-have-iter-separated.rs":"fe413c48331d5e3a7ae5fef6a5892a90c72f610d54595879eb49d0a94154ba3f","tests/ui/does-not-have-iter.rs":"09dc9499d861b63cebb0848b855b78e2dc9497bfde37ba6339f3625ae009a62f","tests/ui/not-quotable.rs":"5759d0884943417609f28faadc70254a3e2fd3d9bd6ff7297a3fb70a77fafd8a","tests/ui/not-repeatable.rs":"a4b115c04e4e41049a05f5b69450503fbffeba031218b4189cb931839f7f9a9c","tests/ui/wrong-type-span.rs":"5f310cb7fde3ef51bad01e7f286d244e3b6e67396cd2ea7eab77275c9d902699"},"package":"c3d0b9745dc2debf507c8422de05d7226cc1f0644216dfdfead988f9b1ab32a7"} \ No newline at end of file +{"files":{"Cargo.toml":"4057136f408f566a2c06bcce49711d67bedcc8ce7a49351538086503afe59762","LICENSE-APACHE":"a60eea817514531668d7e00765731449fe14d059d3249e0bc93b36de45f759f2","LICENSE-MIT":"c9a75f18b9ab2927829a208fc6aa2cf4e63b8420887ba29cdb265d6619ae82d5","README.md":"9209682116de84bb9cc7be6ccf44478b46b909c7857f9e186d90bcff522af864","benches/bench.rs":"5dd3181a97b772e5691d4e6a48e00447250fa893fd63e49d154b519bc1b85fb9","src/ext.rs":"a9fed3a1a4c9d3f2de717ba808af99291b995db2cbf8067f4b6927c39cc62bc6","src/format.rs":"a9c3e3a333c6dacf6e330d02b4c726862e273df1c2c6be6da199049cd1e521db","src/ident_fragment.rs":"3ad27e331af8b54a4b97d19e7ae2bb45e01fb51dc410b24c083345ba6a0b20a8","src/lib.rs":"9c423facea42fe5c63763ba9a269d3f119865d43b4be16cb767ade7659e9356b","src/runtime.rs":"9257f094aefaefa4cf0653c39b5b72bb1922d8b8ac5f5cd45efb29e33acd0b98","src/spanned.rs":"adc0ed742ad17327c375879472d435cea168c208c303f53eb93cb2c0f10f3650","src/to_tokens.rs":"a351a680577d520ebb35905633c77533e8bc4b20642a5c438a51c94b2cc85145","tests/compiletest.rs":"0a52a44786aea1c299c695bf948b2ed2081e4cc344e5c2cadceab4eb03d0010d","tests/test.rs":"e2e829990115b51946d4776ade8eb65f3be1b9398b364bd3cfd4e1969b3a13be","tests/ui/does-not-have-iter-interpolated-dup.rs":"ad13eea21d4cdd2ab6c082f633392e1ff20fb0d1af5f2177041e0bf7f30da695","tests/ui/does-not-have-iter-interpolated-dup.stderr":"bd6a510c807eeda4c2207006d303bcc4bdb59b6122614d16af339ce1ac595449","tests/ui/does-not-have-iter-interpolated.rs":"83a5b3f240651adcbe4b6e51076d76d653ad439b37442cf4054f1fd3c073f3b7","tests/ui/does-not-have-iter-interpolated.stderr":"a0176a2091928037bba14a659d9619117b57112a4640e86466434a2a9cd2e362","tests/ui/does-not-have-iter-separated.rs":"fe413c48331d5e3a7ae5fef6a5892a90c72f610d54595879eb49d0a94154ba3f","tests/ui/does-not-have-iter-separated.stderr":"19287dc8cba743d89996c2d3ded0d5df292f591e6c148a92ea5e9e23d1250837","tests/ui/does-not-have-iter.rs":"09dc9499d861b63cebb0848b855b78e2dc9497bfde37ba6339f3625ae009a62f","tests/ui/does-not-have-iter.stderr":"fb595f24e0a133f705cf585692206ed9dce59b2872cc11eed9bf0ebc184c1d20","tests/ui/not-quotable.rs":"5759d0884943417609f28faadc70254a3e2fd3d9bd6ff7297a3fb70a77fafd8a","tests/ui/not-quotable.stderr":"2ed46f3d6975cc48852b63ece071fd170628c8bd4a4e89e3bb7b156dd139248b","tests/ui/not-repeatable.rs":"a4b115c04e4e41049a05f5b69450503fbffeba031218b4189cb931839f7f9a9c","tests/ui/not-repeatable.stderr":"49991d2b634c8620eb7c76653e2c546223baa473031b0fb4784eb2355f8e6b65","tests/ui/wrong-type-span.rs":"5f310cb7fde3ef51bad01e7f286d244e3b6e67396cd2ea7eab77275c9d902699","tests/ui/wrong-type-span.stderr":"6672d2c5995fe188228c2b24630a3ad658c27383accc03cdf90c30923eaf6906"},"package":"38bc8cc6a5f2e3655e0899c1b848643b2562f853f114bfec7be120678e3ace05"} \ No newline at end of file diff --git a/third_party/rust/quote/Cargo.toml b/third_party/rust/quote/Cargo.toml index 411f943ab442..835d1a263d2a 100644 --- a/third_party/rust/quote/Cargo.toml +++ b/third_party/rust/quote/Cargo.toml @@ -3,19 +3,18 @@ # When uploading crates to the registry Cargo will automatically # "normalize" Cargo.toml files for maximal compatibility # with all versions of Cargo and also rewrite `path` dependencies -# to registry (e.g., crates.io) dependencies +# to registry (e.g., crates.io) dependencies. # -# If you believe there's an error in this file please file an -# issue against the rust-lang/cargo repository. If you're -# editing this file be aware that the upstream Cargo.toml -# will likely look very different (and much more reasonable) +# If you are reading this file be aware that the original Cargo.toml +# will likely look very different (and much more reasonable). +# See Cargo.toml.orig for the original contents. [package] edition = "2018" +rust-version = "1.31" name = "quote" -version = "1.0.9" +version = "1.0.10" authors = ["David Tolnay "] -include = ["Cargo.toml", "src/**/*.rs", "tests/**/*.rs", "README.md", "LICENSE-APACHE", "LICENSE-MIT"] description = "Quasi-quoting macro quote!(...)" documentation = "https://docs.rs/quote/" readme = "README.md" diff --git a/third_party/rust/quote/benches/bench.rs b/third_party/rust/quote/benches/bench.rs new file mode 100644 index 000000000000..ed9150864121 --- /dev/null +++ b/third_party/rust/quote/benches/bench.rs @@ -0,0 +1,192 @@ +#![feature(test)] + +extern crate test; + +use quote::quote; +use test::Bencher; + +#[bench] +fn bench_impl(b: &mut Bencher) { + b.iter(|| { + quote! { + impl<'de> _serde::Deserialize<'de> for Response { + fn deserialize<__D>(__deserializer: __D) -> _serde::export::Result + where + __D: _serde::Deserializer<'de>, + { + #[allow(non_camel_case_types)] + enum __Field { + __field0, + __field1, + __ignore, + } + struct __FieldVisitor; + impl<'de> _serde::de::Visitor<'de> for __FieldVisitor { + type Value = __Field; + fn expecting( + &self, + __formatter: &mut _serde::export::Formatter, + ) -> _serde::export::fmt::Result { + _serde::export::Formatter::write_str(__formatter, "field identifier") + } + fn visit_u64<__E>(self, __value: u64) -> _serde::export::Result + where + __E: _serde::de::Error, + { + match __value { + 0u64 => _serde::export::Ok(__Field::__field0), + 1u64 => _serde::export::Ok(__Field::__field1), + _ => _serde::export::Err(_serde::de::Error::invalid_value( + _serde::de::Unexpected::Unsigned(__value), + &"field index 0 <= i < 2", + )), + } + } + fn visit_str<__E>(self, __value: &str) -> _serde::export::Result + where + __E: _serde::de::Error, + { + match __value { + "id" => _serde::export::Ok(__Field::__field0), + "s" => _serde::export::Ok(__Field::__field1), + _ => _serde::export::Ok(__Field::__ignore), + } + } + fn visit_bytes<__E>( + self, + __value: &[u8], + ) -> _serde::export::Result + where + __E: _serde::de::Error, + { + match __value { + b"id" => _serde::export::Ok(__Field::__field0), + b"s" => _serde::export::Ok(__Field::__field1), + _ => _serde::export::Ok(__Field::__ignore), + } + } + } + impl<'de> _serde::Deserialize<'de> for __Field { + #[inline] + fn deserialize<__D>(__deserializer: __D) -> _serde::export::Result + where + __D: _serde::Deserializer<'de>, + { + _serde::Deserializer::deserialize_identifier(__deserializer, __FieldVisitor) + } + } + struct __Visitor<'de> { + marker: _serde::export::PhantomData, + lifetime: _serde::export::PhantomData<&'de ()>, + } + impl<'de> _serde::de::Visitor<'de> for __Visitor<'de> { + type Value = Response; + fn expecting( + &self, + __formatter: &mut _serde::export::Formatter, + ) -> _serde::export::fmt::Result { + _serde::export::Formatter::write_str(__formatter, "struct Response") + } + #[inline] + fn visit_seq<__A>( + self, + mut __seq: __A, + ) -> _serde::export::Result + where + __A: _serde::de::SeqAccess<'de>, + { + let __field0 = + match try!(_serde::de::SeqAccess::next_element::(&mut __seq)) { + _serde::export::Some(__value) => __value, + _serde::export::None => { + return _serde::export::Err(_serde::de::Error::invalid_length( + 0usize, + &"struct Response with 2 elements", + )); + } + }; + let __field1 = + match try!(_serde::de::SeqAccess::next_element::(&mut __seq)) { + _serde::export::Some(__value) => __value, + _serde::export::None => { + return _serde::export::Err(_serde::de::Error::invalid_length( + 1usize, + &"struct Response with 2 elements", + )); + } + }; + _serde::export::Ok(Response { + id: __field0, + s: __field1, + }) + } + #[inline] + fn visit_map<__A>( + self, + mut __map: __A, + ) -> _serde::export::Result + where + __A: _serde::de::MapAccess<'de>, + { + let mut __field0: _serde::export::Option = _serde::export::None; + let mut __field1: _serde::export::Option = _serde::export::None; + while let _serde::export::Some(__key) = + try!(_serde::de::MapAccess::next_key::<__Field>(&mut __map)) + { + match __key { + __Field::__field0 => { + if _serde::export::Option::is_some(&__field0) { + return _serde::export::Err( + <__A::Error as _serde::de::Error>::duplicate_field("id"), + ); + } + __field0 = _serde::export::Some( + try!(_serde::de::MapAccess::next_value::(&mut __map)), + ); + } + __Field::__field1 => { + if _serde::export::Option::is_some(&__field1) { + return _serde::export::Err( + <__A::Error as _serde::de::Error>::duplicate_field("s"), + ); + } + __field1 = _serde::export::Some( + try!(_serde::de::MapAccess::next_value::(&mut __map)), + ); + } + _ => { + let _ = try!(_serde::de::MapAccess::next_value::< + _serde::de::IgnoredAny, + >(&mut __map)); + } + } + } + let __field0 = match __field0 { + _serde::export::Some(__field0) => __field0, + _serde::export::None => try!(_serde::private::de::missing_field("id")), + }; + let __field1 = match __field1 { + _serde::export::Some(__field1) => __field1, + _serde::export::None => try!(_serde::private::de::missing_field("s")), + }; + _serde::export::Ok(Response { + id: __field0, + s: __field1, + }) + } + } + const FIELDS: &'static [&'static str] = &["id", "s"]; + _serde::Deserializer::deserialize_struct( + __deserializer, + "Response", + FIELDS, + __Visitor { + marker: _serde::export::PhantomData::, + lifetime: _serde::export::PhantomData, + }, + ) + } + } + } + }); +} diff --git a/third_party/rust/quote/src/ident_fragment.rs b/third_party/rust/quote/src/ident_fragment.rs index e7472fe11430..67e2e3393c4d 100644 --- a/third_party/rust/quote/src/ident_fragment.rs +++ b/third_party/rust/quote/src/ident_fragment.rs @@ -79,7 +79,7 @@ macro_rules! ident_fragment_display { } } )* - } + }; } ident_fragment_display!(bool, str, String, char); diff --git a/third_party/rust/quote/src/lib.rs b/third_party/rust/quote/src/lib.rs index 356e43a0524e..1dad8a14be03 100644 --- a/third_party/rust/quote/src/lib.rs +++ b/third_party/rust/quote/src/lib.rs @@ -81,12 +81,14 @@ //! ``` // Quote types in rustdoc of other crates get linked to here. -#![doc(html_root_url = "https://docs.rs/quote/1.0.9")] +#![doc(html_root_url = "https://docs.rs/quote/1.0.10")] #![allow( clippy::doc_markdown, clippy::missing_errors_doc, clippy::missing_panics_doc, - clippy::module_name_repetitions + clippy::module_name_repetitions, + // false positive https://github.com/rust-lang/rust-clippy/issues/6983 + clippy::wrong_self_convention, )] #[cfg(all( @@ -743,9 +745,15 @@ macro_rules! quote_token_with_context { // warnings on anything below the loop. We use has_iter to detect and // fail to compile when there are no iterators, so here we just work // around the unneeded extra warning. - while true { + // + // FIXME: temporariliy working around Clippy regression. + // https://github.com/rust-lang/rust-clippy/issues/7768 + loop { $crate::pounded_var_names!(quote_bind_next_or_break!() () $($inner)*); $crate::quote_each_token!($tokens $($inner)*); + if false { + break; + } } }}; ($tokens:ident $b3:tt $b2:tt # (( $($inner:tt)* )) * $a2:tt $a3:tt) => {}; @@ -757,13 +765,16 @@ macro_rules! quote_token_with_context { let has_iter = $crate::__private::ThereIsNoIteratorInRepetition; $crate::pounded_var_names!(quote_bind_into_iter!(has_iter) () $($inner)*); let _: $crate::__private::HasIterator = has_iter; - while true { + loop { $crate::pounded_var_names!(quote_bind_next_or_break!() () $($inner)*); if _i > 0 { $crate::quote_token!($tokens $sep); } _i += 1; $crate::quote_each_token!($tokens $($inner)*); + if false { + break; + } } }}; ($tokens:ident $b3:tt $b2:tt # (( $($inner:tt)* )) $sep:tt * $a3:tt) => {}; @@ -799,9 +810,15 @@ macro_rules! quote_token_with_context_spanned { // warnings on anything below the loop. We use has_iter to detect and // fail to compile when there are no iterators, so here we just work // around the unneeded extra warning. - while true { + // + // FIXME: temporariliy working around Clippy regression. + // https://github.com/rust-lang/rust-clippy/issues/7768 + loop { $crate::pounded_var_names!(quote_bind_next_or_break!() () $($inner)*); $crate::quote_each_token_spanned!($tokens $span $($inner)*); + if false { + break; + } } }}; ($tokens:ident $span:ident $b3:tt $b2:tt # (( $($inner:tt)* )) * $a2:tt $a3:tt) => {}; @@ -813,13 +830,16 @@ macro_rules! quote_token_with_context_spanned { let has_iter = $crate::__private::ThereIsNoIteratorInRepetition; $crate::pounded_var_names!(quote_bind_into_iter!(has_iter) () $($inner)*); let _: $crate::__private::HasIterator = has_iter; - while true { + loop { $crate::pounded_var_names!(quote_bind_next_or_break!() () $($inner)*); if _i > 0 { $crate::quote_token_spanned!($tokens $span $sep); } _i += 1; $crate::quote_each_token_spanned!($tokens $span $($inner)*); + if false { + break; + } } }}; ($tokens:ident $span:ident $b3:tt $b2:tt # (( $($inner:tt)* )) $sep:tt * $a3:tt) => {}; diff --git a/third_party/rust/quote/src/runtime.rs b/third_party/rust/quote/src/runtime.rs index db3b6a93d95a..92e00f78bfb5 100644 --- a/third_party/rust/quote/src/runtime.rs +++ b/third_party/rust/quote/src/runtime.rs @@ -123,25 +123,6 @@ pub mod ext { } } - macro_rules! array_rep_slice { - ($($l:tt)*) => { - $( - impl<'q, T: 'q> RepAsIteratorExt<'q> for [T; $l] { - type Iter = slice::Iter<'q, T>; - - fn quote_into_iter(&'q self) -> (Self::Iter, HasIter) { - (self.iter(), HasIter) - } - } - )* - } - } - - array_rep_slice!( - 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 - 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 - ); - impl<'q, T: RepAsIteratorExt<'q>> RepAsIteratorExt<'q> for RepInterp { type Iter = T::Iter; diff --git a/third_party/rust/quote/src/to_tokens.rs b/third_party/rust/quote/src/to_tokens.rs index 7f9808396387..dbb8dfc36ea0 100644 --- a/third_party/rust/quote/src/to_tokens.rs +++ b/third_party/rust/quote/src/to_tokens.rs @@ -127,13 +127,15 @@ impl ToTokens for String { } macro_rules! primitive { - ($($t:ident => $name:ident)*) => ($( - impl ToTokens for $t { - fn to_tokens(&self, tokens: &mut TokenStream) { - tokens.append(Literal::$name(*self)); + ($($t:ident => $name:ident)*) => { + $( + impl ToTokens for $t { + fn to_tokens(&self, tokens: &mut TokenStream) { + tokens.append(Literal::$name(*self)); + } } - } - )*) + )* + }; } primitive! { diff --git a/third_party/rust/quote/tests/test.rs b/third_party/rust/quote/tests/test.rs index d5a3490c3d7f..ca633283b1ae 100644 --- a/third_party/rust/quote/tests/test.rs +++ b/third_party/rust/quote/tests/test.rs @@ -1,4 +1,10 @@ -#![cfg_attr(feature = "cargo-clippy", allow(blacklisted_name))] +#![allow( + clippy::blacklisted_name, + clippy::let_underscore_drop, + clippy::shadow_unrelated, + clippy::unseparated_literal_suffix, + clippy::used_underscore_binding +)] use std::borrow::Cow; use std::collections::BTreeSet; @@ -78,6 +84,27 @@ fn test_iter() { assert_eq!("X , X , X , X", quote!(#(#primes),*).to_string()); } +#[test] +fn test_array() { + let array: [u8; 40] = [0; 40]; + let _ = quote!(#(#array #array)*); + + let ref_array: &[u8; 40] = &[0; 40]; + let _ = quote!(#(#ref_array #ref_array)*); + + let ref_slice: &[u8] = &[0; 40]; + let _ = quote!(#(#ref_slice #ref_slice)*); + + let array: [X; 2] = [X, X]; // !Copy + let _ = quote!(#(#array #array)*); + + let ref_array: &[X; 2] = &[X, X]; + let _ = quote!(#(#ref_array #ref_array)*); + + let ref_slice: &[X] = &[X, X]; + let _ = quote!(#(#ref_slice #ref_slice)*); +} + #[test] fn test_advanced() { let generics = quote!( <'a, T> ); diff --git a/third_party/rust/quote/tests/ui/does-not-have-iter-interpolated-dup.stderr b/third_party/rust/quote/tests/ui/does-not-have-iter-interpolated-dup.stderr new file mode 100644 index 000000000000..176f82889584 --- /dev/null +++ b/third_party/rust/quote/tests/ui/does-not-have-iter-interpolated-dup.stderr @@ -0,0 +1,10 @@ +error[E0308]: mismatched types + --> $DIR/does-not-have-iter-interpolated-dup.rs:8:5 + | +8 | quote!(#(#nonrep #nonrep)*); + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | | + | expected struct `HasIterator`, found struct `ThereIsNoIteratorInRepetition` + | expected due to this + | + = note: this error originates in the macro `$crate::quote_token_with_context` (in Nightly builds, run with -Z macro-backtrace for more info) diff --git a/third_party/rust/quote/tests/ui/does-not-have-iter-interpolated.stderr b/third_party/rust/quote/tests/ui/does-not-have-iter-interpolated.stderr new file mode 100644 index 000000000000..40c9eb8708ac --- /dev/null +++ b/third_party/rust/quote/tests/ui/does-not-have-iter-interpolated.stderr @@ -0,0 +1,10 @@ +error[E0308]: mismatched types + --> $DIR/does-not-have-iter-interpolated.rs:8:5 + | +8 | quote!(#(#nonrep)*); + | ^^^^^^^^^^^^^^^^^^^^ + | | + | expected struct `HasIterator`, found struct `ThereIsNoIteratorInRepetition` + | expected due to this + | + = note: this error originates in the macro `$crate::quote_token_with_context` (in Nightly builds, run with -Z macro-backtrace for more info) diff --git a/third_party/rust/quote/tests/ui/does-not-have-iter-separated.stderr b/third_party/rust/quote/tests/ui/does-not-have-iter-separated.stderr new file mode 100644 index 000000000000..8a8a805daf61 --- /dev/null +++ b/third_party/rust/quote/tests/ui/does-not-have-iter-separated.stderr @@ -0,0 +1,10 @@ +error[E0308]: mismatched types + --> $DIR/does-not-have-iter-separated.rs:4:5 + | +4 | quote!(#(a b),*); + | ^^^^^^^^^^^^^^^^^ + | | + | expected struct `HasIterator`, found struct `ThereIsNoIteratorInRepetition` + | expected due to this + | + = note: this error originates in the macro `$crate::quote_token_with_context` (in Nightly builds, run with -Z macro-backtrace for more info) diff --git a/third_party/rust/quote/tests/ui/does-not-have-iter.stderr b/third_party/rust/quote/tests/ui/does-not-have-iter.stderr new file mode 100644 index 000000000000..17871bf31f9d --- /dev/null +++ b/third_party/rust/quote/tests/ui/does-not-have-iter.stderr @@ -0,0 +1,10 @@ +error[E0308]: mismatched types + --> $DIR/does-not-have-iter.rs:4:5 + | +4 | quote!(#(a b)*); + | ^^^^^^^^^^^^^^^^ + | | + | expected struct `HasIterator`, found struct `ThereIsNoIteratorInRepetition` + | expected due to this + | + = note: this error originates in the macro `$crate::quote_token_with_context` (in Nightly builds, run with -Z macro-backtrace for more info) diff --git a/third_party/rust/quote/tests/ui/not-quotable.stderr b/third_party/rust/quote/tests/ui/not-quotable.stderr new file mode 100644 index 000000000000..c70c548f21f0 --- /dev/null +++ b/third_party/rust/quote/tests/ui/not-quotable.stderr @@ -0,0 +1,15 @@ +error[E0277]: the trait bound `Ipv4Addr: ToTokens` is not satisfied + --> $DIR/not-quotable.rs:6:13 + | +6 | let _ = quote! { #ip }; + | ^^^^^^^^^^^^^^ + | | + | the trait `ToTokens` is not implemented for `Ipv4Addr` + | required by a bound introduced by this call + | +note: required by `to_tokens` + --> $DIR/to_tokens.rs:55:5 + | +55 | fn to_tokens(&self, tokens: &mut TokenStream); + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + = note: this error originates in the macro `$crate::quote_token_with_context` (in Nightly builds, run with -Z macro-backtrace for more info) diff --git a/third_party/rust/quote/tests/ui/not-repeatable.stderr b/third_party/rust/quote/tests/ui/not-repeatable.stderr new file mode 100644 index 000000000000..94b8b8769f76 --- /dev/null +++ b/third_party/rust/quote/tests/ui/not-repeatable.stderr @@ -0,0 +1,25 @@ +error[E0599]: the method `quote_into_iter` exists for struct `Ipv4Addr`, but its trait bounds were not satisfied + --> $DIR/not-repeatable.rs:7:13 + | +3 | struct Ipv4Addr; + | ---------------- + | | + | method `quote_into_iter` not found for this + | doesn't satisfy `Ipv4Addr: Iterator` + | doesn't satisfy `Ipv4Addr: ToTokens` + | doesn't satisfy `Ipv4Addr: quote::__private::ext::RepIteratorExt` + | doesn't satisfy `Ipv4Addr: quote::__private::ext::RepToTokensExt` +... +7 | let _ = quote! { #(#ip)* }; + | ^^^^^^^^^^^^^^^^^^ method cannot be called on `Ipv4Addr` due to unsatisfied trait bounds + | + = note: the following trait bounds were not satisfied: + `Ipv4Addr: Iterator` + which is required by `Ipv4Addr: quote::__private::ext::RepIteratorExt` + `&Ipv4Addr: Iterator` + which is required by `&Ipv4Addr: quote::__private::ext::RepIteratorExt` + `Ipv4Addr: ToTokens` + which is required by `Ipv4Addr: quote::__private::ext::RepToTokensExt` + `&mut Ipv4Addr: Iterator` + which is required by `&mut Ipv4Addr: quote::__private::ext::RepIteratorExt` + = note: this error originates in the macro `$crate::quote_bind_into_iter` (in Nightly builds, run with -Z macro-backtrace for more info) diff --git a/third_party/rust/quote/tests/ui/wrong-type-span.stderr b/third_party/rust/quote/tests/ui/wrong-type-span.stderr new file mode 100644 index 000000000000..6ac7b1a88f8b --- /dev/null +++ b/third_party/rust/quote/tests/ui/wrong-type-span.stderr @@ -0,0 +1,8 @@ +error[E0308]: mismatched types + --> $DIR/wrong-type-span.rs:6:20 + | +6 | quote_spanned!(span=> #x); + | ---------------^^^^------- + | | | + | | expected struct `Span`, found `&str` + | expected due to this