summaryrefslogtreecommitdiffstats
path: root/vendor/syn
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-05-18 02:49:50 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-05-18 02:49:50 +0000
commit9835e2ae736235810b4ea1c162ca5e65c547e770 (patch)
tree3fcebf40ed70e581d776a8a4c65923e8ec20e026 /vendor/syn
parentReleasing progress-linux version 1.70.0+dfsg2-1~progress7.99u1. (diff)
downloadrustc-9835e2ae736235810b4ea1c162ca5e65c547e770.tar.xz
rustc-9835e2ae736235810b4ea1c162ca5e65c547e770.zip
Merging upstream version 1.71.1+dfsg1.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'vendor/syn')
-rw-r--r--vendor/syn/.cargo-checksum.json2
-rw-r--r--vendor/syn/Cargo.toml6
-rw-r--r--vendor/syn/benches/rust.rs11
-rw-r--r--vendor/syn/src/error.rs23
-rw-r--r--vendor/syn/src/expr.rs24
-rw-r--r--vendor/syn/src/item.rs395
-rw-r--r--vendor/syn/src/lib.rs3
-rw-r--r--vendor/syn/src/meta.rs2
-rw-r--r--vendor/syn/src/pat.rs22
-rw-r--r--vendor/syn/src/punctuated.rs12
-rw-r--r--vendor/syn/tests/common/eq.rs14
-rw-r--r--vendor/syn/tests/repo/mod.rs65
-rw-r--r--vendor/syn/tests/test_precedence.rs68
-rw-r--r--vendor/syn/tests/test_round_trip.rs16
14 files changed, 372 insertions, 291 deletions
diff --git a/vendor/syn/.cargo-checksum.json b/vendor/syn/.cargo-checksum.json
index e9aa3eafe..5afd54bd2 100644
--- a/vendor/syn/.cargo-checksum.json
+++ b/vendor/syn/.cargo-checksum.json
@@ -1 +1 @@
-{"files":{"Cargo.toml":"c1b6d19b197753cc601931a339bd69184fbc2b334cfe1e528dacc5234f0952e0","LICENSE-APACHE":"62c7a1e35f56406896d7aa7ca52d0cc0d272ac022b5d2796e7d6905db8a3636a","LICENSE-MIT":"23f18e03dc49df91622fe2a76176497404e46ced8a715d9d2b67a7446571cca3","README.md":"33fd74d909172770aaf840c519f7c59ef185a4a8d21c1e5e4dcd6a398e7e1e61","benches/file.rs":"0a0527c78d849148cbb6118b4d36f72da7d4add865ba1a410e0a1be9e8dbfe0e","benches/rust.rs":"d152728d0ec01dd92cd803f7b9ad5f43ecb6adecb352c10e2d1f4b24049fb5e6","src/attr.rs":"bd5ffae18a363162f7d9c12a1b6c1d023070cbf1b060c98ebc38ef79f1de9c67","src/bigint.rs":"0299829b2f7a1a798fe2f7bc1680e4a10f9b6f4a852d09af4da2deab466c4242","src/buffer.rs":"634fed0b398163581d27b4693a481ffcef891c8e274d9b4574482a644ef9fce9","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":"f48a24c90e362164cfedbfc5a3cb24d75bdab281276dee36b69a12707dd49bc7","src/export.rs":"6785b6329d7bc0a5b0efbf9d28af7cdbdfe279ae9a0e21ef177b144ed6188b66","src/expr.rs":"880c35b530f9afa1a94cedfb4b87f5cd7c790b9743d3e3b2f650c161db41ce94","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":"b31c1afb235d4e38d4c8624620a2e00d6e5c74e157daa83adb55dffabf3296ca","src/lib.rs":"6702797f3f54a52fa1f30278d42978e3d42cfdaef49b9d35ef41fcf0f9705384","src/lifetime.rs":"531ef74507eaf942a3aedfac83bbdbc17463102a6c806f675a83a0d6dc612c52","src/lit.rs":"72214440bdfa844aa86853aec42cd6900dff47a3cab4bc8d83ad205a115c09ce","src/lookahead.rs":"376092f91a1c32e1b277db0a6790fdda151c9ec51bd971fe6a6545b5b9e73b5d","src/mac.rs":"b1cf73f34a27a8f1429125e726623a524fb5dce875eb68ead3beaffa976442c3","src/macros.rs":"4e464104c590200213635624706d83e4a0ddd5aedd826ab4aabb390000f35ae0","src/meta.rs":"3184c17a1a0c65084eb3182b423860a81cc9b0c5b3355849563b17340d7c7fbf","src/op.rs":"fe5db7c3373b956234ea8a1a7d129a06e5aef5db77c44c1c2fedb4aaa667ac56","src/parse.rs":"07dafec0038234eba0c15845bd85f3250f41dce6d013f49e2364666bb9732bae","src/parse_macro_input.rs":"4a753b2a6dbfefd6dc93852d66b4f6d73ebd6b8b9be74019fc476f429b9a892d","src/parse_quote.rs":"60eff4d03bf4f5977be86f49faad16d6713121f69bedd868f951bbcabf443d66","src/pat.rs":"15ace4b29add6b7ecdac19bc697e923918f9619e5ec5aea939e91efa84babcfa","src/path.rs":"8dcedaab7ca9e9bc901fb74079e35bfca6ff9e45bc5ca75af1008c087a2c24c8","src/print.rs":"22910bf0521ab868ebd7c62601c55912d12cfb400c65723e08e5cfa3a2d111c0","src/punctuated.rs":"bb8fcdc261caed419b690b623ed375b95c31fccce29a2220a36bd7a8c7384749","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":"8d0435cde79d9599f9ead756b3a36a22cb9302db6572d61092fecaec10d6bc91","src/verbatim.rs":"8d2a42a0aad2a5e69d9b32ba7fb3564fce003fe0862dbc01e106f15d951f3060","src/whitespace.rs":"718a80c12cdd145358e2690f0f68ff7779a91ec17ce9fde9bb755f635fce69ad","tests/common/eq.rs":"9359e9b74dc04cbfd55d1a525bd1dc8fdd1d51dad692fd37f73063a2d4d9dca6","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":"ab9f194ed7a7279b9ad32cf01c50dc0f2f0d45725a0037ce76084817f016e8db","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":"9bd073caba1d56d1256d13ae4b7f825b04f9b399a7b31634db7ea72d6d5d96bf","tests/test_receiver.rs":"af64117acd66fbf42edc476f731ecd20c88009d9cb641dbd7a1d6384ae99ae73","tests/test_round_trip.rs":"15f2ed76f7af6696cb4df7153bcfafb9c514ca6a3ab0e8beb3f78def25427c92","tests/test_shebang.rs":"06d3acabed004767d8b3a0389bde7485a6719cad6a0d0b4ac2c7439b03586651","tests/test_should_parse.rs":"1d3535698a446e2755bfc360676bdb161841a1f454cdef6e7556c6d06a95c89d","tests/test_size.rs":"a4db2760e9438ef1a26d70238c2b5044de02878403fd424b4c9913b5ee45e004","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":"bcc02725fd69ab9f26eab07fad303e2497fad6fb9eba4f96c4d1687bdf704ad9"} \ No newline at end of file
+{"files":{"Cargo.toml":"83c347729a5c03ac800495383833be7d4532264f2bc70647d9129987872175d6","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":"634fed0b398163581d27b4693a481ffcef891c8e274d9b4574482a644ef9fce9","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":"6785b6329d7bc0a5b0efbf9d28af7cdbdfe279ae9a0e21ef177b144ed6188b66","src/expr.rs":"5b90b619ec48704627adefeb437793d41148f62e94d4b1e80ad81b8ee5085a14","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":"95fee1b06510d69ca2bf907ac60b275f830da63e922729bec7d97f141a5056a9","src/lifetime.rs":"531ef74507eaf942a3aedfac83bbdbc17463102a6c806f675a83a0d6dc612c52","src/lit.rs":"72214440bdfa844aa86853aec42cd6900dff47a3cab4bc8d83ad205a115c09ce","src/lookahead.rs":"376092f91a1c32e1b277db0a6790fdda151c9ec51bd971fe6a6545b5b9e73b5d","src/mac.rs":"b1cf73f34a27a8f1429125e726623a524fb5dce875eb68ead3beaffa976442c3","src/macros.rs":"4e464104c590200213635624706d83e4a0ddd5aedd826ab4aabb390000f35ae0","src/meta.rs":"43c9d06f222f5323087bb668d8b5c1cd4fdef772db1b433c9b991ea026649699","src/op.rs":"fe5db7c3373b956234ea8a1a7d129a06e5aef5db77c44c1c2fedb4aaa667ac56","src/parse.rs":"07dafec0038234eba0c15845bd85f3250f41dce6d013f49e2364666bb9732bae","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":"8d0435cde79d9599f9ead756b3a36a22cb9302db6572d61092fecaec10d6bc91","src/verbatim.rs":"8d2a42a0aad2a5e69d9b32ba7fb3564fce003fe0862dbc01e106f15d951f3060","src/whitespace.rs":"718a80c12cdd145358e2690f0f68ff7779a91ec17ce9fde9bb755f635fce69ad","tests/common/eq.rs":"9f606faf667dc6f2f8f09fe4535eec264a227dff3ec03ff2df3bc3b3fa6dfe71","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":"a4db2760e9438ef1a26d70238c2b5044de02878403fd424b4c9913b5ee45e004","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":"fcf316d5356ed6847742d036f8a39c3b8435cac10bd528a4bd461928a6ab34d5"} \ No newline at end of file
diff --git a/vendor/syn/Cargo.toml b/vendor/syn/Cargo.toml
index 813a576f0..59261feb2 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.8"
+version = "2.0.14"
authors = ["David Tolnay <dtolnay@gmail.com>"]
include = [
"/benches/**",
@@ -74,7 +74,7 @@ required-features = [
]
[dependencies.proc-macro2]
-version = "1.0.52"
+version = "1.0.55"
default-features = false
[dependencies.quote]
@@ -123,7 +123,7 @@ version = "0.4.16"
version = "1"
[dev-dependencies.walkdir]
-version = "2.1"
+version = "2.3.2"
[features]
clone-impls = []
diff --git a/vendor/syn/benches/rust.rs b/vendor/syn/benches/rust.rs
index fa72cc94b..ce6cfde29 100644
--- a/vendor/syn/benches/rust.rs
+++ b/vendor/syn/benches/rust.rs
@@ -18,6 +18,7 @@
#[path = "../tests/macros/mod.rs"]
mod macros;
+#[allow(dead_code)]
#[path = "../tests/repo/mod.rs"]
mod repo;
@@ -107,9 +108,13 @@ fn exec(mut codepath: impl FnMut(&str) -> Result<(), ()>) -> Duration {
let mut success = 0;
let mut total = 0;
- walkdir::WalkDir::new("tests/rust/src")
- .into_iter()
- .filter_entry(repo::base_dir_filter)
+ ["tests/rust/compiler", "tests/rust/library"]
+ .iter()
+ .flat_map(|dir| {
+ walkdir::WalkDir::new(dir)
+ .into_iter()
+ .filter_entry(repo::base_dir_filter)
+ })
.for_each(|entry| {
let entry = entry.unwrap();
let path = entry.path();
diff --git a/vendor/syn/src/error.rs b/vendor/syn/src/error.rs
index 7eebd243c..93f20f42f 100644
--- a/vendor/syn/src/error.rs
+++ b/vendor/syn/src/error.rs
@@ -278,8 +278,29 @@ impl ErrorMessage {
None => (Span::call_site(), Span::call_site()),
};
- // compile_error!($message)
+ // ::core::compile_error!($message)
TokenStream::from_iter(vec![
+ TokenTree::Punct({
+ let mut punct = Punct::new(':', Spacing::Joint);
+ punct.set_span(start);
+ punct
+ }),
+ TokenTree::Punct({
+ let mut punct = Punct::new(':', Spacing::Alone);
+ punct.set_span(start);
+ punct
+ }),
+ TokenTree::Ident(Ident::new("core", start)),
+ TokenTree::Punct({
+ let mut punct = Punct::new(':', Spacing::Joint);
+ punct.set_span(start);
+ punct
+ }),
+ TokenTree::Punct({
+ let mut punct = Punct::new(':', Spacing::Alone);
+ punct.set_span(start);
+ punct
+ }),
TokenTree::Ident(Ident::new("compile_error", start)),
TokenTree::Punct({
let mut punct = Punct::new('!', Spacing::Alone);
diff --git a/vendor/syn/src/expr.rs b/vendor/syn/src/expr.rs
index 8caccb33f..8a982021f 100644
--- a/vendor/syn/src/expr.rs
+++ b/vendor/syn/src/expr.rs
@@ -1301,9 +1301,7 @@ pub(crate) mod parsing {
Precedence::Assign
} else if input.peek(Token![..]) {
Precedence::Range
- } else if input.peek(Token![as])
- || cfg!(feature = "full") && input.peek(Token![:]) && !input.peek(Token![::])
- {
+ } else if input.peek(Token![as]) {
Precedence::Cast
} else {
Precedence::Any
@@ -2718,13 +2716,21 @@ pub(crate) mod parsing {
}
fn multi_index(e: &mut Expr, dot_token: &mut Token![.], float: LitFloat) -> Result<bool> {
- let mut float_repr = float.to_string();
+ let float_token = float.token();
+ let float_span = float_token.span();
+ let mut float_repr = float_token.to_string();
let trailing_dot = float_repr.ends_with('.');
if trailing_dot {
float_repr.truncate(float_repr.len() - 1);
}
+
+ let mut offset = 0;
for part in float_repr.split('.') {
- let index = crate::parse_str(part).map_err(|err| Error::new(float.span(), err))?;
+ let mut index: Index =
+ crate::parse_str(part).map_err(|err| Error::new(float_span, err))?;
+ let part_end = offset + part.len();
+ index.span = float_token.subspan(offset..part_end).unwrap_or(float_span);
+
let base = mem::replace(e, Expr::DUMMY);
*e = Expr::Field(ExprField {
attrs: Vec::new(),
@@ -2732,8 +2738,14 @@ pub(crate) mod parsing {
dot_token: Token![.](dot_token.span),
member: Member::Unnamed(index),
});
- *dot_token = Token![.](float.span());
+
+ let dot_span = float_token
+ .subspan(part_end..part_end + 1)
+ .unwrap_or(float_span);
+ *dot_token = Token![.](dot_span);
+ offset = part_end + 1;
}
+
Ok(!trailing_dot)
}
diff --git a/vendor/syn/src/item.rs b/vendor/syn/src/item.rs
index 9d724b063..46ccd73ff 100644
--- a/vendor/syn/src/item.rs
+++ b/vendor/syn/src/item.rs
@@ -893,9 +893,6 @@ pub(crate) mod parsing {
use crate::ext::IdentExt;
use crate::parse::discouraged::Speculative;
use crate::parse::{Parse, ParseBuffer, ParseStream, Result};
- use crate::token::Brace;
- use proc_macro2::{Punct, Spacing, TokenTree};
- use std::iter::FromIterator;
#[cfg_attr(doc_cfg, doc(cfg(feature = "parsing")))]
impl Parse for Item {
@@ -971,40 +968,32 @@ pub(crate) mod parsing {
}
}
} else if lookahead.peek(Token![const]) {
- ahead.parse::<Token![const]>()?;
- let lookahead = ahead.lookahead1();
- if lookahead.peek(Ident) || lookahead.peek(Token![_]) {
- let vis = input.parse()?;
- let const_token = input.parse()?;
- let ident = {
- let lookahead = input.lookahead1();
- 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::<Token![;]>()?;
- 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()?,
- }))
- }
+ 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 {
- Err(lookahead.error())
+ return Err(lookahead.error());
+ };
+ let colon_token = input.parse()?;
+ let ty = input.parse()?;
+ if input.peek(Token![;]) {
+ input.parse::<Token![;]>()?;
+ 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::<Token![unsafe]>()?;
@@ -1083,6 +1072,11 @@ pub(crate) mod parsing {
semi_token: Token![;],
}
+ enum TypeDefaultness {
+ Optional,
+ Disallowed,
+ }
+
enum WhereClauseLocation {
// type Ty<T> where T: 'static = T;
BeforeEq,
@@ -1093,27 +1087,20 @@ pub(crate) mod parsing {
}
impl FlexibleItemType {
- fn parse(input: ParseStream, where_clause_location: WhereClauseLocation) -> Result<Self> {
+ fn parse(
+ input: ParseStream,
+ allow_defaultness: TypeDefaultness,
+ where_clause_location: WhereClauseLocation,
+ ) -> Result<Self> {
let vis: Visibility = input.parse()?;
- let defaultness: Option<Token![default]> = input.parse()?;
+ let defaultness: Option<Token![default]> = match allow_defaultness {
+ TypeDefaultness::Optional => input.parse()?,
+ TypeDefaultness::Disallowed => None,
+ };
let type_token: Token![type] = input.parse()?;
let ident: Ident = input.parse()?;
let mut generics: Generics = input.parse()?;
- let colon_token: Option<Token![:]> = input.parse()?;
-
- let mut bounds = Punctuated::new();
- if colon_token.is_some() {
- loop {
- if input.peek(Token![where]) || input.peek(Token![=]) || input.peek(Token![;]) {
- break;
- }
- bounds.push_value(input.parse::<TypeParamBound>()?);
- if input.peek(Token![where]) || input.peek(Token![=]) || input.peek(Token![;]) {
- break;
- }
- bounds.push_punct(input.parse::<Token![+]>()?);
- }
- }
+ let (colon_token, bounds) = Self::parse_optional_bounds(input)?;
match where_clause_location {
WhereClauseLocation::BeforeEq | WhereClauseLocation::Both => {
@@ -1122,11 +1109,7 @@ pub(crate) mod parsing {
WhereClauseLocation::AfterEq => {}
}
- let ty = if let Some(eq_token) = input.parse()? {
- Some((eq_token, input.parse::<Type>()?))
- } else {
- None
- };
+ let ty = Self::parse_optional_definition(input)?;
match where_clause_location {
WhereClauseLocation::AfterEq | WhereClauseLocation::Both
@@ -1151,6 +1134,38 @@ pub(crate) mod parsing {
semi_token,
})
}
+
+ fn parse_optional_bounds(
+ input: ParseStream,
+ ) -> Result<(Option<Token![:]>, Punctuated<TypeParamBound, Token![+]>)> {
+ let colon_token: Option<Token![:]> = input.parse()?;
+
+ let mut bounds = Punctuated::new();
+ if colon_token.is_some() {
+ loop {
+ if input.peek(Token![where]) || input.peek(Token![=]) || input.peek(Token![;]) {
+ break;
+ }
+ bounds.push_value(input.parse::<TypeParamBound>()?);
+ if input.peek(Token![where]) || input.peek(Token![=]) || input.peek(Token![;]) {
+ break;
+ }
+ bounds.push_punct(input.parse::<Token![+]>()?);
+ }
+ }
+
+ Ok((colon_token, bounds))
+ }
+
+ fn parse_optional_definition(input: ParseStream) -> Result<Option<(Token![=], Type)>> {
+ let eq_token: Option<Token![=]> = input.parse()?;
+ if let Some(eq_token) = eq_token {
+ let definition: Type = input.parse()?;
+ Ok(Some((eq_token, definition)))
+ } else {
+ Ok(None)
+ }
+ }
}
#[cfg_attr(doc_cfg, doc(cfg(feature = "parsing")))]
@@ -1852,7 +1867,7 @@ pub(crate) mod parsing {
fn parse_foreign_item_type(begin: ParseBuffer, input: ParseStream) -> Result<ForeignItem> {
let FlexibleItemType {
vis,
- defaultness,
+ defaultness: _,
type_token,
ident,
generics,
@@ -1860,9 +1875,13 @@ pub(crate) mod parsing {
bounds: _,
ty,
semi_token,
- } = FlexibleItemType::parse(input, WhereClauseLocation::Both)?;
+ } = FlexibleItemType::parse(
+ input,
+ TypeDefaultness::Disallowed,
+ WhereClauseLocation::Both,
+ )?;
- if defaultness.is_some() || colon_token.is_some() || ty.is_some() {
+ if colon_token.is_some() || ty.is_some() {
Ok(ForeignItem::Verbatim(verbatim::between(begin, input)))
} else {
Ok(ForeignItem::Type(ForeignItemType {
@@ -1917,7 +1936,7 @@ pub(crate) mod parsing {
fn parse_item_type(begin: ParseBuffer, input: ParseStream) -> Result<Item> {
let FlexibleItemType {
vis,
- defaultness,
+ defaultness: _,
type_token,
ident,
generics,
@@ -1925,23 +1944,27 @@ pub(crate) mod parsing {
bounds: _,
ty,
semi_token,
- } = FlexibleItemType::parse(input, WhereClauseLocation::BeforeEq)?;
+ } = FlexibleItemType::parse(
+ input,
+ TypeDefaultness::Disallowed,
+ WhereClauseLocation::BeforeEq,
+ )?;
+
+ let (eq_token, ty) = match ty {
+ Some(ty) if colon_token.is_none() => ty,
+ _ => return Ok(Item::Verbatim(verbatim::between(begin, input))),
+ };
- if defaultness.is_some() || colon_token.is_some() || ty.is_none() {
- Ok(Item::Verbatim(verbatim::between(begin, input)))
- } else {
- let (eq_token, ty) = ty.unwrap();
- Ok(Item::Type(ItemType {
- attrs: Vec::new(),
- vis,
- type_token,
- ident,
- generics,
- eq_token,
- ty: Box::new(ty),
- semi_token,
- }))
- }
+ Ok(Item::Type(ItemType {
+ attrs: Vec::new(),
+ vis,
+ type_token,
+ ident,
+ generics,
+ eq_token,
+ ty: Box::new(ty),
+ semi_token,
+ }))
}
#[cfg_attr(doc_cfg, doc(cfg(feature = "parsing")))]
@@ -2202,11 +2225,13 @@ pub(crate) mod parsing {
}
} else if lookahead.peek(Token![type]) {
parse_trait_item_type(begin.fork(), input)
- } else if lookahead.peek(Ident)
- || lookahead.peek(Token![self])
- || lookahead.peek(Token![super])
- || lookahead.peek(Token![crate])
- || lookahead.peek(Token![::])
+ } else if vis.is_inherited()
+ && defaultness.is_none()
+ && (lookahead.peek(Ident)
+ || lookahead.peek(Token![self])
+ || lookahead.peek(Token![super])
+ || lookahead.peek(Token![crate])
+ || lookahead.peek(Token![::]))
{
input.parse().map(TraitItem::Macro)
} else {
@@ -2298,30 +2323,10 @@ pub(crate) mod parsing {
let type_token: Token![type] = input.parse()?;
let ident: Ident = input.parse()?;
let mut generics: Generics = input.parse()?;
- let colon_token: Option<Token![:]> = input.parse()?;
-
- let mut bounds = Punctuated::new();
- if colon_token.is_some() {
- while !input.peek(Token![where]) && !input.peek(Token![=]) && !input.peek(Token![;])
- {
- if !bounds.is_empty() {
- bounds.push_punct(input.parse()?);
- }
- bounds.push_value(input.parse()?);
- }
- }
-
- let default = if input.peek(Token![=]) {
- let eq_token: Token![=] = input.parse()?;
- let default: Type = input.parse()?;
- Some((eq_token, default))
- } else {
- None
- };
-
+ let (colon_token, bounds) = FlexibleItemType::parse_optional_bounds(input)?;
+ let default = FlexibleItemType::parse_optional_definition(input)?;
generics.where_clause = input.parse()?;
let semi_token: Token![;] = input.parse()?;
-
Ok(TraitItemType {
attrs,
type_token,
@@ -2338,7 +2343,7 @@ pub(crate) mod parsing {
fn parse_trait_item_type(begin: ParseBuffer, input: ParseStream) -> Result<TraitItem> {
let FlexibleItemType {
vis,
- defaultness,
+ defaultness: _,
type_token,
ident,
generics,
@@ -2346,9 +2351,13 @@ pub(crate) mod parsing {
bounds,
ty,
semi_token,
- } = FlexibleItemType::parse(input, WhereClauseLocation::AfterEq)?;
+ } = FlexibleItemType::parse(
+ input,
+ TypeDefaultness::Disallowed,
+ WhereClauseLocation::AfterEq,
+ )?;
- if defaultness.is_some() || vis.is_some() {
+ if vis.is_some() {
Ok(TraitItem::Verbatim(verbatim::between(begin, input)))
} else {
Ok(TraitItem::Type(TraitItemType {
@@ -2512,35 +2521,40 @@ pub(crate) mod parsing {
};
let mut item = if lookahead.peek(Token![fn]) || peek_signature(&ahead) {
- input.parse().map(ImplItem::Fn)
+ let allow_omitted_body = true;
+ if let Some(item) = parse_impl_item_fn(input, allow_omitted_body)? {
+ Ok(ImplItem::Fn(item))
+ } else {
+ Ok(ImplItem::Verbatim(verbatim::between(begin, input)))
+ }
} else if lookahead.peek(Token![const]) {
- let const_token: Token![const] = ahead.parse()?;
- let lookahead = ahead.lookahead1();
- if lookahead.peek(Ident) || lookahead.peek(Token![_]) {
- input.advance_to(&ahead);
- let ident: Ident = input.call(Ident::parse_any)?;
- let colon_token: Token![:] = input.parse()?;
- let ty: Type = input.parse()?;
- if let Some(eq_token) = input.parse()? {
- return Ok(ImplItem::Const(ImplItemConst {
- attrs,
- vis,
- defaultness,
- const_token,
- ident,
- generics: Generics::default(),
- colon_token,
- ty,
- eq_token,
- expr: input.parse()?,
- semi_token: input.parse()?,
- }));
- } else {
- input.parse::<Token![;]>()?;
- return Ok(ImplItem::Verbatim(verbatim::between(begin, input)));
- }
+ input.advance_to(&ahead);
+ 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 {
- Err(lookahead.error())
+ return Err(lookahead.error());
+ };
+ let colon_token: Token![:] = input.parse()?;
+ let ty: Type = input.parse()?;
+ if let Some(eq_token) = input.parse()? {
+ return Ok(ImplItem::Const(ImplItemConst {
+ attrs,
+ vis,
+ defaultness,
+ const_token,
+ ident,
+ generics: Generics::default(),
+ colon_token,
+ ty,
+ eq_token,
+ expr: input.parse()?,
+ semi_token: input.parse()?,
+ }));
+ } else {
+ input.parse::<Token![;]>()?;
+ return Ok(ImplItem::Verbatim(verbatim::between(begin, input)));
}
} else if lookahead.peek(Token![type]) {
parse_impl_item_type(begin, input)
@@ -2602,41 +2616,42 @@ pub(crate) mod parsing {
#[cfg_attr(doc_cfg, doc(cfg(feature = "parsing")))]
impl Parse for ImplItemFn {
fn parse(input: ParseStream) -> Result<Self> {
- let mut attrs = input.call(Attribute::parse_outer)?;
- let vis: Visibility = input.parse()?;
- let defaultness: Option<Token![default]> = input.parse()?;
- let sig: Signature = input.parse()?;
+ let allow_omitted_body = false;
+ parse_impl_item_fn(input, allow_omitted_body).map(Option::unwrap)
+ }
+ }
- let block = if let Some(semi) = input.parse::<Option<Token![;]>>()? {
- // Accept functions without a body in an impl block because
- // rustc's *parser* does not reject them (the compilation error
- // is emitted later than parsing) and it can be useful for macro
- // DSLs.
- let mut punct = Punct::new(';', Spacing::Alone);
- punct.set_span(semi.span);
- let tokens = TokenStream::from_iter(vec![TokenTree::Punct(punct)]);
- Block {
- brace_token: Brace(semi.span),
- stmts: vec![Stmt::Item(Item::Verbatim(tokens))],
- }
- } else {
- let content;
- let brace_token = braced!(content in input);
- attrs.extend(content.call(Attribute::parse_inner)?);
- Block {
- brace_token,
- stmts: content.call(Block::parse_within)?,
- }
- };
+ fn parse_impl_item_fn(
+ input: ParseStream,
+ allow_omitted_body: bool,
+ ) -> Result<Option<ImplItemFn>> {
+ let mut attrs = input.call(Attribute::parse_outer)?;
+ let vis: Visibility = input.parse()?;
+ let defaultness: Option<Token![default]> = input.parse()?;
+ let sig: Signature = input.parse()?;
- Ok(ImplItemFn {
- attrs,
- vis,
- defaultness,
- sig,
- block,
- })
+ // Accept functions without a body in an impl block because rustc's
+ // *parser* does not reject them (the compilation error is emitted later
+ // than parsing) and it can be useful for macro DSLs.
+ if allow_omitted_body && input.parse::<Option<Token![;]>>()?.is_some() {
+ return Ok(None);
}
+
+ let content;
+ let brace_token = braced!(content in input);
+ attrs.extend(content.call(Attribute::parse_inner)?);
+ let block = Block {
+ brace_token,
+ stmts: content.call(Block::parse_within)?,
+ };
+
+ Ok(Some(ImplItemFn {
+ attrs,
+ vis,
+ defaultness,
+ sig,
+ block,
+ }))
}
#[cfg_attr(doc_cfg, doc(cfg(feature = "parsing")))]
@@ -2677,24 +2692,28 @@ pub(crate) mod parsing {
bounds: _,
ty,
semi_token,
- } = FlexibleItemType::parse(input, WhereClauseLocation::AfterEq)?;
+ } = FlexibleItemType::parse(
+ input,
+ TypeDefaultness::Optional,
+ WhereClauseLocation::AfterEq,
+ )?;
+
+ let (eq_token, ty) = match ty {
+ Some(ty) if colon_token.is_none() => ty,
+ _ => return Ok(ImplItem::Verbatim(verbatim::between(begin, input))),
+ };
- if colon_token.is_some() || ty.is_none() {
- Ok(ImplItem::Verbatim(verbatim::between(begin, input)))
- } else {
- let (eq_token, ty) = ty.unwrap();
- Ok(ImplItem::Type(ImplItemType {
- attrs: Vec::new(),
- vis,
- defaultness,
- type_token,
- ident,
- generics,
- eq_token,
- ty,
- semi_token,
- }))
- }
+ Ok(ImplItem::Type(ImplItemType {
+ attrs: Vec::new(),
+ vis,
+ defaultness,
+ type_token,
+ ident,
+ generics,
+ eq_token,
+ ty,
+ semi_token,
+ }))
}
#[cfg_attr(doc_cfg, doc(cfg(feature = "parsing")))]
@@ -3132,14 +3151,6 @@ mod printing {
self.vis.to_tokens(tokens);
self.defaultness.to_tokens(tokens);
self.sig.to_tokens(tokens);
- if self.block.stmts.len() == 1 {
- if let Stmt::Item(Item::Verbatim(verbatim)) = &self.block.stmts[0] {
- if verbatim.to_string() == ";" {
- verbatim.to_tokens(tokens);
- return;
- }
- }
- }
self.block.brace_token.surround(tokens, |tokens| {
tokens.append_all(self.attrs.inner());
tokens.append_all(&self.block.stmts);
diff --git a/vendor/syn/src/lib.rs b/vendor/syn/src/lib.rs
index 72b9e7d89..74bd21b41 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.8")]
+#![doc(html_root_url = "https://docs.rs/syn/2.0.14")]
#![cfg_attr(doc_cfg, feature(doc_cfg))]
#![allow(non_camel_case_types)]
#![allow(
@@ -281,6 +281,7 @@
clippy::needless_doctest_main,
clippy::needless_pass_by_value,
clippy::never_loop,
+ clippy::range_plus_one,
clippy::redundant_else,
clippy::return_self_not_must_use,
clippy::similar_names,
diff --git a/vendor/syn/src/meta.rs b/vendor/syn/src/meta.rs
index 766d5b703..b6bcf9830 100644
--- a/vendor/syn/src/meta.rs
+++ b/vendor/syn/src/meta.rs
@@ -401,6 +401,8 @@ fn parse_meta_path(input: ParseStream) -> Result<Path> {
if input.peek(Ident::peek_any) {
let ident = Ident::parse_any(input)?;
segments.push_value(PathSegment::from(ident));
+ } else if input.is_empty() {
+ return Err(input.error("expected nested attribute"));
} else if input.peek(Lit) {
return Err(input.error("unexpected literal in nested attribute, expected ident"));
} else {
diff --git a/vendor/syn/src/pat.rs b/vendor/syn/src/pat.rs
index 5833eeb33..2e6376b2f 100644
--- a/vendor/syn/src/pat.rs
+++ b/vendor/syn/src/pat.rs
@@ -543,17 +543,17 @@ pub(crate) mod parsing {
Member::Unnamed(_) => unreachable!(),
};
- let mut pat = Pat::Ident(PatIdent {
- attrs: Vec::new(),
- by_ref,
- mutability,
- ident: ident.clone(),
- subpat: None,
- });
-
- if boxed.is_some() {
- pat = Pat::Verbatim(verbatim::between(begin, input));
- }
+ let pat = if boxed.is_some() {
+ Pat::Verbatim(verbatim::between(begin, input))
+ } else {
+ Pat::Ident(PatIdent {
+ attrs: Vec::new(),
+ by_ref,
+ mutability,
+ ident: ident.clone(),
+ subpat: None,
+ })
+ };
Ok(FieldPat {
attrs: Vec::new(),
diff --git a/vendor/syn/src/punctuated.rs b/vendor/syn/src/punctuated.rs
index 7880eb29c..a4278081c 100644
--- a/vendor/syn/src/punctuated.rs
+++ b/vendor/syn/src/punctuated.rs
@@ -187,6 +187,18 @@ impl<T, P> Punctuated<T, P> {
}
}
+ /// Removes the trailing punctuation from this punctuated sequence, or
+ /// `None` if there isn't any.
+ pub fn pop_punct(&mut self) -> Option<P> {
+ if self.last.is_some() {
+ None
+ } else {
+ let (t, p) = self.inner.pop()?;
+ self.last = Some(Box::new(t));
+ Some(p)
+ }
+ }
+
/// Determines whether this punctuated sequence ends with a trailing
/// punctuation.
pub fn trailing_punct(&self) -> bool {
diff --git a/vendor/syn/tests/common/eq.rs b/vendor/syn/tests/common/eq.rs
index 70a533768..5d1c775d8 100644
--- a/vendor/syn/tests/common/eq.rs
+++ b/vendor/syn/tests/common/eq.rs
@@ -32,6 +32,7 @@ use rustc_ast::ast::CaptureBy;
use rustc_ast::ast::Closure;
use rustc_ast::ast::ClosureBinder;
use rustc_ast::ast::Const;
+use rustc_ast::ast::ConstItem;
use rustc_ast::ast::Crate;
use rustc_ast::ast::Defaultness;
use rustc_ast::ast::DelimArgs;
@@ -115,6 +116,7 @@ use rustc_ast::ast::QSelf;
use rustc_ast::ast::RangeEnd;
use rustc_ast::ast::RangeLimits;
use rustc_ast::ast::RangeSyntax;
+use rustc_ast::ast::StaticItem;
use rustc_ast::ast::Stmt;
use rustc_ast::ast::StmtKind;
use rustc_ast::ast::StrLit;
@@ -454,6 +456,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!(Crate; attrs items spans id is_placeholder);
spanless_eq_struct!(DelimArgs; dspan delim tokens);
spanless_eq_struct!(EnumDef; variants);
@@ -495,6 +498,7 @@ spanless_eq_struct!(Path; span segments tokens);
spanless_eq_struct!(PathSegment; ident id args);
spanless_eq_struct!(PolyTraitRef; bound_generic_params trait_ref span);
spanless_eq_struct!(QSelf; ty path_span position);
+spanless_eq_struct!(StaticItem; ty mutability expr);
spanless_eq_struct!(Stmt; id kind span);
spanless_eq_struct!(StrLit; symbol suffix symbol_unescaped style span);
spanless_eq_struct!(StructExpr; qself path fields rest);
@@ -513,7 +517,7 @@ spanless_eq_struct!(WhereEqPredicate; span lhs_ty rhs_ty);
spanless_eq_struct!(WhereRegionPredicate; span lifetime bounds);
spanless_eq_enum!(AngleBracketedArg; Arg(0) Constraint(0));
spanless_eq_enum!(AssocConstraintKind; Equality(term) Bound(bounds));
-spanless_eq_enum!(AssocItemKind; Const(0 1 2) Fn(0) Type(0) MacCall(0));
+spanless_eq_enum!(AssocItemKind; Const(0) Fn(0) Type(0) MacCall(0));
spanless_eq_enum!(Async; Yes(span closure_id return_impl_trait_id) No);
spanless_eq_enum!(AttrArgs; Empty Delimited(0) Eq(0 1));
spanless_eq_enum!(AttrArgsEq; Ast(0) Hir(0));
@@ -540,7 +544,7 @@ spanless_eq_enum!(FormatDebugHex; Lower Upper);
spanless_eq_enum!(FormatSign; Plus Minus);
spanless_eq_enum!(FormatTrait; Display Debug LowerExp UpperExp Octal Pointer Binary LowerHex UpperHex);
spanless_eq_enum!(GenericArg; Lifetime(0) Type(0) Const(0));
-spanless_eq_enum!(GenericArgs; AngleBracketed(0) Parenthesized(0));
+spanless_eq_enum!(GenericArgs; AngleBracketed(0) Parenthesized(0) ReturnTypeNotation(0));
spanless_eq_enum!(GenericBound; Trait(0 1) Outlives(0));
spanless_eq_enum!(GenericParamKind; Lifetime Type(default) Const(ty kw_span default));
spanless_eq_enum!(ImplPolarity; Positive Negative(0));
@@ -577,15 +581,15 @@ spanless_eq_enum!(WherePredicate; BoundPredicate(0) RegionPredicate(0) EqPredica
spanless_eq_enum!(ExprKind; Array(0) ConstBlock(0) Call(0 1) MethodCall(0)
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 2) Match(0 1) Closure(0)
- Block(0 1) Async(0 1 2) Await(0) TryBlock(0) Assign(0 1 2) AssignOp(0 1 2)
+ Block(0 1) Async(0 1) 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) 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));
-spanless_eq_enum!(ItemKind; ExternCrate(0) Use(0) Static(0 1 2) Const(0 1 2)
- Fn(0) Mod(0 1) ForeignMod(0) GlobalAsm(0) TyAlias(0) Enum(0 1) Struct(0 1)
+spanless_eq_enum!(ItemKind; ExternCrate(0) Use(0) Static(0) Const(0) Fn(0)
+ Mod(0 1) ForeignMod(0) GlobalAsm(0) TyAlias(0) Enum(0 1) Struct(0 1)
Union(0 1) Trait(0) TraitAlias(0 1) Impl(0) MacCall(0) MacroDef(0));
spanless_eq_enum!(LitKind; Str(0 1) ByteStr(0 1) Byte(0) Char(0) Int(0 1)
Float(0 1) Bool(0) Err);
diff --git a/vendor/syn/tests/repo/mod.rs b/vendor/syn/tests/repo/mod.rs
index 7be1cc323..cec42a6c6 100644
--- a/vendor/syn/tests/repo/mod.rs
+++ b/vendor/syn/tests/repo/mod.rs
@@ -5,15 +5,28 @@ mod progress;
use self::progress::Progress;
use anyhow::Result;
use flate2::read::GzDecoder;
+use rayon::iter::{IntoParallelRefIterator, ParallelIterator};
+use std::collections::BTreeSet;
+use std::ffi::OsStr;
use std::fs;
-use std::path::Path;
+use std::path::{Path, PathBuf};
use tar::Archive;
-use walkdir::DirEntry;
+use walkdir::{DirEntry, WalkDir};
-const REVISION: &str = "22f247c6f3ed388cb702d01c2ff27da658a8b353";
+const REVISION: &str = "5e1d3299a290026b85787bc9c7e72bcc53ac283f";
#[rustfmt::skip]
static EXCLUDE_FILES: &[&str] = &[
+ // TODO: non-lifetime binders: `where for<'a, T> &'a Struct<T>: Trait`
+ // https://github.com/dtolnay/syn/issues/1435
+ "tests/rustdoc-json/non_lifetime_binders.rs",
+ "tests/rustdoc/non_lifetime_binders.rs",
+
+ // TODO: return type notation: `where T: Trait<method(): Send>`
+ // https://github.com/dtolnay/syn/issues/1434
+ "tests/ui/associated-type-bounds/return-type-notation/basic.rs",
+ "tests/ui/feature-gates/feature-gate-return_type_notation.rs",
+
// Compile-fail expr parameter in const generic position: f::<1 + 2>()
"tests/ui/const-generics/early/closing-args-token.rs",
"tests/ui/const-generics/early/const-expression-parameter.rs",
@@ -188,6 +201,42 @@ static EXCLUDE_DIRS: &[&str] = &[
"src/tools/rust-analyzer/crates/syntax/test_data/reparse/fuzz-failures",
];
+// Directories in which a .stderr implies the corresponding .rs is not expected
+// to work.
+static UI_TEST_DIRS: &[&str] = &["tests/ui", "tests/rustdoc-ui"];
+
+pub fn for_each_rust_file(for_each: impl Fn(&Path) + Sync + Send) {
+ let mut rs_files = BTreeSet::new();
+
+ let repo_dir = Path::new("tests/rust");
+ for entry in WalkDir::new(repo_dir)
+ .into_iter()
+ .filter_entry(base_dir_filter)
+ {
+ let entry = entry.unwrap();
+ if !entry.file_type().is_dir() {
+ rs_files.insert(entry.into_path());
+ }
+ }
+
+ for ui_test_dir in UI_TEST_DIRS {
+ for entry in WalkDir::new(repo_dir.join(ui_test_dir)) {
+ let mut path = entry.unwrap().into_path();
+ if path.extension() == Some(OsStr::new("stderr")) {
+ loop {
+ rs_files.remove(&path.with_extension("rs"));
+ path = path.with_extension("");
+ if path.extension().is_none() {
+ break;
+ }
+ }
+ }
+ }
+ }
+
+ rs_files.par_iter().map(PathBuf::as_path).for_each(for_each);
+}
+
pub fn base_dir_filter(entry: &DirEntry) -> bool {
let path = entry.path();
@@ -207,18 +256,10 @@ pub fn base_dir_filter(entry: &DirEntry) -> bool {
return !EXCLUDE_DIRS.contains(&path_string);
}
- if path.extension().map_or(true, |e| e != "rs") {
+ if path.extension() != Some(OsStr::new("rs")) {
return false;
}
- if path_string.starts_with("tests/ui") || path_string.starts_with("tests/rustdoc-ui") {
- let stderr_path = path.with_extension("stderr");
- if stderr_path.exists() {
- // Expected to fail in some way
- return false;
- }
- }
-
!EXCLUDE_FILES.contains(&path_string)
}
diff --git a/vendor/syn/tests/test_precedence.rs b/vendor/syn/tests/test_precedence.rs
index e2931ff5a..b49577f0f 100644
--- a/vendor/syn/tests/test_precedence.rs
+++ b/vendor/syn/tests/test_precedence.rs
@@ -35,7 +35,6 @@ extern crate thin_vec;
use crate::common::eq::SpanlessEq;
use crate::common::parse;
use quote::quote;
-use rayon::iter::{IntoParallelIterator, ParallelIterator};
use regex::Regex;
use rustc_ast::ast;
use rustc_ast::ptr::P;
@@ -45,7 +44,6 @@ use std::fs;
use std::path::Path;
use std::process;
use std::sync::atomic::{AtomicUsize, Ordering};
-use walkdir::{DirEntry, WalkDir};
#[macro_use]
mod macros;
@@ -70,48 +68,36 @@ fn test_rustc_precedence() {
// 2018 edition is hard
let edition_regex = Regex::new(r"\b(async|try)[!(]").unwrap();
- WalkDir::new("tests/rust")
- .sort_by(|a, b| a.file_name().cmp(b.file_name()))
- .into_iter()
- .filter_entry(repo::base_dir_filter)
- .collect::<Result<Vec<DirEntry>, walkdir::Error>>()
- .unwrap()
- .into_par_iter()
- .for_each(|entry| {
- let path = entry.path();
- if path.is_dir() {
- return;
- }
+ repo::for_each_rust_file(|path| {
+ let content = fs::read_to_string(path).unwrap();
+ let content = edition_regex.replace_all(&content, "_$0");
- let content = fs::read_to_string(path).unwrap();
- let content = edition_regex.replace_all(&content, "_$0");
-
- let (l_passed, l_failed) = match syn::parse_file(&content) {
- Ok(file) => {
- let edition = repo::edition(path).parse().unwrap();
- let exprs = collect_exprs(file);
- let (l_passed, l_failed) = test_expressions(path, edition, exprs);
- errorf!(
- "=== {}: {} passed | {} failed\n",
- path.display(),
- l_passed,
- l_failed,
- );
- (l_passed, l_failed)
- }
- Err(msg) => {
- errorf!("\nFAIL {} - syn failed to parse: {}\n", path.display(), msg);
- (0, 1)
- }
- };
+ let (l_passed, l_failed) = match syn::parse_file(&content) {
+ Ok(file) => {
+ let edition = repo::edition(path).parse().unwrap();
+ let exprs = collect_exprs(file);
+ let (l_passed, l_failed) = test_expressions(path, edition, exprs);
+ errorf!(
+ "=== {}: {} passed | {} failed\n",
+ path.display(),
+ l_passed,
+ l_failed,
+ );
+ (l_passed, l_failed)
+ }
+ Err(msg) => {
+ errorf!("\nFAIL {} - syn failed to parse: {}\n", path.display(), msg);
+ (0, 1)
+ }
+ };
- passed.fetch_add(l_passed, Ordering::Relaxed);
- let prev_failed = failed.fetch_add(l_failed, Ordering::Relaxed);
+ passed.fetch_add(l_passed, Ordering::Relaxed);
+ let prev_failed = failed.fetch_add(l_failed, Ordering::Relaxed);
- if prev_failed + l_failed >= abort_after {
- process::exit(1);
- }
- });
+ if prev_failed + l_failed >= abort_after {
+ process::exit(1);
+ }
+ });
let passed = passed.load(Ordering::Relaxed);
let failed = failed.load(Ordering::Relaxed);
diff --git a/vendor/syn/tests/test_round_trip.rs b/vendor/syn/tests/test_round_trip.rs
index 853f45eae..0ef47b20f 100644
--- a/vendor/syn/tests/test_round_trip.rs
+++ b/vendor/syn/tests/test_round_trip.rs
@@ -22,7 +22,6 @@ extern crate rustc_span;
use crate::common::eq::SpanlessEq;
use quote::quote;
-use rayon::iter::{IntoParallelIterator, ParallelIterator};
use rustc_ast::ast::{
AngleBracketedArg, AngleBracketedArgs, Crate, GenericArg, GenericParamKind, Generics,
WhereClause,
@@ -40,7 +39,6 @@ use std::path::Path;
use std::process;
use std::sync::atomic::{AtomicUsize, Ordering};
use std::time::Instant;
-use walkdir::{DirEntry, WalkDir};
#[macro_use]
mod macros;
@@ -61,19 +59,7 @@ fn test_round_trip() {
let failed = AtomicUsize::new(0);
- WalkDir::new("tests/rust")
- .sort_by(|a, b| a.file_name().cmp(b.file_name()))
- .into_iter()
- .filter_entry(repo::base_dir_filter)
- .collect::<Result<Vec<DirEntry>, walkdir::Error>>()
- .unwrap()
- .into_par_iter()
- .for_each(|entry| {
- let path = entry.path();
- if !path.is_dir() {
- test(path, &failed, abort_after);
- }
- });
+ repo::for_each_rust_file(|path| test(path, &failed, abort_after));
let failed = failed.load(Ordering::Relaxed);
if failed > 0 {