From 3183b44a1ec209b06e0c26cbc92217176b59dc76 Mon Sep 17 00:00:00 2001 From: bjorn3 <17426603+bjorn3@users.noreply.github.com> Date: Sat, 8 Feb 2025 22:07:11 +0000 Subject: [PATCH 1/2] Update bootstrap compiler and rustfmt The rustfmt version we previously used formats things differently from what the latest nightly rustfmt does. This causes issues for subtrees that get formatted both in-tree and in their own repo. Updating the rustfmt used in-tree solves those issues. Also bumped the bootstrap compiler as the stage0 update command always updates both at the same time. --- src/stage0 | 924 +++++++++++++++--------------- src/tools/bump-stage0/src/main.rs | 2 +- 2 files changed, 463 insertions(+), 463 deletions(-) diff --git a/src/stage0 b/src/stage0 index bd9a753c21153..5c3e3a7cebcc7 100644 --- a/src/stage0 +++ b/src/stage0 @@ -14,468 +14,468 @@ nightly_branch=master # All changes below this comment will be overridden the next time the # tool is executed. -compiler_date=2025-01-08 +compiler_date=2025-02-08 compiler_version=beta -rustfmt_date=2025-01-08 +rustfmt_date=2025-02-08 rustfmt_version=nightly -dist/2025-01-08/rustc-beta-aarch64-apple-darwin.tar.gz=8869795c998e9d39a7093bf53917291b066e35964059298cb1cc2ee2f1088b2e -dist/2025-01-08/rustc-beta-aarch64-apple-darwin.tar.xz=1397b1ee764dd51d8a082a063b6b13a2d5609b1e1a6e1dbbc0368f24e7830e85 -dist/2025-01-08/rustc-beta-aarch64-pc-windows-msvc.tar.gz=68719c1f92c6aa4251c27910c9f788472166444a9295cfa0af6450bc6b5e6555 -dist/2025-01-08/rustc-beta-aarch64-pc-windows-msvc.tar.xz=56fca9013ab1646263f043898346dfe206f4b264c37d1cf39fc61807e47c072d -dist/2025-01-08/rustc-beta-aarch64-unknown-linux-gnu.tar.gz=7acc2b71f759f098c542f0ff4f3705e73112dfb3b8e85bb9158d1ce10d858efe -dist/2025-01-08/rustc-beta-aarch64-unknown-linux-gnu.tar.xz=0d21e19b284d2053879ee55353f0d601e3b359530cfb9c747f6cc4ad9b67ade9 -dist/2025-01-08/rustc-beta-aarch64-unknown-linux-musl.tar.gz=25a5b2cf16fb51056c208e5899c9843bc3a902ae2f4148ac53f0b9043727e321 -dist/2025-01-08/rustc-beta-aarch64-unknown-linux-musl.tar.xz=31b1dead28d88897fcb2ccdaf72021faba9febe50d797e70ff5c29ae82179618 -dist/2025-01-08/rustc-beta-arm-unknown-linux-gnueabi.tar.gz=fa8d3c93890425c9a0d130a652d3a4ecd018cb3098efe243a3ce8422539cb9ce -dist/2025-01-08/rustc-beta-arm-unknown-linux-gnueabi.tar.xz=15344286d365042d9bd8cced1268eed508aaa6152d5e3e289fbd5ebc87788e75 -dist/2025-01-08/rustc-beta-arm-unknown-linux-gnueabihf.tar.gz=c5ed0dd8c2a3b609d9fdd88b027a1d628517107af8b5488a74bce9a3a4dbebcb -dist/2025-01-08/rustc-beta-arm-unknown-linux-gnueabihf.tar.xz=ff5eb5bc42dcfedaae86bf31af37c6c2bdb6210e98cbdd780c4e1a63ba37eaeb -dist/2025-01-08/rustc-beta-armv7-unknown-linux-gnueabihf.tar.gz=6108711c53f07920a9afd0e749ff4228396220ec2eeacab2310e5b32af7a5e91 -dist/2025-01-08/rustc-beta-armv7-unknown-linux-gnueabihf.tar.xz=7bd41663ab83aa4bef55f3c44e4e4cd3c4291c967573cf8b2ba3d60eda9d06f7 -dist/2025-01-08/rustc-beta-i686-pc-windows-gnu.tar.gz=12ba512d2dece4f9be9ac08f3270bfa6663aa28a3443f1cbd7f852ab052f12ab -dist/2025-01-08/rustc-beta-i686-pc-windows-gnu.tar.xz=834cd8f4962401dc522a5a0ac866561a62c646614a6ce4b99e91619098538861 -dist/2025-01-08/rustc-beta-i686-pc-windows-msvc.tar.gz=9915fde0d52fcc41eb5f5eb19c06be447187aaf3e5b4f438f7c20d92b364527e -dist/2025-01-08/rustc-beta-i686-pc-windows-msvc.tar.xz=e4e79679d6f90b5de5c64a534ff150416e48aed276d7426a1d4b1fc2e517cefe -dist/2025-01-08/rustc-beta-i686-unknown-linux-gnu.tar.gz=e394e8f0361f0f8a8a9653cab3ade57de10622651675e27c137cef2b06114a6d -dist/2025-01-08/rustc-beta-i686-unknown-linux-gnu.tar.xz=756965d724f5389a3cb63374b4287ea48e18d38827ac3af61a127fc6561ab865 -dist/2025-01-08/rustc-beta-loongarch64-unknown-linux-gnu.tar.gz=4e3483a31356c4c7c0a7041d318b36e02bcd25ac25c396e4dd139ff4ecad5af5 -dist/2025-01-08/rustc-beta-loongarch64-unknown-linux-gnu.tar.xz=9fcc0531f285832f5333762317ff64dd2506bc263e447f1931d361b15430d0f8 -dist/2025-01-08/rustc-beta-loongarch64-unknown-linux-musl.tar.gz=780ab392bd8d879efc593ec9f87c1ff927e750fea4fdaae23d327fc363f8078f -dist/2025-01-08/rustc-beta-loongarch64-unknown-linux-musl.tar.xz=bfad2585877df4fc99fe708187336631140a8170d21159a6deb7cd8f8ed20248 -dist/2025-01-08/rustc-beta-powerpc-unknown-linux-gnu.tar.gz=30659e0526394f50ada52ce228cbe342e7ad9f6db2f0e1dfe6c8c63eb7ec3dd4 -dist/2025-01-08/rustc-beta-powerpc-unknown-linux-gnu.tar.xz=e59cbdad42098b5f402f612c957113e7f7b8f4b4f37292079187f44d1753360e -dist/2025-01-08/rustc-beta-powerpc64-unknown-linux-gnu.tar.gz=adc19d38f3927cd2c09e2b4bc5e31b1b2473d45027b839abab1837ef22b6cb31 -dist/2025-01-08/rustc-beta-powerpc64-unknown-linux-gnu.tar.xz=35b15e40ea3b382d67e98dabbb93916abecb7d18977652760e081c1a112300d5 -dist/2025-01-08/rustc-beta-powerpc64le-unknown-linux-gnu.tar.gz=31477a7164f8b3658bdf192bcb1383bb77f93e684887fc7b06e55bb469e7e25a -dist/2025-01-08/rustc-beta-powerpc64le-unknown-linux-gnu.tar.xz=67f4e6f541e16eafa55e803e2c41fef1c892e7408f61228bdaabfb3a4cb41ade -dist/2025-01-08/rustc-beta-powerpc64le-unknown-linux-musl.tar.gz=2f4b8b12fc8bd7bd5783cc77e9b798de3ecd4a17f5a09d6fd4f3a528e1a243a5 -dist/2025-01-08/rustc-beta-powerpc64le-unknown-linux-musl.tar.xz=474f1a2b2f3a2379da02ba24c59a160a7ab0a2bdb4290b0b277d8aea8e441a53 -dist/2025-01-08/rustc-beta-riscv64gc-unknown-linux-gnu.tar.gz=6be8f141e0a3f00abade77cde91405ac107d729f24b946c89831baa674c210d9 -dist/2025-01-08/rustc-beta-riscv64gc-unknown-linux-gnu.tar.xz=897be1e29a2b67a9dc2d69195ec1f41439903dd3ad8a7b57eb339344ca6ec5da -dist/2025-01-08/rustc-beta-s390x-unknown-linux-gnu.tar.gz=b58ebbaeb5474f577329f4d48991222621d4f30f6411a00973951917586e2cf6 -dist/2025-01-08/rustc-beta-s390x-unknown-linux-gnu.tar.xz=215384ed943e173fcb4e10baa69d6929c99e8eeb4790365f1067bf20d5417b32 -dist/2025-01-08/rustc-beta-x86_64-apple-darwin.tar.gz=40a3d42489eb77cc7912af5580632f8f6f27373b0f691d24b7d249ca9bc84a41 -dist/2025-01-08/rustc-beta-x86_64-apple-darwin.tar.xz=6f8c83b96ba2d9bdb623af0f09b6227532d8c0c0f6ac19fb4b0c5f5145d2ee9c -dist/2025-01-08/rustc-beta-x86_64-pc-windows-gnu.tar.gz=1f76fb03cca2d0fe466c995467f209c28a68d8ad69e7b2fce521f4ace94106f8 -dist/2025-01-08/rustc-beta-x86_64-pc-windows-gnu.tar.xz=5bed9303cb18b7c5d78875b11463b945c9c9583c5b377efb69462bda0f92b190 -dist/2025-01-08/rustc-beta-x86_64-pc-windows-msvc.tar.gz=a64fedbd98a9d2e8ca6d21018abf627367e2c81a028d38fb850253a6c94ef45b -dist/2025-01-08/rustc-beta-x86_64-pc-windows-msvc.tar.xz=471c040fe9f119e3ddf74fb8887d03cecc415109577a85c14917c00ab3348d0c -dist/2025-01-08/rustc-beta-x86_64-unknown-freebsd.tar.gz=468f89e4f6b7e72cfeeb19eeb723e723673487f3d1cf333d860623bf454e4ff9 -dist/2025-01-08/rustc-beta-x86_64-unknown-freebsd.tar.xz=c9e699c5fdbf0af0434354caf8745796db42a931669e733b3a7432baabf81974 -dist/2025-01-08/rustc-beta-x86_64-unknown-illumos.tar.gz=e0dbd7d05f74a1d444efb849700f98bbe6b00f870036e5cf6f065fc2d0b982b7 -dist/2025-01-08/rustc-beta-x86_64-unknown-illumos.tar.xz=1936046fd441ed9bf8331f77ac9ba930640523ded0674831912d28f9f7ae90c1 -dist/2025-01-08/rustc-beta-x86_64-unknown-linux-gnu.tar.gz=c6dbeb9017e7f9694ddb05c4658250945e1d6c2b6de656306a3686d499653029 -dist/2025-01-08/rustc-beta-x86_64-unknown-linux-gnu.tar.xz=adec507e847d746ef1bdb0464b23ef7fd840d17e7bff787a198fae239b69a77d -dist/2025-01-08/rustc-beta-x86_64-unknown-linux-musl.tar.gz=32714ed814213cc64fb1721c919c43a877286f625289bf5d526e247de0941e05 -dist/2025-01-08/rustc-beta-x86_64-unknown-linux-musl.tar.xz=fdebe84ac7370ca3cfa66cff6974c00e506aab6fb3ecb6b70e8e2c3ef92025f3 -dist/2025-01-08/rustc-beta-x86_64-unknown-netbsd.tar.gz=6443e8f6c2cd4d5f4a0b7f38e1c741061f42c454d006afc06ab87968425a8f44 -dist/2025-01-08/rustc-beta-x86_64-unknown-netbsd.tar.xz=c12851a0437c7ba6edf08d9ec89f2ccd22f05a5de661664142bf4f15d2a658a2 -dist/2025-01-08/rust-std-beta-aarch64-apple-darwin.tar.gz=e88734bd578a36ca396032144b25717e18ff51c519ff9490b193117516b299be -dist/2025-01-08/rust-std-beta-aarch64-apple-darwin.tar.xz=60f5672d8759ccf632e072cce922dd9d079a8e2325098b278afc4fa829943a2f -dist/2025-01-08/rust-std-beta-aarch64-apple-ios.tar.gz=bfd63a92d85035bdd4b4d445427c68483a34b41f647b09390de2ac9342ad6b54 -dist/2025-01-08/rust-std-beta-aarch64-apple-ios.tar.xz=9e9b941612bb29e317e4dd10ced4cdaec502526fa964b3aa29cd4fc2af070451 -dist/2025-01-08/rust-std-beta-aarch64-apple-ios-macabi.tar.gz=2dc9ed6bbb9fd1d576bc78321a78f7997928a6a94625d90a613286e1a5bec758 -dist/2025-01-08/rust-std-beta-aarch64-apple-ios-macabi.tar.xz=ecb686e8f201952f1e3475a88de73eb264a11c74961967bd1ba7eee87a248bfb -dist/2025-01-08/rust-std-beta-aarch64-apple-ios-sim.tar.gz=b481a6f88b8696b86160541083e608ef811f1ec0d9b1455325fd48efdaca6f01 -dist/2025-01-08/rust-std-beta-aarch64-apple-ios-sim.tar.xz=584d7a1cd7be4af3c747269de3466a312e541dfa17b1614ad355b32b74ea1ad8 -dist/2025-01-08/rust-std-beta-aarch64-linux-android.tar.gz=c91990c99c5687216320bb82e9e2f8f7b2242fafd534cbb0ae88a287880c2dab -dist/2025-01-08/rust-std-beta-aarch64-linux-android.tar.xz=c3a4a168393d0a8222b8ebdb6b5495a8896788156af4c454e35d349d1ab63109 -dist/2025-01-08/rust-std-beta-aarch64-pc-windows-gnullvm.tar.gz=5a7c5b256b41a9ee01387da8ffaa49a3914737c827113beba081f34671568e84 -dist/2025-01-08/rust-std-beta-aarch64-pc-windows-gnullvm.tar.xz=d0343608f884db1579847539eb6346ad3cb7b85072bf698598db61dee720793d -dist/2025-01-08/rust-std-beta-aarch64-pc-windows-msvc.tar.gz=6cf78705518f865a7c6d3c9c4566b0dca6197338d5d88dc0037c721261e5dc3c -dist/2025-01-08/rust-std-beta-aarch64-pc-windows-msvc.tar.xz=c8c81ffc20538dea3050a7b7ba89cab620423e66a10931befba354e2c4572ea1 -dist/2025-01-08/rust-std-beta-aarch64-unknown-fuchsia.tar.gz=966f512ab3d23e303f7162d03bc619aff54b0af25bab86bedc0c96e130c89545 -dist/2025-01-08/rust-std-beta-aarch64-unknown-fuchsia.tar.xz=fba9f964d8fb51753435c300319870a3b4530e385887a16d31975597cfde3ca7 -dist/2025-01-08/rust-std-beta-aarch64-unknown-linux-gnu.tar.gz=997d422eedd7b6adfd175ef6a13b5ae7a83530d633f834e7ca0d94851ed29ed6 -dist/2025-01-08/rust-std-beta-aarch64-unknown-linux-gnu.tar.xz=5ff49e69e9b549494542c9306c1fc82f6221b8d9e9fe25ec5021fe46f7c8cb28 -dist/2025-01-08/rust-std-beta-aarch64-unknown-linux-musl.tar.gz=2181081deaa27438f420df53847b8108f96ad215369cae81947f0688b1906cc2 -dist/2025-01-08/rust-std-beta-aarch64-unknown-linux-musl.tar.xz=f8b28aeeae9973c1dddbea684eec9a6a136fda3f850b4ffaa10e53914e1037e0 -dist/2025-01-08/rust-std-beta-aarch64-unknown-linux-ohos.tar.gz=a49eeccef00269063a10b1e623a54b0b500afbc2dd8e1db4ff8ae4a6844de943 -dist/2025-01-08/rust-std-beta-aarch64-unknown-linux-ohos.tar.xz=32fa668c9d3d703adbf6910ef358dbcab344d37fd3ce4e81ba43a820d8a8792e -dist/2025-01-08/rust-std-beta-aarch64-unknown-none.tar.gz=95c6a6a65ede296e8b4183a1271dd6cb1c61299f3966a8e2a6180867752a2988 -dist/2025-01-08/rust-std-beta-aarch64-unknown-none.tar.xz=a44fa8ccbc73899c013526ca32866f63e1165e7f3b14455b91b37e3865c9e1c0 -dist/2025-01-08/rust-std-beta-aarch64-unknown-none-softfloat.tar.gz=31448ceb30ff86b5d8b4e7fa8fe5871665115d561e6377f73e164d8f11652b6e -dist/2025-01-08/rust-std-beta-aarch64-unknown-none-softfloat.tar.xz=bd71a90489b9ed6134d0fd05fd22c58b20c271422628a552d04bbc2bfd1bd29e -dist/2025-01-08/rust-std-beta-aarch64-unknown-uefi.tar.gz=0cc22881954c661d2ae01058ca04db10912289812e9cfdbca3c066227e38566a -dist/2025-01-08/rust-std-beta-aarch64-unknown-uefi.tar.xz=439e6cda62ca17f124ed788ed8c3882c2999362067214ed911aa362b8d4d22b8 -dist/2025-01-08/rust-std-beta-arm-linux-androideabi.tar.gz=c62e75f3754b04b3594189de953ca6a8703679b29e8da3935ee5a7370ee0e03c -dist/2025-01-08/rust-std-beta-arm-linux-androideabi.tar.xz=dd23a5df6353aa01271f0d1206f927dc0f532203fbf66258b2771155e543b86f -dist/2025-01-08/rust-std-beta-arm-unknown-linux-gnueabi.tar.gz=2cf5fee1c6cc0e2ee099c8687126b11861e12b098dd4ac99397a2ad026596350 -dist/2025-01-08/rust-std-beta-arm-unknown-linux-gnueabi.tar.xz=d3a946d098ca9991b4dbdc4ba3b53e37535e62815f76f81bdf7e4562f3534943 -dist/2025-01-08/rust-std-beta-arm-unknown-linux-gnueabihf.tar.gz=2eed53b995d0ac0c2856c39815ea08f40c074165c3814336af591adcd9f8b571 -dist/2025-01-08/rust-std-beta-arm-unknown-linux-gnueabihf.tar.xz=3848bae0dfc660d40486ee56589fd0d6ee558f051a14b5efd9d55cd03d10f709 -dist/2025-01-08/rust-std-beta-arm-unknown-linux-musleabi.tar.gz=b40192daf614574f7ef2f7785f6b66d99c0876f3f3cdc30990f8545d41ba0fba -dist/2025-01-08/rust-std-beta-arm-unknown-linux-musleabi.tar.xz=9e23ebe3062f38791cd23cfa58d9fbd796553bceff7a5a041d3cb78278915c99 -dist/2025-01-08/rust-std-beta-arm-unknown-linux-musleabihf.tar.gz=1b47d8f88a4496a8c7604aa2b6b0a2a810266825c385df5e29d313d5635eab6f -dist/2025-01-08/rust-std-beta-arm-unknown-linux-musleabihf.tar.xz=613dba102c8e8aed939ce3f1c43382d3d5d74a1baf911b7f68867ce0abaddbf6 -dist/2025-01-08/rust-std-beta-arm64ec-pc-windows-msvc.tar.gz=6afea3865efe25d2675c6e988c09c1fdfc052b27d996f893d9e5fe8a5aee10c3 -dist/2025-01-08/rust-std-beta-arm64ec-pc-windows-msvc.tar.xz=285ce1584fca2d0701baffb3228801c88212c20df1a6ee76bcc6e8a392de8739 -dist/2025-01-08/rust-std-beta-armebv7r-none-eabi.tar.gz=8bee2bdb49b1b8781b016b0b1032663e20d135d23b7d9de898e7dee0732a8ce2 -dist/2025-01-08/rust-std-beta-armebv7r-none-eabi.tar.xz=d0e2b1d1a095bb02866048e6286fcf762cffb69f437031ba3e7f330ec1ddaf07 -dist/2025-01-08/rust-std-beta-armebv7r-none-eabihf.tar.gz=c9a13d7fe85291c560786835a0531a407459f07cbfe4b652d9497a581e4bff09 -dist/2025-01-08/rust-std-beta-armebv7r-none-eabihf.tar.xz=be5e9534e88732ca700315d8a4517de3701201d74a0344e962faa9e9c64cf035 -dist/2025-01-08/rust-std-beta-armv5te-unknown-linux-gnueabi.tar.gz=9a48d8e2247f3f70c85e8a5fd39c9f1302d56aa94fbac6b431bff5a4c74f64ad -dist/2025-01-08/rust-std-beta-armv5te-unknown-linux-gnueabi.tar.xz=5e210bb961e6f73869671298ae1172a3a6f61b1b4ab08baad81e0e32e0a25245 -dist/2025-01-08/rust-std-beta-armv5te-unknown-linux-musleabi.tar.gz=fc842d5db2778c0f3fff7602e8056795a0c33880a29ba0d29941fec2d2174d8f -dist/2025-01-08/rust-std-beta-armv5te-unknown-linux-musleabi.tar.xz=cf473390797976ca153701dcd3ee41a4c2ba314cb180a06ee51e242f5f93047f -dist/2025-01-08/rust-std-beta-armv7-linux-androideabi.tar.gz=2cf80485cb303b44d48f6555ca33ea25fde6daa7f5fc9e6a2acdc23697c810a2 -dist/2025-01-08/rust-std-beta-armv7-linux-androideabi.tar.xz=625e57d27f5b4bc198598df7b2ae6ac8416951060eda7dd08ef9d319e97b2b9c -dist/2025-01-08/rust-std-beta-armv7-unknown-linux-gnueabi.tar.gz=170d6999f1f9185d48df161023e527826ad72019c37ee11a4e3ad25fa1667e81 -dist/2025-01-08/rust-std-beta-armv7-unknown-linux-gnueabi.tar.xz=724bf705fdfd23aa4065ec9128d6d34beaa8285b02f36c2a68d83b1f537c5186 -dist/2025-01-08/rust-std-beta-armv7-unknown-linux-gnueabihf.tar.gz=21a6727b7bee42a9ed22167600a5c9e8346db3e10133c88a07acca89a3513140 -dist/2025-01-08/rust-std-beta-armv7-unknown-linux-gnueabihf.tar.xz=f6234d0030296bb13cd8b075a6b2637b5f8c1c9454ff764a168755686fff4b5c -dist/2025-01-08/rust-std-beta-armv7-unknown-linux-musleabi.tar.gz=09479a598b1fe96eead29bc72f007a130b374b53d06be22282ad94ef7b4e4bce -dist/2025-01-08/rust-std-beta-armv7-unknown-linux-musleabi.tar.xz=7e67daa06adad6878ea5d3cd9626baf370188fde3e14b2459347665118173c5f -dist/2025-01-08/rust-std-beta-armv7-unknown-linux-musleabihf.tar.gz=92d63ffb8ef0c274ff6138032e0df849b7d10668035ec3a20304ab31bafad495 -dist/2025-01-08/rust-std-beta-armv7-unknown-linux-musleabihf.tar.xz=1c2e84999fb5282b6ed7bb31bac0f4c979483696453f3c797dce2e52b7bb848f -dist/2025-01-08/rust-std-beta-armv7-unknown-linux-ohos.tar.gz=3a5e0748561fb981acdcfdc2037b12cdfb51d4fd3336172f6be74a78eeaca6b3 -dist/2025-01-08/rust-std-beta-armv7-unknown-linux-ohos.tar.xz=9bd198313fe8e4d0d3b4f999841ad6310884f6a0ba9f1582e072108e38fbda0c -dist/2025-01-08/rust-std-beta-armv7a-none-eabi.tar.gz=45cdec4bacb8c1cb67e73c26499fa789fffebc981a33472f6b84d8752554e7c9 -dist/2025-01-08/rust-std-beta-armv7a-none-eabi.tar.xz=5222471cb625865c8a2594e88a3adbf529a866164e98f77a315953d5e3494c54 -dist/2025-01-08/rust-std-beta-armv7r-none-eabi.tar.gz=32159e59a8c11c032ab900f77ab7b25827409be390c62bfee8e28d9cd733c13d -dist/2025-01-08/rust-std-beta-armv7r-none-eabi.tar.xz=45c7ba589c6f092ada1a0acc0a107efb09b3baf0549846919ac3f853b574026e -dist/2025-01-08/rust-std-beta-armv7r-none-eabihf.tar.gz=4263a0a290f88e9b5c09c6140aaa02fcc7bc455439070f6d4b4d9a38f8424c3f -dist/2025-01-08/rust-std-beta-armv7r-none-eabihf.tar.xz=a3ff2f3691f7f62f9bb57259eb4e6c2976276fabc46e9ac6a7796ce2fd6ece5c -dist/2025-01-08/rust-std-beta-i586-pc-windows-msvc.tar.gz=d073f07548e5a2d92e094c69b6a7b59cf91309ebb42e06393c410c95fa90b681 -dist/2025-01-08/rust-std-beta-i586-pc-windows-msvc.tar.xz=e8708e2a341358c14c3259a8c4c05db6eb7baf09050cdab383b44f0b70dea7b7 -dist/2025-01-08/rust-std-beta-i586-unknown-linux-gnu.tar.gz=9072d9bf10db42db4e150b73fddf1085495979a18f59cabd43d73c0f1336e112 -dist/2025-01-08/rust-std-beta-i586-unknown-linux-gnu.tar.xz=e43a369c7954f4645243990291c88dae3b6694e4d2efe7ed4f81b7b8b7c723c8 -dist/2025-01-08/rust-std-beta-i586-unknown-linux-musl.tar.gz=e7de687f826c37e20b64b5e091fc3ea514770d38c45bb39eb6ab5a9730be6d11 -dist/2025-01-08/rust-std-beta-i586-unknown-linux-musl.tar.xz=5ab4c606c30f534fa75351160af4c4dda660955658a0d6864d28d927b9ca07cd -dist/2025-01-08/rust-std-beta-i686-linux-android.tar.gz=5936848fc7f45feeb797c6a78889762d0b36fe48dd82eb437049be6e8d17ee04 -dist/2025-01-08/rust-std-beta-i686-linux-android.tar.xz=d66a746f476ad27525c9f22136b664c0a98a811450caa083ff8c9def80dd886f -dist/2025-01-08/rust-std-beta-i686-pc-windows-gnu.tar.gz=d6326c139001357e964fcad7e26b195fb707e8158791fdfbcd16910258438910 -dist/2025-01-08/rust-std-beta-i686-pc-windows-gnu.tar.xz=f455268ea0f33118607adb1a7ebe484a38904e1c698899f4857492633fad219f -dist/2025-01-08/rust-std-beta-i686-pc-windows-gnullvm.tar.gz=714846d27f13247f37edc266b66eb1792fa1c35d2dd13215800db55ed89cf8c3 -dist/2025-01-08/rust-std-beta-i686-pc-windows-gnullvm.tar.xz=cede0b7977ee57ed24d792749dbfb42240f95a235d93b2e1a7ad4aa03d588da3 -dist/2025-01-08/rust-std-beta-i686-pc-windows-msvc.tar.gz=70fbea3fa87e1aa93668f2462ddf73b05c55883ae9d2bbdd0a3acc9ab51eb961 -dist/2025-01-08/rust-std-beta-i686-pc-windows-msvc.tar.xz=bc13da70c924372a2247d125bdfc850b9551e32ef990ca8dd0c24d282f9c7025 -dist/2025-01-08/rust-std-beta-i686-unknown-freebsd.tar.gz=c4583d916fdf07e7e274b59c32fe661b0c1780b925c4d84d01fccb1262cee70a -dist/2025-01-08/rust-std-beta-i686-unknown-freebsd.tar.xz=77612c690f5ecbadb1f2d9128f79676bc3b199478cdb619321eb521e4f8777ca -dist/2025-01-08/rust-std-beta-i686-unknown-linux-gnu.tar.gz=c487e6e164f31a9274a24a1668170db22e64def6412a38a38b6e0c4741523786 -dist/2025-01-08/rust-std-beta-i686-unknown-linux-gnu.tar.xz=cfd25efcec9004d223fb7257a34c0530ff755eb3337fe80468949df185e1adec -dist/2025-01-08/rust-std-beta-i686-unknown-linux-musl.tar.gz=5e208e822d9d2db30bfa4ca363d29d923c5560ac7d220dfd32898524022aa2c7 -dist/2025-01-08/rust-std-beta-i686-unknown-linux-musl.tar.xz=742f8c4dde07be899de43502af87ea1457a4706078ea7f353914fd31d9b91537 -dist/2025-01-08/rust-std-beta-i686-unknown-uefi.tar.gz=3567303608260def6590e9f0c29ce776ce933f0a9cf4c568faa8713935ee9efc -dist/2025-01-08/rust-std-beta-i686-unknown-uefi.tar.xz=dbea586494aeec9d2d29c80eb259cb6d66608c93b26f560f2276b490d6946a25 -dist/2025-01-08/rust-std-beta-loongarch64-unknown-linux-gnu.tar.gz=ecbacd29dc59c59ac513958325ce3a2a2323156562dbf966f529f267fc52ce17 -dist/2025-01-08/rust-std-beta-loongarch64-unknown-linux-gnu.tar.xz=69c2429bc0bdcb3e4ab9b05af37f65c60b936df6598d375843e63b8141371fe3 -dist/2025-01-08/rust-std-beta-loongarch64-unknown-linux-musl.tar.gz=f4f33e673f883a9ac3b0113281c890839498d70d72e5ba51094c851bd6f0d323 -dist/2025-01-08/rust-std-beta-loongarch64-unknown-linux-musl.tar.xz=c82917544801fe373b007aae871b4833db428a37d544e09644601d3fde682018 -dist/2025-01-08/rust-std-beta-loongarch64-unknown-none.tar.gz=d3fb635af8745de8a5019bb9bbc3b20b109ed85f7ced6e939836bc0a124a0fbd -dist/2025-01-08/rust-std-beta-loongarch64-unknown-none.tar.xz=6e7e2d66e1c99507b1b515178d6a200532e1ae7600dc125d26b8ccf52d011399 -dist/2025-01-08/rust-std-beta-loongarch64-unknown-none-softfloat.tar.gz=0fb8285f64d616d741a32ae07f69dfa96e0d231cb835a839dc42ea76fdf0ea83 -dist/2025-01-08/rust-std-beta-loongarch64-unknown-none-softfloat.tar.xz=c1c92ca9c3153ea5f42aeec0c3ee7f1042e3e01d6a91784e6baaf201c9621608 -dist/2025-01-08/rust-std-beta-nvptx64-nvidia-cuda.tar.gz=1749eb869811470620cf5e432b5f5dc128c6b8e9f3b9586fc20336c677b863da -dist/2025-01-08/rust-std-beta-nvptx64-nvidia-cuda.tar.xz=72c7a3c88afab27d0e4b09c313af336e6aff45046fae2becb17235affc1746f6 -dist/2025-01-08/rust-std-beta-powerpc-unknown-linux-gnu.tar.gz=36bd0cb97b921cdb915337ec1c7a23609c94c2485f932a1c27fd71804def533d -dist/2025-01-08/rust-std-beta-powerpc-unknown-linux-gnu.tar.xz=45a6098b27a0de50e3c26d540ab4afeac30178bdd389c0a4d829b015cc5726ec -dist/2025-01-08/rust-std-beta-powerpc64-unknown-linux-gnu.tar.gz=00352c0a8fba406add478aa1bbf6b6ca99e7c5db302901616bd2cc740a9867b8 -dist/2025-01-08/rust-std-beta-powerpc64-unknown-linux-gnu.tar.xz=69d7ca4226590875ae59a45b45e7726780dcf4091c9c44c3759931e2b05a42af -dist/2025-01-08/rust-std-beta-powerpc64le-unknown-linux-gnu.tar.gz=6243b4efcf2435cf586248ebc9b99379e8b86ce5575d8845821a11c21f8946fd -dist/2025-01-08/rust-std-beta-powerpc64le-unknown-linux-gnu.tar.xz=78898b9d99a25075a8c47e7b78e35b64b891179a8f54d41983370814f33b6eca -dist/2025-01-08/rust-std-beta-powerpc64le-unknown-linux-musl.tar.gz=ab293f2e7e3288a4c4842ee510307f18c9df6618702695add978bd1d56be21b1 -dist/2025-01-08/rust-std-beta-powerpc64le-unknown-linux-musl.tar.xz=57b7c326e4167d01385f9f89d89e81b5b660a7e63e1c17b14b70e8c8e50774dd -dist/2025-01-08/rust-std-beta-riscv32i-unknown-none-elf.tar.gz=167fca173e6e2974a35be4c8fc5cc9043a3b34d74efba13a86df75d2600576d5 -dist/2025-01-08/rust-std-beta-riscv32i-unknown-none-elf.tar.xz=4197393d32094f65fc781bf39ba95fb36988508f9ab6b41300ebe2ebad838640 -dist/2025-01-08/rust-std-beta-riscv32im-unknown-none-elf.tar.gz=d3d0569bffb348bc580f3e382557939a4a87452a05dcfe1fbca8c8a9888c457d -dist/2025-01-08/rust-std-beta-riscv32im-unknown-none-elf.tar.xz=c0ad9def2f73a60b674b35b8f53483a0c017ad4e4db3b268b3c10bdbedc13625 -dist/2025-01-08/rust-std-beta-riscv32imac-unknown-none-elf.tar.gz=7f41fade9abdf4ee47e96ffcf345fc37231d60a645ce814b19738689018b77cd -dist/2025-01-08/rust-std-beta-riscv32imac-unknown-none-elf.tar.xz=d6f21bf60530c691a6d40d0ba1ebe0ee041bf8a333f489671b1f1fea61950ffc -dist/2025-01-08/rust-std-beta-riscv32imafc-unknown-none-elf.tar.gz=0ddc2427ea4e448789b8053f111f7310f6da95d6cff8f644ce1f3ccffeb16f42 -dist/2025-01-08/rust-std-beta-riscv32imafc-unknown-none-elf.tar.xz=77a2f8531ec6a87ef95ed5690c31d5e1e3cf65a633e0ff885cb0b2cc55a2fab4 -dist/2025-01-08/rust-std-beta-riscv32imc-unknown-none-elf.tar.gz=c72a5c97347dbf43c328170cd1ded9363f1f3659732d9497d73bc2a9e3b32de7 -dist/2025-01-08/rust-std-beta-riscv32imc-unknown-none-elf.tar.xz=584e99c8fdfd6e186509ad41f67d02ad92cd9d887c2b6159ad8a36334eba7aae -dist/2025-01-08/rust-std-beta-riscv64gc-unknown-linux-gnu.tar.gz=536f1135a697180ed7674b8d9ac15232eac4d7735cbcc836cc099cd6136c39b2 -dist/2025-01-08/rust-std-beta-riscv64gc-unknown-linux-gnu.tar.xz=dad89574543674fd72dd2a6be4b2753b4e2211238d6208b201903c0645024fa5 -dist/2025-01-08/rust-std-beta-riscv64gc-unknown-linux-musl.tar.gz=1fb747dc33e3016ec5f0d8161dadef20f0798f7a65967c316f0315826bf7e8d0 -dist/2025-01-08/rust-std-beta-riscv64gc-unknown-linux-musl.tar.xz=05c57bfecf04cfb5279a3132138c9bf0c6773ea5fa01315bdcc83f0ad06165c5 -dist/2025-01-08/rust-std-beta-riscv64gc-unknown-none-elf.tar.gz=83e04e9c3ca61c2aa39a0c37b92d11a8571792244e6c5ebc795c1c3274a9a926 -dist/2025-01-08/rust-std-beta-riscv64gc-unknown-none-elf.tar.xz=4c1537651b695764db9ae3c536a605a7a9a1fdf51689350f7fff9638454844d3 -dist/2025-01-08/rust-std-beta-riscv64imac-unknown-none-elf.tar.gz=1c3164278134db89dc7cc5d2169402f28757e55c99438cb86a90cbf06f07ef7b -dist/2025-01-08/rust-std-beta-riscv64imac-unknown-none-elf.tar.xz=ddb7ffbad2e308d80b901986f6e00f38ecc59359a9f7d28223c089b01ae86f91 -dist/2025-01-08/rust-std-beta-s390x-unknown-linux-gnu.tar.gz=935d864e0e212ed9f70027fa7f6afe18757e561347c4d8b97221db2936a5afe7 -dist/2025-01-08/rust-std-beta-s390x-unknown-linux-gnu.tar.xz=18cc0e5b000474a60938521e23c5ef057e184616ddb1e2b031db0f8b5d87931b -dist/2025-01-08/rust-std-beta-sparc64-unknown-linux-gnu.tar.gz=e824c24bb3933941658a3a6c981e469c153aefc5bdb153216d90cbe8dc26adf8 -dist/2025-01-08/rust-std-beta-sparc64-unknown-linux-gnu.tar.xz=d40178695aff134127268c21a91ae8b4aaedf2d78122a00c844e0c4efe246815 -dist/2025-01-08/rust-std-beta-sparcv9-sun-solaris.tar.gz=c37a91e3c6685a11bc96acb1f7db48c30a45ed19c9a7f303ad4b60bb24228975 -dist/2025-01-08/rust-std-beta-sparcv9-sun-solaris.tar.xz=cf190f95859df6eb65ca3cc07aee95d4f3f8c0770c480ecd8373168cf0bce323 -dist/2025-01-08/rust-std-beta-thumbv6m-none-eabi.tar.gz=b598d8aba2ac570320ae7a1c8b9103f04cd0b81df37500ed838b88874eb7317c -dist/2025-01-08/rust-std-beta-thumbv6m-none-eabi.tar.xz=ebd4c1ca68d4ca5944a3f0837a8a1018e18dcb31ef8436a4d02c347b251ff0be -dist/2025-01-08/rust-std-beta-thumbv7em-none-eabi.tar.gz=3d0385fdb184a66a1af91e3db28ea0829b1a498f2431a896aeccf2c900cb9624 -dist/2025-01-08/rust-std-beta-thumbv7em-none-eabi.tar.xz=f778bfbb7033a53c61c3af187ee35e9e7713e9e98a6994f11ed9b589f3459391 -dist/2025-01-08/rust-std-beta-thumbv7em-none-eabihf.tar.gz=0a1669fc57856b2e475a9b8edd7575ad7ab07ad0b95a0ba9fb92e7fb26f81a0b -dist/2025-01-08/rust-std-beta-thumbv7em-none-eabihf.tar.xz=bb6b245b183061f65e3a5d9e9c1bafc76c3f968ed7d0cbd0e33ff878f5e30804 -dist/2025-01-08/rust-std-beta-thumbv7m-none-eabi.tar.gz=3f459b3a6dbe99fa6bcce86e853096902f23e7e49a1b8c300ef4515796619b28 -dist/2025-01-08/rust-std-beta-thumbv7m-none-eabi.tar.xz=b9ce85bf7cfcb13526c2cbf56aba726919b818168c6f99fb855cf00ef8d0c76c -dist/2025-01-08/rust-std-beta-thumbv7neon-linux-androideabi.tar.gz=366797feb0b31dccd500310903b494682b654800938a79c46e47313accaf622a -dist/2025-01-08/rust-std-beta-thumbv7neon-linux-androideabi.tar.xz=33c50d91b1f23770031a3e1c9b3a78f901b30831bbed8c7f463c29ebb86d5a91 -dist/2025-01-08/rust-std-beta-thumbv7neon-unknown-linux-gnueabihf.tar.gz=43acc164b41da62e1aeb7f252f6d81f1f3b79281362348817134760185648071 -dist/2025-01-08/rust-std-beta-thumbv7neon-unknown-linux-gnueabihf.tar.xz=c93bc0681027e879719417049e61ddf7f4092d72d103d14994520bccaf6ede19 -dist/2025-01-08/rust-std-beta-thumbv8m.base-none-eabi.tar.gz=0b36bef54f41302c871bfb92f45f248c34bd2450b159c68801eb13373d464e69 -dist/2025-01-08/rust-std-beta-thumbv8m.base-none-eabi.tar.xz=7f9300e17e4786747ca434c1f1a0451aa7c7f933f7952b5010a0e4bf4d9e4198 -dist/2025-01-08/rust-std-beta-thumbv8m.main-none-eabi.tar.gz=ca421607c9f67d0648dc7550781bf90983dca6f17e81153ebcc4ae2f69fe88a5 -dist/2025-01-08/rust-std-beta-thumbv8m.main-none-eabi.tar.xz=0b20c32941914bacc1b0a16b334cd32feed1ff56e6a2551aa0ae6b22c41f4c46 -dist/2025-01-08/rust-std-beta-thumbv8m.main-none-eabihf.tar.gz=e792938012865b5c1fcec63bc25a9b72e28889515472cfd83d7d57fd8f84d7c5 -dist/2025-01-08/rust-std-beta-thumbv8m.main-none-eabihf.tar.xz=15338fd8f01e0fb422336ba055a4ccf4be3ff8ccdb123ace84e9dc9f1a64e3cc -dist/2025-01-08/rust-std-beta-wasm32-unknown-emscripten.tar.gz=c57a71f14db1b122dec0ff70a04faf1b8a7a3af948e3ed81b15563b19c376334 -dist/2025-01-08/rust-std-beta-wasm32-unknown-emscripten.tar.xz=dbbd2251d206de84de81abd5b29e4ed1b08c00155141e08a7b6fa35559ac4e65 -dist/2025-01-08/rust-std-beta-wasm32-unknown-unknown.tar.gz=852381932ef65b7ce75f943164ac747bcce3b1d3f6e2c1cd434934c1030f789a -dist/2025-01-08/rust-std-beta-wasm32-unknown-unknown.tar.xz=cbdf58a9afb016aee98416924578d0a8ece8a6d5a17734606928bedf37719129 -dist/2025-01-08/rust-std-beta-wasm32-wasip1.tar.gz=6dd459e217ea3b4f7f85811eca500c774a36dd849addd9874e4e54e972fc7c7c -dist/2025-01-08/rust-std-beta-wasm32-wasip1.tar.xz=beca27838a50a2da0341d1bee58faaab18d67a41cd1724d39b30b4f8daf18359 -dist/2025-01-08/rust-std-beta-wasm32-wasip1-threads.tar.gz=8a264acc2656f35e61d4ebf8773dd3b29c0e7748ccaf326898089838128c609d -dist/2025-01-08/rust-std-beta-wasm32-wasip1-threads.tar.xz=eac3340c629af165b67982326cbff6cd63a2721e41972b70826a9911af902e02 -dist/2025-01-08/rust-std-beta-wasm32-wasip2.tar.gz=ddef01fac3d8b1116b0f2b5f7b4a65a54070e06ccff8fc0429ed8e668d57d4fe -dist/2025-01-08/rust-std-beta-wasm32-wasip2.tar.xz=6de7754db16d34a556264c6d37ed66480e832aacf2aefe34a7e82636ccd38653 -dist/2025-01-08/rust-std-beta-wasm32v1-none.tar.gz=8f8eef02573a4911630ceb59534bb91a084ecc9d8ba1ccfa6e59370f69af028f -dist/2025-01-08/rust-std-beta-wasm32v1-none.tar.xz=86bb30d39659171af2120a86668f1803f3c1ca7b2a0f8662fc98a499734f9e17 -dist/2025-01-08/rust-std-beta-x86_64-apple-darwin.tar.gz=b4e018a5dec5b232867770a8d8ce43d670265a51b389c7a1f0f1652a9e2b685e -dist/2025-01-08/rust-std-beta-x86_64-apple-darwin.tar.xz=b81c60d6b6c5f5fb1eba3037c545452bf7f070eae7b6c23ab3011f50de1f01ce -dist/2025-01-08/rust-std-beta-x86_64-apple-ios.tar.gz=61a88f5fd29b413ae351db90a43773ad2cc846ef3a03b5747e98bcab7865b988 -dist/2025-01-08/rust-std-beta-x86_64-apple-ios.tar.xz=977ad619301f051e241f898c302bc230ed37dcd6041d925378cba6811a15f41a -dist/2025-01-08/rust-std-beta-x86_64-apple-ios-macabi.tar.gz=184c6fb1f051685f23a04ee2a57d15b8f1f3d5696b9cee0f8d48b230f108f408 -dist/2025-01-08/rust-std-beta-x86_64-apple-ios-macabi.tar.xz=90715fa792f08da57964abae2b8366337c3372ecb92624783448ee6fc921792e -dist/2025-01-08/rust-std-beta-x86_64-fortanix-unknown-sgx.tar.gz=13343f16a12d12bf5dea13e240a88e50855a3eaa16d87842e33356611ef6a0dc -dist/2025-01-08/rust-std-beta-x86_64-fortanix-unknown-sgx.tar.xz=f273923ea18276e3440003bfe6f00479df907dffd18fb80b447c41baae396cb7 -dist/2025-01-08/rust-std-beta-x86_64-linux-android.tar.gz=3c86701e32a065bd9b0529360379b86180724497b5167f776253abba208db741 -dist/2025-01-08/rust-std-beta-x86_64-linux-android.tar.xz=daf93cde1b13402a2e7ef7faa2aa1644cacb2fafb211a28d4e1c7cb96e738372 -dist/2025-01-08/rust-std-beta-x86_64-pc-solaris.tar.gz=5cf8d53338a4c504dfb96dcbef5b2862921624c2c93edc7597478f97ef3f1a24 -dist/2025-01-08/rust-std-beta-x86_64-pc-solaris.tar.xz=a8a4105596906d4b1ac1588c1b301c1843c4ea695219fa6a979205a6b5fb336f -dist/2025-01-08/rust-std-beta-x86_64-pc-windows-gnu.tar.gz=f9c03150ce779c7a31ccf5fa4e12953af8d182bd7c0415300ea0ddee191a0e47 -dist/2025-01-08/rust-std-beta-x86_64-pc-windows-gnu.tar.xz=fb81f14fc43c8c9e86da1f10dbff6474447029781b716c9ad67068f793f07ba5 -dist/2025-01-08/rust-std-beta-x86_64-pc-windows-gnullvm.tar.gz=de329a0e32d0f66d50da01875c85ac807b826d2d2efbf971a7b46f89710dd2f7 -dist/2025-01-08/rust-std-beta-x86_64-pc-windows-gnullvm.tar.xz=ea5ad2523161e086b0b898c8c989fc1b20a26b460f4403eeaa9fde881be58465 -dist/2025-01-08/rust-std-beta-x86_64-pc-windows-msvc.tar.gz=b042f515a81b7151a0930e852fcb23632b74579ddd8be53dc37bf09fa94747f4 -dist/2025-01-08/rust-std-beta-x86_64-pc-windows-msvc.tar.xz=6f850810bcb1ab381e0245ce7d7881d86852d041d679d622dab4f4317aca54db -dist/2025-01-08/rust-std-beta-x86_64-unknown-freebsd.tar.gz=e415f16fbe3bfd0d9283ee41dc385f3a1a79f33730aba9d04da2acf7ea993617 -dist/2025-01-08/rust-std-beta-x86_64-unknown-freebsd.tar.xz=ce6967397e9dcf20c700957d5ef3a8fbe35795f0b7be1e8f2fc61ebebdd9771d -dist/2025-01-08/rust-std-beta-x86_64-unknown-fuchsia.tar.gz=6233e4e853dcbfe5dab0b1258fdadeec39f3d343fd99e597956677a949de1945 -dist/2025-01-08/rust-std-beta-x86_64-unknown-fuchsia.tar.xz=228a0ccf377f633b450b6bdaec99f351cc9db41e61d3caeba85f675bc9e07954 -dist/2025-01-08/rust-std-beta-x86_64-unknown-illumos.tar.gz=d729b6e0f6d70104c730e7cb4d4472ce02452acceecabf98e411b2ad0d6cfdfc -dist/2025-01-08/rust-std-beta-x86_64-unknown-illumos.tar.xz=51dad4bf611ab3bef919a9961f1a4d02f0203c63db501e32ff0810b2a1d81617 -dist/2025-01-08/rust-std-beta-x86_64-unknown-linux-gnu.tar.gz=6c859df64c707c7783863a17e2980c2139a98293473363efa6873d6549b52e3f -dist/2025-01-08/rust-std-beta-x86_64-unknown-linux-gnu.tar.xz=f4cce8d15f242168ba0ec7942a1140b1dadcaeebc8c0e7e7bd35ef7f91e4b390 -dist/2025-01-08/rust-std-beta-x86_64-unknown-linux-gnux32.tar.gz=f7a559f89b5fa340c2974b8c85aad21e48995af01add8e459b82bae890f0b2e5 -dist/2025-01-08/rust-std-beta-x86_64-unknown-linux-gnux32.tar.xz=73007a7a396864a71003de912ceb847e8684c4c63d45f032da628267aa28cb7f -dist/2025-01-08/rust-std-beta-x86_64-unknown-linux-musl.tar.gz=7746927bd5283c05717e006d252bba797b48bb9f50b3674587025125e1916ff7 -dist/2025-01-08/rust-std-beta-x86_64-unknown-linux-musl.tar.xz=4d2cc7aaa081dcc0b9fbf09601881023b6749d8b2986a01f82caae0218d2cdc9 -dist/2025-01-08/rust-std-beta-x86_64-unknown-linux-ohos.tar.gz=6f2ecafe9003c8fba1f43e1acdd477cf0482e7f97c1687d6255c696bc45cf662 -dist/2025-01-08/rust-std-beta-x86_64-unknown-linux-ohos.tar.xz=c82ece042d0980b1707d3871aa35b4b816179c3214e84ca7666e2189e4f062cc -dist/2025-01-08/rust-std-beta-x86_64-unknown-netbsd.tar.gz=d41dcec02cd3dc2536786aa461256bf5ce1b65174ab6cc532564dbfb6dbb37bb -dist/2025-01-08/rust-std-beta-x86_64-unknown-netbsd.tar.xz=cfc7dd1eaf1420db8b87d13bd9a857e258c2db4137ce1fab03583b82cff5e3b0 -dist/2025-01-08/rust-std-beta-x86_64-unknown-none.tar.gz=234209f51b8e8637cb2742cd482be0a333e4463869abbd5f00e548f03eb79483 -dist/2025-01-08/rust-std-beta-x86_64-unknown-none.tar.xz=36a5a189997d1c6eb05397007223611fc9777cee6fc495a885e46c2f52f62040 -dist/2025-01-08/rust-std-beta-x86_64-unknown-redox.tar.gz=a8df20db51fd121a970d6dcd24e583ac831c956f37b7e47b1533cba6f4b27dd4 -dist/2025-01-08/rust-std-beta-x86_64-unknown-redox.tar.xz=d1368bfa84bae9366cde19cb201fd13fe09d2c0b53f82cabefa85a78acf423e2 -dist/2025-01-08/rust-std-beta-x86_64-unknown-uefi.tar.gz=625834a177f20b99f706b9b25c60388db6cc42de7dd54a9ae10b16a86f4ab9bd -dist/2025-01-08/rust-std-beta-x86_64-unknown-uefi.tar.xz=89a95f2c6a11a0788fcb4fb12c7b37dcae62ff682ae8e1d24910f64dcf801be6 -dist/2025-01-08/cargo-beta-aarch64-apple-darwin.tar.gz=be3bbcf4c95c1d30634cdd87efaf0ea57b8199649a9e502245ee3915f93f49c5 -dist/2025-01-08/cargo-beta-aarch64-apple-darwin.tar.xz=74eb6c112313e7bc0104e211397ef998c2713f3c350a0b8995355ea04f4c1df6 -dist/2025-01-08/cargo-beta-aarch64-pc-windows-msvc.tar.gz=089863e43456e8c2613cf63f82172c9b2b220d582d448a88a9301f12aa5471e2 -dist/2025-01-08/cargo-beta-aarch64-pc-windows-msvc.tar.xz=fe604aaf5d859192fa13c78643c072d49b31f1b16fdbb088e2917631aa683431 -dist/2025-01-08/cargo-beta-aarch64-unknown-linux-gnu.tar.gz=f4c710be8d286696c57bce005e43458a5031fec2b706a8e825c498e7b1c9faa1 -dist/2025-01-08/cargo-beta-aarch64-unknown-linux-gnu.tar.xz=18e510f07b0a6b94cc1ec14503c7a2c992ce17c9897c472d9330cf55514ca4c2 -dist/2025-01-08/cargo-beta-aarch64-unknown-linux-musl.tar.gz=b2a4e280c9150683d14ab98770a4bb6f27c74144abcb0d075e81e537cbd2e2d0 -dist/2025-01-08/cargo-beta-aarch64-unknown-linux-musl.tar.xz=096d0926b219a8dbb6952a66ff742936c7307baa236262b2d6ee5238c2b44153 -dist/2025-01-08/cargo-beta-arm-unknown-linux-gnueabi.tar.gz=58eb3f62b876ee4be22ca51720204da9c3734a5a4a5365dedcede0a012a48891 -dist/2025-01-08/cargo-beta-arm-unknown-linux-gnueabi.tar.xz=1ca32ac5479c6d27191c7726b0dad38af34e6423ba8e644461ca30c82382ce06 -dist/2025-01-08/cargo-beta-arm-unknown-linux-gnueabihf.tar.gz=45895027f54b7c4f1222196317ac1cc38a84ccf07696a72fb91b2d42218d4281 -dist/2025-01-08/cargo-beta-arm-unknown-linux-gnueabihf.tar.xz=f08639a9a86802637b08df47815e2b0e32ce826f76c7187a140f97abf1eaebf5 -dist/2025-01-08/cargo-beta-armv7-unknown-linux-gnueabihf.tar.gz=63dfd33bb41426e81a8be487580656699502396350cd6c50a3bf32cacf2f5eb6 -dist/2025-01-08/cargo-beta-armv7-unknown-linux-gnueabihf.tar.xz=1033972fe7345a4cb84d0ba8a479159bdda53d42f581a7087eb517144026e870 -dist/2025-01-08/cargo-beta-i686-pc-windows-gnu.tar.gz=2f00a1e75d995f89ad2b5fd509dcbce97aad2096638cea05d0e9662fe8f21997 -dist/2025-01-08/cargo-beta-i686-pc-windows-gnu.tar.xz=535e4ea02ffcb59ab5c492689aa25aaa7dd026a9db7e5a5e1a674464488e86fb -dist/2025-01-08/cargo-beta-i686-pc-windows-msvc.tar.gz=e2c01590495c6c2384afb0287104bb9e9d8ba555c100c18c8bfd7f06bb4daf43 -dist/2025-01-08/cargo-beta-i686-pc-windows-msvc.tar.xz=6ace1bb6fb5cc03358433476d31f25076eb8d963d685df9c8dfc389a9caad479 -dist/2025-01-08/cargo-beta-i686-unknown-linux-gnu.tar.gz=a50b87367e59dcc3a1c22101d69cbf45a1485e42b2e12b6211d0f35059698d36 -dist/2025-01-08/cargo-beta-i686-unknown-linux-gnu.tar.xz=76d25cafff7f67abe142ba7183b9e1a1fcc18bbfe6969ea03783fd1cbdc7cd68 -dist/2025-01-08/cargo-beta-loongarch64-unknown-linux-gnu.tar.gz=3bd98bbaf3c1f718e4f40aea4dc0ad47e6c33b46b4b169841497b49a582b7caa -dist/2025-01-08/cargo-beta-loongarch64-unknown-linux-gnu.tar.xz=62e384bb07173661c6c1e6ddad3d0fab31a25184966020f70b8492c916cf852b -dist/2025-01-08/cargo-beta-loongarch64-unknown-linux-musl.tar.gz=6bd1ed4631ae5020d4529fc404ef4cf6bf4a93616fd15e1cad9527277fbe200f -dist/2025-01-08/cargo-beta-loongarch64-unknown-linux-musl.tar.xz=e27425b6e8f6c5114aedce100068bda25be975d80761d6478c49588c45f3611a -dist/2025-01-08/cargo-beta-powerpc-unknown-linux-gnu.tar.gz=2b14ae8e9f383d2682292ce26bb5dbe9dab69b450564a5e3f7db3fb93864a21c -dist/2025-01-08/cargo-beta-powerpc-unknown-linux-gnu.tar.xz=dcb68fdece4a4a365a95c440de9bd360f8c1079f4f15eee3d61a53d83957c7e3 -dist/2025-01-08/cargo-beta-powerpc64-unknown-linux-gnu.tar.gz=9e9c94abd8fcdea831451105bc351bd9407f3ab4925226a171cb0d170a4a697b -dist/2025-01-08/cargo-beta-powerpc64-unknown-linux-gnu.tar.xz=4cdd8795488a4c6ffcf9bc446576191dcc364e58dee785bf3ac2e756e3a9d5fa -dist/2025-01-08/cargo-beta-powerpc64le-unknown-linux-gnu.tar.gz=4eb0a9d2a1b85326c393250873a4550c8e6617e56df9a2d313aa220ffcb7a9ca -dist/2025-01-08/cargo-beta-powerpc64le-unknown-linux-gnu.tar.xz=2cf68732cc6926ae9727f627e64fab12c9fbe8803a640b25697ff6af23dbd8ab -dist/2025-01-08/cargo-beta-powerpc64le-unknown-linux-musl.tar.gz=4f276075cf0ce993ac88728992369d996dcbe4e1f68e5e80e620c0a6b305a484 -dist/2025-01-08/cargo-beta-powerpc64le-unknown-linux-musl.tar.xz=5b52acb5500d93fdccc9bdc03e6e91313deff0a2801c2b8a587681239b2a6ecf -dist/2025-01-08/cargo-beta-riscv64gc-unknown-linux-gnu.tar.gz=8325fda118d5da0b376c0db751cf2ceeae2dd3021b930e3b55c14e02d0ac438b -dist/2025-01-08/cargo-beta-riscv64gc-unknown-linux-gnu.tar.xz=2a764695907dcef6b4259831636d0020e72dde5d213f532b3f04b0bae3615d4f -dist/2025-01-08/cargo-beta-s390x-unknown-linux-gnu.tar.gz=12045986bfc2c346a914bd0b18d84d3e1c3103d6082b08659aa2508a483e0817 -dist/2025-01-08/cargo-beta-s390x-unknown-linux-gnu.tar.xz=ed09f5e3c37582c4ab42f0b4ef1353ff29182579818be28d8a184b33bec728f2 -dist/2025-01-08/cargo-beta-x86_64-apple-darwin.tar.gz=d026df870421796b76749529fd0a7965d83c2d915fa42599613c7521f92e391f -dist/2025-01-08/cargo-beta-x86_64-apple-darwin.tar.xz=b2174c6efe4336f76d30f55cf83dd5604b2a4f706a76be1cc57780a45d5fe1dd -dist/2025-01-08/cargo-beta-x86_64-pc-windows-gnu.tar.gz=7047bc8731c2eb00043f0237a12f5261942a1b6b99d574cbb6db32f2f1930180 -dist/2025-01-08/cargo-beta-x86_64-pc-windows-gnu.tar.xz=578f2d6d433dc249fe923edd0519f3db953c0a9beb8a2f2641e1bdb65863526b -dist/2025-01-08/cargo-beta-x86_64-pc-windows-msvc.tar.gz=0b4dadaece478e1c0cadbb479bd2acffda3254f2ca3c2529e3b81a0357019239 -dist/2025-01-08/cargo-beta-x86_64-pc-windows-msvc.tar.xz=19dc7572f4ae2a9b46c9017f78c5ff7108e9e293f21a3a52eba03f29dd204f62 -dist/2025-01-08/cargo-beta-x86_64-unknown-freebsd.tar.gz=71672eeeedc18240a33ea8b0ee0ce2ca8fdb020d5701cf4b8d3cc464a0199cdd -dist/2025-01-08/cargo-beta-x86_64-unknown-freebsd.tar.xz=e853f0e42602ff80f64fe245863ba0a4f50d8197ab4cde56c4bed53f4d7d9cbb -dist/2025-01-08/cargo-beta-x86_64-unknown-illumos.tar.gz=42c1b82bfbccc05f381376b59c92d453810ea57d85e206b9ad958d0e9faa480d -dist/2025-01-08/cargo-beta-x86_64-unknown-illumos.tar.xz=b83b7cfb56b087a0dc648eab5f695104a1f220896a2981d2b65f67aa1584838b -dist/2025-01-08/cargo-beta-x86_64-unknown-linux-gnu.tar.gz=0b87cfd9dd3349b23fdcedad9a0fca316ac59e720c4c8f7b67c44020dcaa9665 -dist/2025-01-08/cargo-beta-x86_64-unknown-linux-gnu.tar.xz=19883a7bde6ed9a4587469f0c7bacb434b9734eb74c4b9c570fd3c217db6a52b -dist/2025-01-08/cargo-beta-x86_64-unknown-linux-musl.tar.gz=11934bf3879a9c395676b9fb737fc9e6e0b54314e51008875a72a80d8e773a74 -dist/2025-01-08/cargo-beta-x86_64-unknown-linux-musl.tar.xz=2ccf643a305060f2fcd24b957a8f9db28dc6fbe44d1b947007a571cea976d973 -dist/2025-01-08/cargo-beta-x86_64-unknown-netbsd.tar.gz=f9982255fb124e74a79708e9e566fd3713b904919260ea498279cde580c9b899 -dist/2025-01-08/cargo-beta-x86_64-unknown-netbsd.tar.xz=18bd7da3c593a0bdcb14140ce19e5a43d42e041fb897fa4acf12f35e03b2d766 -dist/2025-01-08/clippy-beta-aarch64-apple-darwin.tar.gz=511e0a0b6bf59a8e9ff299a32e46586ced5f13a1ad43c9564921c27b905457c3 -dist/2025-01-08/clippy-beta-aarch64-apple-darwin.tar.xz=dd75a377e5a28aff5eca49c73b0b52a2141f347fbb3d2c164d87122663c60ed7 -dist/2025-01-08/clippy-beta-aarch64-pc-windows-msvc.tar.gz=3097ed66faa8489f2fac32453d2ebeb7bc39d5d58b2fa60d47e5f539a57d3658 -dist/2025-01-08/clippy-beta-aarch64-pc-windows-msvc.tar.xz=dd26d47db7f35a41eb16829b35079d2137eb41a254c810e8a9e6d393a899ed96 -dist/2025-01-08/clippy-beta-aarch64-unknown-linux-gnu.tar.gz=a3bdd2413e3d040a1063113d6ba868ed4ffad157f97f180ce6410dc07d89fec4 -dist/2025-01-08/clippy-beta-aarch64-unknown-linux-gnu.tar.xz=308402abb63ae6e364d4ef014aa9dcf338b86982a25fc0570c4ca0e348b50bbe -dist/2025-01-08/clippy-beta-aarch64-unknown-linux-musl.tar.gz=07a3f0f0f6eca797d9feb6b3339a7c87ac4063bd4c898cb49d3a61c43b7b8ee6 -dist/2025-01-08/clippy-beta-aarch64-unknown-linux-musl.tar.xz=9b2fbae0ec014d61a3d20e532b526fb92bde03ab154b0ee02cb5aa4071c319cb -dist/2025-01-08/clippy-beta-arm-unknown-linux-gnueabi.tar.gz=9d6c781e2414d9ba43648fa958b2cee3937fa62d118ffbd7ae11fd71ca797011 -dist/2025-01-08/clippy-beta-arm-unknown-linux-gnueabi.tar.xz=73d6d532acdcd6c64f48d12a24ee4abb6f46c6dbfc3d5c3d593887e98313c1a5 -dist/2025-01-08/clippy-beta-arm-unknown-linux-gnueabihf.tar.gz=0d698e42477ce7c068df67b389e8f63f82649e1e2b38324e3c3b8906ee9f056d -dist/2025-01-08/clippy-beta-arm-unknown-linux-gnueabihf.tar.xz=9b94df3a1bcf891595a8263a61e3aa82a66013a5c59e8d8ac7742e033a1ac590 -dist/2025-01-08/clippy-beta-armv7-unknown-linux-gnueabihf.tar.gz=c010c51bd0665e4fc8a3d0bc27af75d2bd112dc8cbb841252b3d44b3789665f8 -dist/2025-01-08/clippy-beta-armv7-unknown-linux-gnueabihf.tar.xz=c7f9ecb195ded5ac7a03d353e51c264e5ccb4a3460733b06fdf967d8e3a5f085 -dist/2025-01-08/clippy-beta-i686-pc-windows-gnu.tar.gz=5f4ccf0aaeff0eb0970796ea23aae4590285b42b62b165fe3898649e203f57da -dist/2025-01-08/clippy-beta-i686-pc-windows-gnu.tar.xz=4400d650806cbdb2a8e8e2d6ed0bd5f90fa46b8f2398f09fed98ef565135635f -dist/2025-01-08/clippy-beta-i686-pc-windows-msvc.tar.gz=062eb313a72787fe53435c57b8a5b0c16ad2abd0644d8669038090d3572bc94d -dist/2025-01-08/clippy-beta-i686-pc-windows-msvc.tar.xz=ae493ceb9e334b05345cd94a26b87f317909ee82c02f704c2c3b487f5b28e897 -dist/2025-01-08/clippy-beta-i686-unknown-linux-gnu.tar.gz=0d7ba60792aa6e5cd531362ab92977ae3368b2ca2284174019133c2ed9d495a7 -dist/2025-01-08/clippy-beta-i686-unknown-linux-gnu.tar.xz=ded4113933755736c3248f1b0e26cc42d436eb4c6cbb21745f87a2428eae6ae9 -dist/2025-01-08/clippy-beta-loongarch64-unknown-linux-gnu.tar.gz=a4525272c4d46ab120d61855d5e453b92b0fa83623c8c5cdf4384b746ba56925 -dist/2025-01-08/clippy-beta-loongarch64-unknown-linux-gnu.tar.xz=5acf5b947a7d7f546cc405975ce5eb1f7e1a86ffaa6ea7c18f5baccbe8e26a7c -dist/2025-01-08/clippy-beta-loongarch64-unknown-linux-musl.tar.gz=628a86af3590cf6ec46173bfd18790958618e1236d3bb54f6eb92be7f78cbdc5 -dist/2025-01-08/clippy-beta-loongarch64-unknown-linux-musl.tar.xz=970c1e229fe35bbeb251e6e1291618d9da5334c1608685d8d602209bccafb4e8 -dist/2025-01-08/clippy-beta-powerpc-unknown-linux-gnu.tar.gz=25ecca37c54464052f44b79ae061c992f9bb29a671881f5fdc7a8f4e1953e543 -dist/2025-01-08/clippy-beta-powerpc-unknown-linux-gnu.tar.xz=e353972b9c73228c523077137a000d1c265dd24012fd1f3f44cb16ab172561c2 -dist/2025-01-08/clippy-beta-powerpc64-unknown-linux-gnu.tar.gz=b6d050a3cde8ff3c94dd072fce770ddf43486c8db37ca2ce2096f427f169cb81 -dist/2025-01-08/clippy-beta-powerpc64-unknown-linux-gnu.tar.xz=1728393681aa26afdd9b4c6147b1cd95a43e614cb379fd2f0e38fd68b26cd1fe -dist/2025-01-08/clippy-beta-powerpc64le-unknown-linux-gnu.tar.gz=4136945a33e3658464835c0c31a244b953b1bc2614dd38266f650ee8e330d5fc -dist/2025-01-08/clippy-beta-powerpc64le-unknown-linux-gnu.tar.xz=e121b45e188df1d540bd3d3d691b0b4043d5d067b52286e3e82c544d1f059a38 -dist/2025-01-08/clippy-beta-powerpc64le-unknown-linux-musl.tar.gz=6323723980ac6c17e951272bf5473b0f3735d05f00a469317d0371db9f1b562f -dist/2025-01-08/clippy-beta-powerpc64le-unknown-linux-musl.tar.xz=9f7120352e4b0e147159df5e04c1d1939dfe0e1081a6a0d8915ab75709147079 -dist/2025-01-08/clippy-beta-riscv64gc-unknown-linux-gnu.tar.gz=32f52736c78922bb47a624365f3bd7a06d28581ef4f1fffcb57575b6de739431 -dist/2025-01-08/clippy-beta-riscv64gc-unknown-linux-gnu.tar.xz=50c2b4e8c57bd0f4aed56d88e1bfbab2fc8f6c6e6d2aa8cf83dbb36067f2ca69 -dist/2025-01-08/clippy-beta-s390x-unknown-linux-gnu.tar.gz=5c2082cb9fa73e0af8b3384a3caf76c7dccbe7a78f553a5527b3539bbee83c0b -dist/2025-01-08/clippy-beta-s390x-unknown-linux-gnu.tar.xz=ca8c580219fe697b9dae674edb2a2c6ea6c737ebfc4d2580cb184745625874c0 -dist/2025-01-08/clippy-beta-x86_64-apple-darwin.tar.gz=83ac808792dadc4e5779c0b2185514de339cb61359b185d714713ab366909de4 -dist/2025-01-08/clippy-beta-x86_64-apple-darwin.tar.xz=c6a92d2b255736788cd53cb99b84e20ff135c4e5a7ed9cb2ccc9e5eb37523239 -dist/2025-01-08/clippy-beta-x86_64-pc-windows-gnu.tar.gz=6984f5b15e2f56e12924cb251d99f7b52307b1368c47ddc6ec4d17bbce8959e1 -dist/2025-01-08/clippy-beta-x86_64-pc-windows-gnu.tar.xz=fecd2eb58e8e1c9422e4433f120c3456f9cbd0f216863d9e3d37129bda966f79 -dist/2025-01-08/clippy-beta-x86_64-pc-windows-msvc.tar.gz=674115dee679648c45203b9014ce2aaf3812b3de079fc12aab4ba34aa4d8e8e1 -dist/2025-01-08/clippy-beta-x86_64-pc-windows-msvc.tar.xz=892ca2c9bb499ab0922919d89bba3c176e75570be2f4f2a1ac08608ba490d4cb -dist/2025-01-08/clippy-beta-x86_64-unknown-freebsd.tar.gz=513b3402e525d1e28c648a640d4506f9456c5c2fb45e2b7bc7f2c325a2d2f920 -dist/2025-01-08/clippy-beta-x86_64-unknown-freebsd.tar.xz=5e5a6c353aa3c8cfaafa694e70b69ed54a8c8dea5ea46412fd191a28be3bd926 -dist/2025-01-08/clippy-beta-x86_64-unknown-illumos.tar.gz=f16841404d8bb2aa1bd530eb6c2850e665c9e90f82eb6968cfcd4063b5ff8d10 -dist/2025-01-08/clippy-beta-x86_64-unknown-illumos.tar.xz=3c23e2df43a58499b4cf3652b2b02b1f68141b417829eb06d44c977c745fc7ff -dist/2025-01-08/clippy-beta-x86_64-unknown-linux-gnu.tar.gz=43bda68cf861a73c8e9bb461e4c28d3c5315f04900db68168584db4f85e50492 -dist/2025-01-08/clippy-beta-x86_64-unknown-linux-gnu.tar.xz=0d3bac2b017cb529d3fcf81042edae79362842f191a6759441afab41b19cd0eb -dist/2025-01-08/clippy-beta-x86_64-unknown-linux-musl.tar.gz=af7613a78ea98f2f134a69a32bdc09a103f83d6b1ea2ea3c27ddb3eb74430695 -dist/2025-01-08/clippy-beta-x86_64-unknown-linux-musl.tar.xz=78baca17912ad3cf49214187471ddcca890e787dc9821daf37103ea9f8632c1a -dist/2025-01-08/clippy-beta-x86_64-unknown-netbsd.tar.gz=f85ce010c7d235358e532b23e85ca8fd287376c311ca9427bd41ca0b3f04510b -dist/2025-01-08/clippy-beta-x86_64-unknown-netbsd.tar.xz=aacc604a5b53267a8eb936a433eba97ad4a002558836c933548152fc6cf50b0f -dist/2025-01-08/rustfmt-nightly-aarch64-apple-darwin.tar.gz=1ad6d3a92bfd2398af3f712b8238014b5517c80c54e2334e6bdf5bfec349bf0e -dist/2025-01-08/rustfmt-nightly-aarch64-apple-darwin.tar.xz=fcee1911fad43cb5689786b9603ca43fe2e6fccc89aec1f63b8afba4df915a71 -dist/2025-01-08/rustfmt-nightly-aarch64-pc-windows-msvc.tar.gz=3d219a1e888acdccaf75afc7c7820f45eb2161a0c78304f76a28af95c5a53dde -dist/2025-01-08/rustfmt-nightly-aarch64-pc-windows-msvc.tar.xz=0b4ea270256e8efb6df7d60473db256455fe7d5de835f164bdd0a92c3cea7369 -dist/2025-01-08/rustfmt-nightly-aarch64-unknown-linux-gnu.tar.gz=a7edc1692f4a5975fa5877e1af63c8e9c0a2d0946086413678973990fda8ee50 -dist/2025-01-08/rustfmt-nightly-aarch64-unknown-linux-gnu.tar.xz=bd4b98f560d00da97f2e7899ca32729581f9c5a386f398cf477c1ba6c922029e -dist/2025-01-08/rustfmt-nightly-aarch64-unknown-linux-musl.tar.gz=49387f42c45fcb21d55e056843ec3ea210c89b10722adfd2ad6ee5d4a929f7c8 -dist/2025-01-08/rustfmt-nightly-aarch64-unknown-linux-musl.tar.xz=778b995192beced6c690d80103c719e4b30c16b5e3caa2e2586693baac7ead18 -dist/2025-01-08/rustfmt-nightly-arm-unknown-linux-gnueabi.tar.gz=906191d5b2ca8e7645d6ff8571419aa8b50ca62fe10a1934722f1a493230da83 -dist/2025-01-08/rustfmt-nightly-arm-unknown-linux-gnueabi.tar.xz=6944b61661c3b1f72ec86a80b222bdc0a20e88a4e2a2f342bbb7ae2f8a1e1a6b -dist/2025-01-08/rustfmt-nightly-arm-unknown-linux-gnueabihf.tar.gz=e7fd3ba048b6d20956f6a76b6e859204bb9847bbc1305482426bb40f5b28ad36 -dist/2025-01-08/rustfmt-nightly-arm-unknown-linux-gnueabihf.tar.xz=312042e89eb0007fccdc5effa6098a762b94ff3a15840dee0fe681486b0ebda6 -dist/2025-01-08/rustfmt-nightly-armv7-unknown-linux-gnueabihf.tar.gz=584de19a62f85c418d01bc7943f0e3793f4c79776b8aeb5a7993cd1e7141bd7f -dist/2025-01-08/rustfmt-nightly-armv7-unknown-linux-gnueabihf.tar.xz=43327de3051396e27793390468003d1f13da0f0ed1cb7d5224ededf2787fefe8 -dist/2025-01-08/rustfmt-nightly-i686-pc-windows-gnu.tar.gz=bbb72a900c77cebec9cae4b2c6fd0e3bce3451bb2fb65fabfb9f042a55163f78 -dist/2025-01-08/rustfmt-nightly-i686-pc-windows-gnu.tar.xz=fbf8acb567141328ca628bd3c81af9477eb177bb398be3feef55d57acde2af5b -dist/2025-01-08/rustfmt-nightly-i686-pc-windows-msvc.tar.gz=4a80751fdd514a71d20d440260a86510c83cadbeac3bf03014ef5377c6530e10 -dist/2025-01-08/rustfmt-nightly-i686-pc-windows-msvc.tar.xz=fa3d56f5ec9f88448a2b6c36809b6c21bacb2cec7350571d386320aae2b410e5 -dist/2025-01-08/rustfmt-nightly-i686-unknown-linux-gnu.tar.gz=0f11501ddf7be92b987404df21fb4ed83ec8893d887943d86031709e7d671900 -dist/2025-01-08/rustfmt-nightly-i686-unknown-linux-gnu.tar.xz=264accec3e4ff18a3f21508bdc22988c86c0c899be83ed491f7f45f4d8d1f76e -dist/2025-01-08/rustfmt-nightly-loongarch64-unknown-linux-gnu.tar.gz=a32c70abfec103c12119a5adceb83eae81b7fc950733e6039e0b3d3a589d16c5 -dist/2025-01-08/rustfmt-nightly-loongarch64-unknown-linux-gnu.tar.xz=b0ed3c98ee0cabe8e85d031539796f0ff3e6fb3ed90275242d6fe9f55900abed -dist/2025-01-08/rustfmt-nightly-loongarch64-unknown-linux-musl.tar.gz=b4f8456e420eea3025f32303cda5de26c67d061e04fb2229a247411ac7dd8351 -dist/2025-01-08/rustfmt-nightly-loongarch64-unknown-linux-musl.tar.xz=e66969acdf2d98ffd854f19e7d9f8beee8ec8fe7ed4493bd308b2f9b44cd9c90 -dist/2025-01-08/rustfmt-nightly-powerpc-unknown-linux-gnu.tar.gz=f97621947a0a90815867d7a0a08722f87cab26584a4b61dca7d81e50336b16cd -dist/2025-01-08/rustfmt-nightly-powerpc-unknown-linux-gnu.tar.xz=9af1743797ac19982892046c5d4d1865c0fa1e7cc0a38ef43f2364e215a2b5ad -dist/2025-01-08/rustfmt-nightly-powerpc64-unknown-linux-gnu.tar.gz=fdf25dcd2c911c4fc6fbb3a184d078e36cd908a6a7b135c2a48a6f6efabcfd78 -dist/2025-01-08/rustfmt-nightly-powerpc64-unknown-linux-gnu.tar.xz=6df2621585eb4d0c5be9b3118034b70dc12e3ac999a47e843b9b2c8ca48629c8 -dist/2025-01-08/rustfmt-nightly-powerpc64le-unknown-linux-gnu.tar.gz=bd6c79723c219e2c2b56bea90e3c2808bdf2119d299fb84d11d021895292d464 -dist/2025-01-08/rustfmt-nightly-powerpc64le-unknown-linux-gnu.tar.xz=4e1f249176e480b12ea11bb49377cda875189f382086339ed3ce591e3c7576e1 -dist/2025-01-08/rustfmt-nightly-powerpc64le-unknown-linux-musl.tar.gz=36877f682d6c43aaa755b5edb5599e9ee8f48969e93532f458f516ac052dd47b -dist/2025-01-08/rustfmt-nightly-powerpc64le-unknown-linux-musl.tar.xz=ef36ffefbe132c56c3a993ba4f8b9048f65ac87f3f22e9471064d3fa7c0e9bbd -dist/2025-01-08/rustfmt-nightly-riscv64gc-unknown-linux-gnu.tar.gz=2d9a0f3c007b59fb107c859ee4eab0ceadfe4c220ba45bc8c8f4bf5cb2608ba7 -dist/2025-01-08/rustfmt-nightly-riscv64gc-unknown-linux-gnu.tar.xz=f09cde2c36a4b9791f1492b0319ef1444418b2162215d48d18a6eb7493dd275a -dist/2025-01-08/rustfmt-nightly-s390x-unknown-linux-gnu.tar.gz=585ef59a9fcb414ddec4fb69a6c33548a38b62c87be3c707443954c7be9eb764 -dist/2025-01-08/rustfmt-nightly-s390x-unknown-linux-gnu.tar.xz=4da9c4095b0e30d61c9617a5cbfd69ebc77d54f248dfa3c2f9c096383184a762 -dist/2025-01-08/rustfmt-nightly-x86_64-apple-darwin.tar.gz=28ed0f8745b5b68527ca735a794b11a1411574cb0756b74b7e5ad1f0652f1670 -dist/2025-01-08/rustfmt-nightly-x86_64-apple-darwin.tar.xz=6b3c264c1e1002c381bc952ae5f24f56f7bd623067ef0f0179677798539d0aa9 -dist/2025-01-08/rustfmt-nightly-x86_64-pc-windows-gnu.tar.gz=46b9ee6fe5c5bc6ec504b62fd9356cf467ea001cea073056fd8b53265b424940 -dist/2025-01-08/rustfmt-nightly-x86_64-pc-windows-gnu.tar.xz=d888eaa7a4b42b4761cba736c75c29d047e31d6d3918c3d64e8347236918f035 -dist/2025-01-08/rustfmt-nightly-x86_64-pc-windows-msvc.tar.gz=3b04474137945edf639d267a67712166c07df4c018276dfabbd7ad714c952750 -dist/2025-01-08/rustfmt-nightly-x86_64-pc-windows-msvc.tar.xz=f5268dc4d20eb86ae882c5faffdc1b6dfee52ab4487569a02f92e2e001a936ba -dist/2025-01-08/rustfmt-nightly-x86_64-unknown-freebsd.tar.gz=6fe48737c200f3ab1ebea3b5089403ad76a8dad4754cbdfa274c89dbf9b0ea45 -dist/2025-01-08/rustfmt-nightly-x86_64-unknown-freebsd.tar.xz=04f1a8d21dc54470df735f6b1f09e9d6e26c106d4ae4405962aaed11da80bea6 -dist/2025-01-08/rustfmt-nightly-x86_64-unknown-illumos.tar.gz=0dfa280e767a16665aad2bb6051b88a84850ccc408a24d99b89bf8d659149833 -dist/2025-01-08/rustfmt-nightly-x86_64-unknown-illumos.tar.xz=601215d564ed36cdd9be9abfc3ba42bbc15fc75d306e0921b36083a293067980 -dist/2025-01-08/rustfmt-nightly-x86_64-unknown-linux-gnu.tar.gz=ce5f4421a454ac2e5f8e53d0ab6050be45f73a3931b9e60240b13f7bf06800ee -dist/2025-01-08/rustfmt-nightly-x86_64-unknown-linux-gnu.tar.xz=7cda6e670d0718d13b89225f58df1c6a2473e6d2626144354c854d671c778ba2 -dist/2025-01-08/rustfmt-nightly-x86_64-unknown-linux-musl.tar.gz=26e3275bab7d39c465bab76074dd54f534980c89f5460838da9745c171859604 -dist/2025-01-08/rustfmt-nightly-x86_64-unknown-linux-musl.tar.xz=b33178fff841b91968c2f6fc108389a1740d865214729406de40b49e6969d22f -dist/2025-01-08/rustfmt-nightly-x86_64-unknown-netbsd.tar.gz=cc8439ce6628f864503c7ca322ec0607000536c002895dc872ad1bca8e865119 -dist/2025-01-08/rustfmt-nightly-x86_64-unknown-netbsd.tar.xz=2d3c2f666bf57384e11f12dcb00346f73953ca8a2a60947ae5c0b14b856b9170 -dist/2025-01-08/rustc-nightly-aarch64-apple-darwin.tar.gz=febc42bc953bf6b23253670756fb294545a1db22b02fbe2273e1030a78f0dc8a -dist/2025-01-08/rustc-nightly-aarch64-apple-darwin.tar.xz=f978d9d9e0bcc75efd4250406b796fb3f6cae31ec41ca2a40f88f7e70201171c -dist/2025-01-08/rustc-nightly-aarch64-pc-windows-msvc.tar.gz=6dfd42938c385aba18ba477e4430dd89e9b780d9217f410f68094d7bbbc722a3 -dist/2025-01-08/rustc-nightly-aarch64-pc-windows-msvc.tar.xz=d79b6f6158a99ea82314a99a68c52c63deb16d777d74426780df06c5110576a5 -dist/2025-01-08/rustc-nightly-aarch64-unknown-linux-gnu.tar.gz=5dfaa19982b344ba8d3f59418a847a764eb8b6b4a9809b8a63aeafd4725cb406 -dist/2025-01-08/rustc-nightly-aarch64-unknown-linux-gnu.tar.xz=dbe770d4594c9f8cd27aec8d342fd5f6bb44570723228726cbf19424dc0d7708 -dist/2025-01-08/rustc-nightly-aarch64-unknown-linux-musl.tar.gz=41357e54d974f3dfe0e71cac0eedc69625ddf7e2a1cf563c2e9689afa53cef11 -dist/2025-01-08/rustc-nightly-aarch64-unknown-linux-musl.tar.xz=208ffbee7b68121ddc0cb92dc1ab73dc3b489869ab190abd99174026724a3493 -dist/2025-01-08/rustc-nightly-arm-unknown-linux-gnueabi.tar.gz=7970e126f177ea336cc243448d034c8ad1aa6489db36ea0bde54e2df472552df -dist/2025-01-08/rustc-nightly-arm-unknown-linux-gnueabi.tar.xz=8333efc4f3bf9d6fb01a947a6f631f03fd506a494060e426ee7621831dfc3a95 -dist/2025-01-08/rustc-nightly-arm-unknown-linux-gnueabihf.tar.gz=f8b9030db15e6004647772700a7b137fe9e7ff1c24fa0742c45a25d072e1f1e4 -dist/2025-01-08/rustc-nightly-arm-unknown-linux-gnueabihf.tar.xz=f554b976502cdc78735def853947d9b48ab1ff1aca208cb348efdedae0df407d -dist/2025-01-08/rustc-nightly-armv7-unknown-linux-gnueabihf.tar.gz=402109bd4811e723999c8747978452e2a96e2ddf1109393302f9c1be7e36348e -dist/2025-01-08/rustc-nightly-armv7-unknown-linux-gnueabihf.tar.xz=b2dd7f94bbc34b91fd2dc2c1bab7179a51265bc51ac58b66c8aedbe849103749 -dist/2025-01-08/rustc-nightly-i686-pc-windows-gnu.tar.gz=9e3f1aa453de7bfd9a15f1925d96b46ce6375b49c6656db14bd2ed99f4138e1c -dist/2025-01-08/rustc-nightly-i686-pc-windows-gnu.tar.xz=468a157752c69bb2096ffe91413086d04eef8c64b9cdc44b51d7e9a94d2f4b5e -dist/2025-01-08/rustc-nightly-i686-pc-windows-msvc.tar.gz=1a9977db5843941c49c808830364e32c7e57190d3bf4dcf74e2a109473f808c0 -dist/2025-01-08/rustc-nightly-i686-pc-windows-msvc.tar.xz=7cc68c40929538b7711f5bccfa964841094eed9859f490846de0db0b2ba74343 -dist/2025-01-08/rustc-nightly-i686-unknown-linux-gnu.tar.gz=08c86c8984b966d3943de2252318aad2a27899fb58c5eb1079b8b8164b56d21f -dist/2025-01-08/rustc-nightly-i686-unknown-linux-gnu.tar.xz=d3b53723f085887709951dae7b0389b8cd4159a22fc7189bf7d7bc15ecb4bc57 -dist/2025-01-08/rustc-nightly-loongarch64-unknown-linux-gnu.tar.gz=515db325eb12b211d08367436fd07f5ceff4743930b9e685b0b13b94b99bfa34 -dist/2025-01-08/rustc-nightly-loongarch64-unknown-linux-gnu.tar.xz=b4986e7aca0325059689f8d7ead67616b2965922e77da33d9d03a7235520b585 -dist/2025-01-08/rustc-nightly-loongarch64-unknown-linux-musl.tar.gz=541571e5deb51d360eeaf2c88a28cc25c98dead983a3b8f2a6e3f371df3ce0cb -dist/2025-01-08/rustc-nightly-loongarch64-unknown-linux-musl.tar.xz=44fa8d77bf945b1a5ea9ed2a7e8228c8c0d5770098bbd8687173dff58b7005a1 -dist/2025-01-08/rustc-nightly-powerpc-unknown-linux-gnu.tar.gz=1ecae3935e253cc9b7aa44c8e7835fdf039d44ae19080e2316421b47453e3527 -dist/2025-01-08/rustc-nightly-powerpc-unknown-linux-gnu.tar.xz=b512b895e9b78069e57fce8c1982ea6fb8e463fbfe626474a6399008d5c149cf -dist/2025-01-08/rustc-nightly-powerpc64-unknown-linux-gnu.tar.gz=91c4ddebe0b50e8778297793d77a583b23b6c333d785564b97ea38a137c3b7df -dist/2025-01-08/rustc-nightly-powerpc64-unknown-linux-gnu.tar.xz=562f81acf112aefc6878132d7cf352da64b0eb1803d8c371e6713e270bea15bc -dist/2025-01-08/rustc-nightly-powerpc64le-unknown-linux-gnu.tar.gz=147bcd50f63f068a5814200ffeb8adc775c65187fb9c178dae5468af3fc04611 -dist/2025-01-08/rustc-nightly-powerpc64le-unknown-linux-gnu.tar.xz=9b6e863729599a96547119c1c2a04f23167cb142447644b88ccaa86d073e1471 -dist/2025-01-08/rustc-nightly-powerpc64le-unknown-linux-musl.tar.gz=85c085bf2771eb79dd3aca31ff9896de969de229c0549bd8c89a539393ef5cab -dist/2025-01-08/rustc-nightly-powerpc64le-unknown-linux-musl.tar.xz=107bba3499f4446aec6d79919453341a0d10fa5e6001da4cc9d3f1a618871989 -dist/2025-01-08/rustc-nightly-riscv64gc-unknown-linux-gnu.tar.gz=ca6663608404909610479a33562049d313882ab8252fd302657598b0251746ad -dist/2025-01-08/rustc-nightly-riscv64gc-unknown-linux-gnu.tar.xz=f66d3d9a1d897346945b254aed29e29b82be1255908dd0accc7deebd698a0b78 -dist/2025-01-08/rustc-nightly-s390x-unknown-linux-gnu.tar.gz=480fdbaad5a5e9d6412682c61de324ac37093f60377e5f772c59dab58e63e6a2 -dist/2025-01-08/rustc-nightly-s390x-unknown-linux-gnu.tar.xz=c438d14d90ed5acfa2108788b7179aebd7fcbac10703b2c5207ed7eaf988ddeb -dist/2025-01-08/rustc-nightly-x86_64-apple-darwin.tar.gz=b91f15c087c859b8ea6a5d556835c296ff480f6927efa9e535b9dcd726c8c4de -dist/2025-01-08/rustc-nightly-x86_64-apple-darwin.tar.xz=64b1129ba56b964ad433a499b2b5dd590371a4a7fa0f859c551bced786d876f4 -dist/2025-01-08/rustc-nightly-x86_64-pc-windows-gnu.tar.gz=c90d259076abbb62f26348a2bfaf5bc1dca1e6ba7d4c1dec8f02d9dfaa21cc53 -dist/2025-01-08/rustc-nightly-x86_64-pc-windows-gnu.tar.xz=127c2335d668cb93169681ec3775e0c9a91e0c5e1dd6043bd9236e18b7dedbf1 -dist/2025-01-08/rustc-nightly-x86_64-pc-windows-msvc.tar.gz=a0dd89c80a4c2c724a8910c33c6d5159beef9b462f912326c659defb87ebe41e -dist/2025-01-08/rustc-nightly-x86_64-pc-windows-msvc.tar.xz=b2c1972028521d6cd643a7a1f4db2eca1da5eb8ea03187bab5a7bef63377eec4 -dist/2025-01-08/rustc-nightly-x86_64-unknown-freebsd.tar.gz=3eb87ac0585b6a4a3cd0525e3f7fc04eafcb28b64ddb866beedbf24401810bf6 -dist/2025-01-08/rustc-nightly-x86_64-unknown-freebsd.tar.xz=fa93c78e53bc3e408c1b6d7917e643fb7f1f6203ec4a44036e8b73d37e650b82 -dist/2025-01-08/rustc-nightly-x86_64-unknown-illumos.tar.gz=3017ba6134aaf6cae0b7980ef211420ae1c09d230fc082e9f68a5a1a7335aad2 -dist/2025-01-08/rustc-nightly-x86_64-unknown-illumos.tar.xz=5a5881f7883eeb638c00ccc7a4cf453ddb987983228b066ec955b92d4e4855a7 -dist/2025-01-08/rustc-nightly-x86_64-unknown-linux-gnu.tar.gz=9c7796ef52678a29ea7e0406c1f2273ee11d907b379b3616237df9a05505140e -dist/2025-01-08/rustc-nightly-x86_64-unknown-linux-gnu.tar.xz=0c978e79f9794221ebd7c0fc0d4313e323d1aef1a5358ffc9cb806fcd997e4ef -dist/2025-01-08/rustc-nightly-x86_64-unknown-linux-musl.tar.gz=21ff96c7b7c0a5a18051c12f01b67e90fef620c887f7d91e78944b5a1a0e8838 -dist/2025-01-08/rustc-nightly-x86_64-unknown-linux-musl.tar.xz=2b7ffa8d546ed9b89472fd25ac56b4f6e968e99bfae9045a4019fab319716cf4 -dist/2025-01-08/rustc-nightly-x86_64-unknown-netbsd.tar.gz=ea30e5cef50b7b207844bc30ceaee4bcd30cde86f636080b243eb3e7e5367042 -dist/2025-01-08/rustc-nightly-x86_64-unknown-netbsd.tar.xz=c07dc61336037f475cb74945c0925fabd1fb33412eb4e6eba4004f207db67f3e \ No newline at end of file +dist/2025-02-08/rustc-beta-aarch64-apple-darwin.tar.gz=ca5440402ebfd3ba7ce3b30ecbcdc3e9341861996a5dd51601de3131d62d0bc2 +dist/2025-02-08/rustc-beta-aarch64-apple-darwin.tar.xz=bb7c79e5adb6998ac3a57ae7434a247029777bf3e1687c51ff3fdca938b72b3d +dist/2025-02-08/rustc-beta-aarch64-pc-windows-msvc.tar.gz=596a586332d87beaf3d52fead6e6c286a1da6abc89b53da5f6874f5da134cded +dist/2025-02-08/rustc-beta-aarch64-pc-windows-msvc.tar.xz=6828f88d3d576cdea838d975e0dc61ae2daf32746d7dbefce07f12684f5c0d97 +dist/2025-02-08/rustc-beta-aarch64-unknown-linux-gnu.tar.gz=86943f595d3ad4b4ee5b7c9db63df9addf9c5e50e25267f64daa504dc4bb63b6 +dist/2025-02-08/rustc-beta-aarch64-unknown-linux-gnu.tar.xz=13449944b13c4a8ef9aae649e1edf0bfbedc9816f7f32445ce9623098a21e51d +dist/2025-02-08/rustc-beta-aarch64-unknown-linux-musl.tar.gz=ce7fc3bed538a938f11b1cc15da20dc7d68097cf7d68a37ecc969c225bf5dcaf +dist/2025-02-08/rustc-beta-aarch64-unknown-linux-musl.tar.xz=a3b77720f7ff2a4707ecf44cab11ef088c3903ed6e123de14237b2149858f1a0 +dist/2025-02-08/rustc-beta-arm-unknown-linux-gnueabi.tar.gz=a9f02a5eb65c85f98b73dfd88ef4eb48e6782455b3ccb77032b2df5bbfa39e84 +dist/2025-02-08/rustc-beta-arm-unknown-linux-gnueabi.tar.xz=93c5ad3bcb8473a7ec0dcc81b788436c9881c9d9c276906dc09bada56b45180c +dist/2025-02-08/rustc-beta-arm-unknown-linux-gnueabihf.tar.gz=90f46141b9590ad69f60ffabdceb262e0940081994bda97a74692b76fd5cf8c0 +dist/2025-02-08/rustc-beta-arm-unknown-linux-gnueabihf.tar.xz=364a0b19dd91fe47c7152bd5a495d5ebf10170e4e5896859b02aef81225fc72e +dist/2025-02-08/rustc-beta-armv7-unknown-linux-gnueabihf.tar.gz=977901c4eaf17b2acc8f7b7dd4e2efe5c45b45f5763f94b2ca36beadcc1544fc +dist/2025-02-08/rustc-beta-armv7-unknown-linux-gnueabihf.tar.xz=4f60ec3e8a48c97a98567338be479499dbfb48db328d3d208763a8e6ad36e80d +dist/2025-02-08/rustc-beta-i686-pc-windows-gnu.tar.gz=ab1f6cf30ac8abf6dd130144355b79510633b24b06b416d82ba1fbccd318c2e5 +dist/2025-02-08/rustc-beta-i686-pc-windows-gnu.tar.xz=68327052940d99080217450553c42f3df81507385b5b90734c9b41a57e601ec6 +dist/2025-02-08/rustc-beta-i686-pc-windows-msvc.tar.gz=479053067ce64241d06a09d88b23cfb3da6dbcff46b5e8e33c2c1797ecdefb19 +dist/2025-02-08/rustc-beta-i686-pc-windows-msvc.tar.xz=12a4286b430fdd49e8806aa98a4395fc2ded6eae5ca254fb2cddc2c6db2cd893 +dist/2025-02-08/rustc-beta-i686-unknown-linux-gnu.tar.gz=865d88d2a9bb177851e901a56c5b3a295aa4ecdec8f73c72d4f9914b2e4aac60 +dist/2025-02-08/rustc-beta-i686-unknown-linux-gnu.tar.xz=3f17f91cd666e59efd5a47c2db28af8eee0d89d4ebbc6263f005e1d8d7d5b839 +dist/2025-02-08/rustc-beta-loongarch64-unknown-linux-gnu.tar.gz=a1c42bc975d9ccd10771aa83874d0ea382780a8a925016d966d50084fb45c267 +dist/2025-02-08/rustc-beta-loongarch64-unknown-linux-gnu.tar.xz=5452b62e9cccb5dac1cd36b01d31b11ac97c85bf4f82a559a15a08c278061d78 +dist/2025-02-08/rustc-beta-loongarch64-unknown-linux-musl.tar.gz=eb9d9ac867835710ef4dd301aed0afbfeb4221c818ef4d7f70f4bb2b5bc02790 +dist/2025-02-08/rustc-beta-loongarch64-unknown-linux-musl.tar.xz=0afbff667ada4671511c48d6c5558009f395f3c2f3ad3d10c716882f6c9860f6 +dist/2025-02-08/rustc-beta-powerpc-unknown-linux-gnu.tar.gz=db77ef515643b4ced71ab9ffce80338fe99b03abd6b7672f627f38e33e6642d9 +dist/2025-02-08/rustc-beta-powerpc-unknown-linux-gnu.tar.xz=cac3b683fb606be111d5788b1a4194ec0ea77e0226350454cb7d1904d6f2f78e +dist/2025-02-08/rustc-beta-powerpc64-unknown-linux-gnu.tar.gz=a86bb2a0cd6f2c25f6f6c55b070a3f841c0a006588f759d0aa7c8d6b3401d904 +dist/2025-02-08/rustc-beta-powerpc64-unknown-linux-gnu.tar.xz=050e07098291a659baa3fb31e2a83c7e6e203614139dab3f3eb2c486c20b9f8b +dist/2025-02-08/rustc-beta-powerpc64le-unknown-linux-gnu.tar.gz=c20d1b649bb28b8abba4a5dd8e881a03061ebe091e5cdbc44310706fc76b55b0 +dist/2025-02-08/rustc-beta-powerpc64le-unknown-linux-gnu.tar.xz=24c742968242e5bb3d81b865c0fdfdb021772a40fe4d25f3b83fdcf8ccb087bd +dist/2025-02-08/rustc-beta-powerpc64le-unknown-linux-musl.tar.gz=2aa9e78148c44ae2c01f554449811993e592aa9c428de37fbdb42dead53eb60c +dist/2025-02-08/rustc-beta-powerpc64le-unknown-linux-musl.tar.xz=2e6751dacf4ce4a60c61e1fa8afb746ac38285c62e567df78f2de27ce25e5770 +dist/2025-02-08/rustc-beta-riscv64gc-unknown-linux-gnu.tar.gz=d0d365fdba806bda1263767d40365da7b5c2e5d01cfe6e9e4c5a2fd66ad4608a +dist/2025-02-08/rustc-beta-riscv64gc-unknown-linux-gnu.tar.xz=fef429294c81caa19fc0dac00eda00d55c087e94c7235e032b17c2b4f5556850 +dist/2025-02-08/rustc-beta-s390x-unknown-linux-gnu.tar.gz=75ea2ad9e2377d09c9517a932126f876eaf377ff0f38a382187bb4a8c31be34e +dist/2025-02-08/rustc-beta-s390x-unknown-linux-gnu.tar.xz=908e6fff603ef6d0721efc24e8faf014f5cafa71fc0220da4dac5c870b974c04 +dist/2025-02-08/rustc-beta-x86_64-apple-darwin.tar.gz=ccea051b3787d3682258edcfa6a35f2d7a44ac5c3d8117fcd55cc0a97e7b9b92 +dist/2025-02-08/rustc-beta-x86_64-apple-darwin.tar.xz=3555ff1e179da6a249861086c8986039ab7dcdcf581beb1f27246f987da436f6 +dist/2025-02-08/rustc-beta-x86_64-pc-windows-gnu.tar.gz=227da932cd028d2c2415f4df4c14daf225e2a917a0879e1debcee2b8ebbfc790 +dist/2025-02-08/rustc-beta-x86_64-pc-windows-gnu.tar.xz=231c0fb2989746424f8ad394e9015ef13a6b991a50f62009e7bca3e010e9320e +dist/2025-02-08/rustc-beta-x86_64-pc-windows-msvc.tar.gz=b75be89ce511758f7b9ab6b5701155349e5675e4b85975c33a91483d78666927 +dist/2025-02-08/rustc-beta-x86_64-pc-windows-msvc.tar.xz=bf529ca4409fefe3d38e2b0ee6b3102e9f8b7ace4352bea7e6d3148a84e98767 +dist/2025-02-08/rustc-beta-x86_64-unknown-freebsd.tar.gz=e2dcaf33887031f8d169ab734f3b3eb6858e5247097e46293c11ba1a2887a919 +dist/2025-02-08/rustc-beta-x86_64-unknown-freebsd.tar.xz=2cf5c49c04e57bcc34ada76ff22dd149c4d643b5af5766267663f2e0e4031d17 +dist/2025-02-08/rustc-beta-x86_64-unknown-illumos.tar.gz=c7572379985941a513b7b9e750043a74097655600cb34cb0460a34a5587b7e0d +dist/2025-02-08/rustc-beta-x86_64-unknown-illumos.tar.xz=4e98bbcbae02618c3f95a21fdb22b4e067ce0bacd8370076a1bf8107964d2896 +dist/2025-02-08/rustc-beta-x86_64-unknown-linux-gnu.tar.gz=bcc22d77b53b54bcb95a5b92b19af7cf5d3e4b4418c3c9ed1d5ab9db3cd6c3a0 +dist/2025-02-08/rustc-beta-x86_64-unknown-linux-gnu.tar.xz=8f3eb1b74e06bbdbf1d09e5df205677db6f6ff78e94f80fc1fd1441deed86f80 +dist/2025-02-08/rustc-beta-x86_64-unknown-linux-musl.tar.gz=ccd5ba2c7c7d8c8eeaae2f7c7b462945d7c7ac552d6175dd33c0b77ee3d6730b +dist/2025-02-08/rustc-beta-x86_64-unknown-linux-musl.tar.xz=ab198284a035b8b5ef584a925b5f7ef08228d1eeb43b17a33dab8c7ae93cbc96 +dist/2025-02-08/rustc-beta-x86_64-unknown-netbsd.tar.gz=5b52a1e3f591e6f65ac50d885cfa38e2bb655abc3db7f09ea860450b4b95d6e0 +dist/2025-02-08/rustc-beta-x86_64-unknown-netbsd.tar.xz=fad94b63a75e789df1e5d25e0bf44d1fc29146dea862006d5b1ffb5c20fdfc8d +dist/2025-02-08/rust-std-beta-aarch64-apple-darwin.tar.gz=19c355276bb12522f3c8e94e843e6e54434c66c4e2e49bf68e084d43e1c83350 +dist/2025-02-08/rust-std-beta-aarch64-apple-darwin.tar.xz=c05a1e3e86e2846c4322df02f9b02a1bf16edbf39d3394da56e1a8b3b36d9a60 +dist/2025-02-08/rust-std-beta-aarch64-apple-ios.tar.gz=ade5b194bd6b7737f505d201f6560ec3aeb41345ea692b2d262317fe0a3bfc38 +dist/2025-02-08/rust-std-beta-aarch64-apple-ios.tar.xz=026a233fab1b27e70dd1455a9a9a0f097d0617b720f82549a413bc4b2d9a2755 +dist/2025-02-08/rust-std-beta-aarch64-apple-ios-macabi.tar.gz=fe743c3895565a7e641b8727a0e96172e0a735bb77f9ced18e201f54d5bab19e +dist/2025-02-08/rust-std-beta-aarch64-apple-ios-macabi.tar.xz=66fd5b769ae7f0e4dd587fdf81ac31cb780cd20eadd082ef0252d7346354bfdb +dist/2025-02-08/rust-std-beta-aarch64-apple-ios-sim.tar.gz=ccc55643bde9f89be185b560e44d379ef85a0cc7f087f2f2bf7738d523b7a32d +dist/2025-02-08/rust-std-beta-aarch64-apple-ios-sim.tar.xz=b1d4c3de214fa207e987742ab73d316537ad9856eb3499d046f6aea4e9d3bc0c +dist/2025-02-08/rust-std-beta-aarch64-linux-android.tar.gz=b17466c9da602c1c282826bdd878e6ba4592906f74b0e8bbe3df302c2358ede4 +dist/2025-02-08/rust-std-beta-aarch64-linux-android.tar.xz=4addf9a4ed3ae4c80b097027fef7237261d2e9ada641e549cc91595c83614d6e +dist/2025-02-08/rust-std-beta-aarch64-pc-windows-gnullvm.tar.gz=391f0b460feb164d29ed222b322380586743b19ab03c217690e8053e22903d3e +dist/2025-02-08/rust-std-beta-aarch64-pc-windows-gnullvm.tar.xz=d81567dc4e204f7080854d0a3a7e7e16424758ff122dfc14448fa9da630932aa +dist/2025-02-08/rust-std-beta-aarch64-pc-windows-msvc.tar.gz=91ff95f6a56ee5db99e72b293ea2048be0fd5ac3788bd32d9fc97337e7ee8b68 +dist/2025-02-08/rust-std-beta-aarch64-pc-windows-msvc.tar.xz=d6eb64cdaa12fcc469687f99d03a30329847e89bf802361bb6acd61f65b0547e +dist/2025-02-08/rust-std-beta-aarch64-unknown-fuchsia.tar.gz=c9f43315d352ecddbc18a9034723c58d5d8ec77fffa9e0e82322743d162e3db7 +dist/2025-02-08/rust-std-beta-aarch64-unknown-fuchsia.tar.xz=2356a2902f91323d1492ef12fa2f17d1e4934748cec03d6621d6ecfe272f1c3e +dist/2025-02-08/rust-std-beta-aarch64-unknown-linux-gnu.tar.gz=ccc8c1777dc8d2e04d4d0640ece7b7820a8fea60a0fe371efcaa055972dcd7b3 +dist/2025-02-08/rust-std-beta-aarch64-unknown-linux-gnu.tar.xz=4208ef48af14c5feee97c16fe7e894777a479492760dc0eb838febf2eb92ece7 +dist/2025-02-08/rust-std-beta-aarch64-unknown-linux-musl.tar.gz=b67e319c5e447e9ebf4b9a7e51800e7d7aec3564f0829fa23df953d8ee714131 +dist/2025-02-08/rust-std-beta-aarch64-unknown-linux-musl.tar.xz=432ea33a49f0010125c960d7b93b585e7b4c91b34f9d07989cf1664bf7e71fe5 +dist/2025-02-08/rust-std-beta-aarch64-unknown-linux-ohos.tar.gz=53bbbc52c4f99733c7b4a1038fa014867c0d6ca8f1d7eccba651fab4f794247e +dist/2025-02-08/rust-std-beta-aarch64-unknown-linux-ohos.tar.xz=6df101f4d5416cba695be66b975a4e4dcab2a3041d079f0a454f342a6d24d7db +dist/2025-02-08/rust-std-beta-aarch64-unknown-none.tar.gz=f1ef3141ac9c634e7e6686cf3c13b83323eb168a249f596b1490f874372c1423 +dist/2025-02-08/rust-std-beta-aarch64-unknown-none.tar.xz=a709c52f479c73ed15709b3cb0b8e7641606cf86375a4c9a60b1c9d381c70183 +dist/2025-02-08/rust-std-beta-aarch64-unknown-none-softfloat.tar.gz=31b8fec1cd20dd1809bdf733209288d60de0f096fbd0cc2955982ce119703772 +dist/2025-02-08/rust-std-beta-aarch64-unknown-none-softfloat.tar.xz=afb3872ffa8ab3c79d08f713aeb76c658ea00a3b9d79d5516d89aa78ec1eab8e +dist/2025-02-08/rust-std-beta-aarch64-unknown-uefi.tar.gz=d73b90fa9d3a330274b2004ec535d396f90a82ac5b10fb8688f82472bd2c5ac1 +dist/2025-02-08/rust-std-beta-aarch64-unknown-uefi.tar.xz=ae05fa6bf0638b0e26fcb8bcac5973835aa965a56507588fa3d43981f20eee89 +dist/2025-02-08/rust-std-beta-arm-linux-androideabi.tar.gz=c18354734b678f0665dd60bb8765df00bca5d3fb7bb6e6a4b83e3cde971c26cf +dist/2025-02-08/rust-std-beta-arm-linux-androideabi.tar.xz=5f6bc44bbe3b24140fecad715cc5528249906bacf98fc3a0618a9c0cc92913e0 +dist/2025-02-08/rust-std-beta-arm-unknown-linux-gnueabi.tar.gz=d9a2ab83df4240431479fe27600ab1098333699e14103b8a627dc09a3dad6976 +dist/2025-02-08/rust-std-beta-arm-unknown-linux-gnueabi.tar.xz=4f95a441ff45c16fb8aa37432cffeef60f2e0711c9cb1015cf440f4da51d5425 +dist/2025-02-08/rust-std-beta-arm-unknown-linux-gnueabihf.tar.gz=dacdeceea6625041f75c3f2fad4382d2c957b9511666987695fed8e3a2216c88 +dist/2025-02-08/rust-std-beta-arm-unknown-linux-gnueabihf.tar.xz=e338c1d2cef57e4c4ef613e6b080371751b874f94a246ab32e872a008e9166ab +dist/2025-02-08/rust-std-beta-arm-unknown-linux-musleabi.tar.gz=8bd4174934e5d0e4dd8e757db494a238c95024be5336e6062923b479c0275b6a +dist/2025-02-08/rust-std-beta-arm-unknown-linux-musleabi.tar.xz=1637b8d23bc8052803d785f15031a75594860f2263808c9dee68dead29bcd37e +dist/2025-02-08/rust-std-beta-arm-unknown-linux-musleabihf.tar.gz=db6eb6a2af3395e1eee0060d0c022c74c0741c765009f081c0646d696bd0b873 +dist/2025-02-08/rust-std-beta-arm-unknown-linux-musleabihf.tar.xz=ca21a4af4de66abf9d31ae6b3fbc33df152656feef7a269bf7d039d2766176ee +dist/2025-02-08/rust-std-beta-arm64ec-pc-windows-msvc.tar.gz=118c52dfa7142c0ee281b126da5b043b2357b78e7e110000f490b20e6a1e7eed +dist/2025-02-08/rust-std-beta-arm64ec-pc-windows-msvc.tar.xz=558fbb7453a2e633630ed33ad150dce87fa515b5b443ae66c5f85ee27e0e771f +dist/2025-02-08/rust-std-beta-armebv7r-none-eabi.tar.gz=96ff6441b0577b25b83540dc803d692d3444bcd0b4f6128a7743970726facce9 +dist/2025-02-08/rust-std-beta-armebv7r-none-eabi.tar.xz=2621a9f82f73a3a2a2a0c6a7446549c5ad29a430a3e0b961909fe68da21b8491 +dist/2025-02-08/rust-std-beta-armebv7r-none-eabihf.tar.gz=0ef78d66dea96d1a6565fb3469bdcb3368f9e61a55a59a5d2508c54c091484e9 +dist/2025-02-08/rust-std-beta-armebv7r-none-eabihf.tar.xz=1c586301ae2a20ed1caaf0d62d985f9fd95bf2b937ebe7b6d738ca5812713722 +dist/2025-02-08/rust-std-beta-armv5te-unknown-linux-gnueabi.tar.gz=aaeb690b0a08e8f6546ac5608fade5852bb029db9189d6d036c69c4895c6ce32 +dist/2025-02-08/rust-std-beta-armv5te-unknown-linux-gnueabi.tar.xz=1d6ae672d5ebcd302a654c4347a386fabc3bf53aec9664cdf76b9c5a061d4eb1 +dist/2025-02-08/rust-std-beta-armv5te-unknown-linux-musleabi.tar.gz=5557c7444e72eb29c904436f0221cb40c3156c5289c39b7e8c1a057dfd56c394 +dist/2025-02-08/rust-std-beta-armv5te-unknown-linux-musleabi.tar.xz=ae9abe3580b1751854305200bd6a5dbf98aeef396e163534ac5521d04d7bfa7c +dist/2025-02-08/rust-std-beta-armv7-linux-androideabi.tar.gz=c466403dfb8e15cd674859fad24e2e0dd1ba100946c662a9bf29f2440f02a938 +dist/2025-02-08/rust-std-beta-armv7-linux-androideabi.tar.xz=83ad7b8237ae7ab0ddd6f43b604b27677ec9e83453f3127c356936af12140ee2 +dist/2025-02-08/rust-std-beta-armv7-unknown-linux-gnueabi.tar.gz=12489ebd742dd611937c2942c6f897608d1c4acb0fcb103a2a18f70b9b2d0596 +dist/2025-02-08/rust-std-beta-armv7-unknown-linux-gnueabi.tar.xz=54231b6c641736b29317682be9d1de9463e23478a892c16e083bc1bf20c9c925 +dist/2025-02-08/rust-std-beta-armv7-unknown-linux-gnueabihf.tar.gz=e41b6582cc6eb2340208a3473d54d441e13fab87bfee3091a513da4039c224c6 +dist/2025-02-08/rust-std-beta-armv7-unknown-linux-gnueabihf.tar.xz=9ca2df0ba2afd630a94a3bac08f8c412fdb6f905333c8978ac9b6bb5be777774 +dist/2025-02-08/rust-std-beta-armv7-unknown-linux-musleabi.tar.gz=dd9f6f6d930d18dc5e1764691acd2e33cdd032ef757d534ea70202fcdc18e461 +dist/2025-02-08/rust-std-beta-armv7-unknown-linux-musleabi.tar.xz=9d0e4864ecb7e33b231dedd10b54ad7707d79c61ff455256fd693a46a4ecddb5 +dist/2025-02-08/rust-std-beta-armv7-unknown-linux-musleabihf.tar.gz=b508af76bcabed45442fc1587ea1c74bbbf85d75fbd2fb64d7078cd799485ae6 +dist/2025-02-08/rust-std-beta-armv7-unknown-linux-musleabihf.tar.xz=3f9916a37ac0b79586756f09986516ba08e1c24b4d4675bd17d66058e42494cd +dist/2025-02-08/rust-std-beta-armv7-unknown-linux-ohos.tar.gz=a80bdd0178f0b9c98c2fe80e59a1b936115a509d9b1be0202bea09d275b4c5d0 +dist/2025-02-08/rust-std-beta-armv7-unknown-linux-ohos.tar.xz=6cb0340d4633e52f7a6f3419a0f18a9d0b75f604fbfe99ce5886186f81204264 +dist/2025-02-08/rust-std-beta-armv7a-none-eabi.tar.gz=f9ac794582c73c7e0a36990daa6c2e2d637213dc16a0063aed330bf68cf04d4d +dist/2025-02-08/rust-std-beta-armv7a-none-eabi.tar.xz=7463c6f6e9ba1bc056ab528e00017db0d6ac2b0e06812f0b1d7b569a8a7e51ab +dist/2025-02-08/rust-std-beta-armv7r-none-eabi.tar.gz=c676cfbcaae8c7686a231693b923f98e23ed3dfa174ecf42aab57d94e2bddd85 +dist/2025-02-08/rust-std-beta-armv7r-none-eabi.tar.xz=93b2802c8f555fdf03cd309539eabfa2f8e434114f8f750b89ec3005249e9b91 +dist/2025-02-08/rust-std-beta-armv7r-none-eabihf.tar.gz=077cf1bbe4fdb0c011bd625a59ebc4b3d2876a50b544b76934523504c59042b9 +dist/2025-02-08/rust-std-beta-armv7r-none-eabihf.tar.xz=3be6d9e04ad155e78be5ecce391b57b285c7675cd9a4f86e2ddb388c934c21f8 +dist/2025-02-08/rust-std-beta-i586-pc-windows-msvc.tar.gz=2e705d5660544cec738cda300b059dcc1d730f7ff3cb029980a1ac9c1f9e6831 +dist/2025-02-08/rust-std-beta-i586-pc-windows-msvc.tar.xz=4cc0760e20f53648ae5b171c6948af3950cda4c468f2bb437016d92a2eeb2465 +dist/2025-02-08/rust-std-beta-i586-unknown-linux-gnu.tar.gz=3a516cf5c265899c9a548f6b9305b78069cc03864dcf1b3fa0e247adfa978cb8 +dist/2025-02-08/rust-std-beta-i586-unknown-linux-gnu.tar.xz=25144f4fb500ab9ba438042dd24796b25660fc3d16d3e04b64561bd35f84e46b +dist/2025-02-08/rust-std-beta-i586-unknown-linux-musl.tar.gz=70bf9429de2e11fe9e14216d3c1cc61a3923e1a7c7bc17d5b0d63785716a9e26 +dist/2025-02-08/rust-std-beta-i586-unknown-linux-musl.tar.xz=35cfef70aa5c59ecbe0d563959c62ec0162a8943d32cdc45dd0207b6ad3d16eb +dist/2025-02-08/rust-std-beta-i686-linux-android.tar.gz=a17f82a5f41e38c5c9ccaf1b2cf5182ed2e3c459e87c841497f0594cda7f71bf +dist/2025-02-08/rust-std-beta-i686-linux-android.tar.xz=06565daae363ed88f579f261a89f75d126785c894e439976ae47870cedd56378 +dist/2025-02-08/rust-std-beta-i686-pc-windows-gnu.tar.gz=986595d50c1c5799f67bd04575b248c5cd81dc03f318bd137b46248f75b2727f +dist/2025-02-08/rust-std-beta-i686-pc-windows-gnu.tar.xz=9daf96aa939ec6ed4ac8ff6119da06fca827a7f160e5c7db658653d5839846af +dist/2025-02-08/rust-std-beta-i686-pc-windows-gnullvm.tar.gz=f793d7a5ce20392287a7d178a2403d1d72dec2437401c447a7c5e3168c25bcf6 +dist/2025-02-08/rust-std-beta-i686-pc-windows-gnullvm.tar.xz=039a361f65fd610b14142f0d654895f4ac271cfb03918f7fcd8b2e9c5ffc3c98 +dist/2025-02-08/rust-std-beta-i686-pc-windows-msvc.tar.gz=6cdd125eafa981da12bff2a7e519866cfe40b7d6d7b6debabbd2415759fd9dc8 +dist/2025-02-08/rust-std-beta-i686-pc-windows-msvc.tar.xz=7f1a722bc007efe77dbd099ff36f2c682ec4bcdb7e8b60d6ad868e9d08a9a367 +dist/2025-02-08/rust-std-beta-i686-unknown-freebsd.tar.gz=b7dc78d6d4e6ce343ce90a7153082575a991eebd8acbc3cdfbcb56d1cc281b83 +dist/2025-02-08/rust-std-beta-i686-unknown-freebsd.tar.xz=91d19c3086de738b3d11a2bd0f0ad31c9f6a9c39ef800fdb2040638fc91c69ac +dist/2025-02-08/rust-std-beta-i686-unknown-linux-gnu.tar.gz=fdd0f12816d4bfc15c441cd26c7ef0f9ac05f19b03f471f162e8781f04bfc392 +dist/2025-02-08/rust-std-beta-i686-unknown-linux-gnu.tar.xz=a1ba9ce61110a1a64cba2bad7274865979d8d10cf30dba44137cd0acd4b49bf1 +dist/2025-02-08/rust-std-beta-i686-unknown-linux-musl.tar.gz=3774b47f5d6748c32d634f0414391121f2a68d7e3e15162cce62ca42bfce1db3 +dist/2025-02-08/rust-std-beta-i686-unknown-linux-musl.tar.xz=fb0203eb986554773288b732feb65a76aa7e4510b30acf60a9a879614332f0e1 +dist/2025-02-08/rust-std-beta-i686-unknown-uefi.tar.gz=a388f43900f4ac040e2263f06e89ef92c3d630f2631b37147eb1234e3ff5555b +dist/2025-02-08/rust-std-beta-i686-unknown-uefi.tar.xz=5fcc43194705468d31fc07ea2cca780fef717adc2d46bd9508d006adcd237c23 +dist/2025-02-08/rust-std-beta-loongarch64-unknown-linux-gnu.tar.gz=c1d25f88813fb558bf47478a7e2a43e735f2e7ceba87f3ab8e658200825ac6a5 +dist/2025-02-08/rust-std-beta-loongarch64-unknown-linux-gnu.tar.xz=66ae16763fba1c9e54519a34b70811f4b54c2a3985bd0faab4ae1a454f837556 +dist/2025-02-08/rust-std-beta-loongarch64-unknown-linux-musl.tar.gz=0cf97c80c7dc0e760d9aa2f6a6d6b82ecceed06b0c0e7f56b2f3fee98f558d3e +dist/2025-02-08/rust-std-beta-loongarch64-unknown-linux-musl.tar.xz=7b8284890d5c90e9a3d2cee73ee6b77ed0f023321a547a9add7d25e64886c9b9 +dist/2025-02-08/rust-std-beta-loongarch64-unknown-none.tar.gz=67f97000b8786928eb7ff7f060fdaa2fa9e3805c23e5f3fc24350c6ab0954c17 +dist/2025-02-08/rust-std-beta-loongarch64-unknown-none.tar.xz=5660100854fbe9fd87c0854b560a91dd5b653f07a0c374ba6349c44ff54b3b76 +dist/2025-02-08/rust-std-beta-loongarch64-unknown-none-softfloat.tar.gz=a885c29e4eea19ada52cc22bfe395eb0f2e884932885c3978187a44405d5873a +dist/2025-02-08/rust-std-beta-loongarch64-unknown-none-softfloat.tar.xz=acbfef3c94943ebc1a44e662a5eeffea6c3c0f8b2518568b03d2e1c5baf323ea +dist/2025-02-08/rust-std-beta-nvptx64-nvidia-cuda.tar.gz=2bb3f9493afdd89c52bd62e2597c8687335e0d4fbe5a486782335a614881a516 +dist/2025-02-08/rust-std-beta-nvptx64-nvidia-cuda.tar.xz=0702664eceb39c21390e3ee8dbfc0a7a181877449642b1b47dc74e1f463d8ebc +dist/2025-02-08/rust-std-beta-powerpc-unknown-linux-gnu.tar.gz=788b46512726f8350f8266f4dc7e3bd4108ea96b2c257876d42d6c62cef71507 +dist/2025-02-08/rust-std-beta-powerpc-unknown-linux-gnu.tar.xz=a746eeeb6c41696c95144068e348237bc7a3b254b1c3db626797dd2947194999 +dist/2025-02-08/rust-std-beta-powerpc64-unknown-linux-gnu.tar.gz=48f11a2d3aee9b3cb8d9e7f6480c8859427f446ebde617e2575a17dda6605fc7 +dist/2025-02-08/rust-std-beta-powerpc64-unknown-linux-gnu.tar.xz=5a3933b2465cfe93daab1b5d339a0da17bc364d5621d85e192283250b337e38f +dist/2025-02-08/rust-std-beta-powerpc64le-unknown-linux-gnu.tar.gz=50bddd9780ebcb5bc081b41c071c6059618881e1cc384f30787caa6fd2f28127 +dist/2025-02-08/rust-std-beta-powerpc64le-unknown-linux-gnu.tar.xz=4630d67082a6c2211a8c59a6da45d260616bd026d7cf7d2bbee5ae6d24b218c1 +dist/2025-02-08/rust-std-beta-powerpc64le-unknown-linux-musl.tar.gz=4a0bcf103df6febd7b3e04bb24d54b30b6a2f4ffaf150f6774811c149f450588 +dist/2025-02-08/rust-std-beta-powerpc64le-unknown-linux-musl.tar.xz=6a37963463641ddc14e03c0f9d8b037cd62afe3af89aeaa73f1f1d3aea1a6f93 +dist/2025-02-08/rust-std-beta-riscv32i-unknown-none-elf.tar.gz=7e2c0f7ea78086cc2b8674aacf350b6de737ca68a51778a8a66c75932161a8a8 +dist/2025-02-08/rust-std-beta-riscv32i-unknown-none-elf.tar.xz=a575b31731a910d2db684a931ced914b4286b942ce878fde94f08bafae92903c +dist/2025-02-08/rust-std-beta-riscv32im-unknown-none-elf.tar.gz=096407f438062be73bdd4f2efb6e06ddcb6c6c8e08b3c2db76388a4f4c4a731f +dist/2025-02-08/rust-std-beta-riscv32im-unknown-none-elf.tar.xz=38b771d01c0a56330d9547692c424e92b243d3f2448c13b29873cb2e4fe70b17 +dist/2025-02-08/rust-std-beta-riscv32imac-unknown-none-elf.tar.gz=218d5db0b8427fcc0a81612134d830e6807db8d66eaa4365c4b101f29ab75ae2 +dist/2025-02-08/rust-std-beta-riscv32imac-unknown-none-elf.tar.xz=1227b4dbfe7f3a0c7715904d3ed1e9f9846c49e522bb579d7dd76de370ab83a2 +dist/2025-02-08/rust-std-beta-riscv32imafc-unknown-none-elf.tar.gz=8e5ad6f6116b0fef61650f2a3788cc9a9e6da1cd76dd0dc300d81060ef42ee6b +dist/2025-02-08/rust-std-beta-riscv32imafc-unknown-none-elf.tar.xz=777cc9ec22cb9b92ea3569d6835770f45ea7793397be670edeafa65660d411eb +dist/2025-02-08/rust-std-beta-riscv32imc-unknown-none-elf.tar.gz=16d6414fcbfd0356206cccb10f0d5ec1391300c8bd92029d9457fc3030cf3cff +dist/2025-02-08/rust-std-beta-riscv32imc-unknown-none-elf.tar.xz=bd4ffe303e7b6a9031eae2dca7b4af4c7095e06961a55a6eff01db57178c1635 +dist/2025-02-08/rust-std-beta-riscv64gc-unknown-linux-gnu.tar.gz=facbe91da7b765e03b058682a1353153b89632f5f60692b25077ba4152105faf +dist/2025-02-08/rust-std-beta-riscv64gc-unknown-linux-gnu.tar.xz=e130dbd1aa2f19c308ca3e72e0456769ab0898a9bacdc667261396d786a22fca +dist/2025-02-08/rust-std-beta-riscv64gc-unknown-linux-musl.tar.gz=3849880a18e3176c4acb895dcee7f5befa64ad3413ac8476325d97a9a2bbc542 +dist/2025-02-08/rust-std-beta-riscv64gc-unknown-linux-musl.tar.xz=8a14b3cb0c9e20ec84ab686e6eca5acd201e71364ab5007c96b884feb4b59340 +dist/2025-02-08/rust-std-beta-riscv64gc-unknown-none-elf.tar.gz=f5f58c50d793cb26103f812bb32b2d3623c57319a141e151201764f20032262b +dist/2025-02-08/rust-std-beta-riscv64gc-unknown-none-elf.tar.xz=db7ea697f41b8dc2610c6d71ded8dc0b80ec848c002cb6af8faa3105023ec424 +dist/2025-02-08/rust-std-beta-riscv64imac-unknown-none-elf.tar.gz=b081a9b131703cbc11658eb84e54e495fca021bdc6487d902c7aeb8126629437 +dist/2025-02-08/rust-std-beta-riscv64imac-unknown-none-elf.tar.xz=2a3327ffdd3bfb9b4ce6d1aa13202958587d0819dc49ce08e635970d8e608b6c +dist/2025-02-08/rust-std-beta-s390x-unknown-linux-gnu.tar.gz=3b0abfeb0a6bda721e1faad0fe4ed2db072ae04beaef53d895f3902a26387522 +dist/2025-02-08/rust-std-beta-s390x-unknown-linux-gnu.tar.xz=5d6314a99746c5fd7f1d0eb0ac426848b4baafb9e2f4e08b7ce361091909a485 +dist/2025-02-08/rust-std-beta-sparc64-unknown-linux-gnu.tar.gz=01f85bdc840f6d354fbc765b2574cbf039a97e7a8cd4345f31d4a93f41ea2936 +dist/2025-02-08/rust-std-beta-sparc64-unknown-linux-gnu.tar.xz=350aa8e77ce705d04d996ae3911121c14213fed5db6d179ae4efeb54e64d5554 +dist/2025-02-08/rust-std-beta-sparcv9-sun-solaris.tar.gz=4cdb48054bcd8c596657c466145e1ec9d9a513d6019694895b7b1218183d7ed1 +dist/2025-02-08/rust-std-beta-sparcv9-sun-solaris.tar.xz=abda0bf8356c63fcf50fafb196c86a6c2275f3155362fe6b9eb63c8a145e07dc +dist/2025-02-08/rust-std-beta-thumbv6m-none-eabi.tar.gz=87ce4c701797be511509773e6121d69470d604f143c4e46e18866105193d503e +dist/2025-02-08/rust-std-beta-thumbv6m-none-eabi.tar.xz=d0af4c523a37df6ef2519d2abd680e2abc21e8806904cbbfa2bad3ddebc55252 +dist/2025-02-08/rust-std-beta-thumbv7em-none-eabi.tar.gz=9c183442ae8a7bf18303331e23c2263d180157a4fa9d000735b57f54f894fbf3 +dist/2025-02-08/rust-std-beta-thumbv7em-none-eabi.tar.xz=c9278b82123969a4f9c8536f6d27ceb6b6cae182335cee4cfc1ba8f297d503c7 +dist/2025-02-08/rust-std-beta-thumbv7em-none-eabihf.tar.gz=cda7f615c006369dea46c6d00660d596459d2ca809b27802c15a9e71e741f806 +dist/2025-02-08/rust-std-beta-thumbv7em-none-eabihf.tar.xz=7b2bf45033d1849ced101c696641a3e0037dc65029bea06fcedf3b11af1b21b8 +dist/2025-02-08/rust-std-beta-thumbv7m-none-eabi.tar.gz=bbe3db6ddb17830708086940294a8931054c09d781968f69c810a5a17cb4299d +dist/2025-02-08/rust-std-beta-thumbv7m-none-eabi.tar.xz=4cf28e2656f8927cbb75c007aded9d0fcac8d8d34841e9ac5486ba8ad3a75a58 +dist/2025-02-08/rust-std-beta-thumbv7neon-linux-androideabi.tar.gz=6021afefa8b06c99e09e63c07a8d4580ef7a6d9e004205d85f8fea47fb7c77d7 +dist/2025-02-08/rust-std-beta-thumbv7neon-linux-androideabi.tar.xz=7fb5c89a7605b0b377fd3e11d3ac5e33dc59667557b690b02df5c852109cefe8 +dist/2025-02-08/rust-std-beta-thumbv7neon-unknown-linux-gnueabihf.tar.gz=f1cbb573556272077f7a119e019ee4c1f8c533cfcbdb2b12c858c7d72c05212a +dist/2025-02-08/rust-std-beta-thumbv7neon-unknown-linux-gnueabihf.tar.xz=2d7c0f7ece15f6ad5de053a4b0292113efd8b45457a7ea4ac4a84534985a6e7c +dist/2025-02-08/rust-std-beta-thumbv8m.base-none-eabi.tar.gz=fb5c1d99eeedb48edac78bce237351bb2a04b3ce1e028b47c488a28a0f5b258d +dist/2025-02-08/rust-std-beta-thumbv8m.base-none-eabi.tar.xz=301ced2f4ca8766183cfbd84b94ca09f21c9c2fee62b3e1afca440f5872ec6f0 +dist/2025-02-08/rust-std-beta-thumbv8m.main-none-eabi.tar.gz=c720cd1896d201ecee177381386cf37ff58a0ad2e153efa8752dc11358489774 +dist/2025-02-08/rust-std-beta-thumbv8m.main-none-eabi.tar.xz=f2e14c2a08777200dcec2c18677a1bd68c57a7caaed8751e17d4a82af0f61e9c +dist/2025-02-08/rust-std-beta-thumbv8m.main-none-eabihf.tar.gz=146bfeecf574cab3bc15396c2523f27cc463ba9030d9a8c9a07118781a78227c +dist/2025-02-08/rust-std-beta-thumbv8m.main-none-eabihf.tar.xz=093364007abdcb942a1d095bba6b3f6a63cb891e3897764923828db5aa44f970 +dist/2025-02-08/rust-std-beta-wasm32-unknown-emscripten.tar.gz=f2e4ef8637a02510dc3edf78f7117dc16671946e1eebf3ee8911160bde53f3a2 +dist/2025-02-08/rust-std-beta-wasm32-unknown-emscripten.tar.xz=d30b8b9a7607de4cee24b144452439726eb8b4a436f53c058c2b0c21b686a391 +dist/2025-02-08/rust-std-beta-wasm32-unknown-unknown.tar.gz=242403cc6e3df3d47c566c63fccfb40e6a95d2f2295630bb13f4875c9e28ae62 +dist/2025-02-08/rust-std-beta-wasm32-unknown-unknown.tar.xz=8ba08c010e49593d417feb05f3efe407200421bc26d40b51a8d92ae6cbc46200 +dist/2025-02-08/rust-std-beta-wasm32-wasip1.tar.gz=25cdad2de0d599c5e90373765acba871e2facc7656ea1362b3e0d1132fe8805b +dist/2025-02-08/rust-std-beta-wasm32-wasip1.tar.xz=0eb3ae579124a47f7e8b63e6933e703d00c535f8369c614678e35c431a5480ff +dist/2025-02-08/rust-std-beta-wasm32-wasip1-threads.tar.gz=08d400d8ad036c2b240f4044adc6cf484cf996b5f1cca5e9c0fe81814a71635e +dist/2025-02-08/rust-std-beta-wasm32-wasip1-threads.tar.xz=46aeb5066e5fe4bc613a704c760292a85d2cd5ae10d135412adf5cb42de24015 +dist/2025-02-08/rust-std-beta-wasm32-wasip2.tar.gz=9df47e7c8280b8780ca41ed3dac9326375c76955560491ade1c2fdc8682b70d4 +dist/2025-02-08/rust-std-beta-wasm32-wasip2.tar.xz=275cc332f6d29c685ecfc308e143edccf58fce0359f632b038733a7759ae7389 +dist/2025-02-08/rust-std-beta-wasm32v1-none.tar.gz=96ee2faa07796474ea348b83b626cfa0bd07d108ffd05aed8051b63960315ee5 +dist/2025-02-08/rust-std-beta-wasm32v1-none.tar.xz=965650429f8129c65a6180025fdb69c0890f5c6f9c1fc16566c08b055e4ed93c +dist/2025-02-08/rust-std-beta-x86_64-apple-darwin.tar.gz=92ebd93de4f4da8267e13824db8455dbcb7bb95ffda8ae480c648c2eb8f820da +dist/2025-02-08/rust-std-beta-x86_64-apple-darwin.tar.xz=00e4b5a44f69a2c9235e522eee91e972624c75e3ce773928b09e9ee20d2d51ba +dist/2025-02-08/rust-std-beta-x86_64-apple-ios.tar.gz=dfb3d88798ff9b490c1a517d57e459a77cf2bb2e8b427493a3a612405534ebb3 +dist/2025-02-08/rust-std-beta-x86_64-apple-ios.tar.xz=7091bae8ccf328336261c2b096d1565c0dc9dca02b03d4e228a7c3f4c412a6df +dist/2025-02-08/rust-std-beta-x86_64-apple-ios-macabi.tar.gz=79628c744d12c1bc5514801a530d903ec539efd16e82d0c871adfaa168b7f55b +dist/2025-02-08/rust-std-beta-x86_64-apple-ios-macabi.tar.xz=2b12ae64c94a4f11591de8484998391d2825bc68535257dd305d31a1c51a7210 +dist/2025-02-08/rust-std-beta-x86_64-fortanix-unknown-sgx.tar.gz=54f4caf75ac93676fd61fec65e2ea6b73774d5de7d7abe8d47d9c2d8030d8fe0 +dist/2025-02-08/rust-std-beta-x86_64-fortanix-unknown-sgx.tar.xz=abc1feb82d4449c0d098a1ee0861ad991e79911cf0d5cc9ed9b5ca1e134248e6 +dist/2025-02-08/rust-std-beta-x86_64-linux-android.tar.gz=fdc1afd6334f725cfd913faf0915da711cdbcc45c05ec2672fae34d97e73ca60 +dist/2025-02-08/rust-std-beta-x86_64-linux-android.tar.xz=9451c74b695dce762d56354fac148263b0a7de75209c127bc7126da54ede7114 +dist/2025-02-08/rust-std-beta-x86_64-pc-solaris.tar.gz=d32731be8a9d3c5e8279a1b4971d105fe457717acbdfcfd720bc0ae55a34df26 +dist/2025-02-08/rust-std-beta-x86_64-pc-solaris.tar.xz=a5a08cfaae7eb3d77c137bf0d436beb7a84a19e351f529fe459861a8841df44c +dist/2025-02-08/rust-std-beta-x86_64-pc-windows-gnu.tar.gz=7c41f46506f93132c5f90184d7ad1577edec98d47be17c6330f24cd172c673d5 +dist/2025-02-08/rust-std-beta-x86_64-pc-windows-gnu.tar.xz=e439c8a7368e70685b239ab7b84bffcd8081ddc80c2d9f6d2b686485316aed68 +dist/2025-02-08/rust-std-beta-x86_64-pc-windows-gnullvm.tar.gz=128c7e526e37551ba3b6a347cb870c4ceefb272d964512fa10635c8f1f6e239c +dist/2025-02-08/rust-std-beta-x86_64-pc-windows-gnullvm.tar.xz=660409184e81625419b91a4fb5d84572abb0505d9bc11bacbed50121f9230790 +dist/2025-02-08/rust-std-beta-x86_64-pc-windows-msvc.tar.gz=10b37018a254f81e55f555628fcc535a54b0eae0097f02a148c443a3d7e762f9 +dist/2025-02-08/rust-std-beta-x86_64-pc-windows-msvc.tar.xz=d61e44948d2ea70b44c8d3f958a3657dae9eb8a551aedb3ef90327da0124d9d5 +dist/2025-02-08/rust-std-beta-x86_64-unknown-freebsd.tar.gz=7ed5b948a50946b518040170be16cba1b5ec0c02f823436c973e5afbd335d26b +dist/2025-02-08/rust-std-beta-x86_64-unknown-freebsd.tar.xz=0bdce5b2f88448dbbe101f4ef48231763739533b52c32ab6ef858b6b37d98a50 +dist/2025-02-08/rust-std-beta-x86_64-unknown-fuchsia.tar.gz=49676d645ef9c49a421f3fa1d908830b61542541f1ea12c2d240ceaac3b977d4 +dist/2025-02-08/rust-std-beta-x86_64-unknown-fuchsia.tar.xz=1c0854c619e2a0dd7e508513fb68c22352ddc170572bfe6535d2f759de069c53 +dist/2025-02-08/rust-std-beta-x86_64-unknown-illumos.tar.gz=8ded61102c481e7c000292a8c6d39d84c016f81b00618947ac7357a7c72fb142 +dist/2025-02-08/rust-std-beta-x86_64-unknown-illumos.tar.xz=b76ed9b0896cfe863fd2aff88fd6d075e6091a651cb0d5fa65307948316f7ebd +dist/2025-02-08/rust-std-beta-x86_64-unknown-linux-gnu.tar.gz=1cbcf5ae9dd2c61212b82bf27bf1b1b7d9504f077119c1fa04a978fa0ef3b2e6 +dist/2025-02-08/rust-std-beta-x86_64-unknown-linux-gnu.tar.xz=86f236dc4222f5f93f160ca847f43f364e1659b6d4c9f68a31c202f5346f2221 +dist/2025-02-08/rust-std-beta-x86_64-unknown-linux-gnux32.tar.gz=2225ae88e8cf954b7eef8fc2e4f391c0194fd7be6433928dbc8aa6e2235ac479 +dist/2025-02-08/rust-std-beta-x86_64-unknown-linux-gnux32.tar.xz=6017a3197b7a103a4444b81f8fa4f790a2b11bf1c3db0af297e2ed0c97f78172 +dist/2025-02-08/rust-std-beta-x86_64-unknown-linux-musl.tar.gz=e7b3c4d8efb8f56fa76c3cfe51eb0683fc41308691ac194b9eb70e13b1b2e976 +dist/2025-02-08/rust-std-beta-x86_64-unknown-linux-musl.tar.xz=f0ad48db569e21b8fa1053de3320d766cbb10962ebbd69ed56f170bdaf76fe45 +dist/2025-02-08/rust-std-beta-x86_64-unknown-linux-ohos.tar.gz=f1baa7f02c0969d74cd0ba420ae0a8d5e761cd5545c04fd2e432c889db8cb655 +dist/2025-02-08/rust-std-beta-x86_64-unknown-linux-ohos.tar.xz=e572e1a7db7e0127bf7072e5361b91dac84c019afa6433538b40dc984957f1d7 +dist/2025-02-08/rust-std-beta-x86_64-unknown-netbsd.tar.gz=c714b5f4a61041b5c68abc532203c88d65a852a813b7af8e11ab3207804886fc +dist/2025-02-08/rust-std-beta-x86_64-unknown-netbsd.tar.xz=61d6c87b146f114d14fe637257b9feccbb1d787958a7291f7800c7541bd8e21b +dist/2025-02-08/rust-std-beta-x86_64-unknown-none.tar.gz=5ab7c9985beb3f07520cecbb60c2fcb8bf60b3079b253267fb55d2139619331a +dist/2025-02-08/rust-std-beta-x86_64-unknown-none.tar.xz=992257d8f922654977d1c1fdad2b57654b4ea7fd2c27d6a4bcb8f85b9a75fc5a +dist/2025-02-08/rust-std-beta-x86_64-unknown-redox.tar.gz=e5090b881329fd94e4250cef92464bf3fc42ae6566ab3bf461e1f3c843d3d1fe +dist/2025-02-08/rust-std-beta-x86_64-unknown-redox.tar.xz=89cc1ad229a453c15d4a88137646d6824c572eed602c9c131982e3ddc62abd75 +dist/2025-02-08/rust-std-beta-x86_64-unknown-uefi.tar.gz=f42383deea91ab9dfdffede178b4411d751772a482811058dfc0bcc33da2fab6 +dist/2025-02-08/rust-std-beta-x86_64-unknown-uefi.tar.xz=3b4e67edf9785c0eff0fd83e357fbd4c0840620d1b7380ba5d270729f751e4b1 +dist/2025-02-08/cargo-beta-aarch64-apple-darwin.tar.gz=f197e428af3ea3d409a43b54372c9f0f7f8f70ef8d048e066b5c609364211e35 +dist/2025-02-08/cargo-beta-aarch64-apple-darwin.tar.xz=e84b8ec6f87512fbf31c823703b94ebee8531675430224331845158b8997121f +dist/2025-02-08/cargo-beta-aarch64-pc-windows-msvc.tar.gz=16b73927483117d158a3f3aa36d9cd14d74dce707071345fab9e6c359b68665b +dist/2025-02-08/cargo-beta-aarch64-pc-windows-msvc.tar.xz=3fb1381b750a1ccf386602394af21130e9cc6384b962bd008ffb2e11bcac4c1b +dist/2025-02-08/cargo-beta-aarch64-unknown-linux-gnu.tar.gz=2b0d90694987ee10a0f0e5b40c1f95c65c9bbeae6c921556b85067a1920f5988 +dist/2025-02-08/cargo-beta-aarch64-unknown-linux-gnu.tar.xz=b47667e97225ce7542c6e9a137adbc7c002ee1e4b1e0c1255b5dcb87743d886f +dist/2025-02-08/cargo-beta-aarch64-unknown-linux-musl.tar.gz=843bea38aaeaf6629060a046e6654fde6f4a73221a996e56ea9a1f35466cc6cb +dist/2025-02-08/cargo-beta-aarch64-unknown-linux-musl.tar.xz=147827cb32d5ff3628f347800a9202eb0b3caaa142d363dffde94bc6bf821352 +dist/2025-02-08/cargo-beta-arm-unknown-linux-gnueabi.tar.gz=0dd6585f3e93a60d4084a4f7f6c58748e82c03ea38fee164828d3911d024459b +dist/2025-02-08/cargo-beta-arm-unknown-linux-gnueabi.tar.xz=2e8240d79a86de26e7782265bd6551c6357a025b7084a3ba88161c84e2fee54b +dist/2025-02-08/cargo-beta-arm-unknown-linux-gnueabihf.tar.gz=323095df9d5c9f47463c5b05729960ee0db5f910619050ed548adb2b8c59fc35 +dist/2025-02-08/cargo-beta-arm-unknown-linux-gnueabihf.tar.xz=8f5be63da1f8e9a7d90116c9793e03021855dde170a356002f306180d4ba7ff7 +dist/2025-02-08/cargo-beta-armv7-unknown-linux-gnueabihf.tar.gz=63dfca05df7a8d14c27070ce882a96defa2e5c3134fe17e848273694b42b3c88 +dist/2025-02-08/cargo-beta-armv7-unknown-linux-gnueabihf.tar.xz=3881f42ce8e69953804cb0c566fe08f44ab8763cefe8c0d6a4461645dd44f518 +dist/2025-02-08/cargo-beta-i686-pc-windows-gnu.tar.gz=70aabf19aa3db89599131fc09fc005a9c8c0974d3f04267df0e41007f5bc46d7 +dist/2025-02-08/cargo-beta-i686-pc-windows-gnu.tar.xz=c57bfddc9285dd7c1151c3bfbde4f92da394fe6c8d0239c1f9ee8eceeb15e29c +dist/2025-02-08/cargo-beta-i686-pc-windows-msvc.tar.gz=056e750115574ab4e008d76d1bda67aa30f3818a9f46cc88d7ad13bb4238d772 +dist/2025-02-08/cargo-beta-i686-pc-windows-msvc.tar.xz=663a9ec0ba07807ce289bd61c66e196262e991046da44dd583fdc1414759f5e8 +dist/2025-02-08/cargo-beta-i686-unknown-linux-gnu.tar.gz=95dee9910674196f2bf655e91a8443be5b46e36747bf1e980e1585fa3789375b +dist/2025-02-08/cargo-beta-i686-unknown-linux-gnu.tar.xz=09af49a00e181084e7f766c9008c2d3446ff1cb801780feb79d0b7cc31a038b6 +dist/2025-02-08/cargo-beta-loongarch64-unknown-linux-gnu.tar.gz=ab1ac3686ed7b3b50ace61efe20ea6848370de691cf0f287337113d7ca52c61b +dist/2025-02-08/cargo-beta-loongarch64-unknown-linux-gnu.tar.xz=bee237e641da0d804f2002d33910bfb199127c5006af39dd06d877ca5fd1ff82 +dist/2025-02-08/cargo-beta-loongarch64-unknown-linux-musl.tar.gz=9beb2a39f1ef7630f03ed1da5e1e68964a4b198fe7f18d0db9efb4f10d70b35f +dist/2025-02-08/cargo-beta-loongarch64-unknown-linux-musl.tar.xz=f1528e4aec2095d55b98e3421d2310f3aa3fcf7c2493f83e75d3cbc80e18f923 +dist/2025-02-08/cargo-beta-powerpc-unknown-linux-gnu.tar.gz=2ee460d198339449e85ff8c7e522c47f33677e90f8b215c0a13514fe5f05cdb1 +dist/2025-02-08/cargo-beta-powerpc-unknown-linux-gnu.tar.xz=4a9fc5e31abfe582b580e395ada8d59a1aecf65b07b09b8ce526a84fdf61830b +dist/2025-02-08/cargo-beta-powerpc64-unknown-linux-gnu.tar.gz=9e471ec06debbe078b8c92773a1c4380969e92dbbd9f20884986b2cc7e942106 +dist/2025-02-08/cargo-beta-powerpc64-unknown-linux-gnu.tar.xz=1cc6e9e448f036af3bd6f8e597ee242edc65811835e20545e84ab917744b50ca +dist/2025-02-08/cargo-beta-powerpc64le-unknown-linux-gnu.tar.gz=08fb88ea0a4d904b28ef7a51275ccfd1f8480f1d33c7a5a83461d322143e81be +dist/2025-02-08/cargo-beta-powerpc64le-unknown-linux-gnu.tar.xz=0809a5f718157763bbf67e8c3a3b9b868a6694bd88b87277b542fc3207c1f1d7 +dist/2025-02-08/cargo-beta-powerpc64le-unknown-linux-musl.tar.gz=dcbf18b645016eee37a23dce4126d0ad61f8886e8997b480609e8f8fffe0191a +dist/2025-02-08/cargo-beta-powerpc64le-unknown-linux-musl.tar.xz=f4f9350ec459016cc0fe54414d75fee119b0051e3ae1b839971ec5b569be97ce +dist/2025-02-08/cargo-beta-riscv64gc-unknown-linux-gnu.tar.gz=dbeee82ff5cec6c16ba873b40f986e85b55f831efbd4d09d0107b2e66037db87 +dist/2025-02-08/cargo-beta-riscv64gc-unknown-linux-gnu.tar.xz=2974493a708fd5c793b9f1920a11b66aa5ad6aaffecb0b9c597416b7200e411a +dist/2025-02-08/cargo-beta-s390x-unknown-linux-gnu.tar.gz=ca157ff6dac3d680f63c99fc2efbc30376eb6ae54682f40369c4d2aa8647b77c +dist/2025-02-08/cargo-beta-s390x-unknown-linux-gnu.tar.xz=ea5ebe153fbe3d1fdf514ebc050f46776b075268aaf7e7e3ef308f13d0ad545f +dist/2025-02-08/cargo-beta-x86_64-apple-darwin.tar.gz=dd19dc295a1c430a52c223478a01610b359e2e0b40abce7111c9a02a51d4d313 +dist/2025-02-08/cargo-beta-x86_64-apple-darwin.tar.xz=f729d46cb4ca8945657671d5d0c0a55792a2ac9f5ea21b3e2991843004fc23ae +dist/2025-02-08/cargo-beta-x86_64-pc-windows-gnu.tar.gz=9a7dbfaaafd177a725aef60ec6c4fe3c5b732bcbd69a2e25a91ad7461a76ef4c +dist/2025-02-08/cargo-beta-x86_64-pc-windows-gnu.tar.xz=ef585bc9e5f23368fbb960959f80fd34961909e62cd65bb847db06a7178b174a +dist/2025-02-08/cargo-beta-x86_64-pc-windows-msvc.tar.gz=5e396a15cc63f084467d9afcb30cb374c070856b0aa3fcf209d88bcccfc6436b +dist/2025-02-08/cargo-beta-x86_64-pc-windows-msvc.tar.xz=78cdbf2cf0d7fec4d24308853e96a39bf5c417905abfcad34de4d1b2d498a617 +dist/2025-02-08/cargo-beta-x86_64-unknown-freebsd.tar.gz=1e485ce036055c7b3e1949d9e34e7d3dca436438b3f09bd75d36e49217d53d44 +dist/2025-02-08/cargo-beta-x86_64-unknown-freebsd.tar.xz=80c5d0d5860eebbb807a2e5cf8ccba8ed4461f932825439ec8182f6f0c8939c4 +dist/2025-02-08/cargo-beta-x86_64-unknown-illumos.tar.gz=5681331e1d29b476c4f458fee453f73efc86856caf1d30c49df9dec3e147f4b1 +dist/2025-02-08/cargo-beta-x86_64-unknown-illumos.tar.xz=9f7d97045851bb1ab334761cddb38cd8bf3bb0b26f2fca4903c09301c70fbca4 +dist/2025-02-08/cargo-beta-x86_64-unknown-linux-gnu.tar.gz=24bda5749883e133ac58ddcfdbd8dbeeb660c3b33d613852dd1d993cc13f6e8f +dist/2025-02-08/cargo-beta-x86_64-unknown-linux-gnu.tar.xz=2304e5cde3efdb5c6e7319d8239bca7d1c69306846cc3eba84d70d49b8c24e51 +dist/2025-02-08/cargo-beta-x86_64-unknown-linux-musl.tar.gz=825a42ae4bab8be081c7320f06fc7ce6d0c0c31f2224fb0c13af4d01e04c3626 +dist/2025-02-08/cargo-beta-x86_64-unknown-linux-musl.tar.xz=656d148e383896d06483297d785d62c8e235020081acb4110a8bf698a3d6d6e5 +dist/2025-02-08/cargo-beta-x86_64-unknown-netbsd.tar.gz=1e6a750acd6c1f44e37b3d1b1dceef7e8a0d2b0806e1577b667573a6340e7cf9 +dist/2025-02-08/cargo-beta-x86_64-unknown-netbsd.tar.xz=c45bd23fd1004cea41f133a40bd102e55e9f7ed29c9e8cec83dcacc4653da7c7 +dist/2025-02-08/clippy-beta-aarch64-apple-darwin.tar.gz=cd22d4191ca0fb9d8ec3d627805f297ca4528018e34c4f627e7e4fc05d6b0954 +dist/2025-02-08/clippy-beta-aarch64-apple-darwin.tar.xz=0c408799a742b00dce013553a597e62d8f84232ede6883632dade6b3d024904f +dist/2025-02-08/clippy-beta-aarch64-pc-windows-msvc.tar.gz=b4d902d9a096cdc6eb655ae2a0960db6fe4b83ccb681cc5bb5124dcfc5e1fdc0 +dist/2025-02-08/clippy-beta-aarch64-pc-windows-msvc.tar.xz=9e2514d7f304e3253e7205cec8189b8f9b1d49da5b14b2c03e69b8bb0223a65c +dist/2025-02-08/clippy-beta-aarch64-unknown-linux-gnu.tar.gz=1496cc4bbd0edc18ce05bc2ca76d9ed78934f1d1c4749ff830dff7d1acc2535f +dist/2025-02-08/clippy-beta-aarch64-unknown-linux-gnu.tar.xz=4577dce94261cdf07064f43404ade755a8906ed0b1a39a148333d9309e011916 +dist/2025-02-08/clippy-beta-aarch64-unknown-linux-musl.tar.gz=d28217818fb6c1a13456684bfdbf9caa687dcc257fadffcde2d2fd94dfbb228a +dist/2025-02-08/clippy-beta-aarch64-unknown-linux-musl.tar.xz=bae2f1841776e321f5f950678516bb31c05dea8f825fda23f3a3cd423dc00249 +dist/2025-02-08/clippy-beta-arm-unknown-linux-gnueabi.tar.gz=e1698a07ab47d02954bdb67034de33a8414731e3d12a8937cdea97004d98e45f +dist/2025-02-08/clippy-beta-arm-unknown-linux-gnueabi.tar.xz=631499b2ee136c428f1c6045eb6aefee3e6c765dec1baeb0c3e4da056d540d71 +dist/2025-02-08/clippy-beta-arm-unknown-linux-gnueabihf.tar.gz=248a15737924d07afee2108e6545cb4bd5cce91878dedb5368c358c16a0b016d +dist/2025-02-08/clippy-beta-arm-unknown-linux-gnueabihf.tar.xz=6581c968d48e37baf99addf17baf8b4fdda1417c201da311959c62a51783209a +dist/2025-02-08/clippy-beta-armv7-unknown-linux-gnueabihf.tar.gz=8ff9d93ea49d805ffd3534c6aa03692fa7dc8bf0460bba7c22259257dae863d1 +dist/2025-02-08/clippy-beta-armv7-unknown-linux-gnueabihf.tar.xz=b267e928b9708cc168d84c005036d155547274e8fe03f23b14232609b780d219 +dist/2025-02-08/clippy-beta-i686-pc-windows-gnu.tar.gz=957e8d14451557ce11de7303be61a50c68af7b90293a46e48c9a1bb3db05d154 +dist/2025-02-08/clippy-beta-i686-pc-windows-gnu.tar.xz=576732c661cd0998f7b47e99fe84c3dbcb919e787e3222e1c27b5377361083aa +dist/2025-02-08/clippy-beta-i686-pc-windows-msvc.tar.gz=5a4ea7d3fd79823b2342ec9069e865000dc5ab58be0fcf3655bcb161cb195858 +dist/2025-02-08/clippy-beta-i686-pc-windows-msvc.tar.xz=fbe4f93a9f1ab718a5dd3995ce67b7b0768f7f211f8fc3f1e6b181c4e4f1f467 +dist/2025-02-08/clippy-beta-i686-unknown-linux-gnu.tar.gz=0c013dba1ac3db5ec21e672f357c6a86c379c29f7cac0d43df4857e0332abe22 +dist/2025-02-08/clippy-beta-i686-unknown-linux-gnu.tar.xz=0e585010d88a8f04f9e031fcef623a12da7f82ed9f0d827157b10f6be80eb920 +dist/2025-02-08/clippy-beta-loongarch64-unknown-linux-gnu.tar.gz=2716e252361ac72dfebc8521b3f2c0edaa6e0a0bb0b9a3ea3b9b888a5d747104 +dist/2025-02-08/clippy-beta-loongarch64-unknown-linux-gnu.tar.xz=3d400fda76fbc8a830e12f5f71e40d4993019e9e53d58434ca23e3d8761d530f +dist/2025-02-08/clippy-beta-loongarch64-unknown-linux-musl.tar.gz=8d7cd64c2ec8ee5f25bbd6aa01ba22001a4ab2eae6ca481583f736a1da07dc31 +dist/2025-02-08/clippy-beta-loongarch64-unknown-linux-musl.tar.xz=f60bca644d441e36e537e896d4b122ca0f8cde0fbd886f12c3a312efd5225997 +dist/2025-02-08/clippy-beta-powerpc-unknown-linux-gnu.tar.gz=a3fc359554026ae39c7cc46c53c6928de0522387ad2327444745eefd0fdcc43b +dist/2025-02-08/clippy-beta-powerpc-unknown-linux-gnu.tar.xz=8344b79f4a2a61cf68e526c144bbe797f1c60dec047845fc731f4c47a58b7be6 +dist/2025-02-08/clippy-beta-powerpc64-unknown-linux-gnu.tar.gz=05c2cd6e95a7c8ef36703b9bc39cedb8e5eb5b3c93a66a16deef2e18e96be489 +dist/2025-02-08/clippy-beta-powerpc64-unknown-linux-gnu.tar.xz=2a0c36d392c3b69fc437c8ab8358f87c6c50380e8c5ced6690c9a7d0be9c95e8 +dist/2025-02-08/clippy-beta-powerpc64le-unknown-linux-gnu.tar.gz=c9c6975ec5ef1e206a917d03841db90e1f4a3562b0afec32a4753134752454d3 +dist/2025-02-08/clippy-beta-powerpc64le-unknown-linux-gnu.tar.xz=efe920b25316d84c08693f28d0593d227ca18456be2dd9b426c8cbf49d81a352 +dist/2025-02-08/clippy-beta-powerpc64le-unknown-linux-musl.tar.gz=b133cb9709d11da1710b3b833a3e15d3fc216cacfd37e6e1c7c8fe1dbc202067 +dist/2025-02-08/clippy-beta-powerpc64le-unknown-linux-musl.tar.xz=7db8db7300b87bc7841ef59111c8f83fc6e6ffedbb6dd8fbb79431edb821e017 +dist/2025-02-08/clippy-beta-riscv64gc-unknown-linux-gnu.tar.gz=2fea1f879ca90478a2fb75566da4cbed2f2afec31af6d18160fe183772241658 +dist/2025-02-08/clippy-beta-riscv64gc-unknown-linux-gnu.tar.xz=668ef736714909588cae0bc77c30c3063d2911b0e1c28fc77678081099d38a83 +dist/2025-02-08/clippy-beta-s390x-unknown-linux-gnu.tar.gz=a05eb2ea42fc2ed7df974610b076adae42ec456bb80eaf9191521dda5c0cf12b +dist/2025-02-08/clippy-beta-s390x-unknown-linux-gnu.tar.xz=5874e0cfa3b7f7c3b8d9d0c84a519b98908b6228fcd9f29d971b9c36d639a998 +dist/2025-02-08/clippy-beta-x86_64-apple-darwin.tar.gz=e259a0e7776430f1697153505f937c92e942fb5c436c00dd9da3b160ef9a7856 +dist/2025-02-08/clippy-beta-x86_64-apple-darwin.tar.xz=a311ec69770a431837a26e63591dba11dedbad411b688ee69e457bb7a4596c50 +dist/2025-02-08/clippy-beta-x86_64-pc-windows-gnu.tar.gz=2b8278419633f83ca22e2d1c54a170e04775d903076935ce13e91575d6122715 +dist/2025-02-08/clippy-beta-x86_64-pc-windows-gnu.tar.xz=13190a1e83debb9483abc7b0e4e3a4b8d53895542ffa56ebc012dbd72b8e7637 +dist/2025-02-08/clippy-beta-x86_64-pc-windows-msvc.tar.gz=9c8c8de0bd646bb0284e47b6adc1db6443d9da7c06ed6d237c421339a446fd83 +dist/2025-02-08/clippy-beta-x86_64-pc-windows-msvc.tar.xz=32dbce4ca3f3abf6da249e33297efea856b3b0ff39b3571531d71e1d0f90a46c +dist/2025-02-08/clippy-beta-x86_64-unknown-freebsd.tar.gz=55b22726920214e2ca9c4e552b50401fb3eef872c63de554623aaeebf9e11e75 +dist/2025-02-08/clippy-beta-x86_64-unknown-freebsd.tar.xz=b67e699d65462020333c037f206287e609f35e448cffeed6ecaec6874ccb2233 +dist/2025-02-08/clippy-beta-x86_64-unknown-illumos.tar.gz=6bf570aa87c05050e5dffcc191db07b1b0abf18bce160637a1be39e5caa130e6 +dist/2025-02-08/clippy-beta-x86_64-unknown-illumos.tar.xz=52ae7e8906f27c020df67beae61c1c1faf6458a0ccb3e904b909841b2b504d89 +dist/2025-02-08/clippy-beta-x86_64-unknown-linux-gnu.tar.gz=fadc4ff0f2acc6d44a5a29d01101152c8570dcca69ea4fd60e8ca6cc2cfac1e9 +dist/2025-02-08/clippy-beta-x86_64-unknown-linux-gnu.tar.xz=fd8472509ffdb81ff5ce786784274f654eb213ce963caf6e5cb90baa9e641c3b +dist/2025-02-08/clippy-beta-x86_64-unknown-linux-musl.tar.gz=c94e847aae4aa7a04981a4be424cdb2a1eae81a808858a5fc14a20134b7575e3 +dist/2025-02-08/clippy-beta-x86_64-unknown-linux-musl.tar.xz=b1f2a240069cda55c7c49afda6137822d7aee855557cf7269ac4f440d54a0ca9 +dist/2025-02-08/clippy-beta-x86_64-unknown-netbsd.tar.gz=86ada6c1406ff381a81624da25e65f415380da01252e6016bffe50ef7ca5b49d +dist/2025-02-08/clippy-beta-x86_64-unknown-netbsd.tar.xz=2b24a66215cd93b84065cd35d00bb3e7c9482b118eaeaf089bb2a128450add88 +dist/2025-02-08/rustfmt-nightly-aarch64-apple-darwin.tar.gz=0e6740aa70ccffed1e2649619990b75586638b8eb34747aab58ba4cccfb09f29 +dist/2025-02-08/rustfmt-nightly-aarch64-apple-darwin.tar.xz=c5c166763202c35bb7844f0866f05cfb7e2666fe9416776a092372362e7bd8e3 +dist/2025-02-08/rustfmt-nightly-aarch64-pc-windows-msvc.tar.gz=cf025264c087d9339787db6f8cd4c76aaa9c3118b7875de7413dc1894b660fcd +dist/2025-02-08/rustfmt-nightly-aarch64-pc-windows-msvc.tar.xz=f788a44b9542ddda3a88e3000c31644e1b9ee874ce523798b6638f7f181b8df0 +dist/2025-02-08/rustfmt-nightly-aarch64-unknown-linux-gnu.tar.gz=0a7d236cd45ef4f3f12e4516b202cf9b5190e70a19044c8b17c5eef16c45032e +dist/2025-02-08/rustfmt-nightly-aarch64-unknown-linux-gnu.tar.xz=80cf271c8adc2192b212d1b40992d90aa21fcc695375774c17a4f70468c82c11 +dist/2025-02-08/rustfmt-nightly-aarch64-unknown-linux-musl.tar.gz=58d0eef426f8f0c4bf191118161db008db378ee3e77d973d7e15e39e88c3f7ea +dist/2025-02-08/rustfmt-nightly-aarch64-unknown-linux-musl.tar.xz=7eedaef7100f7272f38fbc3cc14a1f4fee7deddd31a59f7db71c2a6f2f03f946 +dist/2025-02-08/rustfmt-nightly-arm-unknown-linux-gnueabi.tar.gz=df5190ea7d9bb84d5ffdda74cec7591388d3501c2a4084c667e0f29ca0a0ba9d +dist/2025-02-08/rustfmt-nightly-arm-unknown-linux-gnueabi.tar.xz=96334a22d0534adc8521b6a000f422f1727f80235303137eac32f4e76e85194b +dist/2025-02-08/rustfmt-nightly-arm-unknown-linux-gnueabihf.tar.gz=2944da8dab479b4892f512711ed6bb3b242602ab11c81c6b22352a467c898165 +dist/2025-02-08/rustfmt-nightly-arm-unknown-linux-gnueabihf.tar.xz=5aa59c9ded50503a2f05d5330ef41ae888254887559b31c4304422aa4ba9e73f +dist/2025-02-08/rustfmt-nightly-armv7-unknown-linux-gnueabihf.tar.gz=bf17c1d62ae3f59b595c6536add64453d5584135e1d238bae55216c428416767 +dist/2025-02-08/rustfmt-nightly-armv7-unknown-linux-gnueabihf.tar.xz=c60925816b01596b846e56efa7cd0e186391e212da077b36d781b926799704ad +dist/2025-02-08/rustfmt-nightly-i686-pc-windows-gnu.tar.gz=5c73dce13f7e0ad408f39f49ae647b0fbda00416027ba43228a443f311b33fb1 +dist/2025-02-08/rustfmt-nightly-i686-pc-windows-gnu.tar.xz=df005321b30d82854f97a3e68a702c64ded7f4cde18edc69c3b1d7c8927b53e0 +dist/2025-02-08/rustfmt-nightly-i686-pc-windows-msvc.tar.gz=2483fe75cd360607f29fc5f7cfc6d55074047291544f398946b5c263eef6b164 +dist/2025-02-08/rustfmt-nightly-i686-pc-windows-msvc.tar.xz=f2553f96bb513e999597c89d0655bf1b28a338d6510f9a146b3e47674c83c550 +dist/2025-02-08/rustfmt-nightly-i686-unknown-linux-gnu.tar.gz=9cbc32383a8b6025ab9b7d75bf95b831cba32826f2732597cc3749b1a44278d6 +dist/2025-02-08/rustfmt-nightly-i686-unknown-linux-gnu.tar.xz=07f16dcf8340feaa8ac400eb54833017d501f78f11f699c095febec148f35aef +dist/2025-02-08/rustfmt-nightly-loongarch64-unknown-linux-gnu.tar.gz=03f7b562d15fb47e8e3ad244b127ed170c6296fbf5bf822fddd51eb5ab2a4f1d +dist/2025-02-08/rustfmt-nightly-loongarch64-unknown-linux-gnu.tar.xz=834186eb75bff0e05f1a7d9ea63382c7b96a18519aa6815060554b06f3d7b90e +dist/2025-02-08/rustfmt-nightly-loongarch64-unknown-linux-musl.tar.gz=45c7db895ae3751fe07dc7483d0c1ae6dae989ec0b3507eabdfaaf9b1f24af04 +dist/2025-02-08/rustfmt-nightly-loongarch64-unknown-linux-musl.tar.xz=8aef8265279fca165e1627639d64c1f980877744cbd8a927c6c6f3f1e9ef2fd8 +dist/2025-02-08/rustfmt-nightly-powerpc-unknown-linux-gnu.tar.gz=4f85245ee5c997a7d821ea3c397c5bc7315c8cb07605f2b5a4746f254ef567aa +dist/2025-02-08/rustfmt-nightly-powerpc-unknown-linux-gnu.tar.xz=ec1326a520eb4bac792bce1e260b261e3cd638c123dc2da962bf2f25bf3a89a6 +dist/2025-02-08/rustfmt-nightly-powerpc64-unknown-linux-gnu.tar.gz=dd473534cd897998f6dd361f18a61ea12ed38bbb323c3d602b3124e832ce37fb +dist/2025-02-08/rustfmt-nightly-powerpc64-unknown-linux-gnu.tar.xz=a3523178a5186ebd3847b1b0fbdf91f300b29f780fc7910fa867ccddaecbab73 +dist/2025-02-08/rustfmt-nightly-powerpc64le-unknown-linux-gnu.tar.gz=625777f6ccf6ede941a88252bea183f8f285f6d282f95a78153e5d45e63edaad +dist/2025-02-08/rustfmt-nightly-powerpc64le-unknown-linux-gnu.tar.xz=7c57c7c0163c74beaa80378974cfbe222f70057e44a025e042989f3816cf02e0 +dist/2025-02-08/rustfmt-nightly-powerpc64le-unknown-linux-musl.tar.gz=b431d8683230d783641bbacf7fee8102ecccf527485e8a753781b49906cdfb56 +dist/2025-02-08/rustfmt-nightly-powerpc64le-unknown-linux-musl.tar.xz=637801af10b564fa8b2bc8b3075b3fc26efd69237702bdd95b60f6d55e7a92ea +dist/2025-02-08/rustfmt-nightly-riscv64gc-unknown-linux-gnu.tar.gz=2532bededd1512c36f97ad91d065ccf681b4df47db86dc382635cbd55e6f1aaa +dist/2025-02-08/rustfmt-nightly-riscv64gc-unknown-linux-gnu.tar.xz=16eb4fcdc66b86d45af649905b33eb1a9cb9a859eaf4becae10b443a747b790f +dist/2025-02-08/rustfmt-nightly-s390x-unknown-linux-gnu.tar.gz=2c29615e4de5f4f9aac64102afee2f7775e961037c2b044ff5ea4690564a0af5 +dist/2025-02-08/rustfmt-nightly-s390x-unknown-linux-gnu.tar.xz=0f88b8da8d50b7bc1fef09a53c5cedb79d24b3a63b8ab8cc6960285acb7fde7a +dist/2025-02-08/rustfmt-nightly-x86_64-apple-darwin.tar.gz=f46c2a065cf61ba644062b20efbbd6cfd0dcba5b15bc8f333c35e32dd4640e03 +dist/2025-02-08/rustfmt-nightly-x86_64-apple-darwin.tar.xz=9bd81b4ec3625d959f96d7b6b17d6c548673c10f7246b712f99fe40e8dcb4844 +dist/2025-02-08/rustfmt-nightly-x86_64-pc-windows-gnu.tar.gz=2d37451b9314b525d41817c432e3bff5e90028cb020f0331f39490975376bf82 +dist/2025-02-08/rustfmt-nightly-x86_64-pc-windows-gnu.tar.xz=e8ad4c33272708ba094a2a14e1a69d9071345351921b357ebd0df7d32ccfdcd3 +dist/2025-02-08/rustfmt-nightly-x86_64-pc-windows-msvc.tar.gz=1d8e24202a8b2111b78531e5313446c6d2e3be083aef77cbd95c09b909b7c49b +dist/2025-02-08/rustfmt-nightly-x86_64-pc-windows-msvc.tar.xz=9217ed18bb34379079aa529e3ef2fcc899db75780db942b1b6a45cb8f9b317eb +dist/2025-02-08/rustfmt-nightly-x86_64-unknown-freebsd.tar.gz=f82fdf61057bae8a38daa767f72c74efefaa6043ef48229bed9d8a86787387be +dist/2025-02-08/rustfmt-nightly-x86_64-unknown-freebsd.tar.xz=60857a9f3518fa6e1a0b8f17a0391672af55bf37bf5fc965b18079060086f946 +dist/2025-02-08/rustfmt-nightly-x86_64-unknown-illumos.tar.gz=67384f76d40cb80dc79bf0221a4c021e33f11f283e793404421bd5391d75f0af +dist/2025-02-08/rustfmt-nightly-x86_64-unknown-illumos.tar.xz=e1238f9c47666b623feca48243e88ad40ba70d3d762e5e0326dd29eef41f8c83 +dist/2025-02-08/rustfmt-nightly-x86_64-unknown-linux-gnu.tar.gz=cdf48fd39c450219ecbc0801aab198c74e31e543b663030bcff9d6df8829f7b0 +dist/2025-02-08/rustfmt-nightly-x86_64-unknown-linux-gnu.tar.xz=a5a461c01b8709335c7e2dfef9378ee49aee5f9491f4bf6173142ab87bee3d31 +dist/2025-02-08/rustfmt-nightly-x86_64-unknown-linux-musl.tar.gz=d9881dac0e6d10758cc5e28d3c63be557d596336685b5d095cb77f69853ad978 +dist/2025-02-08/rustfmt-nightly-x86_64-unknown-linux-musl.tar.xz=beec700c0c6829c8975abbd26f7330a3ddc21040a8f2d531f1991f99ac11363f +dist/2025-02-08/rustfmt-nightly-x86_64-unknown-netbsd.tar.gz=188004d4990d1ca6f8fa7b00dfab510b0cbe840fda4e7318942bc2664c03588a +dist/2025-02-08/rustfmt-nightly-x86_64-unknown-netbsd.tar.xz=ff25e65591a638072362122059d71888ddef0b9b81f0b0d7b2fc285fe82192f9 +dist/2025-02-08/rustc-nightly-aarch64-apple-darwin.tar.gz=c97c0921c6749ab5eebb2fcc65cc7fc98af43d1504fa1cf4ef360e299c74fdde +dist/2025-02-08/rustc-nightly-aarch64-apple-darwin.tar.xz=51e12e1a1bb60b65145a5742899f0ba3c60840c60962c424351dd337de7b2906 +dist/2025-02-08/rustc-nightly-aarch64-pc-windows-msvc.tar.gz=469e68dc2e1546ca27117cb3d282a77bd783e84c351d911a2e45c91916fc5944 +dist/2025-02-08/rustc-nightly-aarch64-pc-windows-msvc.tar.xz=ca16024d975f6c4835d53a47cc12e728380ed9e9126f4f523854b5c8af148499 +dist/2025-02-08/rustc-nightly-aarch64-unknown-linux-gnu.tar.gz=75e9f08ced58ed868a1c5e727b632c1ea9ed8f483cadc68d30d7394ab3f60215 +dist/2025-02-08/rustc-nightly-aarch64-unknown-linux-gnu.tar.xz=c5d3906481bed31bfa563f216e8c17e8be971cf64d0a5d66820025900aa82893 +dist/2025-02-08/rustc-nightly-aarch64-unknown-linux-musl.tar.gz=a6dab5d9fd0ddb5fd83f5332e3608df71b62891c1bc02f73479cf0aa344c4d1a +dist/2025-02-08/rustc-nightly-aarch64-unknown-linux-musl.tar.xz=9b4412cb694f46774b5642b972b0c149b5ba8d4081069cf078ee83e7f7ab1c45 +dist/2025-02-08/rustc-nightly-arm-unknown-linux-gnueabi.tar.gz=cda11234e3e2370fb2a9ae7d4f50a7c44c646c5ea9dee4d4a576383785ae993d +dist/2025-02-08/rustc-nightly-arm-unknown-linux-gnueabi.tar.xz=bd6cece56d6559ae261d5494af10d665bb7293f439287f1d190cd959c598ab15 +dist/2025-02-08/rustc-nightly-arm-unknown-linux-gnueabihf.tar.gz=c29c0ace7fe5b160e9399813848e70865d4eb90536169d9c6089a90b74e4e0b7 +dist/2025-02-08/rustc-nightly-arm-unknown-linux-gnueabihf.tar.xz=bea382931c0b9804ab6ea0f3666679493c1c4390a2f732ad367b6540d4279614 +dist/2025-02-08/rustc-nightly-armv7-unknown-linux-gnueabihf.tar.gz=c83086892fb1ce1b4ca0c778e9efe57334bd18d74a961fccca78125d58f185b0 +dist/2025-02-08/rustc-nightly-armv7-unknown-linux-gnueabihf.tar.xz=30ac3e64449a919ccb70dd30350086bcd5e8f4d12e0da6851f685fb60cdb871b +dist/2025-02-08/rustc-nightly-i686-pc-windows-gnu.tar.gz=f51df0f5c9a8a89fabfb347f1164000a99485bd85dd67ca7bc84e2a48f9c80e6 +dist/2025-02-08/rustc-nightly-i686-pc-windows-gnu.tar.xz=153a564d7930f3c217b25f8573f79b279af82b8ea5ad7ccf09f8c127d4cb6c33 +dist/2025-02-08/rustc-nightly-i686-pc-windows-msvc.tar.gz=2d9c05cb1d60804cfca6076f231ac03081d3b2072cdb87e5f1d9f036325a17a1 +dist/2025-02-08/rustc-nightly-i686-pc-windows-msvc.tar.xz=fbb95c6c97a5e4389b761a1ba712f111f808113ef30abbbf0e95bedc5344708a +dist/2025-02-08/rustc-nightly-i686-unknown-linux-gnu.tar.gz=df09eea18c7be163abd768ede37cfdec306563d0b33219ae040d8f9eef263154 +dist/2025-02-08/rustc-nightly-i686-unknown-linux-gnu.tar.xz=3ba7cab1234713f4fffade6344b62fc6b89d264e3b8b993799e5e0051d869e08 +dist/2025-02-08/rustc-nightly-loongarch64-unknown-linux-gnu.tar.gz=ae94de4d5bcd8c265fb0297078d446fd84bb5ca7f9e61f87e956330d2c439ccd +dist/2025-02-08/rustc-nightly-loongarch64-unknown-linux-gnu.tar.xz=be81df065f92bd25825af0935b3188418c97e377ed7ce05ae287f576ff2eec9c +dist/2025-02-08/rustc-nightly-loongarch64-unknown-linux-musl.tar.gz=96ccf45347235ac893cb61aa0d61aedcc46ae7c93d26f3ad964a73ddd1c274f9 +dist/2025-02-08/rustc-nightly-loongarch64-unknown-linux-musl.tar.xz=1e19c00ef298e5cd1334aa60df8873c0925304bb2a996d0ca590d363443f2f20 +dist/2025-02-08/rustc-nightly-powerpc-unknown-linux-gnu.tar.gz=3e44c93e6be85dfcd8031fce279b1d1604859d149a979d91144272ed4da920fd +dist/2025-02-08/rustc-nightly-powerpc-unknown-linux-gnu.tar.xz=c3651fdbfec98c155159d799a895917c0df3599dcda71a79bdcedee3c9cb616d +dist/2025-02-08/rustc-nightly-powerpc64-unknown-linux-gnu.tar.gz=4875368f83906c9f447657ed70b0d53ae75ff563e6bd9b75110defbaf44ba134 +dist/2025-02-08/rustc-nightly-powerpc64-unknown-linux-gnu.tar.xz=069716dd18791fea69df0b97627bba5fc83ee466883080ef934f4cb6b6342ee7 +dist/2025-02-08/rustc-nightly-powerpc64le-unknown-linux-gnu.tar.gz=0aa826fe16a9245091b84972be39aae113f62c1a254b82ec91df81a2c2c2da82 +dist/2025-02-08/rustc-nightly-powerpc64le-unknown-linux-gnu.tar.xz=2324bf8323d784cd37ca9546295e252a0327e25386ba406409e5c4172412d356 +dist/2025-02-08/rustc-nightly-powerpc64le-unknown-linux-musl.tar.gz=2b5debffe5fd870828cf54365b21b1cb989bc5223b76a911299208c5ec105c2c +dist/2025-02-08/rustc-nightly-powerpc64le-unknown-linux-musl.tar.xz=34342b7ac92698d15b53afa13897fa37401e33b591e2a9ebb00ea17bf2ad7741 +dist/2025-02-08/rustc-nightly-riscv64gc-unknown-linux-gnu.tar.gz=e189c8be0a75ebc0c65e1b467476c510415231c5bb67d742719b39c425ee98a6 +dist/2025-02-08/rustc-nightly-riscv64gc-unknown-linux-gnu.tar.xz=2407a0e42ff8280a16e944f430d2724bed6765295a64a53f463e341d35f9fb0b +dist/2025-02-08/rustc-nightly-s390x-unknown-linux-gnu.tar.gz=ffbaaee6cb11d1cbed985601a58fa5e9d796161b0435b9a8ef547148f042200a +dist/2025-02-08/rustc-nightly-s390x-unknown-linux-gnu.tar.xz=3c6dcdea50189f815b16033dfc8524687d7101eafb266be8f16681fcf348dbd5 +dist/2025-02-08/rustc-nightly-x86_64-apple-darwin.tar.gz=43b2f1b7d16b46419d8fcede2b5b354ab778a1f2c3f59e691b71db8cfa00d727 +dist/2025-02-08/rustc-nightly-x86_64-apple-darwin.tar.xz=6f18083854625d41b5ace4aa8b33f9c1aadfba764a6cb8ce1d5986f745ddfe3c +dist/2025-02-08/rustc-nightly-x86_64-pc-windows-gnu.tar.gz=eba376122f9f9439aa2f6f08a08d496e07fd3e5ac99c82a69eab279e44755b8f +dist/2025-02-08/rustc-nightly-x86_64-pc-windows-gnu.tar.xz=e5b67e358ae1068482f6e09cdacb6f212b6b6c5e87056909b54182d21c6ba5bb +dist/2025-02-08/rustc-nightly-x86_64-pc-windows-msvc.tar.gz=310f2fc7bf1d32926d78e264638d2795718a1406209238c8c18ba76680c58fca +dist/2025-02-08/rustc-nightly-x86_64-pc-windows-msvc.tar.xz=f8915c772b352fd7f25a7f1be36c94f7b383b813d9dae139831c9f7f2b960de8 +dist/2025-02-08/rustc-nightly-x86_64-unknown-freebsd.tar.gz=05bd6715082b006f6d43c369f37c262732e4bb1c44cabe50a201ceb8556ce651 +dist/2025-02-08/rustc-nightly-x86_64-unknown-freebsd.tar.xz=d03c251f78273d4a3de99e650634d30287c4868031ddd3cc929cef8d7cb5d215 +dist/2025-02-08/rustc-nightly-x86_64-unknown-illumos.tar.gz=16804058f8c88358ae2ab0a8302acb092c27a459ca7217d30fde504746be14f9 +dist/2025-02-08/rustc-nightly-x86_64-unknown-illumos.tar.xz=b76535703edb204daf577e42b0a1ae2a41bfa18e0e3205fb5773e7ec12ec9fc7 +dist/2025-02-08/rustc-nightly-x86_64-unknown-linux-gnu.tar.gz=5a63f9f4ee7c5a91252ae8b235780ed6349641c9b6593e9038021c3a3927374d +dist/2025-02-08/rustc-nightly-x86_64-unknown-linux-gnu.tar.xz=0a53b3706ab2981fadb020362dd497917f8361cc778a11d9a7fa05a3b329eea2 +dist/2025-02-08/rustc-nightly-x86_64-unknown-linux-musl.tar.gz=ab4e3c5a4eaabf0f227b160efcf2f8d0e9a572d079ece83c6313fca9865a5dc3 +dist/2025-02-08/rustc-nightly-x86_64-unknown-linux-musl.tar.xz=dcd74640d883aa75df93b86b041f98ef99178d5f39e78de3ff6801077703da32 +dist/2025-02-08/rustc-nightly-x86_64-unknown-netbsd.tar.gz=cdb3d9ac0651e3d44dbb50b3e341e609e228cbc4c358b126547a2909b807901a +dist/2025-02-08/rustc-nightly-x86_64-unknown-netbsd.tar.xz=f4227393819e678dd67c579fc00b52fc1a3974e270f10593d8b550f7362b5a63 \ No newline at end of file diff --git a/src/tools/bump-stage0/src/main.rs b/src/tools/bump-stage0/src/main.rs index b2dc044ec66a2..f51072718a349 100644 --- a/src/tools/bump-stage0/src/main.rs +++ b/src/tools/bump-stage0/src/main.rs @@ -50,7 +50,7 @@ impl Tool { # # All changes below this comment will be overridden the next time the # tool is executed. - "#; +"#; let mut file_content = String::new(); From 1fcae03369abb4c2cc180cd5a49e1f4440a81300 Mon Sep 17 00:00:00 2001 From: bjorn3 <17426603+bjorn3@users.noreply.github.com> Date: Sat, 8 Feb 2025 22:12:13 +0000 Subject: [PATCH 2/2] Rustfmt --- compiler/rustc_abi/src/lib.rs | 11 +- compiler/rustc_ast_lowering/src/expr.rs | 21 +- compiler/rustc_ast_lowering/src/format.rs | 9 +- compiler/rustc_ast_lowering/src/item.rs | 37 +- .../src/session_diagnostics.rs | 36 +- .../src/diagnostics/bound_region_errors.rs | 37 +- .../src/diagnostics/conflict_errors.rs | 32 +- .../rustc_borrowck/src/diagnostics/mod.rs | 8 +- .../src/diagnostics/region_errors.rs | 15 +- compiler/rustc_borrowck/src/lib.rs | 10 +- .../src/region_infer/opaque_types.rs | 8 +- .../src/type_check/input_output.rs | 25 +- compiler/rustc_borrowck/src/type_check/mod.rs | 26 +- .../rustc_borrowck/src/universal_regions.rs | 8 +- .../src/alloc_error_handler.rs | 9 +- compiler/rustc_builtin_macros/src/autodiff.rs | 25 +- .../src/deriving/clone.rs | 22 +- .../src/deriving/cmp/eq.rs | 11 +- .../src/deriving/default.rs | 40 +- .../src/deriving/generic/mod.rs | 10 +- compiler/rustc_builtin_macros/src/env.rs | 10 +- .../src/format_foreign.rs | 12 +- .../src/format_foreign/printf/tests.rs | 10 +- .../src/format_foreign/shell/tests.rs | 9 +- .../src/proc_macro_harness.rs | 32 +- compiler/rustc_builtin_macros/src/test.rs | 157 +++-- .../example/std_example.rs | 7 +- compiler/rustc_codegen_cranelift/src/cast.rs | 9 +- .../src/debuginfo/object.rs | 21 +- .../rustc_codegen_cranelift/src/driver/jit.rs | 14 +- .../rustc_codegen_cranelift/src/inline_asm.rs | 14 +- .../src/intrinsics/simd.rs | 9 +- .../rustc_codegen_cranelift/src/main_shim.rs | 9 +- compiler/rustc_codegen_cranelift/src/trap.rs | 14 +- compiler/rustc_codegen_gcc/src/builder.rs | 21 +- .../rustc_codegen_gcc/src/intrinsic/llvm.rs | 22 +- .../rustc_codegen_gcc/src/intrinsic/simd.rs | 466 ++++++------- compiler/rustc_codegen_llvm/src/abi.rs | 38 +- .../src/builder/autodiff.rs | 26 +- .../rustc_codegen_llvm/src/debuginfo/mod.rs | 19 +- compiler/rustc_codegen_llvm/src/intrinsic.rs | 471 ++++++------- .../rustc_codegen_ssa/src/back/archive.rs | 8 +- .../src/back/linker/tests.rs | 35 +- .../rustc_codegen_ssa/src/back/metadata.rs | 18 +- .../src/back/symbol_export.rs | 143 ++-- compiler/rustc_codegen_ssa/src/mir/block.rs | 8 +- compiler/rustc_codegen_ssa/src/mir/place.rs | 8 +- .../src/check_consts/qualifs.rs | 14 +- compiler/rustc_const_eval/src/errors.rs | 11 +- .../rustc_const_eval/src/interpret/call.rs | 22 +- .../rustc_const_eval/src/interpret/intern.rs | 10 +- .../src/interpret/validity.rs | 25 +- .../src/graph/dominators/tests.rs | 65 +- .../src/graph/implementation/tests.rs | 11 +- .../src/graph/scc/tests.rs | 83 +-- .../src/obligation_forest/tests.rs | 8 +- .../src/vec_cache/tests.rs | 13 +- compiler/rustc_errors/src/json/tests.rs | 160 +++-- compiler/rustc_expand/src/build.rs | 13 +- compiler/rustc_expand/src/mbe/macro_rules.rs | 47 +- compiler/rustc_expand/src/mbe/quoted.rs | 36 +- compiler/rustc_graphviz/src/tests.rs | 16 +- compiler/rustc_hir/src/hir.rs | 17 +- .../src/check/compare_impl_item.rs | 110 +-- .../rustc_hir_analysis/src/check/intrinsic.rs | 21 +- .../rustc_hir_analysis/src/check/wfcheck.rs | 37 +- .../src/coherence/builtin.rs | 9 +- .../src/coherence/inherent_impls_overlap.rs | 11 +- .../src/collect/item_bounds.rs | 18 +- .../src/collect/predicates_of.rs | 8 +- .../src/collect/resolve_bound_vars.rs | 27 +- compiler/rustc_hir_analysis/src/delegation.rs | 8 +- .../src/hir_ty_lowering/bounds.rs | 12 +- .../src/hir_ty_lowering/dyn_compatibility.rs | 11 +- .../src/hir_ty_lowering/mod.rs | 11 +- compiler/rustc_hir_pretty/src/lib.rs | 11 +- compiler/rustc_hir_typeck/src/callee.rs | 34 +- compiler/rustc_hir_typeck/src/cast.rs | 11 +- compiler/rustc_hir_typeck/src/check.rs | 23 +- compiler/rustc_hir_typeck/src/closure.rs | 44 +- compiler/rustc_hir_typeck/src/coercion.rs | 38 +- compiler/rustc_hir_typeck/src/expr.rs | 8 +- .../rustc_hir_typeck/src/fn_ctxt/_impl.rs | 26 +- .../src/fn_ctxt/suggestions.rs | 16 +- .../rustc_hir_typeck/src/method/suggest.rs | 13 +- compiler/rustc_hir_typeck/src/op.rs | 18 +- compiler/rustc_hir_typeck/src/place_op.rs | 11 +- compiler/rustc_hir_typeck/src/upvar.rs | 49 +- .../src/persist/dirty_clean.rs | 9 +- compiler/rustc_index/src/bit_set/tests.rs | 70 +- compiler/rustc_index/src/vec/tests.rs | 18 +- .../src/infer/outlives/obligations.rs | 24 +- .../src/infer/relate/higher_ranked.rs | 24 +- compiler/rustc_infer/src/traits/engine.rs | 15 +- compiler/rustc_infer/src/traits/project.rs | 8 +- compiler/rustc_interface/src/tests.rs | 13 +- compiler/rustc_lexer/src/tests.rs | 35 +- compiler/rustc_lexer/src/unescape/tests.rs | 15 +- compiler/rustc_lint/src/builtin.rs | 213 +++--- compiler/rustc_lint/src/context.rs | 26 +- .../src/deref_into_dyn_supertrait.rs | 21 +- .../rustc_lint/src/drop_forget_useless.rs | 52 +- .../src/enum_intrinsics_non_enums.rs | 9 +- .../src/for_loops_over_fallibles.rs | 13 +- .../src/hidden_unicode_codepoints.rs | 12 +- compiler/rustc_lint/src/if_let_rescope.rs | 33 +- .../rustc_lint/src/impl_trait_overcaptures.rs | 10 +- compiler/rustc_lint/src/internal.rs | 50 +- compiler/rustc_lint/src/let_underscore.rs | 9 +- compiler/rustc_lint/src/lib.rs | 29 +- compiler/rustc_lint/src/map_unit_fn.rs | 42 +- compiler/rustc_lint/src/non_ascii_idents.rs | 53 +- compiler/rustc_lint/src/non_fmt_panic.rs | 12 +- compiler/rustc_lint/src/non_local_def.rs | 26 +- compiler/rustc_lint/src/nonstandard_style.rs | 20 +- compiler/rustc_lint/src/noop_method_call.rs | 18 +- .../src/opaque_hidden_inferred_bound.rs | 11 +- compiler/rustc_lint/src/pass_by_value.rs | 9 +- .../rustc_lint/src/redundant_semicolon.rs | 9 +- compiler/rustc_lint/src/shadowed_into_iter.rs | 11 +- compiler/rustc_lint/src/static_mut_refs.rs | 10 +- compiler/rustc_lint/src/traits.rs | 10 +- compiler/rustc_lint/src/types.rs | 40 +- compiler/rustc_lint/src/types/literal.rs | 96 +-- compiler/rustc_lint/src/unit_bindings.rs | 8 +- compiler/rustc_lint/src/unused.rs | 98 +-- compiler/rustc_macros/src/serialize.rs | 34 +- compiler/rustc_macros/src/symbols/tests.rs | 8 +- compiler/rustc_metadata/src/creader.rs | 32 +- .../src/mir/interpret/allocation.rs | 11 +- compiler/rustc_middle/src/mir/mod.rs | 8 +- .../rustc_middle/src/query/on_disk_cache.rs | 21 +- compiler/rustc_middle/src/ty/context.rs | 26 +- compiler/rustc_middle/src/ty/fold.rs | 33 +- compiler/rustc_middle/src/ty/layout.rs | 9 +- compiler/rustc_middle/src/ty/util.rs | 9 +- compiler/rustc_mir_build/src/builder/cfg.rs | 8 +- .../src/builder/expr/as_place.rs | 46 +- .../src/builder/expr/as_rvalue.rs | 69 +- .../rustc_mir_build/src/builder/expr/into.rs | 109 +-- .../rustc_mir_build/src/builder/expr/stmt.rs | 10 +- .../src/builder/matches/match_pair.rs | 11 +- .../src/builder/matches/mod.rs | 111 +-- .../src/builder/matches/test.rs | 71 +- .../src/builder/matches/util.rs | 9 +- compiler/rustc_mir_build/src/builder/misc.rs | 15 +- compiler/rustc_mir_build/src/builder/scope.rs | 120 ++-- .../rustc_mir_build/src/check_unsafety.rs | 19 +- compiler/rustc_mir_build/src/thir/cx/mod.rs | 8 +- .../rustc_mir_dataflow/src/elaborate_drops.rs | 30 +- .../src/framework/direction.rs | 9 +- .../src/framework/graphviz.rs | 8 +- .../rustc_mir_dataflow/src/framework/tests.rs | 42 +- .../src/add_moves_for_packed_drops.rs | 15 +- compiler/rustc_mir_transform/src/add_retag.rs | 22 +- .../src/check_call_recursion.rs | 10 +- compiler/rustc_mir_transform/src/coroutine.rs | 112 +-- .../src/coroutine/by_move_body.rs | 8 +- .../src/coverage/counters/node_flow/tests.rs | 34 +- .../rustc_mir_transform/src/coverage/tests.rs | 21 +- .../src/ffi_unwind_calls.rs | 8 +- compiler/rustc_mir_transform/src/inline.rs | 11 +- .../src/known_panics_lint.rs | 9 +- .../rustc_mir_transform/src/promote_consts.rs | 20 +- .../src/shim/async_destructor_ctor.rs | 28 +- .../src/simplify_comparison_integral.rs | 11 +- compiler/rustc_mir_transform/src/ssa.rs | 9 +- .../src/mono_checks/move_check.rs | 9 +- .../rustc_monomorphize/src/partitioning.rs | 8 +- .../src/solve/assembly/structural_traits.rs | 29 +- .../src/solve/effect_goals.rs | 9 +- .../src/solve/eval_ctxt/canonical.rs | 9 +- .../src/solve/eval_ctxt/mod.rs | 8 +- .../src/solve/normalizes_to/mod.rs | 62 +- .../src/solve/trait_goals.rs | 33 +- compiler/rustc_parse/src/errors.rs | 76 ++- .../rustc_parse/src/parser/attr_wrapper.rs | 8 +- .../rustc_parse/src/parser/diagnostics.rs | 58 +- compiler/rustc_parse/src/parser/expr.rs | 36 +- compiler/rustc_parse/src/parser/item.rs | 8 +- compiler/rustc_parse/src/parser/path.rs | 24 +- compiler/rustc_parse/src/parser/stmt.rs | 22 +- compiler/rustc_parse_format/src/lib.rs | 101 +-- compiler/rustc_parse_format/src/tests.rs | 640 ++++++++++-------- compiler/rustc_passes/src/check_attr.rs | 37 +- compiler/rustc_passes/src/errors.rs | 14 +- compiler/rustc_passes/src/input_stats.rs | 431 ++++++------ .../rustc_resolve/src/build_reduced_graph.rs | 11 +- compiler/rustc_resolve/src/def_collector.rs | 13 +- compiler/rustc_resolve/src/diagnostics.rs | 12 +- compiler/rustc_resolve/src/ident.rs | 57 +- compiler/rustc_resolve/src/imports.rs | 15 +- compiler/rustc_resolve/src/late.rs | 64 +- .../rustc_resolve/src/late/diagnostics.rs | 36 +- compiler/rustc_resolve/src/macros.rs | 15 +- .../src/config/native_libs/tests.rs | 40 +- compiler/rustc_session/src/search_paths.rs | 8 +- .../rustc_smir/src/rustc_smir/convert/ty.rs | 10 +- .../rustc_target/src/spec/base/apple/tests.rs | 13 +- .../rustc_target/src/spec/base/avr_gnu.rs | 7 +- .../rustc_target/src/spec/base/fuchsia.rs | 29 +- .../rustc_target/src/spec/base/illumos.rs | 41 +- .../rustc_target/src/spec/base/nto_qnx.rs | 8 +- .../rustc_target/src/spec/base/uefi_msvc.rs | 35 +- .../rustc_target/src/spec/base/windows_gnu.rs | 33 +- .../src/spec/base/windows_gnullvm.rs | 19 +- compiler/rustc_target/src/spec/json.rs | 8 +- .../src/spec/targets/aarch64_unknown_none.rs | 7 +- .../src/spec/targets/aarch64_unknown_nuttx.rs | 7 +- .../spec/targets/arm64ec_pc_windows_msvc.rs | 9 +- .../src/spec/targets/armv6k_nintendo_3ds.rs | 10 +- .../targets/armv7_sony_vita_newlibeabihf.rs | 8 +- .../src/spec/targets/i686_pc_windows_gnu.rs | 9 +- .../spec/targets/i686_pc_windows_gnullvm.rs | 9 +- .../src/spec/targets/i686_pc_windows_msvc.rs | 21 +- .../src/spec/targets/i686_uwp_windows_gnu.rs | 9 +- .../src/spec/targets/i686_win7_windows_gnu.rs | 9 +- .../spec/targets/i686_win7_windows_msvc.rs | 21 +- .../src/spec/targets/mipsel_sony_psp.rs | 8 +- .../src/spec/targets/powerpc64_ibm_aix.rs | 10 +- .../spec/targets/powerpc_unknown_freebsd.rs | 8 +- .../spec/targets/sparc_unknown_linux_gnu.rs | 7 +- .../spec/targets/wasm32_unknown_unknown.rs | 28 +- .../src/spec/targets/wasm32_wasip1_threads.rs | 24 +- .../src/spec/targets/wasm32v1_none.rs | 28 +- .../spec/targets/wasm64_unknown_unknown.rs | 30 +- .../targets/x86_64_fortanix_unknown_sgx.rs | 65 +- .../src/spec/targets/x86_64_pc_windows_gnu.rs | 9 +- .../spec/targets/x86_64_uwp_windows_gnu.rs | 9 +- .../spec/targets/x86_64_win7_windows_gnu.rs | 9 +- compiler/rustc_target/src/target_features.rs | 16 +- .../nice_region_error/static_impl_trait.rs | 9 +- .../traits/fulfillment_errors.rs | 27 +- .../src/error_reporting/traits/suggestions.rs | 17 +- .../src/solve/fulfill/derive_errors.rs | 8 +- .../src/solve/normalize.rs | 31 +- .../src/traits/coherence.rs | 53 +- .../rustc_trait_selection/src/traits/mod.rs | 34 +- .../src/traits/project.rs | 96 +-- .../src/traits/select/confirmation.rs | 85 ++- .../src/traits/select/mod.rs | 8 +- compiler/rustc_ty_utils/src/implied_bounds.rs | 8 +- compiler/rustc_ty_utils/src/layout.rs | 55 +- compiler/rustc_type_ir/src/predicate.rs | 52 +- compiler/rustc_type_ir/src/ty_kind/closure.rs | 21 +- compiler/rustc_type_ir_macros/src/lib.rs | 61 +- .../alloc/src/collections/btree/set/tests.rs | 16 +- .../src/collections/linked_list/tests.rs | 28 +- .../alloc/src/collections/vec_deque/tests.rs | 7 +- library/alloc/src/rc.rs | 9 +- library/alloc/src/sync.rs | 13 +- library/alloc/tests/str.rs | 165 ++--- library/alloc/tests/string.rs | 35 +- library/core/src/cell.rs | 17 +- .../tests/iter/adapters/map_windows.rs | 9 +- library/panic_unwind/src/emcc.rs | 13 +- library/std/src/io/stdio/tests.rs | 7 +- library/std/src/os/windows/process.rs | 8 +- library/std/src/os/xous/ffi/definitions.rs | 66 +- library/std/src/sys/pal/itron/time/tests.rs | 30 +- library/std/src/sys/pal/windows/args/tests.rs | 8 +- library/std/src/sys_common/wtf8/tests.rs | 111 +-- src/bootstrap/src/core/build_steps/llvm.rs | 16 +- .../src/core/build_steps/toolstate.rs | 14 +- src/bootstrap/src/core/builder/mod.rs | 49 +- src/bootstrap/src/core/builder/tests.rs | 529 +++++++++------ src/bootstrap/src/core/config/config.rs | 13 +- src/librustdoc/clean/cfg/tests.rs | 29 +- src/librustdoc/clean/mod.rs | 70 +- src/librustdoc/clean/types.rs | 11 +- src/librustdoc/html/highlight.rs | 42 +- src/librustdoc/html/markdown/tests.rs | 16 +- src/librustdoc/html/render/search_index.rs | 9 +- src/librustdoc/json/mod.rs | 28 +- src/librustdoc/passes/lint/bare_urls.rs | 9 +- src/tools/build-manifest/src/main.rs | 13 +- src/tools/compiletest/src/header/tests.rs | 7 +- src/tools/coverage-dump/src/covfun.rs | 11 +- .../generate-copyright/src/cargo_metadata.rs | 15 +- src/tools/generate-copyright/src/main.rs | 10 +- src/tools/jsondoclint/src/validator/tests.rs | 327 +++++---- src/tools/lint-docs/src/lib.rs | 42 +- src/tools/rust-installer/src/compression.rs | 19 +- src/tools/tidy/src/ext_tool_checks.rs | 33 +- src/tools/tidy/src/known_bug.rs | 11 +- .../src/raw_emitter.rs | 48 +- .../run-make/wasm-export-all-symbols/rmake.rs | 17 +- 287 files changed, 5886 insertions(+), 4606 deletions(-) diff --git a/compiler/rustc_abi/src/lib.rs b/compiler/rustc_abi/src/lib.rs index 8ad33749f3473..fc34b28893309 100644 --- a/compiler/rustc_abi/src/lib.rs +++ b/compiler/rustc_abi/src/lib.rs @@ -1184,10 +1184,13 @@ impl Scalar { #[inline] pub fn is_bool(&self) -> bool { use Integer::*; - matches!(self, Scalar::Initialized { - value: Primitive::Int(I8, false), - valid_range: WrappingRange { start: 0, end: 1 } - }) + matches!( + self, + Scalar::Initialized { + value: Primitive::Int(I8, false), + valid_range: WrappingRange { start: 0, end: 1 } + } + ) } /// Get the primitive representation of this type, ignoring the valid range and whether the diff --git a/compiler/rustc_ast_lowering/src/expr.rs b/compiler/rustc_ast_lowering/src/expr.rs index dded18fce0a70..923fd65dccaf9 100644 --- a/compiler/rustc_ast_lowering/src/expr.rs +++ b/compiler/rustc_ast_lowering/src/expr.rs @@ -828,15 +828,18 @@ impl<'hir> LoweringContext<'_, 'hir> { span, Some(Arc::clone(&self.allow_gen_future)), ); - self.lower_attrs(inner_hir_id, &[Attribute { - kind: AttrKind::Normal(ptr::P(NormalAttr::from_ident(Ident::new( - sym::track_caller, - span, - )))), - id: self.tcx.sess.psess.attr_id_generator.mk_attr_id(), - style: AttrStyle::Outer, - span: unstable_span, - }]); + self.lower_attrs( + inner_hir_id, + &[Attribute { + kind: AttrKind::Normal(ptr::P(NormalAttr::from_ident(Ident::new( + sym::track_caller, + span, + )))), + id: self.tcx.sess.psess.attr_id_generator.mk_attr_id(), + style: AttrStyle::Outer, + span: unstable_span, + }], + ); } } diff --git a/compiler/rustc_ast_lowering/src/format.rs b/compiler/rustc_ast_lowering/src/format.rs index 22aa1e6fc201a..07b94dbc2aebd 100644 --- a/compiler/rustc_ast_lowering/src/format.rs +++ b/compiler/rustc_ast_lowering/src/format.rs @@ -362,13 +362,16 @@ fn make_format_spec<'hir>( debug_hex, } = &placeholder.format_options; let fill = ctx.expr_char(sp, fill.unwrap_or(' ')); - let align = - ctx.expr_lang_item_type_relative(sp, hir::LangItem::FormatAlignment, match alignment { + let align = ctx.expr_lang_item_type_relative( + sp, + hir::LangItem::FormatAlignment, + match alignment { Some(FormatAlignment::Left) => sym::Left, Some(FormatAlignment::Right) => sym::Right, Some(FormatAlignment::Center) => sym::Center, None => sym::Unknown, - }); + }, + ); // This needs to match `Flag` in library/core/src/fmt/rt.rs. let flags: u32 = ((sign == Some(FormatSign::Plus)) as u32) | ((sign == Some(FormatSign::Minus)) as u32) << 1 diff --git a/compiler/rustc_ast_lowering/src/item.rs b/compiler/rustc_ast_lowering/src/item.rs index c96110fee619b..11d60b9348df6 100644 --- a/compiler/rustc_ast_lowering/src/item.rs +++ b/compiler/rustc_ast_lowering/src/item.rs @@ -304,12 +304,15 @@ impl<'hir> LoweringContext<'_, 'hir> { ); this.arena.alloc(this.ty(span, hir::TyKind::Err(guar))) } - Some(ty) => this.lower_ty(ty, ImplTraitContext::OpaqueTy { - origin: hir::OpaqueTyOrigin::TyAlias { - parent: this.local_def_id(id), - in_assoc_ty: false, + Some(ty) => this.lower_ty( + ty, + ImplTraitContext::OpaqueTy { + origin: hir::OpaqueTyOrigin::TyAlias { + parent: this.local_def_id(id), + in_assoc_ty: false, + }, }, - }), + ), }, ); hir::ItemKind::TyAlias(ty, generics) @@ -966,12 +969,15 @@ impl<'hir> LoweringContext<'_, 'hir> { hir::ImplItemKind::Type(ty) } Some(ty) => { - let ty = this.lower_ty(ty, ImplTraitContext::OpaqueTy { - origin: hir::OpaqueTyOrigin::TyAlias { - parent: this.local_def_id(i.id), - in_assoc_ty: true, + let ty = this.lower_ty( + ty, + ImplTraitContext::OpaqueTy { + origin: hir::OpaqueTyOrigin::TyAlias { + parent: this.local_def_id(i.id), + in_assoc_ty: true, + }, }, - }); + ); hir::ImplItemKind::Type(ty) } }, @@ -1152,10 +1158,13 @@ impl<'hir> LoweringContext<'_, 'hir> { pub(super) fn lower_const_body(&mut self, span: Span, expr: Option<&Expr>) -> hir::BodyId { self.lower_body(|this| { - (&[], match expr { - Some(expr) => this.lower_expr_mut(expr), - None => this.expr_err(span, this.dcx().span_delayed_bug(span, "no block")), - }) + ( + &[], + match expr { + Some(expr) => this.lower_expr_mut(expr), + None => this.expr_err(span, this.dcx().span_delayed_bug(span, "no block")), + }, + ) }) } diff --git a/compiler/rustc_attr_parsing/src/session_diagnostics.rs b/compiler/rustc_attr_parsing/src/session_diagnostics.rs index b1d8ec497740d..92bc2a8aeb05e 100644 --- a/compiler/rustc_attr_parsing/src/session_diagnostics.rs +++ b/compiler/rustc_attr_parsing/src/session_diagnostics.rs @@ -204,21 +204,27 @@ pub(crate) struct UnsupportedLiteral { impl<'a, G: EmissionGuarantee> Diagnostic<'a, G> for UnsupportedLiteral { fn into_diag(self, dcx: DiagCtxtHandle<'a>, level: Level) -> Diag<'a, G> { - let mut diag = Diag::new(dcx, level, match self.reason { - UnsupportedLiteralReason::Generic => fluent::attr_parsing_unsupported_literal_generic, - UnsupportedLiteralReason::CfgString => { - fluent::attr_parsing_unsupported_literal_cfg_string - } - UnsupportedLiteralReason::CfgBoolean => { - fluent::attr_parsing_unsupported_literal_cfg_boolean - } - UnsupportedLiteralReason::DeprecatedString => { - fluent::attr_parsing_unsupported_literal_deprecated_string - } - UnsupportedLiteralReason::DeprecatedKvPair => { - fluent::attr_parsing_unsupported_literal_deprecated_kv_pair - } - }); + let mut diag = Diag::new( + dcx, + level, + match self.reason { + UnsupportedLiteralReason::Generic => { + fluent::attr_parsing_unsupported_literal_generic + } + UnsupportedLiteralReason::CfgString => { + fluent::attr_parsing_unsupported_literal_cfg_string + } + UnsupportedLiteralReason::CfgBoolean => { + fluent::attr_parsing_unsupported_literal_cfg_boolean + } + UnsupportedLiteralReason::DeprecatedString => { + fluent::attr_parsing_unsupported_literal_deprecated_string + } + UnsupportedLiteralReason::DeprecatedKvPair => { + fluent::attr_parsing_unsupported_literal_deprecated_kv_pair + } + }, + ); diag.span(self.span); diag.code(E0565); if self.is_bytestr { diff --git a/compiler/rustc_borrowck/src/diagnostics/bound_region_errors.rs b/compiler/rustc_borrowck/src/diagnostics/bound_region_errors.rs index 475897d8f3e31..30b0a35858028 100644 --- a/compiler/rustc_borrowck/src/diagnostics/bound_region_errors.rs +++ b/compiler/rustc_borrowck/src/diagnostics/bound_region_errors.rs @@ -156,24 +156,25 @@ pub(crate) trait TypeOpInfo<'tcx> { return; }; - let placeholder_region = ty::Region::new_placeholder(tcx, ty::Placeholder { - universe: adjusted_universe.into(), - bound: placeholder.bound, - }); - - let error_region = - if let RegionElement::PlaceholderRegion(error_placeholder) = error_element { - let adjusted_universe = - error_placeholder.universe.as_u32().checked_sub(base_universe.as_u32()); - adjusted_universe.map(|adjusted| { - ty::Region::new_placeholder(tcx, ty::Placeholder { - universe: adjusted.into(), - bound: error_placeholder.bound, - }) - }) - } else { - None - }; + let placeholder_region = ty::Region::new_placeholder( + tcx, + ty::Placeholder { universe: adjusted_universe.into(), bound: placeholder.bound }, + ); + + let error_region = if let RegionElement::PlaceholderRegion(error_placeholder) = + error_element + { + let adjusted_universe = + error_placeholder.universe.as_u32().checked_sub(base_universe.as_u32()); + adjusted_universe.map(|adjusted| { + ty::Region::new_placeholder( + tcx, + ty::Placeholder { universe: adjusted.into(), bound: error_placeholder.bound }, + ) + }) + } else { + None + }; debug!(?placeholder_region); diff --git a/compiler/rustc_borrowck/src/diagnostics/conflict_errors.rs b/compiler/rustc_borrowck/src/diagnostics/conflict_errors.rs index b3fb2cd938b62..6269728e67f73 100644 --- a/compiler/rustc_borrowck/src/diagnostics/conflict_errors.rs +++ b/compiler/rustc_borrowck/src/diagnostics/conflict_errors.rs @@ -147,10 +147,10 @@ impl<'infcx, 'tcx> MirBorrowckCtxt<'_, 'infcx, 'tcx> { span, desired_action.as_noun(), partially_str, - self.describe_place_with_options(moved_place, DescribePlaceOpt { - including_downcast: true, - including_tuple_field: true, - }), + self.describe_place_with_options( + moved_place, + DescribePlaceOpt { including_downcast: true, including_tuple_field: true }, + ), ); let reinit_spans = maybe_reinitialized_locations @@ -280,10 +280,10 @@ impl<'infcx, 'tcx> MirBorrowckCtxt<'_, 'infcx, 'tcx> { self.suggest_adding_bounds(&mut err, ty, copy_did, span); } - let opt_name = self.describe_place_with_options(place.as_ref(), DescribePlaceOpt { - including_downcast: true, - including_tuple_field: true, - }); + let opt_name = self.describe_place_with_options( + place.as_ref(), + DescribePlaceOpt { including_downcast: true, including_tuple_field: true }, + ); let note_msg = match opt_name { Some(name) => format!("`{name}`"), None => "value".to_owned(), @@ -765,17 +765,17 @@ impl<'infcx, 'tcx> MirBorrowckCtxt<'_, 'infcx, 'tcx> { } let spans: Vec<_> = spans_set.into_iter().collect(); - let (name, desc) = match self.describe_place_with_options(moved_place, DescribePlaceOpt { - including_downcast: true, - including_tuple_field: true, - }) { + let (name, desc) = match self.describe_place_with_options( + moved_place, + DescribePlaceOpt { including_downcast: true, including_tuple_field: true }, + ) { Some(name) => (format!("`{name}`"), format!("`{name}` ")), None => ("the variable".to_string(), String::new()), }; - let path = match self.describe_place_with_options(used_place, DescribePlaceOpt { - including_downcast: true, - including_tuple_field: true, - }) { + let path = match self.describe_place_with_options( + used_place, + DescribePlaceOpt { including_downcast: true, including_tuple_field: true }, + ) { Some(name) => format!("`{name}`"), None => "value".to_string(), }; diff --git a/compiler/rustc_borrowck/src/diagnostics/mod.rs b/compiler/rustc_borrowck/src/diagnostics/mod.rs index 01ed0464c8ab7..860c7c267ea91 100644 --- a/compiler/rustc_borrowck/src/diagnostics/mod.rs +++ b/compiler/rustc_borrowck/src/diagnostics/mod.rs @@ -304,10 +304,10 @@ impl<'infcx, 'tcx> MirBorrowckCtxt<'_, 'infcx, 'tcx> { /// End-user visible description of `place` if one can be found. /// If the place is a temporary for instance, `None` will be returned. pub(super) fn describe_place(&self, place_ref: PlaceRef<'tcx>) -> Option { - self.describe_place_with_options(place_ref, DescribePlaceOpt { - including_downcast: false, - including_tuple_field: true, - }) + self.describe_place_with_options( + place_ref, + DescribePlaceOpt { including_downcast: false, including_tuple_field: true }, + ) } /// End-user visible description of `place` if one can be found. If the place is a temporary diff --git a/compiler/rustc_borrowck/src/diagnostics/region_errors.rs b/compiler/rustc_borrowck/src/diagnostics/region_errors.rs index 3c4e4c29197b8..b809b40a39908 100644 --- a/compiler/rustc_borrowck/src/diagnostics/region_errors.rs +++ b/compiler/rustc_borrowck/src/diagnostics/region_errors.rs @@ -1100,12 +1100,15 @@ impl<'infcx, 'tcx> MirBorrowckCtxt<'_, 'infcx, 'tcx> { let closure_ty = Ty::new_closure( tcx, closure_def_id.to_def_id(), - ty::ClosureArgs::new(tcx, ty::ClosureArgsParts { - parent_args: args.parent_args(), - closure_kind_ty: args.kind_ty(), - tupled_upvars_ty: args.tupled_upvars_ty(), - closure_sig_as_fn_ptr_ty, - }) + ty::ClosureArgs::new( + tcx, + ty::ClosureArgsParts { + parent_args: args.parent_args(), + closure_kind_ty: args.kind_ty(), + tupled_upvars_ty: args.tupled_upvars_ty(), + closure_sig_as_fn_ptr_ty, + }, + ) .args, ); diff --git a/compiler/rustc_borrowck/src/lib.rs b/compiler/rustc_borrowck/src/lib.rs index 8ddc8add67589..53cf4f34ae794 100644 --- a/compiler/rustc_borrowck/src/lib.rs +++ b/compiler/rustc_borrowck/src/lib.rs @@ -1668,9 +1668,13 @@ impl<'a, 'tcx> MirBorrowckCtxt<'a, '_, 'tcx> { match elem { ProjectionElem::Deref => match place_ty.ty.kind() { ty::Ref(..) | ty::RawPtr(..) => { - self.move_errors.push(MoveError::new(place, location, BorrowedContent { - target_place: place_ref.project_deeper(&[elem], tcx), - })); + self.move_errors.push(MoveError::new( + place, + location, + BorrowedContent { + target_place: place_ref.project_deeper(&[elem], tcx), + }, + )); return; } ty::Adt(adt, _) => { diff --git a/compiler/rustc_borrowck/src/region_infer/opaque_types.rs b/compiler/rustc_borrowck/src/region_infer/opaque_types.rs index 5440d451ec8d6..9c19f8b3ad825 100644 --- a/compiler/rustc_borrowck/src/region_infer/opaque_types.rs +++ b/compiler/rustc_borrowck/src/region_infer/opaque_types.rs @@ -166,10 +166,10 @@ impl<'tcx> RegionInferenceContext<'tcx> { // FIXME(oli-obk): collect multiple spans for better diagnostics down the road. prev.span = prev.span.substitute_dummy(concrete_type.span); } else { - result.insert(opaque_type_key.def_id, OpaqueHiddenType { - ty, - span: concrete_type.span, - }); + result.insert( + opaque_type_key.def_id, + OpaqueHiddenType { ty, span: concrete_type.span }, + ); } // Check that all opaque types have the same region parameters if they have the same diff --git a/compiler/rustc_borrowck/src/type_check/input_output.rs b/compiler/rustc_borrowck/src/type_check/input_output.rs index 1f2ec168f0322..f70b17e33624b 100644 --- a/compiler/rustc_borrowck/src/type_check/input_output.rs +++ b/compiler/rustc_borrowck/src/type_check/input_output.rs @@ -75,17 +75,20 @@ impl<'a, 'tcx> TypeChecker<'a, 'tcx> { let output_ty = Ty::new_coroutine( self.tcx(), self.tcx().coroutine_for_closure(mir_def_id), - ty::CoroutineArgs::new(self.tcx(), ty::CoroutineArgsParts { - parent_args: args.parent_args(), - kind_ty: Ty::from_coroutine_closure_kind(self.tcx(), args.kind()), - return_ty: user_provided_sig.output(), - tupled_upvars_ty, - // For async closures, none of these can be annotated, so just fill - // them with fresh ty vars. - resume_ty: next_ty_var(), - yield_ty: next_ty_var(), - witness: next_ty_var(), - }) + ty::CoroutineArgs::new( + self.tcx(), + ty::CoroutineArgsParts { + parent_args: args.parent_args(), + kind_ty: Ty::from_coroutine_closure_kind(self.tcx(), args.kind()), + return_ty: user_provided_sig.output(), + tupled_upvars_ty, + // For async closures, none of these can be annotated, so just fill + // them with fresh ty vars. + resume_ty: next_ty_var(), + yield_ty: next_ty_var(), + witness: next_ty_var(), + }, + ) .args, ); diff --git a/compiler/rustc_borrowck/src/type_check/mod.rs b/compiler/rustc_borrowck/src/type_check/mod.rs index 002f6e36cd8b3..26a5d438edb98 100644 --- a/compiler/rustc_borrowck/src/type_check/mod.rs +++ b/compiler/rustc_borrowck/src/type_check/mod.rs @@ -411,10 +411,10 @@ impl<'a, 'b, 'tcx> Visitor<'tcx> for TypeVerifier<'a, 'b, 'tcx> { } else { self.typeck.ascribe_user_type( constant.const_.ty(), - ty::UserType::new(ty::UserTypeKind::TypeOf(uv.def, UserArgs { - args: uv.args, - user_self_ty: None, - })), + ty::UserType::new(ty::UserTypeKind::TypeOf( + uv.def, + UserArgs { args: uv.args, user_self_ty: None }, + )), locations.span(self.typeck.body), ); } @@ -1642,10 +1642,11 @@ impl<'a, 'tcx> TypeChecker<'a, 'tcx> { } &Rvalue::NullaryOp(NullOp::SizeOf | NullOp::AlignOf, ty) => { - let trait_ref = - ty::TraitRef::new(tcx, tcx.require_lang_item(LangItem::Sized, Some(span)), [ - ty, - ]); + let trait_ref = ty::TraitRef::new( + tcx, + tcx.require_lang_item(LangItem::Sized, Some(span)), + [ty], + ); self.prove_trait_ref( trait_ref, @@ -1659,10 +1660,11 @@ impl<'a, 'tcx> TypeChecker<'a, 'tcx> { Rvalue::ShallowInitBox(operand, ty) => { self.check_operand(operand, location); - let trait_ref = - ty::TraitRef::new(tcx, tcx.require_lang_item(LangItem::Sized, Some(span)), [ - *ty, - ]); + let trait_ref = ty::TraitRef::new( + tcx, + tcx.require_lang_item(LangItem::Sized, Some(span)), + [*ty], + ); self.prove_trait_ref( trait_ref, diff --git a/compiler/rustc_borrowck/src/universal_regions.rs b/compiler/rustc_borrowck/src/universal_regions.rs index 26af86c0cdd49..eb0079a3883f0 100644 --- a/compiler/rustc_borrowck/src/universal_regions.rs +++ b/compiler/rustc_borrowck/src/universal_regions.rs @@ -620,10 +620,10 @@ impl<'cx, 'tcx> UniversalRegionsBuilder<'cx, 'tcx> { let ty = tcx .typeck(self.mir_def) .node_type(tcx.local_def_id_to_hir_id(self.mir_def)); - let args = InlineConstArgs::new(tcx, InlineConstArgsParts { - parent_args: identity_args, - ty, - }) + let args = InlineConstArgs::new( + tcx, + InlineConstArgsParts { parent_args: identity_args, ty }, + ) .args; let args = self.infcx.replace_free_regions_with_nll_infer_vars(FR, args); DefiningTy::InlineConst(self.mir_def.to_def_id(), args) diff --git a/compiler/rustc_builtin_macros/src/alloc_error_handler.rs b/compiler/rustc_builtin_macros/src/alloc_error_handler.rs index cffc497860133..78bf2195975d5 100644 --- a/compiler/rustc_builtin_macros/src/alloc_error_handler.rs +++ b/compiler/rustc_builtin_macros/src/alloc_error_handler.rs @@ -67,10 +67,11 @@ fn generate_handler(cx: &ExtCtxt<'_>, handler: Ident, span: Span, sig_span: Span let layout_new = cx.std_path(&[sym::alloc, sym::Layout, sym::from_size_align_unchecked]); let layout_new = cx.expr_path(cx.path(span, layout_new)); - let layout = cx.expr_call(span, layout_new, thin_vec![ - cx.expr_ident(span, size), - cx.expr_ident(span, align) - ]); + let layout = cx.expr_call( + span, + layout_new, + thin_vec![cx.expr_ident(span, size), cx.expr_ident(span, align)], + ); let call = cx.expr_call_ident(sig_span, handler, thin_vec![layout]); diff --git a/compiler/rustc_builtin_macros/src/autodiff.rs b/compiler/rustc_builtin_macros/src/autodiff.rs index 8960cf6ab598f..24c54edd705a1 100644 --- a/compiler/rustc_builtin_macros/src/autodiff.rs +++ b/compiler/rustc_builtin_macros/src/autodiff.rs @@ -406,19 +406,21 @@ mod llvm_enzyme { let unsf_expr = ecx.expr_block(P(unsf_block)); let blackbox_call_expr = ecx.expr_path(ecx.path(span, blackbox_path)); let primal_call = gen_primal_call(ecx, span, primal, idents); - let black_box_primal_call = - ecx.expr_call(new_decl_span, blackbox_call_expr.clone(), thin_vec![ - primal_call.clone() - ]); + let black_box_primal_call = ecx.expr_call( + new_decl_span, + blackbox_call_expr.clone(), + thin_vec![primal_call.clone()], + ); let tup_args = new_names .iter() .map(|arg| ecx.expr_path(ecx.path_ident(span, Ident::from_str(arg)))) .collect(); - let black_box_remaining_args = - ecx.expr_call(sig_span, blackbox_call_expr.clone(), thin_vec![ - ecx.expr_tuple(sig_span, tup_args) - ]); + let black_box_remaining_args = ecx.expr_call( + sig_span, + blackbox_call_expr.clone(), + thin_vec![ecx.expr_tuple(sig_span, tup_args)], + ); let mut body = ecx.block(span, ThinVec::new()); body.stmts.push(ecx.stmt_semi(unsf_expr)); @@ -532,8 +534,11 @@ mod llvm_enzyme { return body; } [arg] => { - ret = ecx - .expr_call(new_decl_span, blackbox_call_expr.clone(), thin_vec![arg.clone()]); + ret = ecx.expr_call( + new_decl_span, + blackbox_call_expr.clone(), + thin_vec![arg.clone()], + ); } args => { let ret_tuple: P = ecx.expr_tuple(span, args.into()); diff --git a/compiler/rustc_builtin_macros/src/deriving/clone.rs b/compiler/rustc_builtin_macros/src/deriving/clone.rs index 78f50ba8d29ed..c3656e8244fe0 100644 --- a/compiler/rustc_builtin_macros/src/deriving/clone.rs +++ b/compiler/rustc_builtin_macros/src/deriving/clone.rs @@ -114,10 +114,13 @@ fn cs_clone_simple( // type parameters. } else { // let _: AssertParamIsClone; - super::assert_ty_bounds(cx, &mut stmts, field.ty.clone(), field.span, &[ - sym::clone, - sym::AssertParamIsClone, - ]); + super::assert_ty_bounds( + cx, + &mut stmts, + field.ty.clone(), + field.span, + &[sym::clone, sym::AssertParamIsClone], + ); } } }; @@ -126,10 +129,13 @@ fn cs_clone_simple( // Just a single assertion for unions, that the union impls `Copy`. // let _: AssertParamIsCopy; let self_ty = cx.ty_path(cx.path_ident(trait_span, Ident::with_dummy_span(kw::SelfUpper))); - super::assert_ty_bounds(cx, &mut stmts, self_ty, trait_span, &[ - sym::clone, - sym::AssertParamIsCopy, - ]); + super::assert_ty_bounds( + cx, + &mut stmts, + self_ty, + trait_span, + &[sym::clone, sym::AssertParamIsCopy], + ); } else { match *substr.fields { StaticStruct(vdata, ..) => { diff --git a/compiler/rustc_builtin_macros/src/deriving/cmp/eq.rs b/compiler/rustc_builtin_macros/src/deriving/cmp/eq.rs index 5790350203a5a..eca79e4dc4897 100644 --- a/compiler/rustc_builtin_macros/src/deriving/cmp/eq.rs +++ b/compiler/rustc_builtin_macros/src/deriving/cmp/eq.rs @@ -65,10 +65,13 @@ fn cs_total_eq_assert( // Already produced an assertion for this type. } else { // let _: AssertParamIsEq; - super::assert_ty_bounds(cx, &mut stmts, field.ty.clone(), field.span, &[ - sym::cmp, - sym::AssertParamIsEq, - ]); + super::assert_ty_bounds( + cx, + &mut stmts, + field.ty.clone(), + field.span, + &[sym::cmp, sym::AssertParamIsEq], + ); } } }; diff --git a/compiler/rustc_builtin_macros/src/deriving/default.rs b/compiler/rustc_builtin_macros/src/deriving/default.rs index 2388b7dd64823..1fe567e23f455 100644 --- a/compiler/rustc_builtin_macros/src/deriving/default.rs +++ b/compiler/rustc_builtin_macros/src/deriving/default.rs @@ -108,30 +108,38 @@ fn default_enum_substructure( Ok(default_variant) => { // We now know there is exactly one unit variant with exactly one `#[default]` attribute. match &default_variant.data { - VariantData::Unit(_) => cx.expr_path(cx.path(default_variant.span, vec![ - Ident::new(kw::SelfUpper, default_variant.span), - default_variant.ident, - ])), + VariantData::Unit(_) => cx.expr_path(cx.path( + default_variant.span, + vec![Ident::new(kw::SelfUpper, default_variant.span), default_variant.ident], + )), VariantData::Struct { fields, .. } => { // This only happens if `#![feature(default_field_values)]`. We have validated // all fields have default values in the definition. let default_fields = fields .iter() .map(|field| { - cx.field_imm(field.span, field.ident.unwrap(), match &field.default { - // We use `Default::default()`. - None => default_call(cx, field.span), - // We use the field default const expression. - Some(val) => { - cx.expr(val.value.span, ast::ExprKind::ConstBlock(val.clone())) - } - }) + cx.field_imm( + field.span, + field.ident.unwrap(), + match &field.default { + // We use `Default::default()`. + None => default_call(cx, field.span), + // We use the field default const expression. + Some(val) => cx.expr( + val.value.span, + ast::ExprKind::ConstBlock(val.clone()), + ), + }, + ) }) .collect(); - let path = cx.path(default_variant.span, vec![ - Ident::new(kw::SelfUpper, default_variant.span), - default_variant.ident, - ]); + let path = cx.path( + default_variant.span, + vec![ + Ident::new(kw::SelfUpper, default_variant.span), + default_variant.ident, + ], + ); cx.expr_struct(default_variant.span, path, default_fields) } // Logic error in `extract_default_variant`. diff --git a/compiler/rustc_builtin_macros/src/deriving/generic/mod.rs b/compiler/rustc_builtin_macros/src/deriving/generic/mod.rs index 0631c5a80fc5e..234ec8582165b 100644 --- a/compiler/rustc_builtin_macros/src/deriving/generic/mod.rs +++ b/compiler/rustc_builtin_macros/src/deriving/generic/mod.rs @@ -1220,10 +1220,12 @@ impl<'a> MethodDef<'a> { let discr_let_stmts: ThinVec<_> = iter::zip(&discr_idents, &selflike_args) .map(|(&ident, selflike_arg)| { - let variant_value = - deriving::call_intrinsic(cx, span, sym::discriminant_value, thin_vec![ - selflike_arg.clone() - ]); + let variant_value = deriving::call_intrinsic( + cx, + span, + sym::discriminant_value, + thin_vec![selflike_arg.clone()], + ); cx.stmt_let(span, false, ident, variant_value) }) .collect(); diff --git a/compiler/rustc_builtin_macros/src/env.rs b/compiler/rustc_builtin_macros/src/env.rs index 8831261759c3c..0913dc91a5342 100644 --- a/compiler/rustc_builtin_macros/src/env.rs +++ b/compiler/rustc_builtin_macros/src/env.rs @@ -77,11 +77,11 @@ pub(crate) fn expand_option_env<'cx>( let guar = cx.dcx().emit_err(errors::EnvNotUnicode { span: sp, var: *symbol }); return ExpandResult::Ready(DummyResult::any(sp, guar)); } - Ok(value) => { - cx.expr_call_global(sp, cx.std_path(&[sym::option, sym::Option, sym::Some]), thin_vec![ - cx.expr_str(sp, value) - ]) - } + Ok(value) => cx.expr_call_global( + sp, + cx.std_path(&[sym::option, sym::Option, sym::Some]), + thin_vec![cx.expr_str(sp, value)], + ), }; ExpandResult::Ready(MacEager::expr(e)) } diff --git a/compiler/rustc_builtin_macros/src/format_foreign.rs b/compiler/rustc_builtin_macros/src/format_foreign.rs index 71320e6d5ad37..866ec72f11646 100644 --- a/compiler/rustc_builtin_macros/src/format_foreign.rs +++ b/compiler/rustc_builtin_macros/src/format_foreign.rs @@ -183,10 +183,14 @@ pub(crate) mod printf { s.push('{'); if let Some(arg) = self.parameter { - match write!(s, "{}", match arg.checked_sub(1) { - Some(a) => a, - None => return Err(None), - }) { + match write!( + s, + "{}", + match arg.checked_sub(1) { + Some(a) => a, + None => return Err(None), + } + ) { Err(_) => return Err(None), _ => {} } diff --git a/compiler/rustc_builtin_macros/src/format_foreign/printf/tests.rs b/compiler/rustc_builtin_macros/src/format_foreign/printf/tests.rs index 8fe06df48e5ec..1fd54e170b91c 100644 --- a/compiler/rustc_builtin_macros/src/format_foreign/printf/tests.rs +++ b/compiler/rustc_builtin_macros/src/format_foreign/printf/tests.rs @@ -99,12 +99,10 @@ fn test_parse() { fn test_iter() { let s = "The %d'th word %% is: `%.*s` %!\n"; let subs: Vec<_> = iter_subs(s, 0).map(|sub| sub.translate().ok()).collect(); - assert_eq!(subs.iter().map(Option::as_deref).collect::>(), vec![ - Some("{}"), - None, - Some("{:.*}"), - None - ]); + assert_eq!( + subs.iter().map(Option::as_deref).collect::>(), + vec![Some("{}"), None, Some("{:.*}"), None] + ); } /// Checks that the translations are what we expect. diff --git a/compiler/rustc_builtin_macros/src/format_foreign/shell/tests.rs b/compiler/rustc_builtin_macros/src/format_foreign/shell/tests.rs index dd2ee2b6ca9a9..145e3e529b0dc 100644 --- a/compiler/rustc_builtin_macros/src/format_foreign/shell/tests.rs +++ b/compiler/rustc_builtin_macros/src/format_foreign/shell/tests.rs @@ -38,11 +38,10 @@ fn test_iter() { use super::iter_subs; let s = "The $0'th word $$ is: `$WORD` $!\n"; let subs: Vec<_> = iter_subs(s, 0).map(|sub| sub.translate().ok()).collect(); - assert_eq!(subs.iter().map(Option::as_deref).collect::>(), vec![ - Some("{0}"), - None, - Some("{WORD}") - ]); + assert_eq!( + subs.iter().map(Option::as_deref).collect::>(), + vec![Some("{0}"), None, Some("{WORD}")] + ); } #[test] diff --git a/compiler/rustc_builtin_macros/src/proc_macro_harness.rs b/compiler/rustc_builtin_macros/src/proc_macro_harness.rs index dee185ff0c95c..ee6475c8b8e91 100644 --- a/compiler/rustc_builtin_macros/src/proc_macro_harness.rs +++ b/compiler/rustc_builtin_macros/src/proc_macro_harness.rs @@ -301,13 +301,10 @@ fn mk_decls(cx: &mut ExtCtxt<'_>, macros: &[ProcMacro]) -> P { }; let local_path = |cx: &ExtCtxt<'_>, name| cx.expr_path(cx.path(span, vec![name])); let proc_macro_ty_method_path = |cx: &ExtCtxt<'_>, method| { - cx.expr_path(cx.path(span.with_ctxt(harness_span.ctxt()), vec![ - proc_macro, - bridge, - client, - proc_macro_ty, - method, - ])) + cx.expr_path(cx.path( + span.with_ctxt(harness_span.ctxt()), + vec![proc_macro, bridge, client, proc_macro_ty, method], + )) }; match m { ProcMacro::Derive(cd) => { @@ -340,10 +337,14 @@ fn mk_decls(cx: &mut ExtCtxt<'_>, macros: &[ProcMacro]) -> P { // The call needs to use `harness_span` so that the const stability checker // accepts it. - cx.expr_call(harness_span, proc_macro_ty_method_path(cx, ident), thin_vec![ - cx.expr_str(span, ca.function_name.name), - local_path(cx, ca.function_name), - ]) + cx.expr_call( + harness_span, + proc_macro_ty_method_path(cx, ident), + thin_vec![ + cx.expr_str(span, ca.function_name.name), + local_path(cx, ca.function_name), + ], + ) } } }) @@ -357,12 +358,9 @@ fn mk_decls(cx: &mut ExtCtxt<'_>, macros: &[ProcMacro]) -> P { span, cx.ty( span, - ast::TyKind::Slice(cx.ty_path(cx.path(span, vec![ - proc_macro, - bridge, - client, - proc_macro_ty, - ]))), + ast::TyKind::Slice( + cx.ty_path(cx.path(span, vec![proc_macro, bridge, client, proc_macro_ty])), + ), ), None, ast::Mutability::Not, diff --git a/compiler/rustc_builtin_macros/src/test.rs b/compiler/rustc_builtin_macros/src/test.rs index 3f73ddbdd297e..a05fff2dcd1c1 100644 --- a/compiler/rustc_builtin_macros/src/test.rs +++ b/compiler/rustc_builtin_macros/src/test.rs @@ -169,20 +169,26 @@ pub(crate) fn expand_test_or_bench( // creates test::ShouldPanic::$name let should_panic_path = |name| { - cx.path(sp, vec![ - test_id, - Ident::from_str_and_span("ShouldPanic", sp), - Ident::from_str_and_span(name, sp), - ]) + cx.path( + sp, + vec![ + test_id, + Ident::from_str_and_span("ShouldPanic", sp), + Ident::from_str_and_span(name, sp), + ], + ) }; // creates test::TestType::$name let test_type_path = |name| { - cx.path(sp, vec![ - test_id, - Ident::from_str_and_span("TestType", sp), - Ident::from_str_and_span(name, sp), - ]) + cx.path( + sp, + vec![ + test_id, + Ident::from_str_and_span("TestType", sp), + Ident::from_str_and_span(name, sp), + ], + ) }; // creates $name: $expr @@ -202,39 +208,55 @@ pub(crate) fn expand_test_or_bench( // A simple ident for a lambda let b = Ident::from_str_and_span("b", attr_sp); - cx.expr_call(sp, cx.expr_path(test_path("StaticBenchFn")), thin_vec![ - // #[coverage(off)] - // |b| self::test::assert_test_result( - coverage_off(cx.lambda1( - sp, - cx.expr_call(sp, cx.expr_path(test_path("assert_test_result")), thin_vec![ - // super::$test_fn(b) + cx.expr_call( + sp, + cx.expr_path(test_path("StaticBenchFn")), + thin_vec![ + // #[coverage(off)] + // |b| self::test::assert_test_result( + coverage_off(cx.lambda1( + sp, cx.expr_call( - ret_ty_sp, - cx.expr_path(cx.path(sp, vec![item.ident])), - thin_vec![cx.expr_ident(sp, b)], + sp, + cx.expr_path(test_path("assert_test_result")), + thin_vec![ + // super::$test_fn(b) + cx.expr_call( + ret_ty_sp, + cx.expr_path(cx.path(sp, vec![item.ident])), + thin_vec![cx.expr_ident(sp, b)], + ), + ], ), - ],), - b, - )), // ) - ]) + b, + )), // ) + ], + ) } else { - cx.expr_call(sp, cx.expr_path(test_path("StaticTestFn")), thin_vec![ - // #[coverage(off)] - // || { - coverage_off(cx.lambda0( - sp, - // test::assert_test_result( - cx.expr_call(sp, cx.expr_path(test_path("assert_test_result")), thin_vec![ - // $test_fn() + cx.expr_call( + sp, + cx.expr_path(test_path("StaticTestFn")), + thin_vec![ + // #[coverage(off)] + // || { + coverage_off(cx.lambda0( + sp, + // test::assert_test_result( cx.expr_call( - ret_ty_sp, - cx.expr_path(cx.path(sp, vec![item.ident])), - ThinVec::new(), - ), // ) - ],), // } - )), // ) - ]) + sp, + cx.expr_path(test_path("assert_test_result")), + thin_vec![ + // $test_fn() + cx.expr_call( + ret_ty_sp, + cx.expr_path(cx.path(sp, vec![item.ident])), + ThinVec::new(), + ), // ) + ], + ), // } + )), // ) + ], + ) }; let test_path_symbol = Symbol::intern(&item_path( @@ -245,26 +267,30 @@ pub(crate) fn expand_test_or_bench( let location_info = get_location_info(cx, &item); - let mut test_const = cx.item( - sp, - Ident::new(item.ident.name, sp), - thin_vec![ - // #[cfg(test)] - cx.attr_nested_word(sym::cfg, sym::test, attr_sp), - // #[rustc_test_marker = "test_case_sort_key"] - cx.attr_name_value_str(sym::rustc_test_marker, test_path_symbol, attr_sp), - // #[doc(hidden)] - cx.attr_nested_word(sym::doc, sym::hidden, attr_sp), - ], - // const $ident: test::TestDescAndFn = - ast::ItemKind::Const( - ast::ConstItem { - defaultness: ast::Defaultness::Final, - generics: ast::Generics::default(), - ty: cx.ty(sp, ast::TyKind::Path(None, test_path("TestDescAndFn"))), - // test::TestDescAndFn { - expr: Some( - cx.expr_struct(sp, test_path("TestDescAndFn"), thin_vec![ + let mut test_const = + cx.item( + sp, + Ident::new(item.ident.name, sp), + thin_vec![ + // #[cfg(test)] + cx.attr_nested_word(sym::cfg, sym::test, attr_sp), + // #[rustc_test_marker = "test_case_sort_key"] + cx.attr_name_value_str(sym::rustc_test_marker, test_path_symbol, attr_sp), + // #[doc(hidden)] + cx.attr_nested_word(sym::doc, sym::hidden, attr_sp), + ], + // const $ident: test::TestDescAndFn = + ast::ItemKind::Const( + ast::ConstItem { + defaultness: ast::Defaultness::Final, + generics: ast::Generics::default(), + ty: cx.ty(sp, ast::TyKind::Path(None, test_path("TestDescAndFn"))), + // test::TestDescAndFn { + expr: Some( + cx.expr_struct( + sp, + test_path("TestDescAndFn"), + thin_vec![ // desc: test::TestDesc { field( "desc", @@ -340,12 +366,13 @@ pub(crate) fn expand_test_or_bench( ), // testfn: test::StaticTestFn(...) | test::StaticBenchFn(...) field("testfn", test_fn), // } - ]), // } - ), - } - .into(), - ), - ); + ], + ), // } + ), + } + .into(), + ), + ); test_const = test_const.map(|mut tc| { tc.vis.kind = ast::VisibilityKind::Public; tc diff --git a/compiler/rustc_codegen_cranelift/example/std_example.rs b/compiler/rustc_codegen_cranelift/example/std_example.rs index 0b1d83c56309f..ffdc6a7d48491 100644 --- a/compiler/rustc_codegen_cranelift/example/std_example.rs +++ b/compiler/rustc_codegen_cranelift/example/std_example.rs @@ -241,9 +241,10 @@ unsafe fn test_simd() { let (zero0, zero1) = std::mem::transmute::<_, (u64, u64)>(x); assert_eq!((zero0, zero1), (0, 0)); assert_eq!(std::mem::transmute::<_, [u16; 8]>(or), [7, 7, 7, 7, 7, 7, 7, 7]); - assert_eq!(std::mem::transmute::<_, [u16; 8]>(cmp_eq), [ - 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff - ]); + assert_eq!( + std::mem::transmute::<_, [u16; 8]>(cmp_eq), + [0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff] + ); assert_eq!(std::mem::transmute::<_, [u16; 8]>(cmp_lt), [0, 0, 0, 0, 0, 0, 0, 0]); test_mm_slli_si128(); diff --git a/compiler/rustc_codegen_cranelift/src/cast.rs b/compiler/rustc_codegen_cranelift/src/cast.rs index 4463631c524be..e2346324232fc 100644 --- a/compiler/rustc_codegen_cranelift/src/cast.rs +++ b/compiler/rustc_codegen_cranelift/src/cast.rs @@ -96,9 +96,12 @@ pub(crate) fn clif_int_or_float_cast( }, ); - fx.lib_call(&name, vec![AbiParam::new(from_ty)], vec![AbiParam::new(types::I128)], &[ - from, - ])[0] + fx.lib_call( + &name, + vec![AbiParam::new(from_ty)], + vec![AbiParam::new(types::I128)], + &[from], + )[0] } else if to_ty == types::I8 || to_ty == types::I16 { // FIXME implement fcvt_to_*int_sat.i8/i16 let val = if to_signed { diff --git a/compiler/rustc_codegen_cranelift/src/debuginfo/object.rs b/compiler/rustc_codegen_cranelift/src/debuginfo/object.rs index 048a388731fb0..1c6e471cc870f 100644 --- a/compiler/rustc_codegen_cranelift/src/debuginfo/object.rs +++ b/compiler/rustc_codegen_cranelift/src/debuginfo/object.rs @@ -73,16 +73,19 @@ impl WriteDebugInfo for ObjectProduct { } }; self.object - .add_relocation(from.0, Relocation { - offset: u64::from(reloc.offset), - symbol, - flags: RelocationFlags::Generic { - kind: reloc.kind, - encoding: RelocationEncoding::Generic, - size: reloc.size * 8, + .add_relocation( + from.0, + Relocation { + offset: u64::from(reloc.offset), + symbol, + flags: RelocationFlags::Generic { + kind: reloc.kind, + encoding: RelocationEncoding::Generic, + size: reloc.size * 8, + }, + addend: i64::try_from(symbol_offset).unwrap() + reloc.addend, }, - addend: i64::try_from(symbol_offset).unwrap() + reloc.addend, - }) + ) .unwrap(); } } diff --git a/compiler/rustc_codegen_cranelift/src/driver/jit.rs b/compiler/rustc_codegen_cranelift/src/driver/jit.rs index b18f4ff4747bd..2e713171ae064 100644 --- a/compiler/rustc_codegen_cranelift/src/driver/jit.rs +++ b/compiler/rustc_codegen_cranelift/src/driver/jit.rs @@ -342,11 +342,15 @@ fn codegen_shim<'tcx>( let instance_ptr = Box::into_raw(Box::new(inst)); let jit_fn = module - .declare_function("__clif_jit_fn", Linkage::Import, &Signature { - call_conv: module.target_config().default_call_conv, - params: vec![AbiParam::new(pointer_type), AbiParam::new(pointer_type)], - returns: vec![AbiParam::new(pointer_type)], - }) + .declare_function( + "__clif_jit_fn", + Linkage::Import, + &Signature { + call_conv: module.target_config().default_call_conv, + params: vec![AbiParam::new(pointer_type), AbiParam::new(pointer_type)], + returns: vec![AbiParam::new(pointer_type)], + }, + ) .unwrap(); let context = cached_context; diff --git a/compiler/rustc_codegen_cranelift/src/inline_asm.rs b/compiler/rustc_codegen_cranelift/src/inline_asm.rs index 6ff75f75d3b28..f2b0ec977c63d 100644 --- a/compiler/rustc_codegen_cranelift/src/inline_asm.rs +++ b/compiler/rustc_codegen_cranelift/src/inline_asm.rs @@ -875,11 +875,15 @@ fn call_inline_asm<'tcx>( let inline_asm_func = fx .module - .declare_function(asm_name, Linkage::Import, &Signature { - call_conv: CallConv::SystemV, - params: vec![AbiParam::new(fx.pointer_type)], - returns: vec![], - }) + .declare_function( + asm_name, + Linkage::Import, + &Signature { + call_conv: CallConv::SystemV, + params: vec![AbiParam::new(fx.pointer_type)], + returns: vec![], + }, + ) .unwrap(); let inline_asm_func = fx.module.declare_func_in_func(inline_asm_func, fx.bcx.func); if fx.clif_comments.enabled() { diff --git a/compiler/rustc_codegen_cranelift/src/intrinsics/simd.rs b/compiler/rustc_codegen_cranelift/src/intrinsics/simd.rs index d682efd19aaa5..fcccda62355c7 100644 --- a/compiler/rustc_codegen_cranelift/src/intrinsics/simd.rs +++ b/compiler/rustc_codegen_cranelift/src/intrinsics/simd.rs @@ -558,9 +558,12 @@ pub(super) fn codegen_simd_intrinsic_call<'tcx>( (sym::simd_round, types::F64) => "round", _ => unreachable!("{:?}", intrinsic), }; - fx.lib_call(name, vec![AbiParam::new(lane_ty)], vec![AbiParam::new(lane_ty)], &[ - lane, - ])[0] + fx.lib_call( + name, + vec![AbiParam::new(lane_ty)], + vec![AbiParam::new(lane_ty)], + &[lane], + )[0] }); } diff --git a/compiler/rustc_codegen_cranelift/src/main_shim.rs b/compiler/rustc_codegen_cranelift/src/main_shim.rs index f684349689542..6d5df2b00437b 100644 --- a/compiler/rustc_codegen_cranelift/src/main_shim.rs +++ b/compiler/rustc_codegen_cranelift/src/main_shim.rs @@ -15,9 +15,12 @@ pub(crate) fn maybe_create_entry_wrapper( is_primary_cgu: bool, ) { let (main_def_id, sigpipe) = match tcx.entry_fn(()) { - Some((def_id, entry_ty)) => (def_id, match entry_ty { - EntryFnType::Main { sigpipe } => sigpipe, - }), + Some((def_id, entry_ty)) => ( + def_id, + match entry_ty { + EntryFnType::Main { sigpipe } => sigpipe, + }, + ), None => return, }; diff --git a/compiler/rustc_codegen_cranelift/src/trap.rs b/compiler/rustc_codegen_cranelift/src/trap.rs index 9ef1a523d6d69..ac3f58ee1ee6e 100644 --- a/compiler/rustc_codegen_cranelift/src/trap.rs +++ b/compiler/rustc_codegen_cranelift/src/trap.rs @@ -5,11 +5,15 @@ use crate::prelude::*; fn codegen_print(fx: &mut FunctionCx<'_, '_, '_>, msg: &str) { let puts = fx .module - .declare_function("puts", Linkage::Import, &Signature { - call_conv: fx.target_config.default_call_conv, - params: vec![AbiParam::new(fx.pointer_type)], - returns: vec![AbiParam::new(types::I32)], - }) + .declare_function( + "puts", + Linkage::Import, + &Signature { + call_conv: fx.target_config.default_call_conv, + params: vec![AbiParam::new(fx.pointer_type)], + returns: vec![AbiParam::new(types::I32)], + }, + ) .unwrap(); let puts = fx.module.declare_func_in_func(puts, &mut fx.bcx.func); if fx.clif_comments.enabled() { diff --git a/compiler/rustc_codegen_gcc/src/builder.rs b/compiler/rustc_codegen_gcc/src/builder.rs index bba19d0625832..1c3d6cc899a63 100644 --- a/compiler/rustc_codegen_gcc/src/builder.rs +++ b/compiler/rustc_codegen_gcc/src/builder.rs @@ -155,14 +155,11 @@ impl<'a, 'gcc, 'tcx> Builder<'a, 'gcc, 'tcx> { // NOTE: not sure why, but we have the wrong type here. let int_type = compare_exchange.get_param(2).to_rvalue().get_type(); let src = self.context.new_bitcast(self.location, src, int_type); - self.context.new_call(self.location, compare_exchange, &[ - dst, - expected, - src, - weak, - order, - failure_order, - ]) + self.context.new_call( + self.location, + compare_exchange, + &[dst, expected, src, weak, order, failure_order], + ) } pub fn assign(&self, lvalue: LValue<'gcc>, value: RValue<'gcc>) { @@ -1076,9 +1073,11 @@ impl<'a, 'gcc, 'tcx> BuilderMethods<'a, 'tcx> for Builder<'a, 'gcc, 'tcx> { let align = dest.val.align.restrict_for_offset(dest.layout.field(self.cx(), 0).size); cg_elem.val.store(self, PlaceRef::new_sized_aligned(current_val, cg_elem.layout, align)); - let next = self.inbounds_gep(self.backend_type(cg_elem.layout), current.to_rvalue(), &[ - self.const_usize(1), - ]); + let next = self.inbounds_gep( + self.backend_type(cg_elem.layout), + current.to_rvalue(), + &[self.const_usize(1)], + ); self.llbb().add_assignment(self.location, current, next); self.br(header_bb); diff --git a/compiler/rustc_codegen_gcc/src/intrinsic/llvm.rs b/compiler/rustc_codegen_gcc/src/intrinsic/llvm.rs index 231307def291f..2d731f88d7d36 100644 --- a/compiler/rustc_codegen_gcc/src/intrinsic/llvm.rs +++ b/compiler/rustc_codegen_gcc/src/intrinsic/llvm.rs @@ -687,11 +687,12 @@ pub fn adjust_intrinsic_return_value<'a, 'gcc, 'tcx>( let field2 = builder.context.new_field(None, args[1].get_type(), "carryResult"); let struct_type = builder.context.new_struct_type(None, "addcarryResult", &[field1, field2]); - return_value = - builder.context.new_struct_constructor(None, struct_type.as_type(), None, &[ - return_value, - last_arg.dereference(None).to_rvalue(), - ]); + return_value = builder.context.new_struct_constructor( + None, + struct_type.as_type(), + None, + &[return_value, last_arg.dereference(None).to_rvalue()], + ); } } "__builtin_ia32_stmxcsr" => { @@ -716,11 +717,12 @@ pub fn adjust_intrinsic_return_value<'a, 'gcc, 'tcx>( let field2 = builder.context.new_field(None, return_value.get_type(), "success"); let struct_type = builder.context.new_struct_type(None, "rdrand_result", &[field1, field2]); - return_value = - builder.context.new_struct_constructor(None, struct_type.as_type(), None, &[ - random_number, - success_variable.to_rvalue(), - ]); + return_value = builder.context.new_struct_constructor( + None, + struct_type.as_type(), + None, + &[random_number, success_variable.to_rvalue()], + ); } "fma" => { let f16_type = builder.context.new_c_type(CType::Float16); diff --git a/compiler/rustc_codegen_gcc/src/intrinsic/simd.rs b/compiler/rustc_codegen_gcc/src/intrinsic/simd.rs index 12a7dab155b47..84cd5b002fbb6 100644 --- a/compiler/rustc_codegen_gcc/src/intrinsic/simd.rs +++ b/compiler/rustc_codegen_gcc/src/intrinsic/simd.rs @@ -62,11 +62,10 @@ pub fn generic_simd_intrinsic<'a, 'gcc, 'tcx>( let arg_tys = sig.inputs(); if name == sym::simd_select_bitmask { - require_simd!(arg_tys[1], InvalidMonomorphization::SimdArgument { - span, - name, - ty: arg_tys[1] - }); + require_simd!( + arg_tys[1], + InvalidMonomorphization::SimdArgument { span, name, ty: arg_tys[1] } + ); let (len, _) = arg_tys[1].simd_size_and_type(bx.tcx()); let expected_int_bits = (len.max(8) - 1).next_power_of_two(); @@ -140,14 +139,17 @@ pub fn generic_simd_intrinsic<'a, 'gcc, 'tcx>( require_simd!(ret_ty, InvalidMonomorphization::SimdReturn { span, name, ty: ret_ty }); let (out_len, out_ty) = ret_ty.simd_size_and_type(bx.tcx()); - require!(in_len == out_len, InvalidMonomorphization::ReturnLengthInputType { - span, - name, - in_len, - in_ty, - ret_ty, - out_len - }); + require!( + in_len == out_len, + InvalidMonomorphization::ReturnLengthInputType { + span, + name, + in_len, + in_ty, + ret_ty, + out_len + } + ); require!( bx.type_kind(bx.element_type(llret_ty)) == TypeKind::Integer, InvalidMonomorphization::ReturnIntegerType { span, name, ret_ty, out_ty } @@ -269,23 +271,17 @@ pub fn generic_simd_intrinsic<'a, 'gcc, 'tcx>( let lo_nibble = bx.context.new_rvalue_from_vector(None, long_byte_vector_type, &lo_nibble_elements); - let mask = bx.context.new_rvalue_from_vector(None, long_byte_vector_type, &vec![ - bx.context - .new_rvalue_from_int( - bx.u8_type, 0x0f - ); - byte_vector_type_size - as _ - ]); - - let four_vec = bx.context.new_rvalue_from_vector(None, long_byte_vector_type, &vec![ - bx.context - .new_rvalue_from_int( - bx.u8_type, 4 - ); - byte_vector_type_size - as _ - ]); + let mask = bx.context.new_rvalue_from_vector( + None, + long_byte_vector_type, + &vec![bx.context.new_rvalue_from_int(bx.u8_type, 0x0f); byte_vector_type_size as _], + ); + + let four_vec = bx.context.new_rvalue_from_vector( + None, + long_byte_vector_type, + &vec![bx.context.new_rvalue_from_int(bx.u8_type, 4); byte_vector_type_size as _], + ); // Step 2: Byte-swap the input. let swapped = simd_bswap(bx, args[0].immediate()); @@ -388,21 +384,14 @@ pub fn generic_simd_intrinsic<'a, 'gcc, 'tcx>( require_simd!(ret_ty, InvalidMonomorphization::SimdReturn { span, name, ty: ret_ty }); let (out_len, out_ty) = ret_ty.simd_size_and_type(bx.tcx()); - require!(out_len == n, InvalidMonomorphization::ReturnLength { - span, - name, - in_len: n, - ret_ty, - out_len - }); - require!(in_elem == out_ty, InvalidMonomorphization::ReturnElement { - span, - name, - in_elem, - in_ty, - ret_ty, - out_ty - }); + require!( + out_len == n, + InvalidMonomorphization::ReturnLength { span, name, in_len: n, ret_ty, out_len } + ); + require!( + in_elem == out_ty, + InvalidMonomorphization::ReturnElement { span, name, in_elem, in_ty, ret_ty, out_ty } + ); let vector = args[2].immediate(); @@ -411,13 +400,16 @@ pub fn generic_simd_intrinsic<'a, 'gcc, 'tcx>( #[cfg(feature = "master")] if name == sym::simd_insert { - require!(in_elem == arg_tys[2], InvalidMonomorphization::InsertedType { - span, - name, - in_elem, - in_ty, - out_ty: arg_tys[2] - }); + require!( + in_elem == arg_tys[2], + InvalidMonomorphization::InsertedType { + span, + name, + in_elem, + in_ty, + out_ty: arg_tys[2] + } + ); let vector = args[0].immediate(); let index = args[1].immediate(); let value = args[2].immediate(); @@ -431,13 +423,10 @@ pub fn generic_simd_intrinsic<'a, 'gcc, 'tcx>( #[cfg(feature = "master")] if name == sym::simd_extract { - require!(ret_ty == in_elem, InvalidMonomorphization::ReturnType { - span, - name, - in_elem, - in_ty, - ret_ty - }); + require!( + ret_ty == in_elem, + InvalidMonomorphization::ReturnType { span, name, in_elem, in_ty, ret_ty } + ); let vector = args[0].immediate(); return Ok(bx.context.new_vector_access(None, vector, args[1].immediate()).to_rvalue()); } @@ -445,18 +434,15 @@ pub fn generic_simd_intrinsic<'a, 'gcc, 'tcx>( if name == sym::simd_select { let m_elem_ty = in_elem; let m_len = in_len; - require_simd!(arg_tys[1], InvalidMonomorphization::SimdArgument { - span, - name, - ty: arg_tys[1] - }); + require_simd!( + arg_tys[1], + InvalidMonomorphization::SimdArgument { span, name, ty: arg_tys[1] } + ); let (v_len, _) = arg_tys[1].simd_size_and_type(bx.tcx()); - require!(m_len == v_len, InvalidMonomorphization::MismatchedLengths { - span, - name, - m_len, - v_len - }); + require!( + m_len == v_len, + InvalidMonomorphization::MismatchedLengths { span, name, m_len, v_len } + ); match *m_elem_ty.kind() { ty::Int(_) => {} _ => return_error!(InvalidMonomorphization::MaskType { span, name, ty: m_elem_ty }), @@ -468,25 +454,27 @@ pub fn generic_simd_intrinsic<'a, 'gcc, 'tcx>( require_simd!(ret_ty, InvalidMonomorphization::SimdReturn { span, name, ty: ret_ty }); let (out_len, out_elem) = ret_ty.simd_size_and_type(bx.tcx()); - require!(in_len == out_len, InvalidMonomorphization::ReturnLengthInputType { - span, - name, - in_len, - in_ty, - ret_ty, - out_len - }); + require!( + in_len == out_len, + InvalidMonomorphization::ReturnLengthInputType { + span, + name, + in_len, + in_ty, + ret_ty, + out_len + } + ); match *in_elem.kind() { ty::RawPtr(p_ty, _) => { let metadata = p_ty.ptr_metadata_ty(bx.tcx, |ty| { bx.tcx.normalize_erasing_regions(ty::TypingEnv::fully_monomorphized(), ty) }); - require!(metadata.is_unit(), InvalidMonomorphization::CastWidePointer { - span, - name, - ty: in_elem - }); + require!( + metadata.is_unit(), + InvalidMonomorphization::CastWidePointer { span, name, ty: in_elem } + ); } _ => { return_error!(InvalidMonomorphization::ExpectedPointer { span, name, ty: in_elem }) @@ -497,11 +485,10 @@ pub fn generic_simd_intrinsic<'a, 'gcc, 'tcx>( let metadata = p_ty.ptr_metadata_ty(bx.tcx, |ty| { bx.tcx.normalize_erasing_regions(ty::TypingEnv::fully_monomorphized(), ty) }); - require!(metadata.is_unit(), InvalidMonomorphization::CastWidePointer { - span, - name, - ty: out_elem - }); + require!( + metadata.is_unit(), + InvalidMonomorphization::CastWidePointer { span, name, ty: out_elem } + ); } _ => { return_error!(InvalidMonomorphization::ExpectedPointer { span, name, ty: out_elem }) @@ -524,14 +511,17 @@ pub fn generic_simd_intrinsic<'a, 'gcc, 'tcx>( require_simd!(ret_ty, InvalidMonomorphization::SimdReturn { span, name, ty: ret_ty }); let (out_len, out_elem) = ret_ty.simd_size_and_type(bx.tcx()); - require!(in_len == out_len, InvalidMonomorphization::ReturnLengthInputType { - span, - name, - in_len, - in_ty, - ret_ty, - out_len - }); + require!( + in_len == out_len, + InvalidMonomorphization::ReturnLengthInputType { + span, + name, + in_len, + in_ty, + ret_ty, + out_len + } + ); match *in_elem.kind() { ty::RawPtr(_, _) => {} @@ -560,14 +550,17 @@ pub fn generic_simd_intrinsic<'a, 'gcc, 'tcx>( require_simd!(ret_ty, InvalidMonomorphization::SimdReturn { span, name, ty: ret_ty }); let (out_len, out_elem) = ret_ty.simd_size_and_type(bx.tcx()); - require!(in_len == out_len, InvalidMonomorphization::ReturnLengthInputType { - span, - name, - in_len, - in_ty, - ret_ty, - out_len - }); + require!( + in_len == out_len, + InvalidMonomorphization::ReturnLengthInputType { + span, + name, + in_len, + in_ty, + ret_ty, + out_len + } + ); match *in_elem.kind() { ty::Uint(ty::UintTy::Usize) => {} @@ -596,14 +589,17 @@ pub fn generic_simd_intrinsic<'a, 'gcc, 'tcx>( if name == sym::simd_cast || name == sym::simd_as { require_simd!(ret_ty, InvalidMonomorphization::SimdReturn { span, name, ty: ret_ty }); let (out_len, out_elem) = ret_ty.simd_size_and_type(bx.tcx()); - require!(in_len == out_len, InvalidMonomorphization::ReturnLengthInputType { - span, - name, - in_len, - in_ty, - ret_ty, - out_len - }); + require!( + in_len == out_len, + InvalidMonomorphization::ReturnLengthInputType { + span, + name, + in_len, + in_ty, + ret_ty, + out_len + } + ); // casting cares about nominal type, not just structural type if in_elem == out_elem { return Ok(args[0].immediate()); @@ -629,14 +625,17 @@ pub fn generic_simd_intrinsic<'a, 'gcc, 'tcx>( match (in_style, out_style) { (Style::Unsupported, Style::Unsupported) => { - require!(false, InvalidMonomorphization::UnsupportedCast { - span, - name, - in_ty, - in_elem, - ret_ty, - out_elem - }); + require!( + false, + InvalidMonomorphization::UnsupportedCast { + span, + name, + in_ty, + in_elem, + ret_ty, + out_elem + } + ); } _ => return Ok(bx.context.convert_vector(None, args[0].immediate(), llret_ty)), } @@ -914,45 +913,47 @@ pub fn generic_simd_intrinsic<'a, 'gcc, 'tcx>( // All types must be simd vector types require_simd!(in_ty, InvalidMonomorphization::SimdFirst { span, name, ty: in_ty }); - require_simd!(arg_tys[1], InvalidMonomorphization::SimdSecond { - span, - name, - ty: arg_tys[1] - }); - require_simd!(arg_tys[2], InvalidMonomorphization::SimdThird { - span, - name, - ty: arg_tys[2] - }); + require_simd!( + arg_tys[1], + InvalidMonomorphization::SimdSecond { span, name, ty: arg_tys[1] } + ); + require_simd!( + arg_tys[2], + InvalidMonomorphization::SimdThird { span, name, ty: arg_tys[2] } + ); require_simd!(ret_ty, InvalidMonomorphization::SimdReturn { span, name, ty: ret_ty }); // Of the same length: let (out_len, _) = arg_tys[1].simd_size_and_type(bx.tcx()); let (out_len2, _) = arg_tys[2].simd_size_and_type(bx.tcx()); - require!(in_len == out_len, InvalidMonomorphization::SecondArgumentLength { - span, - name, - in_len, - in_ty, - arg_ty: arg_tys[1], - out_len - }); - require!(in_len == out_len2, InvalidMonomorphization::ThirdArgumentLength { - span, - name, - in_len, - in_ty, - arg_ty: arg_tys[2], - out_len: out_len2 - }); + require!( + in_len == out_len, + InvalidMonomorphization::SecondArgumentLength { + span, + name, + in_len, + in_ty, + arg_ty: arg_tys[1], + out_len + } + ); + require!( + in_len == out_len2, + InvalidMonomorphization::ThirdArgumentLength { + span, + name, + in_len, + in_ty, + arg_ty: arg_tys[2], + out_len: out_len2 + } + ); // The return type must match the first argument type - require!(ret_ty == in_ty, InvalidMonomorphization::ExpectedReturnType { - span, - name, - in_ty, - ret_ty - }); + require!( + ret_ty == in_ty, + InvalidMonomorphization::ExpectedReturnType { span, name, in_ty, ret_ty } + ); // This counts how many pointers fn ptr_count(t: Ty<'_>) -> usize { @@ -979,15 +980,18 @@ pub fn generic_simd_intrinsic<'a, 'gcc, 'tcx>( (ptr_count(element_ty1), non_ptr(element_ty1)) } _ => { - require!(false, InvalidMonomorphization::ExpectedElementType { - span, - name, - expected_element: element_ty1, - second_arg: arg_tys[1], - in_elem, - in_ty, - mutability: ExpectedPointerMutability::Not, - }); + require!( + false, + InvalidMonomorphization::ExpectedElementType { + span, + name, + expected_element: element_ty1, + second_arg: arg_tys[1], + in_elem, + in_ty, + mutability: ExpectedPointerMutability::Not, + } + ); unreachable!(); } }; @@ -1000,12 +1004,15 @@ pub fn generic_simd_intrinsic<'a, 'gcc, 'tcx>( match *element_ty2.kind() { ty::Int(_) => (), _ => { - require!(false, InvalidMonomorphization::ThirdArgElementType { - span, - name, - expected_element: element_ty2, - third_arg: arg_tys[2] - }); + require!( + false, + InvalidMonomorphization::ThirdArgElementType { + span, + name, + expected_element: element_ty2, + third_arg: arg_tys[2] + } + ); } } @@ -1029,36 +1036,40 @@ pub fn generic_simd_intrinsic<'a, 'gcc, 'tcx>( // All types must be simd vector types require_simd!(in_ty, InvalidMonomorphization::SimdFirst { span, name, ty: in_ty }); - require_simd!(arg_tys[1], InvalidMonomorphization::SimdSecond { - span, - name, - ty: arg_tys[1] - }); - require_simd!(arg_tys[2], InvalidMonomorphization::SimdThird { - span, - name, - ty: arg_tys[2] - }); + require_simd!( + arg_tys[1], + InvalidMonomorphization::SimdSecond { span, name, ty: arg_tys[1] } + ); + require_simd!( + arg_tys[2], + InvalidMonomorphization::SimdThird { span, name, ty: arg_tys[2] } + ); // Of the same length: let (element_len1, _) = arg_tys[1].simd_size_and_type(bx.tcx()); let (element_len2, _) = arg_tys[2].simd_size_and_type(bx.tcx()); - require!(in_len == element_len1, InvalidMonomorphization::SecondArgumentLength { - span, - name, - in_len, - in_ty, - arg_ty: arg_tys[1], - out_len: element_len1 - }); - require!(in_len == element_len2, InvalidMonomorphization::ThirdArgumentLength { - span, - name, - in_len, - in_ty, - arg_ty: arg_tys[2], - out_len: element_len2 - }); + require!( + in_len == element_len1, + InvalidMonomorphization::SecondArgumentLength { + span, + name, + in_len, + in_ty, + arg_ty: arg_tys[1], + out_len: element_len1 + } + ); + require!( + in_len == element_len2, + InvalidMonomorphization::ThirdArgumentLength { + span, + name, + in_len, + in_ty, + arg_ty: arg_tys[2], + out_len: element_len2 + } + ); // This counts how many pointers fn ptr_count(t: Ty<'_>) -> usize { @@ -1086,15 +1097,18 @@ pub fn generic_simd_intrinsic<'a, 'gcc, 'tcx>( (ptr_count(element_ty1), non_ptr(element_ty1)) } _ => { - require!(false, InvalidMonomorphization::ExpectedElementType { - span, - name, - expected_element: element_ty1, - second_arg: arg_tys[1], - in_elem, - in_ty, - mutability: ExpectedPointerMutability::Mut, - }); + require!( + false, + InvalidMonomorphization::ExpectedElementType { + span, + name, + expected_element: element_ty1, + second_arg: arg_tys[1], + in_elem, + in_ty, + mutability: ExpectedPointerMutability::Mut, + } + ); unreachable!(); } }; @@ -1106,12 +1120,15 @@ pub fn generic_simd_intrinsic<'a, 'gcc, 'tcx>( match *element_ty2.kind() { ty::Int(_) => (), _ => { - require!(false, InvalidMonomorphization::ThirdArgElementType { - span, - name, - expected_element: element_ty2, - third_arg: arg_tys[2] - }); + require!( + false, + InvalidMonomorphization::ThirdArgElementType { + span, + name, + expected_element: element_ty2, + third_arg: arg_tys[2] + } + ); } } @@ -1278,13 +1295,10 @@ pub fn generic_simd_intrinsic<'a, 'gcc, 'tcx>( ($name:ident : $vec_op:expr, $float_reduce:ident, $ordered:expr, $op:ident, $identity:expr) => { if name == sym::$name { - require!(ret_ty == in_elem, InvalidMonomorphization::ReturnType { - span, - name, - in_elem, - in_ty, - ret_ty - }); + require!( + ret_ty == in_elem, + InvalidMonomorphization::ReturnType { span, name, in_elem, in_ty, ret_ty } + ); return match *in_elem.kind() { ty::Int(_) | ty::Uint(_) => { let r = bx.vector_reduce_op(args[0].immediate(), $vec_op); @@ -1350,13 +1364,10 @@ pub fn generic_simd_intrinsic<'a, 'gcc, 'tcx>( macro_rules! minmax_red { ($name:ident: $int_red:ident, $float_red:ident) => { if name == sym::$name { - require!(ret_ty == in_elem, InvalidMonomorphization::ReturnType { - span, - name, - in_elem, - in_ty, - ret_ty - }); + require!( + ret_ty == in_elem, + InvalidMonomorphization::ReturnType { span, name, in_elem, in_ty, ret_ty } + ); return match *in_elem.kind() { ty::Int(_) | ty::Uint(_) => Ok(bx.$int_red(args[0].immediate())), ty::Float(_) => Ok(bx.$float_red(args[0].immediate())), @@ -1380,13 +1391,10 @@ pub fn generic_simd_intrinsic<'a, 'gcc, 'tcx>( ($name:ident : $op:expr, $boolean:expr) => { if name == sym::$name { let input = if !$boolean { - require!(ret_ty == in_elem, InvalidMonomorphization::ReturnType { - span, - name, - in_elem, - in_ty, - ret_ty - }); + require!( + ret_ty == in_elem, + InvalidMonomorphization::ReturnType { span, name, in_elem, in_ty, ret_ty } + ); args[0].immediate() } else { match *in_elem.kind() { diff --git a/compiler/rustc_codegen_llvm/src/abi.rs b/compiler/rustc_codegen_llvm/src/abi.rs index 31ee0eeca11fa..f4d78d59bac99 100644 --- a/compiler/rustc_codegen_llvm/src/abi.rs +++ b/compiler/rustc_codegen_llvm/src/abi.rs @@ -448,11 +448,11 @@ impl<'ll, 'tcx> FnAbiLlvmExt<'ll, 'tcx> for FnAbi<'tcx, Ty<'tcx>> { // LLVM also rejects full range. && !scalar.is_always_valid(cx) { - attributes::apply_to_llfn(llfn, idx, &[llvm::CreateRangeAttr( - cx.llcx, - scalar.size(cx), - scalar.valid_range(cx), - )]); + attributes::apply_to_llfn( + llfn, + idx, + &[llvm::CreateRangeAttr(cx.llcx, scalar.size(cx), scalar.valid_range(cx))], + ); } }; @@ -472,10 +472,14 @@ impl<'ll, 'tcx> FnAbiLlvmExt<'ll, 'tcx> for FnAbi<'tcx, Ty<'tcx>> { ); attributes::apply_to_llfn(llfn, llvm::AttributePlace::Argument(i), &[sret]); if cx.sess().opts.optimize != config::OptLevel::No { - attributes::apply_to_llfn(llfn, llvm::AttributePlace::Argument(i), &[ - llvm::AttributeKind::Writable.create_attr(cx.llcx), - llvm::AttributeKind::DeadOnUnwind.create_attr(cx.llcx), - ]); + attributes::apply_to_llfn( + llfn, + llvm::AttributePlace::Argument(i), + &[ + llvm::AttributeKind::Writable.create_attr(cx.llcx), + llvm::AttributeKind::DeadOnUnwind.create_attr(cx.llcx), + ], + ); } } PassMode::Cast { cast, pad_i32: _ } => { @@ -593,9 +597,11 @@ impl<'ll, 'tcx> FnAbiLlvmExt<'ll, 'tcx> for FnAbi<'tcx, Ty<'tcx>> { bx.cx.llcx, bx.cx.type_array(bx.cx.type_i8(), arg.layout.size.bytes()), ); - attributes::apply_to_callsite(callsite, llvm::AttributePlace::Argument(i), &[ - byval, - ]); + attributes::apply_to_callsite( + callsite, + llvm::AttributePlace::Argument(i), + &[byval], + ); } PassMode::Direct(attrs) | PassMode::Indirect { attrs, meta_attrs: None, on_stack: false } => { @@ -627,9 +633,11 @@ impl<'ll, 'tcx> FnAbiLlvmExt<'ll, 'tcx> for FnAbi<'tcx, Ty<'tcx>> { // This will probably get ignored on all targets but those supporting the TrustZone-M // extension (thumbv8m targets). let cmse_nonsecure_call = llvm::CreateAttrString(bx.cx.llcx, "cmse_nonsecure_call"); - attributes::apply_to_callsite(callsite, llvm::AttributePlace::Function, &[ - cmse_nonsecure_call, - ]); + attributes::apply_to_callsite( + callsite, + llvm::AttributePlace::Function, + &[cmse_nonsecure_call], + ); } // Some intrinsics require that an elementtype attribute (with the pointee type of a diff --git a/compiler/rustc_codegen_llvm/src/builder/autodiff.rs b/compiler/rustc_codegen_llvm/src/builder/autodiff.rs index 9e8e4e1c56774..dd5e726160d48 100644 --- a/compiler/rustc_codegen_llvm/src/builder/autodiff.rs +++ b/compiler/rustc_codegen_llvm/src/builder/autodiff.rs @@ -291,20 +291,26 @@ pub(crate) fn differentiate<'ll>( let name = item.source.clone(); let fn_def: Option<&llvm::Value> = cx.get_function(&name); let Some(fn_def) = fn_def else { - return Err(llvm_err(diag_handler.handle(), LlvmError::PrepareAutoDiff { - src: item.source.clone(), - target: item.target.clone(), - error: "could not find source function".to_owned(), - })); + return Err(llvm_err( + diag_handler.handle(), + LlvmError::PrepareAutoDiff { + src: item.source.clone(), + target: item.target.clone(), + error: "could not find source function".to_owned(), + }, + )); }; debug!(?item.target); let fn_target: Option<&llvm::Value> = cx.get_function(&item.target); let Some(fn_target) = fn_target else { - return Err(llvm_err(diag_handler.handle(), LlvmError::PrepareAutoDiff { - src: item.source.clone(), - target: item.target.clone(), - error: "could not find target function".to_owned(), - })); + return Err(llvm_err( + diag_handler.handle(), + LlvmError::PrepareAutoDiff { + src: item.source.clone(), + target: item.target.clone(), + error: "could not find target function".to_owned(), + }, + )); }; generate_enzyme_call(&cx, fn_def, fn_target, item.attrs.clone()); diff --git a/compiler/rustc_codegen_llvm/src/debuginfo/mod.rs b/compiler/rustc_codegen_llvm/src/debuginfo/mod.rs index 19fb2754571ca..51a17ed3d3fd2 100644 --- a/compiler/rustc_codegen_llvm/src/debuginfo/mod.rs +++ b/compiler/rustc_codegen_llvm/src/debuginfo/mod.rs @@ -544,14 +544,17 @@ impl<'ll, 'tcx> DebugInfoCodegenMethods<'tcx> for CodegenCx<'ll, 'tcx> { } } - let scope = namespace::item_namespace(cx, DefId { - krate: instance.def_id().krate, - index: cx - .tcx - .def_key(instance.def_id()) - .parent - .expect("get_containing_scope: missing parent?"), - }); + let scope = namespace::item_namespace( + cx, + DefId { + krate: instance.def_id().krate, + index: cx + .tcx + .def_key(instance.def_id()) + .parent + .expect("get_containing_scope: missing parent?"), + }, + ); (scope, false) } } diff --git a/compiler/rustc_codegen_llvm/src/intrinsic.rs b/compiler/rustc_codegen_llvm/src/intrinsic.rs index 43d6ccfcb4a28..3200c94d97703 100644 --- a/compiler/rustc_codegen_llvm/src/intrinsic.rs +++ b/compiler/rustc_codegen_llvm/src/intrinsic.rs @@ -333,12 +333,15 @@ impl<'ll, 'tcx> IntrinsicCallBuilderMethods<'tcx> for Builder<'_, 'll, 'tcx> { sym::prefetch_write_instruction => (1, 0), _ => bug!(), }; - self.call_intrinsic("llvm.prefetch", &[ - args[0].immediate(), - self.const_i32(rw), - args[1].immediate(), - self.const_i32(cache_type), - ]) + self.call_intrinsic( + "llvm.prefetch", + &[ + args[0].immediate(), + self.const_i32(rw), + args[1].immediate(), + self.const_i32(cache_type), + ], + ) } sym::carrying_mul_add => { let (size, signed) = fn_args.type_at(0).int_size_and_signed(self.tcx); @@ -396,10 +399,10 @@ impl<'ll, 'tcx> IntrinsicCallBuilderMethods<'tcx> for Builder<'_, 'll, 'tcx> { match name { sym::ctlz | sym::cttz => { let y = self.const_bool(false); - let ret = self.call_intrinsic(&format!("llvm.{name}.i{width}"), &[ - args[0].immediate(), - y, - ]); + let ret = self.call_intrinsic( + &format!("llvm.{name}.i{width}"), + &[args[0].immediate(), y], + ); self.intcast(ret, llret_ty, false) } @@ -416,24 +419,26 @@ impl<'ll, 'tcx> IntrinsicCallBuilderMethods<'tcx> for Builder<'_, 'll, 'tcx> { self.intcast(ret, llret_ty, false) } sym::ctpop => { - let ret = self.call_intrinsic(&format!("llvm.ctpop.i{width}"), &[ - args[0].immediate() - ]); + let ret = self.call_intrinsic( + &format!("llvm.ctpop.i{width}"), + &[args[0].immediate()], + ); self.intcast(ret, llret_ty, false) } sym::bswap => { if width == 8 { args[0].immediate() // byte swap a u8/i8 is just a no-op } else { - self.call_intrinsic(&format!("llvm.bswap.i{width}"), &[ - args[0].immediate() - ]) + self.call_intrinsic( + &format!("llvm.bswap.i{width}"), + &[args[0].immediate()], + ) } } - sym::bitreverse => self - .call_intrinsic(&format!("llvm.bitreverse.i{width}"), &[ - args[0].immediate() - ]), + sym::bitreverse => self.call_intrinsic( + &format!("llvm.bitreverse.i{width}"), + &[args[0].immediate()], + ), sym::rotate_left | sym::rotate_right => { let is_left = name == sym::rotate_left; let val = args[0].immediate(); @@ -500,11 +505,10 @@ impl<'ll, 'tcx> IntrinsicCallBuilderMethods<'tcx> for Builder<'_, 'll, 'tcx> { sym::compare_bytes => { // Here we assume that the `memcmp` provided by the target is a NOP for size 0. - let cmp = self.call_intrinsic("memcmp", &[ - args[0].immediate(), - args[1].immediate(), - args[2].immediate(), - ]); + let cmp = self.call_intrinsic( + "memcmp", + &[args[0].immediate(), args[1].immediate(), args[2].immediate()], + ); // Some targets have `memcmp` returning `i16`, but the intrinsic is always `i32`. self.sext(cmp, self.type_ix(32)) } @@ -1305,14 +1309,17 @@ fn generic_simd_intrinsic<'ll, 'tcx>( if let Some(cmp_op) = comparison { let (out_len, out_ty) = require_simd!(ret_ty, SimdReturn); - require!(in_len == out_len, InvalidMonomorphization::ReturnLengthInputType { - span, - name, - in_len, - in_ty, - ret_ty, - out_len - }); + require!( + in_len == out_len, + InvalidMonomorphization::ReturnLengthInputType { + span, + name, + in_len, + in_ty, + ret_ty, + out_len + } + ); require!( bx.type_kind(bx.element_type(llret_ty)) == TypeKind::Integer, InvalidMonomorphization::ReturnIntegerType { span, name, ret_ty, out_ty } @@ -1333,21 +1340,14 @@ fn generic_simd_intrinsic<'ll, 'tcx>( let n = idx.len() as u64; let (out_len, out_ty) = require_simd!(ret_ty, SimdReturn); - require!(out_len == n, InvalidMonomorphization::ReturnLength { - span, - name, - in_len: n, - ret_ty, - out_len - }); - require!(in_elem == out_ty, InvalidMonomorphization::ReturnElement { - span, - name, - in_elem, - in_ty, - ret_ty, - out_ty - }); + require!( + out_len == n, + InvalidMonomorphization::ReturnLength { span, name, in_len: n, ret_ty, out_len } + ); + require!( + in_elem == out_ty, + InvalidMonomorphization::ReturnElement { span, name, in_elem, in_ty, ret_ty, out_ty } + ); let total_len = in_len * 2; @@ -1392,21 +1392,14 @@ fn generic_simd_intrinsic<'ll, 'tcx>( }; let (out_len, out_ty) = require_simd!(ret_ty, SimdReturn); - require!(out_len == n, InvalidMonomorphization::ReturnLength { - span, - name, - in_len: n, - ret_ty, - out_len - }); - require!(in_elem == out_ty, InvalidMonomorphization::ReturnElement { - span, - name, - in_elem, - in_ty, - ret_ty, - out_ty - }); + require!( + out_len == n, + InvalidMonomorphization::ReturnLength { span, name, in_len: n, ret_ty, out_len } + ); + require!( + in_elem == out_ty, + InvalidMonomorphization::ReturnElement { span, name, in_elem, in_ty, ret_ty, out_ty } + ); let total_len = u128::from(in_len) * 2; @@ -1431,13 +1424,16 @@ fn generic_simd_intrinsic<'ll, 'tcx>( } if name == sym::simd_insert { - require!(in_elem == arg_tys[2], InvalidMonomorphization::InsertedType { - span, - name, - in_elem, - in_ty, - out_ty: arg_tys[2] - }); + require!( + in_elem == arg_tys[2], + InvalidMonomorphization::InsertedType { + span, + name, + in_elem, + in_ty, + out_ty: arg_tys[2] + } + ); let idx = bx .const_to_opt_u128(args[1].immediate(), false) .expect("typeck should have ensure that this is a const"); @@ -1456,13 +1452,10 @@ fn generic_simd_intrinsic<'ll, 'tcx>( )); } if name == sym::simd_extract { - require!(ret_ty == in_elem, InvalidMonomorphization::ReturnType { - span, - name, - in_elem, - in_ty, - ret_ty - }); + require!( + ret_ty == in_elem, + InvalidMonomorphization::ReturnType { span, name, in_elem, in_ty, ret_ty } + ); let idx = bx .const_to_opt_u128(args[1].immediate(), false) .expect("typeck should have ensure that this is a const"); @@ -1481,18 +1474,14 @@ fn generic_simd_intrinsic<'ll, 'tcx>( let m_elem_ty = in_elem; let m_len = in_len; let (v_len, _) = require_simd!(arg_tys[1], SimdArgument); - require!(m_len == v_len, InvalidMonomorphization::MismatchedLengths { - span, - name, - m_len, - v_len - }); - let in_elem_bitwidth = - require_int_ty!(m_elem_ty.kind(), InvalidMonomorphization::MaskType { - span, - name, - ty: m_elem_ty - }); + require!( + m_len == v_len, + InvalidMonomorphization::MismatchedLengths { span, name, m_len, v_len } + ); + let in_elem_bitwidth = require_int_ty!( + m_elem_ty.kind(), + InvalidMonomorphization::MaskType { span, name, ty: m_elem_ty } + ); let m_i1s = vector_mask_to_bitmask(bx, args[0].immediate(), in_elem_bitwidth, m_len); return Ok(bx.select(m_i1s, args[1].immediate(), args[2].immediate())); } @@ -1510,13 +1499,10 @@ fn generic_simd_intrinsic<'ll, 'tcx>( let expected_bytes = in_len.div_ceil(8); // Integer vector : - let in_elem_bitwidth = - require_int_or_uint_ty!(in_elem.kind(), InvalidMonomorphization::VectorArgument { - span, - name, - in_ty, - in_elem - }); + let in_elem_bitwidth = require_int_or_uint_ty!( + in_elem.kind(), + InvalidMonomorphization::VectorArgument { span, name, in_ty, in_elem } + ); let i1xn = vector_mask_to_bitmask(bx, args[0].immediate(), in_elem_bitwidth, in_len); // Bitcast to iN: @@ -1698,30 +1684,34 @@ fn generic_simd_intrinsic<'ll, 'tcx>( require_simd!(ret_ty, SimdReturn); // Of the same length: - require!(in_len == out_len, InvalidMonomorphization::SecondArgumentLength { - span, - name, - in_len, - in_ty, - arg_ty: arg_tys[1], - out_len - }); - require!(in_len == out_len2, InvalidMonomorphization::ThirdArgumentLength { - span, - name, - in_len, - in_ty, - arg_ty: arg_tys[2], - out_len: out_len2 - }); + require!( + in_len == out_len, + InvalidMonomorphization::SecondArgumentLength { + span, + name, + in_len, + in_ty, + arg_ty: arg_tys[1], + out_len + } + ); + require!( + in_len == out_len2, + InvalidMonomorphization::ThirdArgumentLength { + span, + name, + in_len, + in_ty, + arg_ty: arg_tys[2], + out_len: out_len2 + } + ); // The return type must match the first argument type - require!(ret_ty == in_ty, InvalidMonomorphization::ExpectedReturnType { - span, - name, - in_ty, - ret_ty - }); + require!( + ret_ty == in_ty, + InvalidMonomorphization::ExpectedReturnType { span, name, in_ty, ret_ty } + ); require!( matches!( @@ -1739,13 +1729,15 @@ fn generic_simd_intrinsic<'ll, 'tcx>( } ); - let mask_elem_bitwidth = - require_int_ty!(element_ty2.kind(), InvalidMonomorphization::ThirdArgElementType { + let mask_elem_bitwidth = require_int_ty!( + element_ty2.kind(), + InvalidMonomorphization::ThirdArgElementType { span, name, expected_element: element_ty2, third_arg: arg_tys[2] - }); + } + ); // Alignment of T, must be a constant integer value: let alignment_ty = bx.type_i32(); @@ -1805,22 +1797,23 @@ fn generic_simd_intrinsic<'ll, 'tcx>( require_simd!(ret_ty, SimdReturn); // Of the same length: - require!(values_len == mask_len, InvalidMonomorphization::ThirdArgumentLength { - span, - name, - in_len: mask_len, - in_ty: mask_ty, - arg_ty: values_ty, - out_len: values_len - }); + require!( + values_len == mask_len, + InvalidMonomorphization::ThirdArgumentLength { + span, + name, + in_len: mask_len, + in_ty: mask_ty, + arg_ty: values_ty, + out_len: values_len + } + ); // The return type must match the last argument type - require!(ret_ty == values_ty, InvalidMonomorphization::ExpectedReturnType { - span, - name, - in_ty: values_ty, - ret_ty - }); + require!( + ret_ty == values_ty, + InvalidMonomorphization::ExpectedReturnType { span, name, in_ty: values_ty, ret_ty } + ); require!( matches!( @@ -1838,13 +1831,15 @@ fn generic_simd_intrinsic<'ll, 'tcx>( } ); - let m_elem_bitwidth = - require_int_ty!(mask_elem.kind(), InvalidMonomorphization::ThirdArgElementType { + let m_elem_bitwidth = require_int_ty!( + mask_elem.kind(), + InvalidMonomorphization::ThirdArgElementType { span, name, expected_element: values_elem, third_arg: mask_ty, - }); + } + ); let mask = vector_mask_to_bitmask(bx, args[0].immediate(), m_elem_bitwidth, mask_len); let mask_ty = bx.type_vector(bx.type_i1(), mask_len); @@ -1896,14 +1891,17 @@ fn generic_simd_intrinsic<'ll, 'tcx>( let (values_len, values_elem) = require_simd!(values_ty, SimdThird); // Of the same length: - require!(values_len == mask_len, InvalidMonomorphization::ThirdArgumentLength { - span, - name, - in_len: mask_len, - in_ty: mask_ty, - arg_ty: values_ty, - out_len: values_len - }); + require!( + values_len == mask_len, + InvalidMonomorphization::ThirdArgumentLength { + span, + name, + in_len: mask_len, + in_ty: mask_ty, + arg_ty: values_ty, + out_len: values_len + } + ); // The second argument must be a mutable pointer type matching the element type require!( @@ -1923,13 +1921,15 @@ fn generic_simd_intrinsic<'ll, 'tcx>( } ); - let m_elem_bitwidth = - require_int_ty!(mask_elem.kind(), InvalidMonomorphization::ThirdArgElementType { + let m_elem_bitwidth = require_int_ty!( + mask_elem.kind(), + InvalidMonomorphization::ThirdArgElementType { span, name, expected_element: values_elem, third_arg: mask_ty, - }); + } + ); let mask = vector_mask_to_bitmask(bx, args[0].immediate(), m_elem_bitwidth, mask_len); let mask_ty = bx.type_vector(bx.type_i1(), mask_len); @@ -1976,22 +1976,28 @@ fn generic_simd_intrinsic<'ll, 'tcx>( let (element_len2, element_ty2) = require_simd!(arg_tys[2], SimdThird); // Of the same length: - require!(in_len == element_len1, InvalidMonomorphization::SecondArgumentLength { - span, - name, - in_len, - in_ty, - arg_ty: arg_tys[1], - out_len: element_len1 - }); - require!(in_len == element_len2, InvalidMonomorphization::ThirdArgumentLength { - span, - name, - in_len, - in_ty, - arg_ty: arg_tys[2], - out_len: element_len2 - }); + require!( + in_len == element_len1, + InvalidMonomorphization::SecondArgumentLength { + span, + name, + in_len, + in_ty, + arg_ty: arg_tys[1], + out_len: element_len1 + } + ); + require!( + in_len == element_len2, + InvalidMonomorphization::ThirdArgumentLength { + span, + name, + in_len, + in_ty, + arg_ty: arg_tys[2], + out_len: element_len2 + } + ); require!( matches!( @@ -2011,13 +2017,15 @@ fn generic_simd_intrinsic<'ll, 'tcx>( ); // The element type of the third argument must be a signed integer type of any width: - let mask_elem_bitwidth = - require_int_ty!(element_ty2.kind(), InvalidMonomorphization::ThirdArgElementType { + let mask_elem_bitwidth = require_int_ty!( + element_ty2.kind(), + InvalidMonomorphization::ThirdArgElementType { span, name, expected_element: element_ty2, third_arg: arg_tys[2] - }); + } + ); // Alignment of T, must be a constant integer value: let alignment_ty = bx.type_i32(); @@ -2058,13 +2066,10 @@ fn generic_simd_intrinsic<'ll, 'tcx>( ($name:ident : $integer_reduce:ident, $float_reduce:ident, $ordered:expr, $op:ident, $identity:expr) => { if name == sym::$name { - require!(ret_ty == in_elem, InvalidMonomorphization::ReturnType { - span, - name, - in_elem, - in_ty, - ret_ty - }); + require!( + ret_ty == in_elem, + InvalidMonomorphization::ReturnType { span, name, in_elem, in_ty, ret_ty } + ); return match in_elem.kind() { ty::Int(_) | ty::Uint(_) => { let r = bx.$integer_reduce(args[0].immediate()); @@ -2133,13 +2138,10 @@ fn generic_simd_intrinsic<'ll, 'tcx>( macro_rules! minmax_red { ($name:ident: $int_red:ident, $float_red:ident) => { if name == sym::$name { - require!(ret_ty == in_elem, InvalidMonomorphization::ReturnType { - span, - name, - in_elem, - in_ty, - ret_ty - }); + require!( + ret_ty == in_elem, + InvalidMonomorphization::ReturnType { span, name, in_elem, in_ty, ret_ty } + ); return match in_elem.kind() { ty::Int(_i) => Ok(bx.$int_red(args[0].immediate(), true)), ty::Uint(_u) => Ok(bx.$int_red(args[0].immediate(), false)), @@ -2164,13 +2166,10 @@ fn generic_simd_intrinsic<'ll, 'tcx>( ($name:ident : $red:ident, $boolean:expr) => { if name == sym::$name { let input = if !$boolean { - require!(ret_ty == in_elem, InvalidMonomorphization::ReturnType { - span, - name, - in_elem, - in_ty, - ret_ty - }); + require!( + ret_ty == in_elem, + InvalidMonomorphization::ReturnType { span, name, in_elem, in_ty, ret_ty } + ); args[0].immediate() } else { let bitwidth = match in_elem.kind() { @@ -2218,25 +2217,27 @@ fn generic_simd_intrinsic<'ll, 'tcx>( if name == sym::simd_cast_ptr { let (out_len, out_elem) = require_simd!(ret_ty, SimdReturn); - require!(in_len == out_len, InvalidMonomorphization::ReturnLengthInputType { - span, - name, - in_len, - in_ty, - ret_ty, - out_len - }); + require!( + in_len == out_len, + InvalidMonomorphization::ReturnLengthInputType { + span, + name, + in_len, + in_ty, + ret_ty, + out_len + } + ); match in_elem.kind() { ty::RawPtr(p_ty, _) => { let metadata = p_ty.ptr_metadata_ty(bx.tcx, |ty| { bx.tcx.normalize_erasing_regions(bx.typing_env(), ty) }); - require!(metadata.is_unit(), InvalidMonomorphization::CastWidePointer { - span, - name, - ty: in_elem - }); + require!( + metadata.is_unit(), + InvalidMonomorphization::CastWidePointer { span, name, ty: in_elem } + ); } _ => { return_error!(InvalidMonomorphization::ExpectedPointer { span, name, ty: in_elem }) @@ -2247,11 +2248,10 @@ fn generic_simd_intrinsic<'ll, 'tcx>( let metadata = p_ty.ptr_metadata_ty(bx.tcx, |ty| { bx.tcx.normalize_erasing_regions(bx.typing_env(), ty) }); - require!(metadata.is_unit(), InvalidMonomorphization::CastWidePointer { - span, - name, - ty: out_elem - }); + require!( + metadata.is_unit(), + InvalidMonomorphization::CastWidePointer { span, name, ty: out_elem } + ); } _ => { return_error!(InvalidMonomorphization::ExpectedPointer { span, name, ty: out_elem }) @@ -2263,14 +2263,17 @@ fn generic_simd_intrinsic<'ll, 'tcx>( if name == sym::simd_expose_provenance { let (out_len, out_elem) = require_simd!(ret_ty, SimdReturn); - require!(in_len == out_len, InvalidMonomorphization::ReturnLengthInputType { - span, - name, - in_len, - in_ty, - ret_ty, - out_len - }); + require!( + in_len == out_len, + InvalidMonomorphization::ReturnLengthInputType { + span, + name, + in_len, + in_ty, + ret_ty, + out_len + } + ); match in_elem.kind() { ty::RawPtr(_, _) => {} @@ -2288,14 +2291,17 @@ fn generic_simd_intrinsic<'ll, 'tcx>( if name == sym::simd_with_exposed_provenance { let (out_len, out_elem) = require_simd!(ret_ty, SimdReturn); - require!(in_len == out_len, InvalidMonomorphization::ReturnLengthInputType { - span, - name, - in_len, - in_ty, - ret_ty, - out_len - }); + require!( + in_len == out_len, + InvalidMonomorphization::ReturnLengthInputType { + span, + name, + in_len, + in_ty, + ret_ty, + out_len + } + ); match in_elem.kind() { ty::Uint(ty::UintTy::Usize) => {} @@ -2313,14 +2319,17 @@ fn generic_simd_intrinsic<'ll, 'tcx>( if name == sym::simd_cast || name == sym::simd_as { let (out_len, out_elem) = require_simd!(ret_ty, SimdReturn); - require!(in_len == out_len, InvalidMonomorphization::ReturnLengthInputType { - span, - name, - in_len, - in_ty, - ret_ty, - out_len - }); + require!( + in_len == out_len, + InvalidMonomorphization::ReturnLengthInputType { + span, + name, + in_len, + in_ty, + ret_ty, + out_len + } + ); // casting cares about nominal type, not just structural type if in_elem == out_elem { return Ok(args[0].immediate()); diff --git a/compiler/rustc_codegen_ssa/src/back/archive.rs b/compiler/rustc_codegen_ssa/src/back/archive.rs index 58eb137c06879..60af462b6b619 100644 --- a/compiler/rustc_codegen_ssa/src/back/archive.rs +++ b/compiler/rustc_codegen_ssa/src/back/archive.rs @@ -414,10 +414,10 @@ impl<'a> ArchiveBuilder for ArArchiveBuilder<'a> { let member_path = archive_path.parent().unwrap().join(Path::new(&file_name)); self.entries.push((file_name.into_bytes(), ArchiveEntry::File(member_path))); } else { - self.entries.push((file_name.into_bytes(), ArchiveEntry::FromArchive { - archive_index, - file_range: entry.file_range(), - })); + self.entries.push(( + file_name.into_bytes(), + ArchiveEntry::FromArchive { archive_index, file_range: entry.file_range() }, + )); } } } diff --git a/compiler/rustc_codegen_ssa/src/back/linker/tests.rs b/compiler/rustc_codegen_ssa/src/back/linker/tests.rs index bf3e8c902009e..143df085dbfde 100644 --- a/compiler/rustc_codegen_ssa/src/back/linker/tests.rs +++ b/compiler/rustc_codegen_ssa/src/back/linker/tests.rs @@ -10,23 +10,22 @@ fn test_rpaths_to_args() { #[test] fn test_xlinker() { let mut cmd = Command::new("foo"); - convert_link_args_to_cc_args(&mut cmd, &[ - "arg1", - "arg2", - "arg3,with,comma", - "arg4,with,comma", - "arg5", - "arg6,with,comma", - ]); + convert_link_args_to_cc_args( + &mut cmd, + &["arg1", "arg2", "arg3,with,comma", "arg4,with,comma", "arg5", "arg6,with,comma"], + ); - assert_eq!(cmd.get_args(), [ - OsStr::new("-Wl,arg1,arg2"), - OsStr::new("-Xlinker"), - OsStr::new("arg3,with,comma"), - OsStr::new("-Xlinker"), - OsStr::new("arg4,with,comma"), - OsStr::new("-Wl,arg5"), - OsStr::new("-Xlinker"), - OsStr::new("arg6,with,comma"), - ]); + assert_eq!( + cmd.get_args(), + [ + OsStr::new("-Wl,arg1,arg2"), + OsStr::new("-Xlinker"), + OsStr::new("arg3,with,comma"), + OsStr::new("-Xlinker"), + OsStr::new("arg4,with,comma"), + OsStr::new("-Wl,arg5"), + OsStr::new("-Xlinker"), + OsStr::new("arg6,with,comma"), + ] + ); } diff --git a/compiler/rustc_codegen_ssa/src/back/metadata.rs b/compiler/rustc_codegen_ssa/src/back/metadata.rs index ba7b53321a83d..d70413b8a4741 100644 --- a/compiler/rustc_codegen_ssa/src/back/metadata.rs +++ b/compiler/rustc_codegen_ssa/src/back/metadata.rs @@ -704,13 +704,17 @@ pub fn create_metadata_file_for_wasm(sess: &Session, data: &[u8], section_name: let mut imports = wasm_encoder::ImportSection::new(); if sess.target.pointer_width == 64 { - imports.import("env", "__linear_memory", wasm_encoder::MemoryType { - minimum: 0, - maximum: None, - memory64: true, - shared: false, - page_size_log2: None, - }); + imports.import( + "env", + "__linear_memory", + wasm_encoder::MemoryType { + minimum: 0, + maximum: None, + memory64: true, + shared: false, + page_size_log2: None, + }, + ); } if imports.len() > 0 { diff --git a/compiler/rustc_codegen_ssa/src/back/symbol_export.rs b/compiler/rustc_codegen_ssa/src/back/symbol_export.rs index f8f7bb2dbc69b..1dbaffaa57745 100644 --- a/compiler/rustc_codegen_ssa/src/back/symbol_export.rs +++ b/compiler/rustc_codegen_ssa/src/back/symbol_export.rs @@ -140,11 +140,14 @@ fn reachable_non_generics_provider(tcx: TyCtxt<'_>, _: LocalCrate) -> DefIdMap { if args.non_erasable_generics().next().is_some() { let symbol = ExportedSymbol::Generic(def, args); - symbols.push((symbol, SymbolExportInfo { - level: SymbolExportLevel::Rust, - kind: SymbolExportKind::Text, - used: false, - })); + symbols.push(( + symbol, + SymbolExportInfo { + level: SymbolExportLevel::Rust, + kind: SymbolExportKind::Text, + used: false, + }, + )); } } MonoItem::Fn(Instance { def: InstanceKind::DropGlue(_, Some(ty)), args }) => { // A little sanity-check assert_eq!(args.non_erasable_generics().next(), Some(GenericArgKind::Type(ty))); - symbols.push((ExportedSymbol::DropGlue(ty), SymbolExportInfo { - level: SymbolExportLevel::Rust, - kind: SymbolExportKind::Text, - used: false, - })); + symbols.push(( + ExportedSymbol::DropGlue(ty), + SymbolExportInfo { + level: SymbolExportLevel::Rust, + kind: SymbolExportKind::Text, + used: false, + }, + )); } MonoItem::Fn(Instance { def: InstanceKind::AsyncDropGlueCtorShim(_, Some(ty)), @@ -347,11 +377,14 @@ fn exported_symbols_provider_local( }) => { // A little sanity-check assert_eq!(args.non_erasable_generics().next(), Some(GenericArgKind::Type(ty))); - symbols.push((ExportedSymbol::AsyncDropGlueCtorShim(ty), SymbolExportInfo { - level: SymbolExportLevel::Rust, - kind: SymbolExportKind::Text, - used: false, - })); + symbols.push(( + ExportedSymbol::AsyncDropGlueCtorShim(ty), + SymbolExportInfo { + level: SymbolExportLevel::Rust, + kind: SymbolExportKind::Text, + used: false, + }, + )); } _ => { // Any other symbols don't qualify for sharing diff --git a/compiler/rustc_codegen_ssa/src/mir/block.rs b/compiler/rustc_codegen_ssa/src/mir/block.rs index 4be363ca9a2b0..a64cee4aa4b81 100644 --- a/compiler/rustc_codegen_ssa/src/mir/block.rs +++ b/compiler/rustc_codegen_ssa/src/mir/block.rs @@ -1604,10 +1604,10 @@ impl<'a, 'tcx, Bx: BuilderMethods<'a, 'tcx>> FunctionCx<'a, 'tcx, Bx> { if let Some(slot) = self.personality_slot { slot } else { - let layout = cx.layout_of(Ty::new_tup(cx.tcx(), &[ - Ty::new_mut_ptr(cx.tcx(), cx.tcx().types.u8), - cx.tcx().types.i32, - ])); + let layout = cx.layout_of(Ty::new_tup( + cx.tcx(), + &[Ty::new_mut_ptr(cx.tcx(), cx.tcx().types.u8), cx.tcx().types.i32], + )); let slot = PlaceRef::alloca(bx, layout); self.personality_slot = Some(slot); slot diff --git a/compiler/rustc_codegen_ssa/src/mir/place.rs b/compiler/rustc_codegen_ssa/src/mir/place.rs index 73a416768021d..eb4270ffe8096 100644 --- a/compiler/rustc_codegen_ssa/src/mir/place.rs +++ b/compiler/rustc_codegen_ssa/src/mir/place.rs @@ -474,10 +474,10 @@ impl<'a, 'tcx, Bx: BuilderMethods<'a, 'tcx>> FunctionCx<'a, 'tcx, Bx> { LocalRef::Operand(..) => { if place_ref.is_indirect_first_projection() { base = 1; - let cg_base = self.codegen_consume(bx, mir::PlaceRef { - projection: &place_ref.projection[..0], - ..place_ref - }); + let cg_base = self.codegen_consume( + bx, + mir::PlaceRef { projection: &place_ref.projection[..0], ..place_ref }, + ); cg_base.deref(bx.cx()) } else { bug!("using operand local {:?} as place", place_ref); diff --git a/compiler/rustc_const_eval/src/check_consts/qualifs.rs b/compiler/rustc_const_eval/src/check_consts/qualifs.rs index 9c99782d2238c..dfcd1969a73d1 100644 --- a/compiler/rustc_const_eval/src/check_consts/qualifs.rs +++ b/compiler/rustc_const_eval/src/check_consts/qualifs.rs @@ -188,12 +188,14 @@ impl Qualif for NeedsNonConstDrop { ObligationCause::misc(cx.body.span, cx.def_id()), param_env, ty::Binder::dummy(ty::TraitRef::new(cx.tcx, destruct_def_id, [ty])) - .to_host_effect_clause(cx.tcx, match cx.const_kind() { - rustc_hir::ConstContext::ConstFn => ty::BoundConstness::Maybe, - rustc_hir::ConstContext::Static(_) | rustc_hir::ConstContext::Const { .. } => { - ty::BoundConstness::Const - } - }), + .to_host_effect_clause( + cx.tcx, + match cx.const_kind() { + rustc_hir::ConstContext::ConstFn => ty::BoundConstness::Maybe, + rustc_hir::ConstContext::Static(_) + | rustc_hir::ConstContext::Const { .. } => ty::BoundConstness::Const, + }, + ), )); !ocx.select_all_or_error().is_empty() } diff --git a/compiler/rustc_const_eval/src/errors.rs b/compiler/rustc_const_eval/src/errors.rs index a2635885098e3..8df9877cabca2 100644 --- a/compiler/rustc_const_eval/src/errors.rs +++ b/compiler/rustc_const_eval/src/errors.rs @@ -578,10 +578,13 @@ impl<'a> ReportErrorExt for UndefinedBehaviorInfo<'a> { } ShiftOverflow { intrinsic, shift_amount } => { diag.arg("intrinsic", intrinsic); - diag.arg("shift_amount", match shift_amount { - Either::Left(v) => v.to_string(), - Either::Right(v) => v.to_string(), - }); + diag.arg( + "shift_amount", + match shift_amount { + Either::Left(v) => v.to_string(), + Either::Right(v) => v.to_string(), + }, + ); } BoundsCheckFailed { len, index } => { diag.arg("len", len); diff --git a/compiler/rustc_const_eval/src/interpret/call.rs b/compiler/rustc_const_eval/src/interpret/call.rs index e2e6e16d8a71a..cdf706f3752a4 100644 --- a/compiler/rustc_const_eval/src/interpret/call.rs +++ b/compiler/rustc_const_eval/src/interpret/call.rs @@ -381,10 +381,13 @@ impl<'tcx, M: Machine<'tcx>> InterpCx<'tcx, M> { "caller ABI: {:#?}, args: {:#?}", caller_fn_abi, args.iter() - .map(|arg| (arg.layout().ty, match arg { - FnArg::Copy(op) => format!("copy({op:?})"), - FnArg::InPlace(mplace) => format!("in-place({mplace:?})"), - })) + .map(|arg| ( + arg.layout().ty, + match arg { + FnArg::Copy(op) => format!("copy({op:?})"), + FnArg::InPlace(mplace) => format!("in-place({mplace:?})"), + } + )) .collect::>() ); trace!( @@ -874,10 +877,13 @@ impl<'tcx, M: Machine<'tcx>> InterpCx<'tcx, M> { ); // Check `unwinding`. - assert_eq!(unwinding, match self.frame().loc { - Left(loc) => self.body().basic_blocks[loc.block].is_cleanup, - Right(_) => true, - }); + assert_eq!( + unwinding, + match self.frame().loc { + Left(loc) => self.body().basic_blocks[loc.block].is_cleanup, + Right(_) => true, + } + ); if unwinding && self.frame_idx() == 0 { throw_ub_custom!(fluent::const_eval_unwind_past_top); } diff --git a/compiler/rustc_const_eval/src/interpret/intern.rs b/compiler/rustc_const_eval/src/interpret/intern.rs index 0cbb3b157f3f7..e14cc1dad3634 100644 --- a/compiler/rustc_const_eval/src/interpret/intern.rs +++ b/compiler/rustc_const_eval/src/interpret/intern.rs @@ -102,11 +102,11 @@ fn intern_as_new_static<'tcx>( alloc_id: AllocId, alloc: ConstAllocation<'tcx>, ) { - let feed = tcx.create_def(static_id, sym::nested, DefKind::Static { - safety: hir::Safety::Safe, - mutability: alloc.0.mutability, - nested: true, - }); + let feed = tcx.create_def( + static_id, + sym::nested, + DefKind::Static { safety: hir::Safety::Safe, mutability: alloc.0.mutability, nested: true }, + ); tcx.set_nested_alloc_id_static(alloc_id, feed.def_id()); if tcx.is_thread_local_static(static_id.into()) { diff --git a/compiler/rustc_const_eval/src/interpret/validity.rs b/compiler/rustc_const_eval/src/interpret/validity.rs index 8e54479874297..0ac34f4633b57 100644 --- a/compiler/rustc_const_eval/src/interpret/validity.rs +++ b/compiler/rustc_const_eval/src/interpret/validity.rs @@ -812,10 +812,10 @@ impl<'rt, 'tcx, M: Machine<'tcx>> ValidityVisitor<'rt, 'tcx, M> { if start == 1 && end == max_value { // Only null is the niche. So make sure the ptr is NOT null. if self.ecx.scalar_may_be_null(scalar)? { - throw_validation_failure!(self.path, NullablePtrOutOfRange { - range: valid_range, - max_value - }) + throw_validation_failure!( + self.path, + NullablePtrOutOfRange { range: valid_range, max_value } + ) } else { return interp_ok(()); } @@ -825,10 +825,10 @@ impl<'rt, 'tcx, M: Machine<'tcx>> ValidityVisitor<'rt, 'tcx, M> { } else { // Conservatively, we reject, because the pointer *could* have a bad // value. - throw_validation_failure!(self.path, PtrOutOfRange { - range: valid_range, - max_value - }) + throw_validation_failure!( + self.path, + PtrOutOfRange { range: valid_range, max_value } + ) } } }; @@ -836,11 +836,10 @@ impl<'rt, 'tcx, M: Machine<'tcx>> ValidityVisitor<'rt, 'tcx, M> { if valid_range.contains(bits) { interp_ok(()) } else { - throw_validation_failure!(self.path, OutOfRange { - value: format!("{bits}"), - range: valid_range, - max_value - }) + throw_validation_failure!( + self.path, + OutOfRange { value: format!("{bits}"), range: valid_range, max_value } + ) } } diff --git a/compiler/rustc_data_structures/src/graph/dominators/tests.rs b/compiler/rustc_data_structures/src/graph/dominators/tests.rs index ef82193a4b9df..6c078ca7c6ee4 100644 --- a/compiler/rustc_data_structures/src/graph/dominators/tests.rs +++ b/compiler/rustc_data_structures/src/graph/dominators/tests.rs @@ -15,17 +15,10 @@ fn diamond() { #[test] fn paper() { // example from the paper: - let graph = TestGraph::new(6, &[ - (6, 5), - (6, 4), - (5, 1), - (4, 2), - (4, 3), - (1, 2), - (2, 3), - (3, 2), - (2, 1), - ]); + let graph = TestGraph::new( + 6, + &[(6, 5), (6, 4), (5, 1), (4, 2), (4, 3), (1, 2), (2, 3), (3, 2), (2, 1)], + ); let d = dominators(&graph); assert_eq!(d.immediate_dominator(0), None); // <-- note that 0 is not in graph @@ -40,19 +33,10 @@ fn paper() { #[test] fn paper_slt() { // example from the paper: - let graph = TestGraph::new(1, &[ - (1, 2), - (1, 3), - (2, 3), - (2, 7), - (3, 4), - (3, 6), - (4, 5), - (5, 4), - (6, 7), - (7, 8), - (8, 5), - ]); + let graph = TestGraph::new( + 1, + &[(1, 2), (1, 3), (2, 3), (2, 7), (3, 4), (3, 6), (4, 5), (5, 4), (6, 7), (7, 8), (8, 5)], + ); dominators(&graph); } @@ -69,21 +53,24 @@ fn immediate_dominator() { #[test] fn transitive_dominator() { - let graph = TestGraph::new(0, &[ - // First tree branch. - (0, 1), - (1, 2), - (2, 3), - (3, 4), - // Second tree branch. - (1, 5), - (5, 6), - // Third tree branch. - (0, 7), - // These links make 0 the dominator for 2 and 3. - (7, 2), - (5, 3), - ]); + let graph = TestGraph::new( + 0, + &[ + // First tree branch. + (0, 1), + (1, 2), + (2, 3), + (3, 4), + // Second tree branch. + (1, 5), + (5, 6), + // Third tree branch. + (0, 7), + // These links make 0 the dominator for 2 and 3. + (7, 2), + (5, 3), + ], + ); let d = dominators(&graph); assert_eq!(d.immediate_dominator(2), Some(0)); diff --git a/compiler/rustc_data_structures/src/graph/implementation/tests.rs b/compiler/rustc_data_structures/src/graph/implementation/tests.rs index 7a240f4e58bcc..32a6d9ec881a9 100644 --- a/compiler/rustc_data_structures/src/graph/implementation/tests.rs +++ b/compiler/rustc_data_structures/src/graph/implementation/tests.rs @@ -110,10 +110,13 @@ fn each_adjacent_from_a() { #[test] fn each_adjacent_from_b() { let graph = create_graph(); - test_adjacent_edges(&graph, NodeIndex(1), "B", &[("FB", "F"), ("AB", "A")], &[ - ("BD", "D"), - ("BC", "C"), - ]); + test_adjacent_edges( + &graph, + NodeIndex(1), + "B", + &[("FB", "F"), ("AB", "A")], + &[("BD", "D"), ("BC", "C")], + ); } #[test] diff --git a/compiler/rustc_data_structures/src/graph/scc/tests.rs b/compiler/rustc_data_structures/src/graph/scc/tests.rs index 7c876c82af293..373f87bfdbcfa 100644 --- a/compiler/rustc_data_structures/src/graph/scc/tests.rs +++ b/compiler/rustc_data_structures/src/graph/scc/tests.rs @@ -326,46 +326,49 @@ fn test_bug_max_leak_minimised() { #[test] fn test_bug_max_leak() { - let graph = TestGraph::new(8, &[ - (0, 0), - (0, 18), - (0, 19), - (0, 1), - (0, 2), - (0, 7), - (0, 8), - (0, 23), - (18, 0), - (18, 12), - (19, 0), - (19, 25), - (12, 18), - (12, 3), - (12, 5), - (3, 12), - (3, 21), - (3, 22), - (5, 13), - (21, 3), - (22, 3), - (13, 5), - (13, 4), - (4, 13), - (4, 0), - (2, 11), - (7, 6), - (6, 20), - (20, 6), - (8, 17), - (17, 9), - (9, 16), - (16, 26), - (26, 15), - (15, 10), - (10, 14), - (14, 27), - (23, 24), - ]); + let graph = TestGraph::new( + 8, + &[ + (0, 0), + (0, 18), + (0, 19), + (0, 1), + (0, 2), + (0, 7), + (0, 8), + (0, 23), + (18, 0), + (18, 12), + (19, 0), + (19, 25), + (12, 18), + (12, 3), + (12, 5), + (3, 12), + (3, 21), + (3, 22), + (5, 13), + (21, 3), + (22, 3), + (13, 5), + (13, 4), + (4, 13), + (4, 0), + (2, 11), + (7, 6), + (6, 20), + (20, 6), + (8, 17), + (17, 9), + (9, 16), + (16, 26), + (26, 15), + (15, 10), + (10, 14), + (14, 27), + (23, 24), + ], + ); let sccs: MaxReachedSccs = Sccs::new_with_annotation(&graph, |w| match w { 22 => MaxReached(1), 24 => MaxReached(2), diff --git a/compiler/rustc_data_structures/src/obligation_forest/tests.rs b/compiler/rustc_data_structures/src/obligation_forest/tests.rs index 739ef74e3f7a9..1916a8e2b6b8b 100644 --- a/compiler/rustc_data_structures/src/obligation_forest/tests.rs +++ b/compiler/rustc_data_structures/src/obligation_forest/tests.rs @@ -349,10 +349,10 @@ fn diamond() { )); assert_eq!(d_count, 1); assert_eq!(ok.len(), 0); - assert_eq!(err, vec![super::Error { - error: "operation failed", - backtrace: vec!["D'", "A'.1", "A'"] - }]); + assert_eq!( + err, + vec![super::Error { error: "operation failed", backtrace: vec!["D'", "A'.1", "A'"] }] + ); let errors = forest.to_errors(()); assert_eq!(errors.len(), 0); diff --git a/compiler/rustc_data_structures/src/vec_cache/tests.rs b/compiler/rustc_data_structures/src/vec_cache/tests.rs index a05f274136209..3b65c14162e8e 100644 --- a/compiler/rustc_data_structures/src/vec_cache/tests.rs +++ b/compiler/rustc_data_structures/src/vec_cache/tests.rs @@ -58,11 +58,14 @@ fn concurrent_stress_check() { #[test] fn slot_entries_table() { - assert_eq!(ENTRIES_BY_BUCKET, [ - 4096, 4096, 8192, 16384, 32768, 65536, 131072, 262144, 524288, 1048576, 2097152, 4194304, - 8388608, 16777216, 33554432, 67108864, 134217728, 268435456, 536870912, 1073741824, - 2147483648 - ]); + assert_eq!( + ENTRIES_BY_BUCKET, + [ + 4096, 4096, 8192, 16384, 32768, 65536, 131072, 262144, 524288, 1048576, 2097152, + 4194304, 8388608, 16777216, 33554432, 67108864, 134217728, 268435456, 536870912, + 1073741824, 2147483648 + ] + ); } #[test] diff --git a/compiler/rustc_errors/src/json/tests.rs b/compiler/rustc_errors/src/json/tests.rs index f7892db296101..40973e8e5d8a4 100644 --- a/compiler/rustc_errors/src/json/tests.rs +++ b/compiler/rustc_errors/src/json/tests.rs @@ -69,96 +69,128 @@ fn test_positions(code: &str, span: (u32, u32), expected_output: SpanTestData) { #[test] fn empty() { - test_positions(" ", (0, 1), SpanTestData { - byte_start: 0, - byte_end: 1, - line_start: 1, - column_start: 1, - line_end: 1, - column_end: 2, - }) + test_positions( + " ", + (0, 1), + SpanTestData { + byte_start: 0, + byte_end: 1, + line_start: 1, + column_start: 1, + line_end: 1, + column_end: 2, + }, + ) } #[test] fn bom() { - test_positions("\u{feff} ", (0, 1), SpanTestData { - byte_start: 3, - byte_end: 4, - line_start: 1, - column_start: 1, - line_end: 1, - column_end: 2, - }) + test_positions( + "\u{feff} ", + (0, 1), + SpanTestData { + byte_start: 3, + byte_end: 4, + line_start: 1, + column_start: 1, + line_end: 1, + column_end: 2, + }, + ) } #[test] fn lf_newlines() { - test_positions("\nmod foo;\nmod bar;\n", (5, 12), SpanTestData { - byte_start: 5, - byte_end: 12, - line_start: 2, - column_start: 5, - line_end: 3, - column_end: 3, - }) + test_positions( + "\nmod foo;\nmod bar;\n", + (5, 12), + SpanTestData { + byte_start: 5, + byte_end: 12, + line_start: 2, + column_start: 5, + line_end: 3, + column_end: 3, + }, + ) } #[test] fn crlf_newlines() { - test_positions("\r\nmod foo;\r\nmod bar;\r\n", (5, 12), SpanTestData { - byte_start: 6, - byte_end: 14, - line_start: 2, - column_start: 5, - line_end: 3, - column_end: 3, - }) + test_positions( + "\r\nmod foo;\r\nmod bar;\r\n", + (5, 12), + SpanTestData { + byte_start: 6, + byte_end: 14, + line_start: 2, + column_start: 5, + line_end: 3, + column_end: 3, + }, + ) } #[test] fn crlf_newlines_with_bom() { - test_positions("\u{feff}\r\nmod foo;\r\nmod bar;\r\n", (5, 12), SpanTestData { - byte_start: 9, - byte_end: 17, - line_start: 2, - column_start: 5, - line_end: 3, - column_end: 3, - }) + test_positions( + "\u{feff}\r\nmod foo;\r\nmod bar;\r\n", + (5, 12), + SpanTestData { + byte_start: 9, + byte_end: 17, + line_start: 2, + column_start: 5, + line_end: 3, + column_end: 3, + }, + ) } #[test] fn span_before_crlf() { - test_positions("foo\r\nbar", (2, 3), SpanTestData { - byte_start: 2, - byte_end: 3, - line_start: 1, - column_start: 3, - line_end: 1, - column_end: 4, - }) + test_positions( + "foo\r\nbar", + (2, 3), + SpanTestData { + byte_start: 2, + byte_end: 3, + line_start: 1, + column_start: 3, + line_end: 1, + column_end: 4, + }, + ) } #[test] fn span_on_crlf() { - test_positions("foo\r\nbar", (3, 4), SpanTestData { - byte_start: 3, - byte_end: 5, - line_start: 1, - column_start: 4, - line_end: 2, - column_end: 1, - }) + test_positions( + "foo\r\nbar", + (3, 4), + SpanTestData { + byte_start: 3, + byte_end: 5, + line_start: 1, + column_start: 4, + line_end: 2, + column_end: 1, + }, + ) } #[test] fn span_after_crlf() { - test_positions("foo\r\nbar", (4, 5), SpanTestData { - byte_start: 5, - byte_end: 6, - line_start: 2, - column_start: 1, - line_end: 2, - column_end: 2, - }) + test_positions( + "foo\r\nbar", + (4, 5), + SpanTestData { + byte_start: 5, + byte_end: 6, + line_start: 2, + column_start: 1, + line_end: 2, + column_end: 2, + }, + ) } diff --git a/compiler/rustc_expand/src/build.rs b/compiler/rustc_expand/src/build.rs index 8bf09cf96b3f7..046213b5a6a6d 100644 --- a/compiler/rustc_expand/src/build.rs +++ b/compiler/rustc_expand/src/build.rs @@ -233,11 +233,14 @@ impl<'a> ExtCtxt<'a> { } pub fn block_expr(&self, expr: P) -> P { - self.block(expr.span, thin_vec![ast::Stmt { - id: ast::DUMMY_NODE_ID, - span: expr.span, - kind: ast::StmtKind::Expr(expr), - }]) + self.block( + expr.span, + thin_vec![ast::Stmt { + id: ast::DUMMY_NODE_ID, + span: expr.span, + kind: ast::StmtKind::Expr(expr), + }], + ) } pub fn block(&self, span: Span, stmts: ThinVec) -> P { P(ast::Block { diff --git a/compiler/rustc_expand/src/mbe/macro_rules.rs b/compiler/rustc_expand/src/mbe/macro_rules.rs index 7ac9f453baef3..b02a9b93c8af0 100644 --- a/compiler/rustc_expand/src/mbe/macro_rules.rs +++ b/compiler/rustc_expand/src/mbe/macro_rules.rs @@ -405,26 +405,35 @@ pub fn compile_declarative_macro( // ...quasiquoting this would be nice. // These spans won't matter, anyways let argument_gram = vec![ - mbe::TokenTree::Sequence(DelimSpan::dummy(), mbe::SequenceRepetition { - tts: vec![ - mbe::TokenTree::MetaVarDecl(span, lhs_nm, tt_spec), - mbe::TokenTree::token(token::FatArrow, span), - mbe::TokenTree::MetaVarDecl(span, rhs_nm, tt_spec), - ], - separator: Some(Token::new(if macro_rules { token::Semi } else { token::Comma }, span)), - kleene: mbe::KleeneToken::new(mbe::KleeneOp::OneOrMore, span), - num_captures: 2, - }), + mbe::TokenTree::Sequence( + DelimSpan::dummy(), + mbe::SequenceRepetition { + tts: vec![ + mbe::TokenTree::MetaVarDecl(span, lhs_nm, tt_spec), + mbe::TokenTree::token(token::FatArrow, span), + mbe::TokenTree::MetaVarDecl(span, rhs_nm, tt_spec), + ], + separator: Some(Token::new( + if macro_rules { token::Semi } else { token::Comma }, + span, + )), + kleene: mbe::KleeneToken::new(mbe::KleeneOp::OneOrMore, span), + num_captures: 2, + }, + ), // to phase into semicolon-termination instead of semicolon-separation - mbe::TokenTree::Sequence(DelimSpan::dummy(), mbe::SequenceRepetition { - tts: vec![mbe::TokenTree::token( - if macro_rules { token::Semi } else { token::Comma }, - span, - )], - separator: None, - kleene: mbe::KleeneToken::new(mbe::KleeneOp::ZeroOrMore, span), - num_captures: 0, - }), + mbe::TokenTree::Sequence( + DelimSpan::dummy(), + mbe::SequenceRepetition { + tts: vec![mbe::TokenTree::token( + if macro_rules { token::Semi } else { token::Comma }, + span, + )], + separator: None, + kleene: mbe::KleeneToken::new(mbe::KleeneOp::ZeroOrMore, span), + num_captures: 0, + }, + ), ]; // Convert it into `MatcherLoc` form. let argument_gram = mbe::macro_parser::compute_locs(&argument_gram); diff --git a/compiler/rustc_expand/src/mbe/quoted.rs b/compiler/rustc_expand/src/mbe/quoted.rs index a27d47892e461..b9a0615790790 100644 --- a/compiler/rustc_expand/src/mbe/quoted.rs +++ b/compiler/rustc_expand/src/mbe/quoted.rs @@ -179,10 +179,10 @@ fn parse_tree<'a>( Some(&tokenstream::TokenTree::Delimited(delim_span, _, delim, ref tts)) => { if parsing_patterns { if delim != Delimiter::Parenthesis { - span_dollar_dollar_or_metavar_in_the_lhs_err(sess, &Token { - kind: token::OpenDelim(delim), - span: delim_span.entire(), - }); + span_dollar_dollar_or_metavar_in_the_lhs_err( + sess, + &Token { kind: token::OpenDelim(delim), span: delim_span.entire() }, + ); } } else { match delim { @@ -235,12 +235,10 @@ fn parse_tree<'a>( // Count the number of captured "names" (i.e., named metavars) let num_captures = if parsing_patterns { count_metavar_decls(&sequence) } else { 0 }; - TokenTree::Sequence(delim_span, SequenceRepetition { - tts: sequence, - separator, - kleene, - num_captures, - }) + TokenTree::Sequence( + delim_span, + SequenceRepetition { tts: sequence, separator, kleene, num_captures }, + ) } // `tree` is followed by an `ident`. This could be `$meta_var` or the `$crate` @@ -261,10 +259,10 @@ fn parse_tree<'a>( _, )) => { if parsing_patterns { - span_dollar_dollar_or_metavar_in_the_lhs_err(sess, &Token { - kind: token::Dollar, - span: dollar_span2, - }); + span_dollar_dollar_or_metavar_in_the_lhs_err( + sess, + &Token { kind: token::Dollar, span: dollar_span2 }, + ); } else { maybe_emit_macro_metavar_expr_feature(features, sess, dollar_span2); } @@ -289,12 +287,14 @@ fn parse_tree<'a>( // `tree` is the beginning of a delimited set of tokens (e.g., `(` or `{`). We need to // descend into the delimited set and further parse it. - &tokenstream::TokenTree::Delimited(span, spacing, delim, ref tts) => { - TokenTree::Delimited(span, spacing, Delimited { + &tokenstream::TokenTree::Delimited(span, spacing, delim, ref tts) => TokenTree::Delimited( + span, + spacing, + Delimited { delim, tts: parse(tts, parsing_patterns, sess, node_id, features, edition), - }) - } + }, + ), } } diff --git a/compiler/rustc_graphviz/src/tests.rs b/compiler/rustc_graphviz/src/tests.rs index 712620a2000c7..bf2f43fde2ee9 100644 --- a/compiler/rustc_graphviz/src/tests.rs +++ b/compiler/rustc_graphviz/src/tests.rs @@ -360,12 +360,16 @@ fn left_aligned_text() { let mut writer = Vec::new(); - let g = LabelledGraphWithEscStrs::new("syntax_tree", labels, vec![ - edge(0, 1, "then", Style::None), - edge(0, 2, "else", Style::None), - edge(1, 3, ";", Style::None), - edge(2, 3, ";", Style::None), - ]); + let g = LabelledGraphWithEscStrs::new( + "syntax_tree", + labels, + vec![ + edge(0, 1, "then", Style::None), + edge(0, 2, "else", Style::None), + edge(1, 3, ";", Style::None), + edge(2, 3, ";", Style::None), + ], + ); render(&g, &mut writer).unwrap(); let mut r = String::new(); diff --git a/compiler/rustc_hir/src/hir.rs b/compiler/rustc_hir/src/hir.rs index e7b6a97c9d963..eafc60f9d72f7 100644 --- a/compiler/rustc_hir/src/hir.rs +++ b/compiler/rustc_hir/src/hir.rs @@ -3101,10 +3101,10 @@ impl<'hir> Ty<'hir> { fn visit_ty(&mut self, t: &'v Ty<'v, AmbigArg>) { if matches!( &t.kind, - TyKind::Path(QPath::Resolved(_, Path { - res: crate::def::Res::SelfTyAlias { .. }, - .. - },)) + TyKind::Path(QPath::Resolved( + _, + Path { res: crate::def::Res::SelfTyAlias { .. }, .. }, + )) ) { self.0.push(t.span); return; @@ -3446,11 +3446,10 @@ impl<'hir> InlineAsmOperand<'hir> { } pub fn is_clobber(&self) -> bool { - matches!(self, InlineAsmOperand::Out { - reg: InlineAsmRegOrRegClass::Reg(_), - late: _, - expr: None - }) + matches!( + self, + InlineAsmOperand::Out { reg: InlineAsmRegOrRegClass::Reg(_), late: _, expr: None } + ) } } diff --git a/compiler/rustc_hir_analysis/src/check/compare_impl_item.rs b/compiler/rustc_hir_analysis/src/check/compare_impl_item.rs index a91d72e922518..bb5087e864cb0 100644 --- a/compiler/rustc_hir_analysis/src/check/compare_impl_item.rs +++ b/compiler/rustc_hir_analysis/src/check/compare_impl_item.rs @@ -182,12 +182,15 @@ fn compare_method_predicate_entailment<'tcx>( // obligations. let impl_m_def_id = impl_m.def_id.expect_local(); let impl_m_span = tcx.def_span(impl_m_def_id); - let cause = - ObligationCause::new(impl_m_span, impl_m_def_id, ObligationCauseCode::CompareImplItem { + let cause = ObligationCause::new( + impl_m_span, + impl_m_def_id, + ObligationCauseCode::CompareImplItem { impl_item_def_id: impl_m_def_id, trait_item_def_id: trait_m.def_id, kind: impl_m.kind, - }); + }, + ); // Create mapping from trait method to impl method. let impl_def_id = impl_m.container_id(tcx); @@ -248,12 +251,15 @@ fn compare_method_predicate_entailment<'tcx>( let normalize_cause = traits::ObligationCause::misc(span, impl_m_def_id); let predicate = ocx.normalize(&normalize_cause, param_env, predicate); - let cause = - ObligationCause::new(span, impl_m_def_id, ObligationCauseCode::CompareImplItem { + let cause = ObligationCause::new( + span, + impl_m_def_id, + ObligationCauseCode::CompareImplItem { impl_item_def_id: impl_m_def_id, trait_item_def_id: trait_m.def_id, kind: impl_m.kind, - }); + }, + ); ocx.register_obligation(traits::Obligation::new(tcx, cause, param_env, predicate)); } @@ -270,12 +276,15 @@ fn compare_method_predicate_entailment<'tcx>( let normalize_cause = traits::ObligationCause::misc(span, impl_m_def_id); let const_condition = ocx.normalize(&normalize_cause, param_env, const_condition); - let cause = - ObligationCause::new(span, impl_m_def_id, ObligationCauseCode::CompareImplItem { + let cause = ObligationCause::new( + span, + impl_m_def_id, + ObligationCauseCode::CompareImplItem { impl_item_def_id: impl_m_def_id, trait_item_def_id: trait_m.def_id, kind: impl_m.kind, - }); + }, + ); ocx.register_obligation(traits::Obligation::new( tcx, cause, @@ -493,12 +502,15 @@ pub(super) fn collect_return_position_impl_trait_in_trait_tys<'tcx>( let impl_m_hir_id = tcx.local_def_id_to_hir_id(impl_m_def_id); let return_span = tcx.hir().fn_decl_by_hir_id(impl_m_hir_id).unwrap().output.span(); - let cause = - ObligationCause::new(return_span, impl_m_def_id, ObligationCauseCode::CompareImplItem { + let cause = ObligationCause::new( + return_span, + impl_m_def_id, + ObligationCauseCode::CompareImplItem { impl_item_def_id: impl_m_def_id, trait_item_def_id: trait_m.def_id, kind: impl_m.kind, - }); + }, + ); // Create mapping from trait to impl (i.e. impl trait header + impl method identity args). let trait_to_impl_args = GenericArgs::identity_for_item(tcx, impl_m.def_id).rebase_onto( @@ -534,12 +546,15 @@ pub(super) fn collect_return_position_impl_trait_in_trait_tys<'tcx>( let normalize_cause = traits::ObligationCause::misc(span, impl_m_def_id); let predicate = ocx.normalize(&normalize_cause, param_env, predicate); - let cause = - ObligationCause::new(span, impl_m_def_id, ObligationCauseCode::CompareImplItem { + let cause = ObligationCause::new( + span, + impl_m_def_id, + ObligationCauseCode::CompareImplItem { impl_item_def_id: impl_m_def_id, trait_item_def_id: trait_m.def_id, kind: impl_m.kind, - }); + }, + ); ocx.register_obligation(traits::Obligation::new(tcx, cause, param_env, predicate)); } @@ -606,13 +621,16 @@ pub(super) fn collect_return_position_impl_trait_in_trait_tys<'tcx>( idx += 1; ( ty, - Ty::new_placeholder(tcx, ty::Placeholder { - universe, - bound: ty::BoundTy { - var: ty::BoundVar::from_usize(idx), - kind: ty::BoundTyKind::Anon, + Ty::new_placeholder( + tcx, + ty::Placeholder { + universe, + bound: ty::BoundTy { + var: ty::BoundVar::from_usize(idx), + kind: ty::BoundTyKind::Anon, + }, }, - }), + ), ) }) .collect(); @@ -969,10 +987,13 @@ impl<'tcx> ty::FallibleTypeFolder> for RemapHiddenTyRegions<'tcx> { return Err(guar); }; - Ok(ty::Region::new_early_param(self.tcx, ty::EarlyParamRegion { - name: e.name, - index: (e.index as usize - self.num_trait_args + self.num_impl_args) as u32, - })) + Ok(ty::Region::new_early_param( + self.tcx, + ty::EarlyParamRegion { + name: e.name, + index: (e.index as usize - self.num_trait_args + self.num_impl_args) as u32, + }, + )) } } @@ -1967,12 +1988,15 @@ fn compare_type_predicate_entailment<'tcx>( let cause = ObligationCause::misc(span, impl_ty_def_id); let predicate = ocx.normalize(&cause, param_env, predicate); - let cause = - ObligationCause::new(span, impl_ty_def_id, ObligationCauseCode::CompareImplItem { + let cause = ObligationCause::new( + span, + impl_ty_def_id, + ObligationCauseCode::CompareImplItem { impl_item_def_id: impl_ty.def_id.expect_local(), trait_item_def_id: trait_ty.def_id, kind: impl_ty.kind, - }); + }, + ); ocx.register_obligation(traits::Obligation::new(tcx, cause, param_env, predicate)); } @@ -1984,12 +2008,15 @@ fn compare_type_predicate_entailment<'tcx>( let normalize_cause = traits::ObligationCause::misc(span, impl_ty_def_id); let const_condition = ocx.normalize(&normalize_cause, param_env, const_condition); - let cause = - ObligationCause::new(span, impl_ty_def_id, ObligationCauseCode::CompareImplItem { + let cause = ObligationCause::new( + span, + impl_ty_def_id, + ObligationCauseCode::CompareImplItem { impl_item_def_id: impl_ty_def_id, trait_item_def_id: trait_ty.def_id, kind: impl_ty.kind, - }); + }, + ); ocx.register_obligation(traits::Obligation::new( tcx, cause, @@ -2244,20 +2271,25 @@ fn param_env_with_gat_bounds<'tcx>( let kind = ty::BoundTyKind::Param(param.def_id, param.name); let bound_var = ty::BoundVariableKind::Ty(kind); bound_vars.push(bound_var); - Ty::new_bound(tcx, ty::INNERMOST, ty::BoundTy { - var: ty::BoundVar::from_usize(bound_vars.len() - 1), - kind, - }) + Ty::new_bound( + tcx, + ty::INNERMOST, + ty::BoundTy { var: ty::BoundVar::from_usize(bound_vars.len() - 1), kind }, + ) .into() } GenericParamDefKind::Lifetime => { let kind = ty::BoundRegionKind::Named(param.def_id, param.name); let bound_var = ty::BoundVariableKind::Region(kind); bound_vars.push(bound_var); - ty::Region::new_bound(tcx, ty::INNERMOST, ty::BoundRegion { - var: ty::BoundVar::from_usize(bound_vars.len() - 1), - kind, - }) + ty::Region::new_bound( + tcx, + ty::INNERMOST, + ty::BoundRegion { + var: ty::BoundVar::from_usize(bound_vars.len() - 1), + kind, + }, + ) .into() } GenericParamDefKind::Const { .. } => { diff --git a/compiler/rustc_hir_analysis/src/check/intrinsic.rs b/compiler/rustc_hir_analysis/src/check/intrinsic.rs index 40769ef7536d4..08e0e52a4925b 100644 --- a/compiler/rustc_hir_analysis/src/check/intrinsic.rs +++ b/compiler/rustc_hir_analysis/src/check/intrinsic.rs @@ -185,14 +185,19 @@ pub fn check_intrinsic_type( ]); let mk_va_list_ty = |mutbl| { tcx.lang_items().va_list().map(|did| { - let region = ty::Region::new_bound(tcx, ty::INNERMOST, ty::BoundRegion { - var: ty::BoundVar::ZERO, - kind: ty::BoundRegionKind::Anon, - }); - let env_region = ty::Region::new_bound(tcx, ty::INNERMOST, ty::BoundRegion { - var: ty::BoundVar::from_u32(2), - kind: ty::BoundRegionKind::ClosureEnv, - }); + let region = ty::Region::new_bound( + tcx, + ty::INNERMOST, + ty::BoundRegion { var: ty::BoundVar::ZERO, kind: ty::BoundRegionKind::Anon }, + ); + let env_region = ty::Region::new_bound( + tcx, + ty::INNERMOST, + ty::BoundRegion { + var: ty::BoundVar::from_u32(2), + kind: ty::BoundRegionKind::ClosureEnv, + }, + ); let va_list_ty = tcx.type_of(did).instantiate(tcx, &[region.into()]); (Ty::new_ref(tcx, env_region, va_list_ty, mutbl), va_list_ty) }) diff --git a/compiler/rustc_hir_analysis/src/check/wfcheck.rs b/compiler/rustc_hir_analysis/src/check/wfcheck.rs index 20eb96f3ab171..1689437ffb0ed 100644 --- a/compiler/rustc_hir_analysis/src/check/wfcheck.rs +++ b/compiler/rustc_hir_analysis/src/check/wfcheck.rs @@ -675,10 +675,10 @@ fn gather_gat_bounds<'tcx, T: TypeFoldable>>( // Same for the region. In our example, 'a corresponds // to the 'me parameter. let region_param = gat_generics.param_at(*region_a_idx, tcx); - let region_param = ty::Region::new_early_param(tcx, ty::EarlyParamRegion { - index: region_param.index, - name: region_param.name, - }); + let region_param = ty::Region::new_early_param( + tcx, + ty::EarlyParamRegion { index: region_param.index, name: region_param.name }, + ); // The predicate we expect to see. (In our example, // `Self: 'me`.) bounds.insert( @@ -704,16 +704,16 @@ fn gather_gat_bounds<'tcx, T: TypeFoldable>>( debug!("required clause: {region_a} must outlive {region_b}"); // Translate into the generic parameters of the GAT. let region_a_param = gat_generics.param_at(*region_a_idx, tcx); - let region_a_param = ty::Region::new_early_param(tcx, ty::EarlyParamRegion { - index: region_a_param.index, - name: region_a_param.name, - }); + let region_a_param = ty::Region::new_early_param( + tcx, + ty::EarlyParamRegion { index: region_a_param.index, name: region_a_param.name }, + ); // Same for the region. let region_b_param = gat_generics.param_at(*region_b_idx, tcx); - let region_b_param = ty::Region::new_early_param(tcx, ty::EarlyParamRegion { - index: region_b_param.index, - name: region_b_param.name, - }); + let region_b_param = ty::Region::new_early_param( + tcx, + ty::EarlyParamRegion { index: region_b_param.index, name: region_b_param.name }, + ); // The predicate we expect to see. bounds.insert( ty::ClauseKind::RegionOutlives(ty::OutlivesPredicate( @@ -1647,10 +1647,15 @@ fn check_fn_or_method<'tcx>( } // If the function has a body, additionally require that the return type is sized. - check_sized_if_body(wfcx, def_id, sig.output(), match hir_decl.output { - hir::FnRetTy::Return(ty) => Some(ty.span), - hir::FnRetTy::DefaultReturn(_) => None, - }); + check_sized_if_body( + wfcx, + def_id, + sig.output(), + match hir_decl.output { + hir::FnRetTy::Return(ty) => Some(ty.span), + hir::FnRetTy::DefaultReturn(_) => None, + }, + ); } fn check_sized_if_body<'tcx>( diff --git a/compiler/rustc_hir_analysis/src/coherence/builtin.rs b/compiler/rustc_hir_analysis/src/coherence/builtin.rs index 3511dbc625295..66082f4c282b3 100644 --- a/compiler/rustc_hir_analysis/src/coherence/builtin.rs +++ b/compiler/rustc_hir_analysis/src/coherence/builtin.rs @@ -333,10 +333,11 @@ fn visit_implementation_of_dispatch_from_dyn(checker: &Checker<'_>) -> Result<() tcx, cause.clone(), param_env, - ty::TraitRef::new(tcx, dispatch_from_dyn_trait, [ - field.ty(tcx, args_a), - field.ty(tcx, args_b), - ]), + ty::TraitRef::new( + tcx, + dispatch_from_dyn_trait, + [field.ty(tcx, args_a), field.ty(tcx, args_b)], + ), )); } let errors = ocx.select_all_or_error(); diff --git a/compiler/rustc_hir_analysis/src/coherence/inherent_impls_overlap.rs b/compiler/rustc_hir_analysis/src/coherence/inherent_impls_overlap.rs index 5127e73d9784d..c72f6201831ae 100644 --- a/compiler/rustc_hir_analysis/src/coherence/inherent_impls_overlap.rs +++ b/compiler/rustc_hir_analysis/src/coherence/inherent_impls_overlap.rs @@ -251,10 +251,13 @@ impl<'tcx> InherentOverlapChecker<'tcx> { for ident in &idents_to_add { connected_region_ids.insert(*ident, id_to_set); } - connected_regions.insert(id_to_set, ConnectedRegion { - idents: idents_to_add, - impl_blocks: std::iter::once(i).collect(), - }); + connected_regions.insert( + id_to_set, + ConnectedRegion { + idents: idents_to_add, + impl_blocks: std::iter::once(i).collect(), + }, + ); } // Take the only id inside the list &[id_to_set] => { diff --git a/compiler/rustc_hir_analysis/src/collect/item_bounds.rs b/compiler/rustc_hir_analysis/src/collect/item_bounds.rs index e37a11b684453..d2e2ab1da77a2 100644 --- a/compiler/rustc_hir_analysis/src/collect/item_bounds.rs +++ b/compiler/rustc_hir_analysis/src/collect/item_bounds.rs @@ -242,10 +242,11 @@ impl<'tcx> TypeFolder> for MapAndCompressBoundVars<'tcx> { // Allocate a new var idx, and insert a new bound ty. let var = ty::BoundVar::from_usize(self.still_bound_vars.len()); self.still_bound_vars.push(ty::BoundVariableKind::Ty(old_bound.kind)); - let mapped = Ty::new_bound(self.tcx, ty::INNERMOST, ty::BoundTy { - var, - kind: old_bound.kind, - }); + let mapped = Ty::new_bound( + self.tcx, + ty::INNERMOST, + ty::BoundTy { var, kind: old_bound.kind }, + ); self.mapping.insert(old_bound.var, mapped.into()); mapped }; @@ -265,10 +266,11 @@ impl<'tcx> TypeFolder> for MapAndCompressBoundVars<'tcx> { } else { let var = ty::BoundVar::from_usize(self.still_bound_vars.len()); self.still_bound_vars.push(ty::BoundVariableKind::Region(old_bound.kind)); - let mapped = ty::Region::new_bound(self.tcx, ty::INNERMOST, ty::BoundRegion { - var, - kind: old_bound.kind, - }); + let mapped = ty::Region::new_bound( + self.tcx, + ty::INNERMOST, + ty::BoundRegion { var, kind: old_bound.kind }, + ); self.mapping.insert(old_bound.var, mapped.into()); mapped }; diff --git a/compiler/rustc_hir_analysis/src/collect/predicates_of.rs b/compiler/rustc_hir_analysis/src/collect/predicates_of.rs index 8a975786a92f6..d94383d6f3d88 100644 --- a/compiler/rustc_hir_analysis/src/collect/predicates_of.rs +++ b/compiler/rustc_hir_analysis/src/collect/predicates_of.rs @@ -350,10 +350,10 @@ fn compute_bidirectional_outlives_predicates<'tcx>( for param in opaque_own_params { let orig_lifetime = tcx.map_opaque_lifetime_to_parent_lifetime(param.def_id.expect_local()); if let ty::ReEarlyParam(..) = *orig_lifetime { - let dup_lifetime = ty::Region::new_early_param(tcx, ty::EarlyParamRegion { - index: param.index, - name: param.name, - }); + let dup_lifetime = ty::Region::new_early_param( + tcx, + ty::EarlyParamRegion { index: param.index, name: param.name }, + ); let span = tcx.def_span(param.def_id); predicates.push(( ty::ClauseKind::RegionOutlives(ty::OutlivesPredicate(orig_lifetime, dup_lifetime)) diff --git a/compiler/rustc_hir_analysis/src/collect/resolve_bound_vars.rs b/compiler/rustc_hir_analysis/src/collect/resolve_bound_vars.rs index 76006354717e1..c03a1f6240fa3 100644 --- a/compiler/rustc_hir_analysis/src/collect/resolve_bound_vars.rs +++ b/compiler/rustc_hir_analysis/src/collect/resolve_bound_vars.rs @@ -1143,20 +1143,23 @@ impl<'a, 'tcx> BoundVarContext<'a, 'tcx> { .params .iter() .map(|param| { - (param.def_id, match param.kind { - GenericParamKind::Lifetime { .. } => { - if self.tcx.is_late_bound(param.hir_id) { - let late_bound_idx = named_late_bound_vars; - named_late_bound_vars += 1; - ResolvedArg::late(late_bound_idx, param) - } else { + ( + param.def_id, + match param.kind { + GenericParamKind::Lifetime { .. } => { + if self.tcx.is_late_bound(param.hir_id) { + let late_bound_idx = named_late_bound_vars; + named_late_bound_vars += 1; + ResolvedArg::late(late_bound_idx, param) + } else { + ResolvedArg::early(param) + } + } + GenericParamKind::Type { .. } | GenericParamKind::Const { .. } => { ResolvedArg::early(param) } - } - GenericParamKind::Type { .. } | GenericParamKind::Const { .. } => { - ResolvedArg::early(param) - } - }) + }, + ) }) .collect(); diff --git a/compiler/rustc_hir_analysis/src/delegation.rs b/compiler/rustc_hir_analysis/src/delegation.rs index ed45833b614fb..4dbdfa3d85a9b 100644 --- a/compiler/rustc_hir_analysis/src/delegation.rs +++ b/compiler/rustc_hir_analysis/src/delegation.rs @@ -41,10 +41,10 @@ impl<'tcx> TypeFolder> for ParamIndexRemapper<'tcx> { if let ty::ReEarlyParam(param) = r.kind() && let Some(index) = self.remap_table.get(¶m.index).copied() { - return ty::Region::new_early_param(self.tcx, ty::EarlyParamRegion { - index, - name: param.name, - }); + return ty::Region::new_early_param( + self.tcx, + ty::EarlyParamRegion { index, name: param.name }, + ); } r } diff --git a/compiler/rustc_hir_analysis/src/hir_ty_lowering/bounds.rs b/compiler/rustc_hir_analysis/src/hir_ty_lowering/bounds.rs index e949d4a11261e..2834d49769452 100644 --- a/compiler/rustc_hir_analysis/src/hir_ty_lowering/bounds.rs +++ b/compiler/rustc_hir_analysis/src/hir_ty_lowering/bounds.rs @@ -640,13 +640,15 @@ impl<'tcx> dyn HirTyLowerer<'tcx> + '_ { let mut num_bound_vars = candidate.bound_vars().len(); let args = candidate.skip_binder().args.extend_to(tcx, item_def_id, |param, _| { let arg = match param.kind { - ty::GenericParamDefKind::Lifetime => { - ty::Region::new_bound(tcx, ty::INNERMOST, ty::BoundRegion { + ty::GenericParamDefKind::Lifetime => ty::Region::new_bound( + tcx, + ty::INNERMOST, + ty::BoundRegion { var: ty::BoundVar::from_usize(num_bound_vars), kind: ty::BoundRegionKind::Named(param.def_id, param.name), - }) - .into() - } + }, + ) + .into(), ty::GenericParamDefKind::Type { .. } => { let guar = *emitted_bad_param_err.get_or_insert_with(|| { self.dcx().emit_err(crate::errors::ReturnTypeNotationIllegalParam::Type { diff --git a/compiler/rustc_hir_analysis/src/hir_ty_lowering/dyn_compatibility.rs b/compiler/rustc_hir_analysis/src/hir_ty_lowering/dyn_compatibility.rs index e59ff02642cf1..a8b37fa505420 100644 --- a/compiler/rustc_hir_analysis/src/hir_ty_lowering/dyn_compatibility.rs +++ b/compiler/rustc_hir_analysis/src/hir_ty_lowering/dyn_compatibility.rs @@ -107,12 +107,11 @@ impl<'tcx> dyn HirTyLowerer<'tcx> + '_ { let mut needed_associated_types = FxIndexSet::default(); if let Some((principal_trait, spans)) = &principal_trait { let pred: ty::Predicate<'tcx> = (*principal_trait).upcast(tcx); - for ClauseWithSupertraitSpan { pred, supertrait_span } in - traits::elaborate(tcx, [ClauseWithSupertraitSpan::new( - pred, - *spans.last().unwrap(), - )]) - .filter_only_self() + for ClauseWithSupertraitSpan { pred, supertrait_span } in traits::elaborate( + tcx, + [ClauseWithSupertraitSpan::new(pred, *spans.last().unwrap())], + ) + .filter_only_self() { debug!("observing object predicate `{pred:?}`"); diff --git a/compiler/rustc_hir_analysis/src/hir_ty_lowering/mod.rs b/compiler/rustc_hir_analysis/src/hir_ty_lowering/mod.rs index 079e892162792..ffddf6f73aaf0 100644 --- a/compiler/rustc_hir_analysis/src/hir_ty_lowering/mod.rs +++ b/compiler/rustc_hir_analysis/src/hir_ty_lowering/mod.rs @@ -2219,10 +2219,13 @@ impl<'tcx> dyn HirTyLowerer<'tcx> + '_ { match self.try_lower_anon_const_lit(ty, expr) { Some(v) => v, - None => ty::Const::new_unevaluated(tcx, ty::UnevaluatedConst { - def: anon.def_id.to_def_id(), - args: ty::GenericArgs::identity_for_item(tcx, anon.def_id.to_def_id()), - }), + None => ty::Const::new_unevaluated( + tcx, + ty::UnevaluatedConst { + def: anon.def_id.to_def_id(), + args: ty::GenericArgs::identity_for_item(tcx, anon.def_id.to_def_id()), + }, + ), } } diff --git a/compiler/rustc_hir_pretty/src/lib.rs b/compiler/rustc_hir_pretty/src/lib.rs index fb1df518a8814..57df3127a025a 100644 --- a/compiler/rustc_hir_pretty/src/lib.rs +++ b/compiler/rustc_hir_pretty/src/lib.rs @@ -2226,10 +2226,13 @@ impl<'a> State<'a> { let generic_params = generic_params .iter() .filter(|p| { - matches!(p, GenericParam { - kind: GenericParamKind::Lifetime { kind: LifetimeParamKind::Explicit }, - .. - }) + matches!( + p, + GenericParam { + kind: GenericParamKind::Lifetime { kind: LifetimeParamKind::Explicit }, + .. + } + ) }) .collect::>(); diff --git a/compiler/rustc_hir_typeck/src/callee.rs b/compiler/rustc_hir_typeck/src/callee.rs index edc3702d90b58..f2d0b9117314c 100644 --- a/compiler/rustc_hir_typeck/src/callee.rs +++ b/compiler/rustc_hir_typeck/src/callee.rs @@ -153,13 +153,16 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> { closure_sig, ); let adjustments = self.adjust_steps(autoderef); - self.record_deferred_call_resolution(def_id, DeferredCallResolution { - call_expr, - callee_expr, - closure_ty: adjusted_ty, - adjustments, - fn_sig: closure_sig, - }); + self.record_deferred_call_resolution( + def_id, + DeferredCallResolution { + call_expr, + callee_expr, + closure_ty: adjusted_ty, + adjustments, + fn_sig: closure_sig, + }, + ); return Some(CallStep::DeferredClosure(def_id, closure_sig)); } @@ -196,13 +199,16 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> { coroutine_closure_sig.abi, ); let adjustments = self.adjust_steps(autoderef); - self.record_deferred_call_resolution(def_id, DeferredCallResolution { - call_expr, - callee_expr, - closure_ty: adjusted_ty, - adjustments, - fn_sig: call_sig, - }); + self.record_deferred_call_resolution( + def_id, + DeferredCallResolution { + call_expr, + callee_expr, + closure_ty: adjusted_ty, + adjustments, + fn_sig: call_sig, + }, + ); return Some(CallStep::DeferredClosure(def_id, call_sig)); } diff --git a/compiler/rustc_hir_typeck/src/cast.rs b/compiler/rustc_hir_typeck/src/cast.rs index 65021a0cd1106..d8015bcc91424 100644 --- a/compiler/rustc_hir_typeck/src/cast.rs +++ b/compiler/rustc_hir_typeck/src/cast.rs @@ -666,11 +666,12 @@ impl<'a, 'tcx> CastCheck<'tcx> { }; let expr_ty = fcx.resolve_vars_if_possible(self.expr_ty); let cast_ty = fcx.resolve_vars_if_possible(self.cast_ty); - fcx.tcx.emit_node_span_lint(lint, self.expr.hir_id, self.span, errors::TrivialCast { - numeric, - expr_ty, - cast_ty, - }); + fcx.tcx.emit_node_span_lint( + lint, + self.expr.hir_id, + self.span, + errors::TrivialCast { numeric, expr_ty, cast_ty }, + ); } #[instrument(skip(fcx), level = "debug")] diff --git a/compiler/rustc_hir_typeck/src/check.rs b/compiler/rustc_hir_typeck/src/check.rs index 9fdc5a0ae4e15..6fb5f6af0913a 100644 --- a/compiler/rustc_hir_typeck/src/check.rs +++ b/compiler/rustc_hir_typeck/src/check.rs @@ -186,18 +186,21 @@ fn check_panic_info_fn(tcx: TyCtxt<'_>, fn_id: LocalDefId, fn_sig: ty::FnSig<'_> let panic_info_did = tcx.require_lang_item(hir::LangItem::PanicInfo, Some(span)); // build type `for<'a, 'b> fn(&'a PanicInfo<'b>) -> !` - let panic_info_ty = tcx.type_of(panic_info_did).instantiate(tcx, &[ty::GenericArg::from( - ty::Region::new_bound(tcx, ty::INNERMOST, ty::BoundRegion { - var: ty::BoundVar::from_u32(1), - kind: ty::BoundRegionKind::Anon, - }), - )]); + let panic_info_ty = tcx.type_of(panic_info_did).instantiate( + tcx, + &[ty::GenericArg::from(ty::Region::new_bound( + tcx, + ty::INNERMOST, + ty::BoundRegion { var: ty::BoundVar::from_u32(1), kind: ty::BoundRegionKind::Anon }, + ))], + ); let panic_info_ref_ty = Ty::new_imm_ref( tcx, - ty::Region::new_bound(tcx, ty::INNERMOST, ty::BoundRegion { - var: ty::BoundVar::ZERO, - kind: ty::BoundRegionKind::Anon, - }), + ty::Region::new_bound( + tcx, + ty::INNERMOST, + ty::BoundRegion { var: ty::BoundVar::ZERO, kind: ty::BoundRegionKind::Anon }, + ), panic_info_ty, ); diff --git a/compiler/rustc_hir_typeck/src/closure.rs b/compiler/rustc_hir_typeck/src/closure.rs index 62dfffb560bac..43124f44ca600 100644 --- a/compiler/rustc_hir_typeck/src/closure.rs +++ b/compiler/rustc_hir_typeck/src/closure.rs @@ -103,12 +103,15 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> { None => self.next_ty_var(expr_span), }; - let closure_args = ty::ClosureArgs::new(tcx, ty::ClosureArgsParts { - parent_args, - closure_kind_ty, - closure_sig_as_fn_ptr_ty: Ty::new_fn_ptr(tcx, sig), - tupled_upvars_ty, - }); + let closure_args = ty::ClosureArgs::new( + tcx, + ty::ClosureArgsParts { + parent_args, + closure_kind_ty, + closure_sig_as_fn_ptr_ty: Ty::new_fn_ptr(tcx, sig), + tupled_upvars_ty, + }, + ); (Ty::new_closure(tcx, expr_def_id.to_def_id(), closure_args.args), None) } @@ -177,15 +180,18 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> { _ => tcx.types.unit, }; - let coroutine_args = ty::CoroutineArgs::new(tcx, ty::CoroutineArgsParts { - parent_args, - kind_ty, - resume_ty, - yield_ty, - return_ty: liberated_sig.output(), - witness: interior, - tupled_upvars_ty, - }); + let coroutine_args = ty::CoroutineArgs::new( + tcx, + ty::CoroutineArgsParts { + parent_args, + kind_ty, + resume_ty, + yield_ty, + return_ty: liberated_sig.output(), + witness: interior, + tupled_upvars_ty, + }, + ); ( Ty::new_coroutine(tcx, expr_def_id.to_def_id(), coroutine_args.args), @@ -216,8 +222,9 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> { }; let coroutine_captures_by_ref_ty = self.next_ty_var(expr_span); - let closure_args = - ty::CoroutineClosureArgs::new(tcx, ty::CoroutineClosureArgsParts { + let closure_args = ty::CoroutineClosureArgs::new( + tcx, + ty::CoroutineClosureArgsParts { parent_args, closure_kind_ty, signature_parts_ty: Ty::new_fn_ptr( @@ -238,7 +245,8 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> { tupled_upvars_ty, coroutine_captures_by_ref_ty, coroutine_witness_ty: interior, - }); + }, + ); let coroutine_kind_ty = match expected_kind { Some(kind) => Ty::from_coroutine_closure_kind(tcx, kind), diff --git a/compiler/rustc_hir_typeck/src/coercion.rs b/compiler/rustc_hir_typeck/src/coercion.rs index 56cc9b6d5514b..14dd0f32d8206 100644 --- a/compiler/rustc_hir_typeck/src/coercion.rs +++ b/compiler/rustc_hir_typeck/src/coercion.rs @@ -555,18 +555,24 @@ impl<'f, 'tcx> Coerce<'f, 'tcx> { // the reborrow in coerce_borrowed_ptr will pick it up. let mutbl = AutoBorrowMutability::new(mutbl_b, AllowTwoPhase::No); - Some((Adjustment { kind: Adjust::Deref(None), target: ty_a }, Adjustment { - kind: Adjust::Borrow(AutoBorrow::Ref(mutbl)), - target: Ty::new_ref(self.tcx, r_borrow, ty_a, mutbl_b), - })) + Some(( + Adjustment { kind: Adjust::Deref(None), target: ty_a }, + Adjustment { + kind: Adjust::Borrow(AutoBorrow::Ref(mutbl)), + target: Ty::new_ref(self.tcx, r_borrow, ty_a, mutbl_b), + }, + )) } (&ty::Ref(_, ty_a, mt_a), &ty::RawPtr(_, mt_b)) => { coerce_mutbls(mt_a, mt_b)?; - Some((Adjustment { kind: Adjust::Deref(None), target: ty_a }, Adjustment { - kind: Adjust::Borrow(AutoBorrow::RawPtr(mt_b)), - target: Ty::new_ptr(self.tcx, ty_a, mt_b), - })) + Some(( + Adjustment { kind: Adjust::Deref(None), target: ty_a }, + Adjustment { + kind: Adjust::Borrow(AutoBorrow::RawPtr(mt_b)), + target: Ty::new_ptr(self.tcx, ty_a, mt_b), + }, + )) } _ => None, }; @@ -1033,10 +1039,10 @@ impl<'f, 'tcx> Coerce<'f, 'tcx> { // regionck knows that the region for `a` must be valid here. if is_ref { self.unify_and(a_unsafe, b, |target| { - vec![Adjustment { kind: Adjust::Deref(None), target: mt_a.ty }, Adjustment { - kind: Adjust::Borrow(AutoBorrow::RawPtr(mutbl_b)), - target, - }] + vec![ + Adjustment { kind: Adjust::Deref(None), target: mt_a.ty }, + Adjustment { kind: Adjust::Borrow(AutoBorrow::RawPtr(mutbl_b)), target }, + ] }) } else if mt_a.mutbl != mutbl_b { self.unify_and(a_unsafe, b, simple(Adjust::Pointer(PointerCoercion::MutToConstPointer))) @@ -1288,10 +1294,10 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> { _ => span_bug!(new.span, "should not try to coerce a {new_ty} to a fn pointer"), }; for expr in exprs.iter().map(|e| e.as_coercion_site()) { - self.apply_adjustments(expr, vec![Adjustment { - kind: prev_adjustment.clone(), - target: fn_ptr, - }]); + self.apply_adjustments( + expr, + vec![Adjustment { kind: prev_adjustment.clone(), target: fn_ptr }], + ); } self.apply_adjustments(new, vec![Adjustment { kind: next_adjustment, target: fn_ptr }]); return Ok(fn_ptr); diff --git a/compiler/rustc_hir_typeck/src/expr.rs b/compiler/rustc_hir_typeck/src/expr.rs index 49f712090f03c..9dd965a4dcbbb 100644 --- a/compiler/rustc_hir_typeck/src/expr.rs +++ b/compiler/rustc_hir_typeck/src/expr.rs @@ -84,10 +84,10 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> { } let adj_ty = self.next_ty_var(expr.span); - self.apply_adjustments(expr, vec![Adjustment { - kind: Adjust::NeverToAny, - target: adj_ty, - }]); + self.apply_adjustments( + expr, + vec![Adjustment { kind: Adjust::NeverToAny, target: adj_ty }], + ); ty = adj_ty; } diff --git a/compiler/rustc_hir_typeck/src/fn_ctxt/_impl.rs b/compiler/rustc_hir_typeck/src/fn_ctxt/_impl.rs index 9277d71234f42..6bb8cf5f33159 100644 --- a/compiler/rustc_hir_typeck/src/fn_ctxt/_impl.rs +++ b/compiler/rustc_hir_typeck/src/fn_ctxt/_impl.rs @@ -290,10 +290,13 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> { } let autoborrow_mut = adj.iter().any(|adj| { - matches!(adj, &Adjustment { - kind: Adjust::Borrow(AutoBorrow::Ref(AutoBorrowMutability::Mut { .. })), - .. - }) + matches!( + adj, + &Adjustment { + kind: Adjust::Borrow(AutoBorrow::Ref(AutoBorrowMutability::Mut { .. })), + .. + } + ) }); match self.typeck_results.borrow_mut().adjustments_mut().entry(expr.hir_id) { @@ -972,11 +975,16 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> { let mut sp = MultiSpan::from_span(path_segment.ident.span); sp.push_span_label( path_segment.ident.span, - format!("this call modifies {} in-place", match rcvr.kind { - ExprKind::Path(QPath::Resolved(None, hir::Path { segments: [segment], .. })) => - format!("`{}`", segment.ident), - _ => "its receiver".to_string(), - }), + format!( + "this call modifies {} in-place", + match rcvr.kind { + ExprKind::Path(QPath::Resolved( + None, + hir::Path { segments: [segment], .. }, + )) => format!("`{}`", segment.ident), + _ => "its receiver".to_string(), + } + ), ); let modifies_rcvr_note = diff --git a/compiler/rustc_hir_typeck/src/fn_ctxt/suggestions.rs b/compiler/rustc_hir_typeck/src/fn_ctxt/suggestions.rs index 217ebd9cd2bf4..4ec8d0b1f60a2 100644 --- a/compiler/rustc_hir_typeck/src/fn_ctxt/suggestions.rs +++ b/compiler/rustc_hir_typeck/src/fn_ctxt/suggestions.rs @@ -1988,17 +1988,17 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> { expr.kind, hir::ExprKind::Call( hir::Expr { - kind: hir::ExprKind::Path(hir::QPath::Resolved(None, hir::Path { - res: Res::Def(hir::def::DefKind::Ctor(_, _), _), - .. - },)), + kind: hir::ExprKind::Path(hir::QPath::Resolved( + None, + hir::Path { res: Res::Def(hir::def::DefKind::Ctor(_, _), _), .. }, + )), .. }, .., - ) | hir::ExprKind::Path(hir::QPath::Resolved(None, hir::Path { - res: Res::Def(hir::def::DefKind::Ctor(_, _), _), - .. - },)), + ) | hir::ExprKind::Path(hir::QPath::Resolved( + None, + hir::Path { res: Res::Def(hir::def::DefKind::Ctor(_, _), _), .. }, + )), ); let (article, kind, variant, sugg_operator) = diff --git a/compiler/rustc_hir_typeck/src/method/suggest.rs b/compiler/rustc_hir_typeck/src/method/suggest.rs index cbbda0b6cbcdf..6c4ad65be6a63 100644 --- a/compiler/rustc_hir_typeck/src/method/suggest.rs +++ b/compiler/rustc_hir_typeck/src/method/suggest.rs @@ -3922,11 +3922,14 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> { }; let all_suggs = candidate_strs.iter().map(|cand| { - let suggestion = format!("{} {cand}", match introducer { - Introducer::Plus => " +", - Introducer::Colon => ":", - Introducer::Nothing => "", - },); + let suggestion = format!( + "{} {cand}", + match introducer { + Introducer::Plus => " +", + Introducer::Colon => ":", + Introducer::Nothing => "", + }, + ); let mut suggs = vec![]; diff --git a/compiler/rustc_hir_typeck/src/op.rs b/compiler/rustc_hir_typeck/src/op.rs index 47c1f7844484a..fc07c9858494f 100644 --- a/compiler/rustc_hir_typeck/src/op.rs +++ b/compiler/rustc_hir_typeck/src/op.rs @@ -918,13 +918,17 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> { let opname = Ident::with_dummy_span(opname); let (opt_rhs_expr, opt_rhs_ty) = opt_rhs.unzip(); - let cause = self.cause(span, ObligationCauseCode::BinOp { - lhs_hir_id: lhs_expr.hir_id, - rhs_hir_id: opt_rhs_expr.map(|expr| expr.hir_id), - rhs_span: opt_rhs_expr.map(|expr| expr.span), - rhs_is_lit: opt_rhs_expr.is_some_and(|expr| matches!(expr.kind, hir::ExprKind::Lit(_))), - output_ty: expected.only_has_type(self), - }); + let cause = self.cause( + span, + ObligationCauseCode::BinOp { + lhs_hir_id: lhs_expr.hir_id, + rhs_hir_id: opt_rhs_expr.map(|expr| expr.hir_id), + rhs_span: opt_rhs_expr.map(|expr| expr.span), + rhs_is_lit: opt_rhs_expr + .is_some_and(|expr| matches!(expr.kind, hir::ExprKind::Lit(_))), + output_ty: expected.only_has_type(self), + }, + ); let method = self.lookup_method_in_trait(cause.clone(), opname, trait_did, lhs_ty, opt_rhs_ty); diff --git a/compiler/rustc_hir_typeck/src/place_op.rs b/compiler/rustc_hir_typeck/src/place_op.rs index e1bd9ae2e6727..4fc903cf68b88 100644 --- a/compiler/rustc_hir_typeck/src/place_op.rs +++ b/compiler/rustc_hir_typeck/src/place_op.rs @@ -30,10 +30,13 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> { let ok = self.try_overloaded_deref(expr.span, oprnd_ty)?; let method = self.register_infer_ok_obligations(ok); if let ty::Ref(_, _, hir::Mutability::Not) = method.sig.inputs()[0].kind() { - self.apply_adjustments(oprnd_expr, vec![Adjustment { - kind: Adjust::Borrow(AutoBorrow::Ref(AutoBorrowMutability::Not)), - target: method.sig.inputs()[0], - }]); + self.apply_adjustments( + oprnd_expr, + vec![Adjustment { + kind: Adjust::Borrow(AutoBorrow::Ref(AutoBorrowMutability::Not)), + target: method.sig.inputs()[0], + }], + ); } else { span_bug!(expr.span, "input to deref is not a ref?"); } diff --git a/compiler/rustc_hir_typeck/src/upvar.rs b/compiler/rustc_hir_typeck/src/upvar.rs index cac891c4e4c4f..c986429c1b24b 100644 --- a/compiler/rustc_hir_typeck/src/upvar.rs +++ b/compiler/rustc_hir_typeck/src/upvar.rs @@ -288,11 +288,14 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> { bug!(); }; let place = self.place_for_root_variable(closure_def_id, local_id); - delegate.capture_information.push((place, ty::CaptureInfo { - capture_kind_expr_id: Some(init.hir_id), - path_expr_id: Some(init.hir_id), - capture_kind: UpvarCapture::ByValue, - })); + delegate.capture_information.push(( + place, + ty::CaptureInfo { + capture_kind_expr_id: Some(init.hir_id), + path_expr_id: Some(init.hir_id), + capture_kind: UpvarCapture::ByValue, + }, + )); } } @@ -379,11 +382,11 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> { if let UpvarArgs::CoroutineClosure(args) = args && !args.references_error() { - let closure_env_region: ty::Region<'_> = - ty::Region::new_bound(self.tcx, ty::INNERMOST, ty::BoundRegion { - var: ty::BoundVar::ZERO, - kind: ty::BoundRegionKind::ClosureEnv, - }); + let closure_env_region: ty::Region<'_> = ty::Region::new_bound( + self.tcx, + ty::INNERMOST, + ty::BoundRegion { var: ty::BoundVar::ZERO, kind: ty::BoundRegionKind::ClosureEnv }, + ); let num_args = args .as_coroutine_closure() @@ -2009,11 +2012,14 @@ impl<'tcx> euv::Delegate<'tcx> for InferBorrowKind<'tcx> { let PlaceBase::Upvar(upvar_id) = place_with_id.place.base else { return }; assert_eq!(self.closure_def_id, upvar_id.closure_expr_id); - self.capture_information.push((place_with_id.place.clone(), ty::CaptureInfo { - capture_kind_expr_id: Some(diag_expr_id), - path_expr_id: Some(diag_expr_id), - capture_kind: ty::UpvarCapture::ByValue, - })); + self.capture_information.push(( + place_with_id.place.clone(), + ty::CaptureInfo { + capture_kind_expr_id: Some(diag_expr_id), + path_expr_id: Some(diag_expr_id), + capture_kind: ty::UpvarCapture::ByValue, + }, + )); } #[instrument(skip(self), level = "debug")] @@ -2040,11 +2046,14 @@ impl<'tcx> euv::Delegate<'tcx> for InferBorrowKind<'tcx> { capture_kind = ty::UpvarCapture::ByRef(ty::BorrowKind::Immutable); } - self.capture_information.push((place, ty::CaptureInfo { - capture_kind_expr_id: Some(diag_expr_id), - path_expr_id: Some(diag_expr_id), - capture_kind, - })); + self.capture_information.push(( + place, + ty::CaptureInfo { + capture_kind_expr_id: Some(diag_expr_id), + path_expr_id: Some(diag_expr_id), + capture_kind, + }, + )); } #[instrument(skip(self), level = "debug")] diff --git a/compiler/rustc_incremental/src/persist/dirty_clean.rs b/compiler/rustc_incremental/src/persist/dirty_clean.rs index 35e5c250f788f..30590bf5d3cb1 100644 --- a/compiler/rustc_incremental/src/persist/dirty_clean.rs +++ b/compiler/rustc_incremental/src/persist/dirty_clean.rs @@ -107,11 +107,10 @@ const LABELS_FN_IN_TRAIT: &[&[&str]] = const LABELS_HIR_ONLY: &[&[&str]] = &[BASE_HIR]; /// Impl `DepNode`s. -const LABELS_TRAIT: &[&[&str]] = &[BASE_HIR, &[ - label_strs::associated_item_def_ids, - label_strs::predicates_of, - label_strs::generics_of, -]]; +const LABELS_TRAIT: &[&[&str]] = &[ + BASE_HIR, + &[label_strs::associated_item_def_ids, label_strs::predicates_of, label_strs::generics_of], +]; /// Impl `DepNode`s. const LABELS_IMPL: &[&[&str]] = &[BASE_HIR, BASE_IMPL]; diff --git a/compiler/rustc_index/src/bit_set/tests.rs b/compiler/rustc_index/src/bit_set/tests.rs index eaa4aafe72134..323a66ddc6f20 100644 --- a/compiler/rustc_index/src/bit_set/tests.rs +++ b/compiler/rustc_index/src/bit_set/tests.rs @@ -118,11 +118,10 @@ fn chunked_bitset() { //----------------------------------------------------------------------- let mut b1 = ChunkedBitSet::::new_empty(1); - assert_eq!(b1, ChunkedBitSet { - domain_size: 1, - chunks: Box::new([Zeros(1)]), - marker: PhantomData - }); + assert_eq!( + b1, + ChunkedBitSet { domain_size: 1, chunks: Box::new([Zeros(1)]), marker: PhantomData } + ); b1.assert_valid(); assert!(!b1.contains(0)); @@ -141,11 +140,10 @@ fn chunked_bitset() { //----------------------------------------------------------------------- let mut b100 = ChunkedBitSet::::new_filled(100); - assert_eq!(b100, ChunkedBitSet { - domain_size: 100, - chunks: Box::new([Ones(100)]), - marker: PhantomData - }); + assert_eq!( + b100, + ChunkedBitSet { domain_size: 100, chunks: Box::new([Ones(100)]), marker: PhantomData } + ); b100.assert_valid(); for i in 0..100 { @@ -160,17 +158,20 @@ fn chunked_bitset() { ); assert_eq!(b100.count(), 97); assert!(!b100.contains(20) && b100.contains(30) && !b100.contains(99) && b100.contains(50)); - assert_eq!(b100.chunks(), vec![Mixed( - 100, - 97, - #[rustfmt::skip] + assert_eq!( + b100.chunks(), + vec![Mixed( + 100, + 97, + #[rustfmt::skip] Rc::new([ 0b11111111_11111111_11111110_11111111_11111111_11101111_11111111_11111111, 0b00000000_00000000_00000000_00000111_11111111_11111111_11111111_11111111, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, ]) - )],); + )], + ); b100.assert_valid(); let mut num_removed = 0; for i in 0..100 { @@ -185,11 +186,14 @@ fn chunked_bitset() { //----------------------------------------------------------------------- let mut b2548 = ChunkedBitSet::::new_empty(2548); - assert_eq!(b2548, ChunkedBitSet { - domain_size: 2548, - chunks: Box::new([Zeros(2048), Zeros(500)]), - marker: PhantomData, - }); + assert_eq!( + b2548, + ChunkedBitSet { + domain_size: 2548, + chunks: Box::new([Zeros(2048), Zeros(500)]), + marker: PhantomData, + } + ); b2548.assert_valid(); b2548.insert(14); @@ -206,11 +210,14 @@ fn chunked_bitset() { //----------------------------------------------------------------------- let mut b4096 = ChunkedBitSet::::new_empty(4096); - assert_eq!(b4096, ChunkedBitSet { - domain_size: 4096, - chunks: Box::new([Zeros(2048), Zeros(2048)]), - marker: PhantomData, - }); + assert_eq!( + b4096, + ChunkedBitSet { + domain_size: 4096, + chunks: Box::new([Zeros(2048), Zeros(2048)]), + marker: PhantomData, + } + ); b4096.assert_valid(); for i in 0..4096 { @@ -240,11 +247,14 @@ fn chunked_bitset() { //----------------------------------------------------------------------- let mut b10000 = ChunkedBitSet::::new_empty(10000); - assert_eq!(b10000, ChunkedBitSet { - domain_size: 10000, - chunks: Box::new([Zeros(2048), Zeros(2048), Zeros(2048), Zeros(2048), Zeros(1808),]), - marker: PhantomData, - }); + assert_eq!( + b10000, + ChunkedBitSet { + domain_size: 10000, + chunks: Box::new([Zeros(2048), Zeros(2048), Zeros(2048), Zeros(2048), Zeros(1808),]), + marker: PhantomData, + } + ); b10000.assert_valid(); assert!(b10000.insert(3000) && b10000.insert(5000)); diff --git a/compiler/rustc_index/src/vec/tests.rs b/compiler/rustc_index/src/vec/tests.rs index 9cee2f2f5b23b..381d79c24fcba 100644 --- a/compiler/rustc_index/src/vec/tests.rs +++ b/compiler/rustc_index/src/vec/tests.rs @@ -29,21 +29,19 @@ fn index_size_is_optimized() { #[test] fn range_iterator_iterates_forwards() { let range = MyIdx::from_u32(1)..MyIdx::from_u32(4); - assert_eq!(range.collect::>(), [ - MyIdx::from_u32(1), - MyIdx::from_u32(2), - MyIdx::from_u32(3) - ]); + assert_eq!( + range.collect::>(), + [MyIdx::from_u32(1), MyIdx::from_u32(2), MyIdx::from_u32(3)] + ); } #[test] fn range_iterator_iterates_backwards() { let range = MyIdx::from_u32(1)..MyIdx::from_u32(4); - assert_eq!(range.rev().collect::>(), [ - MyIdx::from_u32(3), - MyIdx::from_u32(2), - MyIdx::from_u32(1) - ]); + assert_eq!( + range.rev().collect::>(), + [MyIdx::from_u32(3), MyIdx::from_u32(2), MyIdx::from_u32(1)] + ); } #[test] diff --git a/compiler/rustc_infer/src/infer/outlives/obligations.rs b/compiler/rustc_infer/src/infer/outlives/obligations.rs index 86a47426049a6..a89cef50c9b40 100644 --- a/compiler/rustc_infer/src/infer/outlives/obligations.rs +++ b/compiler/rustc_infer/src/infer/outlives/obligations.rs @@ -100,16 +100,20 @@ impl<'tcx> InferCtxt<'tcx> { ) { debug!(?sup_type, ?sub_region, ?cause); let origin = SubregionOrigin::from_obligation_cause(cause, || { - infer::RelateParamBound(cause.span, sup_type, match cause.code().peel_derives() { - ObligationCauseCode::WhereClause(_, span) - | ObligationCauseCode::WhereClauseInExpr(_, span, ..) - | ObligationCauseCode::OpaqueTypeBound(span, _) - if !span.is_dummy() => - { - Some(*span) - } - _ => None, - }) + infer::RelateParamBound( + cause.span, + sup_type, + match cause.code().peel_derives() { + ObligationCauseCode::WhereClause(_, span) + | ObligationCauseCode::WhereClauseInExpr(_, span, ..) + | ObligationCauseCode::OpaqueTypeBound(span, _) + if !span.is_dummy() => + { + Some(*span) + } + _ => None, + }, + ) }); self.register_region_obligation(RegionObligation { sup_type, sub_region, origin }); diff --git a/compiler/rustc_infer/src/infer/relate/higher_ranked.rs b/compiler/rustc_infer/src/infer/relate/higher_ranked.rs index 061f7e6c22a43..0998f3c479024 100644 --- a/compiler/rustc_infer/src/infer/relate/higher_ranked.rs +++ b/compiler/rustc_infer/src/infer/relate/higher_ranked.rs @@ -34,22 +34,22 @@ impl<'tcx> InferCtxt<'tcx> { let delegate = FnMutDelegate { regions: &mut |br: ty::BoundRegion| { - ty::Region::new_placeholder(self.tcx, ty::PlaceholderRegion { - universe: next_universe, - bound: br, - }) + ty::Region::new_placeholder( + self.tcx, + ty::PlaceholderRegion { universe: next_universe, bound: br }, + ) }, types: &mut |bound_ty: ty::BoundTy| { - Ty::new_placeholder(self.tcx, ty::PlaceholderType { - universe: next_universe, - bound: bound_ty, - }) + Ty::new_placeholder( + self.tcx, + ty::PlaceholderType { universe: next_universe, bound: bound_ty }, + ) }, consts: &mut |bound_var: ty::BoundVar| { - ty::Const::new_placeholder(self.tcx, ty::PlaceholderConst { - universe: next_universe, - bound: bound_var, - }) + ty::Const::new_placeholder( + self.tcx, + ty::PlaceholderConst { universe: next_universe, bound: bound_var }, + ) }, }; diff --git a/compiler/rustc_infer/src/traits/engine.rs b/compiler/rustc_infer/src/traits/engine.rs index 51282b900ed14..1eae10673b62b 100644 --- a/compiler/rustc_infer/src/traits/engine.rs +++ b/compiler/rustc_infer/src/traits/engine.rs @@ -45,12 +45,15 @@ pub trait TraitEngine<'tcx, E: 'tcx>: 'tcx { cause: ObligationCause<'tcx>, ) { let trait_ref = ty::TraitRef::new(infcx.tcx, def_id, [ty]); - self.register_predicate_obligation(infcx, Obligation { - cause, - recursion_depth: 0, - param_env, - predicate: trait_ref.upcast(infcx.tcx), - }); + self.register_predicate_obligation( + infcx, + Obligation { + cause, + recursion_depth: 0, + param_env, + predicate: trait_ref.upcast(infcx.tcx), + }, + ); } fn register_predicate_obligation( diff --git a/compiler/rustc_infer/src/traits/project.rs b/compiler/rustc_infer/src/traits/project.rs index cab2ce9f5a0fc..9082db4f4488c 100644 --- a/compiler/rustc_infer/src/traits/project.rs +++ b/compiler/rustc_infer/src/traits/project.rs @@ -193,10 +193,10 @@ impl<'tcx> ProjectionCache<'_, 'tcx> { if result.must_apply_considering_regions() { ty.obligations = PredicateObligations::new(); } - map.insert(key, ProjectionCacheEntry::NormalizedTerm { - ty, - complete: Some(result), - }); + map.insert( + key, + ProjectionCacheEntry::NormalizedTerm { ty, complete: Some(result) }, + ); } ref value => { // Type inference could "strand behind" old cache entries. Leave diff --git a/compiler/rustc_interface/src/tests.rs b/compiler/rustc_interface/src/tests.rs index 46d6f37a91cb5..bb55756d80ed6 100644 --- a/compiler/rustc_interface/src/tests.rs +++ b/compiler/rustc_interface/src/tests.rs @@ -770,11 +770,14 @@ fn test_unstable_options_tracking_hash() { }) ); tracked!(codegen_backend, Some("abc".to_string())); - tracked!(coverage_options, CoverageOptions { - level: CoverageLevel::Mcdc, - no_mir_spans: true, - discard_all_spans_in_codegen: true - }); + tracked!( + coverage_options, + CoverageOptions { + level: CoverageLevel::Mcdc, + no_mir_spans: true, + discard_all_spans_in_codegen: true + } + ); tracked!(crate_attr, vec!["abc".to_string()]); tracked!(cross_crate_inline_threshold, InliningThreshold::Always); tracked!(debug_info_for_profiling, true); diff --git a/compiler/rustc_lexer/src/tests.rs b/compiler/rustc_lexer/src/tests.rs index db7225fc2a810..8203ae70b0700 100644 --- a/compiler/rustc_lexer/src/tests.rs +++ b/compiler/rustc_lexer/src/tests.rs @@ -131,7 +131,9 @@ fn check_lexing(src: &str, expect: Expect) { #[test] fn smoke_test() { - check_lexing("/* my source file */ fn main() { println!(\"zebra\"); }\n", expect![[r#" + check_lexing( + "/* my source file */ fn main() { println!(\"zebra\"); }\n", + expect![[r#" Token { kind: BlockComment { doc_style: None, terminated: true }, len: 20 } Token { kind: Whitespace, len: 1 } Token { kind: Ident, len: 2 } @@ -151,7 +153,8 @@ fn smoke_test() { Token { kind: Whitespace, len: 1 } Token { kind: CloseBrace, len: 1 } Token { kind: Whitespace, len: 1 } - "#]]) + "#]], + ) } #[test] @@ -194,35 +197,47 @@ fn comment_flavors() { #[test] fn nested_block_comments() { - check_lexing("/* /* */ */'a'", expect![[r#" + check_lexing( + "/* /* */ */'a'", + expect![[r#" Token { kind: BlockComment { doc_style: None, terminated: true }, len: 11 } Token { kind: Literal { kind: Char { terminated: true }, suffix_start: 3 }, len: 3 } - "#]]) + "#]], + ) } #[test] fn characters() { - check_lexing("'a' ' ' '\\n'", expect![[r#" + check_lexing( + "'a' ' ' '\\n'", + expect![[r#" Token { kind: Literal { kind: Char { terminated: true }, suffix_start: 3 }, len: 3 } Token { kind: Whitespace, len: 1 } Token { kind: Literal { kind: Char { terminated: true }, suffix_start: 3 }, len: 3 } Token { kind: Whitespace, len: 1 } Token { kind: Literal { kind: Char { terminated: true }, suffix_start: 4 }, len: 4 } - "#]]); + "#]], + ); } #[test] fn lifetime() { - check_lexing("'abc", expect![[r#" + check_lexing( + "'abc", + expect![[r#" Token { kind: Lifetime { starts_with_number: false }, len: 4 } - "#]]); + "#]], + ); } #[test] fn raw_string() { - check_lexing("r###\"\"#a\\b\x00c\"\"###", expect![[r#" + check_lexing( + "r###\"\"#a\\b\x00c\"\"###", + expect![[r#" Token { kind: Literal { kind: RawStr { n_hashes: Some(3) }, suffix_start: 17 }, len: 17 } - "#]]) + "#]], + ) } #[test] diff --git a/compiler/rustc_lexer/src/unescape/tests.rs b/compiler/rustc_lexer/src/unescape/tests.rs index 6fa7a150516b8..5b99495f47581 100644 --- a/compiler/rustc_lexer/src/unescape/tests.rs +++ b/compiler/rustc_lexer/src/unescape/tests.rs @@ -108,12 +108,15 @@ fn test_unescape_str_warn() { check("\\\n", &[]); check("\\\n ", &[]); - check("\\\n \u{a0} x", &[ - (0..5, Err(EscapeError::UnskippedWhitespaceWarning)), - (3..5, Ok('\u{a0}')), - (5..6, Ok(' ')), - (6..7, Ok('x')), - ]); + check( + "\\\n \u{a0} x", + &[ + (0..5, Err(EscapeError::UnskippedWhitespaceWarning)), + (3..5, Ok('\u{a0}')), + (5..6, Ok(' ')), + (6..7, Ok('x')), + ], + ); check("\\\n \n x", &[(0..7, Err(EscapeError::MultipleSkippedLinesWarning)), (7..8, Ok('x'))]); } diff --git a/compiler/rustc_lint/src/builtin.rs b/compiler/rustc_lint/src/builtin.rs index e2bafbed6e123..5e6b854ff52e4 100644 --- a/compiler/rustc_lint/src/builtin.rs +++ b/compiler/rustc_lint/src/builtin.rs @@ -102,10 +102,11 @@ impl EarlyLintPass for WhileTrue { "{}loop", label.map_or_else(String::new, |label| format!("{}: ", label.ident,)) ); - cx.emit_span_lint(WHILE_TRUE, condition_span, BuiltinWhileTrue { - suggestion: condition_span, - replace, - }); + cx.emit_span_lint( + WHILE_TRUE, + condition_span, + BuiltinWhileTrue { suggestion: condition_span, replace }, + ); } } } @@ -421,10 +422,11 @@ impl MissingDoc { let attrs = cx.tcx.hir().attrs(cx.tcx.local_def_id_to_hir_id(def_id)); let has_doc = attrs.iter().any(has_doc); if !has_doc { - cx.emit_span_lint(MISSING_DOCS, cx.tcx.def_span(def_id), BuiltinMissingDoc { - article, - desc, - }); + cx.emit_span_lint( + MISSING_DOCS, + cx.tcx.def_span(def_id), + BuiltinMissingDoc { article, desc }, + ); } } } @@ -706,10 +708,11 @@ impl<'tcx> LateLintPass<'tcx> for MissingDebugImplementations { .next() .is_some(); if !has_impl { - cx.emit_span_lint(MISSING_DEBUG_IMPLEMENTATIONS, item.span, BuiltinMissingDebugImpl { - tcx: cx.tcx, - def_id: debug, - }); + cx.emit_span_lint( + MISSING_DEBUG_IMPLEMENTATIONS, + item.span, + BuiltinMissingDebugImpl { tcx: cx.tcx, def_id: debug }, + ); } } } @@ -831,12 +834,11 @@ impl EarlyLintPass for DeprecatedAttr { BuiltinDeprecatedAttrLinkSuggestion::Default { suggestion: attr.span } } }; - cx.emit_span_lint(DEPRECATED, attr.span, BuiltinDeprecatedAttrLink { - name, - reason, - link, - suggestion, - }); + cx.emit_span_lint( + DEPRECATED, + attr.span, + BuiltinDeprecatedAttrLink { name, reason, link, suggestion }, + ); } return; } @@ -874,11 +876,11 @@ fn warn_if_doc(cx: &EarlyContext<'_>, node_span: Span, node_kind: &str, attrs: & BuiltinUnusedDocCommentSub::BlockHelp } }; - cx.emit_span_lint(UNUSED_DOC_COMMENTS, span, BuiltinUnusedDocComment { - kind: node_kind, - label: node_span, - sub, - }); + cx.emit_span_lint( + UNUSED_DOC_COMMENTS, + span, + BuiltinUnusedDocComment { kind: node_kind, label: node_span, sub }, + ); } } } @@ -1008,9 +1010,11 @@ impl<'tcx> LateLintPass<'tcx> for InvalidNoMangleItems { match param.kind { GenericParamKind::Lifetime { .. } => {} GenericParamKind::Type { .. } | GenericParamKind::Const { .. } => { - cx.emit_span_lint(NO_MANGLE_GENERIC_ITEMS, span, BuiltinNoMangleGeneric { - suggestion: no_mangle_attr.span, - }); + cx.emit_span_lint( + NO_MANGLE_GENERIC_ITEMS, + span, + BuiltinNoMangleGeneric { suggestion: no_mangle_attr.span }, + ); break; } } @@ -1037,9 +1041,11 @@ impl<'tcx> LateLintPass<'tcx> for InvalidNoMangleItems { // Const items do not refer to a particular location in memory, and therefore // don't have anything to attach a symbol to - cx.emit_span_lint(NO_MANGLE_CONST_ITEMS, it.span, BuiltinConstNoMangle { - suggestion, - }); + cx.emit_span_lint( + NO_MANGLE_CONST_ITEMS, + it.span, + BuiltinConstNoMangle { suggestion }, + ); } } hir::ItemKind::Impl(hir::Impl { generics, items, .. }) => { @@ -1305,12 +1311,16 @@ impl UnreachablePub { applicability = Applicability::MaybeIncorrect; } let def_span = cx.tcx.def_span(def_id); - cx.emit_span_lint(UNREACHABLE_PUB, def_span, BuiltinUnreachablePub { - what, - new_vis, - suggestion: (vis_span, applicability), - help: exportable, - }); + cx.emit_span_lint( + UNREACHABLE_PUB, + def_span, + BuiltinUnreachablePub { + what, + new_vis, + suggestion: (vis_span, applicability), + help: exportable, + }, + ); } } } @@ -1454,24 +1464,32 @@ impl<'tcx> LateLintPass<'tcx> for TypeAliasBounds { let enable_feat_help = cx.tcx.sess.is_nightly_build(); if let [.., label_sp] = *where_spans { - cx.emit_span_lint(TYPE_ALIAS_BOUNDS, where_spans, BuiltinTypeAliasBounds { - in_where_clause: true, - label: label_sp, - enable_feat_help, - suggestions: vec![(generics.where_clause_span, String::new())], - preds: generics.predicates, - ty: ty.take(), - }); + cx.emit_span_lint( + TYPE_ALIAS_BOUNDS, + where_spans, + BuiltinTypeAliasBounds { + in_where_clause: true, + label: label_sp, + enable_feat_help, + suggestions: vec![(generics.where_clause_span, String::new())], + preds: generics.predicates, + ty: ty.take(), + }, + ); } if let [.., label_sp] = *inline_spans { - cx.emit_span_lint(TYPE_ALIAS_BOUNDS, inline_spans, BuiltinTypeAliasBounds { - in_where_clause: false, - label: label_sp, - enable_feat_help, - suggestions: inline_sugg, - preds: generics.predicates, - ty, - }); + cx.emit_span_lint( + TYPE_ALIAS_BOUNDS, + inline_spans, + BuiltinTypeAliasBounds { + in_where_clause: false, + label: label_sp, + enable_feat_help, + suggestions: inline_sugg, + preds: generics.predicates, + ty, + }, + ); } } } @@ -1559,10 +1577,11 @@ impl<'tcx> LateLintPass<'tcx> for TrivialConstraints { | ty::ClauseKind::HostEffect(..) => continue, }; if predicate.is_global() { - cx.emit_span_lint(TRIVIAL_BOUNDS, span, BuiltinTrivialBounds { - predicate_kind_name, - predicate, - }); + cx.emit_span_lint( + TRIVIAL_BOUNDS, + span, + BuiltinTrivialBounds { predicate_kind_name, predicate }, + ); } } } @@ -1611,12 +1630,16 @@ impl EarlyLintPass for DoubleNegations { && let ExprKind::Unary(UnOp::Neg, ref inner2) = inner.kind && !matches!(inner2.kind, ExprKind::Unary(UnOp::Neg, _)) { - cx.emit_span_lint(DOUBLE_NEGATIONS, expr.span, BuiltinDoubleNegations { - add_parens: BuiltinDoubleNegationsAddParens { - start_span: inner.span.shrink_to_lo(), - end_span: inner.span.shrink_to_hi(), + cx.emit_span_lint( + DOUBLE_NEGATIONS, + expr.span, + BuiltinDoubleNegations { + add_parens: BuiltinDoubleNegationsAddParens { + start_span: inner.span.shrink_to_lo(), + end_span: inner.span.shrink_to_hi(), + }, }, - }); + ); } } } @@ -1931,12 +1954,11 @@ impl KeywordIdents { return; } - cx.emit_span_lint(lint, ident.span, BuiltinKeywordIdents { - kw: ident, - next: edition, - suggestion: ident.span, - prefix, - }); + cx.emit_span_lint( + lint, + ident.span, + BuiltinKeywordIdents { kw: ident, next: edition, suggestion: ident.span, prefix }, + ); } } @@ -2357,11 +2379,11 @@ impl EarlyLintPass for IncompleteInternalFeatures { let help = HAS_MIN_FEATURES.contains(&name).then_some(BuiltinIncompleteFeaturesHelp); - cx.emit_span_lint(INCOMPLETE_FEATURES, span, BuiltinIncompleteFeatures { - name, - note, - help, - }); + cx.emit_span_lint( + INCOMPLETE_FEATURES, + span, + BuiltinIncompleteFeatures { name, note, help }, + ); } else { cx.emit_span_lint(INTERNAL_FEATURES, span, BuiltinInternalFeatures { name }); } @@ -2684,13 +2706,17 @@ impl<'tcx> LateLintPass<'tcx> for InvalidValue { InitKind::Uninit => fluent::lint_builtin_unpermitted_type_init_uninit, }; let sub = BuiltinUnpermittedTypeInitSub { err }; - cx.emit_span_lint(INVALID_VALUE, expr.span, BuiltinUnpermittedTypeInit { - msg, - ty: conjured_ty, - label: expr.span, - sub, - tcx: cx.tcx, - }); + cx.emit_span_lint( + INVALID_VALUE, + expr.span, + BuiltinUnpermittedTypeInit { + msg, + ty: conjured_ty, + label: expr.span, + sub, + tcx: cx.tcx, + }, + ); } } } @@ -2776,9 +2802,11 @@ impl<'tcx> LateLintPass<'tcx> for DerefNullPtr { { // `&raw *NULL` is ok. } else { - cx.emit_span_lint(DEREF_NULLPTR, expr.span, BuiltinDerefNullptr { - label: expr.span, - }); + cx.emit_span_lint( + DEREF_NULLPTR, + expr.span, + BuiltinDerefNullptr { label: expr.span }, + ); } } } @@ -2995,14 +3023,18 @@ impl<'tcx> LateLintPass<'tcx> for AsmLabels { let span = span.unwrap_or(*template_span); match label_kind { AsmLabelKind::Named => { - cx.emit_span_lint(NAMED_ASM_LABELS, span, InvalidAsmLabel::Named { - missing_precise_span, - }); + cx.emit_span_lint( + NAMED_ASM_LABELS, + span, + InvalidAsmLabel::Named { missing_precise_span }, + ); } AsmLabelKind::FormatArg => { - cx.emit_span_lint(NAMED_ASM_LABELS, span, InvalidAsmLabel::FormatArg { - missing_precise_span, - }); + cx.emit_span_lint( + NAMED_ASM_LABELS, + span, + InvalidAsmLabel::FormatArg { missing_precise_span }, + ); } // the binary asm issue only occurs when using intel syntax on x86 targets AsmLabelKind::Binary @@ -3012,10 +3044,11 @@ impl<'tcx> LateLintPass<'tcx> for AsmLabels { Some(InlineAsmArch::X86 | InlineAsmArch::X86_64) | None ) => { - cx.emit_span_lint(BINARY_ASM_LABELS, span, InvalidAsmLabel::Binary { - missing_precise_span, + cx.emit_span_lint( + BINARY_ASM_LABELS, span, - }) + InvalidAsmLabel::Binary { missing_precise_span, span }, + ) } // No lint on anything other than x86 AsmLabelKind::Binary => (), diff --git a/compiler/rustc_lint/src/context.rs b/compiler/rustc_lint/src/context.rs index e0863aa035c17..a67b404e6e16c 100644 --- a/compiler/rustc_lint/src/context.rs +++ b/compiler/rustc_lint/src/context.rs @@ -233,11 +233,14 @@ impl LintStore { } pub fn register_group_alias(&mut self, lint_name: &'static str, alias: &'static str) { - self.lint_groups.insert(alias, LintGroup { - lint_ids: vec![], - is_externally_loaded: false, - depr: Some(LintAlias { name: lint_name, silent: true }), - }); + self.lint_groups.insert( + alias, + LintGroup { + lint_ids: vec![], + is_externally_loaded: false, + depr: Some(LintAlias { name: lint_name, silent: true }), + }, + ); } pub fn register_group( @@ -252,11 +255,14 @@ impl LintStore { .insert(name, LintGroup { lint_ids: to, is_externally_loaded, depr: None }) .is_none(); if let Some(deprecated) = deprecated_name { - self.lint_groups.insert(deprecated, LintGroup { - lint_ids: vec![], - is_externally_loaded, - depr: Some(LintAlias { name, silent: false }), - }); + self.lint_groups.insert( + deprecated, + LintGroup { + lint_ids: vec![], + is_externally_loaded, + depr: Some(LintAlias { name, silent: false }), + }, + ); } if !new { diff --git a/compiler/rustc_lint/src/deref_into_dyn_supertrait.rs b/compiler/rustc_lint/src/deref_into_dyn_supertrait.rs index 181f44fb4de30..f418d6d8753b4 100644 --- a/compiler/rustc_lint/src/deref_into_dyn_supertrait.rs +++ b/compiler/rustc_lint/src/deref_into_dyn_supertrait.rs @@ -85,14 +85,19 @@ impl<'tcx> LateLintPass<'tcx> for DerefIntoDynSupertrait { .find_map(|i| (i.ident.name == sym::Target).then_some(i.span)) .map(|label| SupertraitAsDerefTargetLabel { label }); let span = tcx.def_span(item.owner_id.def_id); - cx.emit_span_lint(DEREF_INTO_DYN_SUPERTRAIT, span, SupertraitAsDerefTarget { - self_ty, - supertrait_principal: supertrait_principal - .map_bound(|trait_ref| ty::ExistentialTraitRef::erase_self_ty(tcx, trait_ref)), - target_principal, - label: span, - label2, - }); + cx.emit_span_lint( + DEREF_INTO_DYN_SUPERTRAIT, + span, + SupertraitAsDerefTarget { + self_ty, + supertrait_principal: supertrait_principal.map_bound(|trait_ref| { + ty::ExistentialTraitRef::erase_self_ty(tcx, trait_ref) + }), + target_principal, + label: span, + label2, + }, + ); } } } diff --git a/compiler/rustc_lint/src/drop_forget_useless.rs b/compiler/rustc_lint/src/drop_forget_useless.rs index ce23892508b5d..1ca2e4e74ea6f 100644 --- a/compiler/rustc_lint/src/drop_forget_useless.rs +++ b/compiler/rustc_lint/src/drop_forget_useless.rs @@ -163,32 +163,44 @@ impl<'tcx> LateLintPass<'tcx> for DropForgetUseless { }; match fn_name { sym::mem_drop if arg_ty.is_ref() && !drop_is_single_call_in_arm => { - cx.emit_span_lint(DROPPING_REFERENCES, expr.span, DropRefDiag { - arg_ty, - label: arg.span, - sugg: let_underscore_ignore_sugg(), - }); + cx.emit_span_lint( + DROPPING_REFERENCES, + expr.span, + DropRefDiag { arg_ty, label: arg.span, sugg: let_underscore_ignore_sugg() }, + ); } sym::mem_forget if arg_ty.is_ref() => { - cx.emit_span_lint(FORGETTING_REFERENCES, expr.span, ForgetRefDiag { - arg_ty, - label: arg.span, - sugg: let_underscore_ignore_sugg(), - }); + cx.emit_span_lint( + FORGETTING_REFERENCES, + expr.span, + ForgetRefDiag { + arg_ty, + label: arg.span, + sugg: let_underscore_ignore_sugg(), + }, + ); } sym::mem_drop if is_copy && !drop_is_single_call_in_arm => { - cx.emit_span_lint(DROPPING_COPY_TYPES, expr.span, DropCopyDiag { - arg_ty, - label: arg.span, - sugg: let_underscore_ignore_sugg(), - }); + cx.emit_span_lint( + DROPPING_COPY_TYPES, + expr.span, + DropCopyDiag { + arg_ty, + label: arg.span, + sugg: let_underscore_ignore_sugg(), + }, + ); } sym::mem_forget if is_copy => { - cx.emit_span_lint(FORGETTING_COPY_TYPES, expr.span, ForgetCopyDiag { - arg_ty, - label: arg.span, - sugg: let_underscore_ignore_sugg(), - }); + cx.emit_span_lint( + FORGETTING_COPY_TYPES, + expr.span, + ForgetCopyDiag { + arg_ty, + label: arg.span, + sugg: let_underscore_ignore_sugg(), + }, + ); } sym::mem_drop if let ty::Adt(adt, _) = arg_ty.kind() diff --git a/compiler/rustc_lint/src/enum_intrinsics_non_enums.rs b/compiler/rustc_lint/src/enum_intrinsics_non_enums.rs index 6556a8d8f2d05..7ead8eafbd5aa 100644 --- a/compiler/rustc_lint/src/enum_intrinsics_non_enums.rs +++ b/compiler/rustc_lint/src/enum_intrinsics_non_enums.rs @@ -54,10 +54,11 @@ fn enforce_mem_discriminant( ) { let ty_param = cx.typeck_results().node_args(func_expr.hir_id).type_at(0); if is_non_enum(ty_param) { - cx.emit_span_lint(ENUM_INTRINSICS_NON_ENUMS, expr_span, EnumIntrinsicsMemDiscriminate { - ty_param, - note: args_span, - }); + cx.emit_span_lint( + ENUM_INTRINSICS_NON_ENUMS, + expr_span, + EnumIntrinsicsMemDiscriminate { ty_param, note: args_span }, + ); } } diff --git a/compiler/rustc_lint/src/for_loops_over_fallibles.rs b/compiler/rustc_lint/src/for_loops_over_fallibles.rs index dbc920ea5aee0..0a5c52d65ec97 100644 --- a/compiler/rustc_lint/src/for_loops_over_fallibles.rs +++ b/compiler/rustc_lint/src/for_loops_over_fallibles.rs @@ -96,14 +96,11 @@ impl<'tcx> LateLintPass<'tcx> for ForLoopsOverFallibles { end_span: pat.span.between(arg.span), }; - cx.emit_span_lint(FOR_LOOPS_OVER_FALLIBLES, arg.span, ForLoopsOverFalliblesDiag { - article, - ref_prefix, - ty, - sub, - question_mark, - suggestion, - }); + cx.emit_span_lint( + FOR_LOOPS_OVER_FALLIBLES, + arg.span, + ForLoopsOverFalliblesDiag { article, ref_prefix, ty, sub, question_mark, suggestion }, + ); } } diff --git a/compiler/rustc_lint/src/hidden_unicode_codepoints.rs b/compiler/rustc_lint/src/hidden_unicode_codepoints.rs index 406aa1005dfba..491c2826baaa1 100644 --- a/compiler/rustc_lint/src/hidden_unicode_codepoints.rs +++ b/compiler/rustc_lint/src/hidden_unicode_codepoints.rs @@ -74,13 +74,11 @@ impl HiddenUnicodeCodepoints { HiddenUnicodeCodepointsDiagSub::NoEscape { spans } }; - cx.emit_span_lint(TEXT_DIRECTION_CODEPOINT_IN_LITERAL, span, HiddenUnicodeCodepointsDiag { - label, - count, - span_label: span, - labels, - sub, - }); + cx.emit_span_lint( + TEXT_DIRECTION_CODEPOINT_IN_LITERAL, + span, + HiddenUnicodeCodepointsDiag { label, count, span_label: span, labels, sub }, + ); } fn check_literal( diff --git a/compiler/rustc_lint/src/if_let_rescope.rs b/compiler/rustc_lint/src/if_let_rescope.rs index b5a6159bd0aa4..869dab6799d02 100644 --- a/compiler/rustc_lint/src/if_let_rescope.rs +++ b/compiler/rustc_lint/src/if_let_rescope.rs @@ -221,20 +221,25 @@ impl IfLetRescope { } } if let Some((span, hir_id)) = first_if_to_lint { - tcx.emit_node_span_lint(IF_LET_RESCOPE, hir_id, span, IfLetRescopeLint { - significant_droppers, - lifetime_ends, - rewrite: first_if_to_rewrite.then_some(IfLetRescopeRewrite { - match_heads, - consequent_heads, - closing_brackets: ClosingBrackets { - span: expr_end, - count: closing_brackets, - empty_alt, - }, - alt_heads, - }), - }); + tcx.emit_node_span_lint( + IF_LET_RESCOPE, + hir_id, + span, + IfLetRescopeLint { + significant_droppers, + lifetime_ends, + rewrite: first_if_to_rewrite.then_some(IfLetRescopeRewrite { + match_heads, + consequent_heads, + closing_brackets: ClosingBrackets { + span: expr_end, + count: closing_brackets, + empty_alt, + }, + alt_heads, + }), + }, + ); } } } diff --git a/compiler/rustc_lint/src/impl_trait_overcaptures.rs b/compiler/rustc_lint/src/impl_trait_overcaptures.rs index d251b4b7459e2..d2956d94685f1 100644 --- a/compiler/rustc_lint/src/impl_trait_overcaptures.rs +++ b/compiler/rustc_lint/src/impl_trait_overcaptures.rs @@ -314,12 +314,10 @@ where // We only computed variance of lifetimes... debug_assert_matches!(self.tcx.def_kind(def_id), DefKind::LifetimeParam); let uncaptured = match *kind { - ParamKind::Early(name, index) => { - ty::Region::new_early_param(self.tcx, ty::EarlyParamRegion { - name, - index, - }) - } + ParamKind::Early(name, index) => ty::Region::new_early_param( + self.tcx, + ty::EarlyParamRegion { name, index }, + ), ParamKind::Free(def_id, name) => ty::Region::new_late_param( self.tcx, self.parent_def_id.to_def_id(), diff --git a/compiler/rustc_lint/src/internal.rs b/compiler/rustc_lint/src/internal.rs index 546df4497adf5..ddc9ae1594f90 100644 --- a/compiler/rustc_lint/src/internal.rs +++ b/compiler/rustc_lint/src/internal.rs @@ -48,10 +48,11 @@ impl LateLintPass<'_> for DefaultHashTypes { Some(sym::HashSet) => "FxHashSet", _ => return, }; - cx.emit_span_lint(DEFAULT_HASH_TYPES, path.span, DefaultHashTypesDiag { - preferred, - used: cx.tcx.item_name(def_id), - }); + cx.emit_span_lint( + DEFAULT_HASH_TYPES, + path.span, + DefaultHashTypesDiag { preferred, used: cx.tcx.item_name(def_id) }, + ); } } @@ -107,14 +108,18 @@ impl LateLintPass<'_> for QueryStability { { let def_id = instance.def_id(); if cx.tcx.has_attr(def_id, sym::rustc_lint_query_instability) { - cx.emit_span_lint(POTENTIAL_QUERY_INSTABILITY, span, QueryInstability { - query: cx.tcx.item_name(def_id), - }); + cx.emit_span_lint( + POTENTIAL_QUERY_INSTABILITY, + span, + QueryInstability { query: cx.tcx.item_name(def_id) }, + ); } if cx.tcx.has_attr(def_id, sym::rustc_lint_untracked_query_information) { - cx.emit_span_lint(UNTRACKED_QUERY_INFORMATION, span, QueryUntracked { - method: cx.tcx.item_name(def_id), - }); + cx.emit_span_lint( + UNTRACKED_QUERY_INFORMATION, + span, + QueryUntracked { method: cx.tcx.item_name(def_id) }, + ); } } } @@ -186,9 +191,11 @@ impl<'tcx> LateLintPass<'tcx> for TyTyKind { match span { Some(span) => { - cx.emit_span_lint(USAGE_OF_TY_TYKIND, path.span, TykindKind { - suggestion: span, - }); + cx.emit_span_lint( + USAGE_OF_TY_TYKIND, + path.span, + TykindKind { suggestion: span }, + ); } None => cx.emit_span_lint(USAGE_OF_TY_TYKIND, path.span, TykindDiag), } @@ -196,10 +203,11 @@ impl<'tcx> LateLintPass<'tcx> for TyTyKind { && path.segments.len() > 1 && let Some(ty) = is_ty_or_ty_ctxt(cx, path) { - cx.emit_span_lint(USAGE_OF_QUALIFIED_TY, path.span, TyQualified { - ty, - suggestion: path.span, - }); + cx.emit_span_lint( + USAGE_OF_QUALIFIED_TY, + path.span, + TyQualified { ty, suggestion: path.span }, + ); } } _ => {} @@ -553,9 +561,11 @@ impl LateLintPass<'_> for BadOptAccess { && let Some(lit) = item.lit() && let ast::LitKind::Str(val, _) = lit.kind { - cx.emit_span_lint(BAD_OPT_ACCESS, expr.span, BadOptAccessDiag { - msg: val.as_str(), - }); + cx.emit_span_lint( + BAD_OPT_ACCESS, + expr.span, + BadOptAccessDiag { msg: val.as_str() }, + ); } } } diff --git a/compiler/rustc_lint/src/let_underscore.rs b/compiler/rustc_lint/src/let_underscore.rs index 9e4e83331646c..3e2c1af97f437 100644 --- a/compiler/rustc_lint/src/let_underscore.rs +++ b/compiler/rustc_lint/src/let_underscore.rs @@ -156,10 +156,11 @@ impl<'tcx> LateLintPass<'tcx> for LetUnderscore { }; if is_sync_lock { let span = MultiSpan::from_span(pat.span); - cx.emit_span_lint(LET_UNDERSCORE_LOCK, span, NonBindingLet::SyncLock { - sub, - pat: pat.span, - }); + cx.emit_span_lint( + LET_UNDERSCORE_LOCK, + span, + NonBindingLet::SyncLock { sub, pat: pat.span }, + ); // Only emit let_underscore_drop for top-level `_` patterns. } else if can_use_init.is_some() { cx.emit_span_lint(LET_UNDERSCORE_DROP, local.span, NonBindingLet::DropType { sub }); diff --git a/compiler/rustc_lint/src/lib.rs b/compiler/rustc_lint/src/lib.rs index 3e97f4c86ba32..d89e615e14ad3 100644 --- a/compiler/rustc_lint/src/lib.rs +++ b/compiler/rustc_lint/src/lib.rs @@ -627,18 +627,23 @@ fn register_internals(store: &mut LintStore) { // `DIAGNOSTIC_OUTSIDE_OF_IMPL` here because `-Wrustc::internal` is provided to every crate and // these lints will trigger all of the time - change this once migration to diagnostic structs // and translation is completed - store.register_group(false, "rustc::internal", None, vec![ - LintId::of(DEFAULT_HASH_TYPES), - LintId::of(POTENTIAL_QUERY_INSTABILITY), - LintId::of(UNTRACKED_QUERY_INFORMATION), - LintId::of(USAGE_OF_TY_TYKIND), - LintId::of(PASS_BY_VALUE), - LintId::of(LINT_PASS_IMPL_WITHOUT_MACRO), - LintId::of(USAGE_OF_QUALIFIED_TY), - LintId::of(NON_GLOB_IMPORT_OF_TYPE_IR_INHERENT), - LintId::of(BAD_OPT_ACCESS), - LintId::of(SPAN_USE_EQ_CTXT), - ]); + store.register_group( + false, + "rustc::internal", + None, + vec![ + LintId::of(DEFAULT_HASH_TYPES), + LintId::of(POTENTIAL_QUERY_INSTABILITY), + LintId::of(UNTRACKED_QUERY_INFORMATION), + LintId::of(USAGE_OF_TY_TYKIND), + LintId::of(PASS_BY_VALUE), + LintId::of(LINT_PASS_IMPL_WITHOUT_MACRO), + LintId::of(USAGE_OF_QUALIFIED_TY), + LintId::of(NON_GLOB_IMPORT_OF_TYPE_IR_INHERENT), + LintId::of(BAD_OPT_ACCESS), + LintId::of(SPAN_USE_EQ_CTXT), + ], + ); } #[cfg(test)] diff --git a/compiler/rustc_lint/src/map_unit_fn.rs b/compiler/rustc_lint/src/map_unit_fn.rs index 776d51a672718..3b27e45613690 100644 --- a/compiler/rustc_lint/src/map_unit_fn.rs +++ b/compiler/rustc_lint/src/map_unit_fn.rs @@ -60,25 +60,39 @@ impl<'tcx> LateLintPass<'tcx> for MapUnitFn { let fn_ty = cx.tcx.fn_sig(id).skip_binder(); let ret_ty = fn_ty.output().skip_binder(); if is_unit_type(ret_ty) { - cx.emit_span_lint(MAP_UNIT_FN, span, MappingToUnit { - function_label: cx.tcx.span_of_impl(*id).unwrap_or(default_span), - argument_label: args[0].span, - map_label: arg_ty.default_span(cx.tcx), - suggestion: path.ident.span, - replace: "for_each".to_string(), - }) + cx.emit_span_lint( + MAP_UNIT_FN, + span, + MappingToUnit { + function_label: cx + .tcx + .span_of_impl(*id) + .unwrap_or(default_span), + argument_label: args[0].span, + map_label: arg_ty.default_span(cx.tcx), + suggestion: path.ident.span, + replace: "for_each".to_string(), + }, + ) } } else if let ty::Closure(id, subs) = arg_ty.kind() { let cl_ty = subs.as_closure().sig(); let ret_ty = cl_ty.output().skip_binder(); if is_unit_type(ret_ty) { - cx.emit_span_lint(MAP_UNIT_FN, span, MappingToUnit { - function_label: cx.tcx.span_of_impl(*id).unwrap_or(default_span), - argument_label: args[0].span, - map_label: arg_ty.default_span(cx.tcx), - suggestion: path.ident.span, - replace: "for_each".to_string(), - }) + cx.emit_span_lint( + MAP_UNIT_FN, + span, + MappingToUnit { + function_label: cx + .tcx + .span_of_impl(*id) + .unwrap_or(default_span), + argument_label: args[0].span, + map_label: arg_ty.default_span(cx.tcx), + suggestion: path.ident.span, + replace: "for_each".to_string(), + }, + ) } } } diff --git a/compiler/rustc_lint/src/non_ascii_idents.rs b/compiler/rustc_lint/src/non_ascii_idents.rs index 593c8616c1d7c..2f9cf98848e94 100644 --- a/compiler/rustc_lint/src/non_ascii_idents.rs +++ b/compiler/rustc_lint/src/non_ascii_idents.rs @@ -209,22 +209,30 @@ impl EarlyLintPass for NonAsciiIdents { if codepoints.is_empty() { continue; } - cx.emit_span_lint(UNCOMMON_CODEPOINTS, sp, IdentifierUncommonCodepoints { - codepoints_len: codepoints.len(), - codepoints: codepoints.into_iter().map(|(c, _)| c).collect(), - identifier_type: id_ty_descr, - }); + cx.emit_span_lint( + UNCOMMON_CODEPOINTS, + sp, + IdentifierUncommonCodepoints { + codepoints_len: codepoints.len(), + codepoints: codepoints.into_iter().map(|(c, _)| c).collect(), + identifier_type: id_ty_descr, + }, + ); } let remaining = chars .extract_if(.., |(c, _)| !GeneralSecurityProfile::identifier_allowed(*c)) .collect::>(); if !remaining.is_empty() { - cx.emit_span_lint(UNCOMMON_CODEPOINTS, sp, IdentifierUncommonCodepoints { - codepoints_len: remaining.len(), - codepoints: remaining.into_iter().map(|(c, _)| c).collect(), - identifier_type: "Restricted", - }); + cx.emit_span_lint( + UNCOMMON_CODEPOINTS, + sp, + IdentifierUncommonCodepoints { + codepoints_len: remaining.len(), + codepoints: remaining.into_iter().map(|(c, _)| c).collect(), + identifier_type: "Restricted", + }, + ); } } } @@ -253,12 +261,16 @@ impl EarlyLintPass for NonAsciiIdents { .entry(skeleton_sym) .and_modify(|(existing_symbol, existing_span, existing_is_ascii)| { if !*existing_is_ascii || !is_ascii { - cx.emit_span_lint(CONFUSABLE_IDENTS, sp, ConfusableIdentifierPair { - existing_sym: *existing_symbol, - sym: symbol, - label: *existing_span, - main_label: sp, - }); + cx.emit_span_lint( + CONFUSABLE_IDENTS, + sp, + ConfusableIdentifierPair { + existing_sym: *existing_symbol, + sym: symbol, + label: *existing_span, + main_label: sp, + }, + ); } if *existing_is_ascii && !is_ascii { *existing_symbol = symbol; @@ -370,10 +382,11 @@ impl EarlyLintPass for NonAsciiIdents { let char_info = format!("'{}' (U+{:04X})", ch, ch as u32); includes += &char_info; } - cx.emit_span_lint(MIXED_SCRIPT_CONFUSABLES, sp, MixedScriptConfusables { - set: script_set.to_string(), - includes, - }); + cx.emit_span_lint( + MIXED_SCRIPT_CONFUSABLES, + sp, + MixedScriptConfusables { set: script_set.to_string(), includes }, + ); } } } diff --git a/compiler/rustc_lint/src/non_fmt_panic.rs b/compiler/rustc_lint/src/non_fmt_panic.rs index 648d06756275f..ac9f8d92dacb7 100644 --- a/compiler/rustc_lint/src/non_fmt_panic.rs +++ b/compiler/rustc_lint/src/non_fmt_panic.rs @@ -256,10 +256,14 @@ fn check_panic_str<'tcx>( .map(|span| fmt_span.from_inner(InnerSpan::new(span.start, span.end))) .collect(), }; - cx.emit_span_lint(NON_FMT_PANICS, arg_spans, NonFmtPanicUnused { - count: n_arguments, - suggestion: is_arg_inside_call(arg.span, span).then_some(arg.span), - }); + cx.emit_span_lint( + NON_FMT_PANICS, + arg_spans, + NonFmtPanicUnused { + count: n_arguments, + suggestion: is_arg_inside_call(arg.span, span).then_some(arg.span), + }, + ); } else { let brace_spans: Option> = snippet.filter(|s| s.starts_with('"') || s.starts_with("r#")).map(|s| { diff --git a/compiler/rustc_lint/src/non_local_def.rs b/compiler/rustc_lint/src/non_local_def.rs index 4e9d793be5b91..0890890d12cbf 100644 --- a/compiler/rustc_lint/src/non_local_def.rs +++ b/compiler/rustc_lint/src/non_local_def.rs @@ -222,17 +222,21 @@ impl<'tcx> LateLintPass<'tcx> for NonLocalDefinitions { None }; - cx.emit_span_lint(NON_LOCAL_DEFINITIONS, ms, NonLocalDefinitionsDiag::Impl { - depth: self.body_depth, - body_kind_descr: cx.tcx.def_kind_descr(parent_def_kind, parent), - body_name: parent_opt_item_name - .map(|s| s.to_ident_string()) - .unwrap_or_else(|| "".to_string()), - cargo_update: cargo_update(), - const_anon, - doctest, - macro_to_change, - }) + cx.emit_span_lint( + NON_LOCAL_DEFINITIONS, + ms, + NonLocalDefinitionsDiag::Impl { + depth: self.body_depth, + body_kind_descr: cx.tcx.def_kind_descr(parent_def_kind, parent), + body_name: parent_opt_item_name + .map(|s| s.to_ident_string()) + .unwrap_or_else(|| "".to_string()), + cargo_update: cargo_update(), + const_anon, + doctest, + macro_to_change, + }, + ) } ItemKind::Macro(_macro, MacroKind::Bang) if cx.tcx.has_attr(item.owner_id.def_id, sym::macro_export) => diff --git a/compiler/rustc_lint/src/nonstandard_style.rs b/compiler/rustc_lint/src/nonstandard_style.rs index 0c180ab95706a..5636f80d60020 100644 --- a/compiler/rustc_lint/src/nonstandard_style.rs +++ b/compiler/rustc_lint/src/nonstandard_style.rs @@ -150,11 +150,11 @@ impl NonCamelCaseTypes { } else { NonCamelCaseTypeSub::Label { span: ident.span } }; - cx.emit_span_lint(NON_CAMEL_CASE_TYPES, ident.span, NonCamelCaseType { - sort, - name, - sub, - }); + cx.emit_span_lint( + NON_CAMEL_CASE_TYPES, + ident.span, + NonCamelCaseType { sort, name, sub }, + ); } } } @@ -488,11 +488,11 @@ impl NonUpperCaseGlobals { } else { NonUpperCaseGlobalSub::Label { span: ident.span } }; - cx.emit_span_lint(NON_UPPER_CASE_GLOBALS, ident.span, NonUpperCaseGlobal { - sort, - name, - sub, - }); + cx.emit_span_lint( + NON_UPPER_CASE_GLOBALS, + ident.span, + NonUpperCaseGlobal { sort, name, sub }, + ); } } } diff --git a/compiler/rustc_lint/src/noop_method_call.rs b/compiler/rustc_lint/src/noop_method_call.rs index 790ef910b041b..b7835e6c36ab1 100644 --- a/compiler/rustc_lint/src/noop_method_call.rs +++ b/compiler/rustc_lint/src/noop_method_call.rs @@ -128,13 +128,17 @@ impl<'tcx> LateLintPass<'tcx> for NoopMethodCall { ty::Adt(def, _) => Some(cx.tcx.def_span(def.did()).shrink_to_lo()), _ => None, }; - cx.emit_span_lint(NOOP_METHOD_CALL, span, NoopMethodCallDiag { - method: call.ident, - orig_ty, - trait_, - label: span, - suggest_derive, - }); + cx.emit_span_lint( + NOOP_METHOD_CALL, + span, + NoopMethodCallDiag { + method: call.ident, + orig_ty, + trait_, + label: span, + suggest_derive, + }, + ); } else { match name { // If `type_of(x) == T` and `x.borrow()` is used to get `&T`, diff --git a/compiler/rustc_lint/src/opaque_hidden_inferred_bound.rs b/compiler/rustc_lint/src/opaque_hidden_inferred_bound.rs index d347a8c1bc7ff..7eaf83f5acf31 100644 --- a/compiler/rustc_lint/src/opaque_hidden_inferred_bound.rs +++ b/compiler/rustc_lint/src/opaque_hidden_inferred_bound.rs @@ -113,10 +113,13 @@ impl<'tcx> LateLintPass<'tcx> for OpaqueHiddenInferredBound { // return type is well-formed in traits even when `Self` isn't sized. if let ty::Param(param_ty) = *proj_term.kind() && param_ty.name == kw::SelfUpper - && matches!(opaque.origin, hir::OpaqueTyOrigin::AsyncFn { - in_trait_or_impl: Some(hir::RpitContext::Trait), - .. - }) + && matches!( + opaque.origin, + hir::OpaqueTyOrigin::AsyncFn { + in_trait_or_impl: Some(hir::RpitContext::Trait), + .. + } + ) { return; } diff --git a/compiler/rustc_lint/src/pass_by_value.rs b/compiler/rustc_lint/src/pass_by_value.rs index a1d660470589e..d85618f664d6f 100644 --- a/compiler/rustc_lint/src/pass_by_value.rs +++ b/compiler/rustc_lint/src/pass_by_value.rs @@ -30,10 +30,11 @@ impl<'tcx> LateLintPass<'tcx> for PassByValue { } } if let Some(t) = path_for_pass_by_value(cx, inner_ty) { - cx.emit_span_lint(PASS_BY_VALUE, ty.span, PassByValueDiag { - ty: t, - suggestion: ty.span, - }); + cx.emit_span_lint( + PASS_BY_VALUE, + ty.span, + PassByValueDiag { ty: t, suggestion: ty.span }, + ); } } _ => {} diff --git a/compiler/rustc_lint/src/redundant_semicolon.rs b/compiler/rustc_lint/src/redundant_semicolon.rs index 036bfd06856f6..b43e4938b736c 100644 --- a/compiler/rustc_lint/src/redundant_semicolon.rs +++ b/compiler/rustc_lint/src/redundant_semicolon.rs @@ -50,9 +50,10 @@ fn maybe_lint_redundant_semis(cx: &EarlyContext<'_>, seq: &mut Option<(Span, boo return; } - cx.emit_span_lint(REDUNDANT_SEMICOLONS, span, RedundantSemicolonsDiag { - multiple, - suggestion: span, - }); + cx.emit_span_lint( + REDUNDANT_SEMICOLONS, + span, + RedundantSemicolonsDiag { multiple, suggestion: span }, + ); } } diff --git a/compiler/rustc_lint/src/shadowed_into_iter.rs b/compiler/rustc_lint/src/shadowed_into_iter.rs index f5ab44d74692a..7cc35e20fcb64 100644 --- a/compiler/rustc_lint/src/shadowed_into_iter.rs +++ b/compiler/rustc_lint/src/shadowed_into_iter.rs @@ -147,11 +147,10 @@ impl<'tcx> LateLintPass<'tcx> for ShadowedIntoIter { None }; - cx.emit_span_lint(lint, call.ident.span, ShadowedIntoIterDiag { - target, - edition, - suggestion: call.ident.span, - sub, - }); + cx.emit_span_lint( + lint, + call.ident.span, + ShadowedIntoIterDiag { target, edition, suggestion: call.ident.span, sub }, + ); } } diff --git a/compiler/rustc_lint/src/static_mut_refs.rs b/compiler/rustc_lint/src/static_mut_refs.rs index fed5c29284b3f..50021157ddab7 100644 --- a/compiler/rustc_lint/src/static_mut_refs.rs +++ b/compiler/rustc_lint/src/static_mut_refs.rs @@ -157,11 +157,9 @@ fn emit_static_mut_refs( } }; - cx.emit_span_lint(STATIC_MUT_REFS, span, RefOfMutStatic { + cx.emit_span_lint( + STATIC_MUT_REFS, span, - sugg, - shared_label, - shared_note, - mut_note, - }); + RefOfMutStatic { span, sugg, shared_label, shared_note, mut_note }, + ); } diff --git a/compiler/rustc_lint/src/traits.rs b/compiler/rustc_lint/src/traits.rs index e0937e43c9a37..99222742b65de 100644 --- a/compiler/rustc_lint/src/traits.rs +++ b/compiler/rustc_lint/src/traits.rs @@ -101,11 +101,11 @@ impl<'tcx> LateLintPass<'tcx> for DropTraitConstraints { continue; } let Some(def_id) = cx.tcx.get_diagnostic_item(sym::needs_drop) else { return }; - cx.emit_span_lint(DROP_BOUNDS, span, DropTraitConstraintsDiag { - predicate, - tcx: cx.tcx, - def_id, - }); + cx.emit_span_lint( + DROP_BOUNDS, + span, + DropTraitConstraintsDiag { predicate, tcx: cx.tcx, def_id }, + ); } } } diff --git a/compiler/rustc_lint/src/types.rs b/compiler/rustc_lint/src/types.rs index 80007f34db356..a9fffcf348b87 100644 --- a/compiler/rustc_lint/src/types.rs +++ b/compiler/rustc_lint/src/types.rs @@ -599,13 +599,16 @@ impl<'tcx> LateLintPass<'tcx> for TypeLimits { } fn rev_binop(binop: hir::BinOp) -> hir::BinOp { - source_map::respan(binop.span, match binop.node { - hir::BinOpKind::Lt => hir::BinOpKind::Gt, - hir::BinOpKind::Le => hir::BinOpKind::Ge, - hir::BinOpKind::Gt => hir::BinOpKind::Lt, - hir::BinOpKind::Ge => hir::BinOpKind::Le, - _ => return binop, - }) + source_map::respan( + binop.span, + match binop.node { + hir::BinOpKind::Lt => hir::BinOpKind::Gt, + hir::BinOpKind::Le => hir::BinOpKind::Ge, + hir::BinOpKind::Gt => hir::BinOpKind::Lt, + hir::BinOpKind::Ge => hir::BinOpKind::Le, + _ => return binop, + }, + ) } fn check_limits( @@ -1386,14 +1389,11 @@ impl<'a, 'tcx> ImproperCTypesVisitor<'a, 'tcx> { } else { None }; - self.cx.emit_span_lint(lint, sp, ImproperCTypes { - ty, - desc, - label: sp, - help, - note, - span_note, - }); + self.cx.emit_span_lint( + lint, + sp, + ImproperCTypes { ty, desc, label: sp, help, note, span_note }, + ); } fn check_for_opaque_ty(&mut self, sp: Span, ty: Ty<'tcx>) -> bool { @@ -1930,11 +1930,11 @@ impl InvalidAtomicOrdering { } fn check_atomic_compare_exchange(cx: &LateContext<'_>, expr: &Expr<'_>) { - let Some((method, args)) = Self::inherent_atomic_method_call(cx, expr, &[ - sym::fetch_update, - sym::compare_exchange, - sym::compare_exchange_weak, - ]) else { + let Some((method, args)) = Self::inherent_atomic_method_call( + cx, + expr, + &[sym::fetch_update, sym::compare_exchange, sym::compare_exchange_weak], + ) else { return; }; diff --git a/compiler/rustc_lint/src/types/literal.rs b/compiler/rustc_lint/src/types/literal.rs index 71e6e229907ac..da98b6461f126 100644 --- a/compiler/rustc_lint/src/types/literal.rs +++ b/compiler/rustc_lint/src/types/literal.rs @@ -77,10 +77,11 @@ fn lint_overflowing_range_endpoint<'tcx>( } }; - cx.emit_span_lint(OVERFLOWING_LITERALS, struct_expr.span, RangeEndpointOutOfRange { - ty, - sub: sub_sugg, - }); + cx.emit_span_lint( + OVERFLOWING_LITERALS, + struct_expr.span, + RangeEndpointOutOfRange { ty, sub: sub_sugg }, + ); // We've just emitted a lint, special cased for `(...)..MAX+1` ranges, // return `true` so the callers don't also emit a lint @@ -190,15 +191,19 @@ fn report_bin_hex_error( }) .flatten(); - cx.emit_span_lint(OVERFLOWING_LITERALS, span, OverflowingBinHex { - ty: t, - lit: repr_str.clone(), - dec: val, - actually, - sign, - sub, - sign_bit_sub, - }) + cx.emit_span_lint( + OVERFLOWING_LITERALS, + span, + OverflowingBinHex { + ty: t, + lit: repr_str.clone(), + dec: val, + actually, + sign, + sub, + sign_bit_sub, + }, + ) } // Find the "next" fitting integer and return a suggestion string @@ -283,13 +288,11 @@ fn lint_int_literal<'tcx>( let help = get_type_suggestion(cx.typeck_results().node_type(hir_id), v, negative) .map(|suggestion_ty| OverflowingIntHelp { suggestion_ty }); - cx.emit_span_lint(OVERFLOWING_LITERALS, span, OverflowingInt { - ty: t.name_str(), - lit, - min, - max, - help, - }); + cx.emit_span_lint( + OVERFLOWING_LITERALS, + span, + OverflowingInt { ty: t.name_str(), lit, min, max, help }, + ); } } @@ -314,10 +317,11 @@ fn lint_uint_literal<'tcx>( match par_e.kind { hir::ExprKind::Cast(..) => { if let ty::Char = cx.typeck_results().expr_ty(par_e).kind() { - cx.emit_span_lint(OVERFLOWING_LITERALS, par_e.span, OnlyCastu8ToChar { - span: par_e.span, - literal: lit_val, - }); + cx.emit_span_lint( + OVERFLOWING_LITERALS, + par_e.span, + OnlyCastu8ToChar { span: par_e.span, literal: lit_val }, + ); return; } } @@ -341,16 +345,20 @@ fn lint_uint_literal<'tcx>( ); return; } - cx.emit_span_lint(OVERFLOWING_LITERALS, span, OverflowingUInt { - ty: t.name_str(), - lit: cx - .sess() - .source_map() - .span_to_snippet(lit.span) - .unwrap_or_else(|_| lit_val.to_string()), - min, - max, - }); + cx.emit_span_lint( + OVERFLOWING_LITERALS, + span, + OverflowingUInt { + ty: t.name_str(), + lit: cx + .sess() + .source_map() + .span_to_snippet(lit.span) + .unwrap_or_else(|_| lit_val.to_string()), + min, + max, + }, + ); } } @@ -388,14 +396,18 @@ pub(crate) fn lint_literal<'tcx>( _ => bug!(), }; if is_infinite == Ok(true) { - cx.emit_span_lint(OVERFLOWING_LITERALS, span, OverflowingLiteral { - ty: t.name_str(), - lit: cx - .sess() - .source_map() - .span_to_snippet(lit.span) - .unwrap_or_else(|_| sym.to_string()), - }); + cx.emit_span_lint( + OVERFLOWING_LITERALS, + span, + OverflowingLiteral { + ty: t.name_str(), + lit: cx + .sess() + .source_map() + .span_to_snippet(lit.span) + .unwrap_or_else(|_| sym.to_string()), + }, + ); } } _ => {} diff --git a/compiler/rustc_lint/src/unit_bindings.rs b/compiler/rustc_lint/src/unit_bindings.rs index 3c2c5f8fae095..ed015908ae54a 100644 --- a/compiler/rustc_lint/src/unit_bindings.rs +++ b/compiler/rustc_lint/src/unit_bindings.rs @@ -63,9 +63,11 @@ impl<'tcx> LateLintPass<'tcx> for UnitBindings { && !matches!(init.kind, hir::ExprKind::Tup([])) && !matches!(local.pat.kind, hir::PatKind::Tuple([], ..)) { - cx.emit_span_lint(UNIT_BINDINGS, local.span, UnitBindingsDiag { - label: local.pat.span, - }); + cx.emit_span_lint( + UNIT_BINDINGS, + local.span, + UnitBindingsDiag { label: local.pat.span }, + ); } } } diff --git a/compiler/rustc_lint/src/unused.rs b/compiler/rustc_lint/src/unused.rs index 5696fcaed1370..5a00ac005dbfa 100644 --- a/compiler/rustc_lint/src/unused.rs +++ b/compiler/rustc_lint/src/unused.rs @@ -184,18 +184,22 @@ impl<'tcx> LateLintPass<'tcx> for UnusedResults { let mut op_warned = false; if let Some(must_use_op) = must_use_op { - cx.emit_span_lint(UNUSED_MUST_USE, expr.span, UnusedOp { - op: must_use_op, - label: expr.span, - suggestion: if expr_is_from_block { - UnusedOpSuggestion::BlockTailExpr { - before_span: expr.span.shrink_to_lo(), - after_span: expr.span.shrink_to_hi(), - } - } else { - UnusedOpSuggestion::NormalExpr { span: expr.span.shrink_to_lo() } + cx.emit_span_lint( + UNUSED_MUST_USE, + expr.span, + UnusedOp { + op: must_use_op, + label: expr.span, + suggestion: if expr_is_from_block { + UnusedOpSuggestion::BlockTailExpr { + before_span: expr.span.shrink_to_lo(), + after_span: expr.span.shrink_to_hi(), + } + } else { + UnusedOpSuggestion::NormalExpr { span: expr.span.shrink_to_lo() } + }, }, - }); + ); op_warned = true; } @@ -489,35 +493,39 @@ impl<'tcx> LateLintPass<'tcx> for UnusedResults { ); } MustUsePath::Closure(span) => { - cx.emit_span_lint(UNUSED_MUST_USE, *span, UnusedClosure { - count: plural_len, - pre: descr_pre, - post: descr_post, - }); + cx.emit_span_lint( + UNUSED_MUST_USE, + *span, + UnusedClosure { count: plural_len, pre: descr_pre, post: descr_post }, + ); } MustUsePath::Coroutine(span) => { - cx.emit_span_lint(UNUSED_MUST_USE, *span, UnusedCoroutine { - count: plural_len, - pre: descr_pre, - post: descr_post, - }); + cx.emit_span_lint( + UNUSED_MUST_USE, + *span, + UnusedCoroutine { count: plural_len, pre: descr_pre, post: descr_post }, + ); } MustUsePath::Def(span, def_id, reason) => { - cx.emit_span_lint(UNUSED_MUST_USE, *span, UnusedDef { - pre: descr_pre, - post: descr_post, - cx, - def_id: *def_id, - note: *reason, - suggestion: (!is_inner).then_some(if expr_is_from_block { - UnusedDefSuggestion::BlockTailExpr { - before_span: span.shrink_to_lo(), - after_span: span.shrink_to_hi(), - } - } else { - UnusedDefSuggestion::NormalExpr { span: span.shrink_to_lo() } - }), - }); + cx.emit_span_lint( + UNUSED_MUST_USE, + *span, + UnusedDef { + pre: descr_pre, + post: descr_post, + cx, + def_id: *def_id, + note: *reason, + suggestion: (!is_inner).then_some(if expr_is_from_block { + UnusedDefSuggestion::BlockTailExpr { + before_span: span.shrink_to_lo(), + after_span: span.shrink_to_hi(), + } + } else { + UnusedDefSuggestion::NormalExpr { span: span.shrink_to_lo() } + }), + }, + ); } } } @@ -867,11 +875,11 @@ trait UnusedDelimLint { end_replace: hi_replace, } }); - cx.emit_span_lint(self.lint(), primary_span, UnusedDelim { - delim: Self::DELIM_STR, - item: msg, - suggestion, - }); + cx.emit_span_lint( + self.lint(), + primary_span, + UnusedDelim { delim: Self::DELIM_STR, item: msg, suggestion }, + ); } fn check_expr(&mut self, cx: &EarlyContext<'_>, e: &ast::Expr) { @@ -1558,9 +1566,11 @@ impl UnusedImportBraces { ast::UseTreeKind::Nested { .. } => return, }; - cx.emit_span_lint(UNUSED_IMPORT_BRACES, item.span, UnusedImportBracesDiag { - node: node_name, - }); + cx.emit_span_lint( + UNUSED_IMPORT_BRACES, + item.span, + UnusedImportBracesDiag { node: node_name }, + ); } } } diff --git a/compiler/rustc_macros/src/serialize.rs b/compiler/rustc_macros/src/serialize.rs index ce692abfb9834..2c33a0ac0aafe 100644 --- a/compiler/rustc_macros/src/serialize.rs +++ b/compiler/rustc_macros/src/serialize.rs @@ -105,11 +105,14 @@ fn decodable_body( }; s.underscore_const(true); - s.bound_impl(quote!(::rustc_serialize::Decodable<#decoder_ty>), quote! { - fn decode(__decoder: &mut #decoder_ty) -> Self { - #decode_body - } - }) + s.bound_impl( + quote!(::rustc_serialize::Decodable<#decoder_ty>), + quote! { + fn decode(__decoder: &mut #decoder_ty) -> Self { + #decode_body + } + }, + ) } fn decode_field(field: &syn::Field) -> proc_macro2::TokenStream { @@ -285,13 +288,16 @@ fn encodable_body( quote! {} }; - s.bound_impl(quote!(::rustc_serialize::Encodable<#encoder_ty>), quote! { - fn encode( - &self, - __encoder: &mut #encoder_ty, - ) { - #lints - #encode_body - } - }) + s.bound_impl( + quote!(::rustc_serialize::Encodable<#encoder_ty>), + quote! { + fn encode( + &self, + __encoder: &mut #encoder_ty, + ) { + #lints + #encode_body + } + }, + ) } diff --git a/compiler/rustc_macros/src/symbols/tests.rs b/compiler/rustc_macros/src/symbols/tests.rs index b32ce60e204ab..9c53453df5b54 100644 --- a/compiler/rustc_macros/src/symbols/tests.rs +++ b/compiler/rustc_macros/src/symbols/tests.rs @@ -94,8 +94,8 @@ fn check_symbol_order() { aardvark, } }; - test_symbols_macro(input, &[ - "Symbol `aardvark` must precede `zebra`", - "location of previous symbol `zebra`", - ]); + test_symbols_macro( + input, + &["Symbol `aardvark` must precede `zebra`", "location of previous symbol `zebra`"], + ); } diff --git a/compiler/rustc_metadata/src/creader.rs b/compiler/rustc_metadata/src/creader.rs index 6bad831279005..c2dda21bb72e6 100644 --- a/compiler/rustc_metadata/src/creader.rs +++ b/compiler/rustc_metadata/src/creader.rs @@ -1213,12 +1213,15 @@ impl<'a, 'tcx> CrateLoader<'a, 'tcx> { let cnum = self.resolve_crate(name, item.span, dep_kind)?; let path_len = definitions.def_path(def_id).data.len(); - self.cstore.update_extern_crate(cnum, ExternCrate { - src: ExternCrateSource::Extern(def_id.to_def_id()), - span: item.span, - path_len, - dependency_of: LOCAL_CRATE, - }); + self.cstore.update_extern_crate( + cnum, + ExternCrate { + src: ExternCrateSource::Extern(def_id.to_def_id()), + span: item.span, + path_len, + dependency_of: LOCAL_CRATE, + }, + ); Some(cnum) } _ => bug!(), @@ -1228,13 +1231,16 @@ impl<'a, 'tcx> CrateLoader<'a, 'tcx> { pub fn process_path_extern(&mut self, name: Symbol, span: Span) -> Option { let cnum = self.resolve_crate(name, span, CrateDepKind::Explicit)?; - self.cstore.update_extern_crate(cnum, ExternCrate { - src: ExternCrateSource::Path, - span, - // to have the least priority in `update_extern_crate` - path_len: usize::MAX, - dependency_of: LOCAL_CRATE, - }); + self.cstore.update_extern_crate( + cnum, + ExternCrate { + src: ExternCrateSource::Path, + span, + // to have the least priority in `update_extern_crate` + path_len: usize::MAX, + dependency_of: LOCAL_CRATE, + }, + ); Some(cnum) } diff --git a/compiler/rustc_middle/src/mir/interpret/allocation.rs b/compiler/rustc_middle/src/mir/interpret/allocation.rs index 2e4d258ffff27..95bc9b71fe0ad 100644 --- a/compiler/rustc_middle/src/mir/interpret/allocation.rs +++ b/compiler/rustc_middle/src/mir/interpret/allocation.rs @@ -317,10 +317,13 @@ impl Allocation { Ok(Allocation { bytes, provenance: ProvenanceMap::new(), - init_mask: InitMask::new(size, match init { - AllocInit::Uninit => false, - AllocInit::Zero => true, - }), + init_mask: InitMask::new( + size, + match init { + AllocInit::Uninit => false, + AllocInit::Zero => true, + }, + ), align, mutability: Mutability::Mut, extra: (), diff --git a/compiler/rustc_middle/src/mir/mod.rs b/compiler/rustc_middle/src/mir/mod.rs index 68d5e5f4dd291..63e20fb0d64e5 100644 --- a/compiler/rustc_middle/src/mir/mod.rs +++ b/compiler/rustc_middle/src/mir/mod.rs @@ -1410,10 +1410,10 @@ impl<'tcx> BasicBlockData<'tcx> { // existing elements from before the gap to the end of the gap. // For now, this is safe code, emulating a gap but initializing it. let mut gap = self.statements.len()..self.statements.len() + extra_stmts; - self.statements.resize(gap.end, Statement { - source_info: SourceInfo::outermost(DUMMY_SP), - kind: StatementKind::Nop, - }); + self.statements.resize( + gap.end, + Statement { source_info: SourceInfo::outermost(DUMMY_SP), kind: StatementKind::Nop }, + ); for (splice_start, new_stmts) in splices.into_iter().rev() { let splice_end = splice_start + new_stmts.size_hint().0; while gap.end > splice_end { diff --git a/compiler/rustc_middle/src/query/on_disk_cache.rs b/compiler/rustc_middle/src/query/on_disk_cache.rs index 957b63584be56..3247bdbf1050c 100644 --- a/compiler/rustc_middle/src/query/on_disk_cache.rs +++ b/compiler/rustc_middle/src/query/on_disk_cache.rs @@ -327,15 +327,18 @@ impl OnDiskCache { // Encode the file footer. let footer_pos = encoder.position() as u64; - encoder.encode_tagged(TAG_FILE_FOOTER, &Footer { - file_index_to_stable_id, - query_result_index, - side_effects_index, - interpret_alloc_index, - syntax_contexts, - expn_data, - foreign_expn_data, - }); + encoder.encode_tagged( + TAG_FILE_FOOTER, + &Footer { + file_index_to_stable_id, + query_result_index, + side_effects_index, + interpret_alloc_index, + syntax_contexts, + expn_data, + foreign_expn_data, + }, + ); // Encode the position of the footer as the last 8 bytes of the // file so we know where to look for it. diff --git a/compiler/rustc_middle/src/ty/context.rs b/compiler/rustc_middle/src/ty/context.rs index 82b4fe193f014..2566081cf5dba 100644 --- a/compiler/rustc_middle/src/ty/context.rs +++ b/compiler/rustc_middle/src/ty/context.rs @@ -1094,10 +1094,13 @@ impl<'tcx> CommonLifetimes<'tcx> { .map(|i| { (0..NUM_PREINTERNED_RE_LATE_BOUNDS_V) .map(|v| { - mk(ty::ReBound(ty::DebruijnIndex::from(i), ty::BoundRegion { - var: ty::BoundVar::from(v), - kind: ty::BoundRegionKind::Anon, - })) + mk(ty::ReBound( + ty::DebruijnIndex::from(i), + ty::BoundRegion { + var: ty::BoundVar::from(v), + kind: ty::BoundRegionKind::Anon, + }, + )) }) .collect() }) @@ -3146,12 +3149,15 @@ impl<'tcx> TyCtxt<'tcx> { } let generics = self.generics_of(new_parent); - return ty::Region::new_early_param(self, ty::EarlyParamRegion { - index: generics - .param_def_id_to_index(self, ebv.to_def_id()) - .expect("early-bound var should be present in fn generics"), - name: self.item_name(ebv.to_def_id()), - }); + return ty::Region::new_early_param( + self, + ty::EarlyParamRegion { + index: generics + .param_def_id_to_index(self, ebv.to_def_id()) + .expect("early-bound var should be present in fn generics"), + name: self.item_name(ebv.to_def_id()), + }, + ); } resolve_bound_vars::ResolvedArg::LateBound(_, _, lbv) => { let new_parent = self.local_parent(lbv); diff --git a/compiler/rustc_middle/src/ty/fold.rs b/compiler/rustc_middle/src/ty/fold.rs index 067516917ef77..4ea4050ed8b1d 100644 --- a/compiler/rustc_middle/src/ty/fold.rs +++ b/compiler/rustc_middle/src/ty/fold.rs @@ -280,21 +280,26 @@ impl<'tcx> TyCtxt<'tcx> { T: TypeFoldable>, { let shift_bv = |bv: ty::BoundVar| ty::BoundVar::from_usize(bv.as_usize() + bound_vars); - self.replace_escaping_bound_vars_uncached(value, FnMutDelegate { - regions: &mut |r: ty::BoundRegion| { - ty::Region::new_bound(self, ty::INNERMOST, ty::BoundRegion { - var: shift_bv(r.var), - kind: r.kind, - }) + self.replace_escaping_bound_vars_uncached( + value, + FnMutDelegate { + regions: &mut |r: ty::BoundRegion| { + ty::Region::new_bound( + self, + ty::INNERMOST, + ty::BoundRegion { var: shift_bv(r.var), kind: r.kind }, + ) + }, + types: &mut |t: ty::BoundTy| { + Ty::new_bound( + self, + ty::INNERMOST, + ty::BoundTy { var: shift_bv(t.var), kind: t.kind }, + ) + }, + consts: &mut |c| ty::Const::new_bound(self, ty::INNERMOST, shift_bv(c)), }, - types: &mut |t: ty::BoundTy| { - Ty::new_bound(self, ty::INNERMOST, ty::BoundTy { - var: shift_bv(t.var), - kind: t.kind, - }) - }, - consts: &mut |c| ty::Const::new_bound(self, ty::INNERMOST, shift_bv(c)), - }) + ) } /// Replaces any late-bound regions bound in `value` with `'erased`. Useful in codegen but also diff --git a/compiler/rustc_middle/src/ty/layout.rs b/compiler/rustc_middle/src/ty/layout.rs index 3ced64b5b8026..e5015ea3c3d1f 100644 --- a/compiler/rustc_middle/src/ty/layout.rs +++ b/compiler/rustc_middle/src/ty/layout.rs @@ -1369,10 +1369,11 @@ pub trait FnAbiOf<'tcx>: FnAbiOfHelpers<'tcx> { // `def_span` unconditionally (which may have a perf penalty). let span = if !span.is_dummy() { span } else { tcx.def_span(instance.def_id()) }; - self.handle_fn_abi_err(*err, span, FnAbiRequest::OfInstance { - instance, - extra_args, - }) + self.handle_fn_abi_err( + *err, + span, + FnAbiRequest::OfInstance { instance, extra_args }, + ) }), ) } diff --git a/compiler/rustc_middle/src/ty/util.rs b/compiler/rustc_middle/src/ty/util.rs index 398ed57faeb4e..94bd359f6eb0f 100644 --- a/compiler/rustc_middle/src/ty/util.rs +++ b/compiler/rustc_middle/src/ty/util.rs @@ -759,10 +759,11 @@ impl<'tcx> TyCtxt<'tcx> { assert_eq!(re, self.lifetimes.re_erased); let var = ty::BoundVar::from_usize(vars.len()); vars.push(ty::BoundVariableKind::Region(ty::BoundRegionKind::Anon)); - ty::Region::new_bound(self, debruijn, ty::BoundRegion { - var, - kind: ty::BoundRegionKind::Anon, - }) + ty::Region::new_bound( + self, + debruijn, + ty::BoundRegion { var, kind: ty::BoundRegionKind::Anon }, + ) }); ty::EarlyBinder::bind(ty::Binder::bind_with_vars( ty, diff --git a/compiler/rustc_mir_build/src/builder/cfg.rs b/compiler/rustc_mir_build/src/builder/cfg.rs index 42212f2518b0a..082cdc2e2a49e 100644 --- a/compiler/rustc_mir_build/src/builder/cfg.rs +++ b/compiler/rustc_mir_build/src/builder/cfg.rs @@ -40,10 +40,10 @@ impl<'tcx> CFG<'tcx> { place: Place<'tcx>, rvalue: Rvalue<'tcx>, ) { - self.push(block, Statement { - source_info, - kind: StatementKind::Assign(Box::new((place, rvalue))), - }); + self.push( + block, + Statement { source_info, kind: StatementKind::Assign(Box::new((place, rvalue))) }, + ); } pub(crate) fn push_assign_constant( diff --git a/compiler/rustc_mir_build/src/builder/expr/as_place.rs b/compiler/rustc_mir_build/src/builder/expr/as_place.rs index 482f1e3840b14..308ca442b40cc 100644 --- a/compiler/rustc_mir_build/src/builder/expr/as_place.rs +++ b/compiler/rustc_mir_build/src/builder/expr/as_place.rs @@ -484,16 +484,19 @@ impl<'a, 'tcx> Builder<'a, 'tcx> { }); let place = place_builder.to_place(this); - this.cfg.push(block, Statement { - source_info: ty_source_info, - kind: StatementKind::AscribeUserType( - Box::new((place, UserTypeProjection { - base: annotation_index, - projs: vec![], - })), - Variance::Invariant, - ), - }); + this.cfg.push( + block, + Statement { + source_info: ty_source_info, + kind: StatementKind::AscribeUserType( + Box::new(( + place, + UserTypeProjection { base: annotation_index, projs: vec![] }, + )), + Variance::Invariant, + ), + }, + ); } block.and(place_builder) } @@ -510,16 +513,19 @@ impl<'a, 'tcx> Builder<'a, 'tcx> { user_ty: user_ty.clone(), inferred_ty: expr.ty, }); - this.cfg.push(block, Statement { - source_info: ty_source_info, - kind: StatementKind::AscribeUserType( - Box::new((Place::from(temp), UserTypeProjection { - base: annotation_index, - projs: vec![], - })), - Variance::Invariant, - ), - }); + this.cfg.push( + block, + Statement { + source_info: ty_source_info, + kind: StatementKind::AscribeUserType( + Box::new(( + Place::from(temp), + UserTypeProjection { base: annotation_index, projs: vec![] }, + )), + Variance::Invariant, + ), + }, + ); } block.and(PlaceBuilder::from(temp)) } diff --git a/compiler/rustc_mir_build/src/builder/expr/as_rvalue.rs b/compiler/rustc_mir_build/src/builder/expr/as_rvalue.rs index e7713f0a1d63b..2c9a1de7f9978 100644 --- a/compiler/rustc_mir_build/src/builder/expr/as_rvalue.rs +++ b/compiler/rustc_mir_build/src/builder/expr/as_rvalue.rs @@ -151,19 +151,23 @@ impl<'a, 'tcx> Builder<'a, 'tcx> { ); let storage = this.temp(Ty::new_mut_ptr(tcx, tcx.types.u8), expr_span); let success = this.cfg.start_new_block(); - this.cfg.terminate(block, source_info, TerminatorKind::Call { - func: exchange_malloc, - args: [Spanned { node: Operand::Move(size), span: DUMMY_SP }, Spanned { - node: Operand::Move(align), - span: DUMMY_SP, - }] - .into(), - destination: storage, - target: Some(success), - unwind: UnwindAction::Continue, - call_source: CallSource::Misc, - fn_span: expr_span, - }); + this.cfg.terminate( + block, + source_info, + TerminatorKind::Call { + func: exchange_malloc, + args: [ + Spanned { node: Operand::Move(size), span: DUMMY_SP }, + Spanned { node: Operand::Move(align), span: DUMMY_SP }, + ] + .into(), + destination: storage, + target: Some(success), + unwind: UnwindAction::Continue, + call_source: CallSource::Misc, + fn_span: expr_span, + }, + ); this.diverge_from(block); block = success; @@ -171,10 +175,10 @@ impl<'a, 'tcx> Builder<'a, 'tcx> { // and therefore is not considered during coroutine auto-trait // determination. See the comment about `box` at `yield_in_scope`. let result = this.local_decls.push(LocalDecl::new(expr.ty, expr_span)); - this.cfg.push(block, Statement { - source_info, - kind: StatementKind::StorageLive(result), - }); + this.cfg.push( + block, + Statement { source_info, kind: StatementKind::StorageLive(result) }, + ); if let Some(scope) = scope.temp_lifetime { // schedule a shallow free of that memory, lest we unwind: this.schedule_drop_storage_and_value(expr_span, scope, result); @@ -272,12 +276,15 @@ impl<'a, 'tcx> Builder<'a, 'tcx> { ); merge_place }; - this.cfg.push(block, Statement { - source_info, - kind: StatementKind::Intrinsic(Box::new( - NonDivergingIntrinsic::Assume(Operand::Move(assert_place)), - )), - }); + this.cfg.push( + block, + Statement { + source_info, + kind: StatementKind::Intrinsic(Box::new( + NonDivergingIntrinsic::Assume(Operand::Move(assert_place)), + )), + }, + ); } (op, ty) @@ -739,12 +746,16 @@ impl<'a, 'tcx> Builder<'a, 'tcx> { ); if let Operand::Move(to_drop) = value_operand { let success = this.cfg.start_new_block(); - this.cfg.terminate(block, outer_source_info, TerminatorKind::Drop { - place: to_drop, - target: success, - unwind: UnwindAction::Continue, - replace: false, - }); + this.cfg.terminate( + block, + outer_source_info, + TerminatorKind::Drop { + place: to_drop, + target: success, + unwind: UnwindAction::Continue, + replace: false, + }, + ); this.diverge_from(block); block = success; } diff --git a/compiler/rustc_mir_build/src/builder/expr/into.rs b/compiler/rustc_mir_build/src/builder/expr/into.rs index b25cd0f4426bd..65dd061003d8d 100644 --- a/compiler/rustc_mir_build/src/builder/expr/into.rs +++ b/compiler/rustc_mir_build/src/builder/expr/into.rs @@ -220,10 +220,14 @@ impl<'a, 'tcx> Builder<'a, 'tcx> { this.in_breakable_scope(Some(loop_block), destination, expr_span, move |this| { // conduct the test, if necessary let body_block = this.cfg.start_new_block(); - this.cfg.terminate(loop_block, source_info, TerminatorKind::FalseUnwind { - real_target: body_block, - unwind: UnwindAction::Continue, - }); + this.cfg.terminate( + loop_block, + source_info, + TerminatorKind::FalseUnwind { + real_target: body_block, + unwind: UnwindAction::Continue, + }, + ); this.diverge_from(loop_block); // The “return” value of the loop body must always be a unit. We therefore @@ -254,30 +258,34 @@ impl<'a, 'tcx> Builder<'a, 'tcx> { debug!("expr_into_dest: fn_span={:?}", fn_span); - this.cfg.terminate(block, source_info, TerminatorKind::Call { - func: fun, - args, - unwind: UnwindAction::Continue, - destination, - // The presence or absence of a return edge affects control-flow sensitive - // MIR checks and ultimately whether code is accepted or not. We can only - // omit the return edge if a return type is visibly uninhabited to a module - // that makes the call. - target: expr - .ty - .is_inhabited_from( - this.tcx, - this.parent_module, - this.infcx.typing_env(this.param_env), - ) - .then_some(success), - call_source: if from_hir_call { - CallSource::Normal - } else { - CallSource::OverloadedOperator + this.cfg.terminate( + block, + source_info, + TerminatorKind::Call { + func: fun, + args, + unwind: UnwindAction::Continue, + destination, + // The presence or absence of a return edge affects control-flow sensitive + // MIR checks and ultimately whether code is accepted or not. We can only + // omit the return edge if a return type is visibly uninhabited to a module + // that makes the call. + target: expr + .ty + .is_inhabited_from( + this.tcx, + this.parent_module, + this.infcx.typing_env(this.param_env), + ) + .then_some(success), + call_source: if from_hir_call { + CallSource::Normal + } else { + CallSource::OverloadedOperator + }, + fn_span, }, - fn_span, - }); + ); this.diverge_from(block); success.unit() } @@ -494,9 +502,11 @@ impl<'a, 'tcx> Builder<'a, 'tcx> { let tmp = this.get_unit_temp(); let target = this.ast_block(tmp, target, block, source_info).into_block(); - this.cfg.terminate(target, source_info, TerminatorKind::Goto { - target: destination_block, - }); + this.cfg.terminate( + target, + source_info, + TerminatorKind::Goto { target: destination_block }, + ); mir::InlineAsmOperand::Label { target_index } } @@ -515,19 +525,23 @@ impl<'a, 'tcx> Builder<'a, 'tcx> { AsmMacro::NakedAsm => InlineAsmMacro::NakedAsm, }; - this.cfg.terminate(block, source_info, TerminatorKind::InlineAsm { - asm_macro, - template, - operands, - options, - line_spans, - targets: targets.into_boxed_slice(), - unwind: if options.contains(InlineAsmOptions::MAY_UNWIND) { - UnwindAction::Continue - } else { - UnwindAction::Unreachable + this.cfg.terminate( + block, + source_info, + TerminatorKind::InlineAsm { + asm_macro, + template, + operands, + options, + line_spans, + targets: targets.into_boxed_slice(), + unwind: if options.contains(InlineAsmOptions::MAY_UNWIND) { + UnwindAction::Continue + } else { + UnwindAction::Unreachable + }, }, - }); + ); if options.contains(InlineAsmOptions::MAY_UNWIND) { this.diverge_from(block); } @@ -587,12 +601,11 @@ impl<'a, 'tcx> Builder<'a, 'tcx> { this.as_operand(block, scope, value, LocalInfo::Boring, NeedsTemporary::No) ); let resume = this.cfg.start_new_block(); - this.cfg.terminate(block, source_info, TerminatorKind::Yield { - value, - resume, - resume_arg: destination, - drop: None, - }); + this.cfg.terminate( + block, + source_info, + TerminatorKind::Yield { value, resume, resume_arg: destination, drop: None }, + ); this.coroutine_drop_cleanup(block); resume.unit() } diff --git a/compiler/rustc_mir_build/src/builder/expr/stmt.rs b/compiler/rustc_mir_build/src/builder/expr/stmt.rs index 4ae3536d9c24b..58090d3748b46 100644 --- a/compiler/rustc_mir_build/src/builder/expr/stmt.rs +++ b/compiler/rustc_mir_build/src/builder/expr/stmt.rs @@ -123,11 +123,11 @@ impl<'a, 'tcx> Builder<'a, 'tcx> { unpack!(block = this.break_for_tail_call(block, &args, source_info)); - this.cfg.terminate(block, source_info, TerminatorKind::TailCall { - func: fun, - args, - fn_span, - }); + this.cfg.terminate( + block, + source_info, + TerminatorKind::TailCall { func: fun, args, fn_span }, + ); this.cfg.start_new_block().unit() }) diff --git a/compiler/rustc_mir_build/src/builder/matches/match_pair.rs b/compiler/rustc_mir_build/src/builder/matches/match_pair.rs index bca57817d6617..ee331713736e7 100644 --- a/compiler/rustc_mir_build/src/builder/matches/match_pair.rs +++ b/compiler/rustc_mir_build/src/builder/matches/match_pair.rs @@ -173,10 +173,13 @@ impl<'tcx> MatchPairTree<'tcx> { let ascription = place.map(|source| { let span = pattern.span; let parent_id = cx.tcx.typeck_root_def_id(cx.def_id.to_def_id()); - let args = ty::InlineConstArgs::new(cx.tcx, ty::InlineConstArgsParts { - parent_args: ty::GenericArgs::identity_for_item(cx.tcx, parent_id), - ty: cx.infcx.next_ty_var(span), - }) + let args = ty::InlineConstArgs::new( + cx.tcx, + ty::InlineConstArgsParts { + parent_args: ty::GenericArgs::identity_for_item(cx.tcx, parent_id), + ty: cx.infcx.next_ty_var(span), + }, + ) .args; let user_ty = cx.infcx.canonicalize_user_type_annotation(ty::UserType::new( ty::UserTypeKind::TypeOf(def_id, ty::UserArgs { args, user_self_ty: None }), diff --git a/compiler/rustc_mir_build/src/builder/matches/mod.rs b/compiler/rustc_mir_build/src/builder/matches/mod.rs index a2f92a93ec544..ed577f7adeb3d 100644 --- a/compiler/rustc_mir_build/src/builder/matches/mod.rs +++ b/compiler/rustc_mir_build/src/builder/matches/mod.rs @@ -104,11 +104,11 @@ impl<'a, 'tcx> Builder<'a, 'tcx> { variable_source_info: SourceInfo, declare_let_bindings: DeclareLetBindings, ) -> BlockAnd<()> { - self.then_else_break_inner(block, expr_id, ThenElseArgs { - temp_scope_override, - variable_source_info, - declare_let_bindings, - }) + self.then_else_break_inner( + block, + expr_id, + ThenElseArgs { temp_scope_override, variable_source_info, declare_let_bindings }, + ) } fn then_else_break_inner( @@ -134,16 +134,24 @@ impl<'a, 'tcx> Builder<'a, 'tcx> { let local_scope = this.local_scope(); let (lhs_success_block, failure_block) = this.in_if_then_scope(local_scope, expr_span, |this| { - this.then_else_break_inner(block, lhs, ThenElseArgs { - declare_let_bindings: DeclareLetBindings::LetNotPermitted, - ..args - }) + this.then_else_break_inner( + block, + lhs, + ThenElseArgs { + declare_let_bindings: DeclareLetBindings::LetNotPermitted, + ..args + }, + ) }); let rhs_success_block = this - .then_else_break_inner(failure_block, rhs, ThenElseArgs { - declare_let_bindings: DeclareLetBindings::LetNotPermitted, - ..args - }) + .then_else_break_inner( + failure_block, + rhs, + ThenElseArgs { + declare_let_bindings: DeclareLetBindings::LetNotPermitted, + ..args + }, + ) .into_block(); // Make the LHS and RHS success arms converge to a common block. @@ -170,10 +178,14 @@ impl<'a, 'tcx> Builder<'a, 'tcx> { if this.tcx.sess.instrument_coverage() { this.cfg.push_coverage_span_marker(block, this.source_info(expr_span)); } - this.then_else_break_inner(block, arg, ThenElseArgs { - declare_let_bindings: DeclareLetBindings::LetNotPermitted, - ..args - }) + this.then_else_break_inner( + block, + arg, + ThenElseArgs { + declare_let_bindings: DeclareLetBindings::LetNotPermitted, + ..args + }, + ) }); this.break_for_else(success_block, args.variable_source_info); failure_block.unit() @@ -629,27 +641,30 @@ impl<'a, 'tcx> Builder<'a, 'tcx> { let ty_source_info = self.source_info(annotation.span); let base = self.canonical_user_type_annotations.push(annotation.clone()); - self.cfg.push(block, Statement { - source_info: ty_source_info, - kind: StatementKind::AscribeUserType( - Box::new((place, UserTypeProjection { base, projs: Vec::new() })), - // We always use invariant as the variance here. This is because the - // variance field from the ascription refers to the variance to use - // when applying the type to the value being matched, but this - // ascription applies rather to the type of the binding. e.g., in this - // example: - // - // ``` - // let x: T = - // ``` - // - // We are creating an ascription that defines the type of `x` to be - // exactly `T` (i.e., with invariance). The variance field, in - // contrast, is intended to be used to relate `T` to the type of - // ``. - ty::Invariant, - ), - }); + self.cfg.push( + block, + Statement { + source_info: ty_source_info, + kind: StatementKind::AscribeUserType( + Box::new((place, UserTypeProjection { base, projs: Vec::new() })), + // We always use invariant as the variance here. This is because the + // variance field from the ascription refers to the variance to use + // when applying the type to the value being matched, but this + // ascription applies rather to the type of the binding. e.g., in this + // example: + // + // ``` + // let x: T = + // ``` + // + // We are creating an ascription that defines the type of `x` to be + // exactly `T` (i.e., with invariance). The variance field, in + // contrast, is intended to be used to relate `T` to the type of + // ``. + ty::Invariant, + ), + }, + ); self.schedule_drop_for_binding(var, irrefutable_pat.span, OutsideGuard); block.unit() @@ -2549,13 +2564,19 @@ impl<'a, 'tcx> Builder<'a, 'tcx> { let source_info = self.source_info(ascription.annotation.span); let base = self.canonical_user_type_annotations.push(ascription.annotation); - self.cfg.push(block, Statement { - source_info, - kind: StatementKind::AscribeUserType( - Box::new((ascription.source, UserTypeProjection { base, projs: Vec::new() })), - ascription.variance, - ), - }); + self.cfg.push( + block, + Statement { + source_info, + kind: StatementKind::AscribeUserType( + Box::new(( + ascription.source, + UserTypeProjection { base, projs: Vec::new() }, + )), + ascription.variance, + ), + }, + ); } } diff --git a/compiler/rustc_mir_build/src/builder/matches/test.rs b/compiler/rustc_mir_build/src/builder/matches/test.rs index 834f8be0d007a..a7a028bff97f7 100644 --- a/compiler/rustc_mir_build/src/builder/matches/test.rs +++ b/compiler/rustc_mir_build/src/builder/matches/test.rs @@ -327,15 +327,23 @@ impl<'a, 'tcx> Builder<'a, 'tcx> { ); // `let temp = ::deref(ref_src);` // or `let temp = ::deref_mut(ref_src);` - self.cfg.terminate(block, source_info, TerminatorKind::Call { - func: Operand::Constant(Box::new(ConstOperand { span, user_ty: None, const_: method })), - args: [Spanned { node: Operand::Move(ref_src), span }].into(), - destination: temp, - target: Some(target_block), - unwind: UnwindAction::Continue, - call_source: CallSource::Misc, - fn_span: source_info.span, - }); + self.cfg.terminate( + block, + source_info, + TerminatorKind::Call { + func: Operand::Constant(Box::new(ConstOperand { + span, + user_ty: None, + const_: method, + })), + args: [Spanned { node: Operand::Move(ref_src), span }].into(), + destination: temp, + target: Some(target_block), + unwind: UnwindAction::Continue, + call_source: CallSource::Misc, + fn_span: source_info.span, + }, + ); } /// Compare using the provided built-in comparison operator @@ -463,26 +471,33 @@ impl<'a, 'tcx> Builder<'a, 'tcx> { let bool_ty = self.tcx.types.bool; let eq_result = self.temp(bool_ty, source_info.span); let eq_block = self.cfg.start_new_block(); - self.cfg.terminate(block, source_info, TerminatorKind::Call { - func: Operand::Constant(Box::new(ConstOperand { - span: source_info.span, - - // FIXME(#54571): This constant comes from user input (a - // constant in a pattern). Are there forms where users can add - // type annotations here? For example, an associated constant? - // Need to experiment. - user_ty: None, - - const_: method, - })), - args: [Spanned { node: val, span: DUMMY_SP }, Spanned { node: expect, span: DUMMY_SP }] + self.cfg.terminate( + block, + source_info, + TerminatorKind::Call { + func: Operand::Constant(Box::new(ConstOperand { + span: source_info.span, + + // FIXME(#54571): This constant comes from user input (a + // constant in a pattern). Are there forms where users can add + // type annotations here? For example, an associated constant? + // Need to experiment. + user_ty: None, + + const_: method, + })), + args: [ + Spanned { node: val, span: DUMMY_SP }, + Spanned { node: expect, span: DUMMY_SP }, + ] .into(), - destination: eq_result, - target: Some(eq_block), - unwind: UnwindAction::Continue, - call_source: CallSource::MatchCmp, - fn_span: source_info.span, - }); + destination: eq_result, + target: Some(eq_block), + unwind: UnwindAction::Continue, + call_source: CallSource::MatchCmp, + fn_span: source_info.span, + }, + ); self.diverge_from(block); // check the result diff --git a/compiler/rustc_mir_build/src/builder/matches/util.rs b/compiler/rustc_mir_build/src/builder/matches/util.rs index 83e79572b2a8e..589e350a03fc3 100644 --- a/compiler/rustc_mir_build/src/builder/matches/util.rs +++ b/compiler/rustc_mir_build/src/builder/matches/util.rs @@ -20,10 +20,11 @@ impl<'a, 'tcx> Builder<'a, 'tcx> { source_info: SourceInfo, ) { if imaginary_target != real_target { - self.cfg.terminate(from_block, source_info, TerminatorKind::FalseEdge { - real_target, - imaginary_target, - }); + self.cfg.terminate( + from_block, + source_info, + TerminatorKind::FalseEdge { real_target, imaginary_target }, + ); } else { self.cfg.goto(from_block, source_info, real_target) } diff --git a/compiler/rustc_mir_build/src/builder/misc.rs b/compiler/rustc_mir_build/src/builder/misc.rs index 9ea56a9574fde..6e8e74fd4fc8d 100644 --- a/compiler/rustc_mir_build/src/builder/misc.rs +++ b/compiler/rustc_mir_build/src/builder/misc.rs @@ -45,11 +45,16 @@ impl<'a, 'tcx> Builder<'a, 'tcx> { ) -> Place<'tcx> { let usize_ty = self.tcx.types.usize; let temp = self.temp(usize_ty, source_info.span); - self.cfg.push_assign_constant(block, source_info, temp, ConstOperand { - span: source_info.span, - user_ty: None, - const_: Const::from_usize(self.tcx, value), - }); + self.cfg.push_assign_constant( + block, + source_info, + temp, + ConstOperand { + span: source_info.span, + user_ty: None, + const_: Const::from_usize(self.tcx, value), + }, + ); temp } diff --git a/compiler/rustc_mir_build/src/builder/scope.rs b/compiler/rustc_mir_build/src/builder/scope.rs index 945f02821d999..d3551ea3a97b4 100644 --- a/compiler/rustc_mir_build/src/builder/scope.rs +++ b/compiler/rustc_mir_build/src/builder/scope.rs @@ -532,12 +532,16 @@ impl<'a, 'tcx> Builder<'a, 'tcx> { (Some(normal_block), Some(exit_block)) => { let target = self.cfg.start_new_block(); let source_info = self.source_info(span); - self.cfg.terminate(normal_block.into_block(), source_info, TerminatorKind::Goto { - target, - }); - self.cfg.terminate(exit_block.into_block(), source_info, TerminatorKind::Goto { - target, - }); + self.cfg.terminate( + normal_block.into_block(), + source_info, + TerminatorKind::Goto { target }, + ); + self.cfg.terminate( + exit_block.into_block(), + source_info, + TerminatorKind::Goto { target }, + ); target.unit() } } @@ -833,30 +837,37 @@ impl<'a, 'tcx> Builder<'a, 'tcx> { unwind_drops.add_entry_point(block, unwind_entry_point); let next = self.cfg.start_new_block(); - self.cfg.terminate(block, source_info, TerminatorKind::Drop { - place: local.into(), - target: next, - unwind: UnwindAction::Continue, - replace: false, - }); + self.cfg.terminate( + block, + source_info, + TerminatorKind::Drop { + place: local.into(), + target: next, + unwind: UnwindAction::Continue, + replace: false, + }, + ); block = next; } DropKind::ForLint => { - self.cfg.push(block, Statement { - source_info, - kind: StatementKind::BackwardIncompatibleDropHint { - place: Box::new(local.into()), - reason: BackwardIncompatibleDropReason::Edition2024, + self.cfg.push( + block, + Statement { + source_info, + kind: StatementKind::BackwardIncompatibleDropHint { + place: Box::new(local.into()), + reason: BackwardIncompatibleDropReason::Edition2024, + }, }, - }); + ); } DropKind::Storage => { // Only temps and vars need their storage dead. assert!(local.index() > self.arg_count); - self.cfg.push(block, Statement { - source_info, - kind: StatementKind::StorageDead(local), - }); + self.cfg.push( + block, + Statement { source_info, kind: StatementKind::StorageDead(local) }, + ); } } } @@ -1350,12 +1361,16 @@ impl<'a, 'tcx> Builder<'a, 'tcx> { let assign_unwind = self.cfg.start_new_cleanup_block(); self.cfg.push_assign(assign_unwind, source_info, place, value.clone()); - self.cfg.terminate(block, source_info, TerminatorKind::Drop { - place, - target: assign, - unwind: UnwindAction::Cleanup(assign_unwind), - replace: true, - }); + self.cfg.terminate( + block, + source_info, + TerminatorKind::Drop { + place, + target: assign, + unwind: UnwindAction::Cleanup(assign_unwind), + replace: true, + }, + ); self.diverge_from(block); assign.unit() @@ -1375,13 +1390,17 @@ impl<'a, 'tcx> Builder<'a, 'tcx> { let source_info = self.source_info(span); let success_block = self.cfg.start_new_block(); - self.cfg.terminate(block, source_info, TerminatorKind::Assert { - cond, - expected, - msg: Box::new(msg), - target: success_block, - unwind: UnwindAction::Continue, - }); + self.cfg.terminate( + block, + source_info, + TerminatorKind::Assert { + cond, + expected, + msg: Box::new(msg), + target: success_block, + unwind: UnwindAction::Continue, + }, + ); self.diverge_from(block); success_block @@ -1481,12 +1500,16 @@ fn build_scope_drops<'tcx>( unwind_drops.add_entry_point(block, unwind_to); let next = cfg.start_new_block(); - cfg.terminate(block, source_info, TerminatorKind::Drop { - place: local.into(), - target: next, - unwind: UnwindAction::Continue, - replace: false, - }); + cfg.terminate( + block, + source_info, + TerminatorKind::Drop { + place: local.into(), + target: next, + unwind: UnwindAction::Continue, + replace: false, + }, + ); block = next; } DropKind::ForLint => { @@ -1509,13 +1532,16 @@ fn build_scope_drops<'tcx>( continue; } - cfg.push(block, Statement { - source_info, - kind: StatementKind::BackwardIncompatibleDropHint { - place: Box::new(local.into()), - reason: BackwardIncompatibleDropReason::Edition2024, + cfg.push( + block, + Statement { + source_info, + kind: StatementKind::BackwardIncompatibleDropHint { + place: Box::new(local.into()), + reason: BackwardIncompatibleDropReason::Edition2024, + }, }, - }); + ); } DropKind::Storage => { // Ordinarily, storage-dead nodes are not emitted on unwind, so we don't diff --git a/compiler/rustc_mir_build/src/check_unsafety.rs b/compiler/rustc_mir_build/src/check_unsafety.rs index b6494173b0f08..2b9b948763f95 100644 --- a/compiler/rustc_mir_build/src/check_unsafety.rs +++ b/compiler/rustc_mir_build/src/check_unsafety.rs @@ -525,11 +525,10 @@ impl<'a, 'tcx> Visitor<'a, 'tcx> for UnsafetyVisitor<'a, 'tcx> { .copied() .filter(|feature| missing.contains(feature)) .collect(); - self.requires_unsafe(expr.span, CallToFunctionWith { - function: func_did, - missing, - build_enabled, - }); + self.requires_unsafe( + expr.span, + CallToFunctionWith { function: func_did, missing, build_enabled }, + ); } } } @@ -1186,9 +1185,11 @@ pub(crate) fn check_unsafety(tcx: TyCtxt<'_>, def: LocalDefId) { warnings.sort_by_key(|w| w.block_span); for UnusedUnsafeWarning { hir_id, block_span, enclosing_unsafe } in warnings { let block_span = tcx.sess.source_map().guess_head_span(block_span); - tcx.emit_node_span_lint(UNUSED_UNSAFE, hir_id, block_span, UnusedUnsafe { - span: block_span, - enclosing: enclosing_unsafe, - }); + tcx.emit_node_span_lint( + UNUSED_UNSAFE, + hir_id, + block_span, + UnusedUnsafe { span: block_span, enclosing: enclosing_unsafe }, + ); } } diff --git a/compiler/rustc_mir_build/src/thir/cx/mod.rs b/compiler/rustc_mir_build/src/thir/cx/mod.rs index 9d114e6755931..a01609012b8f1 100644 --- a/compiler/rustc_mir_build/src/thir/cx/mod.rs +++ b/compiler/rustc_mir_build/src/thir/cx/mod.rs @@ -186,11 +186,9 @@ impl<'tcx> ThirBuildCx<'tcx> { let ty = if fn_decl.c_variadic && index == fn_decl.inputs.len() { let va_list_did = self.tcx.require_lang_item(LangItem::VaList, Some(param.span)); - self.tcx.type_of(va_list_did).instantiate(self.tcx, &[self - .tcx - .lifetimes - .re_erased - .into()]) + self.tcx + .type_of(va_list_did) + .instantiate(self.tcx, &[self.tcx.lifetimes.re_erased.into()]) } else { fn_sig.inputs()[index] }; diff --git a/compiler/rustc_mir_dataflow/src/elaborate_drops.rs b/compiler/rustc_mir_dataflow/src/elaborate_drops.rs index 74b0e84068c67..c1c47ecccf302 100644 --- a/compiler/rustc_mir_dataflow/src/elaborate_drops.rs +++ b/compiler/rustc_mir_dataflow/src/elaborate_drops.rs @@ -233,12 +233,15 @@ where .patch_terminator(bb, TerminatorKind::Goto { target: self.succ }); } DropStyle::Static => { - self.elaborator.patch().patch_terminator(bb, TerminatorKind::Drop { - place: self.place, - target: self.succ, - unwind: self.unwind.into_action(), - replace: false, - }); + self.elaborator.patch().patch_terminator( + bb, + TerminatorKind::Drop { + place: self.place, + target: self.succ, + unwind: self.unwind.into_action(), + replace: false, + }, + ); } DropStyle::Conditional => { let drop_bb = self.complete_drop(self.succ, self.unwind); @@ -729,12 +732,15 @@ where }; let loop_block = self.elaborator.patch().new_block(loop_block); - self.elaborator.patch().patch_terminator(drop_block, TerminatorKind::Drop { - place: tcx.mk_place_deref(ptr), - target: loop_block, - unwind: unwind.into_action(), - replace: false, - }); + self.elaborator.patch().patch_terminator( + drop_block, + TerminatorKind::Drop { + place: tcx.mk_place_deref(ptr), + target: loop_block, + unwind: unwind.into_action(), + replace: false, + }, + ); loop_block } diff --git a/compiler/rustc_mir_dataflow/src/framework/direction.rs b/compiler/rustc_mir_dataflow/src/framework/direction.rs index 6427fd0fd295b..07517d7edab01 100644 --- a/compiler/rustc_mir_dataflow/src/framework/direction.rs +++ b/compiler/rustc_mir_dataflow/src/framework/direction.rs @@ -305,10 +305,11 @@ impl Direction for Forward { // `exit_state`, so pass it directly to `apply_switch_int_edge_effect` to save // a clone of the dataflow state. let otherwise = targets.otherwise(); - analysis.apply_switch_int_edge_effect(&mut data, exit_state, SwitchIntTarget { - value: None, - target: otherwise, - }); + analysis.apply_switch_int_edge_effect( + &mut data, + exit_state, + SwitchIntTarget { value: None, target: otherwise }, + ); propagate(otherwise, exit_state); } else { for target in targets.all_targets() { diff --git a/compiler/rustc_mir_dataflow/src/framework/graphviz.rs b/compiler/rustc_mir_dataflow/src/framework/graphviz.rs index 9ccabb46c6332..448fad2dc3ece 100644 --- a/compiler/rustc_mir_dataflow/src/framework/graphviz.rs +++ b/compiler/rustc_mir_dataflow/src/framework/graphviz.rs @@ -670,10 +670,10 @@ where r#"{state}"#, colspan = this.style.num_state_columns(), fmt = fmt, - state = dot::escape_html(&format!("{:?}", DebugWithAdapter { - this: state, - ctxt: analysis - })), + state = dot::escape_html(&format!( + "{:?}", + DebugWithAdapter { this: state, ctxt: analysis } + )), ) }) } diff --git a/compiler/rustc_mir_dataflow/src/framework/tests.rs b/compiler/rustc_mir_dataflow/src/framework/tests.rs index 5b3a9ccba695d..ae0f1179e6fac 100644 --- a/compiler/rustc_mir_dataflow/src/framework/tests.rs +++ b/compiler/rustc_mir_dataflow/src/framework/tests.rs @@ -30,26 +30,32 @@ fn mock_body<'tcx>() -> mir::Body<'tcx> { block(4, mir::TerminatorKind::Return); block(1, mir::TerminatorKind::Return); - block(2, mir::TerminatorKind::Call { - func: mir::Operand::Copy(dummy_place.clone()), - args: [].into(), - destination: dummy_place.clone(), - target: Some(mir::START_BLOCK), - unwind: mir::UnwindAction::Continue, - call_source: mir::CallSource::Misc, - fn_span: DUMMY_SP, - }); + block( + 2, + mir::TerminatorKind::Call { + func: mir::Operand::Copy(dummy_place.clone()), + args: [].into(), + destination: dummy_place.clone(), + target: Some(mir::START_BLOCK), + unwind: mir::UnwindAction::Continue, + call_source: mir::CallSource::Misc, + fn_span: DUMMY_SP, + }, + ); block(3, mir::TerminatorKind::Return); block(0, mir::TerminatorKind::Return); - block(4, mir::TerminatorKind::Call { - func: mir::Operand::Copy(dummy_place.clone()), - args: [].into(), - destination: dummy_place.clone(), - target: Some(mir::START_BLOCK), - unwind: mir::UnwindAction::Continue, - call_source: mir::CallSource::Misc, - fn_span: DUMMY_SP, - }); + block( + 4, + mir::TerminatorKind::Call { + func: mir::Operand::Copy(dummy_place.clone()), + args: [].into(), + destination: dummy_place.clone(), + target: Some(mir::START_BLOCK), + unwind: mir::UnwindAction::Continue, + call_source: mir::CallSource::Misc, + fn_span: DUMMY_SP, + }, + ); mir::Body::new_cfg_only(blocks) } diff --git a/compiler/rustc_mir_transform/src/add_moves_for_packed_drops.rs b/compiler/rustc_mir_transform/src/add_moves_for_packed_drops.rs index 87ae2b7165434..8716fd1c098e3 100644 --- a/compiler/rustc_mir_transform/src/add_moves_for_packed_drops.rs +++ b/compiler/rustc_mir_transform/src/add_moves_for_packed_drops.rs @@ -99,10 +99,13 @@ fn add_move_for_packed_drop<'tcx>( patch.add_statement(loc, StatementKind::StorageLive(temp)); patch.add_assign(loc, Place::from(temp), Rvalue::Use(Operand::Move(*place))); - patch.patch_terminator(loc.block, TerminatorKind::Drop { - place: Place::from(temp), - target: storage_dead_block, - unwind, - replace, - }); + patch.patch_terminator( + loc.block, + TerminatorKind::Drop { + place: Place::from(temp), + target: storage_dead_block, + unwind, + replace, + }, + ); } diff --git a/compiler/rustc_mir_transform/src/add_retag.rs b/compiler/rustc_mir_transform/src/add_retag.rs index 1fc788a2dadeb..e5a28d1b66c8c 100644 --- a/compiler/rustc_mir_transform/src/add_retag.rs +++ b/compiler/rustc_mir_transform/src/add_retag.rs @@ -111,10 +111,13 @@ impl<'tcx> crate::MirPass<'tcx> for AddRetag { .collect::>(); // Now we go over the returns we collected to retag the return values. for (source_info, dest_place, dest_block) in returns { - basic_blocks[dest_block].statements.insert(0, Statement { - source_info, - kind: StatementKind::Retag(RetagKind::Default, Box::new(dest_place)), - }); + basic_blocks[dest_block].statements.insert( + 0, + Statement { + source_info, + kind: StatementKind::Retag(RetagKind::Default, Box::new(dest_place)), + }, + ); } // PART 3 @@ -169,10 +172,13 @@ impl<'tcx> crate::MirPass<'tcx> for AddRetag { }; // Insert a retag after the statement. let source_info = block_data.statements[i].source_info; - block_data.statements.insert(i + 1, Statement { - source_info, - kind: StatementKind::Retag(retag_kind, Box::new(place)), - }); + block_data.statements.insert( + i + 1, + Statement { + source_info, + kind: StatementKind::Retag(retag_kind, Box::new(place)), + }, + ); } } } diff --git a/compiler/rustc_mir_transform/src/check_call_recursion.rs b/compiler/rustc_mir_transform/src/check_call_recursion.rs index 51fd3c6512e4d..e49723a6c39db 100644 --- a/compiler/rustc_mir_transform/src/check_call_recursion.rs +++ b/compiler/rustc_mir_transform/src/check_call_recursion.rs @@ -83,10 +83,12 @@ fn check_recursion<'tcx>( let sp = tcx.def_span(def_id); let hir_id = tcx.local_def_id_to_hir_id(def_id); - tcx.emit_node_span_lint(UNCONDITIONAL_RECURSION, hir_id, sp, UnconditionalRecursion { - span: sp, - call_sites: vis.reachable_recursive_calls, - }); + tcx.emit_node_span_lint( + UNCONDITIONAL_RECURSION, + hir_id, + sp, + UnconditionalRecursion { span: sp, call_sites: vis.reachable_recursive_calls }, + ); } } diff --git a/compiler/rustc_mir_transform/src/coroutine.rs b/compiler/rustc_mir_transform/src/coroutine.rs index 3b75be58e437f..a9bdbeb9cb806 100644 --- a/compiler/rustc_mir_transform/src/coroutine.rs +++ b/compiler/rustc_mir_transform/src/coroutine.rs @@ -1044,11 +1044,14 @@ fn insert_switch<'tcx>( let switch = TerminatorKind::SwitchInt { discr: Operand::Move(discr), targets: switch_targets }; let source_info = SourceInfo::outermost(body.span); - body.basic_blocks_mut().raw.insert(0, BasicBlockData { - statements: vec![assign], - terminator: Some(Terminator { source_info, kind: switch }), - is_cleanup: false, - }); + body.basic_blocks_mut().raw.insert( + 0, + BasicBlockData { + statements: vec![assign], + terminator: Some(Terminator { source_info, kind: switch }), + is_cleanup: false, + }, + ); let blocks = body.basic_blocks_mut().iter_mut(); @@ -1594,13 +1597,16 @@ impl<'tcx> crate::MirPass<'tcx> for StateTransform { // (which is now a generator interior). let source_info = SourceInfo::outermost(body.span); let stmts = &mut body.basic_blocks_mut()[START_BLOCK].statements; - stmts.insert(0, Statement { - source_info, - kind: StatementKind::Assign(Box::new(( - old_resume_local.into(), - Rvalue::Use(Operand::Move(resume_local.into())), - ))), - }); + stmts.insert( + 0, + Statement { + source_info, + kind: StatementKind::Assign(Box::new(( + old_resume_local.into(), + Rvalue::Use(Operand::Move(resume_local.into())), + ))), + }, + ); let always_live_locals = always_storage_live_locals(body); @@ -1839,12 +1845,17 @@ fn check_suspend_tys<'tcx>(tcx: TyCtxt<'tcx>, layout: &CoroutineLayout<'tcx>, bo continue; }; - check_must_not_suspend_ty(tcx, decl.ty, hir_id, SuspendCheckData { - source_span: decl.source_info.span, - yield_span: yield_source_info.span, - plural_len: 1, - ..Default::default() - }); + check_must_not_suspend_ty( + tcx, + decl.ty, + hir_id, + SuspendCheckData { + source_span: decl.source_info.span, + yield_span: yield_source_info.span, + plural_len: 1, + ..Default::default() + }, + ); } } } @@ -1883,13 +1894,17 @@ fn check_must_not_suspend_ty<'tcx>( ty::Adt(_, args) if ty.is_box() => { let boxed_ty = args.type_at(0); let allocator_ty = args.type_at(1); - check_must_not_suspend_ty(tcx, boxed_ty, hir_id, SuspendCheckData { - descr_pre: &format!("{}boxed ", data.descr_pre), - ..data - }) || check_must_not_suspend_ty(tcx, allocator_ty, hir_id, SuspendCheckData { - descr_pre: &format!("{}allocator ", data.descr_pre), - ..data - }) + check_must_not_suspend_ty( + tcx, + boxed_ty, + hir_id, + SuspendCheckData { descr_pre: &format!("{}boxed ", data.descr_pre), ..data }, + ) || check_must_not_suspend_ty( + tcx, + allocator_ty, + hir_id, + SuspendCheckData { descr_pre: &format!("{}allocator ", data.descr_pre), ..data }, + ) } ty::Adt(def, _) => check_must_not_suspend_def(tcx, def.did(), hir_id, data), // FIXME: support adding the attribute to TAITs @@ -1902,10 +1917,12 @@ fn check_must_not_suspend_ty<'tcx>( { let def_id = poly_trait_predicate.trait_ref.def_id; let descr_pre = &format!("{}implementer{} of ", data.descr_pre, plural_suffix); - if check_must_not_suspend_def(tcx, def_id, hir_id, SuspendCheckData { - descr_pre, - ..data - }) { + if check_must_not_suspend_def( + tcx, + def_id, + hir_id, + SuspendCheckData { descr_pre, ..data }, + ) { has_emitted = true; break; } @@ -1919,10 +1936,12 @@ fn check_must_not_suspend_ty<'tcx>( if let ty::ExistentialPredicate::Trait(ref trait_ref) = predicate.skip_binder() { let def_id = trait_ref.def_id; let descr_post = &format!(" trait object{}{}", plural_suffix, data.descr_post); - if check_must_not_suspend_def(tcx, def_id, hir_id, SuspendCheckData { - descr_post, - ..data - }) { + if check_must_not_suspend_def( + tcx, + def_id, + hir_id, + SuspendCheckData { descr_post, ..data }, + ) { has_emitted = true; break; } @@ -1934,10 +1953,12 @@ fn check_must_not_suspend_ty<'tcx>( let mut has_emitted = false; for (i, ty) in fields.iter().enumerate() { let descr_post = &format!(" in tuple element {i}"); - if check_must_not_suspend_ty(tcx, ty, hir_id, SuspendCheckData { - descr_post, - ..data - }) { + if check_must_not_suspend_ty( + tcx, + ty, + hir_id, + SuspendCheckData { descr_post, ..data }, + ) { has_emitted = true; } } @@ -1945,12 +1966,17 @@ fn check_must_not_suspend_ty<'tcx>( } ty::Array(ty, len) => { let descr_pre = &format!("{}array{} of ", data.descr_pre, plural_suffix); - check_must_not_suspend_ty(tcx, ty, hir_id, SuspendCheckData { - descr_pre, - // FIXME(must_not_suspend): This is wrong. We should handle printing unevaluated consts. - plural_len: len.try_to_target_usize(tcx).unwrap_or(0) as usize + 1, - ..data - }) + check_must_not_suspend_ty( + tcx, + ty, + hir_id, + SuspendCheckData { + descr_pre, + // FIXME(must_not_suspend): This is wrong. We should handle printing unevaluated consts. + plural_len: len.try_to_target_usize(tcx).unwrap_or(0) as usize + 1, + ..data + }, + ) } // If drop tracking is enabled, we want to look through references, since the referent // may not be considered live across the await point. diff --git a/compiler/rustc_mir_transform/src/coroutine/by_move_body.rs b/compiler/rustc_mir_transform/src/coroutine/by_move_body.rs index 9f5bb015fa335..0f5fcb0d8eb99 100644 --- a/compiler/rustc_mir_transform/src/coroutine/by_move_body.rs +++ b/compiler/rustc_mir_transform/src/coroutine/by_move_body.rs @@ -138,10 +138,10 @@ pub(crate) fn coroutine_by_move_body_def_id<'tcx>( // If the parent capture is by-ref, then we need to apply an additional // deref before applying any further projections to this place. if parent_capture.is_by_ref() { - child_precise_captures.insert(0, Projection { - ty: parent_capture.place.ty(), - kind: ProjectionKind::Deref, - }); + child_precise_captures.insert( + 0, + Projection { ty: parent_capture.place.ty(), kind: ProjectionKind::Deref }, + ); } // If the child capture is by-ref, then we need to apply a "ref" // projection (i.e. `&`) at the end. But wait! We don't have that diff --git a/compiler/rustc_mir_transform/src/coverage/counters/node_flow/tests.rs b/compiler/rustc_mir_transform/src/coverage/counters/node_flow/tests.rs index b509a14514b79..46c46c743c2c4 100644 --- a/compiler/rustc_mir_transform/src/coverage/counters/node_flow/tests.rs +++ b/compiler/rustc_mir_transform/src/coverage/counters/node_flow/tests.rs @@ -20,29 +20,25 @@ fn make_graph(num_nodes: usize, edge_pairs: Vec<(Node, Node)>) /// (Knuth & Stevenson, 1973), but with 0-based node IDs. #[test] fn example_driver() { - let graph = make_graph::(5, vec![ - (0, 1), - (0, 3), - (1, 0), - (1, 2), - (2, 1), - (2, 4), - (3, 3), - (3, 4), - (4, 0), - ]); + let graph = make_graph::( + 5, + vec![(0, 1), (0, 3), (1, 0), (1, 2), (2, 1), (2, 4), (3, 3), (3, 4), (4, 0)], + ); let node_flow_data = node_flow_data(&graph); let counters = make_node_counters(&node_flow_data, &[3, 1, 2, 0, 4]); - assert_eq!(format_counter_expressions(&counters), &[ - // (comment to force vertical formatting for clarity) - "[0]: +c0", - "[1]: +c0 +c2 -c4", - "[2]: +c2", - "[3]: +c3", - "[4]: +c4", - ]); + assert_eq!( + format_counter_expressions(&counters), + &[ + // (comment to force vertical formatting for clarity) + "[0]: +c0", + "[1]: +c0 +c2 -c4", + "[2]: +c2", + "[3]: +c3", + "[4]: +c4", + ] + ); } fn format_counter_expressions(counters: &NodeCounters) -> Vec { diff --git a/compiler/rustc_mir_transform/src/coverage/tests.rs b/compiler/rustc_mir_transform/src/coverage/tests.rs index b2ee50de50a23..3c0053c610d14 100644 --- a/compiler/rustc_mir_transform/src/coverage/tests.rs +++ b/compiler/rustc_mir_transform/src/coverage/tests.rs @@ -129,15 +129,18 @@ impl<'tcx> MockBlocks<'tcx> { } fn call(&mut self, some_from_block: Option) -> BasicBlock { - self.add_block_from(some_from_block, TerminatorKind::Call { - func: Operand::Copy(self.dummy_place.clone()), - args: [].into(), - destination: self.dummy_place.clone(), - target: Some(TEMP_BLOCK), - unwind: UnwindAction::Continue, - call_source: CallSource::Misc, - fn_span: DUMMY_SP, - }) + self.add_block_from( + some_from_block, + TerminatorKind::Call { + func: Operand::Copy(self.dummy_place.clone()), + args: [].into(), + destination: self.dummy_place.clone(), + target: Some(TEMP_BLOCK), + unwind: UnwindAction::Continue, + call_source: CallSource::Misc, + fn_span: DUMMY_SP, + }, + ) } fn goto(&mut self, some_from_block: Option) -> BasicBlock { diff --git a/compiler/rustc_mir_transform/src/ffi_unwind_calls.rs b/compiler/rustc_mir_transform/src/ffi_unwind_calls.rs index 3d560bdf75c31..9a6a153c7ba95 100644 --- a/compiler/rustc_mir_transform/src/ffi_unwind_calls.rs +++ b/compiler/rustc_mir_transform/src/ffi_unwind_calls.rs @@ -90,10 +90,12 @@ fn has_ffi_unwind_calls(tcx: TyCtxt<'_>, local_def_id: LocalDefId) -> bool { let span = terminator.source_info.span; let foreign = fn_def_id.is_some(); - tcx.emit_node_span_lint(FFI_UNWIND_CALLS, lint_root, span, errors::FfiUnwindCall { + tcx.emit_node_span_lint( + FFI_UNWIND_CALLS, + lint_root, span, - foreign, - }); + errors::FfiUnwindCall { span, foreign }, + ); tainted = true; } diff --git a/compiler/rustc_mir_transform/src/inline.rs b/compiler/rustc_mir_transform/src/inline.rs index f8b0688dfdcc0..07c031e852d6e 100644 --- a/compiler/rustc_mir_transform/src/inline.rs +++ b/compiler/rustc_mir_transform/src/inline.rs @@ -1111,10 +1111,13 @@ fn new_call_temp<'tcx>( }); if let Some(block) = return_block { - caller_body[block].statements.insert(0, Statement { - source_info: callsite.source_info, - kind: StatementKind::StorageDead(local), - }); + caller_body[block].statements.insert( + 0, + Statement { + source_info: callsite.source_info, + kind: StatementKind::StorageDead(local), + }, + ); } local diff --git a/compiler/rustc_mir_transform/src/known_panics_lint.rs b/compiler/rustc_mir_transform/src/known_panics_lint.rs index e43254ba089e5..59de6ca84a71b 100644 --- a/compiler/rustc_mir_transform/src/known_panics_lint.rs +++ b/compiler/rustc_mir_transform/src/known_panics_lint.rs @@ -296,11 +296,12 @@ impl<'mir, 'tcx> ConstPropagator<'mir, 'tcx> { let source_info = self.body.source_info(location); if let Some(lint_root) = self.lint_root(*source_info) { let span = source_info.span; - self.tcx.emit_node_span_lint(lint_kind.lint(), lint_root, span, AssertLint { + self.tcx.emit_node_span_lint( + lint_kind.lint(), + lint_root, span, - assert_kind, - lint_kind, - }); + AssertLint { span, assert_kind, lint_kind }, + ); } } diff --git a/compiler/rustc_mir_transform/src/promote_consts.rs b/compiler/rustc_mir_transform/src/promote_consts.rs index 4dbbcae1756b7..c8d8dc147e94f 100644 --- a/compiler/rustc_mir_transform/src/promote_consts.rs +++ b/compiler/rustc_mir_transform/src/promote_consts.rs @@ -920,19 +920,23 @@ impl<'a, 'tcx> Promoter<'a, 'tcx> { self.extra_statements.push((loc, promoted_ref_statement)); ( - Rvalue::Ref(tcx.lifetimes.re_erased, *borrow_kind, Place { - local: mem::replace(&mut place.local, promoted_ref), - projection: List::empty(), - }), + Rvalue::Ref( + tcx.lifetimes.re_erased, + *borrow_kind, + Place { + local: mem::replace(&mut place.local, promoted_ref), + projection: List::empty(), + }, + ), promoted_operand, ) }; assert_eq!(self.new_block(), START_BLOCK); - self.visit_rvalue(&mut rvalue, Location { - block: START_BLOCK, - statement_index: usize::MAX, - }); + self.visit_rvalue( + &mut rvalue, + Location { block: START_BLOCK, statement_index: usize::MAX }, + ); let span = self.promoted.span; self.assign(RETURN_PLACE, rvalue, span); diff --git a/compiler/rustc_mir_transform/src/shim/async_destructor_ctor.rs b/compiler/rustc_mir_transform/src/shim/async_destructor_ctor.rs index 1d53440cf0bad..94b1b4b1855b5 100644 --- a/compiler/rustc_mir_transform/src/shim/async_destructor_ctor.rs +++ b/compiler/rustc_mir_transform/src/shim/async_destructor_ctor.rs @@ -447,17 +447,19 @@ impl<'tcx> AsyncDestructorCtorShimBuilder<'tcx> { } fn combine_sync_surface(&mut self) -> Ty<'tcx> { - self.apply_combinator(1, LangItem::AsyncDropSurfaceDropInPlace, &[self - .self_ty - .unwrap() - .into()]) + self.apply_combinator( + 1, + LangItem::AsyncDropSurfaceDropInPlace, + &[self.self_ty.unwrap().into()], + ) } fn combine_deferred_drop_in_place(&mut self) -> Ty<'tcx> { - self.apply_combinator(1, LangItem::AsyncDropDeferredDropInPlace, &[self - .self_ty - .unwrap() - .into()]) + self.apply_combinator( + 1, + LangItem::AsyncDropDeferredDropInPlace, + &[self.self_ty.unwrap().into()], + ) } fn combine_fuse(&mut self, inner_future_ty: Ty<'tcx>) -> Ty<'tcx> { @@ -477,11 +479,11 @@ impl<'tcx> AsyncDestructorCtorShimBuilder<'tcx> { } fn combine_either(&mut self, other: Ty<'tcx>, matched: Ty<'tcx>) -> Ty<'tcx> { - self.apply_combinator(4, LangItem::AsyncDropEither, &[ - other.into(), - matched.into(), - self.self_ty.unwrap().into(), - ]) + self.apply_combinator( + 4, + LangItem::AsyncDropEither, + &[other.into(), matched.into(), self.self_ty.unwrap().into()], + ) } fn return_(mut self) -> Body<'tcx> { diff --git a/compiler/rustc_mir_transform/src/simplify_comparison_integral.rs b/compiler/rustc_mir_transform/src/simplify_comparison_integral.rs index c0f25c7ecfebc..21bc51ecca14e 100644 --- a/compiler/rustc_mir_transform/src/simplify_comparison_integral.rs +++ b/compiler/rustc_mir_transform/src/simplify_comparison_integral.rs @@ -113,10 +113,13 @@ impl<'tcx> crate::MirPass<'tcx> for SimplifyComparisonIntegral { // if we have StorageDeads to remove then make sure to insert them at the top of // each target for bb_idx in new_targets.all_targets() { - storage_deads_to_insert.push((*bb_idx, Statement { - source_info: terminator.source_info, - kind: StatementKind::StorageDead(opt.to_switch_on.local), - })); + storage_deads_to_insert.push(( + *bb_idx, + Statement { + source_info: terminator.source_info, + kind: StatementKind::StorageDead(opt.to_switch_on.local), + }, + )); } } diff --git a/compiler/rustc_mir_transform/src/ssa.rs b/compiler/rustc_mir_transform/src/ssa.rs index a24b3b2e80ffe..9f769077e77e2 100644 --- a/compiler/rustc_mir_transform/src/ssa.rs +++ b/compiler/rustc_mir_transform/src/ssa.rs @@ -159,10 +159,11 @@ impl SsaLocals { ) { for &local in &self.assignment_order { match self.assignments[local] { - Set1::One(DefLocation::Argument) => f(local, AssignedValue::Arg, Location { - block: START_BLOCK, - statement_index: 0, - }), + Set1::One(DefLocation::Argument) => f( + local, + AssignedValue::Arg, + Location { block: START_BLOCK, statement_index: 0 }, + ), Set1::One(DefLocation::Assignment(loc)) => { let bb = &mut basic_blocks[loc.block]; // `loc` must point to a direct assignment to `local`. diff --git a/compiler/rustc_monomorphize/src/mono_checks/move_check.rs b/compiler/rustc_monomorphize/src/mono_checks/move_check.rs index 02b9397f9a995..838bfdab1ea59 100644 --- a/compiler/rustc_monomorphize/src/mono_checks/move_check.rs +++ b/compiler/rustc_monomorphize/src/mono_checks/move_check.rs @@ -162,11 +162,12 @@ impl<'tcx> MoveCheckVisitor<'tcx> { // but correct span? This would make the lint at least accept crate-level lint attributes. return; }; - self.tcx.emit_node_span_lint(LARGE_ASSIGNMENTS, lint_root, span, LargeAssignmentsLint { + self.tcx.emit_node_span_lint( + LARGE_ASSIGNMENTS, + lint_root, span, - size: too_large_size.bytes(), - limit: limit as u64, - }); + LargeAssignmentsLint { span, size: too_large_size.bytes(), limit: limit as u64 }, + ); self.move_size_spans.push(span); } } diff --git a/compiler/rustc_monomorphize/src/partitioning.rs b/compiler/rustc_monomorphize/src/partitioning.rs index e7d7cd25c851b..d826d03918e08 100644 --- a/compiler/rustc_monomorphize/src/partitioning.rs +++ b/compiler/rustc_monomorphize/src/partitioning.rs @@ -268,12 +268,8 @@ where } let size_estimate = mono_item.size_estimate(cx.tcx); - cgu.items_mut().insert(mono_item, MonoItemData { - inlined: false, - linkage, - visibility, - size_estimate, - }); + cgu.items_mut() + .insert(mono_item, MonoItemData { inlined: false, linkage, visibility, size_estimate }); // Get all inlined items that are reachable from `mono_item` without // going via another root item. This includes drop-glue, functions from diff --git a/compiler/rustc_next_trait_solver/src/solve/assembly/structural_traits.rs b/compiler/rustc_next_trait_solver/src/solve/assembly/structural_traits.rs index 3c5d9b95e772d..082c356cc5fbd 100644 --- a/compiler/rustc_next_trait_solver/src/solve/assembly/structural_traits.rs +++ b/compiler/rustc_next_trait_solver/src/solve/assembly/structural_traits.rs @@ -514,10 +514,11 @@ pub(in crate::solve) fn extract_tupled_inputs_and_output_from_async_callable( sig: ty::CoroutineClosureSignature, ) -> I::Ty { let upvars_projection_def_id = cx.require_lang_item(TraitSolverLangItem::AsyncFnKindUpvars); - let tupled_upvars_ty = Ty::new_projection(cx, upvars_projection_def_id, [ - I::GenericArg::from(args.kind_ty()), - Ty::from_closure_kind(cx, goal_kind).into(), - goal_region.into(), - sig.tupled_inputs_ty.into(), - args.tupled_upvars_ty().into(), - args.coroutine_captures_by_ref_ty().into(), - ]); + let tupled_upvars_ty = Ty::new_projection( + cx, + upvars_projection_def_id, + [ + I::GenericArg::from(args.kind_ty()), + Ty::from_closure_kind(cx, goal_kind).into(), + goal_region.into(), + sig.tupled_inputs_ty.into(), + args.tupled_upvars_ty().into(), + args.coroutine_captures_by_ref_ty().into(), + ], + ); sig.to_coroutine( cx, args.parent_args(), diff --git a/compiler/rustc_next_trait_solver/src/solve/effect_goals.rs b/compiler/rustc_next_trait_solver/src/solve/effect_goals.rs index 7669a305d58d1..fb53e778e6030 100644 --- a/compiler/rustc_next_trait_solver/src/solve/effect_goals.rs +++ b/compiler/rustc_next_trait_solver/src/solve/effect_goals.rs @@ -248,10 +248,11 @@ where let pred = inputs_and_output .map_bound(|(inputs, _)| { - ty::TraitRef::new(cx, goal.predicate.def_id(), [ - goal.predicate.self_ty(), - Ty::new_tup(cx, inputs.as_slice()), - ]) + ty::TraitRef::new( + cx, + goal.predicate.def_id(), + [goal.predicate.self_ty(), Ty::new_tup(cx, inputs.as_slice())], + ) }) .to_host_effect_clause(cx, goal.predicate.constness); diff --git a/compiler/rustc_next_trait_solver/src/solve/eval_ctxt/canonical.rs b/compiler/rustc_next_trait_solver/src/solve/eval_ctxt/canonical.rs index 0bfd72c68487d..2491f09a0e288 100644 --- a/compiler/rustc_next_trait_solver/src/solve/eval_ctxt/canonical.rs +++ b/compiler/rustc_next_trait_solver/src/solve/eval_ctxt/canonical.rs @@ -60,13 +60,16 @@ where (goal, opaque_types).fold_with(&mut EagerResolver::new(self.delegate)); let mut orig_values = Default::default(); - let canonical = - Canonicalizer::canonicalize_input(self.delegate, &mut orig_values, QueryInput { + let canonical = Canonicalizer::canonicalize_input( + self.delegate, + &mut orig_values, + QueryInput { goal, predefined_opaques_in_body: self .cx() .mk_predefined_opaques_in_body(PredefinedOpaquesData { opaque_types }), - }); + }, + ); let query_input = ty::CanonicalQueryInput { canonical, typing_mode: self.typing_mode() }; (orig_values, query_input) } diff --git a/compiler/rustc_next_trait_solver/src/solve/eval_ctxt/mod.rs b/compiler/rustc_next_trait_solver/src/solve/eval_ctxt/mod.rs index 48a05488148b7..b0a34b9ce7560 100644 --- a/compiler/rustc_next_trait_solver/src/solve/eval_ctxt/mod.rs +++ b/compiler/rustc_next_trait_solver/src/solve/eval_ctxt/mod.rs @@ -548,10 +548,10 @@ where // Replace the goal with an unconstrained infer var, so the // RHS does not affect projection candidate assembly. let unconstrained_rhs = self.next_term_infer_of_kind(goal.predicate.term); - let unconstrained_goal = goal.with(cx, ty::NormalizesTo { - alias: goal.predicate.alias, - term: unconstrained_rhs, - }); + let unconstrained_goal = goal.with( + cx, + ty::NormalizesTo { alias: goal.predicate.alias, term: unconstrained_rhs }, + ); let (NestedNormalizationGoals(nested_goals), _, certainty) = self.evaluate_goal_raw( GoalEvaluationKind::Nested, diff --git a/compiler/rustc_next_trait_solver/src/solve/normalizes_to/mod.rs b/compiler/rustc_next_trait_solver/src/solve/normalizes_to/mod.rs index 76cbe5758b23a..c8ea0b119ffbd 100644 --- a/compiler/rustc_next_trait_solver/src/solve/normalizes_to/mod.rs +++ b/compiler/rustc_next_trait_solver/src/solve/normalizes_to/mod.rs @@ -398,10 +398,11 @@ where let pred = tupled_inputs_and_output .map_bound(|(inputs, output)| ty::ProjectionPredicate { - projection_term: ty::AliasTerm::new(cx, goal.predicate.def_id(), [ - goal.predicate.self_ty(), - inputs, - ]), + projection_term: ty::AliasTerm::new( + cx, + goal.predicate.def_id(), + [goal.predicate.self_ty(), inputs], + ), term: output.into(), }) .upcast(cx); @@ -454,21 +455,26 @@ where .is_lang_item(goal.predicate.def_id(), TraitSolverLangItem::CallOnceFuture) { ( - ty::AliasTerm::new(cx, goal.predicate.def_id(), [ - goal.predicate.self_ty(), - tupled_inputs_ty, - ]), + ty::AliasTerm::new( + cx, + goal.predicate.def_id(), + [goal.predicate.self_ty(), tupled_inputs_ty], + ), output_coroutine_ty.into(), ) } else if cx .is_lang_item(goal.predicate.def_id(), TraitSolverLangItem::CallRefFuture) { ( - ty::AliasTerm::new(cx, goal.predicate.def_id(), [ - I::GenericArg::from(goal.predicate.self_ty()), - tupled_inputs_ty.into(), - env_region.into(), - ]), + ty::AliasTerm::new( + cx, + goal.predicate.def_id(), + [ + I::GenericArg::from(goal.predicate.self_ty()), + tupled_inputs_ty.into(), + env_region.into(), + ], + ), output_coroutine_ty.into(), ) } else if cx.is_lang_item( @@ -476,10 +482,14 @@ where TraitSolverLangItem::AsyncFnOnceOutput, ) { ( - ty::AliasTerm::new(cx, goal.predicate.def_id(), [ - I::GenericArg::from(goal.predicate.self_ty()), - tupled_inputs_ty.into(), - ]), + ty::AliasTerm::new( + cx, + goal.predicate.def_id(), + [ + I::GenericArg::from(goal.predicate.self_ty()), + tupled_inputs_ty.into(), + ], + ), coroutine_return_ty.into(), ) } else { @@ -603,10 +613,11 @@ where // and opaque types: If the `self_ty` is `Sized`, then the metadata is `()`. // FIXME(ptr_metadata): This impl overlaps with the other impls and shouldn't // exist. Instead, `Pointee` should be a supertrait of `Sized`. - let sized_predicate = - ty::TraitRef::new(cx, cx.require_lang_item(TraitSolverLangItem::Sized), [ - I::GenericArg::from(goal.predicate.self_ty()), - ]); + let sized_predicate = ty::TraitRef::new( + cx, + cx.require_lang_item(TraitSolverLangItem::Sized), + [I::GenericArg::from(goal.predicate.self_ty())], + ); // FIXME(-Znext-solver=coinductive): Should this be `GoalSource::ImplWhereBound`? ecx.add_goal(GoalSource::Misc, goal.with(cx, sized_predicate)); Ty::new_unit(cx) @@ -782,10 +793,11 @@ where CandidateSource::BuiltinImpl(BuiltinImplSource::Misc), goal, ty::ProjectionPredicate { - projection_term: ty::AliasTerm::new(ecx.cx(), goal.predicate.def_id(), [ - self_ty, - coroutine.resume_ty(), - ]), + projection_term: ty::AliasTerm::new( + ecx.cx(), + goal.predicate.def_id(), + [self_ty, coroutine.resume_ty()], + ), term, } .upcast(cx), diff --git a/compiler/rustc_next_trait_solver/src/solve/trait_goals.rs b/compiler/rustc_next_trait_solver/src/solve/trait_goals.rs index 513fc9355c8b5..46fae5c6fa465 100644 --- a/compiler/rustc_next_trait_solver/src/solve/trait_goals.rs +++ b/compiler/rustc_next_trait_solver/src/solve/trait_goals.rs @@ -342,18 +342,21 @@ where // (FIXME: technically we only need to check this if the type is a fn ptr...) let output_is_sized_pred = tupled_inputs_and_output_and_coroutine.map_bound( |AsyncCallableRelevantTypes { output_coroutine_ty, .. }| { - ty::TraitRef::new(cx, cx.require_lang_item(TraitSolverLangItem::Sized), [ - output_coroutine_ty, - ]) + ty::TraitRef::new( + cx, + cx.require_lang_item(TraitSolverLangItem::Sized), + [output_coroutine_ty], + ) }, ); let pred = tupled_inputs_and_output_and_coroutine .map_bound(|AsyncCallableRelevantTypes { tupled_inputs_ty, .. }| { - ty::TraitRef::new(cx, goal.predicate.def_id(), [ - goal.predicate.self_ty(), - tupled_inputs_ty, - ]) + ty::TraitRef::new( + cx, + goal.predicate.def_id(), + [goal.predicate.self_ty(), tupled_inputs_ty], + ) }) .upcast(cx); Self::probe_and_consider_implied_clause( @@ -975,9 +978,11 @@ where GoalSource::ImplWhereBound, goal.with( cx, - ty::TraitRef::new(cx, cx.require_lang_item(TraitSolverLangItem::Unsize), [ - a_tail_ty, b_tail_ty, - ]), + ty::TraitRef::new( + cx, + cx.require_lang_item(TraitSolverLangItem::Unsize), + [a_tail_ty, b_tail_ty], + ), ), ); self.probe_builtin_trait_candidate(BuiltinImplSource::Misc) @@ -1015,9 +1020,11 @@ where GoalSource::ImplWhereBound, goal.with( cx, - ty::TraitRef::new(cx, cx.require_lang_item(TraitSolverLangItem::Unsize), [ - a_last_ty, b_last_ty, - ]), + ty::TraitRef::new( + cx, + cx.require_lang_item(TraitSolverLangItem::Unsize), + [a_last_ty, b_last_ty], + ), ), ); self.probe_builtin_trait_candidate(BuiltinImplSource::TupleUnsizing) diff --git a/compiler/rustc_parse/src/errors.rs b/compiler/rustc_parse/src/errors.rs index 2373ab67d42ed..8f0e29c27695b 100644 --- a/compiler/rustc_parse/src/errors.rs +++ b/compiler/rustc_parse/src/errors.rs @@ -1121,23 +1121,29 @@ impl<'a, G: EmissionGuarantee> Diagnostic<'a, G> for ExpectedIdentifier { let token_descr = TokenDescription::from_token(&self.token); let mut add_token = true; - let mut diag = Diag::new(dcx, level, match token_descr { - Some(TokenDescription::ReservedIdentifier) => { - fluent::parse_expected_identifier_found_reserved_identifier_str - } - Some(TokenDescription::Keyword) => fluent::parse_expected_identifier_found_keyword_str, - Some(TokenDescription::ReservedKeyword) => { - fluent::parse_expected_identifier_found_reserved_keyword_str - } - Some(TokenDescription::DocComment) => { - fluent::parse_expected_identifier_found_doc_comment_str - } - Some(TokenDescription::MetaVar(_)) => { - add_token = false; - fluent::parse_expected_identifier_found_metavar_str - } - None => fluent::parse_expected_identifier_found_str, - }); + let mut diag = Diag::new( + dcx, + level, + match token_descr { + Some(TokenDescription::ReservedIdentifier) => { + fluent::parse_expected_identifier_found_reserved_identifier_str + } + Some(TokenDescription::Keyword) => { + fluent::parse_expected_identifier_found_keyword_str + } + Some(TokenDescription::ReservedKeyword) => { + fluent::parse_expected_identifier_found_reserved_keyword_str + } + Some(TokenDescription::DocComment) => { + fluent::parse_expected_identifier_found_doc_comment_str + } + Some(TokenDescription::MetaVar(_)) => { + add_token = false; + fluent::parse_expected_identifier_found_metavar_str + } + None => fluent::parse_expected_identifier_found_str, + }, + ); diag.span(self.span); if add_token { diag.arg("token", self.token); @@ -1182,21 +1188,27 @@ impl<'a, G: EmissionGuarantee> Diagnostic<'a, G> for ExpectedSemi { let token_descr = TokenDescription::from_token(&self.token); let mut add_token = true; - let mut diag = Diag::new(dcx, level, match token_descr { - Some(TokenDescription::ReservedIdentifier) => { - fluent::parse_expected_semi_found_reserved_identifier_str - } - Some(TokenDescription::Keyword) => fluent::parse_expected_semi_found_keyword_str, - Some(TokenDescription::ReservedKeyword) => { - fluent::parse_expected_semi_found_reserved_keyword_str - } - Some(TokenDescription::DocComment) => fluent::parse_expected_semi_found_doc_comment_str, - Some(TokenDescription::MetaVar(_)) => { - add_token = false; - fluent::parse_expected_semi_found_metavar_str - } - None => fluent::parse_expected_semi_found_str, - }); + let mut diag = Diag::new( + dcx, + level, + match token_descr { + Some(TokenDescription::ReservedIdentifier) => { + fluent::parse_expected_semi_found_reserved_identifier_str + } + Some(TokenDescription::Keyword) => fluent::parse_expected_semi_found_keyword_str, + Some(TokenDescription::ReservedKeyword) => { + fluent::parse_expected_semi_found_reserved_keyword_str + } + Some(TokenDescription::DocComment) => { + fluent::parse_expected_semi_found_doc_comment_str + } + Some(TokenDescription::MetaVar(_)) => { + add_token = false; + fluent::parse_expected_semi_found_metavar_str + } + None => fluent::parse_expected_semi_found_str, + }, + ); diag.span(self.span); if add_token { diag.arg("token", self.token); diff --git a/compiler/rustc_parse/src/parser/attr_wrapper.rs b/compiler/rustc_parse/src/parser/attr_wrapper.rs index 434f71beac243..cff998fa13790 100644 --- a/compiler/rustc_parse/src/parser/attr_wrapper.rs +++ b/compiler/rustc_parse/src/parser/attr_wrapper.rs @@ -502,10 +502,10 @@ fn make_attr_token_stream( for flat_token in iter { match flat_token { FlatToken::Token((Token { kind: TokenKind::OpenDelim(delim), span }, spacing)) => { - stack_rest.push(mem::replace(&mut stack_top, FrameData { - open_delim_sp: Some((delim, span, spacing)), - inner: vec![], - })); + stack_rest.push(mem::replace( + &mut stack_top, + FrameData { open_delim_sp: Some((delim, span, spacing)), inner: vec![] }, + )); } FlatToken::Token((Token { kind: TokenKind::CloseDelim(delim), span }, spacing)) => { let frame_data = mem::replace(&mut stack_top, stack_rest.pop().unwrap()); diff --git a/compiler/rustc_parse/src/parser/diagnostics.rs b/compiler/rustc_parse/src/parser/diagnostics.rs index 47bf80a07833b..72aebb5d12144 100644 --- a/compiler/rustc_parse/src/parser/diagnostics.rs +++ b/compiler/rustc_parse/src/parser/diagnostics.rs @@ -684,12 +684,15 @@ impl<'a> Parser<'a> { let span = self.token.span.with_lo(pos).with_hi(pos); err.span_suggestion_verbose( span, - format!("add a space before {} to write a regular comment", match (kind, style) { - (token::CommentKind::Line, ast::AttrStyle::Inner) => "`!`", - (token::CommentKind::Block, ast::AttrStyle::Inner) => "`!`", - (token::CommentKind::Line, ast::AttrStyle::Outer) => "the last `/`", - (token::CommentKind::Block, ast::AttrStyle::Outer) => "the last `*`", - },), + format!( + "add a space before {} to write a regular comment", + match (kind, style) { + (token::CommentKind::Line, ast::AttrStyle::Inner) => "`!`", + (token::CommentKind::Block, ast::AttrStyle::Inner) => "`!`", + (token::CommentKind::Line, ast::AttrStyle::Outer) => "the last `/`", + (token::CommentKind::Block, ast::AttrStyle::Outer) => "the last `*`", + }, + ), " ".to_string(), Applicability::MachineApplicable, ); @@ -1894,13 +1897,14 @@ impl<'a> Parser<'a> { (token::Eof, None) => (self.prev_token.span, self.token.span), _ => (self.prev_token.span.shrink_to_hi(), self.token.span), }; - let msg = format!("expected `{}`, found {}", token_str, match ( - &self.token.kind, - self.subparser_name - ) { - (token::Eof, Some(origin)) => format!("end of {origin}"), - _ => this_token_str, - },); + let msg = format!( + "expected `{}`, found {}", + token_str, + match (&self.token.kind, self.subparser_name) { + (token::Eof, Some(origin)) => format!("end of {origin}"), + _ => this_token_str, + }, + ); let mut err = self.dcx().struct_span_err(sp, msg); let label_exp = format!("expected `{token_str}`"); let sm = self.psess.source_map(); @@ -2826,25 +2830,27 @@ impl<'a> Parser<'a> { PatKind::Ident(BindingMode::NONE, ident, None) => { match &first_pat.kind { PatKind::Ident(_, old_ident, _) => { - let path = PatKind::Path(None, Path { - span: new_span, - segments: thin_vec![ - PathSegment::from_ident(*old_ident), - PathSegment::from_ident(*ident), - ], - tokens: None, - }); + let path = PatKind::Path( + None, + Path { + span: new_span, + segments: thin_vec![ + PathSegment::from_ident(*old_ident), + PathSegment::from_ident(*ident), + ], + tokens: None, + }, + ); first_pat = self.mk_pat(new_span, path); show_sugg = true; } PatKind::Path(old_qself, old_path) => { let mut segments = old_path.segments.clone(); segments.push(PathSegment::from_ident(*ident)); - let path = PatKind::Path(old_qself.clone(), Path { - span: new_span, - segments, - tokens: None, - }); + let path = PatKind::Path( + old_qself.clone(), + Path { span: new_span, segments, tokens: None }, + ); first_pat = self.mk_pat(new_span, path); show_sugg = true; } diff --git a/compiler/rustc_parse/src/parser/expr.rs b/compiler/rustc_parse/src/parser/expr.rs index ffd46f20767e3..e0e6c2177da54 100644 --- a/compiler/rustc_parse/src/parser/expr.rs +++ b/compiler/rustc_parse/src/parser/expr.rs @@ -807,17 +807,20 @@ impl<'a> Parser<'a> { // Check if an illegal postfix operator has been added after the cast. // If the resulting expression is not a cast, it is an illegal postfix operator. if !matches!(with_postfix.kind, ExprKind::Cast(_, _)) { - let msg = format!("cast cannot be followed by {}", match with_postfix.kind { - ExprKind::Index(..) => "indexing", - ExprKind::Try(_) => "`?`", - ExprKind::Field(_, _) => "a field access", - ExprKind::MethodCall(_) => "a method call", - ExprKind::Call(_, _) => "a function call", - ExprKind::Await(_, _) => "`.await`", - ExprKind::Match(_, _, MatchKind::Postfix) => "a postfix match", - ExprKind::Err(_) => return Ok(with_postfix), - _ => unreachable!("parse_dot_or_call_expr_with_ shouldn't produce this"), - }); + let msg = format!( + "cast cannot be followed by {}", + match with_postfix.kind { + ExprKind::Index(..) => "indexing", + ExprKind::Try(_) => "`?`", + ExprKind::Field(_, _) => "a field access", + ExprKind::MethodCall(_) => "a method call", + ExprKind::Call(_, _) => "a function call", + ExprKind::Await(_, _) => "`.await`", + ExprKind::Match(_, _, MatchKind::Postfix) => "a postfix match", + ExprKind::Err(_) => return Ok(with_postfix), + _ => unreachable!("parse_dot_or_call_expr_with_ shouldn't produce this"), + } + ); let mut err = self.dcx().struct_span_err(span, msg); let suggest_parens = |err: &mut Diag<'_>| { @@ -2862,13 +2865,10 @@ impl<'a> Parser<'a> { .emit_err(errors::MissingExpressionInForLoop { span: expr.span.shrink_to_lo() }); let err_expr = self.mk_expr(expr.span, ExprKind::Err(guar)); let block = self.mk_block(thin_vec![], BlockCheckMode::Default, self.prev_token.span); - return Ok(self.mk_expr(lo.to(self.prev_token.span), ExprKind::ForLoop { - pat, - iter: err_expr, - body: block, - label: opt_label, - kind, - })); + return Ok(self.mk_expr( + lo.to(self.prev_token.span), + ExprKind::ForLoop { pat, iter: err_expr, body: block, label: opt_label, kind }, + )); } let (attrs, loop_block) = self.parse_inner_attrs_and_block()?; diff --git a/compiler/rustc_parse/src/parser/item.rs b/compiler/rustc_parse/src/parser/item.rs index dbdc31f06a29d..637ed2774a293 100644 --- a/compiler/rustc_parse/src/parser/item.rs +++ b/compiler/rustc_parse/src/parser/item.rs @@ -1954,10 +1954,10 @@ impl<'a> Parser<'a> { // Try to recover extra trailing angle brackets if let TyKind::Path(_, Path { segments, .. }) = &a_var.ty.kind { if let Some(last_segment) = segments.last() { - let guar = self.check_trailing_angle_brackets(last_segment, &[ - exp!(Comma), - exp!(CloseBrace), - ]); + let guar = self.check_trailing_angle_brackets( + last_segment, + &[exp!(Comma), exp!(CloseBrace)], + ); if let Some(_guar) = guar { // Handle a case like `Vec>,` where we can continue parsing fields // after the comma diff --git a/compiler/rustc_parse/src/parser/path.rs b/compiler/rustc_parse/src/parser/path.rs index 39737b9e13798..576711e66777e 100644 --- a/compiler/rustc_parse/src/parser/path.rs +++ b/compiler/rustc_parse/src/parser/path.rs @@ -106,11 +106,10 @@ impl<'a> Parser<'a> { self.parse_path_segments(&mut path.segments, style, None)?; } - Ok((qself, Path { - segments: path.segments, - span: lo.to(self.prev_token.span), - tokens: None, - })) + Ok(( + qself, + Path { segments: path.segments, span: lo.to(self.prev_token.span), tokens: None }, + )) } /// Recover from an invalid single colon, when the user likely meant a qualified path. @@ -485,13 +484,16 @@ impl<'a> Parser<'a> { error.span_suggestion_verbose( prev_token_before_parsing.span, - format!("consider removing the `::` here to {}", match style { - PathStyle::Expr => "call the expression", - PathStyle::Pat => "turn this into a tuple struct pattern", - _ => { - return; + format!( + "consider removing the `::` here to {}", + match style { + PathStyle::Expr => "call the expression", + PathStyle::Pat => "turn this into a tuple struct pattern", + _ => { + return; + } } - }), + ), "", Applicability::MaybeIncorrect, ); diff --git a/compiler/rustc_parse/src/parser/stmt.rs b/compiler/rustc_parse/src/parser/stmt.rs index 1ddb5fc0a1169..a2699b077fcff 100644 --- a/compiler/rustc_parse/src/parser/stmt.rs +++ b/compiler/rustc_parse/src/parser/stmt.rs @@ -417,14 +417,20 @@ impl<'a> Parser<'a> { fn check_let_else_init_trailing_brace(&self, init: &ast::Expr) { if let Some(trailing) = classify::expr_trailing_brace(init) { let (span, sugg) = match trailing { - TrailingBrace::MacCall(mac) => (mac.span(), errors::WrapInParentheses::MacroArgs { - left: mac.args.dspan.open, - right: mac.args.dspan.close, - }), - TrailingBrace::Expr(expr) => (expr.span, errors::WrapInParentheses::Expression { - left: expr.span.shrink_to_lo(), - right: expr.span.shrink_to_hi(), - }), + TrailingBrace::MacCall(mac) => ( + mac.span(), + errors::WrapInParentheses::MacroArgs { + left: mac.args.dspan.open, + right: mac.args.dspan.close, + }, + ), + TrailingBrace::Expr(expr) => ( + expr.span, + errors::WrapInParentheses::Expression { + left: expr.span.shrink_to_lo(), + right: expr.span.shrink_to_hi(), + }, + ), }; self.dcx().emit_err(errors::InvalidCurlyInLetElse { span: span.with_lo(span.hi() - BytePos(1)), diff --git a/compiler/rustc_parse_format/src/lib.rs b/compiler/rustc_parse_format/src/lib.rs index d021ea107ed28..3b985621b5772 100644 --- a/compiler/rustc_parse_format/src/lib.rs +++ b/compiler/rustc_parse_format/src/lib.rs @@ -863,28 +863,34 @@ impl<'a> Parser<'a> { if let (Some(pos), Some(_)) = (self.consume_pos('?'), self.consume_pos(':')) { let word = self.word(); let pos = self.to_span_index(pos); - self.errors.insert(0, ParseError { - description: "expected format parameter to occur after `:`".to_owned(), - note: Some(format!("`?` comes after `:`, try `{}:{}` instead", word, "?")), - label: "expected `?` to occur after `:`".to_owned(), - span: pos.to(pos), - secondary_label: None, - suggestion: Suggestion::None, - }); + self.errors.insert( + 0, + ParseError { + description: "expected format parameter to occur after `:`".to_owned(), + note: Some(format!("`?` comes after `:`, try `{}:{}` instead", word, "?")), + label: "expected `?` to occur after `:`".to_owned(), + span: pos.to(pos), + secondary_label: None, + suggestion: Suggestion::None, + }, + ); } } fn suggest_format_align(&mut self, alignment: char) { if let Some(pos) = self.consume_pos(alignment) { let pos = self.to_span_index(pos); - self.errors.insert(0, ParseError { - description: "expected format parameter to occur after `:`".to_owned(), - note: None, - label: format!("expected `{}` to occur after `:`", alignment), - span: pos.to(pos), - secondary_label: None, - suggestion: Suggestion::None, - }); + self.errors.insert( + 0, + ParseError { + description: "expected format parameter to occur after `:`".to_owned(), + note: None, + label: format!("expected `{}` to occur after `:`", alignment), + span: pos.to(pos), + secondary_label: None, + suggestion: Suggestion::None, + }, + ); } } @@ -901,24 +907,36 @@ impl<'a> Parser<'a> { if let ArgumentNamed(_) = arg.position { match field.position { ArgumentNamed(_) => { - self.errors.insert(0, ParseError { - description: "field access isn't supported".to_string(), - note: None, - label: "not supported".to_string(), - span: InnerSpan::new(arg.position_span.start, field.position_span.end), - secondary_label: None, - suggestion: Suggestion::UsePositional, - }); + self.errors.insert( + 0, + ParseError { + description: "field access isn't supported".to_string(), + note: None, + label: "not supported".to_string(), + span: InnerSpan::new( + arg.position_span.start, + field.position_span.end, + ), + secondary_label: None, + suggestion: Suggestion::UsePositional, + }, + ); } ArgumentIs(_) => { - self.errors.insert(0, ParseError { - description: "tuple index access isn't supported".to_string(), - note: None, - label: "not supported".to_string(), - span: InnerSpan::new(arg.position_span.start, field.position_span.end), - secondary_label: None, - suggestion: Suggestion::UsePositional, - }); + self.errors.insert( + 0, + ParseError { + description: "tuple index access isn't supported".to_string(), + note: None, + label: "not supported".to_string(), + span: InnerSpan::new( + arg.position_span.start, + field.position_span.end, + ), + secondary_label: None, + suggestion: Suggestion::UsePositional, + }, + ); } _ => {} }; @@ -940,14 +958,17 @@ impl<'a> Parser<'a> { let span = self.span(pos - 1, pos + 1); let pos = self.to_span_index(pos); - self.errors.insert(0, ParseError { - description: format!("expected `}}`, found `{c}`"), - note: None, - label: "expected `'}'`".into(), - span: pos.to(pos), - secondary_label: None, - suggestion: Suggestion::ReorderFormatParameter(span, format!("{replacement}")), - }) + self.errors.insert( + 0, + ParseError { + description: format!("expected `}}`, found `{c}`"), + note: None, + label: "expected `'}'`".into(), + span: pos.to(pos), + secondary_label: None, + suggestion: Suggestion::ReorderFormatParameter(span, format!("{replacement}")), + }, + ) } } diff --git a/compiler/rustc_parse_format/src/tests.rs b/compiler/rustc_parse_format/src/tests.rs index fbb217b16fc32..cc8a0069c4ecd 100644 --- a/compiler/rustc_parse_format/src/tests.rs +++ b/compiler/rustc_parse_format/src/tests.rs @@ -80,307 +80,311 @@ fn invalid_precision() { #[test] fn format_nothing() { - same("{}", &[NextArgument(Box::new(Argument { - position: ArgumentImplicitlyIs(0), - position_span: InnerSpan { start: 2, end: 2 }, - format: fmtdflt(), - }))]); + same( + "{}", + &[NextArgument(Box::new(Argument { + position: ArgumentImplicitlyIs(0), + position_span: InnerSpan { start: 2, end: 2 }, + format: fmtdflt(), + }))], + ); } #[test] fn format_position() { - same("{3}", &[NextArgument(Box::new(Argument { - position: ArgumentIs(3), - position_span: InnerSpan { start: 2, end: 3 }, - format: fmtdflt(), - }))]); + same( + "{3}", + &[NextArgument(Box::new(Argument { + position: ArgumentIs(3), + position_span: InnerSpan { start: 2, end: 3 }, + format: fmtdflt(), + }))], + ); } #[test] fn format_position_nothing_else() { - same("{3:}", &[NextArgument(Box::new(Argument { - position: ArgumentIs(3), - position_span: InnerSpan { start: 2, end: 3 }, - format: fmtdflt(), - }))]); + same( + "{3:}", + &[NextArgument(Box::new(Argument { + position: ArgumentIs(3), + position_span: InnerSpan { start: 2, end: 3 }, + format: fmtdflt(), + }))], + ); } #[test] fn format_named() { - same("{name}", &[NextArgument(Box::new(Argument { - position: ArgumentNamed("name"), - position_span: InnerSpan { start: 2, end: 6 }, - format: fmtdflt(), - }))]) + same( + "{name}", + &[NextArgument(Box::new(Argument { + position: ArgumentNamed("name"), + position_span: InnerSpan { start: 2, end: 6 }, + format: fmtdflt(), + }))], + ) } #[test] fn format_type() { - same("{3:x}", &[NextArgument(Box::new(Argument { - position: ArgumentIs(3), - position_span: InnerSpan { start: 2, end: 3 }, - format: FormatSpec { - fill: None, - fill_span: None, - align: AlignUnknown, - sign: None, - alternate: false, - zero_pad: false, - debug_hex: None, - precision: CountImplied, - width: CountImplied, - precision_span: None, - width_span: None, - ty: "x", - ty_span: None, - }, - }))]); + same( + "{3:x}", + &[NextArgument(Box::new(Argument { + position: ArgumentIs(3), + position_span: InnerSpan { start: 2, end: 3 }, + format: FormatSpec { + fill: None, + fill_span: None, + align: AlignUnknown, + sign: None, + alternate: false, + zero_pad: false, + debug_hex: None, + precision: CountImplied, + width: CountImplied, + precision_span: None, + width_span: None, + ty: "x", + ty_span: None, + }, + }))], + ); } #[test] fn format_align_fill() { - same("{3:>}", &[NextArgument(Box::new(Argument { - position: ArgumentIs(3), - position_span: InnerSpan { start: 2, end: 3 }, - format: FormatSpec { - fill: None, - fill_span: None, - align: AlignRight, - sign: None, - alternate: false, - zero_pad: false, - debug_hex: None, - precision: CountImplied, - width: CountImplied, - precision_span: None, - width_span: None, - ty: "", - ty_span: None, - }, - }))]); - same("{3:0<}", &[NextArgument(Box::new(Argument { - position: ArgumentIs(3), - position_span: InnerSpan { start: 2, end: 3 }, - format: FormatSpec { - fill: Some('0'), - fill_span: Some(InnerSpan::new(4, 5)), - align: AlignLeft, - sign: None, - alternate: false, - zero_pad: false, - debug_hex: None, - precision: CountImplied, - width: CountImplied, - precision_span: None, - width_span: None, - ty: "", - ty_span: None, - }, - }))]); - same("{3:*}", + &[NextArgument(Box::new(Argument { + position: ArgumentIs(3), + position_span: InnerSpan { start: 2, end: 3 }, + format: FormatSpec { + fill: None, + fill_span: None, + align: AlignRight, + sign: None, + alternate: false, + zero_pad: false, + debug_hex: None, + precision: CountImplied, + width: CountImplied, + precision_span: None, + width_span: None, + ty: "", + ty_span: None, + }, + }))], + ); + same( + "{3:0<}", + &[NextArgument(Box::new(Argument { + position: ArgumentIs(3), + position_span: InnerSpan { start: 2, end: 3 }, + format: FormatSpec { + fill: Some('0'), + fill_span: Some(InnerSpan::new(4, 5)), + align: AlignLeft, + sign: None, + alternate: false, + zero_pad: false, + debug_hex: None, + precision: CountImplied, + width: CountImplied, + precision_span: None, + width_span: None, + ty: "", + ty_span: None, + }, + }))], + ); + same( + "{3:* CheckAttrVisitor<'tcx> { } fn inline_attr_str_error_without_macro_def(&self, hir_id: HirId, attr: &Attribute, sym: &str) { - self.tcx - .emit_node_span_lint(UNUSED_ATTRIBUTES, hir_id, attr.span, errors::IgnoredAttr { sym }); + self.tcx.emit_node_span_lint( + UNUSED_ATTRIBUTES, + hir_id, + attr.span, + errors::IgnoredAttr { sym }, + ); } /// Checks if `#[diagnostic::do_not_recommend]` is applied on a trait impl. @@ -1506,10 +1510,12 @@ impl<'tcx> CheckAttrVisitor<'tcx> { _ => { // FIXME: #[cold] was previously allowed on non-functions and some crates used // this, so only emit a warning. - self.tcx.emit_node_span_lint(UNUSED_ATTRIBUTES, hir_id, attr.span, errors::Cold { - span, - on_crate: hir_id == CRATE_HIR_ID, - }); + self.tcx.emit_node_span_lint( + UNUSED_ATTRIBUTES, + hir_id, + attr.span, + errors::Cold { span, on_crate: hir_id == CRATE_HIR_ID }, + ); } } } @@ -1524,9 +1530,12 @@ impl<'tcx> CheckAttrVisitor<'tcx> { return; } - self.tcx.emit_node_span_lint(UNUSED_ATTRIBUTES, hir_id, attr.span, errors::Link { - span: (target != Target::ForeignMod).then_some(span), - }); + self.tcx.emit_node_span_lint( + UNUSED_ATTRIBUTES, + hir_id, + attr.span, + errors::Link { span: (target != Target::ForeignMod).then_some(span) }, + ); } /// Checks if `#[link_name]` is applied to an item other than a foreign function or static. @@ -2393,10 +2402,12 @@ impl<'tcx> CheckAttrVisitor<'tcx> { return; }; - self.tcx.emit_node_span_lint(UNUSED_ATTRIBUTES, hir_id, attr.span, errors::Unused { - attr_span: attr.span, - note, - }); + self.tcx.emit_node_span_lint( + UNUSED_ATTRIBUTES, + hir_id, + attr.span, + errors::Unused { attr_span: attr.span, note }, + ); } /// A best effort attempt to create an error for a mismatching proc macro signature. diff --git a/compiler/rustc_passes/src/errors.rs b/compiler/rustc_passes/src/errors.rs index 0aa50ad19ff96..9bcdd2385470c 100644 --- a/compiler/rustc_passes/src/errors.rs +++ b/compiler/rustc_passes/src/errors.rs @@ -1394,11 +1394,15 @@ pub(crate) struct DuplicateLangItem { impl Diagnostic<'_, G> for DuplicateLangItem { #[track_caller] fn into_diag(self, dcx: DiagCtxtHandle<'_>, level: Level) -> Diag<'_, G> { - let mut diag = Diag::new(dcx, level, match self.duplicate { - Duplicate::Plain => fluent::passes_duplicate_lang_item, - Duplicate::Crate => fluent::passes_duplicate_lang_item_crate, - Duplicate::CrateDepends => fluent::passes_duplicate_lang_item_crate_depends, - }); + let mut diag = Diag::new( + dcx, + level, + match self.duplicate { + Duplicate::Plain => fluent::passes_duplicate_lang_item, + Duplicate::Crate => fluent::passes_duplicate_lang_item_crate, + Duplicate::CrateDepends => fluent::passes_duplicate_lang_item_crate_depends, + }, + ); diag.code(E0152); diag.arg("lang_item_name", self.lang_item_name); diag.arg("crate_name", self.crate_name); diff --git a/compiler/rustc_passes/src/input_stats.rs b/compiler/rustc_passes/src/input_stats.rs index 6d9c70177a4d4..f7cae89852e11 100644 --- a/compiler/rustc_passes/src/input_stats.rs +++ b/compiler/rustc_passes/src/input_stats.rs @@ -230,24 +230,27 @@ impl<'v> hir_visit::Visitor<'v> for StatCollector<'v> { } fn visit_item(&mut self, i: &'v hir::Item<'v>) { - record_variants!((self, i, i.kind, Some(i.hir_id()), hir, Item, ItemKind), [ - ExternCrate, - Use, - Static, - Const, - Fn, - Macro, - Mod, - ForeignMod, - GlobalAsm, - TyAlias, - Enum, - Struct, - Union, - Trait, - TraitAlias, - Impl - ]); + record_variants!( + (self, i, i.kind, Some(i.hir_id()), hir, Item, ItemKind), + [ + ExternCrate, + Use, + Static, + Const, + Fn, + Macro, + Mod, + ForeignMod, + GlobalAsm, + TyAlias, + Enum, + Struct, + Union, + Trait, + TraitAlias, + Impl + ] + ); hir_visit::walk_item(self, i) } @@ -262,9 +265,10 @@ impl<'v> hir_visit::Visitor<'v> for StatCollector<'v> { } fn visit_foreign_item(&mut self, i: &'v hir::ForeignItem<'v>) { - record_variants!((self, i, i.kind, Some(i.hir_id()), hir, ForeignItem, ForeignItemKind), [ - Fn, Static, Type - ]); + record_variants!( + (self, i, i.kind, Some(i.hir_id()), hir, ForeignItem, ForeignItemKind), + [Fn, Static, Type] + ); hir_visit::walk_foreign_item(self, i) } @@ -279,9 +283,10 @@ impl<'v> hir_visit::Visitor<'v> for StatCollector<'v> { } fn visit_stmt(&mut self, s: &'v hir::Stmt<'v>) { - record_variants!((self, s, s.kind, Some(s.hir_id), hir, Stmt, StmtKind), [ - Let, Item, Expr, Semi - ]); + record_variants!( + (self, s, s.kind, Some(s.hir_id), hir, Stmt, StmtKind), + [Let, Item, Expr, Semi] + ); hir_visit::walk_stmt(self, s) } @@ -291,23 +296,26 @@ impl<'v> hir_visit::Visitor<'v> for StatCollector<'v> { } fn visit_pat(&mut self, p: &'v hir::Pat<'v>) { - record_variants!((self, p, p.kind, Some(p.hir_id), hir, Pat, PatKind), [ - Wild, - Binding, - Struct, - TupleStruct, - Or, - Never, - Tuple, - Box, - Deref, - Ref, - Expr, - Guard, - Range, - Slice, - Err - ]); + record_variants!( + (self, p, p.kind, Some(p.hir_id), hir, Pat, PatKind), + [ + Wild, + Binding, + Struct, + TupleStruct, + Or, + Never, + Tuple, + Box, + Deref, + Ref, + Expr, + Guard, + Range, + Slice, + Err + ] + ); hir_visit::walk_pat(self, p) } @@ -317,42 +325,45 @@ impl<'v> hir_visit::Visitor<'v> for StatCollector<'v> { } fn visit_expr(&mut self, e: &'v hir::Expr<'v>) { - record_variants!((self, e, e.kind, Some(e.hir_id), hir, Expr, ExprKind), [ - ConstBlock, - Array, - Call, - MethodCall, - Tup, - Binary, - Unary, - Lit, - Cast, - Type, - DropTemps, - Let, - If, - Loop, - Match, - Closure, - Block, - Assign, - AssignOp, - Field, - Index, - Path, - AddrOf, - Break, - Continue, - Ret, - Become, - InlineAsm, - OffsetOf, - Struct, - Repeat, - Yield, - UnsafeBinderCast, - Err - ]); + record_variants!( + (self, e, e.kind, Some(e.hir_id), hir, Expr, ExprKind), + [ + ConstBlock, + Array, + Call, + MethodCall, + Tup, + Binary, + Unary, + Lit, + Cast, + Type, + DropTemps, + Let, + If, + Loop, + Match, + Closure, + Block, + Assign, + AssignOp, + Field, + Index, + Path, + AddrOf, + Break, + Continue, + Ret, + Become, + InlineAsm, + OffsetOf, + Struct, + Repeat, + Yield, + UnsafeBinderCast, + Err + ] + ); hir_visit::walk_expr(self, e) } @@ -362,25 +373,28 @@ impl<'v> hir_visit::Visitor<'v> for StatCollector<'v> { } fn visit_ty(&mut self, t: &'v hir::Ty<'v, AmbigArg>) { - record_variants!((self, t, t.kind, Some(t.hir_id), hir, Ty, TyKind), [ - InferDelegation, - Slice, - Array, - Ptr, - Ref, - BareFn, - UnsafeBinder, - Never, - Tup, - Path, - OpaqueDef, - TraitAscription, - TraitObject, - Typeof, - Infer, - Pat, - Err - ]); + record_variants!( + (self, t, t.kind, Some(t.hir_id), hir, Ty, TyKind), + [ + InferDelegation, + Slice, + Array, + Ptr, + Ref, + BareFn, + UnsafeBinder, + Never, + Tup, + Path, + OpaqueDef, + TraitAscription, + TraitObject, + Typeof, + Infer, + Pat, + Err + ] + ); hir_visit::walk_ty(self, t) } @@ -421,9 +435,10 @@ impl<'v> hir_visit::Visitor<'v> for StatCollector<'v> { } fn visit_trait_item(&mut self, ti: &'v hir::TraitItem<'v>) { - record_variants!((self, ti, ti.kind, Some(ti.hir_id()), hir, TraitItem, TraitItemKind), [ - Const, Fn, Type - ]); + record_variants!( + (self, ti, ti.kind, Some(ti.hir_id()), hir, TraitItem, TraitItemKind), + [Const, Fn, Type] + ); hir_visit::walk_trait_item(self, ti) } @@ -433,9 +448,10 @@ impl<'v> hir_visit::Visitor<'v> for StatCollector<'v> { } fn visit_impl_item(&mut self, ii: &'v hir::ImplItem<'v>) { - record_variants!((self, ii, ii.kind, Some(ii.hir_id()), hir, ImplItem, ImplItemKind), [ - Const, Fn, Type - ]); + record_variants!( + (self, ii, ii.kind, Some(ii.hir_id()), hir, ImplItem, ImplItemKind), + [Const, Fn, Type] + ); hir_visit::walk_impl_item(self, ii) } @@ -450,9 +466,10 @@ impl<'v> hir_visit::Visitor<'v> for StatCollector<'v> { } fn visit_param_bound(&mut self, b: &'v hir::GenericBound<'v>) { - record_variants!((self, b, b, None, hir, GenericBound, GenericBound), [ - Trait, Outlives, Use - ]); + record_variants!( + (self, b, b, None, hir, GenericBound, GenericBound), + [Trait, Outlives, Use] + ); hir_visit::walk_param_bound(self, b) } @@ -467,9 +484,10 @@ impl<'v> hir_visit::Visitor<'v> for StatCollector<'v> { } fn visit_generic_arg(&mut self, ga: &'v hir::GenericArg<'v>) { - record_variants!((self, ga, ga, Some(ga.hir_id()), hir, GenericArg, GenericArg), [ - Lifetime, Type, Const, Infer - ]); + record_variants!( + (self, ga, ga, Some(ga.hir_id()), hir, GenericArg, GenericArg), + [Lifetime, Type, Const, Infer] + ); match ga { hir::GenericArg::Lifetime(lt) => self.visit_lifetime(lt), hir::GenericArg::Type(ty) => self.visit_ty(ty), @@ -515,34 +533,38 @@ impl<'v> hir_visit::Visitor<'v> for StatCollector<'v> { impl<'v> ast_visit::Visitor<'v> for StatCollector<'v> { fn visit_foreign_item(&mut self, i: &'v ast::ForeignItem) { - record_variants!((self, i, i.kind, None, ast, ForeignItem, ForeignItemKind), [ - Static, Fn, TyAlias, MacCall - ]); + record_variants!( + (self, i, i.kind, None, ast, ForeignItem, ForeignItemKind), + [Static, Fn, TyAlias, MacCall] + ); ast_visit::walk_item(self, i) } fn visit_item(&mut self, i: &'v ast::Item) { - record_variants!((self, i, i.kind, None, ast, Item, ItemKind), [ - ExternCrate, - Use, - Static, - Const, - Fn, - Mod, - ForeignMod, - GlobalAsm, - TyAlias, - Enum, - Struct, - Union, - Trait, - TraitAlias, - Impl, - MacCall, - MacroDef, - Delegation, - DelegationMac - ]); + record_variants!( + (self, i, i.kind, None, ast, Item, ItemKind), + [ + ExternCrate, + Use, + Static, + Const, + Fn, + Mod, + ForeignMod, + GlobalAsm, + TyAlias, + Enum, + Struct, + Union, + Trait, + TraitAlias, + Impl, + MacCall, + MacroDef, + Delegation, + DelegationMac + ] + ); ast_visit::walk_item(self, i) } @@ -557,9 +579,10 @@ impl<'v> ast_visit::Visitor<'v> for StatCollector<'v> { } fn visit_stmt(&mut self, s: &'v ast::Stmt) { - record_variants!((self, s, s.kind, None, ast, Stmt, StmtKind), [ - Let, Item, Expr, Semi, Empty, MacCall - ]); + record_variants!( + (self, s, s.kind, None, ast, Stmt, StmtKind), + [Let, Item, Expr, Semi, Empty, MacCall] + ); ast_visit::walk_stmt(self, s) } @@ -574,27 +597,30 @@ impl<'v> ast_visit::Visitor<'v> for StatCollector<'v> { } fn visit_pat(&mut self, p: &'v ast::Pat) { - record_variants!((self, p, p.kind, None, ast, Pat, PatKind), [ - Wild, - Ident, - Struct, - TupleStruct, - Or, - Path, - Tuple, - Box, - Deref, - Ref, - Expr, - Range, - Slice, - Rest, - Never, - Guard, - Paren, - MacCall, - Err - ]); + record_variants!( + (self, p, p.kind, None, ast, Pat, PatKind), + [ + Wild, + Ident, + Struct, + TupleStruct, + Or, + Path, + Tuple, + Box, + Deref, + Ref, + Expr, + Range, + Slice, + Rest, + Never, + Guard, + Paren, + MacCall, + Err + ] + ); ast_visit::walk_pat(self, p) } @@ -614,29 +640,32 @@ impl<'v> ast_visit::Visitor<'v> for StatCollector<'v> { } fn visit_ty(&mut self, t: &'v ast::Ty) { - record_variants!((self, t, t.kind, None, ast, Ty, TyKind), [ - Slice, - Array, - Ptr, - Ref, - PinnedRef, - BareFn, - UnsafeBinder, - Never, - Tup, - Path, - Pat, - TraitObject, - ImplTrait, - Paren, - Typeof, - Infer, - ImplicitSelf, - MacCall, - CVarArgs, - Dummy, - Err - ]); + record_variants!( + (self, t, t.kind, None, ast, Ty, TyKind), + [ + Slice, + Array, + Ptr, + Ref, + PinnedRef, + BareFn, + UnsafeBinder, + Never, + Tup, + Path, + Pat, + TraitObject, + ImplTrait, + Paren, + Typeof, + Infer, + ImplicitSelf, + MacCall, + CVarArgs, + Dummy, + Err + ] + ); ast_visit::walk_ty(self, t) } @@ -647,11 +676,10 @@ impl<'v> ast_visit::Visitor<'v> for StatCollector<'v> { } fn visit_where_predicate(&mut self, p: &'v ast::WherePredicate) { - record_variants!((self, p, &p.kind, None, ast, WherePredicate, WherePredicateKind), [ - BoundPredicate, - RegionPredicate, - EqPredicate - ]); + record_variants!( + (self, p, &p.kind, None, ast, WherePredicate, WherePredicateKind), + [BoundPredicate, RegionPredicate, EqPredicate] + ); ast_visit::walk_where_predicate(self, p) } @@ -661,21 +689,18 @@ impl<'v> ast_visit::Visitor<'v> for StatCollector<'v> { } fn visit_assoc_item(&mut self, i: &'v ast::AssocItem, ctxt: ast_visit::AssocCtxt) { - record_variants!((self, i, i.kind, None, ast, AssocItem, AssocItemKind), [ - Const, - Fn, - Type, - MacCall, - Delegation, - DelegationMac - ]); + record_variants!( + (self, i, i.kind, None, ast, AssocItem, AssocItemKind), + [Const, Fn, Type, MacCall, Delegation, DelegationMac] + ); ast_visit::walk_assoc_item(self, i, ctxt); } fn visit_param_bound(&mut self, b: &'v ast::GenericBound, _ctxt: BoundKind) { - record_variants!((self, b, b, None, ast, GenericBound, GenericBound), [ - Trait, Outlives, Use - ]); + record_variants!( + (self, b, b, None, ast, GenericBound, GenericBound), + [Trait, Outlives, Use] + ); ast_visit::walk_param_bound(self, b) } @@ -708,18 +733,18 @@ impl<'v> ast_visit::Visitor<'v> for StatCollector<'v> { // common, so we implement `visit_generic_args` and tolerate the double // counting in the former case. fn visit_generic_args(&mut self, g: &'v ast::GenericArgs) { - record_variants!((self, g, g, None, ast, GenericArgs, GenericArgs), [ - AngleBracketed, - Parenthesized, - ParenthesizedElided - ]); + record_variants!( + (self, g, g, None, ast, GenericArgs, GenericArgs), + [AngleBracketed, Parenthesized, ParenthesizedElided] + ); ast_visit::walk_generic_args(self, g) } fn visit_attribute(&mut self, attr: &'v ast::Attribute) { - record_variants!((self, attr, attr.kind, None, ast, Attribute, AttrKind), [ - Normal, DocComment - ]); + record_variants!( + (self, attr, attr.kind, None, ast, Attribute, AttrKind), + [Normal, DocComment] + ); ast_visit::walk_attribute(self, attr) } diff --git a/compiler/rustc_resolve/src/build_reduced_graph.rs b/compiler/rustc_resolve/src/build_reduced_graph.rs index ca7064a36a17b..c6781ecc56681 100644 --- a/compiler/rustc_resolve/src/build_reduced_graph.rs +++ b/compiler/rustc_resolve/src/build_reduced_graph.rs @@ -567,10 +567,13 @@ impl<'a, 'ra, 'tcx> BuildReducedGraphVisitor<'a, 'ra, 'tcx> { Some(rename) => source.ident.span.to(rename.span), None => source.ident.span, }; - self.r.report_error(span, ResolutionError::SelfImportsOnlyAllowedWithin { - root: parent.is_none(), - span_with_rename, - }); + self.r.report_error( + span, + ResolutionError::SelfImportsOnlyAllowedWithin { + root: parent.is_none(), + span_with_rename, + }, + ); // Error recovery: replace `use foo::self;` with `use foo;` if let Some(parent) = module_path.pop() { diff --git a/compiler/rustc_resolve/src/def_collector.rs b/compiler/rustc_resolve/src/def_collector.rs index db607dbb41963..5eb8e420fa4ed 100644 --- a/compiler/rustc_resolve/src/def_collector.rs +++ b/compiler/rustc_resolve/src/def_collector.rs @@ -95,11 +95,14 @@ impl<'a, 'ra, 'tcx> DefCollector<'a, 'ra, 'tcx> { fn visit_macro_invoc(&mut self, id: NodeId) { let id = id.placeholder_to_expn_id(); - let old_parent = self.resolver.invocation_parents.insert(id, InvocationParent { - parent_def: self.parent_def, - impl_trait_context: self.impl_trait_context, - in_attr: self.in_attr, - }); + let old_parent = self.resolver.invocation_parents.insert( + id, + InvocationParent { + parent_def: self.parent_def, + impl_trait_context: self.impl_trait_context, + in_attr: self.in_attr, + }, + ); assert!(old_parent.is_none(), "parent `LocalDefId` is reset for an invocation"); } } diff --git a/compiler/rustc_resolve/src/diagnostics.rs b/compiler/rustc_resolve/src/diagnostics.rs index 8dc752c2cb38d..8d42b478647dc 100644 --- a/compiler/rustc_resolve/src/diagnostics.rs +++ b/compiler/rustc_resolve/src/diagnostics.rs @@ -990,14 +990,10 @@ impl<'ra, 'tcx> Resolver<'ra, 'tcx> { VisResolutionError::AncestorOnly(span) => { self.dcx().create_err(errs::AncestorOnly(span)) } - VisResolutionError::FailedToResolve(span, label, suggestion) => { - self.into_struct_error(span, ResolutionError::FailedToResolve { - segment: None, - label, - suggestion, - module: None, - }) - } + VisResolutionError::FailedToResolve(span, label, suggestion) => self.into_struct_error( + span, + ResolutionError::FailedToResolve { segment: None, label, suggestion, module: None }, + ), VisResolutionError::ExpectedFound(span, path_str, res) => { self.dcx().create_err(errs::ExpectedModuleFound { span, res, path_str }) } diff --git a/compiler/rustc_resolve/src/ident.rs b/compiler/rustc_resolve/src/ident.rs index a3d3e87ade005..499b9bca4d2ad 100644 --- a/compiler/rustc_resolve/src/ident.rs +++ b/compiler/rustc_resolve/src/ident.rs @@ -1181,21 +1181,25 @@ impl<'ra, 'tcx> Resolver<'ra, 'tcx> { } Some(_) => None, }; - (rib_ident.span, AttemptToUseNonConstantValueInConstant { - ident: original_rib_ident_def, - suggestion: "const", - current: "let", - type_span, - }) + ( + rib_ident.span, + AttemptToUseNonConstantValueInConstant { + ident: original_rib_ident_def, + suggestion: "const", + current: "let", + type_span, + }, + ) } - Some((ident, kind)) => { - (span, AttemptToUseNonConstantValueInConstant { + Some((ident, kind)) => ( + span, + AttemptToUseNonConstantValueInConstant { ident, suggestion: "let", current: kind.as_str(), type_span: None, - }) - } + }, + ), }; self.report_error(span, resolution_error); } @@ -1203,10 +1207,13 @@ impl<'ra, 'tcx> Resolver<'ra, 'tcx> { } RibKind::ConstParamTy => { if let Some(span) = finalize { - self.report_error(span, ParamInTyOfConstParam { - name: rib_ident.name, - param_kind: None, - }); + self.report_error( + span, + ParamInTyOfConstParam { + name: rib_ident.name, + param_kind: None, + }, + ); } return Res::Err; } @@ -1287,10 +1294,13 @@ impl<'ra, 'tcx> Resolver<'ra, 'tcx> { } RibKind::ConstParamTy => { if let Some(span) = finalize { - self.report_error(span, ResolutionError::ParamInTyOfConstParam { - name: rib_ident.name, - param_kind: Some(errors::ParamKindInTyOfConstParam::Type), - }); + self.report_error( + span, + ResolutionError::ParamInTyOfConstParam { + name: rib_ident.name, + param_kind: Some(errors::ParamKindInTyOfConstParam::Type), + }, + ); } return Res::Err; } @@ -1353,10 +1363,13 @@ impl<'ra, 'tcx> Resolver<'ra, 'tcx> { } RibKind::ConstParamTy => { if let Some(span) = finalize { - self.report_error(span, ResolutionError::ParamInTyOfConstParam { - name: rib_ident.name, - param_kind: Some(errors::ParamKindInTyOfConstParam::Const), - }); + self.report_error( + span, + ResolutionError::ParamInTyOfConstParam { + name: rib_ident.name, + param_kind: Some(errors::ParamKindInTyOfConstParam::Const), + }, + ); } return Res::Err; } diff --git a/compiler/rustc_resolve/src/imports.rs b/compiler/rustc_resolve/src/imports.rs index d555c93877035..7bbff743ac98c 100644 --- a/compiler/rustc_resolve/src/imports.rs +++ b/compiler/rustc_resolve/src/imports.rs @@ -914,12 +914,15 @@ impl<'ra, 'tcx> Resolver<'ra, 'tcx> { } => { if no_ambiguity { assert!(import.imported_module.get().is_none()); - self.report_error(span, ResolutionError::FailedToResolve { - segment: Some(segment_name), - label, - suggestion, - module, - }); + self.report_error( + span, + ResolutionError::FailedToResolve { + segment: Some(segment_name), + label, + suggestion, + module, + }, + ); } return None; } diff --git a/compiler/rustc_resolve/src/late.rs b/compiler/rustc_resolve/src/late.rs index e37e7e98ee7aa..508bd831ccbea 100644 --- a/compiler/rustc_resolve/src/late.rs +++ b/compiler/rustc_resolve/src/late.rs @@ -1823,9 +1823,11 @@ impl<'a, 'ast, 'ra: 'ast, 'tcx> LateResolutionVisitor<'a, 'ast, 'ra, 'tcx> { && Some(true) == self.diag_metadata.in_non_gat_assoc_type && let crate::ModuleKind::Def(DefKind::Trait, trait_id, _) = module.kind { - if def_id_matches_path(self.r.tcx, trait_id, &[ - "core", "iter", "traits", "iterator", "Iterator", - ]) { + if def_id_matches_path( + self.r.tcx, + trait_id, + &["core", "iter", "traits", "iterator", "Iterator"], + ) { self.r.dcx().emit_err(errors::LendingIteratorReportError { lifetime: lifetime.ident.span, ty: ty.span, @@ -3425,11 +3427,14 @@ impl<'a, 'ast, 'ra: 'ast, 'tcx> LateResolutionVisitor<'a, 'ast, 'ra, 'tcx> { match seen_trait_items.entry(id_in_trait) { Entry::Occupied(entry) => { - self.report_error(span, ResolutionError::TraitImplDuplicate { - name: ident, - old_span: *entry.get(), - trait_item_span: binding.span, - }); + self.report_error( + span, + ResolutionError::TraitImplDuplicate { + name: ident, + old_span: *entry.get(), + trait_item_span: binding.span, + }, + ); return; } Entry::Vacant(entry) => { @@ -3460,13 +3465,16 @@ impl<'a, 'ast, 'ra: 'ast, 'tcx> LateResolutionVisitor<'a, 'ast, 'ra, 'tcx> { } }; let trait_path = path_names_to_string(path); - self.report_error(span, ResolutionError::TraitImplMismatch { - name: ident, - kind, - code, - trait_path, - trait_item_span: binding.span, - }); + self.report_error( + span, + ResolutionError::TraitImplMismatch { + name: ident, + kind, + code, + trait_path, + trait_item_span: binding.span, + }, + ); } fn resolve_const_body(&mut self, expr: &'ast Expr, item: Option<(Ident, ConstantItemKind)>) { @@ -3845,10 +3853,13 @@ impl<'a, 'ast, 'ra: 'ast, 'tcx> LateResolutionVisitor<'a, 'ast, 'ra, 'tcx> { .patterns_with_skipped_bindings .entry(def_id) .or_default() - .push((pat.span, match rest { - ast::PatFieldsRest::Recovered(guar) => Err(*guar), - _ => Ok(()), - })); + .push(( + pat.span, + match rest { + ast::PatFieldsRest::Recovered(guar) => Err(*guar), + _ => Ok(()), + }, + )); } } ast::PatFieldsRest::None => {} @@ -4485,12 +4496,15 @@ impl<'a, 'ast, 'ra: 'ast, 'tcx> LateResolutionVisitor<'a, 'ast, 'ra, 'tcx> { segment_name, error_implied_by_parse_error: _, } => { - return Err(respan(span, ResolutionError::FailedToResolve { - segment: Some(segment_name), - label, - suggestion, - module, - })); + return Err(respan( + span, + ResolutionError::FailedToResolve { + segment: Some(segment_name), + label, + suggestion, + module, + }, + )); } PathResult::Module(..) | PathResult::Failed { .. } => return Ok(None), PathResult::Indeterminate => bug!("indeterminate path result in resolve_qpath"), diff --git a/compiler/rustc_resolve/src/late/diagnostics.rs b/compiler/rustc_resolve/src/late/diagnostics.rs index 57679d595da3e..a80b68d9773d4 100644 --- a/compiler/rustc_resolve/src/late/diagnostics.rs +++ b/compiler/rustc_resolve/src/late/diagnostics.rs @@ -1048,12 +1048,15 @@ impl<'ast, 'ra: 'ast, 'tcx> LateResolutionVisitor<'_, 'ast, 'ra, 'tcx> { debug!("smart_resolve_path_fragment: E0424, source={:?}", source); err.code(E0424); - err.span_label(span, match source { - PathSource::Pat => { - "`self` value is a keyword and may not be bound to variables or shadowed" - } - _ => "`self` value is a keyword only available in methods with a `self` parameter", - }); + err.span_label( + span, + match source { + PathSource::Pat => { + "`self` value is a keyword and may not be bound to variables or shadowed" + } + _ => "`self` value is a keyword only available in methods with a `self` parameter", + }, + ); let is_assoc_fn = self.self_type_is_available(); let self_from_macro = "a `self` parameter, but a macro invocation can only \ access identifiers it receives from parameters"; @@ -2399,15 +2402,18 @@ impl<'ast, 'ra: 'ast, 'tcx> LateResolutionVisitor<'_, 'ast, 'ra, 'tcx> { if module_def_id == def_id { let path = Path { span: name_binding.span, segments: path_segments, tokens: None }; - result = Some((module, ImportSuggestion { - did: Some(def_id), - descr: "module", - path, - accessible: true, - doc_visible, - note: None, - via_import: false, - })); + result = Some(( + module, + ImportSuggestion { + did: Some(def_id), + descr: "module", + path, + accessible: true, + doc_visible, + note: None, + via_import: false, + }, + )); } else { // add the module to the lookup if seen_modules.insert(module_def_id) { diff --git a/compiler/rustc_resolve/src/macros.rs b/compiler/rustc_resolve/src/macros.rs index aeb9672b7583a..cca01a01e9877 100644 --- a/compiler/rustc_resolve/src/macros.rs +++ b/compiler/rustc_resolve/src/macros.rs @@ -888,12 +888,15 @@ impl<'ra, 'tcx> Resolver<'ra, 'tcx> { None, ) }; - self.report_error(span, ResolutionError::FailedToResolve { - segment: path.last().map(|segment| segment.ident.name), - label, - suggestion, - module, - }); + self.report_error( + span, + ResolutionError::FailedToResolve { + segment: path.last().map(|segment| segment.ident.name), + label, + suggestion, + module, + }, + ); } PathResult::Module(..) | PathResult::Indeterminate => unreachable!(), } diff --git a/compiler/rustc_session/src/config/native_libs/tests.rs b/compiler/rustc_session/src/config/native_libs/tests.rs index 3bcab93ef4b8f..287c98fe7ebe6 100644 --- a/compiler/rustc_session/src/config/native_libs/tests.rs +++ b/compiler/rustc_session/src/config/native_libs/tests.rs @@ -14,30 +14,22 @@ fn split() { (":bar", P { kind: None, modifiers: None, name: "", new_name: Some("bar") }), ("kind=foo", P { kind: Some("kind"), modifiers: None, name: "foo", new_name: None }), (":mods=foo", P { kind: Some(""), modifiers: Some("mods"), name: "foo", new_name: None }), - (":mods=:bar", P { - kind: Some(""), - modifiers: Some("mods"), - name: "", - new_name: Some("bar"), - }), - ("kind=foo:bar", P { - kind: Some("kind"), - modifiers: None, - name: "foo", - new_name: Some("bar"), - }), - ("kind:mods=foo", P { - kind: Some("kind"), - modifiers: Some("mods"), - name: "foo", - new_name: None, - }), - ("kind:mods=foo:bar", P { - kind: Some("kind"), - modifiers: Some("mods"), - name: "foo", - new_name: Some("bar"), - }), + ( + ":mods=:bar", + P { kind: Some(""), modifiers: Some("mods"), name: "", new_name: Some("bar") }, + ), + ( + "kind=foo:bar", + P { kind: Some("kind"), modifiers: None, name: "foo", new_name: Some("bar") }, + ), + ( + "kind:mods=foo", + P { kind: Some("kind"), modifiers: Some("mods"), name: "foo", new_name: None }, + ), + ( + "kind:mods=foo:bar", + P { kind: Some("kind"), modifiers: Some("mods"), name: "foo", new_name: Some("bar") }, + ), ("::==::", P { kind: Some(""), modifiers: Some(":"), name: "=", new_name: Some(":") }), ("==::==", P { kind: Some(""), modifiers: None, name: "=", new_name: Some(":==") }), ]; diff --git a/compiler/rustc_session/src/search_paths.rs b/compiler/rustc_session/src/search_paths.rs index 78473fccd2de0..b750d870cb6f7 100644 --- a/compiler/rustc_session/src/search_paths.rs +++ b/compiler/rustc_session/src/search_paths.rs @@ -140,10 +140,10 @@ impl SearchPath { e.ok().and_then(|e| { e.file_name().to_str().map(|s| { let file_name_str: Arc = s.into(); - (Arc::clone(&file_name_str), SearchPathFile { - path: e.path().into(), - file_name_str, - }) + ( + Arc::clone(&file_name_str), + SearchPathFile { path: e.path().into(), file_name_str }, + ) }) }) }) diff --git a/compiler/rustc_smir/src/rustc_smir/convert/ty.rs b/compiler/rustc_smir/src/rustc_smir/convert/ty.rs index a2d95f0f693aa..a0faf20c79a67 100644 --- a/compiler/rustc_smir/src/rustc_smir/convert/ty.rs +++ b/compiler/rustc_smir/src/rustc_smir/convert/ty.rs @@ -771,12 +771,10 @@ impl<'tcx> Stable<'tcx> for ty::RegionKind<'tcx> { index: early_reg.index, name: early_reg.name.to_string(), }), - ty::ReBound(db_index, bound_reg) => { - RegionKind::ReBound(db_index.as_u32(), BoundRegion { - var: bound_reg.var.as_u32(), - kind: bound_reg.kind.stable(tables), - }) - } + ty::ReBound(db_index, bound_reg) => RegionKind::ReBound( + db_index.as_u32(), + BoundRegion { var: bound_reg.var.as_u32(), kind: bound_reg.kind.stable(tables) }, + ), ty::ReStatic => RegionKind::ReStatic, ty::RePlaceholder(place_holder) => { RegionKind::RePlaceholder(stable_mir::ty::Placeholder { diff --git a/compiler/rustc_target/src/spec/base/apple/tests.rs b/compiler/rustc_target/src/spec/base/apple/tests.rs index a7335c9bcaed4..7a985ad4dc056 100644 --- a/compiler/rustc_target/src/spec/base/apple/tests.rs +++ b/compiler/rustc_target/src/spec/base/apple/tests.rs @@ -32,10 +32,13 @@ fn macos_link_environment_unmodified() { for target in all_macos_targets { // macOS targets should only remove information for cross-compiling, but never // for the host. - assert_eq!(target.link_env_remove, crate::spec::cvs![ - "IPHONEOS_DEPLOYMENT_TARGET", - "TVOS_DEPLOYMENT_TARGET", - "XROS_DEPLOYMENT_TARGET" - ],); + assert_eq!( + target.link_env_remove, + crate::spec::cvs![ + "IPHONEOS_DEPLOYMENT_TARGET", + "TVOS_DEPLOYMENT_TARGET", + "XROS_DEPLOYMENT_TARGET" + ], + ); } } diff --git a/compiler/rustc_target/src/spec/base/avr_gnu.rs b/compiler/rustc_target/src/spec/base/avr_gnu.rs index 4f348af21ad99..3554dcfcb4a13 100644 --- a/compiler/rustc_target/src/spec/base/avr_gnu.rs +++ b/compiler/rustc_target/src/spec/base/avr_gnu.rs @@ -28,9 +28,10 @@ pub(crate) fn target(target_cpu: &'static str, mmcu: &'static str) -> Target { linker: Some("avr-gcc".into()), eh_frame_header: false, pre_link_args: TargetOptions::link_args(LinkerFlavor::Gnu(Cc::Yes, Lld::No), &[mmcu]), - late_link_args: TargetOptions::link_args(LinkerFlavor::Gnu(Cc::Yes, Lld::No), &[ - "-lgcc", - ]), + late_link_args: TargetOptions::link_args( + LinkerFlavor::Gnu(Cc::Yes, Lld::No), + &["-lgcc"], + ), max_atomic_width: Some(16), atomic_cas: false, relocation_model: RelocModel::Static, diff --git a/compiler/rustc_target/src/spec/base/fuchsia.rs b/compiler/rustc_target/src/spec/base/fuchsia.rs index 910ee328368db..9deafcac27f15 100644 --- a/compiler/rustc_target/src/spec/base/fuchsia.rs +++ b/compiler/rustc_target/src/spec/base/fuchsia.rs @@ -8,19 +8,22 @@ pub(crate) fn opts() -> TargetOptions { // so we only list them for ld/lld. // // https://github.com/llvm/llvm-project/blob/db9322b2066c55254e7691efeab863f43bfcc084/clang/lib/Driver/ToolChains/Fuchsia.cpp#L31 - let pre_link_args = TargetOptions::link_args(LinkerFlavor::Gnu(Cc::No, Lld::No), &[ - "--build-id", - "--hash-style=gnu", - "-z", - "max-page-size=4096", - "-z", - "now", - "-z", - "rodynamic", - "-z", - "separate-loadable-segments", - "--pack-dyn-relocs=relr", - ]); + let pre_link_args = TargetOptions::link_args( + LinkerFlavor::Gnu(Cc::No, Lld::No), + &[ + "--build-id", + "--hash-style=gnu", + "-z", + "max-page-size=4096", + "-z", + "now", + "-z", + "rodynamic", + "-z", + "separate-loadable-segments", + "--pack-dyn-relocs=relr", + ], + ); TargetOptions { os: "fuchsia".into(), diff --git a/compiler/rustc_target/src/spec/base/illumos.rs b/compiler/rustc_target/src/spec/base/illumos.rs index bb7dfafc53eb3..2391b229e5ba0 100644 --- a/compiler/rustc_target/src/spec/base/illumos.rs +++ b/compiler/rustc_target/src/spec/base/illumos.rs @@ -1,25 +1,28 @@ use crate::spec::{Cc, FramePointer, LinkerFlavor, TargetOptions, cvs}; pub(crate) fn opts() -> TargetOptions { - let late_link_args = TargetOptions::link_args(LinkerFlavor::Unix(Cc::Yes), &[ - // The illumos libc contains a stack unwinding implementation, as - // does libgcc_s. The latter implementation includes several - // additional symbols that are not always in base libc. To force - // the consistent use of just one unwinder, we ensure libc appears - // after libgcc_s in the NEEDED list for the resultant binary by - // ignoring any attempts to add it as a dynamic dependency until the - // very end. - // FIXME: This should be replaced by a more complete and generic - // mechanism for controlling the order of library arguments passed - // to the linker. - "-lc", - // LLVM will insert calls to the stack protector functions - // "__stack_chk_fail" and "__stack_chk_guard" into code in native - // object files. Some platforms include these symbols directly in - // libc, but at least historically these have been provided in - // libssp.so on illumos and Solaris systems. - "-lssp", - ]); + let late_link_args = TargetOptions::link_args( + LinkerFlavor::Unix(Cc::Yes), + &[ + // The illumos libc contains a stack unwinding implementation, as + // does libgcc_s. The latter implementation includes several + // additional symbols that are not always in base libc. To force + // the consistent use of just one unwinder, we ensure libc appears + // after libgcc_s in the NEEDED list for the resultant binary by + // ignoring any attempts to add it as a dynamic dependency until the + // very end. + // FIXME: This should be replaced by a more complete and generic + // mechanism for controlling the order of library arguments passed + // to the linker. + "-lc", + // LLVM will insert calls to the stack protector functions + // "__stack_chk_fail" and "__stack_chk_guard" into code in native + // object files. Some platforms include these symbols directly in + // libc, but at least historically these have been provided in + // libssp.so on illumos and Solaris systems. + "-lssp", + ], + ); TargetOptions { os: "illumos".into(), diff --git a/compiler/rustc_target/src/spec/base/nto_qnx.rs b/compiler/rustc_target/src/spec/base/nto_qnx.rs index 819e68a0500d6..3f35b8b801ab9 100644 --- a/compiler/rustc_target/src/spec/base/nto_qnx.rs +++ b/compiler/rustc_target/src/spec/base/nto_qnx.rs @@ -77,10 +77,10 @@ pub(crate) fn pre_link_args(api_var: ApiVariant, arch: Arch) -> LinkArgs { ApiVariant::Default => { TargetOptions::link_args(LinkerFlavor::Gnu(Cc::Yes, Lld::No), &[qcc_arg]) } - ApiVariant::IoSock => TargetOptions::link_args(LinkerFlavor::Gnu(Cc::Yes, Lld::No), &[ - qcc_arg, - get_iosock_param(arch_lib_dir), - ]), + ApiVariant::IoSock => TargetOptions::link_args( + LinkerFlavor::Gnu(Cc::Yes, Lld::No), + &[qcc_arg, get_iosock_param(arch_lib_dir)], + ), } } diff --git a/compiler/rustc_target/src/spec/base/uefi_msvc.rs b/compiler/rustc_target/src/spec/base/uefi_msvc.rs index b0232ecbe61e7..4766eab7fd7c1 100644 --- a/compiler/rustc_target/src/spec/base/uefi_msvc.rs +++ b/compiler/rustc_target/src/spec/base/uefi_msvc.rs @@ -14,22 +14,25 @@ use crate::spec::{LinkerFlavor, Lld, PanicStrategy, StackProbeType, TargetOption pub(crate) fn opts() -> TargetOptions { let mut base = base::msvc::opts(); - base.add_pre_link_args(LinkerFlavor::Msvc(Lld::No), &[ - // Non-standard subsystems have no default entry-point in PE+ files. We have to define - // one. "efi_main" seems to be a common choice amongst other implementations and the - // spec. - "/entry:efi_main", - // COFF images have a "Subsystem" field in their header, which defines what kind of - // program it is. UEFI has 3 fields reserved, which are EFI_APPLICATION, - // EFI_BOOT_SERVICE_DRIVER, and EFI_RUNTIME_DRIVER. We default to EFI_APPLICATION, - // which is very likely the most common option. Individual projects can override this - // with custom linker flags. - // The subsystem-type only has minor effects on the application. It defines the memory - // regions the application is loaded into (runtime-drivers need to be put into - // reserved areas), as well as whether a return from the entry-point is treated as - // exit (default for applications). - "/subsystem:efi_application", - ]); + base.add_pre_link_args( + LinkerFlavor::Msvc(Lld::No), + &[ + // Non-standard subsystems have no default entry-point in PE+ files. We have to define + // one. "efi_main" seems to be a common choice amongst other implementations and the + // spec. + "/entry:efi_main", + // COFF images have a "Subsystem" field in their header, which defines what kind of + // program it is. UEFI has 3 fields reserved, which are EFI_APPLICATION, + // EFI_BOOT_SERVICE_DRIVER, and EFI_RUNTIME_DRIVER. We default to EFI_APPLICATION, + // which is very likely the most common option. Individual projects can override this + // with custom linker flags. + // The subsystem-type only has minor effects on the application. It defines the memory + // regions the application is loaded into (runtime-drivers need to be put into + // reserved areas), as well as whether a return from the entry-point is treated as + // exit (default for applications). + "/subsystem:efi_application", + ], + ); TargetOptions { os: "uefi".into(), diff --git a/compiler/rustc_target/src/spec/base/windows_gnu.rs b/compiler/rustc_target/src/spec/base/windows_gnu.rs index d8b6ae8cf324e..024b10f2faad7 100644 --- a/compiler/rustc_target/src/spec/base/windows_gnu.rs +++ b/compiler/rustc_target/src/spec/base/windows_gnu.rs @@ -6,19 +6,26 @@ use crate::spec::{ }; pub(crate) fn opts() -> TargetOptions { - let mut pre_link_args = TargetOptions::link_args(LinkerFlavor::Gnu(Cc::No, Lld::No), &[ - // Enable ASLR - "--dynamicbase", - // ASLR will rebase it anyway so leaving that option enabled only leads to confusion - "--disable-auto-image-base", - ]); - add_link_args(&mut pre_link_args, LinkerFlavor::Gnu(Cc::Yes, Lld::No), &[ - // Tell GCC to avoid linker plugins, because we are not bundling - // them with Windows installer, and Rust does its own LTO anyways. - "-fno-use-linker-plugin", - "-Wl,--dynamicbase", - "-Wl,--disable-auto-image-base", - ]); + let mut pre_link_args = TargetOptions::link_args( + LinkerFlavor::Gnu(Cc::No, Lld::No), + &[ + // Enable ASLR + "--dynamicbase", + // ASLR will rebase it anyway so leaving that option enabled only leads to confusion + "--disable-auto-image-base", + ], + ); + add_link_args( + &mut pre_link_args, + LinkerFlavor::Gnu(Cc::Yes, Lld::No), + &[ + // Tell GCC to avoid linker plugins, because we are not bundling + // them with Windows installer, and Rust does its own LTO anyways. + "-fno-use-linker-plugin", + "-Wl,--dynamicbase", + "-Wl,--disable-auto-image-base", + ], + ); // Order of `late_link_args*` was found through trial and error to work with various // mingw-w64 versions (not tested on the CI). It's expected to change from time to time. diff --git a/compiler/rustc_target/src/spec/base/windows_gnullvm.rs b/compiler/rustc_target/src/spec/base/windows_gnullvm.rs index 86e52117dbf75..4a6e7c75200f6 100644 --- a/compiler/rustc_target/src/spec/base/windows_gnullvm.rs +++ b/compiler/rustc_target/src/spec/base/windows_gnullvm.rs @@ -7,18 +7,15 @@ pub(crate) fn opts() -> TargetOptions { // as a path since it's not added to linker search path by the default. // There were attempts to make it behave like libgcc (so one can just use -l) // but LLVM maintainers rejected it: https://reviews.llvm.org/D51440 - let pre_link_args = TargetOptions::link_args(LinkerFlavor::Gnu(Cc::Yes, Lld::No), &[ - "-nolibc", - "--unwindlib=none", - ]); + let pre_link_args = TargetOptions::link_args( + LinkerFlavor::Gnu(Cc::Yes, Lld::No), + &["-nolibc", "--unwindlib=none"], + ); // Order of `late_link_args*` does not matter with LLD. - let late_link_args = TargetOptions::link_args(LinkerFlavor::Gnu(Cc::Yes, Lld::No), &[ - "-lmingw32", - "-lmingwex", - "-lmsvcrt", - "-lkernel32", - "-luser32", - ]); + let late_link_args = TargetOptions::link_args( + LinkerFlavor::Gnu(Cc::Yes, Lld::No), + &["-lmingw32", "-lmingwex", "-lmsvcrt", "-lkernel32", "-luser32"], + ); TargetOptions { os: "windows".into(), diff --git a/compiler/rustc_target/src/spec/json.rs b/compiler/rustc_target/src/spec/json.rs index a6b0ec072e8c0..f703132e51f0a 100644 --- a/compiler/rustc_target/src/spec/json.rs +++ b/compiler/rustc_target/src/spec/json.rs @@ -647,10 +647,10 @@ impl Target { // Each field should have been read using `Json::remove` so any keys remaining are unused. let remaining_keys = obj.keys(); - Ok((base, TargetWarnings { - unused_fields: remaining_keys.cloned().collect(), - incorrect_type, - })) + Ok(( + base, + TargetWarnings { unused_fields: remaining_keys.cloned().collect(), incorrect_type }, + )) } } diff --git a/compiler/rustc_target/src/spec/targets/aarch64_unknown_none.rs b/compiler/rustc_target/src/spec/targets/aarch64_unknown_none.rs index 05fe32734a7e4..27dd713cc5338 100644 --- a/compiler/rustc_target/src/spec/targets/aarch64_unknown_none.rs +++ b/compiler/rustc_target/src/spec/targets/aarch64_unknown_none.rs @@ -16,9 +16,10 @@ pub(crate) fn target() -> Target { linker_flavor: LinkerFlavor::Gnu(Cc::No, Lld::Yes), linker: Some("rust-lld".into()), // Enable the Cortex-A53 errata 843419 mitigation by default - pre_link_args: TargetOptions::link_args(LinkerFlavor::Gnu(Cc::No, Lld::No), &[ - "--fix-cortex-a53-843419", - ]), + pre_link_args: TargetOptions::link_args( + LinkerFlavor::Gnu(Cc::No, Lld::No), + &["--fix-cortex-a53-843419"], + ), features: "+v8a,+strict-align,+neon,+fp-armv8".into(), supported_sanitizers: SanitizerSet::KCFI | SanitizerSet::KERNELADDRESS, relocation_model: RelocModel::Static, diff --git a/compiler/rustc_target/src/spec/targets/aarch64_unknown_nuttx.rs b/compiler/rustc_target/src/spec/targets/aarch64_unknown_nuttx.rs index 582211b02b64d..f7f8dc1e1efb4 100644 --- a/compiler/rustc_target/src/spec/targets/aarch64_unknown_nuttx.rs +++ b/compiler/rustc_target/src/spec/targets/aarch64_unknown_nuttx.rs @@ -16,9 +16,10 @@ pub(crate) fn target() -> Target { linker_flavor: LinkerFlavor::Gnu(Cc::No, Lld::Yes), linker: Some("rust-lld".into()), // Enable the Cortex-A53 errata 843419 mitigation by default - pre_link_args: TargetOptions::link_args(LinkerFlavor::Gnu(Cc::No, Lld::No), &[ - "--fix-cortex-a53-843419", - ]), + pre_link_args: TargetOptions::link_args( + LinkerFlavor::Gnu(Cc::No, Lld::No), + &["--fix-cortex-a53-843419"], + ), features: "+v8a,+strict-align,+neon,+fp-armv8".into(), supported_sanitizers: SanitizerSet::KCFI | SanitizerSet::KERNELADDRESS, relocation_model: RelocModel::Static, diff --git a/compiler/rustc_target/src/spec/targets/arm64ec_pc_windows_msvc.rs b/compiler/rustc_target/src/spec/targets/arm64ec_pc_windows_msvc.rs index 03c96fbfdb0c3..5026c52429e50 100644 --- a/compiler/rustc_target/src/spec/targets/arm64ec_pc_windows_msvc.rs +++ b/compiler/rustc_target/src/spec/targets/arm64ec_pc_windows_msvc.rs @@ -4,10 +4,11 @@ pub(crate) fn target() -> Target { let mut base = base::windows_msvc::opts(); base.max_atomic_width = Some(128); base.features = "+v8a,+neon,+fp-armv8".into(); - add_link_args(&mut base.late_link_args, LinkerFlavor::Msvc(Lld::No), &[ - "/machine:arm64ec", - "softintrin.lib", - ]); + add_link_args( + &mut base.late_link_args, + LinkerFlavor::Msvc(Lld::No), + &["/machine:arm64ec", "softintrin.lib"], + ); Target { llvm_target: "arm64ec-pc-windows-msvc".into(), diff --git a/compiler/rustc_target/src/spec/targets/armv6k_nintendo_3ds.rs b/compiler/rustc_target/src/spec/targets/armv6k_nintendo_3ds.rs index b323d2f86558e..5438811803b4a 100644 --- a/compiler/rustc_target/src/spec/targets/armv6k_nintendo_3ds.rs +++ b/compiler/rustc_target/src/spec/targets/armv6k_nintendo_3ds.rs @@ -5,12 +5,10 @@ use crate::spec::{Cc, FloatAbi, LinkerFlavor, Lld, RelocModel, Target, TargetOpt /// Requires the devkitARM toolchain for 3DS targets on the host system. pub(crate) fn target() -> Target { - let pre_link_args = TargetOptions::link_args(LinkerFlavor::Gnu(Cc::Yes, Lld::No), &[ - "-specs=3dsx.specs", - "-mtune=mpcore", - "-mfloat-abi=hard", - "-mtp=soft", - ]); + let pre_link_args = TargetOptions::link_args( + LinkerFlavor::Gnu(Cc::Yes, Lld::No), + &["-specs=3dsx.specs", "-mtune=mpcore", "-mfloat-abi=hard", "-mtp=soft"], + ); Target { llvm_target: "armv6k-none-eabihf".into(), diff --git a/compiler/rustc_target/src/spec/targets/armv7_sony_vita_newlibeabihf.rs b/compiler/rustc_target/src/spec/targets/armv7_sony_vita_newlibeabihf.rs index 18d834597d87e..f468ac68384a6 100644 --- a/compiler/rustc_target/src/spec/targets/armv7_sony_vita_newlibeabihf.rs +++ b/compiler/rustc_target/src/spec/targets/armv7_sony_vita_newlibeabihf.rs @@ -6,10 +6,10 @@ use crate::spec::{Cc, FloatAbi, LinkerFlavor, Lld, RelocModel, Target, TargetOpt /// Requires the VITASDK toolchain on the host system. pub(crate) fn target() -> Target { - let pre_link_args = TargetOptions::link_args(LinkerFlavor::Gnu(Cc::Yes, Lld::No), &[ - "-Wl,-q", - "-Wl,--pic-veneer", - ]); + let pre_link_args = TargetOptions::link_args( + LinkerFlavor::Gnu(Cc::Yes, Lld::No), + &["-Wl,-q", "-Wl,--pic-veneer"], + ); Target { llvm_target: "thumbv7a-vita-eabihf".into(), diff --git a/compiler/rustc_target/src/spec/targets/i686_pc_windows_gnu.rs b/compiler/rustc_target/src/spec/targets/i686_pc_windows_gnu.rs index 9ef8e120e0de4..208fe50912ca9 100644 --- a/compiler/rustc_target/src/spec/targets/i686_pc_windows_gnu.rs +++ b/compiler/rustc_target/src/spec/targets/i686_pc_windows_gnu.rs @@ -9,11 +9,10 @@ pub(crate) fn target() -> Target { // Mark all dynamic libraries and executables as compatible with the larger 4GiB address // space available to x86 Windows binaries on x86_64. - base.add_pre_link_args(LinkerFlavor::Gnu(Cc::No, Lld::No), &[ - "-m", - "i386pe", - "--large-address-aware", - ]); + base.add_pre_link_args( + LinkerFlavor::Gnu(Cc::No, Lld::No), + &["-m", "i386pe", "--large-address-aware"], + ); base.add_pre_link_args(LinkerFlavor::Gnu(Cc::Yes, Lld::No), &["-Wl,--large-address-aware"]); Target { diff --git a/compiler/rustc_target/src/spec/targets/i686_pc_windows_gnullvm.rs b/compiler/rustc_target/src/spec/targets/i686_pc_windows_gnullvm.rs index 13d3c5532ffd4..5df8dce1aa352 100644 --- a/compiler/rustc_target/src/spec/targets/i686_pc_windows_gnullvm.rs +++ b/compiler/rustc_target/src/spec/targets/i686_pc_windows_gnullvm.rs @@ -9,11 +9,10 @@ pub(crate) fn target() -> Target { // Mark all dynamic libraries and executables as compatible with the larger 4GiB address // space available to x86 Windows binaries on x86_64. - base.add_pre_link_args(LinkerFlavor::Gnu(Cc::No, Lld::No), &[ - "-m", - "i386pe", - "--large-address-aware", - ]); + base.add_pre_link_args( + LinkerFlavor::Gnu(Cc::No, Lld::No), + &["-m", "i386pe", "--large-address-aware"], + ); Target { llvm_target: "i686-pc-windows-gnu".into(), diff --git a/compiler/rustc_target/src/spec/targets/i686_pc_windows_msvc.rs b/compiler/rustc_target/src/spec/targets/i686_pc_windows_msvc.rs index aacad26686315..180750bc7a8b2 100644 --- a/compiler/rustc_target/src/spec/targets/i686_pc_windows_msvc.rs +++ b/compiler/rustc_target/src/spec/targets/i686_pc_windows_msvc.rs @@ -6,15 +6,18 @@ pub(crate) fn target() -> Target { base.max_atomic_width = Some(64); base.supported_sanitizers = SanitizerSet::ADDRESS; - base.add_pre_link_args(LinkerFlavor::Msvc(Lld::No), &[ - // Mark all dynamic libraries and executables as compatible with the larger 4GiB address - // space available to x86 Windows binaries on x86_64. - "/LARGEADDRESSAWARE", - // Ensure the linker will only produce an image if it can also produce a table of - // the image's safe exception handlers. - // https://docs.microsoft.com/en-us/cpp/build/reference/safeseh-image-has-safe-exception-handlers - "/SAFESEH", - ]); + base.add_pre_link_args( + LinkerFlavor::Msvc(Lld::No), + &[ + // Mark all dynamic libraries and executables as compatible with the larger 4GiB address + // space available to x86 Windows binaries on x86_64. + "/LARGEADDRESSAWARE", + // Ensure the linker will only produce an image if it can also produce a table of + // the image's safe exception handlers. + // https://docs.microsoft.com/en-us/cpp/build/reference/safeseh-image-has-safe-exception-handlers + "/SAFESEH", + ], + ); Target { llvm_target: "i686-pc-windows-msvc".into(), diff --git a/compiler/rustc_target/src/spec/targets/i686_uwp_windows_gnu.rs b/compiler/rustc_target/src/spec/targets/i686_uwp_windows_gnu.rs index ffb9926e9444b..6e3733538edf1 100644 --- a/compiler/rustc_target/src/spec/targets/i686_uwp_windows_gnu.rs +++ b/compiler/rustc_target/src/spec/targets/i686_uwp_windows_gnu.rs @@ -8,11 +8,10 @@ pub(crate) fn target() -> Target { // Mark all dynamic libraries and executables as compatible with the larger 4GiB address // space available to x86 Windows binaries on x86_64. - base.add_pre_link_args(LinkerFlavor::Gnu(Cc::No, Lld::No), &[ - "-m", - "i386pe", - "--large-address-aware", - ]); + base.add_pre_link_args( + LinkerFlavor::Gnu(Cc::No, Lld::No), + &["-m", "i386pe", "--large-address-aware"], + ); base.add_pre_link_args(LinkerFlavor::Gnu(Cc::Yes, Lld::No), &["-Wl,--large-address-aware"]); Target { diff --git a/compiler/rustc_target/src/spec/targets/i686_win7_windows_gnu.rs b/compiler/rustc_target/src/spec/targets/i686_win7_windows_gnu.rs index 086a799a68c3b..1d084c0729cc1 100644 --- a/compiler/rustc_target/src/spec/targets/i686_win7_windows_gnu.rs +++ b/compiler/rustc_target/src/spec/targets/i686_win7_windows_gnu.rs @@ -10,11 +10,10 @@ pub(crate) fn target() -> Target { // Mark all dynamic libraries and executables as compatible with the larger 4GiB address // space available to x86 Windows binaries on x86_64. - base.add_pre_link_args(LinkerFlavor::Gnu(Cc::No, Lld::No), &[ - "-m", - "i386pe", - "--large-address-aware", - ]); + base.add_pre_link_args( + LinkerFlavor::Gnu(Cc::No, Lld::No), + &["-m", "i386pe", "--large-address-aware"], + ); base.add_pre_link_args(LinkerFlavor::Gnu(Cc::Yes, Lld::No), &["-Wl,--large-address-aware"]); Target { diff --git a/compiler/rustc_target/src/spec/targets/i686_win7_windows_msvc.rs b/compiler/rustc_target/src/spec/targets/i686_win7_windows_msvc.rs index 173977b77bd13..7efba3aa986ab 100644 --- a/compiler/rustc_target/src/spec/targets/i686_win7_windows_msvc.rs +++ b/compiler/rustc_target/src/spec/targets/i686_win7_windows_msvc.rs @@ -7,15 +7,18 @@ pub(crate) fn target() -> Target { base.max_atomic_width = Some(64); base.supported_sanitizers = SanitizerSet::ADDRESS; - base.add_pre_link_args(LinkerFlavor::Msvc(Lld::No), &[ - // Mark all dynamic libraries and executables as compatible with the larger 4GiB address - // space available to x86 Windows binaries on x86_64. - "/LARGEADDRESSAWARE", - // Ensure the linker will only produce an image if it can also produce a table of - // the image's safe exception handlers. - // https://docs.microsoft.com/en-us/cpp/build/reference/safeseh-image-has-safe-exception-handlers - "/SAFESEH", - ]); + base.add_pre_link_args( + LinkerFlavor::Msvc(Lld::No), + &[ + // Mark all dynamic libraries and executables as compatible with the larger 4GiB address + // space available to x86 Windows binaries on x86_64. + "/LARGEADDRESSAWARE", + // Ensure the linker will only produce an image if it can also produce a table of + // the image's safe exception handlers. + // https://docs.microsoft.com/en-us/cpp/build/reference/safeseh-image-has-safe-exception-handlers + "/SAFESEH", + ], + ); Target { llvm_target: "i686-pc-windows-msvc".into(), diff --git a/compiler/rustc_target/src/spec/targets/mipsel_sony_psp.rs b/compiler/rustc_target/src/spec/targets/mipsel_sony_psp.rs index bf51d86437212..2c63b0f2f3845 100644 --- a/compiler/rustc_target/src/spec/targets/mipsel_sony_psp.rs +++ b/compiler/rustc_target/src/spec/targets/mipsel_sony_psp.rs @@ -4,10 +4,10 @@ use crate::spec::{Cc, LinkerFlavor, Lld, RelocModel, Target, TargetOptions, cvs} const LINKER_SCRIPT: &str = include_str!("./mipsel_sony_psp_linker_script.ld"); pub(crate) fn target() -> Target { - let pre_link_args = TargetOptions::link_args(LinkerFlavor::Gnu(Cc::No, Lld::No), &[ - "--emit-relocs", - "--nmagic", - ]); + let pre_link_args = TargetOptions::link_args( + LinkerFlavor::Gnu(Cc::No, Lld::No), + &["--emit-relocs", "--nmagic"], + ); Target { llvm_target: "mipsel-sony-psp".into(), diff --git a/compiler/rustc_target/src/spec/targets/powerpc64_ibm_aix.rs b/compiler/rustc_target/src/spec/targets/powerpc64_ibm_aix.rs index edabbbf5f005b..2125c95e2664c 100644 --- a/compiler/rustc_target/src/spec/targets/powerpc64_ibm_aix.rs +++ b/compiler/rustc_target/src/spec/targets/powerpc64_ibm_aix.rs @@ -3,12 +3,10 @@ use crate::spec::{Cc, LinkerFlavor, Target, base}; pub(crate) fn target() -> Target { let mut base = base::aix::opts(); base.max_atomic_width = Some(64); - base.add_pre_link_args(LinkerFlavor::Unix(Cc::No), &[ - "-b64", - "-bpT:0x100000000", - "-bpD:0x110000000", - "-bcdtors:all:0:s", - ]); + base.add_pre_link_args( + LinkerFlavor::Unix(Cc::No), + &["-b64", "-bpT:0x100000000", "-bpD:0x110000000", "-bcdtors:all:0:s"], + ); Target { llvm_target: "powerpc64-ibm-aix".into(), diff --git a/compiler/rustc_target/src/spec/targets/powerpc_unknown_freebsd.rs b/compiler/rustc_target/src/spec/targets/powerpc_unknown_freebsd.rs index 9cfc2153ac170..890fae67d76ff 100644 --- a/compiler/rustc_target/src/spec/targets/powerpc_unknown_freebsd.rs +++ b/compiler/rustc_target/src/spec/targets/powerpc_unknown_freebsd.rs @@ -4,10 +4,10 @@ use crate::spec::{Cc, LinkerFlavor, Lld, StackProbeType, Target, TargetOptions, pub(crate) fn target() -> Target { let mut base = base::freebsd::opts(); // Extra hint to linker that we are generating secure-PLT code. - base.add_pre_link_args(LinkerFlavor::Gnu(Cc::Yes, Lld::No), &[ - "-m32", - "--target=powerpc-unknown-freebsd13.0", - ]); + base.add_pre_link_args( + LinkerFlavor::Gnu(Cc::Yes, Lld::No), + &["-m32", "--target=powerpc-unknown-freebsd13.0"], + ); base.max_atomic_width = Some(32); base.stack_probes = StackProbeType::Inline; diff --git a/compiler/rustc_target/src/spec/targets/sparc_unknown_linux_gnu.rs b/compiler/rustc_target/src/spec/targets/sparc_unknown_linux_gnu.rs index 45941cd7c0164..c92a01c40cf9a 100644 --- a/compiler/rustc_target/src/spec/targets/sparc_unknown_linux_gnu.rs +++ b/compiler/rustc_target/src/spec/targets/sparc_unknown_linux_gnu.rs @@ -17,9 +17,10 @@ pub(crate) fn target() -> Target { features: "+v8plus".into(), cpu: "v9".into(), endian: Endian::Big, - late_link_args: TargetOptions::link_args(LinkerFlavor::Gnu(Cc::Yes, Lld::No), &[ - "-mcpu=v9", "-m32", - ]), + late_link_args: TargetOptions::link_args( + LinkerFlavor::Gnu(Cc::Yes, Lld::No), + &["-mcpu=v9", "-m32"], + ), max_atomic_width: Some(32), ..base::linux_gnu::opts() }, diff --git a/compiler/rustc_target/src/spec/targets/wasm32_unknown_unknown.rs b/compiler/rustc_target/src/spec/targets/wasm32_unknown_unknown.rs index 96237f208917c..bcf7b69fe74a1 100644 --- a/compiler/rustc_target/src/spec/targets/wasm32_unknown_unknown.rs +++ b/compiler/rustc_target/src/spec/targets/wasm32_unknown_unknown.rs @@ -16,17 +16,23 @@ pub(crate) fn target() -> Target { let mut options = base::wasm::options(); options.os = "unknown".into(); - options.add_pre_link_args(LinkerFlavor::WasmLld(Cc::No), &[ - // For now this target just never has an entry symbol no matter the output - // type, so unconditionally pass this. - "--no-entry", - ]); - options.add_pre_link_args(LinkerFlavor::WasmLld(Cc::Yes), &[ - // Make sure clang uses LLD as its linker and is configured appropriately - // otherwise - "--target=wasm32-unknown-unknown", - "-Wl,--no-entry", - ]); + options.add_pre_link_args( + LinkerFlavor::WasmLld(Cc::No), + &[ + // For now this target just never has an entry symbol no matter the output + // type, so unconditionally pass this. + "--no-entry", + ], + ); + options.add_pre_link_args( + LinkerFlavor::WasmLld(Cc::Yes), + &[ + // Make sure clang uses LLD as its linker and is configured appropriately + // otherwise + "--target=wasm32-unknown-unknown", + "-Wl,--no-entry", + ], + ); Target { llvm_target: "wasm32-unknown-unknown".into(), diff --git a/compiler/rustc_target/src/spec/targets/wasm32_wasip1_threads.rs b/compiler/rustc_target/src/spec/targets/wasm32_wasip1_threads.rs index 0c2e2bfeda6d6..2411d386f52f3 100644 --- a/compiler/rustc_target/src/spec/targets/wasm32_wasip1_threads.rs +++ b/compiler/rustc_target/src/spec/targets/wasm32_wasip1_threads.rs @@ -15,17 +15,19 @@ pub(crate) fn target() -> Target { options.os = "wasi".into(); options.env = "p1".into(); - options.add_pre_link_args(LinkerFlavor::WasmLld(Cc::No), &[ - "--import-memory", - "--export-memory", - "--shared-memory", - ]); - options.add_pre_link_args(LinkerFlavor::WasmLld(Cc::Yes), &[ - "--target=wasm32-wasip1-threads", - "-Wl,--import-memory", - "-Wl,--export-memory,", - "-Wl,--shared-memory", - ]); + options.add_pre_link_args( + LinkerFlavor::WasmLld(Cc::No), + &["--import-memory", "--export-memory", "--shared-memory"], + ); + options.add_pre_link_args( + LinkerFlavor::WasmLld(Cc::Yes), + &[ + "--target=wasm32-wasip1-threads", + "-Wl,--import-memory", + "-Wl,--export-memory,", + "-Wl,--shared-memory", + ], + ); options.pre_link_objects_self_contained = crt_objects::pre_wasi_self_contained(); options.post_link_objects_self_contained = crt_objects::post_wasi_self_contained(); diff --git a/compiler/rustc_target/src/spec/targets/wasm32v1_none.rs b/compiler/rustc_target/src/spec/targets/wasm32v1_none.rs index 5c35e9c21d3c1..ab1dc21d125f4 100644 --- a/compiler/rustc_target/src/spec/targets/wasm32v1_none.rs +++ b/compiler/rustc_target/src/spec/targets/wasm32v1_none.rs @@ -23,17 +23,23 @@ pub(crate) fn target() -> Target { options.cpu = "mvp".into(); options.features = "+mutable-globals".into(); - options.add_pre_link_args(LinkerFlavor::WasmLld(Cc::No), &[ - // For now this target just never has an entry symbol no matter the output - // type, so unconditionally pass this. - "--no-entry", - ]); - options.add_pre_link_args(LinkerFlavor::WasmLld(Cc::Yes), &[ - // Make sure clang uses LLD as its linker and is configured appropriately - // otherwise - "--target=wasm32-unknown-unknown", - "-Wl,--no-entry", - ]); + options.add_pre_link_args( + LinkerFlavor::WasmLld(Cc::No), + &[ + // For now this target just never has an entry symbol no matter the output + // type, so unconditionally pass this. + "--no-entry", + ], + ); + options.add_pre_link_args( + LinkerFlavor::WasmLld(Cc::Yes), + &[ + // Make sure clang uses LLD as its linker and is configured appropriately + // otherwise + "--target=wasm32-unknown-unknown", + "-Wl,--no-entry", + ], + ); Target { llvm_target: "wasm32-unknown-unknown".into(), diff --git a/compiler/rustc_target/src/spec/targets/wasm64_unknown_unknown.rs b/compiler/rustc_target/src/spec/targets/wasm64_unknown_unknown.rs index 22fa26d3cdbd9..596e26d1e9da1 100644 --- a/compiler/rustc_target/src/spec/targets/wasm64_unknown_unknown.rs +++ b/compiler/rustc_target/src/spec/targets/wasm64_unknown_unknown.rs @@ -13,18 +13,24 @@ pub(crate) fn target() -> Target { let mut options = base::wasm::options(); options.os = "unknown".into(); - options.add_pre_link_args(LinkerFlavor::WasmLld(Cc::No), &[ - // For now this target just never has an entry symbol no matter the output - // type, so unconditionally pass this. - "--no-entry", - "-mwasm64", - ]); - options.add_pre_link_args(LinkerFlavor::WasmLld(Cc::Yes), &[ - // Make sure clang uses LLD as its linker and is configured appropriately - // otherwise - "--target=wasm64-unknown-unknown", - "-Wl,--no-entry", - ]); + options.add_pre_link_args( + LinkerFlavor::WasmLld(Cc::No), + &[ + // For now this target just never has an entry symbol no matter the output + // type, so unconditionally pass this. + "--no-entry", + "-mwasm64", + ], + ); + options.add_pre_link_args( + LinkerFlavor::WasmLld(Cc::Yes), + &[ + // Make sure clang uses LLD as its linker and is configured appropriately + // otherwise + "--target=wasm64-unknown-unknown", + "-Wl,--no-entry", + ], + ); // Any engine that implements wasm64 will surely implement the rest of these // features since they were all merged into the official spec by the time diff --git a/compiler/rustc_target/src/spec/targets/x86_64_fortanix_unknown_sgx.rs b/compiler/rustc_target/src/spec/targets/x86_64_fortanix_unknown_sgx.rs index 65c3163463093..60d078371bb67 100644 --- a/compiler/rustc_target/src/spec/targets/x86_64_fortanix_unknown_sgx.rs +++ b/compiler/rustc_target/src/spec/targets/x86_64_fortanix_unknown_sgx.rs @@ -3,37 +3,40 @@ use std::borrow::Cow; use crate::spec::{Cc, LinkerFlavor, Lld, Target, TargetOptions, cvs}; pub(crate) fn target() -> Target { - let pre_link_args = TargetOptions::link_args(LinkerFlavor::Gnu(Cc::No, Lld::No), &[ - "-e", - "elf_entry", - "-Bstatic", - "--gc-sections", - "-z", - "text", - "-z", - "norelro", - "--no-undefined", - "--error-unresolved-symbols", - "--no-undefined-version", - "-Bsymbolic", - "--export-dynamic", - // The following symbols are needed by libunwind, which is linked after - // libstd. Make sure they're included in the link. - "-u", - "__rust_abort", - "-u", - "__rust_c_alloc", - "-u", - "__rust_c_dealloc", - "-u", - "__rust_print_err", - "-u", - "__rust_rwlock_rdlock", - "-u", - "__rust_rwlock_unlock", - "-u", - "__rust_rwlock_wrlock", - ]); + let pre_link_args = TargetOptions::link_args( + LinkerFlavor::Gnu(Cc::No, Lld::No), + &[ + "-e", + "elf_entry", + "-Bstatic", + "--gc-sections", + "-z", + "text", + "-z", + "norelro", + "--no-undefined", + "--error-unresolved-symbols", + "--no-undefined-version", + "-Bsymbolic", + "--export-dynamic", + // The following symbols are needed by libunwind, which is linked after + // libstd. Make sure they're included in the link. + "-u", + "__rust_abort", + "-u", + "__rust_c_alloc", + "-u", + "__rust_c_dealloc", + "-u", + "__rust_print_err", + "-u", + "__rust_rwlock_rdlock", + "-u", + "__rust_rwlock_unlock", + "-u", + "__rust_rwlock_wrlock", + ], + ); const EXPORT_SYMBOLS: &[&str] = &[ "sgx_entry", diff --git a/compiler/rustc_target/src/spec/targets/x86_64_pc_windows_gnu.rs b/compiler/rustc_target/src/spec/targets/x86_64_pc_windows_gnu.rs index e0ffcaf5a72b6..b10d4478d5ecf 100644 --- a/compiler/rustc_target/src/spec/targets/x86_64_pc_windows_gnu.rs +++ b/compiler/rustc_target/src/spec/targets/x86_64_pc_windows_gnu.rs @@ -6,11 +6,10 @@ pub(crate) fn target() -> Target { base.features = "+cx16,+sse3,+sahf".into(); base.plt_by_default = false; // Use high-entropy 64 bit address space for ASLR - base.add_pre_link_args(LinkerFlavor::Gnu(Cc::No, Lld::No), &[ - "-m", - "i386pep", - "--high-entropy-va", - ]); + base.add_pre_link_args( + LinkerFlavor::Gnu(Cc::No, Lld::No), + &["-m", "i386pep", "--high-entropy-va"], + ); base.add_pre_link_args(LinkerFlavor::Gnu(Cc::Yes, Lld::No), &["-m64", "-Wl,--high-entropy-va"]); base.max_atomic_width = Some(128); base.linker = Some("x86_64-w64-mingw32-gcc".into()); diff --git a/compiler/rustc_target/src/spec/targets/x86_64_uwp_windows_gnu.rs b/compiler/rustc_target/src/spec/targets/x86_64_uwp_windows_gnu.rs index fd10bc087efe7..0ef41d315af12 100644 --- a/compiler/rustc_target/src/spec/targets/x86_64_uwp_windows_gnu.rs +++ b/compiler/rustc_target/src/spec/targets/x86_64_uwp_windows_gnu.rs @@ -6,11 +6,10 @@ pub(crate) fn target() -> Target { base.features = "+cx16,+sse3,+sahf".into(); base.plt_by_default = false; // Use high-entropy 64 bit address space for ASLR - base.add_pre_link_args(LinkerFlavor::Gnu(Cc::No, Lld::No), &[ - "-m", - "i386pep", - "--high-entropy-va", - ]); + base.add_pre_link_args( + LinkerFlavor::Gnu(Cc::No, Lld::No), + &["-m", "i386pep", "--high-entropy-va"], + ); base.add_pre_link_args(LinkerFlavor::Gnu(Cc::Yes, Lld::No), &["-m64", "-Wl,--high-entropy-va"]); base.max_atomic_width = Some(128); diff --git a/compiler/rustc_target/src/spec/targets/x86_64_win7_windows_gnu.rs b/compiler/rustc_target/src/spec/targets/x86_64_win7_windows_gnu.rs index d40df5a3e7d64..8f903934a90fb 100644 --- a/compiler/rustc_target/src/spec/targets/x86_64_win7_windows_gnu.rs +++ b/compiler/rustc_target/src/spec/targets/x86_64_win7_windows_gnu.rs @@ -6,11 +6,10 @@ pub(crate) fn target() -> Target { base.cpu = "x86-64".into(); base.plt_by_default = false; // Use high-entropy 64 bit address space for ASLR - base.add_pre_link_args(LinkerFlavor::Gnu(Cc::No, Lld::No), &[ - "-m", - "i386pep", - "--high-entropy-va", - ]); + base.add_pre_link_args( + LinkerFlavor::Gnu(Cc::No, Lld::No), + &["-m", "i386pep", "--high-entropy-va"], + ); base.add_pre_link_args(LinkerFlavor::Gnu(Cc::Yes, Lld::No), &["-m64", "-Wl,--high-entropy-va"]); base.max_atomic_width = Some(64); base.linker = Some("x86_64-w64-mingw32-gcc".into()); diff --git a/compiler/rustc_target/src/target_features.rs b/compiler/rustc_target/src/target_features.rs index e423ca71dfcbb..ea7c15a359538 100644 --- a/compiler/rustc_target/src/target_features.rs +++ b/compiler/rustc_target/src/target_features.rs @@ -341,13 +341,17 @@ static AARCH64_FEATURES: &[(&str, Stability, ImpliedFeatures)] = &[ ("sve2p1", Unstable(sym::aarch64_unstable_target_feature), &["sve2"]), // FEAT_TME ("tme", Stable, &[]), - ("v8.1a", Unstable(sym::aarch64_ver_target_feature), &[ - "crc", "lse", "rdm", "pan", "lor", "vh", - ]), + ( + "v8.1a", + Unstable(sym::aarch64_ver_target_feature), + &["crc", "lse", "rdm", "pan", "lor", "vh"], + ), ("v8.2a", Unstable(sym::aarch64_ver_target_feature), &["v8.1a", "ras", "dpb"]), - ("v8.3a", Unstable(sym::aarch64_ver_target_feature), &[ - "v8.2a", "rcpc", "paca", "pacg", "jsconv", - ]), + ( + "v8.3a", + Unstable(sym::aarch64_ver_target_feature), + &["v8.2a", "rcpc", "paca", "pacg", "jsconv"], + ), ("v8.4a", Unstable(sym::aarch64_ver_target_feature), &["v8.3a", "dotprod", "dit", "flagm"]), ("v8.5a", Unstable(sym::aarch64_ver_target_feature), &["v8.4a", "ssbs", "sb", "dpb2", "bti"]), ("v8.6a", Unstable(sym::aarch64_ver_target_feature), &["v8.5a", "bf16", "i8mm"]), diff --git a/compiler/rustc_trait_selection/src/error_reporting/infer/nice_region_error/static_impl_trait.rs b/compiler/rustc_trait_selection/src/error_reporting/infer/nice_region_error/static_impl_trait.rs index dfbef39e9e18d..039e21cb5562d 100644 --- a/compiler/rustc_trait_selection/src/error_reporting/infer/nice_region_error/static_impl_trait.rs +++ b/compiler/rustc_trait_selection/src/error_reporting/infer/nice_region_error/static_impl_trait.rs @@ -323,9 +323,12 @@ pub fn suggest_new_region_bound( .params .iter() .filter(|p| { - matches!(p.kind, GenericParamKind::Lifetime { - kind: hir::LifetimeParamKind::Explicit - }) + matches!( + p.kind, + GenericParamKind::Lifetime { + kind: hir::LifetimeParamKind::Explicit + } + ) }) .map(|p| { if let hir::ParamName::Plain(name) = p.name { diff --git a/compiler/rustc_trait_selection/src/error_reporting/traits/fulfillment_errors.rs b/compiler/rustc_trait_selection/src/error_reporting/traits/fulfillment_errors.rs index 3128577776a8e..1b43820bac0c5 100644 --- a/compiler/rustc_trait_selection/src/error_reporting/traits/fulfillment_errors.rs +++ b/compiler/rustc_trait_selection/src/error_reporting/traits/fulfillment_errors.rs @@ -1837,13 +1837,16 @@ impl<'a, 'tcx> TypeErrCtxt<'a, 'tcx> { } } span.push_span_label(self.tcx.def_span(other_trait_def_id), "this is the found trait"); - err.highlighted_span_note(span, vec![ - StringPart::normal("there are ".to_string()), - StringPart::highlighted("multiple different versions".to_string()), - StringPart::normal(" of crate `".to_string()), - StringPart::highlighted(format!("{crate_name}")), - StringPart::normal("` in the dependency graph\n".to_string()), - ]); + err.highlighted_span_note( + span, + vec![ + StringPart::normal("there are ".to_string()), + StringPart::highlighted("multiple different versions".to_string()), + StringPart::normal(" of crate `".to_string()), + StringPart::highlighted(format!("{crate_name}")), + StringPart::normal("` in the dependency graph\n".to_string()), + ], + ); if points_at_type { // We only clarify that the same type from different crate versions are not the // same when we *find* the same type coming from different crate versions, otherwise @@ -2977,12 +2980,10 @@ impl<'a, 'tcx> TypeErrCtxt<'a, 'tcx> { .inputs .iter() .map(|arg| match arg.kind { - hir::TyKind::Tup(tys) => { - ArgKind::Tuple(Some(arg.span), vec![ - ("_".to_owned(), "_".to_owned()); - tys.len() - ]) - } + hir::TyKind::Tup(tys) => ArgKind::Tuple( + Some(arg.span), + vec![("_".to_owned(), "_".to_owned()); tys.len()], + ), _ => ArgKind::empty(), }) .collect::>(), diff --git a/compiler/rustc_trait_selection/src/error_reporting/traits/suggestions.rs b/compiler/rustc_trait_selection/src/error_reporting/traits/suggestions.rs index c194cc11727dd..527d2e54e4327 100644 --- a/compiler/rustc_trait_selection/src/error_reporting/traits/suggestions.rs +++ b/compiler/rustc_trait_selection/src/error_reporting/traits/suggestions.rs @@ -640,10 +640,10 @@ impl<'a, 'tcx> TypeErrCtxt<'a, 'tcx> { } // Empty suggestions with empty spans ICE with debug assertions if steps == 0 { - return (msg.trim_end_matches(" and dereferencing instead"), vec![( - prefix_span, - String::new(), - )]); + return ( + msg.trim_end_matches(" and dereferencing instead"), + vec![(prefix_span, String::new())], + ); } let derefs = "*".repeat(steps); let needs_parens = steps > 0 @@ -3552,10 +3552,11 @@ impl<'a, 'tcx> TypeErrCtxt<'a, 'tcx> { } ObligationCauseCode::TrivialBound => { err.help("see issue #48214"); - tcx.disabled_nightly_features(err, Some(tcx.local_def_id_to_hir_id(body_id)), [( - String::new(), - sym::trivial_bounds, - )]); + tcx.disabled_nightly_features( + err, + Some(tcx.local_def_id_to_hir_id(body_id)), + [(String::new(), sym::trivial_bounds)], + ); } ObligationCauseCode::OpaqueReturnType(expr_info) => { let (expr_ty, expr) = if let Some((expr_ty, hir_id)) = expr_info { diff --git a/compiler/rustc_trait_selection/src/solve/fulfill/derive_errors.rs b/compiler/rustc_trait_selection/src/solve/fulfill/derive_errors.rs index 8edd623e5d00c..7364b4aa34380 100644 --- a/compiler/rustc_trait_selection/src/solve/fulfill/derive_errors.rs +++ b/compiler/rustc_trait_selection/src/solve/fulfill/derive_errors.rs @@ -153,10 +153,10 @@ fn find_best_leaf_obligation<'tcx>( infcx .fudge_inference_if_ok(|| { infcx - .visit_proof_tree(obligation.clone().into(), &mut BestObligation { - obligation: obligation.clone(), - consider_ambiguities, - }) + .visit_proof_tree( + obligation.clone().into(), + &mut BestObligation { obligation: obligation.clone(), consider_ambiguities }, + ) .break_value() .ok_or(()) }) diff --git a/compiler/rustc_trait_selection/src/solve/normalize.rs b/compiler/rustc_trait_selection/src/solve/normalize.rs index a724705ffe912..232357dc71a0d 100644 --- a/compiler/rustc_trait_selection/src/solve/normalize.rs +++ b/compiler/rustc_trait_selection/src/solve/normalize.rs @@ -130,11 +130,12 @@ where self.depth += 1; let new_infer_ct = infcx.next_const_var(self.at.cause.span); - let obligation = - Obligation::new(tcx, self.at.cause.clone(), self.at.param_env, ty::NormalizesTo { - alias: uv.into(), - term: new_infer_ct.into(), - }); + let obligation = Obligation::new( + tcx, + self.at.cause.clone(), + self.at.param_env, + ty::NormalizesTo { alias: uv.into(), term: new_infer_ct.into() }, + ); let result = if infcx.predicate_may_hold(&obligation) { self.fulfill_cx.register_predicate_obligation(infcx, obligation); @@ -252,20 +253,20 @@ impl<'tcx> TypeFolder> for DeeplyNormalizeForDiagnosticsFolder<'_, } fn fold_ty(&mut self, ty: Ty<'tcx>) -> Ty<'tcx> { - deeply_normalize_with_skipped_universes(self.at, ty, vec![ - None; - ty.outer_exclusive_binder() - .as_usize() - ]) + deeply_normalize_with_skipped_universes( + self.at, + ty, + vec![None; ty.outer_exclusive_binder().as_usize()], + ) .unwrap_or_else(|_: Vec>| ty.super_fold_with(self)) } fn fold_const(&mut self, ct: ty::Const<'tcx>) -> ty::Const<'tcx> { - deeply_normalize_with_skipped_universes(self.at, ct, vec![ - None; - ct.outer_exclusive_binder() - .as_usize() - ]) + deeply_normalize_with_skipped_universes( + self.at, + ct, + vec![None; ct.outer_exclusive_binder().as_usize()], + ) .unwrap_or_else(|_: Vec>| ct.super_fold_with(self)) } } diff --git a/compiler/rustc_trait_selection/src/traits/coherence.rs b/compiler/rustc_trait_selection/src/traits/coherence.rs index 7ee9eb4530989..3b40882ef572d 100644 --- a/compiler/rustc_trait_selection/src/traits/coherence.rs +++ b/compiler/rustc_trait_selection/src/traits/coherence.rs @@ -368,9 +368,10 @@ fn impl_intersection_has_impossible_obligation<'a, 'cx, 'tcx>( overflowing_predicates: ambiguities .into_iter() .filter(|error| { - matches!(error.code, FulfillmentErrorCode::Ambiguity { - overflow: Some(true) - }) + matches!( + error.code, + FulfillmentErrorCode::Ambiguity { overflow: Some(true) } + ) }) .map(|e| infcx.resolve_vars_if_possible(e.obligation.predicate)) .collect(), @@ -491,13 +492,16 @@ fn plug_infer_with_placeholders<'tcx>( // Comparing against a type variable never registers hidden types anyway DefineOpaqueTypes::Yes, ty, - Ty::new_placeholder(self.infcx.tcx, ty::Placeholder { - universe: self.universe, - bound: ty::BoundTy { - var: self.next_var(), - kind: ty::BoundTyKind::Anon, + Ty::new_placeholder( + self.infcx.tcx, + ty::Placeholder { + universe: self.universe, + bound: ty::BoundTy { + var: self.next_var(), + kind: ty::BoundTyKind::Anon, + }, }, - }), + ), ) else { bug!("we always expect to be able to plug an infer var with placeholder") @@ -517,10 +521,10 @@ fn plug_infer_with_placeholders<'tcx>( // registration happening anyway. DefineOpaqueTypes::Yes, ct, - ty::Const::new_placeholder(self.infcx.tcx, ty::Placeholder { - universe: self.universe, - bound: self.next_var(), - }), + ty::Const::new_placeholder( + self.infcx.tcx, + ty::Placeholder { universe: self.universe, bound: self.next_var() }, + ), ) else { bug!("we always expect to be able to plug an infer var with placeholder") @@ -545,13 +549,16 @@ fn plug_infer_with_placeholders<'tcx>( // Lifetimes don't contain opaque types (or any types for that matter). DefineOpaqueTypes::Yes, r, - ty::Region::new_placeholder(self.infcx.tcx, ty::Placeholder { - universe: self.universe, - bound: ty::BoundRegion { - var: self.next_var(), - kind: ty::BoundRegionKind::Anon, + ty::Region::new_placeholder( + self.infcx.tcx, + ty::Placeholder { + universe: self.universe, + bound: ty::BoundRegion { + var: self.next_var(), + kind: ty::BoundRegionKind::Anon, + }, }, - }), + ), ) else { bug!("we always expect to be able to plug an infer var with placeholder") @@ -763,9 +770,9 @@ fn search_ambiguity_causes<'tcx>( causes: &mut FxIndexSet>, ) { infcx.probe(|_| { - infcx.visit_proof_tree(goal, &mut AmbiguityCausesVisitor { - cache: Default::default(), - causes, - }) + infcx.visit_proof_tree( + goal, + &mut AmbiguityCausesVisitor { cache: Default::default(), causes }, + ) }); } diff --git a/compiler/rustc_trait_selection/src/traits/mod.rs b/compiler/rustc_trait_selection/src/traits/mod.rs index d4a9664e28280..105cb9175717d 100644 --- a/compiler/rustc_trait_selection/src/traits/mod.rs +++ b/compiler/rustc_trait_selection/src/traits/mod.rs @@ -660,13 +660,16 @@ fn replace_param_and_infer_args_with_placeholder<'tcx>( self.idx += 1; idx }; - Ty::new_placeholder(self.tcx, ty::PlaceholderType { - universe: ty::UniverseIndex::ROOT, - bound: ty::BoundTy { - var: ty::BoundVar::from_u32(idx), - kind: ty::BoundTyKind::Anon, + Ty::new_placeholder( + self.tcx, + ty::PlaceholderType { + universe: ty::UniverseIndex::ROOT, + bound: ty::BoundTy { + var: ty::BoundVar::from_u32(idx), + kind: ty::BoundTyKind::Anon, + }, }, - }) + ) } else { t.super_fold_with(self) } @@ -674,14 +677,17 @@ fn replace_param_and_infer_args_with_placeholder<'tcx>( fn fold_const(&mut self, c: ty::Const<'tcx>) -> ty::Const<'tcx> { if let ty::ConstKind::Infer(_) = c.kind() { - ty::Const::new_placeholder(self.tcx, ty::PlaceholderConst { - universe: ty::UniverseIndex::ROOT, - bound: ty::BoundVar::from_u32({ - let idx = self.idx; - self.idx += 1; - idx - }), - }) + ty::Const::new_placeholder( + self.tcx, + ty::PlaceholderConst { + universe: ty::UniverseIndex::ROOT, + bound: ty::BoundVar::from_u32({ + let idx = self.idx; + self.idx += 1; + idx + }), + }, + ) } else { c.super_fold_with(self) } diff --git a/compiler/rustc_trait_selection/src/traits/project.rs b/compiler/rustc_trait_selection/src/traits/project.rs index 537b042bde529..de5aaa5bd9729 100644 --- a/compiler/rustc_trait_selection/src/traits/project.rs +++ b/compiler/rustc_trait_selection/src/traits/project.rs @@ -1670,14 +1670,18 @@ fn confirm_closure_candidate<'cx, 'tcx>( } else { let upvars_projection_def_id = tcx.require_lang_item(LangItem::AsyncFnKindUpvars, None); - let tupled_upvars_ty = Ty::new_projection(tcx, upvars_projection_def_id, [ - ty::GenericArg::from(kind_ty), - Ty::from_closure_kind(tcx, ty::ClosureKind::FnOnce).into(), - tcx.lifetimes.re_static.into(), - sig.tupled_inputs_ty.into(), - args.tupled_upvars_ty().into(), - args.coroutine_captures_by_ref_ty().into(), - ]); + let tupled_upvars_ty = Ty::new_projection( + tcx, + upvars_projection_def_id, + [ + ty::GenericArg::from(kind_ty), + Ty::from_closure_kind(tcx, ty::ClosureKind::FnOnce).into(), + tcx.lifetimes.re_static.into(), + sig.tupled_inputs_ty.into(), + args.tupled_upvars_ty().into(), + args.coroutine_captures_by_ref_ty().into(), + ], + ); sig.to_coroutine( tcx, args.parent_args(), @@ -1795,14 +1799,18 @@ fn confirm_async_closure_candidate<'cx, 'tcx>( // will project to the right upvars for the generator, appending the inputs and // coroutine upvars respecting the closure kind. // N.B. No need to register a `AsyncFnKindHelper` goal here, it's already in `nested`. - let tupled_upvars_ty = Ty::new_projection(tcx, upvars_projection_def_id, [ - ty::GenericArg::from(kind_ty), - Ty::from_closure_kind(tcx, goal_kind).into(), - env_region.into(), - sig.tupled_inputs_ty.into(), - args.tupled_upvars_ty().into(), - args.coroutine_captures_by_ref_ty().into(), - ]); + let tupled_upvars_ty = Ty::new_projection( + tcx, + upvars_projection_def_id, + [ + ty::GenericArg::from(kind_ty), + Ty::from_closure_kind(tcx, goal_kind).into(), + env_region.into(), + sig.tupled_inputs_ty.into(), + args.tupled_upvars_ty().into(), + args.coroutine_captures_by_ref_ty().into(), + ], + ); sig.to_coroutine( tcx, args.parent_args(), @@ -1816,17 +1824,16 @@ fn confirm_async_closure_candidate<'cx, 'tcx>( name => bug!("no such associated type: {name}"), }; let projection_term = match item_name { - sym::CallOnceFuture | sym::Output => { - ty::AliasTerm::new(tcx, obligation.predicate.def_id, [ - self_ty, - sig.tupled_inputs_ty, - ]) - } - sym::CallRefFuture => ty::AliasTerm::new(tcx, obligation.predicate.def_id, [ - ty::GenericArg::from(self_ty), - sig.tupled_inputs_ty.into(), - env_region.into(), - ]), + sym::CallOnceFuture | sym::Output => ty::AliasTerm::new( + tcx, + obligation.predicate.def_id, + [self_ty, sig.tupled_inputs_ty], + ), + sym::CallRefFuture => ty::AliasTerm::new( + tcx, + obligation.predicate.def_id, + [ty::GenericArg::from(self_ty), sig.tupled_inputs_ty.into(), env_region.into()], + ), name => bug!("no such associated type: {name}"), }; @@ -1846,17 +1853,20 @@ fn confirm_async_closure_candidate<'cx, 'tcx>( name => bug!("no such associated type: {name}"), }; let projection_term = match item_name { - sym::CallOnceFuture | sym::Output => { - ty::AliasTerm::new(tcx, obligation.predicate.def_id, [ - self_ty, - Ty::new_tup(tcx, sig.inputs()), - ]) - } - sym::CallRefFuture => ty::AliasTerm::new(tcx, obligation.predicate.def_id, [ - ty::GenericArg::from(self_ty), - Ty::new_tup(tcx, sig.inputs()).into(), - env_region.into(), - ]), + sym::CallOnceFuture | sym::Output => ty::AliasTerm::new( + tcx, + obligation.predicate.def_id, + [self_ty, Ty::new_tup(tcx, sig.inputs())], + ), + sym::CallRefFuture => ty::AliasTerm::new( + tcx, + obligation.predicate.def_id, + [ + ty::GenericArg::from(self_ty), + Ty::new_tup(tcx, sig.inputs()).into(), + env_region.into(), + ], + ), name => bug!("no such associated type: {name}"), }; @@ -1879,11 +1889,11 @@ fn confirm_async_closure_candidate<'cx, 'tcx>( sym::CallOnceFuture | sym::Output => { ty::AliasTerm::new(tcx, obligation.predicate.def_id, [self_ty, sig.inputs()[0]]) } - sym::CallRefFuture => ty::AliasTerm::new(tcx, obligation.predicate.def_id, [ - ty::GenericArg::from(self_ty), - sig.inputs()[0].into(), - env_region.into(), - ]), + sym::CallRefFuture => ty::AliasTerm::new( + tcx, + obligation.predicate.def_id, + [ty::GenericArg::from(self_ty), sig.inputs()[0].into(), env_region.into()], + ), name => bug!("no such associated type: {name}"), }; diff --git a/compiler/rustc_trait_selection/src/traits/select/confirmation.rs b/compiler/rustc_trait_selection/src/traits/select/confirmation.rs index 729ae3f2c2a26..eb4adde716a08 100644 --- a/compiler/rustc_trait_selection/src/traits/select/confirmation.rs +++ b/compiler/rustc_trait_selection/src/traits/select/confirmation.rs @@ -301,11 +301,15 @@ impl<'cx, 'tcx> SelectionContext<'cx, 'tcx> { let make_transmute_obl = |src, dst| { let transmute_trait = obligation.predicate.def_id(); let assume = obligation.predicate.skip_binder().trait_ref.args.const_at(2); - let trait_ref = ty::TraitRef::new(tcx, transmute_trait, [ - ty::GenericArg::from(dst), - ty::GenericArg::from(src), - ty::GenericArg::from(assume), - ]); + let trait_ref = ty::TraitRef::new( + tcx, + transmute_trait, + [ + ty::GenericArg::from(dst), + ty::GenericArg::from(src), + ty::GenericArg::from(assume), + ], + ); Obligation::with_depth( tcx, obligation.cause.clone(), @@ -316,10 +320,11 @@ impl<'cx, 'tcx> SelectionContext<'cx, 'tcx> { }; let make_freeze_obl = |ty| { - let trait_ref = - ty::TraitRef::new(tcx, tcx.require_lang_item(LangItem::Freeze, None), [ - ty::GenericArg::from(ty), - ]); + let trait_ref = ty::TraitRef::new( + tcx, + tcx.require_lang_item(LangItem::Freeze, None), + [ty::GenericArg::from(ty)], + ); Obligation::with_depth( tcx, obligation.cause.clone(), @@ -863,10 +868,11 @@ impl<'cx, 'tcx> SelectionContext<'cx, 'tcx> { } ty::CoroutineClosure(_, args) => { args.as_coroutine_closure().coroutine_closure_sig().map_bound(|sig| { - ty::TraitRef::new(self.tcx(), obligation.predicate.def_id(), [ - self_ty, - sig.tupled_inputs_ty, - ]) + ty::TraitRef::new( + self.tcx(), + obligation.predicate.def_id(), + [self_ty, sig.tupled_inputs_ty], + ) }) } _ => { @@ -892,10 +898,11 @@ impl<'cx, 'tcx> SelectionContext<'cx, 'tcx> { ty::CoroutineClosure(_, args) => { let args = args.as_coroutine_closure(); let trait_ref = args.coroutine_closure_sig().map_bound(|sig| { - ty::TraitRef::new(self.tcx(), obligation.predicate.def_id(), [ - self_ty, - sig.tupled_inputs_ty, - ]) + ty::TraitRef::new( + self.tcx(), + obligation.predicate.def_id(), + [self_ty, sig.tupled_inputs_ty], + ) }); // Note that unlike below, we don't need to check `Future + Sized` for @@ -906,10 +913,11 @@ impl<'cx, 'tcx> SelectionContext<'cx, 'tcx> { ty::FnDef(..) | ty::FnPtr(..) => { let sig = self_ty.fn_sig(tcx); let trait_ref = sig.map_bound(|sig| { - ty::TraitRef::new(self.tcx(), obligation.predicate.def_id(), [ - self_ty, - Ty::new_tup(tcx, sig.inputs()), - ]) + ty::TraitRef::new( + self.tcx(), + obligation.predicate.def_id(), + [self_ty, Ty::new_tup(tcx, sig.inputs())], + ) }); // We must additionally check that the return type impls `Future + Sized`. @@ -934,10 +942,11 @@ impl<'cx, 'tcx> SelectionContext<'cx, 'tcx> { let args = args.as_closure(); let sig = args.sig(); let trait_ref = sig.map_bound(|sig| { - ty::TraitRef::new(self.tcx(), obligation.predicate.def_id(), [ - self_ty, - sig.inputs()[0], - ]) + ty::TraitRef::new( + self.tcx(), + obligation.predicate.def_id(), + [self_ty, sig.inputs()[0]], + ) }); // We must additionally check that the return type impls `Future + Sized`. @@ -1295,10 +1304,11 @@ impl<'cx, 'tcx> SelectionContext<'cx, 'tcx> { // Construct the nested `TailField: Unsize>` predicate. let tail_unsize_obligation = obligation.with( tcx, - ty::TraitRef::new(tcx, obligation.predicate.def_id(), [ - source_tail, - target_tail, - ]), + ty::TraitRef::new( + tcx, + obligation.predicate.def_id(), + [source_tail, target_tail], + ), ); nested.push(tail_unsize_obligation); @@ -1359,10 +1369,11 @@ fn pointer_like_goal_for_rpitit<'tcx>( ty::GenericParamDefKind::Lifetime => { let kind = ty::BoundRegionKind::Named(arg.def_id, tcx.item_name(arg.def_id)); bound_vars.push(ty::BoundVariableKind::Region(kind)); - ty::Region::new_bound(tcx, ty::INNERMOST, ty::BoundRegion { - var: ty::BoundVar::from_usize(bound_vars.len() - 1), - kind, - }) + ty::Region::new_bound( + tcx, + ty::INNERMOST, + ty::BoundRegion { var: ty::BoundVar::from_usize(bound_vars.len() - 1), kind }, + ) .into() } ty::GenericParamDefKind::Type { .. } | ty::GenericParamDefKind::Const { .. } => { @@ -1371,9 +1382,11 @@ fn pointer_like_goal_for_rpitit<'tcx>( }); ty::Binder::bind_with_vars( - ty::TraitRef::new(tcx, tcx.require_lang_item(LangItem::PointerLike, Some(cause.span)), [ - Ty::new_projection_from_args(tcx, rpitit_item, args), - ]), + ty::TraitRef::new( + tcx, + tcx.require_lang_item(LangItem::PointerLike, Some(cause.span)), + [Ty::new_projection_from_args(tcx, rpitit_item, args)], + ), tcx.mk_bound_variable_kinds(&bound_vars), ) } diff --git a/compiler/rustc_trait_selection/src/traits/select/mod.rs b/compiler/rustc_trait_selection/src/traits/select/mod.rs index 99ce1fd9fb480..6b1e1774f0350 100644 --- a/compiler/rustc_trait_selection/src/traits/select/mod.rs +++ b/compiler/rustc_trait_selection/src/traits/select/mod.rs @@ -2422,9 +2422,11 @@ impl<'tcx> SelectionContext<'_, 'tcx> { } else { // If this is an ill-formed auto/built-in trait, then synthesize // new error args for the missing generics. - let err_args = ty::GenericArgs::extend_with_error(tcx, trait_def_id, &[ - normalized_ty.into(), - ]); + let err_args = ty::GenericArgs::extend_with_error( + tcx, + trait_def_id, + &[normalized_ty.into()], + ); ty::TraitRef::new_from_args(tcx, trait_def_id, err_args) }; diff --git a/compiler/rustc_ty_utils/src/implied_bounds.rs b/compiler/rustc_ty_utils/src/implied_bounds.rs index c4637f1293cb7..cc7baf8daac54 100644 --- a/compiler/rustc_ty_utils/src/implied_bounds.rs +++ b/compiler/rustc_ty_utils/src/implied_bounds.rs @@ -79,10 +79,10 @@ fn assumed_wf_types<'tcx>(tcx: TyCtxt<'tcx>, def_id: LocalDefId) -> &'tcx [(Ty<' if matches!(*orig_lt, ty::ReLateParam(..)) { mapping.insert( orig_lt, - ty::Region::new_early_param(tcx, ty::EarlyParamRegion { - index: param.index, - name: param.name, - }), + ty::Region::new_early_param( + tcx, + ty::EarlyParamRegion { index: param.index, name: param.name }, + ), ); } } diff --git a/compiler/rustc_ty_utils/src/layout.rs b/compiler/rustc_ty_utils/src/layout.rs index 2f258b23f2df4..ce8dc3a2515d4 100644 --- a/compiler/rustc_ty_utils/src/layout.rs +++ b/compiler/rustc_ty_utils/src/layout.rs @@ -240,14 +240,20 @@ fn layout_of_uncached<'tcx>( } // Basic scalars. - ty::Bool => tcx.mk_layout(LayoutData::scalar(cx, Scalar::Initialized { - value: Int(I8, false), - valid_range: WrappingRange { start: 0, end: 1 }, - })), - ty::Char => tcx.mk_layout(LayoutData::scalar(cx, Scalar::Initialized { - value: Int(I32, false), - valid_range: WrappingRange { start: 0, end: 0x10FFFF }, - })), + ty::Bool => tcx.mk_layout(LayoutData::scalar( + cx, + Scalar::Initialized { + value: Int(I8, false), + valid_range: WrappingRange { start: 0, end: 1 }, + }, + )), + ty::Char => tcx.mk_layout(LayoutData::scalar( + cx, + Scalar::Initialized { + value: Int(I32, false), + valid_range: WrappingRange { start: 0, end: 0x10FFFF }, + }, + )), ty::Int(ity) => scalar(Int(abi::Integer::from_int_ty(dl, ity), true)), ty::Uint(ity) => scalar(Int(abi::Integer::from_uint_ty(dl, ity), false)), ty::Float(fty) => scalar(Float(abi::Float::from_float_ty(fty))), @@ -551,10 +557,13 @@ fn layout_of_uncached<'tcx>( // Non-power-of-two vectors have padding up to the next power-of-two. // If we're a packed repr, remove the padding while keeping the alignment as close // to a vector as possible. - (BackendRepr::Memory { sized: true }, AbiAndPrefAlign { - abi: Align::max_for_offset(size), - pref: dl.vector_align(size).pref, - }) + ( + BackendRepr::Memory { sized: true }, + AbiAndPrefAlign { + abi: Align::max_for_offset(size), + pref: dl.vector_align(size).pref, + }, + ) } else { (BackendRepr::Vector { element: e_abi, count: e_len }, dl.vector_align(size)) }; @@ -1179,10 +1188,13 @@ fn variant_info_for_adt<'tcx>( }) .collect(); - (variant_infos, match tag_encoding { - TagEncoding::Direct => Some(tag.size(cx)), - _ => None, - }) + ( + variant_infos, + match tag_encoding { + TagEncoding::Direct => Some(tag.size(cx)), + _ => None, + }, + ) } } } @@ -1302,8 +1314,11 @@ fn variant_info_for_coroutine<'tcx>( let end_states: Vec<_> = end_states.collect(); variant_infos.extend(end_states); - (variant_infos, match tag_encoding { - TagEncoding::Direct => Some(tag.size(cx)), - _ => None, - }) + ( + variant_infos, + match tag_encoding { + TagEncoding::Direct => Some(tag.size(cx)), + _ => None, + }, + ) } diff --git a/compiler/rustc_type_ir/src/predicate.rs b/compiler/rustc_type_ir/src/predicate.rs index f75b292760027..51790b13ec776 100644 --- a/compiler/rustc_type_ir/src/predicate.rs +++ b/compiler/rustc_type_ir/src/predicate.rs @@ -552,35 +552,29 @@ impl AliasTerm { pub fn to_term(self, interner: I) -> I::Term { match self.kind(interner) { - AliasTermKind::ProjectionTy => { - Ty::new_alias(interner, ty::AliasTyKind::Projection, ty::AliasTy { - def_id: self.def_id, - args: self.args, - _use_alias_ty_new_instead: (), - }) - .into() - } - AliasTermKind::InherentTy => { - Ty::new_alias(interner, ty::AliasTyKind::Inherent, ty::AliasTy { - def_id: self.def_id, - args: self.args, - _use_alias_ty_new_instead: (), - }) - .into() - } - AliasTermKind::OpaqueTy => { - Ty::new_alias(interner, ty::AliasTyKind::Opaque, ty::AliasTy { - def_id: self.def_id, - args: self.args, - _use_alias_ty_new_instead: (), - }) - .into() - } - AliasTermKind::WeakTy => Ty::new_alias(interner, ty::AliasTyKind::Weak, ty::AliasTy { - def_id: self.def_id, - args: self.args, - _use_alias_ty_new_instead: (), - }) + AliasTermKind::ProjectionTy => Ty::new_alias( + interner, + ty::AliasTyKind::Projection, + ty::AliasTy { def_id: self.def_id, args: self.args, _use_alias_ty_new_instead: () }, + ) + .into(), + AliasTermKind::InherentTy => Ty::new_alias( + interner, + ty::AliasTyKind::Inherent, + ty::AliasTy { def_id: self.def_id, args: self.args, _use_alias_ty_new_instead: () }, + ) + .into(), + AliasTermKind::OpaqueTy => Ty::new_alias( + interner, + ty::AliasTyKind::Opaque, + ty::AliasTy { def_id: self.def_id, args: self.args, _use_alias_ty_new_instead: () }, + ) + .into(), + AliasTermKind::WeakTy => Ty::new_alias( + interner, + ty::AliasTyKind::Weak, + ty::AliasTy { def_id: self.def_id, args: self.args, _use_alias_ty_new_instead: () }, + ) .into(), AliasTermKind::UnevaluatedConst | AliasTermKind::ProjectionConst => { I::Const::new_unevaluated( diff --git a/compiler/rustc_type_ir/src/ty_kind/closure.rs b/compiler/rustc_type_ir/src/ty_kind/closure.rs index 74e4e035c8753..d1ca9bdb7fbd1 100644 --- a/compiler/rustc_type_ir/src/ty_kind/closure.rs +++ b/compiler/rustc_type_ir/src/ty_kind/closure.rs @@ -399,15 +399,18 @@ impl CoroutineClosureSignature { coroutine_def_id: I::DefId, tupled_upvars_ty: I::Ty, ) -> I::Ty { - let coroutine_args = ty::CoroutineArgs::new(cx, ty::CoroutineArgsParts { - parent_args, - kind_ty: coroutine_kind_ty, - resume_ty: self.resume_ty, - yield_ty: self.yield_ty, - return_ty: self.return_ty, - witness: self.interior, - tupled_upvars_ty, - }); + let coroutine_args = ty::CoroutineArgs::new( + cx, + ty::CoroutineArgsParts { + parent_args, + kind_ty: coroutine_kind_ty, + resume_ty: self.resume_ty, + yield_ty: self.yield_ty, + return_ty: self.return_ty, + witness: self.interior, + tupled_upvars_ty, + }, + ); Ty::new_coroutine(cx, coroutine_def_id, coroutine_args.args) } diff --git a/compiler/rustc_type_ir_macros/src/lib.rs b/compiler/rustc_type_ir_macros/src/lib.rs index aaf69e2648d5c..ede6dcd469cce 100644 --- a/compiler/rustc_type_ir_macros/src/lib.rs +++ b/compiler/rustc_type_ir_macros/src/lib.rs @@ -57,15 +57,18 @@ fn type_visitable_derive(mut s: synstructure::Structure<'_>) -> proc_macro2::Tok }); s.bind_with(|_| synstructure::BindStyle::Move); - s.bound_impl(quote!(::rustc_type_ir::visit::TypeVisitable), quote! { - fn visit_with<__V: ::rustc_type_ir::visit::TypeVisitor>( - &self, - __visitor: &mut __V - ) -> __V::Result { - match *self { #body_visit } - <__V::Result as ::rustc_ast_ir::visit::VisitorResult>::output() - } - }) + s.bound_impl( + quote!(::rustc_type_ir::visit::TypeVisitable), + quote! { + fn visit_with<__V: ::rustc_type_ir::visit::TypeVisitor>( + &self, + __visitor: &mut __V + ) -> __V::Result { + match *self { #body_visit } + <__V::Result as ::rustc_ast_ir::visit::VisitorResult>::output() + } + }, + ) } fn type_foldable_derive(mut s: synstructure::Structure<'_>) -> proc_macro2::TokenStream { @@ -101,14 +104,17 @@ fn type_foldable_derive(mut s: synstructure::Structure<'_>) -> proc_macro2::Toke // to generate code for them. s.filter(|bi| !has_ignore_attr(&bi.ast().attrs, "type_foldable", "identity")); s.add_bounds(synstructure::AddBounds::Fields); - s.bound_impl(quote!(::rustc_type_ir::fold::TypeFoldable), quote! { - fn try_fold_with<__F: ::rustc_type_ir::fold::FallibleTypeFolder>( - self, - __folder: &mut __F - ) -> Result { - Ok(match self { #body_fold }) - } - }) + s.bound_impl( + quote!(::rustc_type_ir::fold::TypeFoldable), + quote! { + fn try_fold_with<__F: ::rustc_type_ir::fold::FallibleTypeFolder>( + self, + __folder: &mut __F + ) -> Result { + Ok(match self { #body_fold }) + } + }, + ) } fn lift_derive(mut s: synstructure::Structure<'_>) -> proc_macro2::TokenStream { @@ -148,16 +154,19 @@ fn lift_derive(mut s: synstructure::Structure<'_>) -> proc_macro2::TokenStream { let self_ty: syn::Type = parse_quote! { #name #ty_generics }; let lifted_ty = lift(self_ty); - s.bound_impl(quote!(::rustc_type_ir::lift::Lift), quote! { - type Lifted = #lifted_ty; + s.bound_impl( + quote!(::rustc_type_ir::lift::Lift), + quote! { + type Lifted = #lifted_ty; - fn lift_to_interner( - self, - interner: J, - ) -> Option { - Some(match self { #body_fold }) - } - }) + fn lift_to_interner( + self, + interner: J, + ) -> Option { + Some(match self { #body_fold }) + } + }, + ) } fn lift(mut ty: syn::Type) -> syn::Type { diff --git a/library/alloc/src/collections/btree/set/tests.rs b/library/alloc/src/collections/btree/set/tests.rs index 990044e069f64..d538ef707eb93 100644 --- a/library/alloc/src/collections/btree/set/tests.rs +++ b/library/alloc/src/collections/btree/set/tests.rs @@ -132,9 +132,11 @@ fn test_difference() { check_difference(&[1, 3, 5, 9, 11], &[3, 6, 9], &[1, 5, 11]); check_difference(&[1, 3, 5, 9, 11], &[0, 1], &[3, 5, 9, 11]); check_difference(&[1, 3, 5, 9, 11], &[11, 12], &[1, 3, 5, 9]); - check_difference(&[-5, 11, 22, 33, 40, 42], &[-12, -5, 14, 23, 34, 38, 39, 50], &[ - 11, 22, 33, 40, 42, - ]); + check_difference( + &[-5, 11, 22, 33, 40, 42], + &[-12, -5, 14, 23, 34, 38, 39, 50], + &[11, 22, 33, 40, 42], + ); if cfg!(miri) { // Miri is too slow @@ -250,9 +252,11 @@ fn test_union() { check_union(&[], &[], &[]); check_union(&[1, 2, 3], &[2], &[1, 2, 3]); check_union(&[2], &[1, 2, 3], &[1, 2, 3]); - check_union(&[1, 3, 5, 9, 11, 16, 19, 24], &[-2, 1, 5, 9, 13, 19], &[ - -2, 1, 3, 5, 9, 11, 13, 16, 19, 24, - ]); + check_union( + &[1, 3, 5, 9, 11, 16, 19, 24], + &[-2, 1, 5, 9, 13, 19], + &[-2, 1, 3, 5, 9, 11, 13, 16, 19, 24], + ); } #[test] diff --git a/library/alloc/src/collections/linked_list/tests.rs b/library/alloc/src/collections/linked_list/tests.rs index aa19239f6c55d..812fe229a0fc5 100644 --- a/library/alloc/src/collections/linked_list/tests.rs +++ b/library/alloc/src/collections/linked_list/tests.rs @@ -696,9 +696,10 @@ fn test_cursor_mut_insert() { cursor.splice_after(p); cursor.splice_before(q); check_links(&m); - assert_eq!(m.iter().cloned().collect::>(), &[ - 200, 201, 202, 203, 1, 100, 101, 102, 103, 8, 2, 3, 4, 5, 6 - ]); + assert_eq!( + m.iter().cloned().collect::>(), + &[200, 201, 202, 203, 1, 100, 101, 102, 103, 8, 2, 3, 4, 5, 6] + ); let mut cursor = m.cursor_front_mut(); cursor.move_prev(); let tmp = cursor.split_before(); @@ -915,9 +916,10 @@ fn extract_if_complex() { assert_eq!(removed, vec![2, 4, 6, 18, 20, 22, 24, 26, 34, 36]); assert_eq!(list.len(), 14); - assert_eq!(list.into_iter().collect::>(), vec![ - 1, 7, 9, 11, 13, 15, 17, 27, 29, 31, 33, 35, 37, 39 - ]); + assert_eq!( + list.into_iter().collect::>(), + vec![1, 7, 9, 11, 13, 15, 17, 27, 29, 31, 33, 35, 37, 39] + ); } { @@ -932,9 +934,10 @@ fn extract_if_complex() { assert_eq!(removed, vec![2, 4, 6, 18, 20, 22, 24, 26, 34, 36]); assert_eq!(list.len(), 13); - assert_eq!(list.into_iter().collect::>(), vec![ - 7, 9, 11, 13, 15, 17, 27, 29, 31, 33, 35, 37, 39 - ]); + assert_eq!( + list.into_iter().collect::>(), + vec![7, 9, 11, 13, 15, 17, 27, 29, 31, 33, 35, 37, 39] + ); } { @@ -949,9 +952,10 @@ fn extract_if_complex() { assert_eq!(removed, vec![2, 4, 6, 18, 20, 22, 24, 26, 34, 36]); assert_eq!(list.len(), 11); - assert_eq!(list.into_iter().collect::>(), vec![ - 7, 9, 11, 13, 15, 17, 27, 29, 31, 33, 35 - ]); + assert_eq!( + list.into_iter().collect::>(), + vec![7, 9, 11, 13, 15, 17, 27, 29, 31, 33, 35] + ); } { diff --git a/library/alloc/src/collections/vec_deque/tests.rs b/library/alloc/src/collections/vec_deque/tests.rs index 6328b3b4db867..c90679f179775 100644 --- a/library/alloc/src/collections/vec_deque/tests.rs +++ b/library/alloc/src/collections/vec_deque/tests.rs @@ -562,9 +562,10 @@ fn make_contiguous_head_to_end() { tester.push_front(i as char); } - assert_eq!(tester, [ - 'P', 'O', 'N', 'M', 'L', 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K' - ]); + assert_eq!( + tester, + ['P', 'O', 'N', 'M', 'L', 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K'] + ); // ABCDEFGHIJKPONML let expected_start = 0; diff --git a/library/alloc/src/rc.rs b/library/alloc/src/rc.rs index ae3318b839dd7..3c73469e90b8f 100644 --- a/library/alloc/src/rc.rs +++ b/library/alloc/src/rc.rs @@ -2350,11 +2350,10 @@ impl Default for Rc { fn default() -> Rc { unsafe { Self::from_inner( - Box::leak(Box::write(Box::new_uninit(), RcInner { - strong: Cell::new(1), - weak: Cell::new(1), - value: T::default(), - })) + Box::leak(Box::write( + Box::new_uninit(), + RcInner { strong: Cell::new(1), weak: Cell::new(1), value: T::default() }, + )) .into(), ) } diff --git a/library/alloc/src/sync.rs b/library/alloc/src/sync.rs index 431e19e6ef1d7..dba1449347ac0 100644 --- a/library/alloc/src/sync.rs +++ b/library/alloc/src/sync.rs @@ -3466,11 +3466,14 @@ impl Default for Arc { fn default() -> Arc { unsafe { Self::from_inner( - Box::leak(Box::write(Box::new_uninit(), ArcInner { - strong: atomic::AtomicUsize::new(1), - weak: atomic::AtomicUsize::new(1), - data: T::default(), - })) + Box::leak(Box::write( + Box::new_uninit(), + ArcInner { + strong: atomic::AtomicUsize::new(1), + weak: atomic::AtomicUsize::new(1), + data: T::default(), + }, + )) .into(), ) } diff --git a/library/alloc/tests/str.rs b/library/alloc/tests/str.rs index 5720d3ffd97b6..23a0e5e525643 100644 --- a/library/alloc/tests/str.rs +++ b/library/alloc/tests/str.rs @@ -1524,18 +1524,14 @@ fn test_lines() { t("bare\r", &["bare\r"]); t("bare\rcr", &["bare\rcr"]); t("Text\n\r", &["Text", "\r"]); - t("\nMäry häd ä little lämb\n\r\nLittle lämb\n", &[ - "", - "Märy häd ä little lämb", - "", - "Little lämb", - ]); - t("\r\nMäry häd ä little lämb\n\nLittle lämb", &[ - "", - "Märy häd ä little lämb", - "", - "Little lämb", - ]); + t( + "\nMäry häd ä little lämb\n\r\nLittle lämb\n", + &["", "Märy häd ä little lämb", "", "Little lämb"], + ); + t( + "\r\nMäry häd ä little lämb\n\nLittle lämb", + &["", "Märy häd ä little lämb", "", "Little lämb"], + ); } #[test] @@ -1978,73 +1974,88 @@ mod pattern { assert_eq!(v, right); } - make_test!(str_searcher_ascii_haystack, "bb", "abbcbbd", [ - Reject(0, 1), - Match(1, 3), - Reject(3, 4), - Match(4, 6), - Reject(6, 7), - ]); - make_test!(str_searcher_ascii_haystack_seq, "bb", "abbcbbbbd", [ - Reject(0, 1), - Match(1, 3), - Reject(3, 4), - Match(4, 6), - Match(6, 8), - Reject(8, 9), - ]); - make_test!(str_searcher_empty_needle_ascii_haystack, "", "abbcbbd", [ - Match(0, 0), - Reject(0, 1), - Match(1, 1), - Reject(1, 2), - Match(2, 2), - Reject(2, 3), - Match(3, 3), - Reject(3, 4), - Match(4, 4), - Reject(4, 5), - Match(5, 5), - Reject(5, 6), - Match(6, 6), - Reject(6, 7), - Match(7, 7), - ]); - make_test!(str_searcher_multibyte_haystack, " ", "├──", [ - Reject(0, 3), - Reject(3, 6), - Reject(6, 9), - ]); - make_test!(str_searcher_empty_needle_multibyte_haystack, "", "├──", [ - Match(0, 0), - Reject(0, 3), - Match(3, 3), - Reject(3, 6), - Match(6, 6), - Reject(6, 9), - Match(9, 9), - ]); + make_test!( + str_searcher_ascii_haystack, + "bb", + "abbcbbd", + [Reject(0, 1), Match(1, 3), Reject(3, 4), Match(4, 6), Reject(6, 7),] + ); + make_test!( + str_searcher_ascii_haystack_seq, + "bb", + "abbcbbbbd", + [Reject(0, 1), Match(1, 3), Reject(3, 4), Match(4, 6), Match(6, 8), Reject(8, 9),] + ); + make_test!( + str_searcher_empty_needle_ascii_haystack, + "", + "abbcbbd", + [ + Match(0, 0), + Reject(0, 1), + Match(1, 1), + Reject(1, 2), + Match(2, 2), + Reject(2, 3), + Match(3, 3), + Reject(3, 4), + Match(4, 4), + Reject(4, 5), + Match(5, 5), + Reject(5, 6), + Match(6, 6), + Reject(6, 7), + Match(7, 7), + ] + ); + make_test!( + str_searcher_multibyte_haystack, + " ", + "├──", + [Reject(0, 3), Reject(3, 6), Reject(6, 9),] + ); + make_test!( + str_searcher_empty_needle_multibyte_haystack, + "", + "├──", + [ + Match(0, 0), + Reject(0, 3), + Match(3, 3), + Reject(3, 6), + Match(6, 6), + Reject(6, 9), + Match(9, 9), + ] + ); make_test!(str_searcher_empty_needle_empty_haystack, "", "", [Match(0, 0),]); make_test!(str_searcher_nonempty_needle_empty_haystack, "├", "", []); - make_test!(char_searcher_ascii_haystack, 'b', "abbcbbd", [ - Reject(0, 1), - Match(1, 2), - Match(2, 3), - Reject(3, 4), - Match(4, 5), - Match(5, 6), - Reject(6, 7), - ]); - make_test!(char_searcher_multibyte_haystack, ' ', "├──", [ - Reject(0, 3), - Reject(3, 6), - Reject(6, 9), - ]); - make_test!(char_searcher_short_haystack, '\u{1F4A9}', "* \t", [ - Reject(0, 1), - Reject(1, 2), - Reject(2, 3), - ]); + make_test!( + char_searcher_ascii_haystack, + 'b', + "abbcbbd", + [ + Reject(0, 1), + Match(1, 2), + Match(2, 3), + Reject(3, 4), + Match(4, 5), + Match(5, 6), + Reject(6, 7), + ] + ); + make_test!( + char_searcher_multibyte_haystack, + ' ', + "├──", + [Reject(0, 3), Reject(3, 6), Reject(6, 9),] + ); + make_test!( + char_searcher_short_haystack, + '\u{1F4A9}', + "* \t", + [Reject(0, 1), Reject(1, 2), Reject(2, 3),] + ); // See #85462 #[test] diff --git a/library/alloc/tests/string.rs b/library/alloc/tests/string.rs index 1c8bff1564db2..d996c55f94660 100644 --- a/library/alloc/tests/string.rs +++ b/library/alloc/tests/string.rs @@ -154,19 +154,28 @@ fn test_fromutf8error_into_lossy() { #[test] fn test_from_utf16() { let pairs = [ - (String::from("𐍅𐌿𐌻𐍆𐌹𐌻𐌰\n"), vec![ - 0xd800, 0xdf45, 0xd800, 0xdf3f, 0xd800, 0xdf3b, 0xd800, 0xdf46, 0xd800, 0xdf39, 0xd800, - 0xdf3b, 0xd800, 0xdf30, 0x000a, - ]), - (String::from("𐐒𐑉𐐮𐑀𐐲𐑋 𐐏𐐲𐑍\n"), vec![ - 0xd801, 0xdc12, 0xd801, 0xdc49, 0xd801, 0xdc2e, 0xd801, 0xdc40, 0xd801, 0xdc32, 0xd801, - 0xdc4b, 0x0020, 0xd801, 0xdc0f, 0xd801, 0xdc32, 0xd801, 0xdc4d, 0x000a, - ]), - (String::from("𐌀𐌖𐌋𐌄𐌑𐌉·𐌌𐌄𐌕𐌄𐌋𐌉𐌑\n"), vec![ - 0xd800, 0xdf00, 0xd800, 0xdf16, 0xd800, 0xdf0b, 0xd800, 0xdf04, 0xd800, 0xdf11, 0xd800, - 0xdf09, 0x00b7, 0xd800, 0xdf0c, 0xd800, 0xdf04, 0xd800, 0xdf15, 0xd800, 0xdf04, 0xd800, - 0xdf0b, 0xd800, 0xdf09, 0xd800, 0xdf11, 0x000a, - ]), + ( + String::from("𐍅𐌿𐌻𐍆𐌹𐌻𐌰\n"), + vec![ + 0xd800, 0xdf45, 0xd800, 0xdf3f, 0xd800, 0xdf3b, 0xd800, 0xdf46, 0xd800, 0xdf39, + 0xd800, 0xdf3b, 0xd800, 0xdf30, 0x000a, + ], + ), + ( + String::from("𐐒𐑉𐐮𐑀𐐲𐑋 𐐏𐐲𐑍\n"), + vec![ + 0xd801, 0xdc12, 0xd801, 0xdc49, 0xd801, 0xdc2e, 0xd801, 0xdc40, 0xd801, 0xdc32, + 0xd801, 0xdc4b, 0x0020, 0xd801, 0xdc0f, 0xd801, 0xdc32, 0xd801, 0xdc4d, 0x000a, + ], + ), + ( + String::from("𐌀𐌖𐌋𐌄𐌑𐌉·𐌌𐌄𐌕𐌄𐌋𐌉𐌑\n"), + vec![ + 0xd800, 0xdf00, 0xd800, 0xdf16, 0xd800, 0xdf0b, 0xd800, 0xdf04, 0xd800, 0xdf11, + 0xd800, 0xdf09, 0x00b7, 0xd800, 0xdf0c, 0xd800, 0xdf04, 0xd800, 0xdf15, 0xd800, + 0xdf04, 0xd800, 0xdf0b, 0xd800, 0xdf09, 0xd800, 0xdf11, 0x000a, + ], + ), ( String::from("𐒋𐒘𐒈𐒑𐒛𐒒 𐒕𐒓 𐒈𐒚𐒍 𐒏𐒜𐒒𐒖𐒆 𐒕𐒆\n"), vec![ diff --git a/library/core/src/cell.rs b/library/core/src/cell.rs index 320d8176011fd..cbf00106c5173 100644 --- a/library/core/src/cell.rs +++ b/library/core/src/cell.rs @@ -1590,10 +1590,10 @@ impl<'b, T: ?Sized> Ref<'b, T> { { let (a, b) = f(&*orig); let borrow = orig.borrow.clone(); - (Ref { value: NonNull::from(a), borrow }, Ref { - value: NonNull::from(b), - borrow: orig.borrow, - }) + ( + Ref { value: NonNull::from(a), borrow }, + Ref { value: NonNull::from(b), borrow: orig.borrow }, + ) } /// Converts into a reference to the underlying data. @@ -1758,11 +1758,10 @@ impl<'b, T: ?Sized> RefMut<'b, T> { { let borrow = orig.borrow.clone(); let (a, b) = f(&mut *orig); - (RefMut { value: NonNull::from(a), borrow, marker: PhantomData }, RefMut { - value: NonNull::from(b), - borrow: orig.borrow, - marker: PhantomData, - }) + ( + RefMut { value: NonNull::from(a), borrow, marker: PhantomData }, + RefMut { value: NonNull::from(b), borrow: orig.borrow, marker: PhantomData }, + ) } /// Converts into a mutable reference to the underlying data. diff --git a/library/coretests/tests/iter/adapters/map_windows.rs b/library/coretests/tests/iter/adapters/map_windows.rs index b677f1cfd55e7..01cebc9b27fd8 100644 --- a/library/coretests/tests/iter/adapters/map_windows.rs +++ b/library/coretests/tests/iter/adapters/map_windows.rs @@ -159,11 +159,10 @@ fn output_n2() { >::new(), ); assert_eq!("ab".chars().map_windows(|a: &[_; 2]| *a).collect::>(), vec![['a', 'b']]); - assert_eq!("abcd".chars().map_windows(|a: &[_; 2]| *a).collect::>(), vec![ - ['a', 'b'], - ['b', 'c'], - ['c', 'd'] - ],); + assert_eq!( + "abcd".chars().map_windows(|a: &[_; 2]| *a).collect::>(), + vec![['a', 'b'], ['b', 'c'], ['c', 'd']], + ); } #[test] diff --git a/library/panic_unwind/src/emcc.rs b/library/panic_unwind/src/emcc.rs index 9127449edb1a7..86906b46d66ba 100644 --- a/library/panic_unwind/src/emcc.rs +++ b/library/panic_unwind/src/emcc.rs @@ -98,11 +98,14 @@ pub(crate) unsafe fn panic(data: Box) -> u32 { if exception.is_null() { return uw::_URC_FATAL_PHASE1_ERROR as u32; } - ptr::write(exception, Exception { - canary: &EXCEPTION_TYPE_INFO, - caught: AtomicBool::new(false), - data: Some(data), - }); + ptr::write( + exception, + Exception { + canary: &EXCEPTION_TYPE_INFO, + caught: AtomicBool::new(false), + data: Some(data), + }, + ); __cxa_throw(exception as *mut _, &EXCEPTION_TYPE_INFO, exception_cleanup); } diff --git a/library/std/src/io/stdio/tests.rs b/library/std/src/io/stdio/tests.rs index bf8f3a5adfb6f..e68d8c29fbce2 100644 --- a/library/std/src/io/stdio/tests.rs +++ b/library/std/src/io/stdio/tests.rs @@ -159,7 +159,8 @@ where assert_eq!(rx2.recv().unwrap(), Release2); // release th2 th2.join().unwrap(); th1.join().unwrap(); - assert_eq!(*log.lock().unwrap(), [ - Start1, Acquire1, Start2, Release1, Acquire2, Release2, Acquire1, Release1 - ]); + assert_eq!( + *log.lock().unwrap(), + [Start1, Acquire1, Start2, Release1, Acquire2, Release2, Acquire1, Release1] + ); } diff --git a/library/std/src/os/windows/process.rs b/library/std/src/os/windows/process.rs index 0277b79b8b69c..201274cf03aec 100644 --- a/library/std/src/os/windows/process.rs +++ b/library/std/src/os/windows/process.rs @@ -590,10 +590,10 @@ impl<'a> ProcThreadAttributeListBuilder<'a> { value_ptr: *const T, value_size: usize, ) -> Self { - self.attributes.insert(attribute, ProcThreadAttributeValue { - ptr: value_ptr.cast::(), - size: value_size, - }); + self.attributes.insert( + attribute, + ProcThreadAttributeValue { ptr: value_ptr.cast::(), size: value_size }, + ); self } diff --git a/library/std/src/os/xous/ffi/definitions.rs b/library/std/src/os/xous/ffi/definitions.rs index 1b16849af03b0..345005bcc78d7 100644 --- a/library/std/src/os/xous/ffi/definitions.rs +++ b/library/std/src/os/xous/ffi/definitions.rs @@ -126,36 +126,42 @@ impl From for Error { #[stable(feature = "rust1", since = "1.0.0")] impl core::fmt::Display for Error { fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { - write!(f, "{}", match self { - Error::NoError => "no error occurred", - Error::BadAlignment => "memory was not properly aligned", - Error::BadAddress => "an invalid address was supplied", - Error::OutOfMemory => "the process or service has run out of memory", - Error::MemoryInUse => "the requested address is in use", - Error::InterruptNotFound => "the requested interrupt does not exist on this platform", - Error::InterruptInUse => "the requested interrupt is currently in use", - Error::InvalidString => "the specified string was not formatted correctly", - Error::ServerExists => "a server with that address already exists", - Error::ServerNotFound => "the requetsed server could not be found", - Error::ProcessNotFound => "the target process does not exist", - Error::ProcessNotChild => "the requested operation can only be done on child processes", - Error::ProcessTerminated => "the target process has crashed", - Error::Timeout => "the requested operation timed out", - Error::InternalError => "an internal error occurred", - Error::ServerQueueFull => "the server has too many pending messages", - Error::ThreadNotAvailable => "the specified thread does not exist", - Error::UnhandledSyscall => "the kernel did not recognize that syscall", - Error::InvalidSyscall => "the syscall had incorrect parameters", - Error::ShareViolation => "an attempt was made to share memory twice", - Error::InvalidThread => "tried to resume a thread that was not ready", - Error::InvalidPid => "kernel attempted to use a pid that was not valid", - Error::AccessDenied => "no permission to perform the requested operation", - Error::UseBeforeInit => "attempt to use a service before initialization finished", - Error::DoubleFree => "the requested resource was freed twice", - Error::DebugInProgress => "kernel attempted to activate a thread being debugged", - Error::InvalidLimit => "process attempted to adjust an invalid limit", - Error::UnknownError => "an unknown error occurred", - }) + write!( + f, + "{}", + match self { + Error::NoError => "no error occurred", + Error::BadAlignment => "memory was not properly aligned", + Error::BadAddress => "an invalid address was supplied", + Error::OutOfMemory => "the process or service has run out of memory", + Error::MemoryInUse => "the requested address is in use", + Error::InterruptNotFound => + "the requested interrupt does not exist on this platform", + Error::InterruptInUse => "the requested interrupt is currently in use", + Error::InvalidString => "the specified string was not formatted correctly", + Error::ServerExists => "a server with that address already exists", + Error::ServerNotFound => "the requetsed server could not be found", + Error::ProcessNotFound => "the target process does not exist", + Error::ProcessNotChild => + "the requested operation can only be done on child processes", + Error::ProcessTerminated => "the target process has crashed", + Error::Timeout => "the requested operation timed out", + Error::InternalError => "an internal error occurred", + Error::ServerQueueFull => "the server has too many pending messages", + Error::ThreadNotAvailable => "the specified thread does not exist", + Error::UnhandledSyscall => "the kernel did not recognize that syscall", + Error::InvalidSyscall => "the syscall had incorrect parameters", + Error::ShareViolation => "an attempt was made to share memory twice", + Error::InvalidThread => "tried to resume a thread that was not ready", + Error::InvalidPid => "kernel attempted to use a pid that was not valid", + Error::AccessDenied => "no permission to perform the requested operation", + Error::UseBeforeInit => "attempt to use a service before initialization finished", + Error::DoubleFree => "the requested resource was freed twice", + Error::DebugInProgress => "kernel attempted to activate a thread being debugged", + Error::InvalidLimit => "process attempted to adjust an invalid limit", + Error::UnknownError => "an unknown error occurred", + } + ) } } diff --git a/library/std/src/sys/pal/itron/time/tests.rs b/library/std/src/sys/pal/itron/time/tests.rs index 28db4f8b6799f..d14035d9da49f 100644 --- a/library/std/src/sys/pal/itron/time/tests.rs +++ b/library/std/src/sys/pal/itron/time/tests.rs @@ -8,24 +8,26 @@ fn reltim2dur(t: u64) -> Duration { fn test_dur2reltims() { assert_eq!(dur2reltims(reltim2dur(0)).collect::>(), vec![]); assert_eq!(dur2reltims(reltim2dur(42)).collect::>(), vec![42]); - assert_eq!(dur2reltims(reltim2dur(abi::TMAX_RELTIM as u64)).collect::>(), vec![ - abi::TMAX_RELTIM - ]); - assert_eq!(dur2reltims(reltim2dur(abi::TMAX_RELTIM as u64 + 10000)).collect::>(), vec![ - abi::TMAX_RELTIM, - 10000 - ]); + assert_eq!( + dur2reltims(reltim2dur(abi::TMAX_RELTIM as u64)).collect::>(), + vec![abi::TMAX_RELTIM] + ); + assert_eq!( + dur2reltims(reltim2dur(abi::TMAX_RELTIM as u64 + 10000)).collect::>(), + vec![abi::TMAX_RELTIM, 10000] + ); } #[test] fn test_dur2tmos() { assert_eq!(dur2tmos(reltim2dur(0)).collect::>(), vec![0]); assert_eq!(dur2tmos(reltim2dur(42)).collect::>(), vec![42]); - assert_eq!(dur2tmos(reltim2dur(abi::TMAX_RELTIM as u64)).collect::>(), vec![ - abi::TMAX_RELTIM - ]); - assert_eq!(dur2tmos(reltim2dur(abi::TMAX_RELTIM as u64 + 10000)).collect::>(), vec![ - abi::TMAX_RELTIM, - 10000 - ]); + assert_eq!( + dur2tmos(reltim2dur(abi::TMAX_RELTIM as u64)).collect::>(), + vec![abi::TMAX_RELTIM] + ); + assert_eq!( + dur2tmos(reltim2dur(abi::TMAX_RELTIM as u64 + 10000)).collect::>(), + vec![abi::TMAX_RELTIM, 10000] + ); } diff --git a/library/std/src/sys/pal/windows/args/tests.rs b/library/std/src/sys/pal/windows/args/tests.rs index 6d5c953cbd5c6..484a90ab056df 100644 --- a/library/std/src/sys/pal/windows/args/tests.rs +++ b/library/std/src/sys/pal/windows/args/tests.rs @@ -47,10 +47,10 @@ fn whitespace_behavior() { fn genius_quotes() { chk(r#"EXE "" """#, &["EXE", "", ""]); chk(r#"EXE "" """"#, &["EXE", "", r#"""#]); - chk(r#"EXE "this is """all""" in the same argument""#, &[ - "EXE", - r#"this is "all" in the same argument"#, - ]); + chk( + r#"EXE "this is """all""" in the same argument""#, + &["EXE", r#"this is "all" in the same argument"#], + ); chk(r#"EXE "a"""#, &["EXE", r#"a""#]); chk(r#"EXE "a"" a"#, &["EXE", r#"a" a"#]); // quotes cannot be escaped in command names diff --git a/library/std/src/sys_common/wtf8/tests.rs b/library/std/src/sys_common/wtf8/tests.rs index bc06eaa2b8fa1..b57c99a8452a1 100644 --- a/library/std/src/sys_common/wtf8/tests.rs +++ b/library/std/src/sys_common/wtf8/tests.rs @@ -356,32 +356,32 @@ fn wtf8buf_from_iterator() { fn f(values: &[u32]) -> Wtf8Buf { values.iter().map(|&c| CodePoint::from_u32(c).unwrap()).collect::() } - assert_eq!(f(&[0x61, 0xE9, 0x20, 0x1F4A9]), Wtf8Buf { - bytes: b"a\xC3\xA9 \xF0\x9F\x92\xA9".to_vec(), - is_known_utf8: true - }); + assert_eq!( + f(&[0x61, 0xE9, 0x20, 0x1F4A9]), + Wtf8Buf { bytes: b"a\xC3\xA9 \xF0\x9F\x92\xA9".to_vec(), is_known_utf8: true } + ); assert_eq!(f(&[0xD83D, 0xDCA9]).bytes, b"\xF0\x9F\x92\xA9"); // Magic! - assert_eq!(f(&[0xD83D, 0x20, 0xDCA9]), Wtf8Buf { - bytes: b"\xED\xA0\xBD \xED\xB2\xA9".to_vec(), - is_known_utf8: false - }); - assert_eq!(f(&[0xD800, 0xDBFF]), Wtf8Buf { - bytes: b"\xED\xA0\x80\xED\xAF\xBF".to_vec(), - is_known_utf8: false - }); - assert_eq!(f(&[0xD800, 0xE000]), Wtf8Buf { - bytes: b"\xED\xA0\x80\xEE\x80\x80".to_vec(), - is_known_utf8: false - }); - assert_eq!(f(&[0xD7FF, 0xDC00]), Wtf8Buf { - bytes: b"\xED\x9F\xBF\xED\xB0\x80".to_vec(), - is_known_utf8: false - }); - assert_eq!(f(&[0x61, 0xDC00]), Wtf8Buf { - bytes: b"\x61\xED\xB0\x80".to_vec(), - is_known_utf8: false - }); + assert_eq!( + f(&[0xD83D, 0x20, 0xDCA9]), + Wtf8Buf { bytes: b"\xED\xA0\xBD \xED\xB2\xA9".to_vec(), is_known_utf8: false } + ); + assert_eq!( + f(&[0xD800, 0xDBFF]), + Wtf8Buf { bytes: b"\xED\xA0\x80\xED\xAF\xBF".to_vec(), is_known_utf8: false } + ); + assert_eq!( + f(&[0xD800, 0xE000]), + Wtf8Buf { bytes: b"\xED\xA0\x80\xEE\x80\x80".to_vec(), is_known_utf8: false } + ); + assert_eq!( + f(&[0xD7FF, 0xDC00]), + Wtf8Buf { bytes: b"\xED\x9F\xBF\xED\xB0\x80".to_vec(), is_known_utf8: false } + ); + assert_eq!( + f(&[0x61, 0xDC00]), + Wtf8Buf { bytes: b"\x61\xED\xB0\x80".to_vec(), is_known_utf8: false } + ); assert_eq!(f(&[0xDC00]), Wtf8Buf { bytes: b"\xED\xB0\x80".to_vec(), is_known_utf8: false }); } @@ -396,36 +396,36 @@ fn wtf8buf_extend() { string } - assert_eq!(e(&[0x61, 0xE9], &[0x20, 0x1F4A9]), Wtf8Buf { - bytes: b"a\xC3\xA9 \xF0\x9F\x92\xA9".to_vec(), - is_known_utf8: true - }); + assert_eq!( + e(&[0x61, 0xE9], &[0x20, 0x1F4A9]), + Wtf8Buf { bytes: b"a\xC3\xA9 \xF0\x9F\x92\xA9".to_vec(), is_known_utf8: true } + ); assert_eq!(e(&[0xD83D], &[0xDCA9]).bytes, b"\xF0\x9F\x92\xA9"); // Magic! - assert_eq!(e(&[0xD83D, 0x20], &[0xDCA9]), Wtf8Buf { - bytes: b"\xED\xA0\xBD \xED\xB2\xA9".to_vec(), - is_known_utf8: false - }); - assert_eq!(e(&[0xD800], &[0xDBFF]), Wtf8Buf { - bytes: b"\xED\xA0\x80\xED\xAF\xBF".to_vec(), - is_known_utf8: false - }); - assert_eq!(e(&[0xD800], &[0xE000]), Wtf8Buf { - bytes: b"\xED\xA0\x80\xEE\x80\x80".to_vec(), - is_known_utf8: false - }); - assert_eq!(e(&[0xD7FF], &[0xDC00]), Wtf8Buf { - bytes: b"\xED\x9F\xBF\xED\xB0\x80".to_vec(), - is_known_utf8: false - }); - assert_eq!(e(&[0x61], &[0xDC00]), Wtf8Buf { - bytes: b"\x61\xED\xB0\x80".to_vec(), - is_known_utf8: false - }); - assert_eq!(e(&[], &[0xDC00]), Wtf8Buf { - bytes: b"\xED\xB0\x80".to_vec(), - is_known_utf8: false - }); + assert_eq!( + e(&[0xD83D, 0x20], &[0xDCA9]), + Wtf8Buf { bytes: b"\xED\xA0\xBD \xED\xB2\xA9".to_vec(), is_known_utf8: false } + ); + assert_eq!( + e(&[0xD800], &[0xDBFF]), + Wtf8Buf { bytes: b"\xED\xA0\x80\xED\xAF\xBF".to_vec(), is_known_utf8: false } + ); + assert_eq!( + e(&[0xD800], &[0xE000]), + Wtf8Buf { bytes: b"\xED\xA0\x80\xEE\x80\x80".to_vec(), is_known_utf8: false } + ); + assert_eq!( + e(&[0xD7FF], &[0xDC00]), + Wtf8Buf { bytes: b"\xED\x9F\xBF\xED\xB0\x80".to_vec(), is_known_utf8: false } + ); + assert_eq!( + e(&[0x61], &[0xDC00]), + Wtf8Buf { bytes: b"\x61\xED\xB0\x80".to_vec(), is_known_utf8: false } + ); + assert_eq!( + e(&[], &[0xDC00]), + Wtf8Buf { bytes: b"\xED\xB0\x80".to_vec(), is_known_utf8: false } + ); } #[test] @@ -556,9 +556,10 @@ fn wtf8_encode_wide() { let mut string = Wtf8Buf::from_str("aé "); string.push(CodePoint::from_u32(0xD83D).unwrap()); string.push_char('💩'); - assert_eq!(string.encode_wide().collect::>(), vec![ - 0x61, 0xE9, 0x20, 0xD83D, 0xD83D, 0xDCA9 - ]); + assert_eq!( + string.encode_wide().collect::>(), + vec![0x61, 0xE9, 0x20, 0xD83D, 0xD83D, 0xDCA9] + ); } #[test] diff --git a/src/bootstrap/src/core/build_steps/llvm.rs b/src/bootstrap/src/core/build_steps/llvm.rs index 82779dc630634..25e5e9e6eb957 100644 --- a/src/bootstrap/src/core/build_steps/llvm.rs +++ b/src/bootstrap/src/core/build_steps/llvm.rs @@ -157,12 +157,16 @@ pub fn prebuilt_llvm_config( /// This retrieves the LLVM sha we *want* to use, according to git history. pub(crate) fn detect_llvm_sha(config: &Config, is_git: bool) -> String { let llvm_sha = if is_git { - get_closest_merge_commit(Some(&config.src), &config.git_config(), &[ - config.src.join("src/llvm-project"), - config.src.join("src/bootstrap/download-ci-llvm-stamp"), - // the LLVM shared object file is named `LLVM-12-rust-{version}-nightly` - config.src.join("src/version"), - ]) + get_closest_merge_commit( + Some(&config.src), + &config.git_config(), + &[ + config.src.join("src/llvm-project"), + config.src.join("src/bootstrap/download-ci-llvm-stamp"), + // the LLVM shared object file is named `LLVM-12-rust-{version}-nightly` + config.src.join("src/version"), + ], + ) .unwrap() } else if let Some(info) = crate::utils::channel::read_commit_info_file(&config.src) { info.sha.trim().to_owned() diff --git a/src/bootstrap/src/core/build_steps/toolstate.rs b/src/bootstrap/src/core/build_steps/toolstate.rs index 84871331bd509..668133f05cb35 100644 --- a/src/bootstrap/src/core/build_steps/toolstate.rs +++ b/src/bootstrap/src/core/build_steps/toolstate.rs @@ -42,11 +42,15 @@ pub enum ToolState { impl fmt::Display for ToolState { fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { - write!(f, "{}", match self { - ToolState::TestFail => "test-fail", - ToolState::TestPass => "test-pass", - ToolState::BuildFail => "build-fail", - }) + write!( + f, + "{}", + match self { + ToolState::TestFail => "test-fail", + ToolState::TestPass => "test-pass", + ToolState::BuildFail => "build-fail", + } + ) } } diff --git a/src/bootstrap/src/core/builder/mod.rs b/src/bootstrap/src/core/builder/mod.rs index 08421dc1f5b11..8e767a8dcc695 100644 --- a/src/bootstrap/src/core/builder/mod.rs +++ b/src/bootstrap/src/core/builder/mod.rs @@ -315,29 +315,32 @@ const PATH_REMAP: &[(&str, &[&str])] = &[ // actual path is `proc-macro-srv-cli` ("rust-analyzer-proc-macro-srv", &["src/tools/rust-analyzer/crates/proc-macro-srv-cli"]), // Make `x test tests` function the same as `x t tests/*` - ("tests", &[ - // tidy-alphabetical-start - "tests/assembly", - "tests/codegen", - "tests/codegen-units", - "tests/coverage", - "tests/coverage-run-rustdoc", - "tests/crashes", - "tests/debuginfo", - "tests/incremental", - "tests/mir-opt", - "tests/pretty", - "tests/run-make", - "tests/rustdoc", - "tests/rustdoc-gui", - "tests/rustdoc-js", - "tests/rustdoc-js-std", - "tests/rustdoc-json", - "tests/rustdoc-ui", - "tests/ui", - "tests/ui-fulldeps", - // tidy-alphabetical-end - ]), + ( + "tests", + &[ + // tidy-alphabetical-start + "tests/assembly", + "tests/codegen", + "tests/codegen-units", + "tests/coverage", + "tests/coverage-run-rustdoc", + "tests/crashes", + "tests/debuginfo", + "tests/incremental", + "tests/mir-opt", + "tests/pretty", + "tests/run-make", + "tests/rustdoc", + "tests/rustdoc-gui", + "tests/rustdoc-js", + "tests/rustdoc-js-std", + "tests/rustdoc-json", + "tests/rustdoc-ui", + "tests/ui", + "tests/ui-fulldeps", + // tidy-alphabetical-end + ], + ), ]; fn remap_paths(paths: &mut Vec) { diff --git a/src/bootstrap/src/core/builder/tests.rs b/src/bootstrap/src/core/builder/tests.rs index 0c27597083def..74e1ed5c63763 100644 --- a/src/bootstrap/src/core/builder/tests.rs +++ b/src/bootstrap/src/core/builder/tests.rs @@ -114,11 +114,14 @@ fn test_intersection() { ]; let subset = library_set.intersection_removing_matches(&mut command_paths, Kind::Build); assert_eq!(subset, set(&["library/core", "library/alloc"]),); - assert_eq!(command_paths, vec![ - CLIStepPath::from(PathBuf::from("library/core")).will_be_executed(true), - CLIStepPath::from(PathBuf::from("library/alloc")).will_be_executed(true), - CLIStepPath::from(PathBuf::from("library/stdarch")).will_be_executed(false), - ]); + assert_eq!( + command_paths, + vec![ + CLIStepPath::from(PathBuf::from("library/core")).will_be_executed(true), + CLIStepPath::from(PathBuf::from("library/alloc")).will_be_executed(true), + CLIStepPath::from(PathBuf::from("library/stdarch")).will_be_executed(false), + ] + ); } #[test] @@ -135,10 +138,13 @@ fn test_resolve_parent_and_subpaths() { let library_set = set(&["src/tools/miri", "src/tools/miri/cargo-miri"]); library_set.intersection_removing_matches(&mut command_paths, Kind::Build); - assert_eq!(command_paths, vec![ - CLIStepPath::from(PathBuf::from("src/tools/miri")).will_be_executed(true), - CLIStepPath::from(PathBuf::from("src/tools/miri/cargo-miri")).will_be_executed(true), - ]); + assert_eq!( + command_paths, + vec![ + CLIStepPath::from(PathBuf::from("src/tools/miri")).will_be_executed(true), + CLIStepPath::from(PathBuf::from("src/tools/miri/cargo-miri")).will_be_executed(true), + ] + ); } #[test] @@ -212,18 +218,22 @@ fn alias_and_path_for_library() { &["library".into(), "core".into()], configure("build", &[TEST_TRIPLE_1], &[TEST_TRIPLE_1]), ); - assert_eq!(first(cache.all::()), &[ - std!(TEST_TRIPLE_1 => TEST_TRIPLE_1, stage = 0), - std!(TEST_TRIPLE_1 => TEST_TRIPLE_1, stage = 1) - ]); + assert_eq!( + first(cache.all::()), + &[ + std!(TEST_TRIPLE_1 => TEST_TRIPLE_1, stage = 0), + std!(TEST_TRIPLE_1 => TEST_TRIPLE_1, stage = 1) + ] + ); let mut cache = run_build( &["library".into(), "core".into()], configure("doc", &[TEST_TRIPLE_1], &[TEST_TRIPLE_1]), ); - assert_eq!(first(cache.all::()), &[ - doc_std!(TEST_TRIPLE_1 => TEST_TRIPLE_1, stage = 0) - ]); + assert_eq!( + first(cache.all::()), + &[doc_std!(TEST_TRIPLE_1 => TEST_TRIPLE_1, stage = 0)] + ); } #[test] @@ -271,10 +281,13 @@ mod defaults { let mut cache = run_build(&[], configure("build", &[TEST_TRIPLE_1], &[TEST_TRIPLE_1])); let a = TargetSelection::from_user(TEST_TRIPLE_1); - assert_eq!(first(cache.all::()), &[ - std!(TEST_TRIPLE_1 => TEST_TRIPLE_1, stage = 0), - std!(TEST_TRIPLE_1 => TEST_TRIPLE_1, stage = 1), - ]); + assert_eq!( + first(cache.all::()), + &[ + std!(TEST_TRIPLE_1 => TEST_TRIPLE_1, stage = 0), + std!(TEST_TRIPLE_1 => TEST_TRIPLE_1, stage = 1), + ] + ); assert!(!cache.all::().is_empty()); // Make sure rustdoc is only built once. assert_eq!( @@ -283,9 +296,10 @@ mod defaults { // - this is the compiler it's _linked_ to, not built with. &[tool::Rustdoc { compiler: Compiler { host: a, stage: 1 } }], ); - assert_eq!(first(cache.all::()), &[ - rustc!(TEST_TRIPLE_1 => TEST_TRIPLE_1, stage = 0) - ],); + assert_eq!( + first(cache.all::()), + &[rustc!(TEST_TRIPLE_1 => TEST_TRIPLE_1, stage = 0)], + ); } #[test] @@ -294,9 +308,10 @@ mod defaults { let mut cache = run_build(&[], config); let a = TargetSelection::from_user(TEST_TRIPLE_1); - assert_eq!(first(cache.all::()), &[ - std!(TEST_TRIPLE_1 => TEST_TRIPLE_1, stage = 0) - ]); + assert_eq!( + first(cache.all::()), + &[std!(TEST_TRIPLE_1 => TEST_TRIPLE_1, stage = 0)] + ); assert!(!cache.all::().is_empty()); assert_eq!( first(cache.all::()), @@ -323,25 +338,37 @@ mod defaults { // there's not really a need for us to build for target A in this case // (since we're producing stage 1 libraries/binaries). But currently // bootstrap is just a bit buggy here; this should be fixed though. - assert_eq!(first(cache.all::()), &[ - std!(TEST_TRIPLE_1 => TEST_TRIPLE_1, stage = 0), - std!(TEST_TRIPLE_1 => TEST_TRIPLE_1, stage = 1), - std!(TEST_TRIPLE_1 => TEST_TRIPLE_2, stage = 0), - std!(TEST_TRIPLE_1 => TEST_TRIPLE_2, stage = 1), - ]); - assert_eq!(first(cache.all::()), &[ - compile::Assemble { target_compiler: Compiler { host: a, stage: 0 } }, - compile::Assemble { target_compiler: Compiler { host: a, stage: 1 } }, - compile::Assemble { target_compiler: Compiler { host: b, stage: 1 } }, - ]); - assert_eq!(first(cache.all::()), &[ - tool::Rustdoc { compiler: Compiler { host: a, stage: 1 } }, - tool::Rustdoc { compiler: Compiler { host: b, stage: 1 } }, - ],); - assert_eq!(first(cache.all::()), &[ - rustc!(TEST_TRIPLE_1 => TEST_TRIPLE_1, stage = 0), - rustc!(TEST_TRIPLE_1 => TEST_TRIPLE_2, stage = 0), - ]); + assert_eq!( + first(cache.all::()), + &[ + std!(TEST_TRIPLE_1 => TEST_TRIPLE_1, stage = 0), + std!(TEST_TRIPLE_1 => TEST_TRIPLE_1, stage = 1), + std!(TEST_TRIPLE_1 => TEST_TRIPLE_2, stage = 0), + std!(TEST_TRIPLE_1 => TEST_TRIPLE_2, stage = 1), + ] + ); + assert_eq!( + first(cache.all::()), + &[ + compile::Assemble { target_compiler: Compiler { host: a, stage: 0 } }, + compile::Assemble { target_compiler: Compiler { host: a, stage: 1 } }, + compile::Assemble { target_compiler: Compiler { host: b, stage: 1 } }, + ] + ); + assert_eq!( + first(cache.all::()), + &[ + tool::Rustdoc { compiler: Compiler { host: a, stage: 1 } }, + tool::Rustdoc { compiler: Compiler { host: b, stage: 1 } }, + ], + ); + assert_eq!( + first(cache.all::()), + &[ + rustc!(TEST_TRIPLE_1 => TEST_TRIPLE_1, stage = 0), + rustc!(TEST_TRIPLE_1 => TEST_TRIPLE_2, stage = 0), + ] + ); } #[test] @@ -355,15 +382,17 @@ mod defaults { // error_index_generator uses stage 0 to share rustdoc artifacts with the // rustdoc tool. assert_eq!(first(cache.all::()), &[doc::ErrorIndex { target: a },]); - assert_eq!(first(cache.all::()), &[tool::ErrorIndex { - compiler: Compiler { host: a, stage: 0 } - }]); + assert_eq!( + first(cache.all::()), + &[tool::ErrorIndex { compiler: Compiler { host: a, stage: 0 } }] + ); // docs should be built with the beta compiler, not with the stage0 artifacts. // recall that rustdoc is off-by-one: `stage` is the compiler rustdoc is _linked_ to, // not the one it was built by. - assert_eq!(first(cache.all::()), &[tool::Rustdoc { - compiler: Compiler { host: a, stage: 0 } - },]); + assert_eq!( + first(cache.all::()), + &[tool::Rustdoc { compiler: Compiler { host: a, stage: 0 } },] + ); } } @@ -385,18 +414,20 @@ mod dist { assert_eq!(first(cache.all::()), &[dist::Docs { host: a },]); assert_eq!(first(cache.all::()), &[dist::Mingw { host: a },]); - assert_eq!(first(cache.all::()), &[dist::Rustc { - compiler: Compiler { host: a, stage: 2 } - },]); - assert_eq!(first(cache.all::()), &[dist::Std { - compiler: Compiler { host: a, stage: 1 }, - target: a - },]); + assert_eq!( + first(cache.all::()), + &[dist::Rustc { compiler: Compiler { host: a, stage: 2 } },] + ); + assert_eq!( + first(cache.all::()), + &[dist::Std { compiler: Compiler { host: a, stage: 1 }, target: a },] + ); assert_eq!(first(cache.all::()), &[dist::Src]); // Make sure rustdoc is only built once. - assert_eq!(first(cache.all::()), &[tool::Rustdoc { - compiler: Compiler { host: a, stage: 2 } - },]); + assert_eq!( + first(cache.all::()), + &[tool::Rustdoc { compiler: Compiler { host: a, stage: 2 } },] + ); } #[test] @@ -407,19 +438,25 @@ mod dist { let a = TargetSelection::from_user(TEST_TRIPLE_1); let b = TargetSelection::from_user(TEST_TRIPLE_2); - assert_eq!(first(cache.all::()), &[dist::Docs { host: a }, dist::Docs { - host: b - },]); - assert_eq!(first(cache.all::()), &[dist::Mingw { host: a }, dist::Mingw { - host: b - },]); - assert_eq!(first(cache.all::()), &[dist::Rustc { - compiler: Compiler { host: a, stage: 2 } - },]); - assert_eq!(first(cache.all::()), &[ - dist::Std { compiler: Compiler { host: a, stage: 1 }, target: a }, - dist::Std { compiler: Compiler { host: a, stage: 2 }, target: b }, - ]); + assert_eq!( + first(cache.all::()), + &[dist::Docs { host: a }, dist::Docs { host: b },] + ); + assert_eq!( + first(cache.all::()), + &[dist::Mingw { host: a }, dist::Mingw { host: b },] + ); + assert_eq!( + first(cache.all::()), + &[dist::Rustc { compiler: Compiler { host: a, stage: 2 } },] + ); + assert_eq!( + first(cache.all::()), + &[ + dist::Std { compiler: Compiler { host: a, stage: 1 }, target: a }, + dist::Std { compiler: Compiler { host: a, stage: 2 }, target: b }, + ] + ); assert_eq!(first(cache.all::()), &[dist::Src]); } @@ -433,27 +470,38 @@ mod dist { let a = TargetSelection::from_user(TEST_TRIPLE_1); let b = TargetSelection::from_user(TEST_TRIPLE_2); - assert_eq!(first(cache.all::()), &[dist::Docs { host: a }, dist::Docs { - host: b - },]); - assert_eq!(first(cache.all::()), &[dist::Mingw { host: a }, dist::Mingw { - host: b - },]); - assert_eq!(first(cache.all::()), &[ - dist::Rustc { compiler: Compiler { host: a, stage: 2 } }, - dist::Rustc { compiler: Compiler { host: b, stage: 2 } }, - ]); - assert_eq!(first(cache.all::()), &[ - dist::Std { compiler: Compiler { host: a, stage: 1 }, target: a }, - dist::Std { compiler: Compiler { host: a, stage: 1 }, target: b }, - ]); - assert_eq!(first(cache.all::()), &[ - std!(TEST_TRIPLE_1 => TEST_TRIPLE_1, stage = 0), - std!(TEST_TRIPLE_1 => TEST_TRIPLE_1, stage = 1), - std!(TEST_TRIPLE_1 => TEST_TRIPLE_1, stage = 2), - std!(TEST_TRIPLE_1 => TEST_TRIPLE_2, stage = 1), - std!(TEST_TRIPLE_1 => TEST_TRIPLE_2, stage = 2), - ],); + assert_eq!( + first(cache.all::()), + &[dist::Docs { host: a }, dist::Docs { host: b },] + ); + assert_eq!( + first(cache.all::()), + &[dist::Mingw { host: a }, dist::Mingw { host: b },] + ); + assert_eq!( + first(cache.all::()), + &[ + dist::Rustc { compiler: Compiler { host: a, stage: 2 } }, + dist::Rustc { compiler: Compiler { host: b, stage: 2 } }, + ] + ); + assert_eq!( + first(cache.all::()), + &[ + dist::Std { compiler: Compiler { host: a, stage: 1 }, target: a }, + dist::Std { compiler: Compiler { host: a, stage: 1 }, target: b }, + ] + ); + assert_eq!( + first(cache.all::()), + &[ + std!(TEST_TRIPLE_1 => TEST_TRIPLE_1, stage = 0), + std!(TEST_TRIPLE_1 => TEST_TRIPLE_1, stage = 1), + std!(TEST_TRIPLE_1 => TEST_TRIPLE_1, stage = 2), + std!(TEST_TRIPLE_1 => TEST_TRIPLE_2, stage = 1), + std!(TEST_TRIPLE_1 => TEST_TRIPLE_2, stage = 2), + ], + ); assert_eq!(first(cache.all::()), &[dist::Src]); } @@ -467,49 +515,56 @@ mod dist { config.hosts = vec![b]; let mut cache = run_build(&[], config); - assert_eq!(first(cache.all::()), &[dist::Rustc { - compiler: Compiler { host: b, stage: 2 } - },]); - assert_eq!(first(cache.all::()), &[ - rustc!(TEST_TRIPLE_1 => TEST_TRIPLE_1, stage = 0), - rustc!(TEST_TRIPLE_1 => TEST_TRIPLE_2, stage = 1), - ]); + assert_eq!( + first(cache.all::()), + &[dist::Rustc { compiler: Compiler { host: b, stage: 2 } },] + ); + assert_eq!( + first(cache.all::()), + &[ + rustc!(TEST_TRIPLE_1 => TEST_TRIPLE_1, stage = 0), + rustc!(TEST_TRIPLE_1 => TEST_TRIPLE_2, stage = 1), + ] + ); } #[test] fn dist_with_targets_and_hosts() { let mut cache = run_build( &[], - configure(&[TEST_TRIPLE_1, TEST_TRIPLE_2], &[ - TEST_TRIPLE_1, - TEST_TRIPLE_2, - TEST_TRIPLE_3, - ]), + configure( + &[TEST_TRIPLE_1, TEST_TRIPLE_2], + &[TEST_TRIPLE_1, TEST_TRIPLE_2, TEST_TRIPLE_3], + ), ); let a = TargetSelection::from_user(TEST_TRIPLE_1); let b = TargetSelection::from_user(TEST_TRIPLE_2); let c = TargetSelection::from_user(TEST_TRIPLE_3); - assert_eq!(first(cache.all::()), &[ - dist::Docs { host: a }, - dist::Docs { host: b }, - dist::Docs { host: c }, - ]); - assert_eq!(first(cache.all::()), &[ - dist::Mingw { host: a }, - dist::Mingw { host: b }, - dist::Mingw { host: c }, - ]); - assert_eq!(first(cache.all::()), &[ - dist::Rustc { compiler: Compiler { host: a, stage: 2 } }, - dist::Rustc { compiler: Compiler { host: b, stage: 2 } }, - ]); - assert_eq!(first(cache.all::()), &[ - dist::Std { compiler: Compiler { host: a, stage: 1 }, target: a }, - dist::Std { compiler: Compiler { host: a, stage: 1 }, target: b }, - dist::Std { compiler: Compiler { host: a, stage: 2 }, target: c }, - ]); + assert_eq!( + first(cache.all::()), + &[dist::Docs { host: a }, dist::Docs { host: b }, dist::Docs { host: c },] + ); + assert_eq!( + first(cache.all::()), + &[dist::Mingw { host: a }, dist::Mingw { host: b }, dist::Mingw { host: c },] + ); + assert_eq!( + first(cache.all::()), + &[ + dist::Rustc { compiler: Compiler { host: a, stage: 2 } }, + dist::Rustc { compiler: Compiler { host: b, stage: 2 } }, + ] + ); + assert_eq!( + first(cache.all::()), + &[ + dist::Std { compiler: Compiler { host: a, stage: 1 }, target: a }, + dist::Std { compiler: Compiler { host: a, stage: 1 }, target: b }, + dist::Std { compiler: Compiler { host: a, stage: 2 }, target: c }, + ] + ); assert_eq!(first(cache.all::()), &[dist::Src]); } @@ -523,10 +578,10 @@ mod dist { assert_eq!(first(cache.all::()), &[dist::Docs { host: c },]); assert_eq!(first(cache.all::()), &[dist::Mingw { host: c },]); - assert_eq!(first(cache.all::()), &[dist::Std { - compiler: Compiler { host: a, stage: 2 }, - target: c - },]); + assert_eq!( + first(cache.all::()), + &[dist::Std { compiler: Compiler { host: a, stage: 2 }, target: c },] + ); } #[test] @@ -539,65 +594,84 @@ mod dist { let a = TargetSelection::from_user(TEST_TRIPLE_1); let b = TargetSelection::from_user(TEST_TRIPLE_2); - assert_eq!(first(cache.all::()), &[dist::Docs { host: a }, dist::Docs { - host: b - },]); - assert_eq!(first(cache.all::()), &[dist::Mingw { host: a }, dist::Mingw { - host: b - },]); - assert_eq!(first(cache.all::()), &[ - dist::Rustc { compiler: Compiler { host: a, stage: 2 } }, - dist::Rustc { compiler: Compiler { host: b, stage: 2 } }, - ]); - assert_eq!(first(cache.all::()), &[ - dist::Std { compiler: Compiler { host: a, stage: 1 }, target: a }, - dist::Std { compiler: Compiler { host: a, stage: 1 }, target: b }, - ]); + assert_eq!( + first(cache.all::()), + &[dist::Docs { host: a }, dist::Docs { host: b },] + ); + assert_eq!( + first(cache.all::()), + &[dist::Mingw { host: a }, dist::Mingw { host: b },] + ); + assert_eq!( + first(cache.all::()), + &[ + dist::Rustc { compiler: Compiler { host: a, stage: 2 } }, + dist::Rustc { compiler: Compiler { host: b, stage: 2 } }, + ] + ); + assert_eq!( + first(cache.all::()), + &[ + dist::Std { compiler: Compiler { host: a, stage: 1 }, target: a }, + dist::Std { compiler: Compiler { host: a, stage: 1 }, target: b }, + ] + ); assert_eq!(first(cache.all::()), &[dist::Src]); - assert_eq!(first(cache.all::()), &[ - std!(TEST_TRIPLE_1 => TEST_TRIPLE_1, stage = 0), - std!(TEST_TRIPLE_1 => TEST_TRIPLE_1, stage = 1), - std!(TEST_TRIPLE_1 => TEST_TRIPLE_1, stage = 2), - std!(TEST_TRIPLE_1 => TEST_TRIPLE_2, stage = 1), - std!(TEST_TRIPLE_1 => TEST_TRIPLE_2, stage = 2), - ]); - assert_eq!(first(cache.all::()), &[ - compile::Assemble { target_compiler: Compiler { host: a, stage: 0 } }, - compile::Assemble { target_compiler: Compiler { host: a, stage: 1 } }, - compile::Assemble { target_compiler: Compiler { host: a, stage: 2 } }, - compile::Assemble { target_compiler: Compiler { host: b, stage: 2 } }, - ]); + assert_eq!( + first(cache.all::()), + &[ + std!(TEST_TRIPLE_1 => TEST_TRIPLE_1, stage = 0), + std!(TEST_TRIPLE_1 => TEST_TRIPLE_1, stage = 1), + std!(TEST_TRIPLE_1 => TEST_TRIPLE_1, stage = 2), + std!(TEST_TRIPLE_1 => TEST_TRIPLE_2, stage = 1), + std!(TEST_TRIPLE_1 => TEST_TRIPLE_2, stage = 2), + ] + ); + assert_eq!( + first(cache.all::()), + &[ + compile::Assemble { target_compiler: Compiler { host: a, stage: 0 } }, + compile::Assemble { target_compiler: Compiler { host: a, stage: 1 } }, + compile::Assemble { target_compiler: Compiler { host: a, stage: 2 } }, + compile::Assemble { target_compiler: Compiler { host: b, stage: 2 } }, + ] + ); } #[test] fn build_all() { - let build = Build::new(configure(&[TEST_TRIPLE_1, TEST_TRIPLE_2], &[ - TEST_TRIPLE_1, - TEST_TRIPLE_2, - TEST_TRIPLE_3, - ])); + let build = Build::new(configure( + &[TEST_TRIPLE_1, TEST_TRIPLE_2], + &[TEST_TRIPLE_1, TEST_TRIPLE_2, TEST_TRIPLE_3], + )); let mut builder = Builder::new(&build); - builder.run_step_descriptions(&Builder::get_step_descriptions(Kind::Build), &[ - "compiler/rustc".into(), - "library".into(), - ]); + builder.run_step_descriptions( + &Builder::get_step_descriptions(Kind::Build), + &["compiler/rustc".into(), "library".into()], + ); - assert_eq!(first(builder.cache.all::()), &[ - std!(TEST_TRIPLE_1 => TEST_TRIPLE_1, stage = 0), - std!(TEST_TRIPLE_1 => TEST_TRIPLE_1, stage = 1), - std!(TEST_TRIPLE_1 => TEST_TRIPLE_1, stage = 2), - std!(TEST_TRIPLE_1 => TEST_TRIPLE_2, stage = 1), - std!(TEST_TRIPLE_1 => TEST_TRIPLE_2, stage = 2), - std!(TEST_TRIPLE_1 => TEST_TRIPLE_3, stage = 2), - ]); + assert_eq!( + first(builder.cache.all::()), + &[ + std!(TEST_TRIPLE_1 => TEST_TRIPLE_1, stage = 0), + std!(TEST_TRIPLE_1 => TEST_TRIPLE_1, stage = 1), + std!(TEST_TRIPLE_1 => TEST_TRIPLE_1, stage = 2), + std!(TEST_TRIPLE_1 => TEST_TRIPLE_2, stage = 1), + std!(TEST_TRIPLE_1 => TEST_TRIPLE_2, stage = 2), + std!(TEST_TRIPLE_1 => TEST_TRIPLE_3, stage = 2), + ] + ); assert_eq!(builder.cache.all::().len(), 5); - assert_eq!(first(builder.cache.all::()), &[ - rustc!(TEST_TRIPLE_1 => TEST_TRIPLE_1, stage = 0), - rustc!(TEST_TRIPLE_1 => TEST_TRIPLE_1, stage = 1), - rustc!(TEST_TRIPLE_1 => TEST_TRIPLE_1, stage = 2), - rustc!(TEST_TRIPLE_1 => TEST_TRIPLE_2, stage = 1), - rustc!(TEST_TRIPLE_1 => TEST_TRIPLE_2, stage = 2), - ]); + assert_eq!( + first(builder.cache.all::()), + &[ + rustc!(TEST_TRIPLE_1 => TEST_TRIPLE_1, stage = 0), + rustc!(TEST_TRIPLE_1 => TEST_TRIPLE_1, stage = 1), + rustc!(TEST_TRIPLE_1 => TEST_TRIPLE_1, stage = 2), + rustc!(TEST_TRIPLE_1 => TEST_TRIPLE_2, stage = 1), + rustc!(TEST_TRIPLE_1 => TEST_TRIPLE_2, stage = 2), + ] + ); } #[test] @@ -626,20 +700,29 @@ mod dist { let a = TargetSelection::from_user(TEST_TRIPLE_1); - assert_eq!(first(builder.cache.all::()), &[ - std!(TEST_TRIPLE_1 => TEST_TRIPLE_1, stage = 0), - std!(TEST_TRIPLE_1 => TEST_TRIPLE_1, stage = 1), - std!(TEST_TRIPLE_1 => TEST_TRIPLE_3, stage = 2), - ]); - assert_eq!(first(builder.cache.all::()), &[ - compile::Assemble { target_compiler: Compiler { host: a, stage: 0 } }, - compile::Assemble { target_compiler: Compiler { host: a, stage: 1 } }, - compile::Assemble { target_compiler: Compiler { host: a, stage: 2 } }, - ]); - assert_eq!(first(builder.cache.all::()), &[ - rustc!(TEST_TRIPLE_1 => TEST_TRIPLE_1, stage = 0), - rustc!(TEST_TRIPLE_1 => TEST_TRIPLE_1, stage = 1), - ]); + assert_eq!( + first(builder.cache.all::()), + &[ + std!(TEST_TRIPLE_1 => TEST_TRIPLE_1, stage = 0), + std!(TEST_TRIPLE_1 => TEST_TRIPLE_1, stage = 1), + std!(TEST_TRIPLE_1 => TEST_TRIPLE_3, stage = 2), + ] + ); + assert_eq!( + first(builder.cache.all::()), + &[ + compile::Assemble { target_compiler: Compiler { host: a, stage: 0 } }, + compile::Assemble { target_compiler: Compiler { host: a, stage: 1 } }, + compile::Assemble { target_compiler: Compiler { host: a, stage: 2 } }, + ] + ); + assert_eq!( + first(builder.cache.all::()), + &[ + rustc!(TEST_TRIPLE_1 => TEST_TRIPLE_1, stage = 0), + rustc!(TEST_TRIPLE_1 => TEST_TRIPLE_1, stage = 1), + ] + ); } #[test] @@ -669,18 +752,22 @@ mod dist { let host = TargetSelection::from_user(TEST_TRIPLE_1); - builder.run_step_descriptions(&[StepDescription::from::(Kind::Test)], &[ - "library/std".into(), - ]); + builder.run_step_descriptions( + &[StepDescription::from::(Kind::Test)], + &["library/std".into()], + ); // Ensure we don't build any compiler artifacts. assert!(!builder.cache.contains::()); - assert_eq!(first(builder.cache.all::()), &[test::Crate { - compiler: Compiler { host, stage: 0 }, - target: host, - mode: crate::Mode::Std, - crates: vec!["std".to_owned()], - },]); + assert_eq!( + first(builder.cache.all::()), + &[test::Crate { + compiler: Compiler { host, stage: 0 }, + target: host, + mode: crate::Mode::Std, + crates: vec!["std".to_owned()], + },] + ); } #[test] @@ -699,14 +786,16 @@ mod dist { first(builder.cache.all::()), &[doc::ErrorIndex { target: a },] ); - assert_eq!(first(builder.cache.all::()), &[tool::ErrorIndex { - compiler: Compiler { host: a, stage: 1 } - }]); + assert_eq!( + first(builder.cache.all::()), + &[tool::ErrorIndex { compiler: Compiler { host: a, stage: 1 } }] + ); // This is actually stage 1, but Rustdoc::run swaps out the compiler with // stage minus 1 if --stage is not 0. Very confusing! - assert_eq!(first(builder.cache.all::()), &[tool::Rustdoc { - compiler: Compiler { host: a, stage: 2 } - },]); + assert_eq!( + first(builder.cache.all::()), + &[tool::Rustdoc { compiler: Compiler { host: a, stage: 2 } },] + ); } #[test] @@ -743,9 +832,10 @@ mod dist { first(builder.cache.all::()), &[doc::ErrorIndex { target: a },] ); - assert_eq!(first(builder.cache.all::()), &[tool::ErrorIndex { - compiler: Compiler { host: a, stage: 1 } - }]); + assert_eq!( + first(builder.cache.all::()), + &[tool::ErrorIndex { compiler: Compiler { host: a, stage: 1 } }] + ); // Unfortunately rustdoc is built twice. Once from stage1 for compiletest // (and other things), and once from stage0 for std crates. Ideally it // would only be built once. If someone wants to fix this, it might be @@ -757,11 +847,14 @@ mod dist { // The stage 0 copy is the one downloaded for bootstrapping. It is // (currently) needed to run "cargo test" on the linkchecker, and // should be relatively "free". - assert_eq!(first(builder.cache.all::()), &[ - tool::Rustdoc { compiler: Compiler { host: a, stage: 0 } }, - tool::Rustdoc { compiler: Compiler { host: a, stage: 1 } }, - tool::Rustdoc { compiler: Compiler { host: a, stage: 2 } }, - ]); + assert_eq!( + first(builder.cache.all::()), + &[ + tool::Rustdoc { compiler: Compiler { host: a, stage: 0 } }, + tool::Rustdoc { compiler: Compiler { host: a, stage: 1 } }, + tool::Rustdoc { compiler: Compiler { host: a, stage: 2 } }, + ] + ); } } diff --git a/src/bootstrap/src/core/config/config.rs b/src/bootstrap/src/core/config/config.rs index 4694dd2ca4e2e..d3ed7ecddd3d7 100644 --- a/src/bootstrap/src/core/config/config.rs +++ b/src/bootstrap/src/core/config/config.rs @@ -1928,11 +1928,14 @@ impl Config { config.rustc_default_linker = default_linker; config.musl_root = musl_root.map(PathBuf::from); config.save_toolstates = save_toolstates.map(PathBuf::from); - set(&mut config.deny_warnings, match flags.warnings { - Warnings::Deny => Some(true), - Warnings::Warn => Some(false), - Warnings::Default => deny_warnings, - }); + set( + &mut config.deny_warnings, + match flags.warnings { + Warnings::Deny => Some(true), + Warnings::Warn => Some(false), + Warnings::Default => deny_warnings, + }, + ); set(&mut config.backtrace_on_ice, backtrace_on_ice); set(&mut config.rust_verify_llvm_ir, verify_llvm_ir); config.rust_thin_lto_import_instr_limit = thin_lto_import_instr_limit; diff --git a/src/librustdoc/clean/cfg/tests.rs b/src/librustdoc/clean/cfg/tests.rs index 2c62e12c96dc1..26dc101e4b590 100644 --- a/src/librustdoc/clean/cfg/tests.rs +++ b/src/librustdoc/clean/cfg/tests.rs @@ -276,10 +276,13 @@ fn test_parse_ok() { let mi = dummy_meta_item_list!(not, [a]); assert_eq!(Cfg::parse(&mi), Ok(!word_cfg("a"))); - let mi = dummy_meta_item_list!(not, [dummy_meta_item_list!(any, [ - dummy_meta_item_word("a"), - dummy_meta_item_list!(all, [b, c]), - ]),]); + let mi = dummy_meta_item_list!( + not, + [dummy_meta_item_list!( + any, + [dummy_meta_item_word("a"), dummy_meta_item_list!(all, [b, c]),] + ),] + ); assert_eq!(Cfg::parse(&mi), Ok(!(word_cfg("a") | (word_cfg("b") & word_cfg("c"))))); let mi = dummy_meta_item_list!(all, [a, b, c]); @@ -302,18 +305,16 @@ fn test_parse_err() { let mi = dummy_meta_item_list!(foo, []); assert!(Cfg::parse(&mi).is_err()); - let mi = - dummy_meta_item_list!( - all, - [dummy_meta_item_list!(foo, []), dummy_meta_item_word("b"),] - ); + let mi = dummy_meta_item_list!( + all, + [dummy_meta_item_list!(foo, []), dummy_meta_item_word("b"),] + ); assert!(Cfg::parse(&mi).is_err()); - let mi = - dummy_meta_item_list!( - any, - [dummy_meta_item_word("a"), dummy_meta_item_list!(foo, []),] - ); + let mi = dummy_meta_item_list!( + any, + [dummy_meta_item_word("a"), dummy_meta_item_list!(foo, []),] + ); assert!(Cfg::parse(&mi).is_err()); let mi = dummy_meta_item_list!(not, [dummy_meta_item_list!(foo, []),]); diff --git a/src/librustdoc/clean/mod.rs b/src/librustdoc/clean/mod.rs index b14381c0c404a..1d62a93e723a9 100644 --- a/src/librustdoc/clean/mod.rs +++ b/src/librustdoc/clean/mod.rs @@ -544,14 +544,18 @@ fn clean_generic_param_def( } else { None }; - (def.name, GenericParamDefKind::Type { - bounds: ThinVec::new(), // These are filled in from the where-clauses. - default: default.map(Box::new), - synthetic, - }) + ( + def.name, + GenericParamDefKind::Type { + bounds: ThinVec::new(), // These are filled in from the where-clauses. + default: default.map(Box::new), + synthetic, + }, + ) } - ty::GenericParamDefKind::Const { has_default, synthetic } => { - (def.name, GenericParamDefKind::Const { + ty::GenericParamDefKind::Const { has_default, synthetic } => ( + def.name, + GenericParamDefKind::Const { ty: Box::new(clean_middle_ty( ty::Binder::dummy( cx.tcx @@ -573,8 +577,8 @@ fn clean_generic_param_def( None }, synthetic, - }) - } + }, + ), }; GenericParamDef { name, def_id: def.def_id, kind } @@ -619,21 +623,25 @@ fn clean_generic_param<'tcx>( } else { ThinVec::new() }; - (param.name.ident().name, GenericParamDefKind::Type { - bounds, - default: default.map(|t| clean_ty(t, cx)).map(Box::new), - synthetic, - }) + ( + param.name.ident().name, + GenericParamDefKind::Type { + bounds, + default: default.map(|t| clean_ty(t, cx)).map(Box::new), + synthetic, + }, + ) } - hir::GenericParamKind::Const { ty, default, synthetic } => { - (param.name.ident().name, GenericParamDefKind::Const { + hir::GenericParamKind::Const { ty, default, synthetic } => ( + param.name.ident().name, + GenericParamDefKind::Const { ty: Box::new(clean_ty(ty, cx)), default: default.map(|ct| { Box::new(lower_const_arg_for_rustdoc(cx.tcx, ct, FeedConstTy::No).to_string()) }), synthetic, - }) - } + }, + ), }; GenericParamDef { name, def_id: param.def_id.to_def_id(), kind } @@ -653,9 +661,10 @@ fn is_impl_trait(param: &hir::GenericParam<'_>) -> bool { /// /// See `lifetime_to_generic_param` in `rustc_ast_lowering` for more information. fn is_elided_lifetime(param: &hir::GenericParam<'_>) -> bool { - matches!(param.kind, hir::GenericParamKind::Lifetime { - kind: hir::LifetimeParamKind::Elided(_) - }) + matches!( + param.kind, + hir::GenericParamKind::Lifetime { kind: hir::LifetimeParamKind::Elided(_) } + ) } pub(crate) fn clean_generics<'tcx>( @@ -1055,11 +1064,10 @@ fn clean_fn_decl_legacy_const_generics(func: &mut Function, attrs: &[hir::Attrib .. } = param { - func.decl.inputs.values.insert(a.get() as _, Argument { - name, - type_: *ty, - is_const: true, - }); + func.decl + .inputs + .values + .insert(a.get() as _, Argument { name, type_: *ty, is_const: true }); } else { panic!("unexpected non const in position {pos}"); } @@ -1422,11 +1430,11 @@ pub(crate) fn clean_middle_assoc_item(assoc_item: &ty::AssocItem, cx: &mut DocCo let bounds = tcx.explicit_item_bounds(assoc_item.def_id).iter_identity_copied(); predicates = tcx.arena.alloc_from_iter(bounds.chain(predicates.iter().copied())); } - let mut generics = - clean_ty_generics(cx, tcx.generics_of(assoc_item.def_id), ty::GenericPredicates { - parent: None, - predicates, - }); + let mut generics = clean_ty_generics( + cx, + tcx.generics_of(assoc_item.def_id), + ty::GenericPredicates { parent: None, predicates }, + ); simplify::move_bounds_to_generic_parameters(&mut generics); if let ty::AssocItemContainer::Trait = assoc_item.container { diff --git a/src/librustdoc/clean/types.rs b/src/librustdoc/clean/types.rs index 583cd404dca96..5f7c30a33ab8b 100644 --- a/src/librustdoc/clean/types.rs +++ b/src/librustdoc/clean/types.rs @@ -1253,10 +1253,13 @@ impl GenericBound { } pub(crate) fn maybe_sized(cx: &mut DocContext<'_>) -> GenericBound { - Self::sized_with(cx, hir::TraitBoundModifiers { - polarity: hir::BoundPolarity::Maybe(DUMMY_SP), - constness: hir::BoundConstness::Never, - }) + Self::sized_with( + cx, + hir::TraitBoundModifiers { + polarity: hir::BoundPolarity::Maybe(DUMMY_SP), + constness: hir::BoundConstness::Never, + }, + ) } fn sized_with(cx: &mut DocContext<'_>, modifiers: hir::TraitBoundModifiers) -> GenericBound { diff --git a/src/librustdoc/html/highlight.rs b/src/librustdoc/html/highlight.rs index 7b2aee4b4a5d7..8c91cae493103 100644 --- a/src/librustdoc/html/highlight.rs +++ b/src/librustdoc/html/highlight.rs @@ -65,26 +65,34 @@ fn write_header( tooltip: Tooltip, extra_classes: &[String], ) { - write!(out, "
", match tooltip { - Tooltip::Ignore => " ignore", - Tooltip::CompileFail => " compile_fail", - Tooltip::ShouldPanic => " should_panic", - Tooltip::Edition(_) => " edition", - Tooltip::None => "", - },); + write!( + out, + "
", + match tooltip { + Tooltip::Ignore => " ignore", + Tooltip::CompileFail => " compile_fail", + Tooltip::ShouldPanic => " should_panic", + Tooltip::Edition(_) => " edition", + Tooltip::None => "", + }, + ); if tooltip != Tooltip::None { let edition_code; - write!(out, "", match tooltip { - Tooltip::Ignore => "This example is not tested", - Tooltip::CompileFail => "This example deliberately fails to compile", - Tooltip::ShouldPanic => "This example panics", - Tooltip::Edition(edition) => { - edition_code = format!("This example runs with edition {edition}"); - &edition_code - } - Tooltip::None => unreachable!(), - },); + write!( + out, + "", + match tooltip { + Tooltip::Ignore => "This example is not tested", + Tooltip::CompileFail => "This example deliberately fails to compile", + Tooltip::ShouldPanic => "This example panics", + Tooltip::Edition(edition) => { + edition_code = format!("This example runs with edition {edition}"); + &edition_code + } + Tooltip::None => unreachable!(), + }, + ); } if let Some(extra) = extra_content { diff --git a/src/librustdoc/html/markdown/tests.rs b/src/librustdoc/html/markdown/tests.rs index 2001a763c09e8..bb42b877a2c4f 100644 --- a/src/librustdoc/html/markdown/tests.rs +++ b/src/librustdoc/html/markdown/tests.rs @@ -275,14 +275,14 @@ fn test_lang_string_tokenizer() { case("foo", &[LangStringToken::LangToken("foo")]); case("foo,bar", &[LangStringToken::LangToken("foo"), LangStringToken::LangToken("bar")]); case(".foo,.bar", &[]); - case("{.foo,.bar}", &[ - LangStringToken::ClassAttribute("foo"), - LangStringToken::ClassAttribute("bar"), - ]); - case(" {.foo,.bar} ", &[ - LangStringToken::ClassAttribute("foo"), - LangStringToken::ClassAttribute("bar"), - ]); + case( + "{.foo,.bar}", + &[LangStringToken::ClassAttribute("foo"), LangStringToken::ClassAttribute("bar")], + ); + case( + " {.foo,.bar} ", + &[LangStringToken::ClassAttribute("foo"), LangStringToken::ClassAttribute("bar")], + ); case("foo bar", &[LangStringToken::LangToken("foo"), LangStringToken::LangToken("bar")]); case("foo\tbar", &[LangStringToken::LangToken("foo"), LangStringToken::LangToken("bar")]); case("foo\t, bar", &[LangStringToken::LangToken("foo"), LangStringToken::LangToken("bar")]); diff --git a/src/librustdoc/html/render/search_index.rs b/src/librustdoc/html/render/search_index.rs index 8ac8b3a1f8437..95f617c98390a 100644 --- a/src/librustdoc/html/render/search_index.rs +++ b/src/librustdoc/html/render/search_index.rs @@ -1265,13 +1265,14 @@ fn simplify_fn_type<'a, 'tcx>( *stored_bounds = type_bounds; } } - ty_constraints.push((RenderTypeId::AssociatedType(name), vec![ - RenderType { + ty_constraints.push(( + RenderTypeId::AssociatedType(name), + vec![RenderType { id: Some(RenderTypeId::Index(idx)), generics: None, bindings: None, - }, - ])) + }], + )) } } } diff --git a/src/librustdoc/json/mod.rs b/src/librustdoc/json/mod.rs index 789a561496750..6f8cf25554fd2 100644 --- a/src/librustdoc/json/mod.rs +++ b/src/librustdoc/json/mod.rs @@ -268,11 +268,14 @@ impl<'tcx> FormatRenderer<'tcx> for JsonRenderer<'tcx> { .iter() .chain(&self.cache.external_paths) .map(|(&k, &(ref path, kind))| { - (self.id_from_item_default(k.into()), types::ItemSummary { - crate_id: k.krate.as_u32(), - path: path.iter().map(|s| s.to_string()).collect(), - kind: kind.into_json(self), - }) + ( + self.id_from_item_default(k.into()), + types::ItemSummary { + crate_id: k.krate.as_u32(), + path: path.iter().map(|s| s.to_string()).collect(), + kind: kind.into_json(self), + }, + ) }) .collect(), external_crates: self @@ -281,13 +284,16 @@ impl<'tcx> FormatRenderer<'tcx> for JsonRenderer<'tcx> { .iter() .map(|(crate_num, external_location)| { let e = ExternalCrate { crate_num: *crate_num }; - (crate_num.as_u32(), types::ExternalCrate { - name: e.name(self.tcx).to_string(), - html_root_url: match external_location { - ExternalLocation::Remote(s) => Some(s.clone()), - _ => None, + ( + crate_num.as_u32(), + types::ExternalCrate { + name: e.name(self.tcx).to_string(), + html_root_url: match external_location { + ExternalLocation::Remote(s) => Some(s.clone()), + _ => None, + }, }, - }) + ) }) .collect(), format_version: types::FORMAT_VERSION, diff --git a/src/librustdoc/passes/lint/bare_urls.rs b/src/librustdoc/passes/lint/bare_urls.rs index 77d7cf5772d67..1e07277d38e5c 100644 --- a/src/librustdoc/passes/lint/bare_urls.rs +++ b/src/librustdoc/passes/lint/bare_urls.rs @@ -77,9 +77,10 @@ fn find_raw_urls( // For now, we only check "full" URLs (meaning, starting with "http://" or "https://"). for match_ in URL_REGEX.find_iter(text) { let url_range = match_.range(); - f(cx, "this URL is not a hyperlink", Range { - start: range.start + url_range.start, - end: range.start + url_range.end, - }); + f( + cx, + "this URL is not a hyperlink", + Range { start: range.start + url_range.start, end: range.start + url_range.end }, + ); } } diff --git a/src/tools/build-manifest/src/main.rs b/src/tools/build-manifest/src/main.rs index feec2a7444f87..c21bf82b852a3 100644 --- a/src/tools/build-manifest/src/main.rs +++ b/src/tools/build-manifest/src/main.rs @@ -603,11 +603,14 @@ impl Builder { }) .collect(); - dst.insert(pkg.manifest_component_name(), Package { - version: version_info.version.unwrap_or_default(), - git_commit_hash: version_info.git_commit, - target: targets, - }); + dst.insert( + pkg.manifest_component_name(), + Package { + version: version_info.version.unwrap_or_default(), + git_commit_hash: version_info.git_commit, + target: targets, + }, + ); } fn url(&self, path: &Path) -> String { diff --git a/src/tools/compiletest/src/header/tests.rs b/src/tools/compiletest/src/header/tests.rs index ebba16d41f9e8..023658a3dd4c6 100644 --- a/src/tools/compiletest/src/header/tests.rs +++ b/src/tools/compiletest/src/header/tests.rs @@ -251,9 +251,10 @@ fn revisions() { let config: Config = cfg().build(); assert_eq!(parse_rs(&config, "//@ revisions: a b c").revisions, vec!["a", "b", "c"],); - assert_eq!(parse_makefile(&config, "# revisions: hello there").revisions, vec![ - "hello", "there" - ],); + assert_eq!( + parse_makefile(&config, "# revisions: hello there").revisions, + vec!["hello", "there"], + ); } #[test] diff --git a/src/tools/coverage-dump/src/covfun.rs b/src/tools/coverage-dump/src/covfun.rs index 33fac3edccd11..82ebd33d0d1ca 100644 --- a/src/tools/coverage-dump/src/covfun.rs +++ b/src/tools/coverage-dump/src/covfun.rs @@ -95,10 +95,13 @@ pub(crate) fn dump_covfun_mappings( // has increased or decreased the number of physical counters needed. // (It's possible for the generated code to have more counters that // aren't used by any mappings, but that should hopefully be rare.) - println!("Highest counter ID seen: {}", match max_counter { - Some(id) => format!("c{id}"), - None => "(none)".to_owned(), - }); + println!( + "Highest counter ID seen: {}", + match max_counter { + Some(id) => format!("c{id}"), + None => "(none)".to_owned(), + } + ); println!(); } Ok(()) diff --git a/src/tools/generate-copyright/src/cargo_metadata.rs b/src/tools/generate-copyright/src/cargo_metadata.rs index 420579372acb0..51e353e9b229f 100644 --- a/src/tools/generate-copyright/src/cargo_metadata.rs +++ b/src/tools/generate-copyright/src/cargo_metadata.rs @@ -98,12 +98,15 @@ pub fn get_metadata( } // otherwise it's an out-of-tree dependency let package_id = Package { name: package.name, version: package.version.to_string() }; - output.insert(package_id, PackageMetadata { - license: package.license.unwrap_or_else(|| String::from("Unspecified")), - authors: package.authors, - notices: BTreeMap::new(), - is_in_libstd: None, - }); + output.insert( + package_id, + PackageMetadata { + license: package.license.unwrap_or_else(|| String::from("Unspecified")), + authors: package.authors, + notices: BTreeMap::new(), + is_in_libstd: None, + }, + ); } } diff --git a/src/tools/generate-copyright/src/main.rs b/src/tools/generate-copyright/src/main.rs index 0a446ecff5b85..7a014989e6880 100644 --- a/src/tools/generate-copyright/src/main.rs +++ b/src/tools/generate-copyright/src/main.rs @@ -24,12 +24,16 @@ fn main() -> Result<(), Error> { let root_path = std::path::absolute(".")?; // Scan Cargo dependencies - let mut collected_cargo_metadata = - cargo_metadata::get_metadata_and_notices(&cargo, &out_dir.join("vendor"), &root_path, &[ + let mut collected_cargo_metadata = cargo_metadata::get_metadata_and_notices( + &cargo, + &out_dir.join("vendor"), + &root_path, + &[ Path::new("./Cargo.toml"), Path::new("./src/tools/cargo/Cargo.toml"), Path::new("./library/Cargo.toml"), - ])?; + ], + )?; let library_collected_cargo_metadata = cargo_metadata::get_metadata_and_notices( &cargo, diff --git a/src/tools/jsondoclint/src/validator/tests.rs b/src/tools/jsondoclint/src/validator/tests.rs index a37e6c2eb5c92..28deb7e7ceef6 100644 --- a/src/tools/jsondoclint/src/validator/tests.rs +++ b/src/tools/jsondoclint/src/validator/tests.rs @@ -21,32 +21,42 @@ fn errors_on_missing_links() { root: Id(0), crate_version: None, includes_private: false, - index: FxHashMap::from_iter([(Id(0), Item { - name: Some("root".to_owned()), - id: Id(0), - crate_id: 0, - span: None, - visibility: Visibility::Public, - docs: None, - links: FxHashMap::from_iter([("Not Found".to_owned(), Id(1))]), - attrs: vec![], - deprecation: None, - inner: ItemEnum::Module(Module { is_crate: true, items: vec![], is_stripped: false }), - })]), + index: FxHashMap::from_iter([( + Id(0), + Item { + name: Some("root".to_owned()), + id: Id(0), + crate_id: 0, + span: None, + visibility: Visibility::Public, + docs: None, + links: FxHashMap::from_iter([("Not Found".to_owned(), Id(1))]), + attrs: vec![], + deprecation: None, + inner: ItemEnum::Module(Module { + is_crate: true, + items: vec![], + is_stripped: false, + }), + }, + )]), paths: FxHashMap::default(), external_crates: FxHashMap::default(), format_version: rustdoc_json_types::FORMAT_VERSION, }; - check(&k, &[Error { - kind: ErrorKind::NotFound(vec![vec![ - SelectorPart::Field("index".to_owned()), - SelectorPart::Field("0".to_owned()), - SelectorPart::Field("links".to_owned()), - SelectorPart::Field("Not Found".to_owned()), - ]]), - id: Id(1), - }]); + check( + &k, + &[Error { + kind: ErrorKind::NotFound(vec![vec![ + SelectorPart::Field("index".to_owned()), + SelectorPart::Field("0".to_owned()), + SelectorPart::Field("links".to_owned()), + SelectorPart::Field("Not Found".to_owned()), + ]]), + id: Id(1), + }], + ); } // Test we would catch @@ -58,48 +68,60 @@ fn errors_on_local_in_paths_and_not_index() { crate_version: None, includes_private: false, index: FxHashMap::from_iter([ - (Id(0), Item { - id: Id(0), - crate_id: 0, - name: Some("microcore".to_owned()), - span: None, - visibility: Visibility::Public, - docs: None, - links: FxHashMap::from_iter([(("prim@i32".to_owned(), Id(2)))]), - attrs: Vec::new(), - deprecation: None, - inner: ItemEnum::Module(Module { - is_crate: true, - items: vec![Id(1)], - is_stripped: false, - }), - }), - (Id(1), Item { - id: Id(1), - crate_id: 0, - name: Some("i32".to_owned()), - span: None, - visibility: Visibility::Public, - docs: None, - links: FxHashMap::default(), - attrs: Vec::new(), - deprecation: None, - inner: ItemEnum::Primitive(Primitive { name: "i32".to_owned(), impls: vec![] }), - }), + ( + Id(0), + Item { + id: Id(0), + crate_id: 0, + name: Some("microcore".to_owned()), + span: None, + visibility: Visibility::Public, + docs: None, + links: FxHashMap::from_iter([(("prim@i32".to_owned(), Id(2)))]), + attrs: Vec::new(), + deprecation: None, + inner: ItemEnum::Module(Module { + is_crate: true, + items: vec![Id(1)], + is_stripped: false, + }), + }, + ), + ( + Id(1), + Item { + id: Id(1), + crate_id: 0, + name: Some("i32".to_owned()), + span: None, + visibility: Visibility::Public, + docs: None, + links: FxHashMap::default(), + attrs: Vec::new(), + deprecation: None, + inner: ItemEnum::Primitive(Primitive { name: "i32".to_owned(), impls: vec![] }), + }, + ), ]), - paths: FxHashMap::from_iter([(Id(2), ItemSummary { - crate_id: 0, - path: vec!["microcore".to_owned(), "i32".to_owned()], - kind: ItemKind::Primitive, - })]), + paths: FxHashMap::from_iter([( + Id(2), + ItemSummary { + crate_id: 0, + path: vec!["microcore".to_owned(), "i32".to_owned()], + kind: ItemKind::Primitive, + }, + )]), external_crates: FxHashMap::default(), format_version: rustdoc_json_types::FORMAT_VERSION, }; - check(&krate, &[Error { - id: Id(2), - kind: ErrorKind::Custom("Id for local item in `paths` but not in `index`".to_owned()), - }]); + check( + &krate, + &[Error { + id: Id(2), + kind: ErrorKind::Custom("Id for local item in `paths` but not in `index`".to_owned()), + }], + ); } #[test] @@ -117,84 +139,96 @@ fn errors_on_missing_path() { crate_version: None, includes_private: false, index: FxHashMap::from_iter([ - (Id(0), Item { - id: Id(0), - crate_id: 0, - name: Some("foo".to_owned()), - span: None, - visibility: Visibility::Public, - docs: None, - links: FxHashMap::default(), - attrs: Vec::new(), - deprecation: None, - inner: ItemEnum::Module(Module { - is_crate: true, - items: vec![Id(1), Id(2)], - is_stripped: false, - }), - }), - (Id(1), Item { - id: Id(0), - crate_id: 0, - name: Some("Bar".to_owned()), - span: None, - visibility: Visibility::Public, - docs: None, - links: FxHashMap::default(), - attrs: Vec::new(), - deprecation: None, - inner: ItemEnum::Struct(Struct { - kind: StructKind::Unit, - generics: generics.clone(), - impls: vec![], - }), - }), - (Id(2), Item { - id: Id(0), - crate_id: 0, - name: Some("mk_bar".to_owned()), - span: None, - visibility: Visibility::Public, - docs: None, - links: FxHashMap::default(), - attrs: Vec::new(), - deprecation: None, - inner: ItemEnum::Function(Function { - sig: FunctionSignature { - inputs: vec![], - output: Some(Type::ResolvedPath(Path { - path: "Bar".to_owned(), - id: Id(1), - args: None, - })), - is_c_variadic: false, - }, - generics, - header: FunctionHeader { - is_const: false, - is_unsafe: false, - is_async: false, - abi: Abi::Rust, - }, - has_body: true, - }), - }), + ( + Id(0), + Item { + id: Id(0), + crate_id: 0, + name: Some("foo".to_owned()), + span: None, + visibility: Visibility::Public, + docs: None, + links: FxHashMap::default(), + attrs: Vec::new(), + deprecation: None, + inner: ItemEnum::Module(Module { + is_crate: true, + items: vec![Id(1), Id(2)], + is_stripped: false, + }), + }, + ), + ( + Id(1), + Item { + id: Id(0), + crate_id: 0, + name: Some("Bar".to_owned()), + span: None, + visibility: Visibility::Public, + docs: None, + links: FxHashMap::default(), + attrs: Vec::new(), + deprecation: None, + inner: ItemEnum::Struct(Struct { + kind: StructKind::Unit, + generics: generics.clone(), + impls: vec![], + }), + }, + ), + ( + Id(2), + Item { + id: Id(0), + crate_id: 0, + name: Some("mk_bar".to_owned()), + span: None, + visibility: Visibility::Public, + docs: None, + links: FxHashMap::default(), + attrs: Vec::new(), + deprecation: None, + inner: ItemEnum::Function(Function { + sig: FunctionSignature { + inputs: vec![], + output: Some(Type::ResolvedPath(Path { + path: "Bar".to_owned(), + id: Id(1), + args: None, + })), + is_c_variadic: false, + }, + generics, + header: FunctionHeader { + is_const: false, + is_unsafe: false, + is_async: false, + abi: Abi::Rust, + }, + has_body: true, + }), + }, + ), ]), - paths: FxHashMap::from_iter([(Id(0), ItemSummary { - crate_id: 0, - path: vec!["foo".to_owned()], - kind: ItemKind::Module, - })]), + paths: FxHashMap::from_iter([( + Id(0), + ItemSummary { crate_id: 0, path: vec!["foo".to_owned()], kind: ItemKind::Module }, + )]), external_crates: FxHashMap::default(), format_version: rustdoc_json_types::FORMAT_VERSION, }; - check(&krate, &[Error { - kind: ErrorKind::Custom( - r#"No entry in '$.paths' for Path { path: "Bar", id: Id(1), args: None }"#.to_owned(), - ), - id: Id(1), - }]); + check( + &krate, + &[Error { + kind: ErrorKind::Custom( + r#"No entry in '$.paths' for Path { path: "Bar", id: Id(1), args: None }"# + .to_owned(), + ), + id: Id(1), + }], + ); } #[test] @@ -204,18 +238,25 @@ fn checks_local_crate_id_is_correct() { root: Id(0), crate_version: None, includes_private: false, - index: FxHashMap::from_iter([(Id(0), Item { - id: Id(0), - crate_id: LOCAL_CRATE_ID.wrapping_add(1), - name: Some("irrelavent".to_owned()), - span: None, - visibility: Visibility::Public, - docs: None, - links: FxHashMap::default(), - attrs: Vec::new(), - deprecation: None, - inner: ItemEnum::Module(Module { is_crate: true, items: vec![], is_stripped: false }), - })]), + index: FxHashMap::from_iter([( + Id(0), + Item { + id: Id(0), + crate_id: LOCAL_CRATE_ID.wrapping_add(1), + name: Some("irrelavent".to_owned()), + span: None, + visibility: Visibility::Public, + docs: None, + links: FxHashMap::default(), + attrs: Vec::new(), + deprecation: None, + inner: ItemEnum::Module(Module { + is_crate: true, + items: vec![], + is_stripped: false, + }), + }, + )]), paths: FxHashMap::default(), external_crates: FxHashMap::default(), format_version: FORMAT_VERSION, diff --git a/src/tools/lint-docs/src/lib.rs b/src/tools/lint-docs/src/lib.rs index f6e844657807f..9fd33e23204e7 100644 --- a/src/tools/lint-docs/src/lib.rs +++ b/src/tools/lint-docs/src/lib.rs @@ -19,24 +19,30 @@ mod groups; /// level of the lint, which will be more difficult to support, since rustc /// currently does not track that historical information. static RENAMES: &[(Level, &[(&str, &str)])] = &[ - (Level::Allow, &[ - ("single-use-lifetime", "single-use-lifetimes"), - ("elided-lifetime-in-path", "elided-lifetimes-in-paths"), - ("async-idents", "keyword-idents"), - ("disjoint-capture-migration", "rust-2021-incompatible-closure-captures"), - ("keyword-idents", "keyword-idents-2018"), - ("or-patterns-back-compat", "rust-2021-incompatible-or-patterns"), - ]), - (Level::Warn, &[ - ("bare-trait-object", "bare-trait-objects"), - ("unstable-name-collision", "unstable-name-collisions"), - ("unused-doc-comment", "unused-doc-comments"), - ("redundant-semicolon", "redundant-semicolons"), - ("overlapping-patterns", "overlapping-range-endpoints"), - ("non-fmt-panic", "non-fmt-panics"), - ("unused-tuple-struct-fields", "dead-code"), - ("static-mut-ref", "static-mut-refs"), - ]), + ( + Level::Allow, + &[ + ("single-use-lifetime", "single-use-lifetimes"), + ("elided-lifetime-in-path", "elided-lifetimes-in-paths"), + ("async-idents", "keyword-idents"), + ("disjoint-capture-migration", "rust-2021-incompatible-closure-captures"), + ("keyword-idents", "keyword-idents-2018"), + ("or-patterns-back-compat", "rust-2021-incompatible-or-patterns"), + ], + ), + ( + Level::Warn, + &[ + ("bare-trait-object", "bare-trait-objects"), + ("unstable-name-collision", "unstable-name-collisions"), + ("unused-doc-comment", "unused-doc-comments"), + ("redundant-semicolon", "redundant-semicolons"), + ("overlapping-patterns", "overlapping-range-endpoints"), + ("non-fmt-panic", "non-fmt-panics"), + ("unused-tuple-struct-fields", "dead-code"), + ("static-mut-ref", "static-mut-refs"), + ], + ), (Level::Deny, &[("exceeding-bitshifts", "arithmetic-overflow")]), ]; diff --git a/src/tools/rust-installer/src/compression.rs b/src/tools/rust-installer/src/compression.rs index 96c48657c4691..df3a98ae789b0 100644 --- a/src/tools/rust-installer/src/compression.rs +++ b/src/tools/rust-installer/src/compression.rs @@ -81,14 +81,17 @@ impl CompressionFormat { let file = crate::util::create_new_file(path)?; Ok(match self { - CompressionFormat::Gz => Box::new(GzEncoder::new(file, match profile { - CompressionProfile::Fast => flate2::Compression::fast(), - CompressionProfile::Balanced => flate2::Compression::new(6), - CompressionProfile::Best => flate2::Compression::best(), - CompressionProfile::NoOp => panic!( - "compression profile 'no-op' should not call `CompressionFormat::encode`." - ), - })), + CompressionFormat::Gz => Box::new(GzEncoder::new( + file, + match profile { + CompressionProfile::Fast => flate2::Compression::fast(), + CompressionProfile::Balanced => flate2::Compression::new(6), + CompressionProfile::Best => flate2::Compression::best(), + CompressionProfile::NoOp => panic!( + "compression profile 'no-op' should not call `CompressionFormat::encode`." + ), + }, + )), CompressionFormat::Xz => { let encoder = match profile { CompressionProfile::NoOp => panic!( diff --git a/src/tools/tidy/src/ext_tool_checks.rs b/src/tools/tidy/src/ext_tool_checks.rs index 2a4cff1d12ed5..4f9a20fa9e294 100644 --- a/src/tools/tidy/src/ext_tool_checks.rs +++ b/src/tools/tidy/src/ext_tool_checks.rs @@ -95,10 +95,14 @@ fn check_impl( if res.is_err() && show_diff { eprintln!("\npython linting failed! Printing diff suggestions:"); - let _ = run_ruff(root_path, outdir, py_path, &cfg_args, &file_args, &[ - "check".as_ref(), - "--diff".as_ref(), - ]); + let _ = run_ruff( + root_path, + outdir, + py_path, + &cfg_args, + &file_args, + &["check".as_ref(), "--diff".as_ref()], + ); } // Rethrow error let _ = res?; @@ -120,10 +124,14 @@ fn check_impl( if show_diff { eprintln!("\npython formatting does not match! Printing diff:"); - let _ = run_ruff(root_path, outdir, py_path, &cfg_args, &file_args, &[ - "format".as_ref(), - "--diff".as_ref(), - ]); + let _ = run_ruff( + root_path, + outdir, + py_path, + &cfg_args, + &file_args, + &["format".as_ref(), "--diff".as_ref()], + ); } eprintln!("rerun tidy with `--extra-checks=py:fmt --bless` to reformat Python code"); } @@ -148,10 +156,11 @@ fn check_impl( let files; if file_args_clang_format.is_empty() { let llvm_wrapper = root_path.join("compiler/rustc_llvm/llvm-wrapper"); - files = find_with_extension(root_path, Some(llvm_wrapper.as_path()), &[ - OsStr::new("h"), - OsStr::new("cpp"), - ])?; + files = find_with_extension( + root_path, + Some(llvm_wrapper.as_path()), + &[OsStr::new("h"), OsStr::new("cpp")], + )?; file_args_clang_format.extend(files.iter().map(|p| p.as_os_str())); } let args = merge_args(&cfg_args_clang_format, &file_args_clang_format); diff --git a/src/tools/tidy/src/known_bug.rs b/src/tools/tidy/src/known_bug.rs index a877165414400..e1921715ab922 100644 --- a/src/tools/tidy/src/known_bug.rs +++ b/src/tools/tidy/src/known_bug.rs @@ -14,13 +14,10 @@ pub fn check(filepath: &Path, bad: &mut bool) { let test_path_segments_str = test_path_segments.iter().map(|s| s.as_str()).collect::>(); - if !matches!(test_path_segments_str[..], [ - .., - "tests", - "crashes", - "auxiliary", - _aux_file_rs - ]) && !contents.lines().any(|line| line.starts_with("//@ known-bug: ")) + if !matches!( + test_path_segments_str[..], + [.., "tests", "crashes", "auxiliary", _aux_file_rs] + ) && !contents.lines().any(|line| line.starts_with("//@ known-bug: ")) { tidy_error!( bad, diff --git a/src/tools/unicode-table-generator/src/raw_emitter.rs b/src/tools/unicode-table-generator/src/raw_emitter.rs index 46010692fe561..ee94d3c93a6cb 100644 --- a/src/tools/unicode-table-generator/src/raw_emitter.rs +++ b/src/tools/unicode-table-generator/src/raw_emitter.rs @@ -355,12 +355,15 @@ impl Canonicalized { let unique_mapping = unique_mapping .into_iter() .map(|(key, value)| { - (key, match value { - UniqueMapping::Canonicalized(idx) => { - u8::try_from(canonical_words.len() + idx).unwrap() - } - UniqueMapping::Canonical(idx) => u8::try_from(idx).unwrap(), - }) + ( + key, + match value { + UniqueMapping::Canonicalized(idx) => { + u8::try_from(canonical_words.len() + idx).unwrap() + } + UniqueMapping::Canonical(idx) => u8::try_from(idx).unwrap(), + }, + ) }) .collect::>(); @@ -375,21 +378,24 @@ impl Canonicalized { let canonicalized_words = canonicalized_words .into_iter() .map(|v| { - (u8::try_from(v.0).unwrap(), match v.1 { - Mapping::RotateAndInvert(amount) => { - assert_eq!(amount, amount & LOWER_6); - 1 << 6 | (amount as u8) - } - Mapping::Rotate(amount) => { - assert_eq!(amount, amount & LOWER_6); - amount as u8 - } - Mapping::Invert => 1 << 6, - Mapping::ShiftRight(shift_by) => { - assert_eq!(shift_by, shift_by & LOWER_6); - 1 << 7 | (shift_by as u8) - } - }) + ( + u8::try_from(v.0).unwrap(), + match v.1 { + Mapping::RotateAndInvert(amount) => { + assert_eq!(amount, amount & LOWER_6); + 1 << 6 | (amount as u8) + } + Mapping::Rotate(amount) => { + assert_eq!(amount, amount & LOWER_6); + amount as u8 + } + Mapping::Invert => 1 << 6, + Mapping::ShiftRight(shift_by) => { + assert_eq!(shift_by, shift_by & LOWER_6); + 1 << 7 | (shift_by as u8) + } + }, + ) }) .collect::>(); Canonicalized { unique_mapping, canonical_words, canonicalized_words } diff --git a/tests/run-make/wasm-export-all-symbols/rmake.rs b/tests/run-make/wasm-export-all-symbols/rmake.rs index 0c0a785c67cde..4148cc29ec2f8 100644 --- a/tests/run-make/wasm-export-all-symbols/rmake.rs +++ b/tests/run-make/wasm-export-all-symbols/rmake.rs @@ -20,13 +20,16 @@ fn test(args: &[&str]) { rustc().input("main.rs").target("wasm32-wasip1").args(args).run(); verify_exports(Path::new("foo.wasm"), &[("foo", Func), ("FOO", Global), ("memory", Memory)]); - verify_exports(Path::new("main.wasm"), &[ - ("foo", Func), - ("FOO", Global), - ("_start", Func), - ("__main_void", Func), - ("memory", Memory), - ]); + verify_exports( + Path::new("main.wasm"), + &[ + ("foo", Func), + ("FOO", Global), + ("_start", Func), + ("__main_void", Func), + ("memory", Memory), + ], + ); } fn verify_exports(path: &Path, exports: &[(&str, wasmparser::ExternalKind)]) {