Gentoo Archives: gentoo-commits

From: Quentin Retornaz <gentoo@××××××××.com>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/proj/libressl:master commit in: dev-lang/rust/files/, dev-lang/rust/
Date: Sat, 15 Jan 2022 19:13:07
Message-Id: 1642273960.f1fee78db8c5c9b10b90d41a267daac8474ff597.quentin@gentoo
1 commit: f1fee78db8c5c9b10b90d41a267daac8474ff597
2 Author: orbea <orbea <AT> riseup <DOT> net>
3 AuthorDate: Sat Jan 15 04:26:44 2022 +0000
4 Commit: Quentin Retornaz <gentoo <AT> retornaz <DOT> com>
5 CommitDate: Sat Jan 15 19:12:40 2022 +0000
6 URL: https://gitweb.gentoo.org/repo/proj/libressl.git/commit/?id=f1fee78d
7
8 dev-lang/rust: Remove old version and patches
9
10 Signed-off-by: orbea <orbea <AT> riseup.net>
11 Closes: https://github.com/gentoo/libressl/pull/376
12 Signed-off-by: Quentin Retornaz <gentoo <AT> retornaz.com>
13
14 dev-lang/rust/Manifest | 34 --
15 dev-lang/rust/files/1.51.0-bootstrap-panic.patch | 43 --
16 dev-lang/rust/files/1.51.0-slow-doc-install.patch | 92 ---
17 .../rust/files/rustc-1.51.0-backport-pr81728.patch | 181 ------
18 .../rust/files/rustc-1.51.0-backport-pr81741.patch | 44 --
19 .../rust/files/rustc-1.51.0-backport-pr82289.patch | 96 ---
20 .../rust/files/rustc-1.51.0-backport-pr82292.patch | 120 ----
21 .../rust/files/rustc-1.51.0-backport-pr83629.patch | 142 -----
22 dev-lang/rust/rust-1.52.1.ebuild | 677 ---------------------
23 9 files changed, 1429 deletions(-)
24
25 diff --git a/dev-lang/rust/Manifest b/dev-lang/rust/Manifest
26 index 1342d4f..c8dda48 100644
27 --- a/dev-lang/rust/Manifest
28 +++ b/dev-lang/rust/Manifest
29 @@ -1,35 +1,3 @@
30 -DIST rust-1.51.0-aarch64-unknown-linux-gnu.tar.xz 208849064 BLAKE2B 1570536f63237ce04222f78c8c1d0592b3d0bacb62e2a1e2b87f9cd74c8d304837f9259c154e6ddfc5d0fc36c1d69aba34cb27d41346d4e7400ad1950ff19f8f SHA512 2af31290e1065a4611f34e6cc8c62ee494c222becfb21ec6707059c119069b0adf0eec23e56bad4a3cc8690b2556309ec58cbd9003a959983689cc46c7c63361
31 -DIST rust-1.51.0-aarch64-unknown-linux-gnu.tar.xz.asc 801 BLAKE2B cc2cef574740ea5eb632235dca2889a7c6a6941169ac011d3a888cdefb8e5a5af5bb9ade93207ccb6adc82eb6ae1b5ed605954cea2561163c538fcbbcdb647f8 SHA512 43abb6e19c1ca905cb2d047503f4473584e06b8daecff3b6e45ac93dadc2c7f37118e3b66124180a9951b2f5eedf212174a37c661a7775600bd200eb089801f9
32 -DIST rust-1.51.0-aarch64-unknown-linux-musl.tar.xz 209607568 BLAKE2B 8a8d677fac5aa68be8b689bd999894f0b51910d50d86d70db4cc9b60695703dd74b68578b72d9d410d2d163aebd3fbab0993ebf79486a103ef588cb849dc2038 SHA512 d7ca480f4e07f88a49b475d2fcd132126defff21c26a665d1b444b97ce5e44404f9106bb844a5e35d4933a51c2d8a5aabc8ee42a2515c02a559c81937920be4d
33 -DIST rust-1.51.0-aarch64-unknown-linux-musl.tar.xz.asc 801 BLAKE2B 0759b58a1647b0c0a29fc295edb31e793a0688d6a4b6eb8febe4364421f53cd1f4c0555abf7c8d4fb25bd7c15c9aeaa8d520390d8d3b61c213a591ccee7b9887 SHA512 bc2135b94f9c4e7b2616d886e84a268f52404abed2b827bdca5ab8f98071801e171234f18aa27a367b5dbd0df0e207b0aac8a30be59fff807ff70f21279614e2
34 -DIST rust-1.51.0-arm-unknown-linux-gnueabi.tar.xz 194362256 BLAKE2B 20c1559d3b1f32c9ca6f5e9740dff0d9fd859be33ca58d59733fff1566ed0b75dd398facbcd15c8d7c862bee945198b0235973d5f683fd78f82cca52429b269c SHA512 fadb5084152b6fa148c1d584c8ba766201012c0a70bdf273f5d4b89b249d7f520997b12809a0db68c9d1d76283fee892f83b6ef687cbb025c08960ffff7e5eea
35 -DIST rust-1.51.0-arm-unknown-linux-gnueabi.tar.xz.asc 801 BLAKE2B 546fad9428e7261ef78e92d6542ebcd2b1b11c54bb4dc1fbcb7ca622551e6b4fc443f16305f9f37572ff2f24e5dfab491fadf3a128e009c77aa0218b271bbe5e SHA512 580954dde6e5a89a9a16d0b93570275e81f488f0a77952cd4e3878894f9865f2a128bac2aaf0567ffc9e7cf9809808088a819bf7b0e54d8fa6224abe677d1732
36 -DIST rust-1.51.0-arm-unknown-linux-gnueabihf.tar.xz 193918308 BLAKE2B 6799652205422d96c95949a4afa8a321a8a4e0cd42543f321898fdba5b27bb645f9eeb50edb63a43902cc74026a786c12a22af67313bc6ac0843b1e638077d64 SHA512 cd0dba1ebdff9692aef0026d94da38ba7856b64004404b75d0d385b8f9f53eed1ddd0e900e49cda60fc5190fe305d96f6f00d0053f4409479ab991fafa90338c
37 -DIST rust-1.51.0-arm-unknown-linux-gnueabihf.tar.xz.asc 801 BLAKE2B 41cad50cdebc0cb4e59f6c914b30b071dd7a70b6278c03a7349eb51a9ec6976fbaeacaea96f13e8ad91a283a3de4f548cf8e352179359f5697520813bc47e274 SHA512 d74a183dba390ea053ee746575788481e3970572e61b7b55acff521c8f4a9da5a3f4e3feff5c3b26162acdc00eed1c4240a4fbdcac3fa117455ac49d8ce62985
38 -DIST rust-1.51.0-armv7-unknown-linux-gnueabihf.tar.xz 197028040 BLAKE2B 801526d0fc9cdfc25a63227afdfc1bf9e0e6fa0b80f6306d86b68ca16adf4996b755b6ade1a4e898bfaf25565b5b49a358a9ed364bfe5d67c308744814a843de SHA512 c602dcc7fd1343b310f5e3074bf63f2428ca7c15cdce8999fa4655de5a4bda5a13255fc12bee3d0632f6cb93220a883fb36d24061dca6795d23afa9f8fdae57f
39 -DIST rust-1.51.0-armv7-unknown-linux-gnueabihf.tar.xz.asc 801 BLAKE2B dd94fb91fb6dba9788b178ea74b73c0df78f496d6f57382969836ade9aacda1696f363c4cef8126426040620ef934a2f2681d89d5e3a703d9114d8d152abb6f8 SHA512 40a3f61341ec996650b6e4e8552007b822b7990b2154483a7d7a7dcbae4eb2913d4ffb5319037256ff5931ee01320d1c3ce307aa7c9fd90a782646de4edcd2e9
40 -DIST rust-1.51.0-i686-unknown-linux-gnu.tar.xz 213348860 BLAKE2B bd6c1d5ce9f20b961e3db8c69b022402acbdf06029e0802863292bcac89b0f88e6e6d02f625be52e8753d772aad8ac01125ff6832072b5d3d41a9ec7bf5c6a6f SHA512 05d08e44827dcba8197667deb9a7f3584465085ce1b79a38deb138849a07c716646a70f1cc2cee02b41c45ec7c3a3b7800a3fae62ebe04d6f72f017a5d722bab
41 -DIST rust-1.51.0-i686-unknown-linux-gnu.tar.xz.asc 801 BLAKE2B c09c5ce8df8834758cf8049872142104023af24f31a2efc97ee201e6b2db56c1b7dd1baccd608ca1f3de416efd162408a01170fff9b7070cac80df32fa30012d SHA512 6aad34b773cfe0ec30f80dacb7482247515ed1e7025a322d22ce7a2b1a6dc49929f71b9c3a6bd05622b70dd8f37fde5cc809ac32c4724b98098630158dddcfdf
42 -DIST rust-1.51.0-mips-unknown-linux-gnu.tar.xz 155944968 BLAKE2B ab9ad78f147b439beec9e92e643cc48814666c5e8fa244981d0919237844006aa2879a4058145d0bdafe89793402e65982d9fd3f0c6253f6a1805bf3381b4caf SHA512 378cfacfc66f1e8a4aeeb3715db9d3cefb4582db8a3b8fc62f05ac50a16db302b250c1696605c17cebe75923010b361b3a9883f7567a26cdcd60fc8379d2d7b3
43 -DIST rust-1.51.0-mips-unknown-linux-gnu.tar.xz.asc 801 BLAKE2B d072b66f210244c3cb534a040679ee5c5433703fe309a05565a91b4cc8fd50b0e09320067dc48a7255aa0561ca6029fcab3ef4b782f40097a9646c5c77727344 SHA512 c7f1789e577c89397c59e288d2351fdb08bb9626df9d2a4d15c13a1474b67f8474be27d9f8a13fb55c53f9a17e47825b84473f487fa3866a8e30e4141b26aaa6
44 -DIST rust-1.51.0-mips64-unknown-linux-gnuabi64.tar.xz 161859704 BLAKE2B a60484b7d009633763f10be8affc33715992f6eee5643d147078840675c900be0ff7f9bd985680836dc7d8467d7d118863cb5bed0f85bb135f0e352318946f32 SHA512 e99437a1b79e8821f6c1eaea92a8c5348e6fb4aa1a4fecbfecc950bf71fd7cd58712d336a67e00f95554bb01565f1daa1221699e142e9e673d8ce2cbb8910008
45 -DIST rust-1.51.0-mips64-unknown-linux-gnuabi64.tar.xz.asc 801 BLAKE2B 85aca04845291448d9ec9c5b37f556e890155574982496d8967829b56b3c4caab1aa40c71e007392a05337ca917a70aa107007cf5c73c8eb8fa95bbcb6f7debf SHA512 4ebd8e0bad5c66a12bfb606f6b28aa63430af5e6344ce91d2be958f1f479fad0d5af6a53006999a321cacfea50fc623629f633f95ff747790c2702aa8dfe9c76
46 -DIST rust-1.51.0-mipsel-unknown-linux-gnu.tar.xz 159164156 BLAKE2B ccccc1e8abf529f9f023cd793dd78c9bfece359a770e03cfae808ac017ae0171ca0dbabb870c5ad57670a9ec562c393d2ffef3490e46423420be6a9a20cc8937 SHA512 31aecea3016e30dd610b610b86ec23f9832061abfbc55c7e43d942d4b0e8e521aecb37306bdb4a810ddcfc4e9d9a6cf057d6802d053ce9abf1cad401b6440d67
47 -DIST rust-1.51.0-mipsel-unknown-linux-gnu.tar.xz.asc 801 BLAKE2B e61e17518d7d326f188b84855b771c7bc2d7f23347dfadaf0783b4fcbb7dfd233ed2262c6ffa75b55baee7e83e94b5c47d24b937e540c6a2892b20d320fcefbb SHA512 e0ffb031f600a58a2f7a76b1b26f5453e9de4d4edf6652d75d0cdd92e4495844601d56b521482e172c72b7463ab667ea65e610baa4f68c5f59333dd8f3cf1155
48 -DIST rust-1.51.0-powerpc-unknown-linux-gnu.tar.xz 167534676 BLAKE2B 5c74ebaf5d5e736bbfb8d963faff6d0fa5725017c738c4a5adf4b4e8c812ff8234b9e03e1a6ba2b6ab718469541e8c398e095ae22f155ccf9290e50ae0595a52 SHA512 9984e464a4e7d18042a8a2d99d26c4436a0ae2b2d281d5c8a42aedb0b78ab5e72f2392ea96e84b2f5892d772d28ee2feb89636f8d1a060a30098faa4e7f259eb
49 -DIST rust-1.51.0-powerpc-unknown-linux-gnu.tar.xz.asc 801 BLAKE2B c8ee6ea39b19cb160527145aeb32206eef6665df1e2c3ce690a136ead20b8114a5806b209a926da7608ffce94e6d65910b7a282cb353345a83a8e2b589df489f SHA512 886c62e4592568ad7b966f933641236ce59a037b65a00e0bfab6d2d6bb62cf994cdd8e392dd2f51b9c958e4e3c0c3763b9dec6be5a4faf27aac5d8d0a225abe2
50 -DIST rust-1.51.0-powerpc64-unknown-linux-gnu.tar.xz 182726600 BLAKE2B d9051eea2d9486b6b4d858a3f6730210de5aac958853de82b3f822b3e0decd1b8a9a9b371b250ffde9ac19be4ccbe09e58c51a78b7e1fb2dd48e61c8a902e5b5 SHA512 4c1864a81d4c32bd95e0381454beae2a1d5b4cb47196821e64fc261133acfa2fa1e514dd6cdb68551559c4da2a2483edf5c6c14246adbea85c3027f88d401e06
51 -DIST rust-1.51.0-powerpc64-unknown-linux-gnu.tar.xz.asc 801 BLAKE2B e1fe8c5764cb11f722893c7efcfb76d5f17ee80a104ede360fedbc8cd1e2996246e0a770959398a524ae55bdfb075dedb2c2583816bd3de28034dddbf248a54c SHA512 3b7e3f15f5a2a4876175a26d7b4332d4a6847a565d5de4c2cb67c52cf26308215286777ea9d89366543ddd1ce353d6a920153549b6641ffeae8e9954470aecfc
52 -DIST rust-1.51.0-powerpc64le-unknown-linux-gnu.tar.xz 192084372 BLAKE2B d127c1827956c7594da5b69346168504b22726e176f03172b599e0a0fae2400e273684090f1d0fd05c33f193b3918c98ccd64c3647b0577b51431c3409083b2f SHA512 b53a741d1d75637fb31ddb0364e1f91427c3818ca145f819b906d13c32c638ae77fbaa567a6220b6bf69f38cc00d2b95615778a86f4acadd63efe2e62b1b01ef
53 -DIST rust-1.51.0-powerpc64le-unknown-linux-gnu.tar.xz.asc 801 BLAKE2B f79f8e1ad8cb0dbc6e1cb45fab2bd19a03d1939518529841155e7a00d9a42e3eb2539ae424c68af7140399a2b37c6ff5a00c55f0467ce4acf6fd7b1ddf525a63 SHA512 785ab118197d53b5f4512cdb07e6277c9ff58b9e53610dcce1c9f928cac8a20b1fbaaa7acad8cbe4370a3fe6dda5f726e8021e8987688a9ec242f73ed8d12adb
54 -DIST rust-1.51.0-riscv64gc-unknown-linux-gnu.tar.xz 179131092 BLAKE2B 1d8cc335cfc434871e1916793974eabd14fa96f49ee9b0f9ae004326c405dbadccd0249ff28dddfecb9921cae4e886f4114a8221e09fd7944f2d2e96bdb12bd2 SHA512 7fb76c3ddc952b43320bf3497d890ff79aa5634df22f38958835cd1d4044bef44257af22d7473675afb42a7c2fc9ac713f210d6bfe1e61ed56d5265f58add540
55 -DIST rust-1.51.0-riscv64gc-unknown-linux-gnu.tar.xz.asc 801 BLAKE2B b0cbee67d6bc37ccdcdf2c563667f3b3e4ec7377e5c86b627cfbbd7385425508778bd67887f46067476ffbf3b5f2719d6b5490d2fe5261db5e7f4da4bbc94be1 SHA512 fdf1ed20eec719435a557be8e6bf6766b0b56e27fa49c65b2c412875a1c76919ff6d6a4d8d14bafa8aa96eb42deca65869db6ca5d2b61a84a0af07dbeb1e9ae9
56 -DIST rust-1.51.0-s390x-unknown-linux-gnu.tar.xz 191632144 BLAKE2B d1690825f59e8ed1ed4855556ff36c05efbc941097744e31fd9207309087d53880d418f737aa0cb9371b973c9c3d56f05ed03533df04402242194ef13b8d608d SHA512 a72ad31c6306f939c4f963133ddc0b3fabc9e506bdff5e318f5275658b7271a675a51d208d306d94fb01739cbcf0f62f018fc7490ca6db54b301852202749d16
57 -DIST rust-1.51.0-s390x-unknown-linux-gnu.tar.xz.asc 801 BLAKE2B 355e753ddca453ca36a8c1e4f361e9655bdb54f856a642be3d4024772266ed1771a2673ab1026c64bbf7ac8d1fc30fb1924a939cc3ea290e98b137edb48bbf6a SHA512 89bf145b8e620eac99b0fe4a79ee205a04550c664bba1e22a7611ef37736cca3cb911ac89659126e0c6fa60e4dbfdf0dd54a8693e496d4c37e4f7d3f518e2740
58 -DIST rust-1.51.0-x86_64-unknown-linux-gnu.tar.xz 147543532 BLAKE2B 44ac97f6b650e65de257b362121091176e02fac60aa534ec83ddbc4e16eb32f7a4a7999cc28eac446f5790572552fee5c2589350cb6d159a946d90007d85c7db SHA512 9f95045119bcd5ef7be54f5b5bdc9ebc6bd6c48437d90762a1cfbc03281882f81087e1877eecae9573ba5e7cd7c11ef5fed979034c57f45b6547cbfeb11eef6d
59 -DIST rust-1.51.0-x86_64-unknown-linux-gnu.tar.xz.asc 801 BLAKE2B 033c41c165cf50a63479d1352a33abe94a63d9730f02016d09bf2e8a8804587d4fc802c047e7417e0befca2d5df5ca8c79a714ec1c1fb389240b6e8931fb9e9b SHA512 e314a7db9aaff445b67f828bf9a98705032071928e2102524c0c720a3b8feb292b8c6766838b92da2d213e93bf53fb780fc856b0370238fbb7e20431d2de6d5c
60 -DIST rust-1.51.0-x86_64-unknown-linux-musl.tar.xz 233773068 BLAKE2B cc9de90b967cc81005ce5c897d3fd6dc4e3880be96ac82c41382d19a8aca0244845830db7a33eaef85b6bdef0c00ae02c0390db932fa49f76e362af2c68edb56 SHA512 d8df3c4c3de435629986e21bc6b31edfb73cba394e76cf87ee98d2936f73aef60c988d020da7ec1188f6448eacad9d5aefed073f4f88ffa2eaac54ac7e3cb3f7
61 -DIST rust-1.51.0-x86_64-unknown-linux-musl.tar.xz.asc 801 BLAKE2B 2e2c20fe99b33e5361b1945f54b77d5e8acad34d1be9cadfd1971b2882e38bc4403a5a67769a74fdd7ab21434784f03084780ef827e26318168bf5d531f9e9bd SHA512 42392e8283a28d58d4874dbf97caa0377f27c6599c272c715fcdefee48551004d491f0509f2894f5696a2820f11dbb333e3bf878cbdf24b0c58add4a493acecc
62 DIST rust-1.52.0-aarch64-unknown-linux-gnu.tar.xz 215549836 BLAKE2B d4179cc67772cd6b92085d68f4bb9de006fca7d8470a56766ac5d94a0379ae675d18c5275ec2ed1eab71274ce4f416a77f3ce74d849a1d4118b5a7ddec205a3c SHA512 7a26e14be6b27c7084c7c85b312341ab991c2df91ea53128f14707a4c725dd03ba7df30b9e9fcef39a509ab4f5d5feb028b99d6d9ffcc059996ed29b83eb90b9
63 DIST rust-1.52.0-aarch64-unknown-linux-gnu.tar.xz.asc 801 BLAKE2B e66afc44186f48548dffcd7c6d7d92b4fbecea48bf3f7970d211844b5401a2556a138993517d049265109146a48856c7106616100ed63a5fa3f263d7023af6b6 SHA512 75ff89cd071641b01f4d483aca5997f6b3857d477b6fb40e6fdf11ff2ecdca74618cc59a9f0d1d2f942bde2d9a8738ac6f821d21d79f3ed85830ef530636a607
64 DIST rust-1.52.0-aarch64-unknown-linux-musl.tar.xz 214159336 BLAKE2B 1b2afb80df6bf75d516127f07d57d12d876f12879c1d87059ab1c40ee1325ddb4e0c22f2fa185dab72f7633bce7d2ff5ed92ce4e88d4e118ac80630a061ec0c4 SHA512 9461c7272ac3e2c854e8e5f24cd57e5d648a3f923a9413eebd9f45a143d27378bc09c4d30ee7a1773a56baa31066dcc9f955b0805ce9f47d81b52e47a3a3e369
65 @@ -222,8 +190,6 @@ DIST rust-1.57.0-x86_64-unknown-linux-gnu.tar.xz 151033748 BLAKE2B 61ecece6a8aa3
66 DIST rust-1.57.0-x86_64-unknown-linux-gnu.tar.xz.asc 801 BLAKE2B ea41b27fd25cc75efac73203688ee0882767fc76a2fe09b5e424c42467d3e332463c5560cc58f3b20f6e4b44289a25cfb0d36e38a7a9a7b3950ef875a59dc9ae SHA512 8b955bfce6c130e4b95054b98646f7f9b89e621256759ee1ff533df5f777312dd7adbb192ee0076c9b9baa6883a74a9def50ef598ba8c707762290d465c9a8b7
67 DIST rust-1.57.0-x86_64-unknown-linux-musl.tar.xz 260333980 BLAKE2B 75342ae8637355e714d5217d78604cfa6a601d3f9bc0ed4667ff0ca57c6521567b19b9bdb10f79761e2e5fd21ca10e12f3fae0c65791118fdb0c35f8f88349f4 SHA512 204ed493528757b8e3e8df13d062c9ae74c75c3e3adc1a2efc0dfc33d2525629168a558dd32653f44a4365191bf203a4415a77152276288a8e122e6bd587394a
68 DIST rust-1.57.0-x86_64-unknown-linux-musl.tar.xz.asc 801 BLAKE2B 506400c3ea70469cbda0e492e85d41b7f94fba790ec19d1c3491bf4a00d283f97c8fb37319ad6c4a43b22a2195c21d1b9e3c16a5b2a9a82833ff61ad49bdc793 SHA512 793369dc7a854c48a72d81446a0c8eb9d83a071af77758e0bcbb8e4d518fb87c5a23c085202b9b427a02bdd772ad9c82724b34295b851f26f384c3e801bf9a04
69 -DIST rustc-1.52.1-src.tar.xz 115109508 BLAKE2B c5d73f5884037d287d88ba9fdaf63a36678b692e1b510920045797ab29f1660f05cda901e19411ff83ec3084c4130034c269976b1056220f3e629cff116d07f0 SHA512 55f5053ce40d4eba4663052817aef6a6275139ca229c89cd1ec44711458b412720203301d8c7975aac5720a91fcaf21847f8184f641cbb0004f722520283c73c
70 -DIST rustc-1.52.1-src.tar.xz.asc 801 BLAKE2B ea2f89289b4d9cf90a0d10148bf3494805c00e7822cc98addf0b602c35e4635bb1963d79168b395a5f7c7bd024070284fccd19757982daa0d554dcac166fd4d7 SHA512 0d692a085c017b03b8a135a28f7e6f1d7e05642d2e99f0f1fbc397e766bb8fed4b4c6b4c9157b79d9bb0c4229607dbc35711cd463c62a9966a4efb6f197de7d3
71 DIST rustc-1.53.0-src.tar.xz 115686332 BLAKE2B fa068f89d42f927fdc79ee31aad1386eaf2aa596a060e059c5a1a73fe48c48d008fc952cd6c7912b743e41d77a94b205639eed0f728b2539b62f18a772cabfe3 SHA512 70485cf7a0f7fc36ee31644e546374079dc387a85b44e5e793707fd0a4d7ca05d311291e78b86db955485d8f21c47ff9e1908acc4da68ba04929287213a40c24
72 DIST rustc-1.53.0-src.tar.xz.asc 801 BLAKE2B 75d3aa4122968f10a119f7a04df897f496588c7a1a2ddf1ea2222099c9efb0e320f5677a26c3271f86e7f500120664485f54c6025ae3c6df30d2b0fe758f5826 SHA512 e337579b9ab4febca4594c2c5d42c279b51cfc745c383be9a430204188311a25319c04c73fde34fdb2bb98a88bfd8daaddc67765834330e6c279a6e5a5648247
73 DIST rustc-1.54.0-src.tar.xz 116286856 BLAKE2B 5ac47822646a0b6205f09282168b4d4ddcace9f6bc8f242c890327ca4074626f129514f8bcae5c5556015745f718990cce490658076f5cd3526623439540416b SHA512 5162f85b43ca2c5af93fdbfb2597d75df8a838f7fcc025a5298499ce1043db50f1ea2fbba753e47ce5daad3d80d4b612acf6527ef902c34117763e687fdbbcfa
74
75 diff --git a/dev-lang/rust/files/1.51.0-bootstrap-panic.patch b/dev-lang/rust/files/1.51.0-bootstrap-panic.patch
76 deleted file mode 100644
77 index 529d5a1..0000000
78 --- a/dev-lang/rust/files/1.51.0-bootstrap-panic.patch
79 +++ /dev/null
80 @@ -1,43 +0,0 @@
81 -From 31c93397bde772764cda3058e16f9cef61895090 Mon Sep 17 00:00:00 2001
82 -From: Joshua Nelson <jyn514@×××××.com>
83 -Date: Mon, 8 Feb 2021 22:51:21 -0500
84 -Subject: [PATCH] Use format string in bootstrap panic instead of a string
85 - directly
86 -
87 -This fixes the following warning when compiling with nightly:
88 -
89 -```
90 -warning: panic message is not a string literal
91 - --> src/bootstrap/builder.rs:1515:24
92 - |
93 -1515 | panic!(out);
94 - | ^^^
95 - |
96 - = note: `#[warn(non_fmt_panic)]` on by default
97 - = note: this is no longer accepted in Rust 2021
98 -help: add a "{}" format string to Display the message
99 - |
100 -1515 | panic!("{}", out);
101 - | ^^^^^
102 -help: or use std::panic::panic_any instead
103 - |
104 -1515 | std::panic::panic_any(out);
105 - | ^^^^^^^^^^^^^^^^^^^^^^
106 -```
107 ----
108 - src/bootstrap/builder.rs | 2 +-
109 - 1 file changed, 1 insertion(+), 1 deletion(-)
110 -
111 -diff --git a/src/bootstrap/builder.rs b/src/bootstrap/builder.rs
112 -index f1a160250dbe1..0f5fcb4af400d 100644
113 ---- a/src/bootstrap/builder.rs
114 -+++ b/src/bootstrap/builder.rs
115 -@@ -1490,7 +1490,7 @@ impl<'a> Builder<'a> {
116 - for el in stack.iter().rev() {
117 - out += &format!("\t{:?}\n", el);
118 - }
119 -- panic!(out);
120 -+ panic!("{}", out);
121 - }
122 - if let Some(out) = self.cache.get(&step) {
123 - self.verbose(&format!("{}c {:?}", " ".repeat(stack.len()), step));
124
125 diff --git a/dev-lang/rust/files/1.51.0-slow-doc-install.patch b/dev-lang/rust/files/1.51.0-slow-doc-install.patch
126 deleted file mode 100644
127 index 4aa7a71..0000000
128 --- a/dev-lang/rust/files/1.51.0-slow-doc-install.patch
129 +++ /dev/null
130 @@ -1,92 +0,0 @@
131 -From 6dfd700c595a8853fd58349c38c4768b922a2e85 Mon Sep 17 00:00:00 2001
132 -From: Anders Kaseorg <andersk@×××.edu>
133 -Date: Sat, 17 Apr 2021 22:20:36 -0700
134 -Subject: [PATCH] bootstrap: Restore missing --bulk-dirs for rust-docs,
135 - rustc-docs
136 -
137 -The --bulk-dirs argument was removed for rust-docs in commit
138 -c768ce138427b1844c1f6594daba9c0e33928032 and rustc-docs in commit
139 -8ca46fc7a83734c9622f11f25d16b82316f44bcc (#79788), presumably by
140 -mistake; that slowed down installation of rust-docs from under a
141 -second to some twenty *minutes*. Restoring --bulk-dirs reverses this
142 -slowdown.
143 -
144 -Fixes #80684.
145 -
146 -Signed-off-by: Anders Kaseorg <andersk@×××.edu>
147 ----
148 - src/bootstrap/dist.rs | 4 ++--
149 - src/bootstrap/tarball.rs | 17 +++++++++++++++++
150 - 2 files changed, 19 insertions(+), 2 deletions(-)
151 -
152 -diff --git a/src/bootstrap/dist.rs b/src/bootstrap/dist.rs
153 -index 38ebe0e52083d..aee3c8324bc11 100644
154 ---- a/src/bootstrap/dist.rs
155 -+++ b/src/bootstrap/dist.rs
156 -@@ -74,7 +74,7 @@ impl Step for Docs {
157 -
158 - let mut tarball = Tarball::new(builder, "rust-docs", &host.triple);
159 - tarball.set_product_name("Rust Documentation");
160 -- tarball.add_dir(&builder.doc_out(host), dest);
161 -+ tarball.add_bulk_dir(&builder.doc_out(host), dest);
162 - tarball.add_file(&builder.src.join("src/doc/robots.txt"), dest, 0o644);
163 - Some(tarball.generate())
164 - }
165 -@@ -107,7 +107,7 @@ impl Step for RustcDocs {
166 -
167 - let mut tarball = Tarball::new(builder, "rustc-docs", &host.triple);
168 - tarball.set_product_name("Rustc Documentation");
169 -- tarball.add_dir(&builder.compiler_doc_out(host), "share/doc/rust/html/rustc");
170 -+ tarball.add_bulk_dir(&builder.compiler_doc_out(host), "share/doc/rust/html/rustc");
171 - Some(tarball.generate())
172 - }
173 - }
174 -diff --git a/src/bootstrap/tarball.rs b/src/bootstrap/tarball.rs
175 -index b02d7e062a524..9ff5c2327e0f7 100644
176 ---- a/src/bootstrap/tarball.rs
177 -+++ b/src/bootstrap/tarball.rs
178 -@@ -99,6 +99,7 @@ pub(crate) struct Tarball<'a> {
179 - temp_dir: PathBuf,
180 - image_dir: PathBuf,
181 - overlay_dir: PathBuf,
182 -+ bulk_dirs: Vec<PathBuf>,
183 -
184 - include_target_in_component_name: bool,
185 - is_preview: bool,
186 -@@ -137,6 +138,7 @@ impl<'a> Tarball<'a> {
187 - temp_dir,
188 - image_dir,
189 - overlay_dir,
190 -+ bulk_dirs: Vec::new(),
191 -
192 - include_target_in_component_name: false,
193 - is_preview: false,
194 -@@ -201,6 +203,11 @@ impl<'a> Tarball<'a> {
195 - self.builder.cp_r(src.as_ref(), &dest);
196 - }
197 -
198 -+ pub(crate) fn add_bulk_dir(&mut self, src: impl AsRef<Path>, dest: impl AsRef<Path>) {
199 -+ self.bulk_dirs.push(dest.as_ref().to_path_buf());
200 -+ self.add_dir(src, dest);
201 -+ }
202 -+
203 - pub(crate) fn generate(self) -> GeneratedTarball {
204 - let mut component_name = self.component.clone();
205 - if self.is_preview {
206 -@@ -221,6 +228,16 @@ impl<'a> Tarball<'a> {
207 - .arg("--image-dir")
208 - .arg(&this.image_dir)
209 - .arg(format!("--component-name={}", &component_name));
210 -+
211 -+ if let Some((dir, dirs)) = this.bulk_dirs.split_first() {
212 -+ let mut arg = dir.as_os_str().to_os_string();
213 -+ for dir in dirs {
214 -+ arg.push(",");
215 -+ arg.push(dir);
216 -+ }
217 -+ cmd.arg("--bulk-dirs").arg(&arg);
218 -+ }
219 -+
220 - this.non_bare_args(cmd);
221 - })
222 - }
223
224 diff --git a/dev-lang/rust/files/rustc-1.51.0-backport-pr81728.patch b/dev-lang/rust/files/rustc-1.51.0-backport-pr81728.patch
225 deleted file mode 100644
226 index 20373f4..0000000
227 --- a/dev-lang/rust/files/rustc-1.51.0-backport-pr81728.patch
228 +++ /dev/null
229 @@ -1,181 +0,0 @@
230 -From 70f17ca715d3d7e2fd79cc909b95fd3a6357c13e Mon Sep 17 00:00:00 2001
231 -From: Yechan Bae <yechan@××××××.edu>
232 -Date: Wed, 3 Feb 2021 16:36:33 -0500
233 -Subject: [PATCH 1/2] Fixes #80335
234 -
235 ----
236 - library/alloc/src/str.rs | 42 ++++++++++++++++++++++----------------
237 - library/alloc/tests/str.rs | 30 +++++++++++++++++++++++++++
238 - 2 files changed, 54 insertions(+), 18 deletions(-)
239 -
240 -diff --git a/library/alloc/src/str.rs b/library/alloc/src/str.rs
241 -index 70e0c7dba5ea..a7584c6b6510 100644
242 ---- a/library/alloc/src/str.rs
243 -+++ b/library/alloc/src/str.rs
244 -@@ -90,8 +90,8 @@ fn join(slice: &Self, sep: &str) -> String {
245 - }
246 - }
247 -
248 --macro_rules! spezialize_for_lengths {
249 -- ($separator:expr, $target:expr, $iter:expr; $($num:expr),*) => {
250 -+macro_rules! specialize_for_lengths {
251 -+ ($separator:expr, $target:expr, $iter:expr; $($num:expr),*) => {{
252 - let mut target = $target;
253 - let iter = $iter;
254 - let sep_bytes = $separator;
255 -@@ -102,7 +102,8 @@ macro_rules! spezialize_for_lengths {
256 - $num => {
257 - for s in iter {
258 - copy_slice_and_advance!(target, sep_bytes);
259 -- copy_slice_and_advance!(target, s.borrow().as_ref());
260 -+ let content_bytes = s.borrow().as_ref();
261 -+ copy_slice_and_advance!(target, content_bytes);
262 - }
263 - },
264 - )*
265 -@@ -110,11 +111,13 @@ macro_rules! spezialize_for_lengths {
266 - // arbitrary non-zero size fallback
267 - for s in iter {
268 - copy_slice_and_advance!(target, sep_bytes);
269 -- copy_slice_and_advance!(target, s.borrow().as_ref());
270 -+ let content_bytes = s.borrow().as_ref();
271 -+ copy_slice_and_advance!(target, content_bytes);
272 - }
273 - }
274 - }
275 -- };
276 -+ target
277 -+ }}
278 - }
279 -
280 - macro_rules! copy_slice_and_advance {
281 -@@ -153,7 +156,7 @@ fn join_generic_copy<B, T, S>(slice: &[S], sep: &[T]) -> Vec<T>
282 - // if the `len` calculation overflows, we'll panic
283 - // we would have run out of memory anyway and the rest of the function requires
284 - // the entire Vec pre-allocated for safety
285 -- let len = sep_len
286 -+ let reserved_len = sep_len
287 - .checked_mul(iter.len())
288 - .and_then(|n| {
289 - slice.iter().map(|s| s.borrow().as_ref().len()).try_fold(n, usize::checked_add)
290 -@@ -161,22 +164,25 @@ fn join_generic_copy<B, T, S>(slice: &[S], sep: &[T]) -> Vec<T>
291 - .expect("attempt to join into collection with len > usize::MAX");
292 -
293 - // crucial for safety
294 -- let mut result = Vec::with_capacity(len);
295 -- assert!(result.capacity() >= len);
296 -+ let mut result = Vec::with_capacity(reserved_len);
297 -+ debug_assert!(result.capacity() >= reserved_len);
298 -
299 - result.extend_from_slice(first.borrow().as_ref());
300 -
301 - unsafe {
302 -- {
303 -- let pos = result.len();
304 -- let target = result.get_unchecked_mut(pos..len);
305 --
306 -- // copy separator and slices over without bounds checks
307 -- // generate loops with hardcoded offsets for small separators
308 -- // massive improvements possible (~ x2)
309 -- spezialize_for_lengths!(sep, target, iter; 0, 1, 2, 3, 4);
310 -- }
311 -- result.set_len(len);
312 -+ let pos = result.len();
313 -+ let target = result.get_unchecked_mut(pos..reserved_len);
314 -+
315 -+ // copy separator and slices over without bounds checks
316 -+ // generate loops with hardcoded offsets for small separators
317 -+ // massive improvements possible (~ x2)
318 -+ let remain = specialize_for_lengths!(sep, target, iter; 0, 1, 2, 3, 4);
319 -+
320 -+ // issue #80335: A weird borrow implementation can return different
321 -+ // slices for the length calculation and the actual copy, so
322 -+ // `remain.len()` might be non-zero.
323 -+ let result_len = reserved_len - remain.len();
324 -+ result.set_len(result_len);
325 - }
326 - result
327 - }
328 -diff --git a/library/alloc/tests/str.rs b/library/alloc/tests/str.rs
329 -index 604835e6cc4a..6df8d8c2f354 100644
330 ---- a/library/alloc/tests/str.rs
331 -+++ b/library/alloc/tests/str.rs
332 -@@ -160,6 +160,36 @@ fn test_join_for_different_lengths_with_long_separator() {
333 - test_join!("~~~~~a~~~~~bc", ["", "a", "bc"], "~~~~~");
334 - }
335 -
336 -+#[test]
337 -+fn test_join_isue_80335() {
338 -+ use core::{borrow::Borrow, cell::Cell};
339 -+
340 -+ struct WeirdBorrow {
341 -+ state: Cell<bool>,
342 -+ }
343 -+
344 -+ impl Default for WeirdBorrow {
345 -+ fn default() -> Self {
346 -+ WeirdBorrow { state: Cell::new(false) }
347 -+ }
348 -+ }
349 -+
350 -+ impl Borrow<str> for WeirdBorrow {
351 -+ fn borrow(&self) -> &str {
352 -+ let state = self.state.get();
353 -+ if state {
354 -+ "0"
355 -+ } else {
356 -+ self.state.set(true);
357 -+ "123456"
358 -+ }
359 -+ }
360 -+ }
361 -+
362 -+ let arr: [WeirdBorrow; 3] = Default::default();
363 -+ test_join!("0-0-0", arr, "-");
364 -+}
365 -+
366 - #[test]
367 - #[cfg_attr(miri, ignore)] // Miri is too slow
368 - fn test_unsafe_slice() {
369 ---
370 -2.31.1
371 -
372 -
373 -From 10020817d2e6756be1ff2ac3c182af97cf7fe904 Mon Sep 17 00:00:00 2001
374 -From: Yechan Bae <yechan@××××××.edu>
375 -Date: Sat, 20 Mar 2021 13:42:54 -0400
376 -Subject: [PATCH 2/2] Update the comment
377 -
378 ----
379 - library/alloc/src/str.rs | 8 ++++----
380 - 1 file changed, 4 insertions(+), 4 deletions(-)
381 -
382 -diff --git a/library/alloc/src/str.rs b/library/alloc/src/str.rs
383 -index a7584c6b6510..4d1e876457b8 100644
384 ---- a/library/alloc/src/str.rs
385 -+++ b/library/alloc/src/str.rs
386 -@@ -163,7 +163,7 @@ fn join_generic_copy<B, T, S>(slice: &[S], sep: &[T]) -> Vec<T>
387 - })
388 - .expect("attempt to join into collection with len > usize::MAX");
389 -
390 -- // crucial for safety
391 -+ // prepare an uninitialized buffer
392 - let mut result = Vec::with_capacity(reserved_len);
393 - debug_assert!(result.capacity() >= reserved_len);
394 -
395 -@@ -178,9 +178,9 @@ fn join_generic_copy<B, T, S>(slice: &[S], sep: &[T]) -> Vec<T>
396 - // massive improvements possible (~ x2)
397 - let remain = specialize_for_lengths!(sep, target, iter; 0, 1, 2, 3, 4);
398 -
399 -- // issue #80335: A weird borrow implementation can return different
400 -- // slices for the length calculation and the actual copy, so
401 -- // `remain.len()` might be non-zero.
402 -+ // A weird borrow implementation may return different
403 -+ // slices for the length calculation and the actual copy.
404 -+ // Make sure we don't expose uninitialized bytes to the caller.
405 - let result_len = reserved_len - remain.len();
406 - result.set_len(result_len);
407 - }
408 ---
409 -2.31.1
410 -
411
412 diff --git a/dev-lang/rust/files/rustc-1.51.0-backport-pr81741.patch b/dev-lang/rust/files/rustc-1.51.0-backport-pr81741.patch
413 deleted file mode 100644
414 index 8ef22ee..0000000
415 --- a/dev-lang/rust/files/rustc-1.51.0-backport-pr81741.patch
416 +++ /dev/null
417 @@ -1,44 +0,0 @@
418 -From 40d3f2d7ef5835317fe9df9ecc01f4c363def4fd Mon Sep 17 00:00:00 2001
419 -From: =?UTF-8?q?Sebastian=20Dr=C3=B6ge?= <sebastian@×××××××××××.com>
420 -Date: Thu, 4 Feb 2021 10:23:01 +0200
421 -Subject: [PATCH] Increment `self.index` before calling
422 - `Iterator::self.a.__iterator_get_unchecked` in `Zip` `TrustedRandomAccess`
423 - specialization
424 -
425 -Otherwise if `Iterator::self.a.__iterator_get_unchecked` panics the
426 -index would not have been incremented yet and another call to
427 -`Iterator::next` would read from the same index again, which is not
428 -allowed according to the API contract of `TrustedRandomAccess` for
429 -`!Clone`.
430 -
431 -Fixes https://github.com/rust-lang/rust/issues/81740
432 -
433 -(cherry picked from commit 86a4b27475aab52b998c15f5758540697cc9cff0)
434 ----
435 - library/core/src/iter/adapters/zip.rs | 7 ++++---
436 - 1 file changed, 4 insertions(+), 3 deletions(-)
437 -
438 -diff --git a/library/core/src/iter/adapters/zip.rs b/library/core/src/iter/adapters/zip.rs
439 -index 98b8dca96140..9f9835345200 100644
440 ---- a/library/core/src/iter/adapters/zip.rs
441 -+++ b/library/core/src/iter/adapters/zip.rs
442 -@@ -198,12 +198,13 @@ fn next(&mut self) -> Option<(A::Item, B::Item)> {
443 - Some((self.a.__iterator_get_unchecked(i), self.b.__iterator_get_unchecked(i)))
444 - }
445 - } else if A::may_have_side_effect() && self.index < self.a.size() {
446 -+ let i = self.index;
447 -+ self.index += 1;
448 - // match the base implementation's potential side effects
449 -- // SAFETY: we just checked that `self.index` < `self.a.len()`
450 -+ // SAFETY: we just checked that `i` < `self.a.len()`
451 - unsafe {
452 -- self.a.__iterator_get_unchecked(self.index);
453 -+ self.a.__iterator_get_unchecked(i);
454 - }
455 -- self.index += 1;
456 - None
457 - } else {
458 - None
459 ---
460 -2.31.1
461 -
462
463 diff --git a/dev-lang/rust/files/rustc-1.51.0-backport-pr82289.patch b/dev-lang/rust/files/rustc-1.51.0-backport-pr82289.patch
464 deleted file mode 100644
465 index 5cf5433..0000000
466 --- a/dev-lang/rust/files/rustc-1.51.0-backport-pr82289.patch
467 +++ /dev/null
468 @@ -1,96 +0,0 @@
469 -From 5222e2ba2d97cd716a379b4ae6bc62c5f7c2dd36 Mon Sep 17 00:00:00 2001
470 -From: Giacomo Stevanato <giaco.stevanato@×××××.com>
471 -Date: Fri, 19 Feb 2021 12:15:37 +0100
472 -Subject: [PATCH 1/3] Increment self.len in specialized ZipImpl to avoid
473 - underflow in size_hint
474 -
475 -(cherry picked from commit 66a260617a88ed1ad55a46f03c5a90d5ad3004d3)
476 ----
477 - library/core/src/iter/adapters/zip.rs | 1 +
478 - 1 file changed, 1 insertion(+)
479 -
480 -diff --git a/library/core/src/iter/adapters/zip.rs b/library/core/src/iter/adapters/zip.rs
481 -index 9f9835345200..f08bfac837fe 100644
482 ---- a/library/core/src/iter/adapters/zip.rs
483 -+++ b/library/core/src/iter/adapters/zip.rs
484 -@@ -200,6 +200,7 @@ fn next(&mut self) -> Option<(A::Item, B::Item)> {
485 - } else if A::may_have_side_effect() && self.index < self.a.size() {
486 - let i = self.index;
487 - self.index += 1;
488 -+ self.len += 1;
489 - // match the base implementation's potential side effects
490 - // SAFETY: we just checked that `i` < `self.a.len()`
491 - unsafe {
492 ---
493 -2.31.1
494 -
495 -
496 -From d39669fc8282830a374d19d204f7b4ee8eb1e381 Mon Sep 17 00:00:00 2001
497 -From: Giacomo Stevanato <giaco.stevanato@×××××.com>
498 -Date: Fri, 19 Feb 2021 12:16:12 +0100
499 -Subject: [PATCH 2/3] Add test for underflow in specialized Zip's size_hint
500 -
501 -(cherry picked from commit 8b9ac4d4155c74db5b317046033ab9c05a09e351)
502 ----
503 - library/core/tests/iter/adapters/zip.rs | 20 ++++++++++++++++++++
504 - 1 file changed, 20 insertions(+)
505 -
506 -diff --git a/library/core/tests/iter/adapters/zip.rs b/library/core/tests/iter/adapters/zip.rs
507 -index 1fce0951e365..a59771039295 100644
508 ---- a/library/core/tests/iter/adapters/zip.rs
509 -+++ b/library/core/tests/iter/adapters/zip.rs
510 -@@ -245,3 +245,23 @@ fn test_double_ended_zip() {
511 - assert_eq!(it.next_back(), Some((3, 3)));
512 - assert_eq!(it.next(), None);
513 - }
514 -+
515 -+#[test]
516 -+fn test_issue_82282() {
517 -+ fn overflowed_zip(arr: &[i32]) -> impl Iterator<Item = (i32, &())> {
518 -+ static UNIT_EMPTY_ARR: [(); 0] = [];
519 -+
520 -+ let mapped = arr.into_iter().map(|i| *i);
521 -+ let mut zipped = mapped.zip(UNIT_EMPTY_ARR.iter());
522 -+ zipped.next();
523 -+ zipped
524 -+ }
525 -+
526 -+ let arr = [1, 2, 3];
527 -+ let zip = overflowed_zip(&arr).zip(overflowed_zip(&arr));
528 -+
529 -+ assert_eq!(zip.size_hint(), (0, Some(0)));
530 -+ for _ in zip {
531 -+ panic!();
532 -+ }
533 -+}
534 ---
535 -2.31.1
536 -
537 -
538 -From 4b382167dd5ed5a6eac0cf314bfb86e3704b6e76 Mon Sep 17 00:00:00 2001
539 -From: Giacomo Stevanato <giaco.stevanato@×××××.com>
540 -Date: Fri, 19 Feb 2021 12:17:48 +0100
541 -Subject: [PATCH 3/3] Remove useless comparison since now self.index <=
542 - self.len is an invariant
543 -
544 -(cherry picked from commit aeb4ea739efb70e0002a4a9c4c7b8027dd0620b3)
545 ----
546 - library/core/src/iter/adapters/zip.rs | 2 +-
547 - 1 file changed, 1 insertion(+), 1 deletion(-)
548 -
549 -diff --git a/library/core/src/iter/adapters/zip.rs b/library/core/src/iter/adapters/zip.rs
550 -index f08bfac837fe..dcbcb1ce7200 100644
551 ---- a/library/core/src/iter/adapters/zip.rs
552 -+++ b/library/core/src/iter/adapters/zip.rs
553 -@@ -261,7 +261,7 @@ fn next_back(&mut self) -> Option<(A::Item, B::Item)>
554 - if sz_a != sz_b {
555 - let sz_a = self.a.size();
556 - if a_side_effect && sz_a > self.len {
557 -- for _ in 0..sz_a - cmp::max(self.len, self.index) {
558 -+ for _ in 0..sz_a - self.len {
559 - self.a.next_back();
560 - }
561 - }
562 ---
563 -2.31.1
564 -
565
566 diff --git a/dev-lang/rust/files/rustc-1.51.0-backport-pr82292.patch b/dev-lang/rust/files/rustc-1.51.0-backport-pr82292.patch
567 deleted file mode 100644
568 index 4baf72a..0000000
569 --- a/dev-lang/rust/files/rustc-1.51.0-backport-pr82292.patch
570 +++ /dev/null
571 @@ -1,120 +0,0 @@
572 -From 0babb88efc4d36f3defafc3c3c0343793fa05d52 Mon Sep 17 00:00:00 2001
573 -From: Giacomo Stevanato <giaco.stevanato@×××××.com>
574 -Date: Wed, 3 Mar 2021 21:09:01 +0100
575 -Subject: [PATCH 1/2] Prevent Zip specialization from calling
576 - __iterator_get_unchecked twice with the same index after calling next_back
577 -
578 -(cherry picked from commit 2371914a05f8f2763dffe6e2511d0870bcd6b461)
579 ----
580 - library/core/src/iter/adapters/zip.rs | 13 +++++++++----
581 - 1 file changed, 9 insertions(+), 4 deletions(-)
582 -
583 -diff --git a/library/core/src/iter/adapters/zip.rs b/library/core/src/iter/adapters/zip.rs
584 -index dcbcb1ce7200..7dac0c63ca2d 100644
585 ---- a/library/core/src/iter/adapters/zip.rs
586 -+++ b/library/core/src/iter/adapters/zip.rs
587 -@@ -13,9 +13,10 @@
588 - pub struct Zip<A, B> {
589 - a: A,
590 - b: B,
591 -- // index and len are only used by the specialized version of zip
592 -+ // index, len and a_len are only used by the specialized version of zip
593 - index: usize,
594 - len: usize,
595 -+ a_len: usize,
596 - }
597 - impl<A: Iterator, B: Iterator> Zip<A, B> {
598 - pub(in crate::iter) fn new(a: A, b: B) -> Zip<A, B> {
599 -@@ -110,6 +111,7 @@ impl<A, B> ZipImpl<A, B> for Zip<A, B>
600 - b,
601 - index: 0, // unused
602 - len: 0, // unused
603 -+ a_len: 0, // unused
604 - }
605 - }
606 -
607 -@@ -184,8 +186,9 @@ impl<A, B> ZipImpl<A, B> for Zip<A, B>
608 - B: TrustedRandomAccess + Iterator,
609 - {
610 - fn new(a: A, b: B) -> Self {
611 -- let len = cmp::min(a.size(), b.size());
612 -- Zip { a, b, index: 0, len }
613 -+ let a_len = a.size();
614 -+ let len = cmp::min(a_len, b.size());
615 -+ Zip { a, b, index: 0, len, a_len }
616 - }
617 -
618 - #[inline]
619 -@@ -197,7 +200,7 @@ fn next(&mut self) -> Option<(A::Item, B::Item)> {
620 - unsafe {
621 - Some((self.a.__iterator_get_unchecked(i), self.b.__iterator_get_unchecked(i)))
622 - }
623 -- } else if A::may_have_side_effect() && self.index < self.a.size() {
624 -+ } else if A::may_have_side_effect() && self.index < self.a_len {
625 - let i = self.index;
626 - self.index += 1;
627 - self.len += 1;
628 -@@ -264,6 +267,7 @@ fn next_back(&mut self) -> Option<(A::Item, B::Item)>
629 - for _ in 0..sz_a - self.len {
630 - self.a.next_back();
631 - }
632 -+ self.a_len = self.len;
633 - }
634 - let sz_b = self.b.size();
635 - if b_side_effect && sz_b > self.len {
636 -@@ -275,6 +279,7 @@ fn next_back(&mut self) -> Option<(A::Item, B::Item)>
637 - }
638 - if self.index < self.len {
639 - self.len -= 1;
640 -+ self.a_len -= 1;
641 - let i = self.len;
642 - // SAFETY: `i` is smaller than the previous value of `self.len`,
643 - // which is also smaller than or equal to `self.a.len()` and `self.b.len()`
644 ---
645 -2.31.1
646 -
647 -
648 -From 19af66a6f3e2bbb4780bb9eae7eb53bd13e3dd0f Mon Sep 17 00:00:00 2001
649 -From: Giacomo Stevanato <giaco.stevanato@×××××.com>
650 -Date: Fri, 19 Feb 2021 15:25:09 +0100
651 -Subject: [PATCH 2/2] Add relevant test
652 -
653 -(cherry picked from commit c1bfb9a78db6d481be1d03355672712c766e20b0)
654 ----
655 - library/core/tests/iter/adapters/zip.rs | 23 +++++++++++++++++++++++
656 - 1 file changed, 23 insertions(+)
657 -
658 -diff --git a/library/core/tests/iter/adapters/zip.rs b/library/core/tests/iter/adapters/zip.rs
659 -index a59771039295..000c15f72c88 100644
660 ---- a/library/core/tests/iter/adapters/zip.rs
661 -+++ b/library/core/tests/iter/adapters/zip.rs
662 -@@ -265,3 +265,26 @@ fn overflowed_zip(arr: &[i32]) -> impl Iterator<Item = (i32, &())> {
663 - panic!();
664 - }
665 - }
666 -+
667 -+#[test]
668 -+fn test_issue_82291() {
669 -+ use std::cell::Cell;
670 -+
671 -+ let mut v1 = [()];
672 -+ let v2 = [()];
673 -+
674 -+ let called = Cell::new(0);
675 -+
676 -+ let mut zip = v1
677 -+ .iter_mut()
678 -+ .map(|r| {
679 -+ called.set(called.get() + 1);
680 -+ r
681 -+ })
682 -+ .zip(&v2);
683 -+
684 -+ zip.next_back();
685 -+ assert_eq!(called.get(), 1);
686 -+ zip.next();
687 -+ assert_eq!(called.get(), 1);
688 -+}
689 ---
690 -2.31.1
691 -
692
693 diff --git a/dev-lang/rust/files/rustc-1.51.0-backport-pr83629.patch b/dev-lang/rust/files/rustc-1.51.0-backport-pr83629.patch
694 deleted file mode 100644
695 index 7f68d95..0000000
696 --- a/dev-lang/rust/files/rustc-1.51.0-backport-pr83629.patch
697 +++ /dev/null
698 @@ -1,142 +0,0 @@
699 -From 3834e7b7393bf1a0d7df02ccd1d2e896c1465769 Mon Sep 17 00:00:00 2001
700 -From: The8472 <git@×××××××××××××××.de>
701 -Date: Mon, 29 Mar 2021 04:22:34 +0200
702 -Subject: [PATCH 1/2] add testcase for double-drop during Vec in-place
703 - collection
704 -
705 ----
706 - library/alloc/tests/vec.rs | 38 +++++++++++++++++++++++++++++++++++++-
707 - 1 file changed, 37 insertions(+), 1 deletion(-)
708 -
709 -diff --git a/library/alloc/tests/vec.rs b/library/alloc/tests/vec.rs
710 -index 5c7ff67bc621..4cdb7eefcdf1 100644
711 ---- a/library/alloc/tests/vec.rs
712 -+++ b/library/alloc/tests/vec.rs
713 -@@ -954,7 +954,7 @@ fn test_from_iter_specialization_head_tail_drop() {
714 - }
715 -
716 - #[test]
717 --fn test_from_iter_specialization_panic_drop() {
718 -+fn test_from_iter_specialization_panic_during_iteration_drops() {
719 - let drop_count: Vec<_> = (0..=2).map(|_| Rc::new(())).collect();
720 - let src: Vec<_> = drop_count.iter().cloned().collect();
721 - let iter = src.into_iter();
722 -@@ -977,6 +977,42 @@ fn test_from_iter_specialization_panic_drop() {
723 - );
724 - }
725 -
726 -+#[test]
727 -+fn test_from_iter_specialization_panic_during_drop_leaks() {
728 -+ static mut DROP_COUNTER: usize = 0;
729 -+
730 -+ #[derive(Debug)]
731 -+ enum Droppable {
732 -+ DroppedTwice(Box<i32>),
733 -+ PanicOnDrop,
734 -+ }
735 -+
736 -+ impl Drop for Droppable {
737 -+ fn drop(&mut self) {
738 -+ match self {
739 -+ Droppable::DroppedTwice(_) => {
740 -+ unsafe {
741 -+ DROP_COUNTER += 1;
742 -+ }
743 -+ println!("Dropping!")
744 -+ }
745 -+ Droppable::PanicOnDrop => {
746 -+ if !std::thread::panicking() {
747 -+ panic!();
748 -+ }
749 -+ }
750 -+ }
751 -+ }
752 -+ }
753 -+
754 -+ let _ = std::panic::catch_unwind(AssertUnwindSafe(|| {
755 -+ let v = vec![Droppable::DroppedTwice(Box::new(123)), Droppable::PanicOnDrop];
756 -+ let _ = v.into_iter().take(0).collect::<Vec<_>>();
757 -+ }));
758 -+
759 -+ assert_eq!(unsafe { DROP_COUNTER }, 1);
760 -+}
761 -+
762 - #[test]
763 - fn test_cow_from() {
764 - let borrowed: &[_] = &["borrowed", "(slice)"];
765 ---
766 -2.31.1
767 -
768 -
769 -From 8e2706343e1ce1c5a2d3a2ceaaaa010aaeb21d93 Mon Sep 17 00:00:00 2001
770 -From: The8472 <git@×××××××××××××××.de>
771 -Date: Mon, 29 Mar 2021 04:22:48 +0200
772 -Subject: [PATCH 2/2] fix double-drop in in-place collect specialization
773 -
774 ----
775 - library/alloc/src/vec/into_iter.rs | 27 ++++++++++++++-------
776 - library/alloc/src/vec/source_iter_marker.rs | 4 +--
777 - 2 files changed, 20 insertions(+), 11 deletions(-)
778 -
779 -diff --git a/library/alloc/src/vec/into_iter.rs b/library/alloc/src/vec/into_iter.rs
780 -index f131d06bb18f..74adced53f6d 100644
781 ---- a/library/alloc/src/vec/into_iter.rs
782 -+++ b/library/alloc/src/vec/into_iter.rs
783 -@@ -85,20 +85,29 @@ fn as_raw_mut_slice(&mut self) -> *mut [T] {
784 - ptr::slice_from_raw_parts_mut(self.ptr as *mut T, self.len())
785 - }
786 -
787 -- pub(super) fn drop_remaining(&mut self) {
788 -- unsafe {
789 -- ptr::drop_in_place(self.as_mut_slice());
790 -- }
791 -- self.ptr = self.end;
792 -- }
793 -+ /// Drops remaining elements and relinquishes the backing allocation.
794 -+ ///
795 -+ /// This is roughly equivalent to the following, but more efficient
796 -+ ///
797 -+ /// ```
798 -+ /// # let mut into_iter = Vec::<u8>::with_capacity(10).into_iter();
799 -+ /// (&mut into_iter).for_each(core::mem::drop);
800 -+ /// unsafe { core::ptr::write(&mut into_iter, Vec::new().into_iter()); }
801 -+ /// ```
802 -+ pub(super) fn forget_allocation_drop_remaining(&mut self) {
803 -+ let remaining = self.as_raw_mut_slice();
804 -
805 -- /// Relinquishes the backing allocation, equivalent to
806 -- /// `ptr::write(&mut self, Vec::new().into_iter())`
807 -- pub(super) fn forget_allocation(&mut self) {
808 -+ // overwrite the individual fields instead of creating a new
809 -+ // struct and then overwriting &mut self.
810 -+ // this creates less assembly
811 - self.cap = 0;
812 - self.buf = unsafe { NonNull::new_unchecked(RawVec::NEW.ptr()) };
813 - self.ptr = self.buf.as_ptr();
814 - self.end = self.buf.as_ptr();
815 -+
816 -+ unsafe {
817 -+ ptr::drop_in_place(remaining);
818 -+ }
819 - }
820 - }
821 -
822 -diff --git a/library/alloc/src/vec/source_iter_marker.rs b/library/alloc/src/vec/source_iter_marker.rs
823 -index 8c0e95559fa1..9301f7a5184e 100644
824 ---- a/library/alloc/src/vec/source_iter_marker.rs
825 -+++ b/library/alloc/src/vec/source_iter_marker.rs
826 -@@ -78,9 +78,9 @@ impl<T, I> SpecFromIter<T, I> for Vec<T>
827 - }
828 -
829 - // drop any remaining values at the tail of the source
830 -- src.drop_remaining();
831 - // but prevent drop of the allocation itself once IntoIter goes out of scope
832 -- src.forget_allocation();
833 -+ // if the drop panics then we also leak any elements collected into dst_buf
834 -+ src.forget_allocation_drop_remaining();
835 -
836 - let vec = unsafe {
837 - let len = dst.offset_from(dst_buf) as usize;
838 ---
839 -2.31.1
840 -
841
842 diff --git a/dev-lang/rust/rust-1.52.1.ebuild b/dev-lang/rust/rust-1.52.1.ebuild
843 deleted file mode 100644
844 index f1b3385..0000000
845 --- a/dev-lang/rust/rust-1.52.1.ebuild
846 +++ /dev/null
847 @@ -1,677 +0,0 @@
848 -# Copyright 1999-2021 Gentoo Authors
849 -# Distributed under the terms of the GNU General Public License v2
850 -
851 -EAPI=7
852 -
853 -PYTHON_COMPAT=( python3_{7..9} )
854 -
855 -inherit bash-completion-r1 check-reqs estack flag-o-matic llvm multiprocessing \
856 - multilib-build python-any-r1 rust-toolchain toolchain-funcs verify-sig
857 -
858 -if [[ ${PV} = *beta* ]]; then
859 - betaver=${PV//*beta}
860 - BETA_SNAPSHOT="${betaver:0:4}-${betaver:4:2}-${betaver:6:2}"
861 - MY_P="rustc-beta"
862 - SLOT="beta/${PV}"
863 - SRC="${BETA_SNAPSHOT}/rustc-beta-src.tar.xz -> rustc-${PV}-src.tar.xz"
864 -else
865 - ABI_VER="$(ver_cut 1-2)"
866 - SLOT="stable/${ABI_VER}"
867 - MY_P="rustc-${PV}"
868 - SRC="${MY_P}-src.tar.xz"
869 - KEYWORDS="amd64 arm arm64 ppc64 ~riscv x86"
870 -fi
871 -
872 -RUST_STAGE0_VERSION="1.$(($(ver_cut 2) - 1)).0"
873 -
874 -DESCRIPTION="Systems programming language from Mozilla"
875 -HOMEPAGE="https://www.rust-lang.org/"
876 -
877 -SRC_URI="
878 - https://static.rust-lang.org/dist/${SRC}
879 - verify-sig? ( https://static.rust-lang.org/dist/${SRC}.asc )
880 - !system-bootstrap? ( $(rust_all_arch_uris rust-${RUST_STAGE0_VERSION}) )
881 -"
882 -
883 -# keep in sync with llvm ebuild of the same version as bundled one.
884 -ALL_LLVM_TARGETS=( AArch64 AMDGPU ARM AVR BPF Hexagon Lanai Mips MSP430
885 - NVPTX PowerPC RISCV Sparc SystemZ WebAssembly X86 XCore )
886 -ALL_LLVM_TARGETS=( "${ALL_LLVM_TARGETS[@]/#/llvm_targets_}" )
887 -LLVM_TARGET_USEDEPS=${ALL_LLVM_TARGETS[@]/%/(-)?}
888 -
889 -LICENSE="|| ( MIT Apache-2.0 ) BSD-1 BSD-2 BSD-4 UoI-NCSA"
890 -
891 -IUSE="clippy cpu_flags_x86_sse2 debug doc miri nightly parallel-compiler rls rustfmt system-bootstrap system-llvm test wasm ${ALL_LLVM_TARGETS[*]}"
892 -
893 -# Please keep the LLVM dependency block separate. Since LLVM is slotted,
894 -# we need to *really* make sure we're not pulling more than one slot
895 -# simultaneously.
896 -
897 -# How to use it:
898 -# List all the working slots in LLVM_VALID_SLOTS, newest first.
899 -LLVM_VALID_SLOTS=( 12 )
900 -LLVM_MAX_SLOT="${LLVM_VALID_SLOTS[0]}"
901 -
902 -# splitting usedeps needed to avoid CI/pkgcheck's UncheckableDep limitation
903 -# (-) usedep needed because we may build with older llvm without that target
904 -LLVM_DEPEND="|| ( "
905 -for _s in ${LLVM_VALID_SLOTS[@]}; do
906 - LLVM_DEPEND+=" ( "
907 - for _x in ${ALL_LLVM_TARGETS[@]}; do
908 - LLVM_DEPEND+="
909 - ${_x}? ( sys-devel/llvm:${_s}[${_x}(-)] )"
910 - done
911 - LLVM_DEPEND+=" )"
912 -done
913 -unset _s _x
914 -LLVM_DEPEND+=" )
915 - <sys-devel/llvm-$(( LLVM_MAX_SLOT + 1 )):=
916 - wasm? ( sys-devel/lld )
917 -"
918 -
919 -# to bootstrap we need at least exactly previous version, or same.
920 -# most of the time previous versions fail to bootstrap with newer
921 -# for example 1.47.x, requires at least 1.46.x, 1.47.x is ok,
922 -# but it fails to bootstrap with 1.48.x
923 -# https://github.com/rust-lang/rust/blob/${PV}/src/stage0.txt
924 -BOOTSTRAP_DEPEND="||
925 - (
926 - =dev-lang/rust-$(ver_cut 1).$(($(ver_cut 2) - 1))*
927 - =dev-lang/rust-bin-$(ver_cut 1).$(($(ver_cut 2) - 1))*
928 - =dev-lang/rust-$(ver_cut 1).$(ver_cut 2)*
929 - =dev-lang/rust-bin-$(ver_cut 1).$(ver_cut 2)*
930 - )
931 -"
932 -
933 -BDEPEND="${PYTHON_DEPS}
934 - app-eselect/eselect-rust
935 - || (
936 - >=sys-devel/gcc-4.7
937 - >=sys-devel/clang-3.5
938 - )
939 - system-bootstrap? ( ${BOOTSTRAP_DEPEND} )
940 - !system-llvm? (
941 - >=dev-util/cmake-3.13.4
942 - dev-util/ninja
943 - )
944 - test? ( sys-devel/gdb )
945 - verify-sig? ( app-crypt/openpgp-keys-rust )
946 -"
947 -
948 -DEPEND="
949 - >=app-arch/xz-utils-5.2
950 - net-misc/curl:=[http2,ssl]
951 - sys-libs/zlib:=
952 - dev-libs/openssl:0=
953 - elibc_musl? ( sys-libs/libunwind:= )
954 - system-llvm? ( ${LLVM_DEPEND} )
955 -"
956 -
957 -# we need to block older versions due to layout changes.
958 -RDEPEND="${DEPEND}
959 - app-eselect/eselect-rust
960 - !<dev-lang/rust-1.47.0-r1
961 - !<dev-lang/rust-bin-1.47.0-r1
962 -"
963 -
964 -REQUIRED_USE="|| ( ${ALL_LLVM_TARGETS[*]} )
965 - miri? ( nightly )
966 - parallel-compiler? ( nightly )
967 - test? ( ${ALL_LLVM_TARGETS[*]} )
968 - wasm? ( llvm_targets_WebAssembly )
969 - x86? ( cpu_flags_x86_sse2 )
970 -"
971 -
972 -# we don't use cmake.eclass, but can get a warnings
973 -CMAKE_WARN_UNUSED_CLI=no
974 -
975 -QA_FLAGS_IGNORED="
976 - usr/lib/${PN}/${PV}/bin/.*
977 - usr/lib/${PN}/${PV}/libexec/.*
978 - usr/lib/${PN}/${PV}/lib/lib.*.so
979 - usr/lib/${PN}/${PV}/lib/rustlib/.*/bin/.*
980 - usr/lib/${PN}/${PV}/lib/rustlib/.*/lib/lib.*.so
981 -"
982 -
983 -QA_SONAME="
984 - usr/lib/${PN}/${PV}/lib/lib.*.so.*
985 - usr/lib/${PN}/${PV}/lib/rustlib/.*/lib/lib.*.so
986 -"
987 -
988 -# An rmeta file is custom binary format that contains the metadata for the crate.
989 -# rmeta files do not support linking, since they do not contain compiled object files.
990 -# so we can safely silence the warning for this QA check.
991 -QA_EXECSTACK="usr/lib/${PN}/${PV}/lib/rustlib/*/lib*.rlib:lib.rmeta"
992 -
993 -# causes double bootstrap
994 -RESTRICT="test"
995 -
996 -VERIFY_SIG_OPENPGP_KEY_PATH=${BROOT}/usr/share/openpgp-keys/rust.asc
997 -
998 -PATCHES=(
999 - "${FILESDIR}"/1.47.0-libressl.patch
1000 - "${FILESDIR}"/1.47.0-ignore-broken-and-non-applicable-tests.patch
1001 - "${FILESDIR}"/1.49.0-gentoo-musl-target-specs.patch
1002 - "${FILESDIR}"/1.51.0-slow-doc-install.patch
1003 -)
1004 -
1005 -S="${WORKDIR}/${MY_P}-src"
1006 -
1007 -toml_usex() {
1008 - usex "${1}" true false
1009 -}
1010 -
1011 -bootstrap_rust_version_check() {
1012 - # never call from pkg_pretend. eselect-rust may be not installed yet.
1013 - [[ ${MERGE_TYPE} == binary ]] && return
1014 - local rustc_wanted="$(ver_cut 1).$(($(ver_cut 2) - 1))"
1015 - local rustc_toonew="$(ver_cut 1).$(($(ver_cut 2) + 1))"
1016 - local rustc_version=( $(eselect --brief rust show 2>/dev/null) )
1017 - rustc_version=${rustc_version[0]#rust-bin-}
1018 - rustc_version=${rustc_version#rust-}
1019 -
1020 - [[ -z "${rustc_version}" ]] && die "Failed to determine rust version, check 'eselect rust' output"
1021 -
1022 - if ver_test "${rustc_version}" -lt "${rustc_wanted}" ; then
1023 - eerror "Rust >=${rustc_wanted} is required"
1024 - eerror "please run 'eselect rust' and set correct rust version"
1025 - die "selected rust version is too old"
1026 - elif ver_test "${rustc_version}" -ge "${rustc_toonew}" ; then
1027 - eerror "Rust <${rustc_toonew} is required"
1028 - eerror "please run 'eselect rust' and set correct rust version"
1029 - die "selected rust version is too new"
1030 - else
1031 - einfo "Using rust ${rustc_version} to build"
1032 - fi
1033 -}
1034 -
1035 -pre_build_checks() {
1036 - local M=8192
1037 - # multiply requirements by 1.5 if we are doing x86-multilib
1038 - if use amd64; then
1039 - M=$(( $(usex abi_x86_32 15 10) * ${M} / 10 ))
1040 - fi
1041 - M=$(( $(usex clippy 128 0) + ${M} ))
1042 - M=$(( $(usex miri 128 0) + ${M} ))
1043 - M=$(( $(usex rls 512 0) + ${M} ))
1044 - M=$(( $(usex rustfmt 256 0) + ${M} ))
1045 - # add 2G if we compile llvm and 256M per llvm_target
1046 - if ! use system-llvm; then
1047 - M=$(( 2048 + ${M} ))
1048 - local ltarget
1049 - for ltarget in ${ALL_LLVM_TARGETS[@]}; do
1050 - M=$(( $(usex ${ltarget} 256 0) + ${M} ))
1051 - done
1052 - fi
1053 - M=$(( $(usex wasm 256 0) + ${M} ))
1054 - M=$(( $(usex debug 2 1) * ${M} ))
1055 - eshopts_push -s extglob
1056 - if is-flagq '-g?(gdb)?([1-9])'; then
1057 - M=$(( 15 * ${M} / 10 ))
1058 - fi
1059 - eshopts_pop
1060 - M=$(( $(usex system-bootstrap 0 1024) + ${M} ))
1061 - M=$(( $(usex doc 256 0) + ${M} ))
1062 - CHECKREQS_DISK_BUILD=${M}M check-reqs_pkg_${EBUILD_PHASE}
1063 -}
1064 -
1065 -llvm_check_deps() {
1066 - has_version -r "sys-devel/llvm:${LLVM_SLOT}[${LLVM_TARGET_USEDEPS// /,}]"
1067 -}
1068 -
1069 -pkg_pretend() {
1070 - pre_build_checks
1071 -}
1072 -
1073 -pkg_setup() {
1074 - pre_build_checks
1075 - python-any-r1_pkg_setup
1076 -
1077 - export LIBGIT2_NO_PKG_CONFIG=1 #749381
1078 -
1079 - use system-bootstrap && bootstrap_rust_version_check
1080 -
1081 - if use system-llvm; then
1082 - llvm_pkg_setup
1083 -
1084 - local llvm_config="$(get_llvm_prefix "${LLVM_MAX_SLOT}")/bin/llvm-config"
1085 - export LLVM_LINK_SHARED=1
1086 - export RUSTFLAGS="${RUSTFLAGS} -Lnative=$("${llvm_config}" --libdir)"
1087 - fi
1088 -}
1089 -
1090 -src_prepare() {
1091 - if ! use system-bootstrap; then
1092 - local rust_stage0_root="${WORKDIR}"/rust-stage0
1093 - local rust_stage0="rust-${RUST_STAGE0_VERSION}-$(rust_abi)"
1094 -
1095 - "${WORKDIR}/${rust_stage0}"/install.sh --disable-ldconfig \
1096 - --without=rust-docs --destdir="${rust_stage0_root}" --prefix=/ || die
1097 - fi
1098 -
1099 - default
1100 -}
1101 -
1102 -src_configure() {
1103 - local rust_target="" rust_targets="" arch_cflags
1104 -
1105 - # Collect rust target names to compile standard libs for all ABIs.
1106 - for v in $(multilib_get_enabled_abi_pairs); do
1107 - rust_targets="${rust_targets},\"$(rust_abi $(get_abi_CHOST ${v##*.}))\""
1108 - done
1109 - if use wasm; then
1110 - rust_targets="${rust_targets},\"wasm32-unknown-unknown\""
1111 - if use system-llvm; then
1112 - # un-hardcode rust-lld linker for this target
1113 - # https://bugs.gentoo.org/715348
1114 - sed -i '/linker:/ s/rust-lld/wasm-ld/' compiler/rustc_target/src/spec/wasm32_base.rs || die
1115 - fi
1116 - fi
1117 - rust_targets="${rust_targets#,}"
1118 -
1119 - local tools="\"cargo\","
1120 - if use clippy; then
1121 - tools="\"clippy\",$tools"
1122 - fi
1123 - if use miri; then
1124 - tools="\"miri\",$tools"
1125 - fi
1126 - if use rls; then
1127 - tools="\"rls\",\"analysis\",\"src\",$tools"
1128 - fi
1129 - if use rustfmt; then
1130 - tools="\"rustfmt\",$tools"
1131 - fi
1132 -
1133 - local rust_stage0_root
1134 - if use system-bootstrap; then
1135 - local printsysroot
1136 - printsysroot="$(rustc --print sysroot || die "Can't determine rust's sysroot")"
1137 - rust_stage0_root="${printsysroot}"
1138 - else
1139 - rust_stage0_root="${WORKDIR}"/rust-stage0
1140 - fi
1141 - # in case of prefix it will be already prefixed, as --print sysroot returns full path
1142 - [[ -d ${rust_stage0_root} ]] || die "${rust_stage0_root} is not a directory"
1143 -
1144 - rust_target="$(rust_abi)"
1145 -
1146 - cat <<- _EOF_ > "${S}"/config.toml
1147 - [llvm]
1148 - download-ci-llvm = false
1149 - optimize = $(toml_usex !debug)
1150 - release-debuginfo = $(toml_usex debug)
1151 - assertions = $(toml_usex debug)
1152 - ninja = true
1153 - targets = "${LLVM_TARGETS// /;}"
1154 - experimental-targets = ""
1155 - link-shared = $(toml_usex system-llvm)
1156 - [build]
1157 - build = "${rust_target}"
1158 - host = ["${rust_target}"]
1159 - target = [${rust_targets}]
1160 - cargo = "${rust_stage0_root}/bin/cargo"
1161 - rustc = "${rust_stage0_root}/bin/rustc"
1162 - rustfmt = "${rust_stage0_root}/bin/rustfmt"
1163 - docs = $(toml_usex doc)
1164 - compiler-docs = false
1165 - submodules = false
1166 - python = "${EPYTHON}"
1167 - locked-deps = true
1168 - vendor = true
1169 - extended = true
1170 - tools = [${tools}]
1171 - verbose = 2
1172 - sanitizers = false
1173 - profiler = false
1174 - cargo-native-static = false
1175 - [install]
1176 - prefix = "${EPREFIX}/usr/lib/${PN}/${PV}"
1177 - sysconfdir = "etc"
1178 - docdir = "share/doc/rust"
1179 - bindir = "bin"
1180 - libdir = "lib"
1181 - mandir = "share/man"
1182 - [rust]
1183 - # https://github.com/rust-lang/rust/issues/54872
1184 - codegen-units-std = 1
1185 - optimize = true
1186 - debug = $(toml_usex debug)
1187 - debug-assertions = $(toml_usex debug)
1188 - debug-assertions-std = $(toml_usex debug)
1189 - debuginfo-level = $(usex debug 2 0)
1190 - debuginfo-level-rustc = $(usex debug 2 0)
1191 - debuginfo-level-std = $(usex debug 2 0)
1192 - debuginfo-level-tools = $(usex debug 2 0)
1193 - debuginfo-level-tests = 0
1194 - backtrace = true
1195 - incremental = false
1196 - default-linker = "$(tc-getCC)"
1197 - parallel-compiler = $(toml_usex parallel-compiler)
1198 - channel = "$(usex nightly nightly stable)"
1199 - description = "gentoo"
1200 - rpath = false
1201 - verbose-tests = true
1202 - optimize-tests = $(toml_usex !debug)
1203 - codegen-tests = true
1204 - dist-src = false
1205 - remap-debuginfo = true
1206 - lld = $(usex system-llvm false $(toml_usex wasm))
1207 - # only deny warnings if doc+wasm are NOT requested, documenting stage0 wasm std fails without it
1208 - # https://github.com/rust-lang/rust/issues/74976
1209 - # https://github.com/rust-lang/rust/issues/76526
1210 - deny-warnings = $(usex wasm $(usex doc false true) true)
1211 - backtrace-on-ice = true
1212 - jemalloc = false
1213 - [dist]
1214 - src-tarball = false
1215 - compression-formats = ["gz"]
1216 - _EOF_
1217 -
1218 - for v in $(multilib_get_enabled_abi_pairs); do
1219 - rust_target=$(rust_abi $(get_abi_CHOST ${v##*.}))
1220 - arch_cflags="$(get_abi_CFLAGS ${v##*.})"
1221 -
1222 - cat <<- _EOF_ >> "${S}"/config.env
1223 - CFLAGS_${rust_target}=${arch_cflags}
1224 - _EOF_
1225 -
1226 - cat <<- _EOF_ >> "${S}"/config.toml
1227 - [target.${rust_target}]
1228 - cc = "$(tc-getBUILD_CC)"
1229 - cxx = "$(tc-getBUILD_CXX)"
1230 - linker = "$(tc-getCC)"
1231 - ar = "$(tc-getAR)"
1232 - _EOF_
1233 - # librustc_target/spec/linux_musl_base.rs sets base.crt_static_default = true;
1234 - if use elibc_musl; then
1235 - cat <<- _EOF_ >> "${S}"/config.toml
1236 - crt-static = false
1237 - _EOF_
1238 - fi
1239 - if use system-llvm; then
1240 - cat <<- _EOF_ >> "${S}"/config.toml
1241 - llvm-config = "$(get_llvm_prefix "${LLVM_MAX_SLOT}")/bin/llvm-config"
1242 - _EOF_
1243 - fi
1244 - done
1245 - if use wasm; then
1246 - cat <<- _EOF_ >> "${S}"/config.toml
1247 - [target.wasm32-unknown-unknown]
1248 - linker = "$(usex system-llvm lld rust-lld)"
1249 - _EOF_
1250 - fi
1251 -
1252 - if [[ -n ${I_KNOW_WHAT_I_AM_DOING_CROSS} ]]; then # whitespace intentionally shifted below
1253 - # experimental cross support
1254 - # discussion: https://bugs.gentoo.org/679878
1255 - # TODO: c*flags, clang, system-llvm, cargo.eclass target support
1256 - # it would be much better if we could split out stdlib
1257 - # complilation to separate ebuild and abuse CATEGORY to
1258 - # just install to /usr/lib/rustlib/<target>
1259 -
1260 - # extra targets defined as a bash array
1261 - # spec format: <LLVM target>:<rust-target>:<CTARGET>
1262 - # best place would be /etc/portage/env/dev-lang/rust
1263 - # Example:
1264 - # RUST_CROSS_TARGETS=(
1265 - # "AArch64:aarch64-unknown-linux-gnu:aarch64-unknown-linux-gnu"
1266 - # )
1267 - # no extra hand holding is done, no target transformations, all
1268 - # values are passed as-is with just basic checks, so it's up to user to supply correct values
1269 - # valid rust targets can be obtained with
1270 - # rustc --print target-list
1271 - # matching cross toolchain has to be installed
1272 - # matching LLVM_TARGET has to be enabled for both rust and llvm (if using system one)
1273 - # only gcc toolchains installed with crossdev are checked for now.
1274 -
1275 - # BUG: we can't pass host flags to cross compiler, so just filter for now
1276 - # BUG: this should be more fine-grained.
1277 - filter-flags '-mcpu=*' '-march=*' '-mtune=*'
1278 -
1279 - local cross_target_spec
1280 - for cross_target_spec in "${RUST_CROSS_TARGETS[@]}";do
1281 - # extracts first element form <LLVM target>:<rust-target>:<CTARGET>
1282 - local cross_llvm_target="${cross_target_spec%%:*}"
1283 - # extracts toolchain triples, <rust-target>:<CTARGET>
1284 - local cross_triples="${cross_target_spec#*:}"
1285 - # extracts first element after before : separator
1286 - local cross_rust_target="${cross_triples%%:*}"
1287 - # extracts last element after : separator
1288 - local cross_toolchain="${cross_triples##*:}"
1289 - use llvm_targets_${cross_llvm_target} || die "need llvm_targets_${cross_llvm_target} target enabled"
1290 - command -v ${cross_toolchain}-gcc > /dev/null 2>&1 || die "need ${cross_toolchain} cross toolchain"
1291 -
1292 - cat <<- _EOF_ >> "${S}"/config.toml
1293 - [target.${cross_rust_target}]
1294 - cc = "${cross_toolchain}-gcc"
1295 - cxx = "${cross_toolchain}-g++"
1296 - linker = "${cross_toolchain}-gcc"
1297 - ar = "${cross_toolchain}-ar"
1298 - _EOF_
1299 - if use system-llvm; then
1300 - cat <<- _EOF_ >> "${S}"/config.toml
1301 - llvm-config = "$(get_llvm_prefix "${LLVM_MAX_SLOT}")/bin/llvm-config"
1302 - _EOF_
1303 - fi
1304 - if [[ "${cross_toolchain}" == *-musl* ]]; then
1305 - cat <<- _EOF_ >> "${S}"/config.toml
1306 - musl-root = "$(${cross_toolchain}-gcc -print-sysroot)/usr"
1307 - _EOF_
1308 - fi
1309 -
1310 - # append cross target to "normal" target list
1311 - # example 'target = ["powerpc64le-unknown-linux-gnu"]'
1312 - # becomes 'target = ["powerpc64le-unknown-linux-gnu","aarch64-unknown-linux-gnu"]'
1313 -
1314 - rust_targets="${rust_targets},\"${cross_rust_target}\""
1315 - sed -i "/^target = \[/ s#\[.*\]#\[${rust_targets}\]#" config.toml || die
1316 -
1317 - ewarn
1318 - ewarn "Enabled ${cross_rust_target} rust target"
1319 - ewarn "Using ${cross_toolchain} cross toolchain"
1320 - ewarn
1321 - if ! has_version -b 'sys-devel/binutils[multitarget]' ; then
1322 - ewarn "'sys-devel/binutils[multitarget]' is not installed"
1323 - ewarn "'strip' will be unable to strip cross libraries"
1324 - ewarn "cross targets will be installed with full debug information"
1325 - ewarn "enable 'multitarget' USE flag for binutils to be able to strip object files"
1326 - ewarn
1327 - ewarn "Alternatively llvm-strip can be used, it supports stripping any target"
1328 - ewarn "define STRIP=\"llvm-strip\" to use it (experimental)"
1329 - ewarn
1330 - fi
1331 - done
1332 - fi # I_KNOW_WHAT_I_AM_DOING_CROSS
1333 -
1334 - einfo "Rust configured with the following flags:"
1335 - echo
1336 - echo "RUSTFLAGS=\"${RUSTFLAGS:-}\""
1337 - echo "RUSTFLAGS_BOOTSTRAP=\"${RUSTFLAGS_BOOTSTRAP:-}\""
1338 - echo "RUSTFLAGS_NOT_BOOTSTRAP=\"${RUSTFLAGS_NOT_BOOTSTRAP:-}\""
1339 - cat "${S}"/config.env || die
1340 - echo
1341 - einfo "config.toml contents:"
1342 - cat "${S}"/config.toml || die
1343 - echo
1344 -}
1345 -
1346 -src_compile() {
1347 - # we need \n IFS to have config.env with spaces loaded properly. #734018
1348 - (
1349 - IFS=$'\n'
1350 - env $(cat "${S}"/config.env) RUST_BACKTRACE=1\
1351 - "${EPYTHON}" ./x.py dist -vv --config="${S}"/config.toml -j$(makeopts_jobs) || die
1352 - )
1353 -}
1354 -
1355 -src_test() {
1356 - # https://rustc-dev-guide.rust-lang.org/tests/intro.html
1357 -
1358 - # those are basic and codegen tests.
1359 - local tests=(
1360 - codegen
1361 - codegen-units
1362 - compile-fail
1363 - incremental
1364 - mir-opt
1365 - pretty
1366 - run-make
1367 - )
1368 -
1369 - # fails if llvm is not built with ALL targets.
1370 - # and known to fail with system llvm sometimes.
1371 - use system-llvm || tests+=( assembly )
1372 -
1373 - # fragile/expensive/less important tests
1374 - # or tests that require extra builds
1375 - # TODO: instead of skipping, just make some nonfatal.
1376 - if [[ ${ERUST_RUN_EXTRA_TESTS:-no} != no ]]; then
1377 - tests+=(
1378 - rustdoc
1379 - rustdoc-js
1380 - rustdoc-js-std
1381 - rustdoc-ui
1382 - run-make-fulldeps
1383 - ui
1384 - ui-fulldeps
1385 - )
1386 - fi
1387 -
1388 - local i failed=()
1389 - einfo "rust_src_test: enabled tests ${tests[@]/#/src/test/}"
1390 - for i in "${tests[@]}"; do
1391 - local t="src/test/${i}"
1392 - einfo "rust_src_test: running ${t}"
1393 - if ! (
1394 - IFS=$'\n'
1395 - env $(cat "${S}"/config.env) RUST_BACKTRACE=1 \
1396 - "${EPYTHON}" ./x.py test -vv --config="${S}"/config.toml \
1397 - -j$(makeopts_jobs) --no-doc --no-fail-fast "${t}"
1398 - )
1399 - then
1400 - failed+=( "${t}" )
1401 - eerror "rust_src_test: ${t} failed"
1402 - fi
1403 - done
1404 -
1405 - if [[ ${#failed[@]} -ne 0 ]]; then
1406 - eerror "rust_src_test: failure summary: ${failed[@]}"
1407 - die "aborting due to test failures"
1408 - fi
1409 -}
1410 -
1411 -src_install() {
1412 - (
1413 - IFS=$'\n'
1414 - env $(cat "${S}"/config.env) DESTDIR="${D}" \
1415 - "${EPYTHON}" ./x.py install -vv --config="${S}"/config.toml -j$(makeopts_jobs) || die
1416 - )
1417 -
1418 - # bug #689562, #689160
1419 - rm -v "${ED}/usr/lib/${PN}/${PV}/etc/bash_completion.d/cargo" || die
1420 - rmdir -v "${ED}/usr/lib/${PN}/${PV}"/etc{/bash_completion.d,} || die
1421 - newbashcomp src/tools/cargo/src/etc/cargo.bashcomp.sh cargo
1422 -
1423 - local symlinks=(
1424 - cargo
1425 - rustc
1426 - rustdoc
1427 - rust-gdb
1428 - rust-gdbgui
1429 - rust-lldb
1430 - )
1431 -
1432 - use clippy && symlinks+=( clippy-driver cargo-clippy )
1433 - use miri && symlinks+=( miri cargo-miri )
1434 - use rls && symlinks+=( rls )
1435 - use rustfmt && symlinks+=( rustfmt cargo-fmt )
1436 -
1437 - einfo "installing eselect-rust symlinks and paths: ${symlinks[@]}"
1438 - local i
1439 - for i in "${symlinks[@]}"; do
1440 - # we need realpath on /usr/bin/* symlink return version-appended binary path.
1441 - # so /usr/bin/rustc should point to /usr/lib/rust/<ver>/bin/rustc-<ver>
1442 - # need to fix eselect-rust to remove this hack.
1443 - local ver_i="${i}-${PV}"
1444 - if [[ -f "${ED}/usr/lib/${PN}/${PV}/bin/${i}" ]]; then
1445 - einfo "Installing ${i} symlink"
1446 - ln -v "${ED}/usr/lib/${PN}/${PV}/bin/${i}" "${ED}/usr/lib/${PN}/${PV}/bin/${ver_i}" || die
1447 - else
1448 - ewarn "${i} symlink requested, but source file not found"
1449 - ewarn "please report this"
1450 - fi
1451 - dosym "../lib/${PN}/${PV}/bin/${ver_i}" "/usr/bin/${ver_i}"
1452 - done
1453 -
1454 - # symlinks to switch components to active rust in eselect
1455 - dosym "${PV}/lib" "/usr/lib/${PN}/lib-${PV}"
1456 - dosym "${PV}/libexec" "/usr/lib/${PN}/libexec-${PV}"
1457 - dosym "${PV}/share/man" "/usr/lib/${PN}/man-${PV}"
1458 - dosym "rust/${PV}/lib/rustlib" "/usr/lib/rustlib-${PV}"
1459 - dosym "../../lib/${PN}/${PV}/share/doc/rust" "/usr/share/doc/${P}"
1460 -
1461 - newenvd - "50${P}" <<-_EOF_
1462 - LDPATH="${EPREFIX}/usr/lib/rust/lib"
1463 - MANPATH="${EPREFIX}/usr/lib/rust/man"
1464 - $(use amd64 && usex elibc_musl 'CARGO_TARGET_X86_64_UNKNOWN_LINUX_MUSL_RUSTFLAGS="-C target-feature=-crt-static"' '')
1465 - $(use arm64 && usex elibc_musl 'CARGO_TARGET_AARCH64_UNKNOWN_LINUX_MUSL_RUSTFLAGS="-C target-feature=-crt-static"' '')
1466 - _EOF_
1467 -
1468 - rm -rf "${ED}/usr/lib/${PN}/${PV}"/*.old || die
1469 - rm -rf "${ED}/usr/lib/${PN}/${PV}/doc"/*.old || die
1470 -
1471 - # note: eselect-rust adds EROOT to all paths below
1472 - cat <<-_EOF_ > "${T}/provider-${P}"
1473 - /usr/bin/cargo
1474 - /usr/bin/rustdoc
1475 - /usr/bin/rust-gdb
1476 - /usr/bin/rust-gdbgui
1477 - /usr/bin/rust-lldb
1478 - /usr/lib/rustlib
1479 - /usr/lib/rust/lib
1480 - /usr/lib/rust/libexec
1481 - /usr/lib/rust/man
1482 - /usr/share/doc/rust
1483 - _EOF_
1484 -
1485 - if use clippy; then
1486 - echo /usr/bin/clippy-driver >> "${T}/provider-${P}"
1487 - echo /usr/bin/cargo-clippy >> "${T}/provider-${P}"
1488 - fi
1489 - if use miri; then
1490 - echo /usr/bin/miri >> "${T}/provider-${P}"
1491 - echo /usr/bin/cargo-miri >> "${T}/provider-${P}"
1492 - fi
1493 - if use rls; then
1494 - echo /usr/bin/rls >> "${T}/provider-${P}"
1495 - fi
1496 - if use rustfmt; then
1497 - echo /usr/bin/rustfmt >> "${T}/provider-${P}"
1498 - echo /usr/bin/cargo-fmt >> "${T}/provider-${P}"
1499 - fi
1500 -
1501 - insinto /etc/env.d/rust
1502 - doins "${T}/provider-${P}"
1503 -}
1504 -
1505 -pkg_postinst() {
1506 - eselect rust update
1507 -
1508 - if has_version sys-devel/gdb || has_version dev-util/lldb; then
1509 - elog "Rust installs a helper script for calling GDB and LLDB,"
1510 - elog "for your convenience it is installed under /usr/bin/rust-{gdb,lldb}-${PV}."
1511 - fi
1512 -
1513 - if has_version app-editors/emacs; then
1514 - elog "install app-emacs/rust-mode to get emacs support for rust."
1515 - fi
1516 -
1517 - if has_version app-editors/gvim || has_version app-editors/vim; then
1518 - elog "install app-vim/rust-vim to get vim support for rust."
1519 - fi
1520 -}
1521 -
1522 -pkg_postrm() {
1523 - eselect rust cleanup
1524 -}