From 23df2d1569255f34b705fbc9e9d3f93b8514499b Mon Sep 17 00:00:00 2001 From: Mike Hommey Date: Tue, 16 Aug 2022 21:38:24 +0000 Subject: [PATCH] Bug 1785002 - Update syn to 1.0.99. r=emilio,supply-chain-reviewers Differential Revision: https://phabricator.services.mozilla.com/D154753 --- Cargo.lock | 4 +- supply-chain/audits.toml | 5 + third_party/rust/syn/.cargo-checksum.json | 2 +- third_party/rust/syn/Cargo.toml | 11 +- third_party/rust/syn/README.md | 2 +- third_party/rust/syn/benches/file.rs | 34 +++++- third_party/rust/syn/src/buffer.rs | 100 ++++++++++++------ third_party/rust/syn/src/export.rs | 3 + third_party/rust/syn/src/group.rs | 6 +- third_party/rust/syn/src/lib.rs | 10 +- third_party/rust/syn/src/lit.rs | 2 +- third_party/rust/syn/tests/common/eq.rs | 47 ++++---- third_party/rust/syn/tests/debug/mod.rs | 2 +- .../rust/syn/tests/test_derive_input.rs | 2 +- third_party/rust/syn/tests/test_stmt.rs | 2 +- 15 files changed, 156 insertions(+), 76 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index fab46e1ca19c..73519aa9d749 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -5057,9 +5057,9 @@ dependencies = [ [[package]] name = "syn" -version = "1.0.96" +version = "1.0.99" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0748dd251e24453cb8717f0354206b91557e4ec8703673a4b30208f2abaf1ebf" +checksum = "58dbef6ec655055e20b86b15a8cc6d439cca19b667537ac6a1369572d151ab13" dependencies = [ "proc-macro2", "quote", diff --git a/supply-chain/audits.toml b/supply-chain/audits.toml index ed65a9d95dfd..3064f2065f28 100644 --- a/supply-chain/audits.toml +++ b/supply-chain/audits.toml @@ -613,6 +613,11 @@ criteria = "safe-to-deploy" version = "0.4.1" notes = "Simple string processing with no unsafe code or ambient capability usage." +[[audits.syn]] +who = "Mike Hommey " +criteria = "safe-to-deploy" +delta = "1.0.96 -> 1.0.99" + [[audits.thin-vec]] who = "Aria Beingessner " criteria = "safe-to-deploy" diff --git a/third_party/rust/syn/.cargo-checksum.json b/third_party/rust/syn/.cargo-checksum.json index 989d51085eae..691cc4e06184 100644 --- a/third_party/rust/syn/.cargo-checksum.json +++ b/third_party/rust/syn/.cargo-checksum.json @@ -1 +1 @@ -{"files":{"Cargo.toml":"8e5d8f38d861a33080b78a411a2dd260db11f2638a85edc619feb3fb7a9e5638","LICENSE-APACHE":"a60eea817514531668d7e00765731449fe14d059d3249e0bc93b36de45f759f2","LICENSE-MIT":"23f18e03dc49df91622fe2a76176497404e46ced8a715d9d2b67a7446571cca3","README.md":"417bb33dc685fb0036f91229dd0d828b104a4c35010d362f2a6e5d8b4cf1e36d","benches/file.rs":"af4671030b7fbc3a5dbc37b492e80fcae2893ad7a64dd43dac12cf5906c32301","benches/rust.rs":"22dfbffc39f8d091ef74cca849e7e7c69e9a47f2a06f7dec91c0382401055c14","build.rs":"b815649fd2929d3debd93a58f5da2fb8eba506047a6a5ba538347305828a87b0","src/attr.rs":"234d9cebe2c5e92cd0f5e1117bf5755037e2e905788a337000a65d4bd82b63aa","src/await.rs":"8aa22e3c201cb2bdb6b4817fa00901f308ab06817607aa7b884c58c957705969","src/bigint.rs":"efc7f64959980653d73fe4f8bc2a3a2904dc05f45b02c6dc15cd316fa3d7c338","src/buffer.rs":"24a3ba4928a5b2265199c29b84610b6f988bc422076ad07dfa30e91b6d72314f","src/custom_keyword.rs":"5c706fc3611e73d16b8c019d7ecb848a86b1ccfcd9e556f80bb6e6a4abe058a8","src/custom_punctuation.rs":"8a666298e774b0d326642f0f73284f6677d0d0a7c9e4a712c9c98d010b4d8a2c","src/data.rs":"75d2c2b5d6a01bf8a6fa2845e41663d8045a78b4b191f1a1bd7c93619d20017a","src/derive.rs":"ee24a202be2d36ccdff576dd9cd765e94b33ef2286946e6725d75b08e777d462","src/discouraged.rs":"6c6a9298f8d24f578da119557bc588f3bd928f7b79fca27d6bdfe3e786dd005f","src/error.rs":"e548cc5b7c6f742ab6c19788755980594c4cb8086f99e6709f1cbc982961102d","src/export.rs":"60e27ba28108b56e63981b6e946273cd159e9cae42d665dc9c6a09ad8c20046a","src/expr.rs":"0d441100457567b7b18372fdcbbe833d7516b5a43f17f1cfc4d7f354141b8206","src/ext.rs":"1f648cff1d705a1cea64b32b77482b97a82d2fe0aaf63b40cade91e5c02dc969","src/file.rs":"f86697655222ae294215114f4eae8e6b0b5e2a935d6c479ff8f8f889c4efd2e2","src/gen/clone.rs":"c43199af10b9963476a1ef6b9e0540363a8383c611f8999463235a0939817da8","src/gen/debug.rs":"12e07500a09d1d15b7a148d9155af357c7ac9b65ac100906cf0fac604403274e","src/gen/eq.rs":"e0928a9f4e81a7ede04853d1837abccaf29dd4ffb56d864fad2f4c3a4c76f1b4","src/gen/fold.rs":"43b34e7a951c180b65c6dd97c380f067ea91776f52e70f61555bd8a4120170b1","src/gen/hash.rs":"b66425846386e2168990b3bee2461f5c01695acd8c4b6360619a07108b260f3d","src/gen/visit.rs":"d559f661ab4a4c5b058af91ef244f30f906b6be82d1dd61bf0d058236f8c6a35","src/gen/visit_mut.rs":"fe384074919cdb1a6f54b93f8a9c768da7d3751e5bbfaf8c6c7133a7ebd390ae","src/gen_helper.rs":"ea6c66388365971db6a2fc86cbb208f7eacde77e245bc8623f27a3642a3d7741","src/generics.rs":"46ed41bf116448822ddfefcb62e803fd33264ca8ba672efc0612674d85b6dd11","src/group.rs":"d9cd30ea5bd4d453293e8e8debbe388a0360c3c766f67c8499fec453a9a43cdc","src/ident.rs":"2443e43561abea7eea577b141422258237a663499c839923d8a5ca6fea2470db","src/item.rs":"2745d8bc068f821fc7dc8f480aceac1d10adc578a0b8b7317eb78f5c9048c68c","src/lib.rs":"55bbf8366c1e89631720cd99b046e8a3a8c3a6f6dfd5d9846165fa878eda7a1a","src/lifetime.rs":"b18862ef1e690037a4f308ea897debad7bc5038584e3b26c6d8809752ea0e3c2","src/lit.rs":"e9d1e548e5e1877fa91ba61cb67ab06069750e0e8ae313aec54b0937bd8c17de","src/lookahead.rs":"e2c2b6d55906421e83dab51463b58bc6dcb582f1bff9303c8b62afefb8d71e5f","src/mac.rs":"004cb89f9697564f6c9ee837e08ead68463ef946fb4c13c6c105adf2ba364b2b","src/macros.rs":"936f503c2fcde602f05220954ecaf87625c6138d0af13d33d56c7b6530110084","src/op.rs":"9d499022902743a6a0a19223b356449a979b90e60552d0446497d72750e646a4","src/parse.rs":"7b2f8caddf25a5734cbcdf7cbf043cbf9afbc07b484966cd59ddfcec9f970fb3","src/parse_macro_input.rs":"88929a1a7e5e72aa2d0b3459e52d8975afea856d159047ba4ab02ecbc5878a9c","src/parse_quote.rs":"d7d996f1382c68b5fbfd4b7327ce1d389cd43c3bb3c4f382a35994d0bb79d8ab","src/pat.rs":"1e0223ca92c160e07b17a593bb93dd5d451fc9b7014012b403377a4f0f21bfce","src/path.rs":"1ad8b8335628f67a013b7ce2f662aa2feab4583ff67bc959a9dea1dcb51be8a3","src/print.rs":"da6529c1d9d21aaf6c835f66b4e67eacb7cf91a10eb5e9a2143b49bf99b3b5e1","src/punctuated.rs":"f687c23bd3ae512e7412c28ac68030d3bc7a384d1ca8b3da6620e364b0cbbb78","src/reserved.rs":"e70e028bd55cfa43e23cab4ba29e4dc53a3d91eff685ef2b6e57efc2b87a3428","src/sealed.rs":"896a495a5340eec898527f18bd4ddca408ea03ea0ee3af30074ff48deace778d","src/span.rs":"748c51c6feb223c26d3b1701f5bb98aee823666c775c98106cfa24fe29d8cec1","src/spanned.rs":"3ca016a943637653ab98e373dfb826a120f3c159867346fa38a844439944eb39","src/stmt.rs":"8115bc96090022baad91660d7e5e986664c3f1fbd2f112d1c5d1d77e5c3f227e","src/thread.rs":"815eca6bd64f4eef7c447f0809e84108f5428ff50225224b373efd8fbb696874","src/token.rs":"5e423a696f80e281c322f37c87577f9fdc28607e9c007e24896a2b12da62d5ad","src/tt.rs":"32402645b6e82ef1e882945721b59b5fb7b0ee337d1972876362ecacef643d0f","src/ty.rs":"5c05b000d4884334bed729c3345732fbbb4136a75df9dd5002c493ebb6cd091b","src/verbatim.rs":"802a97df997432f18cac6e6200ff6ea29fb2474986005e0fcdbc2b65197f87f7","src/whitespace.rs":"e63dd0aa3d34029f17766a8b09c1a6e4479e36c552c8b7023d710a399333aace","tests/.gitignore":"22e782449a3c216db3f7215d5fb8882e316768e40beeec3833aae419ad8941db","tests/common/eq.rs":"fc4b0ced43acb32eedecb1a161bfe12148aacdd7bf57c926da55880b70b529f7","tests/common/mod.rs":"432ad35577f836a20b517d8c26ed994ac25fe73ef2f461c67688b61b99762015","tests/common/parse.rs":"81580f23583723f7a2a337c4d13ebc021057cd825562fb4e474caa7cc641fed9","tests/debug/gen.rs":"4937074a11fe8266431d05177435bad28340763d408d0a4c45bd0c0acc90a86a","tests/debug/mod.rs":"c0b48c9f03c6eac6dea6fcecb5927dd1e097c4f4cc1443df64bdc45c7ac2b3c6","tests/macros/mod.rs":"aff805b35cfd55aef6a1359ff747e4023afcb08d69d86aff4c19465d29dda088","tests/regression.rs":"f962ebf24007f631f7e702e34e142d07581da7c9a36321ac142cafed1a0afc69","tests/regression/issue1108.rs":"f32db35244a674e22ff824ca9e5bbec2184e287b59f022db68c418b5878a2edc","tests/repo/mod.rs":"947b678f50df8716ef5c946885a3096e91ab2ec4ce2251cea83d6e6d2ab82eb5","tests/repo/progress.rs":"c08d0314a7f3ecf760d471f27da3cd2a500aeb9f1c8331bffb2aa648f9fabf3f","tests/test_asyncness.rs":"cff01db49d28ab23b0b258bc6c0a5cc4071be4fe7248eef344a5d79d2fb649b7","tests/test_attribute.rs":"0ffd99384e1a52ae17d9fed5c4053e411e8f9018decef07ffa621d1faa7329d8","tests/test_derive_input.rs":"63f0b4d56f3f421e0bb523ce2924afe9e349f0ccefda52ccb8e1e5f342e6d525","tests/test_expr.rs":"a639728866a063b590430965a4840c01755e398b89be12d8d09b0aa97837ecac","tests/test_generics.rs":"54b7d2afc19aa6e9049585f4c8f7d3f0c29ac3bd11a2c769e9df76f18a4f5ecb","tests/test_grouping.rs":"6276c3c73bba649dec5c97904ad2492879f918bc887a2c425d095c654ca0d925","tests/test_ident.rs":"9eb53d1e21edf23e7c9e14dc74dcc2b2538e9221e19dbcc0a44e3acc2e90f3f6","tests/test_item.rs":"a3642c80066f1e7787becfd0278af90a6b7968d6c1249e25e81663aa454cfb2a","tests/test_iterators.rs":"53ed6078d37550bd6765d2411e3660be401aef8a31a407350cc064a7d08c7c33","tests/test_lit.rs":"19740ea9cd4a980bcab9b0dcaa4b032bb6ebb137fa5e4237140b97da1d9679fa","tests/test_meta.rs":"65d4586d131f6cac66694ca5e936748ec4e7f7423af6d8da509240e6be14800b","tests/test_parse_buffer.rs":"68d857f776396d064fcc0023c37093c2fbf75ee68e8241d4014d00d1423c18e9","tests/test_parse_stream.rs":"2f449a2c41a3dee6fd14bee24e1666a453cb808eda17332fd91afd127fcdd2a6","tests/test_pat.rs":"d4465f4fc3fd5d6e534ba8efabe1e0ed6da89de4ac7c96effa6bfb880c4287cf","tests/test_path.rs":"71092a5ae2c9143b92a8fe15a92d39958b3c28bd4d4275cfb2d22cbdd53ada07","tests/test_precedence.rs":"1069d979cec0e6c650bebb58be272d23080ce89e83d194dfa2718d22912e481d","tests/test_receiver.rs":"084eca59984b9a18651da52f2c4407355da3de1335916a12477652999e2d01cc","tests/test_round_trip.rs":"b47662e35be2729f28bacdbbea20f1879c111889430e735a7bcb5f2a5c0b9e5c","tests/test_shebang.rs":"f5772cadad5b56e3112cb16308b779f92bce1c3a48091fc9933deb2276a69331","tests/test_should_parse.rs":"1d3535698a446e2755bfc360676bdb161841a1f454cdef6e7556c6d06a95c89d","tests/test_size.rs":"1aa0dd489bd844a4a9cf32a5310abd66dad1dae3ffb24fe1288b62a26bfdd8dc","tests/test_stmt.rs":"1c39e26e262673aee7747338f0dbca01f5fc4f07b198b11414a614f36d3f9587","tests/test_token_trees.rs":"43e56a701817e3c3bfd0cae54a457dd7a38ccb3ca19da41e2b995fdf20e6ed18","tests/test_ty.rs":"f71d7f7f1c038aaabea8dd4c03c0d5752c76d570f8b4885a81659825bbb4d576","tests/test_visibility.rs":"7456fcb3a6634db509748aededff9c2d8b242d511a3e5ee3022e40b232892704","tests/zzz_stable.rs":"2a862e59cb446235ed99aec0e6ada8e16d3ecc30229b29d825b7c0bbc2602989"},"package":"0748dd251e24453cb8717f0354206b91557e4ec8703673a4b30208f2abaf1ebf"} \ No newline at end of file +{"files":{"Cargo.toml":"598185e9190166e7f3217ced440d8b3e555ae2a6a84b51ee5ea0a5c7f55bdd0b","LICENSE-APACHE":"a60eea817514531668d7e00765731449fe14d059d3249e0bc93b36de45f759f2","LICENSE-MIT":"23f18e03dc49df91622fe2a76176497404e46ced8a715d9d2b67a7446571cca3","README.md":"b1546652aefba564455c1ebbf0f276450d4fdb19755e08bfa03c13c8bab241fc","benches/file.rs":"39e124e8ebb7f7171af29e87debbcaeb87c1eb465ef1436cfd8f218b340ef580","benches/rust.rs":"22dfbffc39f8d091ef74cca849e7e7c69e9a47f2a06f7dec91c0382401055c14","build.rs":"b815649fd2929d3debd93a58f5da2fb8eba506047a6a5ba538347305828a87b0","src/attr.rs":"234d9cebe2c5e92cd0f5e1117bf5755037e2e905788a337000a65d4bd82b63aa","src/await.rs":"8aa22e3c201cb2bdb6b4817fa00901f308ab06817607aa7b884c58c957705969","src/bigint.rs":"efc7f64959980653d73fe4f8bc2a3a2904dc05f45b02c6dc15cd316fa3d7c338","src/buffer.rs":"bd5762429e5eb3c899167e820620e7e2a66b4573c48e17326ed12d7461962536","src/custom_keyword.rs":"5c706fc3611e73d16b8c019d7ecb848a86b1ccfcd9e556f80bb6e6a4abe058a8","src/custom_punctuation.rs":"8a666298e774b0d326642f0f73284f6677d0d0a7c9e4a712c9c98d010b4d8a2c","src/data.rs":"75d2c2b5d6a01bf8a6fa2845e41663d8045a78b4b191f1a1bd7c93619d20017a","src/derive.rs":"ee24a202be2d36ccdff576dd9cd765e94b33ef2286946e6725d75b08e777d462","src/discouraged.rs":"6c6a9298f8d24f578da119557bc588f3bd928f7b79fca27d6bdfe3e786dd005f","src/error.rs":"e548cc5b7c6f742ab6c19788755980594c4cb8086f99e6709f1cbc982961102d","src/export.rs":"0cf50d70c32d5fddba8b1193032df62e560237c113df3e86ba26b565cc82838e","src/expr.rs":"0d441100457567b7b18372fdcbbe833d7516b5a43f17f1cfc4d7f354141b8206","src/ext.rs":"1f648cff1d705a1cea64b32b77482b97a82d2fe0aaf63b40cade91e5c02dc969","src/file.rs":"f86697655222ae294215114f4eae8e6b0b5e2a935d6c479ff8f8f889c4efd2e2","src/gen/clone.rs":"c43199af10b9963476a1ef6b9e0540363a8383c611f8999463235a0939817da8","src/gen/debug.rs":"12e07500a09d1d15b7a148d9155af357c7ac9b65ac100906cf0fac604403274e","src/gen/eq.rs":"e0928a9f4e81a7ede04853d1837abccaf29dd4ffb56d864fad2f4c3a4c76f1b4","src/gen/fold.rs":"43b34e7a951c180b65c6dd97c380f067ea91776f52e70f61555bd8a4120170b1","src/gen/hash.rs":"b66425846386e2168990b3bee2461f5c01695acd8c4b6360619a07108b260f3d","src/gen/visit.rs":"d559f661ab4a4c5b058af91ef244f30f906b6be82d1dd61bf0d058236f8c6a35","src/gen/visit_mut.rs":"fe384074919cdb1a6f54b93f8a9c768da7d3751e5bbfaf8c6c7133a7ebd390ae","src/gen_helper.rs":"ea6c66388365971db6a2fc86cbb208f7eacde77e245bc8623f27a3642a3d7741","src/generics.rs":"46ed41bf116448822ddfefcb62e803fd33264ca8ba672efc0612674d85b6dd11","src/group.rs":"166f0fbb365471ffa3e4f554b72c2b460cbf7e3a1f9bec6c01ef6bbbcd751041","src/ident.rs":"2443e43561abea7eea577b141422258237a663499c839923d8a5ca6fea2470db","src/item.rs":"2745d8bc068f821fc7dc8f480aceac1d10adc578a0b8b7317eb78f5c9048c68c","src/lib.rs":"143cbfa606d88ed75d3f80a27ca582c4b5285e2e60b78991bec02393ffebf334","src/lifetime.rs":"b18862ef1e690037a4f308ea897debad7bc5038584e3b26c6d8809752ea0e3c2","src/lit.rs":"9134ff103d943cfabdbfae56e78881680f91f9902172b890884a05c58131602a","src/lookahead.rs":"e2c2b6d55906421e83dab51463b58bc6dcb582f1bff9303c8b62afefb8d71e5f","src/mac.rs":"004cb89f9697564f6c9ee837e08ead68463ef946fb4c13c6c105adf2ba364b2b","src/macros.rs":"936f503c2fcde602f05220954ecaf87625c6138d0af13d33d56c7b6530110084","src/op.rs":"9d499022902743a6a0a19223b356449a979b90e60552d0446497d72750e646a4","src/parse.rs":"7b2f8caddf25a5734cbcdf7cbf043cbf9afbc07b484966cd59ddfcec9f970fb3","src/parse_macro_input.rs":"88929a1a7e5e72aa2d0b3459e52d8975afea856d159047ba4ab02ecbc5878a9c","src/parse_quote.rs":"d7d996f1382c68b5fbfd4b7327ce1d389cd43c3bb3c4f382a35994d0bb79d8ab","src/pat.rs":"1e0223ca92c160e07b17a593bb93dd5d451fc9b7014012b403377a4f0f21bfce","src/path.rs":"1ad8b8335628f67a013b7ce2f662aa2feab4583ff67bc959a9dea1dcb51be8a3","src/print.rs":"da6529c1d9d21aaf6c835f66b4e67eacb7cf91a10eb5e9a2143b49bf99b3b5e1","src/punctuated.rs":"f687c23bd3ae512e7412c28ac68030d3bc7a384d1ca8b3da6620e364b0cbbb78","src/reserved.rs":"e70e028bd55cfa43e23cab4ba29e4dc53a3d91eff685ef2b6e57efc2b87a3428","src/sealed.rs":"896a495a5340eec898527f18bd4ddca408ea03ea0ee3af30074ff48deace778d","src/span.rs":"748c51c6feb223c26d3b1701f5bb98aee823666c775c98106cfa24fe29d8cec1","src/spanned.rs":"3ca016a943637653ab98e373dfb826a120f3c159867346fa38a844439944eb39","src/stmt.rs":"8115bc96090022baad91660d7e5e986664c3f1fbd2f112d1c5d1d77e5c3f227e","src/thread.rs":"815eca6bd64f4eef7c447f0809e84108f5428ff50225224b373efd8fbb696874","src/token.rs":"5e423a696f80e281c322f37c87577f9fdc28607e9c007e24896a2b12da62d5ad","src/tt.rs":"32402645b6e82ef1e882945721b59b5fb7b0ee337d1972876362ecacef643d0f","src/ty.rs":"5c05b000d4884334bed729c3345732fbbb4136a75df9dd5002c493ebb6cd091b","src/verbatim.rs":"802a97df997432f18cac6e6200ff6ea29fb2474986005e0fcdbc2b65197f87f7","src/whitespace.rs":"e63dd0aa3d34029f17766a8b09c1a6e4479e36c552c8b7023d710a399333aace","tests/.gitignore":"22e782449a3c216db3f7215d5fb8882e316768e40beeec3833aae419ad8941db","tests/common/eq.rs":"529ae94214c0666045a4c16d9beab6c71eedb40e100be8f990674d44480b5ba6","tests/common/mod.rs":"432ad35577f836a20b517d8c26ed994ac25fe73ef2f461c67688b61b99762015","tests/common/parse.rs":"81580f23583723f7a2a337c4d13ebc021057cd825562fb4e474caa7cc641fed9","tests/debug/gen.rs":"4937074a11fe8266431d05177435bad28340763d408d0a4c45bd0c0acc90a86a","tests/debug/mod.rs":"3a6bb799f478101f71c84c6f1a854a58afe2f9db43c39017909346ca20262d94","tests/macros/mod.rs":"aff805b35cfd55aef6a1359ff747e4023afcb08d69d86aff4c19465d29dda088","tests/regression.rs":"f962ebf24007f631f7e702e34e142d07581da7c9a36321ac142cafed1a0afc69","tests/regression/issue1108.rs":"f32db35244a674e22ff824ca9e5bbec2184e287b59f022db68c418b5878a2edc","tests/repo/mod.rs":"947b678f50df8716ef5c946885a3096e91ab2ec4ce2251cea83d6e6d2ab82eb5","tests/repo/progress.rs":"c08d0314a7f3ecf760d471f27da3cd2a500aeb9f1c8331bffb2aa648f9fabf3f","tests/test_asyncness.rs":"cff01db49d28ab23b0b258bc6c0a5cc4071be4fe7248eef344a5d79d2fb649b7","tests/test_attribute.rs":"0ffd99384e1a52ae17d9fed5c4053e411e8f9018decef07ffa621d1faa7329d8","tests/test_derive_input.rs":"62bb86aaaaf730187a46ff700a8e3b2d1a163039b109b6a483aa44ed2b6806fe","tests/test_expr.rs":"a639728866a063b590430965a4840c01755e398b89be12d8d09b0aa97837ecac","tests/test_generics.rs":"54b7d2afc19aa6e9049585f4c8f7d3f0c29ac3bd11a2c769e9df76f18a4f5ecb","tests/test_grouping.rs":"6276c3c73bba649dec5c97904ad2492879f918bc887a2c425d095c654ca0d925","tests/test_ident.rs":"9eb53d1e21edf23e7c9e14dc74dcc2b2538e9221e19dbcc0a44e3acc2e90f3f6","tests/test_item.rs":"a3642c80066f1e7787becfd0278af90a6b7968d6c1249e25e81663aa454cfb2a","tests/test_iterators.rs":"53ed6078d37550bd6765d2411e3660be401aef8a31a407350cc064a7d08c7c33","tests/test_lit.rs":"19740ea9cd4a980bcab9b0dcaa4b032bb6ebb137fa5e4237140b97da1d9679fa","tests/test_meta.rs":"65d4586d131f6cac66694ca5e936748ec4e7f7423af6d8da509240e6be14800b","tests/test_parse_buffer.rs":"68d857f776396d064fcc0023c37093c2fbf75ee68e8241d4014d00d1423c18e9","tests/test_parse_stream.rs":"2f449a2c41a3dee6fd14bee24e1666a453cb808eda17332fd91afd127fcdd2a6","tests/test_pat.rs":"d4465f4fc3fd5d6e534ba8efabe1e0ed6da89de4ac7c96effa6bfb880c4287cf","tests/test_path.rs":"71092a5ae2c9143b92a8fe15a92d39958b3c28bd4d4275cfb2d22cbdd53ada07","tests/test_precedence.rs":"1069d979cec0e6c650bebb58be272d23080ce89e83d194dfa2718d22912e481d","tests/test_receiver.rs":"084eca59984b9a18651da52f2c4407355da3de1335916a12477652999e2d01cc","tests/test_round_trip.rs":"b47662e35be2729f28bacdbbea20f1879c111889430e735a7bcb5f2a5c0b9e5c","tests/test_shebang.rs":"f5772cadad5b56e3112cb16308b779f92bce1c3a48091fc9933deb2276a69331","tests/test_should_parse.rs":"1d3535698a446e2755bfc360676bdb161841a1f454cdef6e7556c6d06a95c89d","tests/test_size.rs":"1aa0dd489bd844a4a9cf32a5310abd66dad1dae3ffb24fe1288b62a26bfdd8dc","tests/test_stmt.rs":"0601fc32131b5501dfcdc4b4248d46bf21e0a98a49eb19439e1a46869dfb30b7","tests/test_token_trees.rs":"43e56a701817e3c3bfd0cae54a457dd7a38ccb3ca19da41e2b995fdf20e6ed18","tests/test_ty.rs":"f71d7f7f1c038aaabea8dd4c03c0d5752c76d570f8b4885a81659825bbb4d576","tests/test_visibility.rs":"7456fcb3a6634db509748aededff9c2d8b242d511a3e5ee3022e40b232892704","tests/zzz_stable.rs":"2a862e59cb446235ed99aec0e6ada8e16d3ecc30229b29d825b7c0bbc2602989"},"package":"58dbef6ec655055e20b86b15a8cc6d439cca19b667537ac6a1369572d151ab13"} \ No newline at end of file diff --git a/third_party/rust/syn/Cargo.toml b/third_party/rust/syn/Cargo.toml index cff566494a72..d03ee2e315a1 100644 --- a/third_party/rust/syn/Cargo.toml +++ b/third_party/rust/syn/Cargo.toml @@ -13,7 +13,7 @@ edition = "2018" rust-version = "1.31" name = "syn" -version = "1.0.96" +version = "1.0.99" authors = ["David Tolnay "] include = [ "/benches/**", @@ -28,7 +28,14 @@ include = [ description = "Parser for Rust source code" documentation = "https://docs.rs/syn" readme = "README.md" -categories = ["development-tools::procedural-macro-helpers"] +keywords = [ + "macros", + "syn", +] +categories = [ + "development-tools::procedural-macro-helpers", + "parser-implementations", +] license = "MIT OR Apache-2.0" repository = "https://github.com/dtolnay/syn" diff --git a/third_party/rust/syn/README.md b/third_party/rust/syn/README.md index 38005f5e537c..9c883ae2b6d0 100644 --- a/third_party/rust/syn/README.md +++ b/third_party/rust/syn/README.md @@ -3,7 +3,7 @@ Parser for Rust source code [github](https://github.com/dtolnay/syn) [crates.io](https://crates.io/crates/syn) -[docs.rs](https://docs.rs/syn) +[docs.rs](https://docs.rs/syn) [build status](https://github.com/dtolnay/syn/actions?query=branch%3Amaster) Syn is a parsing library for parsing a stream of Rust tokens into a syntax tree diff --git a/third_party/rust/syn/benches/file.rs b/third_party/rust/syn/benches/file.rs index 86204df2d735..c500dc24a784 100644 --- a/third_party/rust/syn/benches/file.rs +++ b/third_party/rust/syn/benches/file.rs @@ -2,7 +2,11 @@ #![feature(rustc_private, test)] #![recursion_limit = "1024"] -#![allow(clippy::missing_panics_doc, clippy::must_use_candidate)] +#![allow( + clippy::items_after_statements, + clippy::missing_panics_doc, + clippy::must_use_candidate +)] extern crate test; @@ -15,17 +19,37 @@ mod common; #[path = "../tests/repo/mod.rs"] pub mod repo; -use proc_macro2::TokenStream; +use proc_macro2::{Span, TokenStream}; use std::fs; use std::str::FromStr; +use syn::parse::{ParseStream, Parser}; use test::Bencher; const FILE: &str = "tests/rust/library/core/src/str/mod.rs"; -#[bench] -fn parse_file(b: &mut Bencher) { +fn get_tokens() -> TokenStream { repo::clone_rust(); let content = fs::read_to_string(FILE).unwrap(); - let tokens = TokenStream::from_str(&content).unwrap(); + TokenStream::from_str(&content).unwrap() +} + +#[bench] +fn baseline(b: &mut Bencher) { + let tokens = get_tokens(); + b.iter(|| drop(tokens.clone())); +} + +#[bench] +fn create_token_buffer(b: &mut Bencher) { + let tokens = get_tokens(); + fn immediate_fail(_input: ParseStream) -> syn::Result<()> { + Err(syn::Error::new(Span::call_site(), "")) + } + b.iter(|| immediate_fail.parse2(tokens.clone())); +} + +#[bench] +fn parse_file(b: &mut Bencher) { + let tokens = get_tokens(); b.iter(|| syn::parse2::(tokens.clone())); } diff --git a/third_party/rust/syn/src/buffer.rs b/third_party/rust/syn/src/buffer.rs index 2cb6690f0b0b..2c8e21bdb2b9 100644 --- a/third_party/rust/syn/src/buffer.rs +++ b/third_party/rust/syn/src/buffer.rs @@ -14,7 +14,9 @@ use crate::proc_macro as pm; use crate::Lifetime; use proc_macro2::{Delimiter, Group, Ident, Literal, Punct, Spacing, Span, TokenStream, TokenTree}; +use std::hint; use std::marker::PhantomData; +use std::mem; use std::ptr; use std::slice; @@ -57,29 +59,39 @@ impl TokenBuffer { // NOTE: Do not mutate the Vec returned from this function once it returns; // the address of its backing memory must remain stable. fn inner_new(stream: TokenStream, up: *const Entry) -> TokenBuffer { - // Build up the entries list, recording the locations of any Groups - // in the list to be processed later. - let mut entries = Vec::new(); - let mut groups = Vec::new(); - for tt in stream { + let iterator = stream.into_iter(); + let mut entries = Vec::with_capacity(iterator.size_hint().0 + 1); + let mut next_index_after_last_group = 0; + for tt in iterator { match tt { - TokenTree::Ident(sym) => { - entries.push(Entry::Ident(sym)); + TokenTree::Ident(ident) => { + entries.push(Entry::Ident(ident)); } - TokenTree::Punct(op) => { - entries.push(Entry::Punct(op)); + TokenTree::Punct(punct) => { + entries.push(Entry::Punct(punct)); } - TokenTree::Literal(l) => { - entries.push(Entry::Literal(l)); + TokenTree::Literal(literal) => { + entries.push(Entry::Literal(literal)); } - TokenTree::Group(g) => { - // Record the index of the interesting entry, and store an - // `End(null)` there temporarily. - groups.push((entries.len(), g)); - entries.push(Entry::End(ptr::null())); + TokenTree::Group(group) => { + // We cannot fill in a real `End` pointer until `entries` is + // finished growing and getting potentially reallocated. + // Instead, we temporarily coopt the spot where the end + // pointer would go, and use it to string together an + // intrusive linked list of all the Entry::Group entries in + // the vector. Later after `entries` is done growing, we'll + // traverse the linked list and fill in all the end + // pointers with a correct value. + let group_up = + ptr::null::().wrapping_add(next_index_after_last_group) as *const Entry; + + let inner = Self::inner_new(group.stream(), group_up); + entries.push(Entry::Group(group, inner)); + next_index_after_last_group = entries.len(); } } } + // Add an `End` entry to the end with a reference to the enclosing token // stream which was passed in. entries.push(Entry::End(up)); @@ -90,20 +102,36 @@ impl TokenBuffer { // pointer into it. let entries = entries.into_boxed_slice(); let len = entries.len(); + // Convert boxed slice into a pointer to the first element early, to // avoid invalidating pointers into this slice when we move the Box. // See https://github.com/rust-lang/unsafe-code-guidelines/issues/326 let entries = Box::into_raw(entries) as *mut Entry; - for (idx, group) in groups { - // We know that this index refers to one of the temporary - // `End(null)` entries, and we know that the last entry is - // `End(up)`, so the next index is also valid. - let group_up = unsafe { entries.add(idx + 1) }; - // The end entry stored at the end of this Entry::Group should - // point to the Entry which follows the Group in the list. - let inner = Self::inner_new(group.stream(), group_up); - unsafe { *entries.add(idx) = Entry::Group(group, inner) }; + // Traverse intrusive linked list of Entry::Group entries and fill in + // correct End pointers. + while let Some(idx) = next_index_after_last_group.checked_sub(1) { + // We know that idx refers to one of the Entry::Group entries, and + // that the very last entry is an Entry::End, so the next index + // after any group entry is a valid index. + let group_up = unsafe { entries.add(next_index_after_last_group) }; + + // Linked list only takes us to entries which are of type Group. + let token_buffer = match unsafe { &*entries.add(idx) } { + Entry::Group(_group, token_buffer) => token_buffer, + _ => unsafe { hint::unreachable_unchecked() }, + }; + + // Last entry in any TokenBuffer is of type End. + let buffer_ptr = token_buffer.ptr as *mut Entry; + let last_entry = unsafe { &mut *buffer_ptr.add(token_buffer.len - 1) }; + let end_ptr_slot = match last_entry { + Entry::End(end_ptr_slot) => end_ptr_slot, + _ => unsafe { hint::unreachable_unchecked() }, + }; + + // Step to next element in linked list. + next_index_after_last_group = mem::replace(end_ptr_slot, group_up) as usize; } TokenBuffer { ptr: entries, len } @@ -275,7 +303,9 @@ impl<'a> Cursor<'a> { pub fn punct(mut self) -> Option<(Punct, Cursor<'a>)> { self.ignore_none(); match self.entry() { - Entry::Punct(op) if op.as_char() != '\'' => Some((op.clone(), unsafe { self.bump() })), + Entry::Punct(punct) if punct.as_char() != '\'' => { + Some((punct.clone(), unsafe { self.bump() })) + } _ => None, } } @@ -285,7 +315,7 @@ impl<'a> Cursor<'a> { pub fn literal(mut self) -> Option<(Literal, Cursor<'a>)> { self.ignore_none(); match self.entry() { - Entry::Literal(lit) => Some((lit.clone(), unsafe { self.bump() })), + Entry::Literal(literal) => Some((literal.clone(), unsafe { self.bump() })), _ => None, } } @@ -295,12 +325,12 @@ impl<'a> Cursor<'a> { pub fn lifetime(mut self) -> Option<(Lifetime, Cursor<'a>)> { self.ignore_none(); match self.entry() { - Entry::Punct(op) if op.as_char() == '\'' && op.spacing() == Spacing::Joint => { + Entry::Punct(punct) if punct.as_char() == '\'' && punct.spacing() == Spacing::Joint => { let next = unsafe { self.bump() }; match next.ident() { Some((ident, rest)) => { let lifetime = Lifetime { - apostrophe: op.span(), + apostrophe: punct.span(), ident, }; Some((lifetime, rest)) @@ -334,9 +364,9 @@ impl<'a> Cursor<'a> { pub fn token_tree(self) -> Option<(TokenTree, Cursor<'a>)> { let tree = match self.entry() { Entry::Group(group, _) => group.clone().into(), - Entry::Literal(lit) => lit.clone().into(), + Entry::Literal(literal) => literal.clone().into(), Entry::Ident(ident) => ident.clone().into(), - Entry::Punct(op) => op.clone().into(), + Entry::Punct(punct) => punct.clone().into(), Entry::End(..) => return None, }; @@ -348,9 +378,9 @@ impl<'a> Cursor<'a> { pub fn span(self) -> Span { match self.entry() { Entry::Group(group, _) => group.span(), - Entry::Literal(l) => l.span(), - Entry::Ident(t) => t.span(), - Entry::Punct(o) => o.span(), + Entry::Literal(literal) => literal.span(), + Entry::Ident(ident) => ident.span(), + Entry::Punct(punct) => punct.span(), Entry::End(..) => Span::call_site(), } } @@ -364,7 +394,7 @@ impl<'a> Cursor<'a> { Entry::End(..) => None, // Treat lifetimes as a single tt for the purposes of 'skip'. - Entry::Punct(op) if op.as_char() == '\'' && op.spacing() == Spacing::Joint => { + Entry::Punct(punct) if punct.as_char() == '\'' && punct.spacing() == Spacing::Joint => { let next = unsafe { self.bump() }; match next.entry() { Entry::Ident(_) => Some(unsafe { next.bump() }), diff --git a/third_party/rust/syn/src/export.rs b/third_party/rust/syn/src/export.rs index d3a087841e65..f478d091ea12 100644 --- a/third_party/rust/syn/src/export.rs +++ b/third_party/rust/syn/src/export.rs @@ -12,6 +12,9 @@ pub extern crate quote; pub use proc_macro2::{Span, TokenStream as TokenStream2}; +#[cfg(feature = "parsing")] +pub use crate::group::{parse_braces, parse_brackets, parse_parens}; + pub use crate::span::IntoSpans; #[cfg(all( diff --git a/third_party/rust/syn/src/group.rs b/third_party/rust/syn/src/group.rs index 6b05710154a5..7fd273c1de00 100644 --- a/third_party/rust/syn/src/group.rs +++ b/third_party/rust/syn/src/group.rs @@ -136,7 +136,7 @@ fn parse_delimited<'a>( #[cfg_attr(doc_cfg, doc(cfg(feature = "parsing")))] macro_rules! parenthesized { ($content:ident in $cursor:expr) => { - match $crate::group::parse_parens(&$cursor) { + match $crate::__private::parse_parens(&$cursor) { $crate::__private::Ok(parens) => { $content = parens.content; parens.token @@ -214,7 +214,7 @@ macro_rules! parenthesized { #[cfg_attr(doc_cfg, doc(cfg(feature = "parsing")))] macro_rules! braced { ($content:ident in $cursor:expr) => { - match $crate::group::parse_braces(&$cursor) { + match $crate::__private::parse_braces(&$cursor) { $crate::__private::Ok(braces) => { $content = braces.content; braces.token @@ -269,7 +269,7 @@ macro_rules! braced { #[cfg_attr(doc_cfg, doc(cfg(feature = "parsing")))] macro_rules! bracketed { ($content:ident in $cursor:expr) => { - match $crate::group::parse_brackets(&$cursor) { + match $crate::__private::parse_brackets(&$cursor) { $crate::__private::Ok(brackets) => { $content = brackets.content; brackets.token diff --git a/third_party/rust/syn/src/lib.rs b/third_party/rust/syn/src/lib.rs index 3449393b229e..09addd3a6ad6 100644 --- a/third_party/rust/syn/src/lib.rs +++ b/third_party/rust/syn/src/lib.rs @@ -2,7 +2,7 @@ //! //! [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 +//! [docs-rs]: https://img.shields.io/badge/docs.rs-66c2a5?style=for-the-badge&labelColor=555555&logo=docs.rs //! //!
//! @@ -250,15 +250,17 @@ //! dynamic library libproc_macro from rustc toolchain. // Syn types in rustdoc of other crates get linked to here. -#![doc(html_root_url = "https://docs.rs/syn/1.0.96")] +#![doc(html_root_url = "https://docs.rs/syn/1.0.99")] #![cfg_attr(doc_cfg, feature(doc_cfg))] #![allow(non_camel_case_types)] #![allow( clippy::cast_lossless, clippy::cast_possible_truncation, + clippy::cast_ptr_alignment, clippy::default_trait_access, clippy::doc_markdown, clippy::expl_impl_clone_on_copy, + clippy::explicit_auto_deref, clippy::if_not_else, clippy::inherent_to_string, clippy::large_enum_variant, @@ -299,11 +301,9 @@ extern crate quote; #[macro_use] mod macros; -// Not public API. #[cfg(feature = "parsing")] -#[doc(hidden)] #[macro_use] -pub mod group; +mod group; #[macro_use] pub mod token; diff --git a/third_party/rust/syn/src/lit.rs b/third_party/rust/syn/src/lit.rs index bb61ee26a89a..2600dc80108c 100644 --- a/third_party/rust/syn/src/lit.rs +++ b/third_party/rust/syn/src/lit.rs @@ -1480,7 +1480,7 @@ mod value { let mut bytes = input.to_owned().into_bytes(); - let start = (*bytes.get(0)? == b'-') as usize; + let start = (*bytes.first()? == b'-') as usize; match bytes.get(start)? { b'0'..=b'9' => {} _ => return None, diff --git a/third_party/rust/syn/tests/common/eq.rs b/third_party/rust/syn/tests/common/eq.rs index a6c3791650ec..ff100aa4124c 100644 --- a/third_party/rust/syn/tests/common/eq.rs +++ b/third_party/rust/syn/tests/common/eq.rs @@ -24,6 +24,7 @@ use rustc_ast::ast::Block; use rustc_ast::ast::BlockCheckMode; use rustc_ast::ast::BorrowKind; use rustc_ast::ast::CaptureBy; +use rustc_ast::ast::ClosureBinder; use rustc_ast::ast::Const; use rustc_ast::ast::Crate; use rustc_ast::ast::Defaultness; @@ -145,7 +146,7 @@ impl SpanlessEq for Box { } } -impl SpanlessEq for P { +impl SpanlessEq for P { fn eq(&self, other: &Self) -> bool { SpanlessEq::eq(&**self, &**other) } @@ -466,9 +467,10 @@ spanless_eq_enum!(BindingMode; ByRef(0) ByValue(0)); spanless_eq_enum!(BlockCheckMode; Default Unsafe(0)); spanless_eq_enum!(BorrowKind; Ref Raw); spanless_eq_enum!(CaptureBy; Value Ref); +spanless_eq_enum!(ClosureBinder; NotPresent For(span generic_params)); spanless_eq_enum!(Const; Yes(0) No); spanless_eq_enum!(Defaultness; Default(0) Final); -spanless_eq_enum!(Extern; None Implicit Explicit(0)); +spanless_eq_enum!(Extern; None Implicit(0) Explicit(0 1)); spanless_eq_enum!(FloatTy; F32 F64); spanless_eq_enum!(FnRetTy; Default(0) Ty(0)); spanless_eq_enum!(ForeignItemKind; Static(0 1 2) Fn(0) TyAlias(0) MacCall(0)); @@ -498,7 +500,7 @@ spanless_eq_enum!(StmtKind; Local(0) Item(0) Expr(0) Semi(0) Empty MacCall(0)); spanless_eq_enum!(StrStyle; Cooked Raw(0)); spanless_eq_enum!(StructRest; Base(0) Rest(0) None); spanless_eq_enum!(Term; Ty(0) Const(0)); -spanless_eq_enum!(TokenTree; Token(0) Delimited(0 1 2)); +spanless_eq_enum!(TokenTree; Token(0 1) Delimited(0 1 2)); spanless_eq_enum!(TraitBoundModifier; None Maybe MaybeConst MaybeConstMaybe); spanless_eq_enum!(TraitObjectSyntax; Dyn None); spanless_eq_enum!(UintTy; Usize U8 U16 U32 U64 U128); @@ -512,7 +514,7 @@ spanless_eq_enum!(WherePredicate; BoundPredicate(0) RegionPredicate(0) EqPredica spanless_eq_enum!(ExprKind; Box(0) Array(0) ConstBlock(0) Call(0 1) MethodCall(0 1 2) Tup(0) Binary(0 1 2) Unary(0 1) Lit(0) Cast(0 1) Type(0 1) Let(0 1 2) If(0 1 2) While(0 1 2) ForLoop(0 1 2 3) Loop(0 1) Match(0 1) - Closure(0 1 2 3 4 5) Block(0 1) Async(0 1 2) Await(0) TryBlock(0) + Closure(0 1 2 3 4 5 6) Block(0 1) Async(0 1 2) Await(0) TryBlock(0) Assign(0 1 2) AssignOp(0 1 2) Field(0 1) Index(0 1) Underscore Range(0 1 2) Path(0 1) AddrOf(0 1 2) Break(0 1) Continue(0) Ret(0) InlineAsm(0) MacCall(0) Struct(0) Repeat(0 1) Paren(0) Try(0) Yield(0) Yeet(0) Err); @@ -610,7 +612,7 @@ impl SpanlessEq for TokenStream { if SpanlessEq::eq(this, other) { continue; } - if let (TokenTree::Token(this), TokenTree::Token(other)) = (this, other) { + if let (TokenTree::Token(this, _), TokenTree::Token(other, _)) = (this, other) { if match (&this.kind, &other.kind) { (TokenKind::Literal(this), TokenKind::Literal(other)) => { SpanlessEq::eq(this, other) @@ -641,10 +643,13 @@ fn doc_comment<'a>( AttrStyle::Inner => true, } { match trees.next() { - Some(TokenTree::Token(Token { - kind: TokenKind::Not, - span: _, - })) => {} + Some(TokenTree::Token( + Token { + kind: TokenKind::Not, + span: _, + }, + _spacing, + )) => {} _ => return false, } } @@ -654,21 +659,27 @@ fn doc_comment<'a>( }; let mut trees = stream.trees(); match trees.next() { - Some(TokenTree::Token(Token { - kind: TokenKind::Ident(symbol, false), - span: _, - })) if *symbol == sym::doc => {} + Some(TokenTree::Token( + Token { + kind: TokenKind::Ident(symbol, false), + span: _, + }, + _spacing, + )) if *symbol == sym::doc => {} _ => return false, } match trees.next() { - Some(TokenTree::Token(Token { - kind: TokenKind::Eq, - span: _, - })) => {} + Some(TokenTree::Token( + Token { + kind: TokenKind::Eq, + span: _, + }, + _spacing, + )) => {} _ => return false, } match trees.next() { - Some(TokenTree::Token(token)) => { + Some(TokenTree::Token(token, _spacing)) => { is_escaped_literal_token(token, unescaped) && trees.next().is_none() } _ => false, diff --git a/third_party/rust/syn/tests/debug/mod.rs b/third_party/rust/syn/tests/debug/mod.rs index 05de61264a97..0a0991a92404 100644 --- a/third_party/rust/syn/tests/debug/mod.rs +++ b/third_party/rust/syn/tests/debug/mod.rs @@ -87,7 +87,7 @@ where Lite: Debug, { fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result { - Debug::fmt(Lite(&*self.value), formatter) + Debug::fmt(Lite(self.value), formatter) } } diff --git a/third_party/rust/syn/tests/test_derive_input.rs b/third_party/rust/syn/tests/test_derive_input.rs index 93634e5772c8..1eff01186a3b 100644 --- a/third_party/rust/syn/tests/test_derive_input.rs +++ b/third_party/rust/syn/tests/test_derive_input.rs @@ -1,4 +1,4 @@ -#![allow(clippy::too_many_lines)] +#![allow(clippy::assertions_on_result_states, clippy::too_many_lines)] #[macro_use] mod macros; diff --git a/third_party/rust/syn/tests/test_stmt.rs b/third_party/rust/syn/tests/test_stmt.rs index 0bca62b048bf..f444e5b49e15 100644 --- a/third_party/rust/syn/tests/test_stmt.rs +++ b/third_party/rust/syn/tests/test_stmt.rs @@ -1,4 +1,4 @@ -#![allow(clippy::non_ascii_literal)] +#![allow(clippy::assertions_on_result_states, clippy::non_ascii_literal)] #[macro_use] mod macros;