diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-06-07 05:48:48 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-06-07 05:48:48 +0000 |
commit | ef24de24a82fe681581cc130f342363c47c0969a (patch) | |
tree | 0d494f7e1a38b95c92426f58fe6eaa877303a86c /vendor/syn | |
parent | Releasing progress-linux version 1.74.1+dfsg1-1~progress7.99u1. (diff) | |
download | rustc-ef24de24a82fe681581cc130f342363c47c0969a.tar.xz rustc-ef24de24a82fe681581cc130f342363c47c0969a.zip |
Merging upstream version 1.75.0+dfsg1.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'vendor/syn')
-rw-r--r-- | vendor/syn/.cargo-checksum.json | 2 | ||||
-rw-r--r-- | vendor/syn/Cargo.toml | 4 | ||||
-rw-r--r-- | vendor/syn/src/custom_punctuation.rs | 2 | ||||
-rw-r--r-- | vendor/syn/src/data.rs | 38 | ||||
-rw-r--r-- | vendor/syn/src/ident.rs | 10 | ||||
-rw-r--r-- | vendor/syn/src/item.rs | 253 | ||||
-rw-r--r-- | vendor/syn/src/lib.rs | 2 | ||||
-rw-r--r-- | vendor/syn/src/lifetime.rs | 10 | ||||
-rw-r--r-- | vendor/syn/src/lit.rs | 31 | ||||
-rw-r--r-- | vendor/syn/src/macros.rs | 17 | ||||
-rw-r--r-- | vendor/syn/src/path.rs | 13 | ||||
-rw-r--r-- | vendor/syn/src/token.rs | 63 | ||||
-rw-r--r-- | vendor/syn/tests/common/eq.rs | 9 | ||||
-rw-r--r-- | vendor/syn/tests/debug/gen.rs | 1 | ||||
-rw-r--r-- | vendor/syn/tests/repo/mod.rs | 29 | ||||
-rw-r--r-- | vendor/syn/tests/test_lit.rs | 16 | ||||
-rw-r--r-- | vendor/syn/tests/test_precedence.rs | 98 |
17 files changed, 436 insertions, 162 deletions
diff --git a/vendor/syn/.cargo-checksum.json b/vendor/syn/.cargo-checksum.json index 1504b1098..395cafc9d 100644 --- a/vendor/syn/.cargo-checksum.json +++ b/vendor/syn/.cargo-checksum.json @@ -1 +1 @@ -{"files":{"Cargo.toml":"1fe7cdf292faefe74cebc20883bc16e98f7b1a0324824582a7362c75c0516034","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":"f2704d15a337def453bdb337359fffdd014d62ae875cd6dbd442691c932f89c9","src/custom_punctuation.rs":"4227e8f9c6d78be776db0cf67d6cf836ee2ad39848984c11c1e44febc34ab375","src/data.rs":"7d217b0252a0d14b2db308ac00f48ba24a831e01a49b893f5b3ee6b580dab4cb","src/derive.rs":"3132e7f064725c7ca43f26daee93ec78037d46a935c6b0758af905cff450c15c","src/discouraged.rs":"482970b03bdee3cbc30c034f644e3293b25387db46300da5d8d8efd97dad8507","src/drops.rs":"013385f1dd95663f1afab41abc1e2eea04181998644828935ca564c74d6462ae","src/error.rs":"8dbb17978f688e12bcce58232f05c0ca9ed9de1fe511440793fb958da2fc93b9","src/export.rs":"6b519b1c17967cdd1519f52f981022435fcf940834fc8a705923426b65f21eac","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":"f5911e9cf2dc2dffab546590167c48de30409cb7708aa3307d22be143df720e4","src/ident.rs":"c26102f3dd66c85e05dbc9e41fb8c6ff3cf227e1ec84152b7ac920584a866578","src/item.rs":"68b2fbbf908460617dd7cf017478638ab6232a5bb2597868d67f1c809aea0232","src/lib.rs":"8c67ef153c56a2552c027256ad99407b7a6ae3a4dd43fda80ec9070780348da7","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":"08c8f4eaedeffaac73170b59921d140f63f4a01c243993dff050b4b848d0ac1f","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":"0a48e375e5c9768f6f64174a91ba6a255f4b021e2fb3548d8494e617f142601b","src/spanned.rs":"1bba75d73dd4dc5be6c4e11fdd72686d340fb25b5808830bd603ddc840beabdc","src/stmt.rs":"321d445f681c46ac30644504df2a8afc333a1dde0371159e9e077a17eed16548","src/thread.rs":"1f1deb1272525ab2af9a36aac4bce8f65b0e315adb1656641fd7075662f49222","src/token.rs":"94cca416e38225dc8e7ca5033a33f2edc216cb0680696ac81127351d3b2d7785","src/tt.rs":"32490509abcc4a5a3c7eb5628337172b3b49d30697d2f7b7df4d8045255c13da","src/ty.rs":"1d11c614298f25a8fa42165a01d6545fc699a446d7f3f8630162c7f478b26886","src/verbatim.rs":"87cbe82a90f48efb57ffd09141042698b3e011a21d0d5412154d80324b0a5ef0","src/whitespace.rs":"718a80c12cdd145358e2690f0f68ff7779a91ec17ce9fde9bb755f635fce69ad","tests/common/eq.rs":"add52aa28c339853660cea002b80aaf56f919757266c68873fb117a20ddd66f5","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":"c324c494eba9d92503e6f1ef2e6df781e78f6a7705a0202d9801b198807d518a"}
\ No newline at end of file +{"files":{"Cargo.toml":"f56cb0ef622eddc84e2f801e2123e0e3728847d581d8597a6d5707339162e96b","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":"f2704d15a337def453bdb337359fffdd014d62ae875cd6dbd442691c932f89c9","src/custom_punctuation.rs":"2e688f6a7c3c0405f209a6aaa85a43fc34807fc280e4a71235642fc9333492dd","src/data.rs":"09ce487d27f7dd79031b390c8344fc6361d64b05064ee25dba1489cf3aa56128","src/derive.rs":"3132e7f064725c7ca43f26daee93ec78037d46a935c6b0758af905cff450c15c","src/discouraged.rs":"482970b03bdee3cbc30c034f644e3293b25387db46300da5d8d8efd97dad8507","src/drops.rs":"013385f1dd95663f1afab41abc1e2eea04181998644828935ca564c74d6462ae","src/error.rs":"8dbb17978f688e12bcce58232f05c0ca9ed9de1fe511440793fb958da2fc93b9","src/export.rs":"6b519b1c17967cdd1519f52f981022435fcf940834fc8a705923426b65f21eac","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":"f5911e9cf2dc2dffab546590167c48de30409cb7708aa3307d22be143df720e4","src/ident.rs":"1b2d86d2e380b1fa83aee6ed113c47f0b482a229c25be428dac921deec0b4852","src/item.rs":"00ae729a00854f15203dbcbf2251910658eb052130de243144dcbec68be37919","src/lib.rs":"723c0555b398e4efd39c3198b4fc264b2bab6051e6f81ea3af81865784fdf4ec","src/lifetime.rs":"64abfd72af5dd271b2de1a8304ca0899b90da7750df9dec2ee8102bceb08a426","src/lit.rs":"3a70ebbc81563b967d2cbf589b6980a5b202ee3379d5d401e01a4c2af124d7ae","src/lookahead.rs":"376092f91a1c32e1b277db0a6790fdda151c9ec51bd971fe6a6545b5b9e73b5d","src/mac.rs":"b1cf73f34a27a8f1429125e726623a524fb5dce875eb68ead3beaffa976442c3","src/macros.rs":"64fce3fda990306cfae5f0409918946ff7c9e98ecad963932e6c1436c0b0d4c2","src/meta.rs":"9df61ebaa405ef743ba1629b39ee5e806f9ead77694a1027f192da860270c83d","src/op.rs":"fe5db7c3373b956234ea8a1a7d129a06e5aef5db77c44c1c2fedb4aaa667ac56","src/parse.rs":"e57637899f8533da26e16d41575c3489fd1bf3560cea427ba57b3c966d891d8e","src/parse_macro_input.rs":"4a753b2a6dbfefd6dc93852d66b4f6d73ebd6b8b9be74019fc476f429b9a892d","src/parse_quote.rs":"08c8f4eaedeffaac73170b59921d140f63f4a01c243993dff050b4b848d0ac1f","src/pat.rs":"4d99c5ed6a08e6adfd0f6c31438befd3f03e48982a36bb2544962d9db7805a4a","src/path.rs":"8079943ec924ad5338e4bfa16b15b8ea0d6d27092396b62667eadcd0b98f20db","src/print.rs":"22910bf0521ab868ebd7c62601c55912d12cfb400c65723e08e5cfa3a2d111c0","src/punctuated.rs":"dffaab15b9215c70d7db416e8d4c44b78c43ba2f255485e6211363f0f0fea063","src/restriction.rs":"62efbc127d7e7316dd1070c0e976872de6238b2602bba1fb35df18511b4e7199","src/sealed.rs":"6ece3b3dcb30f6bb98b93d83759ca7712ee8592bef9c0511141039c38765db0e","src/span.rs":"0a48e375e5c9768f6f64174a91ba6a255f4b021e2fb3548d8494e617f142601b","src/spanned.rs":"1bba75d73dd4dc5be6c4e11fdd72686d340fb25b5808830bd603ddc840beabdc","src/stmt.rs":"321d445f681c46ac30644504df2a8afc333a1dde0371159e9e077a17eed16548","src/thread.rs":"1f1deb1272525ab2af9a36aac4bce8f65b0e315adb1656641fd7075662f49222","src/token.rs":"42c9c9d8a7145255abf0cb1af1f2fe56a0b428a8a5ea8ff08e58f894fb519fd5","src/tt.rs":"32490509abcc4a5a3c7eb5628337172b3b49d30697d2f7b7df4d8045255c13da","src/ty.rs":"1d11c614298f25a8fa42165a01d6545fc699a446d7f3f8630162c7f478b26886","src/verbatim.rs":"87cbe82a90f48efb57ffd09141042698b3e011a21d0d5412154d80324b0a5ef0","src/whitespace.rs":"718a80c12cdd145358e2690f0f68ff7779a91ec17ce9fde9bb755f635fce69ad","tests/common/eq.rs":"e51d7f102ec29eef1336e0aad451378d0191845f9b1617744b79d47ff557e6df","tests/common/mod.rs":"432ad35577f836a20b517d8c26ed994ac25fe73ef2f461c67688b61b99762015","tests/common/parse.rs":"246ddf1d303a9dbbc380e8d0689bd851cef3c3146d09d2627175deb9203b003d","tests/debug/gen.rs":"bc638d0fcb4a007d658535b60eec09cf4dc2c4907062832cb94fe6960a0d7e01","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":"ca9ca1d192aa25ffcfc12161edf4998f4c4e3160f8834f8f7259023a28981e5c","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":"8e30c2d7837673a742d77aef01212788bbd099182dd5c1d10ee474cfeb786c39","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":"d3c34f2e5ffe22f7bdacff7ab6af71b24ba8150fdcc640f3c3e28db3491a556a","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":"e96b79aaa137db8f61e26363a0c9b47d8b4ec75da28b7d1d614c2303e232408b"}
\ No newline at end of file diff --git a/vendor/syn/Cargo.toml b/vendor/syn/Cargo.toml index 2ebc5974d..a0e56c526 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.29" +version = "2.0.38" authors = ["David Tolnay <dtolnay@gmail.com>"] include = [ "/benches/**", @@ -75,7 +75,7 @@ required-features = [ ] [dependencies.proc-macro2] -version = "1.0.62" +version = "1.0.67" default-features = false [dependencies.quote] diff --git a/vendor/syn/src/custom_punctuation.rs b/vendor/syn/src/custom_punctuation.rs index dba91c17f..062fe5169 100644 --- a/vendor/syn/src/custom_punctuation.rs +++ b/vendor/syn/src/custom_punctuation.rs @@ -114,7 +114,7 @@ macro_rules! custom_punctuation { macro_rules! impl_parse_for_custom_punctuation { ($ident:ident, $($tt:tt)+) => { impl $crate::token::CustomToken for $ident { - fn peek(cursor: $crate::buffer::Cursor) -> bool { + fn peek(cursor: $crate::buffer::Cursor) -> $crate::__private::bool { $crate::__private::peek_punct(cursor, $crate::stringify_punct!($($tt)+)) } diff --git a/vendor/syn/src/data.rs b/vendor/syn/src/data.rs index 185f88ba0..431c0857d 100644 --- a/vendor/syn/src/data.rs +++ b/vendor/syn/src/data.rs @@ -214,17 +214,37 @@ pub(crate) mod parsing { /// Parses a named (braced struct) field. #[cfg_attr(doc_cfg, doc(cfg(feature = "parsing")))] pub fn parse_named(input: ParseStream) -> Result<Self> { + let attrs = input.call(Attribute::parse_outer)?; + let vis: Visibility = input.parse()?; + + let unnamed_field = cfg!(feature = "full") && input.peek(Token![_]); + let ident = if unnamed_field { + input.call(Ident::parse_any) + } else { + input.parse() + }?; + + let colon_token: Token![:] = input.parse()?; + + let ty: Type = if unnamed_field + && (input.peek(Token![struct]) + || input.peek(Token![union]) && input.peek2(token::Brace)) + { + let begin = input.fork(); + input.call(Ident::parse_any)?; + input.parse::<FieldsNamed>()?; + Type::Verbatim(verbatim::between(&begin, input)) + } else { + input.parse()? + }; + Ok(Field { - attrs: input.call(Attribute::parse_outer)?, - vis: input.parse()?, + attrs, + vis, mutability: FieldMutability::None, - ident: Some(if input.peek(Token![_]) { - input.call(Ident::parse_any) - } else { - input.parse() - }?), - colon_token: Some(input.parse()?), - ty: input.parse()?, + ident: Some(ident), + colon_token: Some(colon_token), + ty, }) } diff --git a/vendor/syn/src/ident.rs b/vendor/syn/src/ident.rs index 41eb72129..d0f4ba08d 100644 --- a/vendor/syn/src/ident.rs +++ b/vendor/syn/src/ident.rs @@ -4,10 +4,12 @@ use crate::lookahead; pub use proc_macro2::Ident; #[cfg(feature = "parsing")] -#[doc(hidden)] -#[allow(non_snake_case)] -pub fn Ident(marker: lookahead::TokenMarker) -> Ident { - match marker {} +pub_if_not_doc! { + #[doc(hidden)] + #[allow(non_snake_case)] + pub fn Ident(marker: lookahead::TokenMarker) -> Ident { + match marker {} + } } macro_rules! ident_from_token { diff --git a/vendor/syn/src/item.rs b/vendor/syn/src/item.rs index 50d7e6ef6..ee91f5914 100644 --- a/vendor/syn/src/item.rs +++ b/vendor/syn/src/item.rs @@ -985,24 +985,35 @@ pub(crate) mod parsing { } else { return Err(lookahead.error()); }; + let mut generics: Generics = input.parse()?; let colon_token = input.parse()?; let ty = input.parse()?; - if input.peek(Token![;]) { - input.parse::<Token![;]>()?; - Ok(Item::Verbatim(verbatim::between(&begin, input))) + let value = if let Some(eq_token) = input.parse::<Option<Token![=]>>()? { + let expr: Expr = input.parse()?; + Some((eq_token, expr)) } 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()?, - })) + None + }; + generics.where_clause = input.parse()?; + let semi_token: Token![;] = input.parse()?; + match value { + Some((eq_token, expr)) + if generics.lt_token.is_none() && generics.where_clause.is_none() => + { + Ok(Item::Const(ItemConst { + attrs: Vec::new(), + vis, + const_token, + ident, + generics, + colon_token, + ty, + eq_token, + expr: Box::new(expr), + semi_token, + })) + } + _ => Ok(Item::Verbatim(verbatim::between(&begin, input))), } } else if lookahead.peek(Token![unsafe]) { ahead.parse::<Token![unsafe]>()?; @@ -1400,24 +1411,34 @@ pub(crate) mod parsing { #[cfg_attr(doc_cfg, doc(cfg(feature = "parsing")))] impl Parse for ItemConst { fn parse(input: ParseStream) -> Result<Self> { + let attrs = input.call(Attribute::parse_outer)?; + let vis: Visibility = 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: Token![:] = input.parse()?; + let ty: Type = input.parse()?; + let eq_token: Token![=] = input.parse()?; + let expr: Expr = input.parse()?; + let semi_token: Token![;] = input.parse()?; + Ok(ItemConst { - attrs: input.call(Attribute::parse_outer)?, - vis: input.parse()?, - const_token: input.parse()?, - ident: { - let lookahead = input.lookahead1(); - if lookahead.peek(Ident) || lookahead.peek(Token![_]) { - input.call(Ident::parse_any)? - } else { - return Err(lookahead.error()); - } - }, + attrs, + vis, + const_token, + ident, generics: Generics::default(), - colon_token: input.parse()?, - ty: input.parse()?, - eq_token: input.parse()?, - expr: input.parse()?, - semi_token: input.parse()?, + colon_token, + ty: Box::new(ty), + eq_token, + expr: Box::new(expr), + semi_token, }) } } @@ -2224,10 +2245,36 @@ pub(crate) mod parsing { let mut item = if lookahead.peek(Token![fn]) || peek_signature(&ahead) { input.parse().map(TraitItem::Fn) } else if lookahead.peek(Token![const]) { - ahead.parse::<Token![const]>()?; + let const_token: Token![const] = ahead.parse()?; let lookahead = ahead.lookahead1(); if lookahead.peek(Ident) || lookahead.peek(Token![_]) { - input.parse().map(TraitItem::Const) + input.advance_to(&ahead); + let ident = input.call(Ident::parse_any)?; + let mut generics: Generics = input.parse()?; + let colon_token: Token![:] = input.parse()?; + let ty: Type = input.parse()?; + let default = if let Some(eq_token) = input.parse::<Option<Token![=]>>()? { + let expr: Expr = input.parse()?; + Some((eq_token, expr)) + } else { + None + }; + generics.where_clause = input.parse()?; + let semi_token: Token![;] = input.parse()?; + if generics.lt_token.is_none() && generics.where_clause.is_none() { + Ok(TraitItem::Const(TraitItemConst { + attrs: Vec::new(), + const_token, + ident, + generics, + colon_token, + ty, + default, + semi_token, + })) + } else { + return Ok(TraitItem::Verbatim(verbatim::between(&begin, input))); + } } else if lookahead.peek(Token![async]) || lookahead.peek(Token![unsafe]) || lookahead.peek(Token![extern]) @@ -2273,30 +2320,36 @@ pub(crate) mod parsing { #[cfg_attr(doc_cfg, doc(cfg(feature = "parsing")))] impl Parse for TraitItemConst { fn parse(input: ParseStream) -> Result<Self> { + let attrs = input.call(Attribute::parse_outer)?; + 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: Token![:] = input.parse()?; + let ty: Type = input.parse()?; + let default = if input.peek(Token![=]) { + let eq_token: Token![=] = input.parse()?; + let default: Expr = input.parse()?; + Some((eq_token, default)) + } else { + None + }; + let semi_token: Token![;] = input.parse()?; + Ok(TraitItemConst { - attrs: input.call(Attribute::parse_outer)?, - const_token: input.parse()?, - ident: { - let lookahead = input.lookahead1(); - if lookahead.peek(Ident) || lookahead.peek(Token![_]) { - input.call(Ident::parse_any)? - } else { - return Err(lookahead.error()); - } - }, + attrs, + const_token, + ident, generics: Generics::default(), - colon_token: input.parse()?, - ty: input.parse()?, - default: { - if input.peek(Token![=]) { - let eq_token: Token![=] = input.parse()?; - let default: Expr = input.parse()?; - Some((eq_token, default)) - } else { - None - } - }, - semi_token: input.parse()?, + colon_token, + ty, + default, + semi_token, }) } } @@ -2550,26 +2603,37 @@ pub(crate) mod parsing { } else { return Err(lookahead.error()); }; + let mut generics: Generics = input.parse()?; 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()?, - })); + let value = if let Some(eq_token) = input.parse::<Option<Token![=]>>()? { + let expr: Expr = input.parse()?; + Some((eq_token, expr)) } else { - input.parse::<Token![;]>()?; - return Ok(ImplItem::Verbatim(verbatim::between(&begin, input))); - } + None + }; + generics.where_clause = input.parse()?; + let semi_token: Token![;] = input.parse()?; + return match value { + Some((eq_token, expr)) + if generics.lt_token.is_none() && generics.where_clause.is_none() => + { + Ok(ImplItem::Const(ImplItemConst { + attrs, + vis, + defaultness, + const_token, + ident, + generics, + colon_token, + ty, + eq_token, + expr, + semi_token, + })) + } + _ => Ok(ImplItem::Verbatim(verbatim::between(&begin, input))), + }; } else if lookahead.peek(Token![type]) { parse_impl_item_type(begin, input) } else if vis.is_inherited() @@ -2604,25 +2668,36 @@ pub(crate) mod parsing { #[cfg_attr(doc_cfg, doc(cfg(feature = "parsing")))] impl Parse for ImplItemConst { fn parse(input: ParseStream) -> Result<Self> { + let attrs = input.call(Attribute::parse_outer)?; + let vis: Visibility = input.parse()?; + let defaultness: Option<Token![default]> = 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: Token![:] = input.parse()?; + let ty: Type = input.parse()?; + let eq_token: Token![=] = input.parse()?; + let expr: Expr = input.parse()?; + let semi_token: Token![;] = input.parse()?; + Ok(ImplItemConst { - attrs: input.call(Attribute::parse_outer)?, - vis: input.parse()?, - defaultness: input.parse()?, - const_token: input.parse()?, - ident: { - let lookahead = input.lookahead1(); - if lookahead.peek(Ident) || lookahead.peek(Token![_]) { - input.call(Ident::parse_any)? - } else { - return Err(lookahead.error()); - } - }, + attrs, + vis, + defaultness, + const_token, + ident, generics: Generics::default(), - colon_token: input.parse()?, - ty: input.parse()?, - eq_token: input.parse()?, - expr: input.parse()?, - semi_token: input.parse()?, + colon_token, + ty, + eq_token, + expr, + semi_token, }) } } diff --git a/vendor/syn/src/lib.rs b/vendor/syn/src/lib.rs index 4adaa8587..a74d4b117 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.29")] +#![doc(html_root_url = "https://docs.rs/syn/2.0.38")] #![cfg_attr(doc_cfg, feature(doc_cfg))] #![allow(non_camel_case_types)] #![allow( diff --git a/vendor/syn/src/lifetime.rs b/vendor/syn/src/lifetime.rs index 96920ad05..29f4cfdb3 100644 --- a/vendor/syn/src/lifetime.rs +++ b/vendor/syn/src/lifetime.rs @@ -113,10 +113,12 @@ impl Hash for Lifetime { } #[cfg(feature = "parsing")] -#[doc(hidden)] -#[allow(non_snake_case)] -pub fn Lifetime(marker: lookahead::TokenMarker) -> Lifetime { - match marker {} +pub_if_not_doc! { + #[doc(hidden)] + #[allow(non_snake_case)] + pub fn Lifetime(marker: lookahead::TokenMarker) -> Lifetime { + match marker {} + } } #[cfg(feature = "parsing")] diff --git a/vendor/syn/src/lit.rs b/vendor/syn/src/lit.rs index 4f36cf50b..f7426ce81 100644 --- a/vendor/syn/src/lit.rs +++ b/vendor/syn/src/lit.rs @@ -758,10 +758,12 @@ macro_rules! lit_extra_traits { } #[cfg(feature = "parsing")] - #[doc(hidden)] - #[allow(non_snake_case)] - pub fn $ty(marker: lookahead::TokenMarker) -> $ty { - match marker {} + pub_if_not_doc! { + #[doc(hidden)] + #[allow(non_snake_case)] + pub fn $ty(marker: lookahead::TokenMarker) -> $ty { + match marker {} + } } }; } @@ -774,10 +776,12 @@ lit_extra_traits!(LitInt); lit_extra_traits!(LitFloat); #[cfg(feature = "parsing")] -#[doc(hidden)] -#[allow(non_snake_case)] -pub fn LitBool(marker: lookahead::TokenMarker) -> LitBool { - match marker {} +pub_if_not_doc! { + #[doc(hidden)] + #[allow(non_snake_case)] + pub fn LitBool(marker: lookahead::TokenMarker) -> LitBool { + match marker {} + } } ast_enum! { @@ -794,10 +798,12 @@ ast_enum! { } #[cfg(feature = "parsing")] -#[doc(hidden)] -#[allow(non_snake_case)] -pub fn Lit(marker: lookahead::TokenMarker) -> Lit { - match marker {} +pub_if_not_doc! { + #[doc(hidden)] + #[allow(non_snake_case)] + pub fn Lit(marker: lookahead::TokenMarker) -> Lit { + match marker {} + } } #[cfg(feature = "parsing")] @@ -1089,6 +1095,7 @@ mod value { // c"...", cr"...", cr#"..."# // TODO: add a Lit::CStr variant? b'c' => return Lit::Verbatim(token), + b'(' if repr == "(/*ERROR*/)" => return Lit::Verbatim(token), _ => {} } diff --git a/vendor/syn/src/macros.rs b/vendor/syn/src/macros.rs index 953841b6f..06ceb542d 100644 --- a/vendor/syn/src/macros.rs +++ b/vendor/syn/src/macros.rs @@ -166,3 +166,20 @@ macro_rules! check_keyword_matches { (enum enum) => {}; (pub pub) => {}; } + +// Rustdoc bug: does not respect the doc(hidden) on some items. +#[cfg(all(doc, feature = "parsing"))] +macro_rules! pub_if_not_doc { + ($(#[$m:meta])* pub $($item:tt)*) => { + $(#[$m])* + pub(crate) $($item)* + }; +} + +#[cfg(all(not(doc), feature = "parsing"))] +macro_rules! pub_if_not_doc { + ($(#[$m:meta])* pub $($item:tt)*) => { + $(#[$m])* + pub $($item)* + }; +} diff --git a/vendor/syn/src/path.rs b/vendor/syn/src/path.rs index 883f179f5..b9d96e669 100644 --- a/vendor/syn/src/path.rs +++ b/vendor/syn/src/path.rs @@ -82,6 +82,19 @@ impl Path { None } } + + /// An error if this path is not a single ident, as defined in `get_ident`. + #[cfg(feature = "parsing")] + #[cfg_attr(doc_cfg, doc(cfg(feature = "parsing")))] + pub fn require_ident(&self) -> Result<&Ident> { + self.get_ident().ok_or_else(|| { + crate::error::new2( + self.segments.first().unwrap().ident.span(), + self.segments.last().unwrap().ident.span(), + "expected this path to be an identifier", + ) + }) + } } ast_struct! { diff --git a/vendor/syn/src/token.rs b/vendor/syn/src/token.rs index c7e0e1f1a..af7f25c42 100644 --- a/vendor/syn/src/token.rs +++ b/vendor/syn/src/token.rs @@ -143,6 +143,7 @@ mod private { /// Support writing `token.span` rather than `token.spans[0]` on tokens that /// hold a single span. #[repr(transparent)] + #[allow(unknown_lints, repr_transparent_external_private_fields)] // False positive: https://github.com/rust-lang/rust/issues/78586#issuecomment-1722680482 pub struct WithSpan { pub span: Span, } @@ -365,6 +366,7 @@ macro_rules! define_punctuation_structs { ($($token:literal pub struct $name:ident/$len:tt #[doc = $usage:literal])*) => { $( #[cfg_attr(not(doc), repr(transparent))] + #[allow(unknown_lints, repr_transparent_external_private_fields)] // False positive: https://github.com/rust-lang/rust/issues/78586#issuecomment-1722680482 #[doc = concat!('`', $token, '`')] /// /// Usage: @@ -840,6 +842,67 @@ define_delimiters! { /// A type-macro that expands to the name of the Rust type representation of a /// given token. /// +/// As a type, `Token!` is commonly used in the type of struct fields, the type +/// of a `let` statement, or in turbofish for a `parse` function. +/// +/// ``` +/// use syn::{Ident, Token}; +/// use syn::parse::{Parse, ParseStream, Result}; +/// +/// // `struct Foo;` +/// pub struct UnitStruct { +/// struct_token: Token![struct], +/// ident: Ident, +/// semi_token: Token![;], +/// } +/// +/// impl Parse for UnitStruct { +/// fn parse(input: ParseStream) -> Result<Self> { +/// let struct_token: Token![struct] = input.parse()?; +/// let ident: Ident = input.parse()?; +/// let semi_token = input.parse::<Token![;]>()?; +/// Ok(UnitStruct { struct_token, ident, semi_token }) +/// } +/// } +/// ``` +/// +/// As an expression, `Token!` is used for peeking tokens or instantiating +/// tokens from a span. +/// +/// ``` +/// # use syn::{Ident, Token}; +/// # use syn::parse::{Parse, ParseStream, Result}; +/// # +/// # struct UnitStruct { +/// # struct_token: Token![struct], +/// # ident: Ident, +/// # semi_token: Token![;], +/// # } +/// # +/// # impl Parse for UnitStruct { +/// # fn parse(input: ParseStream) -> Result<Self> { +/// # unimplemented!() +/// # } +/// # } +/// # +/// fn make_unit_struct(name: Ident) -> UnitStruct { +/// let span = name.span(); +/// UnitStruct { +/// struct_token: Token![struct](span), +/// ident: name, +/// semi_token: Token![;](span), +/// } +/// } +/// +/// # fn parse(input: ParseStream) -> Result<()> { +/// if input.peek(Token![struct]) { +/// let unit_struct: UnitStruct = input.parse()?; +/// /* ... */ +/// } +/// # Ok(()) +/// # } +/// ``` +/// /// See the [token module] documentation for details and examples. /// /// [token module]: crate::token diff --git a/vendor/syn/tests/common/eq.rs b/vendor/syn/tests/common/eq.rs index 68fd1949e..3c2b1c124 100644 --- a/vendor/syn/tests/common/eq.rs +++ b/vendor/syn/tests/common/eq.rs @@ -156,7 +156,7 @@ use rustc_ast::tokenstream::{ use rustc_data_structures::sync::Lrc; use rustc_span::source_map::Spanned; use rustc_span::symbol::{sym, Ident}; -use rustc_span::{Span, Symbol, SyntaxContext, DUMMY_SP}; +use rustc_span::{ErrorGuaranteed, Span, Symbol, SyntaxContext, DUMMY_SP}; use std::collections::HashMap; use std::hash::{BuildHasher, Hash}; use thin_vec::ThinVec; @@ -296,6 +296,7 @@ spanless_eq_partial_eq!(CommentKind); spanless_eq_partial_eq!(Delimiter); spanless_eq_partial_eq!(InlineAsmOptions); spanless_eq_partial_eq!(token::LitKind); +spanless_eq_partial_eq!(ErrorGuaranteed); macro_rules! spanless_eq_struct { { @@ -579,7 +580,7 @@ spanless_eq_enum!(VariantData; Struct(0 1) Tuple(0 1) Unit(0)); spanless_eq_enum!(VisibilityKind; Public Restricted(path id shorthand) Inherited); spanless_eq_enum!(WherePredicate; BoundPredicate(0) RegionPredicate(0) EqPredicate(0)); 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) + Tup(0) Binary(0 1 2) Unary(0 1) Lit(0) Cast(0 1) Type(0 1) Let(0 1 2 3) 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) Await(0 1) TryBlock(0) Assign(0 1 2) AssignOp(0 1 2) Field(0 1) Index(0 1 2) Underscore Range(0 1 2) Path(0 1) AddrOf(0 1 2) @@ -598,8 +599,8 @@ spanless_eq_enum!(PatKind; Wild Ident(0 1 2) Struct(0 1 2 3) TupleStruct(0 1 2) Or(0) Path(0 1) Tuple(0) Box(0) Ref(0 1) Lit(0) Range(0 1 2) Slice(0) Rest Paren(0) MacCall(0)); spanless_eq_enum!(TyKind; Slice(0) Array(0 1) Ptr(0) Ref(0 1) BareFn(0) Never - Tup(0) Path(0 1) TraitObject(0 1) ImplTrait(0 1) Paren(0) Typeof(0) Infer - ImplicitSelf MacCall(0) Err CVarArgs); + Tup(0) AnonStruct(0) AnonUnion(0) Path(0 1) TraitObject(0 1) ImplTrait(0 1) + Paren(0) Typeof(0) Infer ImplicitSelf MacCall(0) Err CVarArgs); impl SpanlessEq for Ident { fn eq(&self, other: &Self) -> bool { diff --git a/vendor/syn/tests/debug/gen.rs b/vendor/syn/tests/debug/gen.rs index b64cc3e7e..3f92598d7 100644 --- a/vendor/syn/tests/debug/gen.rs +++ b/vendor/syn/tests/debug/gen.rs @@ -1,6 +1,7 @@ // This file is @generated by syn-internal-codegen. // It is not intended for manual editing. +#![allow(repr_transparent_external_private_fields)] #![allow(clippy::match_wildcard_for_single_variants)] use super::{Lite, Present}; use ref_cast::RefCast; diff --git a/vendor/syn/tests/repo/mod.rs b/vendor/syn/tests/repo/mod.rs index 780ad823b..61d5ff35f 100644 --- a/vendor/syn/tests/repo/mod.rs +++ b/vendor/syn/tests/repo/mod.rs @@ -13,15 +13,16 @@ use std::path::{Path, PathBuf}; use tar::Archive; use walkdir::{DirEntry, WalkDir}; -const REVISION: &str = "85bf07972a1041b9e25393b803d0e006bec3eaaf"; +const REVISION: &str = "9f5fc1bd443f59583e7af0d94d289f95fe1e20c4"; #[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", + // TODO: CStr literals: c"…", cr"…" + // https://github.com/dtolnay/syn/issues/1502 "src/tools/rust-analyzer/crates/parser/test_data/parser/inline/ok/0085_expr_literals.rs", + + // TODO: explicit tail calls: `become _g()` + // https://github.com/dtolnay/syn/issues/1501 "tests/ui/explicit-tail-calls/return-lifetime-sub.rs", // TODO: non-lifetime binders: `where for<'a, T> &'a Struct<T>: Trait` @@ -115,7 +116,6 @@ static EXCLUDE_FILES: &[&str] = &[ // Various extensions to Rust syntax made up by rust-analyzer "src/tools/rust-analyzer/crates/parser/test_data/parser/inline/ok/0012_type_item_where_clause.rs", - "src/tools/rust-analyzer/crates/parser/test_data/parser/inline/ok/0040_crate_keyword_vis.rs", "src/tools/rust-analyzer/crates/parser/test_data/parser/inline/ok/0058_range_pat.rs", "src/tools/rust-analyzer/crates/parser/test_data/parser/inline/ok/0123_param_list_vararg.rs", "src/tools/rust-analyzer/crates/parser/test_data/parser/inline/ok/0131_existential_type.rs", @@ -288,21 +288,38 @@ pub fn clone_rust() { if needs_clone { download_and_unpack().unwrap(); } + let mut missing = String::new(); let test_src = Path::new("tests/rust"); + + let mut exclude_files_set = BTreeSet::new(); for exclude in EXCLUDE_FILES { + if !exclude_files_set.insert(exclude) { + panic!("duplicate path in EXCLUDE_FILES: {}", exclude); + } + for dir in EXCLUDE_DIRS { + if Path::new(exclude).starts_with(dir) { + panic!("excluded file {} is inside an excluded dir", exclude); + } + } if !test_src.join(exclude).is_file() { missing += "\ntests/rust/"; missing += exclude; } } + + let mut exclude_dirs_set = BTreeSet::new(); for exclude in EXCLUDE_DIRS { + if !exclude_dirs_set.insert(exclude) { + panic!("duplicate path in EXCLUDE_DIRS: {}", exclude); + } if !test_src.join(exclude).is_dir() { missing += "\ntests/rust/"; missing += exclude; missing += "/"; } } + if !missing.is_empty() { panic!("excluded test file does not exist:{}\n", missing); } diff --git a/vendor/syn/tests/test_lit.rs b/vendor/syn/tests/test_lit.rs index 82d229001..bc50136f6 100644 --- a/vendor/syn/tests/test_lit.rs +++ b/vendor/syn/tests/test_lit.rs @@ -1,6 +1,7 @@ #![allow( clippy::float_cmp, clippy::non_ascii_literal, + clippy::single_match_else, clippy::uninlined_format_args )] @@ -13,14 +14,13 @@ use std::str::FromStr; use syn::{Lit, LitFloat, LitInt, LitStr}; fn lit(s: &str) -> Lit { - match TokenStream::from_str(s) - .unwrap() - .into_iter() - .next() - .unwrap() - { - TokenTree::Literal(lit) => Lit::new(lit), - _ => panic!(), + let mut tokens = TokenStream::from_str(s).unwrap().into_iter(); + match tokens.next().unwrap() { + TokenTree::Literal(lit) => { + assert!(tokens.next().is_none()); + Lit::new(lit) + } + wrong => panic!("{:?}", wrong), } } diff --git a/vendor/syn/tests/test_precedence.rs b/vendor/syn/tests/test_precedence.rs index b49577f0f..bf0510bb3 100644 --- a/vendor/syn/tests/test_precedence.rs +++ b/vendor/syn/tests/test_precedence.rs @@ -30,6 +30,7 @@ extern crate rustc_ast_pretty; extern crate rustc_data_structures; extern crate rustc_driver; extern crate rustc_span; +extern crate smallvec; extern crate thin_vec; use crate::common::eq::SpanlessEq; @@ -168,15 +169,17 @@ fn librustc_parse_and_rewrite(input: &str) -> Option<P<ast::Expr>> { /// This method operates on librustc objects. fn librustc_brackets(mut librustc_expr: P<ast::Expr>) -> Option<P<ast::Expr>> { use rustc_ast::ast::{ - Attribute, BinOpKind, Block, BorrowKind, Expr, ExprField, ExprKind, GenericArg, - GenericBound, Local, LocalKind, Pat, Stmt, StmtKind, StructExpr, StructRest, - TraitBoundModifier, Ty, + AssocItem, AssocItemKind, Attribute, BinOpKind, Block, BorrowKind, Expr, ExprField, + ExprKind, GenericArg, GenericBound, ItemKind, Local, LocalKind, Pat, Stmt, StmtKind, + StructExpr, StructRest, TraitBoundModifier, Ty, }; use rustc_ast::mut_visit::{ - noop_visit_generic_arg, noop_visit_local, noop_visit_param_bound, MutVisitor, + noop_flat_map_assoc_item, noop_visit_generic_arg, noop_visit_item_kind, noop_visit_local, + noop_visit_param_bound, MutVisitor, }; use rustc_data_structures::flat_map_in_place::FlatMapInPlace; use rustc_span::DUMMY_SP; + use smallvec::SmallVec; use std::mem; use std::ops::DerefMut; use thin_vec::ThinVec; @@ -185,6 +188,17 @@ fn librustc_brackets(mut librustc_expr: P<ast::Expr>) -> Option<P<ast::Expr>> { failed: bool, } + fn contains_let_chain(expr: &Expr) -> bool { + match &expr.kind { + ExprKind::Let(..) => true, + ExprKind::Binary(binop, left, right) => { + binop.node == BinOpKind::And + && (contains_let_chain(left) || contains_let_chain(right)) + } + _ => false, + } + } + fn flat_map_field<T: MutVisitor>(mut f: ExprField, vis: &mut T) -> Vec<ExprField> { if f.is_shorthand { noop_visit_expr(&mut f.expr, vis); @@ -241,12 +255,7 @@ fn librustc_brackets(mut librustc_expr: P<ast::Expr>) -> Option<P<ast::Expr>> { noop_visit_expr(e, self); match e.kind { ExprKind::Block(..) | ExprKind::If(..) | ExprKind::Let(..) => {} - ExprKind::Binary(binop, ref left, ref right) - if match (&left.kind, binop.node, &right.kind) { - (ExprKind::Let(..), BinOpKind::And, _) - | (_, BinOpKind::And, ExprKind::Let(..)) => true, - _ => false, - } => {} + ExprKind::Binary(..) if contains_let_chain(e) => {} _ => { let inner = mem::replace( e, @@ -300,6 +309,39 @@ fn librustc_brackets(mut librustc_expr: P<ast::Expr>) -> Option<P<ast::Expr>> { } } + fn visit_item_kind(&mut self, item: &mut ItemKind) { + match item { + ItemKind::Const(const_item) + if !const_item.generics.params.is_empty() + || !const_item.generics.where_clause.predicates.is_empty() => {} + _ => noop_visit_item_kind(item, self), + } + } + + fn flat_map_trait_item(&mut self, item: P<AssocItem>) -> SmallVec<[P<AssocItem>; 1]> { + match &item.kind { + AssocItemKind::Const(const_item) + if !const_item.generics.params.is_empty() + || !const_item.generics.where_clause.predicates.is_empty() => + { + SmallVec::from([item]) + } + _ => noop_flat_map_assoc_item(item, self), + } + } + + fn flat_map_impl_item(&mut self, item: P<AssocItem>) -> SmallVec<[P<AssocItem>; 1]> { + match &item.kind { + AssocItemKind::Const(const_item) + if !const_item.generics.params.is_empty() + || !const_item.generics.where_clause.predicates.is_empty() => + { + SmallVec::from([item]) + } + _ => noop_flat_map_assoc_item(item, self), + } + } + // We don't want to look at expressions that might appear in patterns or // types yet. We'll look into comparing those in the future. For now // focus on expressions appearing in other places. @@ -334,28 +376,42 @@ fn syn_brackets(syn_expr: syn::Expr) -> syn::Expr { struct ParenthesizeEveryExpr; + fn parenthesize(expr: Expr) -> Expr { + Expr::Paren(ExprParen { + attrs: Vec::new(), + expr: Box::new(expr), + paren_token: token::Paren::default(), + }) + } + fn needs_paren(expr: &Expr) -> bool { match expr { Expr::Group(_) => unreachable!(), Expr::If(_) | Expr::Unsafe(_) | Expr::Block(_) | Expr::Let(_) => false, - Expr::Binary(bin) => match (&*bin.left, bin.op, &*bin.right) { - (Expr::Let(_), BinOp::And(_), _) | (_, BinOp::And(_), Expr::Let(_)) => false, - _ => true, - }, + Expr::Binary(_) => !contains_let_chain(expr), _ => true, } } + fn contains_let_chain(expr: &Expr) -> bool { + match expr { + Expr::Let(_) => true, + Expr::Binary(expr) => { + matches!(expr.op, BinOp::And(_)) + && (contains_let_chain(&expr.left) || contains_let_chain(&expr.right)) + } + _ => false, + } + } + impl Fold for ParenthesizeEveryExpr { fn fold_expr(&mut self, expr: Expr) -> Expr { - if needs_paren(&expr) { - Expr::Paren(ExprParen { - attrs: Vec::new(), - expr: Box::new(fold_expr(self, expr)), - paren_token: token::Paren::default(), - }) + let needs_paren = needs_paren(&expr); + let folded = fold_expr(self, expr); + if needs_paren { + parenthesize(folded) } else { - fold_expr(self, expr) + folded } } |