From d1b2d29528b7794b41e66fc2136e395a02f8529b Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Thu, 30 May 2024 05:59:35 +0200 Subject: Merging upstream version 1.73.0+dfsg1. Signed-off-by: Daniel Baumann --- vendor/syn/.cargo-checksum.json | 2 +- vendor/syn/Cargo.toml | 5 +- vendor/syn/README.md | 12 +- vendor/syn/benches/rust.rs | 2 +- vendor/syn/src/error.rs | 2 +- vendor/syn/src/expr.rs | 18 ++- vendor/syn/src/gen/fold.rs | 6 +- vendor/syn/src/gen/visit.rs | 1 + vendor/syn/src/gen/visit_mut.rs | 1 + vendor/syn/src/generics.rs | 2 +- vendor/syn/src/ident.rs | 1 - vendor/syn/src/item.rs | 304 +++++++++++++++++++----------------- vendor/syn/src/lib.rs | 5 +- vendor/syn/src/lit.rs | 17 +- vendor/syn/src/pat.rs | 6 +- vendor/syn/src/path.rs | 42 ++++- vendor/syn/src/punctuated.rs | 5 + vendor/syn/src/spanned.rs | 3 + vendor/syn/src/stmt.rs | 7 +- vendor/syn/src/thread.rs | 20 ++- vendor/syn/src/ty.rs | 4 +- vendor/syn/src/verbatim.rs | 4 +- vendor/syn/tests/common/eq.rs | 6 +- vendor/syn/tests/macros/mod.rs | 15 +- vendor/syn/tests/repo/mod.rs | 26 +-- vendor/syn/tests/test_expr.rs | 2 +- vendor/syn/tests/test_round_trip.rs | 5 +- 27 files changed, 316 insertions(+), 207 deletions(-) (limited to 'vendor/syn') diff --git a/vendor/syn/.cargo-checksum.json b/vendor/syn/.cargo-checksum.json index 8085d0f2e..dc7be8961 100644 --- a/vendor/syn/.cargo-checksum.json +++ b/vendor/syn/.cargo-checksum.json @@ -1 +1 @@ -{"files":{"Cargo.toml":"8764581374625fbc849f047e6df8044b4b8d265448936df5e8d46f6794e315d3","LICENSE-APACHE":"62c7a1e35f56406896d7aa7ca52d0cc0d272ac022b5d2796e7d6905db8a3636a","LICENSE-MIT":"23f18e03dc49df91622fe2a76176497404e46ced8a715d9d2b67a7446571cca3","README.md":"33fd74d909172770aaf840c519f7c59ef185a4a8d21c1e5e4dcd6a398e7e1e61","benches/file.rs":"0a0527c78d849148cbb6118b4d36f72da7d4add865ba1a410e0a1be9e8dbfe0e","benches/rust.rs":"cc2f7ce7b547b746b02215c8eabeb82697bff9d54fabec70156b54f6dc6492cd","src/attr.rs":"bd5ffae18a363162f7d9c12a1b6c1d023070cbf1b060c98ebc38ef79f1de9c67","src/bigint.rs":"0299829b2f7a1a798fe2f7bc1680e4a10f9b6f4a852d09af4da2deab466c4242","src/buffer.rs":"3ef1c3302acc4f9976484fd11c28981a5ff245cf4f3b8b888b7f065c8614881e","src/custom_keyword.rs":"b82199b98f67ed5c0025f5e8791b8c9a755522e54aa5ab8fbab2b01b36fdb400","src/custom_punctuation.rs":"39b38bc18553aa902a5ce842f503390c30e259b4404d5fb63d2401af7c73b527","src/data.rs":"7d217b0252a0d14b2db308ac00f48ba24a831e01a49b893f5b3ee6b580dab4cb","src/derive.rs":"3132e7f064725c7ca43f26daee93ec78037d46a935c6b0758af905cff450c15c","src/discouraged.rs":"482970b03bdee3cbc30c034f644e3293b25387db46300da5d8d8efd97dad8507","src/drops.rs":"013385f1dd95663f1afab41abc1e2eea04181998644828935ca564c74d6462ae","src/error.rs":"c75089eeb5c0a231e747cbe479e84a379841a6e8d61fd072347cfae09c8781ec","src/export.rs":"db5b1c71686d2788935ec30fa47d86efe949cc628bea88b6bc2f29cdc833f2e8","src/expr.rs":"2c75883e95b922835fdc8cca21aa756ffe75d4692e1f61cd3ee9f2839780479d","src/ext.rs":"3cf2d869812e5be894aa1c48bf074da262143fb2df1c9ac1b5ee965bf2a96a1c","src/file.rs":"a4d510dd0e2756bd54983dfa747601918c801e987cbf92deab44cdca6a201aeb","src/gen/clone.rs":"46540509dc99bb849014948a0c5b02ea372d5feceae5ea391c29f226f06516eb","src/gen/debug.rs":"32b2076b755f021428a0fb268a94057e1bcb1cd400feb895946703d7919b843a","src/gen/eq.rs":"aa5455b2cc0d9846d119ce001e821872df911f65133b993e3801a42e8f635f2a","src/gen/fold.rs":"45ac5b6915d5214fa1e9af84621584443f599f838ed936fa8bda3b68a9cc4b6a","src/gen/hash.rs":"4ca8239c681ea5fd7b16bb61bff9034bff09680c088f5a16e90e99013e55742f","src/gen/visit.rs":"0a10ef3a2c5cae7aed83e8ffb5da9f9c85e0fdbae82025cc411f6328bf7fda9e","src/gen/visit_mut.rs":"1f6cfa463da0f970063e70831e3ff6b07d725c77c6e20ece17c0731d90d5b4a4","src/gen_helper.rs":"750caab67ba0ba11a95ea28cd38026485227bb4aa114cdb497472386f60fdb35","src/generics.rs":"d080112c1d3084e9d701ab628cfa77881ed9398c638ba40c7e4135d9b3f1e784","src/group.rs":"fb7f24019ab612ba85f091c4edda3b2f0154f39caa18c9a139ee600afffbeefa","src/ident.rs":"711647537aee87d7249bbcdeb2cc90d146937998dd435395c85c6b18a10b5e07","src/item.rs":"6f9c8c8bd6f1a30d39e9df5e8be978c3d2d727df64c5e64fb34199f770df6a2f","src/lib.rs":"17aef9c31fcb5815138fcfabc99066566e86785d7fd23bcdb0766208213c0328","src/lifetime.rs":"531ef74507eaf942a3aedfac83bbdbc17463102a6c806f675a83a0d6dc612c52","src/lit.rs":"72214440bdfa844aa86853aec42cd6900dff47a3cab4bc8d83ad205a115c09ce","src/lookahead.rs":"376092f91a1c32e1b277db0a6790fdda151c9ec51bd971fe6a6545b5b9e73b5d","src/mac.rs":"b1cf73f34a27a8f1429125e726623a524fb5dce875eb68ead3beaffa976442c3","src/macros.rs":"4e464104c590200213635624706d83e4a0ddd5aedd826ab4aabb390000f35ae0","src/meta.rs":"9df61ebaa405ef743ba1629b39ee5e806f9ead77694a1027f192da860270c83d","src/op.rs":"fe5db7c3373b956234ea8a1a7d129a06e5aef5db77c44c1c2fedb4aaa667ac56","src/parse.rs":"e57637899f8533da26e16d41575c3489fd1bf3560cea427ba57b3c966d891d8e","src/parse_macro_input.rs":"4a753b2a6dbfefd6dc93852d66b4f6d73ebd6b8b9be74019fc476f429b9a892d","src/parse_quote.rs":"60eff4d03bf4f5977be86f49faad16d6713121f69bedd868f951bbcabf443d66","src/pat.rs":"cae5d096a31f7dfe96213f6d83a6c717ef5e2ef4a10793f4d28e2099e6ee404b","src/path.rs":"8dcedaab7ca9e9bc901fb74079e35bfca6ff9e45bc5ca75af1008c087a2c24c8","src/print.rs":"22910bf0521ab868ebd7c62601c55912d12cfb400c65723e08e5cfa3a2d111c0","src/punctuated.rs":"6c072f20c5ff0eda8916e94c415c8fd62e113faf87316be4b6e5ca64042b6b01","src/restriction.rs":"62efbc127d7e7316dd1070c0e976872de6238b2602bba1fb35df18511b4e7199","src/sealed.rs":"6ece3b3dcb30f6bb98b93d83759ca7712ee8592bef9c0511141039c38765db0e","src/span.rs":"4c13579eaf94803bcdb98696e4c3e26fd5cfb7ad46e5a727ed087e5935530a59","src/spanned.rs":"311f4ca8ab9d436df8861a8ea3411d8eff0920354457e124ac85d0579c074981","src/stmt.rs":"acd8ad6406a8e0c11de789f4907d127bdbe8fdf2be68de957298905492ec195c","src/thread.rs":"32f1d8a9890a15920bb939e51647a6630c0661c3fae282834394e4437b8aa5df","src/token.rs":"8b0b4535972fb7b3640e27cb54f80d0e61f27334f2c4c2226c6bae7958299527","src/tt.rs":"32490509abcc4a5a3c7eb5628337172b3b49d30697d2f7b7df4d8045255c13da","src/ty.rs":"6b0185102966685329c1797c6e6bbac47ffe91cb8d68218f454443ba5d252206","src/verbatim.rs":"8d2a42a0aad2a5e69d9b32ba7fb3564fce003fe0862dbc01e106f15d951f3060","src/whitespace.rs":"718a80c12cdd145358e2690f0f68ff7779a91ec17ce9fde9bb755f635fce69ad","tests/common/eq.rs":"2c19e6a65dc16e1d7e1923422ccb98e77b05760b2d7aa5712b25fd33bf80e12f","tests/common/mod.rs":"432ad35577f836a20b517d8c26ed994ac25fe73ef2f461c67688b61b99762015","tests/common/parse.rs":"246ddf1d303a9dbbc380e8d0689bd851cef3c3146d09d2627175deb9203b003d","tests/debug/gen.rs":"0b689be01a4f4a0d168617b0f867f248a9e3d211e259926e6ec6c10a59776d81","tests/debug/mod.rs":"dd87563bbd359401790a9c4185178539929ff9fa35a6998657af82a85731fe4c","tests/macros/mod.rs":"aff805b35cfd55aef6a1359ff747e4023afcb08d69d86aff4c19465d29dda088","tests/regression.rs":"e9565ea0efecb4136f099164ffcfa26e1996b0a27fb9c6659e90ad9bdd42e7b6","tests/regression/issue1108.rs":"f32db35244a674e22ff824ca9e5bbec2184e287b59f022db68c418b5878a2edc","tests/regression/issue1235.rs":"a2266b10c3f7c7af5734817ab0a3e8b309b51e7d177b63f26e67e6b744d280b0","tests/repo/mod.rs":"c624f94ac3238a4231dd884daf330979ccd600b2169cc76ddd2306aeebfae8d9","tests/repo/progress.rs":"c08d0314a7f3ecf760d471f27da3cd2a500aeb9f1c8331bffb2aa648f9fabf3f","tests/test_asyncness.rs":"3868181f25f7470476077f80a442a7804b6b9b371ad5917f4fd18b1002714c64","tests/test_attribute.rs":"b35550a43bbd187bb330997ba36f90c65d8fc489135b1d32ef4547f145cb7612","tests/test_derive_input.rs":"c215245c4d09052661ac5b65b34e950ea47622847bdffe648d380470f12db8f2","tests/test_expr.rs":"1d8688c51d4e8dd5a288722ec8c074320081756fcc83812f23109dffe0caddbf","tests/test_generics.rs":"b77741aa38e6ac7e1a9082faf168e7b7b92fbabf9f3fd07306676339a67394df","tests/test_grouping.rs":"ecbe3324878b2e2be42640a3dec198620cff18731fcb95ee7e94eacd11d2fec1","tests/test_ident.rs":"9eb53d1e21edf23e7c9e14dc74dcc2b2538e9221e19dbcc0a44e3acc2e90f3f6","tests/test_item.rs":"7f0255b61d0a6921313c09aaba470beefc55f1d4e66d1e24cfac7a3f63b035d8","tests/test_iterators.rs":"f4dacb5f3a8e0473dfb0d27f05270d41e79eddb4759b1fad3e88e379b4731e17","tests/test_lit.rs":"7297fed48ca248689f112f67b6f024f2f2784e29c6cd33185ac659c350834b01","tests/test_meta.rs":"3e1bb60b4bd56adb1e04b0e2d867404f0d81f7bf69caf7d8a70fc7090e079e84","tests/test_parse_buffer.rs":"3ed83ea2e50f84b80c0b543aac4bfbd379610d0911c0baa1eb94bb925bda7341","tests/test_parse_stream.rs":"a7e186272c89a239cae03053b5a039cdc073cdb46fad64b178fe76fde98405d5","tests/test_pat.rs":"fe94e084ee478d41cccea4eeb3e975386a70d36ff7cbb902ba0c767d536aab6e","tests/test_path.rs":"0033e1082b576bb3217ebd4546423d6f86fde7ee7ba3aba8c57bf137d2b42f47","tests/test_precedence.rs":"1395b213a1aa953a3b2eacc922853f8d0e3afba552325440bfbe4df6b62102a1","tests/test_receiver.rs":"af64117acd66fbf42edc476f731ecd20c88009d9cb641dbd7a1d6384ae99ae73","tests/test_round_trip.rs":"b9f133540847a04e80f6f5264290633ebdd00d058a7b1a626929966786ffbe98","tests/test_shebang.rs":"06d3acabed004767d8b3a0389bde7485a6719cad6a0d0b4ac2c7439b03586651","tests/test_should_parse.rs":"1d3535698a446e2755bfc360676bdb161841a1f454cdef6e7556c6d06a95c89d","tests/test_size.rs":"78c14995718c2f8d5a7296c8f524601c30f91a5586e1402c0775977a4f814406","tests/test_stmt.rs":"42a3707056da0ce3a01f8fb13e8b7631f9be6066627ac376e1874742419ad2cc","tests/test_token_trees.rs":"d012da9c3c861073711b006bf6ffdc073821fb9fb0a08733628cdae57124d1f5","tests/test_ty.rs":"f7f21f76e9e798669f09a95c380e26ae5959ee8ac5f3b765b1a799cc9505d075","tests/test_visibility.rs":"cf4c93997cd88821ef7f8e2dd5d1586175cce4614407cd3bdf371ecc4d8abc44","tests/zzz_stable.rs":"2a862e59cb446235ed99aec0e6ada8e16d3ecc30229b29d825b7c0bbc2602989"},"package":"32d41677bcbe24c20c52e7c70b0d8db04134c5d1066bf98662e2871ad200ea3e"} \ No newline at end of file +{"files":{"Cargo.toml":"3e466f1d9d79e3b04c69510a4751c1ab8551be5e46806cad6105d3fa3a59472c","LICENSE-APACHE":"62c7a1e35f56406896d7aa7ca52d0cc0d272ac022b5d2796e7d6905db8a3636a","LICENSE-MIT":"23f18e03dc49df91622fe2a76176497404e46ced8a715d9d2b67a7446571cca3","README.md":"f6904878f9082d7d267b6d0d737ef211ff165cfd039a4d45ad88e9861f3e217f","benches/file.rs":"0a0527c78d849148cbb6118b4d36f72da7d4add865ba1a410e0a1be9e8dbfe0e","benches/rust.rs":"c006f01aacf95f61e5d6f4064be4040896a37a9632fb3dcfd9bc2a7ab171741d","src/attr.rs":"bd5ffae18a363162f7d9c12a1b6c1d023070cbf1b060c98ebc38ef79f1de9c67","src/bigint.rs":"0299829b2f7a1a798fe2f7bc1680e4a10f9b6f4a852d09af4da2deab466c4242","src/buffer.rs":"3ef1c3302acc4f9976484fd11c28981a5ff245cf4f3b8b888b7f065c8614881e","src/custom_keyword.rs":"b82199b98f67ed5c0025f5e8791b8c9a755522e54aa5ab8fbab2b01b36fdb400","src/custom_punctuation.rs":"39b38bc18553aa902a5ce842f503390c30e259b4404d5fb63d2401af7c73b527","src/data.rs":"7d217b0252a0d14b2db308ac00f48ba24a831e01a49b893f5b3ee6b580dab4cb","src/derive.rs":"3132e7f064725c7ca43f26daee93ec78037d46a935c6b0758af905cff450c15c","src/discouraged.rs":"482970b03bdee3cbc30c034f644e3293b25387db46300da5d8d8efd97dad8507","src/drops.rs":"013385f1dd95663f1afab41abc1e2eea04181998644828935ca564c74d6462ae","src/error.rs":"8dbb17978f688e12bcce58232f05c0ca9ed9de1fe511440793fb958da2fc93b9","src/export.rs":"db5b1c71686d2788935ec30fa47d86efe949cc628bea88b6bc2f29cdc833f2e8","src/expr.rs":"388348e9404a53331fe84d670bc0da889e1e9471461a8dc0a2e010a377103ecf","src/ext.rs":"3cf2d869812e5be894aa1c48bf074da262143fb2df1c9ac1b5ee965bf2a96a1c","src/file.rs":"a4d510dd0e2756bd54983dfa747601918c801e987cbf92deab44cdca6a201aeb","src/gen/clone.rs":"46540509dc99bb849014948a0c5b02ea372d5feceae5ea391c29f226f06516eb","src/gen/debug.rs":"32b2076b755f021428a0fb268a94057e1bcb1cd400feb895946703d7919b843a","src/gen/eq.rs":"aa5455b2cc0d9846d119ce001e821872df911f65133b993e3801a42e8f635f2a","src/gen/fold.rs":"305fe1db2b5b7039e79104a6e8ead11b1ee3c009f31f2a2bbebca10e494188cd","src/gen/hash.rs":"4ca8239c681ea5fd7b16bb61bff9034bff09680c088f5a16e90e99013e55742f","src/gen/visit.rs":"cbd0ebe18da62614c66a7900ef67350a5efee261bcdfff6cffc1ea6c4e754e34","src/gen/visit_mut.rs":"1b2a260ab3a6465eed6164f6d2c0cec977f9c3ca912f6bed81f8599b4d8f5cb0","src/gen_helper.rs":"750caab67ba0ba11a95ea28cd38026485227bb4aa114cdb497472386f60fdb35","src/generics.rs":"cb1a0374c523a469d48b1db7316166559034d437fb4f6cc5661511edb8aba32c","src/group.rs":"fb7f24019ab612ba85f091c4edda3b2f0154f39caa18c9a139ee600afffbeefa","src/ident.rs":"c26102f3dd66c85e05dbc9e41fb8c6ff3cf227e1ec84152b7ac920584a866578","src/item.rs":"68b2fbbf908460617dd7cf017478638ab6232a5bb2597868d67f1c809aea0232","src/lib.rs":"2e5b16ed993873c8baf33b253290df8da65b3c17c7a916493e6fde605e8d7818","src/lifetime.rs":"531ef74507eaf942a3aedfac83bbdbc17463102a6c806f675a83a0d6dc612c52","src/lit.rs":"f7d5029e33a49d400a52027540134a86565cbcb5362f15097ffdc63d3a057380","src/lookahead.rs":"376092f91a1c32e1b277db0a6790fdda151c9ec51bd971fe6a6545b5b9e73b5d","src/mac.rs":"b1cf73f34a27a8f1429125e726623a524fb5dce875eb68ead3beaffa976442c3","src/macros.rs":"4e464104c590200213635624706d83e4a0ddd5aedd826ab4aabb390000f35ae0","src/meta.rs":"9df61ebaa405ef743ba1629b39ee5e806f9ead77694a1027f192da860270c83d","src/op.rs":"fe5db7c3373b956234ea8a1a7d129a06e5aef5db77c44c1c2fedb4aaa667ac56","src/parse.rs":"e57637899f8533da26e16d41575c3489fd1bf3560cea427ba57b3c966d891d8e","src/parse_macro_input.rs":"4a753b2a6dbfefd6dc93852d66b4f6d73ebd6b8b9be74019fc476f429b9a892d","src/parse_quote.rs":"60eff4d03bf4f5977be86f49faad16d6713121f69bedd868f951bbcabf443d66","src/pat.rs":"4d99c5ed6a08e6adfd0f6c31438befd3f03e48982a36bb2544962d9db7805a4a","src/path.rs":"f53bd51c4049630c9c28ba5a07276f110d87ef9da737a143fe4c2aa2e92d1fd3","src/print.rs":"22910bf0521ab868ebd7c62601c55912d12cfb400c65723e08e5cfa3a2d111c0","src/punctuated.rs":"dffaab15b9215c70d7db416e8d4c44b78c43ba2f255485e6211363f0f0fea063","src/restriction.rs":"62efbc127d7e7316dd1070c0e976872de6238b2602bba1fb35df18511b4e7199","src/sealed.rs":"6ece3b3dcb30f6bb98b93d83759ca7712ee8592bef9c0511141039c38765db0e","src/span.rs":"4c13579eaf94803bcdb98696e4c3e26fd5cfb7ad46e5a727ed087e5935530a59","src/spanned.rs":"1bba75d73dd4dc5be6c4e11fdd72686d340fb25b5808830bd603ddc840beabdc","src/stmt.rs":"321d445f681c46ac30644504df2a8afc333a1dde0371159e9e077a17eed16548","src/thread.rs":"1f1deb1272525ab2af9a36aac4bce8f65b0e315adb1656641fd7075662f49222","src/token.rs":"8b0b4535972fb7b3640e27cb54f80d0e61f27334f2c4c2226c6bae7958299527","src/tt.rs":"32490509abcc4a5a3c7eb5628337172b3b49d30697d2f7b7df4d8045255c13da","src/ty.rs":"1d11c614298f25a8fa42165a01d6545fc699a446d7f3f8630162c7f478b26886","src/verbatim.rs":"87cbe82a90f48efb57ffd09141042698b3e011a21d0d5412154d80324b0a5ef0","src/whitespace.rs":"718a80c12cdd145358e2690f0f68ff7779a91ec17ce9fde9bb755f635fce69ad","tests/common/eq.rs":"1cebe2f5afd2c2eaa3efa3f2aef5a09573f3064d169fdf83ca014d6203eaea39","tests/common/mod.rs":"432ad35577f836a20b517d8c26ed994ac25fe73ef2f461c67688b61b99762015","tests/common/parse.rs":"246ddf1d303a9dbbc380e8d0689bd851cef3c3146d09d2627175deb9203b003d","tests/debug/gen.rs":"0b689be01a4f4a0d168617b0f867f248a9e3d211e259926e6ec6c10a59776d81","tests/debug/mod.rs":"dd87563bbd359401790a9c4185178539929ff9fa35a6998657af82a85731fe4c","tests/macros/mod.rs":"4c84bd9e82df255258671b6a57b0f2a3e4bef2127a2e8b842a4b6f3037b7fc5c","tests/regression.rs":"e9565ea0efecb4136f099164ffcfa26e1996b0a27fb9c6659e90ad9bdd42e7b6","tests/regression/issue1108.rs":"f32db35244a674e22ff824ca9e5bbec2184e287b59f022db68c418b5878a2edc","tests/regression/issue1235.rs":"a2266b10c3f7c7af5734817ab0a3e8b309b51e7d177b63f26e67e6b744d280b0","tests/repo/mod.rs":"a857b13b258846a5f2b25c66e8db149c703ab7f623505dc18206eec4244ffba2","tests/repo/progress.rs":"c08d0314a7f3ecf760d471f27da3cd2a500aeb9f1c8331bffb2aa648f9fabf3f","tests/test_asyncness.rs":"3868181f25f7470476077f80a442a7804b6b9b371ad5917f4fd18b1002714c64","tests/test_attribute.rs":"b35550a43bbd187bb330997ba36f90c65d8fc489135b1d32ef4547f145cb7612","tests/test_derive_input.rs":"c215245c4d09052661ac5b65b34e950ea47622847bdffe648d380470f12db8f2","tests/test_expr.rs":"2de81f6171bcde3db8d36ce90b9c77ce672f93dcb1e03b6a44290b039246132b","tests/test_generics.rs":"b77741aa38e6ac7e1a9082faf168e7b7b92fbabf9f3fd07306676339a67394df","tests/test_grouping.rs":"ecbe3324878b2e2be42640a3dec198620cff18731fcb95ee7e94eacd11d2fec1","tests/test_ident.rs":"9eb53d1e21edf23e7c9e14dc74dcc2b2538e9221e19dbcc0a44e3acc2e90f3f6","tests/test_item.rs":"7f0255b61d0a6921313c09aaba470beefc55f1d4e66d1e24cfac7a3f63b035d8","tests/test_iterators.rs":"f4dacb5f3a8e0473dfb0d27f05270d41e79eddb4759b1fad3e88e379b4731e17","tests/test_lit.rs":"7297fed48ca248689f112f67b6f024f2f2784e29c6cd33185ac659c350834b01","tests/test_meta.rs":"3e1bb60b4bd56adb1e04b0e2d867404f0d81f7bf69caf7d8a70fc7090e079e84","tests/test_parse_buffer.rs":"3ed83ea2e50f84b80c0b543aac4bfbd379610d0911c0baa1eb94bb925bda7341","tests/test_parse_stream.rs":"a7e186272c89a239cae03053b5a039cdc073cdb46fad64b178fe76fde98405d5","tests/test_pat.rs":"fe94e084ee478d41cccea4eeb3e975386a70d36ff7cbb902ba0c767d536aab6e","tests/test_path.rs":"0033e1082b576bb3217ebd4546423d6f86fde7ee7ba3aba8c57bf137d2b42f47","tests/test_precedence.rs":"1395b213a1aa953a3b2eacc922853f8d0e3afba552325440bfbe4df6b62102a1","tests/test_receiver.rs":"af64117acd66fbf42edc476f731ecd20c88009d9cb641dbd7a1d6384ae99ae73","tests/test_round_trip.rs":"61183de56bf70c628659b9529f794b9f138904959f919f08f3b8176ba62c76ef","tests/test_shebang.rs":"06d3acabed004767d8b3a0389bde7485a6719cad6a0d0b4ac2c7439b03586651","tests/test_should_parse.rs":"1d3535698a446e2755bfc360676bdb161841a1f454cdef6e7556c6d06a95c89d","tests/test_size.rs":"78c14995718c2f8d5a7296c8f524601c30f91a5586e1402c0775977a4f814406","tests/test_stmt.rs":"42a3707056da0ce3a01f8fb13e8b7631f9be6066627ac376e1874742419ad2cc","tests/test_token_trees.rs":"d012da9c3c861073711b006bf6ffdc073821fb9fb0a08733628cdae57124d1f5","tests/test_ty.rs":"f7f21f76e9e798669f09a95c380e26ae5959ee8ac5f3b765b1a799cc9505d075","tests/test_visibility.rs":"cf4c93997cd88821ef7f8e2dd5d1586175cce4614407cd3bdf371ecc4d8abc44","tests/zzz_stable.rs":"2a862e59cb446235ed99aec0e6ada8e16d3ecc30229b29d825b7c0bbc2602989"},"package":"04361975b3f5e348b2189d8dc55bc942f278b2d482a6a0365de5bdd62d351567"} \ No newline at end of file diff --git a/vendor/syn/Cargo.toml b/vendor/syn/Cargo.toml index 52dbea46b..0018a539f 100644 --- a/vendor/syn/Cargo.toml +++ b/vendor/syn/Cargo.toml @@ -13,7 +13,7 @@ edition = "2021" rust-version = "1.56" name = "syn" -version = "2.0.18" +version = "2.0.28" authors = ["David Tolnay "] include = [ "/benches/**", @@ -43,6 +43,7 @@ all-features = true rustdoc-args = [ "--cfg", "doc_cfg", + "--generate-link-to-definition", ] targets = ["x86_64-unknown-linux-gnu"] @@ -74,7 +75,7 @@ required-features = [ ] [dependencies.proc-macro2] -version = "1.0.59" +version = "1.0.62" default-features = false [dependencies.quote] diff --git a/vendor/syn/README.md b/vendor/syn/README.md index 24aea1700..e8d99abcf 100644 --- a/vendor/syn/README.md +++ b/vendor/syn/README.md @@ -39,12 +39,12 @@ contains some APIs that may be useful more generally. procedural macros enable only what they need, and do not pay in compile time for all the rest. -[`syn::File`]: https://docs.rs/syn/1.0/syn/struct.File.html -[`syn::Item`]: https://docs.rs/syn/1.0/syn/enum.Item.html -[`syn::Expr`]: https://docs.rs/syn/1.0/syn/enum.Expr.html -[`syn::Type`]: https://docs.rs/syn/1.0/syn/enum.Type.html -[`syn::DeriveInput`]: https://docs.rs/syn/1.0/syn/struct.DeriveInput.html -[parser functions]: https://docs.rs/syn/1.0/syn/parse/index.html +[`syn::File`]: https://docs.rs/syn/2.0/syn/struct.File.html +[`syn::Item`]: https://docs.rs/syn/2.0/syn/enum.Item.html +[`syn::Expr`]: https://docs.rs/syn/2.0/syn/enum.Expr.html +[`syn::Type`]: https://docs.rs/syn/2.0/syn/enum.Type.html +[`syn::DeriveInput`]: https://docs.rs/syn/2.0/syn/struct.DeriveInput.html +[parser functions]: https://docs.rs/syn/2.0/syn/parse/index.html *Version requirement: Syn supports rustc 1.56 and up.* diff --git a/vendor/syn/benches/rust.rs b/vendor/syn/benches/rust.rs index ce6cfde29..643976188 100644 --- a/vendor/syn/benches/rust.rs +++ b/vendor/syn/benches/rust.rs @@ -80,7 +80,7 @@ mod librustc_parse { rustc_span::create_session_if_not_set_then(Edition::Edition2018, |_| { let cm = Lrc::new(SourceMap::new(FilePathMapping::empty())); let emitter = Box::new(SilentEmitter); - let handler = Handler::with_emitter(false, None, emitter); + let handler = Handler::with_emitter(emitter); let sess = ParseSess::with_span_handler(handler, cm); if let Err(diagnostic) = rustc_parse::parse_crate_from_source_str( FileName::Custom("bench".to_owned()), diff --git a/vendor/syn/src/error.rs b/vendor/syn/src/error.rs index 93f20f42f..3fe31d5ce 100644 --- a/vendor/syn/src/error.rs +++ b/vendor/syn/src/error.rs @@ -385,7 +385,7 @@ impl Clone for Error { impl Clone for ErrorMessage { fn clone(&self) -> Self { ErrorMessage { - span: self.span.clone(), + span: self.span, message: self.message.clone(), } } diff --git a/vendor/syn/src/expr.rs b/vendor/syn/src/expr.rs index 0f1a6953e..ae723242e 100644 --- a/vendor/syn/src/expr.rs +++ b/vendor/syn/src/expr.rs @@ -1377,7 +1377,7 @@ pub(crate) mod parsing { } let expr = Box::new(unary_expr(input, allow_struct)?); if raw.is_some() { - Ok(Expr::Verbatim(verbatim::between(begin, input))) + Ok(Expr::Verbatim(verbatim::between(&begin, input))) } else { Ok(Expr::Reference(ExprReference { attrs, @@ -1423,7 +1423,7 @@ pub(crate) mod parsing { let mut e = trailer_helper(input, atom)?; if let Expr::Verbatim(tokens) = &mut e { - *tokens = verbatim::between(begin, input); + *tokens = verbatim::between(&begin, input); } else { let inner_attrs = e.replace_attrs(Vec::new()); attrs.extend(inner_attrs); @@ -1663,7 +1663,7 @@ pub(crate) mod parsing { } Ok(expr) } else { - Err(input.error("expected expression")) + Err(input.error("expected an expression")) } } @@ -1691,6 +1691,16 @@ pub(crate) mod parsing { } else if input.is_empty() { Err(input.error("expected an expression")) } else { + if input.peek(token::Brace) { + let scan = input.fork(); + let content; + braced!(content in scan); + if content.parse::().is_ok() && content.is_empty() { + let expr_block = verbatim::between(input, &scan); + input.advance_to(&scan); + return Ok(Expr::Verbatim(expr_block)); + } + } Err(input.error("unsupported expression; enable syn's features=[\"full\"]")) } } @@ -1707,7 +1717,7 @@ pub(crate) mod parsing { parenthesized!(args in input); args.parse::()?; - Ok(Expr::Verbatim(verbatim::between(begin, input))) + Ok(Expr::Verbatim(verbatim::between(&begin, input))) } fn path_or_macro_or_struct( diff --git a/vendor/syn/src/gen/fold.rs b/vendor/syn/src/gen/fold.rs index 624c15b17..8ea6c75fc 100644 --- a/vendor/syn/src/gen/fold.rs +++ b/vendor/syn/src/gen/fold.rs @@ -2,7 +2,11 @@ // It is not intended for manual editing. #![allow(unreachable_code, unused_variables)] -#![allow(clippy::match_wildcard_for_single_variants, clippy::needless_match)] +#![allow( + clippy::match_wildcard_for_single_variants, + clippy::needless_match, + clippy::needless_pass_by_ref_mut, +)] #[cfg(any(feature = "full", feature = "derive"))] use crate::gen::helper::fold::*; use crate::*; diff --git a/vendor/syn/src/gen/visit.rs b/vendor/syn/src/gen/visit.rs index 9eaa24f05..fe81fb63c 100644 --- a/vendor/syn/src/gen/visit.rs +++ b/vendor/syn/src/gen/visit.rs @@ -2,6 +2,7 @@ // It is not intended for manual editing. #![allow(unused_variables)] +#![allow(clippy::needless_pass_by_ref_mut)] #[cfg(any(feature = "full", feature = "derive"))] use crate::punctuated::Punctuated; use crate::*; diff --git a/vendor/syn/src/gen/visit_mut.rs b/vendor/syn/src/gen/visit_mut.rs index 83bd1ccf8..9e7d16ff6 100644 --- a/vendor/syn/src/gen/visit_mut.rs +++ b/vendor/syn/src/gen/visit_mut.rs @@ -2,6 +2,7 @@ // It is not intended for manual editing. #![allow(unused_variables)] +#![allow(clippy::needless_pass_by_ref_mut)] #[cfg(any(feature = "full", feature = "derive"))] use crate::punctuated::Punctuated; use crate::*; diff --git a/vendor/syn/src/generics.rs b/vendor/syn/src/generics.rs index 44a10da7d..2ad913d1d 100644 --- a/vendor/syn/src/generics.rs +++ b/vendor/syn/src/generics.rs @@ -771,7 +771,7 @@ pub(crate) mod parsing { bound.paren_token = paren_token; if is_tilde_const { - Ok(TypeParamBound::Verbatim(verbatim::between(begin, input))) + Ok(TypeParamBound::Verbatim(verbatim::between(&begin, input))) } else { Ok(TypeParamBound::Trait(bound)) } diff --git a/vendor/syn/src/ident.rs b/vendor/syn/src/ident.rs index bd6f3f9f2..41eb72129 100644 --- a/vendor/syn/src/ident.rs +++ b/vendor/syn/src/ident.rs @@ -3,7 +3,6 @@ use crate::lookahead; pub use proc_macro2::Ident; -#[cfg(not(doc))] // rustdoc bug: https://github.com/rust-lang/rust/issues/105735 #[cfg(feature = "parsing")] #[doc(hidden)] #[allow(non_snake_case)] diff --git a/vendor/syn/src/item.rs b/vendor/syn/src/item.rs index 46ccd73ff..50d7e6ef6 100644 --- a/vendor/syn/src/item.rs +++ b/vendor/syn/src/item.rs @@ -898,96 +898,76 @@ pub(crate) mod parsing { impl Parse for Item { fn parse(input: ParseStream) -> Result { let begin = input.fork(); - let mut attrs = input.call(Attribute::parse_outer)?; - let ahead = input.fork(); - let vis: Visibility = ahead.parse()?; + let attrs = input.call(Attribute::parse_outer)?; + parse_rest_of_item(begin, attrs, input) + } + } + pub(crate) fn parse_rest_of_item( + begin: ParseBuffer, + mut attrs: Vec, + input: ParseStream, + ) -> Result { + let ahead = input.fork(); + let vis: Visibility = ahead.parse()?; + + let lookahead = ahead.lookahead1(); + let mut item = if lookahead.peek(Token![fn]) || peek_signature(&ahead) { + let vis: Visibility = input.parse()?; + let sig: Signature = input.parse()?; + if input.peek(Token![;]) { + input.parse::()?; + Ok(Item::Verbatim(verbatim::between(&begin, input))) + } else { + parse_rest_of_fn(input, Vec::new(), vis, sig).map(Item::Fn) + } + } else if lookahead.peek(Token![extern]) { + ahead.parse::()?; let lookahead = ahead.lookahead1(); - let mut item = if lookahead.peek(Token![fn]) || peek_signature(&ahead) { - let vis: Visibility = input.parse()?; - let sig: Signature = input.parse()?; - if input.peek(Token![;]) { - input.parse::()?; - Ok(Item::Verbatim(verbatim::between(begin, input))) - } else { - parse_rest_of_fn(input, Vec::new(), vis, sig).map(Item::Fn) - } - } else if lookahead.peek(Token![extern]) { - ahead.parse::()?; + if lookahead.peek(Token![crate]) { + input.parse().map(Item::ExternCrate) + } else if lookahead.peek(token::Brace) { + input.parse().map(Item::ForeignMod) + } else if lookahead.peek(LitStr) { + ahead.parse::()?; let lookahead = ahead.lookahead1(); - if lookahead.peek(Token![crate]) { - input.parse().map(Item::ExternCrate) - } else if lookahead.peek(token::Brace) { + if lookahead.peek(token::Brace) { input.parse().map(Item::ForeignMod) - } else if lookahead.peek(LitStr) { - ahead.parse::()?; - let lookahead = ahead.lookahead1(); - if lookahead.peek(token::Brace) { - input.parse().map(Item::ForeignMod) - } else { - Err(lookahead.error()) - } } else { Err(lookahead.error()) } - } else if lookahead.peek(Token![use]) { - let allow_crate_root_in_path = true; - match parse_item_use(input, allow_crate_root_in_path)? { - Some(item_use) => Ok(Item::Use(item_use)), - None => Ok(Item::Verbatim(verbatim::between(begin, input))), - } - } else if lookahead.peek(Token![static]) { - let vis = input.parse()?; - let static_token = input.parse()?; - let mutability = input.parse()?; - let ident = input.parse()?; - if input.peek(Token![=]) { - input.parse::()?; - input.parse::()?; - input.parse::()?; - Ok(Item::Verbatim(verbatim::between(begin, input))) - } else { - let colon_token = input.parse()?; - let ty = input.parse()?; - if input.peek(Token![;]) { - input.parse::()?; - Ok(Item::Verbatim(verbatim::between(begin, input))) - } else { - Ok(Item::Static(ItemStatic { - attrs: Vec::new(), - vis, - static_token, - mutability, - ident, - colon_token, - ty, - eq_token: input.parse()?, - expr: input.parse()?, - semi_token: input.parse()?, - })) - } - } - } else if lookahead.peek(Token![const]) { - let vis = input.parse()?; - let const_token: Token![const] = input.parse()?; - let lookahead = input.lookahead1(); - let ident = if lookahead.peek(Ident) || lookahead.peek(Token![_]) { - input.call(Ident::parse_any)? - } else { - return Err(lookahead.error()); - }; + } else { + Err(lookahead.error()) + } + } else if lookahead.peek(Token![use]) { + let allow_crate_root_in_path = true; + match parse_item_use(input, allow_crate_root_in_path)? { + Some(item_use) => Ok(Item::Use(item_use)), + None => Ok(Item::Verbatim(verbatim::between(&begin, input))), + } + } else if lookahead.peek(Token![static]) { + let vis = input.parse()?; + let static_token = input.parse()?; + let mutability = input.parse()?; + let ident = input.parse()?; + if input.peek(Token![=]) { + input.parse::()?; + input.parse::()?; + input.parse::()?; + Ok(Item::Verbatim(verbatim::between(&begin, input))) + } else { let colon_token = input.parse()?; let ty = input.parse()?; if input.peek(Token![;]) { input.parse::()?; - Ok(Item::Verbatim(verbatim::between(begin, input))) + Ok(Item::Verbatim(verbatim::between(&begin, input))) } else { - Ok(Item::Const(ItemConst { + Ok(Item::Static(ItemStatic { attrs: Vec::new(), vis, - const_token, + static_token, + mutability, ident, - generics: Generics::default(), colon_token, ty, eq_token: input.parse()?, @@ -995,69 +975,97 @@ pub(crate) mod parsing { semi_token: input.parse()?, })) } - } else if lookahead.peek(Token![unsafe]) { - ahead.parse::()?; - let lookahead = ahead.lookahead1(); - if lookahead.peek(Token![trait]) - || lookahead.peek(Token![auto]) && ahead.peek2(Token![trait]) - { - input.parse().map(Item::Trait) - } else if lookahead.peek(Token![impl]) { - let allow_verbatim_impl = true; - if let Some(item) = parse_impl(input, allow_verbatim_impl)? { - Ok(Item::Impl(item)) - } else { - Ok(Item::Verbatim(verbatim::between(begin, input))) - } - } else if lookahead.peek(Token![extern]) { - input.parse().map(Item::ForeignMod) - } else if lookahead.peek(Token![mod]) { - input.parse().map(Item::Mod) - } else { - Err(lookahead.error()) - } - } else if lookahead.peek(Token![mod]) { - input.parse().map(Item::Mod) - } else if lookahead.peek(Token![type]) { - parse_item_type(begin, input) - } else if lookahead.peek(Token![struct]) { - input.parse().map(Item::Struct) - } else if lookahead.peek(Token![enum]) { - input.parse().map(Item::Enum) - } else if lookahead.peek(Token![union]) && ahead.peek2(Ident) { - input.parse().map(Item::Union) - } else if lookahead.peek(Token![trait]) { - input.call(parse_trait_or_trait_alias) - } else if lookahead.peek(Token![auto]) && ahead.peek2(Token![trait]) { - input.parse().map(Item::Trait) - } else if lookahead.peek(Token![impl]) - || lookahead.peek(Token![default]) && !ahead.peek2(Token![!]) + } + } else if lookahead.peek(Token![const]) { + let vis = input.parse()?; + let const_token: Token![const] = input.parse()?; + let lookahead = input.lookahead1(); + let ident = if lookahead.peek(Ident) || lookahead.peek(Token![_]) { + input.call(Ident::parse_any)? + } else { + return Err(lookahead.error()); + }; + let colon_token = input.parse()?; + let ty = input.parse()?; + if input.peek(Token![;]) { + input.parse::()?; + Ok(Item::Verbatim(verbatim::between(&begin, input))) + } else { + Ok(Item::Const(ItemConst { + attrs: Vec::new(), + vis, + const_token, + ident, + generics: Generics::default(), + colon_token, + ty, + eq_token: input.parse()?, + expr: input.parse()?, + semi_token: input.parse()?, + })) + } + } else if lookahead.peek(Token![unsafe]) { + ahead.parse::()?; + let lookahead = ahead.lookahead1(); + if lookahead.peek(Token![trait]) + || lookahead.peek(Token![auto]) && ahead.peek2(Token![trait]) { + input.parse().map(Item::Trait) + } else if lookahead.peek(Token![impl]) { let allow_verbatim_impl = true; if let Some(item) = parse_impl(input, allow_verbatim_impl)? { Ok(Item::Impl(item)) } else { - Ok(Item::Verbatim(verbatim::between(begin, input))) + Ok(Item::Verbatim(verbatim::between(&begin, input))) } - } else if lookahead.peek(Token![macro]) { - input.advance_to(&ahead); - parse_macro2(begin, vis, input) - } else if vis.is_inherited() - && (lookahead.peek(Ident) - || lookahead.peek(Token![self]) - || lookahead.peek(Token![super]) - || lookahead.peek(Token![crate]) - || lookahead.peek(Token![::])) - { - input.parse().map(Item::Macro) + } else if lookahead.peek(Token![extern]) { + input.parse().map(Item::ForeignMod) + } else if lookahead.peek(Token![mod]) { + input.parse().map(Item::Mod) } else { Err(lookahead.error()) - }?; + } + } else if lookahead.peek(Token![mod]) { + input.parse().map(Item::Mod) + } else if lookahead.peek(Token![type]) { + parse_item_type(begin, input) + } else if lookahead.peek(Token![struct]) { + input.parse().map(Item::Struct) + } else if lookahead.peek(Token![enum]) { + input.parse().map(Item::Enum) + } else if lookahead.peek(Token![union]) && ahead.peek2(Ident) { + input.parse().map(Item::Union) + } else if lookahead.peek(Token![trait]) { + input.call(parse_trait_or_trait_alias) + } else if lookahead.peek(Token![auto]) && ahead.peek2(Token![trait]) { + input.parse().map(Item::Trait) + } else if lookahead.peek(Token![impl]) + || lookahead.peek(Token![default]) && !ahead.peek2(Token![!]) + { + let allow_verbatim_impl = true; + if let Some(item) = parse_impl(input, allow_verbatim_impl)? { + Ok(Item::Impl(item)) + } else { + Ok(Item::Verbatim(verbatim::between(&begin, input))) + } + } else if lookahead.peek(Token![macro]) { + input.advance_to(&ahead); + parse_macro2(begin, vis, input) + } else if vis.is_inherited() + && (lookahead.peek(Ident) + || lookahead.peek(Token![self]) + || lookahead.peek(Token![super]) + || lookahead.peek(Token![crate]) + || lookahead.peek(Token![::])) + { + input.parse().map(Item::Macro) + } else { + Err(lookahead.error()) + }?; - attrs.extend(item.replace_attrs(Vec::new())); - item.replace_attrs(attrs); - Ok(item) - } + attrs.extend(item.replace_attrs(Vec::new())); + item.replace_attrs(attrs); + Ok(item) } struct FlexibleItemType { @@ -1219,7 +1227,7 @@ pub(crate) mod parsing { return Err(lookahead.error()); } - Ok(Item::Verbatim(verbatim::between(begin, input))) + Ok(Item::Verbatim(verbatim::between(&begin, input))) } #[cfg_attr(doc_cfg, doc(cfg(feature = "parsing")))] @@ -1340,22 +1348,28 @@ pub(crate) mod parsing { let content; let brace_token = braced!(content in input); let mut items = Punctuated::new(); - let mut has_crate_root_in_path = false; + let mut has_any_crate_root_in_path = false; loop { if content.is_empty() { break; } - has_crate_root_in_path |= + let this_tree_starts_with_crate_root = allow_crate_root_in_path && content.parse::>()?.is_some(); - let tree: UseTree = content.parse()?; - items.push_value(tree); + has_any_crate_root_in_path |= this_tree_starts_with_crate_root; + match parse_use_tree( + &content, + allow_crate_root_in_path && !this_tree_starts_with_crate_root, + )? { + Some(tree) => items.push_value(tree), + None => has_any_crate_root_in_path = true, + } if content.is_empty() { break; } let comma: Token![,] = content.parse()?; items.push_punct(comma); } - if has_crate_root_in_path { + if has_any_crate_root_in_path { Ok(None) } else { Ok(Some(UseTree::Group(UseGroup { brace_token, items }))) @@ -1753,7 +1767,7 @@ pub(crate) mod parsing { content.call(Attribute::parse_inner)?; content.call(Block::parse_within)?; - Ok(ForeignItem::Verbatim(verbatim::between(begin, input))) + Ok(ForeignItem::Verbatim(verbatim::between(&begin, input))) } else { Ok(ForeignItem::Fn(ForeignItemFn { attrs: Vec::new(), @@ -1773,7 +1787,7 @@ pub(crate) mod parsing { input.parse::()?; input.parse::()?; input.parse::()?; - Ok(ForeignItem::Verbatim(verbatim::between(begin, input))) + Ok(ForeignItem::Verbatim(verbatim::between(&begin, input))) } else { Ok(ForeignItem::Static(ForeignItemStatic { attrs: Vec::new(), @@ -1882,7 +1896,7 @@ pub(crate) mod parsing { )?; if colon_token.is_some() || ty.is_some() { - Ok(ForeignItem::Verbatim(verbatim::between(begin, input))) + Ok(ForeignItem::Verbatim(verbatim::between(&begin, input))) } else { Ok(ForeignItem::Type(ForeignItemType { attrs: Vec::new(), @@ -1952,7 +1966,7 @@ pub(crate) mod parsing { let (eq_token, ty) = match ty { Some(ty) if colon_token.is_none() => ty, - _ => return Ok(Item::Verbatim(verbatim::between(begin, input))), + _ => return Ok(Item::Verbatim(verbatim::between(&begin, input))), }; Ok(Item::Type(ItemType { @@ -2240,7 +2254,7 @@ pub(crate) mod parsing { match (vis, defaultness) { (Visibility::Inherited, None) => {} - _ => return Ok(TraitItem::Verbatim(verbatim::between(begin, input))), + _ => return Ok(TraitItem::Verbatim(verbatim::between(&begin, input))), } let item_attrs = match &mut item { @@ -2358,7 +2372,7 @@ pub(crate) mod parsing { )?; if vis.is_some() { - Ok(TraitItem::Verbatim(verbatim::between(begin, input))) + Ok(TraitItem::Verbatim(verbatim::between(&begin, input))) } else { Ok(TraitItem::Type(TraitItemType { attrs: Vec::new(), @@ -2471,7 +2485,7 @@ pub(crate) mod parsing { self_ty = if polarity.is_none() { first_ty } else { - Type::Verbatim(verbatim::between(begin, input)) + Type::Verbatim(verbatim::between(&begin, input)) }; } @@ -2525,7 +2539,7 @@ pub(crate) mod parsing { if let Some(item) = parse_impl_item_fn(input, allow_omitted_body)? { Ok(ImplItem::Fn(item)) } else { - Ok(ImplItem::Verbatim(verbatim::between(begin, input))) + Ok(ImplItem::Verbatim(verbatim::between(&begin, input))) } } else if lookahead.peek(Token![const]) { input.advance_to(&ahead); @@ -2554,7 +2568,7 @@ pub(crate) mod parsing { })); } else { input.parse::()?; - return Ok(ImplItem::Verbatim(verbatim::between(begin, input))); + return Ok(ImplItem::Verbatim(verbatim::between(&begin, input))); } } else if lookahead.peek(Token![type]) { parse_impl_item_type(begin, input) @@ -2700,7 +2714,7 @@ pub(crate) mod parsing { let (eq_token, ty) = match ty { Some(ty) if colon_token.is_none() => ty, - _ => return Ok(ImplItem::Verbatim(verbatim::between(begin, input))), + _ => return Ok(ImplItem::Verbatim(verbatim::between(&begin, input))), }; Ok(ImplItem::Type(ImplItemType { diff --git a/vendor/syn/src/lib.rs b/vendor/syn/src/lib.rs index aeeb37ef9..b9fd8073f 100644 --- a/vendor/syn/src/lib.rs +++ b/vendor/syn/src/lib.rs @@ -249,7 +249,7 @@ //! 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/2.0.18")] +#![doc(html_root_url = "https://docs.rs/syn/2.0.28")] #![cfg_attr(doc_cfg, feature(doc_cfg))] #![allow(non_camel_case_types)] #![allow( @@ -373,6 +373,7 @@ pub use crate::generics::{ pub use crate::generics::{ImplGenerics, Turbofish, TypeGenerics}; mod ident; +#[doc(inline)] pub use crate::ident::Ident; #[cfg(feature = "full")] @@ -388,9 +389,11 @@ pub use crate::item::{ }; mod lifetime; +#[doc(inline)] pub use crate::lifetime::Lifetime; mod lit; +#[doc(inline)] pub use crate::lit::{ Lit, LitBool, LitByte, LitByteStr, LitChar, LitFloat, LitInt, LitStr, StrStyle, }; diff --git a/vendor/syn/src/lit.rs b/vendor/syn/src/lit.rs index 662ef8b22..4f36cf50b 100644 --- a/vendor/syn/src/lit.rs +++ b/vendor/syn/src/lit.rs @@ -228,7 +228,17 @@ impl LitStr { let mut tokens = TokenStream::from_str(&self.value())?; tokens = respan_token_stream(tokens, self.span()); - parser.parse2(tokens) + let result = parser.parse2(tokens)?; + + let suffix = self.suffix(); + if !suffix.is_empty() { + return Err(Error::new( + self.span(), + format!("unexpected suffix `{}` on string literal", suffix), + )); + } + + Ok(result) } pub fn span(&self) -> Span { @@ -1166,7 +1176,7 @@ mod value { b'x' => { let (byte, rest) = backslash_x(s); s = rest; - assert!(byte <= 0x80, "Invalid \\x byte in string literal"); + assert!(byte <= 0x7F, "Invalid \\x byte in string literal"); char::from_u32(u32::from(byte)).unwrap() } b'u' => { @@ -1273,8 +1283,7 @@ mod value { b'"' => b'"', b'\r' | b'\n' => loop { let byte = byte(v, 0); - let ch = char::from_u32(u32::from(byte)).unwrap(); - if ch.is_whitespace() { + if matches!(byte, b' ' | b'\t' | b'\n' | b'\r') { v = &v[1..]; } else { continue 'outer; diff --git a/vendor/syn/src/pat.rs b/vendor/syn/src/pat.rs index 2e6376b2f..df7da5bbe 100644 --- a/vendor/syn/src/pat.rs +++ b/vendor/syn/src/pat.rs @@ -422,7 +422,7 @@ pub(crate) mod parsing { fn pat_box(begin: ParseBuffer, input: ParseStream) -> Result { input.parse::()?; Pat::parse_single(input)?; - Ok(Pat::Verbatim(verbatim::between(begin, input))) + Ok(Pat::Verbatim(verbatim::between(&begin, input))) } fn pat_ident(input: ParseStream) -> Result { @@ -544,7 +544,7 @@ pub(crate) mod parsing { }; let pat = if boxed.is_some() { - Pat::Verbatim(verbatim::between(begin, input)) + Pat::Verbatim(verbatim::between(&begin, input)) } else { Pat::Ident(PatIdent { attrs: Vec::new(), @@ -762,7 +762,7 @@ pub(crate) mod parsing { content.call(Attribute::parse_inner)?; content.call(Block::parse_within)?; - Ok(verbatim::between(begin, input)) + Ok(verbatim::between(&begin, input)) } } diff --git a/vendor/syn/src/path.rs b/vendor/syn/src/path.rs index e99a3f87d..883f179f5 100644 --- a/vendor/syn/src/path.rs +++ b/vendor/syn/src/path.rs @@ -53,8 +53,9 @@ impl Path { /// } /// } /// ``` - pub fn is_ident(&self, ident: &I) -> bool + pub fn is_ident(&self, ident: &I) -> bool where + I: ?Sized, Ident: PartialEq, { match self.get_ident() { @@ -368,7 +369,6 @@ pub(crate) mod parsing { return Ok(Expr::Lit(lit)); } - #[cfg(feature = "full")] if input.peek(Ident) { let ident: Ident = input.parse()?; return Ok(Expr::Path(ExprPath { @@ -391,7 +391,7 @@ pub(crate) mod parsing { let content; braced!(content in input); content.parse::()?; - let verbatim = verbatim::between(begin, input); + let verbatim = verbatim::between(&begin, input); return Ok(Expr::Verbatim(verbatim)); } } @@ -649,6 +649,10 @@ pub(crate) mod parsing { pub(crate) mod printing { use super::*; use crate::print::TokensOrDefault; + #[cfg(feature = "parsing")] + use crate::spanned::Spanned; + #[cfg(feature = "parsing")] + use proc_macro2::Span; use proc_macro2::TokenStream; use quote::ToTokens; use std::cmp; @@ -692,10 +696,21 @@ pub(crate) mod printing { GenericArgument::Lifetime(lt) => lt.to_tokens(tokens), GenericArgument::Type(ty) => ty.to_tokens(tokens), GenericArgument::Const(expr) => match expr { - Expr::Lit(_) => expr.to_tokens(tokens), + Expr::Lit(expr) => expr.to_tokens(tokens), + + Expr::Path(expr) + if expr.attrs.is_empty() + && expr.qself.is_none() + && expr.path.get_ident().is_some() => + { + expr.to_tokens(tokens); + } #[cfg(feature = "full")] - Expr::Block(_) => expr.to_tokens(tokens), + Expr::Block(expr) => expr.to_tokens(tokens), + + #[cfg(not(feature = "full"))] + Expr::Verbatim(expr) => expr.to_tokens(tokens), // ERROR CORRECTION: Add braces to make sure that the // generated code is valid. @@ -826,4 +841,21 @@ pub(crate) mod printing { segment.to_tokens(tokens); } } + + #[cfg(feature = "parsing")] + #[cfg_attr(doc_cfg, doc(cfg(all(feature = "parsing", feature = "printing"))))] + impl Spanned for QSelf { + fn span(&self) -> Span { + struct QSelfDelimiters<'a>(&'a QSelf); + + impl<'a> ToTokens for QSelfDelimiters<'a> { + fn to_tokens(&self, tokens: &mut TokenStream) { + self.0.lt_token.to_tokens(tokens); + self.0.gt_token.to_tokens(tokens); + } + } + + QSelfDelimiters(self).span() + } + } } diff --git a/vendor/syn/src/punctuated.rs b/vendor/syn/src/punctuated.rs index a4278081c..3ea8a1d4e 100644 --- a/vendor/syn/src/punctuated.rs +++ b/vendor/syn/src/punctuated.rs @@ -369,6 +369,11 @@ where last: self.last.clone(), } } + + fn clone_from(&mut self, other: &Self) { + self.inner.clone_from(&other.inner); + self.last.clone_from(&other.last); + } } #[cfg(feature = "extra-traits")] diff --git a/vendor/syn/src/spanned.rs b/vendor/syn/src/spanned.rs index 7e101d264..98aa0aa1e 100644 --- a/vendor/syn/src/spanned.rs +++ b/vendor/syn/src/spanned.rs @@ -112,4 +112,7 @@ mod private { pub trait Sealed {} impl Sealed for T {} + + #[cfg(any(feature = "full", feature = "derive"))] + impl Sealed for crate::QSelf {} } diff --git a/vendor/syn/src/stmt.rs b/vendor/syn/src/stmt.rs index b5434f7ce..fb67feccb 100644 --- a/vendor/syn/src/stmt.rs +++ b/vendor/syn/src/stmt.rs @@ -180,7 +180,8 @@ pub(crate) mod parsing { } fn parse_stmt(input: ParseStream, allow_nosemi: AllowNoSemi) -> Result { - let mut attrs = input.call(Attribute::parse_outer)?; + let begin = input.fork(); + let attrs = input.call(Attribute::parse_outer)?; // brace-style macros; paren and bracket macros get parsed as // expression statements. @@ -238,9 +239,7 @@ pub(crate) mod parsing { || input.peek(Token![macro]) || is_item_macro { - let mut item: Item = input.parse()?; - attrs.extend(item.replace_attrs(Vec::new())); - item.replace_attrs(attrs); + let item = item::parsing::parse_rest_of_item(begin, attrs, input)?; Ok(Stmt::Item(item)) } else { stmt_expr(input, allow_nosemi, attrs) diff --git a/vendor/syn/src/thread.rs b/vendor/syn/src/thread.rs index 63fdea834..b33d248af 100644 --- a/vendor/syn/src/thread.rs +++ b/vendor/syn/src/thread.rs @@ -12,6 +12,9 @@ pub(crate) struct ThreadBound { unsafe impl Sync for ThreadBound {} // Send bound requires Copy, as otherwise Drop could run in the wrong place. +// +// Today Copy and Drop are mutually exclusive so `T: Copy` implies `T: !Drop`. +// This impl needs to be revisited if that restriction is relaxed in the future. unsafe impl Send for ThreadBound {} impl ThreadBound { @@ -40,11 +43,18 @@ impl Debug for ThreadBound { } } -impl Clone for ThreadBound { +// Copy the bytes of T, even if the currently running thread is the "wrong" +// thread. This is fine as long as the original thread is not simultaneously +// mutating this value via interior mutability, which would be a data race. +// +// Currently `T: Copy` is sufficient to guarantee that T contains no interior +// mutability, because _all_ interior mutability in Rust is built on +// std::cell::UnsafeCell, which has no Copy impl. This impl needs to be +// revisited if that restriction is relaxed in the future. +impl Copy for ThreadBound {} + +impl Clone for ThreadBound { fn clone(&self) -> Self { - ThreadBound { - value: self.value.clone(), - thread_id: self.thread_id, - } + *self } } diff --git a/vendor/syn/src/ty.rs b/vendor/syn/src/ty.rs index 9282ba4e6..0f41fe4fa 100644 --- a/vendor/syn/src/ty.rs +++ b/vendor/syn/src/ty.rs @@ -525,7 +525,7 @@ pub(crate) mod parsing { let star_token: Option = input.parse()?; let bounds = TypeTraitObject::parse_bounds(dyn_span, input, allow_plus)?; return Ok(if star_token.is_some() { - Type::Verbatim(verbatim::between(begin, input)) + Type::Verbatim(verbatim::between(&begin, input)) } else { Type::TraitObject(TypeTraitObject { dyn_token: Some(dyn_token), @@ -947,7 +947,7 @@ pub(crate) mod parsing { Some(ty) if !has_mut_self => ty, _ => { name = None; - Type::Verbatim(verbatim::between(begin, input)) + Type::Verbatim(verbatim::between(&begin, input)) } }; diff --git a/vendor/syn/src/verbatim.rs b/vendor/syn/src/verbatim.rs index 436d87343..54dc1cfa0 100644 --- a/vendor/syn/src/verbatim.rs +++ b/vendor/syn/src/verbatim.rs @@ -1,9 +1,9 @@ -use crate::parse::{ParseBuffer, ParseStream}; +use crate::parse::ParseStream; use proc_macro2::{Delimiter, TokenStream}; use std::cmp::Ordering; use std::iter; -pub(crate) fn between<'a>(begin: ParseBuffer<'a>, end: ParseStream<'a>) -> TokenStream { +pub(crate) fn between<'a>(begin: ParseStream<'a>, end: ParseStream<'a>) -> TokenStream { let end = end.cursor(); let mut cursor = begin.cursor(); assert!(crate::buffer::same_buffer(end, cursor)); diff --git a/vendor/syn/tests/common/eq.rs b/vendor/syn/tests/common/eq.rs index 8ca04b6a2..7fe75d49b 100644 --- a/vendor/syn/tests/common/eq.rs +++ b/vendor/syn/tests/common/eq.rs @@ -457,7 +457,7 @@ spanless_eq_struct!(BareFnTy; unsafety ext generic_params decl decl_span); spanless_eq_struct!(BindingAnnotation; 0 1); spanless_eq_struct!(Block; stmts id rules span tokens could_be_bare_literal); spanless_eq_struct!(Closure; binder capture_clause constness asyncness movability fn_decl body !fn_decl_span !fn_arg_span); -spanless_eq_struct!(ConstItem; defaultness ty expr); +spanless_eq_struct!(ConstItem; defaultness generics ty expr); spanless_eq_struct!(Crate; attrs items spans id is_placeholder); spanless_eq_struct!(DelimArgs; dspan delim tokens); spanless_eq_struct!(EnumDef; variants); @@ -586,8 +586,8 @@ spanless_eq_enum!(ExprKind; Array(0) ConstBlock(0) Call(0 1) MethodCall(0) Block(0 1) Async(0 1) Await(0 1) 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) OffsetOf(0 1) MacCall(0) - Struct(0) Repeat(0 1) Paren(0) Try(0) Yield(0) Yeet(0) IncludedBytes(0) - FormatArgs(0) Err); + Struct(0) Repeat(0 1) Paren(0) Try(0) Yield(0) Yeet(0) Become(0) + IncludedBytes(0) FormatArgs(0) Err); spanless_eq_enum!(InlineAsmOperand; In(reg expr) Out(reg late expr) InOut(reg late expr) SplitInOut(reg late in_expr out_expr) Const(anon_const) Sym(sym)); diff --git a/vendor/syn/tests/macros/mod.rs b/vendor/syn/tests/macros/mod.rs index 5ca88b083..3bfbe0389 100644 --- a/vendor/syn/tests/macros/mod.rs +++ b/vendor/syn/tests/macros/mod.rs @@ -38,14 +38,20 @@ macro_rules! snapshot_impl { let $expr = crate::macros::Tokens::parse::<$t>($expr).unwrap(); let debug = crate::macros::debug::Lite(&$expr); if !cfg!(miri) { - insta::assert_debug_snapshot!(debug, @$snapshot); + #[allow(clippy::needless_raw_string_hashes)] // https://github.com/mitsuhiko/insta/issues/389 + { + insta::assert_debug_snapshot!(debug, @$snapshot); + } } }; (($($expr:tt)*) as $t:ty, @$snapshot:literal) => {{ let syntax_tree = crate::macros::Tokens::parse::<$t>($($expr)*).unwrap(); let debug = crate::macros::debug::Lite(&syntax_tree); if !cfg!(miri) { - insta::assert_debug_snapshot!(debug, @$snapshot); + #[allow(clippy::needless_raw_string_hashes)] + { + insta::assert_debug_snapshot!(debug, @$snapshot); + } } syntax_tree }}; @@ -53,7 +59,10 @@ macro_rules! snapshot_impl { let syntax_tree = $($expr)*; let debug = crate::macros::debug::Lite(&syntax_tree); if !cfg!(miri) { - insta::assert_debug_snapshot!(debug, @$snapshot); + #[allow(clippy::needless_raw_string_hashes)] + { + insta::assert_debug_snapshot!(debug, @$snapshot); + } } syntax_tree }}; diff --git a/vendor/syn/tests/repo/mod.rs b/vendor/syn/tests/repo/mod.rs index cec42a6c6..780ad823b 100644 --- a/vendor/syn/tests/repo/mod.rs +++ b/vendor/syn/tests/repo/mod.rs @@ -13,10 +13,17 @@ use std::path::{Path, PathBuf}; use tar::Archive; use walkdir::{DirEntry, WalkDir}; -const REVISION: &str = "5e1d3299a290026b85787bc9c7e72bcc53ac283f"; +const REVISION: &str = "85bf07972a1041b9e25393b803d0e006bec3eaaf"; #[rustfmt::skip] static EXCLUDE_FILES: &[&str] = &[ + // CStr literals (c"…") are not yet supported by rustc's lexer + // https://github.com/rust-lang/rust/issues/113333 + "src/tools/clippy/tests/ui/needless_raw_string_hashes.rs", + "src/tools/rust-analyzer/crates/parser/test_data/parser/inline/ok/0085_expr_literals.rs", + "src/tools/rust-analyzer/crates/parser/test_data/parser/inline/ok/0085_expr_literals.rs", + "tests/ui/explicit-tail-calls/return-lifetime-sub.rs", + // TODO: non-lifetime binders: `where for<'a, T> &'a Struct: Trait` // https://github.com/dtolnay/syn/issues/1435 "tests/rustdoc-json/non_lifetime_binders.rs", @@ -24,6 +31,7 @@ static EXCLUDE_FILES: &[&str] = &[ // TODO: return type notation: `where T: Trait` // https://github.com/dtolnay/syn/issues/1434 + "src/tools/rust-analyzer/crates/parser/test_data/parser/inline/ok/0208_associated_return_type_bounds.rs", "tests/ui/associated-type-bounds/return-type-notation/basic.rs", "tests/ui/feature-gates/feature-gate-return_type_notation.rs", @@ -37,11 +45,14 @@ static EXCLUDE_FILES: &[&str] = &[ // Need at least one trait in impl Trait, no such type as impl 'static "tests/ui/type-alias-impl-trait/generic_type_does_not_live_long_enough.rs", + // Negative polarity trait bound: `where T: !Copy` + "src/tools/rustfmt/tests/target/negative-bounds.rs", + // Lifetime bound inside for<>: `T: ~const ?for<'a: 'b> Trait<'a>` - "tests/ui/rfc-2632-const-trait-impl/tilde-const-syntax.rs", + "tests/ui/rfcs/rfc-2632-const-trait-impl/tilde-const-syntax.rs", // Const impl that is not a trait impl: `impl ~const T {}` - "tests/ui/rfc-2632-const-trait-impl/syntax.rs", + "tests/ui/rfcs/rfc-2632-const-trait-impl/syntax.rs", // Deprecated anonymous parameter syntax in traits "src/tools/rustfmt/tests/source/trait.rs", @@ -63,6 +74,7 @@ static EXCLUDE_FILES: &[&str] = &[ "src/tools/rust-analyzer/crates/parser/test_data/parser/inline/ok/0004_value_parameters_no_patterns.rs", "src/tools/rust-analyzer/crates/parser/test_data/parser/inline/ok/0104_path_fn_trait_args.rs", "src/tools/rust-analyzer/crates/parser/test_data/parser/inline/ok/0202_typepathfn_with_coloncolon.rs", + "src/tools/rust-analyzer/crates/parser/test_data/parser/inline/ok/0209_bare_dyn_types_with_paren_as_generic_args.rs", "src/tools/rustfmt/tests/source/attrib.rs", "src/tools/rustfmt/tests/source/closure.rs", "src/tools/rustfmt/tests/source/existential_type.rs", @@ -85,8 +97,8 @@ static EXCLUDE_FILES: &[&str] = &[ "tests/codegen-units/item-collection/non-generic-closures.rs", "tests/debuginfo/recursive-enum.rs", "tests/pretty/closure-reform-pretty.rs", - "tests/run-make-fulldeps/reproducible-build-2/reproducible-build.rs", - "tests/run-make-fulldeps/reproducible-build/reproducible-build.rs", + "tests/run-make/reproducible-build-2/reproducible-build.rs", + "tests/run-make/reproducible-build/reproducible-build.rs", "tests/ui/auxiliary/typeid-intrinsic-aux1.rs", "tests/ui/auxiliary/typeid-intrinsic-aux2.rs", "tests/ui/impl-trait/generic-with-implicit-hrtb-without-dyn.rs", @@ -95,10 +107,6 @@ static EXCLUDE_FILES: &[&str] = &[ "tests/ui/lifetimes/bare-trait-object.rs", "tests/ui/parser/bounds-obj-parens.rs", - // Old type ascription expression syntax - "src/tools/rustfmt/tests/source/type-ascription.rs", - "src/tools/rustfmt/tests/target/type-ascription.rs", - // Obsolete box syntax "src/tools/rust-analyzer/crates/parser/test_data/parser/inline/ok/0132_box_expr.rs", diff --git a/vendor/syn/tests/test_expr.rs b/vendor/syn/tests/test_expr.rs index c7230c6dc..5d529bf14 100644 --- a/vendor/syn/tests/test_expr.rs +++ b/vendor/syn/tests/test_expr.rs @@ -85,7 +85,7 @@ fn test_tuple_multi_index() { assert_eq!(expected, syn::parse_str(input).unwrap()); } - for tokens in vec![ + for tokens in [ quote!(tuple.0.0), quote!(tuple .0.0), quote!(tuple. 0.0), diff --git a/vendor/syn/tests/test_round_trip.rs b/vendor/syn/tests/test_round_trip.rs index 0ef47b20f..c0af30d29 100644 --- a/vendor/syn/tests/test_round_trip.rs +++ b/vendor/syn/tests/test_round_trip.rs @@ -33,6 +33,7 @@ use rustc_errors::{translation, Diagnostic, PResult}; use rustc_session::parse::ParseSess; use rustc_span::source_map::FilePathMapping; use rustc_span::FileName; +use std::borrow::Cow; use std::fs; use std::panic; use std::path::Path; @@ -154,7 +155,7 @@ fn librustc_parse(content: String, sess: &ParseSess) -> PResult { parse::parse_crate_from_source_str(name, content, sess) } -fn translate_message(diagnostic: &Diagnostic) -> String { +fn translate_message(diagnostic: &Diagnostic) -> Cow<'static, str> { thread_local! { static FLUENT_BUNDLE: LazyFallbackBundle = { let locale_resources = rustc_driver::DEFAULT_LOCALE_RESOURCES.to_vec(); @@ -186,7 +187,7 @@ fn translate_message(diagnostic: &Diagnostic) -> String { let mut err = Vec::new(); let translated = fluent_bundle.format_pattern(value, Some(&args), &mut err); assert!(err.is_empty()); - translated.into_owned() + Cow::Owned(translated.into_owned()) }) } -- cgit v1.2.3