diff options
1169 files changed, 12093 insertions, 10441 deletions
diff --git a/.git-blame-ignore-revs b/.git-blame-ignore-revs index 9fd8054a12e..ec76a1a42ef 100644 --- a/.git-blame-ignore-revs +++ b/.git-blame-ignore-revs @@ -25,3 +25,5 @@ b2d2184edea578109a48ec3d8decbee5948e8f35 ec2cc761bc7067712ecc7734502f703fe3b024c8 # format use declarations 84ac80f1921afc243d71fd0caaa4f2838c294102 +# bless mir-opt tests to add `copy` +99cb0c6bc399fb94a0ddde7e9b38e9c00d523bad diff --git a/Cargo.lock b/Cargo.lock index 0b546d6e5ee..ac347d02af7 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -125,9 +125,9 @@ dependencies = [ [[package]] name = "anstream" -version = "0.6.14" +version = "0.6.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "418c75fa768af9c03be99d17643f93f79bbba589895012a80e3452a19ddda15b" +checksum = "64e15c1ab1f89faffbf04a634d5e1962e9074f2741eef6d97f3c4e322426d526" dependencies = [ "anstyle", "anstyle-parse", @@ -140,42 +140,42 @@ dependencies = [ [[package]] name = "anstyle" -version = "1.0.7" +version = "1.0.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "038dfcf04a5feb68e9c60b21c9625a54c2c0616e79b72b0fd87075a056ae1d1b" +checksum = "1bec1de6f59aedf83baf9ff929c98f2ad654b97c9510f4e70cf6f661d49fd5b1" [[package]] name = "anstyle-lossy" -version = "1.1.1" +version = "1.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6fcff6599f06e21b0165c85052ccd6e67dc388ddd1c516a9dc5f55dc8cacf004" +checksum = "f45c79b3b9413932fc255f2c19ca0d48eaab72c4ea1913bafaebf289cbc099f2" dependencies = [ "anstyle", ] [[package]] name = "anstyle-parse" -version = "0.2.4" +version = "0.2.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c03a11a9034d92058ceb6ee011ce58af4a9bf61491aa7e1e59ecd24bd40d22d4" +checksum = "eb47de1e80c2b463c735db5b217a0ddc39d612e7ac9e2e96a5aed1f57616c1cb" dependencies = [ "utf8parse", ] [[package]] name = "anstyle-query" -version = "1.1.0" +version = "1.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ad186efb764318d35165f1758e7dcef3b10628e26d41a44bc5550652e6804391" +checksum = "6d36fc52c7f6c869915e99412912f22093507da8d9e942ceaf66fe4b7c14422a" dependencies = [ "windows-sys 0.52.0", ] [[package]] name = "anstyle-svg" -version = "0.1.4" +version = "0.1.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bbbf0bf947d663010f0b4132f28ca08da9151f3b9035fa7578a38de521c1d1aa" +checksum = "962f6d5681926dbe5503b71057202d6723a33abe464c983b1d160bca3095a3bb" dependencies = [ "anstream", "anstyle", @@ -186,9 +186,9 @@ dependencies = [ [[package]] name = "anstyle-wincon" -version = "3.0.3" +version = "3.0.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "61a38449feb7068f52bb06c12759005cf459ee52bb4adc1d5a7c4322d716fb19" +checksum = "5bf74e1b6e971609db8ca7a9ce79fd5768ab6ae46441c572e46cf596f59e57f8" dependencies = [ "anstyle", "windows-sys 0.52.0", @@ -205,18 +205,18 @@ dependencies = [ [[package]] name = "ar_archive_writer" -version = "0.3.3" +version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3f2bcb7cf51decfbbfc7ef476e28b0775b13e5eb1190f8b7df145cd53d4f4374" +checksum = "de11a9d32db3327f981143bdf699ade4d637c6887b13b97e6e91a9154666963c" dependencies = [ - "object 0.36.2", + "object 0.36.3", ] [[package]] name = "arrayvec" -version = "0.7.4" +version = "0.7.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "96d30a06541fbafbc7f82ed10c06164cfbd2c401138f6addd8404629c4b16711" +checksum = "7c02d123df017efcdfbd739ef81735b36c5ba83ec3c59c80a9d7ecc718f92e50" [[package]] name = "autocfg" @@ -271,9 +271,9 @@ checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" [[package]] name = "bitflags" -version = "2.5.0" +version = "2.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cf4b9d6a944f767f8e5e0db018570623c85f3d925ac718db4e06d0187adb21c1" +checksum = "b048fb63fd8b5923fc5aa7b340d8e156aec7ec02f0c78fa8a6ddc2613f6f71de" [[package]] name = "block-buffer" @@ -291,7 +291,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6798148dccfbff0fae41c7574d2fa8f1ef3492fba0face179de5d8d447d67b05" dependencies = [ "memchr", - "regex-automata 0.3.7", + "regex-automata 0.3.9", "serde", ] @@ -351,15 +351,15 @@ checksum = "1fd0f2584146f6f2ef48085050886acf353beff7305ebd1ae69500e27c67f64b" [[package]] name = "bytes" -version = "1.6.0" +version = "1.7.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "514de17de45fdb8dc022b1a7975556c53c86f9f0aa5f534b98977b171857c2c9" +checksum = "8318a53db07bb3f8dca91a600466bdb3f2eaadeedfdbcf02e1accbad9271ba50" [[package]] name = "camino" -version = "1.1.7" +version = "1.1.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e0ec6b951b160caa93cc0c7b209e5a3bff7aae9062213451ac99493cd844c239" +checksum = "8b96ec4966b5813e2c0507c1f86115c8c5abaadc3980879c3424042a02fd1ad3" dependencies = [ "serde", ] @@ -420,9 +420,12 @@ version = "0.1.0" [[package]] name = "cc" -version = "1.0.99" +version = "1.1.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "96c51067fd44124faa7f870b4b1c969379ad32b2ba805aa959430ceaa384f695" +checksum = "72db2f7947ecee9b03b510377e8bb9077afa27176fdbff55c51027e976fdcc48" +dependencies = [ + "shlex", +] [[package]] name = "cfg-if" @@ -432,9 +435,9 @@ checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" [[package]] name = "cfg_aliases" -version = "0.1.1" +version = "0.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fd16c4719339c4530435d38e511904438d07cce7950afa3718a84ac36c10e89e" +checksum = "613afe47fcd5fac7ccf1db93babcb082c5994d996f20b8b159f2ad1658eb5724" [[package]] name = "chrono" @@ -446,7 +449,7 @@ dependencies = [ "iana-time-zone", "num-traits", "serde", - "windows-targets 0.52.5", + "windows-targets 0.52.6", ] [[package]] @@ -483,9 +486,9 @@ dependencies = [ [[package]] name = "clap" -version = "4.5.7" +version = "4.5.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5db83dced34638ad474f39f250d7fea9598bdd239eaced1bdf45d597da0f433f" +checksum = "ed6719fffa43d0d87e5fd8caeab59be1554fb028cd30edc88fc4369b17971019" dependencies = [ "clap_builder", "clap_derive", @@ -503,9 +506,9 @@ dependencies = [ [[package]] name = "clap_builder" -version = "4.5.7" +version = "4.5.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f7e204572485eb3fbf28f871612191521df159bc3e15a9f5064c66dba3a8c05f" +checksum = "216aec2b177652e3846684cbfe25c9964d18ec45234f0f5da5157b207ed1aab6" dependencies = [ "anstream", "anstyle", @@ -516,30 +519,30 @@ dependencies = [ [[package]] name = "clap_complete" -version = "4.5.6" +version = "4.5.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fbca90c87c2a04da41e95d1856e8bcd22f159bdbfa147314d2ce5218057b0e58" +checksum = "1ee158892bd7ce77aa15c208abbdb73e155d191c287a659b57abd5adb92feb03" dependencies = [ "clap", ] [[package]] name = "clap_derive" -version = "4.5.5" +version = "4.5.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c780290ccf4fb26629baa7a1081e68ced113f1d3ec302fa5948f1c381ebf06c6" +checksum = "501d359d5f3dcaf6ecdeee48833ae73ec6e42723a1e52419c79abf9507eec0a0" dependencies = [ "heck 0.5.0", "proc-macro2", "quote", - "syn 2.0.67", + "syn 2.0.75", ] [[package]] name = "clap_lex" -version = "0.7.1" +version = "0.7.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4b82cf0babdbd58558212896d1a4272303a57bdb245c2bf1147185fb45640e70" +checksum = "1462739cb27611015575c0c11df5df7601141071f07518d56fcc1be504cbec97" [[package]] name = "clippy" @@ -559,7 +562,7 @@ dependencies = [ "regex", "rustc_tools_util", "serde", - "syn 2.0.67", + "syn 2.0.75", "tempfile", "termize", "tokio", @@ -671,7 +674,7 @@ dependencies = [ "nom", "proc-macro2", "quote", - "syn 2.0.67", + "syn 2.0.75", ] [[package]] @@ -688,9 +691,9 @@ dependencies = [ [[package]] name = "colorchoice" -version = "1.0.1" +version = "1.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0b6a852b24ab71dffc585bcb46eaf7959d175cb865a7152e35b348d1b2960422" +checksum = "d3fd119d74b830634cea2a0f58bbd0d54540518a14397557951e79340abc28c0" [[package]] name = "colored" @@ -750,9 +753,9 @@ dependencies = [ [[package]] name = "core-foundation-sys" -version = "0.8.6" +version = "0.8.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "06ea2b9bc92be3c2baa9334a323ebca2d6f074ff852cd1d7b11064035cd3868f" +checksum = "773648b94d0e5d620f64f280777445740e61fe701025087ec8b57f45c791888b" [[package]] name = "coverage-dump" @@ -768,9 +771,9 @@ dependencies = [ [[package]] name = "cpufeatures" -version = "0.2.12" +version = "0.2.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "53fe5e26ff1b7aef8bca9c6080520cfb8d9333c7568e1829cef191a9723e5504" +checksum = "51e852e6dc9a5bed1fae92dd2375037bf2b768725bf3be87811edee3249d09ad" dependencies = [ "libc", ] @@ -830,12 +833,12 @@ dependencies = [ [[package]] name = "ctrlc" -version = "3.4.4" +version = "3.4.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "672465ae37dc1bc6380a6547a8883d5dd397b0f1faaad4f265726cc7042a5345" +checksum = "90eeab0aa92f3f9b4e87f258c72b139c207d251f9cbc1080a0086b86a8870dd3" dependencies = [ "nix", - "windows-sys 0.52.0", + "windows-sys 0.59.0", ] [[package]] @@ -855,9 +858,9 @@ dependencies = [ [[package]] name = "curl-sys" -version = "0.4.72+curl-8.6.0" +version = "0.4.74+curl-8.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "29cbdc8314c447d11e8fd156dcdd031d9e02a7a976163e396b548c03153bc9ea" +checksum = "8af10b986114528fcdc4b63b6f5f021b7057618411046a4de2ba0f0149a097bf" dependencies = [ "cc", "libc", @@ -870,9 +873,9 @@ dependencies = [ [[package]] name = "darling" -version = "0.20.9" +version = "0.20.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "83b2eb4d90d12bdda5ed17de686c2acb4c57914f8f921b8da7e112b5a36f3fe1" +checksum = "6f63b86c8a8826a49b8c21f08a2d07338eec8d900540f8630dc76284be802989" dependencies = [ "darling_core", "darling_macro", @@ -880,27 +883,27 @@ dependencies = [ [[package]] name = "darling_core" -version = "0.20.9" +version = "0.20.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "622687fe0bac72a04e5599029151f5796111b90f1baaa9b544d807a5e31cd120" +checksum = "95133861a8032aaea082871032f5815eb9e98cef03fa916ab4500513994df9e5" dependencies = [ "fnv", "ident_case", "proc-macro2", "quote", "strsim", - "syn 2.0.67", + "syn 2.0.75", ] [[package]] name = "darling_macro" -version = "0.20.9" +version = "0.20.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "733cabb43482b1a1b53eee8583c2b9e8684d592215ea83efd305dd31bc2f0178" +checksum = "d336a2a514f6ccccaa3e09b02d41d35330c07ddf03a62165fcec10bb561c7806" dependencies = [ "darling_core", "quote", - "syn 2.0.67", + "syn 2.0.75", ] [[package]] @@ -926,7 +929,7 @@ version = "0.1.82" dependencies = [ "itertools", "quote", - "syn 2.0.67", + "syn 2.0.75", ] [[package]] @@ -946,7 +949,7 @@ checksum = "62d671cc41a825ebabc75757b62d3d168c577f9149b2d49ece1dad1f72119d25" dependencies = [ "proc-macro2", "quote", - "syn 2.0.67", + "syn 2.0.75", ] [[package]] @@ -967,7 +970,7 @@ dependencies = [ "darling", "proc-macro2", "quote", - "syn 2.0.67", + "syn 2.0.75", ] [[package]] @@ -977,7 +980,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "206868b8242f27cecce124c19fd88157fbd0dd334df2587f36417bafbc85097b" dependencies = [ "derive_builder_core", - "syn 2.0.67", + "syn 2.0.75", ] [[package]] @@ -988,7 +991,7 @@ checksum = "5f33878137e4dafd7fa914ad4e259e18a4e8e532b9617a2d0150262bf53abfce" dependencies = [ "proc-macro2", "quote", - "syn 2.0.67", + "syn 2.0.75", ] [[package]] @@ -1000,7 +1003,7 @@ dependencies = [ "darling", "proc-macro2", "quote", - "syn 2.0.67", + "syn 2.0.75", ] [[package]] @@ -1078,7 +1081,7 @@ checksum = "97369cbbc041bc366949bc74d34658d6cda5621039731c6310521892a3a20ae0" dependencies = [ "proc-macro2", "quote", - "syn 2.0.67", + "syn 2.0.75", ] [[package]] @@ -1089,9 +1092,9 @@ checksum = "59f8e79d1fbf76bdfbde321e902714bf6c49df88a7dda6fc682fc2979226962d" [[package]] name = "either" -version = "1.12.0" +version = "1.13.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3dca9240753cf90908d7e4aac30f630662b02aebaa1b58a3cadabdb23385b58b" +checksum = "60b1af1c220855b6ceac025d3f6ecdd2b7c4894bfe9cd9bda4fbb4bc7c0d4cf0" [[package]] name = "elasticlunr-rs" @@ -1131,9 +1134,9 @@ checksum = "a357d28ed41a50f9c765dbfe56cbc04a64e53e5fc58ba79fbc34c10ef3df831f" [[package]] name = "env_filter" -version = "0.1.0" +version = "0.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a009aa4810eb158359dda09d0c87378e4bbb89b5a801f016885a4707ba24f7ea" +checksum = "4f2c92ceda6ceec50f43169f9ee8424fe2db276791afde7b2cd8bc084cb376ab" dependencies = [ "log", "regex", @@ -1141,9 +1144,9 @@ dependencies = [ [[package]] name = "env_logger" -version = "0.11.3" +version = "0.11.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "38b35839ba51819680ba087cd351788c9a3c476841207e0b8cee0b04722343b9" +checksum = "e13fa619b91fb2381732789fc5de83b45675e882f66623b7d8cb4f643017018d" dependencies = [ "anstream", "anstyle", @@ -1219,21 +1222,21 @@ dependencies = [ [[package]] name = "filetime" -version = "0.2.23" +version = "0.2.24" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1ee447700ac8aa0b2f2bd7bc4462ad686ba06baa6727ac149a2d6277f0d240fd" +checksum = "bf401df4a4e3872c4fe8151134cf483738e74b67fc934d6532c882b3d24a4550" dependencies = [ "cfg-if", "libc", - "redox_syscall 0.4.1", - "windows-sys 0.52.0", + "libredox", + "windows-sys 0.59.0", ] [[package]] name = "flate2" -version = "1.0.30" +version = "1.0.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5f54427cfd1c7829e2a139fcefea601bf088ebca651d2bf53ebc600eac295dae" +checksum = "7f211bbe8e69bbd0cfdea405084f128ae8b4aaa6b0b522fc8f2b009084797920" dependencies = [ "crc32fast", "miniz_oxide", @@ -1369,7 +1372,7 @@ checksum = "87750cf4b7a4c0625b1529e4c543c2182106e4dedc60a2a6455e00d212c489ac" dependencies = [ "proc-macro2", "quote", - "syn 2.0.67", + "syn 2.0.75", ] [[package]] @@ -1587,7 +1590,7 @@ dependencies = [ "markup5ever", "proc-macro2", "quote", - "syn 2.0.67", + "syn 2.0.75", ] [[package]] @@ -1719,7 +1722,7 @@ checksum = "1ec89e9337638ecdc08744df490b221a7399bf8d164eb52a665454e60e075ad6" dependencies = [ "proc-macro2", "quote", - "syn 2.0.67", + "syn 2.0.75", ] [[package]] @@ -1856,9 +1859,9 @@ dependencies = [ [[package]] name = "is_terminal_polyfill" -version = "1.70.0" +version = "1.70.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f8478577c03552c21db0e2724ffb8986a5ce7af88107e6be5d2ee6e158c12800" +checksum = "7943c866cc5cd64cbc25b2e01621d07fa8eb2a1a23160ee81ce38704e97b8ecf" [[package]] name = "itertools" @@ -1887,18 +1890,18 @@ dependencies = [ [[package]] name = "jobserver" -version = "0.1.31" +version = "0.1.32" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d2b099aaa34a9751c5bf0878add70444e1ed2dd73f347be99003d4577277de6e" +checksum = "48d1dbcbbeb6a7fec7e059840aa538bd62aaccf972c7346c4d9d2059312853d0" dependencies = [ "libc", ] [[package]] name = "js-sys" -version = "0.3.69" +version = "0.3.70" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "29c15563dc2726973df627357ce0c9ddddbea194836909d655df6a75d2cf296d" +checksum = "1868808506b929d7b0cfa8f75951347aa71bb21144b7791bae35d9bccfcfe37a" dependencies = [ "wasm-bindgen", ] @@ -1965,9 +1968,9 @@ checksum = "baff4b617f7df3d896f97fe922b64817f6cd9a756bb81d40f8883f2f66dcb401" [[package]] name = "libc" -version = "0.2.155" +version = "0.2.157" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "97b3888a4aecf77e811145cadf6eef5901f4782c53886191b2f693f24761847c" +checksum = "374af5f94e54fa97cf75e945cce8a6b201e88a1a07e688b47dfd2a59c66dbd86" [[package]] name = "libdbus-sys" @@ -2000,12 +2003,12 @@ dependencies = [ [[package]] name = "libloading" -version = "0.8.3" +version = "0.8.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0c2a198fb6b0eada2a8df47933734e6d35d350665a33a3593d7164fa52c75c19" +checksum = "4979f22fdb869068da03c9f7528f8297c6fd2606bc3a4affe42e6a823fdb8da4" dependencies = [ "cfg-if", - "windows-targets 0.52.5", + "windows-targets 0.52.6", ] [[package]] @@ -2020,15 +2023,16 @@ version = "0.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c0ff37bd590ca25063e35af745c343cb7a0271906fb7b37e4813e8f79f00268d" dependencies = [ - "bitflags 2.5.0", + "bitflags 2.6.0", "libc", + "redox_syscall", ] [[package]] name = "libz-sys" -version = "1.1.18" +version = "1.1.19" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c15da26e5af7e25c90b37a2d75cdbf940cf4a55316de9d84c679c9b8bfabf82e" +checksum = "fdc53a7799a7496ebc9fd29f31f7df80e83c9bda5299768af5f9e59eeea74647" dependencies = [ "cc", "libc", @@ -2092,9 +2096,9 @@ dependencies = [ [[package]] name = "log" -version = "0.4.21" +version = "0.4.22" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "90ed8c1e510134f979dbc4f070f87d4313098b704861a105fe34231c70a3901c" +checksum = "a7a70ba024b9dc04c27ea2f0c0548feb474ec5c54bba33a7f72f873a39d07b24" [[package]] name = "lzma-sys" @@ -2169,7 +2173,7 @@ dependencies = [ "log", "memchr", "once_cell", - "opener 0.7.1", + "opener 0.7.2", "pulldown-cmark 0.10.3", "regex", "serde", @@ -2226,9 +2230,9 @@ checksum = "6877bb514081ee2a7ff5ef9de3281f14a4dd4bceac4c09388074a6b5df8a139a" [[package]] name = "mime_guess" -version = "2.0.4" +version = "2.0.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4192263c238a5f0d0c6bfd21f336a313a4ce1c450542449ca191bb657b4642ef" +checksum = "f7c44f8e672c00fe5308fa235f821cb4198414e1c77935c1ab6948d3fd78550e" dependencies = [ "mime", "unicase", @@ -2301,11 +2305,11 @@ checksum = "650eef8c711430f1a879fdd01d4745a7deea475becfb90269c06775983bbf086" [[package]] name = "nix" -version = "0.28.0" +version = "0.29.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ab2156c4fce2f8df6c499cc1c763e4394b7482525bf2a9701c9d79d215f519e4" +checksum = "71e2746dc3a24dd78b3cfcb7be93368c6de9963d30f43a6a73998a9cf4b17b46" dependencies = [ - "bitflags 2.5.0", + "bitflags 2.6.0", "cfg-if", "cfg_aliases", "libc", @@ -2323,11 +2327,11 @@ dependencies = [ [[package]] name = "normpath" -version = "1.2.0" +version = "1.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5831952a9476f2fed74b77d74182fa5ddc4d21c72ec45a333b250e3ed0272804" +checksum = "c8911957c4b1549ac0dc74e30db9c8b0e66ddcd6d7acc33098f4c63a64a6d7ed" dependencies = [ - "windows-sys 0.52.0", + "windows-sys 0.59.0", ] [[package]] @@ -2342,11 +2346,11 @@ dependencies = [ [[package]] name = "nu-ansi-term" -version = "0.50.0" +version = "0.50.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dd2800e1520bdc966782168a627aa5d1ad92e33b984bf7c7615d31280c83ff14" +checksum = "d4a28e057d01f97e61255210fcff094d74ed0466038633e95017f5beb68e4399" dependencies = [ - "windows-sys 0.48.0", + "windows-sys 0.52.0", ] [[package]] @@ -2460,9 +2464,9 @@ dependencies = [ [[package]] name = "object" -version = "0.36.2" +version = "0.36.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3f203fa8daa7bb185f760ae12bd8e097f63d17041dcdcaf675ac54cdf863170e" +checksum = "27b64972346851a39438c60b341ebc01bba47464ae329e55cf343eb93964efd9" dependencies = [ "crc32fast", "flate2", @@ -2470,7 +2474,7 @@ dependencies = [ "indexmap", "memchr", "ruzstd 0.7.0", - "wasmparser 0.214.0", + "wasmparser", ] [[package]] @@ -2513,14 +2517,14 @@ dependencies = [ [[package]] name = "opener" -version = "0.7.1" +version = "0.7.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f8df34be653210fbe9ffaff41d3b92721c56ce82dfee58ee684f9afb5e3a90c0" +checksum = "d0812e5e4df08da354c851a3376fead46db31c2214f849d3de356d774d057681" dependencies = [ "bstr", "dbus", "normpath", - "windows-sys 0.52.0", + "windows-sys 0.59.0", ] [[package]] @@ -2531,9 +2535,9 @@ checksum = "ff011a302c396a5197692431fc1948019154afc178baf7d8e37367442a4601cf" [[package]] name = "openssl-sys" -version = "0.9.102" +version = "0.9.103" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c597637d56fbc83893a35eb0dd04b2b8e7a50c91e64e9493e398b5df4fb45fa2" +checksum = "7f9e8deee91df40a943c71b917e5874b951d32a802526c85721ce3b776c929d6" dependencies = [ "cc", "libc", @@ -2621,9 +2625,9 @@ checksum = "1e401f977ab385c9e4e3ab30627d6f26d00e2c73eef317493c4ec6d468726cf8" dependencies = [ "cfg-if", "libc", - "redox_syscall 0.5.2", + "redox_syscall", "smallvec", - "windows-targets 0.52.5", + "windows-targets 0.52.6", ] [[package]] @@ -2658,9 +2662,9 @@ dependencies = [ [[package]] name = "pest" -version = "2.7.10" +version = "2.7.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "560131c633294438da9f7c4b08189194b20946c8274c6b9e38881a7874dc8ee8" +checksum = "cd53dff83f26735fdc1ca837098ccf133605d794cdae66acfc2bfac3ec809d95" dependencies = [ "memchr", "thiserror", @@ -2669,9 +2673,9 @@ dependencies = [ [[package]] name = "pest_derive" -version = "2.7.10" +version = "2.7.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "26293c9193fbca7b1a3bf9b79dc1e388e927e6cacaa78b4a3ab705a1d3d41459" +checksum = "2a548d2beca6773b1c244554d36fcf8548a8a58e74156968211567250e48e49a" dependencies = [ "pest", "pest_generator", @@ -2679,22 +2683,22 @@ dependencies = [ [[package]] name = "pest_generator" -version = "2.7.10" +version = "2.7.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3ec22af7d3fb470a85dd2ca96b7c577a1eb4ef6f1683a9fe9a8c16e136c04687" +checksum = "3c93a82e8d145725dcbaf44e5ea887c8a869efdcc28706df2d08c69e17077183" dependencies = [ "pest", "pest_meta", "proc-macro2", "quote", - "syn 2.0.67", + "syn 2.0.75", ] [[package]] name = "pest_meta" -version = "2.7.10" +version = "2.7.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d7a240022f37c361ec1878d646fc5b7d7c4d28d5946e1a80ad5a7a4f4ca0bdcd" +checksum = "a941429fea7e08bedec25e4f6785b6ffaacc6b755da98df5ef3e7dcf4a124c4f" dependencies = [ "once_cell", "pest", @@ -2789,9 +2793,9 @@ dependencies = [ [[package]] name = "portable-atomic" -version = "1.6.0" +version = "1.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7170ef9988bc169ba16dd36a7fa041e5c4cbeb6a35b76d4c03daded371eae7c0" +checksum = "da544ee218f0d287a911e9c99a39a8c9bc8fcad3cb8db5959940044ecfc67265" [[package]] name = "powerfmt" @@ -2801,9 +2805,12 @@ checksum = "439ee305def115ba05938db6eb1644ff94165c5ab5e9420d1c1bcedbba909391" [[package]] name = "ppv-lite86" -version = "0.2.17" +version = "0.2.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5b40af805b3121feab8a3c29f04d8ad262fa8e0561883e7653e024ae4479e6de" +checksum = "77957b295656769bb8ad2b6a6b09d897d94f05c41b069aede1fcdaa675eaea04" +dependencies = [ + "zerocopy", +] [[package]] name = "precomputed-hash" @@ -2861,7 +2868,7 @@ version = "0.9.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "57206b407293d2bcd3af849ce869d52068623f19e1b5ff8e8778e3309439682b" dependencies = [ - "bitflags 2.5.0", + "bitflags 2.6.0", "memchr", "unicase", ] @@ -2872,7 +2879,7 @@ version = "0.10.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "76979bea66e7875e7509c4ec5300112b316af87fa7a252ca91c448b32dfe3993" dependencies = [ - "bitflags 2.5.0", + "bitflags 2.6.0", "memchr", "pulldown-cmark-escape 0.10.1", "unicase", @@ -2880,11 +2887,11 @@ dependencies = [ [[package]] name = "pulldown-cmark" -version = "0.11.0" +version = "0.11.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8746739f11d39ce5ad5c2520a9b75285310dbfe78c541ccf832d38615765aec0" +checksum = "cb4e75767fbc9d92b90e4d0c011f61358cde9513b31ef07ea3631b15ffc3b4fd" dependencies = [ - "bitflags 2.5.0", + "bitflags 2.6.0", "memchr", "pulldown-cmark-escape 0.11.0", "unicase", @@ -2984,20 +2991,11 @@ dependencies = [ [[package]] name = "redox_syscall" -version = "0.4.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4722d768eff46b75989dd134e5c353f0d6296e5aaa3132e776cbdb56be7731aa" -dependencies = [ - "bitflags 1.3.2", -] - -[[package]] -name = "redox_syscall" -version = "0.5.2" +version = "0.5.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c82cf8cff14456045f55ec4241383baeff27af886adb72ffb2162f99911de0fd" +checksum = "2a908a6e00f1fdd0dfd9c0eb08ce85126f6d8bbda50017e74bc4a4b7d4a926a4" dependencies = [ - "bitflags 2.5.0", + "bitflags 2.6.0", ] [[package]] @@ -3013,13 +3011,12 @@ dependencies = [ [[package]] name = "regex" -version = "1.9.4" +version = "1.8.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "12de2eff854e5fa4b1295edd650e227e9d8fb0c9e90b12e7f36d6a6811791a29" +checksum = "d0ab3ca65655bb1e41f2a8c8cd662eb4fb035e67c3f78da1d61dffe89d07300f" dependencies = [ "aho-corasick", "memchr", - "regex-automata 0.3.7", "regex-syntax 0.7.5", ] @@ -3043,14 +3040,9 @@ dependencies = [ [[package]] name = "regex-automata" -version = "0.3.7" +version = "0.3.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "49530408a136e16e5b486e883fbb6ba058e8e4e8ae6621a77b048b314336e629" -dependencies = [ - "aho-corasick", - "memchr", - "regex-syntax 0.7.5", -] +checksum = "59b23e92ee4318893fa3fe3e6fb365258efbfe6ac6ab30f090cdcbb7aa37efa9" [[package]] name = "regex-lite" @@ -3120,7 +3112,7 @@ dependencies = [ "quote", "rinja_parser", "serde", - "syn 2.0.67", + "syn 2.0.75", ] [[package]] @@ -3147,11 +3139,11 @@ dependencies = [ "bstr", "build_helper", "gimli 0.31.0", - "object 0.36.2", + "object 0.36.3", "regex", "serde_json", "similar", - "wasmparser 0.214.0", + "wasmparser", ] [[package]] @@ -3235,7 +3227,7 @@ checksum = "e5c9f15eec8235d7cb775ee6f81891db79b98fd54ba1ad8fae565b88ef1ae4e2" name = "rustc_abi" version = "0.0.0" dependencies = [ - "bitflags 2.5.0", + "bitflags 2.6.0", "rand", "rand_xoshiro", "rustc_data_structures", @@ -3247,9 +3239,9 @@ dependencies = [ [[package]] name = "rustc_apfloat" -version = "0.2.0+llvm-462a31f5a5ab" +version = "0.2.1+llvm-462a31f5a5ab" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "465187772033a5ee566f69fe008df03628fce549a0899aae76f0a0c2e34696be" +checksum = "886d94c63c812a8037c4faca2607453a0fa4cf82f734665266876b022244543f" dependencies = [ "bitflags 1.3.2", "smallvec", @@ -3266,7 +3258,7 @@ dependencies = [ name = "rustc_ast" version = "0.0.0" dependencies = [ - "bitflags 2.5.0", + "bitflags 2.6.0", "memchr", "rustc_ast_ir", "rustc_data_structures", @@ -3428,11 +3420,11 @@ dependencies = [ name = "rustc_codegen_llvm" version = "0.0.0" dependencies = [ - "bitflags 2.5.0", + "bitflags 2.6.0", "itertools", "libc", "measureme", - "object 0.36.2", + "object 0.36.3", "rustc-demangle", "rustc_ast", "rustc_attr", @@ -3465,13 +3457,13 @@ version = "0.0.0" dependencies = [ "ar_archive_writer", "arrayvec", - "bitflags 2.5.0", + "bitflags 2.6.0", "cc", "either", "itertools", "jobserver", "libc", - "object 0.36.2", + "object 0.36.3", "pathdiff", "regex", "rustc_arena", @@ -3501,7 +3493,7 @@ dependencies = [ "thin-vec", "thorin-dwp", "tracing", - "wasm-encoder 0.210.0", + "wasm-encoder", "windows 0.52.0", ] @@ -3535,7 +3527,7 @@ name = "rustc_data_structures" version = "0.0.0" dependencies = [ "arrayvec", - "bitflags 2.5.0", + "bitflags 2.6.0", "either", "elsa", "ena", @@ -3715,7 +3707,7 @@ dependencies = [ "fluent-syntax", "proc-macro2", "quote", - "syn 2.0.67", + "syn 2.0.75", "unic-langid", ] @@ -3849,7 +3841,7 @@ version = "0.0.0" dependencies = [ "proc-macro2", "quote", - "syn 2.0.67", + "syn 2.0.75", ] [[package]] @@ -3998,7 +3990,7 @@ version = "0.0.0" dependencies = [ "proc-macro2", "quote", - "syn 2.0.67", + "syn 2.0.75", "synstructure", ] @@ -4006,7 +3998,7 @@ dependencies = [ name = "rustc_metadata" version = "0.0.0" dependencies = [ - "bitflags 2.5.0", + "bitflags 2.6.0", "libloading", "odht", "rustc_ast", @@ -4036,7 +4028,7 @@ dependencies = [ name = "rustc_middle" version = "0.0.0" dependencies = [ - "bitflags 2.5.0", + "bitflags 2.6.0", "derive-where", "either", "field-offset", @@ -4167,7 +4159,7 @@ dependencies = [ name = "rustc_next_trait_solver" version = "0.0.0" dependencies = [ - "bitflags 2.5.0", + "bitflags 2.6.0", "derive-where", "rustc_ast_ir", "rustc_data_structures", @@ -4183,7 +4175,7 @@ dependencies = [ name = "rustc_parse" version = "0.0.0" dependencies = [ - "bitflags 2.5.0", + "bitflags 2.6.0", "rustc_ast", "rustc_ast_pretty", "rustc_data_structures", @@ -4321,8 +4313,8 @@ dependencies = [ name = "rustc_resolve" version = "0.0.0" dependencies = [ - "bitflags 2.5.0", - "pulldown-cmark 0.11.0", + "bitflags 2.6.0", + "pulldown-cmark 0.11.2", "rustc_arena", "rustc_ast", "rustc_ast_pretty", @@ -4349,7 +4341,7 @@ dependencies = [ name = "rustc_sanitizers" version = "0.0.0" dependencies = [ - "bitflags 2.5.0", + "bitflags 2.6.0", "rustc_data_structures", "rustc_hir", "rustc_middle", @@ -4375,7 +4367,7 @@ dependencies = [ name = "rustc_session" version = "0.0.0" dependencies = [ - "bitflags 2.5.0", + "bitflags 2.6.0", "getopts", "libc", "rustc_ast", @@ -4454,8 +4446,8 @@ dependencies = [ name = "rustc_target" version = "0.0.0" dependencies = [ - "bitflags 2.5.0", - "object 0.36.2", + "bitflags 2.6.0", + "object 0.36.3", "rustc_abi", "rustc_data_structures", "rustc_feature", @@ -4557,7 +4549,7 @@ dependencies = [ name = "rustc_type_ir" version = "0.0.0" dependencies = [ - "bitflags 2.5.0", + "bitflags 2.6.0", "derive-where", "indexmap", "rustc_ast_ir", @@ -4577,7 +4569,7 @@ version = "0.0.0" dependencies = [ "proc-macro2", "quote", - "syn 2.0.67", + "syn 2.0.75", "synstructure", ] @@ -4677,7 +4669,7 @@ dependencies = [ "proc-macro2", "quote", "serde", - "syn 2.0.67", + "syn 2.0.75", ] [[package]] @@ -4715,7 +4707,7 @@ version = "0.38.34" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "70dc5ec042f7a43c4a73241207cecc9873a06d45debb38b329f8541d85c2730f" dependencies = [ - "bitflags 2.5.0", + "bitflags 2.6.0", "errno", "libc", "linux-raw-sys", @@ -4811,41 +4803,42 @@ dependencies = [ [[package]] name = "serde" -version = "1.0.203" +version = "1.0.208" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7253ab4de971e72fb7be983802300c30b5a7f0c2e56fab8abfc6a214307c0094" +checksum = "cff085d2cb684faa248efb494c39b68e522822ac0de72ccf08109abde717cfb2" dependencies = [ "serde_derive", ] [[package]] name = "serde_derive" -version = "1.0.203" +version = "1.0.208" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "500cbc0ebeb6f46627f50f3f5811ccf6bf00643be300b4c3eabc0ef55dc5b5ba" +checksum = "24008e81ff7613ed8e5ba0cfaf24e2c2f1e5b8a0495711e44fcd4882fca62bcf" dependencies = [ "proc-macro2", "quote", - "syn 2.0.67", + "syn 2.0.75", ] [[package]] name = "serde_json" -version = "1.0.117" +version = "1.0.125" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "455182ea6142b14f93f4bc5320a2b31c1f266b66a4a5c858b013302a5d8cbfc3" +checksum = "83c8e735a073ccf5be70aa8066aa984eaf2fa000db6c8d0100ae605b366d31ed" dependencies = [ "indexmap", "itoa", + "memchr", "ryu", "serde", ] [[package]] name = "serde_spanned" -version = "0.6.6" +version = "0.6.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "79e674e01f999af37c49f70a6ede167a8a60b2503e56c5599532a65baa5969a0" +checksum = "eb5b1b31579f3811bf615c144393417496f152e12ac8b7663bf664f4a815306d" dependencies = [ "serde", ] @@ -4895,9 +4888,9 @@ checksum = "0fda2ff0d084019ba4d7c6f371c95d8fd75ce3524c3cb8fb653a3023f6323e64" [[package]] name = "similar" -version = "2.5.0" +version = "2.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fa42c91313f1d05da9b26f267f931cf178d4aba455b4c4622dd7355eb80c6640" +checksum = "1de1d4f81173b03af4c0cbed3c898f6bff5b870e4a7f5d6f4057d62a7a4b686e" [[package]] name = "siphasher" @@ -5089,9 +5082,9 @@ dependencies = [ [[package]] name = "syn" -version = "2.0.67" +version = "2.0.75" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ff8655ed1d86f3af4ee3fd3263786bc14245ad17c4c7e85ba7187fb3ae028c90" +checksum = "f6af063034fc1935ede7be0122941bafa9bacb949334d090b77ca98b5817c7d9" dependencies = [ "proc-macro2", "quote", @@ -5106,7 +5099,7 @@ checksum = "c8af7666ab7b6390ab78131fb5b0fce11d6b7a6951602017c35fa82800708971" dependencies = [ "proc-macro2", "quote", - "syn 2.0.67", + "syn 2.0.75", ] [[package]] @@ -5143,14 +5136,15 @@ dependencies = [ [[package]] name = "tempfile" -version = "3.10.1" +version = "3.12.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "85b77fafb263dd9d05cbeac119526425676db3784113aa9295c88498cbf8bff1" +checksum = "04cbcdd0c794ebb0d4cf35e88edd2f7d2c4c3e9a5a6dab322839b321c6a87a64" dependencies = [ "cfg-if", "fastrand", + "once_cell", "rustix", - "windows-sys 0.52.0", + "windows-sys 0.59.0", ] [[package]] @@ -5223,22 +5217,22 @@ checksum = "a38c90d48152c236a3ab59271da4f4ae63d678c5d7ad6b7714d7cb9760be5e4b" [[package]] name = "thiserror" -version = "1.0.61" +version = "1.0.63" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c546c80d6be4bc6a00c0f01730c08df82eaa7a7a61f11d656526506112cc1709" +checksum = "c0342370b38b6a11b6cc11d6a805569958d54cfa061a29969c3b5ce2ea405724" dependencies = [ "thiserror-impl", ] [[package]] name = "thiserror-impl" -version = "1.0.61" +version = "1.0.63" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "46c3384250002a6d5af4d114f2845d37b57521033f30d5c3f46c4d70e1197533" +checksum = "a4558b58466b9ad7ca0f102865eccc95938dca1a74a856f2b57b6629050da261" dependencies = [ "proc-macro2", "quote", - "syn 2.0.67", + "syn 2.0.75", ] [[package]] @@ -5336,9 +5330,9 @@ dependencies = [ [[package]] name = "tinyvec" -version = "1.6.0" +version = "1.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "87cc5ceb3875bb20c2890005a4e226a4651264a5c75edb2421b52861a0a0cb50" +checksum = "445e881f4f6d382d5f27c034e25eb92edd7c784ceab92a0937db7f2e9471b938" dependencies = [ "tinyvec_macros", ] @@ -5351,9 +5345,9 @@ checksum = "1f3ccbac311fea05f86f61904b462b55fb3df8837a366dfc601a0161d0532f20" [[package]] name = "tokio" -version = "1.38.0" +version = "1.39.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ba4f4a02a7a80d6f274636f0aa95c7e383b912d41fe721a31f29e29698585a4a" +checksum = "9babc99b9923bfa4804bd74722ff02c0381021eafa4db9949217e3be8e84fff5" dependencies = [ "backtrace", "bytes", @@ -5383,9 +5377,9 @@ dependencies = [ [[package]] name = "toml_datetime" -version = "0.6.6" +version = "0.6.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4badfd56924ae69bcc9039335b2e017639ce3f9b001c393c1b2d1ef846ce2cbf" +checksum = "0dd7358ecb8fc2f8d014bf86f6f638ce72ba252a2c3a2572f2a795f1d23efb41" dependencies = [ "serde", ] @@ -5429,7 +5423,7 @@ checksum = "34704c8d6ebcbc939824180af020566b01a7c01f80641264eba0999f6c2b6be7" dependencies = [ "proc-macro2", "quote", - "syn 2.0.67", + "syn 2.0.75", ] [[package]] @@ -5488,7 +5482,7 @@ version = "0.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b56c62d2c80033cb36fae448730a2f2ef99410fe3ecbffc916681a32f6807dbe" dependencies = [ - "nu-ansi-term 0.50.0", + "nu-ansi-term 0.50.1", "tracing-core", "tracing-log", "tracing-subscriber", @@ -5628,7 +5622,7 @@ checksum = "1ed7f4237ba393424195053097c1516bd4590dc82b84f2f97c5c69e12704555b" dependencies = [ "proc-macro-hack", "quote", - "syn 2.0.67", + "syn 2.0.75", "unic-langid-impl", ] @@ -5757,9 +5751,9 @@ checksum = "06abde3611657adf66d383f00b093d7faecc7fa57071cce2578660c9f1010821" [[package]] name = "uuid" -version = "1.8.0" +version = "1.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a183cf7feeba97b4dd1c0d46788634f6221d87fa961b305bed08c851829efcc0" +checksum = "81dfa00651efa65069b0b6b651f4aaa31ba9e3c3ce0137aaad053604ee7e0314" dependencies = [ "getrandom", ] @@ -5778,9 +5772,9 @@ checksum = "accd4ea62f7bb7a82fe23066fb0957d48ef677f6eeb8215f372f52e48bb32426" [[package]] name = "version_check" -version = "0.9.4" +version = "0.9.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "49874b5167b65d7193b8aba1567f5c7d93d001cafc34600cee003eda787e483f" +checksum = "0b928f33d975fc6ad9f86c8f283853ad26bdd5b10b7f1542aa2fa15e2289105a" [[package]] name = "walkdir" @@ -5799,35 +5793,42 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" [[package]] +name = "wasi-preview1-component-adapter-provider" +version = "23.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f91d3d13afef569b9fc80cfbb807c87c16ef49bd3ac1a93285ea6a264b600d2d" + +[[package]] name = "wasm-bindgen" -version = "0.2.92" +version = "0.2.93" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4be2531df63900aeb2bca0daaaddec08491ee64ceecbee5076636a3b026795a8" +checksum = "a82edfc16a6c469f5f44dc7b571814045d60404b55a0ee849f9bcfa2e63dd9b5" dependencies = [ "cfg-if", + "once_cell", "wasm-bindgen-macro", ] [[package]] name = "wasm-bindgen-backend" -version = "0.2.92" +version = "0.2.93" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "614d787b966d3989fa7bb98a654e369c762374fd3213d212cfc0251257e747da" +checksum = "9de396da306523044d3302746f1208fa71d7532227f15e347e2d93e4145dd77b" dependencies = [ "bumpalo", "log", "once_cell", "proc-macro2", "quote", - "syn 2.0.67", + "syn 2.0.75", "wasm-bindgen-shared", ] [[package]] name = "wasm-bindgen-macro" -version = "0.2.92" +version = "0.2.93" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a1f8823de937b71b9460c0c34e25f3da88250760bec0ebac694b49997550d726" +checksum = "585c4c91a46b072c92e908d99cb1dcdf95c5218eeb6f3bf1efa991ee7a68cccf" dependencies = [ "quote", "wasm-bindgen-macro-support", @@ -5835,36 +5836,38 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro-support" -version = "0.2.92" +version = "0.2.93" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e94f17b526d0a461a191c78ea52bbce64071ed5c04c9ffe424dcb38f74171bb7" +checksum = "afc340c74d9005395cf9dd098506f7f44e38f2b4a21c6aaacf9a105ea5e1e836" dependencies = [ "proc-macro2", "quote", - "syn 2.0.67", + "syn 2.0.75", "wasm-bindgen-backend", "wasm-bindgen-shared", ] [[package]] name = "wasm-bindgen-shared" -version = "0.2.92" +version = "0.2.93" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "af190c94f2773fdb3729c55b007a722abb5384da03bc0986df4c289bf5567e96" +checksum = "c62a0a307cb4a311d3a07867860911ca130c3494e8c2719593806c08bc5d0484" [[package]] name = "wasm-component-ld" -version = "0.5.4" +version = "0.5.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "314d932d5e84c9678751b85498b1482b2f32f185744e449d3ce0b1d400376dad" +checksum = "51449c63d1ce69f92b8465a084ed5b91f1a7eb583fa95796650a6bfcffc4f9cb" dependencies = [ "anyhow", "clap", "lexopt", "tempfile", - "wasmparser 0.210.0", + "wasi-preview1-component-adapter-provider", + "wasmparser", "wat", "wit-component", + "wit-parser", ] [[package]] @@ -5876,27 +5879,19 @@ dependencies = [ [[package]] name = "wasm-encoder" -version = "0.210.0" +version = "0.215.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e7e3764d9d6edabd8c9e16195e177be0d20f6ab942ad18af52860f12f82bc59a" -dependencies = [ - "leb128", -] - -[[package]] -name = "wasm-encoder" -version = "0.211.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5e7d931a1120ef357f32b74547646b6fa68ea25e377772b72874b131a9ed70d4" +checksum = "4fb56df3e06b8e6b77e37d2969a50ba51281029a9aeb3855e76b7f49b6418847" dependencies = [ "leb128", + "wasmparser", ] [[package]] name = "wasm-metadata" -version = "0.210.0" +version = "0.215.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "012729d1294907fcb0866f08460ab95426a6d0b176a599619b84cac7653452b4" +checksum = "0c6bb07c5576b608f7a2a9baa2294c1a3584a249965d695a9814a496cb6d232f" dependencies = [ "anyhow", "indexmap", @@ -5904,18 +5899,18 @@ dependencies = [ "serde_derive", "serde_json", "spdx", - "wasm-encoder 0.210.0", - "wasmparser 0.210.0", + "wasm-encoder", + "wasmparser", ] [[package]] name = "wasmparser" -version = "0.210.0" +version = "0.215.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a7bbcd21e7581619d9f6ca00f8c4f08f1cacfe58bf63f83af57cd0476f1026f5" +checksum = "53fbde0881f24199b81cf49b6ff8f9c145ac8eb1b7fc439adb5c099734f7d90e" dependencies = [ "ahash", - "bitflags 2.5.0", + "bitflags 2.6.0", "hashbrown", "indexmap", "semver", @@ -5923,33 +5918,23 @@ dependencies = [ ] [[package]] -name = "wasmparser" -version = "0.214.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5309c1090e3e84dad0d382f42064e9933fdaedb87e468cc239f0eabea73ddcb6" -dependencies = [ - "bitflags 2.5.0", - "indexmap", -] - -[[package]] name = "wast" -version = "211.0.1" +version = "215.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b25506dd82d00da6b14a87436b3d52b1d264083fa79cdb72a0d1b04a8595ccaa" +checksum = "1ff1d00d893593249e60720be04a7c1f42f1c4dc3806a2869f4e66ab61eb54cb" dependencies = [ "bumpalo", "leb128", "memchr", "unicode-width", - "wasm-encoder 0.211.1", + "wasm-encoder", ] [[package]] name = "wat" -version = "1.211.1" +version = "1.215.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eb716ca6c86eecac2d82541ffc39860118fc0af9309c4f2670637bea2e1bdd7d" +checksum = "670bf4d9c8cf76ae242d70ded47c546525b6dafaa6871f9bcb065344bf2b4e3d" dependencies = [ "wast", ] @@ -5972,11 +5957,11 @@ checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" [[package]] name = "winapi-util" -version = "0.1.8" +version = "0.1.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4d4cc384e1e73b93bafa6fb4f1df8c41695c8a91cf9c4c64358067d15a7b6c6b" +checksum = "cf221c93e13a30d793f7645a0e7762c55d169dbb0a49671918a2319d289b10bb" dependencies = [ - "windows-sys 0.52.0", + "windows-sys 0.59.0", ] [[package]] @@ -5992,7 +5977,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e48a53791691ab099e5e2ad123536d0fff50652600abaf43bbf952894110d0be" dependencies = [ "windows-core 0.52.0", - "windows-targets 0.52.5", + "windows-targets 0.52.6", ] [[package]] @@ -6002,7 +5987,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "12342cb4d8e3b046f3d80effd474a7a02447231330ef77d71daa6fbc40681143" dependencies = [ "windows-core 0.57.0", - "windows-targets 0.52.5", + "windows-targets 0.52.6", ] [[package]] @@ -6015,7 +6000,7 @@ dependencies = [ "rayon", "serde", "serde_json", - "syn 2.0.67", + "syn 2.0.75", "windows-metadata", ] @@ -6025,7 +6010,7 @@ version = "0.52.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "33ab640c8d7e35bf8ba19b884ba838ceb4fba93a4e8c65a9059d08afcfc683d9" dependencies = [ - "windows-targets 0.52.5", + "windows-targets 0.52.6", ] [[package]] @@ -6037,7 +6022,7 @@ dependencies = [ "windows-implement", "windows-interface", "windows-result", - "windows-targets 0.52.5", + "windows-targets 0.52.6", ] [[package]] @@ -6048,7 +6033,7 @@ checksum = "9107ddc059d5b6fbfbffdfa7a7fe3e22a226def0b2608f72e9d552763d3e1ad7" dependencies = [ "proc-macro2", "quote", - "syn 2.0.67", + "syn 2.0.75", ] [[package]] @@ -6059,7 +6044,7 @@ checksum = "29bee4b38ea3cde66011baa44dba677c432a78593e202392d1e9070cf2a7fca7" dependencies = [ "proc-macro2", "quote", - "syn 2.0.67", + "syn 2.0.75", ] [[package]] @@ -6074,7 +6059,7 @@ version = "0.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5e383302e8ec8515204254685643de10811af0ed97ea37210dc26fb0032647f8" dependencies = [ - "windows-targets 0.52.5", + "windows-targets 0.52.6", ] [[package]] @@ -6092,7 +6077,16 @@ version = "0.52.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "282be5f36a8ce781fad8c8ae18fa3f9beff57ec1b52cb3de0789201425d9a33d" dependencies = [ - "windows-targets 0.52.5", + "windows-targets 0.52.6", +] + +[[package]] +name = "windows-sys" +version = "0.59.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1e38bc4d79ed67fd075bcc251a1c39b32a1776bbe92e5bef1f0bf1f8c531853b" +dependencies = [ + "windows-targets 0.52.6", ] [[package]] @@ -6112,18 +6106,18 @@ dependencies = [ [[package]] name = "windows-targets" -version = "0.52.5" +version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6f0713a46559409d202e70e28227288446bf7841d3211583a4b53e3f6d96e7eb" +checksum = "9b724f72796e036ab90c1021d4780d4d3d648aca59e491e6b98e725b84e99973" dependencies = [ - "windows_aarch64_gnullvm 0.52.5", - "windows_aarch64_msvc 0.52.5", - "windows_i686_gnu 0.52.5", + "windows_aarch64_gnullvm 0.52.6", + "windows_aarch64_msvc 0.52.6", + "windows_i686_gnu 0.52.6", "windows_i686_gnullvm", - "windows_i686_msvc 0.52.5", - "windows_x86_64_gnu 0.52.5", - "windows_x86_64_gnullvm 0.52.5", - "windows_x86_64_msvc 0.52.5", + "windows_i686_msvc 0.52.6", + "windows_x86_64_gnu 0.52.6", + "windows_x86_64_gnullvm 0.52.6", + "windows_x86_64_msvc 0.52.6", ] [[package]] @@ -6134,9 +6128,9 @@ checksum = "2b38e32f0abccf9987a4e3079dfb67dcd799fb61361e53e2882c3cbaf0d905d8" [[package]] name = "windows_aarch64_gnullvm" -version = "0.52.5" +version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7088eed71e8b8dda258ecc8bac5fb1153c5cffaf2578fc8ff5d61e23578d3263" +checksum = "32a4622180e7a0ec044bb555404c800bc9fd9ec262ec147edd5989ccd0c02cd3" [[package]] name = "windows_aarch64_msvc" @@ -6146,9 +6140,9 @@ checksum = "dc35310971f3b2dbbf3f0690a219f40e2d9afcf64f9ab7cc1be722937c26b4bc" [[package]] name = "windows_aarch64_msvc" -version = "0.52.5" +version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9985fd1504e250c615ca5f281c3f7a6da76213ebd5ccc9561496568a2752afb6" +checksum = "09ec2a7bb152e2252b53fa7803150007879548bc709c039df7627cabbd05d469" [[package]] name = "windows_i686_gnu" @@ -6158,15 +6152,15 @@ checksum = "a75915e7def60c94dcef72200b9a8e58e5091744960da64ec734a6c6e9b3743e" [[package]] name = "windows_i686_gnu" -version = "0.52.5" +version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "88ba073cf16d5372720ec942a8ccbf61626074c6d4dd2e745299726ce8b89670" +checksum = "8e9b5ad5ab802e97eb8e295ac6720e509ee4c243f69d781394014ebfe8bbfa0b" [[package]] name = "windows_i686_gnullvm" -version = "0.52.5" +version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "87f4261229030a858f36b459e748ae97545d6f1ec60e5e0d6a3d32e0dc232ee9" +checksum = "0eee52d38c090b3caa76c563b86c3a4bd71ef1a819287c19d586d7334ae8ed66" [[package]] name = "windows_i686_msvc" @@ -6176,9 +6170,9 @@ checksum = "8f55c233f70c4b27f66c523580f78f1004e8b5a8b659e05a4eb49d4166cca406" [[package]] name = "windows_i686_msvc" -version = "0.52.5" +version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "db3c2bf3d13d5b658be73463284eaf12830ac9a26a90c717b7f771dfe97487bf" +checksum = "240948bc05c5e7c6dabba28bf89d89ffce3e303022809e73deaefe4f6ec56c66" [[package]] name = "windows_x86_64_gnu" @@ -6188,9 +6182,9 @@ checksum = "53d40abd2583d23e4718fddf1ebec84dbff8381c07cae67ff7768bbf19c6718e" [[package]] name = "windows_x86_64_gnu" -version = "0.52.5" +version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4e4246f76bdeff09eb48875a0fd3e2af6aada79d409d33011886d3e1581517d9" +checksum = "147a5c80aabfbf0c7d901cb5895d1de30ef2907eb21fbbab29ca94c5b08b1a78" [[package]] name = "windows_x86_64_gnullvm" @@ -6200,9 +6194,9 @@ checksum = "0b7b52767868a23d5bab768e390dc5f5c55825b6d30b86c844ff2dc7414044cc" [[package]] name = "windows_x86_64_gnullvm" -version = "0.52.5" +version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "852298e482cd67c356ddd9570386e2862b5673c85bd5f88df9ab6802b334c596" +checksum = "24d5b23dc417412679681396f2b49f3de8c1473deb516bd34410872eff51ed0d" [[package]] name = "windows_x86_64_msvc" @@ -6212,9 +6206,9 @@ checksum = "ed94fce61571a4006852b7389a063ab983c02eb1bb37b47f8272ce92d06d9538" [[package]] name = "windows_x86_64_msvc" -version = "0.52.5" +version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bec47e5bfd1bff0eeaf6d8b485cc1074891a197ab4225d504cb7a1ab88b02bf0" +checksum = "589f6da84c646204747d1270a2a5661ea66ed1cced2631d546fdfb155959f9ec" [[package]] name = "winnow" @@ -6227,28 +6221,28 @@ dependencies = [ [[package]] name = "wit-component" -version = "0.210.0" +version = "0.215.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a450bdb5d032acf1fa0865451fa0c6f50e62f2d31eaa8dba967c2e2d068694a4" +checksum = "f725e3885fc5890648be5c5cbc1353b755dc932aa5f1aa7de968b912a3280743" dependencies = [ "anyhow", - "bitflags 2.5.0", + "bitflags 2.6.0", "indexmap", "log", "serde", "serde_derive", "serde_json", - "wasm-encoder 0.210.0", + "wasm-encoder", "wasm-metadata", - "wasmparser 0.210.0", + "wasmparser", "wit-parser", ] [[package]] name = "wit-parser" -version = "0.210.0" +version = "0.215.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "60a965cbd439af19a4b44a54a97ab8957d86f02d01320efc9e31c1d3605c6710" +checksum = "935a97eaffd57c3b413aa510f8f0b550a4a9fe7d59e79cd8b89a83dcb860321f" dependencies = [ "anyhow", "id-arena", @@ -6259,7 +6253,7 @@ dependencies = [ "serde_derive", "serde_json", "unicode-xid", - "wasmparser 0.210.0", + "wasmparser", ] [[package]] @@ -6317,28 +6311,29 @@ checksum = "28cc31741b18cb6f1d5ff12f5b7523e3d6eb0852bbbad19d73905511d9849b95" dependencies = [ "proc-macro2", "quote", - "syn 2.0.67", + "syn 2.0.75", "synstructure", ] [[package]] name = "zerocopy" -version = "0.7.34" +version = "0.7.35" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ae87e3fcd617500e5d106f0380cf7b77f3c6092aae37191433159dda23cfb087" +checksum = "1b9b4fd18abc82b8136838da5d50bae7bdea537c574d8dc1a34ed098d6c166f0" dependencies = [ + "byteorder", "zerocopy-derive", ] [[package]] name = "zerocopy-derive" -version = "0.7.34" +version = "0.7.35" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "15e934569e47891f7d9411f1a451d947a60e000ab3bd24fbb970f000387d1b3b" +checksum = "fa4f8080344d4671fb4e831a13ad1e68092748387dfc4f55e356242fae12ce3e" dependencies = [ "proc-macro2", "quote", - "syn 2.0.67", + "syn 2.0.75", ] [[package]] @@ -6358,15 +6353,15 @@ checksum = "0ea7b4a3637ea8669cedf0f1fd5c286a17f3de97b8dd5a70a6c167a1730e63a5" dependencies = [ "proc-macro2", "quote", - "syn 2.0.67", + "syn 2.0.75", "synstructure", ] [[package]] name = "zerovec" -version = "0.10.2" +version = "0.10.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bb2cc8827d6c0994478a15c53f374f46fbd41bea663d809b14744bc42e6b109c" +checksum = "aa2b893d79df23bfb12d5461018d408ea19dfafe76c2c7ef6d4eba614f8ff079" dependencies = [ "yoke", "zerofrom", @@ -6375,11 +6370,11 @@ dependencies = [ [[package]] name = "zerovec-derive" -version = "0.10.2" +version = "0.10.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "97cf56601ee5052b4417d90c8755c6683473c926039908196cf35d99f893ebe7" +checksum = "6eafa6dfb17584ea3e2bd6e76e0cc15ad7af12b09abdd1ca55961bed9b1063c6" dependencies = [ "proc-macro2", "quote", - "syn 2.0.67", + "syn 2.0.75", ] diff --git a/Cargo.toml b/Cargo.toml index 131feec70ab..d4b84250fc4 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,5 +1,5 @@ [workspace] -resolver = "1" +resolver = "2" members = [ "compiler/rustc", "src/etc/test-float-parse", diff --git a/compiler/rustc_ast_lowering/src/delegation.rs b/compiler/rustc_ast_lowering/src/delegation.rs index 300bfa101c6..9c073130827 100644 --- a/compiler/rustc_ast_lowering/src/delegation.rs +++ b/compiler/rustc_ast_lowering/src/delegation.rs @@ -189,7 +189,7 @@ impl<'hir> LoweringContext<'_, 'hir> { ) -> hir::FnSig<'hir> { let header = if let Some(local_sig_id) = sig_id.as_local() { match self.resolver.delegation_fn_sigs.get(&local_sig_id) { - Some(sig) => self.lower_fn_header(sig.header), + Some(sig) => self.lower_fn_header(sig.header, hir::Safety::Safe), None => self.generate_header_error(), } } else { diff --git a/compiler/rustc_ast_lowering/src/item.rs b/compiler/rustc_ast_lowering/src/item.rs index 7af3945d3f9..f6065259d8d 100644 --- a/compiler/rustc_ast_lowering/src/item.rs +++ b/compiler/rustc_ast_lowering/src/item.rs @@ -237,7 +237,7 @@ impl<'hir> LoweringContext<'_, 'hir> { }); let sig = hir::FnSig { decl, - header: this.lower_fn_header(*header), + header: this.lower_fn_header(*header, hir::Safety::Safe), span: this.lower_span(*fn_sig_span), }; hir::ItemKind::Fn(sig, generics, body_id) @@ -668,7 +668,7 @@ impl<'hir> LoweringContext<'_, 'hir> { ForeignItemKind::Fn(box Fn { sig, generics, .. }) => { let fdec = &sig.decl; let itctx = ImplTraitContext::Universal; - let (generics, (fn_dec, fn_args)) = + let (generics, (decl, fn_args)) = self.lower_generics(generics, Const::No, false, i.id, itctx, |this| { ( // Disallow `impl Trait` in foreign items. @@ -682,9 +682,15 @@ impl<'hir> LoweringContext<'_, 'hir> { this.lower_fn_params_to_names(fdec), ) }); - let safety = self.lower_safety(sig.header.safety, hir::Safety::Unsafe); - hir::ForeignItemKind::Fn(fn_dec, fn_args, generics, safety) + // Unmarked safety in unsafe block defaults to unsafe. + let header = self.lower_fn_header(sig.header, hir::Safety::Unsafe); + + hir::ForeignItemKind::Fn( + hir::FnSig { header, decl, span: self.lower_span(sig.span) }, + fn_args, + generics, + ) } ForeignItemKind::Static(box StaticItem { ty, mutability, expr: _, safety }) => { let ty = self @@ -1390,7 +1396,7 @@ impl<'hir> LoweringContext<'_, 'hir> { coroutine_kind: Option<CoroutineKind>, parent_constness: Const, ) -> (&'hir hir::Generics<'hir>, hir::FnSig<'hir>) { - let header = self.lower_fn_header(sig.header); + let header = self.lower_fn_header(sig.header, hir::Safety::Safe); // Don't pass along the user-provided constness of trait associated functions; we don't want to // synthesize a host effect param for them. We reject `const` on them during AST validation. let constness = @@ -1403,14 +1409,18 @@ impl<'hir> LoweringContext<'_, 'hir> { (generics, hir::FnSig { header, decl, span: self.lower_span(sig.span) }) } - pub(super) fn lower_fn_header(&mut self, h: FnHeader) -> hir::FnHeader { + pub(super) fn lower_fn_header( + &mut self, + h: FnHeader, + default_safety: hir::Safety, + ) -> hir::FnHeader { let asyncness = if let Some(CoroutineKind::Async { span, .. }) = h.coroutine_kind { hir::IsAsync::Async(span) } else { hir::IsAsync::NotAsync }; hir::FnHeader { - safety: self.lower_safety(h.safety, hir::Safety::Safe), + safety: self.lower_safety(h.safety, default_safety), asyncness: asyncness, constness: self.lower_constness(h.constness), abi: self.lower_extern(h.ext), diff --git a/compiler/rustc_ast_passes/src/ast_validation.rs b/compiler/rustc_ast_passes/src/ast_validation.rs index a353c79f12d..837cb805700 100644 --- a/compiler/rustc_ast_passes/src/ast_validation.rs +++ b/compiler/rustc_ast_passes/src/ast_validation.rs @@ -887,7 +887,7 @@ fn validate_generic_param_order(dcx: DiagCtxtHandle<'_>, generics: &[GenericPara impl<'a> Visitor<'a> for AstValidator<'a> { fn visit_attribute(&mut self, attr: &Attribute) { - validate_attr::check_attr(&self.features, &self.session.psess, attr); + validate_attr::check_attr(&self.session.psess, attr); } fn visit_ty(&mut self, ty: &'a Ty) { diff --git a/compiler/rustc_ast_passes/src/feature_gate.rs b/compiler/rustc_ast_passes/src/feature_gate.rs index 3ceb8e0711a..5ab99fbac86 100644 --- a/compiler/rustc_ast_passes/src/feature_gate.rs +++ b/compiler/rustc_ast_passes/src/feature_gate.rs @@ -539,7 +539,6 @@ pub fn check_crate(krate: &ast::Crate, sess: &Session, features: &Features) { } } gate_all!(gen_blocks, "gen blocks are experimental"); - gate_all!(raw_ref_op, "raw address of syntax is experimental"); gate_all!(const_trait_impl, "const trait impls are experimental"); gate_all!( half_open_range_patterns_in_slices, @@ -559,7 +558,6 @@ pub fn check_crate(krate: &ast::Crate, sess: &Session, features: &Features) { gate_all!(mut_ref, "mutable by-reference bindings are experimental"); gate_all!(precise_capturing, "precise captures on `impl Trait` are experimental"); gate_all!(global_registration, "global registration is experimental"); - gate_all!(unsafe_attributes, "`#[unsafe()]` markers for attributes are experimental"); gate_all!(return_type_notation, "return type notation is experimental"); if !visitor.features.never_patterns { diff --git a/compiler/rustc_borrowck/src/def_use.rs b/compiler/rustc_borrowck/src/def_use.rs index 1f0b0981c8f..e07d7dd309a 100644 --- a/compiler/rustc_borrowck/src/def_use.rs +++ b/compiler/rustc_borrowck/src/def_use.rs @@ -55,8 +55,8 @@ pub fn categorize(context: PlaceContext) -> Option<DefUse> { PlaceContext::NonMutatingUse(NonMutatingUseContext::PlaceMention) | PlaceContext::NonUse(NonUseContext::AscribeUserTy(_)) | - PlaceContext::MutatingUse(MutatingUseContext::AddressOf) | - PlaceContext::NonMutatingUse(NonMutatingUseContext::AddressOf) | + PlaceContext::MutatingUse(MutatingUseContext::RawBorrow) | + PlaceContext::NonMutatingUse(NonMutatingUseContext::RawBorrow) | PlaceContext::NonMutatingUse(NonMutatingUseContext::Inspect) | PlaceContext::NonMutatingUse(NonMutatingUseContext::Copy) | PlaceContext::NonMutatingUse(NonMutatingUseContext::Move) | diff --git a/compiler/rustc_borrowck/src/lib.rs b/compiler/rustc_borrowck/src/lib.rs index 30dd45d847c..a529df76bcb 100644 --- a/compiler/rustc_borrowck/src/lib.rs +++ b/compiler/rustc_borrowck/src/lib.rs @@ -1242,7 +1242,7 @@ impl<'mir, 'tcx> MirBorrowckCtxt<'_, 'mir, '_, 'tcx> { ); } - &Rvalue::AddressOf(mutability, place) => { + &Rvalue::RawPtr(mutability, place) => { let access_kind = match mutability { Mutability::Mut => ( Deep, diff --git a/compiler/rustc_borrowck/src/polonius/loan_invalidations.rs b/compiler/rustc_borrowck/src/polonius/loan_invalidations.rs index f090da031a0..a57041cd04c 100644 --- a/compiler/rustc_borrowck/src/polonius/loan_invalidations.rs +++ b/compiler/rustc_borrowck/src/polonius/loan_invalidations.rs @@ -269,7 +269,7 @@ impl<'cx, 'tcx> LoanInvalidationsGenerator<'cx, 'tcx> { self.access_place(location, place, access_kind, LocalMutationIsAllowed::No); } - &Rvalue::AddressOf(mutability, place) => { + &Rvalue::RawPtr(mutability, place) => { let access_kind = match mutability { Mutability::Mut => ( Deep, diff --git a/compiler/rustc_borrowck/src/type_check/mod.rs b/compiler/rustc_borrowck/src/type_check/mod.rs index a2669da1b04..6983cda6ddf 100644 --- a/compiler/rustc_borrowck/src/type_check/mod.rs +++ b/compiler/rustc_borrowck/src/type_check/mod.rs @@ -756,7 +756,7 @@ impl<'a, 'b, 'tcx> TypeVerifier<'a, 'b, 'tcx> { PlaceContext::MutatingUse(_) => ty::Invariant, PlaceContext::NonUse(StorageDead | StorageLive | VarDebugInfo) => ty::Invariant, PlaceContext::NonMutatingUse( - Inspect | Copy | Move | PlaceMention | SharedBorrow | FakeBorrow | AddressOf + Inspect | Copy | Move | PlaceMention | SharedBorrow | FakeBorrow | RawBorrow | Projection, ) => ty::Covariant, PlaceContext::NonUse(AscribeUserTy(variance)) => variance, @@ -2468,7 +2468,7 @@ impl<'a, 'tcx> TypeChecker<'a, 'tcx> { self.check_operand(right, location); } - Rvalue::AddressOf(..) + Rvalue::RawPtr(..) | Rvalue::ThreadLocalRef(..) | Rvalue::Len(..) | Rvalue::Discriminant(..) @@ -2485,7 +2485,7 @@ impl<'a, 'tcx> TypeChecker<'a, 'tcx> { | Rvalue::ThreadLocalRef(_) | Rvalue::Repeat(..) | Rvalue::Ref(..) - | Rvalue::AddressOf(..) + | Rvalue::RawPtr(..) | Rvalue::Len(..) | Rvalue::Cast(..) | Rvalue::ShallowInitBox(..) diff --git a/compiler/rustc_builtin_macros/src/cfg_accessible.rs b/compiler/rustc_builtin_macros/src/cfg_accessible.rs index 006b6aa823f..3d3bd3aea05 100644 --- a/compiler/rustc_builtin_macros/src/cfg_accessible.rs +++ b/compiler/rustc_builtin_macros/src/cfg_accessible.rs @@ -47,7 +47,6 @@ impl MultiItemModifier for Expander { ) -> ExpandResult<Vec<Annotatable>, Annotatable> { let template = AttributeTemplate { list: Some("path"), ..Default::default() }; validate_attr::check_builtin_meta_item( - &ecx.ecfg.features, &ecx.sess.psess, meta_item, ast::AttrStyle::Outer, diff --git a/compiler/rustc_builtin_macros/src/derive.rs b/compiler/rustc_builtin_macros/src/derive.rs index 57bddf0ab60..e8704bc2f63 100644 --- a/compiler/rustc_builtin_macros/src/derive.rs +++ b/compiler/rustc_builtin_macros/src/derive.rs @@ -38,7 +38,6 @@ impl MultiItemModifier for Expander { let template = AttributeTemplate { list: Some("Trait1, Trait2, ..."), ..Default::default() }; validate_attr::check_builtin_meta_item( - features, &sess.psess, meta_item, ast::AttrStyle::Outer, diff --git a/compiler/rustc_builtin_macros/src/util.rs b/compiler/rustc_builtin_macros/src/util.rs index 73cc8ff547d..0bcd5aef28b 100644 --- a/compiler/rustc_builtin_macros/src/util.rs +++ b/compiler/rustc_builtin_macros/src/util.rs @@ -17,7 +17,6 @@ pub(crate) fn check_builtin_macro_attribute(ecx: &ExtCtxt<'_>, meta_item: &MetaI // All the built-in macro attributes are "words" at the moment. let template = AttributeTemplate { word: true, ..Default::default() }; validate_attr::check_builtin_meta_item( - &ecx.ecfg.features, &ecx.sess.psess, meta_item, AttrStyle::Outer, diff --git a/compiler/rustc_codegen_cranelift/example/mini_core_hello_world.rs b/compiler/rustc_codegen_cranelift/example/mini_core_hello_world.rs index e603ac566f4..ccbd5a78485 100644 --- a/compiler/rustc_codegen_cranelift/example/mini_core_hello_world.rs +++ b/compiler/rustc_codegen_cranelift/example/mini_core_hello_world.rs @@ -6,8 +6,7 @@ extern_types, naked_functions, thread_local, - repr_simd, - raw_ref_op + repr_simd )] #![no_core] #![allow(dead_code, non_camel_case_types, internal_features)] diff --git a/compiler/rustc_codegen_cranelift/src/analyze.rs b/compiler/rustc_codegen_cranelift/src/analyze.rs index c5762638a6b..72380f50385 100644 --- a/compiler/rustc_codegen_cranelift/src/analyze.rs +++ b/compiler/rustc_codegen_cranelift/src/analyze.rs @@ -25,7 +25,7 @@ pub(crate) fn analyze(fx: &FunctionCx<'_, '_, '_>) -> IndexVec<Local, SsaKind> { for stmt in bb.statements.iter() { match &stmt.kind { Assign(place_and_rval) => match &place_and_rval.1 { - Rvalue::Ref(_, _, place) | Rvalue::AddressOf(_, place) => { + Rvalue::Ref(_, _, place) | Rvalue::RawPtr(_, place) => { flag_map[place.local] = SsaKind::NotSsa; } _ => {} diff --git a/compiler/rustc_codegen_cranelift/src/archive.rs b/compiler/rustc_codegen_cranelift/src/archive.rs index 5eedab4f2cb..c7725e49c94 100644 --- a/compiler/rustc_codegen_cranelift/src/archive.rs +++ b/compiler/rustc_codegen_cranelift/src/archive.rs @@ -1,13 +1,6 @@ -use std::borrow::Borrow; -use std::fs; -use std::path::Path; - -use ar_archive_writer::{COFFShortExport, MachineTypes}; use rustc_codegen_ssa::back::archive::{ - create_mingw_dll_import_lib, ArArchiveBuilder, ArchiveBuilder, ArchiveBuilderBuilder, - DEFAULT_OBJECT_READER, + ArArchiveBuilder, ArchiveBuilder, ArchiveBuilderBuilder, DEFAULT_OBJECT_READER, }; -use rustc_codegen_ssa::common::is_mingw_gnu_toolchain; use rustc_session::Session; pub(crate) struct ArArchiveBuilderBuilder; @@ -16,78 +9,4 @@ impl ArchiveBuilderBuilder for ArArchiveBuilderBuilder { fn new_archive_builder<'a>(&self, sess: &'a Session) -> Box<dyn ArchiveBuilder + 'a> { Box::new(ArArchiveBuilder::new(sess, &DEFAULT_OBJECT_READER)) } - - fn create_dll_import_lib( - &self, - sess: &Session, - lib_name: &str, - import_name_and_ordinal_vector: Vec<(String, Option<u16>)>, - output_path: &Path, - ) { - if is_mingw_gnu_toolchain(&sess.target) { - // The binutils linker used on -windows-gnu targets cannot read the import - // libraries generated by LLVM: in our attempts, the linker produced an .EXE - // that loaded but crashed with an AV upon calling one of the imported - // functions. Therefore, use binutils to create the import library instead, - // by writing a .DEF file to the temp dir and calling binutils's dlltool. - create_mingw_dll_import_lib( - sess, - lib_name, - import_name_and_ordinal_vector, - output_path, - ); - } else { - let mut file = - match fs::OpenOptions::new().write(true).create_new(true).open(&output_path) { - Ok(file) => file, - Err(error) => { - sess.dcx().fatal(format!( - "failed to create import library file `{path}`: {error}", - path = output_path.display(), - )); - } - }; - - let machine = match sess.target.arch.borrow() { - "x86" => MachineTypes::I386, - "x86_64" => MachineTypes::AMD64, - "arm" => MachineTypes::ARMNT, - "aarch64" => MachineTypes::ARM64, - _ => { - sess.dcx().fatal(format!( - "unsupported target architecture `{arch}`", - arch = sess.target.arch, - )); - } - }; - - let exports = import_name_and_ordinal_vector - .iter() - .map(|(name, ordinal)| COFFShortExport { - name: name.to_string(), - ext_name: None, - symbol_name: None, - alias_target: None, - ordinal: ordinal.unwrap_or(0), - noname: ordinal.is_some(), - data: false, - private: false, - constant: false, - }) - .collect::<Vec<_>>(); - - if let Err(error) = ar_archive_writer::write_import_library( - &mut file, - lib_name, - &exports, - machine, - !sess.target.is_like_msvc, - ) { - sess.dcx().fatal(format!( - "failed to create import library `{path}`: `{error}`", - path = output_path.display(), - )); - } - } - } } diff --git a/compiler/rustc_codegen_cranelift/src/base.rs b/compiler/rustc_codegen_cranelift/src/base.rs index 9bc7b57c537..f1d885bf1bc 100644 --- a/compiler/rustc_codegen_cranelift/src/base.rs +++ b/compiler/rustc_codegen_cranelift/src/base.rs @@ -595,7 +595,7 @@ fn codegen_stmt<'tcx>( let val = cplace.to_cvalue(fx); lval.write_cvalue(fx, val) } - Rvalue::Ref(_, _, place) | Rvalue::AddressOf(_, place) => { + Rvalue::Ref(_, _, place) | Rvalue::RawPtr(_, place) => { let place = codegen_place(fx, place); let ref_ = place.place_ref(fx, lval.layout()); lval.write_cvalue(fx, ref_); diff --git a/compiler/rustc_codegen_cranelift/src/lib.rs b/compiler/rustc_codegen_cranelift/src/lib.rs index 21930fa2ddb..f737af25b62 100644 --- a/compiler/rustc_codegen_cranelift/src/lib.rs +++ b/compiler/rustc_codegen_cranelift/src/lib.rs @@ -12,7 +12,6 @@ #![warn(unused_lifetimes)] // tidy-alphabetical-end -extern crate ar_archive_writer; extern crate jobserver; #[macro_use] extern crate rustc_middle; diff --git a/compiler/rustc_codegen_gcc/example/mini_core_hello_world.rs b/compiler/rustc_codegen_gcc/example/mini_core_hello_world.rs index 9f096e90220..dcfa34cb729 100644 --- a/compiler/rustc_codegen_gcc/example/mini_core_hello_world.rs +++ b/compiler/rustc_codegen_gcc/example/mini_core_hello_world.rs @@ -2,7 +2,7 @@ #![feature( no_core, unboxed_closures, start, lang_items, never_type, linkage, - extern_types, thread_local, raw_ref_op + extern_types, thread_local )] #![no_core] #![allow(dead_code, internal_features, non_camel_case_types)] diff --git a/compiler/rustc_codegen_llvm/Cargo.toml b/compiler/rustc_codegen_llvm/Cargo.toml index dad4722d620..a93baf88413 100644 --- a/compiler/rustc_codegen_llvm/Cargo.toml +++ b/compiler/rustc_codegen_llvm/Cargo.toml @@ -12,7 +12,7 @@ bitflags = "2.4.1" itertools = "0.12" libc = "0.2" measureme = "11" -object = { version = "0.36.2", default-features = false, features = ["std", "read"] } +object = { version = "0.36.3", default-features = false, features = ["std", "read"] } rustc-demangle = "0.1.21" rustc_ast = { path = "../rustc_ast" } rustc_attr = { path = "../rustc_attr" } diff --git a/compiler/rustc_codegen_llvm/messages.ftl b/compiler/rustc_codegen_llvm/messages.ftl index 267da9325c3..df2198df14b 100644 --- a/compiler/rustc_codegen_llvm/messages.ftl +++ b/compiler/rustc_codegen_llvm/messages.ftl @@ -5,9 +5,6 @@ codegen_llvm_dynamic_linking_with_lto = .note = only 'staticlib', 'bin', and 'cdylib' outputs are supported with LTO -codegen_llvm_error_creating_import_library = - Error creating import library for {$lib_name}: {$error} - codegen_llvm_fixed_x18_invalid_arch = the `-Zfixed-x18` flag is not supported on the `{$arch}` architecture codegen_llvm_from_llvm_diag = {$message} diff --git a/compiler/rustc_codegen_llvm/src/back/archive.rs b/compiler/rustc_codegen_llvm/src/back/archive.rs index 2120fc1815c..c0ec4f86b4d 100644 --- a/compiler/rustc_codegen_llvm/src/back/archive.rs +++ b/compiler/rustc_codegen_llvm/src/back/archive.rs @@ -5,17 +5,13 @@ use std::path::{Path, PathBuf}; use std::{io, mem, ptr, str}; use rustc_codegen_ssa::back::archive::{ - create_mingw_dll_import_lib, try_extract_macho_fat_archive, ArArchiveBuilder, - ArchiveBuildFailure, ArchiveBuilder, ArchiveBuilderBuilder, ObjectReader, UnknownArchiveKind, - DEFAULT_OBJECT_READER, + try_extract_macho_fat_archive, ArArchiveBuilder, ArchiveBuildFailure, ArchiveBuilder, + ArchiveBuilderBuilder, ObjectReader, UnknownArchiveKind, DEFAULT_OBJECT_READER, }; -use rustc_codegen_ssa::common; use rustc_session::Session; -use tracing::trace; -use crate::errors::ErrorCreatingImportLibrary; use crate::llvm::archive_ro::{ArchiveRO, Child}; -use crate::llvm::{self, ArchiveKind, LLVMMachineType, LLVMRustCOFFShortExport}; +use crate::llvm::{self, ArchiveKind}; /// Helper for adding many files to an archive. #[must_use = "must call build() to finish building the archive"] @@ -44,18 +40,6 @@ fn is_relevant_child(c: &Child<'_>) -> bool { } } -/// Map machine type strings to values of LLVM's MachineTypes enum. -fn llvm_machine_type(cpu: &str) -> LLVMMachineType { - match cpu { - "x86_64" => LLVMMachineType::AMD64, - "x86" => LLVMMachineType::I386, - "aarch64" => LLVMMachineType::ARM64, - "arm64ec" => LLVMMachineType::ARM64EC, - "arm" => LLVMMachineType::ARM, - _ => panic!("unsupported cpu type {cpu}"), - } -} - impl<'a> ArchiveBuilder for LlvmArchiveBuilder<'a> { fn add_archive( &mut self, @@ -116,78 +100,6 @@ impl ArchiveBuilderBuilder for LlvmArchiveBuilderBuilder { Box::new(ArArchiveBuilder::new(sess, &LLVM_OBJECT_READER)) } } - - fn create_dll_import_lib( - &self, - sess: &Session, - lib_name: &str, - import_name_and_ordinal_vector: Vec<(String, Option<u16>)>, - output_path: &Path, - ) { - if common::is_mingw_gnu_toolchain(&sess.target) { - // The binutils linker used on -windows-gnu targets cannot read the import - // libraries generated by LLVM: in our attempts, the linker produced an .EXE - // that loaded but crashed with an AV upon calling one of the imported - // functions. Therefore, use binutils to create the import library instead, - // by writing a .DEF file to the temp dir and calling binutils's dlltool. - create_mingw_dll_import_lib( - sess, - lib_name, - import_name_and_ordinal_vector, - output_path, - ); - } else { - // we've checked for \0 characters in the library name already - let dll_name_z = CString::new(lib_name).unwrap(); - - let output_path_z = rustc_fs_util::path_to_c_string(&output_path); - - trace!("invoking LLVMRustWriteImportLibrary"); - trace!(" dll_name {:#?}", dll_name_z); - trace!(" output_path {}", output_path.display()); - trace!( - " import names: {}", - import_name_and_ordinal_vector - .iter() - .map(|(name, _ordinal)| name.clone()) - .collect::<Vec<_>>() - .join(", "), - ); - - // All import names are Rust identifiers and therefore cannot contain \0 characters. - // FIXME: when support for #[link_name] is implemented, ensure that the import names - // still don't contain any \0 characters. Also need to check that the names don't - // contain substrings like " @" or "NONAME" that are keywords or otherwise reserved - // in definition files. - let cstring_import_name_and_ordinal_vector: Vec<(CString, Option<u16>)> = - import_name_and_ordinal_vector - .into_iter() - .map(|(name, ordinal)| (CString::new(name).unwrap(), ordinal)) - .collect(); - - let ffi_exports: Vec<LLVMRustCOFFShortExport> = cstring_import_name_and_ordinal_vector - .iter() - .map(|(name_z, ordinal)| LLVMRustCOFFShortExport::new(name_z.as_ptr(), *ordinal)) - .collect(); - let result = unsafe { - crate::llvm::LLVMRustWriteImportLibrary( - dll_name_z.as_ptr(), - output_path_z.as_ptr(), - ffi_exports.as_ptr(), - ffi_exports.len(), - llvm_machine_type(&sess.target.arch) as u16, - !sess.target.is_like_msvc, - ) - }; - - if result == crate::llvm::LLVMRustResult::Failure { - sess.dcx().emit_fatal(ErrorCreatingImportLibrary { - lib_name, - error: llvm::last_error().unwrap_or("unknown LLVM error".to_string()), - }); - } - } - } } // The object crate doesn't know how to get symbols for LLVM bitcode and COFF bigobj files. diff --git a/compiler/rustc_codegen_llvm/src/context.rs b/compiler/rustc_codegen_llvm/src/context.rs index dd3f39ecead..1fd9f9e8116 100644 --- a/compiler/rustc_codegen_llvm/src/context.rs +++ b/compiler/rustc_codegen_llvm/src/context.rs @@ -1000,8 +1000,10 @@ impl<'ll> CodegenCx<'ll, '_> { ifn!("llvm.is.constant.i64", fn(t_i64) -> i1); ifn!("llvm.is.constant.i128", fn(t_i128) -> i1); ifn!("llvm.is.constant.isize", fn(t_isize) -> i1); + ifn!("llvm.is.constant.f16", fn(t_f16) -> i1); ifn!("llvm.is.constant.f32", fn(t_f32) -> i1); ifn!("llvm.is.constant.f64", fn(t_f64) -> i1); + ifn!("llvm.is.constant.f128", fn(t_f128) -> i1); ifn!("llvm.is.constant.ptr", fn(ptr) -> i1); ifn!("llvm.expect.i1", fn(i1, i1) -> i1); diff --git a/compiler/rustc_codegen_llvm/src/errors.rs b/compiler/rustc_codegen_llvm/src/errors.rs index 7e53d32ce8c..e0ec9cdca56 100644 --- a/compiler/rustc_codegen_llvm/src/errors.rs +++ b/compiler/rustc_codegen_llvm/src/errors.rs @@ -40,13 +40,6 @@ pub(crate) enum PossibleFeature<'a> { } #[derive(Diagnostic)] -#[diag(codegen_llvm_error_creating_import_library)] -pub(crate) struct ErrorCreatingImportLibrary<'a> { - pub lib_name: &'a str, - pub error: String, -} - -#[derive(Diagnostic)] #[diag(codegen_llvm_symbol_already_defined)] pub(crate) struct SymbolAlreadyDefined<'a> { #[primary_span] diff --git a/compiler/rustc_codegen_llvm/src/intrinsic.rs b/compiler/rustc_codegen_llvm/src/intrinsic.rs index f5558723d11..abfe38d4c0c 100644 --- a/compiler/rustc_codegen_llvm/src/intrinsic.rs +++ b/compiler/rustc_codegen_llvm/src/intrinsic.rs @@ -192,14 +192,22 @@ impl<'ll, 'tcx> IntrinsicCallMethods<'tcx> for Builder<'_, 'll, 'tcx> { } sym::is_val_statically_known => { let intrinsic_type = args[0].layout.immediate_llvm_type(self.cx); - match self.type_kind(intrinsic_type) { - TypeKind::Pointer | TypeKind::Integer | TypeKind::Float | TypeKind::Double => { - self.call_intrinsic( - &format!("llvm.is.constant.{:?}", intrinsic_type), - &[args[0].immediate()], - ) + let kind = self.type_kind(intrinsic_type); + let intrinsic_name = match kind { + TypeKind::Pointer | TypeKind::Integer => { + Some(format!("llvm.is.constant.{intrinsic_type:?}")) } - _ => self.const_bool(false), + // LLVM float types' intrinsic names differ from their type names. + TypeKind::Half => Some(format!("llvm.is.constant.f16")), + TypeKind::Float => Some(format!("llvm.is.constant.f32")), + TypeKind::Double => Some(format!("llvm.is.constant.f64")), + TypeKind::FP128 => Some(format!("llvm.is.constant.f128")), + _ => None, + }; + if let Some(intrinsic_name) = intrinsic_name { + self.call_intrinsic(&intrinsic_name, &[args[0].immediate()]) + } else { + self.const_bool(false) } } sym::unlikely => self diff --git a/compiler/rustc_codegen_ssa/Cargo.toml b/compiler/rustc_codegen_ssa/Cargo.toml index 6e1c323cbd0..e3033b332ca 100644 --- a/compiler/rustc_codegen_ssa/Cargo.toml +++ b/compiler/rustc_codegen_ssa/Cargo.toml @@ -5,7 +5,7 @@ edition = "2021" [dependencies] # tidy-alphabetical-start -ar_archive_writer = "0.3.3" +ar_archive_writer = "0.4.0" arrayvec = { version = "0.7", default-features = false } bitflags = "2.4.1" cc = "1.0.90" @@ -41,7 +41,7 @@ tempfile = "3.2" thin-vec = "0.2.12" thorin-dwp = "0.7" tracing = "0.1" -wasm-encoder = "0.210.0" +wasm-encoder = "0.215.0" # tidy-alphabetical-end [target.'cfg(unix)'.dependencies] diff --git a/compiler/rustc_codegen_ssa/messages.ftl b/compiler/rustc_codegen_ssa/messages.ftl index 80f25d42a08..8a6a2acd87d 100644 --- a/compiler/rustc_codegen_ssa/messages.ftl +++ b/compiler/rustc_codegen_ssa/messages.ftl @@ -32,6 +32,9 @@ codegen_ssa_dlltool_fail_import_library = codegen_ssa_error_calling_dlltool = Error calling dlltool '{$dlltool_path}': {$error} +codegen_ssa_error_creating_import_library = + Error creating import library for {$lib_name}: {$error} + codegen_ssa_error_creating_remark_dir = failed to create remark directory: {$error} codegen_ssa_error_writing_def_file = diff --git a/compiler/rustc_codegen_ssa/src/back/archive.rs b/compiler/rustc_codegen_ssa/src/back/archive.rs index 8eb44d12016..38a440a707a 100644 --- a/compiler/rustc_codegen_ssa/src/back/archive.rs +++ b/compiler/rustc_codegen_ssa/src/back/archive.rs @@ -5,7 +5,9 @@ use std::fs::{self, File}; use std::io::{self, Write}; use std::path::{Path, PathBuf}; -use ar_archive_writer::{write_archive_to_stream, ArchiveKind, NewArchiveMember}; +use ar_archive_writer::{ + write_archive_to_stream, ArchiveKind, COFFShortExport, MachineTypes, NewArchiveMember, +}; pub use ar_archive_writer::{ObjectReader, DEFAULT_OBJECT_READER}; use object::read::archive::ArchiveFile; use object::read::macho::FatArch; @@ -14,11 +16,15 @@ use rustc_data_structures::memmap::Mmap; use rustc_session::Session; use rustc_span::symbol::Symbol; use tempfile::Builder as TempFileBuilder; +use tracing::trace; use super::metadata::search_for_section; +use crate::common; // Re-exporting for rustc_codegen_llvm::back::archive pub use crate::errors::{ArchiveBuildFailure, ExtractBundledLibsError, UnknownArchiveKind}; -use crate::errors::{DlltoolFailImportLibrary, ErrorCallingDllTool, ErrorWritingDEFFile}; +use crate::errors::{ + DlltoolFailImportLibrary, ErrorCallingDllTool, ErrorCreatingImportLibrary, ErrorWritingDEFFile, +}; pub trait ArchiveBuilderBuilder { fn new_archive_builder<'a>(&self, sess: &'a Session) -> Box<dyn ArchiveBuilder + 'a>; @@ -34,7 +40,81 @@ pub trait ArchiveBuilderBuilder { lib_name: &str, import_name_and_ordinal_vector: Vec<(String, Option<u16>)>, output_path: &Path, - ); + ) { + if common::is_mingw_gnu_toolchain(&sess.target) { + // The binutils linker used on -windows-gnu targets cannot read the import + // libraries generated by LLVM: in our attempts, the linker produced an .EXE + // that loaded but crashed with an AV upon calling one of the imported + // functions. Therefore, use binutils to create the import library instead, + // by writing a .DEF file to the temp dir and calling binutils's dlltool. + create_mingw_dll_import_lib( + sess, + lib_name, + import_name_and_ordinal_vector, + output_path, + ); + } else { + trace!("creating import library"); + trace!(" dll_name {:#?}", lib_name); + trace!(" output_path {}", output_path.display()); + trace!( + " import names: {}", + import_name_and_ordinal_vector + .iter() + .map(|(name, _ordinal)| name.clone()) + .collect::<Vec<_>>() + .join(", "), + ); + + // All import names are Rust identifiers and therefore cannot contain \0 characters. + // FIXME: when support for #[link_name] is implemented, ensure that the import names + // still don't contain any \0 characters. Also need to check that the names don't + // contain substrings like " @" or "NONAME" that are keywords or otherwise reserved + // in definition files. + + let mut file = match fs::File::create_new(&output_path) { + Ok(file) => file, + Err(error) => sess + .dcx() + .emit_fatal(ErrorCreatingImportLibrary { lib_name, error: error.to_string() }), + }; + + let exports = import_name_and_ordinal_vector + .iter() + .map(|(name, ordinal)| COFFShortExport { + name: name.to_string(), + ext_name: None, + symbol_name: None, + alias_target: None, + ordinal: ordinal.unwrap_or(0), + noname: ordinal.is_some(), + data: false, + private: false, + constant: false, + }) + .collect::<Vec<_>>(); + let machine = match &*sess.target.arch { + "x86_64" => MachineTypes::AMD64, + "x86" => MachineTypes::I386, + "aarch64" => MachineTypes::ARM64, + "arm64ec" => MachineTypes::ARM64EC, + "arm" => MachineTypes::ARMNT, + cpu => panic!("unsupported cpu type {cpu}"), + }; + + if let Err(error) = ar_archive_writer::write_import_library( + &mut file, + lib_name, + &exports, + machine, + !sess.target.is_like_msvc, + /*comdat=*/ false, + ) { + sess.dcx() + .emit_fatal(ErrorCreatingImportLibrary { lib_name, error: error.to_string() }); + } + } + } fn extract_bundled_libs<'a>( &'a self, diff --git a/compiler/rustc_codegen_ssa/src/errors.rs b/compiler/rustc_codegen_ssa/src/errors.rs index 94bf0ab34e2..573a8cf7cbe 100644 --- a/compiler/rustc_codegen_ssa/src/errors.rs +++ b/compiler/rustc_codegen_ssa/src/errors.rs @@ -1060,3 +1060,10 @@ pub struct CompilerBuiltinsCannotCall { pub caller: String, pub callee: String, } + +#[derive(Diagnostic)] +#[diag(codegen_ssa_error_creating_import_library)] +pub(crate) struct ErrorCreatingImportLibrary<'a> { + pub lib_name: &'a str, + pub error: String, +} diff --git a/compiler/rustc_codegen_ssa/src/mir/analyze.rs b/compiler/rustc_codegen_ssa/src/mir/analyze.rs index 6794365c9be..c8cf341628c 100644 --- a/compiler/rustc_codegen_ssa/src/mir/analyze.rs +++ b/compiler/rustc_codegen_ssa/src/mir/analyze.rs @@ -220,14 +220,14 @@ impl<'mir, 'a, 'tcx, Bx: BuilderMethods<'a, 'tcx>> Visitor<'tcx> | MutatingUseContext::SetDiscriminant | MutatingUseContext::AsmOutput | MutatingUseContext::Borrow - | MutatingUseContext::AddressOf + | MutatingUseContext::RawBorrow | MutatingUseContext::Projection, ) | PlaceContext::NonMutatingUse( NonMutatingUseContext::Inspect | NonMutatingUseContext::SharedBorrow | NonMutatingUseContext::FakeBorrow - | NonMutatingUseContext::AddressOf + | NonMutatingUseContext::RawBorrow | NonMutatingUseContext::Projection, ) => { self.locals[local] = LocalKind::Memory; diff --git a/compiler/rustc_codegen_ssa/src/mir/rvalue.rs b/compiler/rustc_codegen_ssa/src/mir/rvalue.rs index 3c2c29ac7f7..d94c6f8ddce 100644 --- a/compiler/rustc_codegen_ssa/src/mir/rvalue.rs +++ b/compiler/rustc_codegen_ssa/src/mir/rvalue.rs @@ -584,7 +584,7 @@ impl<'a, 'tcx, Bx: BuilderMethods<'a, 'tcx>> FunctionCx<'a, 'tcx, Bx> { mir::Rvalue::CopyForDeref(place) => { self.codegen_operand(bx, &mir::Operand::Copy(place)) } - mir::Rvalue::AddressOf(mutability, place) => { + mir::Rvalue::RawPtr(mutability, place) => { let mk_ptr = move |tcx: TyCtxt<'tcx>, ty: Ty<'tcx>| Ty::new_ptr(tcx, ty, mutability); self.codegen_place_to_pointer(bx, place, mk_ptr) @@ -813,7 +813,7 @@ impl<'a, 'tcx, Bx: BuilderMethods<'a, 'tcx>> FunctionCx<'a, 'tcx, Bx> { cg_value.len(bx.cx()) } - /// Codegen an `Rvalue::AddressOf` or `Rvalue::Ref` + /// Codegen an `Rvalue::RawPtr` or `Rvalue::Ref` fn codegen_place_to_pointer( &mut self, bx: &mut Bx, @@ -1085,7 +1085,7 @@ impl<'a, 'tcx, Bx: BuilderMethods<'a, 'tcx>> FunctionCx<'a, 'tcx, Bx> { } mir::Rvalue::Ref(..) | mir::Rvalue::CopyForDeref(..) | - mir::Rvalue::AddressOf(..) | + mir::Rvalue::RawPtr(..) | mir::Rvalue::Len(..) | mir::Rvalue::Cast(..) | // (*) mir::Rvalue::ShallowInitBox(..) | // (*) diff --git a/compiler/rustc_const_eval/src/check_consts/check.rs b/compiler/rustc_const_eval/src/check_consts/check.rs index 32a9247bcc7..86a5afa65ba 100644 --- a/compiler/rustc_const_eval/src/check_consts/check.rs +++ b/compiler/rustc_const_eval/src/check_consts/check.rs @@ -431,13 +431,13 @@ impl<'tcx> Visitor<'tcx> for Checker<'_, 'tcx> { return; } } - Rvalue::AddressOf(mutbl, place) => { + Rvalue::RawPtr(mutbl, place) => { if let Some(reborrowed_place_ref) = place_as_reborrow(self.tcx, self.body, place) { let ctx = match mutbl { Mutability::Not => { - PlaceContext::NonMutatingUse(NonMutatingUseContext::AddressOf) + PlaceContext::NonMutatingUse(NonMutatingUseContext::RawBorrow) } - Mutability::Mut => PlaceContext::MutatingUse(MutatingUseContext::AddressOf), + Mutability::Mut => PlaceContext::MutatingUse(MutatingUseContext::RawBorrow), }; self.visit_local(reborrowed_place_ref.local, ctx, location); self.visit_projection(reborrowed_place_ref, ctx, location); @@ -472,7 +472,7 @@ impl<'tcx> Visitor<'tcx> for Checker<'_, 'tcx> { } Rvalue::Ref(_, BorrowKind::Mut { .. }, place) - | Rvalue::AddressOf(Mutability::Mut, place) => { + | Rvalue::RawPtr(Mutability::Mut, place) => { // Inside mutable statics, we allow arbitrary mutable references. // We've allowed `static mut FOO = &mut [elements];` for a long time (the exact // reasons why are lost to history), and there is no reason to restrict that to @@ -493,7 +493,7 @@ impl<'tcx> Visitor<'tcx> for Checker<'_, 'tcx> { } Rvalue::Ref(_, BorrowKind::Shared | BorrowKind::Fake(_), place) - | Rvalue::AddressOf(Mutability::Not, place) => { + | Rvalue::RawPtr(Mutability::Not, place) => { let borrowed_place_has_mut_interior = qualifs::in_place::<HasMutInterior, _>( self.ccx, &mut |local| self.qualifs.has_mut_interior(self.ccx, local, location), diff --git a/compiler/rustc_const_eval/src/check_consts/qualifs.rs b/compiler/rustc_const_eval/src/check_consts/qualifs.rs index c0f2d113c7e..c566dc7fa84 100644 --- a/compiler/rustc_const_eval/src/check_consts/qualifs.rs +++ b/compiler/rustc_const_eval/src/check_consts/qualifs.rs @@ -291,7 +291,7 @@ where in_operand::<Q, _>(cx, in_local, lhs) || in_operand::<Q, _>(cx, in_local, rhs) } - Rvalue::Ref(_, _, place) | Rvalue::AddressOf(_, place) => { + Rvalue::Ref(_, _, place) | Rvalue::RawPtr(_, place) => { // Special-case reborrows to be more like a copy of the reference. if let Some((place_base, ProjectionElem::Deref)) = place.as_ref().last_projection() { let base_ty = place_base.ty(cx.body, cx.tcx).ty; diff --git a/compiler/rustc_const_eval/src/check_consts/resolver.rs b/compiler/rustc_const_eval/src/check_consts/resolver.rs index ea3a5264357..681184f7fbc 100644 --- a/compiler/rustc_const_eval/src/check_consts/resolver.rs +++ b/compiler/rustc_const_eval/src/check_consts/resolver.rs @@ -96,7 +96,7 @@ where } fn address_of_allows_mutation(&self) -> bool { - // Exact set of permissions granted by AddressOf is undecided. Conservatively assume that + // Exact set of permissions granted by RawPtr is undecided. Conservatively assume that // it might allow mutation until resolution of #56604. true } @@ -170,7 +170,7 @@ where self.super_rvalue(rvalue, location); match rvalue { - mir::Rvalue::AddressOf(_mt, borrowed_place) => { + mir::Rvalue::RawPtr(_mt, borrowed_place) => { if !borrowed_place.is_indirect() && self.address_of_allows_mutation() { let place_ty = borrowed_place.ty(self.ccx.body, self.ccx.tcx).ty; if Q::in_any_value_of_ty(self.ccx, place_ty) { diff --git a/compiler/rustc_const_eval/src/interpret/step.rs b/compiler/rustc_const_eval/src/interpret/step.rs index aaee6f6d247..70cfba1922c 100644 --- a/compiler/rustc_const_eval/src/interpret/step.rs +++ b/compiler/rustc_const_eval/src/interpret/step.rs @@ -234,7 +234,7 @@ impl<'tcx, M: Machine<'tcx>> InterpCx<'tcx, M> { self.write_immediate(*val, &dest)?; } - AddressOf(_, place) => { + RawPtr(_, place) => { // Figure out whether this is an addr_of of an already raw place. let place_base_raw = if place.is_indirect_first_projection() { let ty = self.frame().body.local_decls[place.local].ty; diff --git a/compiler/rustc_error_codes/src/error_codes/E0745.md b/compiler/rustc_error_codes/src/error_codes/E0745.md index 23ee7af30f4..32b28f3de94 100644 --- a/compiler/rustc_error_codes/src/error_codes/E0745.md +++ b/compiler/rustc_error_codes/src/error_codes/E0745.md @@ -3,7 +3,6 @@ The address of temporary value was taken. Erroneous code example: ```compile_fail,E0745 -# #![feature(raw_ref_op)] fn temp_address() { let ptr = &raw const 2; // error! } @@ -15,7 +14,6 @@ In this example, `2` is destroyed right after the assignment, which means that To avoid this error, first bind the temporary to a named local variable: ``` -# #![feature(raw_ref_op)] fn temp_address() { let val = 2; let ptr = &raw const val; // ok! diff --git a/compiler/rustc_expand/src/config.rs b/compiler/rustc_expand/src/config.rs index f6bf9f5e89f..b0d3fecbb47 100644 --- a/compiler/rustc_expand/src/config.rs +++ b/compiler/rustc_expand/src/config.rs @@ -265,12 +265,7 @@ impl<'a> StripUnconfigured<'a> { /// is in the original source file. Gives a compiler error if the syntax of /// the attribute is incorrect. pub(crate) fn expand_cfg_attr(&self, cfg_attr: &Attribute, recursive: bool) -> Vec<Attribute> { - validate_attr::check_attribute_safety( - self.features.unwrap_or(&Features::default()), - &self.sess.psess, - AttributeSafety::Normal, - &cfg_attr, - ); + validate_attr::check_attribute_safety(&self.sess.psess, AttributeSafety::Normal, &cfg_attr); let Some((cfg_predicate, expanded_attrs)) = rustc_parse::parse_cfg_attr(cfg_attr, &self.sess.psess) @@ -395,11 +390,7 @@ impl<'a> StripUnconfigured<'a> { } }; - validate_attr::deny_builtin_meta_unsafety( - self.features.unwrap_or(&Features::default()), - &self.sess.psess, - &meta_item, - ); + validate_attr::deny_builtin_meta_unsafety(&self.sess.psess, &meta_item); ( parse_cfg(&meta_item, self.sess).map_or(true, |meta_item| { diff --git a/compiler/rustc_expand/src/expand.rs b/compiler/rustc_expand/src/expand.rs index 37679e17b90..cb6b13282a2 100644 --- a/compiler/rustc_expand/src/expand.rs +++ b/compiler/rustc_expand/src/expand.rs @@ -1882,7 +1882,7 @@ impl<'a, 'b> InvocationCollector<'a, 'b> { let mut span: Option<Span> = None; while let Some(attr) = attrs.next() { rustc_ast_passes::feature_gate::check_attribute(attr, self.cx.sess, features); - validate_attr::check_attr(features, &self.cx.sess.psess, attr); + validate_attr::check_attr(&self.cx.sess.psess, attr); let current_span = if let Some(sp) = span { sp.to(attr.span) } else { attr.span }; span = Some(current_span); diff --git a/compiler/rustc_feature/src/accepted.rs b/compiler/rustc_feature/src/accepted.rs index 03b40e28f8b..7838abca9b8 100644 --- a/compiler/rustc_feature/src/accepted.rs +++ b/compiler/rustc_feature/src/accepted.rs @@ -321,6 +321,8 @@ declare_features! ( (accepted, raw_dylib, "1.71.0", Some(58713)), /// Allows keywords to be escaped for use as identifiers. (accepted, raw_identifiers, "1.30.0", Some(48589)), + /// Allows `&raw const $place_expr` and `&raw mut $place_expr` expressions. + (accepted, raw_ref_op, "CURRENT_RUSTC_VERSION", Some(64490)), /// Allows relaxing the coherence rules such that /// `impl<T> ForeignTrait<LocalType> for ForeignType<T>` is permitted. (accepted, re_rebalance_coherence, "1.41.0", Some(55437)), @@ -392,6 +394,8 @@ declare_features! ( (accepted, universal_impl_trait, "1.26.0", Some(34511)), /// Allows arbitrary delimited token streams in non-macro attributes. (accepted, unrestricted_attribute_tokens, "1.34.0", Some(55208)), + /// Allows unsafe attributes. + (accepted, unsafe_attributes, "CURRENT_RUSTC_VERSION", Some(123757)), /// The `unsafe_op_in_unsafe_fn` lint (allowed by default): no longer treat an unsafe function as an unsafe block. (accepted, unsafe_block_in_unsafe_fn, "1.52.0", Some(71668)), /// Allows unsafe on extern declarations and safety qualifiers over internal items. diff --git a/compiler/rustc_feature/src/unstable.rs b/compiler/rustc_feature/src/unstable.rs index 24f691ea7fa..14e353f13ca 100644 --- a/compiler/rustc_feature/src/unstable.rs +++ b/compiler/rustc_feature/src/unstable.rs @@ -565,8 +565,6 @@ declare_features! ( (unstable, precise_capturing, "1.79.0", Some(123432)), /// Allows macro attributes on expressions, statements and non-inline modules. (unstable, proc_macro_hygiene, "1.30.0", Some(54727)), - /// Allows `&raw const $place_expr` and `&raw mut $place_expr` expressions. - (unstable, raw_ref_op, "1.41.0", Some(64490)), /// Makes `&` and `&mut` patterns eat only one layer of references in Rust 2024. (incomplete, ref_pat_eat_one_layer_2024, "1.79.0", Some(123076)), /// Makes `&` and `&mut` patterns eat only one layer of references in Rust 2024—structural variant @@ -622,8 +620,6 @@ declare_features! ( (unstable, type_changing_struct_update, "1.58.0", Some(86555)), /// Allows unnamed fields of struct and union type (incomplete, unnamed_fields, "1.74.0", Some(49804)), - /// Allows unsafe attributes. - (unstable, unsafe_attributes, "1.80.0", Some(123757)), /// Allows const generic parameters to be defined with types that /// are not `Sized`, e.g. `fn foo<const N: [u8]>() {`. (incomplete, unsized_const_params, "CURRENT_RUSTC_VERSION", Some(95174)), diff --git a/compiler/rustc_hir/src/hir.rs b/compiler/rustc_hir/src/hir.rs index 33e8432596b..6c7125b75db 100644 --- a/compiler/rustc_hir/src/hir.rs +++ b/compiler/rustc_hir/src/hir.rs @@ -1395,7 +1395,7 @@ pub struct LetExpr<'hir> { pub pat: &'hir Pat<'hir>, pub ty: Option<&'hir Ty<'hir>>, pub init: &'hir Expr<'hir>, - /// `Recovered::Yes` when this let expressions is not in a syntanctically valid location. + /// `Recovered::Yes` when this let expressions is not in a syntactically valid location. /// Used to prevent building MIR in such situations. pub recovered: ast::Recovered, } @@ -3586,7 +3586,7 @@ impl ForeignItem<'_> { #[derive(Debug, Clone, Copy, HashStable_Generic)] pub enum ForeignItemKind<'hir> { /// A foreign function. - Fn(&'hir FnDecl<'hir>, &'hir [Ident], &'hir Generics<'hir>, Safety), + Fn(FnSig<'hir>, &'hir [Ident], &'hir Generics<'hir>), /// A foreign static item (`static ext: u8`). Static(&'hir Ty<'hir>, Mutability, Safety), /// A foreign type. @@ -3645,7 +3645,10 @@ impl<'hir> OwnerNode<'hir> { match self { OwnerNode::TraitItem(TraitItem { kind: TraitItemKind::Fn(fn_sig, _), .. }) | OwnerNode::ImplItem(ImplItem { kind: ImplItemKind::Fn(fn_sig, _), .. }) - | OwnerNode::Item(Item { kind: ItemKind::Fn(fn_sig, _, _), .. }) => Some(fn_sig), + | OwnerNode::Item(Item { kind: ItemKind::Fn(fn_sig, _, _), .. }) + | OwnerNode::ForeignItem(ForeignItem { + kind: ForeignItemKind::Fn(fn_sig, _, _), .. + }) => Some(fn_sig), _ => None, } } @@ -3654,11 +3657,10 @@ impl<'hir> OwnerNode<'hir> { match self { OwnerNode::TraitItem(TraitItem { kind: TraitItemKind::Fn(fn_sig, _), .. }) | OwnerNode::ImplItem(ImplItem { kind: ImplItemKind::Fn(fn_sig, _), .. }) - | OwnerNode::Item(Item { kind: ItemKind::Fn(fn_sig, _, _), .. }) => Some(fn_sig.decl), - OwnerNode::ForeignItem(ForeignItem { - kind: ForeignItemKind::Fn(fn_decl, _, _, _), - .. - }) => Some(fn_decl), + | OwnerNode::Item(Item { kind: ItemKind::Fn(fn_sig, _, _), .. }) + | OwnerNode::ForeignItem(ForeignItem { + kind: ForeignItemKind::Fn(fn_sig, _, _), .. + }) => Some(fn_sig.decl), _ => None, } } @@ -3846,11 +3848,13 @@ impl<'hir> Node<'hir> { match self { Node::TraitItem(TraitItem { kind: TraitItemKind::Fn(fn_sig, _), .. }) | Node::ImplItem(ImplItem { kind: ImplItemKind::Fn(fn_sig, _), .. }) - | Node::Item(Item { kind: ItemKind::Fn(fn_sig, _, _), .. }) => Some(fn_sig.decl), - Node::Expr(Expr { kind: ExprKind::Closure(Closure { fn_decl, .. }), .. }) - | Node::ForeignItem(ForeignItem { - kind: ForeignItemKind::Fn(fn_decl, _, _, _), .. - }) => Some(fn_decl), + | Node::Item(Item { kind: ItemKind::Fn(fn_sig, _, _), .. }) + | Node::ForeignItem(ForeignItem { kind: ForeignItemKind::Fn(fn_sig, _, _), .. }) => { + Some(fn_sig.decl) + } + Node::Expr(Expr { kind: ExprKind::Closure(Closure { fn_decl, .. }), .. }) => { + Some(fn_decl) + } _ => None, } } @@ -3874,7 +3878,10 @@ impl<'hir> Node<'hir> { match self { Node::TraitItem(TraitItem { kind: TraitItemKind::Fn(fn_sig, _), .. }) | Node::ImplItem(ImplItem { kind: ImplItemKind::Fn(fn_sig, _), .. }) - | Node::Item(Item { kind: ItemKind::Fn(fn_sig, _, _), .. }) => Some(fn_sig), + | Node::Item(Item { kind: ItemKind::Fn(fn_sig, _, _), .. }) + | Node::ForeignItem(ForeignItem { kind: ForeignItemKind::Fn(fn_sig, _, _), .. }) => { + Some(fn_sig) + } _ => None, } } @@ -3949,7 +3956,7 @@ impl<'hir> Node<'hir> { pub fn generics(self) -> Option<&'hir Generics<'hir>> { match self { Node::ForeignItem(ForeignItem { - kind: ForeignItemKind::Fn(_, _, generics, _), .. + kind: ForeignItemKind::Fn(_, _, generics), .. }) | Node::TraitItem(TraitItem { generics, .. }) | Node::ImplItem(ImplItem { generics, .. }) => Some(generics), @@ -4039,8 +4046,8 @@ mod size_asserts { static_assert_size!(Expr<'_>, 64); static_assert_size!(ExprKind<'_>, 48); static_assert_size!(FnDecl<'_>, 40); - static_assert_size!(ForeignItem<'_>, 72); - static_assert_size!(ForeignItemKind<'_>, 40); + static_assert_size!(ForeignItem<'_>, 88); + static_assert_size!(ForeignItemKind<'_>, 56); static_assert_size!(GenericArg<'_>, 16); static_assert_size!(GenericBound<'_>, 48); static_assert_size!(Generics<'_>, 56); diff --git a/compiler/rustc_hir/src/intravisit.rs b/compiler/rustc_hir/src/intravisit.rs index dd501f8417e..a54596e3088 100644 --- a/compiler/rustc_hir/src/intravisit.rs +++ b/compiler/rustc_hir/src/intravisit.rs @@ -611,9 +611,9 @@ pub fn walk_foreign_item<'v, V: Visitor<'v>>( try_visit!(visitor.visit_ident(foreign_item.ident)); match foreign_item.kind { - ForeignItemKind::Fn(ref function_declaration, param_names, ref generics, _) => { + ForeignItemKind::Fn(ref sig, param_names, ref generics) => { try_visit!(visitor.visit_generics(generics)); - try_visit!(visitor.visit_fn_decl(function_declaration)); + try_visit!(visitor.visit_fn_decl(sig.decl)); walk_list!(visitor, visit_ident, param_names.iter().copied()); } ForeignItemKind::Static(ref typ, _, _) => { diff --git a/compiler/rustc_hir_analysis/src/check/check.rs b/compiler/rustc_hir_analysis/src/check/check.rs index 2e778fd3759..0135cdf1e90 100644 --- a/compiler/rustc_hir_analysis/src/check/check.rs +++ b/compiler/rustc_hir_analysis/src/check/check.rs @@ -804,8 +804,8 @@ pub(crate) fn check_item_type(tcx: TyCtxt<'_>, def_id: LocalDefId) { let item = tcx.hir().foreign_item(item.id); match &item.kind { - hir::ForeignItemKind::Fn(fn_decl, _, _, _) => { - require_c_abi_if_c_variadic(tcx, fn_decl, abi, item.span); + hir::ForeignItemKind::Fn(sig, _, _) => { + require_c_abi_if_c_variadic(tcx, sig.decl, abi, item.span); } hir::ForeignItemKind::Static(..) => { check_static_inhabited(tcx, def_id); diff --git a/compiler/rustc_hir_analysis/src/check/intrinsic.rs b/compiler/rustc_hir_analysis/src/check/intrinsic.rs index 4b45ced30c5..c2b2f08132e 100644 --- a/compiler/rustc_hir_analysis/src/check/intrinsic.rs +++ b/compiler/rustc_hir_analysis/src/check/intrinsic.rs @@ -30,7 +30,7 @@ fn equate_intrinsic_type<'tcx>( let (generics, span) = match tcx.hir_node_by_def_id(def_id) { hir::Node::Item(hir::Item { kind: hir::ItemKind::Fn(_, generics, _), .. }) | hir::Node::ForeignItem(hir::ForeignItem { - kind: hir::ForeignItemKind::Fn(.., generics, _), + kind: hir::ForeignItemKind::Fn(_, _, generics), .. }) => (tcx.generics_of(def_id), generics.span), _ => { diff --git a/compiler/rustc_hir_analysis/src/check/wfcheck.rs b/compiler/rustc_hir_analysis/src/check/wfcheck.rs index d3b928fc17c..bdf2914fc50 100644 --- a/compiler/rustc_hir_analysis/src/check/wfcheck.rs +++ b/compiler/rustc_hir_analysis/src/check/wfcheck.rs @@ -350,8 +350,8 @@ fn check_foreign_item<'tcx>( ); match item.kind { - hir::ForeignItemKind::Fn(decl, ..) => { - check_item_fn(tcx, def_id, item.ident, item.span, decl) + hir::ForeignItemKind::Fn(sig, ..) => { + check_item_fn(tcx, def_id, item.ident, item.span, sig.decl) } hir::ForeignItemKind::Static(ty, ..) => { check_item_type(tcx, def_id, ty.span, UnsizedHandling::AllowIfForeignTail) diff --git a/compiler/rustc_hir_analysis/src/collect.rs b/compiler/rustc_hir_analysis/src/collect.rs index 91fa066ec6a..f75954c9edf 100644 --- a/compiler/rustc_hir_analysis/src/collect.rs +++ b/compiler/rustc_hir_analysis/src/collect.rs @@ -1440,11 +1440,9 @@ fn fn_sig(tcx: TyCtxt<'_>, def_id: LocalDefId) -> ty::EarlyBinder<'_, ty::PolyFn icx.lowerer().lower_fn_ty(hir_id, header.safety, header.abi, decl, Some(generics), None) } - ForeignItem(&hir::ForeignItem { - kind: ForeignItemKind::Fn(fn_decl, _, _, safety), .. - }) => { + ForeignItem(&hir::ForeignItem { kind: ForeignItemKind::Fn(sig, _, _), .. }) => { let abi = tcx.hir().get_foreign_abi(hir_id); - compute_sig_of_foreign_fn_decl(tcx, def_id, fn_decl, abi, safety) + compute_sig_of_foreign_fn_decl(tcx, def_id, sig.decl, abi, sig.header.safety) } Ctor(data) | Variant(hir::Variant { data, .. }) if data.ctor().is_some() => { 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 e11d3c9c48b..ae0c70d2326 100644 --- a/compiler/rustc_hir_analysis/src/collect/resolve_bound_vars.rs +++ b/compiler/rustc_hir_analysis/src/collect/resolve_bound_vars.rs @@ -604,7 +604,7 @@ impl<'a, 'tcx> Visitor<'tcx> for BoundVarContext<'a, 'tcx> { fn visit_foreign_item(&mut self, item: &'tcx hir::ForeignItem<'tcx>) { match item.kind { - hir::ForeignItemKind::Fn(_, _, generics, _) => { + hir::ForeignItemKind::Fn(_, _, generics) => { self.visit_early_late(item.hir_id(), generics, |this| { intravisit::walk_foreign_item(this, item); }) diff --git a/compiler/rustc_hir_pretty/src/lib.rs b/compiler/rustc_hir_pretty/src/lib.rs index 089cee2fa0d..cff21173f79 100644 --- a/compiler/rustc_hir_pretty/src/lib.rs +++ b/compiler/rustc_hir_pretty/src/lib.rs @@ -352,16 +352,11 @@ impl<'a> State<'a> { self.maybe_print_comment(item.span.lo()); self.print_outer_attributes(self.attrs(item.hir_id())); match item.kind { - hir::ForeignItemKind::Fn(decl, arg_names, generics, safety) => { + hir::ForeignItemKind::Fn(sig, arg_names, generics) => { self.head(""); self.print_fn( - decl, - hir::FnHeader { - safety, - constness: hir::Constness::NotConst, - abi: Abi::Rust, - asyncness: hir::IsAsync::NotAsync, - }, + sig.decl, + sig.header, Some(item.ident.name), generics, arg_names, diff --git a/compiler/rustc_hir_typeck/src/cast.rs b/compiler/rustc_hir_typeck/src/cast.rs index 7cd97166ed1..03a76d44cc9 100644 --- a/compiler/rustc_hir_typeck/src/cast.rs +++ b/compiler/rustc_hir_typeck/src/cast.rs @@ -967,7 +967,7 @@ impl<'a, 'tcx> CastCheck<'tcx> { // need to special-case obtaining a raw pointer // from a region pointer to a vector. - // Coerce to a raw pointer so that we generate AddressOf in MIR. + // Coerce to a raw pointer so that we generate RawPtr in MIR. let array_ptr_type = Ty::new_ptr(fcx.tcx, m_expr.ty, m_expr.mutbl); fcx.coerce(self.expr, self.expr_ty, array_ptr_type, AllowTwoPhase::No, None) .unwrap_or_else(|_| { diff --git a/compiler/rustc_hir_typeck/src/coercion.rs b/compiler/rustc_hir_typeck/src/coercion.rs index d53df251a15..9b34c59f1f1 100644 --- a/compiler/rustc_hir_typeck/src/coercion.rs +++ b/compiler/rustc_hir_typeck/src/coercion.rs @@ -1859,7 +1859,7 @@ impl<'tcx, 'exprs, E: AsCoercionSite> CoerceMany<'tcx, 'exprs, E> { }; // If this is due to an explicit `return`, suggest adding a return type. - if let Some((fn_id, fn_decl, can_suggest)) = fcx.get_fn_decl(parent_id) + if let Some((fn_id, fn_decl, can_suggest)) = fcx.get_fn_decl(block_or_return_id) && !due_to_block { fcx.suggest_missing_return_type(&mut err, fn_decl, expected, found, can_suggest, fn_id); diff --git a/compiler/rustc_hir_typeck/src/method/suggest.rs b/compiler/rustc_hir_typeck/src/method/suggest.rs index 3b71e2f19b1..b3cf73bac1a 100644 --- a/compiler/rustc_hir_typeck/src/method/suggest.rs +++ b/compiler/rustc_hir_typeck/src/method/suggest.rs @@ -3448,6 +3448,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> { trait_missing_method: bool, ) { let mut alt_rcvr_sugg = false; + let mut trait_in_other_version_found = false; if let (SelfSource::MethodCall(rcvr), false) = (source, unsatisfied_bounds) { debug!( "suggest_traits_to_import: span={:?}, item_name={:?}, rcvr_ty={:?}, rcvr={:?}", @@ -3489,8 +3490,17 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> { // self types and rely on the suggestion to `use` the trait from // `suggest_valid_traits`. let did = Some(pick.item.container_id(self.tcx)); - let skip = skippable.contains(&did); - if pick.autoderefs == 0 && !skip { + if skippable.contains(&did) { + continue; + } + trait_in_other_version_found = self + .detect_and_explain_multiple_crate_versions( + err, + pick.item.def_id, + rcvr.hir_id, + *rcvr_ty, + ); + if pick.autoderefs == 0 && !trait_in_other_version_found { err.span_label( pick.item.ident(self.tcx).span, format!("the method is available for `{rcvr_ty}` here"), @@ -3675,7 +3685,32 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> { } } } - if self.suggest_valid_traits(err, item_name, valid_out_of_scope_traits, true) { + + if let SelfSource::QPath(ty) = source + && !valid_out_of_scope_traits.is_empty() + && let hir::TyKind::Path(path) = ty.kind + && let hir::QPath::Resolved(_, path) = path + && let Some(def_id) = path.res.opt_def_id() + && let Some(assoc) = self + .tcx + .associated_items(valid_out_of_scope_traits[0]) + .filter_by_name_unhygienic(item_name.name) + .next() + { + // See if the `Type::function(val)` where `function` wasn't found corresponds to a + // `Trait` that is imported directly, but `Type` came from a different version of the + // same crate. + let rcvr_ty = self.tcx.type_of(def_id).instantiate_identity(); + trait_in_other_version_found = self.detect_and_explain_multiple_crate_versions( + err, + assoc.def_id, + ty.hir_id, + rcvr_ty, + ); + } + if !trait_in_other_version_found + && self.suggest_valid_traits(err, item_name, valid_out_of_scope_traits, true) + { return; } @@ -4040,6 +4075,62 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> { } } + fn detect_and_explain_multiple_crate_versions( + &self, + err: &mut Diag<'_>, + item_def_id: DefId, + hir_id: hir::HirId, + rcvr_ty: Ty<'_>, + ) -> bool { + let hir_id = self.tcx.parent_hir_id(hir_id); + let Some(traits) = self.tcx.in_scope_traits(hir_id) else { return false }; + if traits.is_empty() { + return false; + } + let trait_def_id = self.tcx.parent(item_def_id); + let krate = self.tcx.crate_name(trait_def_id.krate); + let name = self.tcx.item_name(trait_def_id); + let candidates: Vec<_> = traits + .iter() + .filter(|c| { + c.def_id.krate != trait_def_id.krate + && self.tcx.crate_name(c.def_id.krate) == krate + && self.tcx.item_name(c.def_id) == name + }) + .map(|c| (c.def_id, c.import_ids.get(0).cloned())) + .collect(); + if candidates.is_empty() { + return false; + } + let item_span = self.tcx.def_span(item_def_id); + let msg = format!( + "there are multiple different versions of crate `{krate}` in the dependency graph", + ); + let trait_span = self.tcx.def_span(trait_def_id); + let mut multi_span: MultiSpan = trait_span.into(); + multi_span.push_span_label(trait_span, format!("this is the trait that is needed")); + let descr = self.tcx.associated_item(item_def_id).descr(); + multi_span + .push_span_label(item_span, format!("the {descr} is available for `{rcvr_ty}` here")); + for (def_id, import_def_id) in candidates { + if let Some(import_def_id) = import_def_id { + multi_span.push_span_label( + self.tcx.def_span(import_def_id), + format!( + "`{name}` imported here doesn't correspond to the right version of crate \ + `{krate}`", + ), + ); + } + multi_span.push_span_label( + self.tcx.def_span(def_id), + format!("this is the trait that was imported"), + ); + } + err.span_note(multi_span, msg); + true + } + /// issue #102320, for `unwrap_or` with closure as argument, suggest `unwrap_or_else` /// FIXME: currently not working for suggesting `map_or_else`, see #102408 pub(crate) fn suggest_else_fn_with_closure( diff --git a/compiler/rustc_lint/src/types.rs b/compiler/rustc_lint/src/types.rs index 54bf73a40dd..cb7a07116ce 100644 --- a/compiler/rustc_lint/src/types.rs +++ b/compiler/rustc_lint/src/types.rs @@ -1734,13 +1734,16 @@ impl<'tcx> LateLintPass<'tcx> for ImproperCTypesDeclarations { let abi = cx.tcx.hir().get_foreign_abi(it.hir_id()); match it.kind { - hir::ForeignItemKind::Fn(decl, _, _, _) if !vis.is_internal_abi(abi) => { - vis.check_foreign_fn(it.owner_id.def_id, decl); + hir::ForeignItemKind::Fn(sig, _, _) => { + if vis.is_internal_abi(abi) { + vis.check_fn(it.owner_id.def_id, sig.decl) + } else { + vis.check_foreign_fn(it.owner_id.def_id, sig.decl); + } } hir::ForeignItemKind::Static(ty, _, _) if !vis.is_internal_abi(abi) => { vis.check_foreign_static(it.owner_id, ty.span); } - hir::ForeignItemKind::Fn(decl, _, _, _) => vis.check_fn(it.owner_id.def_id, decl), hir::ForeignItemKind::Static(..) | hir::ForeignItemKind::Type => (), } } diff --git a/compiler/rustc_lint_defs/src/builtin.rs b/compiler/rustc_lint_defs/src/builtin.rs index c731b03a875..56d77c9d1d0 100644 --- a/compiler/rustc_lint_defs/src/builtin.rs +++ b/compiler/rustc_lint_defs/src/builtin.rs @@ -4971,7 +4971,6 @@ declare_lint! { /// ### Example /// /// ```rust - /// #![feature(unsafe_attributes)] /// #![warn(unsafe_attr_outside_unsafe)] /// /// #[no_mangle] diff --git a/compiler/rustc_middle/src/hir/map/mod.rs b/compiler/rustc_middle/src/hir/map/mod.rs index edab6b5ebde..0f85998204c 100644 --- a/compiler/rustc_middle/src/hir/map/mod.rs +++ b/compiler/rustc_middle/src/hir/map/mod.rs @@ -554,53 +554,43 @@ impl<'hir> Map<'hir> { /// } /// ``` pub fn get_fn_id_for_return_block(self, id: HirId) -> Option<HirId> { - let mut iter = self.parent_iter(id).peekable(); - let mut ignore_tail = false; - if let Node::Expr(Expr { kind: ExprKind::Ret(_), .. }) = self.tcx.hir_node(id) { - // When dealing with `return` statements, we don't care about climbing only tail - // expressions. - ignore_tail = true; - } + let enclosing_body_owner = self.tcx.local_def_id_to_hir_id(self.enclosing_body_owner(id)); + + // Return `None` if the `id` expression is not the returned value of the enclosing body + let mut iter = [id].into_iter().chain(self.parent_id_iter(id)).peekable(); + while let Some(cur_id) = iter.next() { + if enclosing_body_owner == cur_id { + break; + } - let mut prev_hir_id = None; - while let Some((hir_id, node)) = iter.next() { - if let (Some((_, next_node)), false) = (iter.peek(), ignore_tail) { - match next_node { - Node::Block(Block { expr: None, .. }) => return None, - // The current node is not the tail expression of its parent. - Node::Block(Block { expr: Some(e), .. }) if hir_id != e.hir_id => return None, + // A return statement is always the value returned from the enclosing body regardless of + // what the parent expressions are. + if let Node::Expr(Expr { kind: ExprKind::Ret(_), .. }) = self.tcx.hir_node(cur_id) { + break; + } + + // If the current expression's value doesnt get used as the parent expressions value then return `None` + if let Some(&parent_id) = iter.peek() { + match self.tcx.hir_node(parent_id) { + // The current node is not the tail expression of the block expression parent expr. + Node::Block(Block { expr: Some(e), .. }) if cur_id != e.hir_id => return None, Node::Block(Block { expr: Some(e), .. }) if matches!(e.kind, ExprKind::If(_, _, None)) => { return None; } + + // The current expression's value does not pass up through these parent expressions + Node::Block(Block { expr: None, .. }) + | Node::Expr(Expr { kind: ExprKind::Loop(..), .. }) + | Node::LetStmt(..) => return None, + _ => {} } } - match node { - Node::Item(_) - | Node::ForeignItem(_) - | Node::TraitItem(_) - | Node::Expr(Expr { kind: ExprKind::Closure(_), .. }) - | Node::ImplItem(_) - // The input node `id` must be enclosed in the method's body as opposed - // to some other place such as its return type (fixes #114918). - // We verify that indirectly by checking that the previous node is the - // current node's body - if node.body_id().map(|b| b.hir_id) == prev_hir_id => { - return Some(hir_id) - } - // Ignore `return`s on the first iteration - Node::Expr(Expr { kind: ExprKind::Loop(..) | ExprKind::Ret(..), .. }) - | Node::LetStmt(_) => { - return None; - } - _ => {} - } - - prev_hir_id = Some(hir_id); } - None + + Some(enclosing_body_owner) } /// Retrieves the `OwnerId` for `id`'s parent item, or `id` itself if no @@ -826,6 +816,11 @@ impl<'hir> Map<'hir> { }) | Node::ImplItem(ImplItem { kind: ImplItemKind::Fn(sig, ..), span: outer_span, .. + }) + | Node::ForeignItem(ForeignItem { + kind: ForeignItemKind::Fn(sig, ..), + span: outer_span, + .. }) => { // Ensure that the returned span has the item's SyntaxContext, and not the // SyntaxContext of the visibility. @@ -884,10 +879,7 @@ impl<'hir> Map<'hir> { }, Node::Variant(variant) => named_span(variant.span, variant.ident, None), Node::ImplItem(item) => named_span(item.span, item.ident, Some(item.generics)), - Node::ForeignItem(item) => match item.kind { - ForeignItemKind::Fn(decl, _, _, _) => until_within(item.span, decl.output.span()), - _ => named_span(item.span, item.ident, None), - }, + Node::ForeignItem(item) => named_span(item.span, item.ident, None), Node::Ctor(_) => return self.span(self.tcx.parent_hir_id(hir_id)), Node::Expr(Expr { kind: ExprKind::Closure(Closure { fn_decl_span, .. }), diff --git a/compiler/rustc_middle/src/hir/mod.rs b/compiler/rustc_middle/src/hir/mod.rs index fa521ab9f2f..596d9f07737 100644 --- a/compiler/rustc_middle/src/hir/mod.rs +++ b/compiler/rustc_middle/src/hir/mod.rs @@ -202,7 +202,7 @@ pub fn provide(providers: &mut Providers) { .. }) | Node::ForeignItem(&ForeignItem { - kind: ForeignItemKind::Fn(_, idents, _, _), + kind: ForeignItemKind::Fn(_, idents, _), .. }) = tcx.hir_node(tcx.local_def_id_to_hir_id(def_id)) { diff --git a/compiler/rustc_middle/src/mir/pretty.rs b/compiler/rustc_middle/src/mir/pretty.rs index f2d87814130..efdc0c710ba 100644 --- a/compiler/rustc_middle/src/mir/pretty.rs +++ b/compiler/rustc_middle/src/mir/pretty.rs @@ -1038,7 +1038,7 @@ impl<'tcx> Debug for Rvalue<'tcx> { CopyForDeref(ref place) => write!(fmt, "deref_copy {place:#?}"), - AddressOf(mutability, ref place) => { + RawPtr(mutability, ref place) => { write!(fmt, "&raw {mut_str} {place:?}", mut_str = mutability.ptr_str()) } @@ -1159,7 +1159,7 @@ impl<'tcx> Debug for Operand<'tcx> { use self::Operand::*; match *self { Constant(ref a) => write!(fmt, "{a:?}"), - Copy(ref place) => write!(fmt, "{place:?}"), + Copy(ref place) => write!(fmt, "copy {place:?}"), Move(ref place) => write!(fmt, "move {place:?}"), } } @@ -1418,21 +1418,19 @@ pub fn write_allocations<'tcx>( alloc.inner().provenance().ptrs().values().map(|p| p.alloc_id()) } - fn alloc_ids_from_const_val(val: ConstValue<'_>) -> impl Iterator<Item = AllocId> + '_ { + fn alloc_id_from_const_val(val: ConstValue<'_>) -> Option<AllocId> { match val { - ConstValue::Scalar(interpret::Scalar::Ptr(ptr, _)) => { - Either::Left(std::iter::once(ptr.provenance.alloc_id())) - } - ConstValue::Scalar(interpret::Scalar::Int { .. }) => Either::Right(std::iter::empty()), - ConstValue::ZeroSized => Either::Right(std::iter::empty()), + ConstValue::Scalar(interpret::Scalar::Ptr(ptr, _)) => Some(ptr.provenance.alloc_id()), + ConstValue::Scalar(interpret::Scalar::Int { .. }) => None, + ConstValue::ZeroSized => None, ConstValue::Slice { .. } => { // `u8`/`str` slices, shouldn't contain pointers that we want to print. - Either::Right(std::iter::empty()) + None } ConstValue::Indirect { alloc_id, .. } => { // FIXME: we don't actually want to print all of these, since some are printed nicely directly as values inline in MIR. // Really we'd want `pretty_print_const_value` to decide which allocations to print, instead of having a separate visitor. - Either::Left(std::iter::once(alloc_id)) + Some(alloc_id) } } } @@ -1443,7 +1441,9 @@ pub fn write_allocations<'tcx>( match c.const_ { Const::Ty(_, _) | Const::Unevaluated(..) => {} Const::Val(val, _) => { - self.0.extend(alloc_ids_from_const_val(val)); + if let Some(id) = alloc_id_from_const_val(val) { + self.0.insert(id); + } } } } diff --git a/compiler/rustc_middle/src/mir/statement.rs b/compiler/rustc_middle/src/mir/statement.rs index 3009ca8d809..bc7dfa6205e 100644 --- a/compiler/rustc_middle/src/mir/statement.rs +++ b/compiler/rustc_middle/src/mir/statement.rs @@ -423,7 +423,7 @@ impl<'tcx> Rvalue<'tcx> { | Rvalue::Repeat(_, _) | Rvalue::Ref(_, _, _) | Rvalue::ThreadLocalRef(_) - | Rvalue::AddressOf(_, _) + | Rvalue::RawPtr(_, _) | Rvalue::Len(_) | Rvalue::Cast( CastKind::IntToInt diff --git a/compiler/rustc_middle/src/mir/syntax.rs b/compiler/rustc_middle/src/mir/syntax.rs index 1119ff6ff3d..51b4154ddab 100644 --- a/compiler/rustc_middle/src/mir/syntax.rs +++ b/compiler/rustc_middle/src/mir/syntax.rs @@ -1293,14 +1293,14 @@ pub enum Rvalue<'tcx> { /// nature of this operation? ThreadLocalRef(DefId), - /// Creates a pointer with the indicated mutability to the place. + /// Creates a raw pointer with the indicated mutability to the place. /// - /// This is generated by pointer casts like `&v as *const _` or raw address of expressions like - /// `&raw v` or `addr_of!(v)`. + /// This is generated by pointer casts like `&v as *const _` or raw borrow expressions like + /// `&raw const v`. /// /// Like with references, the semantics of this operation are heavily dependent on the aliasing /// model. - AddressOf(Mutability, Place<'tcx>), + RawPtr(Mutability, Place<'tcx>), /// Yields the length of the place, as a `usize`. /// diff --git a/compiler/rustc_middle/src/mir/tcx.rs b/compiler/rustc_middle/src/mir/tcx.rs index 1075344dc00..8d57d0d8654 100644 --- a/compiler/rustc_middle/src/mir/tcx.rs +++ b/compiler/rustc_middle/src/mir/tcx.rs @@ -170,7 +170,7 @@ impl<'tcx> Rvalue<'tcx> { let place_ty = place.ty(local_decls, tcx).ty; Ty::new_ref(tcx, reg, place_ty, bk.to_mutbl_lossy()) } - Rvalue::AddressOf(mutability, ref place) => { + Rvalue::RawPtr(mutability, ref place) => { let place_ty = place.ty(local_decls, tcx).ty; Ty::new_ptr(tcx, place_ty, mutability) } diff --git a/compiler/rustc_middle/src/mir/visit.rs b/compiler/rustc_middle/src/mir/visit.rs index 3921176873c..bfb129495ce 100644 --- a/compiler/rustc_middle/src/mir/visit.rs +++ b/compiler/rustc_middle/src/mir/visit.rs @@ -682,13 +682,13 @@ macro_rules! make_mir_visitor { ); } - Rvalue::AddressOf(m, path) => { + Rvalue::RawPtr(m, path) => { let ctx = match m { Mutability::Mut => PlaceContext::MutatingUse( - MutatingUseContext::AddressOf + MutatingUseContext::RawBorrow ), Mutability::Not => PlaceContext::NonMutatingUse( - NonMutatingUseContext::AddressOf + NonMutatingUseContext::RawBorrow ), }; self.visit_place(path, ctx, location); @@ -1299,8 +1299,8 @@ pub enum NonMutatingUseContext { /// FIXME: do we need to distinguish shallow and deep fake borrows? In fact, do we need to /// distinguish fake and normal deep borrows? FakeBorrow, - /// AddressOf for *const pointer. - AddressOf, + /// `&raw const`. + RawBorrow, /// PlaceMention statement. /// /// This statement is executed as a check that the `Place` is live without reading from it, @@ -1333,8 +1333,8 @@ pub enum MutatingUseContext { Drop, /// Mutable borrow. Borrow, - /// AddressOf for *mut pointer. - AddressOf, + /// `&raw mut`. + RawBorrow, /// Used as base for another place, e.g., `x` in `x.y`. Could potentially mutate the place. /// For example, the projection `x.y` is marked as a mutation in these cases: /// ```ignore (illustrative) @@ -1386,8 +1386,8 @@ impl PlaceContext { pub fn is_address_of(&self) -> bool { matches!( self, - PlaceContext::NonMutatingUse(NonMutatingUseContext::AddressOf) - | PlaceContext::MutatingUse(MutatingUseContext::AddressOf) + PlaceContext::NonMutatingUse(NonMutatingUseContext::RawBorrow) + | PlaceContext::MutatingUse(MutatingUseContext::RawBorrow) ) } diff --git a/compiler/rustc_middle/src/query/mod.rs b/compiler/rustc_middle/src/query/mod.rs index 92c8d265c09..75166624f95 100644 --- a/compiler/rustc_middle/src/query/mod.rs +++ b/compiler/rustc_middle/src/query/mod.rs @@ -1520,7 +1520,7 @@ rustc_queries! { separate_provide_extern } - query extern_crate(def_id: DefId) -> Option<&'tcx ExternCrate> { + query extern_crate(def_id: CrateNum) -> Option<&'tcx ExternCrate> { eval_always desc { "getting crate's ExternCrateData" } separate_provide_extern diff --git a/compiler/rustc_middle/src/thir.rs b/compiler/rustc_middle/src/thir.rs index f2ea32275f9..aca1390935e 100644 --- a/compiler/rustc_middle/src/thir.rs +++ b/compiler/rustc_middle/src/thir.rs @@ -407,7 +407,7 @@ pub enum ExprKind<'tcx> { arg: ExprId, }, /// A `&raw [const|mut] $place_expr` raw borrow resulting in type `*[const|mut] T`. - AddressOf { + RawBorrow { mutability: hir::Mutability, arg: ExprId, }, diff --git a/compiler/rustc_middle/src/thir/visit.rs b/compiler/rustc_middle/src/thir/visit.rs index f1988810437..e246ecebbec 100644 --- a/compiler/rustc_middle/src/thir/visit.rs +++ b/compiler/rustc_middle/src/thir/visit.rs @@ -92,7 +92,7 @@ pub fn walk_expr<'thir, 'tcx: 'thir, V: Visitor<'thir, 'tcx>>( } VarRef { id: _ } | UpvarRef { closure_def_id: _, var_hir_id: _ } => {} Borrow { arg, borrow_kind: _ } => visitor.visit_expr(&visitor.thir()[arg]), - AddressOf { arg, mutability: _ } => visitor.visit_expr(&visitor.thir()[arg]), + RawBorrow { arg, mutability: _ } => visitor.visit_expr(&visitor.thir()[arg]), Break { value, label: _ } => { if let Some(value) = value { visitor.visit_expr(&visitor.thir()[value]) diff --git a/compiler/rustc_middle/src/ty/print/pretty.rs b/compiler/rustc_middle/src/ty/print/pretty.rs index 56ddf146636..319fb7ef03b 100644 --- a/compiler/rustc_middle/src/ty/print/pretty.rs +++ b/compiler/rustc_middle/src/ty/print/pretty.rs @@ -451,7 +451,7 @@ pub trait PrettyPrinter<'tcx>: Printer<'tcx> + fmt::Write { // 2. For an extern inferred from a path or an indirect crate, // where there is no explicit `extern crate`, we just prepend // the crate name. - match self.tcx().extern_crate(def_id) { + match self.tcx().extern_crate(cnum) { Some(&ExternCrate { src, dependency_of, span, .. }) => match (src, dependency_of) { (ExternCrateSource::Extern(def_id), LOCAL_CRATE) => { // NOTE(eddyb) the only reason `span` might be dummy, @@ -3247,10 +3247,8 @@ fn for_each_def(tcx: TyCtxt<'_>, mut collect_fn: impl for<'b> FnMut(&'b Ident, N let mut seen_defs: DefIdSet = Default::default(); for &cnum in tcx.crates(()).iter() { - let def_id = cnum.as_def_id(); - // Ignore crates that are not direct dependencies. - match tcx.extern_crate(def_id) { + match tcx.extern_crate(cnum) { None => continue, Some(extern_crate) => { if !extern_crate.is_direct() { @@ -3259,7 +3257,7 @@ fn for_each_def(tcx: TyCtxt<'_>, mut collect_fn: impl for<'b> FnMut(&'b Ident, N } } - queue.push(def_id); + queue.push(cnum.as_def_id()); } // Iterate external crate defs but be mindful about visibility diff --git a/compiler/rustc_middle/src/ty/util.rs b/compiler/rustc_middle/src/ty/util.rs index b9bf17cbb5c..045c8ad39be 100644 --- a/compiler/rustc_middle/src/ty/util.rs +++ b/compiler/rustc_middle/src/ty/util.rs @@ -859,7 +859,7 @@ impl<'tcx> TyCtxt<'tcx> { // If `extern_crate` is `None`, then the crate was injected (e.g., by the allocator). // Treat that kind of crate as "indirect", since it's an implementation detail of // the language. - || self.extern_crate(key.as_def_id()).is_some_and(|e| e.is_direct()) + || self.extern_crate(key).is_some_and(|e| e.is_direct()) } /// Whether the item has a host effect param. This is different from `TyCtxt::is_const`, diff --git a/compiler/rustc_mir_build/src/build/custom/parse/instruction.rs b/compiler/rustc_mir_build/src/build/custom/parse/instruction.rs index 56896d945e5..0b13ceb574d 100644 --- a/compiler/rustc_mir_build/src/build/custom/parse/instruction.rs +++ b/compiler/rustc_mir_build/src/build/custom/parse/instruction.rs @@ -244,8 +244,8 @@ impl<'tcx, 'body> ParseCtxt<'tcx, 'body> { ExprKind::Borrow { borrow_kind, arg } => Ok( Rvalue::Ref(self.tcx.lifetimes.re_erased, *borrow_kind, self.parse_place(*arg)?) ), - ExprKind::AddressOf { mutability, arg } => Ok( - Rvalue::AddressOf(*mutability, self.parse_place(*arg)?) + ExprKind::RawBorrow { mutability, arg } => Ok( + Rvalue::RawPtr(*mutability, self.parse_place(*arg)?) ), ExprKind::Binary { op, lhs, rhs } => Ok( Rvalue::BinaryOp(*op, Box::new((self.parse_operand(*lhs)?, self.parse_operand(*rhs)?))) diff --git a/compiler/rustc_mir_build/src/build/expr/as_place.rs b/compiler/rustc_mir_build/src/build/expr/as_place.rs index b80d9de70c8..07784982631 100644 --- a/compiler/rustc_mir_build/src/build/expr/as_place.rs +++ b/compiler/rustc_mir_build/src/build/expr/as_place.rs @@ -542,7 +542,7 @@ impl<'a, 'tcx> Builder<'a, 'tcx> { | ExprKind::PointerCoercion { .. } | ExprKind::Repeat { .. } | ExprKind::Borrow { .. } - | ExprKind::AddressOf { .. } + | ExprKind::RawBorrow { .. } | ExprKind::Match { .. } | ExprKind::If { .. } | ExprKind::Loop { .. } diff --git a/compiler/rustc_mir_build/src/build/expr/as_rvalue.rs b/compiler/rustc_mir_build/src/build/expr/as_rvalue.rs index 379d2140c09..0c9571da3cf 100644 --- a/compiler/rustc_mir_build/src/build/expr/as_rvalue.rs +++ b/compiler/rustc_mir_build/src/build/expr/as_rvalue.rs @@ -512,7 +512,7 @@ impl<'a, 'tcx> Builder<'a, 'tcx> { | ExprKind::NeverToAny { .. } | ExprKind::Use { .. } | ExprKind::Borrow { .. } - | ExprKind::AddressOf { .. } + | ExprKind::RawBorrow { .. } | ExprKind::Adt { .. } | ExprKind::Loop { .. } | ExprKind::LogicalOp { .. } diff --git a/compiler/rustc_mir_build/src/build/expr/category.rs b/compiler/rustc_mir_build/src/build/expr/category.rs index e07ba6b6e93..e0349e3e3f6 100644 --- a/compiler/rustc_mir_build/src/build/expr/category.rs +++ b/compiler/rustc_mir_build/src/build/expr/category.rs @@ -51,7 +51,7 @@ impl Category { | ExprKind::Use { .. } | ExprKind::Adt { .. } | ExprKind::Borrow { .. } - | ExprKind::AddressOf { .. } + | ExprKind::RawBorrow { .. } | ExprKind::Yield { .. } | ExprKind::Call { .. } | ExprKind::InlineAsm { .. } => Some(Category::Rvalue(RvalueFunc::Into)), diff --git a/compiler/rustc_mir_build/src/build/expr/into.rs b/compiler/rustc_mir_build/src/build/expr/into.rs index 01b32b8e05e..1c805ed20cc 100644 --- a/compiler/rustc_mir_build/src/build/expr/into.rs +++ b/compiler/rustc_mir_build/src/build/expr/into.rs @@ -303,12 +303,12 @@ impl<'a, 'tcx> Builder<'a, 'tcx> { this.cfg.push_assign(block, source_info, destination, borrow); block.unit() } - ExprKind::AddressOf { mutability, arg } => { + ExprKind::RawBorrow { mutability, arg } => { let place = match mutability { hir::Mutability::Not => this.as_read_only_place(block, arg), hir::Mutability::Mut => this.as_place(block, arg), }; - let address_of = Rvalue::AddressOf(mutability, unpack!(block = place)); + let address_of = Rvalue::RawPtr(mutability, unpack!(block = place)); this.cfg.push_assign(block, source_info, destination, address_of); block.unit() } diff --git a/compiler/rustc_mir_build/src/check_unsafety.rs b/compiler/rustc_mir_build/src/check_unsafety.rs index 9b85ad0ad08..e4e5844d2ef 100644 --- a/compiler/rustc_mir_build/src/check_unsafety.rs +++ b/compiler/rustc_mir_build/src/check_unsafety.rs @@ -397,7 +397,7 @@ impl<'a, 'tcx> Visitor<'a, 'tcx> for UnsafetyVisitor<'a, 'tcx> { | ExprKind::Scope { .. } | ExprKind::Cast { .. } => {} - ExprKind::AddressOf { .. } + ExprKind::RawBorrow { .. } | ExprKind::Adt { .. } | ExprKind::Array { .. } | ExprKind::Binary { .. } @@ -498,7 +498,7 @@ impl<'a, 'tcx> Visitor<'a, 'tcx> for UnsafetyVisitor<'a, 'tcx> { } } } - ExprKind::AddressOf { arg, .. } => { + ExprKind::RawBorrow { arg, .. } => { if let ExprKind::Scope { value: arg, .. } = self.thir[arg].kind // THIR desugars UNSAFE_STATIC into *UNSAFE_STATIC_REF, where // UNSAFE_STATIC_REF holds the addr of the UNSAFE_STATIC, so: take two steps diff --git a/compiler/rustc_mir_build/src/thir/cx/expr.rs b/compiler/rustc_mir_build/src/thir/cx/expr.rs index d4de5fac96e..2cbaed2cc62 100644 --- a/compiler/rustc_mir_build/src/thir/cx/expr.rs +++ b/compiler/rustc_mir_build/src/thir/cx/expr.rs @@ -143,7 +143,7 @@ impl<'tcx> Cx<'tcx> { arg: self.thir.exprs.push(expr), }, Adjust::Borrow(AutoBorrow::RawPtr(mutability)) => { - ExprKind::AddressOf { mutability, arg: self.thir.exprs.push(expr) } + ExprKind::RawBorrow { mutability, arg: self.thir.exprs.push(expr) } } Adjust::DynStar => ExprKind::Cast { source: self.thir.exprs.push(expr) }, }; @@ -396,7 +396,7 @@ impl<'tcx> Cx<'tcx> { } hir::ExprKind::AddrOf(hir::BorrowKind::Raw, mutability, arg) => { - ExprKind::AddressOf { mutability, arg: self.mirror_expr(arg) } + ExprKind::RawBorrow { mutability, arg: self.mirror_expr(arg) } } hir::ExprKind::Block(blk, _) => ExprKind::Block { block: self.mirror_block(blk) }, diff --git a/compiler/rustc_mir_build/src/thir/cx/mod.rs b/compiler/rustc_mir_build/src/thir/cx/mod.rs index 6120b1453cf..5b5f97cb514 100644 --- a/compiler/rustc_mir_build/src/thir/cx/mod.rs +++ b/compiler/rustc_mir_build/src/thir/cx/mod.rs @@ -8,7 +8,7 @@ use rustc_hir as hir; use rustc_hir::def::DefKind; use rustc_hir::def_id::{DefId, LocalDefId}; use rustc_hir::lang_items::LangItem; -use rustc_hir::{HirId, Node}; +use rustc_hir::HirId; use rustc_middle::bug; use rustc_middle::middle::region; use rustc_middle::thir::*; @@ -110,11 +110,7 @@ impl<'tcx> Cx<'tcx> { } #[instrument(level = "debug", skip(self))] - fn pattern_from_hir(&mut self, p: &hir::Pat<'_>) -> Box<Pat<'tcx>> { - let p = match self.tcx.hir_node(p.hir_id) { - Node::Pat(p) => p, - node => bug!("pattern became {:?}", node), - }; + fn pattern_from_hir(&mut self, p: &'tcx hir::Pat<'tcx>) -> Box<Pat<'tcx>> { pat_from_hir(self.tcx, self.param_env, self.typeck_results(), p) } diff --git a/compiler/rustc_mir_build/src/thir/pattern/check_match.rs b/compiler/rustc_mir_build/src/thir/pattern/check_match.rs index 85b9dacb129..bc1acd51c69 100644 --- a/compiler/rustc_mir_build/src/thir/pattern/check_match.rs +++ b/compiler/rustc_mir_build/src/thir/pattern/check_match.rs @@ -325,7 +325,7 @@ impl<'p, 'tcx> MatchVisitor<'p, 'tcx> { Assign { .. } | AssignOp { .. } | InlineAsm { .. } | Let { .. } => true, // These evaluate to a value. - AddressOf { .. } + RawBorrow { .. } | Adt { .. } | Array { .. } | Binary { .. } diff --git a/compiler/rustc_mir_build/src/thir/print.rs b/compiler/rustc_mir_build/src/thir/print.rs index 2d4b39e7b08..ce7774f5948 100644 --- a/compiler/rustc_mir_build/src/thir/print.rs +++ b/compiler/rustc_mir_build/src/thir/print.rs @@ -379,8 +379,8 @@ impl<'a, 'tcx> ThirPrinter<'a, 'tcx> { self.print_expr(*arg, depth_lvl + 2); print_indented!(self, ")", depth_lvl); } - AddressOf { mutability, arg } => { - print_indented!(self, "AddressOf {", depth_lvl); + RawBorrow { mutability, arg } => { + print_indented!(self, "RawBorrow {", depth_lvl); print_indented!(self, format!("mutability: {:?}", mutability), depth_lvl + 1); print_indented!(self, "arg:", depth_lvl + 1); self.print_expr(*arg, depth_lvl + 2); diff --git a/compiler/rustc_mir_dataflow/src/elaborate_drops.rs b/compiler/rustc_mir_dataflow/src/elaborate_drops.rs index 2ec3b53bc98..d7e738b8829 100644 --- a/compiler/rustc_mir_dataflow/src/elaborate_drops.rs +++ b/compiler/rustc_mir_dataflow/src/elaborate_drops.rs @@ -703,7 +703,7 @@ where statements: vec![ self.assign( ptr, - Rvalue::AddressOf(Mutability::Mut, tcx.mk_place_index(self.place, cur)), + Rvalue::RawPtr(Mutability::Mut, tcx.mk_place_index(self.place, cur)), ), self.assign( cur.into(), diff --git a/compiler/rustc_mir_dataflow/src/impls/borrowed_locals.rs b/compiler/rustc_mir_dataflow/src/impls/borrowed_locals.rs index 885fdd0d58b..e8e78fb8a89 100644 --- a/compiler/rustc_mir_dataflow/src/impls/borrowed_locals.rs +++ b/compiler/rustc_mir_dataflow/src/impls/borrowed_locals.rs @@ -94,7 +94,7 @@ where match rvalue { // We ignore fake borrows as these get removed after analysis and shouldn't effect // the layout of generators. - Rvalue::AddressOf(_, borrowed_place) + Rvalue::RawPtr(_, borrowed_place) | Rvalue::Ref(_, BorrowKind::Mut { .. } | BorrowKind::Shared, borrowed_place) => { if !borrowed_place.is_indirect() { self.trans.gen_(borrowed_place.local); diff --git a/compiler/rustc_mir_dataflow/src/impls/initialized.rs b/compiler/rustc_mir_dataflow/src/impls/initialized.rs index 7822fb17f72..ddfd0739358 100644 --- a/compiler/rustc_mir_dataflow/src/impls/initialized.rs +++ b/compiler/rustc_mir_dataflow/src/impls/initialized.rs @@ -351,7 +351,7 @@ impl<'tcx> GenKillAnalysis<'tcx> for MaybeInitializedPlaces<'_, '_, 'tcx> { && let Some((_, rvalue)) = statement.kind.as_assign() && let mir::Rvalue::Ref(_, mir::BorrowKind::Mut { .. }, place) // FIXME: Does `&raw const foo` allow mutation? See #90413. - | mir::Rvalue::AddressOf(_, place) = rvalue + | mir::Rvalue::RawPtr(_, place) = rvalue && let LookupResult::Exact(mpi) = self.move_data().rev_lookup.find(place.as_ref()) { on_all_children_bits(self.move_data(), mpi, |child| { diff --git a/compiler/rustc_mir_dataflow/src/impls/liveness.rs b/compiler/rustc_mir_dataflow/src/impls/liveness.rs index 48bdb131601..24a4b32ceb7 100644 --- a/compiler/rustc_mir_dataflow/src/impls/liveness.rs +++ b/compiler/rustc_mir_dataflow/src/impls/liveness.rs @@ -189,13 +189,13 @@ impl DefUse { // All other contexts are uses... PlaceContext::MutatingUse( - MutatingUseContext::AddressOf + MutatingUseContext::RawBorrow | MutatingUseContext::Borrow | MutatingUseContext::Drop | MutatingUseContext::Retag, ) | PlaceContext::NonMutatingUse( - NonMutatingUseContext::AddressOf + NonMutatingUseContext::RawBorrow | NonMutatingUseContext::Copy | NonMutatingUseContext::Inspect | NonMutatingUseContext::Move diff --git a/compiler/rustc_mir_dataflow/src/move_paths/builder.rs b/compiler/rustc_mir_dataflow/src/move_paths/builder.rs index 86091379f5a..14390723ba4 100644 --- a/compiler/rustc_mir_dataflow/src/move_paths/builder.rs +++ b/compiler/rustc_mir_dataflow/src/move_paths/builder.rs @@ -432,7 +432,7 @@ impl<'b, 'a, 'tcx, F: Fn(Ty<'tcx>) -> bool> Gatherer<'b, 'a, 'tcx, F> { } Rvalue::CopyForDeref(..) => unreachable!(), Rvalue::Ref(..) - | Rvalue::AddressOf(..) + | Rvalue::RawPtr(..) | Rvalue::Discriminant(..) | Rvalue::Len(..) | Rvalue::NullaryOp( diff --git a/compiler/rustc_mir_dataflow/src/value_analysis.rs b/compiler/rustc_mir_dataflow/src/value_analysis.rs index 139fd592f69..2b20a35b61e 100644 --- a/compiler/rustc_mir_dataflow/src/value_analysis.rs +++ b/compiler/rustc_mir_dataflow/src/value_analysis.rs @@ -177,7 +177,7 @@ pub trait ValueAnalysis<'tcx> { match rvalue { Rvalue::Use(operand) => self.handle_operand(operand, state), Rvalue::CopyForDeref(place) => self.handle_operand(&Operand::Copy(*place), state), - Rvalue::Ref(..) | Rvalue::AddressOf(..) => { + Rvalue::Ref(..) | Rvalue::RawPtr(..) => { // We don't track such places. ValueOrPlace::TOP } diff --git a/compiler/rustc_mir_transform/src/add_retag.rs b/compiler/rustc_mir_transform/src/add_retag.rs index 16977a63c59..12a68790374 100644 --- a/compiler/rustc_mir_transform/src/add_retag.rs +++ b/compiler/rustc_mir_transform/src/add_retag.rs @@ -131,9 +131,9 @@ impl<'tcx> MirPass<'tcx> for AddRetag { // Ptr-creating operations already do their own internal retagging, no // need to also add a retag statement. // *Except* if we are deref'ing a Box, because those get desugared to directly working - // with the inner raw pointer! That's relevant for `AddressOf` as Miri otherwise makes it + // with the inner raw pointer! That's relevant for `RawPtr` as Miri otherwise makes it // a NOP when the original pointer is already raw. - Rvalue::AddressOf(_mutbl, place) => { + Rvalue::RawPtr(_mutbl, place) => { // Using `is_box_global` here is a bit sketchy: if this code is // generic over the allocator, we'll not add a retag! This is a hack // to make Stacked Borrows compatible with custom allocator code. diff --git a/compiler/rustc_mir_transform/src/check_alignment.rs b/compiler/rustc_mir_transform/src/check_alignment.rs index a1dbd7dc50e..5dfdcfc8b94 100644 --- a/compiler/rustc_mir_transform/src/check_alignment.rs +++ b/compiler/rustc_mir_transform/src/check_alignment.rs @@ -71,7 +71,7 @@ struct PointerFinder<'tcx, 'a> { impl<'tcx, 'a> Visitor<'tcx> for PointerFinder<'tcx, 'a> { fn visit_place(&mut self, place: &Place<'tcx>, context: PlaceContext, location: Location) { // We want to only check reads and writes to Places, so we specifically exclude - // Borrows and AddressOf. + // Borrow and RawBorrow. match context { PlaceContext::MutatingUse( MutatingUseContext::Store diff --git a/compiler/rustc_mir_transform/src/deduce_param_attrs.rs b/compiler/rustc_mir_transform/src/deduce_param_attrs.rs index 370e930b740..71af099199e 100644 --- a/compiler/rustc_mir_transform/src/deduce_param_attrs.rs +++ b/compiler/rustc_mir_transform/src/deduce_param_attrs.rs @@ -40,7 +40,7 @@ impl<'tcx> Visitor<'tcx> for DeduceReadOnly { // This is a mutation, so mark it as such. true } - PlaceContext::NonMutatingUse(NonMutatingUseContext::AddressOf) => { + PlaceContext::NonMutatingUse(NonMutatingUseContext::RawBorrow) => { // Whether mutating though a `&raw const` is allowed is still undecided, so we // disable any sketchy `readonly` optimizations for now. // But we only need to do this if the pointer would point into the argument. diff --git a/compiler/rustc_mir_transform/src/dest_prop.rs b/compiler/rustc_mir_transform/src/dest_prop.rs index 054cdbc6bad..ed924761892 100644 --- a/compiler/rustc_mir_transform/src/dest_prop.rs +++ b/compiler/rustc_mir_transform/src/dest_prop.rs @@ -576,7 +576,7 @@ impl WriteInfo { Rvalue::ThreadLocalRef(_) | Rvalue::NullaryOp(_, _) | Rvalue::Ref(_, _, _) - | Rvalue::AddressOf(_, _) + | Rvalue::RawPtr(_, _) | Rvalue::Len(_) | Rvalue::Discriminant(_) | Rvalue::CopyForDeref(_) => (), diff --git a/compiler/rustc_mir_transform/src/gvn.rs b/compiler/rustc_mir_transform/src/gvn.rs index e16911d79c3..90e3ba26a43 100644 --- a/compiler/rustc_mir_transform/src/gvn.rs +++ b/compiler/rustc_mir_transform/src/gvn.rs @@ -45,7 +45,7 @@ //! //! # Handling of references //! -//! We handle references by assigning a different "provenance" index to each Ref/AddressOf rvalue. +//! We handle references by assigning a different "provenance" index to each Ref/RawPtr rvalue. //! This ensure that we do not spuriously merge borrows that should not be merged. Meanwhile, we //! consider all the derefs of an immutable reference to a freeze type to give the same value: //! ```ignore (MIR) @@ -832,7 +832,7 @@ impl<'body, 'tcx> VnState<'body, 'tcx> { self.simplify_place_projection(place, location); return self.new_pointer(*place, AddressKind::Ref(borrow_kind)); } - Rvalue::AddressOf(mutbl, ref mut place) => { + Rvalue::RawPtr(mutbl, ref mut place) => { self.simplify_place_projection(place, location); return self.new_pointer(*place, AddressKind::Address(mutbl)); } diff --git a/compiler/rustc_mir_transform/src/instsimplify.rs b/compiler/rustc_mir_transform/src/instsimplify.rs index 1589653968c..3ec553d0ba0 100644 --- a/compiler/rustc_mir_transform/src/instsimplify.rs +++ b/compiler/rustc_mir_transform/src/instsimplify.rs @@ -141,7 +141,7 @@ impl<'tcx> InstSimplifyContext<'tcx, '_> { /// Transform `&(*a)` ==> `a`. fn simplify_ref_deref(&self, source_info: &SourceInfo, rvalue: &mut Rvalue<'tcx>) { - if let Rvalue::Ref(_, _, place) | Rvalue::AddressOf(_, place) = rvalue { + if let Rvalue::Ref(_, _, place) | Rvalue::RawPtr(_, place) = rvalue { if let Some((base, ProjectionElem::Deref)) = place.as_ref().last_projection() { if rvalue.ty(self.local_decls, self.tcx) != base.ty(self.local_decls, self.tcx).ty { return; diff --git a/compiler/rustc_mir_transform/src/known_panics_lint.rs b/compiler/rustc_mir_transform/src/known_panics_lint.rs index 7202cc2d042..7eed47cf239 100644 --- a/compiler/rustc_mir_transform/src/known_panics_lint.rs +++ b/compiler/rustc_mir_transform/src/known_panics_lint.rs @@ -419,8 +419,8 @@ impl<'mir, 'tcx> ConstPropagator<'mir, 'tcx> { } // Do not try creating references (#67862) - Rvalue::AddressOf(_, place) | Rvalue::Ref(_, _, place) => { - trace!("skipping AddressOf | Ref for {:?}", place); + Rvalue::RawPtr(_, place) | Rvalue::Ref(_, _, place) => { + trace!("skipping RawPtr | Ref for {:?}", place); // This may be creating mutable references or immutable references to cells. // If that happens, the pointed to value could be mutated via that reference. @@ -616,7 +616,7 @@ impl<'mir, 'tcx> ConstPropagator<'mir, 'tcx> { ImmTy::from_scalar(Scalar::from_target_usize(len, self), layout).into() } - Ref(..) | AddressOf(..) => return None, + Ref(..) | RawPtr(..) => return None, NullaryOp(ref null_op, ty) => { let op_layout = self.use_ecx(|this| this.ecx.layout_of(ty))?; @@ -969,9 +969,9 @@ impl<'tcx> Visitor<'tcx> for CanConstProp { // mutation. | NonMutatingUse(NonMutatingUseContext::SharedBorrow) | NonMutatingUse(NonMutatingUseContext::FakeBorrow) - | NonMutatingUse(NonMutatingUseContext::AddressOf) + | NonMutatingUse(NonMutatingUseContext::RawBorrow) | MutatingUse(MutatingUseContext::Borrow) - | MutatingUse(MutatingUseContext::AddressOf) => { + | MutatingUse(MutatingUseContext::RawBorrow) => { trace!("local {:?} can't be propagated because it's used: {:?}", local, context); self.can_const_prop[local] = ConstPropMode::NoPropagation; } diff --git a/compiler/rustc_mir_transform/src/large_enums.rs b/compiler/rustc_mir_transform/src/large_enums.rs index e407929c9a7..cbc3169f2f1 100644 --- a/compiler/rustc_mir_transform/src/large_enums.rs +++ b/compiler/rustc_mir_transform/src/large_enums.rs @@ -214,7 +214,7 @@ impl EnumSizeOpt { source_info, kind: StatementKind::Assign(Box::new(( dst, - Rvalue::AddressOf(Mutability::Mut, *lhs), + Rvalue::RawPtr(Mutability::Mut, *lhs), ))), }; @@ -238,7 +238,7 @@ impl EnumSizeOpt { source_info, kind: StatementKind::Assign(Box::new(( src, - Rvalue::AddressOf(Mutability::Not, *rhs), + Rvalue::RawPtr(Mutability::Not, *rhs), ))), }; diff --git a/compiler/rustc_mir_transform/src/promote_consts.rs b/compiler/rustc_mir_transform/src/promote_consts.rs index 48a3266ae6f..6e84914ef97 100644 --- a/compiler/rustc_mir_transform/src/promote_consts.rs +++ b/compiler/rustc_mir_transform/src/promote_consts.rs @@ -551,7 +551,7 @@ impl<'tcx> Validator<'_, 'tcx> { self.validate_operand(rhs)?; } - Rvalue::AddressOf(_, place) => { + Rvalue::RawPtr(_, place) => { // We accept `&raw *`, i.e., raw reborrows -- creating a raw pointer is // no problem, only using it is. if let Some((place_base, ProjectionElem::Deref)) = place.as_ref().last_projection() diff --git a/compiler/rustc_mir_transform/src/ref_prop.rs b/compiler/rustc_mir_transform/src/ref_prop.rs index 76e65099e90..973a191d786 100644 --- a/compiler/rustc_mir_transform/src/ref_prop.rs +++ b/compiler/rustc_mir_transform/src/ref_prop.rs @@ -227,7 +227,7 @@ fn compute_replacement<'tcx>( } } } - Rvalue::Ref(_, _, place) | Rvalue::AddressOf(_, place) => { + Rvalue::Ref(_, _, place) | Rvalue::RawPtr(_, place) => { let mut place = *place; // Try to see through `place` in order to collapse reborrow chains. if place.projection.first() == Some(&PlaceElem::Deref) 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 ea4f5fca59e..9c3f903e0ea 100644 --- a/compiler/rustc_mir_transform/src/shim/async_destructor_ctor.rs +++ b/compiler/rustc_mir_transform/src/shim/async_destructor_ctor.rs @@ -343,7 +343,7 @@ impl<'tcx> AsyncDestructorCtorShimBuilder<'tcx> { .tcx .mk_place_elems(&[PlaceElem::Deref, PlaceElem::Field(field, field_ty)]), }; - self.put_temp_rvalue(Rvalue::AddressOf(Mutability::Mut, place)) + self.put_temp_rvalue(Rvalue::RawPtr(Mutability::Mut, place)) } /// If given Self is an enum puts `to_drop: *mut FieldTy` on top of @@ -363,7 +363,7 @@ impl<'tcx> AsyncDestructorCtorShimBuilder<'tcx> { PlaceElem::Field(field, field_ty), ]), }; - self.put_temp_rvalue(Rvalue::AddressOf(Mutability::Mut, place)) + self.put_temp_rvalue(Rvalue::RawPtr(Mutability::Mut, place)) } /// If given Self is an enum puts `to_drop: *mut FieldTy` on top of diff --git a/compiler/rustc_mir_transform/src/simplify.rs b/compiler/rustc_mir_transform/src/simplify.rs index 5bbe3bb747f..4fe8cf6213f 100644 --- a/compiler/rustc_mir_transform/src/simplify.rs +++ b/compiler/rustc_mir_transform/src/simplify.rs @@ -31,6 +31,7 @@ use rustc_index::{Idx, IndexSlice, IndexVec}; use rustc_middle::mir::visit::{MutVisitor, MutatingUseContext, PlaceContext, Visitor}; use rustc_middle::mir::*; use rustc_middle::ty::TyCtxt; +use rustc_span::DUMMY_SP; use smallvec::SmallVec; pub enum SimplifyCfg { @@ -318,6 +319,7 @@ pub(crate) fn remove_dead_blocks(body: &mut Body<'_>) { let mut orig_index = 0; let mut used_index = 0; let mut kept_unreachable = None; + let mut deduplicated_unreachable = false; basic_blocks.raw.retain(|bbdata| { let orig_bb = BasicBlock::new(orig_index); if !reachable.contains(orig_bb) { @@ -330,6 +332,7 @@ pub(crate) fn remove_dead_blocks(body: &mut Body<'_>) { let kept_unreachable = *kept_unreachable.get_or_insert(used_bb); if kept_unreachable != used_bb { replacements[orig_index] = kept_unreachable; + deduplicated_unreachable = true; orig_index += 1; return false; } @@ -341,6 +344,14 @@ pub(crate) fn remove_dead_blocks(body: &mut Body<'_>) { true }); + // If we deduplicated unreachable blocks we erase their source_info as we + // can no longer attribute their code to a particular location in the + // source. + if deduplicated_unreachable { + basic_blocks[kept_unreachable.unwrap()].terminator_mut().source_info = + SourceInfo { span: DUMMY_SP, scope: OUTERMOST_SOURCE_SCOPE }; + } + for block in basic_blocks { for target in block.terminator_mut().successors_mut() { *target = replacements[target.index()]; diff --git a/compiler/rustc_mir_transform/src/ssa.rs b/compiler/rustc_mir_transform/src/ssa.rs index fb870425f6e..76591f52625 100644 --- a/compiler/rustc_mir_transform/src/ssa.rs +++ b/compiler/rustc_mir_transform/src/ssa.rs @@ -2,9 +2,9 @@ //! 1/ They are only assigned-to once, either as a function parameter, or in an assign statement; //! 2/ This single assignment dominates all uses; //! -//! As we do not track indirect assignments, a local that has its address taken (either by -//! AddressOf or by borrowing) is considered non-SSA. However, it is UB to modify through an -//! immutable borrow of a `Freeze` local. Those can still be considered to be SSA. +//! As we do not track indirect assignments, a local that has its address taken (via a borrow or raw +//! borrow operator) is considered non-SSA. However, it is UB to modify through an immutable borrow +//! of a `Freeze` local. Those can still be considered to be SSA. use rustc_data_structures::graph::dominators::Dominators; use rustc_index::bit_set::BitSet; @@ -262,7 +262,7 @@ impl<'tcx> Visitor<'tcx> for SsaVisitor<'tcx, '_> { PlaceContext::MutatingUse(MutatingUseContext::Projection) | PlaceContext::NonMutatingUse(NonMutatingUseContext::Projection) => bug!(), // Anything can happen with raw pointers, so remove them. - PlaceContext::NonMutatingUse(NonMutatingUseContext::AddressOf) + PlaceContext::NonMutatingUse(NonMutatingUseContext::RawBorrow) | PlaceContext::MutatingUse(_) => { self.assignments[local] = Set1::Many; } diff --git a/compiler/rustc_mir_transform/src/validate.rs b/compiler/rustc_mir_transform/src/validate.rs index 491ae1c0d08..36908036796 100644 --- a/compiler/rustc_mir_transform/src/validate.rs +++ b/compiler/rustc_mir_transform/src/validate.rs @@ -1345,7 +1345,7 @@ impl<'a, 'tcx> Visitor<'tcx> for TypeChecker<'a, 'tcx> { } Rvalue::Repeat(_, _) | Rvalue::ThreadLocalRef(_) - | Rvalue::AddressOf(_, _) + | Rvalue::RawPtr(_, _) | Rvalue::NullaryOp(NullOp::SizeOf | NullOp::AlignOf | NullOp::UbChecks, _) | Rvalue::Discriminant(_) => {} } diff --git a/compiler/rustc_parse/src/parser/attr.rs b/compiler/rustc_parse/src/parser/attr.rs index 3d06017fcf3..6391ff901cb 100644 --- a/compiler/rustc_parse/src/parser/attr.rs +++ b/compiler/rustc_parse/src/parser/attr.rs @@ -4,7 +4,7 @@ use rustc_ast::token::{self, Delimiter}; use rustc_errors::codes::*; use rustc_errors::{Diag, PResult}; use rustc_span::symbol::kw; -use rustc_span::{sym, BytePos, Span}; +use rustc_span::{BytePos, Span}; use thin_vec::ThinVec; use tracing::debug; @@ -265,7 +265,6 @@ impl<'a> Parser<'a> { let is_unsafe = this.eat_keyword(kw::Unsafe); let unsafety = if is_unsafe { let unsafe_span = this.prev_token.span; - this.psess.gated_spans.gate(sym::unsafe_attributes, unsafe_span); this.expect(&token::OpenDelim(Delimiter::Parenthesis))?; ast::Safety::Unsafe(unsafe_span) } else { @@ -406,7 +405,6 @@ impl<'a> Parser<'a> { }; let unsafety = if is_unsafe { let unsafe_span = self.prev_token.span; - self.psess.gated_spans.gate(sym::unsafe_attributes, unsafe_span); self.expect(&token::OpenDelim(Delimiter::Parenthesis))?; ast::Safety::Unsafe(unsafe_span) diff --git a/compiler/rustc_parse/src/parser/expr.rs b/compiler/rustc_parse/src/parser/expr.rs index e0917ba43e4..422206ebbce 100644 --- a/compiler/rustc_parse/src/parser/expr.rs +++ b/compiler/rustc_parse/src/parser/expr.rs @@ -851,7 +851,7 @@ impl<'a> Parser<'a> { self.expect_and()?; let has_lifetime = self.token.is_lifetime() && self.look_ahead(1, |t| t != &token::Colon); let lifetime = has_lifetime.then(|| self.expect_lifetime()); // For recovery, see below. - let (borrow_kind, mutbl) = self.parse_borrow_modifiers(lo); + let (borrow_kind, mutbl) = self.parse_borrow_modifiers(); let attrs = self.parse_outer_attributes()?; let expr = if self.token.is_range_separator() { self.parse_expr_prefix_range(attrs) @@ -871,13 +871,12 @@ impl<'a> Parser<'a> { } /// Parse `mut?` or `raw [ const | mut ]`. - fn parse_borrow_modifiers(&mut self, lo: Span) -> (ast::BorrowKind, ast::Mutability) { + fn parse_borrow_modifiers(&mut self) -> (ast::BorrowKind, ast::Mutability) { if self.check_keyword(kw::Raw) && self.look_ahead(1, Token::is_mutability) { // `raw [ const | mut ]`. let found_raw = self.eat_keyword(kw::Raw); assert!(found_raw); let mutability = self.parse_const_or_mut().unwrap(); - self.psess.gated_spans.gate(sym::raw_ref_op, lo.to(self.prev_token.span)); (ast::BorrowKind::Raw, mutability) } else { // `mut?` diff --git a/compiler/rustc_parse/src/validate_attr.rs b/compiler/rustc_parse/src/validate_attr.rs index a64c00f3b6c..fce41bd90be 100644 --- a/compiler/rustc_parse/src/validate_attr.rs +++ b/compiler/rustc_parse/src/validate_attr.rs @@ -7,9 +7,7 @@ use rustc_ast::{ NestedMetaItem, Safety, }; use rustc_errors::{Applicability, FatalError, PResult}; -use rustc_feature::{ - AttributeSafety, AttributeTemplate, BuiltinAttribute, Features, BUILTIN_ATTRIBUTE_MAP, -}; +use rustc_feature::{AttributeSafety, AttributeTemplate, BuiltinAttribute, BUILTIN_ATTRIBUTE_MAP}; use rustc_session::errors::report_lit_error; use rustc_session::lint::builtin::{ILL_FORMED_ATTRIBUTE_INPUT, UNSAFE_ATTR_OUTSIDE_UNSAFE}; use rustc_session::lint::BuiltinLintDiag; @@ -18,7 +16,7 @@ use rustc_span::{sym, BytePos, Span, Symbol}; use crate::{errors, parse_in}; -pub fn check_attr(features: &Features, psess: &ParseSess, attr: &Attribute) { +pub fn check_attr(psess: &ParseSess, attr: &Attribute) { if attr.is_doc_comment() { return; } @@ -28,7 +26,7 @@ pub fn check_attr(features: &Features, psess: &ParseSess, attr: &Attribute) { // All non-builtin attributes are considered safe let safety = attr_info.map(|x| x.safety).unwrap_or(AttributeSafety::Normal); - check_attribute_safety(features, psess, safety, attr); + check_attribute_safety(psess, safety, attr); // Check input tokens for built-in and key-value attributes. match attr_info { @@ -36,9 +34,9 @@ pub fn check_attr(features: &Features, psess: &ParseSess, attr: &Attribute) { Some(BuiltinAttribute { name, template, .. }) if *name != sym::rustc_dummy => { match parse_meta(psess, attr) { // Don't check safety again, we just did that - Ok(meta) => check_builtin_meta_item( - features, psess, &meta, attr.style, *name, *template, false, - ), + Ok(meta) => { + check_builtin_meta_item(psess, &meta, attr.style, *name, *template, false) + } Err(err) => { err.emit(); } @@ -157,16 +155,7 @@ fn is_attr_template_compatible(template: &AttributeTemplate, meta: &ast::MetaIte } } -pub fn check_attribute_safety( - features: &Features, - psess: &ParseSess, - safety: AttributeSafety, - attr: &Attribute, -) { - if !features.unsafe_attributes { - return; - } - +pub fn check_attribute_safety(psess: &ParseSess, safety: AttributeSafety, attr: &Attribute) { let attr_item = attr.get_normal_item(); if safety == AttributeSafety::Unsafe { @@ -215,21 +204,18 @@ pub fn check_attribute_safety( // Called by `check_builtin_meta_item` and code that manually denies // `unsafe(...)` in `cfg` -pub fn deny_builtin_meta_unsafety(features: &Features, psess: &ParseSess, meta: &MetaItem) { +pub fn deny_builtin_meta_unsafety(psess: &ParseSess, meta: &MetaItem) { // This only supports denying unsafety right now - making builtin attributes // support unsafety will requite us to thread the actual `Attribute` through // for the nice diagnostics. - if features.unsafe_attributes { - if let Safety::Unsafe(unsafe_span) = meta.unsafety { - psess - .dcx() - .emit_err(errors::InvalidAttrUnsafe { span: unsafe_span, name: meta.path.clone() }); - } + if let Safety::Unsafe(unsafe_span) = meta.unsafety { + psess + .dcx() + .emit_err(errors::InvalidAttrUnsafe { span: unsafe_span, name: meta.path.clone() }); } } pub fn check_builtin_meta_item( - features: &Features, psess: &ParseSess, meta: &MetaItem, style: ast::AttrStyle, @@ -246,7 +232,7 @@ pub fn check_builtin_meta_item( } if deny_unsafety { - deny_builtin_meta_unsafety(features, psess, meta); + deny_builtin_meta_unsafety(psess, meta); } } diff --git a/compiler/rustc_passes/messages.ftl b/compiler/rustc_passes/messages.ftl index 0318d34fb73..dfc726efeb9 100644 --- a/compiler/rustc_passes/messages.ftl +++ b/compiler/rustc_passes/messages.ftl @@ -430,6 +430,10 @@ passes_link_section = .warn = {-passes_previously_accepted} .label = not a function or static +passes_linkage = + attribute should be applied to a function or static + .label = not a function definition or static + passes_macro_export = `#[macro_export]` only has an effect on macro definitions @@ -440,6 +444,9 @@ passes_macro_export_on_decl_macro = passes_macro_use = `#[{$name}]` only has an effect on `extern crate` and modules +passes_may_dangle = + `#[may_dangle]` must be applied to a lifetime or type generic parameter in `Drop` impl + passes_maybe_string_interpolation = you might have meant to use string interpolation in this string literal passes_missing_const_err = attributes `#[rustc_const_unstable]` and `#[rustc_const_stable]` require the function or method to be `const` @@ -471,8 +478,8 @@ passes_multiple_start_functions = .previous = previous `#[start]` function here passes_must_not_suspend = - `must_not_suspend` attribute should be applied to a struct, enum, or trait - .label = is not a struct, enum, or trait + `must_not_suspend` attribute should be applied to a struct, enum, union, or trait + .label = is not a struct, enum, union, or trait passes_must_use_async = `must_use` attribute on `async` functions applies to the anonymous `Future` returned by the function, not the value within diff --git a/compiler/rustc_passes/src/check_attr.rs b/compiler/rustc_passes/src/check_attr.rs index bd157d1d619..e3c2999142f 100644 --- a/compiler/rustc_passes/src/check_attr.rs +++ b/compiler/rustc_passes/src/check_attr.rs @@ -189,6 +189,7 @@ impl<'tcx> CheckAttrVisitor<'tcx> { [sym::collapse_debuginfo, ..] => self.check_collapse_debuginfo(attr, span, target), [sym::must_not_suspend, ..] => self.check_must_not_suspend(attr, span, target), [sym::must_use, ..] => self.check_must_use(hir_id, attr, target), + [sym::may_dangle, ..] => self.check_may_dangle(hir_id, attr), [sym::rustc_pass_by_value, ..] => self.check_pass_by_value(attr, span, target), [sym::rustc_allow_incoherent_impl, ..] => { self.check_allow_incoherent_impl(attr, span, target) @@ -243,6 +244,7 @@ impl<'tcx> CheckAttrVisitor<'tcx> { [sym::coroutine, ..] => { self.check_coroutine(attr, target); } + [sym::linkage, ..] => self.check_linkage(attr, span, target), [ // ok sym::allow @@ -254,9 +256,7 @@ impl<'tcx> CheckAttrVisitor<'tcx> { | sym::cfg_attr // need to be fixed | sym::cfi_encoding // FIXME(cfi_encoding) - | sym::may_dangle // FIXME(dropck_eyepatch) | sym::pointee // FIXME(derive_smart_pointer) - | sym::linkage // FIXME(linkage) | sym::omit_gdb_pretty_printer_section // FIXME(omit_gdb_pretty_printer_section) | sym::used // handled elsewhere to restrict to static items | sym::repr // handled elsewhere to restrict to type decls items @@ -1363,7 +1363,7 @@ impl<'tcx> CheckAttrVisitor<'tcx> { } } - /// Checks if `#[must_not_suspend]` is applied to a function. + /// Checks if `#[must_not_suspend]` is applied to a struct, enum, union, or trait. fn check_must_not_suspend(&self, attr: &Attribute, span: Span, target: Target) { match target { Target::Struct | Target::Enum | Target::Union | Target::Trait => {} @@ -1373,6 +1373,27 @@ impl<'tcx> CheckAttrVisitor<'tcx> { } } + /// Checks if `#[may_dangle]` is applied to a lifetime or type generic parameter in `Drop` impl. + fn check_may_dangle(&self, hir_id: HirId, attr: &Attribute) { + if let hir::Node::GenericParam(param) = self.tcx.hir_node(hir_id) + && matches!( + param.kind, + hir::GenericParamKind::Lifetime { .. } | hir::GenericParamKind::Type { .. } + ) + && matches!(param.source, hir::GenericParamSource::Generics) + && let parent_hir_id = self.tcx.parent_hir_id(hir_id) + && let hir::Node::Item(item) = self.tcx.hir_node(parent_hir_id) + && let hir::ItemKind::Impl(impl_) = item.kind + && let Some(trait_) = impl_.of_trait + && let Some(def_id) = trait_.trait_def_id() + && self.tcx.is_lang_item(def_id, hir::LangItem::Drop) + { + return; + } + + self.dcx().emit_err(errors::InvalidMayDangle { attr_span: attr.span }); + } + /// Checks if `#[cold]` is applied to a non-function. fn check_cold(&self, hir_id: HirId, attr: &Attribute, span: Span, target: Target) { match target { @@ -2347,6 +2368,19 @@ impl<'tcx> CheckAttrVisitor<'tcx> { } } } + + fn check_linkage(&self, attr: &Attribute, span: Span, target: Target) { + match target { + Target::Fn + | Target::Method(..) + | Target::Static + | Target::ForeignStatic + | Target::ForeignFn => {} + _ => { + self.dcx().emit_err(errors::Linkage { attr_span: attr.span, span }); + } + } + } } impl<'tcx> Visitor<'tcx> for CheckAttrVisitor<'tcx> { diff --git a/compiler/rustc_passes/src/errors.rs b/compiler/rustc_passes/src/errors.rs index 36dfc40e762..ee7d097e5d3 100644 --- a/compiler/rustc_passes/src/errors.rs +++ b/compiler/rustc_passes/src/errors.rs @@ -644,6 +644,15 @@ pub struct CoroutineOnNonClosure { } #[derive(Diagnostic)] +#[diag(passes_linkage)] +pub struct Linkage { + #[primary_span] + pub attr_span: Span, + #[label] + pub span: Span, +} + +#[derive(Diagnostic)] #[diag(passes_empty_confusables)] pub(crate) struct EmptyConfusables { #[primary_span] @@ -728,6 +737,13 @@ pub struct NonExportedMacroInvalidAttrs { pub attr_span: Span, } +#[derive(Diagnostic)] +#[diag(passes_may_dangle)] +pub struct InvalidMayDangle { + #[primary_span] + pub attr_span: Span, +} + #[derive(LintDiagnostic)] #[diag(passes_unused_duplicate)] pub struct UnusedDuplicate { diff --git a/compiler/rustc_passes/src/lang_items.rs b/compiler/rustc_passes/src/lang_items.rs index 3f1be87a73f..71b0ebb0e21 100644 --- a/compiler/rustc_passes/src/lang_items.rs +++ b/compiler/rustc_passes/src/lang_items.rs @@ -130,7 +130,7 @@ impl<'ast, 'tcx> LanguageItemCollector<'ast, 'tcx> { if first_defined_span.is_none() { orig_crate_name = self.tcx.crate_name(original_def_id.krate); if let Some(ExternCrate { dependency_of: inner_dependency_of, .. }) = - self.tcx.extern_crate(original_def_id) + self.tcx.extern_crate(original_def_id.krate) { orig_dependency_of = self.tcx.crate_name(*inner_dependency_of); } @@ -139,7 +139,7 @@ impl<'ast, 'tcx> LanguageItemCollector<'ast, 'tcx> { let duplicate = if item_span.is_some() { Duplicate::Plain } else { - match self.tcx.extern_crate(item_def_id) { + match self.tcx.extern_crate(item_def_id.krate) { Some(ExternCrate { dependency_of: inner_dependency_of, .. }) => { dependency_of = self.tcx.crate_name(*inner_dependency_of); Duplicate::CrateDepends diff --git a/compiler/rustc_query_impl/src/plumbing.rs b/compiler/rustc_query_impl/src/plumbing.rs index b9e700c1938..c064b2bd6c1 100644 --- a/compiler/rustc_query_impl/src/plumbing.rs +++ b/compiler/rustc_query_impl/src/plumbing.rs @@ -702,11 +702,17 @@ macro_rules! define_queries { let name = stringify!($name); $crate::plumbing::create_query_frame(tcx, rustc_middle::query::descs::$name, key, kind, name) }; - tcx.query_system.states.$name.try_collect_active_jobs( + let res = tcx.query_system.states.$name.try_collect_active_jobs( tcx, make_query, qmap, - ).unwrap(); + ); + // this can be called during unwinding, and the function has a `try_`-prefix, so + // don't `unwrap()` here, just manually check for `None` and do best-effort error + // reporting. + if res.is_none() { + tracing::warn!("Failed to collect active jobs for query with name `{}`!", stringify!($name)); + } } pub fn alloc_self_profile_query_strings<'tcx>(tcx: TyCtxt<'tcx>, string_cache: &mut QueryKeyStringCache) { diff --git a/compiler/rustc_query_system/src/query/plumbing.rs b/compiler/rustc_query_system/src/query/plumbing.rs index 8ef680cdb6c..6dbd6e89fe9 100644 --- a/compiler/rustc_query_system/src/query/plumbing.rs +++ b/compiler/rustc_query_system/src/query/plumbing.rs @@ -181,8 +181,15 @@ where cache.complete(key, result, dep_node_index); let job = { - let mut lock = state.active.lock_shard_by_value(&key); - lock.remove(&key).unwrap().expect_job() + let val = { + // don't keep the lock during the `unwrap()` of the retrieved value, or we taint the + // underlying shard. + // since unwinding also wants to look at this map, this can also prevent a double + // panic. + let mut lock = state.active.lock_shard_by_value(&key); + lock.remove(&key) + }; + val.unwrap().expect_job() }; job.signal_complete(); diff --git a/compiler/rustc_smir/src/rustc_smir/convert/mir.rs b/compiler/rustc_smir/src/rustc_smir/convert/mir.rs index da705e6f959..c442ca861d3 100644 --- a/compiler/rustc_smir/src/rustc_smir/convert/mir.rs +++ b/compiler/rustc_smir/src/rustc_smir/convert/mir.rs @@ -174,7 +174,7 @@ impl<'tcx> Stable<'tcx> for mir::Rvalue<'tcx> { ThreadLocalRef(def_id) => { stable_mir::mir::Rvalue::ThreadLocalRef(tables.crate_item(*def_id)) } - AddressOf(mutability, place) => { + RawPtr(mutability, place) => { stable_mir::mir::Rvalue::AddressOf(mutability.stable(tables), place.stable(tables)) } Len(place) => stable_mir::mir::Rvalue::Len(place.stable(tables)), diff --git a/compiler/rustc_target/src/abi/call/mod.rs b/compiler/rustc_target/src/abi/call/mod.rs index 5bfc528dffc..25e4d70945b 100644 --- a/compiler/rustc_target/src/abi/call/mod.rs +++ b/compiler/rustc_target/src/abi/call/mod.rs @@ -642,7 +642,7 @@ impl<'a, Ty> ArgAbi<'a, Ty> { pub fn make_indirect(&mut self) { match self.mode { PassMode::Direct(_) | PassMode::Pair(_, _) => { - self.mode = Self::indirect_pass_mode(&self.layout); + self.make_indirect_force(); } PassMode::Indirect { attrs: _, meta_attrs: _, on_stack: false } => { // already indirect @@ -652,6 +652,11 @@ impl<'a, Ty> ArgAbi<'a, Ty> { } } + /// Same as make_indirect, but doesn't check the current `PassMode`. + pub fn make_indirect_force(&mut self) { + self.mode = Self::indirect_pass_mode(&self.layout); + } + /// Pass this argument indirectly, by placing it at a fixed stack offset. /// This corresponds to the `byval` LLVM argument attribute. /// This is only valid for sized arguments. @@ -871,10 +876,10 @@ impl<'a, Ty> FnAbi<'a, Ty> { } "x86_64" => match abi { spec::abi::Abi::SysV64 { .. } => x86_64::compute_abi_info(cx, self), - spec::abi::Abi::Win64 { .. } => x86_win64::compute_abi_info(self), + spec::abi::Abi::Win64 { .. } => x86_win64::compute_abi_info(cx, self), _ => { if cx.target_spec().is_like_windows { - x86_win64::compute_abi_info(self) + x86_win64::compute_abi_info(cx, self) } else { x86_64::compute_abi_info(cx, self) } @@ -898,7 +903,7 @@ impl<'a, Ty> FnAbi<'a, Ty> { "csky" => csky::compute_abi_info(self), "mips" | "mips32r6" => mips::compute_abi_info(cx, self), "mips64" | "mips64r6" => mips64::compute_abi_info(cx, self), - "powerpc" => powerpc::compute_abi_info(self), + "powerpc" => powerpc::compute_abi_info(cx, self), "powerpc64" => powerpc64::compute_abi_info(cx, self), "s390x" => s390x::compute_abi_info(cx, self), "msp430" => msp430::compute_abi_info(self), diff --git a/compiler/rustc_target/src/abi/call/powerpc.rs b/compiler/rustc_target/src/abi/call/powerpc.rs index 70c32db0a87..cb80d64c943 100644 --- a/compiler/rustc_target/src/abi/call/powerpc.rs +++ b/compiler/rustc_target/src/abi/call/powerpc.rs @@ -1,4 +1,5 @@ use crate::abi::call::{ArgAbi, FnAbi}; +use crate::spec::HasTargetSpec; fn classify_ret<Ty>(ret: &mut ArgAbi<'_, Ty>) { if ret.layout.is_aggregate() { @@ -8,7 +9,17 @@ fn classify_ret<Ty>(ret: &mut ArgAbi<'_, Ty>) { } } -fn classify_arg<Ty>(arg: &mut ArgAbi<'_, Ty>) { +fn classify_arg<Ty>(cx: &impl HasTargetSpec, arg: &mut ArgAbi<'_, Ty>) { + if arg.is_ignore() { + // powerpc-unknown-linux-{gnu,musl,uclibc} doesn't ignore ZSTs. + if cx.target_spec().os == "linux" + && matches!(&*cx.target_spec().env, "gnu" | "musl" | "uclibc") + && arg.layout.is_zst() + { + arg.make_indirect_force(); + } + return; + } if arg.layout.is_aggregate() { arg.make_indirect(); } else { @@ -16,15 +27,12 @@ fn classify_arg<Ty>(arg: &mut ArgAbi<'_, Ty>) { } } -pub fn compute_abi_info<Ty>(fn_abi: &mut FnAbi<'_, Ty>) { +pub fn compute_abi_info<Ty>(cx: &impl HasTargetSpec, fn_abi: &mut FnAbi<'_, Ty>) { if !fn_abi.ret.is_ignore() { classify_ret(&mut fn_abi.ret); } for arg in fn_abi.args.iter_mut() { - if arg.is_ignore() { - continue; - } - classify_arg(arg); + classify_arg(cx, arg); } } diff --git a/compiler/rustc_target/src/abi/call/s390x.rs b/compiler/rustc_target/src/abi/call/s390x.rs index 1a2191082d5..7dcbb3e4a9e 100644 --- a/compiler/rustc_target/src/abi/call/s390x.rs +++ b/compiler/rustc_target/src/abi/call/s390x.rs @@ -3,6 +3,7 @@ use crate::abi::call::{ArgAbi, FnAbi, Reg}; use crate::abi::{HasDataLayout, TyAbiInterface}; +use crate::spec::HasTargetSpec; fn classify_ret<Ty>(ret: &mut ArgAbi<'_, Ty>) { if !ret.layout.is_aggregate() && ret.layout.size.bits() <= 64 { @@ -15,12 +16,22 @@ fn classify_ret<Ty>(ret: &mut ArgAbi<'_, Ty>) { fn classify_arg<'a, Ty, C>(cx: &C, arg: &mut ArgAbi<'a, Ty>) where Ty: TyAbiInterface<'a, C> + Copy, - C: HasDataLayout, + C: HasDataLayout + HasTargetSpec, { if !arg.layout.is_sized() { // Not touching this... return; } + if arg.is_ignore() { + // s390x-unknown-linux-{gnu,musl,uclibc} doesn't ignore ZSTs. + if cx.target_spec().os == "linux" + && matches!(&*cx.target_spec().env, "gnu" | "musl" | "uclibc") + && arg.layout.is_zst() + { + arg.make_indirect_force(); + } + return; + } if !arg.layout.is_aggregate() && arg.layout.size.bits() <= 64 { arg.extend_integer_width_to(64); return; @@ -46,16 +57,13 @@ where pub fn compute_abi_info<'a, Ty, C>(cx: &C, fn_abi: &mut FnAbi<'a, Ty>) where Ty: TyAbiInterface<'a, C> + Copy, - C: HasDataLayout, + C: HasDataLayout + HasTargetSpec, { if !fn_abi.ret.is_ignore() { classify_ret(&mut fn_abi.ret); } for arg in fn_abi.args.iter_mut() { - if arg.is_ignore() { - continue; - } classify_arg(cx, arg); } } diff --git a/compiler/rustc_target/src/abi/call/sparc64.rs b/compiler/rustc_target/src/abi/call/sparc64.rs index c0952130e04..3b2bf9b3187 100644 --- a/compiler/rustc_target/src/abi/call/sparc64.rs +++ b/compiler/rustc_target/src/abi/call/sparc64.rs @@ -4,6 +4,7 @@ use crate::abi::call::{ ArgAbi, ArgAttribute, ArgAttributes, ArgExtension, CastTarget, FnAbi, Reg, Uniform, }; use crate::abi::{self, HasDataLayout, Scalar, Size, TyAbiInterface, TyAndLayout}; +use crate::spec::HasTargetSpec; #[derive(Clone, Debug)] pub struct Sdata { @@ -211,7 +212,7 @@ where pub fn compute_abi_info<'a, Ty, C>(cx: &C, fn_abi: &mut FnAbi<'a, Ty>) where Ty: TyAbiInterface<'a, C> + Copy, - C: HasDataLayout, + C: HasDataLayout + HasTargetSpec, { if !fn_abi.ret.is_ignore() { classify_arg(cx, &mut fn_abi.ret, Size::from_bytes(32)); @@ -219,7 +220,14 @@ where for arg in fn_abi.args.iter_mut() { if arg.is_ignore() { - continue; + // sparc64-unknown-linux-{gnu,musl,uclibc} doesn't ignore ZSTs. + if cx.target_spec().os == "linux" + && matches!(&*cx.target_spec().env, "gnu" | "musl" | "uclibc") + && arg.layout.is_zst() + { + arg.make_indirect_force(); + } + return; } classify_arg(cx, arg, Size::from_bytes(16)); } diff --git a/compiler/rustc_target/src/abi/call/x86_win64.rs b/compiler/rustc_target/src/abi/call/x86_win64.rs index 4e19460bd28..6ca01cf84ea 100644 --- a/compiler/rustc_target/src/abi/call/x86_win64.rs +++ b/compiler/rustc_target/src/abi/call/x86_win64.rs @@ -1,9 +1,10 @@ use crate::abi::call::{ArgAbi, FnAbi, Reg}; use crate::abi::{Abi, Float, Primitive}; +use crate::spec::HasTargetSpec; // Win64 ABI: https://docs.microsoft.com/en-us/cpp/build/parameter-passing -pub fn compute_abi_info<Ty>(fn_abi: &mut FnAbi<'_, Ty>) { +pub fn compute_abi_info<Ty>(cx: &impl HasTargetSpec, fn_abi: &mut FnAbi<'_, Ty>) { let fixup = |a: &mut ArgAbi<'_, Ty>| { match a.layout.abi { Abi::Uninhabited | Abi::Aggregate { sized: false } => {} @@ -37,6 +38,13 @@ pub fn compute_abi_info<Ty>(fn_abi: &mut FnAbi<'_, Ty>) { } for arg in fn_abi.args.iter_mut() { if arg.is_ignore() { + // x86_64-pc-windows-gnu doesn't ignore ZSTs. + if cx.target_spec().os == "windows" + && cx.target_spec().env == "gnu" + && arg.layout.is_zst() + { + arg.make_indirect_force(); + } continue; } fixup(arg); diff --git a/compiler/rustc_target/src/spec/targets/aarch64_apple_ios_macabi.rs b/compiler/rustc_target/src/spec/targets/aarch64_apple_ios_macabi.rs index 85c40ec60c4..32c2367d5bf 100644 --- a/compiler/rustc_target/src/spec/targets/aarch64_apple_ios_macabi.rs +++ b/compiler/rustc_target/src/spec/targets/aarch64_apple_ios_macabi.rs @@ -10,7 +10,7 @@ pub fn target() -> Target { llvm_target: mac_catalyst_llvm_target(arch).into(), metadata: crate::spec::TargetMetadata { description: Some("Apple Catalyst on ARM64".into()), - tier: Some(3), + tier: Some(2), host_tools: Some(false), std: Some(true), }, diff --git a/compiler/rustc_target/src/spec/targets/x86_64_apple_ios_macabi.rs b/compiler/rustc_target/src/spec/targets/x86_64_apple_ios_macabi.rs index d3ba17cf027..c23a20ff084 100644 --- a/compiler/rustc_target/src/spec/targets/x86_64_apple_ios_macabi.rs +++ b/compiler/rustc_target/src/spec/targets/x86_64_apple_ios_macabi.rs @@ -10,7 +10,7 @@ pub fn target() -> Target { llvm_target: mac_catalyst_llvm_target(arch).into(), metadata: crate::spec::TargetMetadata { description: Some("Apple Catalyst on x86_64".into()), - tier: Some(3), + tier: Some(2), host_tools: Some(false), std: Some(true), }, 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 326a0e4e35c..d1cc630bc9a 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 @@ -1668,7 +1668,7 @@ impl<'a, 'tcx> TypeErrCtxt<'a, 'tcx> { let name = self.tcx.crate_name(trait_def_id.krate); let spans: Vec<_> = [trait_def_id, found_type] .into_iter() - .filter_map(|def_id| self.tcx.extern_crate(def_id)) + .filter_map(|def_id| self.tcx.extern_crate(def_id.krate)) .map(|data| { let dependency = if data.dependency_of == LOCAL_CRATE { "direct dependency of the current crate".to_string() @@ -1689,11 +1689,11 @@ impl<'a, 'tcx> TypeErrCtxt<'a, 'tcx> { err.highlighted_span_help( span, vec![ - StringPart::normal("you have ".to_string()), + StringPart::normal("there are ".to_string()), StringPart::highlighted("multiple different versions".to_string()), StringPart::normal(" of crate `".to_string()), StringPart::highlighted(format!("{name}")), - StringPart::normal("` in your dependency graph".to_string()), + StringPart::normal("` the your dependency graph".to_string()), ], ); let candidates = if impl_candidates.is_empty() { @@ -2729,6 +2729,10 @@ impl<'a, 'tcx> TypeErrCtxt<'a, 'tcx> { | Node::ImplItem(&hir::ImplItem { kind: hir::ImplItemKind::Fn(ref sig, _), .. }) | Node::TraitItem(&hir::TraitItem { kind: hir::TraitItemKind::Fn(ref sig, _), .. + }) + | Node::ForeignItem(&hir::ForeignItem { + kind: hir::ForeignItemKind::Fn(ref sig, _, _), + .. }) => ( sig.span, None, 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 d0f76f0d50e..a962be54c3d 100644 --- a/compiler/rustc_trait_selection/src/error_reporting/traits/suggestions.rs +++ b/compiler/rustc_trait_selection/src/error_reporting/traits/suggestions.rs @@ -4610,6 +4610,9 @@ impl<'a, 'tcx> TypeErrCtxt<'a, 'tcx> { }) } + // For E0277 when use `?` operator, suggest adding + // a suitable return type in `FnSig`, and a default + // return value at the end of the function's body. pub(super) fn suggest_add_result_as_return_type( &self, obligation: &PredicateObligation<'tcx>, @@ -4620,19 +4623,47 @@ impl<'a, 'tcx> TypeErrCtxt<'a, 'tcx> { return; } + // Only suggest for local function and associated method, + // because this suggest adding both return type in + // the `FnSig` and a default return value in the body, so it + // is not suitable for foreign function without a local body, + // and neighter for trait method which may be also implemented + // in other place, so shouldn't change it's FnSig. + fn choose_suggest_items<'tcx, 'hir>( + tcx: TyCtxt<'tcx>, + node: hir::Node<'hir>, + ) -> Option<(&'hir hir::FnDecl<'hir>, hir::BodyId)> { + match node { + hir::Node::Item(item) if let hir::ItemKind::Fn(sig, _, body_id) = item.kind => { + Some((sig.decl, body_id)) + } + hir::Node::ImplItem(item) + if let hir::ImplItemKind::Fn(sig, body_id) = item.kind => + { + let parent = tcx.parent_hir_node(item.hir_id()); + if let hir::Node::Item(item) = parent + && let hir::ItemKind::Impl(imp) = item.kind + && imp.of_trait.is_none() + { + return Some((sig.decl, body_id)); + } + None + } + _ => None, + } + } + let node = self.tcx.hir_node_by_def_id(obligation.cause.body_id); - if let hir::Node::Item(item) = node - && let hir::ItemKind::Fn(sig, _, body_id) = item.kind - && let hir::FnRetTy::DefaultReturn(ret_span) = sig.decl.output + if let Some((fn_decl, body_id)) = choose_suggest_items(self.tcx, node) + && let hir::FnRetTy::DefaultReturn(ret_span) = fn_decl.output && self.tcx.is_diagnostic_item(sym::FromResidual, trait_pred.def_id()) && trait_pred.skip_binder().trait_ref.args.type_at(0).is_unit() && let ty::Adt(def, _) = trait_pred.skip_binder().trait_ref.args.type_at(1).kind() && self.tcx.is_diagnostic_item(sym::Result, def.did()) { - let body = self.tcx.hir().body(body_id); let mut sugg_spans = vec![(ret_span, " -> Result<(), Box<dyn std::error::Error>>".to_string())]; - + let body = self.tcx.hir().body(body_id); if let hir::ExprKind::Block(b, _) = body.value.kind && b.expr.is_none() { diff --git a/compiler/rustc_trait_selection/src/traits/query/normalize.rs b/compiler/rustc_trait_selection/src/traits/query/normalize.rs index 247b6e4823c..cb96db5f7a2 100644 --- a/compiler/rustc_trait_selection/src/traits/query/normalize.rs +++ b/compiler/rustc_trait_selection/src/traits/query/normalize.rs @@ -333,14 +333,14 @@ impl<'cx, 'tcx> FallibleTypeFolder<TyCtxt<'tcx>> for QueryNormalizer<'cx, 'tcx> return Ok(constant); } - let constant = constant.try_super_fold_with(self)?; - debug!(?constant, ?self.param_env); - Ok(crate::traits::with_replaced_escaping_bound_vars( + let constant = crate::traits::with_replaced_escaping_bound_vars( self.infcx, &mut self.universes, constant, |constant| constant.normalize(self.infcx.tcx, self.param_env), - )) + ); + debug!(?constant, ?self.param_env); + constant.try_super_fold_with(self) } #[inline] diff --git a/compiler/rustc_trait_selection/src/traits/select/confirmation.rs b/compiler/rustc_trait_selection/src/traits/select/confirmation.rs index 0d7ceca4301..f19cd19c99a 100644 --- a/compiler/rustc_trait_selection/src/traits/select/confirmation.rs +++ b/compiler/rustc_trait_selection/src/traits/select/confirmation.rs @@ -17,8 +17,7 @@ use rustc_infer::infer::{DefineOpaqueTypes, HigherRankedType, InferOk}; use rustc_infer::traits::ObligationCauseCode; use rustc_middle::traits::{BuiltinImplSource, SignatureMismatchData}; use rustc_middle::ty::{ - self, GenericArgs, GenericArgsRef, GenericParamDefKind, ToPolyTraitRef, TraitPredicate, Ty, - TyCtxt, Upcast, + self, GenericArgs, GenericArgsRef, GenericParamDefKind, ToPolyTraitRef, Ty, TyCtxt, Upcast, }; use rustc_middle::{bug, span_bug}; use rustc_span::def_id::DefId; @@ -292,90 +291,120 @@ impl<'cx, 'tcx> SelectionContext<'cx, 'tcx> { &mut self, obligation: &PolyTraitObligation<'tcx>, ) -> Result<Vec<PredicateObligation<'tcx>>, SelectionError<'tcx>> { - use rustc_transmute::{Answer, Condition}; - #[instrument(level = "debug", skip(tcx, obligation, predicate))] + use rustc_transmute::{Answer, Assume, Condition}; + + /// Generate sub-obligations for reference-to-reference transmutations. + fn reference_obligations<'tcx>( + tcx: TyCtxt<'tcx>, + obligation: &PolyTraitObligation<'tcx>, + (src_lifetime, src_ty, src_mut): (ty::Region<'tcx>, Ty<'tcx>, Mutability), + (dst_lifetime, dst_ty, dst_mut): (ty::Region<'tcx>, Ty<'tcx>, Mutability), + assume: Assume, + ) -> Vec<PredicateObligation<'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), + ], + ); + Obligation::with_depth( + tcx, + obligation.cause.clone(), + obligation.recursion_depth + 1, + obligation.param_env, + obligation.predicate.rebind(trait_ref), + ) + }; + + let make_freeze_obl = |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(), + obligation.recursion_depth + 1, + obligation.param_env, + trait_ref, + ) + }; + + let make_outlives_obl = |target, region| { + let outlives = ty::OutlivesPredicate(target, region); + Obligation::with_depth( + tcx, + obligation.cause.clone(), + obligation.recursion_depth + 1, + obligation.param_env, + obligation.predicate.rebind(outlives), + ) + }; + + // Given a transmutation from `&'a (mut) Src` and `&'dst (mut) Dst`, + // it is always the case that `Src` must be transmutable into `Dst`, + // and that that `'src` must outlive `'dst`. + let mut obls = vec![make_transmute_obl(src_ty, dst_ty)]; + if !assume.lifetimes { + obls.push(make_outlives_obl(src_lifetime, dst_lifetime)); + } + + // Given a transmutation from `&Src`, both `Src` and `Dst` must be + // `Freeze`, otherwise, using the transmuted value could lead to + // data races. + if src_mut == Mutability::Not { + obls.extend([make_freeze_obl(src_ty), make_freeze_obl(dst_ty)]) + } + + // Given a transmutation into `&'dst mut Dst`, it also must be the + // case that `Dst` is transmutable into `Src`. For example, + // transmuting bool -> u8 is OK as long as you can't update that u8 + // to be > 1, because you could later transmute the u8 back to a + // bool and get undefined behavior. It also must be the case that + // `'dst` lives exactly as long as `'src`. + if dst_mut == Mutability::Mut { + obls.push(make_transmute_obl(dst_ty, src_ty)); + if !assume.lifetimes { + obls.push(make_outlives_obl(dst_lifetime, src_lifetime)); + } + } + + obls + } + + /// Flatten the `Condition` tree into a conjunction of obligations. + #[instrument(level = "debug", skip(tcx, obligation))] fn flatten_answer_tree<'tcx>( tcx: TyCtxt<'tcx>, obligation: &PolyTraitObligation<'tcx>, - predicate: TraitPredicate<'tcx>, cond: Condition<rustc_transmute::layout::rustc::Ref<'tcx>>, + assume: Assume, ) -> Vec<PredicateObligation<'tcx>> { match cond { // FIXME(bryangarza): Add separate `IfAny` case, instead of treating as `IfAll` // Not possible until the trait solver supports disjunctions of obligations Condition::IfAll(conds) | Condition::IfAny(conds) => conds .into_iter() - .flat_map(|cond| flatten_answer_tree(tcx, obligation, predicate, cond)) + .flat_map(|cond| flatten_answer_tree(tcx, obligation, cond, assume)) .collect(), - Condition::IfTransmutable { src, dst } => { - let transmute_trait = obligation.predicate.def_id(); - let assume_const = predicate.trait_ref.args.const_at(2); - let make_transmute_obl = |from_ty, to_ty| { - let trait_ref = ty::TraitRef::new( - tcx, - transmute_trait, - [ - ty::GenericArg::from(to_ty), - ty::GenericArg::from(from_ty), - ty::GenericArg::from(assume_const), - ], - ); - Obligation::with_depth( - tcx, - obligation.cause.clone(), - obligation.recursion_depth + 1, - obligation.param_env, - trait_ref, - ) - }; - - let make_freeze_obl = |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(), - obligation.recursion_depth + 1, - obligation.param_env, - trait_ref, - ) - }; - - let mut obls = vec![]; - - // If the source is a shared reference, it must be `Freeze`; - // otherwise, transmuting could lead to data races. - if src.mutability == Mutability::Not { - obls.extend([make_freeze_obl(src.ty), make_freeze_obl(dst.ty)]) - } - - // If Dst is mutable, check bidirectionally. - // For example, transmuting bool -> u8 is OK as long as you can't update that u8 - // to be > 1, because you could later transmute the u8 back to a bool and get UB. - match dst.mutability { - Mutability::Not => obls.push(make_transmute_obl(src.ty, dst.ty)), - Mutability::Mut => obls.extend([ - make_transmute_obl(src.ty, dst.ty), - make_transmute_obl(dst.ty, src.ty), - ]), - } - - obls - } + Condition::IfTransmutable { src, dst } => reference_obligations( + tcx, + obligation, + (src.lifetime, src.ty, src.mutability), + (dst.lifetime, dst.ty, dst.mutability), + assume, + ), } } - // We erase regions here because transmutability calls layout queries, - // which does not handle inference regions and doesn't particularly - // care about other regions. Erasing late-bound regions is equivalent - // to instantiating the binder with placeholders then erasing those - // placeholder regions. - let predicate = self - .tcx() - .erase_regions(self.tcx().instantiate_bound_regions_with_erased(obligation.predicate)); + let predicate = obligation.predicate.skip_binder(); let Some(assume) = rustc_transmute::Assume::from_const( self.infcx.tcx, @@ -387,6 +416,7 @@ impl<'cx, 'tcx> SelectionContext<'cx, 'tcx> { let dst = predicate.trait_ref.args.type_at(0); let src = predicate.trait_ref.args.type_at(1); + debug!(?src, ?dst); let mut transmute_env = rustc_transmute::TransmuteTypeEnv::new(self.infcx); let maybe_transmutable = transmute_env.is_transmutable( @@ -397,7 +427,7 @@ impl<'cx, 'tcx> SelectionContext<'cx, 'tcx> { let fully_flattened = match maybe_transmutable { Answer::No(_) => Err(Unimplemented)?, - Answer::If(cond) => flatten_answer_tree(self.tcx(), obligation, predicate, cond), + Answer::If(cond) => flatten_answer_tree(self.tcx(), obligation, cond, assume), Answer::Yes => vec![], }; diff --git a/compiler/rustc_transmute/src/layout/mod.rs b/compiler/rustc_transmute/src/layout/mod.rs index bbf155581f9..1cf9e0b9b70 100644 --- a/compiler/rustc_transmute/src/layout/mod.rs +++ b/compiler/rustc_transmute/src/layout/mod.rs @@ -63,7 +63,9 @@ pub mod rustc { use std::fmt::{self, Write}; use rustc_middle::mir::Mutability; - use rustc_middle::ty::{self, Ty}; + use rustc_middle::ty::layout::{LayoutCx, LayoutError}; + use rustc_middle::ty::{self, Ty, TyCtxt}; + use rustc_target::abi::Layout; /// A reference in the layout. #[derive(Debug, Hash, Eq, PartialEq, Clone, Copy)] @@ -120,4 +122,13 @@ pub mod rustc { self != &Self::Primitive } } + + pub(crate) fn layout_of<'tcx>( + cx: LayoutCx<'tcx, TyCtxt<'tcx>>, + ty: Ty<'tcx>, + ) -> Result<Layout<'tcx>, &'tcx LayoutError<'tcx>> { + use rustc_middle::ty::layout::LayoutOf; + let ty = cx.tcx.erase_regions(ty); + cx.layout_of(ty).map(|tl| tl.layout) + } } diff --git a/compiler/rustc_transmute/src/layout/tree.rs b/compiler/rustc_transmute/src/layout/tree.rs index 5c25f913ffe..7c73f74e629 100644 --- a/compiler/rustc_transmute/src/layout/tree.rs +++ b/compiler/rustc_transmute/src/layout/tree.rs @@ -171,10 +171,12 @@ where #[cfg(feature = "rustc")] pub(crate) mod rustc { - use rustc_middle::ty::layout::{HasTyCtxt, LayoutCx, LayoutError, LayoutOf}; + use rustc_middle::ty::layout::{HasTyCtxt, LayoutCx, LayoutError}; use rustc_middle::ty::{self, AdtDef, AdtKind, List, ScalarInt, Ty, TyCtxt, TypeVisitableExt}; use rustc_span::ErrorGuaranteed; - use rustc_target::abi::{FieldsShape, Size, TyAndLayout, Variants}; + use rustc_target::abi::{ + FieldIdx, FieldsShape, Layout, Size, TyAndLayout, VariantIdx, Variants, + }; use super::Tree; use crate::layout::rustc::{Def, Ref}; @@ -202,20 +204,18 @@ pub(crate) mod rustc { } impl<'tcx> Tree<Def<'tcx>, Ref<'tcx>> { - pub fn from_ty( - ty_and_layout: TyAndLayout<'tcx, Ty<'tcx>>, - cx: LayoutCx<'tcx, TyCtxt<'tcx>>, - ) -> Result<Self, Err> { + pub fn from_ty(ty: Ty<'tcx>, cx: LayoutCx<'tcx, TyCtxt<'tcx>>) -> Result<Self, Err> { use rustc_target::abi::HasDataLayout; + let layout = ty_layout(cx, ty); - if let Err(e) = ty_and_layout.ty.error_reported() { + if let Err(e) = ty.error_reported() { return Err(Err::TypeError(e)); } let target = cx.tcx.data_layout(); let pointer_size = target.pointer_size; - match ty_and_layout.ty.kind() { + match ty.kind() { ty::Bool => Ok(Self::bool()), ty::Float(nty) => { @@ -233,32 +233,30 @@ pub(crate) mod rustc { Ok(Self::number(width as _)) } - ty::Tuple(members) => Self::from_tuple(ty_and_layout, members, cx), + ty::Tuple(members) => Self::from_tuple((ty, layout), members, cx), ty::Array(inner_ty, len) => { - let FieldsShape::Array { stride, count } = &ty_and_layout.fields else { + let FieldsShape::Array { stride, count } = &layout.fields else { return Err(Err::NotYetSupported); }; - let inner_ty_and_layout = cx.layout_of(*inner_ty)?; - assert_eq!(*stride, inner_ty_and_layout.size); - let elt = Tree::from_ty(inner_ty_and_layout, cx)?; + let inner_layout = ty_layout(cx, *inner_ty); + assert_eq!(*stride, inner_layout.size); + let elt = Tree::from_ty(*inner_ty, cx)?; Ok(std::iter::repeat(elt) .take(*count as usize) .fold(Tree::unit(), |tree, elt| tree.then(elt))) } - ty::Adt(adt_def, _args_ref) if !ty_and_layout.ty.is_box() => { - match adt_def.adt_kind() { - AdtKind::Struct => Self::from_struct(ty_and_layout, *adt_def, cx), - AdtKind::Enum => Self::from_enum(ty_and_layout, *adt_def, cx), - AdtKind::Union => Self::from_union(ty_and_layout, *adt_def, cx), - } - } + ty::Adt(adt_def, _args_ref) if !ty.is_box() => match adt_def.adt_kind() { + AdtKind::Struct => Self::from_struct((ty, layout), *adt_def, cx), + AdtKind::Enum => Self::from_enum((ty, layout), *adt_def, cx), + AdtKind::Union => Self::from_union((ty, layout), *adt_def, cx), + }, ty::Ref(lifetime, ty, mutability) => { - let ty_and_layout = cx.layout_of(*ty)?; - let align = ty_and_layout.align.abi.bytes_usize(); - let size = ty_and_layout.size.bytes_usize(); + let layout = ty_layout(cx, *ty); + let align = layout.align.abi.bytes_usize(); + let size = layout.size.bytes_usize(); Ok(Tree::Ref(Ref { lifetime: *lifetime, ty: *ty, @@ -274,21 +272,20 @@ pub(crate) mod rustc { /// Constructs a `Tree` from a tuple. fn from_tuple( - ty_and_layout: TyAndLayout<'tcx, Ty<'tcx>>, + (ty, layout): (Ty<'tcx>, Layout<'tcx>), members: &'tcx List<Ty<'tcx>>, cx: LayoutCx<'tcx, TyCtxt<'tcx>>, ) -> Result<Self, Err> { - match &ty_and_layout.fields { + match &layout.fields { FieldsShape::Primitive => { assert_eq!(members.len(), 1); let inner_ty = members[0]; - let inner_ty_and_layout = cx.layout_of(inner_ty)?; - assert_eq!(ty_and_layout.layout, inner_ty_and_layout.layout); - Self::from_ty(inner_ty_and_layout, cx) + let inner_layout = ty_layout(cx, inner_ty); + Self::from_ty(inner_ty, cx) } FieldsShape::Arbitrary { offsets, .. } => { assert_eq!(offsets.len(), members.len()); - Self::from_variant(Def::Primitive, None, ty_and_layout, ty_and_layout.size, cx) + Self::from_variant(Def::Primitive, None, (ty, layout), layout.size, cx) } FieldsShape::Array { .. } | FieldsShape::Union(_) => Err(Err::NotYetSupported), } @@ -300,13 +297,13 @@ pub(crate) mod rustc { /// /// Panics if `def` is not a struct definition. fn from_struct( - ty_and_layout: TyAndLayout<'tcx, Ty<'tcx>>, + (ty, layout): (Ty<'tcx>, Layout<'tcx>), def: AdtDef<'tcx>, cx: LayoutCx<'tcx, TyCtxt<'tcx>>, ) -> Result<Self, Err> { assert!(def.is_struct()); let def = Def::Adt(def); - Self::from_variant(def, None, ty_and_layout, ty_and_layout.size, cx) + Self::from_variant(def, None, (ty, layout), layout.size, cx) } /// Constructs a `Tree` from an enum. @@ -315,19 +312,18 @@ pub(crate) mod rustc { /// /// Panics if `def` is not an enum definition. fn from_enum( - ty_and_layout: TyAndLayout<'tcx, Ty<'tcx>>, + (ty, layout): (Ty<'tcx>, Layout<'tcx>), def: AdtDef<'tcx>, cx: LayoutCx<'tcx, TyCtxt<'tcx>>, ) -> Result<Self, Err> { assert!(def.is_enum()); - let layout = ty_and_layout.layout; // Computes the variant of a given index. let layout_of_variant = |index| { - let tag = cx.tcx.tag_for_variant((ty_and_layout.ty, index)); + let tag = cx.tcx.tag_for_variant((cx.tcx.erase_regions(ty), index)); let variant_def = Def::Variant(def.variant(index)); - let variant_ty_and_layout = ty_and_layout.for_variant(&cx, index); - Self::from_variant(variant_def, tag, variant_ty_and_layout, layout.size, cx) + let variant_layout = ty_variant(cx, (ty, layout), index); + Self::from_variant(variant_def, tag, (ty, variant_layout), layout.size, cx) }; // We consider three kinds of enums, each demanding a different @@ -385,21 +381,20 @@ pub(crate) mod rustc { fn from_variant( def: Def<'tcx>, tag: Option<ScalarInt>, - ty_and_layout: TyAndLayout<'tcx, Ty<'tcx>>, + (ty, layout): (Ty<'tcx>, Layout<'tcx>), total_size: Size, cx: LayoutCx<'tcx, TyCtxt<'tcx>>, ) -> Result<Self, Err> { // This constructor does not support non-`FieldsShape::Arbitrary` // layouts. - let FieldsShape::Arbitrary { offsets, memory_index } = ty_and_layout.layout.fields() - else { + let FieldsShape::Arbitrary { offsets, memory_index } = layout.fields() else { return Err(Err::NotYetSupported); }; // When this function is invoked with enum variants, // `ty_and_layout.size` does not encompass the entire size of the // enum. We rely on `total_size` for this. - assert!(ty_and_layout.size <= total_size); + assert!(layout.size <= total_size); let mut size = Size::ZERO; let mut struct_tree = Self::def(def); @@ -412,17 +407,18 @@ pub(crate) mod rustc { // Append the fields, in memory order, to the layout. let inverse_memory_index = memory_index.invert_bijective_mapping(); - for (memory_idx, field_idx) in inverse_memory_index.iter_enumerated() { + for (memory_idx, &field_idx) in inverse_memory_index.iter_enumerated() { // Add interfield padding. - let padding_needed = offsets[*field_idx] - size; + let padding_needed = offsets[field_idx] - size; let padding = Self::padding(padding_needed.bytes_usize()); - let field_ty_and_layout = ty_and_layout.field(&cx, field_idx.as_usize()); - let field_tree = Self::from_ty(field_ty_and_layout, cx)?; + let field_ty = ty_field(cx, (ty, layout), field_idx); + let field_layout = ty_layout(cx, field_ty); + let field_tree = Self::from_ty(field_ty, cx)?; struct_tree = struct_tree.then(padding).then(field_tree); - size += padding_needed + field_ty_and_layout.size; + size += padding_needed + field_layout.size; } // Add trailing padding. @@ -457,28 +453,27 @@ pub(crate) mod rustc { /// /// Panics if `def` is not a union definition. fn from_union( - ty_and_layout: TyAndLayout<'tcx, Ty<'tcx>>, + (ty, layout): (Ty<'tcx>, Layout<'tcx>), def: AdtDef<'tcx>, cx: LayoutCx<'tcx, TyCtxt<'tcx>>, ) -> Result<Self, Err> { assert!(def.is_union()); - let union_layout = ty_and_layout.layout; - // This constructor does not support non-`FieldsShape::Union` // layouts. Fields of this shape are all placed at offset 0. - let FieldsShape::Union(fields) = union_layout.fields() else { + let FieldsShape::Union(fields) = layout.fields() else { return Err(Err::NotYetSupported); }; let fields = &def.non_enum_variant().fields; let fields = fields.iter_enumerated().try_fold( Self::uninhabited(), - |fields, (idx, ref field_def)| { + |fields, (idx, field_def)| { let field_def = Def::Field(field_def); - let field_ty_and_layout = ty_and_layout.field(&cx, idx.as_usize()); - let field = Self::from_ty(field_ty_and_layout, cx)?; - let trailing_padding_needed = union_layout.size - field_ty_and_layout.size; + let field_ty = ty_field(cx, (ty, layout), idx); + let field_layout = ty_layout(cx, field_ty); + let field = Self::from_ty(field_ty, cx)?; + let trailing_padding_needed = layout.size - field_layout.size; let trailing_padding = Self::padding(trailing_padding_needed.bytes_usize()); let field_and_padding = field.then(trailing_padding); Result::<Self, Err>::Ok(fields.or(field_and_padding)) @@ -488,4 +483,44 @@ pub(crate) mod rustc { Ok(Self::def(Def::Adt(def)).then(fields)) } } + + pub(crate) fn ty_layout<'tcx>(cx: LayoutCx<'tcx, TyCtxt<'tcx>>, ty: Ty<'tcx>) -> Layout<'tcx> { + crate::layout::rustc::layout_of(cx, ty).unwrap() + } + + fn ty_field<'tcx>( + cx: LayoutCx<'tcx, TyCtxt<'tcx>>, + (ty, layout): (Ty<'tcx>, Layout<'tcx>), + i: FieldIdx, + ) -> Ty<'tcx> { + match ty.kind() { + ty::Adt(def, args) => { + match layout.variants { + Variants::Single { index } => { + let field = &def.variant(index).fields[i]; + field.ty(cx.tcx, args) + } + // Discriminant field for enums (where applicable). + Variants::Multiple { tag, .. } => { + assert_eq!(i.as_usize(), 0); + ty::layout::PrimitiveExt::to_ty(&tag.primitive(), cx.tcx) + } + } + } + ty::Tuple(fields) => fields[i.as_usize()], + kind @ _ => unimplemented!( + "only a subset of `Ty::ty_and_layout_field`'s functionality is implemented. implementation needed for {:?}", + kind + ), + } + } + + fn ty_variant<'tcx>( + cx: LayoutCx<'tcx, TyCtxt<'tcx>>, + (ty, layout): (Ty<'tcx>, Layout<'tcx>), + i: VariantIdx, + ) -> Layout<'tcx> { + let ty = cx.tcx.erase_regions(ty); + TyAndLayout { ty, layout }.for_variant(&cx, i).layout + } } diff --git a/compiler/rustc_transmute/src/lib.rs b/compiler/rustc_transmute/src/lib.rs index 31664ee6c4f..bdc98bcea5e 100644 --- a/compiler/rustc_transmute/src/lib.rs +++ b/compiler/rustc_transmute/src/lib.rs @@ -9,7 +9,7 @@ pub(crate) use rustc_data_structures::fx::{FxIndexMap as Map, FxIndexSet as Set} pub mod layout; mod maybe_transmutable; -#[derive(Default)] +#[derive(Copy, Clone, Debug, Default)] pub struct Assume { pub alignment: bool, pub lifetimes: bool, diff --git a/compiler/rustc_transmute/src/maybe_transmutable/mod.rs b/compiler/rustc_transmute/src/maybe_transmutable/mod.rs index 7c66a827db9..1f3c4e3c817 100644 --- a/compiler/rustc_transmute/src/maybe_transmutable/mod.rs +++ b/compiler/rustc_transmute/src/maybe_transmutable/mod.rs @@ -30,7 +30,7 @@ where // FIXME: Nix this cfg, so we can write unit tests independently of rustc #[cfg(feature = "rustc")] mod rustc { - use rustc_middle::ty::layout::{LayoutCx, LayoutOf}; + use rustc_middle::ty::layout::LayoutCx; use rustc_middle::ty::{ParamEnv, Ty, TyCtxt}; use super::*; @@ -45,10 +45,9 @@ mod rustc { let layout_cx = LayoutCx { tcx: context, param_env: ParamEnv::reveal_all() }; let layout_of = |ty| { - layout_cx - .layout_of(ty) + crate::layout::rustc::layout_of(layout_cx, ty) .map_err(|_| Err::NotYetSupported) - .and_then(|tl| Tree::from_ty(tl, layout_cx)) + .and_then(|_| Tree::from_ty(ty, layout_cx)) }; // Convert `src` and `dst` from their rustc representations, to `Tree`-based diff --git a/compiler/rustc_ty_utils/src/abi.rs b/compiler/rustc_ty_utils/src/abi.rs index 34c426f2aa6..7e3c30f2383 100644 --- a/compiler/rustc_ty_utils/src/abi.rs +++ b/compiler/rustc_ty_utils/src/abi.rs @@ -584,7 +584,7 @@ fn fn_abi_new_uncached<'tcx>( let conv = conv_from_spec_abi(cx.tcx(), sig.abi, sig.c_variadic); let mut inputs = sig.inputs(); - let extra_args = if sig.abi == RustCall { + let extra_args = if sig.abi == SpecAbi::RustCall { assert!(!sig.c_variadic && extra_args.is_empty()); if let Some(input) = sig.inputs().last() { @@ -608,18 +608,6 @@ fn fn_abi_new_uncached<'tcx>( extra_args }; - let target = &cx.tcx.sess.target; - let target_env_gnu_like = matches!(&target.env[..], "gnu" | "musl" | "uclibc"); - let win_x64_gnu = target.os == "windows" && target.arch == "x86_64" && target.env == "gnu"; - let linux_s390x_gnu_like = - target.os == "linux" && target.arch == "s390x" && target_env_gnu_like; - let linux_sparc64_gnu_like = - target.os == "linux" && target.arch == "sparc64" && target_env_gnu_like; - let linux_powerpc_gnu_like = - target.os == "linux" && target.arch == "powerpc" && target_env_gnu_like; - use SpecAbi::*; - let rust_abi = matches!(sig.abi, RustIntrinsic | Rust | RustCall); - let is_drop_in_place = fn_def_id.is_some_and(|def_id| cx.tcx.is_lang_item(def_id, LangItem::DropInPlace)); @@ -659,18 +647,7 @@ fn fn_abi_new_uncached<'tcx>( }); if arg.layout.is_zst() { - // For some forsaken reason, x86_64-pc-windows-gnu - // doesn't ignore zero-sized struct arguments. - // The same is true for {s390x,sparc64,powerpc}-unknown-linux-{gnu,musl,uclibc}. - if is_return - || rust_abi - || (!win_x64_gnu - && !linux_s390x_gnu_like - && !linux_sparc64_gnu_like - && !linux_powerpc_gnu_like) - { - arg.mode = PassMode::Ignore; - } + arg.mode = PassMode::Ignore; } Ok(arg) diff --git a/compiler/rustc_ty_utils/src/consts.rs b/compiler/rustc_ty_utils/src/consts.rs index 24926883523..4ded935b801 100644 --- a/compiler/rustc_ty_utils/src/consts.rs +++ b/compiler/rustc_ty_utils/src/consts.rs @@ -192,7 +192,7 @@ fn recurse_build<'tcx>( ExprKind::Borrow { arg, .. } => { let arg_node = &body.exprs[*arg]; - // Skip reborrows for now until we allow Deref/Borrow/AddressOf + // Skip reborrows for now until we allow Deref/Borrow/RawBorrow // expressions. // FIXME(generic_const_exprs): Verify/explain why this is sound if let ExprKind::Deref { arg } = arg_node.kind { @@ -202,7 +202,7 @@ fn recurse_build<'tcx>( } } // FIXME(generic_const_exprs): We may want to support these. - ExprKind::AddressOf { .. } | ExprKind::Deref { .. } => maybe_supported_error( + ExprKind::RawBorrow { .. } | ExprKind::Deref { .. } => maybe_supported_error( GenericConstantTooComplexSub::AddressAndDerefNotSupported(node.span), )?, ExprKind::Repeat { .. } | ExprKind::Array { .. } => { @@ -343,7 +343,7 @@ impl<'a, 'tcx> IsThirPolymorphic<'a, 'tcx> { | thir::ExprKind::VarRef { .. } | thir::ExprKind::UpvarRef { .. } | thir::ExprKind::Borrow { .. } - | thir::ExprKind::AddressOf { .. } + | thir::ExprKind::RawBorrow { .. } | thir::ExprKind::Break { .. } | thir::ExprKind::Continue { .. } | thir::ExprKind::Return { .. } diff --git a/library/Cargo.lock b/library/Cargo.lock index 815f5bb1385..30f5076e1e2 100644 --- a/library/Cargo.lock +++ b/library/Cargo.lock @@ -155,9 +155,9 @@ dependencies = [ [[package]] name = "libc" -version = "0.2.155" +version = "0.2.158" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "97b3888a4aecf77e811145cadf6eef5901f4782c53886191b2f693f24761847c" +checksum = "d8adc4bb1803a324070e64a98ae98f38934d91957a99cfb3a43dcbc01bc56439" dependencies = [ "rustc-std-workspace-core", ] diff --git a/library/core/src/clone.rs b/library/core/src/clone.rs index 76a89eaaff8..21504630672 100644 --- a/library/core/src/clone.rs +++ b/library/core/src/clone.rs @@ -36,8 +36,7 @@ #![stable(feature = "rust1", since = "1.0.0")] -use crate::mem::{self, MaybeUninit}; -use crate::ptr; +mod uninit; /// A common trait for the ability to explicitly duplicate an object. /// @@ -248,7 +247,7 @@ pub unsafe trait CloneToUninit { /// * `dst` must be properly aligned. /// * `dst` must have the same [pointer metadata] (slice length or `dyn` vtable) as `self`. /// - /// [valid]: ptr#safety + /// [valid]: crate::ptr#safety /// [pointer metadata]: crate::ptr::metadata() /// /// # Panics @@ -272,124 +271,42 @@ pub unsafe trait CloneToUninit { #[unstable(feature = "clone_to_uninit", issue = "126799")] unsafe impl<T: Clone> CloneToUninit for T { - default unsafe fn clone_to_uninit(&self, dst: *mut Self) { - // SAFETY: The safety conditions of clone_to_uninit() are a superset of those of - // ptr::write(). - unsafe { - // We hope the optimizer will figure out to create the cloned value in-place, - // skipping ever storing it on the stack and the copy to the destination. - ptr::write(dst, self.clone()); - } - } -} - -// Specialized implementation for types that are [`Copy`], not just [`Clone`], -// and can therefore be copied bitwise. -#[unstable(feature = "clone_to_uninit", issue = "126799")] -unsafe impl<T: Copy> CloneToUninit for T { + #[inline] unsafe fn clone_to_uninit(&self, dst: *mut Self) { - // SAFETY: The safety conditions of clone_to_uninit() are a superset of those of - // ptr::copy_nonoverlapping(). - unsafe { - ptr::copy_nonoverlapping(self, dst, 1); - } + // SAFETY: we're calling a specialization with the same contract + unsafe { <T as self::uninit::CopySpec>::clone_one(self, dst) } } } #[unstable(feature = "clone_to_uninit", issue = "126799")] unsafe impl<T: Clone> CloneToUninit for [T] { + #[inline] #[cfg_attr(debug_assertions, track_caller)] - default unsafe fn clone_to_uninit(&self, dst: *mut Self) { - let len = self.len(); - // This is the most likely mistake to make, so check it as a debug assertion. - debug_assert_eq!( - len, - dst.len(), - "clone_to_uninit() source and destination must have equal lengths", - ); - - // SAFETY: The produced `&mut` is valid because: - // * The caller is obligated to provide a pointer which is valid for writes. - // * All bytes pointed to are in MaybeUninit, so we don't care about the memory's - // initialization status. - let uninit_ref = unsafe { &mut *(dst as *mut [MaybeUninit<T>]) }; - - // Copy the elements - let mut initializing = InitializingSlice::from_fully_uninit(uninit_ref); - for element_ref in self.iter() { - // If the clone() panics, `initializing` will take care of the cleanup. - initializing.push(element_ref.clone()); - } - // If we reach here, then the entire slice is initialized, and we've satisfied our - // responsibilities to the caller. Disarm the cleanup guard by forgetting it. - mem::forget(initializing); + unsafe fn clone_to_uninit(&self, dst: *mut Self) { + // SAFETY: we're calling a specialization with the same contract + unsafe { <T as self::uninit::CopySpec>::clone_slice(self, dst) } } } #[unstable(feature = "clone_to_uninit", issue = "126799")] -unsafe impl<T: Copy> CloneToUninit for [T] { +unsafe impl CloneToUninit for str { + #[inline] #[cfg_attr(debug_assertions, track_caller)] unsafe fn clone_to_uninit(&self, dst: *mut Self) { - let len = self.len(); - // This is the most likely mistake to make, so check it as a debug assertion. - debug_assert_eq!( - len, - dst.len(), - "clone_to_uninit() source and destination must have equal lengths", - ); - - // SAFETY: The safety conditions of clone_to_uninit() are a superset of those of - // ptr::copy_nonoverlapping(). - unsafe { - ptr::copy_nonoverlapping(self.as_ptr(), dst.as_mut_ptr(), len); - } + // SAFETY: str is just a [u8] with UTF-8 invariant + unsafe { self.as_bytes().clone_to_uninit(dst as *mut [u8]) } } } -/// Ownership of a collection of values stored in a non-owned `[MaybeUninit<T>]`, some of which -/// are not yet initialized. This is sort of like a `Vec` that doesn't own its allocation. -/// Its responsibility is to provide cleanup on unwind by dropping the values that *are* -/// initialized, unless disarmed by forgetting. -/// -/// This is a helper for `impl<T: Clone> CloneToUninit for [T]`. -struct InitializingSlice<'a, T> { - data: &'a mut [MaybeUninit<T>], - /// Number of elements of `*self.data` that are initialized. - initialized_len: usize, -} - -impl<'a, T> InitializingSlice<'a, T> { - #[inline] - fn from_fully_uninit(data: &'a mut [MaybeUninit<T>]) -> Self { - Self { data, initialized_len: 0 } - } - - /// Push a value onto the end of the initialized part of the slice. - /// - /// # Panics - /// - /// Panics if the slice is already fully initialized. - #[inline] - fn push(&mut self, value: T) { - MaybeUninit::write(&mut self.data[self.initialized_len], value); - self.initialized_len += 1; - } -} - -impl<'a, T> Drop for InitializingSlice<'a, T> { - #[cold] // will only be invoked on unwind - fn drop(&mut self) { - let initialized_slice = ptr::slice_from_raw_parts_mut( - MaybeUninit::slice_as_mut_ptr(self.data), - self.initialized_len, - ); - // SAFETY: - // * the pointer is valid because it was made from a mutable reference - // * `initialized_len` counts the initialized elements as an invariant of this type, - // so each of the pointed-to elements is initialized and may be dropped. - unsafe { - ptr::drop_in_place::<[T]>(initialized_slice); - } +#[unstable(feature = "clone_to_uninit", issue = "126799")] +unsafe impl CloneToUninit for crate::ffi::CStr { + #[cfg_attr(debug_assertions, track_caller)] + unsafe fn clone_to_uninit(&self, dst: *mut Self) { + // SAFETY: For now, CStr is just a #[repr(trasnsparent)] [c_char] with some invariants. + // And we can cast [c_char] to [u8] on all supported platforms (see: to_bytes_with_nul). + // The pointer metadata properly preserves the length (NUL included). + // See: `cstr_metadata_is_length_with_nul` in tests. + unsafe { self.to_bytes_with_nul().clone_to_uninit(dst as *mut [u8]) } } } diff --git a/library/core/src/clone/uninit.rs b/library/core/src/clone/uninit.rs new file mode 100644 index 00000000000..8b738bec796 --- /dev/null +++ b/library/core/src/clone/uninit.rs @@ -0,0 +1,128 @@ +use crate::mem::{self, MaybeUninit}; +use crate::ptr; + +/// Private specialization trait used by CloneToUninit, as per +/// [the dev guide](https://std-dev-guide.rust-lang.org/policy/specialization.html). +pub(super) unsafe trait CopySpec: Clone { + unsafe fn clone_one(src: &Self, dst: *mut Self); + unsafe fn clone_slice(src: &[Self], dst: *mut [Self]); +} + +unsafe impl<T: Clone> CopySpec for T { + #[inline] + default unsafe fn clone_one(src: &Self, dst: *mut Self) { + // SAFETY: The safety conditions of clone_to_uninit() are a superset of those of + // ptr::write(). + unsafe { + // We hope the optimizer will figure out to create the cloned value in-place, + // skipping ever storing it on the stack and the copy to the destination. + ptr::write(dst, src.clone()); + } + } + + #[inline] + #[cfg_attr(debug_assertions, track_caller)] + default unsafe fn clone_slice(src: &[Self], dst: *mut [Self]) { + let len = src.len(); + // This is the most likely mistake to make, so check it as a debug assertion. + debug_assert_eq!( + len, + dst.len(), + "clone_to_uninit() source and destination must have equal lengths", + ); + + // SAFETY: The produced `&mut` is valid because: + // * The caller is obligated to provide a pointer which is valid for writes. + // * All bytes pointed to are in MaybeUninit, so we don't care about the memory's + // initialization status. + let uninit_ref = unsafe { &mut *(dst as *mut [MaybeUninit<T>]) }; + + // Copy the elements + let mut initializing = InitializingSlice::from_fully_uninit(uninit_ref); + for element_ref in src { + // If the clone() panics, `initializing` will take care of the cleanup. + initializing.push(element_ref.clone()); + } + // If we reach here, then the entire slice is initialized, and we've satisfied our + // responsibilities to the caller. Disarm the cleanup guard by forgetting it. + mem::forget(initializing); + } +} + +// Specialized implementation for types that are [`Copy`], not just [`Clone`], +// and can therefore be copied bitwise. +unsafe impl<T: Copy> CopySpec for T { + #[inline] + unsafe fn clone_one(src: &Self, dst: *mut Self) { + // SAFETY: The safety conditions of clone_to_uninit() are a superset of those of + // ptr::copy_nonoverlapping(). + unsafe { + ptr::copy_nonoverlapping(src, dst, 1); + } + } + + #[inline] + #[cfg_attr(debug_assertions, track_caller)] + unsafe fn clone_slice(src: &[Self], dst: *mut [Self]) { + let len = src.len(); + // This is the most likely mistake to make, so check it as a debug assertion. + debug_assert_eq!( + len, + dst.len(), + "clone_to_uninit() source and destination must have equal lengths", + ); + + // SAFETY: The safety conditions of clone_to_uninit() are a superset of those of + // ptr::copy_nonoverlapping(). + unsafe { + ptr::copy_nonoverlapping(src.as_ptr(), dst.as_mut_ptr(), len); + } + } +} + +/// Ownership of a collection of values stored in a non-owned `[MaybeUninit<T>]`, some of which +/// are not yet initialized. This is sort of like a `Vec` that doesn't own its allocation. +/// Its responsibility is to provide cleanup on unwind by dropping the values that *are* +/// initialized, unless disarmed by forgetting. +/// +/// This is a helper for `impl<T: Clone> CloneToUninit for [T]`. +struct InitializingSlice<'a, T> { + data: &'a mut [MaybeUninit<T>], + /// Number of elements of `*self.data` that are initialized. + initialized_len: usize, +} + +impl<'a, T> InitializingSlice<'a, T> { + #[inline] + fn from_fully_uninit(data: &'a mut [MaybeUninit<T>]) -> Self { + Self { data, initialized_len: 0 } + } + + /// Push a value onto the end of the initialized part of the slice. + /// + /// # Panics + /// + /// Panics if the slice is already fully initialized. + #[inline] + fn push(&mut self, value: T) { + MaybeUninit::write(&mut self.data[self.initialized_len], value); + self.initialized_len += 1; + } +} + +impl<'a, T> Drop for InitializingSlice<'a, T> { + #[cold] // will only be invoked on unwind + fn drop(&mut self) { + let initialized_slice = ptr::slice_from_raw_parts_mut( + MaybeUninit::slice_as_mut_ptr(self.data), + self.initialized_len, + ); + // SAFETY: + // * the pointer is valid because it was made from a mutable reference + // * `initialized_len` counts the initialized elements as an invariant of this type, + // so each of the pointed-to elements is initialized and may be dropped. + unsafe { + ptr::drop_in_place::<[T]>(initialized_slice); + } + } +} diff --git a/library/core/src/num/f128.rs b/library/core/src/num/f128.rs index 0c04f47fe7d..38e69e7641a 100644 --- a/library/core/src/num/f128.rs +++ b/library/core/src/num/f128.rs @@ -290,7 +290,7 @@ impl f128 { #[inline] #[rustc_const_unstable(feature = "const_float_classify", issue = "72505")] pub(crate) const fn abs_private(self) -> f128 { - // SAFETY: This transmutation is fine. Probably. For the reasons std is using it. + // SAFETY: This transmutation is fine just like in `to_bits`/`from_bits`. unsafe { mem::transmute::<u128, f128>(mem::transmute::<f128, u128>(self) & !Self::SIGN_MASK) } @@ -439,22 +439,12 @@ impl f128 { #[unstable(feature = "f128", issue = "116909")] #[rustc_const_unstable(feature = "const_float_classify", issue = "72505")] pub const fn classify(self) -> FpCategory { - // Other float types cannot use a bitwise classify because they may suffer a variety - // of errors if the backend chooses to cast to different float types (x87). `f128` cannot - // fit into any other float types so this is not a concern, and we rely on bit patterns. + // Other float types suffer from various platform bugs that violate the usual IEEE semantics + // and also make bitwise classification not always work reliably. However, `f128` cannot fit + // into any other float types so this is not a concern, and we can rely on bit patterns. - // SAFETY: POD bitcast, same as in `to_bits`. - let bits = unsafe { mem::transmute::<f128, u128>(self) }; - Self::classify_bits(bits) - } - - /// This operates on bits, and only bits, so it can ignore concerns about weird FPUs. - /// FIXME(jubilee): In a just world, this would be the entire impl for classify, - /// plus a transmute. We do not live in a just world, but we can make it more so. - #[inline] - #[rustc_const_unstable(feature = "const_float_classify", issue = "72505")] - const fn classify_bits(b: u128) -> FpCategory { - match (b & Self::MAN_MASK, b & Self::EXP_MASK) { + let bits = self.to_bits(); + match (bits & Self::MAN_MASK, bits & Self::EXP_MASK) { (0, Self::EXP_MASK) => FpCategory::Infinite, (_, Self::EXP_MASK) => FpCategory::Nan, (0, 0) => FpCategory::Zero, @@ -922,48 +912,7 @@ impl f128 { #[must_use = "this returns the result of the operation, without modifying the original"] pub const fn to_bits(self) -> u128 { // SAFETY: `u128` is a plain old datatype so we can always transmute to it. - // ...sorta. - // - // It turns out that at runtime, it is possible for a floating point number - // to be subject to a floating point mode that alters nonzero subnormal numbers - // to zero on reads and writes, aka "denormals are zero" and "flush to zero". - // - // And, of course evaluating to a NaN value is fairly nondeterministic. - // More precisely: when NaN should be returned is knowable, but which NaN? - // So far that's defined by a combination of LLVM and the CPU, not Rust. - // This function, however, allows observing the bitstring of a NaN, - // thus introspection on CTFE. - // - // In order to preserve, at least for the moment, const-to-runtime equivalence, - // we reject any of these possible situations from happening. - #[inline] - #[rustc_const_unstable(feature = "const_float_bits_conv", issue = "72447")] - const fn ct_f128_to_u128(ct: f128) -> u128 { - // FIXME(f16_f128): we should use `.classify()` like `f32` and `f64`, but that - // is not available on all platforms (needs `netf2` and `unordtf2`). So classify - // the bits instead. - - // SAFETY: this is a POD transmutation - let bits = unsafe { mem::transmute::<f128, u128>(ct) }; - match f128::classify_bits(bits) { - FpCategory::Nan => { - panic!("const-eval error: cannot use f128::to_bits on a NaN") - } - FpCategory::Subnormal => { - panic!("const-eval error: cannot use f128::to_bits on a subnormal number") - } - FpCategory::Infinite | FpCategory::Normal | FpCategory::Zero => bits, - } - } - - #[inline(always)] // See https://github.com/rust-lang/compiler-builtins/issues/491 - fn rt_f128_to_u128(x: f128) -> u128 { - // SAFETY: `u128` is a plain old datatype so we can always... uh... - // ...look, just pretend you forgot what you just read. - // Stability concerns. - unsafe { mem::transmute(x) } - } - intrinsics::const_eval_select((self,), ct_f128_to_u128, rt_f128_to_u128) + unsafe { mem::transmute(self) } } /// Raw transmutation from `u128`. @@ -1011,49 +960,8 @@ impl f128 { #[rustc_const_unstable(feature = "const_float_bits_conv", issue = "72447")] pub const fn from_bits(v: u128) -> Self { // It turns out the safety issues with sNaN were overblown! Hooray! - // SAFETY: `u128` is a plain old datatype so we can always transmute from it - // ...sorta. - // - // It turns out that at runtime, it is possible for a floating point number - // to be subject to floating point modes that alter nonzero subnormal numbers - // to zero on reads and writes, aka "denormals are zero" and "flush to zero". - // This is not a problem usually, but at least one tier2 platform for Rust - // actually exhibits this behavior by default: thumbv7neon - // aka "the Neon FPU in AArch32 state" - // - // And, of course evaluating to a NaN value is fairly nondeterministic. - // More precisely: when NaN should be returned is knowable, but which NaN? - // So far that's defined by a combination of LLVM and the CPU, not Rust. - // This function, however, allows observing the bitstring of a NaN, - // thus introspection on CTFE. - // - // In order to preserve, at least for the moment, const-to-runtime equivalence, - // reject any of these possible situations from happening. - #[inline] - #[rustc_const_unstable(feature = "const_float_bits_conv", issue = "72447")] - const fn ct_u128_to_f128(ct: u128) -> f128 { - match f128::classify_bits(ct) { - FpCategory::Subnormal => { - panic!("const-eval error: cannot use f128::from_bits on a subnormal number") - } - FpCategory::Nan => { - panic!("const-eval error: cannot use f128::from_bits on NaN") - } - FpCategory::Infinite | FpCategory::Normal | FpCategory::Zero => { - // SAFETY: It's not a frumious number - unsafe { mem::transmute::<u128, f128>(ct) } - } - } - } - - #[inline(always)] // See https://github.com/rust-lang/compiler-builtins/issues/491 - fn rt_u128_to_f128(x: u128) -> f128 { - // SAFETY: `u128` is a plain old datatype so we can always... uh... - // ...look, just pretend you forgot what you just read. - // Stability concerns. - unsafe { mem::transmute(x) } - } - intrinsics::const_eval_select((v,), ct_u128_to_f128, rt_u128_to_f128) + // SAFETY: `u128` is a plain old datatype so we can always transmute from it. + unsafe { mem::transmute(v) } } /// Returns the memory representation of this floating point number as a byte array in diff --git a/library/core/src/num/f16.rs b/library/core/src/num/f16.rs index e5b1148e192..41bd34a2702 100644 --- a/library/core/src/num/f16.rs +++ b/library/core/src/num/f16.rs @@ -284,7 +284,7 @@ impl f16 { #[inline] #[rustc_const_unstable(feature = "const_float_classify", issue = "72505")] pub(crate) const fn abs_private(self) -> f16 { - // SAFETY: This transmutation is fine. Probably. For the reasons std is using it. + // SAFETY: This transmutation is fine just like in `to_bits`/`from_bits`. unsafe { mem::transmute::<u16, f16>(mem::transmute::<f16, u16>(self) & !Self::SIGN_MASK) } } @@ -426,15 +426,15 @@ impl f16 { pub const fn classify(self) -> FpCategory { // A previous implementation for f32/f64 tried to only use bitmask-based checks, // using `to_bits` to transmute the float to its bit repr and match on that. - // Unfortunately, floating point numbers can be much worse than that. - // This also needs to not result in recursive evaluations of `to_bits`. + // If we only cared about being "technically" correct, that's an entirely legit + // implementation. // - - // Platforms without native support generally convert to `f32` to perform operations, - // and most of these platforms correctly round back to `f16` after each operation. - // However, some platforms have bugs where they keep the excess `f32` precision (e.g. - // WASM, see llvm/llvm-project#96437). This implementation makes a best-effort attempt - // to account for that excess precision. + // Unfortunately, there are platforms out there that do not correctly implement the IEEE + // float semantics Rust relies on: some hardware flushes denormals to zero, and some + // platforms convert to `f32` to perform operations without properly rounding back (e.g. + // WASM, see llvm/llvm-project#96437). These are platforms bugs, and Rust will misbehave on + // such platforms, but we can at least try to make things seem as sane as possible by being + // careful here. if self.is_infinite() { // Thus, a value may compare unequal to infinity, despite having a "full" exponent mask. FpCategory::Infinite @@ -446,49 +446,20 @@ impl f16 { // as correctness requires avoiding equality tests that may be Subnormal == -0.0 // because it may be wrong under "denormals are zero" and "flush to zero" modes. // Most of std's targets don't use those, but they are used for thumbv7neon. - // So, this does use bitpattern matching for the rest. - - // SAFETY: f16 to u16 is fine. Usually. - // If classify has gotten this far, the value is definitely in one of these categories. - unsafe { f16::partial_classify(self) } - } - } - - /// This doesn't actually return a right answer for NaN on purpose, - /// seeing as how it cannot correctly discern between a floating point NaN, - /// and some normal floating point numbers truncated from an x87 FPU. - /// - /// # Safety - /// - /// This requires making sure you call this function for values it answers correctly on, - /// otherwise it returns a wrong answer. This is not important for memory safety per se, - /// but getting floats correct is important for not accidentally leaking const eval - /// runtime-deviating logic which may or may not be acceptable. - #[inline] - #[rustc_const_unstable(feature = "const_float_classify", issue = "72505")] - const unsafe fn partial_classify(self) -> FpCategory { - // SAFETY: The caller is not asking questions for which this will tell lies. - let b = unsafe { mem::transmute::<f16, u16>(self) }; - match (b & Self::MAN_MASK, b & Self::EXP_MASK) { - (0, Self::EXP_MASK) => FpCategory::Infinite, - (0, 0) => FpCategory::Zero, - (_, 0) => FpCategory::Subnormal, - _ => FpCategory::Normal, - } - } - - /// This operates on bits, and only bits, so it can ignore concerns about weird FPUs. - /// FIXME(jubilee): In a just world, this would be the entire impl for classify, - /// plus a transmute. We do not live in a just world, but we can make it more so. - #[inline] - #[rustc_const_unstable(feature = "const_float_classify", issue = "72505")] - const fn classify_bits(b: u16) -> FpCategory { - match (b & Self::MAN_MASK, b & Self::EXP_MASK) { - (0, Self::EXP_MASK) => FpCategory::Infinite, - (_, Self::EXP_MASK) => FpCategory::Nan, - (0, 0) => FpCategory::Zero, - (_, 0) => FpCategory::Subnormal, - _ => FpCategory::Normal, + // So, this does use bitpattern matching for the rest. On x87, due to the incorrect + // float codegen on this hardware, this doesn't actually return a right answer for NaN + // because it cannot correctly discern between a floating point NaN, and some normal + // floating point numbers truncated from an x87 FPU -- but we took care of NaN above, so + // we are fine. + // FIXME(jubilee): This probably could at least answer things correctly for Infinity, + // like the f64 version does, but I need to run more checks on how things go on x86. + // I fear losing mantissa data that would have answered that differently. + let b = self.to_bits(); + match (b & Self::MAN_MASK, b & Self::EXP_MASK) { + (0, 0) => FpCategory::Zero, + (_, 0) => FpCategory::Subnormal, + _ => FpCategory::Normal, + } } } @@ -952,48 +923,7 @@ impl f16 { #[must_use = "this returns the result of the operation, without modifying the original"] pub const fn to_bits(self) -> u16 { // SAFETY: `u16` is a plain old datatype so we can always transmute to it. - // ...sorta. - // - // It turns out that at runtime, it is possible for a floating point number - // to be subject to a floating point mode that alters nonzero subnormal numbers - // to zero on reads and writes, aka "denormals are zero" and "flush to zero". - // - // And, of course evaluating to a NaN value is fairly nondeterministic. - // More precisely: when NaN should be returned is knowable, but which NaN? - // So far that's defined by a combination of LLVM and the CPU, not Rust. - // This function, however, allows observing the bitstring of a NaN, - // thus introspection on CTFE. - // - // In order to preserve, at least for the moment, const-to-runtime equivalence, - // we reject any of these possible situations from happening. - #[inline] - #[rustc_const_unstable(feature = "const_float_bits_conv", issue = "72447")] - const fn ct_f16_to_u16(ct: f16) -> u16 { - // FIXME(f16_f128): we should use `.classify()` like `f32` and `f64`, but we don't yet - // want to rely on that on all platforms because it is nondeterministic (e.g. x86 has - // convention discrepancies calling intrinsics). So just classify the bits instead. - - // SAFETY: this is a POD transmutation - let bits = unsafe { mem::transmute::<f16, u16>(ct) }; - match f16::classify_bits(bits) { - FpCategory::Nan => { - panic!("const-eval error: cannot use f16::to_bits on a NaN") - } - FpCategory::Subnormal => { - panic!("const-eval error: cannot use f16::to_bits on a subnormal number") - } - FpCategory::Infinite | FpCategory::Normal | FpCategory::Zero => bits, - } - } - - #[inline(always)] // See https://github.com/rust-lang/compiler-builtins/issues/491 - fn rt_f16_to_u16(x: f16) -> u16 { - // SAFETY: `u16` is a plain old datatype so we can always... uh... - // ...look, just pretend you forgot what you just read. - // Stability concerns. - unsafe { mem::transmute(x) } - } - intrinsics::const_eval_select((self,), ct_f16_to_u16, rt_f16_to_u16) + unsafe { mem::transmute(self) } } /// Raw transmutation from `u16`. @@ -1040,49 +970,8 @@ impl f16 { #[rustc_const_unstable(feature = "const_float_bits_conv", issue = "72447")] pub const fn from_bits(v: u16) -> Self { // It turns out the safety issues with sNaN were overblown! Hooray! - // SAFETY: `u16` is a plain old datatype so we can always transmute from it - // ...sorta. - // - // It turns out that at runtime, it is possible for a floating point number - // to be subject to floating point modes that alter nonzero subnormal numbers - // to zero on reads and writes, aka "denormals are zero" and "flush to zero". - // This is not a problem usually, but at least one tier2 platform for Rust - // actually exhibits this behavior by default: thumbv7neon - // aka "the Neon FPU in AArch32 state" - // - // And, of course evaluating to a NaN value is fairly nondeterministic. - // More precisely: when NaN should be returned is knowable, but which NaN? - // So far that's defined by a combination of LLVM and the CPU, not Rust. - // This function, however, allows observing the bitstring of a NaN, - // thus introspection on CTFE. - // - // In order to preserve, at least for the moment, const-to-runtime equivalence, - // reject any of these possible situations from happening. - #[inline] - #[rustc_const_unstable(feature = "const_float_bits_conv", issue = "72447")] - const fn ct_u16_to_f16(ct: u16) -> f16 { - match f16::classify_bits(ct) { - FpCategory::Subnormal => { - panic!("const-eval error: cannot use f16::from_bits on a subnormal number") - } - FpCategory::Nan => { - panic!("const-eval error: cannot use f16::from_bits on NaN") - } - FpCategory::Infinite | FpCategory::Normal | FpCategory::Zero => { - // SAFETY: It's not a frumious number - unsafe { mem::transmute::<u16, f16>(ct) } - } - } - } - - #[inline(always)] // See https://github.com/rust-lang/compiler-builtins/issues/491 - fn rt_u16_to_f16(x: u16) -> f16 { - // SAFETY: `u16` is a plain old datatype so we can always... uh... - // ...look, just pretend you forgot what you just read. - // Stability concerns. - unsafe { mem::transmute(x) } - } - intrinsics::const_eval_select((v,), ct_u16_to_f16, rt_u16_to_f16) + // SAFETY: `u16` is a plain old datatype so we can always transmute from it. + unsafe { mem::transmute(v) } } /// Returns the memory representation of this floating point number as a byte array in diff --git a/library/core/src/num/f32.rs b/library/core/src/num/f32.rs index 7710e23edf0..719727e2f1e 100644 --- a/library/core/src/num/f32.rs +++ b/library/core/src/num/f32.rs @@ -529,7 +529,7 @@ impl f32 { #[inline] #[rustc_const_unstable(feature = "const_float_classify", issue = "72505")] pub(crate) const fn abs_private(self) -> f32 { - // SAFETY: This transmutation is fine. Probably. For the reasons std is using it. + // SAFETY: This transmutation is fine just like in `to_bits`/`from_bits`. unsafe { mem::transmute::<u32, f32>(mem::transmute::<f32, u32>(self) & !Self::SIGN_MASK) } } @@ -654,18 +654,20 @@ impl f32 { pub const fn classify(self) -> FpCategory { // A previous implementation tried to only use bitmask-based checks, // using f32::to_bits to transmute the float to its bit repr and match on that. - // Unfortunately, floating point numbers can be much worse than that. - // This also needs to not result in recursive evaluations of f64::to_bits. + // If we only cared about being "technically" correct, that's an entirely legit + // implementation. + // + // Unfortunately, there is hardware out there that does not correctly implement the IEEE + // float semantics Rust relies on: x87 uses a too-large mantissa and exponent, and some + // hardware flushes subnormals to zero. These are platforms bugs, and Rust will misbehave on + // such hardware, but we can at least try to make things seem as sane as possible by being + // careful here. // - // On some processors, in some cases, LLVM will "helpfully" lower floating point ops, - // in spite of a request for them using f32 and f64, to things like x87 operations. - // These have an f64's mantissa, but can have a larger than normal exponent. // FIXME(jubilee): Using x87 operations is never necessary in order to function // on x86 processors for Rust-to-Rust calls, so this issue should not happen. // Code generation should be adjusted to use non-C calling conventions, avoiding this. - // if self.is_infinite() { - // Thus, a value may compare unequal to infinity, despite having a "full" exponent mask. + // A value may compare unequal to infinity, despite having a "full" exponent mask. FpCategory::Infinite } else if self.is_nan() { // And it may not be NaN, as it can simply be an "overextended" finite value. @@ -675,48 +677,20 @@ impl f32 { // as correctness requires avoiding equality tests that may be Subnormal == -0.0 // because it may be wrong under "denormals are zero" and "flush to zero" modes. // Most of std's targets don't use those, but they are used for thumbv7neon. - // So, this does use bitpattern matching for the rest. - - // SAFETY: f32 to u32 is fine. Usually. - // If classify has gotten this far, the value is definitely in one of these categories. - unsafe { f32::partial_classify(self) } - } - } - - // This doesn't actually return a right answer for NaN on purpose, - // seeing as how it cannot correctly discern between a floating point NaN, - // and some normal floating point numbers truncated from an x87 FPU. - // FIXME(jubilee): This probably could at least answer things correctly for Infinity, - // like the f64 version does, but I need to run more checks on how things go on x86. - // I fear losing mantissa data that would have answered that differently. - // - // # Safety - // This requires making sure you call this function for values it answers correctly on, - // otherwise it returns a wrong answer. This is not important for memory safety per se, - // but getting floats correct is important for not accidentally leaking const eval - // runtime-deviating logic which may or may not be acceptable. - #[rustc_const_unstable(feature = "const_float_classify", issue = "72505")] - const unsafe fn partial_classify(self) -> FpCategory { - // SAFETY: The caller is not asking questions for which this will tell lies. - let b = unsafe { mem::transmute::<f32, u32>(self) }; - match (b & Self::MAN_MASK, b & Self::EXP_MASK) { - (0, 0) => FpCategory::Zero, - (_, 0) => FpCategory::Subnormal, - _ => FpCategory::Normal, - } - } - - // This operates on bits, and only bits, so it can ignore concerns about weird FPUs. - // FIXME(jubilee): In a just world, this would be the entire impl for classify, - // plus a transmute. We do not live in a just world, but we can make it more so. - #[rustc_const_unstable(feature = "const_float_classify", issue = "72505")] - const fn classify_bits(b: u32) -> FpCategory { - match (b & Self::MAN_MASK, b & Self::EXP_MASK) { - (0, Self::EXP_MASK) => FpCategory::Infinite, - (_, Self::EXP_MASK) => FpCategory::Nan, - (0, 0) => FpCategory::Zero, - (_, 0) => FpCategory::Subnormal, - _ => FpCategory::Normal, + // So, this does use bitpattern matching for the rest. On x87, due to the incorrect + // float codegen on this hardware, this doesn't actually return a right answer for NaN + // because it cannot correctly discern between a floating point NaN, and some normal + // floating point numbers truncated from an x87 FPU -- but we took care of NaN above, so + // we are fine. + // FIXME(jubilee): This probably could at least answer things correctly for Infinity, + // like the f64 version does, but I need to run more checks on how things go on x86. + // I fear losing mantissa data that would have answered that differently. + let b = self.to_bits(); + match (b & Self::MAN_MASK, b & Self::EXP_MASK) { + (0, 0) => FpCategory::Zero, + (_, 0) => FpCategory::Subnormal, + _ => FpCategory::Normal, + } } } @@ -1143,51 +1117,7 @@ impl f32 { #[inline] pub const fn to_bits(self) -> u32 { // SAFETY: `u32` is a plain old datatype so we can always transmute to it. - // ...sorta. - // - // It turns out that at runtime, it is possible for a floating point number - // to be subject to a floating point mode that alters nonzero subnormal numbers - // to zero on reads and writes, aka "denormals are zero" and "flush to zero". - // This is not a problem per se, but at least one tier2 platform for Rust - // actually exhibits this behavior by default. - // - // In addition, on x86 targets with SSE or SSE2 disabled and the x87 FPU enabled, - // i.e. not soft-float, the way Rust does parameter passing can actually alter - // a number that is "not infinity" to have the same exponent as infinity, - // in a slightly unpredictable manner. - // - // And, of course evaluating to a NaN value is fairly nondeterministic. - // More precisely: when NaN should be returned is knowable, but which NaN? - // So far that's defined by a combination of LLVM and the CPU, not Rust. - // This function, however, allows observing the bitstring of a NaN, - // thus introspection on CTFE. - // - // In order to preserve, at least for the moment, const-to-runtime equivalence, - // we reject any of these possible situations from happening. - #[rustc_const_unstable(feature = "const_float_bits_conv", issue = "72447")] - const fn ct_f32_to_u32(ct: f32) -> u32 { - match ct.classify() { - FpCategory::Nan => { - panic!("const-eval error: cannot use f32::to_bits on a NaN") - } - FpCategory::Subnormal => { - panic!("const-eval error: cannot use f32::to_bits on a subnormal number") - } - FpCategory::Infinite | FpCategory::Normal | FpCategory::Zero => { - // SAFETY: We have a normal floating point number. Now we transmute, i.e. do a bitcopy. - unsafe { mem::transmute::<f32, u32>(ct) } - } - } - } - - #[inline(always)] // See https://github.com/rust-lang/compiler-builtins/issues/491 - fn rt_f32_to_u32(x: f32) -> u32 { - // SAFETY: `u32` is a plain old datatype so we can always... uh... - // ...look, just pretend you forgot what you just read. - // Stability concerns. - unsafe { mem::transmute(x) } - } - intrinsics::const_eval_select((self,), ct_f32_to_u32, rt_f32_to_u32) + unsafe { mem::transmute(self) } } /// Raw transmutation from `u32`. @@ -1232,53 +1162,8 @@ impl f32 { #[inline] pub const fn from_bits(v: u32) -> Self { // It turns out the safety issues with sNaN were overblown! Hooray! - // SAFETY: `u32` is a plain old datatype so we can always transmute from it - // ...sorta. - // - // It turns out that at runtime, it is possible for a floating point number - // to be subject to floating point modes that alter nonzero subnormal numbers - // to zero on reads and writes, aka "denormals are zero" and "flush to zero". - // This is not a problem usually, but at least one tier2 platform for Rust - // actually exhibits this behavior by default: thumbv7neon - // aka "the Neon FPU in AArch32 state" - // - // In addition, on x86 targets with SSE or SSE2 disabled and the x87 FPU enabled, - // i.e. not soft-float, the way Rust does parameter passing can actually alter - // a number that is "not infinity" to have the same exponent as infinity, - // in a slightly unpredictable manner. - // - // And, of course evaluating to a NaN value is fairly nondeterministic. - // More precisely: when NaN should be returned is knowable, but which NaN? - // So far that's defined by a combination of LLVM and the CPU, not Rust. - // This function, however, allows observing the bitstring of a NaN, - // thus introspection on CTFE. - // - // In order to preserve, at least for the moment, const-to-runtime equivalence, - // reject any of these possible situations from happening. - #[rustc_const_unstable(feature = "const_float_bits_conv", issue = "72447")] - const fn ct_u32_to_f32(ct: u32) -> f32 { - match f32::classify_bits(ct) { - FpCategory::Subnormal => { - panic!("const-eval error: cannot use f32::from_bits on a subnormal number") - } - FpCategory::Nan => { - panic!("const-eval error: cannot use f32::from_bits on NaN") - } - FpCategory::Infinite | FpCategory::Normal | FpCategory::Zero => { - // SAFETY: It's not a frumious number - unsafe { mem::transmute::<u32, f32>(ct) } - } - } - } - - #[inline(always)] // See https://github.com/rust-lang/compiler-builtins/issues/491 - fn rt_u32_to_f32(x: u32) -> f32 { - // SAFETY: `u32` is a plain old datatype so we can always... uh... - // ...look, just pretend you forgot what you just read. - // Stability concerns. - unsafe { mem::transmute(x) } - } - intrinsics::const_eval_select((v,), ct_u32_to_f32, rt_u32_to_f32) + // SAFETY: `u32` is a plain old datatype so we can always transmute from it. + unsafe { mem::transmute(v) } } /// Returns the memory representation of this floating point number as a byte array in diff --git a/library/core/src/num/f64.rs b/library/core/src/num/f64.rs index a89859be7ef..85eb152ad1f 100644 --- a/library/core/src/num/f64.rs +++ b/library/core/src/num/f64.rs @@ -528,7 +528,7 @@ impl f64 { #[inline] #[rustc_const_unstable(feature = "const_float_classify", issue = "72505")] pub(crate) const fn abs_private(self) -> f64 { - // SAFETY: This transmutation is fine. Probably. For the reasons std is using it. + // SAFETY: This transmutation is fine just like in `to_bits`/`from_bits`. unsafe { mem::transmute::<u64, f64>(mem::transmute::<f64, u64>(self) & !Self::SIGN_MASK) } } @@ -653,12 +653,14 @@ impl f64 { pub const fn classify(self) -> FpCategory { // A previous implementation tried to only use bitmask-based checks, // using f64::to_bits to transmute the float to its bit repr and match on that. - // Unfortunately, floating point numbers can be much worse than that. - // This also needs to not result in recursive evaluations of f64::to_bits. + // If we only cared about being "technically" correct, that's an entirely legit + // implementation. + // + // Unfortunately, there is hardware out there that does not correctly implement the IEEE + // float semantics Rust relies on: x87 uses a too-large exponent, and some hardware flushes + // subnormals to zero. These are platforms bugs, and Rust will misbehave on such hardware, + // but we can at least try to make things seem as sane as possible by being careful here. // - // On some processors, in some cases, LLVM will "helpfully" lower floating point ops, - // in spite of a request for them using f32 and f64, to things like x87 operations. - // These have an f64's mantissa, but can have a larger than normal exponent. // FIXME(jubilee): Using x87 operations is never necessary in order to function // on x86 processors for Rust-to-Rust calls, so this issue should not happen. // Code generation should be adjusted to use non-C calling conventions, avoiding this. @@ -672,41 +674,18 @@ impl f64 { // as correctness requires avoiding equality tests that may be Subnormal == -0.0 // because it may be wrong under "denormals are zero" and "flush to zero" modes. // Most of std's targets don't use those, but they are used for thumbv7neon. - // So, this does use bitpattern matching for the rest. - - // SAFETY: f64 to u64 is fine. Usually. - // If control flow has gotten this far, the value is definitely in one of the categories - // that f64::partial_classify can correctly analyze. - unsafe { f64::partial_classify(self) } - } - } - - // This doesn't actually return a right answer for NaN on purpose, - // seeing as how it cannot correctly discern between a floating point NaN, - // and some normal floating point numbers truncated from an x87 FPU. - #[rustc_const_unstable(feature = "const_float_classify", issue = "72505")] - const unsafe fn partial_classify(self) -> FpCategory { - // SAFETY: The caller is not asking questions for which this will tell lies. - let b = unsafe { mem::transmute::<f64, u64>(self) }; - match (b & Self::MAN_MASK, b & Self::EXP_MASK) { - (0, Self::EXP_MASK) => FpCategory::Infinite, - (0, 0) => FpCategory::Zero, - (_, 0) => FpCategory::Subnormal, - _ => FpCategory::Normal, - } - } - - // This operates on bits, and only bits, so it can ignore concerns about weird FPUs. - // FIXME(jubilee): In a just world, this would be the entire impl for classify, - // plus a transmute. We do not live in a just world, but we can make it more so. - #[rustc_const_unstable(feature = "const_float_classify", issue = "72505")] - const fn classify_bits(b: u64) -> FpCategory { - match (b & Self::MAN_MASK, b & Self::EXP_MASK) { - (0, Self::EXP_MASK) => FpCategory::Infinite, - (_, Self::EXP_MASK) => FpCategory::Nan, - (0, 0) => FpCategory::Zero, - (_, 0) => FpCategory::Subnormal, - _ => FpCategory::Normal, + // So, this does use bitpattern matching for the rest. On x87, due to the incorrect + // float codegen on this hardware, this doesn't actually return a right answer for NaN + // because it cannot correctly discern between a floating point NaN, and some normal + // floating point numbers truncated from an x87 FPU -- but we took care of NaN above, so + // we are fine. + let b = self.to_bits(); + match (b & Self::MAN_MASK, b & Self::EXP_MASK) { + (0, Self::EXP_MASK) => FpCategory::Infinite, + (0, 0) => FpCategory::Zero, + (_, 0) => FpCategory::Subnormal, + _ => FpCategory::Normal, + } } } @@ -1134,33 +1113,7 @@ impl f64 { #[inline] pub const fn to_bits(self) -> u64 { // SAFETY: `u64` is a plain old datatype so we can always transmute to it. - // ...sorta. - // - // See the SAFETY comment in f64::from_bits for more. - #[rustc_const_unstable(feature = "const_float_bits_conv", issue = "72447")] - const fn ct_f64_to_u64(ct: f64) -> u64 { - match ct.classify() { - FpCategory::Nan => { - panic!("const-eval error: cannot use f64::to_bits on a NaN") - } - FpCategory::Subnormal => { - panic!("const-eval error: cannot use f64::to_bits on a subnormal number") - } - FpCategory::Infinite | FpCategory::Normal | FpCategory::Zero => { - // SAFETY: We have a normal floating point number. Now we transmute, i.e. do a bitcopy. - unsafe { mem::transmute::<f64, u64>(ct) } - } - } - } - - #[inline(always)] // See https://github.com/rust-lang/compiler-builtins/issues/491 - fn rt_f64_to_u64(rt: f64) -> u64 { - // SAFETY: `u64` is a plain old datatype so we can always... uh... - // ...look, just pretend you forgot what you just read. - // Stability concerns. - unsafe { mem::transmute::<f64, u64>(rt) } - } - intrinsics::const_eval_select((self,), ct_f64_to_u64, rt_f64_to_u64) + unsafe { mem::transmute(self) } } /// Raw transmutation from `u64`. @@ -1205,58 +1158,8 @@ impl f64 { #[inline] pub const fn from_bits(v: u64) -> Self { // It turns out the safety issues with sNaN were overblown! Hooray! - // SAFETY: `u64` is a plain old datatype so we can always transmute from it - // ...sorta. - // - // It turns out that at runtime, it is possible for a floating point number - // to be subject to floating point modes that alter nonzero subnormal numbers - // to zero on reads and writes, aka "denormals are zero" and "flush to zero". - // This is not a problem usually, but at least one tier2 platform for Rust - // actually exhibits an FTZ behavior by default: thumbv7neon - // aka "the Neon FPU in AArch32 state" - // - // Even with this, not all instructions exhibit the FTZ behaviors on thumbv7neon, - // so this should load the same bits if LLVM emits the "correct" instructions, - // but LLVM sometimes makes interesting choices about float optimization, - // and other FPUs may do similar. Thus, it is wise to indulge luxuriously in caution. - // - // In addition, on x86 targets with SSE or SSE2 disabled and the x87 FPU enabled, - // i.e. not soft-float, the way Rust does parameter passing can actually alter - // a number that is "not infinity" to have the same exponent as infinity, - // in a slightly unpredictable manner. - // - // And, of course evaluating to a NaN value is fairly nondeterministic. - // More precisely: when NaN should be returned is knowable, but which NaN? - // So far that's defined by a combination of LLVM and the CPU, not Rust. - // This function, however, allows observing the bitstring of a NaN, - // thus introspection on CTFE. - // - // In order to preserve, at least for the moment, const-to-runtime equivalence, - // reject any of these possible situations from happening. - #[rustc_const_unstable(feature = "const_float_bits_conv", issue = "72447")] - const fn ct_u64_to_f64(ct: u64) -> f64 { - match f64::classify_bits(ct) { - FpCategory::Subnormal => { - panic!("const-eval error: cannot use f64::from_bits on a subnormal number") - } - FpCategory::Nan => { - panic!("const-eval error: cannot use f64::from_bits on NaN") - } - FpCategory::Infinite | FpCategory::Normal | FpCategory::Zero => { - // SAFETY: It's not a frumious number - unsafe { mem::transmute::<u64, f64>(ct) } - } - } - } - - #[inline(always)] // See https://github.com/rust-lang/compiler-builtins/issues/491 - fn rt_u64_to_f64(rt: u64) -> f64 { - // SAFETY: `u64` is a plain old datatype so we can always... uh... - // ...look, just pretend you forgot what you just read. - // Stability concerns. - unsafe { mem::transmute::<u64, f64>(rt) } - } - intrinsics::const_eval_select((v,), ct_u64_to_f64, rt_u64_to_f64) + // SAFETY: `u64` is a plain old datatype so we can always transmute from it. + unsafe { mem::transmute(v) } } /// Returns the memory representation of this floating point number as a byte array in diff --git a/library/core/src/ptr/mod.rs b/library/core/src/ptr/mod.rs index 25d8f4a0adb..3fe5212cea7 100644 --- a/library/core/src/ptr/mod.rs +++ b/library/core/src/ptr/mod.rs @@ -2209,6 +2209,9 @@ impl<F: FnPtr> fmt::Debug for F { /// Creates a `const` raw pointer to a place, without creating an intermediate reference. /// +/// `addr_of!(expr)` is equivalent to `&raw const expr`. The macro is *soft-deprecated*; +/// use `&raw const` instead. +/// /// Creating a reference with `&`/`&mut` is only allowed if the pointer is properly aligned /// and points to initialized data. For cases where those requirements do not hold, /// raw pointers should be used instead. However, `&expr as *const _` creates a reference @@ -2283,6 +2286,9 @@ pub macro addr_of($place:expr) { /// Creates a `mut` raw pointer to a place, without creating an intermediate reference. /// +/// `addr_of_mut!(expr)` is equivalent to `&raw mut expr`. The macro is *soft-deprecated*; +/// use `&raw mut` instead. +/// /// Creating a reference with `&`/`&mut` is only allowed if the pointer is properly aligned /// and points to initialized data. For cases where those requirements do not hold, /// raw pointers should be used instead. However, `&mut expr as *mut _` creates a reference diff --git a/library/core/tests/clone.rs b/library/core/tests/clone.rs index b7130f16f87..71a328733b7 100644 --- a/library/core/tests/clone.rs +++ b/library/core/tests/clone.rs @@ -1,5 +1,7 @@ use core::clone::CloneToUninit; +use core::ffi::CStr; use core::mem::MaybeUninit; +use core::ptr; #[test] #[allow(suspicious_double_ref_op)] @@ -81,3 +83,41 @@ fn test_clone_to_uninit_slice_drops_on_panic() { drop(a); assert_eq!(COUNTER.load(Relaxed), 0); } + +#[test] +fn test_clone_to_uninit_str() { + let a = "hello"; + + let mut storage: MaybeUninit<[u8; 5]> = MaybeUninit::uninit(); + unsafe { a.clone_to_uninit(storage.as_mut_ptr() as *mut [u8] as *mut str) }; + assert_eq!(a.as_bytes(), unsafe { storage.assume_init() }.as_slice()); + + let mut b: Box<str> = "world".into(); + assert_eq!(a.len(), b.len()); + assert_ne!(a, &*b); + unsafe { a.clone_to_uninit(ptr::from_mut::<str>(&mut b)) }; + assert_eq!(a, &*b); +} + +#[test] +fn test_clone_to_uninit_cstr() { + let a = c"hello"; + + let mut storage: MaybeUninit<[u8; 6]> = MaybeUninit::uninit(); + unsafe { a.clone_to_uninit(storage.as_mut_ptr() as *mut [u8] as *mut CStr) }; + assert_eq!(a.to_bytes_with_nul(), unsafe { storage.assume_init() }.as_slice()); + + let mut b: Box<CStr> = c"world".into(); + assert_eq!(a.count_bytes(), b.count_bytes()); + assert_ne!(a, &*b); + unsafe { a.clone_to_uninit(ptr::from_mut::<CStr>(&mut b)) }; + assert_eq!(a, &*b); +} + +#[test] +fn cstr_metadata_is_length_with_nul() { + let s: &CStr = c"abcdef"; + let p: *const CStr = ptr::from_ref(s); + let bytes: *const [u8] = p as *const [u8]; + assert_eq!(s.to_bytes_with_nul().len(), bytes.len()); +} diff --git a/library/std/src/env.rs b/library/std/src/env.rs index 80890e61471..e06a851658c 100644 --- a/library/std/src/env.rs +++ b/library/std/src/env.rs @@ -198,13 +198,12 @@ impl fmt::Debug for VarsOs { /// /// # Errors /// -/// This function will return an error if the environment variable isn't set. +/// Returns [`VarError::NotPresent`] if: +/// - The variable is not set. +/// - The variable's name contains an equal sign or NUL (`'='` or `'\0'`). /// -/// This function may return an error if the environment variable's name contains -/// the equal sign character (`=`) or the NUL character. -/// -/// This function will return an error if the environment variable's value is -/// not valid Unicode. If this is not desired, consider using [`var_os`]. +/// Returns [`VarError::NotUnicode`] if the variable's value is not valid +/// Unicode. If this is not desired, consider using [`var_os`]. /// /// # Examples /// diff --git a/library/std/src/ffi/os_str.rs b/library/std/src/ffi/os_str.rs index a501bcc98cf..918eec2d0d8 100644 --- a/library/std/src/ffi/os_str.rs +++ b/library/std/src/ffi/os_str.rs @@ -3,10 +3,13 @@ #[cfg(test)] mod tests; +use core::clone::CloneToUninit; + use crate::borrow::{Borrow, Cow}; use crate::collections::TryReserveError; use crate::hash::{Hash, Hasher}; use crate::ops::{self, Range}; +use crate::ptr::addr_of_mut; use crate::rc::Rc; use crate::str::FromStr; use crate::sync::Arc; @@ -1261,6 +1264,16 @@ impl Clone for Box<OsStr> { } } +#[unstable(feature = "clone_to_uninit", issue = "126799")] +unsafe impl CloneToUninit for OsStr { + #[inline] + #[cfg_attr(debug_assertions, track_caller)] + unsafe fn clone_to_uninit(&self, dst: *mut Self) { + // SAFETY: we're just a wrapper around a platform-specific Slice + unsafe { self.inner.clone_to_uninit(addr_of_mut!((*dst).inner)) } + } +} + #[stable(feature = "shared_from_slice2", since = "1.24.0")] impl From<OsString> for Arc<OsStr> { /// Converts an [`OsString`] into an <code>[Arc]<[OsStr]></code> by moving the [`OsString`] diff --git a/library/std/src/ffi/os_str/tests.rs b/library/std/src/ffi/os_str/tests.rs index 5b39b9e34d8..67147934b4d 100644 --- a/library/std/src/ffi/os_str/tests.rs +++ b/library/std/src/ffi/os_str/tests.rs @@ -1,4 +1,6 @@ use super::*; +use crate::mem::MaybeUninit; +use crate::ptr; #[test] fn test_os_string_with_capacity() { @@ -286,3 +288,18 @@ fn slice_surrogate_edge() { assert_eq!(post_crab.slice_encoded_bytes(..4), "🦀"); assert_eq!(post_crab.slice_encoded_bytes(4..), surrogate); } + +#[test] +fn clone_to_uninit() { + let a = OsStr::new("hello.txt"); + + let mut storage = vec![MaybeUninit::<u8>::uninit(); size_of_val::<OsStr>(a)]; + unsafe { a.clone_to_uninit(ptr::from_mut::<[_]>(storage.as_mut_slice()) as *mut OsStr) }; + assert_eq!(a.as_encoded_bytes(), unsafe { MaybeUninit::slice_assume_init_ref(&storage) }); + + let mut b: Box<OsStr> = OsStr::new("world.exe").into(); + assert_eq!(size_of_val::<OsStr>(a), size_of_val::<OsStr>(&b)); + assert_ne!(a, &*b); + unsafe { a.clone_to_uninit(ptr::from_mut::<OsStr>(&mut b)) }; + assert_eq!(a, &*b); +} diff --git a/library/std/src/lib.rs b/library/std/src/lib.rs index 93a74ef739b..2530a376387 100644 --- a/library/std/src/lib.rs +++ b/library/std/src/lib.rs @@ -319,6 +319,7 @@ // tidy-alphabetical-start #![feature(c_str_module)] #![feature(char_internals)] +#![feature(clone_to_uninit)] #![feature(core_intrinsics)] #![feature(core_io_borrowed_buf)] #![feature(duration_constants)] diff --git a/library/std/src/path.rs b/library/std/src/path.rs index 80163667636..9eaa0e01c2c 100644 --- a/library/std/src/path.rs +++ b/library/std/src/path.rs @@ -70,6 +70,8 @@ #[cfg(test)] mod tests; +use core::clone::CloneToUninit; + use crate::borrow::{Borrow, Cow}; use crate::collections::TryReserveError; use crate::error::Error; @@ -3109,6 +3111,16 @@ impl Path { } } +#[unstable(feature = "clone_to_uninit", issue = "126799")] +unsafe impl CloneToUninit for Path { + #[inline] + #[cfg_attr(debug_assertions, track_caller)] + unsafe fn clone_to_uninit(&self, dst: *mut Self) { + // SAFETY: Path is just a wrapper around OsStr + unsafe { self.inner.clone_to_uninit(core::ptr::addr_of_mut!((*dst).inner)) } + } +} + #[stable(feature = "rust1", since = "1.0.0")] impl AsRef<OsStr> for Path { #[inline] diff --git a/library/std/src/path/tests.rs b/library/std/src/path/tests.rs index a12e42cba0c..6436872087d 100644 --- a/library/std/src/path/tests.rs +++ b/library/std/src/path/tests.rs @@ -3,6 +3,8 @@ use core::hint::black_box; use super::*; use crate::collections::{BTreeSet, HashSet}; use crate::hash::DefaultHasher; +use crate::mem::MaybeUninit; +use crate::ptr; #[allow(unknown_lints, unused_macro_rules)] macro_rules! t ( @@ -2054,3 +2056,20 @@ fn bench_hash_path_long(b: &mut test::Bencher) { black_box(hasher.finish()); } + +#[test] +fn clone_to_uninit() { + let a = Path::new("hello.txt"); + + let mut storage = vec![MaybeUninit::<u8>::uninit(); size_of_val::<Path>(a)]; + unsafe { a.clone_to_uninit(ptr::from_mut::<[_]>(storage.as_mut_slice()) as *mut Path) }; + assert_eq!(a.as_os_str().as_encoded_bytes(), unsafe { + MaybeUninit::slice_assume_init_ref(&storage) + }); + + let mut b: Box<Path> = Path::new("world.exe").into(); + assert_eq!(size_of_val::<Path>(a), size_of_val::<Path>(&b)); + assert_ne!(a, &*b); + unsafe { a.clone_to_uninit(ptr::from_mut::<Path>(&mut b)) }; + assert_eq!(a, &*b); +} diff --git a/library/std/src/sys/os_str/bytes.rs b/library/std/src/sys/os_str/bytes.rs index 0f8bd645352..992767211d0 100644 --- a/library/std/src/sys/os_str/bytes.rs +++ b/library/std/src/sys/os_str/bytes.rs @@ -1,6 +1,9 @@ //! The underlying OsString/OsStr implementation on Unix and many other //! systems: just a `Vec<u8>`/`[u8]`. +use core::clone::CloneToUninit; +use core::ptr::addr_of_mut; + use crate::borrow::Cow; use crate::collections::TryReserveError; use crate::fmt::Write; @@ -345,3 +348,13 @@ impl Slice { self.inner.eq_ignore_ascii_case(&other.inner) } } + +#[unstable(feature = "clone_to_uninit", issue = "126799")] +unsafe impl CloneToUninit for Slice { + #[inline] + #[cfg_attr(debug_assertions, track_caller)] + unsafe fn clone_to_uninit(&self, dst: *mut Self) { + // SAFETY: we're just a wrapper around [u8] + unsafe { self.inner.clone_to_uninit(addr_of_mut!((*dst).inner)) } + } +} diff --git a/library/std/src/sys/os_str/wtf8.rs b/library/std/src/sys/os_str/wtf8.rs index ed975ba58b5..433237aa6e7 100644 --- a/library/std/src/sys/os_str/wtf8.rs +++ b/library/std/src/sys/os_str/wtf8.rs @@ -1,5 +1,8 @@ //! The underlying OsString/OsStr implementation on Windows is a //! wrapper around the "WTF-8" encoding; see the `wtf8` module for more. +use core::clone::CloneToUninit; +use core::ptr::addr_of_mut; + use crate::borrow::Cow; use crate::collections::TryReserveError; use crate::rc::Rc; @@ -268,3 +271,13 @@ impl Slice { self.inner.eq_ignore_ascii_case(&other.inner) } } + +#[unstable(feature = "clone_to_uninit", issue = "126799")] +unsafe impl CloneToUninit for Slice { + #[inline] + #[cfg_attr(debug_assertions, track_caller)] + unsafe fn clone_to_uninit(&self, dst: *mut Self) { + // SAFETY: we're just a wrapper around Wtf8 + unsafe { self.inner.clone_to_uninit(addr_of_mut!((*dst).inner)) } + } +} diff --git a/library/std/src/sys_common/wtf8.rs b/library/std/src/sys_common/wtf8.rs index 277c9506feb..063451ad54e 100644 --- a/library/std/src/sys_common/wtf8.rs +++ b/library/std/src/sys_common/wtf8.rs @@ -19,12 +19,14 @@ mod tests; use core::char::{encode_utf16_raw, encode_utf8_raw}; +use core::clone::CloneToUninit; use core::str::next_code_point; use crate::borrow::Cow; use crate::collections::TryReserveError; use crate::hash::{Hash, Hasher}; use crate::iter::FusedIterator; +use crate::ptr::addr_of_mut; use crate::rc::Rc; use crate::sync::Arc; use crate::sys_common::AsInner; @@ -1046,3 +1048,13 @@ impl Hash for Wtf8 { 0xfeu8.hash(state) } } + +#[unstable(feature = "clone_to_uninit", issue = "126799")] +unsafe impl CloneToUninit for Wtf8 { + #[inline] + #[cfg_attr(debug_assertions, track_caller)] + unsafe fn clone_to_uninit(&self, dst: *mut Self) { + // SAFETY: we're just a wrapper around [u8] + unsafe { self.bytes.clone_to_uninit(addr_of_mut!((*dst).bytes)) } + } +} diff --git a/src/bootstrap/Cargo.lock b/src/bootstrap/Cargo.lock index 60453764d82..357c6175152 100644 --- a/src/bootstrap/Cargo.lock +++ b/src/bootstrap/Cargo.lock @@ -4,30 +4,24 @@ version = 3 [[package]] name = "aho-corasick" -version = "1.1.2" +version = "1.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b2969dcb958b36655471fc61f7e416fa76033bdd4bfed0678d8fee1e2d07a1f0" +checksum = "8e60d3430d3a69478ad0993f19238d2df97c507009a52b3c10addcd7f6bcb916" dependencies = [ "memchr", ] [[package]] name = "anstyle" -version = "1.0.4" +version = "1.0.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7079075b41f533b8c61d2a4d073c4676e1f8b249ff94a393b0595db304e0dd87" +checksum = "1bec1de6f59aedf83baf9ff929c98f2ad654b97c9510f4e70cf6f661d49fd5b1" [[package]] name = "bitflags" -version = "1.3.2" +version = "2.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" - -[[package]] -name = "bitflags" -version = "2.4.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "327762f6e5a765692301e5bb513e0d9fef63be86bbc14528052b1cd3e6f03e07" +checksum = "b048fb63fd8b5923fc5aa7b340d8e156aec7ec02f0c78fa8a6ddc2613f6f71de" [[package]] name = "block-buffer" @@ -71,9 +65,9 @@ dependencies = [ [[package]] name = "bstr" -version = "1.9.0" +version = "1.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c48f0051a4b4c5e0b6d365cd04af53aeaa209e3cc15ec2cdb69e73cc87fbd0dc" +checksum = "40723b8fb387abc38f4f4a37c09073622e41dd12327033091ef8950659e6dc0c" dependencies = [ "memchr", "regex-automata", @@ -102,9 +96,9 @@ checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" [[package]] name = "clap" -version = "4.4.13" +version = "4.5.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "52bdc885e4cacc7f7c9eedc1ef6da641603180c783c41a15c264944deeaab642" +checksum = "ed6719fffa43d0d87e5fd8caeab59be1554fb028cd30edc88fc4369b17971019" dependencies = [ "clap_builder", "clap_derive", @@ -112,9 +106,9 @@ dependencies = [ [[package]] name = "clap_builder" -version = "4.4.12" +version = "4.5.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fb7fb5e4e979aec3be7791562fcba452f94ad85e954da024396433e0e25a79e9" +checksum = "216aec2b177652e3846684cbfe25c9964d18ec45234f0f5da5157b207ed1aab6" dependencies = [ "anstyle", "clap_lex", @@ -122,18 +116,18 @@ dependencies = [ [[package]] name = "clap_complete" -version = "4.4.6" +version = "4.5.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "97aeaa95557bd02f23fbb662f981670c3d20c5a26e69f7354b28f57092437fcd" +checksum = "1ee158892bd7ce77aa15c208abbdb73e155d191c287a659b57abd5adb92feb03" dependencies = [ "clap", ] [[package]] name = "clap_derive" -version = "4.4.7" +version = "4.5.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cf9804afaaf59a91e75b022a30fb7229a7901f60c755489cc61c9b423b836442" +checksum = "501d359d5f3dcaf6ecdeee48833ae73ec6e42723a1e52419c79abf9507eec0a0" dependencies = [ "heck", "proc-macro2", @@ -143,9 +137,9 @@ dependencies = [ [[package]] name = "clap_lex" -version = "0.6.0" +version = "0.7.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "702fc72eb24e5a1e48ce58027a675bc24edd52096d5397d4aea7c6dd9eca0bd1" +checksum = "1462739cb27611015575c0c11df5df7601141071f07518d56fcc1be504cbec97" [[package]] name = "cmake" @@ -158,15 +152,15 @@ dependencies = [ [[package]] name = "core-foundation-sys" -version = "0.8.6" +version = "0.8.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "06ea2b9bc92be3c2baa9334a323ebca2d6f074ff852cd1d7b11064035cd3868f" +checksum = "773648b94d0e5d620f64f280777445740e61fe701025087ec8b57f45c791888b" [[package]] name = "cpufeatures" -version = "0.2.12" +version = "0.2.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "53fe5e26ff1b7aef8bca9c6080520cfb8d9333c7568e1829cef191a9723e5504" +checksum = "51e852e6dc9a5bed1fae92dd2375037bf2b768725bf3be87811edee3249d09ad" dependencies = [ "libc", ] @@ -224,12 +218,12 @@ dependencies = [ [[package]] name = "errno" -version = "0.3.8" +version = "0.3.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a258e46cdc063eb8519c00b9fc845fc47bcfca4130e2f08e88665ceda8474245" +checksum = "534c5cf6194dfab3db3242765c03bbe257cf92f22b38f6bc0c58d59108a820ba" dependencies = [ "libc", - "windows-sys", + "windows-sys 0.52.0", ] [[package]] @@ -240,19 +234,19 @@ checksum = "7e5768da2206272c81ef0b5e951a41862938a6070da63bcea197899942d3b947" dependencies = [ "cfg-if", "rustix", - "windows-sys", + "windows-sys 0.52.0", ] [[package]] name = "filetime" -version = "0.2.23" +version = "0.2.24" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1ee447700ac8aa0b2f2bd7bc4462ad686ba06baa6727ac149a2d6277f0d240fd" +checksum = "bf401df4a4e3872c4fe8151134cf483738e74b67fc934d6532c882b3d24a4550" dependencies = [ "cfg-if", "libc", - "redox_syscall", - "windows-sys", + "libredox", + "windows-sys 0.59.0", ] [[package]] @@ -280,9 +274,9 @@ dependencies = [ [[package]] name = "heck" -version = "0.4.1" +version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "95505c38b4572b2d910cecb0281560f54b440a19336cbbcb27bf6ce6adc6f5a8" +checksum = "2304e00983f87ffb38b55b444b5e3b60a884b5d30c0fca7d82fe33449bbe55ea" [[package]] name = "home" @@ -290,14 +284,14 @@ version = "0.5.9" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e3d1354bf6b7235cb4a0576c2619fd4ed18183f689b12b006a0ee7329eeff9a5" dependencies = [ - "windows-sys", + "windows-sys 0.52.0", ] [[package]] name = "ignore" -version = "0.4.21" +version = "0.4.22" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "747ad1b4ae841a78e8aba0d63adbfbeaea26b517b63705d47856b73015d27060" +checksum = "b46810df39e66e925525d6e38ce1e7f6e1d208f72dc39757880fcb66e2c58af1" dependencies = [ "crossbeam-deque", "globset", @@ -311,9 +305,9 @@ dependencies = [ [[package]] name = "itoa" -version = "1.0.10" +version = "1.0.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b1a46d1a171d865aa5f83f92695765caa047a9b4cbae2cbf37dbd613a793fd4c" +checksum = "49f1f14873335454500d59611f1cf4a4b0f786f9ac11f4312a78e4cf2566695b" [[package]] name = "junction" @@ -322,26 +316,37 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1c9c415a9b7b1e86cd5738f39d34c9e78c765da7fb1756dbd7d31b3b0d2e7afa" dependencies = [ "scopeguard", - "windows-sys", + "windows-sys 0.52.0", ] [[package]] name = "libc" -version = "0.2.155" +version = "0.2.157" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "97b3888a4aecf77e811145cadf6eef5901f4782c53886191b2f693f24761847c" +checksum = "374af5f94e54fa97cf75e945cce8a6b201e88a1a07e688b47dfd2a59c66dbd86" + +[[package]] +name = "libredox" +version = "0.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c0ff37bd590ca25063e35af745c343cb7a0271906fb7b37e4813e8f79f00268d" +dependencies = [ + "bitflags", + "libc", + "redox_syscall", +] [[package]] name = "linux-raw-sys" -version = "0.4.12" +version = "0.4.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c4cd1a83af159aa67994778be9070f0ae1bd732942279cabb14f86f986a21456" +checksum = "78b3ae25bc7c8c38cec158d1f2757ee79e9b3740fbc7ccf0e59e4b08d793fa89" [[package]] name = "log" -version = "0.4.20" +version = "0.4.22" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b5e6163cb8c49088c2c36f57875e58ccd8c87c7427f7fbd50ea6710b2f3f2e8f" +checksum = "a7a70ba024b9dc04c27ea2f0c0548feb474ec5c54bba33a7f72f873a39d07b24" [[package]] name = "lzma-sys" @@ -356,9 +361,9 @@ dependencies = [ [[package]] name = "memchr" -version = "2.7.1" +version = "2.7.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "523dc4f511e55ab87b694dc30d0f820d60906ef06413f93d4d7a1385599cc149" +checksum = "78ca9ab1a0babb1e7d5695e3530886289c18cf2f87ec19a575a0abdce112e3a3" [[package]] name = "ntapi" @@ -371,9 +376,9 @@ dependencies = [ [[package]] name = "object" -version = "0.32.2" +version = "0.36.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a6a622008b6e321afc04970976f62ee297fdbaa6f95318ca343e3eebb9648441" +checksum = "27b64972346851a39438c60b341ebc01bba47464ae329e55cf343eb93964efd9" dependencies = [ "memchr", ] @@ -390,9 +395,9 @@ dependencies = [ [[package]] name = "pkg-config" -version = "0.3.28" +version = "0.3.30" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "69d3587f8a9e599cc7ec2c00e331f71c4e69a5f9a4b8a6efd5b07466b9736f9a" +checksum = "d231b230927b5e4ad203db57bbcbee2802f6bce620b1e4a9024a07d94e2907ec" [[package]] name = "pretty_assertions" @@ -406,36 +411,36 @@ dependencies = [ [[package]] name = "proc-macro2" -version = "1.0.76" +version = "1.0.86" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "95fc56cda0b5c3325f5fbbd7ff9fda9e02bb00bb3dac51252d2f1bfa1cb8cc8c" +checksum = "5e719e8df665df0d1c8fbfd238015744736151d4445ec0836b8e628aae103b77" dependencies = [ "unicode-ident", ] [[package]] name = "quote" -version = "1.0.35" +version = "1.0.36" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "291ec9ab5efd934aaf503a6466c5d5251535d108ee747472c3977cc5acc868ef" +checksum = "0fa76aaf39101c457836aec0ce2316dbdc3ab723cdda1c6bd4e6ad4208acaca7" dependencies = [ "proc-macro2", ] [[package]] name = "redox_syscall" -version = "0.4.1" +version = "0.5.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4722d768eff46b75989dd134e5c353f0d6296e5aaa3132e776cbdb56be7731aa" +checksum = "2a908a6e00f1fdd0dfd9c0eb08ce85126f6d8bbda50017e74bc4a4b7d4a926a4" dependencies = [ - "bitflags 1.3.2", + "bitflags", ] [[package]] name = "regex-automata" -version = "0.4.3" +version = "0.4.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5f804c7828047e88b2d32e2d7fe5a105da8ee3264f01902f796c8e067dc2483f" +checksum = "38caf58cc5ef2fed281f89292ef23f6365465ed9a41b7a7754eb4e26496c92df" dependencies = [ "aho-corasick", "memchr", @@ -444,28 +449,28 @@ dependencies = [ [[package]] name = "regex-syntax" -version = "0.8.2" +version = "0.8.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c08c74e62047bb2de4ff487b251e4a92e24f48745648451635cec7d591162d9f" +checksum = "7a66a03ae7c801facd77a29370b4faec201768915ac14a721ba36f20bc9c209b" [[package]] name = "rustix" -version = "0.38.28" +version = "0.38.34" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "72e572a5e8ca657d7366229cdde4bd14c4eb5499a9573d4d366fe1b599daa316" +checksum = "70dc5ec042f7a43c4a73241207cecc9873a06d45debb38b329f8541d85c2730f" dependencies = [ - "bitflags 2.4.1", + "bitflags", "errno", "libc", "linux-raw-sys", - "windows-sys", + "windows-sys 0.52.0", ] [[package]] name = "ryu" -version = "1.0.16" +version = "1.0.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f98d2aa92eebf49b69786be48e4477826b256916e84a57ff2a4f21923b48eb4c" +checksum = "f3cb5ba0dc43242ce17de99c180e96db90b235b8a9fdc9543c96d2209116bd9f" [[package]] name = "same-file" @@ -484,24 +489,24 @@ checksum = "94143f37725109f92c262ed2cf5e59bce7498c01bcc1502d7b9afe439a4e9f49" [[package]] name = "semver" -version = "1.0.21" +version = "1.0.23" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b97ed7a9823b74f99c7742f5336af7be5ecd3eeafcb1507d1fa93347b1d589b0" +checksum = "61697e0a1c7e512e84a621326239844a24d8207b4669b41bc18b32ea5cbf988b" [[package]] name = "serde" -version = "1.0.195" +version = "1.0.208" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "63261df402c67811e9ac6def069e4786148c4563f4b50fd4bf30aa370d626b02" +checksum = "cff085d2cb684faa248efb494c39b68e522822ac0de72ccf08109abde717cfb2" dependencies = [ "serde_derive", ] [[package]] name = "serde_derive" -version = "1.0.195" +version = "1.0.208" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "46fe8f8603d81ba86327b23a2e9cdf49e1255fb94a4c5f297f6ee0547178ea2c" +checksum = "24008e81ff7613ed8e5ba0cfaf24e2c2f1e5b8a0495711e44fcd4882fca62bcf" dependencies = [ "proc-macro2", "quote", @@ -510,11 +515,12 @@ dependencies = [ [[package]] name = "serde_json" -version = "1.0.111" +version = "1.0.125" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "176e46fa42316f18edd598015a5166857fc835ec732f5215eac6b7bdbf0a84f4" +checksum = "83c8e735a073ccf5be70aa8066aa984eaf2fa000db6c8d0100ae605b366d31ed" dependencies = [ "itoa", + "memchr", "ryu", "serde", ] @@ -532,9 +538,9 @@ dependencies = [ [[package]] name = "syn" -version = "2.0.48" +version = "2.0.75" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0f3531638e407dfc0814761abb7c00a5b54992b849452a0646b7f65c9f770f3f" +checksum = "f6af063034fc1935ede7be0122941bafa9bacb949334d090b77ca98b5817c7d9" dependencies = [ "proc-macro2", "quote", @@ -556,9 +562,9 @@ dependencies = [ [[package]] name = "tar" -version = "0.4.40" +version = "0.4.41" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b16afcea1f22891c49a00c751c7b63b2233284064f11a200fc624137c51e2ddb" +checksum = "cb797dad5fb5b76fcf519e702f4a589483b5ef06567f160c392832c1f5e44909" dependencies = [ "filetime", "libc", @@ -567,9 +573,9 @@ dependencies = [ [[package]] name = "termcolor" -version = "1.4.0" +version = "1.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ff1bc3d3f05aff0403e8ac0d92ced918ec05b666a43f83297ccef5bea8a3d449" +checksum = "06794f8f6c5c898b3275aebefa6b8a1cb24cd2c6c79397ab15774837a0bc5755" dependencies = [ "winapi-util", ] @@ -597,15 +603,15 @@ checksum = "3354b9ac3fae1ff6755cb6db53683adb661634f67557942dea4facebec0fee4b" [[package]] name = "version_check" -version = "0.9.4" +version = "0.9.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "49874b5167b65d7193b8aba1567f5c7d93d001cafc34600cee003eda787e483f" +checksum = "0b928f33d975fc6ad9f86c8f283853ad26bdd5b10b7f1542aa2fa15e2289105a" [[package]] name = "walkdir" -version = "2.4.0" +version = "2.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d71d857dc86794ca4c280d616f7da00d2dbfd8cd788846559a6813e6aa4b54ee" +checksum = "29790946404f91d9c5d06f9874efddea1dc06c5efe94541a7d6863108e3a5e4b" dependencies = [ "same-file", "winapi-util", @@ -629,11 +635,11 @@ checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" [[package]] name = "winapi-util" -version = "0.1.6" +version = "0.1.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f29e6f9198ba0d26b4c9f07dbe6f9ed633e1f3d5b8b414090084349e46a52596" +checksum = "cf221c93e13a30d793f7645a0e7762c55d169dbb0a49671918a2319d289b10bb" dependencies = [ - "winapi", + "windows-sys 0.59.0", ] [[package]] @@ -724,6 +730,15 @@ dependencies = [ ] [[package]] +name = "windows-sys" +version = "0.59.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1e38bc4d79ed67fd075bcc251a1c39b32a1776bbe92e5bef1f0bf1f8c531853b" +dependencies = [ + "windows-targets", +] + +[[package]] name = "windows-targets" version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" @@ -789,9 +804,9 @@ checksum = "589f6da84c646204747d1270a2a5661ea66ed1cced2631d546fdfb155959f9ec" [[package]] name = "xattr" -version = "1.2.0" +version = "1.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "914566e6413e7fa959cc394fb30e563ba80f3541fbd40816d4c05a0fc3f2a0f1" +checksum = "8da84f1a25939b27f6820d92aed108f83ff920fdf11a7b19366c27c4cda81d4f" dependencies = [ "libc", "linux-raw-sys", diff --git a/src/bootstrap/Cargo.toml b/src/bootstrap/Cargo.toml index 84262c115b1..07f7444aaff 100644 --- a/src/bootstrap/Cargo.toml +++ b/src/bootstrap/Cargo.toml @@ -47,7 +47,7 @@ fd-lock = "4.0" home = "0.5" ignore = "0.4" libc = "0.2" -object = { version = "0.32", default-features = false, features = ["archive", "coff", "read_core", "unaligned"] } +object = { version = "0.36.3", default-features = false, features = ["archive", "coff", "read_core", "unaligned"] } opener = "0.5" semver = "1.0" serde = "1.0" diff --git a/src/bootstrap/download-ci-llvm-stamp b/src/bootstrap/download-ci-llvm-stamp index 11316004412..90901530501 100644 --- a/src/bootstrap/download-ci-llvm-stamp +++ b/src/bootstrap/download-ci-llvm-stamp @@ -1,4 +1,4 @@ Change this file to make users of the `download-ci-llvm` configuration download a new version of LLVM from CI, even if the LLVM submodule hasn’t changed. -Last change is for: https://github.com/rust-lang/rust/pull/125642 +Last change is for: https://github.com/rust-lang/rust/pull/129116 diff --git a/src/bootstrap/src/core/build_steps/dist.rs b/src/bootstrap/src/core/build_steps/dist.rs index 530eb9b446a..8d20b956213 100644 --- a/src/bootstrap/src/core/build_steps/dist.rs +++ b/src/bootstrap/src/core/build_steps/dist.rs @@ -19,6 +19,7 @@ use object::BinaryFormat; use crate::core::build_steps::doc::DocumentationFormat; use crate::core::build_steps::tool::{self, Tool}; +use crate::core::build_steps::vendor::default_paths_to_vendor; use crate::core::build_steps::{compile, llvm}; use crate::core::builder::{Builder, Kind, RunConfig, ShouldRun, Step}; use crate::core::config::TargetSelection; @@ -1004,35 +1005,18 @@ impl Step for PlainSourceTarball { if builder.rust_info().is_managed_git_subrepository() || builder.rust_info().is_from_tarball() { - // FIXME: This code looks _very_ similar to what we have in `src/core/build_steps/vendor.rs` - // perhaps it should be removed in favor of making `dist` perform the `vendor` step? - builder.require_and_update_all_submodules(); // Vendor all Cargo dependencies let mut cmd = command(&builder.initial_cargo); - cmd.arg("vendor") - .arg("--versioned-dirs") - .arg("--sync") - .arg(builder.src.join("./src/tools/cargo/Cargo.toml")) - .arg("--sync") - .arg(builder.src.join("./src/tools/rust-analyzer/Cargo.toml")) - .arg("--sync") - .arg(builder.src.join("./compiler/rustc_codegen_cranelift/Cargo.toml")) - .arg("--sync") - .arg(builder.src.join("./compiler/rustc_codegen_gcc/Cargo.toml")) - .arg("--sync") - .arg(builder.src.join("./library/Cargo.toml")) - .arg("--sync") - .arg(builder.src.join("./src/bootstrap/Cargo.toml")) - .arg("--sync") - .arg(builder.src.join("./src/tools/opt-dist/Cargo.toml")) - .arg("--sync") - .arg(builder.src.join("./src/tools/rustc-perf/Cargo.toml")) - .arg("--sync") - .arg(builder.src.join("./src/tools/rustbook/Cargo.toml")) - // Will read the libstd Cargo.toml - // which uses the unstable `public-dependency` feature. + cmd.arg("vendor").arg("--versioned-dirs"); + + for p in default_paths_to_vendor(builder) { + cmd.arg("--sync").arg(p); + } + + cmd + // Will read the libstd Cargo.toml which uses the unstable `public-dependency` feature. .env("RUSTC_BOOTSTRAP", "1") .current_dir(plain_dst_src); @@ -2322,6 +2306,19 @@ impl Step for RustDev { let link_type = if builder.llvm_link_shared() { "dynamic" } else { "static" }; t!(std::fs::write(tarball.image_dir().join("link-type.txt"), link_type), dst_libdir); + // Copy the `compiler-rt` source, so that `library/profiler_builtins` + // can potentially use it to build the profiler runtime without needing + // to check out the LLVM submodule. + copy_src_dirs( + builder, + &builder.src.join("src").join("llvm-project"), + &["compiler-rt"], + // The test subdirectory is much larger than the rest of the source, + // and we currently don't use these test files anyway. + &["compiler-rt/test"], + tarball.image_dir(), + ); + Some(tarball.generate()) } } diff --git a/src/bootstrap/src/core/build_steps/setup.rs b/src/bootstrap/src/core/build_steps/setup.rs index 8cd9ba5fd14..f7b26712cab 100644 --- a/src/bootstrap/src/core/build_steps/setup.rs +++ b/src/bootstrap/src/core/build_steps/setup.rs @@ -247,9 +247,11 @@ pub struct Link; impl Step for Link { type Output = (); const DEFAULT: bool = true; + fn should_run(run: ShouldRun<'_>) -> ShouldRun<'_> { run.alias("link") } + fn make_run(run: RunConfig<'_>) { if run.builder.config.dry_run() { return; @@ -262,21 +264,30 @@ impl Step for Link { } fn run(self, builder: &Builder<'_>) -> Self::Output { let config = &builder.config; + if config.dry_run() { return; } + + if !rustup_installed(builder) { + println!("WARNING: `rustup` is not installed; Skipping `stage1` toolchain linking."); + return; + } + let stage_path = ["build", config.build.rustc_target_arg(), "stage1"].join(MAIN_SEPARATOR_STR); - if !rustup_installed(builder) { - eprintln!("`rustup` is not installed; cannot link `stage1` toolchain"); - } else if stage_dir_exists(&stage_path[..]) && !config.dry_run() { + + if stage_dir_exists(&stage_path[..]) && !config.dry_run() { attempt_toolchain_link(builder, &stage_path[..]); } } } fn rustup_installed(builder: &Builder<'_>) -> bool { - command("rustup").arg("--version").run_capture_stdout(builder).is_success() + let mut rustup = command("rustup"); + rustup.arg("--version"); + + rustup.allow_failure().run_always().run_capture_stdout(builder).is_success() } fn stage_dir_exists(stage_path: &str) -> bool { diff --git a/src/bootstrap/src/core/build_steps/tool.rs b/src/bootstrap/src/core/build_steps/tool.rs index 4d573b107b5..ff8ca2ad74a 100644 --- a/src/bootstrap/src/core/build_steps/tool.rs +++ b/src/bootstrap/src/core/build_steps/tool.rs @@ -1091,18 +1091,13 @@ macro_rules! tool_extended { } } -// NOTE: tools need to be also added to `Builder::get_step_descriptions` in `builder.rs` -// to make `./x.py build <tool>` work. tool_extended!((self, builder), Cargofmt, "src/tools/rustfmt", "cargo-fmt", stable=true; CargoClippy, "src/tools/clippy", "cargo-clippy", stable=true; Clippy, "src/tools/clippy", "clippy-driver", stable=true, add_bins_to_sysroot = ["clippy-driver", "cargo-clippy"]; Miri, "src/tools/miri", "miri", stable=false, add_bins_to_sysroot = ["miri"]; CargoMiri, "src/tools/miri/cargo-miri", "cargo-miri", stable=true, add_bins_to_sysroot = ["cargo-miri"]; - // FIXME: tool_std is not quite right, we shouldn't allow nightly features. - // But `builder.cargo` doesn't know how to handle ToolBootstrap in stages other than 0, - // and this is close enough for now. - Rls, "src/tools/rls", "rls", stable=true, tool_std=true; + Rls, "src/tools/rls", "rls", stable=true; Rustfmt, "src/tools/rustfmt", "rustfmt", stable=true, add_bins_to_sysroot = ["rustfmt", "cargo-fmt"]; ); diff --git a/src/bootstrap/src/core/build_steps/vendor.rs b/src/bootstrap/src/core/build_steps/vendor.rs index 33768465225..82a6b4d4f28 100644 --- a/src/bootstrap/src/core/build_steps/vendor.rs +++ b/src/bootstrap/src/core/build_steps/vendor.rs @@ -4,6 +4,26 @@ use crate::core::build_steps::tool::SUBMODULES_FOR_RUSTBOOK; use crate::core::builder::{Builder, RunConfig, ShouldRun, Step}; use crate::utils::exec::command; +/// List of default paths used for vendoring for `x vendor` and dist tarballs. +pub fn default_paths_to_vendor(builder: &Builder<'_>) -> Vec<PathBuf> { + let mut paths = vec![]; + for p in [ + "src/tools/cargo/Cargo.toml", + "src/tools/rust-analyzer/Cargo.toml", + "compiler/rustc_codegen_cranelift/Cargo.toml", + "compiler/rustc_codegen_gcc/Cargo.toml", + "library/Cargo.toml", + "src/bootstrap/Cargo.toml", + "src/tools/rustbook/Cargo.toml", + "src/tools/rustc-perf/Cargo.toml", + "src/tools/opt-dist/Cargo.toml", + ] { + paths.push(builder.src.join(p)); + } + + paths +} + #[derive(Debug, Clone, Hash, PartialEq, Eq)] pub(crate) struct Vendor { sync_args: Vec<PathBuf>, @@ -42,16 +62,8 @@ impl Step for Vendor { } // Sync these paths by default. - for p in [ - "src/tools/cargo/Cargo.toml", - "src/tools/rust-analyzer/Cargo.toml", - "compiler/rustc_codegen_cranelift/Cargo.toml", - "compiler/rustc_codegen_gcc/Cargo.toml", - "library/Cargo.toml", - "src/bootstrap/Cargo.toml", - "src/tools/rustbook/Cargo.toml", - ] { - cmd.arg("--sync").arg(builder.src.join(p)); + for p in default_paths_to_vendor(builder) { + cmd.arg("--sync").arg(p); } // Also sync explicitly requested paths. diff --git a/src/bootstrap/src/core/builder.rs b/src/bootstrap/src/core/builder.rs index 454cc20d155..a848163b272 100644 --- a/src/bootstrap/src/core/builder.rs +++ b/src/bootstrap/src/core/builder.rs @@ -1455,15 +1455,11 @@ impl<'a> Builder<'a> { assert_eq!(target, compiler.host); } - if self.config.rust_optimize.is_release() { - // FIXME: cargo bench/install do not accept `--release` - // and miri doesn't want it - match cmd_kind { - Kind::Bench | Kind::Install | Kind::Miri | Kind::MiriSetup | Kind::MiriTest => {} - _ => { - cargo.arg("--release"); - } - } + if self.config.rust_optimize.is_release() && + // cargo bench/install do not accept `--release` and miri doesn't want it + !matches!(cmd_kind, Kind::Bench | Kind::Install | Kind::Miri | Kind::MiriSetup | Kind::MiriTest) + { + cargo.arg("--release"); } // Remove make-related flags to ensure Cargo can correctly set things up diff --git a/src/bootstrap/src/core/config/tests.rs b/src/bootstrap/src/core/config/tests.rs index 378d069672f..219c5a6ec91 100644 --- a/src/bootstrap/src/core/config/tests.rs +++ b/src/bootstrap/src/core/config/tests.rs @@ -96,8 +96,8 @@ fn detect_src_and_out() { test(parse(""), None); { - let build_dir = if cfg!(windows) { Some("C:\\tmp") } else { Some("/tmp") }; - test(parse("build.build-dir = \"/tmp\""), build_dir); + let build_dir = if cfg!(windows) { "C:\\tmp" } else { "/tmp" }; + test(parse(&format!("build.build-dir = '{build_dir}'")), Some(build_dir)); } } diff --git a/src/bootstrap/src/core/download.rs b/src/bootstrap/src/core/download.rs index ae39afa1fa2..dd0309733ae 100644 --- a/src/bootstrap/src/core/download.rs +++ b/src/bootstrap/src/core/download.rs @@ -620,8 +620,6 @@ impl Config { }; // For the beta compiler, put special effort into ensuring the checksums are valid. - // FIXME: maybe we should do this for download-rustc as well? but it would be a pain to update - // this on each and every nightly ... let checksum = if should_verify { let error = format!( "src/stage0 doesn't contain a checksum for {url}. \ diff --git a/src/ci/docker/README.md b/src/ci/docker/README.md index 985e3b37422..876787c30e5 100644 --- a/src/ci/docker/README.md +++ b/src/ci/docker/README.md @@ -266,9 +266,9 @@ For targets: `loongarch64-unknown-linux-gnu` - Target options > Bitness = 64-bit - Operating System > Target OS = linux - Operating System > Linux kernel version = 5.19.16 -- Binary utilities > Version of binutils = 2.40 +- Binary utilities > Version of binutils = 2.42 - C-library > glibc version = 2.36 -- C compiler > gcc version = 13.2.0 +- C compiler > gcc version = 14.2.0 - C compiler > C++ = ENABLE -- to cross compile LLVM ### `loongarch64-linux-musl.defconfig` @@ -282,9 +282,9 @@ For targets: `loongarch64-unknown-linux-musl` - Target options > Bitness = 64-bit - Operating System > Target OS = linux - Operating System > Linux kernel version = 5.19.16 -- Binary utilities > Version of binutils = 2.41 +- Binary utilities > Version of binutils = 2.42 - C-library > musl version = 1.2.5 -- C compiler > gcc version = 13.2.0 +- C compiler > gcc version = 14.2.0 - C compiler > C++ = ENABLE -- to cross compile LLVM ### `mips-linux-gnu.defconfig` diff --git a/src/ci/docker/host-x86_64/dist-loongarch64-linux/Dockerfile b/src/ci/docker/host-x86_64/dist-loongarch64-linux/Dockerfile index d3956651663..865a9e32fa9 100644 --- a/src/ci/docker/host-x86_64/dist-loongarch64-linux/Dockerfile +++ b/src/ci/docker/host-x86_64/dist-loongarch64-linux/Dockerfile @@ -3,8 +3,8 @@ FROM ubuntu:22.04 COPY scripts/cross-apt-packages.sh /scripts/ RUN sh /scripts/cross-apt-packages.sh -COPY scripts/crosstool-ng.sh /scripts/ -RUN sh /scripts/crosstool-ng.sh +COPY scripts/crosstool-ng-git.sh /scripts/ +RUN sh /scripts/crosstool-ng-git.sh COPY scripts/rustbuild-setup.sh /scripts/ RUN sh /scripts/rustbuild-setup.sh diff --git a/src/ci/docker/host-x86_64/test-various/uefi_qemu_test/Cargo.toml b/src/ci/docker/host-x86_64/test-various/uefi_qemu_test/Cargo.toml index 2d17cf7d47a..976245f5bdd 100644 --- a/src/ci/docker/host-x86_64/test-various/uefi_qemu_test/Cargo.toml +++ b/src/ci/docker/host-x86_64/test-various/uefi_qemu_test/Cargo.toml @@ -4,7 +4,7 @@ version = "0.0.0" edition = "2021" [workspace] -resolver = "1" +resolver = "2" [dependencies] r-efi = "4.1.0" diff --git a/src/ci/docker/scripts/crosstool-ng-git.sh b/src/ci/docker/scripts/crosstool-ng-git.sh index 2a10e262df8..e86810ae613 100644 --- a/src/ci/docker/scripts/crosstool-ng-git.sh +++ b/src/ci/docker/scripts/crosstool-ng-git.sh @@ -2,7 +2,7 @@ set -ex URL=https://github.com/crosstool-ng/crosstool-ng -REV=c64500d94be92ed1bcdfdef911048a14e216a5e1 +REV=ed12fa68402f58e171a6f79500f73f4781fdc9e5 mkdir crosstool-ng cd crosstool-ng diff --git a/src/ci/github-actions/jobs.yml b/src/ci/github-actions/jobs.yml index 638f14ad53f..4de44c6dd39 100644 --- a/src/ci/github-actions/jobs.yml +++ b/src/ci/github-actions/jobs.yml @@ -285,8 +285,10 @@ auto: - image: dist-apple-various env: - SCRIPT: ./x.py dist bootstrap --include-default-paths --host='' --target=aarch64-apple-ios,x86_64-apple-ios,aarch64-apple-ios-sim - RUST_CONFIGURE_ARGS: --enable-sanitizers --enable-profiler --set rust.jemalloc + SCRIPT: ./x.py dist bootstrap --include-default-paths --host='' --target=aarch64-apple-ios,x86_64-apple-ios,aarch64-apple-ios-sim,aarch64-apple-ios-macabi,x86_64-apple-ios-macabi + # Mac Catalyst cannot currently compile the sanitizer: + # https://github.com/rust-lang/rust/issues/129069 + RUST_CONFIGURE_ARGS: --enable-sanitizers --enable-profiler --set rust.jemalloc --set target.aarch64-apple-ios-macabi.sanitizers=false --set target.x86_64-apple-ios-macabi.sanitizers=false RUSTC_RETRY_LINKER_ON_SEGFAULT: 1 MACOSX_DEPLOYMENT_TARGET: 10.12 SELECT_XCODE: /Applications/Xcode_14.3.1.app diff --git a/src/doc/rustc/src/platform-support.md b/src/doc/rustc/src/platform-support.md index c3f73a8367a..667758a1203 100644 --- a/src/doc/rustc/src/platform-support.md +++ b/src/doc/rustc/src/platform-support.md @@ -136,6 +136,7 @@ so Rustup may install the documentation for a similar tier 1 target instead. target | std | notes -------|:---:|------- [`aarch64-apple-ios`](platform-support/apple-ios.md) | ✓ | ARM64 iOS +[`aarch64-apple-ios-macabi`](platform-support/apple-ios-macabi.md) | ✓ | Mac Catalyst on ARM64 [`aarch64-apple-ios-sim`](platform-support/apple-ios.md) | ✓ | Apple iOS Simulator on ARM64 `aarch64-fuchsia` | ✓ | Alias for `aarch64-unknown-fuchsia` [`aarch64-unknown-fuchsia`](platform-support/fuchsia.md) | ✓ | ARM64 Fuchsia @@ -196,6 +197,7 @@ target | std | notes [`wasm32-wasip1`](platform-support/wasm32-wasip1.md) | ✓ | WebAssembly with WASI [`wasm32-wasip1-threads`](platform-support/wasm32-wasip1-threads.md) | ✓ | WebAssembly with WASI Preview 1 and threads [`x86_64-apple-ios`](platform-support/apple-ios.md) | ✓ | 64-bit x86 iOS +[`x86_64-apple-ios-macabi`](platform-support/apple-ios-macabi.md) | ✓ | Mac Catalyst on x86_64 [`x86_64-fortanix-unknown-sgx`](platform-support/x86_64-fortanix-unknown-sgx.md) | ✓ | [Fortanix ABI] for 64-bit Intel SGX `x86_64-fuchsia` | ✓ | Alias for `x86_64-unknown-fuchsia` [`x86_64-unknown-fuchsia`](platform-support/fuchsia.md) | ✓ | 64-bit x86 Fuchsia @@ -245,7 +247,6 @@ target | std | host | notes -------|:---:|:----:|------- [`arm64e-apple-ios`](platform-support/arm64e-apple-ios.md) | ✓ | | ARM64e Apple iOS [`arm64e-apple-darwin`](platform-support/arm64e-apple-darwin.md) | ✓ | ✓ | ARM64e Apple Darwin -[`aarch64-apple-ios-macabi`](platform-support/apple-ios-macabi.md) | ✓ | | Apple Catalyst on ARM64 [`aarch64-apple-tvos`](platform-support/apple-tvos.md) | ✓ | | ARM64 tvOS [`aarch64-apple-tvos-sim`](platform-support/apple-tvos.md) | ✓ | | ARM64 tvOS Simulator [`aarch64-apple-watchos`](platform-support/apple-watchos.md) | ✓ | | ARM64 Apple WatchOS @@ -371,7 +372,6 @@ target | std | host | notes `thumbv7neon-unknown-linux-musleabihf` | ? | | Thumb2-mode Armv7-A Linux with NEON, musl 1.2.3 [`wasm32-wasip2`](platform-support/wasm32-wasip2.md) | ✓ | | WebAssembly [`wasm64-unknown-unknown`](platform-support/wasm64-unknown-unknown.md) | ? | | WebAssembly -[`x86_64-apple-ios-macabi`](platform-support/apple-ios-macabi.md) | ✓ | | Apple Catalyst on x86_64 [`x86_64-apple-tvos`](platform-support/apple-tvos.md) | ✓ | | x86 64-bit tvOS [`x86_64-apple-watchos-sim`](platform-support/apple-watchos.md) | ✓ | | x86 64-bit Apple WatchOS simulator [`x86_64-pc-nto-qnx710`](platform-support/nto-qnx.md) | ✓ | | x86 64-bit QNX Neutrino 7.1 RTOS | diff --git a/src/doc/rustc/src/platform-support/apple-ios-macabi.md b/src/doc/rustc/src/platform-support/apple-ios-macabi.md index 15ba31e0f06..678630873b1 100644 --- a/src/doc/rustc/src/platform-support/apple-ios-macabi.md +++ b/src/doc/rustc/src/platform-support/apple-ios-macabi.md @@ -2,7 +2,7 @@ Apple Mac Catalyst targets. -**Tier: 3** +**Tier: 2 (without Host Tools)** - `aarch64-apple-ios-macabi`: Mac Catalyst on ARM64. - `x86_64-apple-ios-macabi`: Mac Catalyst on 64-bit x86. @@ -32,15 +32,19 @@ case `IPHONEOS_DEPLOYMENT_TARGET`. ## Building the target -The targets can be built by enabling them for a `rustc` build in -`config.toml`, by adding, for example: - -```toml -[build] -target = ["aarch64-apple-ios-macabi", "x86_64-apple-ios-macabi"] +The targets are distributed through `rustup`, and can be installed using one +of: +```console +$ rustup target add aarch64-apple-ios-macabi +$ rustup target add x86_64-apple-ios-macabi ``` -Using the unstable `-Zbuild-std` with a nightly Cargo may also work. +### Sanitizers + +Due to CMake having poor support for Mac Catalyst, sanitizer runtimes are not +currently available, see [#129069]. + +[#129069]: https://github.com/rust-lang/rust/issues/129069 ## Building Rust programs diff --git a/src/etc/completions/x.py.fish b/src/etc/completions/x.py.fish index 297dc11cd61..3a83c89280f 100644 --- a/src/etc/completions/x.py.fish +++ b/src/etc/completions/x.py.fish @@ -1,664 +1,690 @@ -complete -c x.py -n "__fish_use_subcommand" -l config -d 'TOML configuration file for build' -r -F -complete -c x.py -n "__fish_use_subcommand" -l build-dir -d 'Build directory, overrides `build.build-dir` in `config.toml`' -r -f -a "(__fish_complete_directories)" -complete -c x.py -n "__fish_use_subcommand" -l build -d 'build target of the stage0 compiler' -r -f -complete -c x.py -n "__fish_use_subcommand" -l host -d 'host targets to build' -r -f -complete -c x.py -n "__fish_use_subcommand" -l target -d 'target targets to build' -r -f -complete -c x.py -n "__fish_use_subcommand" -l exclude -d 'build paths to exclude' -r -F -complete -c x.py -n "__fish_use_subcommand" -l skip -d 'build paths to skip' -r -F -complete -c x.py -n "__fish_use_subcommand" -l rustc-error-format -r -f -complete -c x.py -n "__fish_use_subcommand" -l on-fail -d 'command to run on failure' -r -f -a "(__fish_complete_command)" -complete -c x.py -n "__fish_use_subcommand" -l stage -d 'stage to build (indicates compiler to use/test, e.g., stage 0 uses the bootstrap compiler, stage 1 the stage 0 rustc artifacts, etc.)' -r -f -complete -c x.py -n "__fish_use_subcommand" -l keep-stage -d 'stage(s) to keep without recompiling (pass multiple times to keep e.g., both stages 0 and 1)' -r -f -complete -c x.py -n "__fish_use_subcommand" -l keep-stage-std -d 'stage(s) of the standard library to keep without recompiling (pass multiple times to keep e.g., both stages 0 and 1)' -r -f -complete -c x.py -n "__fish_use_subcommand" -l src -d 'path to the root of the rust checkout' -r -f -a "(__fish_complete_directories)" -complete -c x.py -n "__fish_use_subcommand" -s j -l jobs -d 'number of jobs to run in parallel' -r -f -complete -c x.py -n "__fish_use_subcommand" -l warnings -d 'if value is deny, will deny warnings if value is warn, will emit warnings otherwise, use the default configured behaviour' -r -f -a "{deny '',warn '',default ''}" -complete -c x.py -n "__fish_use_subcommand" -l error-format -d 'rustc error format' -r -f -complete -c x.py -n "__fish_use_subcommand" -l color -d 'whether to use color in cargo and rustc output' -r -f -a "{always '',never '',auto ''}" -complete -c x.py -n "__fish_use_subcommand" -l llvm-skip-rebuild -d 'whether rebuilding llvm should be skipped, overriding `skip-rebuld` in config.toml' -r -f -a "{true '',false ''}" -complete -c x.py -n "__fish_use_subcommand" -l rust-profile-generate -d 'generate PGO profile with rustc build' -r -F -complete -c x.py -n "__fish_use_subcommand" -l rust-profile-use -d 'use PGO profile for rustc build' -r -F -complete -c x.py -n "__fish_use_subcommand" -l llvm-profile-use -d 'use PGO profile for LLVM build' -r -F -complete -c x.py -n "__fish_use_subcommand" -l reproducible-artifact -d 'Additional reproducible artifacts that should be added to the reproducible artifacts archive' -r -complete -c x.py -n "__fish_use_subcommand" -l set -d 'override options in config.toml' -r -f -complete -c x.py -n "__fish_use_subcommand" -s v -l verbose -d 'use verbose output (-vv for very verbose)' -complete -c x.py -n "__fish_use_subcommand" -s i -l incremental -d 'use incremental compilation' -complete -c x.py -n "__fish_use_subcommand" -l include-default-paths -d 'include default paths in addition to the provided ones' -complete -c x.py -n "__fish_use_subcommand" -l dry-run -d 'dry run; don\'t build anything' -complete -c x.py -n "__fish_use_subcommand" -l dump-bootstrap-shims -d 'Indicates whether to dump the work done from bootstrap shims' -complete -c x.py -n "__fish_use_subcommand" -l json-output -d 'use message-format=json' -complete -c x.py -n "__fish_use_subcommand" -l bypass-bootstrap-lock -d 'Bootstrap uses this value to decide whether it should bypass locking the build process. This is rarely needed (e.g., compiling the std library for different targets in parallel)' -complete -c x.py -n "__fish_use_subcommand" -l llvm-profile-generate -d 'generate PGO profile with llvm built for rustc' -complete -c x.py -n "__fish_use_subcommand" -l enable-bolt-settings -d 'Enable BOLT link flags' -complete -c x.py -n "__fish_use_subcommand" -l skip-stage0-validation -d 'Skip stage0 compiler validation' -complete -c x.py -n "__fish_use_subcommand" -s h -l help -d 'Print help (see more with \'--help\')' -complete -c x.py -n "__fish_use_subcommand" -f -a "build" -d 'Compile either the compiler or libraries' -complete -c x.py -n "__fish_use_subcommand" -f -a "check" -d 'Compile either the compiler or libraries, using cargo check' -complete -c x.py -n "__fish_use_subcommand" -f -a "clippy" -d 'Run Clippy (uses rustup/cargo-installed clippy binary)' -complete -c x.py -n "__fish_use_subcommand" -f -a "fix" -d 'Run cargo fix' -complete -c x.py -n "__fish_use_subcommand" -f -a "fmt" -d 'Run rustfmt' -complete -c x.py -n "__fish_use_subcommand" -f -a "doc" -d 'Build documentation' -complete -c x.py -n "__fish_use_subcommand" -f -a "test" -d 'Build and run some test suites' -complete -c x.py -n "__fish_use_subcommand" -f -a "miri" -d 'Build and run some test suites *in Miri*' -complete -c x.py -n "__fish_use_subcommand" -f -a "bench" -d 'Build and run some benchmarks' -complete -c x.py -n "__fish_use_subcommand" -f -a "clean" -d 'Clean out build directories' -complete -c x.py -n "__fish_use_subcommand" -f -a "dist" -d 'Build distribution artifacts' -complete -c x.py -n "__fish_use_subcommand" -f -a "install" -d 'Install distribution artifacts' -complete -c x.py -n "__fish_use_subcommand" -f -a "run" -d 'Run tools contained in this repository' -complete -c x.py -n "__fish_use_subcommand" -f -a "setup" -d 'Set up the environment for development' -complete -c x.py -n "__fish_use_subcommand" -f -a "suggest" -d 'Suggest a subset of tests to run, based on modified files' -complete -c x.py -n "__fish_use_subcommand" -f -a "vendor" -d 'Vendor dependencies' -complete -c x.py -n "__fish_use_subcommand" -f -a "perf" -d 'Perform profiling and benchmarking of the compiler using the `rustc-perf-wrapper` tool' -complete -c x.py -n "__fish_seen_subcommand_from build" -l config -d 'TOML configuration file for build' -r -F -complete -c x.py -n "__fish_seen_subcommand_from build" -l build-dir -d 'Build directory, overrides `build.build-dir` in `config.toml`' -r -f -a "(__fish_complete_directories)" -complete -c x.py -n "__fish_seen_subcommand_from build" -l build -d 'build target of the stage0 compiler' -r -f -complete -c x.py -n "__fish_seen_subcommand_from build" -l host -d 'host targets to build' -r -f -complete -c x.py -n "__fish_seen_subcommand_from build" -l target -d 'target targets to build' -r -f -complete -c x.py -n "__fish_seen_subcommand_from build" -l exclude -d 'build paths to exclude' -r -F -complete -c x.py -n "__fish_seen_subcommand_from build" -l skip -d 'build paths to skip' -r -F -complete -c x.py -n "__fish_seen_subcommand_from build" -l rustc-error-format -r -f -complete -c x.py -n "__fish_seen_subcommand_from build" -l on-fail -d 'command to run on failure' -r -f -a "(__fish_complete_command)" -complete -c x.py -n "__fish_seen_subcommand_from build" -l stage -d 'stage to build (indicates compiler to use/test, e.g., stage 0 uses the bootstrap compiler, stage 1 the stage 0 rustc artifacts, etc.)' -r -f -complete -c x.py -n "__fish_seen_subcommand_from build" -l keep-stage -d 'stage(s) to keep without recompiling (pass multiple times to keep e.g., both stages 0 and 1)' -r -f -complete -c x.py -n "__fish_seen_subcommand_from build" -l keep-stage-std -d 'stage(s) of the standard library to keep without recompiling (pass multiple times to keep e.g., both stages 0 and 1)' -r -f -complete -c x.py -n "__fish_seen_subcommand_from build" -l src -d 'path to the root of the rust checkout' -r -f -a "(__fish_complete_directories)" -complete -c x.py -n "__fish_seen_subcommand_from build" -s j -l jobs -d 'number of jobs to run in parallel' -r -f -complete -c x.py -n "__fish_seen_subcommand_from build" -l warnings -d 'if value is deny, will deny warnings if value is warn, will emit warnings otherwise, use the default configured behaviour' -r -f -a "{deny '',warn '',default ''}" -complete -c x.py -n "__fish_seen_subcommand_from build" -l error-format -d 'rustc error format' -r -f -complete -c x.py -n "__fish_seen_subcommand_from build" -l color -d 'whether to use color in cargo and rustc output' -r -f -a "{always '',never '',auto ''}" -complete -c x.py -n "__fish_seen_subcommand_from build" -l llvm-skip-rebuild -d 'whether rebuilding llvm should be skipped, overriding `skip-rebuld` in config.toml' -r -f -a "{true '',false ''}" -complete -c x.py -n "__fish_seen_subcommand_from build" -l rust-profile-generate -d 'generate PGO profile with rustc build' -r -F -complete -c x.py -n "__fish_seen_subcommand_from build" -l rust-profile-use -d 'use PGO profile for rustc build' -r -F -complete -c x.py -n "__fish_seen_subcommand_from build" -l llvm-profile-use -d 'use PGO profile for LLVM build' -r -F -complete -c x.py -n "__fish_seen_subcommand_from build" -l reproducible-artifact -d 'Additional reproducible artifacts that should be added to the reproducible artifacts archive' -r -complete -c x.py -n "__fish_seen_subcommand_from build" -l set -d 'override options in config.toml' -r -f -complete -c x.py -n "__fish_seen_subcommand_from build" -s v -l verbose -d 'use verbose output (-vv for very verbose)' -complete -c x.py -n "__fish_seen_subcommand_from build" -s i -l incremental -d 'use incremental compilation' -complete -c x.py -n "__fish_seen_subcommand_from build" -l include-default-paths -d 'include default paths in addition to the provided ones' -complete -c x.py -n "__fish_seen_subcommand_from build" -l dry-run -d 'dry run; don\'t build anything' -complete -c x.py -n "__fish_seen_subcommand_from build" -l dump-bootstrap-shims -d 'Indicates whether to dump the work done from bootstrap shims' -complete -c x.py -n "__fish_seen_subcommand_from build" -l json-output -d 'use message-format=json' -complete -c x.py -n "__fish_seen_subcommand_from build" -l bypass-bootstrap-lock -d 'Bootstrap uses this value to decide whether it should bypass locking the build process. This is rarely needed (e.g., compiling the std library for different targets in parallel)' -complete -c x.py -n "__fish_seen_subcommand_from build" -l llvm-profile-generate -d 'generate PGO profile with llvm built for rustc' -complete -c x.py -n "__fish_seen_subcommand_from build" -l enable-bolt-settings -d 'Enable BOLT link flags' -complete -c x.py -n "__fish_seen_subcommand_from build" -l skip-stage0-validation -d 'Skip stage0 compiler validation' -complete -c x.py -n "__fish_seen_subcommand_from build" -s h -l help -d 'Print help (see more with \'--help\')' -complete -c x.py -n "__fish_seen_subcommand_from check" -l config -d 'TOML configuration file for build' -r -F -complete -c x.py -n "__fish_seen_subcommand_from check" -l build-dir -d 'Build directory, overrides `build.build-dir` in `config.toml`' -r -f -a "(__fish_complete_directories)" -complete -c x.py -n "__fish_seen_subcommand_from check" -l build -d 'build target of the stage0 compiler' -r -f -complete -c x.py -n "__fish_seen_subcommand_from check" -l host -d 'host targets to build' -r -f -complete -c x.py -n "__fish_seen_subcommand_from check" -l target -d 'target targets to build' -r -f -complete -c x.py -n "__fish_seen_subcommand_from check" -l exclude -d 'build paths to exclude' -r -F -complete -c x.py -n "__fish_seen_subcommand_from check" -l skip -d 'build paths to skip' -r -F -complete -c x.py -n "__fish_seen_subcommand_from check" -l rustc-error-format -r -f -complete -c x.py -n "__fish_seen_subcommand_from check" -l on-fail -d 'command to run on failure' -r -f -a "(__fish_complete_command)" -complete -c x.py -n "__fish_seen_subcommand_from check" -l stage -d 'stage to build (indicates compiler to use/test, e.g., stage 0 uses the bootstrap compiler, stage 1 the stage 0 rustc artifacts, etc.)' -r -f -complete -c x.py -n "__fish_seen_subcommand_from check" -l keep-stage -d 'stage(s) to keep without recompiling (pass multiple times to keep e.g., both stages 0 and 1)' -r -f -complete -c x.py -n "__fish_seen_subcommand_from check" -l keep-stage-std -d 'stage(s) of the standard library to keep without recompiling (pass multiple times to keep e.g., both stages 0 and 1)' -r -f -complete -c x.py -n "__fish_seen_subcommand_from check" -l src -d 'path to the root of the rust checkout' -r -f -a "(__fish_complete_directories)" -complete -c x.py -n "__fish_seen_subcommand_from check" -s j -l jobs -d 'number of jobs to run in parallel' -r -f -complete -c x.py -n "__fish_seen_subcommand_from check" -l warnings -d 'if value is deny, will deny warnings if value is warn, will emit warnings otherwise, use the default configured behaviour' -r -f -a "{deny '',warn '',default ''}" -complete -c x.py -n "__fish_seen_subcommand_from check" -l error-format -d 'rustc error format' -r -f -complete -c x.py -n "__fish_seen_subcommand_from check" -l color -d 'whether to use color in cargo and rustc output' -r -f -a "{always '',never '',auto ''}" -complete -c x.py -n "__fish_seen_subcommand_from check" -l llvm-skip-rebuild -d 'whether rebuilding llvm should be skipped, overriding `skip-rebuld` in config.toml' -r -f -a "{true '',false ''}" -complete -c x.py -n "__fish_seen_subcommand_from check" -l rust-profile-generate -d 'generate PGO profile with rustc build' -r -F -complete -c x.py -n "__fish_seen_subcommand_from check" -l rust-profile-use -d 'use PGO profile for rustc build' -r -F -complete -c x.py -n "__fish_seen_subcommand_from check" -l llvm-profile-use -d 'use PGO profile for LLVM build' -r -F -complete -c x.py -n "__fish_seen_subcommand_from check" -l reproducible-artifact -d 'Additional reproducible artifacts that should be added to the reproducible artifacts archive' -r -complete -c x.py -n "__fish_seen_subcommand_from check" -l set -d 'override options in config.toml' -r -f -complete -c x.py -n "__fish_seen_subcommand_from check" -l all-targets -d 'Check all targets' -complete -c x.py -n "__fish_seen_subcommand_from check" -s v -l verbose -d 'use verbose output (-vv for very verbose)' -complete -c x.py -n "__fish_seen_subcommand_from check" -s i -l incremental -d 'use incremental compilation' -complete -c x.py -n "__fish_seen_subcommand_from check" -l include-default-paths -d 'include default paths in addition to the provided ones' -complete -c x.py -n "__fish_seen_subcommand_from check" -l dry-run -d 'dry run; don\'t build anything' -complete -c x.py -n "__fish_seen_subcommand_from check" -l dump-bootstrap-shims -d 'Indicates whether to dump the work done from bootstrap shims' -complete -c x.py -n "__fish_seen_subcommand_from check" -l json-output -d 'use message-format=json' -complete -c x.py -n "__fish_seen_subcommand_from check" -l bypass-bootstrap-lock -d 'Bootstrap uses this value to decide whether it should bypass locking the build process. This is rarely needed (e.g., compiling the std library for different targets in parallel)' -complete -c x.py -n "__fish_seen_subcommand_from check" -l llvm-profile-generate -d 'generate PGO profile with llvm built for rustc' -complete -c x.py -n "__fish_seen_subcommand_from check" -l enable-bolt-settings -d 'Enable BOLT link flags' -complete -c x.py -n "__fish_seen_subcommand_from check" -l skip-stage0-validation -d 'Skip stage0 compiler validation' -complete -c x.py -n "__fish_seen_subcommand_from check" -s h -l help -d 'Print help (see more with \'--help\')' -complete -c x.py -n "__fish_seen_subcommand_from clippy" -s A -d 'clippy lints to allow' -r -complete -c x.py -n "__fish_seen_subcommand_from clippy" -s D -d 'clippy lints to deny' -r -complete -c x.py -n "__fish_seen_subcommand_from clippy" -s W -d 'clippy lints to warn on' -r -complete -c x.py -n "__fish_seen_subcommand_from clippy" -s F -d 'clippy lints to forbid' -r -complete -c x.py -n "__fish_seen_subcommand_from clippy" -l config -d 'TOML configuration file for build' -r -F -complete -c x.py -n "__fish_seen_subcommand_from clippy" -l build-dir -d 'Build directory, overrides `build.build-dir` in `config.toml`' -r -f -a "(__fish_complete_directories)" -complete -c x.py -n "__fish_seen_subcommand_from clippy" -l build -d 'build target of the stage0 compiler' -r -f -complete -c x.py -n "__fish_seen_subcommand_from clippy" -l host -d 'host targets to build' -r -f -complete -c x.py -n "__fish_seen_subcommand_from clippy" -l target -d 'target targets to build' -r -f -complete -c x.py -n "__fish_seen_subcommand_from clippy" -l exclude -d 'build paths to exclude' -r -F -complete -c x.py -n "__fish_seen_subcommand_from clippy" -l skip -d 'build paths to skip' -r -F -complete -c x.py -n "__fish_seen_subcommand_from clippy" -l rustc-error-format -r -f -complete -c x.py -n "__fish_seen_subcommand_from clippy" -l on-fail -d 'command to run on failure' -r -f -a "(__fish_complete_command)" -complete -c x.py -n "__fish_seen_subcommand_from clippy" -l stage -d 'stage to build (indicates compiler to use/test, e.g., stage 0 uses the bootstrap compiler, stage 1 the stage 0 rustc artifacts, etc.)' -r -f -complete -c x.py -n "__fish_seen_subcommand_from clippy" -l keep-stage -d 'stage(s) to keep without recompiling (pass multiple times to keep e.g., both stages 0 and 1)' -r -f -complete -c x.py -n "__fish_seen_subcommand_from clippy" -l keep-stage-std -d 'stage(s) of the standard library to keep without recompiling (pass multiple times to keep e.g., both stages 0 and 1)' -r -f -complete -c x.py -n "__fish_seen_subcommand_from clippy" -l src -d 'path to the root of the rust checkout' -r -f -a "(__fish_complete_directories)" -complete -c x.py -n "__fish_seen_subcommand_from clippy" -s j -l jobs -d 'number of jobs to run in parallel' -r -f -complete -c x.py -n "__fish_seen_subcommand_from clippy" -l warnings -d 'if value is deny, will deny warnings if value is warn, will emit warnings otherwise, use the default configured behaviour' -r -f -a "{deny '',warn '',default ''}" -complete -c x.py -n "__fish_seen_subcommand_from clippy" -l error-format -d 'rustc error format' -r -f -complete -c x.py -n "__fish_seen_subcommand_from clippy" -l color -d 'whether to use color in cargo and rustc output' -r -f -a "{always '',never '',auto ''}" -complete -c x.py -n "__fish_seen_subcommand_from clippy" -l llvm-skip-rebuild -d 'whether rebuilding llvm should be skipped, overriding `skip-rebuld` in config.toml' -r -f -a "{true '',false ''}" -complete -c x.py -n "__fish_seen_subcommand_from clippy" -l rust-profile-generate -d 'generate PGO profile with rustc build' -r -F -complete -c x.py -n "__fish_seen_subcommand_from clippy" -l rust-profile-use -d 'use PGO profile for rustc build' -r -F -complete -c x.py -n "__fish_seen_subcommand_from clippy" -l llvm-profile-use -d 'use PGO profile for LLVM build' -r -F -complete -c x.py -n "__fish_seen_subcommand_from clippy" -l reproducible-artifact -d 'Additional reproducible artifacts that should be added to the reproducible artifacts archive' -r -complete -c x.py -n "__fish_seen_subcommand_from clippy" -l set -d 'override options in config.toml' -r -f -complete -c x.py -n "__fish_seen_subcommand_from clippy" -l fix -complete -c x.py -n "__fish_seen_subcommand_from clippy" -l allow-dirty -complete -c x.py -n "__fish_seen_subcommand_from clippy" -l allow-staged -complete -c x.py -n "__fish_seen_subcommand_from clippy" -s v -l verbose -d 'use verbose output (-vv for very verbose)' -complete -c x.py -n "__fish_seen_subcommand_from clippy" -s i -l incremental -d 'use incremental compilation' -complete -c x.py -n "__fish_seen_subcommand_from clippy" -l include-default-paths -d 'include default paths in addition to the provided ones' -complete -c x.py -n "__fish_seen_subcommand_from clippy" -l dry-run -d 'dry run; don\'t build anything' -complete -c x.py -n "__fish_seen_subcommand_from clippy" -l dump-bootstrap-shims -d 'Indicates whether to dump the work done from bootstrap shims' -complete -c x.py -n "__fish_seen_subcommand_from clippy" -l json-output -d 'use message-format=json' -complete -c x.py -n "__fish_seen_subcommand_from clippy" -l bypass-bootstrap-lock -d 'Bootstrap uses this value to decide whether it should bypass locking the build process. This is rarely needed (e.g., compiling the std library for different targets in parallel)' -complete -c x.py -n "__fish_seen_subcommand_from clippy" -l llvm-profile-generate -d 'generate PGO profile with llvm built for rustc' -complete -c x.py -n "__fish_seen_subcommand_from clippy" -l enable-bolt-settings -d 'Enable BOLT link flags' -complete -c x.py -n "__fish_seen_subcommand_from clippy" -l skip-stage0-validation -d 'Skip stage0 compiler validation' -complete -c x.py -n "__fish_seen_subcommand_from clippy" -s h -l help -d 'Print help (see more with \'--help\')' -complete -c x.py -n "__fish_seen_subcommand_from fix" -l config -d 'TOML configuration file for build' -r -F -complete -c x.py -n "__fish_seen_subcommand_from fix" -l build-dir -d 'Build directory, overrides `build.build-dir` in `config.toml`' -r -f -a "(__fish_complete_directories)" -complete -c x.py -n "__fish_seen_subcommand_from fix" -l build -d 'build target of the stage0 compiler' -r -f -complete -c x.py -n "__fish_seen_subcommand_from fix" -l host -d 'host targets to build' -r -f -complete -c x.py -n "__fish_seen_subcommand_from fix" -l target -d 'target targets to build' -r -f -complete -c x.py -n "__fish_seen_subcommand_from fix" -l exclude -d 'build paths to exclude' -r -F -complete -c x.py -n "__fish_seen_subcommand_from fix" -l skip -d 'build paths to skip' -r -F -complete -c x.py -n "__fish_seen_subcommand_from fix" -l rustc-error-format -r -f -complete -c x.py -n "__fish_seen_subcommand_from fix" -l on-fail -d 'command to run on failure' -r -f -a "(__fish_complete_command)" -complete -c x.py -n "__fish_seen_subcommand_from fix" -l stage -d 'stage to build (indicates compiler to use/test, e.g., stage 0 uses the bootstrap compiler, stage 1 the stage 0 rustc artifacts, etc.)' -r -f -complete -c x.py -n "__fish_seen_subcommand_from fix" -l keep-stage -d 'stage(s) to keep without recompiling (pass multiple times to keep e.g., both stages 0 and 1)' -r -f -complete -c x.py -n "__fish_seen_subcommand_from fix" -l keep-stage-std -d 'stage(s) of the standard library to keep without recompiling (pass multiple times to keep e.g., both stages 0 and 1)' -r -f -complete -c x.py -n "__fish_seen_subcommand_from fix" -l src -d 'path to the root of the rust checkout' -r -f -a "(__fish_complete_directories)" -complete -c x.py -n "__fish_seen_subcommand_from fix" -s j -l jobs -d 'number of jobs to run in parallel' -r -f -complete -c x.py -n "__fish_seen_subcommand_from fix" -l warnings -d 'if value is deny, will deny warnings if value is warn, will emit warnings otherwise, use the default configured behaviour' -r -f -a "{deny '',warn '',default ''}" -complete -c x.py -n "__fish_seen_subcommand_from fix" -l error-format -d 'rustc error format' -r -f -complete -c x.py -n "__fish_seen_subcommand_from fix" -l color -d 'whether to use color in cargo and rustc output' -r -f -a "{always '',never '',auto ''}" -complete -c x.py -n "__fish_seen_subcommand_from fix" -l llvm-skip-rebuild -d 'whether rebuilding llvm should be skipped, overriding `skip-rebuld` in config.toml' -r -f -a "{true '',false ''}" -complete -c x.py -n "__fish_seen_subcommand_from fix" -l rust-profile-generate -d 'generate PGO profile with rustc build' -r -F -complete -c x.py -n "__fish_seen_subcommand_from fix" -l rust-profile-use -d 'use PGO profile for rustc build' -r -F -complete -c x.py -n "__fish_seen_subcommand_from fix" -l llvm-profile-use -d 'use PGO profile for LLVM build' -r -F -complete -c x.py -n "__fish_seen_subcommand_from fix" -l reproducible-artifact -d 'Additional reproducible artifacts that should be added to the reproducible artifacts archive' -r -complete -c x.py -n "__fish_seen_subcommand_from fix" -l set -d 'override options in config.toml' -r -f -complete -c x.py -n "__fish_seen_subcommand_from fix" -s v -l verbose -d 'use verbose output (-vv for very verbose)' -complete -c x.py -n "__fish_seen_subcommand_from fix" -s i -l incremental -d 'use incremental compilation' -complete -c x.py -n "__fish_seen_subcommand_from fix" -l include-default-paths -d 'include default paths in addition to the provided ones' -complete -c x.py -n "__fish_seen_subcommand_from fix" -l dry-run -d 'dry run; don\'t build anything' -complete -c x.py -n "__fish_seen_subcommand_from fix" -l dump-bootstrap-shims -d 'Indicates whether to dump the work done from bootstrap shims' -complete -c x.py -n "__fish_seen_subcommand_from fix" -l json-output -d 'use message-format=json' -complete -c x.py -n "__fish_seen_subcommand_from fix" -l bypass-bootstrap-lock -d 'Bootstrap uses this value to decide whether it should bypass locking the build process. This is rarely needed (e.g., compiling the std library for different targets in parallel)' -complete -c x.py -n "__fish_seen_subcommand_from fix" -l llvm-profile-generate -d 'generate PGO profile with llvm built for rustc' -complete -c x.py -n "__fish_seen_subcommand_from fix" -l enable-bolt-settings -d 'Enable BOLT link flags' -complete -c x.py -n "__fish_seen_subcommand_from fix" -l skip-stage0-validation -d 'Skip stage0 compiler validation' -complete -c x.py -n "__fish_seen_subcommand_from fix" -s h -l help -d 'Print help (see more with \'--help\')' -complete -c x.py -n "__fish_seen_subcommand_from fmt" -l config -d 'TOML configuration file for build' -r -F -complete -c x.py -n "__fish_seen_subcommand_from fmt" -l build-dir -d 'Build directory, overrides `build.build-dir` in `config.toml`' -r -f -a "(__fish_complete_directories)" -complete -c x.py -n "__fish_seen_subcommand_from fmt" -l build -d 'build target of the stage0 compiler' -r -f -complete -c x.py -n "__fish_seen_subcommand_from fmt" -l host -d 'host targets to build' -r -f -complete -c x.py -n "__fish_seen_subcommand_from fmt" -l target -d 'target targets to build' -r -f -complete -c x.py -n "__fish_seen_subcommand_from fmt" -l exclude -d 'build paths to exclude' -r -F -complete -c x.py -n "__fish_seen_subcommand_from fmt" -l skip -d 'build paths to skip' -r -F -complete -c x.py -n "__fish_seen_subcommand_from fmt" -l rustc-error-format -r -f -complete -c x.py -n "__fish_seen_subcommand_from fmt" -l on-fail -d 'command to run on failure' -r -f -a "(__fish_complete_command)" -complete -c x.py -n "__fish_seen_subcommand_from fmt" -l stage -d 'stage to build (indicates compiler to use/test, e.g., stage 0 uses the bootstrap compiler, stage 1 the stage 0 rustc artifacts, etc.)' -r -f -complete -c x.py -n "__fish_seen_subcommand_from fmt" -l keep-stage -d 'stage(s) to keep without recompiling (pass multiple times to keep e.g., both stages 0 and 1)' -r -f -complete -c x.py -n "__fish_seen_subcommand_from fmt" -l keep-stage-std -d 'stage(s) of the standard library to keep without recompiling (pass multiple times to keep e.g., both stages 0 and 1)' -r -f -complete -c x.py -n "__fish_seen_subcommand_from fmt" -l src -d 'path to the root of the rust checkout' -r -f -a "(__fish_complete_directories)" -complete -c x.py -n "__fish_seen_subcommand_from fmt" -s j -l jobs -d 'number of jobs to run in parallel' -r -f -complete -c x.py -n "__fish_seen_subcommand_from fmt" -l warnings -d 'if value is deny, will deny warnings if value is warn, will emit warnings otherwise, use the default configured behaviour' -r -f -a "{deny '',warn '',default ''}" -complete -c x.py -n "__fish_seen_subcommand_from fmt" -l error-format -d 'rustc error format' -r -f -complete -c x.py -n "__fish_seen_subcommand_from fmt" -l color -d 'whether to use color in cargo and rustc output' -r -f -a "{always '',never '',auto ''}" -complete -c x.py -n "__fish_seen_subcommand_from fmt" -l llvm-skip-rebuild -d 'whether rebuilding llvm should be skipped, overriding `skip-rebuld` in config.toml' -r -f -a "{true '',false ''}" -complete -c x.py -n "__fish_seen_subcommand_from fmt" -l rust-profile-generate -d 'generate PGO profile with rustc build' -r -F -complete -c x.py -n "__fish_seen_subcommand_from fmt" -l rust-profile-use -d 'use PGO profile for rustc build' -r -F -complete -c x.py -n "__fish_seen_subcommand_from fmt" -l llvm-profile-use -d 'use PGO profile for LLVM build' -r -F -complete -c x.py -n "__fish_seen_subcommand_from fmt" -l reproducible-artifact -d 'Additional reproducible artifacts that should be added to the reproducible artifacts archive' -r -complete -c x.py -n "__fish_seen_subcommand_from fmt" -l set -d 'override options in config.toml' -r -f -complete -c x.py -n "__fish_seen_subcommand_from fmt" -l check -d 'check formatting instead of applying' -complete -c x.py -n "__fish_seen_subcommand_from fmt" -l all -d 'apply to all appropriate files, not just those that have been modified' -complete -c x.py -n "__fish_seen_subcommand_from fmt" -s v -l verbose -d 'use verbose output (-vv for very verbose)' -complete -c x.py -n "__fish_seen_subcommand_from fmt" -s i -l incremental -d 'use incremental compilation' -complete -c x.py -n "__fish_seen_subcommand_from fmt" -l include-default-paths -d 'include default paths in addition to the provided ones' -complete -c x.py -n "__fish_seen_subcommand_from fmt" -l dry-run -d 'dry run; don\'t build anything' -complete -c x.py -n "__fish_seen_subcommand_from fmt" -l dump-bootstrap-shims -d 'Indicates whether to dump the work done from bootstrap shims' -complete -c x.py -n "__fish_seen_subcommand_from fmt" -l json-output -d 'use message-format=json' -complete -c x.py -n "__fish_seen_subcommand_from fmt" -l bypass-bootstrap-lock -d 'Bootstrap uses this value to decide whether it should bypass locking the build process. This is rarely needed (e.g., compiling the std library for different targets in parallel)' -complete -c x.py -n "__fish_seen_subcommand_from fmt" -l llvm-profile-generate -d 'generate PGO profile with llvm built for rustc' -complete -c x.py -n "__fish_seen_subcommand_from fmt" -l enable-bolt-settings -d 'Enable BOLT link flags' -complete -c x.py -n "__fish_seen_subcommand_from fmt" -l skip-stage0-validation -d 'Skip stage0 compiler validation' -complete -c x.py -n "__fish_seen_subcommand_from fmt" -s h -l help -d 'Print help (see more with \'--help\')' -complete -c x.py -n "__fish_seen_subcommand_from doc" -l config -d 'TOML configuration file for build' -r -F -complete -c x.py -n "__fish_seen_subcommand_from doc" -l build-dir -d 'Build directory, overrides `build.build-dir` in `config.toml`' -r -f -a "(__fish_complete_directories)" -complete -c x.py -n "__fish_seen_subcommand_from doc" -l build -d 'build target of the stage0 compiler' -r -f -complete -c x.py -n "__fish_seen_subcommand_from doc" -l host -d 'host targets to build' -r -f -complete -c x.py -n "__fish_seen_subcommand_from doc" -l target -d 'target targets to build' -r -f -complete -c x.py -n "__fish_seen_subcommand_from doc" -l exclude -d 'build paths to exclude' -r -F -complete -c x.py -n "__fish_seen_subcommand_from doc" -l skip -d 'build paths to skip' -r -F -complete -c x.py -n "__fish_seen_subcommand_from doc" -l rustc-error-format -r -f -complete -c x.py -n "__fish_seen_subcommand_from doc" -l on-fail -d 'command to run on failure' -r -f -a "(__fish_complete_command)" -complete -c x.py -n "__fish_seen_subcommand_from doc" -l stage -d 'stage to build (indicates compiler to use/test, e.g., stage 0 uses the bootstrap compiler, stage 1 the stage 0 rustc artifacts, etc.)' -r -f -complete -c x.py -n "__fish_seen_subcommand_from doc" -l keep-stage -d 'stage(s) to keep without recompiling (pass multiple times to keep e.g., both stages 0 and 1)' -r -f -complete -c x.py -n "__fish_seen_subcommand_from doc" -l keep-stage-std -d 'stage(s) of the standard library to keep without recompiling (pass multiple times to keep e.g., both stages 0 and 1)' -r -f -complete -c x.py -n "__fish_seen_subcommand_from doc" -l src -d 'path to the root of the rust checkout' -r -f -a "(__fish_complete_directories)" -complete -c x.py -n "__fish_seen_subcommand_from doc" -s j -l jobs -d 'number of jobs to run in parallel' -r -f -complete -c x.py -n "__fish_seen_subcommand_from doc" -l warnings -d 'if value is deny, will deny warnings if value is warn, will emit warnings otherwise, use the default configured behaviour' -r -f -a "{deny '',warn '',default ''}" -complete -c x.py -n "__fish_seen_subcommand_from doc" -l error-format -d 'rustc error format' -r -f -complete -c x.py -n "__fish_seen_subcommand_from doc" -l color -d 'whether to use color in cargo and rustc output' -r -f -a "{always '',never '',auto ''}" -complete -c x.py -n "__fish_seen_subcommand_from doc" -l llvm-skip-rebuild -d 'whether rebuilding llvm should be skipped, overriding `skip-rebuld` in config.toml' -r -f -a "{true '',false ''}" -complete -c x.py -n "__fish_seen_subcommand_from doc" -l rust-profile-generate -d 'generate PGO profile with rustc build' -r -F -complete -c x.py -n "__fish_seen_subcommand_from doc" -l rust-profile-use -d 'use PGO profile for rustc build' -r -F -complete -c x.py -n "__fish_seen_subcommand_from doc" -l llvm-profile-use -d 'use PGO profile for LLVM build' -r -F -complete -c x.py -n "__fish_seen_subcommand_from doc" -l reproducible-artifact -d 'Additional reproducible artifacts that should be added to the reproducible artifacts archive' -r -complete -c x.py -n "__fish_seen_subcommand_from doc" -l set -d 'override options in config.toml' -r -f -complete -c x.py -n "__fish_seen_subcommand_from doc" -l open -d 'open the docs in a browser' -complete -c x.py -n "__fish_seen_subcommand_from doc" -l json -d 'render the documentation in JSON format in addition to the usual HTML format' -complete -c x.py -n "__fish_seen_subcommand_from doc" -s v -l verbose -d 'use verbose output (-vv for very verbose)' -complete -c x.py -n "__fish_seen_subcommand_from doc" -s i -l incremental -d 'use incremental compilation' -complete -c x.py -n "__fish_seen_subcommand_from doc" -l include-default-paths -d 'include default paths in addition to the provided ones' -complete -c x.py -n "__fish_seen_subcommand_from doc" -l dry-run -d 'dry run; don\'t build anything' -complete -c x.py -n "__fish_seen_subcommand_from doc" -l dump-bootstrap-shims -d 'Indicates whether to dump the work done from bootstrap shims' -complete -c x.py -n "__fish_seen_subcommand_from doc" -l json-output -d 'use message-format=json' -complete -c x.py -n "__fish_seen_subcommand_from doc" -l bypass-bootstrap-lock -d 'Bootstrap uses this value to decide whether it should bypass locking the build process. This is rarely needed (e.g., compiling the std library for different targets in parallel)' -complete -c x.py -n "__fish_seen_subcommand_from doc" -l llvm-profile-generate -d 'generate PGO profile with llvm built for rustc' -complete -c x.py -n "__fish_seen_subcommand_from doc" -l enable-bolt-settings -d 'Enable BOLT link flags' -complete -c x.py -n "__fish_seen_subcommand_from doc" -l skip-stage0-validation -d 'Skip stage0 compiler validation' -complete -c x.py -n "__fish_seen_subcommand_from doc" -s h -l help -d 'Print help (see more with \'--help\')' -complete -c x.py -n "__fish_seen_subcommand_from test" -l test-args -d 'extra arguments to be passed for the test tool being used (e.g. libtest, compiletest or rustdoc)' -r -complete -c x.py -n "__fish_seen_subcommand_from test" -l compiletest-rustc-args -d 'extra options to pass the compiler when running compiletest tests' -r -complete -c x.py -n "__fish_seen_subcommand_from test" -l extra-checks -d 'comma-separated list of other files types to check (accepts py, py:lint, py:fmt, shell)' -r -complete -c x.py -n "__fish_seen_subcommand_from test" -l compare-mode -d 'mode describing what file the actual ui output will be compared to' -r -complete -c x.py -n "__fish_seen_subcommand_from test" -l pass -d 'force {check,build,run}-pass tests to this mode' -r -complete -c x.py -n "__fish_seen_subcommand_from test" -l run -d 'whether to execute run-* tests' -r -complete -c x.py -n "__fish_seen_subcommand_from test" -l config -d 'TOML configuration file for build' -r -F -complete -c x.py -n "__fish_seen_subcommand_from test" -l build-dir -d 'Build directory, overrides `build.build-dir` in `config.toml`' -r -f -a "(__fish_complete_directories)" -complete -c x.py -n "__fish_seen_subcommand_from test" -l build -d 'build target of the stage0 compiler' -r -f -complete -c x.py -n "__fish_seen_subcommand_from test" -l host -d 'host targets to build' -r -f -complete -c x.py -n "__fish_seen_subcommand_from test" -l target -d 'target targets to build' -r -f -complete -c x.py -n "__fish_seen_subcommand_from test" -l exclude -d 'build paths to exclude' -r -F -complete -c x.py -n "__fish_seen_subcommand_from test" -l skip -d 'build paths to skip' -r -F -complete -c x.py -n "__fish_seen_subcommand_from test" -l rustc-error-format -r -f -complete -c x.py -n "__fish_seen_subcommand_from test" -l on-fail -d 'command to run on failure' -r -f -a "(__fish_complete_command)" -complete -c x.py -n "__fish_seen_subcommand_from test" -l stage -d 'stage to build (indicates compiler to use/test, e.g., stage 0 uses the bootstrap compiler, stage 1 the stage 0 rustc artifacts, etc.)' -r -f -complete -c x.py -n "__fish_seen_subcommand_from test" -l keep-stage -d 'stage(s) to keep without recompiling (pass multiple times to keep e.g., both stages 0 and 1)' -r -f -complete -c x.py -n "__fish_seen_subcommand_from test" -l keep-stage-std -d 'stage(s) of the standard library to keep without recompiling (pass multiple times to keep e.g., both stages 0 and 1)' -r -f -complete -c x.py -n "__fish_seen_subcommand_from test" -l src -d 'path to the root of the rust checkout' -r -f -a "(__fish_complete_directories)" -complete -c x.py -n "__fish_seen_subcommand_from test" -s j -l jobs -d 'number of jobs to run in parallel' -r -f -complete -c x.py -n "__fish_seen_subcommand_from test" -l warnings -d 'if value is deny, will deny warnings if value is warn, will emit warnings otherwise, use the default configured behaviour' -r -f -a "{deny '',warn '',default ''}" -complete -c x.py -n "__fish_seen_subcommand_from test" -l error-format -d 'rustc error format' -r -f -complete -c x.py -n "__fish_seen_subcommand_from test" -l color -d 'whether to use color in cargo and rustc output' -r -f -a "{always '',never '',auto ''}" -complete -c x.py -n "__fish_seen_subcommand_from test" -l llvm-skip-rebuild -d 'whether rebuilding llvm should be skipped, overriding `skip-rebuld` in config.toml' -r -f -a "{true '',false ''}" -complete -c x.py -n "__fish_seen_subcommand_from test" -l rust-profile-generate -d 'generate PGO profile with rustc build' -r -F -complete -c x.py -n "__fish_seen_subcommand_from test" -l rust-profile-use -d 'use PGO profile for rustc build' -r -F -complete -c x.py -n "__fish_seen_subcommand_from test" -l llvm-profile-use -d 'use PGO profile for LLVM build' -r -F -complete -c x.py -n "__fish_seen_subcommand_from test" -l reproducible-artifact -d 'Additional reproducible artifacts that should be added to the reproducible artifacts archive' -r -complete -c x.py -n "__fish_seen_subcommand_from test" -l set -d 'override options in config.toml' -r -f -complete -c x.py -n "__fish_seen_subcommand_from test" -l no-fail-fast -d 'run all tests regardless of failure' -complete -c x.py -n "__fish_seen_subcommand_from test" -l no-doc -d 'do not run doc tests' -complete -c x.py -n "__fish_seen_subcommand_from test" -l doc -d 'only run doc tests' -complete -c x.py -n "__fish_seen_subcommand_from test" -l bless -d 'whether to automatically update stderr/stdout files' -complete -c x.py -n "__fish_seen_subcommand_from test" -l force-rerun -d 'rerun tests even if the inputs are unchanged' -complete -c x.py -n "__fish_seen_subcommand_from test" -l only-modified -d 'only run tests that result has been changed' -complete -c x.py -n "__fish_seen_subcommand_from test" -l rustfix-coverage -d 'enable this to generate a Rustfix coverage file, which is saved in `/<build_base>/rustfix_missing_coverage.txt`' -complete -c x.py -n "__fish_seen_subcommand_from test" -s v -l verbose -d 'use verbose output (-vv for very verbose)' -complete -c x.py -n "__fish_seen_subcommand_from test" -s i -l incremental -d 'use incremental compilation' -complete -c x.py -n "__fish_seen_subcommand_from test" -l include-default-paths -d 'include default paths in addition to the provided ones' -complete -c x.py -n "__fish_seen_subcommand_from test" -l dry-run -d 'dry run; don\'t build anything' -complete -c x.py -n "__fish_seen_subcommand_from test" -l dump-bootstrap-shims -d 'Indicates whether to dump the work done from bootstrap shims' -complete -c x.py -n "__fish_seen_subcommand_from test" -l json-output -d 'use message-format=json' -complete -c x.py -n "__fish_seen_subcommand_from test" -l bypass-bootstrap-lock -d 'Bootstrap uses this value to decide whether it should bypass locking the build process. This is rarely needed (e.g., compiling the std library for different targets in parallel)' -complete -c x.py -n "__fish_seen_subcommand_from test" -l llvm-profile-generate -d 'generate PGO profile with llvm built for rustc' -complete -c x.py -n "__fish_seen_subcommand_from test" -l enable-bolt-settings -d 'Enable BOLT link flags' -complete -c x.py -n "__fish_seen_subcommand_from test" -l skip-stage0-validation -d 'Skip stage0 compiler validation' -complete -c x.py -n "__fish_seen_subcommand_from test" -s h -l help -d 'Print help (see more with \'--help\')' -complete -c x.py -n "__fish_seen_subcommand_from miri" -l test-args -d 'extra arguments to be passed for the test tool being used (e.g. libtest, compiletest or rustdoc)' -r -complete -c x.py -n "__fish_seen_subcommand_from miri" -l config -d 'TOML configuration file for build' -r -F -complete -c x.py -n "__fish_seen_subcommand_from miri" -l build-dir -d 'Build directory, overrides `build.build-dir` in `config.toml`' -r -f -a "(__fish_complete_directories)" -complete -c x.py -n "__fish_seen_subcommand_from miri" -l build -d 'build target of the stage0 compiler' -r -f -complete -c x.py -n "__fish_seen_subcommand_from miri" -l host -d 'host targets to build' -r -f -complete -c x.py -n "__fish_seen_subcommand_from miri" -l target -d 'target targets to build' -r -f -complete -c x.py -n "__fish_seen_subcommand_from miri" -l exclude -d 'build paths to exclude' -r -F -complete -c x.py -n "__fish_seen_subcommand_from miri" -l skip -d 'build paths to skip' -r -F -complete -c x.py -n "__fish_seen_subcommand_from miri" -l rustc-error-format -r -f -complete -c x.py -n "__fish_seen_subcommand_from miri" -l on-fail -d 'command to run on failure' -r -f -a "(__fish_complete_command)" -complete -c x.py -n "__fish_seen_subcommand_from miri" -l stage -d 'stage to build (indicates compiler to use/test, e.g., stage 0 uses the bootstrap compiler, stage 1 the stage 0 rustc artifacts, etc.)' -r -f -complete -c x.py -n "__fish_seen_subcommand_from miri" -l keep-stage -d 'stage(s) to keep without recompiling (pass multiple times to keep e.g., both stages 0 and 1)' -r -f -complete -c x.py -n "__fish_seen_subcommand_from miri" -l keep-stage-std -d 'stage(s) of the standard library to keep without recompiling (pass multiple times to keep e.g., both stages 0 and 1)' -r -f -complete -c x.py -n "__fish_seen_subcommand_from miri" -l src -d 'path to the root of the rust checkout' -r -f -a "(__fish_complete_directories)" -complete -c x.py -n "__fish_seen_subcommand_from miri" -s j -l jobs -d 'number of jobs to run in parallel' -r -f -complete -c x.py -n "__fish_seen_subcommand_from miri" -l warnings -d 'if value is deny, will deny warnings if value is warn, will emit warnings otherwise, use the default configured behaviour' -r -f -a "{deny '',warn '',default ''}" -complete -c x.py -n "__fish_seen_subcommand_from miri" -l error-format -d 'rustc error format' -r -f -complete -c x.py -n "__fish_seen_subcommand_from miri" -l color -d 'whether to use color in cargo and rustc output' -r -f -a "{always '',never '',auto ''}" -complete -c x.py -n "__fish_seen_subcommand_from miri" -l llvm-skip-rebuild -d 'whether rebuilding llvm should be skipped, overriding `skip-rebuld` in config.toml' -r -f -a "{true '',false ''}" -complete -c x.py -n "__fish_seen_subcommand_from miri" -l rust-profile-generate -d 'generate PGO profile with rustc build' -r -F -complete -c x.py -n "__fish_seen_subcommand_from miri" -l rust-profile-use -d 'use PGO profile for rustc build' -r -F -complete -c x.py -n "__fish_seen_subcommand_from miri" -l llvm-profile-use -d 'use PGO profile for LLVM build' -r -F -complete -c x.py -n "__fish_seen_subcommand_from miri" -l reproducible-artifact -d 'Additional reproducible artifacts that should be added to the reproducible artifacts archive' -r -complete -c x.py -n "__fish_seen_subcommand_from miri" -l set -d 'override options in config.toml' -r -f -complete -c x.py -n "__fish_seen_subcommand_from miri" -l no-fail-fast -d 'run all tests regardless of failure' -complete -c x.py -n "__fish_seen_subcommand_from miri" -l no-doc -d 'do not run doc tests' -complete -c x.py -n "__fish_seen_subcommand_from miri" -l doc -d 'only run doc tests' -complete -c x.py -n "__fish_seen_subcommand_from miri" -s v -l verbose -d 'use verbose output (-vv for very verbose)' -complete -c x.py -n "__fish_seen_subcommand_from miri" -s i -l incremental -d 'use incremental compilation' -complete -c x.py -n "__fish_seen_subcommand_from miri" -l include-default-paths -d 'include default paths in addition to the provided ones' -complete -c x.py -n "__fish_seen_subcommand_from miri" -l dry-run -d 'dry run; don\'t build anything' -complete -c x.py -n "__fish_seen_subcommand_from miri" -l dump-bootstrap-shims -d 'Indicates whether to dump the work done from bootstrap shims' -complete -c x.py -n "__fish_seen_subcommand_from miri" -l json-output -d 'use message-format=json' -complete -c x.py -n "__fish_seen_subcommand_from miri" -l bypass-bootstrap-lock -d 'Bootstrap uses this value to decide whether it should bypass locking the build process. This is rarely needed (e.g., compiling the std library for different targets in parallel)' -complete -c x.py -n "__fish_seen_subcommand_from miri" -l llvm-profile-generate -d 'generate PGO profile with llvm built for rustc' -complete -c x.py -n "__fish_seen_subcommand_from miri" -l enable-bolt-settings -d 'Enable BOLT link flags' -complete -c x.py -n "__fish_seen_subcommand_from miri" -l skip-stage0-validation -d 'Skip stage0 compiler validation' -complete -c x.py -n "__fish_seen_subcommand_from miri" -s h -l help -d 'Print help (see more with \'--help\')' -complete -c x.py -n "__fish_seen_subcommand_from bench" -l test-args -r -complete -c x.py -n "__fish_seen_subcommand_from bench" -l config -d 'TOML configuration file for build' -r -F -complete -c x.py -n "__fish_seen_subcommand_from bench" -l build-dir -d 'Build directory, overrides `build.build-dir` in `config.toml`' -r -f -a "(__fish_complete_directories)" -complete -c x.py -n "__fish_seen_subcommand_from bench" -l build -d 'build target of the stage0 compiler' -r -f -complete -c x.py -n "__fish_seen_subcommand_from bench" -l host -d 'host targets to build' -r -f -complete -c x.py -n "__fish_seen_subcommand_from bench" -l target -d 'target targets to build' -r -f -complete -c x.py -n "__fish_seen_subcommand_from bench" -l exclude -d 'build paths to exclude' -r -F -complete -c x.py -n "__fish_seen_subcommand_from bench" -l skip -d 'build paths to skip' -r -F -complete -c x.py -n "__fish_seen_subcommand_from bench" -l rustc-error-format -r -f -complete -c x.py -n "__fish_seen_subcommand_from bench" -l on-fail -d 'command to run on failure' -r -f -a "(__fish_complete_command)" -complete -c x.py -n "__fish_seen_subcommand_from bench" -l stage -d 'stage to build (indicates compiler to use/test, e.g., stage 0 uses the bootstrap compiler, stage 1 the stage 0 rustc artifacts, etc.)' -r -f -complete -c x.py -n "__fish_seen_subcommand_from bench" -l keep-stage -d 'stage(s) to keep without recompiling (pass multiple times to keep e.g., both stages 0 and 1)' -r -f -complete -c x.py -n "__fish_seen_subcommand_from bench" -l keep-stage-std -d 'stage(s) of the standard library to keep without recompiling (pass multiple times to keep e.g., both stages 0 and 1)' -r -f -complete -c x.py -n "__fish_seen_subcommand_from bench" -l src -d 'path to the root of the rust checkout' -r -f -a "(__fish_complete_directories)" -complete -c x.py -n "__fish_seen_subcommand_from bench" -s j -l jobs -d 'number of jobs to run in parallel' -r -f -complete -c x.py -n "__fish_seen_subcommand_from bench" -l warnings -d 'if value is deny, will deny warnings if value is warn, will emit warnings otherwise, use the default configured behaviour' -r -f -a "{deny '',warn '',default ''}" -complete -c x.py -n "__fish_seen_subcommand_from bench" -l error-format -d 'rustc error format' -r -f -complete -c x.py -n "__fish_seen_subcommand_from bench" -l color -d 'whether to use color in cargo and rustc output' -r -f -a "{always '',never '',auto ''}" -complete -c x.py -n "__fish_seen_subcommand_from bench" -l llvm-skip-rebuild -d 'whether rebuilding llvm should be skipped, overriding `skip-rebuld` in config.toml' -r -f -a "{true '',false ''}" -complete -c x.py -n "__fish_seen_subcommand_from bench" -l rust-profile-generate -d 'generate PGO profile with rustc build' -r -F -complete -c x.py -n "__fish_seen_subcommand_from bench" -l rust-profile-use -d 'use PGO profile for rustc build' -r -F -complete -c x.py -n "__fish_seen_subcommand_from bench" -l llvm-profile-use -d 'use PGO profile for LLVM build' -r -F -complete -c x.py -n "__fish_seen_subcommand_from bench" -l reproducible-artifact -d 'Additional reproducible artifacts that should be added to the reproducible artifacts archive' -r -complete -c x.py -n "__fish_seen_subcommand_from bench" -l set -d 'override options in config.toml' -r -f -complete -c x.py -n "__fish_seen_subcommand_from bench" -s v -l verbose -d 'use verbose output (-vv for very verbose)' -complete -c x.py -n "__fish_seen_subcommand_from bench" -s i -l incremental -d 'use incremental compilation' -complete -c x.py -n "__fish_seen_subcommand_from bench" -l include-default-paths -d 'include default paths in addition to the provided ones' -complete -c x.py -n "__fish_seen_subcommand_from bench" -l dry-run -d 'dry run; don\'t build anything' -complete -c x.py -n "__fish_seen_subcommand_from bench" -l dump-bootstrap-shims -d 'Indicates whether to dump the work done from bootstrap shims' -complete -c x.py -n "__fish_seen_subcommand_from bench" -l json-output -d 'use message-format=json' -complete -c x.py -n "__fish_seen_subcommand_from bench" -l bypass-bootstrap-lock -d 'Bootstrap uses this value to decide whether it should bypass locking the build process. This is rarely needed (e.g., compiling the std library for different targets in parallel)' -complete -c x.py -n "__fish_seen_subcommand_from bench" -l llvm-profile-generate -d 'generate PGO profile with llvm built for rustc' -complete -c x.py -n "__fish_seen_subcommand_from bench" -l enable-bolt-settings -d 'Enable BOLT link flags' -complete -c x.py -n "__fish_seen_subcommand_from bench" -l skip-stage0-validation -d 'Skip stage0 compiler validation' -complete -c x.py -n "__fish_seen_subcommand_from bench" -s h -l help -d 'Print help (see more with \'--help\')' -complete -c x.py -n "__fish_seen_subcommand_from clean" -l stage -d 'Clean a specific stage without touching other artifacts. By default, every stage is cleaned if this option is not used' -r -complete -c x.py -n "__fish_seen_subcommand_from clean" -l config -d 'TOML configuration file for build' -r -F -complete -c x.py -n "__fish_seen_subcommand_from clean" -l build-dir -d 'Build directory, overrides `build.build-dir` in `config.toml`' -r -f -a "(__fish_complete_directories)" -complete -c x.py -n "__fish_seen_subcommand_from clean" -l build -d 'build target of the stage0 compiler' -r -f -complete -c x.py -n "__fish_seen_subcommand_from clean" -l host -d 'host targets to build' -r -f -complete -c x.py -n "__fish_seen_subcommand_from clean" -l target -d 'target targets to build' -r -f -complete -c x.py -n "__fish_seen_subcommand_from clean" -l exclude -d 'build paths to exclude' -r -F -complete -c x.py -n "__fish_seen_subcommand_from clean" -l skip -d 'build paths to skip' -r -F -complete -c x.py -n "__fish_seen_subcommand_from clean" -l rustc-error-format -r -f -complete -c x.py -n "__fish_seen_subcommand_from clean" -l on-fail -d 'command to run on failure' -r -f -a "(__fish_complete_command)" -complete -c x.py -n "__fish_seen_subcommand_from clean" -l keep-stage -d 'stage(s) to keep without recompiling (pass multiple times to keep e.g., both stages 0 and 1)' -r -f -complete -c x.py -n "__fish_seen_subcommand_from clean" -l keep-stage-std -d 'stage(s) of the standard library to keep without recompiling (pass multiple times to keep e.g., both stages 0 and 1)' -r -f -complete -c x.py -n "__fish_seen_subcommand_from clean" -l src -d 'path to the root of the rust checkout' -r -f -a "(__fish_complete_directories)" -complete -c x.py -n "__fish_seen_subcommand_from clean" -s j -l jobs -d 'number of jobs to run in parallel' -r -f -complete -c x.py -n "__fish_seen_subcommand_from clean" -l warnings -d 'if value is deny, will deny warnings if value is warn, will emit warnings otherwise, use the default configured behaviour' -r -f -a "{deny '',warn '',default ''}" -complete -c x.py -n "__fish_seen_subcommand_from clean" -l error-format -d 'rustc error format' -r -f -complete -c x.py -n "__fish_seen_subcommand_from clean" -l color -d 'whether to use color in cargo and rustc output' -r -f -a "{always '',never '',auto ''}" -complete -c x.py -n "__fish_seen_subcommand_from clean" -l llvm-skip-rebuild -d 'whether rebuilding llvm should be skipped, overriding `skip-rebuld` in config.toml' -r -f -a "{true '',false ''}" -complete -c x.py -n "__fish_seen_subcommand_from clean" -l rust-profile-generate -d 'generate PGO profile with rustc build' -r -F -complete -c x.py -n "__fish_seen_subcommand_from clean" -l rust-profile-use -d 'use PGO profile for rustc build' -r -F -complete -c x.py -n "__fish_seen_subcommand_from clean" -l llvm-profile-use -d 'use PGO profile for LLVM build' -r -F -complete -c x.py -n "__fish_seen_subcommand_from clean" -l reproducible-artifact -d 'Additional reproducible artifacts that should be added to the reproducible artifacts archive' -r -complete -c x.py -n "__fish_seen_subcommand_from clean" -l set -d 'override options in config.toml' -r -f -complete -c x.py -n "__fish_seen_subcommand_from clean" -l all -d 'Clean the entire build directory (not used by default)' -complete -c x.py -n "__fish_seen_subcommand_from clean" -s v -l verbose -d 'use verbose output (-vv for very verbose)' -complete -c x.py -n "__fish_seen_subcommand_from clean" -s i -l incremental -d 'use incremental compilation' -complete -c x.py -n "__fish_seen_subcommand_from clean" -l include-default-paths -d 'include default paths in addition to the provided ones' -complete -c x.py -n "__fish_seen_subcommand_from clean" -l dry-run -d 'dry run; don\'t build anything' -complete -c x.py -n "__fish_seen_subcommand_from clean" -l dump-bootstrap-shims -d 'Indicates whether to dump the work done from bootstrap shims' -complete -c x.py -n "__fish_seen_subcommand_from clean" -l json-output -d 'use message-format=json' -complete -c x.py -n "__fish_seen_subcommand_from clean" -l bypass-bootstrap-lock -d 'Bootstrap uses this value to decide whether it should bypass locking the build process. This is rarely needed (e.g., compiling the std library for different targets in parallel)' -complete -c x.py -n "__fish_seen_subcommand_from clean" -l llvm-profile-generate -d 'generate PGO profile with llvm built for rustc' -complete -c x.py -n "__fish_seen_subcommand_from clean" -l enable-bolt-settings -d 'Enable BOLT link flags' -complete -c x.py -n "__fish_seen_subcommand_from clean" -l skip-stage0-validation -d 'Skip stage0 compiler validation' -complete -c x.py -n "__fish_seen_subcommand_from clean" -s h -l help -d 'Print help (see more with \'--help\')' -complete -c x.py -n "__fish_seen_subcommand_from dist" -l config -d 'TOML configuration file for build' -r -F -complete -c x.py -n "__fish_seen_subcommand_from dist" -l build-dir -d 'Build directory, overrides `build.build-dir` in `config.toml`' -r -f -a "(__fish_complete_directories)" -complete -c x.py -n "__fish_seen_subcommand_from dist" -l build -d 'build target of the stage0 compiler' -r -f -complete -c x.py -n "__fish_seen_subcommand_from dist" -l host -d 'host targets to build' -r -f -complete -c x.py -n "__fish_seen_subcommand_from dist" -l target -d 'target targets to build' -r -f -complete -c x.py -n "__fish_seen_subcommand_from dist" -l exclude -d 'build paths to exclude' -r -F -complete -c x.py -n "__fish_seen_subcommand_from dist" -l skip -d 'build paths to skip' -r -F -complete -c x.py -n "__fish_seen_subcommand_from dist" -l rustc-error-format -r -f -complete -c x.py -n "__fish_seen_subcommand_from dist" -l on-fail -d 'command to run on failure' -r -f -a "(__fish_complete_command)" -complete -c x.py -n "__fish_seen_subcommand_from dist" -l stage -d 'stage to build (indicates compiler to use/test, e.g., stage 0 uses the bootstrap compiler, stage 1 the stage 0 rustc artifacts, etc.)' -r -f -complete -c x.py -n "__fish_seen_subcommand_from dist" -l keep-stage -d 'stage(s) to keep without recompiling (pass multiple times to keep e.g., both stages 0 and 1)' -r -f -complete -c x.py -n "__fish_seen_subcommand_from dist" -l keep-stage-std -d 'stage(s) of the standard library to keep without recompiling (pass multiple times to keep e.g., both stages 0 and 1)' -r -f -complete -c x.py -n "__fish_seen_subcommand_from dist" -l src -d 'path to the root of the rust checkout' -r -f -a "(__fish_complete_directories)" -complete -c x.py -n "__fish_seen_subcommand_from dist" -s j -l jobs -d 'number of jobs to run in parallel' -r -f -complete -c x.py -n "__fish_seen_subcommand_from dist" -l warnings -d 'if value is deny, will deny warnings if value is warn, will emit warnings otherwise, use the default configured behaviour' -r -f -a "{deny '',warn '',default ''}" -complete -c x.py -n "__fish_seen_subcommand_from dist" -l error-format -d 'rustc error format' -r -f -complete -c x.py -n "__fish_seen_subcommand_from dist" -l color -d 'whether to use color in cargo and rustc output' -r -f -a "{always '',never '',auto ''}" -complete -c x.py -n "__fish_seen_subcommand_from dist" -l llvm-skip-rebuild -d 'whether rebuilding llvm should be skipped, overriding `skip-rebuld` in config.toml' -r -f -a "{true '',false ''}" -complete -c x.py -n "__fish_seen_subcommand_from dist" -l rust-profile-generate -d 'generate PGO profile with rustc build' -r -F -complete -c x.py -n "__fish_seen_subcommand_from dist" -l rust-profile-use -d 'use PGO profile for rustc build' -r -F -complete -c x.py -n "__fish_seen_subcommand_from dist" -l llvm-profile-use -d 'use PGO profile for LLVM build' -r -F -complete -c x.py -n "__fish_seen_subcommand_from dist" -l reproducible-artifact -d 'Additional reproducible artifacts that should be added to the reproducible artifacts archive' -r -complete -c x.py -n "__fish_seen_subcommand_from dist" -l set -d 'override options in config.toml' -r -f -complete -c x.py -n "__fish_seen_subcommand_from dist" -s v -l verbose -d 'use verbose output (-vv for very verbose)' -complete -c x.py -n "__fish_seen_subcommand_from dist" -s i -l incremental -d 'use incremental compilation' -complete -c x.py -n "__fish_seen_subcommand_from dist" -l include-default-paths -d 'include default paths in addition to the provided ones' -complete -c x.py -n "__fish_seen_subcommand_from dist" -l dry-run -d 'dry run; don\'t build anything' -complete -c x.py -n "__fish_seen_subcommand_from dist" -l dump-bootstrap-shims -d 'Indicates whether to dump the work done from bootstrap shims' -complete -c x.py -n "__fish_seen_subcommand_from dist" -l json-output -d 'use message-format=json' -complete -c x.py -n "__fish_seen_subcommand_from dist" -l bypass-bootstrap-lock -d 'Bootstrap uses this value to decide whether it should bypass locking the build process. This is rarely needed (e.g., compiling the std library for different targets in parallel)' -complete -c x.py -n "__fish_seen_subcommand_from dist" -l llvm-profile-generate -d 'generate PGO profile with llvm built for rustc' -complete -c x.py -n "__fish_seen_subcommand_from dist" -l enable-bolt-settings -d 'Enable BOLT link flags' -complete -c x.py -n "__fish_seen_subcommand_from dist" -l skip-stage0-validation -d 'Skip stage0 compiler validation' -complete -c x.py -n "__fish_seen_subcommand_from dist" -s h -l help -d 'Print help (see more with \'--help\')' -complete -c x.py -n "__fish_seen_subcommand_from install" -l config -d 'TOML configuration file for build' -r -F -complete -c x.py -n "__fish_seen_subcommand_from install" -l build-dir -d 'Build directory, overrides `build.build-dir` in `config.toml`' -r -f -a "(__fish_complete_directories)" -complete -c x.py -n "__fish_seen_subcommand_from install" -l build -d 'build target of the stage0 compiler' -r -f -complete -c x.py -n "__fish_seen_subcommand_from install" -l host -d 'host targets to build' -r -f -complete -c x.py -n "__fish_seen_subcommand_from install" -l target -d 'target targets to build' -r -f -complete -c x.py -n "__fish_seen_subcommand_from install" -l exclude -d 'build paths to exclude' -r -F -complete -c x.py -n "__fish_seen_subcommand_from install" -l skip -d 'build paths to skip' -r -F -complete -c x.py -n "__fish_seen_subcommand_from install" -l rustc-error-format -r -f -complete -c x.py -n "__fish_seen_subcommand_from install" -l on-fail -d 'command to run on failure' -r -f -a "(__fish_complete_command)" -complete -c x.py -n "__fish_seen_subcommand_from install" -l stage -d 'stage to build (indicates compiler to use/test, e.g., stage 0 uses the bootstrap compiler, stage 1 the stage 0 rustc artifacts, etc.)' -r -f -complete -c x.py -n "__fish_seen_subcommand_from install" -l keep-stage -d 'stage(s) to keep without recompiling (pass multiple times to keep e.g., both stages 0 and 1)' -r -f -complete -c x.py -n "__fish_seen_subcommand_from install" -l keep-stage-std -d 'stage(s) of the standard library to keep without recompiling (pass multiple times to keep e.g., both stages 0 and 1)' -r -f -complete -c x.py -n "__fish_seen_subcommand_from install" -l src -d 'path to the root of the rust checkout' -r -f -a "(__fish_complete_directories)" -complete -c x.py -n "__fish_seen_subcommand_from install" -s j -l jobs -d 'number of jobs to run in parallel' -r -f -complete -c x.py -n "__fish_seen_subcommand_from install" -l warnings -d 'if value is deny, will deny warnings if value is warn, will emit warnings otherwise, use the default configured behaviour' -r -f -a "{deny '',warn '',default ''}" -complete -c x.py -n "__fish_seen_subcommand_from install" -l error-format -d 'rustc error format' -r -f -complete -c x.py -n "__fish_seen_subcommand_from install" -l color -d 'whether to use color in cargo and rustc output' -r -f -a "{always '',never '',auto ''}" -complete -c x.py -n "__fish_seen_subcommand_from install" -l llvm-skip-rebuild -d 'whether rebuilding llvm should be skipped, overriding `skip-rebuld` in config.toml' -r -f -a "{true '',false ''}" -complete -c x.py -n "__fish_seen_subcommand_from install" -l rust-profile-generate -d 'generate PGO profile with rustc build' -r -F -complete -c x.py -n "__fish_seen_subcommand_from install" -l rust-profile-use -d 'use PGO profile for rustc build' -r -F -complete -c x.py -n "__fish_seen_subcommand_from install" -l llvm-profile-use -d 'use PGO profile for LLVM build' -r -F -complete -c x.py -n "__fish_seen_subcommand_from install" -l reproducible-artifact -d 'Additional reproducible artifacts that should be added to the reproducible artifacts archive' -r -complete -c x.py -n "__fish_seen_subcommand_from install" -l set -d 'override options in config.toml' -r -f -complete -c x.py -n "__fish_seen_subcommand_from install" -s v -l verbose -d 'use verbose output (-vv for very verbose)' -complete -c x.py -n "__fish_seen_subcommand_from install" -s i -l incremental -d 'use incremental compilation' -complete -c x.py -n "__fish_seen_subcommand_from install" -l include-default-paths -d 'include default paths in addition to the provided ones' -complete -c x.py -n "__fish_seen_subcommand_from install" -l dry-run -d 'dry run; don\'t build anything' -complete -c x.py -n "__fish_seen_subcommand_from install" -l dump-bootstrap-shims -d 'Indicates whether to dump the work done from bootstrap shims' -complete -c x.py -n "__fish_seen_subcommand_from install" -l json-output -d 'use message-format=json' -complete -c x.py -n "__fish_seen_subcommand_from install" -l bypass-bootstrap-lock -d 'Bootstrap uses this value to decide whether it should bypass locking the build process. This is rarely needed (e.g., compiling the std library for different targets in parallel)' -complete -c x.py -n "__fish_seen_subcommand_from install" -l llvm-profile-generate -d 'generate PGO profile with llvm built for rustc' -complete -c x.py -n "__fish_seen_subcommand_from install" -l enable-bolt-settings -d 'Enable BOLT link flags' -complete -c x.py -n "__fish_seen_subcommand_from install" -l skip-stage0-validation -d 'Skip stage0 compiler validation' -complete -c x.py -n "__fish_seen_subcommand_from install" -s h -l help -d 'Print help (see more with \'--help\')' -complete -c x.py -n "__fish_seen_subcommand_from run" -l args -d 'arguments for the tool' -r -complete -c x.py -n "__fish_seen_subcommand_from run" -l config -d 'TOML configuration file for build' -r -F -complete -c x.py -n "__fish_seen_subcommand_from run" -l build-dir -d 'Build directory, overrides `build.build-dir` in `config.toml`' -r -f -a "(__fish_complete_directories)" -complete -c x.py -n "__fish_seen_subcommand_from run" -l build -d 'build target of the stage0 compiler' -r -f -complete -c x.py -n "__fish_seen_subcommand_from run" -l host -d 'host targets to build' -r -f -complete -c x.py -n "__fish_seen_subcommand_from run" -l target -d 'target targets to build' -r -f -complete -c x.py -n "__fish_seen_subcommand_from run" -l exclude -d 'build paths to exclude' -r -F -complete -c x.py -n "__fish_seen_subcommand_from run" -l skip -d 'build paths to skip' -r -F -complete -c x.py -n "__fish_seen_subcommand_from run" -l rustc-error-format -r -f -complete -c x.py -n "__fish_seen_subcommand_from run" -l on-fail -d 'command to run on failure' -r -f -a "(__fish_complete_command)" -complete -c x.py -n "__fish_seen_subcommand_from run" -l stage -d 'stage to build (indicates compiler to use/test, e.g., stage 0 uses the bootstrap compiler, stage 1 the stage 0 rustc artifacts, etc.)' -r -f -complete -c x.py -n "__fish_seen_subcommand_from run" -l keep-stage -d 'stage(s) to keep without recompiling (pass multiple times to keep e.g., both stages 0 and 1)' -r -f -complete -c x.py -n "__fish_seen_subcommand_from run" -l keep-stage-std -d 'stage(s) of the standard library to keep without recompiling (pass multiple times to keep e.g., both stages 0 and 1)' -r -f -complete -c x.py -n "__fish_seen_subcommand_from run" -l src -d 'path to the root of the rust checkout' -r -f -a "(__fish_complete_directories)" -complete -c x.py -n "__fish_seen_subcommand_from run" -s j -l jobs -d 'number of jobs to run in parallel' -r -f -complete -c x.py -n "__fish_seen_subcommand_from run" -l warnings -d 'if value is deny, will deny warnings if value is warn, will emit warnings otherwise, use the default configured behaviour' -r -f -a "{deny '',warn '',default ''}" -complete -c x.py -n "__fish_seen_subcommand_from run" -l error-format -d 'rustc error format' -r -f -complete -c x.py -n "__fish_seen_subcommand_from run" -l color -d 'whether to use color in cargo and rustc output' -r -f -a "{always '',never '',auto ''}" -complete -c x.py -n "__fish_seen_subcommand_from run" -l llvm-skip-rebuild -d 'whether rebuilding llvm should be skipped, overriding `skip-rebuld` in config.toml' -r -f -a "{true '',false ''}" -complete -c x.py -n "__fish_seen_subcommand_from run" -l rust-profile-generate -d 'generate PGO profile with rustc build' -r -F -complete -c x.py -n "__fish_seen_subcommand_from run" -l rust-profile-use -d 'use PGO profile for rustc build' -r -F -complete -c x.py -n "__fish_seen_subcommand_from run" -l llvm-profile-use -d 'use PGO profile for LLVM build' -r -F -complete -c x.py -n "__fish_seen_subcommand_from run" -l reproducible-artifact -d 'Additional reproducible artifacts that should be added to the reproducible artifacts archive' -r -complete -c x.py -n "__fish_seen_subcommand_from run" -l set -d 'override options in config.toml' -r -f -complete -c x.py -n "__fish_seen_subcommand_from run" -s v -l verbose -d 'use verbose output (-vv for very verbose)' -complete -c x.py -n "__fish_seen_subcommand_from run" -s i -l incremental -d 'use incremental compilation' -complete -c x.py -n "__fish_seen_subcommand_from run" -l include-default-paths -d 'include default paths in addition to the provided ones' -complete -c x.py -n "__fish_seen_subcommand_from run" -l dry-run -d 'dry run; don\'t build anything' -complete -c x.py -n "__fish_seen_subcommand_from run" -l dump-bootstrap-shims -d 'Indicates whether to dump the work done from bootstrap shims' -complete -c x.py -n "__fish_seen_subcommand_from run" -l json-output -d 'use message-format=json' -complete -c x.py -n "__fish_seen_subcommand_from run" -l bypass-bootstrap-lock -d 'Bootstrap uses this value to decide whether it should bypass locking the build process. This is rarely needed (e.g., compiling the std library for different targets in parallel)' -complete -c x.py -n "__fish_seen_subcommand_from run" -l llvm-profile-generate -d 'generate PGO profile with llvm built for rustc' -complete -c x.py -n "__fish_seen_subcommand_from run" -l enable-bolt-settings -d 'Enable BOLT link flags' -complete -c x.py -n "__fish_seen_subcommand_from run" -l skip-stage0-validation -d 'Skip stage0 compiler validation' -complete -c x.py -n "__fish_seen_subcommand_from run" -s h -l help -d 'Print help (see more with \'--help\')' -complete -c x.py -n "__fish_seen_subcommand_from setup" -l config -d 'TOML configuration file for build' -r -F -complete -c x.py -n "__fish_seen_subcommand_from setup" -l build-dir -d 'Build directory, overrides `build.build-dir` in `config.toml`' -r -f -a "(__fish_complete_directories)" -complete -c x.py -n "__fish_seen_subcommand_from setup" -l build -d 'build target of the stage0 compiler' -r -f -complete -c x.py -n "__fish_seen_subcommand_from setup" -l host -d 'host targets to build' -r -f -complete -c x.py -n "__fish_seen_subcommand_from setup" -l target -d 'target targets to build' -r -f -complete -c x.py -n "__fish_seen_subcommand_from setup" -l exclude -d 'build paths to exclude' -r -F -complete -c x.py -n "__fish_seen_subcommand_from setup" -l skip -d 'build paths to skip' -r -F -complete -c x.py -n "__fish_seen_subcommand_from setup" -l rustc-error-format -r -f -complete -c x.py -n "__fish_seen_subcommand_from setup" -l on-fail -d 'command to run on failure' -r -f -a "(__fish_complete_command)" -complete -c x.py -n "__fish_seen_subcommand_from setup" -l stage -d 'stage to build (indicates compiler to use/test, e.g., stage 0 uses the bootstrap compiler, stage 1 the stage 0 rustc artifacts, etc.)' -r -f -complete -c x.py -n "__fish_seen_subcommand_from setup" -l keep-stage -d 'stage(s) to keep without recompiling (pass multiple times to keep e.g., both stages 0 and 1)' -r -f -complete -c x.py -n "__fish_seen_subcommand_from setup" -l keep-stage-std -d 'stage(s) of the standard library to keep without recompiling (pass multiple times to keep e.g., both stages 0 and 1)' -r -f -complete -c x.py -n "__fish_seen_subcommand_from setup" -l src -d 'path to the root of the rust checkout' -r -f -a "(__fish_complete_directories)" -complete -c x.py -n "__fish_seen_subcommand_from setup" -s j -l jobs -d 'number of jobs to run in parallel' -r -f -complete -c x.py -n "__fish_seen_subcommand_from setup" -l warnings -d 'if value is deny, will deny warnings if value is warn, will emit warnings otherwise, use the default configured behaviour' -r -f -a "{deny '',warn '',default ''}" -complete -c x.py -n "__fish_seen_subcommand_from setup" -l error-format -d 'rustc error format' -r -f -complete -c x.py -n "__fish_seen_subcommand_from setup" -l color -d 'whether to use color in cargo and rustc output' -r -f -a "{always '',never '',auto ''}" -complete -c x.py -n "__fish_seen_subcommand_from setup" -l llvm-skip-rebuild -d 'whether rebuilding llvm should be skipped, overriding `skip-rebuld` in config.toml' -r -f -a "{true '',false ''}" -complete -c x.py -n "__fish_seen_subcommand_from setup" -l rust-profile-generate -d 'generate PGO profile with rustc build' -r -F -complete -c x.py -n "__fish_seen_subcommand_from setup" -l rust-profile-use -d 'use PGO profile for rustc build' -r -F -complete -c x.py -n "__fish_seen_subcommand_from setup" -l llvm-profile-use -d 'use PGO profile for LLVM build' -r -F -complete -c x.py -n "__fish_seen_subcommand_from setup" -l reproducible-artifact -d 'Additional reproducible artifacts that should be added to the reproducible artifacts archive' -r -complete -c x.py -n "__fish_seen_subcommand_from setup" -l set -d 'override options in config.toml' -r -f -complete -c x.py -n "__fish_seen_subcommand_from setup" -s v -l verbose -d 'use verbose output (-vv for very verbose)' -complete -c x.py -n "__fish_seen_subcommand_from setup" -s i -l incremental -d 'use incremental compilation' -complete -c x.py -n "__fish_seen_subcommand_from setup" -l include-default-paths -d 'include default paths in addition to the provided ones' -complete -c x.py -n "__fish_seen_subcommand_from setup" -l dry-run -d 'dry run; don\'t build anything' -complete -c x.py -n "__fish_seen_subcommand_from setup" -l dump-bootstrap-shims -d 'Indicates whether to dump the work done from bootstrap shims' -complete -c x.py -n "__fish_seen_subcommand_from setup" -l json-output -d 'use message-format=json' -complete -c x.py -n "__fish_seen_subcommand_from setup" -l bypass-bootstrap-lock -d 'Bootstrap uses this value to decide whether it should bypass locking the build process. This is rarely needed (e.g., compiling the std library for different targets in parallel)' -complete -c x.py -n "__fish_seen_subcommand_from setup" -l llvm-profile-generate -d 'generate PGO profile with llvm built for rustc' -complete -c x.py -n "__fish_seen_subcommand_from setup" -l enable-bolt-settings -d 'Enable BOLT link flags' -complete -c x.py -n "__fish_seen_subcommand_from setup" -l skip-stage0-validation -d 'Skip stage0 compiler validation' -complete -c x.py -n "__fish_seen_subcommand_from setup" -s h -l help -d 'Print help (see more with \'--help\')' -complete -c x.py -n "__fish_seen_subcommand_from suggest" -l config -d 'TOML configuration file for build' -r -F -complete -c x.py -n "__fish_seen_subcommand_from suggest" -l build-dir -d 'Build directory, overrides `build.build-dir` in `config.toml`' -r -f -a "(__fish_complete_directories)" -complete -c x.py -n "__fish_seen_subcommand_from suggest" -l build -d 'build target of the stage0 compiler' -r -f -complete -c x.py -n "__fish_seen_subcommand_from suggest" -l host -d 'host targets to build' -r -f -complete -c x.py -n "__fish_seen_subcommand_from suggest" -l target -d 'target targets to build' -r -f -complete -c x.py -n "__fish_seen_subcommand_from suggest" -l exclude -d 'build paths to exclude' -r -F -complete -c x.py -n "__fish_seen_subcommand_from suggest" -l skip -d 'build paths to skip' -r -F -complete -c x.py -n "__fish_seen_subcommand_from suggest" -l rustc-error-format -r -f -complete -c x.py -n "__fish_seen_subcommand_from suggest" -l on-fail -d 'command to run on failure' -r -f -a "(__fish_complete_command)" -complete -c x.py -n "__fish_seen_subcommand_from suggest" -l stage -d 'stage to build (indicates compiler to use/test, e.g., stage 0 uses the bootstrap compiler, stage 1 the stage 0 rustc artifacts, etc.)' -r -f -complete -c x.py -n "__fish_seen_subcommand_from suggest" -l keep-stage -d 'stage(s) to keep without recompiling (pass multiple times to keep e.g., both stages 0 and 1)' -r -f -complete -c x.py -n "__fish_seen_subcommand_from suggest" -l keep-stage-std -d 'stage(s) of the standard library to keep without recompiling (pass multiple times to keep e.g., both stages 0 and 1)' -r -f -complete -c x.py -n "__fish_seen_subcommand_from suggest" -l src -d 'path to the root of the rust checkout' -r -f -a "(__fish_complete_directories)" -complete -c x.py -n "__fish_seen_subcommand_from suggest" -s j -l jobs -d 'number of jobs to run in parallel' -r -f -complete -c x.py -n "__fish_seen_subcommand_from suggest" -l warnings -d 'if value is deny, will deny warnings if value is warn, will emit warnings otherwise, use the default configured behaviour' -r -f -a "{deny '',warn '',default ''}" -complete -c x.py -n "__fish_seen_subcommand_from suggest" -l error-format -d 'rustc error format' -r -f -complete -c x.py -n "__fish_seen_subcommand_from suggest" -l color -d 'whether to use color in cargo and rustc output' -r -f -a "{always '',never '',auto ''}" -complete -c x.py -n "__fish_seen_subcommand_from suggest" -l llvm-skip-rebuild -d 'whether rebuilding llvm should be skipped, overriding `skip-rebuld` in config.toml' -r -f -a "{true '',false ''}" -complete -c x.py -n "__fish_seen_subcommand_from suggest" -l rust-profile-generate -d 'generate PGO profile with rustc build' -r -F -complete -c x.py -n "__fish_seen_subcommand_from suggest" -l rust-profile-use -d 'use PGO profile for rustc build' -r -F -complete -c x.py -n "__fish_seen_subcommand_from suggest" -l llvm-profile-use -d 'use PGO profile for LLVM build' -r -F -complete -c x.py -n "__fish_seen_subcommand_from suggest" -l reproducible-artifact -d 'Additional reproducible artifacts that should be added to the reproducible artifacts archive' -r -complete -c x.py -n "__fish_seen_subcommand_from suggest" -l set -d 'override options in config.toml' -r -f -complete -c x.py -n "__fish_seen_subcommand_from suggest" -l run -d 'run suggested tests' -complete -c x.py -n "__fish_seen_subcommand_from suggest" -s v -l verbose -d 'use verbose output (-vv for very verbose)' -complete -c x.py -n "__fish_seen_subcommand_from suggest" -s i -l incremental -d 'use incremental compilation' -complete -c x.py -n "__fish_seen_subcommand_from suggest" -l include-default-paths -d 'include default paths in addition to the provided ones' -complete -c x.py -n "__fish_seen_subcommand_from suggest" -l dry-run -d 'dry run; don\'t build anything' -complete -c x.py -n "__fish_seen_subcommand_from suggest" -l dump-bootstrap-shims -d 'Indicates whether to dump the work done from bootstrap shims' -complete -c x.py -n "__fish_seen_subcommand_from suggest" -l json-output -d 'use message-format=json' -complete -c x.py -n "__fish_seen_subcommand_from suggest" -l bypass-bootstrap-lock -d 'Bootstrap uses this value to decide whether it should bypass locking the build process. This is rarely needed (e.g., compiling the std library for different targets in parallel)' -complete -c x.py -n "__fish_seen_subcommand_from suggest" -l llvm-profile-generate -d 'generate PGO profile with llvm built for rustc' -complete -c x.py -n "__fish_seen_subcommand_from suggest" -l enable-bolt-settings -d 'Enable BOLT link flags' -complete -c x.py -n "__fish_seen_subcommand_from suggest" -l skip-stage0-validation -d 'Skip stage0 compiler validation' -complete -c x.py -n "__fish_seen_subcommand_from suggest" -s h -l help -d 'Print help (see more with \'--help\')' -complete -c x.py -n "__fish_seen_subcommand_from vendor" -l sync -d 'Additional `Cargo.toml` to sync and vendor' -r -F -complete -c x.py -n "__fish_seen_subcommand_from vendor" -l config -d 'TOML configuration file for build' -r -F -complete -c x.py -n "__fish_seen_subcommand_from vendor" -l build-dir -d 'Build directory, overrides `build.build-dir` in `config.toml`' -r -f -a "(__fish_complete_directories)" -complete -c x.py -n "__fish_seen_subcommand_from vendor" -l build -d 'build target of the stage0 compiler' -r -f -complete -c x.py -n "__fish_seen_subcommand_from vendor" -l host -d 'host targets to build' -r -f -complete -c x.py -n "__fish_seen_subcommand_from vendor" -l target -d 'target targets to build' -r -f -complete -c x.py -n "__fish_seen_subcommand_from vendor" -l exclude -d 'build paths to exclude' -r -F -complete -c x.py -n "__fish_seen_subcommand_from vendor" -l skip -d 'build paths to skip' -r -F -complete -c x.py -n "__fish_seen_subcommand_from vendor" -l rustc-error-format -r -f -complete -c x.py -n "__fish_seen_subcommand_from vendor" -l on-fail -d 'command to run on failure' -r -f -a "(__fish_complete_command)" -complete -c x.py -n "__fish_seen_subcommand_from vendor" -l stage -d 'stage to build (indicates compiler to use/test, e.g., stage 0 uses the bootstrap compiler, stage 1 the stage 0 rustc artifacts, etc.)' -r -f -complete -c x.py -n "__fish_seen_subcommand_from vendor" -l keep-stage -d 'stage(s) to keep without recompiling (pass multiple times to keep e.g., both stages 0 and 1)' -r -f -complete -c x.py -n "__fish_seen_subcommand_from vendor" -l keep-stage-std -d 'stage(s) of the standard library to keep without recompiling (pass multiple times to keep e.g., both stages 0 and 1)' -r -f -complete -c x.py -n "__fish_seen_subcommand_from vendor" -l src -d 'path to the root of the rust checkout' -r -f -a "(__fish_complete_directories)" -complete -c x.py -n "__fish_seen_subcommand_from vendor" -s j -l jobs -d 'number of jobs to run in parallel' -r -f -complete -c x.py -n "__fish_seen_subcommand_from vendor" -l warnings -d 'if value is deny, will deny warnings if value is warn, will emit warnings otherwise, use the default configured behaviour' -r -f -a "{deny '',warn '',default ''}" -complete -c x.py -n "__fish_seen_subcommand_from vendor" -l error-format -d 'rustc error format' -r -f -complete -c x.py -n "__fish_seen_subcommand_from vendor" -l color -d 'whether to use color in cargo and rustc output' -r -f -a "{always '',never '',auto ''}" -complete -c x.py -n "__fish_seen_subcommand_from vendor" -l llvm-skip-rebuild -d 'whether rebuilding llvm should be skipped, overriding `skip-rebuld` in config.toml' -r -f -a "{true '',false ''}" -complete -c x.py -n "__fish_seen_subcommand_from vendor" -l rust-profile-generate -d 'generate PGO profile with rustc build' -r -F -complete -c x.py -n "__fish_seen_subcommand_from vendor" -l rust-profile-use -d 'use PGO profile for rustc build' -r -F -complete -c x.py -n "__fish_seen_subcommand_from vendor" -l llvm-profile-use -d 'use PGO profile for LLVM build' -r -F -complete -c x.py -n "__fish_seen_subcommand_from vendor" -l reproducible-artifact -d 'Additional reproducible artifacts that should be added to the reproducible artifacts archive' -r -complete -c x.py -n "__fish_seen_subcommand_from vendor" -l set -d 'override options in config.toml' -r -f -complete -c x.py -n "__fish_seen_subcommand_from vendor" -l versioned-dirs -d 'Always include version in subdir name' -complete -c x.py -n "__fish_seen_subcommand_from vendor" -s v -l verbose -d 'use verbose output (-vv for very verbose)' -complete -c x.py -n "__fish_seen_subcommand_from vendor" -s i -l incremental -d 'use incremental compilation' -complete -c x.py -n "__fish_seen_subcommand_from vendor" -l include-default-paths -d 'include default paths in addition to the provided ones' -complete -c x.py -n "__fish_seen_subcommand_from vendor" -l dry-run -d 'dry run; don\'t build anything' -complete -c x.py -n "__fish_seen_subcommand_from vendor" -l dump-bootstrap-shims -d 'Indicates whether to dump the work done from bootstrap shims' -complete -c x.py -n "__fish_seen_subcommand_from vendor" -l json-output -d 'use message-format=json' -complete -c x.py -n "__fish_seen_subcommand_from vendor" -l bypass-bootstrap-lock -d 'Bootstrap uses this value to decide whether it should bypass locking the build process. This is rarely needed (e.g., compiling the std library for different targets in parallel)' -complete -c x.py -n "__fish_seen_subcommand_from vendor" -l llvm-profile-generate -d 'generate PGO profile with llvm built for rustc' -complete -c x.py -n "__fish_seen_subcommand_from vendor" -l enable-bolt-settings -d 'Enable BOLT link flags' -complete -c x.py -n "__fish_seen_subcommand_from vendor" -l skip-stage0-validation -d 'Skip stage0 compiler validation' -complete -c x.py -n "__fish_seen_subcommand_from vendor" -s h -l help -d 'Print help (see more with \'--help\')' -complete -c x.py -n "__fish_seen_subcommand_from perf" -l config -d 'TOML configuration file for build' -r -F -complete -c x.py -n "__fish_seen_subcommand_from perf" -l build-dir -d 'Build directory, overrides `build.build-dir` in `config.toml`' -r -f -a "(__fish_complete_directories)" -complete -c x.py -n "__fish_seen_subcommand_from perf" -l build -d 'build target of the stage0 compiler' -r -f -complete -c x.py -n "__fish_seen_subcommand_from perf" -l host -d 'host targets to build' -r -f -complete -c x.py -n "__fish_seen_subcommand_from perf" -l target -d 'target targets to build' -r -f -complete -c x.py -n "__fish_seen_subcommand_from perf" -l exclude -d 'build paths to exclude' -r -F -complete -c x.py -n "__fish_seen_subcommand_from perf" -l skip -d 'build paths to skip' -r -F -complete -c x.py -n "__fish_seen_subcommand_from perf" -l rustc-error-format -r -f -complete -c x.py -n "__fish_seen_subcommand_from perf" -l on-fail -d 'command to run on failure' -r -f -a "(__fish_complete_command)" -complete -c x.py -n "__fish_seen_subcommand_from perf" -l stage -d 'stage to build (indicates compiler to use/test, e.g., stage 0 uses the bootstrap compiler, stage 1 the stage 0 rustc artifacts, etc.)' -r -f -complete -c x.py -n "__fish_seen_subcommand_from perf" -l keep-stage -d 'stage(s) to keep without recompiling (pass multiple times to keep e.g., both stages 0 and 1)' -r -f -complete -c x.py -n "__fish_seen_subcommand_from perf" -l keep-stage-std -d 'stage(s) of the standard library to keep without recompiling (pass multiple times to keep e.g., both stages 0 and 1)' -r -f -complete -c x.py -n "__fish_seen_subcommand_from perf" -l src -d 'path to the root of the rust checkout' -r -f -a "(__fish_complete_directories)" -complete -c x.py -n "__fish_seen_subcommand_from perf" -s j -l jobs -d 'number of jobs to run in parallel' -r -f -complete -c x.py -n "__fish_seen_subcommand_from perf" -l warnings -d 'if value is deny, will deny warnings if value is warn, will emit warnings otherwise, use the default configured behaviour' -r -f -a "{deny '',warn '',default ''}" -complete -c x.py -n "__fish_seen_subcommand_from perf" -l error-format -d 'rustc error format' -r -f -complete -c x.py -n "__fish_seen_subcommand_from perf" -l color -d 'whether to use color in cargo and rustc output' -r -f -a "{always '',never '',auto ''}" -complete -c x.py -n "__fish_seen_subcommand_from perf" -l llvm-skip-rebuild -d 'whether rebuilding llvm should be skipped, overriding `skip-rebuld` in config.toml' -r -f -a "{true '',false ''}" -complete -c x.py -n "__fish_seen_subcommand_from perf" -l rust-profile-generate -d 'generate PGO profile with rustc build' -r -F -complete -c x.py -n "__fish_seen_subcommand_from perf" -l rust-profile-use -d 'use PGO profile for rustc build' -r -F -complete -c x.py -n "__fish_seen_subcommand_from perf" -l llvm-profile-use -d 'use PGO profile for LLVM build' -r -F -complete -c x.py -n "__fish_seen_subcommand_from perf" -l reproducible-artifact -d 'Additional reproducible artifacts that should be added to the reproducible artifacts archive' -r -complete -c x.py -n "__fish_seen_subcommand_from perf" -l set -d 'override options in config.toml' -r -f -complete -c x.py -n "__fish_seen_subcommand_from perf" -s v -l verbose -d 'use verbose output (-vv for very verbose)' -complete -c x.py -n "__fish_seen_subcommand_from perf" -s i -l incremental -d 'use incremental compilation' -complete -c x.py -n "__fish_seen_subcommand_from perf" -l include-default-paths -d 'include default paths in addition to the provided ones' -complete -c x.py -n "__fish_seen_subcommand_from perf" -l dry-run -d 'dry run; don\'t build anything' -complete -c x.py -n "__fish_seen_subcommand_from perf" -l dump-bootstrap-shims -d 'Indicates whether to dump the work done from bootstrap shims' -complete -c x.py -n "__fish_seen_subcommand_from perf" -l json-output -d 'use message-format=json' -complete -c x.py -n "__fish_seen_subcommand_from perf" -l bypass-bootstrap-lock -d 'Bootstrap uses this value to decide whether it should bypass locking the build process. This is rarely needed (e.g., compiling the std library for different targets in parallel)' -complete -c x.py -n "__fish_seen_subcommand_from perf" -l llvm-profile-generate -d 'generate PGO profile with llvm built for rustc' -complete -c x.py -n "__fish_seen_subcommand_from perf" -l enable-bolt-settings -d 'Enable BOLT link flags' -complete -c x.py -n "__fish_seen_subcommand_from perf" -l skip-stage0-validation -d 'Skip stage0 compiler validation' -complete -c x.py -n "__fish_seen_subcommand_from perf" -s h -l help -d 'Print help (see more with \'--help\')' +# Print an optspec for argparse to handle cmd's options that are independent of any subcommand. +function __fish_x.py_global_optspecs + string join \n v/verbose i/incremental config= build-dir= build= host= target= exclude= skip= include-default-paths rustc-error-format= on-fail= dry-run dump-bootstrap-shims stage= keep-stage= keep-stage-std= src= j/jobs= warnings= error-format= json-output color= bypass-bootstrap-lock llvm-skip-rebuild= rust-profile-generate= rust-profile-use= llvm-profile-use= llvm-profile-generate enable-bolt-settings skip-stage0-validation reproducible-artifact= set= h/help +end + +function __fish_x.py_needs_command + # Figure out if the current invocation already has a command. + set -l cmd (commandline -opc) + set -e cmd[1] + argparse -s (__fish_x.py_global_optspecs) -- $cmd 2>/dev/null + or return + if set -q argv[1] + # Also print the command, so this can be used to figure out what it is. + echo $argv[1] + return 1 + end + return 0 +end + +function __fish_x.py_using_subcommand + set -l cmd (__fish_x.py_needs_command) + test -z "$cmd" + and return 1 + contains -- $cmd[1] $argv +end + +complete -c x.py -n "__fish_x.py_needs_command" -l config -d 'TOML configuration file for build' -r -F +complete -c x.py -n "__fish_x.py_needs_command" -l build-dir -d 'Build directory, overrides `build.build-dir` in `config.toml`' -r -f -a "(__fish_complete_directories)" +complete -c x.py -n "__fish_x.py_needs_command" -l build -d 'build target of the stage0 compiler' -r -f +complete -c x.py -n "__fish_x.py_needs_command" -l host -d 'host targets to build' -r -f +complete -c x.py -n "__fish_x.py_needs_command" -l target -d 'target targets to build' -r -f +complete -c x.py -n "__fish_x.py_needs_command" -l exclude -d 'build paths to exclude' -r -F +complete -c x.py -n "__fish_x.py_needs_command" -l skip -d 'build paths to skip' -r -F +complete -c x.py -n "__fish_x.py_needs_command" -l rustc-error-format -r -f +complete -c x.py -n "__fish_x.py_needs_command" -l on-fail -d 'command to run on failure' -r -f -a "(__fish_complete_command)" +complete -c x.py -n "__fish_x.py_needs_command" -l stage -d 'stage to build (indicates compiler to use/test, e.g., stage 0 uses the bootstrap compiler, stage 1 the stage 0 rustc artifacts, etc.)' -r -f +complete -c x.py -n "__fish_x.py_needs_command" -l keep-stage -d 'stage(s) to keep without recompiling (pass multiple times to keep e.g., both stages 0 and 1)' -r -f +complete -c x.py -n "__fish_x.py_needs_command" -l keep-stage-std -d 'stage(s) of the standard library to keep without recompiling (pass multiple times to keep e.g., both stages 0 and 1)' -r -f +complete -c x.py -n "__fish_x.py_needs_command" -l src -d 'path to the root of the rust checkout' -r -f -a "(__fish_complete_directories)" +complete -c x.py -n "__fish_x.py_needs_command" -s j -l jobs -d 'number of jobs to run in parallel' -r -f +complete -c x.py -n "__fish_x.py_needs_command" -l warnings -d 'if value is deny, will deny warnings if value is warn, will emit warnings otherwise, use the default configured behaviour' -r -f -a "{deny\t'',warn\t'',default\t''}" +complete -c x.py -n "__fish_x.py_needs_command" -l error-format -d 'rustc error format' -r -f +complete -c x.py -n "__fish_x.py_needs_command" -l color -d 'whether to use color in cargo and rustc output' -r -f -a "{always\t'',never\t'',auto\t''}" +complete -c x.py -n "__fish_x.py_needs_command" -l llvm-skip-rebuild -d 'whether rebuilding llvm should be skipped, overriding `skip-rebuld` in config.toml' -r -f -a "{true\t'',false\t''}" +complete -c x.py -n "__fish_x.py_needs_command" -l rust-profile-generate -d 'generate PGO profile with rustc build' -r -F +complete -c x.py -n "__fish_x.py_needs_command" -l rust-profile-use -d 'use PGO profile for rustc build' -r -F +complete -c x.py -n "__fish_x.py_needs_command" -l llvm-profile-use -d 'use PGO profile for LLVM build' -r -F +complete -c x.py -n "__fish_x.py_needs_command" -l reproducible-artifact -d 'Additional reproducible artifacts that should be added to the reproducible artifacts archive' -r +complete -c x.py -n "__fish_x.py_needs_command" -l set -d 'override options in config.toml' -r -f +complete -c x.py -n "__fish_x.py_needs_command" -s v -l verbose -d 'use verbose output (-vv for very verbose)' +complete -c x.py -n "__fish_x.py_needs_command" -s i -l incremental -d 'use incremental compilation' +complete -c x.py -n "__fish_x.py_needs_command" -l include-default-paths -d 'include default paths in addition to the provided ones' +complete -c x.py -n "__fish_x.py_needs_command" -l dry-run -d 'dry run; don\'t build anything' +complete -c x.py -n "__fish_x.py_needs_command" -l dump-bootstrap-shims -d 'Indicates whether to dump the work done from bootstrap shims' +complete -c x.py -n "__fish_x.py_needs_command" -l json-output -d 'use message-format=json' +complete -c x.py -n "__fish_x.py_needs_command" -l bypass-bootstrap-lock -d 'Bootstrap uses this value to decide whether it should bypass locking the build process. This is rarely needed (e.g., compiling the std library for different targets in parallel)' +complete -c x.py -n "__fish_x.py_needs_command" -l llvm-profile-generate -d 'generate PGO profile with llvm built for rustc' +complete -c x.py -n "__fish_x.py_needs_command" -l enable-bolt-settings -d 'Enable BOLT link flags' +complete -c x.py -n "__fish_x.py_needs_command" -l skip-stage0-validation -d 'Skip stage0 compiler validation' +complete -c x.py -n "__fish_x.py_needs_command" -s h -l help -d 'Print help (see more with \'--help\')' +complete -c x.py -n "__fish_x.py_needs_command" -a "build" -d 'Compile either the compiler or libraries' +complete -c x.py -n "__fish_x.py_needs_command" -a "check" -d 'Compile either the compiler or libraries, using cargo check' +complete -c x.py -n "__fish_x.py_needs_command" -a "clippy" -d 'Run Clippy (uses rustup/cargo-installed clippy binary)' +complete -c x.py -n "__fish_x.py_needs_command" -a "fix" -d 'Run cargo fix' +complete -c x.py -n "__fish_x.py_needs_command" -a "fmt" -d 'Run rustfmt' +complete -c x.py -n "__fish_x.py_needs_command" -a "doc" -d 'Build documentation' +complete -c x.py -n "__fish_x.py_needs_command" -a "test" -d 'Build and run some test suites' +complete -c x.py -n "__fish_x.py_needs_command" -a "miri" -d 'Build and run some test suites *in Miri*' +complete -c x.py -n "__fish_x.py_needs_command" -a "bench" -d 'Build and run some benchmarks' +complete -c x.py -n "__fish_x.py_needs_command" -a "clean" -d 'Clean out build directories' +complete -c x.py -n "__fish_x.py_needs_command" -a "dist" -d 'Build distribution artifacts' +complete -c x.py -n "__fish_x.py_needs_command" -a "install" -d 'Install distribution artifacts' +complete -c x.py -n "__fish_x.py_needs_command" -a "run" -d 'Run tools contained in this repository' +complete -c x.py -n "__fish_x.py_needs_command" -a "setup" -d 'Set up the environment for development' +complete -c x.py -n "__fish_x.py_needs_command" -a "suggest" -d 'Suggest a subset of tests to run, based on modified files' +complete -c x.py -n "__fish_x.py_needs_command" -a "vendor" -d 'Vendor dependencies' +complete -c x.py -n "__fish_x.py_needs_command" -a "perf" -d 'Perform profiling and benchmarking of the compiler using the `rustc-perf-wrapper` tool' +complete -c x.py -n "__fish_x.py_using_subcommand build" -l config -d 'TOML configuration file for build' -r -F +complete -c x.py -n "__fish_x.py_using_subcommand build" -l build-dir -d 'Build directory, overrides `build.build-dir` in `config.toml`' -r -f -a "(__fish_complete_directories)" +complete -c x.py -n "__fish_x.py_using_subcommand build" -l build -d 'build target of the stage0 compiler' -r -f +complete -c x.py -n "__fish_x.py_using_subcommand build" -l host -d 'host targets to build' -r -f +complete -c x.py -n "__fish_x.py_using_subcommand build" -l target -d 'target targets to build' -r -f +complete -c x.py -n "__fish_x.py_using_subcommand build" -l exclude -d 'build paths to exclude' -r -F +complete -c x.py -n "__fish_x.py_using_subcommand build" -l skip -d 'build paths to skip' -r -F +complete -c x.py -n "__fish_x.py_using_subcommand build" -l rustc-error-format -r -f +complete -c x.py -n "__fish_x.py_using_subcommand build" -l on-fail -d 'command to run on failure' -r -f -a "(__fish_complete_command)" +complete -c x.py -n "__fish_x.py_using_subcommand build" -l stage -d 'stage to build (indicates compiler to use/test, e.g., stage 0 uses the bootstrap compiler, stage 1 the stage 0 rustc artifacts, etc.)' -r -f +complete -c x.py -n "__fish_x.py_using_subcommand build" -l keep-stage -d 'stage(s) to keep without recompiling (pass multiple times to keep e.g., both stages 0 and 1)' -r -f +complete -c x.py -n "__fish_x.py_using_subcommand build" -l keep-stage-std -d 'stage(s) of the standard library to keep without recompiling (pass multiple times to keep e.g., both stages 0 and 1)' -r -f +complete -c x.py -n "__fish_x.py_using_subcommand build" -l src -d 'path to the root of the rust checkout' -r -f -a "(__fish_complete_directories)" +complete -c x.py -n "__fish_x.py_using_subcommand build" -s j -l jobs -d 'number of jobs to run in parallel' -r -f +complete -c x.py -n "__fish_x.py_using_subcommand build" -l warnings -d 'if value is deny, will deny warnings if value is warn, will emit warnings otherwise, use the default configured behaviour' -r -f -a "{deny\t'',warn\t'',default\t''}" +complete -c x.py -n "__fish_x.py_using_subcommand build" -l error-format -d 'rustc error format' -r -f +complete -c x.py -n "__fish_x.py_using_subcommand build" -l color -d 'whether to use color in cargo and rustc output' -r -f -a "{always\t'',never\t'',auto\t''}" +complete -c x.py -n "__fish_x.py_using_subcommand build" -l llvm-skip-rebuild -d 'whether rebuilding llvm should be skipped, overriding `skip-rebuld` in config.toml' -r -f -a "{true\t'',false\t''}" +complete -c x.py -n "__fish_x.py_using_subcommand build" -l rust-profile-generate -d 'generate PGO profile with rustc build' -r -F +complete -c x.py -n "__fish_x.py_using_subcommand build" -l rust-profile-use -d 'use PGO profile for rustc build' -r -F +complete -c x.py -n "__fish_x.py_using_subcommand build" -l llvm-profile-use -d 'use PGO profile for LLVM build' -r -F +complete -c x.py -n "__fish_x.py_using_subcommand build" -l reproducible-artifact -d 'Additional reproducible artifacts that should be added to the reproducible artifacts archive' -r +complete -c x.py -n "__fish_x.py_using_subcommand build" -l set -d 'override options in config.toml' -r -f +complete -c x.py -n "__fish_x.py_using_subcommand build" -s v -l verbose -d 'use verbose output (-vv for very verbose)' +complete -c x.py -n "__fish_x.py_using_subcommand build" -s i -l incremental -d 'use incremental compilation' +complete -c x.py -n "__fish_x.py_using_subcommand build" -l include-default-paths -d 'include default paths in addition to the provided ones' +complete -c x.py -n "__fish_x.py_using_subcommand build" -l dry-run -d 'dry run; don\'t build anything' +complete -c x.py -n "__fish_x.py_using_subcommand build" -l dump-bootstrap-shims -d 'Indicates whether to dump the work done from bootstrap shims' +complete -c x.py -n "__fish_x.py_using_subcommand build" -l json-output -d 'use message-format=json' +complete -c x.py -n "__fish_x.py_using_subcommand build" -l bypass-bootstrap-lock -d 'Bootstrap uses this value to decide whether it should bypass locking the build process. This is rarely needed (e.g., compiling the std library for different targets in parallel)' +complete -c x.py -n "__fish_x.py_using_subcommand build" -l llvm-profile-generate -d 'generate PGO profile with llvm built for rustc' +complete -c x.py -n "__fish_x.py_using_subcommand build" -l enable-bolt-settings -d 'Enable BOLT link flags' +complete -c x.py -n "__fish_x.py_using_subcommand build" -l skip-stage0-validation -d 'Skip stage0 compiler validation' +complete -c x.py -n "__fish_x.py_using_subcommand build" -s h -l help -d 'Print help (see more with \'--help\')' +complete -c x.py -n "__fish_x.py_using_subcommand check" -l config -d 'TOML configuration file for build' -r -F +complete -c x.py -n "__fish_x.py_using_subcommand check" -l build-dir -d 'Build directory, overrides `build.build-dir` in `config.toml`' -r -f -a "(__fish_complete_directories)" +complete -c x.py -n "__fish_x.py_using_subcommand check" -l build -d 'build target of the stage0 compiler' -r -f +complete -c x.py -n "__fish_x.py_using_subcommand check" -l host -d 'host targets to build' -r -f +complete -c x.py -n "__fish_x.py_using_subcommand check" -l target -d 'target targets to build' -r -f +complete -c x.py -n "__fish_x.py_using_subcommand check" -l exclude -d 'build paths to exclude' -r -F +complete -c x.py -n "__fish_x.py_using_subcommand check" -l skip -d 'build paths to skip' -r -F +complete -c x.py -n "__fish_x.py_using_subcommand check" -l rustc-error-format -r -f +complete -c x.py -n "__fish_x.py_using_subcommand check" -l on-fail -d 'command to run on failure' -r -f -a "(__fish_complete_command)" +complete -c x.py -n "__fish_x.py_using_subcommand check" -l stage -d 'stage to build (indicates compiler to use/test, e.g., stage 0 uses the bootstrap compiler, stage 1 the stage 0 rustc artifacts, etc.)' -r -f +complete -c x.py -n "__fish_x.py_using_subcommand check" -l keep-stage -d 'stage(s) to keep without recompiling (pass multiple times to keep e.g., both stages 0 and 1)' -r -f +complete -c x.py -n "__fish_x.py_using_subcommand check" -l keep-stage-std -d 'stage(s) of the standard library to keep without recompiling (pass multiple times to keep e.g., both stages 0 and 1)' -r -f +complete -c x.py -n "__fish_x.py_using_subcommand check" -l src -d 'path to the root of the rust checkout' -r -f -a "(__fish_complete_directories)" +complete -c x.py -n "__fish_x.py_using_subcommand check" -s j -l jobs -d 'number of jobs to run in parallel' -r -f +complete -c x.py -n "__fish_x.py_using_subcommand check" -l warnings -d 'if value is deny, will deny warnings if value is warn, will emit warnings otherwise, use the default configured behaviour' -r -f -a "{deny\t'',warn\t'',default\t''}" +complete -c x.py -n "__fish_x.py_using_subcommand check" -l error-format -d 'rustc error format' -r -f +complete -c x.py -n "__fish_x.py_using_subcommand check" -l color -d 'whether to use color in cargo and rustc output' -r -f -a "{always\t'',never\t'',auto\t''}" +complete -c x.py -n "__fish_x.py_using_subcommand check" -l llvm-skip-rebuild -d 'whether rebuilding llvm should be skipped, overriding `skip-rebuld` in config.toml' -r -f -a "{true\t'',false\t''}" +complete -c x.py -n "__fish_x.py_using_subcommand check" -l rust-profile-generate -d 'generate PGO profile with rustc build' -r -F +complete -c x.py -n "__fish_x.py_using_subcommand check" -l rust-profile-use -d 'use PGO profile for rustc build' -r -F +complete -c x.py -n "__fish_x.py_using_subcommand check" -l llvm-profile-use -d 'use PGO profile for LLVM build' -r -F +complete -c x.py -n "__fish_x.py_using_subcommand check" -l reproducible-artifact -d 'Additional reproducible artifacts that should be added to the reproducible artifacts archive' -r +complete -c x.py -n "__fish_x.py_using_subcommand check" -l set -d 'override options in config.toml' -r -f +complete -c x.py -n "__fish_x.py_using_subcommand check" -l all-targets -d 'Check all targets' +complete -c x.py -n "__fish_x.py_using_subcommand check" -s v -l verbose -d 'use verbose output (-vv for very verbose)' +complete -c x.py -n "__fish_x.py_using_subcommand check" -s i -l incremental -d 'use incremental compilation' +complete -c x.py -n "__fish_x.py_using_subcommand check" -l include-default-paths -d 'include default paths in addition to the provided ones' +complete -c x.py -n "__fish_x.py_using_subcommand check" -l dry-run -d 'dry run; don\'t build anything' +complete -c x.py -n "__fish_x.py_using_subcommand check" -l dump-bootstrap-shims -d 'Indicates whether to dump the work done from bootstrap shims' +complete -c x.py -n "__fish_x.py_using_subcommand check" -l json-output -d 'use message-format=json' +complete -c x.py -n "__fish_x.py_using_subcommand check" -l bypass-bootstrap-lock -d 'Bootstrap uses this value to decide whether it should bypass locking the build process. This is rarely needed (e.g., compiling the std library for different targets in parallel)' +complete -c x.py -n "__fish_x.py_using_subcommand check" -l llvm-profile-generate -d 'generate PGO profile with llvm built for rustc' +complete -c x.py -n "__fish_x.py_using_subcommand check" -l enable-bolt-settings -d 'Enable BOLT link flags' +complete -c x.py -n "__fish_x.py_using_subcommand check" -l skip-stage0-validation -d 'Skip stage0 compiler validation' +complete -c x.py -n "__fish_x.py_using_subcommand check" -s h -l help -d 'Print help (see more with \'--help\')' +complete -c x.py -n "__fish_x.py_using_subcommand clippy" -s A -d 'clippy lints to allow' -r +complete -c x.py -n "__fish_x.py_using_subcommand clippy" -s D -d 'clippy lints to deny' -r +complete -c x.py -n "__fish_x.py_using_subcommand clippy" -s W -d 'clippy lints to warn on' -r +complete -c x.py -n "__fish_x.py_using_subcommand clippy" -s F -d 'clippy lints to forbid' -r +complete -c x.py -n "__fish_x.py_using_subcommand clippy" -l config -d 'TOML configuration file for build' -r -F +complete -c x.py -n "__fish_x.py_using_subcommand clippy" -l build-dir -d 'Build directory, overrides `build.build-dir` in `config.toml`' -r -f -a "(__fish_complete_directories)" +complete -c x.py -n "__fish_x.py_using_subcommand clippy" -l build -d 'build target of the stage0 compiler' -r -f +complete -c x.py -n "__fish_x.py_using_subcommand clippy" -l host -d 'host targets to build' -r -f +complete -c x.py -n "__fish_x.py_using_subcommand clippy" -l target -d 'target targets to build' -r -f +complete -c x.py -n "__fish_x.py_using_subcommand clippy" -l exclude -d 'build paths to exclude' -r -F +complete -c x.py -n "__fish_x.py_using_subcommand clippy" -l skip -d 'build paths to skip' -r -F +complete -c x.py -n "__fish_x.py_using_subcommand clippy" -l rustc-error-format -r -f +complete -c x.py -n "__fish_x.py_using_subcommand clippy" -l on-fail -d 'command to run on failure' -r -f -a "(__fish_complete_command)" +complete -c x.py -n "__fish_x.py_using_subcommand clippy" -l stage -d 'stage to build (indicates compiler to use/test, e.g., stage 0 uses the bootstrap compiler, stage 1 the stage 0 rustc artifacts, etc.)' -r -f +complete -c x.py -n "__fish_x.py_using_subcommand clippy" -l keep-stage -d 'stage(s) to keep without recompiling (pass multiple times to keep e.g., both stages 0 and 1)' -r -f +complete -c x.py -n "__fish_x.py_using_subcommand clippy" -l keep-stage-std -d 'stage(s) of the standard library to keep without recompiling (pass multiple times to keep e.g., both stages 0 and 1)' -r -f +complete -c x.py -n "__fish_x.py_using_subcommand clippy" -l src -d 'path to the root of the rust checkout' -r -f -a "(__fish_complete_directories)" +complete -c x.py -n "__fish_x.py_using_subcommand clippy" -s j -l jobs -d 'number of jobs to run in parallel' -r -f +complete -c x.py -n "__fish_x.py_using_subcommand clippy" -l warnings -d 'if value is deny, will deny warnings if value is warn, will emit warnings otherwise, use the default configured behaviour' -r -f -a "{deny\t'',warn\t'',default\t''}" +complete -c x.py -n "__fish_x.py_using_subcommand clippy" -l error-format -d 'rustc error format' -r -f +complete -c x.py -n "__fish_x.py_using_subcommand clippy" -l color -d 'whether to use color in cargo and rustc output' -r -f -a "{always\t'',never\t'',auto\t''}" +complete -c x.py -n "__fish_x.py_using_subcommand clippy" -l llvm-skip-rebuild -d 'whether rebuilding llvm should be skipped, overriding `skip-rebuld` in config.toml' -r -f -a "{true\t'',false\t''}" +complete -c x.py -n "__fish_x.py_using_subcommand clippy" -l rust-profile-generate -d 'generate PGO profile with rustc build' -r -F +complete -c x.py -n "__fish_x.py_using_subcommand clippy" -l rust-profile-use -d 'use PGO profile for rustc build' -r -F +complete -c x.py -n "__fish_x.py_using_subcommand clippy" -l llvm-profile-use -d 'use PGO profile for LLVM build' -r -F +complete -c x.py -n "__fish_x.py_using_subcommand clippy" -l reproducible-artifact -d 'Additional reproducible artifacts that should be added to the reproducible artifacts archive' -r +complete -c x.py -n "__fish_x.py_using_subcommand clippy" -l set -d 'override options in config.toml' -r -f +complete -c x.py -n "__fish_x.py_using_subcommand clippy" -l fix +complete -c x.py -n "__fish_x.py_using_subcommand clippy" -l allow-dirty +complete -c x.py -n "__fish_x.py_using_subcommand clippy" -l allow-staged +complete -c x.py -n "__fish_x.py_using_subcommand clippy" -s v -l verbose -d 'use verbose output (-vv for very verbose)' +complete -c x.py -n "__fish_x.py_using_subcommand clippy" -s i -l incremental -d 'use incremental compilation' +complete -c x.py -n "__fish_x.py_using_subcommand clippy" -l include-default-paths -d 'include default paths in addition to the provided ones' +complete -c x.py -n "__fish_x.py_using_subcommand clippy" -l dry-run -d 'dry run; don\'t build anything' +complete -c x.py -n "__fish_x.py_using_subcommand clippy" -l dump-bootstrap-shims -d 'Indicates whether to dump the work done from bootstrap shims' +complete -c x.py -n "__fish_x.py_using_subcommand clippy" -l json-output -d 'use message-format=json' +complete -c x.py -n "__fish_x.py_using_subcommand clippy" -l bypass-bootstrap-lock -d 'Bootstrap uses this value to decide whether it should bypass locking the build process. This is rarely needed (e.g., compiling the std library for different targets in parallel)' +complete -c x.py -n "__fish_x.py_using_subcommand clippy" -l llvm-profile-generate -d 'generate PGO profile with llvm built for rustc' +complete -c x.py -n "__fish_x.py_using_subcommand clippy" -l enable-bolt-settings -d 'Enable BOLT link flags' +complete -c x.py -n "__fish_x.py_using_subcommand clippy" -l skip-stage0-validation -d 'Skip stage0 compiler validation' +complete -c x.py -n "__fish_x.py_using_subcommand clippy" -s h -l help -d 'Print help (see more with \'--help\')' +complete -c x.py -n "__fish_x.py_using_subcommand fix" -l config -d 'TOML configuration file for build' -r -F +complete -c x.py -n "__fish_x.py_using_subcommand fix" -l build-dir -d 'Build directory, overrides `build.build-dir` in `config.toml`' -r -f -a "(__fish_complete_directories)" +complete -c x.py -n "__fish_x.py_using_subcommand fix" -l build -d 'build target of the stage0 compiler' -r -f +complete -c x.py -n "__fish_x.py_using_subcommand fix" -l host -d 'host targets to build' -r -f +complete -c x.py -n "__fish_x.py_using_subcommand fix" -l target -d 'target targets to build' -r -f +complete -c x.py -n "__fish_x.py_using_subcommand fix" -l exclude -d 'build paths to exclude' -r -F +complete -c x.py -n "__fish_x.py_using_subcommand fix" -l skip -d 'build paths to skip' -r -F +complete -c x.py -n "__fish_x.py_using_subcommand fix" -l rustc-error-format -r -f +complete -c x.py -n "__fish_x.py_using_subcommand fix" -l on-fail -d 'command to run on failure' -r -f -a "(__fish_complete_command)" +complete -c x.py -n "__fish_x.py_using_subcommand fix" -l stage -d 'stage to build (indicates compiler to use/test, e.g., stage 0 uses the bootstrap compiler, stage 1 the stage 0 rustc artifacts, etc.)' -r -f +complete -c x.py -n "__fish_x.py_using_subcommand fix" -l keep-stage -d 'stage(s) to keep without recompiling (pass multiple times to keep e.g., both stages 0 and 1)' -r -f +complete -c x.py -n "__fish_x.py_using_subcommand fix" -l keep-stage-std -d 'stage(s) of the standard library to keep without recompiling (pass multiple times to keep e.g., both stages 0 and 1)' -r -f +complete -c x.py -n "__fish_x.py_using_subcommand fix" -l src -d 'path to the root of the rust checkout' -r -f -a "(__fish_complete_directories)" +complete -c x.py -n "__fish_x.py_using_subcommand fix" -s j -l jobs -d 'number of jobs to run in parallel' -r -f +complete -c x.py -n "__fish_x.py_using_subcommand fix" -l warnings -d 'if value is deny, will deny warnings if value is warn, will emit warnings otherwise, use the default configured behaviour' -r -f -a "{deny\t'',warn\t'',default\t''}" +complete -c x.py -n "__fish_x.py_using_subcommand fix" -l error-format -d 'rustc error format' -r -f +complete -c x.py -n "__fish_x.py_using_subcommand fix" -l color -d 'whether to use color in cargo and rustc output' -r -f -a "{always\t'',never\t'',auto\t''}" +complete -c x.py -n "__fish_x.py_using_subcommand fix" -l llvm-skip-rebuild -d 'whether rebuilding llvm should be skipped, overriding `skip-rebuld` in config.toml' -r -f -a "{true\t'',false\t''}" +complete -c x.py -n "__fish_x.py_using_subcommand fix" -l rust-profile-generate -d 'generate PGO profile with rustc build' -r -F +complete -c x.py -n "__fish_x.py_using_subcommand fix" -l rust-profile-use -d 'use PGO profile for rustc build' -r -F +complete -c x.py -n "__fish_x.py_using_subcommand fix" -l llvm-profile-use -d 'use PGO profile for LLVM build' -r -F +complete -c x.py -n "__fish_x.py_using_subcommand fix" -l reproducible-artifact -d 'Additional reproducible artifacts that should be added to the reproducible artifacts archive' -r +complete -c x.py -n "__fish_x.py_using_subcommand fix" -l set -d 'override options in config.toml' -r -f +complete -c x.py -n "__fish_x.py_using_subcommand fix" -s v -l verbose -d 'use verbose output (-vv for very verbose)' +complete -c x.py -n "__fish_x.py_using_subcommand fix" -s i -l incremental -d 'use incremental compilation' +complete -c x.py -n "__fish_x.py_using_subcommand fix" -l include-default-paths -d 'include default paths in addition to the provided ones' +complete -c x.py -n "__fish_x.py_using_subcommand fix" -l dry-run -d 'dry run; don\'t build anything' +complete -c x.py -n "__fish_x.py_using_subcommand fix" -l dump-bootstrap-shims -d 'Indicates whether to dump the work done from bootstrap shims' +complete -c x.py -n "__fish_x.py_using_subcommand fix" -l json-output -d 'use message-format=json' +complete -c x.py -n "__fish_x.py_using_subcommand fix" -l bypass-bootstrap-lock -d 'Bootstrap uses this value to decide whether it should bypass locking the build process. This is rarely needed (e.g., compiling the std library for different targets in parallel)' +complete -c x.py -n "__fish_x.py_using_subcommand fix" -l llvm-profile-generate -d 'generate PGO profile with llvm built for rustc' +complete -c x.py -n "__fish_x.py_using_subcommand fix" -l enable-bolt-settings -d 'Enable BOLT link flags' +complete -c x.py -n "__fish_x.py_using_subcommand fix" -l skip-stage0-validation -d 'Skip stage0 compiler validation' +complete -c x.py -n "__fish_x.py_using_subcommand fix" -s h -l help -d 'Print help (see more with \'--help\')' +complete -c x.py -n "__fish_x.py_using_subcommand fmt" -l config -d 'TOML configuration file for build' -r -F +complete -c x.py -n "__fish_x.py_using_subcommand fmt" -l build-dir -d 'Build directory, overrides `build.build-dir` in `config.toml`' -r -f -a "(__fish_complete_directories)" +complete -c x.py -n "__fish_x.py_using_subcommand fmt" -l build -d 'build target of the stage0 compiler' -r -f +complete -c x.py -n "__fish_x.py_using_subcommand fmt" -l host -d 'host targets to build' -r -f +complete -c x.py -n "__fish_x.py_using_subcommand fmt" -l target -d 'target targets to build' -r -f +complete -c x.py -n "__fish_x.py_using_subcommand fmt" -l exclude -d 'build paths to exclude' -r -F +complete -c x.py -n "__fish_x.py_using_subcommand fmt" -l skip -d 'build paths to skip' -r -F +complete -c x.py -n "__fish_x.py_using_subcommand fmt" -l rustc-error-format -r -f +complete -c x.py -n "__fish_x.py_using_subcommand fmt" -l on-fail -d 'command to run on failure' -r -f -a "(__fish_complete_command)" +complete -c x.py -n "__fish_x.py_using_subcommand fmt" -l stage -d 'stage to build (indicates compiler to use/test, e.g., stage 0 uses the bootstrap compiler, stage 1 the stage 0 rustc artifacts, etc.)' -r -f +complete -c x.py -n "__fish_x.py_using_subcommand fmt" -l keep-stage -d 'stage(s) to keep without recompiling (pass multiple times to keep e.g., both stages 0 and 1)' -r -f +complete -c x.py -n "__fish_x.py_using_subcommand fmt" -l keep-stage-std -d 'stage(s) of the standard library to keep without recompiling (pass multiple times to keep e.g., both stages 0 and 1)' -r -f +complete -c x.py -n "__fish_x.py_using_subcommand fmt" -l src -d 'path to the root of the rust checkout' -r -f -a "(__fish_complete_directories)" +complete -c x.py -n "__fish_x.py_using_subcommand fmt" -s j -l jobs -d 'number of jobs to run in parallel' -r -f +complete -c x.py -n "__fish_x.py_using_subcommand fmt" -l warnings -d 'if value is deny, will deny warnings if value is warn, will emit warnings otherwise, use the default configured behaviour' -r -f -a "{deny\t'',warn\t'',default\t''}" +complete -c x.py -n "__fish_x.py_using_subcommand fmt" -l error-format -d 'rustc error format' -r -f +complete -c x.py -n "__fish_x.py_using_subcommand fmt" -l color -d 'whether to use color in cargo and rustc output' -r -f -a "{always\t'',never\t'',auto\t''}" +complete -c x.py -n "__fish_x.py_using_subcommand fmt" -l llvm-skip-rebuild -d 'whether rebuilding llvm should be skipped, overriding `skip-rebuld` in config.toml' -r -f -a "{true\t'',false\t''}" +complete -c x.py -n "__fish_x.py_using_subcommand fmt" -l rust-profile-generate -d 'generate PGO profile with rustc build' -r -F +complete -c x.py -n "__fish_x.py_using_subcommand fmt" -l rust-profile-use -d 'use PGO profile for rustc build' -r -F +complete -c x.py -n "__fish_x.py_using_subcommand fmt" -l llvm-profile-use -d 'use PGO profile for LLVM build' -r -F +complete -c x.py -n "__fish_x.py_using_subcommand fmt" -l reproducible-artifact -d 'Additional reproducible artifacts that should be added to the reproducible artifacts archive' -r +complete -c x.py -n "__fish_x.py_using_subcommand fmt" -l set -d 'override options in config.toml' -r -f +complete -c x.py -n "__fish_x.py_using_subcommand fmt" -l check -d 'check formatting instead of applying' +complete -c x.py -n "__fish_x.py_using_subcommand fmt" -l all -d 'apply to all appropriate files, not just those that have been modified' +complete -c x.py -n "__fish_x.py_using_subcommand fmt" -s v -l verbose -d 'use verbose output (-vv for very verbose)' +complete -c x.py -n "__fish_x.py_using_subcommand fmt" -s i -l incremental -d 'use incremental compilation' +complete -c x.py -n "__fish_x.py_using_subcommand fmt" -l include-default-paths -d 'include default paths in addition to the provided ones' +complete -c x.py -n "__fish_x.py_using_subcommand fmt" -l dry-run -d 'dry run; don\'t build anything' +complete -c x.py -n "__fish_x.py_using_subcommand fmt" -l dump-bootstrap-shims -d 'Indicates whether to dump the work done from bootstrap shims' +complete -c x.py -n "__fish_x.py_using_subcommand fmt" -l json-output -d 'use message-format=json' +complete -c x.py -n "__fish_x.py_using_subcommand fmt" -l bypass-bootstrap-lock -d 'Bootstrap uses this value to decide whether it should bypass locking the build process. This is rarely needed (e.g., compiling the std library for different targets in parallel)' +complete -c x.py -n "__fish_x.py_using_subcommand fmt" -l llvm-profile-generate -d 'generate PGO profile with llvm built for rustc' +complete -c x.py -n "__fish_x.py_using_subcommand fmt" -l enable-bolt-settings -d 'Enable BOLT link flags' +complete -c x.py -n "__fish_x.py_using_subcommand fmt" -l skip-stage0-validation -d 'Skip stage0 compiler validation' +complete -c x.py -n "__fish_x.py_using_subcommand fmt" -s h -l help -d 'Print help (see more with \'--help\')' +complete -c x.py -n "__fish_x.py_using_subcommand doc" -l config -d 'TOML configuration file for build' -r -F +complete -c x.py -n "__fish_x.py_using_subcommand doc" -l build-dir -d 'Build directory, overrides `build.build-dir` in `config.toml`' -r -f -a "(__fish_complete_directories)" +complete -c x.py -n "__fish_x.py_using_subcommand doc" -l build -d 'build target of the stage0 compiler' -r -f +complete -c x.py -n "__fish_x.py_using_subcommand doc" -l host -d 'host targets to build' -r -f +complete -c x.py -n "__fish_x.py_using_subcommand doc" -l target -d 'target targets to build' -r -f +complete -c x.py -n "__fish_x.py_using_subcommand doc" -l exclude -d 'build paths to exclude' -r -F +complete -c x.py -n "__fish_x.py_using_subcommand doc" -l skip -d 'build paths to skip' -r -F +complete -c x.py -n "__fish_x.py_using_subcommand doc" -l rustc-error-format -r -f +complete -c x.py -n "__fish_x.py_using_subcommand doc" -l on-fail -d 'command to run on failure' -r -f -a "(__fish_complete_command)" +complete -c x.py -n "__fish_x.py_using_subcommand doc" -l stage -d 'stage to build (indicates compiler to use/test, e.g., stage 0 uses the bootstrap compiler, stage 1 the stage 0 rustc artifacts, etc.)' -r -f +complete -c x.py -n "__fish_x.py_using_subcommand doc" -l keep-stage -d 'stage(s) to keep without recompiling (pass multiple times to keep e.g., both stages 0 and 1)' -r -f +complete -c x.py -n "__fish_x.py_using_subcommand doc" -l keep-stage-std -d 'stage(s) of the standard library to keep without recompiling (pass multiple times to keep e.g., both stages 0 and 1)' -r -f +complete -c x.py -n "__fish_x.py_using_subcommand doc" -l src -d 'path to the root of the rust checkout' -r -f -a "(__fish_complete_directories)" +complete -c x.py -n "__fish_x.py_using_subcommand doc" -s j -l jobs -d 'number of jobs to run in parallel' -r -f +complete -c x.py -n "__fish_x.py_using_subcommand doc" -l warnings -d 'if value is deny, will deny warnings if value is warn, will emit warnings otherwise, use the default configured behaviour' -r -f -a "{deny\t'',warn\t'',default\t''}" +complete -c x.py -n "__fish_x.py_using_subcommand doc" -l error-format -d 'rustc error format' -r -f +complete -c x.py -n "__fish_x.py_using_subcommand doc" -l color -d 'whether to use color in cargo and rustc output' -r -f -a "{always\t'',never\t'',auto\t''}" +complete -c x.py -n "__fish_x.py_using_subcommand doc" -l llvm-skip-rebuild -d 'whether rebuilding llvm should be skipped, overriding `skip-rebuld` in config.toml' -r -f -a "{true\t'',false\t''}" +complete -c x.py -n "__fish_x.py_using_subcommand doc" -l rust-profile-generate -d 'generate PGO profile with rustc build' -r -F +complete -c x.py -n "__fish_x.py_using_subcommand doc" -l rust-profile-use -d 'use PGO profile for rustc build' -r -F +complete -c x.py -n "__fish_x.py_using_subcommand doc" -l llvm-profile-use -d 'use PGO profile for LLVM build' -r -F +complete -c x.py -n "__fish_x.py_using_subcommand doc" -l reproducible-artifact -d 'Additional reproducible artifacts that should be added to the reproducible artifacts archive' -r +complete -c x.py -n "__fish_x.py_using_subcommand doc" -l set -d 'override options in config.toml' -r -f +complete -c x.py -n "__fish_x.py_using_subcommand doc" -l open -d 'open the docs in a browser' +complete -c x.py -n "__fish_x.py_using_subcommand doc" -l json -d 'render the documentation in JSON format in addition to the usual HTML format' +complete -c x.py -n "__fish_x.py_using_subcommand doc" -s v -l verbose -d 'use verbose output (-vv for very verbose)' +complete -c x.py -n "__fish_x.py_using_subcommand doc" -s i -l incremental -d 'use incremental compilation' +complete -c x.py -n "__fish_x.py_using_subcommand doc" -l include-default-paths -d 'include default paths in addition to the provided ones' +complete -c x.py -n "__fish_x.py_using_subcommand doc" -l dry-run -d 'dry run; don\'t build anything' +complete -c x.py -n "__fish_x.py_using_subcommand doc" -l dump-bootstrap-shims -d 'Indicates whether to dump the work done from bootstrap shims' +complete -c x.py -n "__fish_x.py_using_subcommand doc" -l json-output -d 'use message-format=json' +complete -c x.py -n "__fish_x.py_using_subcommand doc" -l bypass-bootstrap-lock -d 'Bootstrap uses this value to decide whether it should bypass locking the build process. This is rarely needed (e.g., compiling the std library for different targets in parallel)' +complete -c x.py -n "__fish_x.py_using_subcommand doc" -l llvm-profile-generate -d 'generate PGO profile with llvm built for rustc' +complete -c x.py -n "__fish_x.py_using_subcommand doc" -l enable-bolt-settings -d 'Enable BOLT link flags' +complete -c x.py -n "__fish_x.py_using_subcommand doc" -l skip-stage0-validation -d 'Skip stage0 compiler validation' +complete -c x.py -n "__fish_x.py_using_subcommand doc" -s h -l help -d 'Print help (see more with \'--help\')' +complete -c x.py -n "__fish_x.py_using_subcommand test" -l test-args -d 'extra arguments to be passed for the test tool being used (e.g. libtest, compiletest or rustdoc)' -r +complete -c x.py -n "__fish_x.py_using_subcommand test" -l compiletest-rustc-args -d 'extra options to pass the compiler when running compiletest tests' -r +complete -c x.py -n "__fish_x.py_using_subcommand test" -l extra-checks -d 'comma-separated list of other files types to check (accepts py, py:lint, py:fmt, shell)' -r +complete -c x.py -n "__fish_x.py_using_subcommand test" -l compare-mode -d 'mode describing what file the actual ui output will be compared to' -r +complete -c x.py -n "__fish_x.py_using_subcommand test" -l pass -d 'force {check,build,run}-pass tests to this mode' -r +complete -c x.py -n "__fish_x.py_using_subcommand test" -l run -d 'whether to execute run-* tests' -r +complete -c x.py -n "__fish_x.py_using_subcommand test" -l config -d 'TOML configuration file for build' -r -F +complete -c x.py -n "__fish_x.py_using_subcommand test" -l build-dir -d 'Build directory, overrides `build.build-dir` in `config.toml`' -r -f -a "(__fish_complete_directories)" +complete -c x.py -n "__fish_x.py_using_subcommand test" -l build -d 'build target of the stage0 compiler' -r -f +complete -c x.py -n "__fish_x.py_using_subcommand test" -l host -d 'host targets to build' -r -f +complete -c x.py -n "__fish_x.py_using_subcommand test" -l target -d 'target targets to build' -r -f +complete -c x.py -n "__fish_x.py_using_subcommand test" -l exclude -d 'build paths to exclude' -r -F +complete -c x.py -n "__fish_x.py_using_subcommand test" -l skip -d 'build paths to skip' -r -F +complete -c x.py -n "__fish_x.py_using_subcommand test" -l rustc-error-format -r -f +complete -c x.py -n "__fish_x.py_using_subcommand test" -l on-fail -d 'command to run on failure' -r -f -a "(__fish_complete_command)" +complete -c x.py -n "__fish_x.py_using_subcommand test" -l stage -d 'stage to build (indicates compiler to use/test, e.g., stage 0 uses the bootstrap compiler, stage 1 the stage 0 rustc artifacts, etc.)' -r -f +complete -c x.py -n "__fish_x.py_using_subcommand test" -l keep-stage -d 'stage(s) to keep without recompiling (pass multiple times to keep e.g., both stages 0 and 1)' -r -f +complete -c x.py -n "__fish_x.py_using_subcommand test" -l keep-stage-std -d 'stage(s) of the standard library to keep without recompiling (pass multiple times to keep e.g., both stages 0 and 1)' -r -f +complete -c x.py -n "__fish_x.py_using_subcommand test" -l src -d 'path to the root of the rust checkout' -r -f -a "(__fish_complete_directories)" +complete -c x.py -n "__fish_x.py_using_subcommand test" -s j -l jobs -d 'number of jobs to run in parallel' -r -f +complete -c x.py -n "__fish_x.py_using_subcommand test" -l warnings -d 'if value is deny, will deny warnings if value is warn, will emit warnings otherwise, use the default configured behaviour' -r -f -a "{deny\t'',warn\t'',default\t''}" +complete -c x.py -n "__fish_x.py_using_subcommand test" -l error-format -d 'rustc error format' -r -f +complete -c x.py -n "__fish_x.py_using_subcommand test" -l color -d 'whether to use color in cargo and rustc output' -r -f -a "{always\t'',never\t'',auto\t''}" +complete -c x.py -n "__fish_x.py_using_subcommand test" -l llvm-skip-rebuild -d 'whether rebuilding llvm should be skipped, overriding `skip-rebuld` in config.toml' -r -f -a "{true\t'',false\t''}" +complete -c x.py -n "__fish_x.py_using_subcommand test" -l rust-profile-generate -d 'generate PGO profile with rustc build' -r -F +complete -c x.py -n "__fish_x.py_using_subcommand test" -l rust-profile-use -d 'use PGO profile for rustc build' -r -F +complete -c x.py -n "__fish_x.py_using_subcommand test" -l llvm-profile-use -d 'use PGO profile for LLVM build' -r -F +complete -c x.py -n "__fish_x.py_using_subcommand test" -l reproducible-artifact -d 'Additional reproducible artifacts that should be added to the reproducible artifacts archive' -r +complete -c x.py -n "__fish_x.py_using_subcommand test" -l set -d 'override options in config.toml' -r -f +complete -c x.py -n "__fish_x.py_using_subcommand test" -l no-fail-fast -d 'run all tests regardless of failure' +complete -c x.py -n "__fish_x.py_using_subcommand test" -l no-doc -d 'do not run doc tests' +complete -c x.py -n "__fish_x.py_using_subcommand test" -l doc -d 'only run doc tests' +complete -c x.py -n "__fish_x.py_using_subcommand test" -l bless -d 'whether to automatically update stderr/stdout files' +complete -c x.py -n "__fish_x.py_using_subcommand test" -l force-rerun -d 'rerun tests even if the inputs are unchanged' +complete -c x.py -n "__fish_x.py_using_subcommand test" -l only-modified -d 'only run tests that result has been changed' +complete -c x.py -n "__fish_x.py_using_subcommand test" -l rustfix-coverage -d 'enable this to generate a Rustfix coverage file, which is saved in `/<build_base>/rustfix_missing_coverage.txt`' +complete -c x.py -n "__fish_x.py_using_subcommand test" -s v -l verbose -d 'use verbose output (-vv for very verbose)' +complete -c x.py -n "__fish_x.py_using_subcommand test" -s i -l incremental -d 'use incremental compilation' +complete -c x.py -n "__fish_x.py_using_subcommand test" -l include-default-paths -d 'include default paths in addition to the provided ones' +complete -c x.py -n "__fish_x.py_using_subcommand test" -l dry-run -d 'dry run; don\'t build anything' +complete -c x.py -n "__fish_x.py_using_subcommand test" -l dump-bootstrap-shims -d 'Indicates whether to dump the work done from bootstrap shims' +complete -c x.py -n "__fish_x.py_using_subcommand test" -l json-output -d 'use message-format=json' +complete -c x.py -n "__fish_x.py_using_subcommand test" -l bypass-bootstrap-lock -d 'Bootstrap uses this value to decide whether it should bypass locking the build process. This is rarely needed (e.g., compiling the std library for different targets in parallel)' +complete -c x.py -n "__fish_x.py_using_subcommand test" -l llvm-profile-generate -d 'generate PGO profile with llvm built for rustc' +complete -c x.py -n "__fish_x.py_using_subcommand test" -l enable-bolt-settings -d 'Enable BOLT link flags' +complete -c x.py -n "__fish_x.py_using_subcommand test" -l skip-stage0-validation -d 'Skip stage0 compiler validation' +complete -c x.py -n "__fish_x.py_using_subcommand test" -s h -l help -d 'Print help (see more with \'--help\')' +complete -c x.py -n "__fish_x.py_using_subcommand miri" -l test-args -d 'extra arguments to be passed for the test tool being used (e.g. libtest, compiletest or rustdoc)' -r +complete -c x.py -n "__fish_x.py_using_subcommand miri" -l config -d 'TOML configuration file for build' -r -F +complete -c x.py -n "__fish_x.py_using_subcommand miri" -l build-dir -d 'Build directory, overrides `build.build-dir` in `config.toml`' -r -f -a "(__fish_complete_directories)" +complete -c x.py -n "__fish_x.py_using_subcommand miri" -l build -d 'build target of the stage0 compiler' -r -f +complete -c x.py -n "__fish_x.py_using_subcommand miri" -l host -d 'host targets to build' -r -f +complete -c x.py -n "__fish_x.py_using_subcommand miri" -l target -d 'target targets to build' -r -f +complete -c x.py -n "__fish_x.py_using_subcommand miri" -l exclude -d 'build paths to exclude' -r -F +complete -c x.py -n "__fish_x.py_using_subcommand miri" -l skip -d 'build paths to skip' -r -F +complete -c x.py -n "__fish_x.py_using_subcommand miri" -l rustc-error-format -r -f +complete -c x.py -n "__fish_x.py_using_subcommand miri" -l on-fail -d 'command to run on failure' -r -f -a "(__fish_complete_command)" +complete -c x.py -n "__fish_x.py_using_subcommand miri" -l stage -d 'stage to build (indicates compiler to use/test, e.g., stage 0 uses the bootstrap compiler, stage 1 the stage 0 rustc artifacts, etc.)' -r -f +complete -c x.py -n "__fish_x.py_using_subcommand miri" -l keep-stage -d 'stage(s) to keep without recompiling (pass multiple times to keep e.g., both stages 0 and 1)' -r -f +complete -c x.py -n "__fish_x.py_using_subcommand miri" -l keep-stage-std -d 'stage(s) of the standard library to keep without recompiling (pass multiple times to keep e.g., both stages 0 and 1)' -r -f +complete -c x.py -n "__fish_x.py_using_subcommand miri" -l src -d 'path to the root of the rust checkout' -r -f -a "(__fish_complete_directories)" +complete -c x.py -n "__fish_x.py_using_subcommand miri" -s j -l jobs -d 'number of jobs to run in parallel' -r -f +complete -c x.py -n "__fish_x.py_using_subcommand miri" -l warnings -d 'if value is deny, will deny warnings if value is warn, will emit warnings otherwise, use the default configured behaviour' -r -f -a "{deny\t'',warn\t'',default\t''}" +complete -c x.py -n "__fish_x.py_using_subcommand miri" -l error-format -d 'rustc error format' -r -f +complete -c x.py -n "__fish_x.py_using_subcommand miri" -l color -d 'whether to use color in cargo and rustc output' -r -f -a "{always\t'',never\t'',auto\t''}" +complete -c x.py -n "__fish_x.py_using_subcommand miri" -l llvm-skip-rebuild -d 'whether rebuilding llvm should be skipped, overriding `skip-rebuld` in config.toml' -r -f -a "{true\t'',false\t''}" +complete -c x.py -n "__fish_x.py_using_subcommand miri" -l rust-profile-generate -d 'generate PGO profile with rustc build' -r -F +complete -c x.py -n "__fish_x.py_using_subcommand miri" -l rust-profile-use -d 'use PGO profile for rustc build' -r -F +complete -c x.py -n "__fish_x.py_using_subcommand miri" -l llvm-profile-use -d 'use PGO profile for LLVM build' -r -F +complete -c x.py -n "__fish_x.py_using_subcommand miri" -l reproducible-artifact -d 'Additional reproducible artifacts that should be added to the reproducible artifacts archive' -r +complete -c x.py -n "__fish_x.py_using_subcommand miri" -l set -d 'override options in config.toml' -r -f +complete -c x.py -n "__fish_x.py_using_subcommand miri" -l no-fail-fast -d 'run all tests regardless of failure' +complete -c x.py -n "__fish_x.py_using_subcommand miri" -l no-doc -d 'do not run doc tests' +complete -c x.py -n "__fish_x.py_using_subcommand miri" -l doc -d 'only run doc tests' +complete -c x.py -n "__fish_x.py_using_subcommand miri" -s v -l verbose -d 'use verbose output (-vv for very verbose)' +complete -c x.py -n "__fish_x.py_using_subcommand miri" -s i -l incremental -d 'use incremental compilation' +complete -c x.py -n "__fish_x.py_using_subcommand miri" -l include-default-paths -d 'include default paths in addition to the provided ones' +complete -c x.py -n "__fish_x.py_using_subcommand miri" -l dry-run -d 'dry run; don\'t build anything' +complete -c x.py -n "__fish_x.py_using_subcommand miri" -l dump-bootstrap-shims -d 'Indicates whether to dump the work done from bootstrap shims' +complete -c x.py -n "__fish_x.py_using_subcommand miri" -l json-output -d 'use message-format=json' +complete -c x.py -n "__fish_x.py_using_subcommand miri" -l bypass-bootstrap-lock -d 'Bootstrap uses this value to decide whether it should bypass locking the build process. This is rarely needed (e.g., compiling the std library for different targets in parallel)' +complete -c x.py -n "__fish_x.py_using_subcommand miri" -l llvm-profile-generate -d 'generate PGO profile with llvm built for rustc' +complete -c x.py -n "__fish_x.py_using_subcommand miri" -l enable-bolt-settings -d 'Enable BOLT link flags' +complete -c x.py -n "__fish_x.py_using_subcommand miri" -l skip-stage0-validation -d 'Skip stage0 compiler validation' +complete -c x.py -n "__fish_x.py_using_subcommand miri" -s h -l help -d 'Print help (see more with \'--help\')' +complete -c x.py -n "__fish_x.py_using_subcommand bench" -l test-args -r +complete -c x.py -n "__fish_x.py_using_subcommand bench" -l config -d 'TOML configuration file for build' -r -F +complete -c x.py -n "__fish_x.py_using_subcommand bench" -l build-dir -d 'Build directory, overrides `build.build-dir` in `config.toml`' -r -f -a "(__fish_complete_directories)" +complete -c x.py -n "__fish_x.py_using_subcommand bench" -l build -d 'build target of the stage0 compiler' -r -f +complete -c x.py -n "__fish_x.py_using_subcommand bench" -l host -d 'host targets to build' -r -f +complete -c x.py -n "__fish_x.py_using_subcommand bench" -l target -d 'target targets to build' -r -f +complete -c x.py -n "__fish_x.py_using_subcommand bench" -l exclude -d 'build paths to exclude' -r -F +complete -c x.py -n "__fish_x.py_using_subcommand bench" -l skip -d 'build paths to skip' -r -F +complete -c x.py -n "__fish_x.py_using_subcommand bench" -l rustc-error-format -r -f +complete -c x.py -n "__fish_x.py_using_subcommand bench" -l on-fail -d 'command to run on failure' -r -f -a "(__fish_complete_command)" +complete -c x.py -n "__fish_x.py_using_subcommand bench" -l stage -d 'stage to build (indicates compiler to use/test, e.g., stage 0 uses the bootstrap compiler, stage 1 the stage 0 rustc artifacts, etc.)' -r -f +complete -c x.py -n "__fish_x.py_using_subcommand bench" -l keep-stage -d 'stage(s) to keep without recompiling (pass multiple times to keep e.g., both stages 0 and 1)' -r -f +complete -c x.py -n "__fish_x.py_using_subcommand bench" -l keep-stage-std -d 'stage(s) of the standard library to keep without recompiling (pass multiple times to keep e.g., both stages 0 and 1)' -r -f +complete -c x.py -n "__fish_x.py_using_subcommand bench" -l src -d 'path to the root of the rust checkout' -r -f -a "(__fish_complete_directories)" +complete -c x.py -n "__fish_x.py_using_subcommand bench" -s j -l jobs -d 'number of jobs to run in parallel' -r -f +complete -c x.py -n "__fish_x.py_using_subcommand bench" -l warnings -d 'if value is deny, will deny warnings if value is warn, will emit warnings otherwise, use the default configured behaviour' -r -f -a "{deny\t'',warn\t'',default\t''}" +complete -c x.py -n "__fish_x.py_using_subcommand bench" -l error-format -d 'rustc error format' -r -f +complete -c x.py -n "__fish_x.py_using_subcommand bench" -l color -d 'whether to use color in cargo and rustc output' -r -f -a "{always\t'',never\t'',auto\t''}" +complete -c x.py -n "__fish_x.py_using_subcommand bench" -l llvm-skip-rebuild -d 'whether rebuilding llvm should be skipped, overriding `skip-rebuld` in config.toml' -r -f -a "{true\t'',false\t''}" +complete -c x.py -n "__fish_x.py_using_subcommand bench" -l rust-profile-generate -d 'generate PGO profile with rustc build' -r -F +complete -c x.py -n "__fish_x.py_using_subcommand bench" -l rust-profile-use -d 'use PGO profile for rustc build' -r -F +complete -c x.py -n "__fish_x.py_using_subcommand bench" -l llvm-profile-use -d 'use PGO profile for LLVM build' -r -F +complete -c x.py -n "__fish_x.py_using_subcommand bench" -l reproducible-artifact -d 'Additional reproducible artifacts that should be added to the reproducible artifacts archive' -r +complete -c x.py -n "__fish_x.py_using_subcommand bench" -l set -d 'override options in config.toml' -r -f +complete -c x.py -n "__fish_x.py_using_subcommand bench" -s v -l verbose -d 'use verbose output (-vv for very verbose)' +complete -c x.py -n "__fish_x.py_using_subcommand bench" -s i -l incremental -d 'use incremental compilation' +complete -c x.py -n "__fish_x.py_using_subcommand bench" -l include-default-paths -d 'include default paths in addition to the provided ones' +complete -c x.py -n "__fish_x.py_using_subcommand bench" -l dry-run -d 'dry run; don\'t build anything' +complete -c x.py -n "__fish_x.py_using_subcommand bench" -l dump-bootstrap-shims -d 'Indicates whether to dump the work done from bootstrap shims' +complete -c x.py -n "__fish_x.py_using_subcommand bench" -l json-output -d 'use message-format=json' +complete -c x.py -n "__fish_x.py_using_subcommand bench" -l bypass-bootstrap-lock -d 'Bootstrap uses this value to decide whether it should bypass locking the build process. This is rarely needed (e.g., compiling the std library for different targets in parallel)' +complete -c x.py -n "__fish_x.py_using_subcommand bench" -l llvm-profile-generate -d 'generate PGO profile with llvm built for rustc' +complete -c x.py -n "__fish_x.py_using_subcommand bench" -l enable-bolt-settings -d 'Enable BOLT link flags' +complete -c x.py -n "__fish_x.py_using_subcommand bench" -l skip-stage0-validation -d 'Skip stage0 compiler validation' +complete -c x.py -n "__fish_x.py_using_subcommand bench" -s h -l help -d 'Print help (see more with \'--help\')' +complete -c x.py -n "__fish_x.py_using_subcommand clean" -l stage -d 'Clean a specific stage without touching other artifacts. By default, every stage is cleaned if this option is not used' -r +complete -c x.py -n "__fish_x.py_using_subcommand clean" -l config -d 'TOML configuration file for build' -r -F +complete -c x.py -n "__fish_x.py_using_subcommand clean" -l build-dir -d 'Build directory, overrides `build.build-dir` in `config.toml`' -r -f -a "(__fish_complete_directories)" +complete -c x.py -n "__fish_x.py_using_subcommand clean" -l build -d 'build target of the stage0 compiler' -r -f +complete -c x.py -n "__fish_x.py_using_subcommand clean" -l host -d 'host targets to build' -r -f +complete -c x.py -n "__fish_x.py_using_subcommand clean" -l target -d 'target targets to build' -r -f +complete -c x.py -n "__fish_x.py_using_subcommand clean" -l exclude -d 'build paths to exclude' -r -F +complete -c x.py -n "__fish_x.py_using_subcommand clean" -l skip -d 'build paths to skip' -r -F +complete -c x.py -n "__fish_x.py_using_subcommand clean" -l rustc-error-format -r -f +complete -c x.py -n "__fish_x.py_using_subcommand clean" -l on-fail -d 'command to run on failure' -r -f -a "(__fish_complete_command)" +complete -c x.py -n "__fish_x.py_using_subcommand clean" -l keep-stage -d 'stage(s) to keep without recompiling (pass multiple times to keep e.g., both stages 0 and 1)' -r -f +complete -c x.py -n "__fish_x.py_using_subcommand clean" -l keep-stage-std -d 'stage(s) of the standard library to keep without recompiling (pass multiple times to keep e.g., both stages 0 and 1)' -r -f +complete -c x.py -n "__fish_x.py_using_subcommand clean" -l src -d 'path to the root of the rust checkout' -r -f -a "(__fish_complete_directories)" +complete -c x.py -n "__fish_x.py_using_subcommand clean" -s j -l jobs -d 'number of jobs to run in parallel' -r -f +complete -c x.py -n "__fish_x.py_using_subcommand clean" -l warnings -d 'if value is deny, will deny warnings if value is warn, will emit warnings otherwise, use the default configured behaviour' -r -f -a "{deny\t'',warn\t'',default\t''}" +complete -c x.py -n "__fish_x.py_using_subcommand clean" -l error-format -d 'rustc error format' -r -f +complete -c x.py -n "__fish_x.py_using_subcommand clean" -l color -d 'whether to use color in cargo and rustc output' -r -f -a "{always\t'',never\t'',auto\t''}" +complete -c x.py -n "__fish_x.py_using_subcommand clean" -l llvm-skip-rebuild -d 'whether rebuilding llvm should be skipped, overriding `skip-rebuld` in config.toml' -r -f -a "{true\t'',false\t''}" +complete -c x.py -n "__fish_x.py_using_subcommand clean" -l rust-profile-generate -d 'generate PGO profile with rustc build' -r -F +complete -c x.py -n "__fish_x.py_using_subcommand clean" -l rust-profile-use -d 'use PGO profile for rustc build' -r -F +complete -c x.py -n "__fish_x.py_using_subcommand clean" -l llvm-profile-use -d 'use PGO profile for LLVM build' -r -F +complete -c x.py -n "__fish_x.py_using_subcommand clean" -l reproducible-artifact -d 'Additional reproducible artifacts that should be added to the reproducible artifacts archive' -r +complete -c x.py -n "__fish_x.py_using_subcommand clean" -l set -d 'override options in config.toml' -r -f +complete -c x.py -n "__fish_x.py_using_subcommand clean" -l all -d 'Clean the entire build directory (not used by default)' +complete -c x.py -n "__fish_x.py_using_subcommand clean" -s v -l verbose -d 'use verbose output (-vv for very verbose)' +complete -c x.py -n "__fish_x.py_using_subcommand clean" -s i -l incremental -d 'use incremental compilation' +complete -c x.py -n "__fish_x.py_using_subcommand clean" -l include-default-paths -d 'include default paths in addition to the provided ones' +complete -c x.py -n "__fish_x.py_using_subcommand clean" -l dry-run -d 'dry run; don\'t build anything' +complete -c x.py -n "__fish_x.py_using_subcommand clean" -l dump-bootstrap-shims -d 'Indicates whether to dump the work done from bootstrap shims' +complete -c x.py -n "__fish_x.py_using_subcommand clean" -l json-output -d 'use message-format=json' +complete -c x.py -n "__fish_x.py_using_subcommand clean" -l bypass-bootstrap-lock -d 'Bootstrap uses this value to decide whether it should bypass locking the build process. This is rarely needed (e.g., compiling the std library for different targets in parallel)' +complete -c x.py -n "__fish_x.py_using_subcommand clean" -l llvm-profile-generate -d 'generate PGO profile with llvm built for rustc' +complete -c x.py -n "__fish_x.py_using_subcommand clean" -l enable-bolt-settings -d 'Enable BOLT link flags' +complete -c x.py -n "__fish_x.py_using_subcommand clean" -l skip-stage0-validation -d 'Skip stage0 compiler validation' +complete -c x.py -n "__fish_x.py_using_subcommand clean" -s h -l help -d 'Print help (see more with \'--help\')' +complete -c x.py -n "__fish_x.py_using_subcommand dist" -l config -d 'TOML configuration file for build' -r -F +complete -c x.py -n "__fish_x.py_using_subcommand dist" -l build-dir -d 'Build directory, overrides `build.build-dir` in `config.toml`' -r -f -a "(__fish_complete_directories)" +complete -c x.py -n "__fish_x.py_using_subcommand dist" -l build -d 'build target of the stage0 compiler' -r -f +complete -c x.py -n "__fish_x.py_using_subcommand dist" -l host -d 'host targets to build' -r -f +complete -c x.py -n "__fish_x.py_using_subcommand dist" -l target -d 'target targets to build' -r -f +complete -c x.py -n "__fish_x.py_using_subcommand dist" -l exclude -d 'build paths to exclude' -r -F +complete -c x.py -n "__fish_x.py_using_subcommand dist" -l skip -d 'build paths to skip' -r -F +complete -c x.py -n "__fish_x.py_using_subcommand dist" -l rustc-error-format -r -f +complete -c x.py -n "__fish_x.py_using_subcommand dist" -l on-fail -d 'command to run on failure' -r -f -a "(__fish_complete_command)" +complete -c x.py -n "__fish_x.py_using_subcommand dist" -l stage -d 'stage to build (indicates compiler to use/test, e.g., stage 0 uses the bootstrap compiler, stage 1 the stage 0 rustc artifacts, etc.)' -r -f +complete -c x.py -n "__fish_x.py_using_subcommand dist" -l keep-stage -d 'stage(s) to keep without recompiling (pass multiple times to keep e.g., both stages 0 and 1)' -r -f +complete -c x.py -n "__fish_x.py_using_subcommand dist" -l keep-stage-std -d 'stage(s) of the standard library to keep without recompiling (pass multiple times to keep e.g., both stages 0 and 1)' -r -f +complete -c x.py -n "__fish_x.py_using_subcommand dist" -l src -d 'path to the root of the rust checkout' -r -f -a "(__fish_complete_directories)" +complete -c x.py -n "__fish_x.py_using_subcommand dist" -s j -l jobs -d 'number of jobs to run in parallel' -r -f +complete -c x.py -n "__fish_x.py_using_subcommand dist" -l warnings -d 'if value is deny, will deny warnings if value is warn, will emit warnings otherwise, use the default configured behaviour' -r -f -a "{deny\t'',warn\t'',default\t''}" +complete -c x.py -n "__fish_x.py_using_subcommand dist" -l error-format -d 'rustc error format' -r -f +complete -c x.py -n "__fish_x.py_using_subcommand dist" -l color -d 'whether to use color in cargo and rustc output' -r -f -a "{always\t'',never\t'',auto\t''}" +complete -c x.py -n "__fish_x.py_using_subcommand dist" -l llvm-skip-rebuild -d 'whether rebuilding llvm should be skipped, overriding `skip-rebuld` in config.toml' -r -f -a "{true\t'',false\t''}" +complete -c x.py -n "__fish_x.py_using_subcommand dist" -l rust-profile-generate -d 'generate PGO profile with rustc build' -r -F +complete -c x.py -n "__fish_x.py_using_subcommand dist" -l rust-profile-use -d 'use PGO profile for rustc build' -r -F +complete -c x.py -n "__fish_x.py_using_subcommand dist" -l llvm-profile-use -d 'use PGO profile for LLVM build' -r -F +complete -c x.py -n "__fish_x.py_using_subcommand dist" -l reproducible-artifact -d 'Additional reproducible artifacts that should be added to the reproducible artifacts archive' -r +complete -c x.py -n "__fish_x.py_using_subcommand dist" -l set -d 'override options in config.toml' -r -f +complete -c x.py -n "__fish_x.py_using_subcommand dist" -s v -l verbose -d 'use verbose output (-vv for very verbose)' +complete -c x.py -n "__fish_x.py_using_subcommand dist" -s i -l incremental -d 'use incremental compilation' +complete -c x.py -n "__fish_x.py_using_subcommand dist" -l include-default-paths -d 'include default paths in addition to the provided ones' +complete -c x.py -n "__fish_x.py_using_subcommand dist" -l dry-run -d 'dry run; don\'t build anything' +complete -c x.py -n "__fish_x.py_using_subcommand dist" -l dump-bootstrap-shims -d 'Indicates whether to dump the work done from bootstrap shims' +complete -c x.py -n "__fish_x.py_using_subcommand dist" -l json-output -d 'use message-format=json' +complete -c x.py -n "__fish_x.py_using_subcommand dist" -l bypass-bootstrap-lock -d 'Bootstrap uses this value to decide whether it should bypass locking the build process. This is rarely needed (e.g., compiling the std library for different targets in parallel)' +complete -c x.py -n "__fish_x.py_using_subcommand dist" -l llvm-profile-generate -d 'generate PGO profile with llvm built for rustc' +complete -c x.py -n "__fish_x.py_using_subcommand dist" -l enable-bolt-settings -d 'Enable BOLT link flags' +complete -c x.py -n "__fish_x.py_using_subcommand dist" -l skip-stage0-validation -d 'Skip stage0 compiler validation' +complete -c x.py -n "__fish_x.py_using_subcommand dist" -s h -l help -d 'Print help (see more with \'--help\')' +complete -c x.py -n "__fish_x.py_using_subcommand install" -l config -d 'TOML configuration file for build' -r -F +complete -c x.py -n "__fish_x.py_using_subcommand install" -l build-dir -d 'Build directory, overrides `build.build-dir` in `config.toml`' -r -f -a "(__fish_complete_directories)" +complete -c x.py -n "__fish_x.py_using_subcommand install" -l build -d 'build target of the stage0 compiler' -r -f +complete -c x.py -n "__fish_x.py_using_subcommand install" -l host -d 'host targets to build' -r -f +complete -c x.py -n "__fish_x.py_using_subcommand install" -l target -d 'target targets to build' -r -f +complete -c x.py -n "__fish_x.py_using_subcommand install" -l exclude -d 'build paths to exclude' -r -F +complete -c x.py -n "__fish_x.py_using_subcommand install" -l skip -d 'build paths to skip' -r -F +complete -c x.py -n "__fish_x.py_using_subcommand install" -l rustc-error-format -r -f +complete -c x.py -n "__fish_x.py_using_subcommand install" -l on-fail -d 'command to run on failure' -r -f -a "(__fish_complete_command)" +complete -c x.py -n "__fish_x.py_using_subcommand install" -l stage -d 'stage to build (indicates compiler to use/test, e.g., stage 0 uses the bootstrap compiler, stage 1 the stage 0 rustc artifacts, etc.)' -r -f +complete -c x.py -n "__fish_x.py_using_subcommand install" -l keep-stage -d 'stage(s) to keep without recompiling (pass multiple times to keep e.g., both stages 0 and 1)' -r -f +complete -c x.py -n "__fish_x.py_using_subcommand install" -l keep-stage-std -d 'stage(s) of the standard library to keep without recompiling (pass multiple times to keep e.g., both stages 0 and 1)' -r -f +complete -c x.py -n "__fish_x.py_using_subcommand install" -l src -d 'path to the root of the rust checkout' -r -f -a "(__fish_complete_directories)" +complete -c x.py -n "__fish_x.py_using_subcommand install" -s j -l jobs -d 'number of jobs to run in parallel' -r -f +complete -c x.py -n "__fish_x.py_using_subcommand install" -l warnings -d 'if value is deny, will deny warnings if value is warn, will emit warnings otherwise, use the default configured behaviour' -r -f -a "{deny\t'',warn\t'',default\t''}" +complete -c x.py -n "__fish_x.py_using_subcommand install" -l error-format -d 'rustc error format' -r -f +complete -c x.py -n "__fish_x.py_using_subcommand install" -l color -d 'whether to use color in cargo and rustc output' -r -f -a "{always\t'',never\t'',auto\t''}" +complete -c x.py -n "__fish_x.py_using_subcommand install" -l llvm-skip-rebuild -d 'whether rebuilding llvm should be skipped, overriding `skip-rebuld` in config.toml' -r -f -a "{true\t'',false\t''}" +complete -c x.py -n "__fish_x.py_using_subcommand install" -l rust-profile-generate -d 'generate PGO profile with rustc build' -r -F +complete -c x.py -n "__fish_x.py_using_subcommand install" -l rust-profile-use -d 'use PGO profile for rustc build' -r -F +complete -c x.py -n "__fish_x.py_using_subcommand install" -l llvm-profile-use -d 'use PGO profile for LLVM build' -r -F +complete -c x.py -n "__fish_x.py_using_subcommand install" -l reproducible-artifact -d 'Additional reproducible artifacts that should be added to the reproducible artifacts archive' -r +complete -c x.py -n "__fish_x.py_using_subcommand install" -l set -d 'override options in config.toml' -r -f +complete -c x.py -n "__fish_x.py_using_subcommand install" -s v -l verbose -d 'use verbose output (-vv for very verbose)' +complete -c x.py -n "__fish_x.py_using_subcommand install" -s i -l incremental -d 'use incremental compilation' +complete -c x.py -n "__fish_x.py_using_subcommand install" -l include-default-paths -d 'include default paths in addition to the provided ones' +complete -c x.py -n "__fish_x.py_using_subcommand install" -l dry-run -d 'dry run; don\'t build anything' +complete -c x.py -n "__fish_x.py_using_subcommand install" -l dump-bootstrap-shims -d 'Indicates whether to dump the work done from bootstrap shims' +complete -c x.py -n "__fish_x.py_using_subcommand install" -l json-output -d 'use message-format=json' +complete -c x.py -n "__fish_x.py_using_subcommand install" -l bypass-bootstrap-lock -d 'Bootstrap uses this value to decide whether it should bypass locking the build process. This is rarely needed (e.g., compiling the std library for different targets in parallel)' +complete -c x.py -n "__fish_x.py_using_subcommand install" -l llvm-profile-generate -d 'generate PGO profile with llvm built for rustc' +complete -c x.py -n "__fish_x.py_using_subcommand install" -l enable-bolt-settings -d 'Enable BOLT link flags' +complete -c x.py -n "__fish_x.py_using_subcommand install" -l skip-stage0-validation -d 'Skip stage0 compiler validation' +complete -c x.py -n "__fish_x.py_using_subcommand install" -s h -l help -d 'Print help (see more with \'--help\')' +complete -c x.py -n "__fish_x.py_using_subcommand run" -l args -d 'arguments for the tool' -r +complete -c x.py -n "__fish_x.py_using_subcommand run" -l config -d 'TOML configuration file for build' -r -F +complete -c x.py -n "__fish_x.py_using_subcommand run" -l build-dir -d 'Build directory, overrides `build.build-dir` in `config.toml`' -r -f -a "(__fish_complete_directories)" +complete -c x.py -n "__fish_x.py_using_subcommand run" -l build -d 'build target of the stage0 compiler' -r -f +complete -c x.py -n "__fish_x.py_using_subcommand run" -l host -d 'host targets to build' -r -f +complete -c x.py -n "__fish_x.py_using_subcommand run" -l target -d 'target targets to build' -r -f +complete -c x.py -n "__fish_x.py_using_subcommand run" -l exclude -d 'build paths to exclude' -r -F +complete -c x.py -n "__fish_x.py_using_subcommand run" -l skip -d 'build paths to skip' -r -F +complete -c x.py -n "__fish_x.py_using_subcommand run" -l rustc-error-format -r -f +complete -c x.py -n "__fish_x.py_using_subcommand run" -l on-fail -d 'command to run on failure' -r -f -a "(__fish_complete_command)" +complete -c x.py -n "__fish_x.py_using_subcommand run" -l stage -d 'stage to build (indicates compiler to use/test, e.g., stage 0 uses the bootstrap compiler, stage 1 the stage 0 rustc artifacts, etc.)' -r -f +complete -c x.py -n "__fish_x.py_using_subcommand run" -l keep-stage -d 'stage(s) to keep without recompiling (pass multiple times to keep e.g., both stages 0 and 1)' -r -f +complete -c x.py -n "__fish_x.py_using_subcommand run" -l keep-stage-std -d 'stage(s) of the standard library to keep without recompiling (pass multiple times to keep e.g., both stages 0 and 1)' -r -f +complete -c x.py -n "__fish_x.py_using_subcommand run" -l src -d 'path to the root of the rust checkout' -r -f -a "(__fish_complete_directories)" +complete -c x.py -n "__fish_x.py_using_subcommand run" -s j -l jobs -d 'number of jobs to run in parallel' -r -f +complete -c x.py -n "__fish_x.py_using_subcommand run" -l warnings -d 'if value is deny, will deny warnings if value is warn, will emit warnings otherwise, use the default configured behaviour' -r -f -a "{deny\t'',warn\t'',default\t''}" +complete -c x.py -n "__fish_x.py_using_subcommand run" -l error-format -d 'rustc error format' -r -f +complete -c x.py -n "__fish_x.py_using_subcommand run" -l color -d 'whether to use color in cargo and rustc output' -r -f -a "{always\t'',never\t'',auto\t''}" +complete -c x.py -n "__fish_x.py_using_subcommand run" -l llvm-skip-rebuild -d 'whether rebuilding llvm should be skipped, overriding `skip-rebuld` in config.toml' -r -f -a "{true\t'',false\t''}" +complete -c x.py -n "__fish_x.py_using_subcommand run" -l rust-profile-generate -d 'generate PGO profile with rustc build' -r -F +complete -c x.py -n "__fish_x.py_using_subcommand run" -l rust-profile-use -d 'use PGO profile for rustc build' -r -F +complete -c x.py -n "__fish_x.py_using_subcommand run" -l llvm-profile-use -d 'use PGO profile for LLVM build' -r -F +complete -c x.py -n "__fish_x.py_using_subcommand run" -l reproducible-artifact -d 'Additional reproducible artifacts that should be added to the reproducible artifacts archive' -r +complete -c x.py -n "__fish_x.py_using_subcommand run" -l set -d 'override options in config.toml' -r -f +complete -c x.py -n "__fish_x.py_using_subcommand run" -s v -l verbose -d 'use verbose output (-vv for very verbose)' +complete -c x.py -n "__fish_x.py_using_subcommand run" -s i -l incremental -d 'use incremental compilation' +complete -c x.py -n "__fish_x.py_using_subcommand run" -l include-default-paths -d 'include default paths in addition to the provided ones' +complete -c x.py -n "__fish_x.py_using_subcommand run" -l dry-run -d 'dry run; don\'t build anything' +complete -c x.py -n "__fish_x.py_using_subcommand run" -l dump-bootstrap-shims -d 'Indicates whether to dump the work done from bootstrap shims' +complete -c x.py -n "__fish_x.py_using_subcommand run" -l json-output -d 'use message-format=json' +complete -c x.py -n "__fish_x.py_using_subcommand run" -l bypass-bootstrap-lock -d 'Bootstrap uses this value to decide whether it should bypass locking the build process. This is rarely needed (e.g., compiling the std library for different targets in parallel)' +complete -c x.py -n "__fish_x.py_using_subcommand run" -l llvm-profile-generate -d 'generate PGO profile with llvm built for rustc' +complete -c x.py -n "__fish_x.py_using_subcommand run" -l enable-bolt-settings -d 'Enable BOLT link flags' +complete -c x.py -n "__fish_x.py_using_subcommand run" -l skip-stage0-validation -d 'Skip stage0 compiler validation' +complete -c x.py -n "__fish_x.py_using_subcommand run" -s h -l help -d 'Print help (see more with \'--help\')' +complete -c x.py -n "__fish_x.py_using_subcommand setup" -l config -d 'TOML configuration file for build' -r -F +complete -c x.py -n "__fish_x.py_using_subcommand setup" -l build-dir -d 'Build directory, overrides `build.build-dir` in `config.toml`' -r -f -a "(__fish_complete_directories)" +complete -c x.py -n "__fish_x.py_using_subcommand setup" -l build -d 'build target of the stage0 compiler' -r -f +complete -c x.py -n "__fish_x.py_using_subcommand setup" -l host -d 'host targets to build' -r -f +complete -c x.py -n "__fish_x.py_using_subcommand setup" -l target -d 'target targets to build' -r -f +complete -c x.py -n "__fish_x.py_using_subcommand setup" -l exclude -d 'build paths to exclude' -r -F +complete -c x.py -n "__fish_x.py_using_subcommand setup" -l skip -d 'build paths to skip' -r -F +complete -c x.py -n "__fish_x.py_using_subcommand setup" -l rustc-error-format -r -f +complete -c x.py -n "__fish_x.py_using_subcommand setup" -l on-fail -d 'command to run on failure' -r -f -a "(__fish_complete_command)" +complete -c x.py -n "__fish_x.py_using_subcommand setup" -l stage -d 'stage to build (indicates compiler to use/test, e.g., stage 0 uses the bootstrap compiler, stage 1 the stage 0 rustc artifacts, etc.)' -r -f +complete -c x.py -n "__fish_x.py_using_subcommand setup" -l keep-stage -d 'stage(s) to keep without recompiling (pass multiple times to keep e.g., both stages 0 and 1)' -r -f +complete -c x.py -n "__fish_x.py_using_subcommand setup" -l keep-stage-std -d 'stage(s) of the standard library to keep without recompiling (pass multiple times to keep e.g., both stages 0 and 1)' -r -f +complete -c x.py -n "__fish_x.py_using_subcommand setup" -l src -d 'path to the root of the rust checkout' -r -f -a "(__fish_complete_directories)" +complete -c x.py -n "__fish_x.py_using_subcommand setup" -s j -l jobs -d 'number of jobs to run in parallel' -r -f +complete -c x.py -n "__fish_x.py_using_subcommand setup" -l warnings -d 'if value is deny, will deny warnings if value is warn, will emit warnings otherwise, use the default configured behaviour' -r -f -a "{deny\t'',warn\t'',default\t''}" +complete -c x.py -n "__fish_x.py_using_subcommand setup" -l error-format -d 'rustc error format' -r -f +complete -c x.py -n "__fish_x.py_using_subcommand setup" -l color -d 'whether to use color in cargo and rustc output' -r -f -a "{always\t'',never\t'',auto\t''}" +complete -c x.py -n "__fish_x.py_using_subcommand setup" -l llvm-skip-rebuild -d 'whether rebuilding llvm should be skipped, overriding `skip-rebuld` in config.toml' -r -f -a "{true\t'',false\t''}" +complete -c x.py -n "__fish_x.py_using_subcommand setup" -l rust-profile-generate -d 'generate PGO profile with rustc build' -r -F +complete -c x.py -n "__fish_x.py_using_subcommand setup" -l rust-profile-use -d 'use PGO profile for rustc build' -r -F +complete -c x.py -n "__fish_x.py_using_subcommand setup" -l llvm-profile-use -d 'use PGO profile for LLVM build' -r -F +complete -c x.py -n "__fish_x.py_using_subcommand setup" -l reproducible-artifact -d 'Additional reproducible artifacts that should be added to the reproducible artifacts archive' -r +complete -c x.py -n "__fish_x.py_using_subcommand setup" -l set -d 'override options in config.toml' -r -f +complete -c x.py -n "__fish_x.py_using_subcommand setup" -s v -l verbose -d 'use verbose output (-vv for very verbose)' +complete -c x.py -n "__fish_x.py_using_subcommand setup" -s i -l incremental -d 'use incremental compilation' +complete -c x.py -n "__fish_x.py_using_subcommand setup" -l include-default-paths -d 'include default paths in addition to the provided ones' +complete -c x.py -n "__fish_x.py_using_subcommand setup" -l dry-run -d 'dry run; don\'t build anything' +complete -c x.py -n "__fish_x.py_using_subcommand setup" -l dump-bootstrap-shims -d 'Indicates whether to dump the work done from bootstrap shims' +complete -c x.py -n "__fish_x.py_using_subcommand setup" -l json-output -d 'use message-format=json' +complete -c x.py -n "__fish_x.py_using_subcommand setup" -l bypass-bootstrap-lock -d 'Bootstrap uses this value to decide whether it should bypass locking the build process. This is rarely needed (e.g., compiling the std library for different targets in parallel)' +complete -c x.py -n "__fish_x.py_using_subcommand setup" -l llvm-profile-generate -d 'generate PGO profile with llvm built for rustc' +complete -c x.py -n "__fish_x.py_using_subcommand setup" -l enable-bolt-settings -d 'Enable BOLT link flags' +complete -c x.py -n "__fish_x.py_using_subcommand setup" -l skip-stage0-validation -d 'Skip stage0 compiler validation' +complete -c x.py -n "__fish_x.py_using_subcommand setup" -s h -l help -d 'Print help (see more with \'--help\')' +complete -c x.py -n "__fish_x.py_using_subcommand suggest" -l config -d 'TOML configuration file for build' -r -F +complete -c x.py -n "__fish_x.py_using_subcommand suggest" -l build-dir -d 'Build directory, overrides `build.build-dir` in `config.toml`' -r -f -a "(__fish_complete_directories)" +complete -c x.py -n "__fish_x.py_using_subcommand suggest" -l build -d 'build target of the stage0 compiler' -r -f +complete -c x.py -n "__fish_x.py_using_subcommand suggest" -l host -d 'host targets to build' -r -f +complete -c x.py -n "__fish_x.py_using_subcommand suggest" -l target -d 'target targets to build' -r -f +complete -c x.py -n "__fish_x.py_using_subcommand suggest" -l exclude -d 'build paths to exclude' -r -F +complete -c x.py -n "__fish_x.py_using_subcommand suggest" -l skip -d 'build paths to skip' -r -F +complete -c x.py -n "__fish_x.py_using_subcommand suggest" -l rustc-error-format -r -f +complete -c x.py -n "__fish_x.py_using_subcommand suggest" -l on-fail -d 'command to run on failure' -r -f -a "(__fish_complete_command)" +complete -c x.py -n "__fish_x.py_using_subcommand suggest" -l stage -d 'stage to build (indicates compiler to use/test, e.g., stage 0 uses the bootstrap compiler, stage 1 the stage 0 rustc artifacts, etc.)' -r -f +complete -c x.py -n "__fish_x.py_using_subcommand suggest" -l keep-stage -d 'stage(s) to keep without recompiling (pass multiple times to keep e.g., both stages 0 and 1)' -r -f +complete -c x.py -n "__fish_x.py_using_subcommand suggest" -l keep-stage-std -d 'stage(s) of the standard library to keep without recompiling (pass multiple times to keep e.g., both stages 0 and 1)' -r -f +complete -c x.py -n "__fish_x.py_using_subcommand suggest" -l src -d 'path to the root of the rust checkout' -r -f -a "(__fish_complete_directories)" +complete -c x.py -n "__fish_x.py_using_subcommand suggest" -s j -l jobs -d 'number of jobs to run in parallel' -r -f +complete -c x.py -n "__fish_x.py_using_subcommand suggest" -l warnings -d 'if value is deny, will deny warnings if value is warn, will emit warnings otherwise, use the default configured behaviour' -r -f -a "{deny\t'',warn\t'',default\t''}" +complete -c x.py -n "__fish_x.py_using_subcommand suggest" -l error-format -d 'rustc error format' -r -f +complete -c x.py -n "__fish_x.py_using_subcommand suggest" -l color -d 'whether to use color in cargo and rustc output' -r -f -a "{always\t'',never\t'',auto\t''}" +complete -c x.py -n "__fish_x.py_using_subcommand suggest" -l llvm-skip-rebuild -d 'whether rebuilding llvm should be skipped, overriding `skip-rebuld` in config.toml' -r -f -a "{true\t'',false\t''}" +complete -c x.py -n "__fish_x.py_using_subcommand suggest" -l rust-profile-generate -d 'generate PGO profile with rustc build' -r -F +complete -c x.py -n "__fish_x.py_using_subcommand suggest" -l rust-profile-use -d 'use PGO profile for rustc build' -r -F +complete -c x.py -n "__fish_x.py_using_subcommand suggest" -l llvm-profile-use -d 'use PGO profile for LLVM build' -r -F +complete -c x.py -n "__fish_x.py_using_subcommand suggest" -l reproducible-artifact -d 'Additional reproducible artifacts that should be added to the reproducible artifacts archive' -r +complete -c x.py -n "__fish_x.py_using_subcommand suggest" -l set -d 'override options in config.toml' -r -f +complete -c x.py -n "__fish_x.py_using_subcommand suggest" -l run -d 'run suggested tests' +complete -c x.py -n "__fish_x.py_using_subcommand suggest" -s v -l verbose -d 'use verbose output (-vv for very verbose)' +complete -c x.py -n "__fish_x.py_using_subcommand suggest" -s i -l incremental -d 'use incremental compilation' +complete -c x.py -n "__fish_x.py_using_subcommand suggest" -l include-default-paths -d 'include default paths in addition to the provided ones' +complete -c x.py -n "__fish_x.py_using_subcommand suggest" -l dry-run -d 'dry run; don\'t build anything' +complete -c x.py -n "__fish_x.py_using_subcommand suggest" -l dump-bootstrap-shims -d 'Indicates whether to dump the work done from bootstrap shims' +complete -c x.py -n "__fish_x.py_using_subcommand suggest" -l json-output -d 'use message-format=json' +complete -c x.py -n "__fish_x.py_using_subcommand suggest" -l bypass-bootstrap-lock -d 'Bootstrap uses this value to decide whether it should bypass locking the build process. This is rarely needed (e.g., compiling the std library for different targets in parallel)' +complete -c x.py -n "__fish_x.py_using_subcommand suggest" -l llvm-profile-generate -d 'generate PGO profile with llvm built for rustc' +complete -c x.py -n "__fish_x.py_using_subcommand suggest" -l enable-bolt-settings -d 'Enable BOLT link flags' +complete -c x.py -n "__fish_x.py_using_subcommand suggest" -l skip-stage0-validation -d 'Skip stage0 compiler validation' +complete -c x.py -n "__fish_x.py_using_subcommand suggest" -s h -l help -d 'Print help (see more with \'--help\')' +complete -c x.py -n "__fish_x.py_using_subcommand vendor" -l sync -d 'Additional `Cargo.toml` to sync and vendor' -r -F +complete -c x.py -n "__fish_x.py_using_subcommand vendor" -l config -d 'TOML configuration file for build' -r -F +complete -c x.py -n "__fish_x.py_using_subcommand vendor" -l build-dir -d 'Build directory, overrides `build.build-dir` in `config.toml`' -r -f -a "(__fish_complete_directories)" +complete -c x.py -n "__fish_x.py_using_subcommand vendor" -l build -d 'build target of the stage0 compiler' -r -f +complete -c x.py -n "__fish_x.py_using_subcommand vendor" -l host -d 'host targets to build' -r -f +complete -c x.py -n "__fish_x.py_using_subcommand vendor" -l target -d 'target targets to build' -r -f +complete -c x.py -n "__fish_x.py_using_subcommand vendor" -l exclude -d 'build paths to exclude' -r -F +complete -c x.py -n "__fish_x.py_using_subcommand vendor" -l skip -d 'build paths to skip' -r -F +complete -c x.py -n "__fish_x.py_using_subcommand vendor" -l rustc-error-format -r -f +complete -c x.py -n "__fish_x.py_using_subcommand vendor" -l on-fail -d 'command to run on failure' -r -f -a "(__fish_complete_command)" +complete -c x.py -n "__fish_x.py_using_subcommand vendor" -l stage -d 'stage to build (indicates compiler to use/test, e.g., stage 0 uses the bootstrap compiler, stage 1 the stage 0 rustc artifacts, etc.)' -r -f +complete -c x.py -n "__fish_x.py_using_subcommand vendor" -l keep-stage -d 'stage(s) to keep without recompiling (pass multiple times to keep e.g., both stages 0 and 1)' -r -f +complete -c x.py -n "__fish_x.py_using_subcommand vendor" -l keep-stage-std -d 'stage(s) of the standard library to keep without recompiling (pass multiple times to keep e.g., both stages 0 and 1)' -r -f +complete -c x.py -n "__fish_x.py_using_subcommand vendor" -l src -d 'path to the root of the rust checkout' -r -f -a "(__fish_complete_directories)" +complete -c x.py -n "__fish_x.py_using_subcommand vendor" -s j -l jobs -d 'number of jobs to run in parallel' -r -f +complete -c x.py -n "__fish_x.py_using_subcommand vendor" -l warnings -d 'if value is deny, will deny warnings if value is warn, will emit warnings otherwise, use the default configured behaviour' -r -f -a "{deny\t'',warn\t'',default\t''}" +complete -c x.py -n "__fish_x.py_using_subcommand vendor" -l error-format -d 'rustc error format' -r -f +complete -c x.py -n "__fish_x.py_using_subcommand vendor" -l color -d 'whether to use color in cargo and rustc output' -r -f -a "{always\t'',never\t'',auto\t''}" +complete -c x.py -n "__fish_x.py_using_subcommand vendor" -l llvm-skip-rebuild -d 'whether rebuilding llvm should be skipped, overriding `skip-rebuld` in config.toml' -r -f -a "{true\t'',false\t''}" +complete -c x.py -n "__fish_x.py_using_subcommand vendor" -l rust-profile-generate -d 'generate PGO profile with rustc build' -r -F +complete -c x.py -n "__fish_x.py_using_subcommand vendor" -l rust-profile-use -d 'use PGO profile for rustc build' -r -F +complete -c x.py -n "__fish_x.py_using_subcommand vendor" -l llvm-profile-use -d 'use PGO profile for LLVM build' -r -F +complete -c x.py -n "__fish_x.py_using_subcommand vendor" -l reproducible-artifact -d 'Additional reproducible artifacts that should be added to the reproducible artifacts archive' -r +complete -c x.py -n "__fish_x.py_using_subcommand vendor" -l set -d 'override options in config.toml' -r -f +complete -c x.py -n "__fish_x.py_using_subcommand vendor" -l versioned-dirs -d 'Always include version in subdir name' +complete -c x.py -n "__fish_x.py_using_subcommand vendor" -s v -l verbose -d 'use verbose output (-vv for very verbose)' +complete -c x.py -n "__fish_x.py_using_subcommand vendor" -s i -l incremental -d 'use incremental compilation' +complete -c x.py -n "__fish_x.py_using_subcommand vendor" -l include-default-paths -d 'include default paths in addition to the provided ones' +complete -c x.py -n "__fish_x.py_using_subcommand vendor" -l dry-run -d 'dry run; don\'t build anything' +complete -c x.py -n "__fish_x.py_using_subcommand vendor" -l dump-bootstrap-shims -d 'Indicates whether to dump the work done from bootstrap shims' +complete -c x.py -n "__fish_x.py_using_subcommand vendor" -l json-output -d 'use message-format=json' +complete -c x.py -n "__fish_x.py_using_subcommand vendor" -l bypass-bootstrap-lock -d 'Bootstrap uses this value to decide whether it should bypass locking the build process. This is rarely needed (e.g., compiling the std library for different targets in parallel)' +complete -c x.py -n "__fish_x.py_using_subcommand vendor" -l llvm-profile-generate -d 'generate PGO profile with llvm built for rustc' +complete -c x.py -n "__fish_x.py_using_subcommand vendor" -l enable-bolt-settings -d 'Enable BOLT link flags' +complete -c x.py -n "__fish_x.py_using_subcommand vendor" -l skip-stage0-validation -d 'Skip stage0 compiler validation' +complete -c x.py -n "__fish_x.py_using_subcommand vendor" -s h -l help -d 'Print help (see more with \'--help\')' +complete -c x.py -n "__fish_x.py_using_subcommand perf" -l config -d 'TOML configuration file for build' -r -F +complete -c x.py -n "__fish_x.py_using_subcommand perf" -l build-dir -d 'Build directory, overrides `build.build-dir` in `config.toml`' -r -f -a "(__fish_complete_directories)" +complete -c x.py -n "__fish_x.py_using_subcommand perf" -l build -d 'build target of the stage0 compiler' -r -f +complete -c x.py -n "__fish_x.py_using_subcommand perf" -l host -d 'host targets to build' -r -f +complete -c x.py -n "__fish_x.py_using_subcommand perf" -l target -d 'target targets to build' -r -f +complete -c x.py -n "__fish_x.py_using_subcommand perf" -l exclude -d 'build paths to exclude' -r -F +complete -c x.py -n "__fish_x.py_using_subcommand perf" -l skip -d 'build paths to skip' -r -F +complete -c x.py -n "__fish_x.py_using_subcommand perf" -l rustc-error-format -r -f +complete -c x.py -n "__fish_x.py_using_subcommand perf" -l on-fail -d 'command to run on failure' -r -f -a "(__fish_complete_command)" +complete -c x.py -n "__fish_x.py_using_subcommand perf" -l stage -d 'stage to build (indicates compiler to use/test, e.g., stage 0 uses the bootstrap compiler, stage 1 the stage 0 rustc artifacts, etc.)' -r -f +complete -c x.py -n "__fish_x.py_using_subcommand perf" -l keep-stage -d 'stage(s) to keep without recompiling (pass multiple times to keep e.g., both stages 0 and 1)' -r -f +complete -c x.py -n "__fish_x.py_using_subcommand perf" -l keep-stage-std -d 'stage(s) of the standard library to keep without recompiling (pass multiple times to keep e.g., both stages 0 and 1)' -r -f +complete -c x.py -n "__fish_x.py_using_subcommand perf" -l src -d 'path to the root of the rust checkout' -r -f -a "(__fish_complete_directories)" +complete -c x.py -n "__fish_x.py_using_subcommand perf" -s j -l jobs -d 'number of jobs to run in parallel' -r -f +complete -c x.py -n "__fish_x.py_using_subcommand perf" -l warnings -d 'if value is deny, will deny warnings if value is warn, will emit warnings otherwise, use the default configured behaviour' -r -f -a "{deny\t'',warn\t'',default\t''}" +complete -c x.py -n "__fish_x.py_using_subcommand perf" -l error-format -d 'rustc error format' -r -f +complete -c x.py -n "__fish_x.py_using_subcommand perf" -l color -d 'whether to use color in cargo and rustc output' -r -f -a "{always\t'',never\t'',auto\t''}" +complete -c x.py -n "__fish_x.py_using_subcommand perf" -l llvm-skip-rebuild -d 'whether rebuilding llvm should be skipped, overriding `skip-rebuld` in config.toml' -r -f -a "{true\t'',false\t''}" +complete -c x.py -n "__fish_x.py_using_subcommand perf" -l rust-profile-generate -d 'generate PGO profile with rustc build' -r -F +complete -c x.py -n "__fish_x.py_using_subcommand perf" -l rust-profile-use -d 'use PGO profile for rustc build' -r -F +complete -c x.py -n "__fish_x.py_using_subcommand perf" -l llvm-profile-use -d 'use PGO profile for LLVM build' -r -F +complete -c x.py -n "__fish_x.py_using_subcommand perf" -l reproducible-artifact -d 'Additional reproducible artifacts that should be added to the reproducible artifacts archive' -r +complete -c x.py -n "__fish_x.py_using_subcommand perf" -l set -d 'override options in config.toml' -r -f +complete -c x.py -n "__fish_x.py_using_subcommand perf" -s v -l verbose -d 'use verbose output (-vv for very verbose)' +complete -c x.py -n "__fish_x.py_using_subcommand perf" -s i -l incremental -d 'use incremental compilation' +complete -c x.py -n "__fish_x.py_using_subcommand perf" -l include-default-paths -d 'include default paths in addition to the provided ones' +complete -c x.py -n "__fish_x.py_using_subcommand perf" -l dry-run -d 'dry run; don\'t build anything' +complete -c x.py -n "__fish_x.py_using_subcommand perf" -l dump-bootstrap-shims -d 'Indicates whether to dump the work done from bootstrap shims' +complete -c x.py -n "__fish_x.py_using_subcommand perf" -l json-output -d 'use message-format=json' +complete -c x.py -n "__fish_x.py_using_subcommand perf" -l bypass-bootstrap-lock -d 'Bootstrap uses this value to decide whether it should bypass locking the build process. This is rarely needed (e.g., compiling the std library for different targets in parallel)' +complete -c x.py -n "__fish_x.py_using_subcommand perf" -l llvm-profile-generate -d 'generate PGO profile with llvm built for rustc' +complete -c x.py -n "__fish_x.py_using_subcommand perf" -l enable-bolt-settings -d 'Enable BOLT link flags' +complete -c x.py -n "__fish_x.py_using_subcommand perf" -l skip-stage0-validation -d 'Skip stage0 compiler validation' +complete -c x.py -n "__fish_x.py_using_subcommand perf" -s h -l help -d 'Print help (see more with \'--help\')' diff --git a/src/etc/completions/x.py.ps1 b/src/etc/completions/x.py.ps1 index 4b424471a26..240de32451d 100644 --- a/src/etc/completions/x.py.ps1 +++ b/src/etc/completions/x.py.ps1 @@ -21,44 +21,44 @@ Register-ArgumentCompleter -Native -CommandName 'x.py' -ScriptBlock { $completions = @(switch ($command) { 'x.py' { - [CompletionResult]::new('--config', 'config', [CompletionResultType]::ParameterName, 'TOML configuration file for build') - [CompletionResult]::new('--build-dir', 'build-dir', [CompletionResultType]::ParameterName, 'Build directory, overrides `build.build-dir` in `config.toml`') - [CompletionResult]::new('--build', 'build', [CompletionResultType]::ParameterName, 'build target of the stage0 compiler') - [CompletionResult]::new('--host', 'host', [CompletionResultType]::ParameterName, 'host targets to build') - [CompletionResult]::new('--target', 'target', [CompletionResultType]::ParameterName, 'target targets to build') - [CompletionResult]::new('--exclude', 'exclude', [CompletionResultType]::ParameterName, 'build paths to exclude') - [CompletionResult]::new('--skip', 'skip', [CompletionResultType]::ParameterName, 'build paths to skip') - [CompletionResult]::new('--rustc-error-format', 'rustc-error-format', [CompletionResultType]::ParameterName, 'rustc-error-format') - [CompletionResult]::new('--on-fail', 'on-fail', [CompletionResultType]::ParameterName, 'command to run on failure') - [CompletionResult]::new('--stage', 'stage', [CompletionResultType]::ParameterName, 'stage to build (indicates compiler to use/test, e.g., stage 0 uses the bootstrap compiler, stage 1 the stage 0 rustc artifacts, etc.)') - [CompletionResult]::new('--keep-stage', 'keep-stage', [CompletionResultType]::ParameterName, 'stage(s) to keep without recompiling (pass multiple times to keep e.g., both stages 0 and 1)') - [CompletionResult]::new('--keep-stage-std', 'keep-stage-std', [CompletionResultType]::ParameterName, 'stage(s) of the standard library to keep without recompiling (pass multiple times to keep e.g., both stages 0 and 1)') - [CompletionResult]::new('--src', 'src', [CompletionResultType]::ParameterName, 'path to the root of the rust checkout') - [CompletionResult]::new('-j', 'j', [CompletionResultType]::ParameterName, 'number of jobs to run in parallel') - [CompletionResult]::new('--jobs', 'jobs', [CompletionResultType]::ParameterName, 'number of jobs to run in parallel') - [CompletionResult]::new('--warnings', 'warnings', [CompletionResultType]::ParameterName, 'if value is deny, will deny warnings if value is warn, will emit warnings otherwise, use the default configured behaviour') - [CompletionResult]::new('--error-format', 'error-format', [CompletionResultType]::ParameterName, 'rustc error format') - [CompletionResult]::new('--color', 'color', [CompletionResultType]::ParameterName, 'whether to use color in cargo and rustc output') - [CompletionResult]::new('--llvm-skip-rebuild', 'llvm-skip-rebuild', [CompletionResultType]::ParameterName, 'whether rebuilding llvm should be skipped, overriding `skip-rebuld` in config.toml') - [CompletionResult]::new('--rust-profile-generate', 'rust-profile-generate', [CompletionResultType]::ParameterName, 'generate PGO profile with rustc build') - [CompletionResult]::new('--rust-profile-use', 'rust-profile-use', [CompletionResultType]::ParameterName, 'use PGO profile for rustc build') - [CompletionResult]::new('--llvm-profile-use', 'llvm-profile-use', [CompletionResultType]::ParameterName, 'use PGO profile for LLVM build') - [CompletionResult]::new('--reproducible-artifact', 'reproducible-artifact', [CompletionResultType]::ParameterName, 'Additional reproducible artifacts that should be added to the reproducible artifacts archive') - [CompletionResult]::new('--set', 'set', [CompletionResultType]::ParameterName, 'override options in config.toml') - [CompletionResult]::new('-v', 'v', [CompletionResultType]::ParameterName, 'use verbose output (-vv for very verbose)') - [CompletionResult]::new('--verbose', 'verbose', [CompletionResultType]::ParameterName, 'use verbose output (-vv for very verbose)') - [CompletionResult]::new('-i', 'i', [CompletionResultType]::ParameterName, 'use incremental compilation') - [CompletionResult]::new('--incremental', 'incremental', [CompletionResultType]::ParameterName, 'use incremental compilation') - [CompletionResult]::new('--include-default-paths', 'include-default-paths', [CompletionResultType]::ParameterName, 'include default paths in addition to the provided ones') - [CompletionResult]::new('--dry-run', 'dry-run', [CompletionResultType]::ParameterName, 'dry run; don''t build anything') - [CompletionResult]::new('--dump-bootstrap-shims', 'dump-bootstrap-shims', [CompletionResultType]::ParameterName, 'Indicates whether to dump the work done from bootstrap shims') - [CompletionResult]::new('--json-output', 'json-output', [CompletionResultType]::ParameterName, 'use message-format=json') - [CompletionResult]::new('--bypass-bootstrap-lock', 'bypass-bootstrap-lock', [CompletionResultType]::ParameterName, 'Bootstrap uses this value to decide whether it should bypass locking the build process. This is rarely needed (e.g., compiling the std library for different targets in parallel)') - [CompletionResult]::new('--llvm-profile-generate', 'llvm-profile-generate', [CompletionResultType]::ParameterName, 'generate PGO profile with llvm built for rustc') - [CompletionResult]::new('--enable-bolt-settings', 'enable-bolt-settings', [CompletionResultType]::ParameterName, 'Enable BOLT link flags') - [CompletionResult]::new('--skip-stage0-validation', 'skip-stage0-validation', [CompletionResultType]::ParameterName, 'Skip stage0 compiler validation') - [CompletionResult]::new('-h', 'h', [CompletionResultType]::ParameterName, 'Print help (see more with ''--help'')') - [CompletionResult]::new('--help', 'help', [CompletionResultType]::ParameterName, 'Print help (see more with ''--help'')') + [CompletionResult]::new('--config', '--config', [CompletionResultType]::ParameterName, 'TOML configuration file for build') + [CompletionResult]::new('--build-dir', '--build-dir', [CompletionResultType]::ParameterName, 'Build directory, overrides `build.build-dir` in `config.toml`') + [CompletionResult]::new('--build', '--build', [CompletionResultType]::ParameterName, 'build target of the stage0 compiler') + [CompletionResult]::new('--host', '--host', [CompletionResultType]::ParameterName, 'host targets to build') + [CompletionResult]::new('--target', '--target', [CompletionResultType]::ParameterName, 'target targets to build') + [CompletionResult]::new('--exclude', '--exclude', [CompletionResultType]::ParameterName, 'build paths to exclude') + [CompletionResult]::new('--skip', '--skip', [CompletionResultType]::ParameterName, 'build paths to skip') + [CompletionResult]::new('--rustc-error-format', '--rustc-error-format', [CompletionResultType]::ParameterName, 'rustc-error-format') + [CompletionResult]::new('--on-fail', '--on-fail', [CompletionResultType]::ParameterName, 'command to run on failure') + [CompletionResult]::new('--stage', '--stage', [CompletionResultType]::ParameterName, 'stage to build (indicates compiler to use/test, e.g., stage 0 uses the bootstrap compiler, stage 1 the stage 0 rustc artifacts, etc.)') + [CompletionResult]::new('--keep-stage', '--keep-stage', [CompletionResultType]::ParameterName, 'stage(s) to keep without recompiling (pass multiple times to keep e.g., both stages 0 and 1)') + [CompletionResult]::new('--keep-stage-std', '--keep-stage-std', [CompletionResultType]::ParameterName, 'stage(s) of the standard library to keep without recompiling (pass multiple times to keep e.g., both stages 0 and 1)') + [CompletionResult]::new('--src', '--src', [CompletionResultType]::ParameterName, 'path to the root of the rust checkout') + [CompletionResult]::new('-j', '-j', [CompletionResultType]::ParameterName, 'number of jobs to run in parallel') + [CompletionResult]::new('--jobs', '--jobs', [CompletionResultType]::ParameterName, 'number of jobs to run in parallel') + [CompletionResult]::new('--warnings', '--warnings', [CompletionResultType]::ParameterName, 'if value is deny, will deny warnings if value is warn, will emit warnings otherwise, use the default configured behaviour') + [CompletionResult]::new('--error-format', '--error-format', [CompletionResultType]::ParameterName, 'rustc error format') + [CompletionResult]::new('--color', '--color', [CompletionResultType]::ParameterName, 'whether to use color in cargo and rustc output') + [CompletionResult]::new('--llvm-skip-rebuild', '--llvm-skip-rebuild', [CompletionResultType]::ParameterName, 'whether rebuilding llvm should be skipped, overriding `skip-rebuld` in config.toml') + [CompletionResult]::new('--rust-profile-generate', '--rust-profile-generate', [CompletionResultType]::ParameterName, 'generate PGO profile with rustc build') + [CompletionResult]::new('--rust-profile-use', '--rust-profile-use', [CompletionResultType]::ParameterName, 'use PGO profile for rustc build') + [CompletionResult]::new('--llvm-profile-use', '--llvm-profile-use', [CompletionResultType]::ParameterName, 'use PGO profile for LLVM build') + [CompletionResult]::new('--reproducible-artifact', '--reproducible-artifact', [CompletionResultType]::ParameterName, 'Additional reproducible artifacts that should be added to the reproducible artifacts archive') + [CompletionResult]::new('--set', '--set', [CompletionResultType]::ParameterName, 'override options in config.toml') + [CompletionResult]::new('-v', '-v', [CompletionResultType]::ParameterName, 'use verbose output (-vv for very verbose)') + [CompletionResult]::new('--verbose', '--verbose', [CompletionResultType]::ParameterName, 'use verbose output (-vv for very verbose)') + [CompletionResult]::new('-i', '-i', [CompletionResultType]::ParameterName, 'use incremental compilation') + [CompletionResult]::new('--incremental', '--incremental', [CompletionResultType]::ParameterName, 'use incremental compilation') + [CompletionResult]::new('--include-default-paths', '--include-default-paths', [CompletionResultType]::ParameterName, 'include default paths in addition to the provided ones') + [CompletionResult]::new('--dry-run', '--dry-run', [CompletionResultType]::ParameterName, 'dry run; don''t build anything') + [CompletionResult]::new('--dump-bootstrap-shims', '--dump-bootstrap-shims', [CompletionResultType]::ParameterName, 'Indicates whether to dump the work done from bootstrap shims') + [CompletionResult]::new('--json-output', '--json-output', [CompletionResultType]::ParameterName, 'use message-format=json') + [CompletionResult]::new('--bypass-bootstrap-lock', '--bypass-bootstrap-lock', [CompletionResultType]::ParameterName, 'Bootstrap uses this value to decide whether it should bypass locking the build process. This is rarely needed (e.g., compiling the std library for different targets in parallel)') + [CompletionResult]::new('--llvm-profile-generate', '--llvm-profile-generate', [CompletionResultType]::ParameterName, 'generate PGO profile with llvm built for rustc') + [CompletionResult]::new('--enable-bolt-settings', '--enable-bolt-settings', [CompletionResultType]::ParameterName, 'Enable BOLT link flags') + [CompletionResult]::new('--skip-stage0-validation', '--skip-stage0-validation', [CompletionResultType]::ParameterName, 'Skip stage0 compiler validation') + [CompletionResult]::new('-h', '-h', [CompletionResultType]::ParameterName, 'Print help (see more with ''--help'')') + [CompletionResult]::new('--help', '--help', [CompletionResultType]::ParameterName, 'Print help (see more with ''--help'')') [CompletionResult]::new('build', 'build', [CompletionResultType]::ParameterValue, 'Compile either the compiler or libraries') [CompletionResult]::new('check', 'check', [CompletionResultType]::ParameterValue, 'Compile either the compiler or libraries, using cargo check') [CompletionResult]::new('clippy', 'clippy', [CompletionResultType]::ParameterValue, 'Run Clippy (uses rustup/cargo-installed clippy binary)') @@ -79,735 +79,735 @@ Register-ArgumentCompleter -Native -CommandName 'x.py' -ScriptBlock { break } 'x.py;build' { - [CompletionResult]::new('--config', 'config', [CompletionResultType]::ParameterName, 'TOML configuration file for build') - [CompletionResult]::new('--build-dir', 'build-dir', [CompletionResultType]::ParameterName, 'Build directory, overrides `build.build-dir` in `config.toml`') - [CompletionResult]::new('--build', 'build', [CompletionResultType]::ParameterName, 'build target of the stage0 compiler') - [CompletionResult]::new('--host', 'host', [CompletionResultType]::ParameterName, 'host targets to build') - [CompletionResult]::new('--target', 'target', [CompletionResultType]::ParameterName, 'target targets to build') - [CompletionResult]::new('--exclude', 'exclude', [CompletionResultType]::ParameterName, 'build paths to exclude') - [CompletionResult]::new('--skip', 'skip', [CompletionResultType]::ParameterName, 'build paths to skip') - [CompletionResult]::new('--rustc-error-format', 'rustc-error-format', [CompletionResultType]::ParameterName, 'rustc-error-format') - [CompletionResult]::new('--on-fail', 'on-fail', [CompletionResultType]::ParameterName, 'command to run on failure') - [CompletionResult]::new('--stage', 'stage', [CompletionResultType]::ParameterName, 'stage to build (indicates compiler to use/test, e.g., stage 0 uses the bootstrap compiler, stage 1 the stage 0 rustc artifacts, etc.)') - [CompletionResult]::new('--keep-stage', 'keep-stage', [CompletionResultType]::ParameterName, 'stage(s) to keep without recompiling (pass multiple times to keep e.g., both stages 0 and 1)') - [CompletionResult]::new('--keep-stage-std', 'keep-stage-std', [CompletionResultType]::ParameterName, 'stage(s) of the standard library to keep without recompiling (pass multiple times to keep e.g., both stages 0 and 1)') - [CompletionResult]::new('--src', 'src', [CompletionResultType]::ParameterName, 'path to the root of the rust checkout') - [CompletionResult]::new('-j', 'j', [CompletionResultType]::ParameterName, 'number of jobs to run in parallel') - [CompletionResult]::new('--jobs', 'jobs', [CompletionResultType]::ParameterName, 'number of jobs to run in parallel') - [CompletionResult]::new('--warnings', 'warnings', [CompletionResultType]::ParameterName, 'if value is deny, will deny warnings if value is warn, will emit warnings otherwise, use the default configured behaviour') - [CompletionResult]::new('--error-format', 'error-format', [CompletionResultType]::ParameterName, 'rustc error format') - [CompletionResult]::new('--color', 'color', [CompletionResultType]::ParameterName, 'whether to use color in cargo and rustc output') - [CompletionResult]::new('--llvm-skip-rebuild', 'llvm-skip-rebuild', [CompletionResultType]::ParameterName, 'whether rebuilding llvm should be skipped, overriding `skip-rebuld` in config.toml') - [CompletionResult]::new('--rust-profile-generate', 'rust-profile-generate', [CompletionResultType]::ParameterName, 'generate PGO profile with rustc build') - [CompletionResult]::new('--rust-profile-use', 'rust-profile-use', [CompletionResultType]::ParameterName, 'use PGO profile for rustc build') - [CompletionResult]::new('--llvm-profile-use', 'llvm-profile-use', [CompletionResultType]::ParameterName, 'use PGO profile for LLVM build') - [CompletionResult]::new('--reproducible-artifact', 'reproducible-artifact', [CompletionResultType]::ParameterName, 'Additional reproducible artifacts that should be added to the reproducible artifacts archive') - [CompletionResult]::new('--set', 'set', [CompletionResultType]::ParameterName, 'override options in config.toml') - [CompletionResult]::new('-v', 'v', [CompletionResultType]::ParameterName, 'use verbose output (-vv for very verbose)') - [CompletionResult]::new('--verbose', 'verbose', [CompletionResultType]::ParameterName, 'use verbose output (-vv for very verbose)') - [CompletionResult]::new('-i', 'i', [CompletionResultType]::ParameterName, 'use incremental compilation') - [CompletionResult]::new('--incremental', 'incremental', [CompletionResultType]::ParameterName, 'use incremental compilation') - [CompletionResult]::new('--include-default-paths', 'include-default-paths', [CompletionResultType]::ParameterName, 'include default paths in addition to the provided ones') - [CompletionResult]::new('--dry-run', 'dry-run', [CompletionResultType]::ParameterName, 'dry run; don''t build anything') - [CompletionResult]::new('--dump-bootstrap-shims', 'dump-bootstrap-shims', [CompletionResultType]::ParameterName, 'Indicates whether to dump the work done from bootstrap shims') - [CompletionResult]::new('--json-output', 'json-output', [CompletionResultType]::ParameterName, 'use message-format=json') - [CompletionResult]::new('--bypass-bootstrap-lock', 'bypass-bootstrap-lock', [CompletionResultType]::ParameterName, 'Bootstrap uses this value to decide whether it should bypass locking the build process. This is rarely needed (e.g., compiling the std library for different targets in parallel)') - [CompletionResult]::new('--llvm-profile-generate', 'llvm-profile-generate', [CompletionResultType]::ParameterName, 'generate PGO profile with llvm built for rustc') - [CompletionResult]::new('--enable-bolt-settings', 'enable-bolt-settings', [CompletionResultType]::ParameterName, 'Enable BOLT link flags') - [CompletionResult]::new('--skip-stage0-validation', 'skip-stage0-validation', [CompletionResultType]::ParameterName, 'Skip stage0 compiler validation') - [CompletionResult]::new('-h', 'h', [CompletionResultType]::ParameterName, 'Print help (see more with ''--help'')') - [CompletionResult]::new('--help', 'help', [CompletionResultType]::ParameterName, 'Print help (see more with ''--help'')') + [CompletionResult]::new('--config', '--config', [CompletionResultType]::ParameterName, 'TOML configuration file for build') + [CompletionResult]::new('--build-dir', '--build-dir', [CompletionResultType]::ParameterName, 'Build directory, overrides `build.build-dir` in `config.toml`') + [CompletionResult]::new('--build', '--build', [CompletionResultType]::ParameterName, 'build target of the stage0 compiler') + [CompletionResult]::new('--host', '--host', [CompletionResultType]::ParameterName, 'host targets to build') + [CompletionResult]::new('--target', '--target', [CompletionResultType]::ParameterName, 'target targets to build') + [CompletionResult]::new('--exclude', '--exclude', [CompletionResultType]::ParameterName, 'build paths to exclude') + [CompletionResult]::new('--skip', '--skip', [CompletionResultType]::ParameterName, 'build paths to skip') + [CompletionResult]::new('--rustc-error-format', '--rustc-error-format', [CompletionResultType]::ParameterName, 'rustc-error-format') + [CompletionResult]::new('--on-fail', '--on-fail', [CompletionResultType]::ParameterName, 'command to run on failure') + [CompletionResult]::new('--stage', '--stage', [CompletionResultType]::ParameterName, 'stage to build (indicates compiler to use/test, e.g., stage 0 uses the bootstrap compiler, stage 1 the stage 0 rustc artifacts, etc.)') + [CompletionResult]::new('--keep-stage', '--keep-stage', [CompletionResultType]::ParameterName, 'stage(s) to keep without recompiling (pass multiple times to keep e.g., both stages 0 and 1)') + [CompletionResult]::new('--keep-stage-std', '--keep-stage-std', [CompletionResultType]::ParameterName, 'stage(s) of the standard library to keep without recompiling (pass multiple times to keep e.g., both stages 0 and 1)') + [CompletionResult]::new('--src', '--src', [CompletionResultType]::ParameterName, 'path to the root of the rust checkout') + [CompletionResult]::new('-j', '-j', [CompletionResultType]::ParameterName, 'number of jobs to run in parallel') + [CompletionResult]::new('--jobs', '--jobs', [CompletionResultType]::ParameterName, 'number of jobs to run in parallel') + [CompletionResult]::new('--warnings', '--warnings', [CompletionResultType]::ParameterName, 'if value is deny, will deny warnings if value is warn, will emit warnings otherwise, use the default configured behaviour') + [CompletionResult]::new('--error-format', '--error-format', [CompletionResultType]::ParameterName, 'rustc error format') + [CompletionResult]::new('--color', '--color', [CompletionResultType]::ParameterName, 'whether to use color in cargo and rustc output') + [CompletionResult]::new('--llvm-skip-rebuild', '--llvm-skip-rebuild', [CompletionResultType]::ParameterName, 'whether rebuilding llvm should be skipped, overriding `skip-rebuld` in config.toml') + [CompletionResult]::new('--rust-profile-generate', '--rust-profile-generate', [CompletionResultType]::ParameterName, 'generate PGO profile with rustc build') + [CompletionResult]::new('--rust-profile-use', '--rust-profile-use', [CompletionResultType]::ParameterName, 'use PGO profile for rustc build') + [CompletionResult]::new('--llvm-profile-use', '--llvm-profile-use', [CompletionResultType]::ParameterName, 'use PGO profile for LLVM build') + [CompletionResult]::new('--reproducible-artifact', '--reproducible-artifact', [CompletionResultType]::ParameterName, 'Additional reproducible artifacts that should be added to the reproducible artifacts archive') + [CompletionResult]::new('--set', '--set', [CompletionResultType]::ParameterName, 'override options in config.toml') + [CompletionResult]::new('-v', '-v', [CompletionResultType]::ParameterName, 'use verbose output (-vv for very verbose)') + [CompletionResult]::new('--verbose', '--verbose', [CompletionResultType]::ParameterName, 'use verbose output (-vv for very verbose)') + [CompletionResult]::new('-i', '-i', [CompletionResultType]::ParameterName, 'use incremental compilation') + [CompletionResult]::new('--incremental', '--incremental', [CompletionResultType]::ParameterName, 'use incremental compilation') + [CompletionResult]::new('--include-default-paths', '--include-default-paths', [CompletionResultType]::ParameterName, 'include default paths in addition to the provided ones') + [CompletionResult]::new('--dry-run', '--dry-run', [CompletionResultType]::ParameterName, 'dry run; don''t build anything') + [CompletionResult]::new('--dump-bootstrap-shims', '--dump-bootstrap-shims', [CompletionResultType]::ParameterName, 'Indicates whether to dump the work done from bootstrap shims') + [CompletionResult]::new('--json-output', '--json-output', [CompletionResultType]::ParameterName, 'use message-format=json') + [CompletionResult]::new('--bypass-bootstrap-lock', '--bypass-bootstrap-lock', [CompletionResultType]::ParameterName, 'Bootstrap uses this value to decide whether it should bypass locking the build process. This is rarely needed (e.g., compiling the std library for different targets in parallel)') + [CompletionResult]::new('--llvm-profile-generate', '--llvm-profile-generate', [CompletionResultType]::ParameterName, 'generate PGO profile with llvm built for rustc') + [CompletionResult]::new('--enable-bolt-settings', '--enable-bolt-settings', [CompletionResultType]::ParameterName, 'Enable BOLT link flags') + [CompletionResult]::new('--skip-stage0-validation', '--skip-stage0-validation', [CompletionResultType]::ParameterName, 'Skip stage0 compiler validation') + [CompletionResult]::new('-h', '-h', [CompletionResultType]::ParameterName, 'Print help (see more with ''--help'')') + [CompletionResult]::new('--help', '--help', [CompletionResultType]::ParameterName, 'Print help (see more with ''--help'')') break } 'x.py;check' { - [CompletionResult]::new('--config', 'config', [CompletionResultType]::ParameterName, 'TOML configuration file for build') - [CompletionResult]::new('--build-dir', 'build-dir', [CompletionResultType]::ParameterName, 'Build directory, overrides `build.build-dir` in `config.toml`') - [CompletionResult]::new('--build', 'build', [CompletionResultType]::ParameterName, 'build target of the stage0 compiler') - [CompletionResult]::new('--host', 'host', [CompletionResultType]::ParameterName, 'host targets to build') - [CompletionResult]::new('--target', 'target', [CompletionResultType]::ParameterName, 'target targets to build') - [CompletionResult]::new('--exclude', 'exclude', [CompletionResultType]::ParameterName, 'build paths to exclude') - [CompletionResult]::new('--skip', 'skip', [CompletionResultType]::ParameterName, 'build paths to skip') - [CompletionResult]::new('--rustc-error-format', 'rustc-error-format', [CompletionResultType]::ParameterName, 'rustc-error-format') - [CompletionResult]::new('--on-fail', 'on-fail', [CompletionResultType]::ParameterName, 'command to run on failure') - [CompletionResult]::new('--stage', 'stage', [CompletionResultType]::ParameterName, 'stage to build (indicates compiler to use/test, e.g., stage 0 uses the bootstrap compiler, stage 1 the stage 0 rustc artifacts, etc.)') - [CompletionResult]::new('--keep-stage', 'keep-stage', [CompletionResultType]::ParameterName, 'stage(s) to keep without recompiling (pass multiple times to keep e.g., both stages 0 and 1)') - [CompletionResult]::new('--keep-stage-std', 'keep-stage-std', [CompletionResultType]::ParameterName, 'stage(s) of the standard library to keep without recompiling (pass multiple times to keep e.g., both stages 0 and 1)') - [CompletionResult]::new('--src', 'src', [CompletionResultType]::ParameterName, 'path to the root of the rust checkout') - [CompletionResult]::new('-j', 'j', [CompletionResultType]::ParameterName, 'number of jobs to run in parallel') - [CompletionResult]::new('--jobs', 'jobs', [CompletionResultType]::ParameterName, 'number of jobs to run in parallel') - [CompletionResult]::new('--warnings', 'warnings', [CompletionResultType]::ParameterName, 'if value is deny, will deny warnings if value is warn, will emit warnings otherwise, use the default configured behaviour') - [CompletionResult]::new('--error-format', 'error-format', [CompletionResultType]::ParameterName, 'rustc error format') - [CompletionResult]::new('--color', 'color', [CompletionResultType]::ParameterName, 'whether to use color in cargo and rustc output') - [CompletionResult]::new('--llvm-skip-rebuild', 'llvm-skip-rebuild', [CompletionResultType]::ParameterName, 'whether rebuilding llvm should be skipped, overriding `skip-rebuld` in config.toml') - [CompletionResult]::new('--rust-profile-generate', 'rust-profile-generate', [CompletionResultType]::ParameterName, 'generate PGO profile with rustc build') - [CompletionResult]::new('--rust-profile-use', 'rust-profile-use', [CompletionResultType]::ParameterName, 'use PGO profile for rustc build') - [CompletionResult]::new('--llvm-profile-use', 'llvm-profile-use', [CompletionResultType]::ParameterName, 'use PGO profile for LLVM build') - [CompletionResult]::new('--reproducible-artifact', 'reproducible-artifact', [CompletionResultType]::ParameterName, 'Additional reproducible artifacts that should be added to the reproducible artifacts archive') - [CompletionResult]::new('--set', 'set', [CompletionResultType]::ParameterName, 'override options in config.toml') - [CompletionResult]::new('--all-targets', 'all-targets', [CompletionResultType]::ParameterName, 'Check all targets') - [CompletionResult]::new('-v', 'v', [CompletionResultType]::ParameterName, 'use verbose output (-vv for very verbose)') - [CompletionResult]::new('--verbose', 'verbose', [CompletionResultType]::ParameterName, 'use verbose output (-vv for very verbose)') - [CompletionResult]::new('-i', 'i', [CompletionResultType]::ParameterName, 'use incremental compilation') - [CompletionResult]::new('--incremental', 'incremental', [CompletionResultType]::ParameterName, 'use incremental compilation') - [CompletionResult]::new('--include-default-paths', 'include-default-paths', [CompletionResultType]::ParameterName, 'include default paths in addition to the provided ones') - [CompletionResult]::new('--dry-run', 'dry-run', [CompletionResultType]::ParameterName, 'dry run; don''t build anything') - [CompletionResult]::new('--dump-bootstrap-shims', 'dump-bootstrap-shims', [CompletionResultType]::ParameterName, 'Indicates whether to dump the work done from bootstrap shims') - [CompletionResult]::new('--json-output', 'json-output', [CompletionResultType]::ParameterName, 'use message-format=json') - [CompletionResult]::new('--bypass-bootstrap-lock', 'bypass-bootstrap-lock', [CompletionResultType]::ParameterName, 'Bootstrap uses this value to decide whether it should bypass locking the build process. This is rarely needed (e.g., compiling the std library for different targets in parallel)') - [CompletionResult]::new('--llvm-profile-generate', 'llvm-profile-generate', [CompletionResultType]::ParameterName, 'generate PGO profile with llvm built for rustc') - [CompletionResult]::new('--enable-bolt-settings', 'enable-bolt-settings', [CompletionResultType]::ParameterName, 'Enable BOLT link flags') - [CompletionResult]::new('--skip-stage0-validation', 'skip-stage0-validation', [CompletionResultType]::ParameterName, 'Skip stage0 compiler validation') - [CompletionResult]::new('-h', 'h', [CompletionResultType]::ParameterName, 'Print help (see more with ''--help'')') - [CompletionResult]::new('--help', 'help', [CompletionResultType]::ParameterName, 'Print help (see more with ''--help'')') + [CompletionResult]::new('--config', '--config', [CompletionResultType]::ParameterName, 'TOML configuration file for build') + [CompletionResult]::new('--build-dir', '--build-dir', [CompletionResultType]::ParameterName, 'Build directory, overrides `build.build-dir` in `config.toml`') + [CompletionResult]::new('--build', '--build', [CompletionResultType]::ParameterName, 'build target of the stage0 compiler') + [CompletionResult]::new('--host', '--host', [CompletionResultType]::ParameterName, 'host targets to build') + [CompletionResult]::new('--target', '--target', [CompletionResultType]::ParameterName, 'target targets to build') + [CompletionResult]::new('--exclude', '--exclude', [CompletionResultType]::ParameterName, 'build paths to exclude') + [CompletionResult]::new('--skip', '--skip', [CompletionResultType]::ParameterName, 'build paths to skip') + [CompletionResult]::new('--rustc-error-format', '--rustc-error-format', [CompletionResultType]::ParameterName, 'rustc-error-format') + [CompletionResult]::new('--on-fail', '--on-fail', [CompletionResultType]::ParameterName, 'command to run on failure') + [CompletionResult]::new('--stage', '--stage', [CompletionResultType]::ParameterName, 'stage to build (indicates compiler to use/test, e.g., stage 0 uses the bootstrap compiler, stage 1 the stage 0 rustc artifacts, etc.)') + [CompletionResult]::new('--keep-stage', '--keep-stage', [CompletionResultType]::ParameterName, 'stage(s) to keep without recompiling (pass multiple times to keep e.g., both stages 0 and 1)') + [CompletionResult]::new('--keep-stage-std', '--keep-stage-std', [CompletionResultType]::ParameterName, 'stage(s) of the standard library to keep without recompiling (pass multiple times to keep e.g., both stages 0 and 1)') + [CompletionResult]::new('--src', '--src', [CompletionResultType]::ParameterName, 'path to the root of the rust checkout') + [CompletionResult]::new('-j', '-j', [CompletionResultType]::ParameterName, 'number of jobs to run in parallel') + [CompletionResult]::new('--jobs', '--jobs', [CompletionResultType]::ParameterName, 'number of jobs to run in parallel') + [CompletionResult]::new('--warnings', '--warnings', [CompletionResultType]::ParameterName, 'if value is deny, will deny warnings if value is warn, will emit warnings otherwise, use the default configured behaviour') + [CompletionResult]::new('--error-format', '--error-format', [CompletionResultType]::ParameterName, 'rustc error format') + [CompletionResult]::new('--color', '--color', [CompletionResultType]::ParameterName, 'whether to use color in cargo and rustc output') + [CompletionResult]::new('--llvm-skip-rebuild', '--llvm-skip-rebuild', [CompletionResultType]::ParameterName, 'whether rebuilding llvm should be skipped, overriding `skip-rebuld` in config.toml') + [CompletionResult]::new('--rust-profile-generate', '--rust-profile-generate', [CompletionResultType]::ParameterName, 'generate PGO profile with rustc build') + [CompletionResult]::new('--rust-profile-use', '--rust-profile-use', [CompletionResultType]::ParameterName, 'use PGO profile for rustc build') + [CompletionResult]::new('--llvm-profile-use', '--llvm-profile-use', [CompletionResultType]::ParameterName, 'use PGO profile for LLVM build') + [CompletionResult]::new('--reproducible-artifact', '--reproducible-artifact', [CompletionResultType]::ParameterName, 'Additional reproducible artifacts that should be added to the reproducible artifacts archive') + [CompletionResult]::new('--set', '--set', [CompletionResultType]::ParameterName, 'override options in config.toml') + [CompletionResult]::new('--all-targets', '--all-targets', [CompletionResultType]::ParameterName, 'Check all targets') + [CompletionResult]::new('-v', '-v', [CompletionResultType]::ParameterName, 'use verbose output (-vv for very verbose)') + [CompletionResult]::new('--verbose', '--verbose', [CompletionResultType]::ParameterName, 'use verbose output (-vv for very verbose)') + [CompletionResult]::new('-i', '-i', [CompletionResultType]::ParameterName, 'use incremental compilation') + [CompletionResult]::new('--incremental', '--incremental', [CompletionResultType]::ParameterName, 'use incremental compilation') + [CompletionResult]::new('--include-default-paths', '--include-default-paths', [CompletionResultType]::ParameterName, 'include default paths in addition to the provided ones') + [CompletionResult]::new('--dry-run', '--dry-run', [CompletionResultType]::ParameterName, 'dry run; don''t build anything') + [CompletionResult]::new('--dump-bootstrap-shims', '--dump-bootstrap-shims', [CompletionResultType]::ParameterName, 'Indicates whether to dump the work done from bootstrap shims') + [CompletionResult]::new('--json-output', '--json-output', [CompletionResultType]::ParameterName, 'use message-format=json') + [CompletionResult]::new('--bypass-bootstrap-lock', '--bypass-bootstrap-lock', [CompletionResultType]::ParameterName, 'Bootstrap uses this value to decide whether it should bypass locking the build process. This is rarely needed (e.g., compiling the std library for different targets in parallel)') + [CompletionResult]::new('--llvm-profile-generate', '--llvm-profile-generate', [CompletionResultType]::ParameterName, 'generate PGO profile with llvm built for rustc') + [CompletionResult]::new('--enable-bolt-settings', '--enable-bolt-settings', [CompletionResultType]::ParameterName, 'Enable BOLT link flags') + [CompletionResult]::new('--skip-stage0-validation', '--skip-stage0-validation', [CompletionResultType]::ParameterName, 'Skip stage0 compiler validation') + [CompletionResult]::new('-h', '-h', [CompletionResultType]::ParameterName, 'Print help (see more with ''--help'')') + [CompletionResult]::new('--help', '--help', [CompletionResultType]::ParameterName, 'Print help (see more with ''--help'')') break } 'x.py;clippy' { - [CompletionResult]::new('-A', 'A ', [CompletionResultType]::ParameterName, 'clippy lints to allow') - [CompletionResult]::new('-D', 'D ', [CompletionResultType]::ParameterName, 'clippy lints to deny') - [CompletionResult]::new('-W', 'W ', [CompletionResultType]::ParameterName, 'clippy lints to warn on') - [CompletionResult]::new('-F', 'F ', [CompletionResultType]::ParameterName, 'clippy lints to forbid') - [CompletionResult]::new('--config', 'config', [CompletionResultType]::ParameterName, 'TOML configuration file for build') - [CompletionResult]::new('--build-dir', 'build-dir', [CompletionResultType]::ParameterName, 'Build directory, overrides `build.build-dir` in `config.toml`') - [CompletionResult]::new('--build', 'build', [CompletionResultType]::ParameterName, 'build target of the stage0 compiler') - [CompletionResult]::new('--host', 'host', [CompletionResultType]::ParameterName, 'host targets to build') - [CompletionResult]::new('--target', 'target', [CompletionResultType]::ParameterName, 'target targets to build') - [CompletionResult]::new('--exclude', 'exclude', [CompletionResultType]::ParameterName, 'build paths to exclude') - [CompletionResult]::new('--skip', 'skip', [CompletionResultType]::ParameterName, 'build paths to skip') - [CompletionResult]::new('--rustc-error-format', 'rustc-error-format', [CompletionResultType]::ParameterName, 'rustc-error-format') - [CompletionResult]::new('--on-fail', 'on-fail', [CompletionResultType]::ParameterName, 'command to run on failure') - [CompletionResult]::new('--stage', 'stage', [CompletionResultType]::ParameterName, 'stage to build (indicates compiler to use/test, e.g., stage 0 uses the bootstrap compiler, stage 1 the stage 0 rustc artifacts, etc.)') - [CompletionResult]::new('--keep-stage', 'keep-stage', [CompletionResultType]::ParameterName, 'stage(s) to keep without recompiling (pass multiple times to keep e.g., both stages 0 and 1)') - [CompletionResult]::new('--keep-stage-std', 'keep-stage-std', [CompletionResultType]::ParameterName, 'stage(s) of the standard library to keep without recompiling (pass multiple times to keep e.g., both stages 0 and 1)') - [CompletionResult]::new('--src', 'src', [CompletionResultType]::ParameterName, 'path to the root of the rust checkout') - [CompletionResult]::new('-j', 'j', [CompletionResultType]::ParameterName, 'number of jobs to run in parallel') - [CompletionResult]::new('--jobs', 'jobs', [CompletionResultType]::ParameterName, 'number of jobs to run in parallel') - [CompletionResult]::new('--warnings', 'warnings', [CompletionResultType]::ParameterName, 'if value is deny, will deny warnings if value is warn, will emit warnings otherwise, use the default configured behaviour') - [CompletionResult]::new('--error-format', 'error-format', [CompletionResultType]::ParameterName, 'rustc error format') - [CompletionResult]::new('--color', 'color', [CompletionResultType]::ParameterName, 'whether to use color in cargo and rustc output') - [CompletionResult]::new('--llvm-skip-rebuild', 'llvm-skip-rebuild', [CompletionResultType]::ParameterName, 'whether rebuilding llvm should be skipped, overriding `skip-rebuld` in config.toml') - [CompletionResult]::new('--rust-profile-generate', 'rust-profile-generate', [CompletionResultType]::ParameterName, 'generate PGO profile with rustc build') - [CompletionResult]::new('--rust-profile-use', 'rust-profile-use', [CompletionResultType]::ParameterName, 'use PGO profile for rustc build') - [CompletionResult]::new('--llvm-profile-use', 'llvm-profile-use', [CompletionResultType]::ParameterName, 'use PGO profile for LLVM build') - [CompletionResult]::new('--reproducible-artifact', 'reproducible-artifact', [CompletionResultType]::ParameterName, 'Additional reproducible artifacts that should be added to the reproducible artifacts archive') - [CompletionResult]::new('--set', 'set', [CompletionResultType]::ParameterName, 'override options in config.toml') - [CompletionResult]::new('--fix', 'fix', [CompletionResultType]::ParameterName, 'fix') - [CompletionResult]::new('--allow-dirty', 'allow-dirty', [CompletionResultType]::ParameterName, 'allow-dirty') - [CompletionResult]::new('--allow-staged', 'allow-staged', [CompletionResultType]::ParameterName, 'allow-staged') - [CompletionResult]::new('-v', 'v', [CompletionResultType]::ParameterName, 'use verbose output (-vv for very verbose)') - [CompletionResult]::new('--verbose', 'verbose', [CompletionResultType]::ParameterName, 'use verbose output (-vv for very verbose)') - [CompletionResult]::new('-i', 'i', [CompletionResultType]::ParameterName, 'use incremental compilation') - [CompletionResult]::new('--incremental', 'incremental', [CompletionResultType]::ParameterName, 'use incremental compilation') - [CompletionResult]::new('--include-default-paths', 'include-default-paths', [CompletionResultType]::ParameterName, 'include default paths in addition to the provided ones') - [CompletionResult]::new('--dry-run', 'dry-run', [CompletionResultType]::ParameterName, 'dry run; don''t build anything') - [CompletionResult]::new('--dump-bootstrap-shims', 'dump-bootstrap-shims', [CompletionResultType]::ParameterName, 'Indicates whether to dump the work done from bootstrap shims') - [CompletionResult]::new('--json-output', 'json-output', [CompletionResultType]::ParameterName, 'use message-format=json') - [CompletionResult]::new('--bypass-bootstrap-lock', 'bypass-bootstrap-lock', [CompletionResultType]::ParameterName, 'Bootstrap uses this value to decide whether it should bypass locking the build process. This is rarely needed (e.g., compiling the std library for different targets in parallel)') - [CompletionResult]::new('--llvm-profile-generate', 'llvm-profile-generate', [CompletionResultType]::ParameterName, 'generate PGO profile with llvm built for rustc') - [CompletionResult]::new('--enable-bolt-settings', 'enable-bolt-settings', [CompletionResultType]::ParameterName, 'Enable BOLT link flags') - [CompletionResult]::new('--skip-stage0-validation', 'skip-stage0-validation', [CompletionResultType]::ParameterName, 'Skip stage0 compiler validation') - [CompletionResult]::new('-h', 'h', [CompletionResultType]::ParameterName, 'Print help (see more with ''--help'')') - [CompletionResult]::new('--help', 'help', [CompletionResultType]::ParameterName, 'Print help (see more with ''--help'')') + [CompletionResult]::new('-A', '-A ', [CompletionResultType]::ParameterName, 'clippy lints to allow') + [CompletionResult]::new('-D', '-D ', [CompletionResultType]::ParameterName, 'clippy lints to deny') + [CompletionResult]::new('-W', '-W ', [CompletionResultType]::ParameterName, 'clippy lints to warn on') + [CompletionResult]::new('-F', '-F ', [CompletionResultType]::ParameterName, 'clippy lints to forbid') + [CompletionResult]::new('--config', '--config', [CompletionResultType]::ParameterName, 'TOML configuration file for build') + [CompletionResult]::new('--build-dir', '--build-dir', [CompletionResultType]::ParameterName, 'Build directory, overrides `build.build-dir` in `config.toml`') + [CompletionResult]::new('--build', '--build', [CompletionResultType]::ParameterName, 'build target of the stage0 compiler') + [CompletionResult]::new('--host', '--host', [CompletionResultType]::ParameterName, 'host targets to build') + [CompletionResult]::new('--target', '--target', [CompletionResultType]::ParameterName, 'target targets to build') + [CompletionResult]::new('--exclude', '--exclude', [CompletionResultType]::ParameterName, 'build paths to exclude') + [CompletionResult]::new('--skip', '--skip', [CompletionResultType]::ParameterName, 'build paths to skip') + [CompletionResult]::new('--rustc-error-format', '--rustc-error-format', [CompletionResultType]::ParameterName, 'rustc-error-format') + [CompletionResult]::new('--on-fail', '--on-fail', [CompletionResultType]::ParameterName, 'command to run on failure') + [CompletionResult]::new('--stage', '--stage', [CompletionResultType]::ParameterName, 'stage to build (indicates compiler to use/test, e.g., stage 0 uses the bootstrap compiler, stage 1 the stage 0 rustc artifacts, etc.)') + [CompletionResult]::new('--keep-stage', '--keep-stage', [CompletionResultType]::ParameterName, 'stage(s) to keep without recompiling (pass multiple times to keep e.g., both stages 0 and 1)') + [CompletionResult]::new('--keep-stage-std', '--keep-stage-std', [CompletionResultType]::ParameterName, 'stage(s) of the standard library to keep without recompiling (pass multiple times to keep e.g., both stages 0 and 1)') + [CompletionResult]::new('--src', '--src', [CompletionResultType]::ParameterName, 'path to the root of the rust checkout') + [CompletionResult]::new('-j', '-j', [CompletionResultType]::ParameterName, 'number of jobs to run in parallel') + [CompletionResult]::new('--jobs', '--jobs', [CompletionResultType]::ParameterName, 'number of jobs to run in parallel') + [CompletionResult]::new('--warnings', '--warnings', [CompletionResultType]::ParameterName, 'if value is deny, will deny warnings if value is warn, will emit warnings otherwise, use the default configured behaviour') + [CompletionResult]::new('--error-format', '--error-format', [CompletionResultType]::ParameterName, 'rustc error format') + [CompletionResult]::new('--color', '--color', [CompletionResultType]::ParameterName, 'whether to use color in cargo and rustc output') + [CompletionResult]::new('--llvm-skip-rebuild', '--llvm-skip-rebuild', [CompletionResultType]::ParameterName, 'whether rebuilding llvm should be skipped, overriding `skip-rebuld` in config.toml') + [CompletionResult]::new('--rust-profile-generate', '--rust-profile-generate', [CompletionResultType]::ParameterName, 'generate PGO profile with rustc build') + [CompletionResult]::new('--rust-profile-use', '--rust-profile-use', [CompletionResultType]::ParameterName, 'use PGO profile for rustc build') + [CompletionResult]::new('--llvm-profile-use', '--llvm-profile-use', [CompletionResultType]::ParameterName, 'use PGO profile for LLVM build') + [CompletionResult]::new('--reproducible-artifact', '--reproducible-artifact', [CompletionResultType]::ParameterName, 'Additional reproducible artifacts that should be added to the reproducible artifacts archive') + [CompletionResult]::new('--set', '--set', [CompletionResultType]::ParameterName, 'override options in config.toml') + [CompletionResult]::new('--fix', '--fix', [CompletionResultType]::ParameterName, 'fix') + [CompletionResult]::new('--allow-dirty', '--allow-dirty', [CompletionResultType]::ParameterName, 'allow-dirty') + [CompletionResult]::new('--allow-staged', '--allow-staged', [CompletionResultType]::ParameterName, 'allow-staged') + [CompletionResult]::new('-v', '-v', [CompletionResultType]::ParameterName, 'use verbose output (-vv for very verbose)') + [CompletionResult]::new('--verbose', '--verbose', [CompletionResultType]::ParameterName, 'use verbose output (-vv for very verbose)') + [CompletionResult]::new('-i', '-i', [CompletionResultType]::ParameterName, 'use incremental compilation') + [CompletionResult]::new('--incremental', '--incremental', [CompletionResultType]::ParameterName, 'use incremental compilation') + [CompletionResult]::new('--include-default-paths', '--include-default-paths', [CompletionResultType]::ParameterName, 'include default paths in addition to the provided ones') + [CompletionResult]::new('--dry-run', '--dry-run', [CompletionResultType]::ParameterName, 'dry run; don''t build anything') + [CompletionResult]::new('--dump-bootstrap-shims', '--dump-bootstrap-shims', [CompletionResultType]::ParameterName, 'Indicates whether to dump the work done from bootstrap shims') + [CompletionResult]::new('--json-output', '--json-output', [CompletionResultType]::ParameterName, 'use message-format=json') + [CompletionResult]::new('--bypass-bootstrap-lock', '--bypass-bootstrap-lock', [CompletionResultType]::ParameterName, 'Bootstrap uses this value to decide whether it should bypass locking the build process. This is rarely needed (e.g., compiling the std library for different targets in parallel)') + [CompletionResult]::new('--llvm-profile-generate', '--llvm-profile-generate', [CompletionResultType]::ParameterName, 'generate PGO profile with llvm built for rustc') + [CompletionResult]::new('--enable-bolt-settings', '--enable-bolt-settings', [CompletionResultType]::ParameterName, 'Enable BOLT link flags') + [CompletionResult]::new('--skip-stage0-validation', '--skip-stage0-validation', [CompletionResultType]::ParameterName, 'Skip stage0 compiler validation') + [CompletionResult]::new('-h', '-h', [CompletionResultType]::ParameterName, 'Print help (see more with ''--help'')') + [CompletionResult]::new('--help', '--help', [CompletionResultType]::ParameterName, 'Print help (see more with ''--help'')') break } 'x.py;fix' { - [CompletionResult]::new('--config', 'config', [CompletionResultType]::ParameterName, 'TOML configuration file for build') - [CompletionResult]::new('--build-dir', 'build-dir', [CompletionResultType]::ParameterName, 'Build directory, overrides `build.build-dir` in `config.toml`') - [CompletionResult]::new('--build', 'build', [CompletionResultType]::ParameterName, 'build target of the stage0 compiler') - [CompletionResult]::new('--host', 'host', [CompletionResultType]::ParameterName, 'host targets to build') - [CompletionResult]::new('--target', 'target', [CompletionResultType]::ParameterName, 'target targets to build') - [CompletionResult]::new('--exclude', 'exclude', [CompletionResultType]::ParameterName, 'build paths to exclude') - [CompletionResult]::new('--skip', 'skip', [CompletionResultType]::ParameterName, 'build paths to skip') - [CompletionResult]::new('--rustc-error-format', 'rustc-error-format', [CompletionResultType]::ParameterName, 'rustc-error-format') - [CompletionResult]::new('--on-fail', 'on-fail', [CompletionResultType]::ParameterName, 'command to run on failure') - [CompletionResult]::new('--stage', 'stage', [CompletionResultType]::ParameterName, 'stage to build (indicates compiler to use/test, e.g., stage 0 uses the bootstrap compiler, stage 1 the stage 0 rustc artifacts, etc.)') - [CompletionResult]::new('--keep-stage', 'keep-stage', [CompletionResultType]::ParameterName, 'stage(s) to keep without recompiling (pass multiple times to keep e.g., both stages 0 and 1)') - [CompletionResult]::new('--keep-stage-std', 'keep-stage-std', [CompletionResultType]::ParameterName, 'stage(s) of the standard library to keep without recompiling (pass multiple times to keep e.g., both stages 0 and 1)') - [CompletionResult]::new('--src', 'src', [CompletionResultType]::ParameterName, 'path to the root of the rust checkout') - [CompletionResult]::new('-j', 'j', [CompletionResultType]::ParameterName, 'number of jobs to run in parallel') - [CompletionResult]::new('--jobs', 'jobs', [CompletionResultType]::ParameterName, 'number of jobs to run in parallel') - [CompletionResult]::new('--warnings', 'warnings', [CompletionResultType]::ParameterName, 'if value is deny, will deny warnings if value is warn, will emit warnings otherwise, use the default configured behaviour') - [CompletionResult]::new('--error-format', 'error-format', [CompletionResultType]::ParameterName, 'rustc error format') - [CompletionResult]::new('--color', 'color', [CompletionResultType]::ParameterName, 'whether to use color in cargo and rustc output') - [CompletionResult]::new('--llvm-skip-rebuild', 'llvm-skip-rebuild', [CompletionResultType]::ParameterName, 'whether rebuilding llvm should be skipped, overriding `skip-rebuld` in config.toml') - [CompletionResult]::new('--rust-profile-generate', 'rust-profile-generate', [CompletionResultType]::ParameterName, 'generate PGO profile with rustc build') - [CompletionResult]::new('--rust-profile-use', 'rust-profile-use', [CompletionResultType]::ParameterName, 'use PGO profile for rustc build') - [CompletionResult]::new('--llvm-profile-use', 'llvm-profile-use', [CompletionResultType]::ParameterName, 'use PGO profile for LLVM build') - [CompletionResult]::new('--reproducible-artifact', 'reproducible-artifact', [CompletionResultType]::ParameterName, 'Additional reproducible artifacts that should be added to the reproducible artifacts archive') - [CompletionResult]::new('--set', 'set', [CompletionResultType]::ParameterName, 'override options in config.toml') - [CompletionResult]::new('-v', 'v', [CompletionResultType]::ParameterName, 'use verbose output (-vv for very verbose)') - [CompletionResult]::new('--verbose', 'verbose', [CompletionResultType]::ParameterName, 'use verbose output (-vv for very verbose)') - [CompletionResult]::new('-i', 'i', [CompletionResultType]::ParameterName, 'use incremental compilation') - [CompletionResult]::new('--incremental', 'incremental', [CompletionResultType]::ParameterName, 'use incremental compilation') - [CompletionResult]::new('--include-default-paths', 'include-default-paths', [CompletionResultType]::ParameterName, 'include default paths in addition to the provided ones') - [CompletionResult]::new('--dry-run', 'dry-run', [CompletionResultType]::ParameterName, 'dry run; don''t build anything') - [CompletionResult]::new('--dump-bootstrap-shims', 'dump-bootstrap-shims', [CompletionResultType]::ParameterName, 'Indicates whether to dump the work done from bootstrap shims') - [CompletionResult]::new('--json-output', 'json-output', [CompletionResultType]::ParameterName, 'use message-format=json') - [CompletionResult]::new('--bypass-bootstrap-lock', 'bypass-bootstrap-lock', [CompletionResultType]::ParameterName, 'Bootstrap uses this value to decide whether it should bypass locking the build process. This is rarely needed (e.g., compiling the std library for different targets in parallel)') - [CompletionResult]::new('--llvm-profile-generate', 'llvm-profile-generate', [CompletionResultType]::ParameterName, 'generate PGO profile with llvm built for rustc') - [CompletionResult]::new('--enable-bolt-settings', 'enable-bolt-settings', [CompletionResultType]::ParameterName, 'Enable BOLT link flags') - [CompletionResult]::new('--skip-stage0-validation', 'skip-stage0-validation', [CompletionResultType]::ParameterName, 'Skip stage0 compiler validation') - [CompletionResult]::new('-h', 'h', [CompletionResultType]::ParameterName, 'Print help (see more with ''--help'')') - [CompletionResult]::new('--help', 'help', [CompletionResultType]::ParameterName, 'Print help (see more with ''--help'')') + [CompletionResult]::new('--config', '--config', [CompletionResultType]::ParameterName, 'TOML configuration file for build') + [CompletionResult]::new('--build-dir', '--build-dir', [CompletionResultType]::ParameterName, 'Build directory, overrides `build.build-dir` in `config.toml`') + [CompletionResult]::new('--build', '--build', [CompletionResultType]::ParameterName, 'build target of the stage0 compiler') + [CompletionResult]::new('--host', '--host', [CompletionResultType]::ParameterName, 'host targets to build') + [CompletionResult]::new('--target', '--target', [CompletionResultType]::ParameterName, 'target targets to build') + [CompletionResult]::new('--exclude', '--exclude', [CompletionResultType]::ParameterName, 'build paths to exclude') + [CompletionResult]::new('--skip', '--skip', [CompletionResultType]::ParameterName, 'build paths to skip') + [CompletionResult]::new('--rustc-error-format', '--rustc-error-format', [CompletionResultType]::ParameterName, 'rustc-error-format') + [CompletionResult]::new('--on-fail', '--on-fail', [CompletionResultType]::ParameterName, 'command to run on failure') + [CompletionResult]::new('--stage', '--stage', [CompletionResultType]::ParameterName, 'stage to build (indicates compiler to use/test, e.g., stage 0 uses the bootstrap compiler, stage 1 the stage 0 rustc artifacts, etc.)') + [CompletionResult]::new('--keep-stage', '--keep-stage', [CompletionResultType]::ParameterName, 'stage(s) to keep without recompiling (pass multiple times to keep e.g., both stages 0 and 1)') + [CompletionResult]::new('--keep-stage-std', '--keep-stage-std', [CompletionResultType]::ParameterName, 'stage(s) of the standard library to keep without recompiling (pass multiple times to keep e.g., both stages 0 and 1)') + [CompletionResult]::new('--src', '--src', [CompletionResultType]::ParameterName, 'path to the root of the rust checkout') + [CompletionResult]::new('-j', '-j', [CompletionResultType]::ParameterName, 'number of jobs to run in parallel') + [CompletionResult]::new('--jobs', '--jobs', [CompletionResultType]::ParameterName, 'number of jobs to run in parallel') + [CompletionResult]::new('--warnings', '--warnings', [CompletionResultType]::ParameterName, 'if value is deny, will deny warnings if value is warn, will emit warnings otherwise, use the default configured behaviour') + [CompletionResult]::new('--error-format', '--error-format', [CompletionResultType]::ParameterName, 'rustc error format') + [CompletionResult]::new('--color', '--color', [CompletionResultType]::ParameterName, 'whether to use color in cargo and rustc output') + [CompletionResult]::new('--llvm-skip-rebuild', '--llvm-skip-rebuild', [CompletionResultType]::ParameterName, 'whether rebuilding llvm should be skipped, overriding `skip-rebuld` in config.toml') + [CompletionResult]::new('--rust-profile-generate', '--rust-profile-generate', [CompletionResultType]::ParameterName, 'generate PGO profile with rustc build') + [CompletionResult]::new('--rust-profile-use', '--rust-profile-use', [CompletionResultType]::ParameterName, 'use PGO profile for rustc build') + [CompletionResult]::new('--llvm-profile-use', '--llvm-profile-use', [CompletionResultType]::ParameterName, 'use PGO profile for LLVM build') + [CompletionResult]::new('--reproducible-artifact', '--reproducible-artifact', [CompletionResultType]::ParameterName, 'Additional reproducible artifacts that should be added to the reproducible artifacts archive') + [CompletionResult]::new('--set', '--set', [CompletionResultType]::ParameterName, 'override options in config.toml') + [CompletionResult]::new('-v', '-v', [CompletionResultType]::ParameterName, 'use verbose output (-vv for very verbose)') + [CompletionResult]::new('--verbose', '--verbose', [CompletionResultType]::ParameterName, 'use verbose output (-vv for very verbose)') + [CompletionResult]::new('-i', '-i', [CompletionResultType]::ParameterName, 'use incremental compilation') + [CompletionResult]::new('--incremental', '--incremental', [CompletionResultType]::ParameterName, 'use incremental compilation') + [CompletionResult]::new('--include-default-paths', '--include-default-paths', [CompletionResultType]::ParameterName, 'include default paths in addition to the provided ones') + [CompletionResult]::new('--dry-run', '--dry-run', [CompletionResultType]::ParameterName, 'dry run; don''t build anything') + [CompletionResult]::new('--dump-bootstrap-shims', '--dump-bootstrap-shims', [CompletionResultType]::ParameterName, 'Indicates whether to dump the work done from bootstrap shims') + [CompletionResult]::new('--json-output', '--json-output', [CompletionResultType]::ParameterName, 'use message-format=json') + [CompletionResult]::new('--bypass-bootstrap-lock', '--bypass-bootstrap-lock', [CompletionResultType]::ParameterName, 'Bootstrap uses this value to decide whether it should bypass locking the build process. This is rarely needed (e.g., compiling the std library for different targets in parallel)') + [CompletionResult]::new('--llvm-profile-generate', '--llvm-profile-generate', [CompletionResultType]::ParameterName, 'generate PGO profile with llvm built for rustc') + [CompletionResult]::new('--enable-bolt-settings', '--enable-bolt-settings', [CompletionResultType]::ParameterName, 'Enable BOLT link flags') + [CompletionResult]::new('--skip-stage0-validation', '--skip-stage0-validation', [CompletionResultType]::ParameterName, 'Skip stage0 compiler validation') + [CompletionResult]::new('-h', '-h', [CompletionResultType]::ParameterName, 'Print help (see more with ''--help'')') + [CompletionResult]::new('--help', '--help', [CompletionResultType]::ParameterName, 'Print help (see more with ''--help'')') break } 'x.py;fmt' { - [CompletionResult]::new('--config', 'config', [CompletionResultType]::ParameterName, 'TOML configuration file for build') - [CompletionResult]::new('--build-dir', 'build-dir', [CompletionResultType]::ParameterName, 'Build directory, overrides `build.build-dir` in `config.toml`') - [CompletionResult]::new('--build', 'build', [CompletionResultType]::ParameterName, 'build target of the stage0 compiler') - [CompletionResult]::new('--host', 'host', [CompletionResultType]::ParameterName, 'host targets to build') - [CompletionResult]::new('--target', 'target', [CompletionResultType]::ParameterName, 'target targets to build') - [CompletionResult]::new('--exclude', 'exclude', [CompletionResultType]::ParameterName, 'build paths to exclude') - [CompletionResult]::new('--skip', 'skip', [CompletionResultType]::ParameterName, 'build paths to skip') - [CompletionResult]::new('--rustc-error-format', 'rustc-error-format', [CompletionResultType]::ParameterName, 'rustc-error-format') - [CompletionResult]::new('--on-fail', 'on-fail', [CompletionResultType]::ParameterName, 'command to run on failure') - [CompletionResult]::new('--stage', 'stage', [CompletionResultType]::ParameterName, 'stage to build (indicates compiler to use/test, e.g., stage 0 uses the bootstrap compiler, stage 1 the stage 0 rustc artifacts, etc.)') - [CompletionResult]::new('--keep-stage', 'keep-stage', [CompletionResultType]::ParameterName, 'stage(s) to keep without recompiling (pass multiple times to keep e.g., both stages 0 and 1)') - [CompletionResult]::new('--keep-stage-std', 'keep-stage-std', [CompletionResultType]::ParameterName, 'stage(s) of the standard library to keep without recompiling (pass multiple times to keep e.g., both stages 0 and 1)') - [CompletionResult]::new('--src', 'src', [CompletionResultType]::ParameterName, 'path to the root of the rust checkout') - [CompletionResult]::new('-j', 'j', [CompletionResultType]::ParameterName, 'number of jobs to run in parallel') - [CompletionResult]::new('--jobs', 'jobs', [CompletionResultType]::ParameterName, 'number of jobs to run in parallel') - [CompletionResult]::new('--warnings', 'warnings', [CompletionResultType]::ParameterName, 'if value is deny, will deny warnings if value is warn, will emit warnings otherwise, use the default configured behaviour') - [CompletionResult]::new('--error-format', 'error-format', [CompletionResultType]::ParameterName, 'rustc error format') - [CompletionResult]::new('--color', 'color', [CompletionResultType]::ParameterName, 'whether to use color in cargo and rustc output') - [CompletionResult]::new('--llvm-skip-rebuild', 'llvm-skip-rebuild', [CompletionResultType]::ParameterName, 'whether rebuilding llvm should be skipped, overriding `skip-rebuld` in config.toml') - [CompletionResult]::new('--rust-profile-generate', 'rust-profile-generate', [CompletionResultType]::ParameterName, 'generate PGO profile with rustc build') - [CompletionResult]::new('--rust-profile-use', 'rust-profile-use', [CompletionResultType]::ParameterName, 'use PGO profile for rustc build') - [CompletionResult]::new('--llvm-profile-use', 'llvm-profile-use', [CompletionResultType]::ParameterName, 'use PGO profile for LLVM build') - [CompletionResult]::new('--reproducible-artifact', 'reproducible-artifact', [CompletionResultType]::ParameterName, 'Additional reproducible artifacts that should be added to the reproducible artifacts archive') - [CompletionResult]::new('--set', 'set', [CompletionResultType]::ParameterName, 'override options in config.toml') - [CompletionResult]::new('--check', 'check', [CompletionResultType]::ParameterName, 'check formatting instead of applying') - [CompletionResult]::new('--all', 'all', [CompletionResultType]::ParameterName, 'apply to all appropriate files, not just those that have been modified') - [CompletionResult]::new('-v', 'v', [CompletionResultType]::ParameterName, 'use verbose output (-vv for very verbose)') - [CompletionResult]::new('--verbose', 'verbose', [CompletionResultType]::ParameterName, 'use verbose output (-vv for very verbose)') - [CompletionResult]::new('-i', 'i', [CompletionResultType]::ParameterName, 'use incremental compilation') - [CompletionResult]::new('--incremental', 'incremental', [CompletionResultType]::ParameterName, 'use incremental compilation') - [CompletionResult]::new('--include-default-paths', 'include-default-paths', [CompletionResultType]::ParameterName, 'include default paths in addition to the provided ones') - [CompletionResult]::new('--dry-run', 'dry-run', [CompletionResultType]::ParameterName, 'dry run; don''t build anything') - [CompletionResult]::new('--dump-bootstrap-shims', 'dump-bootstrap-shims', [CompletionResultType]::ParameterName, 'Indicates whether to dump the work done from bootstrap shims') - [CompletionResult]::new('--json-output', 'json-output', [CompletionResultType]::ParameterName, 'use message-format=json') - [CompletionResult]::new('--bypass-bootstrap-lock', 'bypass-bootstrap-lock', [CompletionResultType]::ParameterName, 'Bootstrap uses this value to decide whether it should bypass locking the build process. This is rarely needed (e.g., compiling the std library for different targets in parallel)') - [CompletionResult]::new('--llvm-profile-generate', 'llvm-profile-generate', [CompletionResultType]::ParameterName, 'generate PGO profile with llvm built for rustc') - [CompletionResult]::new('--enable-bolt-settings', 'enable-bolt-settings', [CompletionResultType]::ParameterName, 'Enable BOLT link flags') - [CompletionResult]::new('--skip-stage0-validation', 'skip-stage0-validation', [CompletionResultType]::ParameterName, 'Skip stage0 compiler validation') - [CompletionResult]::new('-h', 'h', [CompletionResultType]::ParameterName, 'Print help (see more with ''--help'')') - [CompletionResult]::new('--help', 'help', [CompletionResultType]::ParameterName, 'Print help (see more with ''--help'')') + [CompletionResult]::new('--config', '--config', [CompletionResultType]::ParameterName, 'TOML configuration file for build') + [CompletionResult]::new('--build-dir', '--build-dir', [CompletionResultType]::ParameterName, 'Build directory, overrides `build.build-dir` in `config.toml`') + [CompletionResult]::new('--build', '--build', [CompletionResultType]::ParameterName, 'build target of the stage0 compiler') + [CompletionResult]::new('--host', '--host', [CompletionResultType]::ParameterName, 'host targets to build') + [CompletionResult]::new('--target', '--target', [CompletionResultType]::ParameterName, 'target targets to build') + [CompletionResult]::new('--exclude', '--exclude', [CompletionResultType]::ParameterName, 'build paths to exclude') + [CompletionResult]::new('--skip', '--skip', [CompletionResultType]::ParameterName, 'build paths to skip') + [CompletionResult]::new('--rustc-error-format', '--rustc-error-format', [CompletionResultType]::ParameterName, 'rustc-error-format') + [CompletionResult]::new('--on-fail', '--on-fail', [CompletionResultType]::ParameterName, 'command to run on failure') + [CompletionResult]::new('--stage', '--stage', [CompletionResultType]::ParameterName, 'stage to build (indicates compiler to use/test, e.g., stage 0 uses the bootstrap compiler, stage 1 the stage 0 rustc artifacts, etc.)') + [CompletionResult]::new('--keep-stage', '--keep-stage', [CompletionResultType]::ParameterName, 'stage(s) to keep without recompiling (pass multiple times to keep e.g., both stages 0 and 1)') + [CompletionResult]::new('--keep-stage-std', '--keep-stage-std', [CompletionResultType]::ParameterName, 'stage(s) of the standard library to keep without recompiling (pass multiple times to keep e.g., both stages 0 and 1)') + [CompletionResult]::new('--src', '--src', [CompletionResultType]::ParameterName, 'path to the root of the rust checkout') + [CompletionResult]::new('-j', '-j', [CompletionResultType]::ParameterName, 'number of jobs to run in parallel') + [CompletionResult]::new('--jobs', '--jobs', [CompletionResultType]::ParameterName, 'number of jobs to run in parallel') + [CompletionResult]::new('--warnings', '--warnings', [CompletionResultType]::ParameterName, 'if value is deny, will deny warnings if value is warn, will emit warnings otherwise, use the default configured behaviour') + [CompletionResult]::new('--error-format', '--error-format', [CompletionResultType]::ParameterName, 'rustc error format') + [CompletionResult]::new('--color', '--color', [CompletionResultType]::ParameterName, 'whether to use color in cargo and rustc output') + [CompletionResult]::new('--llvm-skip-rebuild', '--llvm-skip-rebuild', [CompletionResultType]::ParameterName, 'whether rebuilding llvm should be skipped, overriding `skip-rebuld` in config.toml') + [CompletionResult]::new('--rust-profile-generate', '--rust-profile-generate', [CompletionResultType]::ParameterName, 'generate PGO profile with rustc build') + [CompletionResult]::new('--rust-profile-use', '--rust-profile-use', [CompletionResultType]::ParameterName, 'use PGO profile for rustc build') + [CompletionResult]::new('--llvm-profile-use', '--llvm-profile-use', [CompletionResultType]::ParameterName, 'use PGO profile for LLVM build') + [CompletionResult]::new('--reproducible-artifact', '--reproducible-artifact', [CompletionResultType]::ParameterName, 'Additional reproducible artifacts that should be added to the reproducible artifacts archive') + [CompletionResult]::new('--set', '--set', [CompletionResultType]::ParameterName, 'override options in config.toml') + [CompletionResult]::new('--check', '--check', [CompletionResultType]::ParameterName, 'check formatting instead of applying') + [CompletionResult]::new('--all', '--all', [CompletionResultType]::ParameterName, 'apply to all appropriate files, not just those that have been modified') + [CompletionResult]::new('-v', '-v', [CompletionResultType]::ParameterName, 'use verbose output (-vv for very verbose)') + [CompletionResult]::new('--verbose', '--verbose', [CompletionResultType]::ParameterName, 'use verbose output (-vv for very verbose)') + [CompletionResult]::new('-i', '-i', [CompletionResultType]::ParameterName, 'use incremental compilation') + [CompletionResult]::new('--incremental', '--incremental', [CompletionResultType]::ParameterName, 'use incremental compilation') + [CompletionResult]::new('--include-default-paths', '--include-default-paths', [CompletionResultType]::ParameterName, 'include default paths in addition to the provided ones') + [CompletionResult]::new('--dry-run', '--dry-run', [CompletionResultType]::ParameterName, 'dry run; don''t build anything') + [CompletionResult]::new('--dump-bootstrap-shims', '--dump-bootstrap-shims', [CompletionResultType]::ParameterName, 'Indicates whether to dump the work done from bootstrap shims') + [CompletionResult]::new('--json-output', '--json-output', [CompletionResultType]::ParameterName, 'use message-format=json') + [CompletionResult]::new('--bypass-bootstrap-lock', '--bypass-bootstrap-lock', [CompletionResultType]::ParameterName, 'Bootstrap uses this value to decide whether it should bypass locking the build process. This is rarely needed (e.g., compiling the std library for different targets in parallel)') + [CompletionResult]::new('--llvm-profile-generate', '--llvm-profile-generate', [CompletionResultType]::ParameterName, 'generate PGO profile with llvm built for rustc') + [CompletionResult]::new('--enable-bolt-settings', '--enable-bolt-settings', [CompletionResultType]::ParameterName, 'Enable BOLT link flags') + [CompletionResult]::new('--skip-stage0-validation', '--skip-stage0-validation', [CompletionResultType]::ParameterName, 'Skip stage0 compiler validation') + [CompletionResult]::new('-h', '-h', [CompletionResultType]::ParameterName, 'Print help (see more with ''--help'')') + [CompletionResult]::new('--help', '--help', [CompletionResultType]::ParameterName, 'Print help (see more with ''--help'')') break } 'x.py;doc' { - [CompletionResult]::new('--config', 'config', [CompletionResultType]::ParameterName, 'TOML configuration file for build') - [CompletionResult]::new('--build-dir', 'build-dir', [CompletionResultType]::ParameterName, 'Build directory, overrides `build.build-dir` in `config.toml`') - [CompletionResult]::new('--build', 'build', [CompletionResultType]::ParameterName, 'build target of the stage0 compiler') - [CompletionResult]::new('--host', 'host', [CompletionResultType]::ParameterName, 'host targets to build') - [CompletionResult]::new('--target', 'target', [CompletionResultType]::ParameterName, 'target targets to build') - [CompletionResult]::new('--exclude', 'exclude', [CompletionResultType]::ParameterName, 'build paths to exclude') - [CompletionResult]::new('--skip', 'skip', [CompletionResultType]::ParameterName, 'build paths to skip') - [CompletionResult]::new('--rustc-error-format', 'rustc-error-format', [CompletionResultType]::ParameterName, 'rustc-error-format') - [CompletionResult]::new('--on-fail', 'on-fail', [CompletionResultType]::ParameterName, 'command to run on failure') - [CompletionResult]::new('--stage', 'stage', [CompletionResultType]::ParameterName, 'stage to build (indicates compiler to use/test, e.g., stage 0 uses the bootstrap compiler, stage 1 the stage 0 rustc artifacts, etc.)') - [CompletionResult]::new('--keep-stage', 'keep-stage', [CompletionResultType]::ParameterName, 'stage(s) to keep without recompiling (pass multiple times to keep e.g., both stages 0 and 1)') - [CompletionResult]::new('--keep-stage-std', 'keep-stage-std', [CompletionResultType]::ParameterName, 'stage(s) of the standard library to keep without recompiling (pass multiple times to keep e.g., both stages 0 and 1)') - [CompletionResult]::new('--src', 'src', [CompletionResultType]::ParameterName, 'path to the root of the rust checkout') - [CompletionResult]::new('-j', 'j', [CompletionResultType]::ParameterName, 'number of jobs to run in parallel') - [CompletionResult]::new('--jobs', 'jobs', [CompletionResultType]::ParameterName, 'number of jobs to run in parallel') - [CompletionResult]::new('--warnings', 'warnings', [CompletionResultType]::ParameterName, 'if value is deny, will deny warnings if value is warn, will emit warnings otherwise, use the default configured behaviour') - [CompletionResult]::new('--error-format', 'error-format', [CompletionResultType]::ParameterName, 'rustc error format') - [CompletionResult]::new('--color', 'color', [CompletionResultType]::ParameterName, 'whether to use color in cargo and rustc output') - [CompletionResult]::new('--llvm-skip-rebuild', 'llvm-skip-rebuild', [CompletionResultType]::ParameterName, 'whether rebuilding llvm should be skipped, overriding `skip-rebuld` in config.toml') - [CompletionResult]::new('--rust-profile-generate', 'rust-profile-generate', [CompletionResultType]::ParameterName, 'generate PGO profile with rustc build') - [CompletionResult]::new('--rust-profile-use', 'rust-profile-use', [CompletionResultType]::ParameterName, 'use PGO profile for rustc build') - [CompletionResult]::new('--llvm-profile-use', 'llvm-profile-use', [CompletionResultType]::ParameterName, 'use PGO profile for LLVM build') - [CompletionResult]::new('--reproducible-artifact', 'reproducible-artifact', [CompletionResultType]::ParameterName, 'Additional reproducible artifacts that should be added to the reproducible artifacts archive') - [CompletionResult]::new('--set', 'set', [CompletionResultType]::ParameterName, 'override options in config.toml') - [CompletionResult]::new('--open', 'open', [CompletionResultType]::ParameterName, 'open the docs in a browser') - [CompletionResult]::new('--json', 'json', [CompletionResultType]::ParameterName, 'render the documentation in JSON format in addition to the usual HTML format') - [CompletionResult]::new('-v', 'v', [CompletionResultType]::ParameterName, 'use verbose output (-vv for very verbose)') - [CompletionResult]::new('--verbose', 'verbose', [CompletionResultType]::ParameterName, 'use verbose output (-vv for very verbose)') - [CompletionResult]::new('-i', 'i', [CompletionResultType]::ParameterName, 'use incremental compilation') - [CompletionResult]::new('--incremental', 'incremental', [CompletionResultType]::ParameterName, 'use incremental compilation') - [CompletionResult]::new('--include-default-paths', 'include-default-paths', [CompletionResultType]::ParameterName, 'include default paths in addition to the provided ones') - [CompletionResult]::new('--dry-run', 'dry-run', [CompletionResultType]::ParameterName, 'dry run; don''t build anything') - [CompletionResult]::new('--dump-bootstrap-shims', 'dump-bootstrap-shims', [CompletionResultType]::ParameterName, 'Indicates whether to dump the work done from bootstrap shims') - [CompletionResult]::new('--json-output', 'json-output', [CompletionResultType]::ParameterName, 'use message-format=json') - [CompletionResult]::new('--bypass-bootstrap-lock', 'bypass-bootstrap-lock', [CompletionResultType]::ParameterName, 'Bootstrap uses this value to decide whether it should bypass locking the build process. This is rarely needed (e.g., compiling the std library for different targets in parallel)') - [CompletionResult]::new('--llvm-profile-generate', 'llvm-profile-generate', [CompletionResultType]::ParameterName, 'generate PGO profile with llvm built for rustc') - [CompletionResult]::new('--enable-bolt-settings', 'enable-bolt-settings', [CompletionResultType]::ParameterName, 'Enable BOLT link flags') - [CompletionResult]::new('--skip-stage0-validation', 'skip-stage0-validation', [CompletionResultType]::ParameterName, 'Skip stage0 compiler validation') - [CompletionResult]::new('-h', 'h', [CompletionResultType]::ParameterName, 'Print help (see more with ''--help'')') - [CompletionResult]::new('--help', 'help', [CompletionResultType]::ParameterName, 'Print help (see more with ''--help'')') + [CompletionResult]::new('--config', '--config', [CompletionResultType]::ParameterName, 'TOML configuration file for build') + [CompletionResult]::new('--build-dir', '--build-dir', [CompletionResultType]::ParameterName, 'Build directory, overrides `build.build-dir` in `config.toml`') + [CompletionResult]::new('--build', '--build', [CompletionResultType]::ParameterName, 'build target of the stage0 compiler') + [CompletionResult]::new('--host', '--host', [CompletionResultType]::ParameterName, 'host targets to build') + [CompletionResult]::new('--target', '--target', [CompletionResultType]::ParameterName, 'target targets to build') + [CompletionResult]::new('--exclude', '--exclude', [CompletionResultType]::ParameterName, 'build paths to exclude') + [CompletionResult]::new('--skip', '--skip', [CompletionResultType]::ParameterName, 'build paths to skip') + [CompletionResult]::new('--rustc-error-format', '--rustc-error-format', [CompletionResultType]::ParameterName, 'rustc-error-format') + [CompletionResult]::new('--on-fail', '--on-fail', [CompletionResultType]::ParameterName, 'command to run on failure') + [CompletionResult]::new('--stage', '--stage', [CompletionResultType]::ParameterName, 'stage to build (indicates compiler to use/test, e.g., stage 0 uses the bootstrap compiler, stage 1 the stage 0 rustc artifacts, etc.)') + [CompletionResult]::new('--keep-stage', '--keep-stage', [CompletionResultType]::ParameterName, 'stage(s) to keep without recompiling (pass multiple times to keep e.g., both stages 0 and 1)') + [CompletionResult]::new('--keep-stage-std', '--keep-stage-std', [CompletionResultType]::ParameterName, 'stage(s) of the standard library to keep without recompiling (pass multiple times to keep e.g., both stages 0 and 1)') + [CompletionResult]::new('--src', '--src', [CompletionResultType]::ParameterName, 'path to the root of the rust checkout') + [CompletionResult]::new('-j', '-j', [CompletionResultType]::ParameterName, 'number of jobs to run in parallel') + [CompletionResult]::new('--jobs', '--jobs', [CompletionResultType]::ParameterName, 'number of jobs to run in parallel') + [CompletionResult]::new('--warnings', '--warnings', [CompletionResultType]::ParameterName, 'if value is deny, will deny warnings if value is warn, will emit warnings otherwise, use the default configured behaviour') + [CompletionResult]::new('--error-format', '--error-format', [CompletionResultType]::ParameterName, 'rustc error format') + [CompletionResult]::new('--color', '--color', [CompletionResultType]::ParameterName, 'whether to use color in cargo and rustc output') + [CompletionResult]::new('--llvm-skip-rebuild', '--llvm-skip-rebuild', [CompletionResultType]::ParameterName, 'whether rebuilding llvm should be skipped, overriding `skip-rebuld` in config.toml') + [CompletionResult]::new('--rust-profile-generate', '--rust-profile-generate', [CompletionResultType]::ParameterName, 'generate PGO profile with rustc build') + [CompletionResult]::new('--rust-profile-use', '--rust-profile-use', [CompletionResultType]::ParameterName, 'use PGO profile for rustc build') + [CompletionResult]::new('--llvm-profile-use', '--llvm-profile-use', [CompletionResultType]::ParameterName, 'use PGO profile for LLVM build') + [CompletionResult]::new('--reproducible-artifact', '--reproducible-artifact', [CompletionResultType]::ParameterName, 'Additional reproducible artifacts that should be added to the reproducible artifacts archive') + [CompletionResult]::new('--set', '--set', [CompletionResultType]::ParameterName, 'override options in config.toml') + [CompletionResult]::new('--open', '--open', [CompletionResultType]::ParameterName, 'open the docs in a browser') + [CompletionResult]::new('--json', '--json', [CompletionResultType]::ParameterName, 'render the documentation in JSON format in addition to the usual HTML format') + [CompletionResult]::new('-v', '-v', [CompletionResultType]::ParameterName, 'use verbose output (-vv for very verbose)') + [CompletionResult]::new('--verbose', '--verbose', [CompletionResultType]::ParameterName, 'use verbose output (-vv for very verbose)') + [CompletionResult]::new('-i', '-i', [CompletionResultType]::ParameterName, 'use incremental compilation') + [CompletionResult]::new('--incremental', '--incremental', [CompletionResultType]::ParameterName, 'use incremental compilation') + [CompletionResult]::new('--include-default-paths', '--include-default-paths', [CompletionResultType]::ParameterName, 'include default paths in addition to the provided ones') + [CompletionResult]::new('--dry-run', '--dry-run', [CompletionResultType]::ParameterName, 'dry run; don''t build anything') + [CompletionResult]::new('--dump-bootstrap-shims', '--dump-bootstrap-shims', [CompletionResultType]::ParameterName, 'Indicates whether to dump the work done from bootstrap shims') + [CompletionResult]::new('--json-output', '--json-output', [CompletionResultType]::ParameterName, 'use message-format=json') + [CompletionResult]::new('--bypass-bootstrap-lock', '--bypass-bootstrap-lock', [CompletionResultType]::ParameterName, 'Bootstrap uses this value to decide whether it should bypass locking the build process. This is rarely needed (e.g., compiling the std library for different targets in parallel)') + [CompletionResult]::new('--llvm-profile-generate', '--llvm-profile-generate', [CompletionResultType]::ParameterName, 'generate PGO profile with llvm built for rustc') + [CompletionResult]::new('--enable-bolt-settings', '--enable-bolt-settings', [CompletionResultType]::ParameterName, 'Enable BOLT link flags') + [CompletionResult]::new('--skip-stage0-validation', '--skip-stage0-validation', [CompletionResultType]::ParameterName, 'Skip stage0 compiler validation') + [CompletionResult]::new('-h', '-h', [CompletionResultType]::ParameterName, 'Print help (see more with ''--help'')') + [CompletionResult]::new('--help', '--help', [CompletionResultType]::ParameterName, 'Print help (see more with ''--help'')') break } 'x.py;test' { - [CompletionResult]::new('--test-args', 'test-args', [CompletionResultType]::ParameterName, 'extra arguments to be passed for the test tool being used (e.g. libtest, compiletest or rustdoc)') - [CompletionResult]::new('--compiletest-rustc-args', 'compiletest-rustc-args', [CompletionResultType]::ParameterName, 'extra options to pass the compiler when running compiletest tests') - [CompletionResult]::new('--extra-checks', 'extra-checks', [CompletionResultType]::ParameterName, 'comma-separated list of other files types to check (accepts py, py:lint, py:fmt, shell)') - [CompletionResult]::new('--compare-mode', 'compare-mode', [CompletionResultType]::ParameterName, 'mode describing what file the actual ui output will be compared to') - [CompletionResult]::new('--pass', 'pass', [CompletionResultType]::ParameterName, 'force {check,build,run}-pass tests to this mode') - [CompletionResult]::new('--run', 'run', [CompletionResultType]::ParameterName, 'whether to execute run-* tests') - [CompletionResult]::new('--config', 'config', [CompletionResultType]::ParameterName, 'TOML configuration file for build') - [CompletionResult]::new('--build-dir', 'build-dir', [CompletionResultType]::ParameterName, 'Build directory, overrides `build.build-dir` in `config.toml`') - [CompletionResult]::new('--build', 'build', [CompletionResultType]::ParameterName, 'build target of the stage0 compiler') - [CompletionResult]::new('--host', 'host', [CompletionResultType]::ParameterName, 'host targets to build') - [CompletionResult]::new('--target', 'target', [CompletionResultType]::ParameterName, 'target targets to build') - [CompletionResult]::new('--exclude', 'exclude', [CompletionResultType]::ParameterName, 'build paths to exclude') - [CompletionResult]::new('--skip', 'skip', [CompletionResultType]::ParameterName, 'build paths to skip') - [CompletionResult]::new('--rustc-error-format', 'rustc-error-format', [CompletionResultType]::ParameterName, 'rustc-error-format') - [CompletionResult]::new('--on-fail', 'on-fail', [CompletionResultType]::ParameterName, 'command to run on failure') - [CompletionResult]::new('--stage', 'stage', [CompletionResultType]::ParameterName, 'stage to build (indicates compiler to use/test, e.g., stage 0 uses the bootstrap compiler, stage 1 the stage 0 rustc artifacts, etc.)') - [CompletionResult]::new('--keep-stage', 'keep-stage', [CompletionResultType]::ParameterName, 'stage(s) to keep without recompiling (pass multiple times to keep e.g., both stages 0 and 1)') - [CompletionResult]::new('--keep-stage-std', 'keep-stage-std', [CompletionResultType]::ParameterName, 'stage(s) of the standard library to keep without recompiling (pass multiple times to keep e.g., both stages 0 and 1)') - [CompletionResult]::new('--src', 'src', [CompletionResultType]::ParameterName, 'path to the root of the rust checkout') - [CompletionResult]::new('-j', 'j', [CompletionResultType]::ParameterName, 'number of jobs to run in parallel') - [CompletionResult]::new('--jobs', 'jobs', [CompletionResultType]::ParameterName, 'number of jobs to run in parallel') - [CompletionResult]::new('--warnings', 'warnings', [CompletionResultType]::ParameterName, 'if value is deny, will deny warnings if value is warn, will emit warnings otherwise, use the default configured behaviour') - [CompletionResult]::new('--error-format', 'error-format', [CompletionResultType]::ParameterName, 'rustc error format') - [CompletionResult]::new('--color', 'color', [CompletionResultType]::ParameterName, 'whether to use color in cargo and rustc output') - [CompletionResult]::new('--llvm-skip-rebuild', 'llvm-skip-rebuild', [CompletionResultType]::ParameterName, 'whether rebuilding llvm should be skipped, overriding `skip-rebuld` in config.toml') - [CompletionResult]::new('--rust-profile-generate', 'rust-profile-generate', [CompletionResultType]::ParameterName, 'generate PGO profile with rustc build') - [CompletionResult]::new('--rust-profile-use', 'rust-profile-use', [CompletionResultType]::ParameterName, 'use PGO profile for rustc build') - [CompletionResult]::new('--llvm-profile-use', 'llvm-profile-use', [CompletionResultType]::ParameterName, 'use PGO profile for LLVM build') - [CompletionResult]::new('--reproducible-artifact', 'reproducible-artifact', [CompletionResultType]::ParameterName, 'Additional reproducible artifacts that should be added to the reproducible artifacts archive') - [CompletionResult]::new('--set', 'set', [CompletionResultType]::ParameterName, 'override options in config.toml') - [CompletionResult]::new('--no-fail-fast', 'no-fail-fast', [CompletionResultType]::ParameterName, 'run all tests regardless of failure') - [CompletionResult]::new('--no-doc', 'no-doc', [CompletionResultType]::ParameterName, 'do not run doc tests') - [CompletionResult]::new('--doc', 'doc', [CompletionResultType]::ParameterName, 'only run doc tests') - [CompletionResult]::new('--bless', 'bless', [CompletionResultType]::ParameterName, 'whether to automatically update stderr/stdout files') - [CompletionResult]::new('--force-rerun', 'force-rerun', [CompletionResultType]::ParameterName, 'rerun tests even if the inputs are unchanged') - [CompletionResult]::new('--only-modified', 'only-modified', [CompletionResultType]::ParameterName, 'only run tests that result has been changed') - [CompletionResult]::new('--rustfix-coverage', 'rustfix-coverage', [CompletionResultType]::ParameterName, 'enable this to generate a Rustfix coverage file, which is saved in `/<build_base>/rustfix_missing_coverage.txt`') - [CompletionResult]::new('-v', 'v', [CompletionResultType]::ParameterName, 'use verbose output (-vv for very verbose)') - [CompletionResult]::new('--verbose', 'verbose', [CompletionResultType]::ParameterName, 'use verbose output (-vv for very verbose)') - [CompletionResult]::new('-i', 'i', [CompletionResultType]::ParameterName, 'use incremental compilation') - [CompletionResult]::new('--incremental', 'incremental', [CompletionResultType]::ParameterName, 'use incremental compilation') - [CompletionResult]::new('--include-default-paths', 'include-default-paths', [CompletionResultType]::ParameterName, 'include default paths in addition to the provided ones') - [CompletionResult]::new('--dry-run', 'dry-run', [CompletionResultType]::ParameterName, 'dry run; don''t build anything') - [CompletionResult]::new('--dump-bootstrap-shims', 'dump-bootstrap-shims', [CompletionResultType]::ParameterName, 'Indicates whether to dump the work done from bootstrap shims') - [CompletionResult]::new('--json-output', 'json-output', [CompletionResultType]::ParameterName, 'use message-format=json') - [CompletionResult]::new('--bypass-bootstrap-lock', 'bypass-bootstrap-lock', [CompletionResultType]::ParameterName, 'Bootstrap uses this value to decide whether it should bypass locking the build process. This is rarely needed (e.g., compiling the std library for different targets in parallel)') - [CompletionResult]::new('--llvm-profile-generate', 'llvm-profile-generate', [CompletionResultType]::ParameterName, 'generate PGO profile with llvm built for rustc') - [CompletionResult]::new('--enable-bolt-settings', 'enable-bolt-settings', [CompletionResultType]::ParameterName, 'Enable BOLT link flags') - [CompletionResult]::new('--skip-stage0-validation', 'skip-stage0-validation', [CompletionResultType]::ParameterName, 'Skip stage0 compiler validation') - [CompletionResult]::new('-h', 'h', [CompletionResultType]::ParameterName, 'Print help (see more with ''--help'')') - [CompletionResult]::new('--help', 'help', [CompletionResultType]::ParameterName, 'Print help (see more with ''--help'')') + [CompletionResult]::new('--test-args', '--test-args', [CompletionResultType]::ParameterName, 'extra arguments to be passed for the test tool being used (e.g. libtest, compiletest or rustdoc)') + [CompletionResult]::new('--compiletest-rustc-args', '--compiletest-rustc-args', [CompletionResultType]::ParameterName, 'extra options to pass the compiler when running compiletest tests') + [CompletionResult]::new('--extra-checks', '--extra-checks', [CompletionResultType]::ParameterName, 'comma-separated list of other files types to check (accepts py, py:lint, py:fmt, shell)') + [CompletionResult]::new('--compare-mode', '--compare-mode', [CompletionResultType]::ParameterName, 'mode describing what file the actual ui output will be compared to') + [CompletionResult]::new('--pass', '--pass', [CompletionResultType]::ParameterName, 'force {check,build,run}-pass tests to this mode') + [CompletionResult]::new('--run', '--run', [CompletionResultType]::ParameterName, 'whether to execute run-* tests') + [CompletionResult]::new('--config', '--config', [CompletionResultType]::ParameterName, 'TOML configuration file for build') + [CompletionResult]::new('--build-dir', '--build-dir', [CompletionResultType]::ParameterName, 'Build directory, overrides `build.build-dir` in `config.toml`') + [CompletionResult]::new('--build', '--build', [CompletionResultType]::ParameterName, 'build target of the stage0 compiler') + [CompletionResult]::new('--host', '--host', [CompletionResultType]::ParameterName, 'host targets to build') + [CompletionResult]::new('--target', '--target', [CompletionResultType]::ParameterName, 'target targets to build') + [CompletionResult]::new('--exclude', '--exclude', [CompletionResultType]::ParameterName, 'build paths to exclude') + [CompletionResult]::new('--skip', '--skip', [CompletionResultType]::ParameterName, 'build paths to skip') + [CompletionResult]::new('--rustc-error-format', '--rustc-error-format', [CompletionResultType]::ParameterName, 'rustc-error-format') + [CompletionResult]::new('--on-fail', '--on-fail', [CompletionResultType]::ParameterName, 'command to run on failure') + [CompletionResult]::new('--stage', '--stage', [CompletionResultType]::ParameterName, 'stage to build (indicates compiler to use/test, e.g., stage 0 uses the bootstrap compiler, stage 1 the stage 0 rustc artifacts, etc.)') + [CompletionResult]::new('--keep-stage', '--keep-stage', [CompletionResultType]::ParameterName, 'stage(s) to keep without recompiling (pass multiple times to keep e.g., both stages 0 and 1)') + [CompletionResult]::new('--keep-stage-std', '--keep-stage-std', [CompletionResultType]::ParameterName, 'stage(s) of the standard library to keep without recompiling (pass multiple times to keep e.g., both stages 0 and 1)') + [CompletionResult]::new('--src', '--src', [CompletionResultType]::ParameterName, 'path to the root of the rust checkout') + [CompletionResult]::new('-j', '-j', [CompletionResultType]::ParameterName, 'number of jobs to run in parallel') + [CompletionResult]::new('--jobs', '--jobs', [CompletionResultType]::ParameterName, 'number of jobs to run in parallel') + [CompletionResult]::new('--warnings', '--warnings', [CompletionResultType]::ParameterName, 'if value is deny, will deny warnings if value is warn, will emit warnings otherwise, use the default configured behaviour') + [CompletionResult]::new('--error-format', '--error-format', [CompletionResultType]::ParameterName, 'rustc error format') + [CompletionResult]::new('--color', '--color', [CompletionResultType]::ParameterName, 'whether to use color in cargo and rustc output') + [CompletionResult]::new('--llvm-skip-rebuild', '--llvm-skip-rebuild', [CompletionResultType]::ParameterName, 'whether rebuilding llvm should be skipped, overriding `skip-rebuld` in config.toml') + [CompletionResult]::new('--rust-profile-generate', '--rust-profile-generate', [CompletionResultType]::ParameterName, 'generate PGO profile with rustc build') + [CompletionResult]::new('--rust-profile-use', '--rust-profile-use', [CompletionResultType]::ParameterName, 'use PGO profile for rustc build') + [CompletionResult]::new('--llvm-profile-use', '--llvm-profile-use', [CompletionResultType]::ParameterName, 'use PGO profile for LLVM build') + [CompletionResult]::new('--reproducible-artifact', '--reproducible-artifact', [CompletionResultType]::ParameterName, 'Additional reproducible artifacts that should be added to the reproducible artifacts archive') + [CompletionResult]::new('--set', '--set', [CompletionResultType]::ParameterName, 'override options in config.toml') + [CompletionResult]::new('--no-fail-fast', '--no-fail-fast', [CompletionResultType]::ParameterName, 'run all tests regardless of failure') + [CompletionResult]::new('--no-doc', '--no-doc', [CompletionResultType]::ParameterName, 'do not run doc tests') + [CompletionResult]::new('--doc', '--doc', [CompletionResultType]::ParameterName, 'only run doc tests') + [CompletionResult]::new('--bless', '--bless', [CompletionResultType]::ParameterName, 'whether to automatically update stderr/stdout files') + [CompletionResult]::new('--force-rerun', '--force-rerun', [CompletionResultType]::ParameterName, 'rerun tests even if the inputs are unchanged') + [CompletionResult]::new('--only-modified', '--only-modified', [CompletionResultType]::ParameterName, 'only run tests that result has been changed') + [CompletionResult]::new('--rustfix-coverage', '--rustfix-coverage', [CompletionResultType]::ParameterName, 'enable this to generate a Rustfix coverage file, which is saved in `/<build_base>/rustfix_missing_coverage.txt`') + [CompletionResult]::new('-v', '-v', [CompletionResultType]::ParameterName, 'use verbose output (-vv for very verbose)') + [CompletionResult]::new('--verbose', '--verbose', [CompletionResultType]::ParameterName, 'use verbose output (-vv for very verbose)') + [CompletionResult]::new('-i', '-i', [CompletionResultType]::ParameterName, 'use incremental compilation') + [CompletionResult]::new('--incremental', '--incremental', [CompletionResultType]::ParameterName, 'use incremental compilation') + [CompletionResult]::new('--include-default-paths', '--include-default-paths', [CompletionResultType]::ParameterName, 'include default paths in addition to the provided ones') + [CompletionResult]::new('--dry-run', '--dry-run', [CompletionResultType]::ParameterName, 'dry run; don''t build anything') + [CompletionResult]::new('--dump-bootstrap-shims', '--dump-bootstrap-shims', [CompletionResultType]::ParameterName, 'Indicates whether to dump the work done from bootstrap shims') + [CompletionResult]::new('--json-output', '--json-output', [CompletionResultType]::ParameterName, 'use message-format=json') + [CompletionResult]::new('--bypass-bootstrap-lock', '--bypass-bootstrap-lock', [CompletionResultType]::ParameterName, 'Bootstrap uses this value to decide whether it should bypass locking the build process. This is rarely needed (e.g., compiling the std library for different targets in parallel)') + [CompletionResult]::new('--llvm-profile-generate', '--llvm-profile-generate', [CompletionResultType]::ParameterName, 'generate PGO profile with llvm built for rustc') + [CompletionResult]::new('--enable-bolt-settings', '--enable-bolt-settings', [CompletionResultType]::ParameterName, 'Enable BOLT link flags') + [CompletionResult]::new('--skip-stage0-validation', '--skip-stage0-validation', [CompletionResultType]::ParameterName, 'Skip stage0 compiler validation') + [CompletionResult]::new('-h', '-h', [CompletionResultType]::ParameterName, 'Print help (see more with ''--help'')') + [CompletionResult]::new('--help', '--help', [CompletionResultType]::ParameterName, 'Print help (see more with ''--help'')') break } 'x.py;miri' { - [CompletionResult]::new('--test-args', 'test-args', [CompletionResultType]::ParameterName, 'extra arguments to be passed for the test tool being used (e.g. libtest, compiletest or rustdoc)') - [CompletionResult]::new('--config', 'config', [CompletionResultType]::ParameterName, 'TOML configuration file for build') - [CompletionResult]::new('--build-dir', 'build-dir', [CompletionResultType]::ParameterName, 'Build directory, overrides `build.build-dir` in `config.toml`') - [CompletionResult]::new('--build', 'build', [CompletionResultType]::ParameterName, 'build target of the stage0 compiler') - [CompletionResult]::new('--host', 'host', [CompletionResultType]::ParameterName, 'host targets to build') - [CompletionResult]::new('--target', 'target', [CompletionResultType]::ParameterName, 'target targets to build') - [CompletionResult]::new('--exclude', 'exclude', [CompletionResultType]::ParameterName, 'build paths to exclude') - [CompletionResult]::new('--skip', 'skip', [CompletionResultType]::ParameterName, 'build paths to skip') - [CompletionResult]::new('--rustc-error-format', 'rustc-error-format', [CompletionResultType]::ParameterName, 'rustc-error-format') - [CompletionResult]::new('--on-fail', 'on-fail', [CompletionResultType]::ParameterName, 'command to run on failure') - [CompletionResult]::new('--stage', 'stage', [CompletionResultType]::ParameterName, 'stage to build (indicates compiler to use/test, e.g., stage 0 uses the bootstrap compiler, stage 1 the stage 0 rustc artifacts, etc.)') - [CompletionResult]::new('--keep-stage', 'keep-stage', [CompletionResultType]::ParameterName, 'stage(s) to keep without recompiling (pass multiple times to keep e.g., both stages 0 and 1)') - [CompletionResult]::new('--keep-stage-std', 'keep-stage-std', [CompletionResultType]::ParameterName, 'stage(s) of the standard library to keep without recompiling (pass multiple times to keep e.g., both stages 0 and 1)') - [CompletionResult]::new('--src', 'src', [CompletionResultType]::ParameterName, 'path to the root of the rust checkout') - [CompletionResult]::new('-j', 'j', [CompletionResultType]::ParameterName, 'number of jobs to run in parallel') - [CompletionResult]::new('--jobs', 'jobs', [CompletionResultType]::ParameterName, 'number of jobs to run in parallel') - [CompletionResult]::new('--warnings', 'warnings', [CompletionResultType]::ParameterName, 'if value is deny, will deny warnings if value is warn, will emit warnings otherwise, use the default configured behaviour') - [CompletionResult]::new('--error-format', 'error-format', [CompletionResultType]::ParameterName, 'rustc error format') - [CompletionResult]::new('--color', 'color', [CompletionResultType]::ParameterName, 'whether to use color in cargo and rustc output') - [CompletionResult]::new('--llvm-skip-rebuild', 'llvm-skip-rebuild', [CompletionResultType]::ParameterName, 'whether rebuilding llvm should be skipped, overriding `skip-rebuld` in config.toml') - [CompletionResult]::new('--rust-profile-generate', 'rust-profile-generate', [CompletionResultType]::ParameterName, 'generate PGO profile with rustc build') - [CompletionResult]::new('--rust-profile-use', 'rust-profile-use', [CompletionResultType]::ParameterName, 'use PGO profile for rustc build') - [CompletionResult]::new('--llvm-profile-use', 'llvm-profile-use', [CompletionResultType]::ParameterName, 'use PGO profile for LLVM build') - [CompletionResult]::new('--reproducible-artifact', 'reproducible-artifact', [CompletionResultType]::ParameterName, 'Additional reproducible artifacts that should be added to the reproducible artifacts archive') - [CompletionResult]::new('--set', 'set', [CompletionResultType]::ParameterName, 'override options in config.toml') - [CompletionResult]::new('--no-fail-fast', 'no-fail-fast', [CompletionResultType]::ParameterName, 'run all tests regardless of failure') - [CompletionResult]::new('--no-doc', 'no-doc', [CompletionResultType]::ParameterName, 'do not run doc tests') - [CompletionResult]::new('--doc', 'doc', [CompletionResultType]::ParameterName, 'only run doc tests') - [CompletionResult]::new('-v', 'v', [CompletionResultType]::ParameterName, 'use verbose output (-vv for very verbose)') - [CompletionResult]::new('--verbose', 'verbose', [CompletionResultType]::ParameterName, 'use verbose output (-vv for very verbose)') - [CompletionResult]::new('-i', 'i', [CompletionResultType]::ParameterName, 'use incremental compilation') - [CompletionResult]::new('--incremental', 'incremental', [CompletionResultType]::ParameterName, 'use incremental compilation') - [CompletionResult]::new('--include-default-paths', 'include-default-paths', [CompletionResultType]::ParameterName, 'include default paths in addition to the provided ones') - [CompletionResult]::new('--dry-run', 'dry-run', [CompletionResultType]::ParameterName, 'dry run; don''t build anything') - [CompletionResult]::new('--dump-bootstrap-shims', 'dump-bootstrap-shims', [CompletionResultType]::ParameterName, 'Indicates whether to dump the work done from bootstrap shims') - [CompletionResult]::new('--json-output', 'json-output', [CompletionResultType]::ParameterName, 'use message-format=json') - [CompletionResult]::new('--bypass-bootstrap-lock', 'bypass-bootstrap-lock', [CompletionResultType]::ParameterName, 'Bootstrap uses this value to decide whether it should bypass locking the build process. This is rarely needed (e.g., compiling the std library for different targets in parallel)') - [CompletionResult]::new('--llvm-profile-generate', 'llvm-profile-generate', [CompletionResultType]::ParameterName, 'generate PGO profile with llvm built for rustc') - [CompletionResult]::new('--enable-bolt-settings', 'enable-bolt-settings', [CompletionResultType]::ParameterName, 'Enable BOLT link flags') - [CompletionResult]::new('--skip-stage0-validation', 'skip-stage0-validation', [CompletionResultType]::ParameterName, 'Skip stage0 compiler validation') - [CompletionResult]::new('-h', 'h', [CompletionResultType]::ParameterName, 'Print help (see more with ''--help'')') - [CompletionResult]::new('--help', 'help', [CompletionResultType]::ParameterName, 'Print help (see more with ''--help'')') + [CompletionResult]::new('--test-args', '--test-args', [CompletionResultType]::ParameterName, 'extra arguments to be passed for the test tool being used (e.g. libtest, compiletest or rustdoc)') + [CompletionResult]::new('--config', '--config', [CompletionResultType]::ParameterName, 'TOML configuration file for build') + [CompletionResult]::new('--build-dir', '--build-dir', [CompletionResultType]::ParameterName, 'Build directory, overrides `build.build-dir` in `config.toml`') + [CompletionResult]::new('--build', '--build', [CompletionResultType]::ParameterName, 'build target of the stage0 compiler') + [CompletionResult]::new('--host', '--host', [CompletionResultType]::ParameterName, 'host targets to build') + [CompletionResult]::new('--target', '--target', [CompletionResultType]::ParameterName, 'target targets to build') + [CompletionResult]::new('--exclude', '--exclude', [CompletionResultType]::ParameterName, 'build paths to exclude') + [CompletionResult]::new('--skip', '--skip', [CompletionResultType]::ParameterName, 'build paths to skip') + [CompletionResult]::new('--rustc-error-format', '--rustc-error-format', [CompletionResultType]::ParameterName, 'rustc-error-format') + [CompletionResult]::new('--on-fail', '--on-fail', [CompletionResultType]::ParameterName, 'command to run on failure') + [CompletionResult]::new('--stage', '--stage', [CompletionResultType]::ParameterName, 'stage to build (indicates compiler to use/test, e.g., stage 0 uses the bootstrap compiler, stage 1 the stage 0 rustc artifacts, etc.)') + [CompletionResult]::new('--keep-stage', '--keep-stage', [CompletionResultType]::ParameterName, 'stage(s) to keep without recompiling (pass multiple times to keep e.g., both stages 0 and 1)') + [CompletionResult]::new('--keep-stage-std', '--keep-stage-std', [CompletionResultType]::ParameterName, 'stage(s) of the standard library to keep without recompiling (pass multiple times to keep e.g., both stages 0 and 1)') + [CompletionResult]::new('--src', '--src', [CompletionResultType]::ParameterName, 'path to the root of the rust checkout') + [CompletionResult]::new('-j', '-j', [CompletionResultType]::ParameterName, 'number of jobs to run in parallel') + [CompletionResult]::new('--jobs', '--jobs', [CompletionResultType]::ParameterName, 'number of jobs to run in parallel') + [CompletionResult]::new('--warnings', '--warnings', [CompletionResultType]::ParameterName, 'if value is deny, will deny warnings if value is warn, will emit warnings otherwise, use the default configured behaviour') + [CompletionResult]::new('--error-format', '--error-format', [CompletionResultType]::ParameterName, 'rustc error format') + [CompletionResult]::new('--color', '--color', [CompletionResultType]::ParameterName, 'whether to use color in cargo and rustc output') + [CompletionResult]::new('--llvm-skip-rebuild', '--llvm-skip-rebuild', [CompletionResultType]::ParameterName, 'whether rebuilding llvm should be skipped, overriding `skip-rebuld` in config.toml') + [CompletionResult]::new('--rust-profile-generate', '--rust-profile-generate', [CompletionResultType]::ParameterName, 'generate PGO profile with rustc build') + [CompletionResult]::new('--rust-profile-use', '--rust-profile-use', [CompletionResultType]::ParameterName, 'use PGO profile for rustc build') + [CompletionResult]::new('--llvm-profile-use', '--llvm-profile-use', [CompletionResultType]::ParameterName, 'use PGO profile for LLVM build') + [CompletionResult]::new('--reproducible-artifact', '--reproducible-artifact', [CompletionResultType]::ParameterName, 'Additional reproducible artifacts that should be added to the reproducible artifacts archive') + [CompletionResult]::new('--set', '--set', [CompletionResultType]::ParameterName, 'override options in config.toml') + [CompletionResult]::new('--no-fail-fast', '--no-fail-fast', [CompletionResultType]::ParameterName, 'run all tests regardless of failure') + [CompletionResult]::new('--no-doc', '--no-doc', [CompletionResultType]::ParameterName, 'do not run doc tests') + [CompletionResult]::new('--doc', '--doc', [CompletionResultType]::ParameterName, 'only run doc tests') + [CompletionResult]::new('-v', '-v', [CompletionResultType]::ParameterName, 'use verbose output (-vv for very verbose)') + [CompletionResult]::new('--verbose', '--verbose', [CompletionResultType]::ParameterName, 'use verbose output (-vv for very verbose)') + [CompletionResult]::new('-i', '-i', [CompletionResultType]::ParameterName, 'use incremental compilation') + [CompletionResult]::new('--incremental', '--incremental', [CompletionResultType]::ParameterName, 'use incremental compilation') + [CompletionResult]::new('--include-default-paths', '--include-default-paths', [CompletionResultType]::ParameterName, 'include default paths in addition to the provided ones') + [CompletionResult]::new('--dry-run', '--dry-run', [CompletionResultType]::ParameterName, 'dry run; don''t build anything') + [CompletionResult]::new('--dump-bootstrap-shims', '--dump-bootstrap-shims', [CompletionResultType]::ParameterName, 'Indicates whether to dump the work done from bootstrap shims') + [CompletionResult]::new('--json-output', '--json-output', [CompletionResultType]::ParameterName, 'use message-format=json') + [CompletionResult]::new('--bypass-bootstrap-lock', '--bypass-bootstrap-lock', [CompletionResultType]::ParameterName, 'Bootstrap uses this value to decide whether it should bypass locking the build process. This is rarely needed (e.g., compiling the std library for different targets in parallel)') + [CompletionResult]::new('--llvm-profile-generate', '--llvm-profile-generate', [CompletionResultType]::ParameterName, 'generate PGO profile with llvm built for rustc') + [CompletionResult]::new('--enable-bolt-settings', '--enable-bolt-settings', [CompletionResultType]::ParameterName, 'Enable BOLT link flags') + [CompletionResult]::new('--skip-stage0-validation', '--skip-stage0-validation', [CompletionResultType]::ParameterName, 'Skip stage0 compiler validation') + [CompletionResult]::new('-h', '-h', [CompletionResultType]::ParameterName, 'Print help (see more with ''--help'')') + [CompletionResult]::new('--help', '--help', [CompletionResultType]::ParameterName, 'Print help (see more with ''--help'')') break } 'x.py;bench' { - [CompletionResult]::new('--test-args', 'test-args', [CompletionResultType]::ParameterName, 'test-args') - [CompletionResult]::new('--config', 'config', [CompletionResultType]::ParameterName, 'TOML configuration file for build') - [CompletionResult]::new('--build-dir', 'build-dir', [CompletionResultType]::ParameterName, 'Build directory, overrides `build.build-dir` in `config.toml`') - [CompletionResult]::new('--build', 'build', [CompletionResultType]::ParameterName, 'build target of the stage0 compiler') - [CompletionResult]::new('--host', 'host', [CompletionResultType]::ParameterName, 'host targets to build') - [CompletionResult]::new('--target', 'target', [CompletionResultType]::ParameterName, 'target targets to build') - [CompletionResult]::new('--exclude', 'exclude', [CompletionResultType]::ParameterName, 'build paths to exclude') - [CompletionResult]::new('--skip', 'skip', [CompletionResultType]::ParameterName, 'build paths to skip') - [CompletionResult]::new('--rustc-error-format', 'rustc-error-format', [CompletionResultType]::ParameterName, 'rustc-error-format') - [CompletionResult]::new('--on-fail', 'on-fail', [CompletionResultType]::ParameterName, 'command to run on failure') - [CompletionResult]::new('--stage', 'stage', [CompletionResultType]::ParameterName, 'stage to build (indicates compiler to use/test, e.g., stage 0 uses the bootstrap compiler, stage 1 the stage 0 rustc artifacts, etc.)') - [CompletionResult]::new('--keep-stage', 'keep-stage', [CompletionResultType]::ParameterName, 'stage(s) to keep without recompiling (pass multiple times to keep e.g., both stages 0 and 1)') - [CompletionResult]::new('--keep-stage-std', 'keep-stage-std', [CompletionResultType]::ParameterName, 'stage(s) of the standard library to keep without recompiling (pass multiple times to keep e.g., both stages 0 and 1)') - [CompletionResult]::new('--src', 'src', [CompletionResultType]::ParameterName, 'path to the root of the rust checkout') - [CompletionResult]::new('-j', 'j', [CompletionResultType]::ParameterName, 'number of jobs to run in parallel') - [CompletionResult]::new('--jobs', 'jobs', [CompletionResultType]::ParameterName, 'number of jobs to run in parallel') - [CompletionResult]::new('--warnings', 'warnings', [CompletionResultType]::ParameterName, 'if value is deny, will deny warnings if value is warn, will emit warnings otherwise, use the default configured behaviour') - [CompletionResult]::new('--error-format', 'error-format', [CompletionResultType]::ParameterName, 'rustc error format') - [CompletionResult]::new('--color', 'color', [CompletionResultType]::ParameterName, 'whether to use color in cargo and rustc output') - [CompletionResult]::new('--llvm-skip-rebuild', 'llvm-skip-rebuild', [CompletionResultType]::ParameterName, 'whether rebuilding llvm should be skipped, overriding `skip-rebuld` in config.toml') - [CompletionResult]::new('--rust-profile-generate', 'rust-profile-generate', [CompletionResultType]::ParameterName, 'generate PGO profile with rustc build') - [CompletionResult]::new('--rust-profile-use', 'rust-profile-use', [CompletionResultType]::ParameterName, 'use PGO profile for rustc build') - [CompletionResult]::new('--llvm-profile-use', 'llvm-profile-use', [CompletionResultType]::ParameterName, 'use PGO profile for LLVM build') - [CompletionResult]::new('--reproducible-artifact', 'reproducible-artifact', [CompletionResultType]::ParameterName, 'Additional reproducible artifacts that should be added to the reproducible artifacts archive') - [CompletionResult]::new('--set', 'set', [CompletionResultType]::ParameterName, 'override options in config.toml') - [CompletionResult]::new('-v', 'v', [CompletionResultType]::ParameterName, 'use verbose output (-vv for very verbose)') - [CompletionResult]::new('--verbose', 'verbose', [CompletionResultType]::ParameterName, 'use verbose output (-vv for very verbose)') - [CompletionResult]::new('-i', 'i', [CompletionResultType]::ParameterName, 'use incremental compilation') - [CompletionResult]::new('--incremental', 'incremental', [CompletionResultType]::ParameterName, 'use incremental compilation') - [CompletionResult]::new('--include-default-paths', 'include-default-paths', [CompletionResultType]::ParameterName, 'include default paths in addition to the provided ones') - [CompletionResult]::new('--dry-run', 'dry-run', [CompletionResultType]::ParameterName, 'dry run; don''t build anything') - [CompletionResult]::new('--dump-bootstrap-shims', 'dump-bootstrap-shims', [CompletionResultType]::ParameterName, 'Indicates whether to dump the work done from bootstrap shims') - [CompletionResult]::new('--json-output', 'json-output', [CompletionResultType]::ParameterName, 'use message-format=json') - [CompletionResult]::new('--bypass-bootstrap-lock', 'bypass-bootstrap-lock', [CompletionResultType]::ParameterName, 'Bootstrap uses this value to decide whether it should bypass locking the build process. This is rarely needed (e.g., compiling the std library for different targets in parallel)') - [CompletionResult]::new('--llvm-profile-generate', 'llvm-profile-generate', [CompletionResultType]::ParameterName, 'generate PGO profile with llvm built for rustc') - [CompletionResult]::new('--enable-bolt-settings', 'enable-bolt-settings', [CompletionResultType]::ParameterName, 'Enable BOLT link flags') - [CompletionResult]::new('--skip-stage0-validation', 'skip-stage0-validation', [CompletionResultType]::ParameterName, 'Skip stage0 compiler validation') - [CompletionResult]::new('-h', 'h', [CompletionResultType]::ParameterName, 'Print help (see more with ''--help'')') - [CompletionResult]::new('--help', 'help', [CompletionResultType]::ParameterName, 'Print help (see more with ''--help'')') + [CompletionResult]::new('--test-args', '--test-args', [CompletionResultType]::ParameterName, 'test-args') + [CompletionResult]::new('--config', '--config', [CompletionResultType]::ParameterName, 'TOML configuration file for build') + [CompletionResult]::new('--build-dir', '--build-dir', [CompletionResultType]::ParameterName, 'Build directory, overrides `build.build-dir` in `config.toml`') + [CompletionResult]::new('--build', '--build', [CompletionResultType]::ParameterName, 'build target of the stage0 compiler') + [CompletionResult]::new('--host', '--host', [CompletionResultType]::ParameterName, 'host targets to build') + [CompletionResult]::new('--target', '--target', [CompletionResultType]::ParameterName, 'target targets to build') + [CompletionResult]::new('--exclude', '--exclude', [CompletionResultType]::ParameterName, 'build paths to exclude') + [CompletionResult]::new('--skip', '--skip', [CompletionResultType]::ParameterName, 'build paths to skip') + [CompletionResult]::new('--rustc-error-format', '--rustc-error-format', [CompletionResultType]::ParameterName, 'rustc-error-format') + [CompletionResult]::new('--on-fail', '--on-fail', [CompletionResultType]::ParameterName, 'command to run on failure') + [CompletionResult]::new('--stage', '--stage', [CompletionResultType]::ParameterName, 'stage to build (indicates compiler to use/test, e.g., stage 0 uses the bootstrap compiler, stage 1 the stage 0 rustc artifacts, etc.)') + [CompletionResult]::new('--keep-stage', '--keep-stage', [CompletionResultType]::ParameterName, 'stage(s) to keep without recompiling (pass multiple times to keep e.g., both stages 0 and 1)') + [CompletionResult]::new('--keep-stage-std', '--keep-stage-std', [CompletionResultType]::ParameterName, 'stage(s) of the standard library to keep without recompiling (pass multiple times to keep e.g., both stages 0 and 1)') + [CompletionResult]::new('--src', '--src', [CompletionResultType]::ParameterName, 'path to the root of the rust checkout') + [CompletionResult]::new('-j', '-j', [CompletionResultType]::ParameterName, 'number of jobs to run in parallel') + [CompletionResult]::new('--jobs', '--jobs', [CompletionResultType]::ParameterName, 'number of jobs to run in parallel') + [CompletionResult]::new('--warnings', '--warnings', [CompletionResultType]::ParameterName, 'if value is deny, will deny warnings if value is warn, will emit warnings otherwise, use the default configured behaviour') + [CompletionResult]::new('--error-format', '--error-format', [CompletionResultType]::ParameterName, 'rustc error format') + [CompletionResult]::new('--color', '--color', [CompletionResultType]::ParameterName, 'whether to use color in cargo and rustc output') + [CompletionResult]::new('--llvm-skip-rebuild', '--llvm-skip-rebuild', [CompletionResultType]::ParameterName, 'whether rebuilding llvm should be skipped, overriding `skip-rebuld` in config.toml') + [CompletionResult]::new('--rust-profile-generate', '--rust-profile-generate', [CompletionResultType]::ParameterName, 'generate PGO profile with rustc build') + [CompletionResult]::new('--rust-profile-use', '--rust-profile-use', [CompletionResultType]::ParameterName, 'use PGO profile for rustc build') + [CompletionResult]::new('--llvm-profile-use', '--llvm-profile-use', [CompletionResultType]::ParameterName, 'use PGO profile for LLVM build') + [CompletionResult]::new('--reproducible-artifact', '--reproducible-artifact', [CompletionResultType]::ParameterName, 'Additional reproducible artifacts that should be added to the reproducible artifacts archive') + [CompletionResult]::new('--set', '--set', [CompletionResultType]::ParameterName, 'override options in config.toml') + [CompletionResult]::new('-v', '-v', [CompletionResultType]::ParameterName, 'use verbose output (-vv for very verbose)') + [CompletionResult]::new('--verbose', '--verbose', [CompletionResultType]::ParameterName, 'use verbose output (-vv for very verbose)') + [CompletionResult]::new('-i', '-i', [CompletionResultType]::ParameterName, 'use incremental compilation') + [CompletionResult]::new('--incremental', '--incremental', [CompletionResultType]::ParameterName, 'use incremental compilation') + [CompletionResult]::new('--include-default-paths', '--include-default-paths', [CompletionResultType]::ParameterName, 'include default paths in addition to the provided ones') + [CompletionResult]::new('--dry-run', '--dry-run', [CompletionResultType]::ParameterName, 'dry run; don''t build anything') + [CompletionResult]::new('--dump-bootstrap-shims', '--dump-bootstrap-shims', [CompletionResultType]::ParameterName, 'Indicates whether to dump the work done from bootstrap shims') + [CompletionResult]::new('--json-output', '--json-output', [CompletionResultType]::ParameterName, 'use message-format=json') + [CompletionResult]::new('--bypass-bootstrap-lock', '--bypass-bootstrap-lock', [CompletionResultType]::ParameterName, 'Bootstrap uses this value to decide whether it should bypass locking the build process. This is rarely needed (e.g., compiling the std library for different targets in parallel)') + [CompletionResult]::new('--llvm-profile-generate', '--llvm-profile-generate', [CompletionResultType]::ParameterName, 'generate PGO profile with llvm built for rustc') + [CompletionResult]::new('--enable-bolt-settings', '--enable-bolt-settings', [CompletionResultType]::ParameterName, 'Enable BOLT link flags') + [CompletionResult]::new('--skip-stage0-validation', '--skip-stage0-validation', [CompletionResultType]::ParameterName, 'Skip stage0 compiler validation') + [CompletionResult]::new('-h', '-h', [CompletionResultType]::ParameterName, 'Print help (see more with ''--help'')') + [CompletionResult]::new('--help', '--help', [CompletionResultType]::ParameterName, 'Print help (see more with ''--help'')') break } 'x.py;clean' { - [CompletionResult]::new('--stage', 'stage', [CompletionResultType]::ParameterName, 'Clean a specific stage without touching other artifacts. By default, every stage is cleaned if this option is not used') - [CompletionResult]::new('--config', 'config', [CompletionResultType]::ParameterName, 'TOML configuration file for build') - [CompletionResult]::new('--build-dir', 'build-dir', [CompletionResultType]::ParameterName, 'Build directory, overrides `build.build-dir` in `config.toml`') - [CompletionResult]::new('--build', 'build', [CompletionResultType]::ParameterName, 'build target of the stage0 compiler') - [CompletionResult]::new('--host', 'host', [CompletionResultType]::ParameterName, 'host targets to build') - [CompletionResult]::new('--target', 'target', [CompletionResultType]::ParameterName, 'target targets to build') - [CompletionResult]::new('--exclude', 'exclude', [CompletionResultType]::ParameterName, 'build paths to exclude') - [CompletionResult]::new('--skip', 'skip', [CompletionResultType]::ParameterName, 'build paths to skip') - [CompletionResult]::new('--rustc-error-format', 'rustc-error-format', [CompletionResultType]::ParameterName, 'rustc-error-format') - [CompletionResult]::new('--on-fail', 'on-fail', [CompletionResultType]::ParameterName, 'command to run on failure') - [CompletionResult]::new('--keep-stage', 'keep-stage', [CompletionResultType]::ParameterName, 'stage(s) to keep without recompiling (pass multiple times to keep e.g., both stages 0 and 1)') - [CompletionResult]::new('--keep-stage-std', 'keep-stage-std', [CompletionResultType]::ParameterName, 'stage(s) of the standard library to keep without recompiling (pass multiple times to keep e.g., both stages 0 and 1)') - [CompletionResult]::new('--src', 'src', [CompletionResultType]::ParameterName, 'path to the root of the rust checkout') - [CompletionResult]::new('-j', 'j', [CompletionResultType]::ParameterName, 'number of jobs to run in parallel') - [CompletionResult]::new('--jobs', 'jobs', [CompletionResultType]::ParameterName, 'number of jobs to run in parallel') - [CompletionResult]::new('--warnings', 'warnings', [CompletionResultType]::ParameterName, 'if value is deny, will deny warnings if value is warn, will emit warnings otherwise, use the default configured behaviour') - [CompletionResult]::new('--error-format', 'error-format', [CompletionResultType]::ParameterName, 'rustc error format') - [CompletionResult]::new('--color', 'color', [CompletionResultType]::ParameterName, 'whether to use color in cargo and rustc output') - [CompletionResult]::new('--llvm-skip-rebuild', 'llvm-skip-rebuild', [CompletionResultType]::ParameterName, 'whether rebuilding llvm should be skipped, overriding `skip-rebuld` in config.toml') - [CompletionResult]::new('--rust-profile-generate', 'rust-profile-generate', [CompletionResultType]::ParameterName, 'generate PGO profile with rustc build') - [CompletionResult]::new('--rust-profile-use', 'rust-profile-use', [CompletionResultType]::ParameterName, 'use PGO profile for rustc build') - [CompletionResult]::new('--llvm-profile-use', 'llvm-profile-use', [CompletionResultType]::ParameterName, 'use PGO profile for LLVM build') - [CompletionResult]::new('--reproducible-artifact', 'reproducible-artifact', [CompletionResultType]::ParameterName, 'Additional reproducible artifacts that should be added to the reproducible artifacts archive') - [CompletionResult]::new('--set', 'set', [CompletionResultType]::ParameterName, 'override options in config.toml') - [CompletionResult]::new('--all', 'all', [CompletionResultType]::ParameterName, 'Clean the entire build directory (not used by default)') - [CompletionResult]::new('-v', 'v', [CompletionResultType]::ParameterName, 'use verbose output (-vv for very verbose)') - [CompletionResult]::new('--verbose', 'verbose', [CompletionResultType]::ParameterName, 'use verbose output (-vv for very verbose)') - [CompletionResult]::new('-i', 'i', [CompletionResultType]::ParameterName, 'use incremental compilation') - [CompletionResult]::new('--incremental', 'incremental', [CompletionResultType]::ParameterName, 'use incremental compilation') - [CompletionResult]::new('--include-default-paths', 'include-default-paths', [CompletionResultType]::ParameterName, 'include default paths in addition to the provided ones') - [CompletionResult]::new('--dry-run', 'dry-run', [CompletionResultType]::ParameterName, 'dry run; don''t build anything') - [CompletionResult]::new('--dump-bootstrap-shims', 'dump-bootstrap-shims', [CompletionResultType]::ParameterName, 'Indicates whether to dump the work done from bootstrap shims') - [CompletionResult]::new('--json-output', 'json-output', [CompletionResultType]::ParameterName, 'use message-format=json') - [CompletionResult]::new('--bypass-bootstrap-lock', 'bypass-bootstrap-lock', [CompletionResultType]::ParameterName, 'Bootstrap uses this value to decide whether it should bypass locking the build process. This is rarely needed (e.g., compiling the std library for different targets in parallel)') - [CompletionResult]::new('--llvm-profile-generate', 'llvm-profile-generate', [CompletionResultType]::ParameterName, 'generate PGO profile with llvm built for rustc') - [CompletionResult]::new('--enable-bolt-settings', 'enable-bolt-settings', [CompletionResultType]::ParameterName, 'Enable BOLT link flags') - [CompletionResult]::new('--skip-stage0-validation', 'skip-stage0-validation', [CompletionResultType]::ParameterName, 'Skip stage0 compiler validation') - [CompletionResult]::new('-h', 'h', [CompletionResultType]::ParameterName, 'Print help (see more with ''--help'')') - [CompletionResult]::new('--help', 'help', [CompletionResultType]::ParameterName, 'Print help (see more with ''--help'')') + [CompletionResult]::new('--stage', '--stage', [CompletionResultType]::ParameterName, 'Clean a specific stage without touching other artifacts. By default, every stage is cleaned if this option is not used') + [CompletionResult]::new('--config', '--config', [CompletionResultType]::ParameterName, 'TOML configuration file for build') + [CompletionResult]::new('--build-dir', '--build-dir', [CompletionResultType]::ParameterName, 'Build directory, overrides `build.build-dir` in `config.toml`') + [CompletionResult]::new('--build', '--build', [CompletionResultType]::ParameterName, 'build target of the stage0 compiler') + [CompletionResult]::new('--host', '--host', [CompletionResultType]::ParameterName, 'host targets to build') + [CompletionResult]::new('--target', '--target', [CompletionResultType]::ParameterName, 'target targets to build') + [CompletionResult]::new('--exclude', '--exclude', [CompletionResultType]::ParameterName, 'build paths to exclude') + [CompletionResult]::new('--skip', '--skip', [CompletionResultType]::ParameterName, 'build paths to skip') + [CompletionResult]::new('--rustc-error-format', '--rustc-error-format', [CompletionResultType]::ParameterName, 'rustc-error-format') + [CompletionResult]::new('--on-fail', '--on-fail', [CompletionResultType]::ParameterName, 'command to run on failure') + [CompletionResult]::new('--keep-stage', '--keep-stage', [CompletionResultType]::ParameterName, 'stage(s) to keep without recompiling (pass multiple times to keep e.g., both stages 0 and 1)') + [CompletionResult]::new('--keep-stage-std', '--keep-stage-std', [CompletionResultType]::ParameterName, 'stage(s) of the standard library to keep without recompiling (pass multiple times to keep e.g., both stages 0 and 1)') + [CompletionResult]::new('--src', '--src', [CompletionResultType]::ParameterName, 'path to the root of the rust checkout') + [CompletionResult]::new('-j', '-j', [CompletionResultType]::ParameterName, 'number of jobs to run in parallel') + [CompletionResult]::new('--jobs', '--jobs', [CompletionResultType]::ParameterName, 'number of jobs to run in parallel') + [CompletionResult]::new('--warnings', '--warnings', [CompletionResultType]::ParameterName, 'if value is deny, will deny warnings if value is warn, will emit warnings otherwise, use the default configured behaviour') + [CompletionResult]::new('--error-format', '--error-format', [CompletionResultType]::ParameterName, 'rustc error format') + [CompletionResult]::new('--color', '--color', [CompletionResultType]::ParameterName, 'whether to use color in cargo and rustc output') + [CompletionResult]::new('--llvm-skip-rebuild', '--llvm-skip-rebuild', [CompletionResultType]::ParameterName, 'whether rebuilding llvm should be skipped, overriding `skip-rebuld` in config.toml') + [CompletionResult]::new('--rust-profile-generate', '--rust-profile-generate', [CompletionResultType]::ParameterName, 'generate PGO profile with rustc build') + [CompletionResult]::new('--rust-profile-use', '--rust-profile-use', [CompletionResultType]::ParameterName, 'use PGO profile for rustc build') + [CompletionResult]::new('--llvm-profile-use', '--llvm-profile-use', [CompletionResultType]::ParameterName, 'use PGO profile for LLVM build') + [CompletionResult]::new('--reproducible-artifact', '--reproducible-artifact', [CompletionResultType]::ParameterName, 'Additional reproducible artifacts that should be added to the reproducible artifacts archive') + [CompletionResult]::new('--set', '--set', [CompletionResultType]::ParameterName, 'override options in config.toml') + [CompletionResult]::new('--all', '--all', [CompletionResultType]::ParameterName, 'Clean the entire build directory (not used by default)') + [CompletionResult]::new('-v', '-v', [CompletionResultType]::ParameterName, 'use verbose output (-vv for very verbose)') + [CompletionResult]::new('--verbose', '--verbose', [CompletionResultType]::ParameterName, 'use verbose output (-vv for very verbose)') + [CompletionResult]::new('-i', '-i', [CompletionResultType]::ParameterName, 'use incremental compilation') + [CompletionResult]::new('--incremental', '--incremental', [CompletionResultType]::ParameterName, 'use incremental compilation') + [CompletionResult]::new('--include-default-paths', '--include-default-paths', [CompletionResultType]::ParameterName, 'include default paths in addition to the provided ones') + [CompletionResult]::new('--dry-run', '--dry-run', [CompletionResultType]::ParameterName, 'dry run; don''t build anything') + [CompletionResult]::new('--dump-bootstrap-shims', '--dump-bootstrap-shims', [CompletionResultType]::ParameterName, 'Indicates whether to dump the work done from bootstrap shims') + [CompletionResult]::new('--json-output', '--json-output', [CompletionResultType]::ParameterName, 'use message-format=json') + [CompletionResult]::new('--bypass-bootstrap-lock', '--bypass-bootstrap-lock', [CompletionResultType]::ParameterName, 'Bootstrap uses this value to decide whether it should bypass locking the build process. This is rarely needed (e.g., compiling the std library for different targets in parallel)') + [CompletionResult]::new('--llvm-profile-generate', '--llvm-profile-generate', [CompletionResultType]::ParameterName, 'generate PGO profile with llvm built for rustc') + [CompletionResult]::new('--enable-bolt-settings', '--enable-bolt-settings', [CompletionResultType]::ParameterName, 'Enable BOLT link flags') + [CompletionResult]::new('--skip-stage0-validation', '--skip-stage0-validation', [CompletionResultType]::ParameterName, 'Skip stage0 compiler validation') + [CompletionResult]::new('-h', '-h', [CompletionResultType]::ParameterName, 'Print help (see more with ''--help'')') + [CompletionResult]::new('--help', '--help', [CompletionResultType]::ParameterName, 'Print help (see more with ''--help'')') break } 'x.py;dist' { - [CompletionResult]::new('--config', 'config', [CompletionResultType]::ParameterName, 'TOML configuration file for build') - [CompletionResult]::new('--build-dir', 'build-dir', [CompletionResultType]::ParameterName, 'Build directory, overrides `build.build-dir` in `config.toml`') - [CompletionResult]::new('--build', 'build', [CompletionResultType]::ParameterName, 'build target of the stage0 compiler') - [CompletionResult]::new('--host', 'host', [CompletionResultType]::ParameterName, 'host targets to build') - [CompletionResult]::new('--target', 'target', [CompletionResultType]::ParameterName, 'target targets to build') - [CompletionResult]::new('--exclude', 'exclude', [CompletionResultType]::ParameterName, 'build paths to exclude') - [CompletionResult]::new('--skip', 'skip', [CompletionResultType]::ParameterName, 'build paths to skip') - [CompletionResult]::new('--rustc-error-format', 'rustc-error-format', [CompletionResultType]::ParameterName, 'rustc-error-format') - [CompletionResult]::new('--on-fail', 'on-fail', [CompletionResultType]::ParameterName, 'command to run on failure') - [CompletionResult]::new('--stage', 'stage', [CompletionResultType]::ParameterName, 'stage to build (indicates compiler to use/test, e.g., stage 0 uses the bootstrap compiler, stage 1 the stage 0 rustc artifacts, etc.)') - [CompletionResult]::new('--keep-stage', 'keep-stage', [CompletionResultType]::ParameterName, 'stage(s) to keep without recompiling (pass multiple times to keep e.g., both stages 0 and 1)') - [CompletionResult]::new('--keep-stage-std', 'keep-stage-std', [CompletionResultType]::ParameterName, 'stage(s) of the standard library to keep without recompiling (pass multiple times to keep e.g., both stages 0 and 1)') - [CompletionResult]::new('--src', 'src', [CompletionResultType]::ParameterName, 'path to the root of the rust checkout') - [CompletionResult]::new('-j', 'j', [CompletionResultType]::ParameterName, 'number of jobs to run in parallel') - [CompletionResult]::new('--jobs', 'jobs', [CompletionResultType]::ParameterName, 'number of jobs to run in parallel') - [CompletionResult]::new('--warnings', 'warnings', [CompletionResultType]::ParameterName, 'if value is deny, will deny warnings if value is warn, will emit warnings otherwise, use the default configured behaviour') - [CompletionResult]::new('--error-format', 'error-format', [CompletionResultType]::ParameterName, 'rustc error format') - [CompletionResult]::new('--color', 'color', [CompletionResultType]::ParameterName, 'whether to use color in cargo and rustc output') - [CompletionResult]::new('--llvm-skip-rebuild', 'llvm-skip-rebuild', [CompletionResultType]::ParameterName, 'whether rebuilding llvm should be skipped, overriding `skip-rebuld` in config.toml') - [CompletionResult]::new('--rust-profile-generate', 'rust-profile-generate', [CompletionResultType]::ParameterName, 'generate PGO profile with rustc build') - [CompletionResult]::new('--rust-profile-use', 'rust-profile-use', [CompletionResultType]::ParameterName, 'use PGO profile for rustc build') - [CompletionResult]::new('--llvm-profile-use', 'llvm-profile-use', [CompletionResultType]::ParameterName, 'use PGO profile for LLVM build') - [CompletionResult]::new('--reproducible-artifact', 'reproducible-artifact', [CompletionResultType]::ParameterName, 'Additional reproducible artifacts that should be added to the reproducible artifacts archive') - [CompletionResult]::new('--set', 'set', [CompletionResultType]::ParameterName, 'override options in config.toml') - [CompletionResult]::new('-v', 'v', [CompletionResultType]::ParameterName, 'use verbose output (-vv for very verbose)') - [CompletionResult]::new('--verbose', 'verbose', [CompletionResultType]::ParameterName, 'use verbose output (-vv for very verbose)') - [CompletionResult]::new('-i', 'i', [CompletionResultType]::ParameterName, 'use incremental compilation') - [CompletionResult]::new('--incremental', 'incremental', [CompletionResultType]::ParameterName, 'use incremental compilation') - [CompletionResult]::new('--include-default-paths', 'include-default-paths', [CompletionResultType]::ParameterName, 'include default paths in addition to the provided ones') - [CompletionResult]::new('--dry-run', 'dry-run', [CompletionResultType]::ParameterName, 'dry run; don''t build anything') - [CompletionResult]::new('--dump-bootstrap-shims', 'dump-bootstrap-shims', [CompletionResultType]::ParameterName, 'Indicates whether to dump the work done from bootstrap shims') - [CompletionResult]::new('--json-output', 'json-output', [CompletionResultType]::ParameterName, 'use message-format=json') - [CompletionResult]::new('--bypass-bootstrap-lock', 'bypass-bootstrap-lock', [CompletionResultType]::ParameterName, 'Bootstrap uses this value to decide whether it should bypass locking the build process. This is rarely needed (e.g., compiling the std library for different targets in parallel)') - [CompletionResult]::new('--llvm-profile-generate', 'llvm-profile-generate', [CompletionResultType]::ParameterName, 'generate PGO profile with llvm built for rustc') - [CompletionResult]::new('--enable-bolt-settings', 'enable-bolt-settings', [CompletionResultType]::ParameterName, 'Enable BOLT link flags') - [CompletionResult]::new('--skip-stage0-validation', 'skip-stage0-validation', [CompletionResultType]::ParameterName, 'Skip stage0 compiler validation') - [CompletionResult]::new('-h', 'h', [CompletionResultType]::ParameterName, 'Print help (see more with ''--help'')') - [CompletionResult]::new('--help', 'help', [CompletionResultType]::ParameterName, 'Print help (see more with ''--help'')') + [CompletionResult]::new('--config', '--config', [CompletionResultType]::ParameterName, 'TOML configuration file for build') + [CompletionResult]::new('--build-dir', '--build-dir', [CompletionResultType]::ParameterName, 'Build directory, overrides `build.build-dir` in `config.toml`') + [CompletionResult]::new('--build', '--build', [CompletionResultType]::ParameterName, 'build target of the stage0 compiler') + [CompletionResult]::new('--host', '--host', [CompletionResultType]::ParameterName, 'host targets to build') + [CompletionResult]::new('--target', '--target', [CompletionResultType]::ParameterName, 'target targets to build') + [CompletionResult]::new('--exclude', '--exclude', [CompletionResultType]::ParameterName, 'build paths to exclude') + [CompletionResult]::new('--skip', '--skip', [CompletionResultType]::ParameterName, 'build paths to skip') + [CompletionResult]::new('--rustc-error-format', '--rustc-error-format', [CompletionResultType]::ParameterName, 'rustc-error-format') + [CompletionResult]::new('--on-fail', '--on-fail', [CompletionResultType]::ParameterName, 'command to run on failure') + [CompletionResult]::new('--stage', '--stage', [CompletionResultType]::ParameterName, 'stage to build (indicates compiler to use/test, e.g., stage 0 uses the bootstrap compiler, stage 1 the stage 0 rustc artifacts, etc.)') + [CompletionResult]::new('--keep-stage', '--keep-stage', [CompletionResultType]::ParameterName, 'stage(s) to keep without recompiling (pass multiple times to keep e.g., both stages 0 and 1)') + [CompletionResult]::new('--keep-stage-std', '--keep-stage-std', [CompletionResultType]::ParameterName, 'stage(s) of the standard library to keep without recompiling (pass multiple times to keep e.g., both stages 0 and 1)') + [CompletionResult]::new('--src', '--src', [CompletionResultType]::ParameterName, 'path to the root of the rust checkout') + [CompletionResult]::new('-j', '-j', [CompletionResultType]::ParameterName, 'number of jobs to run in parallel') + [CompletionResult]::new('--jobs', '--jobs', [CompletionResultType]::ParameterName, 'number of jobs to run in parallel') + [CompletionResult]::new('--warnings', '--warnings', [CompletionResultType]::ParameterName, 'if value is deny, will deny warnings if value is warn, will emit warnings otherwise, use the default configured behaviour') + [CompletionResult]::new('--error-format', '--error-format', [CompletionResultType]::ParameterName, 'rustc error format') + [CompletionResult]::new('--color', '--color', [CompletionResultType]::ParameterName, 'whether to use color in cargo and rustc output') + [CompletionResult]::new('--llvm-skip-rebuild', '--llvm-skip-rebuild', [CompletionResultType]::ParameterName, 'whether rebuilding llvm should be skipped, overriding `skip-rebuld` in config.toml') + [CompletionResult]::new('--rust-profile-generate', '--rust-profile-generate', [CompletionResultType]::ParameterName, 'generate PGO profile with rustc build') + [CompletionResult]::new('--rust-profile-use', '--rust-profile-use', [CompletionResultType]::ParameterName, 'use PGO profile for rustc build') + [CompletionResult]::new('--llvm-profile-use', '--llvm-profile-use', [CompletionResultType]::ParameterName, 'use PGO profile for LLVM build') + [CompletionResult]::new('--reproducible-artifact', '--reproducible-artifact', [CompletionResultType]::ParameterName, 'Additional reproducible artifacts that should be added to the reproducible artifacts archive') + [CompletionResult]::new('--set', '--set', [CompletionResultType]::ParameterName, 'override options in config.toml') + [CompletionResult]::new('-v', '-v', [CompletionResultType]::ParameterName, 'use verbose output (-vv for very verbose)') + [CompletionResult]::new('--verbose', '--verbose', [CompletionResultType]::ParameterName, 'use verbose output (-vv for very verbose)') + [CompletionResult]::new('-i', '-i', [CompletionResultType]::ParameterName, 'use incremental compilation') + [CompletionResult]::new('--incremental', '--incremental', [CompletionResultType]::ParameterName, 'use incremental compilation') + [CompletionResult]::new('--include-default-paths', '--include-default-paths', [CompletionResultType]::ParameterName, 'include default paths in addition to the provided ones') + [CompletionResult]::new('--dry-run', '--dry-run', [CompletionResultType]::ParameterName, 'dry run; don''t build anything') + [CompletionResult]::new('--dump-bootstrap-shims', '--dump-bootstrap-shims', [CompletionResultType]::ParameterName, 'Indicates whether to dump the work done from bootstrap shims') + [CompletionResult]::new('--json-output', '--json-output', [CompletionResultType]::ParameterName, 'use message-format=json') + [CompletionResult]::new('--bypass-bootstrap-lock', '--bypass-bootstrap-lock', [CompletionResultType]::ParameterName, 'Bootstrap uses this value to decide whether it should bypass locking the build process. This is rarely needed (e.g., compiling the std library for different targets in parallel)') + [CompletionResult]::new('--llvm-profile-generate', '--llvm-profile-generate', [CompletionResultType]::ParameterName, 'generate PGO profile with llvm built for rustc') + [CompletionResult]::new('--enable-bolt-settings', '--enable-bolt-settings', [CompletionResultType]::ParameterName, 'Enable BOLT link flags') + [CompletionResult]::new('--skip-stage0-validation', '--skip-stage0-validation', [CompletionResultType]::ParameterName, 'Skip stage0 compiler validation') + [CompletionResult]::new('-h', '-h', [CompletionResultType]::ParameterName, 'Print help (see more with ''--help'')') + [CompletionResult]::new('--help', '--help', [CompletionResultType]::ParameterName, 'Print help (see more with ''--help'')') break } 'x.py;install' { - [CompletionResult]::new('--config', 'config', [CompletionResultType]::ParameterName, 'TOML configuration file for build') - [CompletionResult]::new('--build-dir', 'build-dir', [CompletionResultType]::ParameterName, 'Build directory, overrides `build.build-dir` in `config.toml`') - [CompletionResult]::new('--build', 'build', [CompletionResultType]::ParameterName, 'build target of the stage0 compiler') - [CompletionResult]::new('--host', 'host', [CompletionResultType]::ParameterName, 'host targets to build') - [CompletionResult]::new('--target', 'target', [CompletionResultType]::ParameterName, 'target targets to build') - [CompletionResult]::new('--exclude', 'exclude', [CompletionResultType]::ParameterName, 'build paths to exclude') - [CompletionResult]::new('--skip', 'skip', [CompletionResultType]::ParameterName, 'build paths to skip') - [CompletionResult]::new('--rustc-error-format', 'rustc-error-format', [CompletionResultType]::ParameterName, 'rustc-error-format') - [CompletionResult]::new('--on-fail', 'on-fail', [CompletionResultType]::ParameterName, 'command to run on failure') - [CompletionResult]::new('--stage', 'stage', [CompletionResultType]::ParameterName, 'stage to build (indicates compiler to use/test, e.g., stage 0 uses the bootstrap compiler, stage 1 the stage 0 rustc artifacts, etc.)') - [CompletionResult]::new('--keep-stage', 'keep-stage', [CompletionResultType]::ParameterName, 'stage(s) to keep without recompiling (pass multiple times to keep e.g., both stages 0 and 1)') - [CompletionResult]::new('--keep-stage-std', 'keep-stage-std', [CompletionResultType]::ParameterName, 'stage(s) of the standard library to keep without recompiling (pass multiple times to keep e.g., both stages 0 and 1)') - [CompletionResult]::new('--src', 'src', [CompletionResultType]::ParameterName, 'path to the root of the rust checkout') - [CompletionResult]::new('-j', 'j', [CompletionResultType]::ParameterName, 'number of jobs to run in parallel') - [CompletionResult]::new('--jobs', 'jobs', [CompletionResultType]::ParameterName, 'number of jobs to run in parallel') - [CompletionResult]::new('--warnings', 'warnings', [CompletionResultType]::ParameterName, 'if value is deny, will deny warnings if value is warn, will emit warnings otherwise, use the default configured behaviour') - [CompletionResult]::new('--error-format', 'error-format', [CompletionResultType]::ParameterName, 'rustc error format') - [CompletionResult]::new('--color', 'color', [CompletionResultType]::ParameterName, 'whether to use color in cargo and rustc output') - [CompletionResult]::new('--llvm-skip-rebuild', 'llvm-skip-rebuild', [CompletionResultType]::ParameterName, 'whether rebuilding llvm should be skipped, overriding `skip-rebuld` in config.toml') - [CompletionResult]::new('--rust-profile-generate', 'rust-profile-generate', [CompletionResultType]::ParameterName, 'generate PGO profile with rustc build') - [CompletionResult]::new('--rust-profile-use', 'rust-profile-use', [CompletionResultType]::ParameterName, 'use PGO profile for rustc build') - [CompletionResult]::new('--llvm-profile-use', 'llvm-profile-use', [CompletionResultType]::ParameterName, 'use PGO profile for LLVM build') - [CompletionResult]::new('--reproducible-artifact', 'reproducible-artifact', [CompletionResultType]::ParameterName, 'Additional reproducible artifacts that should be added to the reproducible artifacts archive') - [CompletionResult]::new('--set', 'set', [CompletionResultType]::ParameterName, 'override options in config.toml') - [CompletionResult]::new('-v', 'v', [CompletionResultType]::ParameterName, 'use verbose output (-vv for very verbose)') - [CompletionResult]::new('--verbose', 'verbose', [CompletionResultType]::ParameterName, 'use verbose output (-vv for very verbose)') - [CompletionResult]::new('-i', 'i', [CompletionResultType]::ParameterName, 'use incremental compilation') - [CompletionResult]::new('--incremental', 'incremental', [CompletionResultType]::ParameterName, 'use incremental compilation') - [CompletionResult]::new('--include-default-paths', 'include-default-paths', [CompletionResultType]::ParameterName, 'include default paths in addition to the provided ones') - [CompletionResult]::new('--dry-run', 'dry-run', [CompletionResultType]::ParameterName, 'dry run; don''t build anything') - [CompletionResult]::new('--dump-bootstrap-shims', 'dump-bootstrap-shims', [CompletionResultType]::ParameterName, 'Indicates whether to dump the work done from bootstrap shims') - [CompletionResult]::new('--json-output', 'json-output', [CompletionResultType]::ParameterName, 'use message-format=json') - [CompletionResult]::new('--bypass-bootstrap-lock', 'bypass-bootstrap-lock', [CompletionResultType]::ParameterName, 'Bootstrap uses this value to decide whether it should bypass locking the build process. This is rarely needed (e.g., compiling the std library for different targets in parallel)') - [CompletionResult]::new('--llvm-profile-generate', 'llvm-profile-generate', [CompletionResultType]::ParameterName, 'generate PGO profile with llvm built for rustc') - [CompletionResult]::new('--enable-bolt-settings', 'enable-bolt-settings', [CompletionResultType]::ParameterName, 'Enable BOLT link flags') - [CompletionResult]::new('--skip-stage0-validation', 'skip-stage0-validation', [CompletionResultType]::ParameterName, 'Skip stage0 compiler validation') - [CompletionResult]::new('-h', 'h', [CompletionResultType]::ParameterName, 'Print help (see more with ''--help'')') - [CompletionResult]::new('--help', 'help', [CompletionResultType]::ParameterName, 'Print help (see more with ''--help'')') + [CompletionResult]::new('--config', '--config', [CompletionResultType]::ParameterName, 'TOML configuration file for build') + [CompletionResult]::new('--build-dir', '--build-dir', [CompletionResultType]::ParameterName, 'Build directory, overrides `build.build-dir` in `config.toml`') + [CompletionResult]::new('--build', '--build', [CompletionResultType]::ParameterName, 'build target of the stage0 compiler') + [CompletionResult]::new('--host', '--host', [CompletionResultType]::ParameterName, 'host targets to build') + [CompletionResult]::new('--target', '--target', [CompletionResultType]::ParameterName, 'target targets to build') + [CompletionResult]::new('--exclude', '--exclude', [CompletionResultType]::ParameterName, 'build paths to exclude') + [CompletionResult]::new('--skip', '--skip', [CompletionResultType]::ParameterName, 'build paths to skip') + [CompletionResult]::new('--rustc-error-format', '--rustc-error-format', [CompletionResultType]::ParameterName, 'rustc-error-format') + [CompletionResult]::new('--on-fail', '--on-fail', [CompletionResultType]::ParameterName, 'command to run on failure') + [CompletionResult]::new('--stage', '--stage', [CompletionResultType]::ParameterName, 'stage to build (indicates compiler to use/test, e.g., stage 0 uses the bootstrap compiler, stage 1 the stage 0 rustc artifacts, etc.)') + [CompletionResult]::new('--keep-stage', '--keep-stage', [CompletionResultType]::ParameterName, 'stage(s) to keep without recompiling (pass multiple times to keep e.g., both stages 0 and 1)') + [CompletionResult]::new('--keep-stage-std', '--keep-stage-std', [CompletionResultType]::ParameterName, 'stage(s) of the standard library to keep without recompiling (pass multiple times to keep e.g., both stages 0 and 1)') + [CompletionResult]::new('--src', '--src', [CompletionResultType]::ParameterName, 'path to the root of the rust checkout') + [CompletionResult]::new('-j', '-j', [CompletionResultType]::ParameterName, 'number of jobs to run in parallel') + [CompletionResult]::new('--jobs', '--jobs', [CompletionResultType]::ParameterName, 'number of jobs to run in parallel') + [CompletionResult]::new('--warnings', '--warnings', [CompletionResultType]::ParameterName, 'if value is deny, will deny warnings if value is warn, will emit warnings otherwise, use the default configured behaviour') + [CompletionResult]::new('--error-format', '--error-format', [CompletionResultType]::ParameterName, 'rustc error format') + [CompletionResult]::new('--color', '--color', [CompletionResultType]::ParameterName, 'whether to use color in cargo and rustc output') + [CompletionResult]::new('--llvm-skip-rebuild', '--llvm-skip-rebuild', [CompletionResultType]::ParameterName, 'whether rebuilding llvm should be skipped, overriding `skip-rebuld` in config.toml') + [CompletionResult]::new('--rust-profile-generate', '--rust-profile-generate', [CompletionResultType]::ParameterName, 'generate PGO profile with rustc build') + [CompletionResult]::new('--rust-profile-use', '--rust-profile-use', [CompletionResultType]::ParameterName, 'use PGO profile for rustc build') + [CompletionResult]::new('--llvm-profile-use', '--llvm-profile-use', [CompletionResultType]::ParameterName, 'use PGO profile for LLVM build') + [CompletionResult]::new('--reproducible-artifact', '--reproducible-artifact', [CompletionResultType]::ParameterName, 'Additional reproducible artifacts that should be added to the reproducible artifacts archive') + [CompletionResult]::new('--set', '--set', [CompletionResultType]::ParameterName, 'override options in config.toml') + [CompletionResult]::new('-v', '-v', [CompletionResultType]::ParameterName, 'use verbose output (-vv for very verbose)') + [CompletionResult]::new('--verbose', '--verbose', [CompletionResultType]::ParameterName, 'use verbose output (-vv for very verbose)') + [CompletionResult]::new('-i', '-i', [CompletionResultType]::ParameterName, 'use incremental compilation') + [CompletionResult]::new('--incremental', '--incremental', [CompletionResultType]::ParameterName, 'use incremental compilation') + [CompletionResult]::new('--include-default-paths', '--include-default-paths', [CompletionResultType]::ParameterName, 'include default paths in addition to the provided ones') + [CompletionResult]::new('--dry-run', '--dry-run', [CompletionResultType]::ParameterName, 'dry run; don''t build anything') + [CompletionResult]::new('--dump-bootstrap-shims', '--dump-bootstrap-shims', [CompletionResultType]::ParameterName, 'Indicates whether to dump the work done from bootstrap shims') + [CompletionResult]::new('--json-output', '--json-output', [CompletionResultType]::ParameterName, 'use message-format=json') + [CompletionResult]::new('--bypass-bootstrap-lock', '--bypass-bootstrap-lock', [CompletionResultType]::ParameterName, 'Bootstrap uses this value to decide whether it should bypass locking the build process. This is rarely needed (e.g., compiling the std library for different targets in parallel)') + [CompletionResult]::new('--llvm-profile-generate', '--llvm-profile-generate', [CompletionResultType]::ParameterName, 'generate PGO profile with llvm built for rustc') + [CompletionResult]::new('--enable-bolt-settings', '--enable-bolt-settings', [CompletionResultType]::ParameterName, 'Enable BOLT link flags') + [CompletionResult]::new('--skip-stage0-validation', '--skip-stage0-validation', [CompletionResultType]::ParameterName, 'Skip stage0 compiler validation') + [CompletionResult]::new('-h', '-h', [CompletionResultType]::ParameterName, 'Print help (see more with ''--help'')') + [CompletionResult]::new('--help', '--help', [CompletionResultType]::ParameterName, 'Print help (see more with ''--help'')') break } 'x.py;run' { - [CompletionResult]::new('--args', 'args', [CompletionResultType]::ParameterName, 'arguments for the tool') - [CompletionResult]::new('--config', 'config', [CompletionResultType]::ParameterName, 'TOML configuration file for build') - [CompletionResult]::new('--build-dir', 'build-dir', [CompletionResultType]::ParameterName, 'Build directory, overrides `build.build-dir` in `config.toml`') - [CompletionResult]::new('--build', 'build', [CompletionResultType]::ParameterName, 'build target of the stage0 compiler') - [CompletionResult]::new('--host', 'host', [CompletionResultType]::ParameterName, 'host targets to build') - [CompletionResult]::new('--target', 'target', [CompletionResultType]::ParameterName, 'target targets to build') - [CompletionResult]::new('--exclude', 'exclude', [CompletionResultType]::ParameterName, 'build paths to exclude') - [CompletionResult]::new('--skip', 'skip', [CompletionResultType]::ParameterName, 'build paths to skip') - [CompletionResult]::new('--rustc-error-format', 'rustc-error-format', [CompletionResultType]::ParameterName, 'rustc-error-format') - [CompletionResult]::new('--on-fail', 'on-fail', [CompletionResultType]::ParameterName, 'command to run on failure') - [CompletionResult]::new('--stage', 'stage', [CompletionResultType]::ParameterName, 'stage to build (indicates compiler to use/test, e.g., stage 0 uses the bootstrap compiler, stage 1 the stage 0 rustc artifacts, etc.)') - [CompletionResult]::new('--keep-stage', 'keep-stage', [CompletionResultType]::ParameterName, 'stage(s) to keep without recompiling (pass multiple times to keep e.g., both stages 0 and 1)') - [CompletionResult]::new('--keep-stage-std', 'keep-stage-std', [CompletionResultType]::ParameterName, 'stage(s) of the standard library to keep without recompiling (pass multiple times to keep e.g., both stages 0 and 1)') - [CompletionResult]::new('--src', 'src', [CompletionResultType]::ParameterName, 'path to the root of the rust checkout') - [CompletionResult]::new('-j', 'j', [CompletionResultType]::ParameterName, 'number of jobs to run in parallel') - [CompletionResult]::new('--jobs', 'jobs', [CompletionResultType]::ParameterName, 'number of jobs to run in parallel') - [CompletionResult]::new('--warnings', 'warnings', [CompletionResultType]::ParameterName, 'if value is deny, will deny warnings if value is warn, will emit warnings otherwise, use the default configured behaviour') - [CompletionResult]::new('--error-format', 'error-format', [CompletionResultType]::ParameterName, 'rustc error format') - [CompletionResult]::new('--color', 'color', [CompletionResultType]::ParameterName, 'whether to use color in cargo and rustc output') - [CompletionResult]::new('--llvm-skip-rebuild', 'llvm-skip-rebuild', [CompletionResultType]::ParameterName, 'whether rebuilding llvm should be skipped, overriding `skip-rebuld` in config.toml') - [CompletionResult]::new('--rust-profile-generate', 'rust-profile-generate', [CompletionResultType]::ParameterName, 'generate PGO profile with rustc build') - [CompletionResult]::new('--rust-profile-use', 'rust-profile-use', [CompletionResultType]::ParameterName, 'use PGO profile for rustc build') - [CompletionResult]::new('--llvm-profile-use', 'llvm-profile-use', [CompletionResultType]::ParameterName, 'use PGO profile for LLVM build') - [CompletionResult]::new('--reproducible-artifact', 'reproducible-artifact', [CompletionResultType]::ParameterName, 'Additional reproducible artifacts that should be added to the reproducible artifacts archive') - [CompletionResult]::new('--set', 'set', [CompletionResultType]::ParameterName, 'override options in config.toml') - [CompletionResult]::new('-v', 'v', [CompletionResultType]::ParameterName, 'use verbose output (-vv for very verbose)') - [CompletionResult]::new('--verbose', 'verbose', [CompletionResultType]::ParameterName, 'use verbose output (-vv for very verbose)') - [CompletionResult]::new('-i', 'i', [CompletionResultType]::ParameterName, 'use incremental compilation') - [CompletionResult]::new('--incremental', 'incremental', [CompletionResultType]::ParameterName, 'use incremental compilation') - [CompletionResult]::new('--include-default-paths', 'include-default-paths', [CompletionResultType]::ParameterName, 'include default paths in addition to the provided ones') - [CompletionResult]::new('--dry-run', 'dry-run', [CompletionResultType]::ParameterName, 'dry run; don''t build anything') - [CompletionResult]::new('--dump-bootstrap-shims', 'dump-bootstrap-shims', [CompletionResultType]::ParameterName, 'Indicates whether to dump the work done from bootstrap shims') - [CompletionResult]::new('--json-output', 'json-output', [CompletionResultType]::ParameterName, 'use message-format=json') - [CompletionResult]::new('--bypass-bootstrap-lock', 'bypass-bootstrap-lock', [CompletionResultType]::ParameterName, 'Bootstrap uses this value to decide whether it should bypass locking the build process. This is rarely needed (e.g., compiling the std library for different targets in parallel)') - [CompletionResult]::new('--llvm-profile-generate', 'llvm-profile-generate', [CompletionResultType]::ParameterName, 'generate PGO profile with llvm built for rustc') - [CompletionResult]::new('--enable-bolt-settings', 'enable-bolt-settings', [CompletionResultType]::ParameterName, 'Enable BOLT link flags') - [CompletionResult]::new('--skip-stage0-validation', 'skip-stage0-validation', [CompletionResultType]::ParameterName, 'Skip stage0 compiler validation') - [CompletionResult]::new('-h', 'h', [CompletionResultType]::ParameterName, 'Print help (see more with ''--help'')') - [CompletionResult]::new('--help', 'help', [CompletionResultType]::ParameterName, 'Print help (see more with ''--help'')') + [CompletionResult]::new('--args', '--args', [CompletionResultType]::ParameterName, 'arguments for the tool') + [CompletionResult]::new('--config', '--config', [CompletionResultType]::ParameterName, 'TOML configuration file for build') + [CompletionResult]::new('--build-dir', '--build-dir', [CompletionResultType]::ParameterName, 'Build directory, overrides `build.build-dir` in `config.toml`') + [CompletionResult]::new('--build', '--build', [CompletionResultType]::ParameterName, 'build target of the stage0 compiler') + [CompletionResult]::new('--host', '--host', [CompletionResultType]::ParameterName, 'host targets to build') + [CompletionResult]::new('--target', '--target', [CompletionResultType]::ParameterName, 'target targets to build') + [CompletionResult]::new('--exclude', '--exclude', [CompletionResultType]::ParameterName, 'build paths to exclude') + [CompletionResult]::new('--skip', '--skip', [CompletionResultType]::ParameterName, 'build paths to skip') + [CompletionResult]::new('--rustc-error-format', '--rustc-error-format', [CompletionResultType]::ParameterName, 'rustc-error-format') + [CompletionResult]::new('--on-fail', '--on-fail', [CompletionResultType]::ParameterName, 'command to run on failure') + [CompletionResult]::new('--stage', '--stage', [CompletionResultType]::ParameterName, 'stage to build (indicates compiler to use/test, e.g., stage 0 uses the bootstrap compiler, stage 1 the stage 0 rustc artifacts, etc.)') + [CompletionResult]::new('--keep-stage', '--keep-stage', [CompletionResultType]::ParameterName, 'stage(s) to keep without recompiling (pass multiple times to keep e.g., both stages 0 and 1)') + [CompletionResult]::new('--keep-stage-std', '--keep-stage-std', [CompletionResultType]::ParameterName, 'stage(s) of the standard library to keep without recompiling (pass multiple times to keep e.g., both stages 0 and 1)') + [CompletionResult]::new('--src', '--src', [CompletionResultType]::ParameterName, 'path to the root of the rust checkout') + [CompletionResult]::new('-j', '-j', [CompletionResultType]::ParameterName, 'number of jobs to run in parallel') + [CompletionResult]::new('--jobs', '--jobs', [CompletionResultType]::ParameterName, 'number of jobs to run in parallel') + [CompletionResult]::new('--warnings', '--warnings', [CompletionResultType]::ParameterName, 'if value is deny, will deny warnings if value is warn, will emit warnings otherwise, use the default configured behaviour') + [CompletionResult]::new('--error-format', '--error-format', [CompletionResultType]::ParameterName, 'rustc error format') + [CompletionResult]::new('--color', '--color', [CompletionResultType]::ParameterName, 'whether to use color in cargo and rustc output') + [CompletionResult]::new('--llvm-skip-rebuild', '--llvm-skip-rebuild', [CompletionResultType]::ParameterName, 'whether rebuilding llvm should be skipped, overriding `skip-rebuld` in config.toml') + [CompletionResult]::new('--rust-profile-generate', '--rust-profile-generate', [CompletionResultType]::ParameterName, 'generate PGO profile with rustc build') + [CompletionResult]::new('--rust-profile-use', '--rust-profile-use', [CompletionResultType]::ParameterName, 'use PGO profile for rustc build') + [CompletionResult]::new('--llvm-profile-use', '--llvm-profile-use', [CompletionResultType]::ParameterName, 'use PGO profile for LLVM build') + [CompletionResult]::new('--reproducible-artifact', '--reproducible-artifact', [CompletionResultType]::ParameterName, 'Additional reproducible artifacts that should be added to the reproducible artifacts archive') + [CompletionResult]::new('--set', '--set', [CompletionResultType]::ParameterName, 'override options in config.toml') + [CompletionResult]::new('-v', '-v', [CompletionResultType]::ParameterName, 'use verbose output (-vv for very verbose)') + [CompletionResult]::new('--verbose', '--verbose', [CompletionResultType]::ParameterName, 'use verbose output (-vv for very verbose)') + [CompletionResult]::new('-i', '-i', [CompletionResultType]::ParameterName, 'use incremental compilation') + [CompletionResult]::new('--incremental', '--incremental', [CompletionResultType]::ParameterName, 'use incremental compilation') + [CompletionResult]::new('--include-default-paths', '--include-default-paths', [CompletionResultType]::ParameterName, 'include default paths in addition to the provided ones') + [CompletionResult]::new('--dry-run', '--dry-run', [CompletionResultType]::ParameterName, 'dry run; don''t build anything') + [CompletionResult]::new('--dump-bootstrap-shims', '--dump-bootstrap-shims', [CompletionResultType]::ParameterName, 'Indicates whether to dump the work done from bootstrap shims') + [CompletionResult]::new('--json-output', '--json-output', [CompletionResultType]::ParameterName, 'use message-format=json') + [CompletionResult]::new('--bypass-bootstrap-lock', '--bypass-bootstrap-lock', [CompletionResultType]::ParameterName, 'Bootstrap uses this value to decide whether it should bypass locking the build process. This is rarely needed (e.g., compiling the std library for different targets in parallel)') + [CompletionResult]::new('--llvm-profile-generate', '--llvm-profile-generate', [CompletionResultType]::ParameterName, 'generate PGO profile with llvm built for rustc') + [CompletionResult]::new('--enable-bolt-settings', '--enable-bolt-settings', [CompletionResultType]::ParameterName, 'Enable BOLT link flags') + [CompletionResult]::new('--skip-stage0-validation', '--skip-stage0-validation', [CompletionResultType]::ParameterName, 'Skip stage0 compiler validation') + [CompletionResult]::new('-h', '-h', [CompletionResultType]::ParameterName, 'Print help (see more with ''--help'')') + [CompletionResult]::new('--help', '--help', [CompletionResultType]::ParameterName, 'Print help (see more with ''--help'')') break } 'x.py;setup' { - [CompletionResult]::new('--config', 'config', [CompletionResultType]::ParameterName, 'TOML configuration file for build') - [CompletionResult]::new('--build-dir', 'build-dir', [CompletionResultType]::ParameterName, 'Build directory, overrides `build.build-dir` in `config.toml`') - [CompletionResult]::new('--build', 'build', [CompletionResultType]::ParameterName, 'build target of the stage0 compiler') - [CompletionResult]::new('--host', 'host', [CompletionResultType]::ParameterName, 'host targets to build') - [CompletionResult]::new('--target', 'target', [CompletionResultType]::ParameterName, 'target targets to build') - [CompletionResult]::new('--exclude', 'exclude', [CompletionResultType]::ParameterName, 'build paths to exclude') - [CompletionResult]::new('--skip', 'skip', [CompletionResultType]::ParameterName, 'build paths to skip') - [CompletionResult]::new('--rustc-error-format', 'rustc-error-format', [CompletionResultType]::ParameterName, 'rustc-error-format') - [CompletionResult]::new('--on-fail', 'on-fail', [CompletionResultType]::ParameterName, 'command to run on failure') - [CompletionResult]::new('--stage', 'stage', [CompletionResultType]::ParameterName, 'stage to build (indicates compiler to use/test, e.g., stage 0 uses the bootstrap compiler, stage 1 the stage 0 rustc artifacts, etc.)') - [CompletionResult]::new('--keep-stage', 'keep-stage', [CompletionResultType]::ParameterName, 'stage(s) to keep without recompiling (pass multiple times to keep e.g., both stages 0 and 1)') - [CompletionResult]::new('--keep-stage-std', 'keep-stage-std', [CompletionResultType]::ParameterName, 'stage(s) of the standard library to keep without recompiling (pass multiple times to keep e.g., both stages 0 and 1)') - [CompletionResult]::new('--src', 'src', [CompletionResultType]::ParameterName, 'path to the root of the rust checkout') - [CompletionResult]::new('-j', 'j', [CompletionResultType]::ParameterName, 'number of jobs to run in parallel') - [CompletionResult]::new('--jobs', 'jobs', [CompletionResultType]::ParameterName, 'number of jobs to run in parallel') - [CompletionResult]::new('--warnings', 'warnings', [CompletionResultType]::ParameterName, 'if value is deny, will deny warnings if value is warn, will emit warnings otherwise, use the default configured behaviour') - [CompletionResult]::new('--error-format', 'error-format', [CompletionResultType]::ParameterName, 'rustc error format') - [CompletionResult]::new('--color', 'color', [CompletionResultType]::ParameterName, 'whether to use color in cargo and rustc output') - [CompletionResult]::new('--llvm-skip-rebuild', 'llvm-skip-rebuild', [CompletionResultType]::ParameterName, 'whether rebuilding llvm should be skipped, overriding `skip-rebuld` in config.toml') - [CompletionResult]::new('--rust-profile-generate', 'rust-profile-generate', [CompletionResultType]::ParameterName, 'generate PGO profile with rustc build') - [CompletionResult]::new('--rust-profile-use', 'rust-profile-use', [CompletionResultType]::ParameterName, 'use PGO profile for rustc build') - [CompletionResult]::new('--llvm-profile-use', 'llvm-profile-use', [CompletionResultType]::ParameterName, 'use PGO profile for LLVM build') - [CompletionResult]::new('--reproducible-artifact', 'reproducible-artifact', [CompletionResultType]::ParameterName, 'Additional reproducible artifacts that should be added to the reproducible artifacts archive') - [CompletionResult]::new('--set', 'set', [CompletionResultType]::ParameterName, 'override options in config.toml') - [CompletionResult]::new('-v', 'v', [CompletionResultType]::ParameterName, 'use verbose output (-vv for very verbose)') - [CompletionResult]::new('--verbose', 'verbose', [CompletionResultType]::ParameterName, 'use verbose output (-vv for very verbose)') - [CompletionResult]::new('-i', 'i', [CompletionResultType]::ParameterName, 'use incremental compilation') - [CompletionResult]::new('--incremental', 'incremental', [CompletionResultType]::ParameterName, 'use incremental compilation') - [CompletionResult]::new('--include-default-paths', 'include-default-paths', [CompletionResultType]::ParameterName, 'include default paths in addition to the provided ones') - [CompletionResult]::new('--dry-run', 'dry-run', [CompletionResultType]::ParameterName, 'dry run; don''t build anything') - [CompletionResult]::new('--dump-bootstrap-shims', 'dump-bootstrap-shims', [CompletionResultType]::ParameterName, 'Indicates whether to dump the work done from bootstrap shims') - [CompletionResult]::new('--json-output', 'json-output', [CompletionResultType]::ParameterName, 'use message-format=json') - [CompletionResult]::new('--bypass-bootstrap-lock', 'bypass-bootstrap-lock', [CompletionResultType]::ParameterName, 'Bootstrap uses this value to decide whether it should bypass locking the build process. This is rarely needed (e.g., compiling the std library for different targets in parallel)') - [CompletionResult]::new('--llvm-profile-generate', 'llvm-profile-generate', [CompletionResultType]::ParameterName, 'generate PGO profile with llvm built for rustc') - [CompletionResult]::new('--enable-bolt-settings', 'enable-bolt-settings', [CompletionResultType]::ParameterName, 'Enable BOLT link flags') - [CompletionResult]::new('--skip-stage0-validation', 'skip-stage0-validation', [CompletionResultType]::ParameterName, 'Skip stage0 compiler validation') - [CompletionResult]::new('-h', 'h', [CompletionResultType]::ParameterName, 'Print help (see more with ''--help'')') - [CompletionResult]::new('--help', 'help', [CompletionResultType]::ParameterName, 'Print help (see more with ''--help'')') + [CompletionResult]::new('--config', '--config', [CompletionResultType]::ParameterName, 'TOML configuration file for build') + [CompletionResult]::new('--build-dir', '--build-dir', [CompletionResultType]::ParameterName, 'Build directory, overrides `build.build-dir` in `config.toml`') + [CompletionResult]::new('--build', '--build', [CompletionResultType]::ParameterName, 'build target of the stage0 compiler') + [CompletionResult]::new('--host', '--host', [CompletionResultType]::ParameterName, 'host targets to build') + [CompletionResult]::new('--target', '--target', [CompletionResultType]::ParameterName, 'target targets to build') + [CompletionResult]::new('--exclude', '--exclude', [CompletionResultType]::ParameterName, 'build paths to exclude') + [CompletionResult]::new('--skip', '--skip', [CompletionResultType]::ParameterName, 'build paths to skip') + [CompletionResult]::new('--rustc-error-format', '--rustc-error-format', [CompletionResultType]::ParameterName, 'rustc-error-format') + [CompletionResult]::new('--on-fail', '--on-fail', [CompletionResultType]::ParameterName, 'command to run on failure') + [CompletionResult]::new('--stage', '--stage', [CompletionResultType]::ParameterName, 'stage to build (indicates compiler to use/test, e.g., stage 0 uses the bootstrap compiler, stage 1 the stage 0 rustc artifacts, etc.)') + [CompletionResult]::new('--keep-stage', '--keep-stage', [CompletionResultType]::ParameterName, 'stage(s) to keep without recompiling (pass multiple times to keep e.g., both stages 0 and 1)') + [CompletionResult]::new('--keep-stage-std', '--keep-stage-std', [CompletionResultType]::ParameterName, 'stage(s) of the standard library to keep without recompiling (pass multiple times to keep e.g., both stages 0 and 1)') + [CompletionResult]::new('--src', '--src', [CompletionResultType]::ParameterName, 'path to the root of the rust checkout') + [CompletionResult]::new('-j', '-j', [CompletionResultType]::ParameterName, 'number of jobs to run in parallel') + [CompletionResult]::new('--jobs', '--jobs', [CompletionResultType]::ParameterName, 'number of jobs to run in parallel') + [CompletionResult]::new('--warnings', '--warnings', [CompletionResultType]::ParameterName, 'if value is deny, will deny warnings if value is warn, will emit warnings otherwise, use the default configured behaviour') + [CompletionResult]::new('--error-format', '--error-format', [CompletionResultType]::ParameterName, 'rustc error format') + [CompletionResult]::new('--color', '--color', [CompletionResultType]::ParameterName, 'whether to use color in cargo and rustc output') + [CompletionResult]::new('--llvm-skip-rebuild', '--llvm-skip-rebuild', [CompletionResultType]::ParameterName, 'whether rebuilding llvm should be skipped, overriding `skip-rebuld` in config.toml') + [CompletionResult]::new('--rust-profile-generate', '--rust-profile-generate', [CompletionResultType]::ParameterName, 'generate PGO profile with rustc build') + [CompletionResult]::new('--rust-profile-use', '--rust-profile-use', [CompletionResultType]::ParameterName, 'use PGO profile for rustc build') + [CompletionResult]::new('--llvm-profile-use', '--llvm-profile-use', [CompletionResultType]::ParameterName, 'use PGO profile for LLVM build') + [CompletionResult]::new('--reproducible-artifact', '--reproducible-artifact', [CompletionResultType]::ParameterName, 'Additional reproducible artifacts that should be added to the reproducible artifacts archive') + [CompletionResult]::new('--set', '--set', [CompletionResultType]::ParameterName, 'override options in config.toml') + [CompletionResult]::new('-v', '-v', [CompletionResultType]::ParameterName, 'use verbose output (-vv for very verbose)') + [CompletionResult]::new('--verbose', '--verbose', [CompletionResultType]::ParameterName, 'use verbose output (-vv for very verbose)') + [CompletionResult]::new('-i', '-i', [CompletionResultType]::ParameterName, 'use incremental compilation') + [CompletionResult]::new('--incremental', '--incremental', [CompletionResultType]::ParameterName, 'use incremental compilation') + [CompletionResult]::new('--include-default-paths', '--include-default-paths', [CompletionResultType]::ParameterName, 'include default paths in addition to the provided ones') + [CompletionResult]::new('--dry-run', '--dry-run', [CompletionResultType]::ParameterName, 'dry run; don''t build anything') + [CompletionResult]::new('--dump-bootstrap-shims', '--dump-bootstrap-shims', [CompletionResultType]::ParameterName, 'Indicates whether to dump the work done from bootstrap shims') + [CompletionResult]::new('--json-output', '--json-output', [CompletionResultType]::ParameterName, 'use message-format=json') + [CompletionResult]::new('--bypass-bootstrap-lock', '--bypass-bootstrap-lock', [CompletionResultType]::ParameterName, 'Bootstrap uses this value to decide whether it should bypass locking the build process. This is rarely needed (e.g., compiling the std library for different targets in parallel)') + [CompletionResult]::new('--llvm-profile-generate', '--llvm-profile-generate', [CompletionResultType]::ParameterName, 'generate PGO profile with llvm built for rustc') + [CompletionResult]::new('--enable-bolt-settings', '--enable-bolt-settings', [CompletionResultType]::ParameterName, 'Enable BOLT link flags') + [CompletionResult]::new('--skip-stage0-validation', '--skip-stage0-validation', [CompletionResultType]::ParameterName, 'Skip stage0 compiler validation') + [CompletionResult]::new('-h', '-h', [CompletionResultType]::ParameterName, 'Print help (see more with ''--help'')') + [CompletionResult]::new('--help', '--help', [CompletionResultType]::ParameterName, 'Print help (see more with ''--help'')') break } 'x.py;suggest' { - [CompletionResult]::new('--config', 'config', [CompletionResultType]::ParameterName, 'TOML configuration file for build') - [CompletionResult]::new('--build-dir', 'build-dir', [CompletionResultType]::ParameterName, 'Build directory, overrides `build.build-dir` in `config.toml`') - [CompletionResult]::new('--build', 'build', [CompletionResultType]::ParameterName, 'build target of the stage0 compiler') - [CompletionResult]::new('--host', 'host', [CompletionResultType]::ParameterName, 'host targets to build') - [CompletionResult]::new('--target', 'target', [CompletionResultType]::ParameterName, 'target targets to build') - [CompletionResult]::new('--exclude', 'exclude', [CompletionResultType]::ParameterName, 'build paths to exclude') - [CompletionResult]::new('--skip', 'skip', [CompletionResultType]::ParameterName, 'build paths to skip') - [CompletionResult]::new('--rustc-error-format', 'rustc-error-format', [CompletionResultType]::ParameterName, 'rustc-error-format') - [CompletionResult]::new('--on-fail', 'on-fail', [CompletionResultType]::ParameterName, 'command to run on failure') - [CompletionResult]::new('--stage', 'stage', [CompletionResultType]::ParameterName, 'stage to build (indicates compiler to use/test, e.g., stage 0 uses the bootstrap compiler, stage 1 the stage 0 rustc artifacts, etc.)') - [CompletionResult]::new('--keep-stage', 'keep-stage', [CompletionResultType]::ParameterName, 'stage(s) to keep without recompiling (pass multiple times to keep e.g., both stages 0 and 1)') - [CompletionResult]::new('--keep-stage-std', 'keep-stage-std', [CompletionResultType]::ParameterName, 'stage(s) of the standard library to keep without recompiling (pass multiple times to keep e.g., both stages 0 and 1)') - [CompletionResult]::new('--src', 'src', [CompletionResultType]::ParameterName, 'path to the root of the rust checkout') - [CompletionResult]::new('-j', 'j', [CompletionResultType]::ParameterName, 'number of jobs to run in parallel') - [CompletionResult]::new('--jobs', 'jobs', [CompletionResultType]::ParameterName, 'number of jobs to run in parallel') - [CompletionResult]::new('--warnings', 'warnings', [CompletionResultType]::ParameterName, 'if value is deny, will deny warnings if value is warn, will emit warnings otherwise, use the default configured behaviour') - [CompletionResult]::new('--error-format', 'error-format', [CompletionResultType]::ParameterName, 'rustc error format') - [CompletionResult]::new('--color', 'color', [CompletionResultType]::ParameterName, 'whether to use color in cargo and rustc output') - [CompletionResult]::new('--llvm-skip-rebuild', 'llvm-skip-rebuild', [CompletionResultType]::ParameterName, 'whether rebuilding llvm should be skipped, overriding `skip-rebuld` in config.toml') - [CompletionResult]::new('--rust-profile-generate', 'rust-profile-generate', [CompletionResultType]::ParameterName, 'generate PGO profile with rustc build') - [CompletionResult]::new('--rust-profile-use', 'rust-profile-use', [CompletionResultType]::ParameterName, 'use PGO profile for rustc build') - [CompletionResult]::new('--llvm-profile-use', 'llvm-profile-use', [CompletionResultType]::ParameterName, 'use PGO profile for LLVM build') - [CompletionResult]::new('--reproducible-artifact', 'reproducible-artifact', [CompletionResultType]::ParameterName, 'Additional reproducible artifacts that should be added to the reproducible artifacts archive') - [CompletionResult]::new('--set', 'set', [CompletionResultType]::ParameterName, 'override options in config.toml') - [CompletionResult]::new('--run', 'run', [CompletionResultType]::ParameterName, 'run suggested tests') - [CompletionResult]::new('-v', 'v', [CompletionResultType]::ParameterName, 'use verbose output (-vv for very verbose)') - [CompletionResult]::new('--verbose', 'verbose', [CompletionResultType]::ParameterName, 'use verbose output (-vv for very verbose)') - [CompletionResult]::new('-i', 'i', [CompletionResultType]::ParameterName, 'use incremental compilation') - [CompletionResult]::new('--incremental', 'incremental', [CompletionResultType]::ParameterName, 'use incremental compilation') - [CompletionResult]::new('--include-default-paths', 'include-default-paths', [CompletionResultType]::ParameterName, 'include default paths in addition to the provided ones') - [CompletionResult]::new('--dry-run', 'dry-run', [CompletionResultType]::ParameterName, 'dry run; don''t build anything') - [CompletionResult]::new('--dump-bootstrap-shims', 'dump-bootstrap-shims', [CompletionResultType]::ParameterName, 'Indicates whether to dump the work done from bootstrap shims') - [CompletionResult]::new('--json-output', 'json-output', [CompletionResultType]::ParameterName, 'use message-format=json') - [CompletionResult]::new('--bypass-bootstrap-lock', 'bypass-bootstrap-lock', [CompletionResultType]::ParameterName, 'Bootstrap uses this value to decide whether it should bypass locking the build process. This is rarely needed (e.g., compiling the std library for different targets in parallel)') - [CompletionResult]::new('--llvm-profile-generate', 'llvm-profile-generate', [CompletionResultType]::ParameterName, 'generate PGO profile with llvm built for rustc') - [CompletionResult]::new('--enable-bolt-settings', 'enable-bolt-settings', [CompletionResultType]::ParameterName, 'Enable BOLT link flags') - [CompletionResult]::new('--skip-stage0-validation', 'skip-stage0-validation', [CompletionResultType]::ParameterName, 'Skip stage0 compiler validation') - [CompletionResult]::new('-h', 'h', [CompletionResultType]::ParameterName, 'Print help (see more with ''--help'')') - [CompletionResult]::new('--help', 'help', [CompletionResultType]::ParameterName, 'Print help (see more with ''--help'')') + [CompletionResult]::new('--config', '--config', [CompletionResultType]::ParameterName, 'TOML configuration file for build') + [CompletionResult]::new('--build-dir', '--build-dir', [CompletionResultType]::ParameterName, 'Build directory, overrides `build.build-dir` in `config.toml`') + [CompletionResult]::new('--build', '--build', [CompletionResultType]::ParameterName, 'build target of the stage0 compiler') + [CompletionResult]::new('--host', '--host', [CompletionResultType]::ParameterName, 'host targets to build') + [CompletionResult]::new('--target', '--target', [CompletionResultType]::ParameterName, 'target targets to build') + [CompletionResult]::new('--exclude', '--exclude', [CompletionResultType]::ParameterName, 'build paths to exclude') + [CompletionResult]::new('--skip', '--skip', [CompletionResultType]::ParameterName, 'build paths to skip') + [CompletionResult]::new('--rustc-error-format', '--rustc-error-format', [CompletionResultType]::ParameterName, 'rustc-error-format') + [CompletionResult]::new('--on-fail', '--on-fail', [CompletionResultType]::ParameterName, 'command to run on failure') + [CompletionResult]::new('--stage', '--stage', [CompletionResultType]::ParameterName, 'stage to build (indicates compiler to use/test, e.g., stage 0 uses the bootstrap compiler, stage 1 the stage 0 rustc artifacts, etc.)') + [CompletionResult]::new('--keep-stage', '--keep-stage', [CompletionResultType]::ParameterName, 'stage(s) to keep without recompiling (pass multiple times to keep e.g., both stages 0 and 1)') + [CompletionResult]::new('--keep-stage-std', '--keep-stage-std', [CompletionResultType]::ParameterName, 'stage(s) of the standard library to keep without recompiling (pass multiple times to keep e.g., both stages 0 and 1)') + [CompletionResult]::new('--src', '--src', [CompletionResultType]::ParameterName, 'path to the root of the rust checkout') + [CompletionResult]::new('-j', '-j', [CompletionResultType]::ParameterName, 'number of jobs to run in parallel') + [CompletionResult]::new('--jobs', '--jobs', [CompletionResultType]::ParameterName, 'number of jobs to run in parallel') + [CompletionResult]::new('--warnings', '--warnings', [CompletionResultType]::ParameterName, 'if value is deny, will deny warnings if value is warn, will emit warnings otherwise, use the default configured behaviour') + [CompletionResult]::new('--error-format', '--error-format', [CompletionResultType]::ParameterName, 'rustc error format') + [CompletionResult]::new('--color', '--color', [CompletionResultType]::ParameterName, 'whether to use color in cargo and rustc output') + [CompletionResult]::new('--llvm-skip-rebuild', '--llvm-skip-rebuild', [CompletionResultType]::ParameterName, 'whether rebuilding llvm should be skipped, overriding `skip-rebuld` in config.toml') + [CompletionResult]::new('--rust-profile-generate', '--rust-profile-generate', [CompletionResultType]::ParameterName, 'generate PGO profile with rustc build') + [CompletionResult]::new('--rust-profile-use', '--rust-profile-use', [CompletionResultType]::ParameterName, 'use PGO profile for rustc build') + [CompletionResult]::new('--llvm-profile-use', '--llvm-profile-use', [CompletionResultType]::ParameterName, 'use PGO profile for LLVM build') + [CompletionResult]::new('--reproducible-artifact', '--reproducible-artifact', [CompletionResultType]::ParameterName, 'Additional reproducible artifacts that should be added to the reproducible artifacts archive') + [CompletionResult]::new('--set', '--set', [CompletionResultType]::ParameterName, 'override options in config.toml') + [CompletionResult]::new('--run', '--run', [CompletionResultType]::ParameterName, 'run suggested tests') + [CompletionResult]::new('-v', '-v', [CompletionResultType]::ParameterName, 'use verbose output (-vv for very verbose)') + [CompletionResult]::new('--verbose', '--verbose', [CompletionResultType]::ParameterName, 'use verbose output (-vv for very verbose)') + [CompletionResult]::new('-i', '-i', [CompletionResultType]::ParameterName, 'use incremental compilation') + [CompletionResult]::new('--incremental', '--incremental', [CompletionResultType]::ParameterName, 'use incremental compilation') + [CompletionResult]::new('--include-default-paths', '--include-default-paths', [CompletionResultType]::ParameterName, 'include default paths in addition to the provided ones') + [CompletionResult]::new('--dry-run', '--dry-run', [CompletionResultType]::ParameterName, 'dry run; don''t build anything') + [CompletionResult]::new('--dump-bootstrap-shims', '--dump-bootstrap-shims', [CompletionResultType]::ParameterName, 'Indicates whether to dump the work done from bootstrap shims') + [CompletionResult]::new('--json-output', '--json-output', [CompletionResultType]::ParameterName, 'use message-format=json') + [CompletionResult]::new('--bypass-bootstrap-lock', '--bypass-bootstrap-lock', [CompletionResultType]::ParameterName, 'Bootstrap uses this value to decide whether it should bypass locking the build process. This is rarely needed (e.g., compiling the std library for different targets in parallel)') + [CompletionResult]::new('--llvm-profile-generate', '--llvm-profile-generate', [CompletionResultType]::ParameterName, 'generate PGO profile with llvm built for rustc') + [CompletionResult]::new('--enable-bolt-settings', '--enable-bolt-settings', [CompletionResultType]::ParameterName, 'Enable BOLT link flags') + [CompletionResult]::new('--skip-stage0-validation', '--skip-stage0-validation', [CompletionResultType]::ParameterName, 'Skip stage0 compiler validation') + [CompletionResult]::new('-h', '-h', [CompletionResultType]::ParameterName, 'Print help (see more with ''--help'')') + [CompletionResult]::new('--help', '--help', [CompletionResultType]::ParameterName, 'Print help (see more with ''--help'')') break } 'x.py;vendor' { - [CompletionResult]::new('--sync', 'sync', [CompletionResultType]::ParameterName, 'Additional `Cargo.toml` to sync and vendor') - [CompletionResult]::new('--config', 'config', [CompletionResultType]::ParameterName, 'TOML configuration file for build') - [CompletionResult]::new('--build-dir', 'build-dir', [CompletionResultType]::ParameterName, 'Build directory, overrides `build.build-dir` in `config.toml`') - [CompletionResult]::new('--build', 'build', [CompletionResultType]::ParameterName, 'build target of the stage0 compiler') - [CompletionResult]::new('--host', 'host', [CompletionResultType]::ParameterName, 'host targets to build') - [CompletionResult]::new('--target', 'target', [CompletionResultType]::ParameterName, 'target targets to build') - [CompletionResult]::new('--exclude', 'exclude', [CompletionResultType]::ParameterName, 'build paths to exclude') - [CompletionResult]::new('--skip', 'skip', [CompletionResultType]::ParameterName, 'build paths to skip') - [CompletionResult]::new('--rustc-error-format', 'rustc-error-format', [CompletionResultType]::ParameterName, 'rustc-error-format') - [CompletionResult]::new('--on-fail', 'on-fail', [CompletionResultType]::ParameterName, 'command to run on failure') - [CompletionResult]::new('--stage', 'stage', [CompletionResultType]::ParameterName, 'stage to build (indicates compiler to use/test, e.g., stage 0 uses the bootstrap compiler, stage 1 the stage 0 rustc artifacts, etc.)') - [CompletionResult]::new('--keep-stage', 'keep-stage', [CompletionResultType]::ParameterName, 'stage(s) to keep without recompiling (pass multiple times to keep e.g., both stages 0 and 1)') - [CompletionResult]::new('--keep-stage-std', 'keep-stage-std', [CompletionResultType]::ParameterName, 'stage(s) of the standard library to keep without recompiling (pass multiple times to keep e.g., both stages 0 and 1)') - [CompletionResult]::new('--src', 'src', [CompletionResultType]::ParameterName, 'path to the root of the rust checkout') - [CompletionResult]::new('-j', 'j', [CompletionResultType]::ParameterName, 'number of jobs to run in parallel') - [CompletionResult]::new('--jobs', 'jobs', [CompletionResultType]::ParameterName, 'number of jobs to run in parallel') - [CompletionResult]::new('--warnings', 'warnings', [CompletionResultType]::ParameterName, 'if value is deny, will deny warnings if value is warn, will emit warnings otherwise, use the default configured behaviour') - [CompletionResult]::new('--error-format', 'error-format', [CompletionResultType]::ParameterName, 'rustc error format') - [CompletionResult]::new('--color', 'color', [CompletionResultType]::ParameterName, 'whether to use color in cargo and rustc output') - [CompletionResult]::new('--llvm-skip-rebuild', 'llvm-skip-rebuild', [CompletionResultType]::ParameterName, 'whether rebuilding llvm should be skipped, overriding `skip-rebuld` in config.toml') - [CompletionResult]::new('--rust-profile-generate', 'rust-profile-generate', [CompletionResultType]::ParameterName, 'generate PGO profile with rustc build') - [CompletionResult]::new('--rust-profile-use', 'rust-profile-use', [CompletionResultType]::ParameterName, 'use PGO profile for rustc build') - [CompletionResult]::new('--llvm-profile-use', 'llvm-profile-use', [CompletionResultType]::ParameterName, 'use PGO profile for LLVM build') - [CompletionResult]::new('--reproducible-artifact', 'reproducible-artifact', [CompletionResultType]::ParameterName, 'Additional reproducible artifacts that should be added to the reproducible artifacts archive') - [CompletionResult]::new('--set', 'set', [CompletionResultType]::ParameterName, 'override options in config.toml') - [CompletionResult]::new('--versioned-dirs', 'versioned-dirs', [CompletionResultType]::ParameterName, 'Always include version in subdir name') - [CompletionResult]::new('-v', 'v', [CompletionResultType]::ParameterName, 'use verbose output (-vv for very verbose)') - [CompletionResult]::new('--verbose', 'verbose', [CompletionResultType]::ParameterName, 'use verbose output (-vv for very verbose)') - [CompletionResult]::new('-i', 'i', [CompletionResultType]::ParameterName, 'use incremental compilation') - [CompletionResult]::new('--incremental', 'incremental', [CompletionResultType]::ParameterName, 'use incremental compilation') - [CompletionResult]::new('--include-default-paths', 'include-default-paths', [CompletionResultType]::ParameterName, 'include default paths in addition to the provided ones') - [CompletionResult]::new('--dry-run', 'dry-run', [CompletionResultType]::ParameterName, 'dry run; don''t build anything') - [CompletionResult]::new('--dump-bootstrap-shims', 'dump-bootstrap-shims', [CompletionResultType]::ParameterName, 'Indicates whether to dump the work done from bootstrap shims') - [CompletionResult]::new('--json-output', 'json-output', [CompletionResultType]::ParameterName, 'use message-format=json') - [CompletionResult]::new('--bypass-bootstrap-lock', 'bypass-bootstrap-lock', [CompletionResultType]::ParameterName, 'Bootstrap uses this value to decide whether it should bypass locking the build process. This is rarely needed (e.g., compiling the std library for different targets in parallel)') - [CompletionResult]::new('--llvm-profile-generate', 'llvm-profile-generate', [CompletionResultType]::ParameterName, 'generate PGO profile with llvm built for rustc') - [CompletionResult]::new('--enable-bolt-settings', 'enable-bolt-settings', [CompletionResultType]::ParameterName, 'Enable BOLT link flags') - [CompletionResult]::new('--skip-stage0-validation', 'skip-stage0-validation', [CompletionResultType]::ParameterName, 'Skip stage0 compiler validation') - [CompletionResult]::new('-h', 'h', [CompletionResultType]::ParameterName, 'Print help (see more with ''--help'')') - [CompletionResult]::new('--help', 'help', [CompletionResultType]::ParameterName, 'Print help (see more with ''--help'')') + [CompletionResult]::new('--sync', '--sync', [CompletionResultType]::ParameterName, 'Additional `Cargo.toml` to sync and vendor') + [CompletionResult]::new('--config', '--config', [CompletionResultType]::ParameterName, 'TOML configuration file for build') + [CompletionResult]::new('--build-dir', '--build-dir', [CompletionResultType]::ParameterName, 'Build directory, overrides `build.build-dir` in `config.toml`') + [CompletionResult]::new('--build', '--build', [CompletionResultType]::ParameterName, 'build target of the stage0 compiler') + [CompletionResult]::new('--host', '--host', [CompletionResultType]::ParameterName, 'host targets to build') + [CompletionResult]::new('--target', '--target', [CompletionResultType]::ParameterName, 'target targets to build') + [CompletionResult]::new('--exclude', '--exclude', [CompletionResultType]::ParameterName, 'build paths to exclude') + [CompletionResult]::new('--skip', '--skip', [CompletionResultType]::ParameterName, 'build paths to skip') + [CompletionResult]::new('--rustc-error-format', '--rustc-error-format', [CompletionResultType]::ParameterName, 'rustc-error-format') + [CompletionResult]::new('--on-fail', '--on-fail', [CompletionResultType]::ParameterName, 'command to run on failure') + [CompletionResult]::new('--stage', '--stage', [CompletionResultType]::ParameterName, 'stage to build (indicates compiler to use/test, e.g., stage 0 uses the bootstrap compiler, stage 1 the stage 0 rustc artifacts, etc.)') + [CompletionResult]::new('--keep-stage', '--keep-stage', [CompletionResultType]::ParameterName, 'stage(s) to keep without recompiling (pass multiple times to keep e.g., both stages 0 and 1)') + [CompletionResult]::new('--keep-stage-std', '--keep-stage-std', [CompletionResultType]::ParameterName, 'stage(s) of the standard library to keep without recompiling (pass multiple times to keep e.g., both stages 0 and 1)') + [CompletionResult]::new('--src', '--src', [CompletionResultType]::ParameterName, 'path to the root of the rust checkout') + [CompletionResult]::new('-j', '-j', [CompletionResultType]::ParameterName, 'number of jobs to run in parallel') + [CompletionResult]::new('--jobs', '--jobs', [CompletionResultType]::ParameterName, 'number of jobs to run in parallel') + [CompletionResult]::new('--warnings', '--warnings', [CompletionResultType]::ParameterName, 'if value is deny, will deny warnings if value is warn, will emit warnings otherwise, use the default configured behaviour') + [CompletionResult]::new('--error-format', '--error-format', [CompletionResultType]::ParameterName, 'rustc error format') + [CompletionResult]::new('--color', '--color', [CompletionResultType]::ParameterName, 'whether to use color in cargo and rustc output') + [CompletionResult]::new('--llvm-skip-rebuild', '--llvm-skip-rebuild', [CompletionResultType]::ParameterName, 'whether rebuilding llvm should be skipped, overriding `skip-rebuld` in config.toml') + [CompletionResult]::new('--rust-profile-generate', '--rust-profile-generate', [CompletionResultType]::ParameterName, 'generate PGO profile with rustc build') + [CompletionResult]::new('--rust-profile-use', '--rust-profile-use', [CompletionResultType]::ParameterName, 'use PGO profile for rustc build') + [CompletionResult]::new('--llvm-profile-use', '--llvm-profile-use', [CompletionResultType]::ParameterName, 'use PGO profile for LLVM build') + [CompletionResult]::new('--reproducible-artifact', '--reproducible-artifact', [CompletionResultType]::ParameterName, 'Additional reproducible artifacts that should be added to the reproducible artifacts archive') + [CompletionResult]::new('--set', '--set', [CompletionResultType]::ParameterName, 'override options in config.toml') + [CompletionResult]::new('--versioned-dirs', '--versioned-dirs', [CompletionResultType]::ParameterName, 'Always include version in subdir name') + [CompletionResult]::new('-v', '-v', [CompletionResultType]::ParameterName, 'use verbose output (-vv for very verbose)') + [CompletionResult]::new('--verbose', '--verbose', [CompletionResultType]::ParameterName, 'use verbose output (-vv for very verbose)') + [CompletionResult]::new('-i', '-i', [CompletionResultType]::ParameterName, 'use incremental compilation') + [CompletionResult]::new('--incremental', '--incremental', [CompletionResultType]::ParameterName, 'use incremental compilation') + [CompletionResult]::new('--include-default-paths', '--include-default-paths', [CompletionResultType]::ParameterName, 'include default paths in addition to the provided ones') + [CompletionResult]::new('--dry-run', '--dry-run', [CompletionResultType]::ParameterName, 'dry run; don''t build anything') + [CompletionResult]::new('--dump-bootstrap-shims', '--dump-bootstrap-shims', [CompletionResultType]::ParameterName, 'Indicates whether to dump the work done from bootstrap shims') + [CompletionResult]::new('--json-output', '--json-output', [CompletionResultType]::ParameterName, 'use message-format=json') + [CompletionResult]::new('--bypass-bootstrap-lock', '--bypass-bootstrap-lock', [CompletionResultType]::ParameterName, 'Bootstrap uses this value to decide whether it should bypass locking the build process. This is rarely needed (e.g., compiling the std library for different targets in parallel)') + [CompletionResult]::new('--llvm-profile-generate', '--llvm-profile-generate', [CompletionResultType]::ParameterName, 'generate PGO profile with llvm built for rustc') + [CompletionResult]::new('--enable-bolt-settings', '--enable-bolt-settings', [CompletionResultType]::ParameterName, 'Enable BOLT link flags') + [CompletionResult]::new('--skip-stage0-validation', '--skip-stage0-validation', [CompletionResultType]::ParameterName, 'Skip stage0 compiler validation') + [CompletionResult]::new('-h', '-h', [CompletionResultType]::ParameterName, 'Print help (see more with ''--help'')') + [CompletionResult]::new('--help', '--help', [CompletionResultType]::ParameterName, 'Print help (see more with ''--help'')') break } 'x.py;perf' { - [CompletionResult]::new('--config', 'config', [CompletionResultType]::ParameterName, 'TOML configuration file for build') - [CompletionResult]::new('--build-dir', 'build-dir', [CompletionResultType]::ParameterName, 'Build directory, overrides `build.build-dir` in `config.toml`') - [CompletionResult]::new('--build', 'build', [CompletionResultType]::ParameterName, 'build target of the stage0 compiler') - [CompletionResult]::new('--host', 'host', [CompletionResultType]::ParameterName, 'host targets to build') - [CompletionResult]::new('--target', 'target', [CompletionResultType]::ParameterName, 'target targets to build') - [CompletionResult]::new('--exclude', 'exclude', [CompletionResultType]::ParameterName, 'build paths to exclude') - [CompletionResult]::new('--skip', 'skip', [CompletionResultType]::ParameterName, 'build paths to skip') - [CompletionResult]::new('--rustc-error-format', 'rustc-error-format', [CompletionResultType]::ParameterName, 'rustc-error-format') - [CompletionResult]::new('--on-fail', 'on-fail', [CompletionResultType]::ParameterName, 'command to run on failure') - [CompletionResult]::new('--stage', 'stage', [CompletionResultType]::ParameterName, 'stage to build (indicates compiler to use/test, e.g., stage 0 uses the bootstrap compiler, stage 1 the stage 0 rustc artifacts, etc.)') - [CompletionResult]::new('--keep-stage', 'keep-stage', [CompletionResultType]::ParameterName, 'stage(s) to keep without recompiling (pass multiple times to keep e.g., both stages 0 and 1)') - [CompletionResult]::new('--keep-stage-std', 'keep-stage-std', [CompletionResultType]::ParameterName, 'stage(s) of the standard library to keep without recompiling (pass multiple times to keep e.g., both stages 0 and 1)') - [CompletionResult]::new('--src', 'src', [CompletionResultType]::ParameterName, 'path to the root of the rust checkout') - [CompletionResult]::new('-j', 'j', [CompletionResultType]::ParameterName, 'number of jobs to run in parallel') - [CompletionResult]::new('--jobs', 'jobs', [CompletionResultType]::ParameterName, 'number of jobs to run in parallel') - [CompletionResult]::new('--warnings', 'warnings', [CompletionResultType]::ParameterName, 'if value is deny, will deny warnings if value is warn, will emit warnings otherwise, use the default configured behaviour') - [CompletionResult]::new('--error-format', 'error-format', [CompletionResultType]::ParameterName, 'rustc error format') - [CompletionResult]::new('--color', 'color', [CompletionResultType]::ParameterName, 'whether to use color in cargo and rustc output') - [CompletionResult]::new('--llvm-skip-rebuild', 'llvm-skip-rebuild', [CompletionResultType]::ParameterName, 'whether rebuilding llvm should be skipped, overriding `skip-rebuld` in config.toml') - [CompletionResult]::new('--rust-profile-generate', 'rust-profile-generate', [CompletionResultType]::ParameterName, 'generate PGO profile with rustc build') - [CompletionResult]::new('--rust-profile-use', 'rust-profile-use', [CompletionResultType]::ParameterName, 'use PGO profile for rustc build') - [CompletionResult]::new('--llvm-profile-use', 'llvm-profile-use', [CompletionResultType]::ParameterName, 'use PGO profile for LLVM build') - [CompletionResult]::new('--reproducible-artifact', 'reproducible-artifact', [CompletionResultType]::ParameterName, 'Additional reproducible artifacts that should be added to the reproducible artifacts archive') - [CompletionResult]::new('--set', 'set', [CompletionResultType]::ParameterName, 'override options in config.toml') - [CompletionResult]::new('-v', 'v', [CompletionResultType]::ParameterName, 'use verbose output (-vv for very verbose)') - [CompletionResult]::new('--verbose', 'verbose', [CompletionResultType]::ParameterName, 'use verbose output (-vv for very verbose)') - [CompletionResult]::new('-i', 'i', [CompletionResultType]::ParameterName, 'use incremental compilation') - [CompletionResult]::new('--incremental', 'incremental', [CompletionResultType]::ParameterName, 'use incremental compilation') - [CompletionResult]::new('--include-default-paths', 'include-default-paths', [CompletionResultType]::ParameterName, 'include default paths in addition to the provided ones') - [CompletionResult]::new('--dry-run', 'dry-run', [CompletionResultType]::ParameterName, 'dry run; don''t build anything') - [CompletionResult]::new('--dump-bootstrap-shims', 'dump-bootstrap-shims', [CompletionResultType]::ParameterName, 'Indicates whether to dump the work done from bootstrap shims') - [CompletionResult]::new('--json-output', 'json-output', [CompletionResultType]::ParameterName, 'use message-format=json') - [CompletionResult]::new('--bypass-bootstrap-lock', 'bypass-bootstrap-lock', [CompletionResultType]::ParameterName, 'Bootstrap uses this value to decide whether it should bypass locking the build process. This is rarely needed (e.g., compiling the std library for different targets in parallel)') - [CompletionResult]::new('--llvm-profile-generate', 'llvm-profile-generate', [CompletionResultType]::ParameterName, 'generate PGO profile with llvm built for rustc') - [CompletionResult]::new('--enable-bolt-settings', 'enable-bolt-settings', [CompletionResultType]::ParameterName, 'Enable BOLT link flags') - [CompletionResult]::new('--skip-stage0-validation', 'skip-stage0-validation', [CompletionResultType]::ParameterName, 'Skip stage0 compiler validation') - [CompletionResult]::new('-h', 'h', [CompletionResultType]::ParameterName, 'Print help (see more with ''--help'')') - [CompletionResult]::new('--help', 'help', [CompletionResultType]::ParameterName, 'Print help (see more with ''--help'')') + [CompletionResult]::new('--config', '--config', [CompletionResultType]::ParameterName, 'TOML configuration file for build') + [CompletionResult]::new('--build-dir', '--build-dir', [CompletionResultType]::ParameterName, 'Build directory, overrides `build.build-dir` in `config.toml`') + [CompletionResult]::new('--build', '--build', [CompletionResultType]::ParameterName, 'build target of the stage0 compiler') + [CompletionResult]::new('--host', '--host', [CompletionResultType]::ParameterName, 'host targets to build') + [CompletionResult]::new('--target', '--target', [CompletionResultType]::ParameterName, 'target targets to build') + [CompletionResult]::new('--exclude', '--exclude', [CompletionResultType]::ParameterName, 'build paths to exclude') + [CompletionResult]::new('--skip', '--skip', [CompletionResultType]::ParameterName, 'build paths to skip') + [CompletionResult]::new('--rustc-error-format', '--rustc-error-format', [CompletionResultType]::ParameterName, 'rustc-error-format') + [CompletionResult]::new('--on-fail', '--on-fail', [CompletionResultType]::ParameterName, 'command to run on failure') + [CompletionResult]::new('--stage', '--stage', [CompletionResultType]::ParameterName, 'stage to build (indicates compiler to use/test, e.g., stage 0 uses the bootstrap compiler, stage 1 the stage 0 rustc artifacts, etc.)') + [CompletionResult]::new('--keep-stage', '--keep-stage', [CompletionResultType]::ParameterName, 'stage(s) to keep without recompiling (pass multiple times to keep e.g., both stages 0 and 1)') + [CompletionResult]::new('--keep-stage-std', '--keep-stage-std', [CompletionResultType]::ParameterName, 'stage(s) of the standard library to keep without recompiling (pass multiple times to keep e.g., both stages 0 and 1)') + [CompletionResult]::new('--src', '--src', [CompletionResultType]::ParameterName, 'path to the root of the rust checkout') + [CompletionResult]::new('-j', '-j', [CompletionResultType]::ParameterName, 'number of jobs to run in parallel') + [CompletionResult]::new('--jobs', '--jobs', [CompletionResultType]::ParameterName, 'number of jobs to run in parallel') + [CompletionResult]::new('--warnings', '--warnings', [CompletionResultType]::ParameterName, 'if value is deny, will deny warnings if value is warn, will emit warnings otherwise, use the default configured behaviour') + [CompletionResult]::new('--error-format', '--error-format', [CompletionResultType]::ParameterName, 'rustc error format') + [CompletionResult]::new('--color', '--color', [CompletionResultType]::ParameterName, 'whether to use color in cargo and rustc output') + [CompletionResult]::new('--llvm-skip-rebuild', '--llvm-skip-rebuild', [CompletionResultType]::ParameterName, 'whether rebuilding llvm should be skipped, overriding `skip-rebuld` in config.toml') + [CompletionResult]::new('--rust-profile-generate', '--rust-profile-generate', [CompletionResultType]::ParameterName, 'generate PGO profile with rustc build') + [CompletionResult]::new('--rust-profile-use', '--rust-profile-use', [CompletionResultType]::ParameterName, 'use PGO profile for rustc build') + [CompletionResult]::new('--llvm-profile-use', '--llvm-profile-use', [CompletionResultType]::ParameterName, 'use PGO profile for LLVM build') + [CompletionResult]::new('--reproducible-artifact', '--reproducible-artifact', [CompletionResultType]::ParameterName, 'Additional reproducible artifacts that should be added to the reproducible artifacts archive') + [CompletionResult]::new('--set', '--set', [CompletionResultType]::ParameterName, 'override options in config.toml') + [CompletionResult]::new('-v', '-v', [CompletionResultType]::ParameterName, 'use verbose output (-vv for very verbose)') + [CompletionResult]::new('--verbose', '--verbose', [CompletionResultType]::ParameterName, 'use verbose output (-vv for very verbose)') + [CompletionResult]::new('-i', '-i', [CompletionResultType]::ParameterName, 'use incremental compilation') + [CompletionResult]::new('--incremental', '--incremental', [CompletionResultType]::ParameterName, 'use incremental compilation') + [CompletionResult]::new('--include-default-paths', '--include-default-paths', [CompletionResultType]::ParameterName, 'include default paths in addition to the provided ones') + [CompletionResult]::new('--dry-run', '--dry-run', [CompletionResultType]::ParameterName, 'dry run; don''t build anything') + [CompletionResult]::new('--dump-bootstrap-shims', '--dump-bootstrap-shims', [CompletionResultType]::ParameterName, 'Indicates whether to dump the work done from bootstrap shims') + [CompletionResult]::new('--json-output', '--json-output', [CompletionResultType]::ParameterName, 'use message-format=json') + [CompletionResult]::new('--bypass-bootstrap-lock', '--bypass-bootstrap-lock', [CompletionResultType]::ParameterName, 'Bootstrap uses this value to decide whether it should bypass locking the build process. This is rarely needed (e.g., compiling the std library for different targets in parallel)') + [CompletionResult]::new('--llvm-profile-generate', '--llvm-profile-generate', [CompletionResultType]::ParameterName, 'generate PGO profile with llvm built for rustc') + [CompletionResult]::new('--enable-bolt-settings', '--enable-bolt-settings', [CompletionResultType]::ParameterName, 'Enable BOLT link flags') + [CompletionResult]::new('--skip-stage0-validation', '--skip-stage0-validation', [CompletionResultType]::ParameterName, 'Skip stage0 compiler validation') + [CompletionResult]::new('-h', '-h', [CompletionResultType]::ParameterName, 'Print help (see more with ''--help'')') + [CompletionResult]::new('--help', '--help', [CompletionResultType]::ParameterName, 'Print help (see more with ''--help'')') break } }) diff --git a/src/etc/completions/x.py.sh b/src/etc/completions/x.py.sh index 60ba8d3ba70..b1730e5c6d8 100644 --- a/src/etc/completions/x.py.sh +++ b/src/etc/completions/x.py.sh @@ -12,56 +12,56 @@ _x.py() { ",$1") cmd="x.py" ;; - bootstrap,bench) - cmd="bootstrap__bench" + x.py,bench) + cmd="x.py__bench" ;; - bootstrap,build) - cmd="bootstrap__build" + x.py,build) + cmd="x.py__build" ;; - bootstrap,check) - cmd="bootstrap__check" + x.py,check) + cmd="x.py__check" ;; - bootstrap,clean) - cmd="bootstrap__clean" + x.py,clean) + cmd="x.py__clean" ;; - bootstrap,clippy) - cmd="bootstrap__clippy" + x.py,clippy) + cmd="x.py__clippy" ;; - bootstrap,dist) - cmd="bootstrap__dist" + x.py,dist) + cmd="x.py__dist" ;; - bootstrap,doc) - cmd="bootstrap__doc" + x.py,doc) + cmd="x.py__doc" ;; - bootstrap,fix) - cmd="bootstrap__fix" + x.py,fix) + cmd="x.py__fix" ;; - bootstrap,fmt) - cmd="bootstrap__fmt" + x.py,fmt) + cmd="x.py__fmt" ;; - bootstrap,install) - cmd="bootstrap__install" + x.py,install) + cmd="x.py__install" ;; - bootstrap,miri) - cmd="bootstrap__miri" + x.py,miri) + cmd="x.py__miri" ;; - bootstrap,perf) - cmd="bootstrap__perf" + x.py,perf) + cmd="x.py__perf" ;; - bootstrap,run) - cmd="bootstrap__run" + x.py,run) + cmd="x.py__run" ;; - bootstrap,setup) - cmd="bootstrap__setup" + x.py,setup) + cmd="x.py__setup" ;; - bootstrap,suggest) - cmd="bootstrap__suggest" + x.py,suggest) + cmd="x.py__suggest" ;; - bootstrap,test) - cmd="bootstrap__test" + x.py,test) + cmd="x.py__test" ;; - bootstrap,vendor) - cmd="bootstrap__vendor" + x.py,vendor) + cmd="x.py__vendor" ;; *) ;; @@ -77,23 +77,46 @@ _x.py() { fi case "${prev}" in --config) + local oldifs + if [ -n "${IFS+x}" ]; then + oldifs="$IFS" + fi + IFS=$'\n' COMPREPLY=($(compgen -f "${cur}")) + if [ -n "${oldifs+x}" ]; then + IFS="$oldifs" + fi + if [[ "${BASH_VERSINFO[0]}" -ge 4 ]]; then + compopt -o filenames + fi return 0 ;; --build-dir) - COMPREPLY=($(compgen -f "${cur}")) + COMPREPLY=() + if [[ "${BASH_VERSINFO[0]}" -ge 4 ]]; then + compopt -o plusdirs + fi return 0 ;; --build) COMPREPLY=("${cur}") + if [[ "${BASH_VERSINFO[0]}" -ge 4 ]]; then + compopt -o nospace + fi return 0 ;; --host) COMPREPLY=("${cur}") + if [[ "${BASH_VERSINFO[0]}" -ge 4 ]]; then + compopt -o nospace + fi return 0 ;; --target) COMPREPLY=("${cur}") + if [[ "${BASH_VERSINFO[0]}" -ge 4 ]]; then + compopt -o nospace + fi return 0 ;; --exclude) @@ -106,6 +129,9 @@ _x.py() { ;; --rustc-error-format) COMPREPLY=("${cur}") + if [[ "${BASH_VERSINFO[0]}" -ge 4 ]]; then + compopt -o nospace + fi return 0 ;; --on-fail) @@ -114,26 +140,44 @@ _x.py() { ;; --stage) COMPREPLY=("${cur}") + if [[ "${BASH_VERSINFO[0]}" -ge 4 ]]; then + compopt -o nospace + fi return 0 ;; --keep-stage) COMPREPLY=("${cur}") + if [[ "${BASH_VERSINFO[0]}" -ge 4 ]]; then + compopt -o nospace + fi return 0 ;; --keep-stage-std) COMPREPLY=("${cur}") + if [[ "${BASH_VERSINFO[0]}" -ge 4 ]]; then + compopt -o nospace + fi return 0 ;; --src) - COMPREPLY=($(compgen -f "${cur}")) + COMPREPLY=() + if [[ "${BASH_VERSINFO[0]}" -ge 4 ]]; then + compopt -o plusdirs + fi return 0 ;; --jobs) COMPREPLY=("${cur}") + if [[ "${BASH_VERSINFO[0]}" -ge 4 ]]; then + compopt -o nospace + fi return 0 ;; -j) COMPREPLY=("${cur}") + if [[ "${BASH_VERSINFO[0]}" -ge 4 ]]; then + compopt -o nospace + fi return 0 ;; --warnings) @@ -142,6 +186,9 @@ _x.py() { ;; --error-format) COMPREPLY=("${cur}") + if [[ "${BASH_VERSINFO[0]}" -ge 4 ]]; then + compopt -o nospace + fi return 0 ;; --color) @@ -153,15 +200,48 @@ _x.py() { return 0 ;; --rust-profile-generate) + local oldifs + if [ -n "${IFS+x}" ]; then + oldifs="$IFS" + fi + IFS=$'\n' COMPREPLY=($(compgen -f "${cur}")) + if [ -n "${oldifs+x}" ]; then + IFS="$oldifs" + fi + if [[ "${BASH_VERSINFO[0]}" -ge 4 ]]; then + compopt -o filenames + fi return 0 ;; --rust-profile-use) + local oldifs + if [ -n "${IFS+x}" ]; then + oldifs="$IFS" + fi + IFS=$'\n' COMPREPLY=($(compgen -f "${cur}")) + if [ -n "${oldifs+x}" ]; then + IFS="$oldifs" + fi + if [[ "${BASH_VERSINFO[0]}" -ge 4 ]]; then + compopt -o filenames + fi return 0 ;; --llvm-profile-use) + local oldifs + if [ -n "${IFS+x}" ]; then + oldifs="$IFS" + fi + IFS=$'\n' COMPREPLY=($(compgen -f "${cur}")) + if [ -n "${oldifs+x}" ]; then + IFS="$oldifs" + fi + if [[ "${BASH_VERSINFO[0]}" -ge 4 ]]; then + compopt -o filenames + fi return 0 ;; --reproducible-artifact) @@ -170,6 +250,9 @@ _x.py() { ;; --set) COMPREPLY=("${cur}") + if [[ "${BASH_VERSINFO[0]}" -ge 4 ]]; then + compopt -o nospace + fi return 0 ;; *) @@ -191,23 +274,46 @@ _x.py() { return 0 ;; --config) + local oldifs + if [ -n "${IFS+x}" ]; then + oldifs="$IFS" + fi + IFS=$'\n' COMPREPLY=($(compgen -f "${cur}")) + if [ -n "${oldifs+x}" ]; then + IFS="$oldifs" + fi + if [[ "${BASH_VERSINFO[0]}" -ge 4 ]]; then + compopt -o filenames + fi return 0 ;; --build-dir) - COMPREPLY=($(compgen -f "${cur}")) + COMPREPLY=() + if [[ "${BASH_VERSINFO[0]}" -ge 4 ]]; then + compopt -o plusdirs + fi return 0 ;; --build) COMPREPLY=("${cur}") + if [[ "${BASH_VERSINFO[0]}" -ge 4 ]]; then + compopt -o nospace + fi return 0 ;; --host) COMPREPLY=("${cur}") + if [[ "${BASH_VERSINFO[0]}" -ge 4 ]]; then + compopt -o nospace + fi return 0 ;; --target) COMPREPLY=("${cur}") + if [[ "${BASH_VERSINFO[0]}" -ge 4 ]]; then + compopt -o nospace + fi return 0 ;; --exclude) @@ -220,6 +326,9 @@ _x.py() { ;; --rustc-error-format) COMPREPLY=("${cur}") + if [[ "${BASH_VERSINFO[0]}" -ge 4 ]]; then + compopt -o nospace + fi return 0 ;; --on-fail) @@ -228,26 +337,44 @@ _x.py() { ;; --stage) COMPREPLY=("${cur}") + if [[ "${BASH_VERSINFO[0]}" -ge 4 ]]; then + compopt -o nospace + fi return 0 ;; --keep-stage) COMPREPLY=("${cur}") + if [[ "${BASH_VERSINFO[0]}" -ge 4 ]]; then + compopt -o nospace + fi return 0 ;; --keep-stage-std) COMPREPLY=("${cur}") + if [[ "${BASH_VERSINFO[0]}" -ge 4 ]]; then + compopt -o nospace + fi return 0 ;; --src) - COMPREPLY=($(compgen -f "${cur}")) + COMPREPLY=() + if [[ "${BASH_VERSINFO[0]}" -ge 4 ]]; then + compopt -o plusdirs + fi return 0 ;; --jobs) COMPREPLY=("${cur}") + if [[ "${BASH_VERSINFO[0]}" -ge 4 ]]; then + compopt -o nospace + fi return 0 ;; -j) COMPREPLY=("${cur}") + if [[ "${BASH_VERSINFO[0]}" -ge 4 ]]; then + compopt -o nospace + fi return 0 ;; --warnings) @@ -256,6 +383,9 @@ _x.py() { ;; --error-format) COMPREPLY=("${cur}") + if [[ "${BASH_VERSINFO[0]}" -ge 4 ]]; then + compopt -o nospace + fi return 0 ;; --color) @@ -267,15 +397,48 @@ _x.py() { return 0 ;; --rust-profile-generate) + local oldifs + if [ -n "${IFS+x}" ]; then + oldifs="$IFS" + fi + IFS=$'\n' COMPREPLY=($(compgen -f "${cur}")) + if [ -n "${oldifs+x}" ]; then + IFS="$oldifs" + fi + if [[ "${BASH_VERSINFO[0]}" -ge 4 ]]; then + compopt -o filenames + fi return 0 ;; --rust-profile-use) + local oldifs + if [ -n "${IFS+x}" ]; then + oldifs="$IFS" + fi + IFS=$'\n' COMPREPLY=($(compgen -f "${cur}")) + if [ -n "${oldifs+x}" ]; then + IFS="$oldifs" + fi + if [[ "${BASH_VERSINFO[0]}" -ge 4 ]]; then + compopt -o filenames + fi return 0 ;; --llvm-profile-use) + local oldifs + if [ -n "${IFS+x}" ]; then + oldifs="$IFS" + fi + IFS=$'\n' COMPREPLY=($(compgen -f "${cur}")) + if [ -n "${oldifs+x}" ]; then + IFS="$oldifs" + fi + if [[ "${BASH_VERSINFO[0]}" -ge 4 ]]; then + compopt -o filenames + fi return 0 ;; --reproducible-artifact) @@ -284,6 +447,9 @@ _x.py() { ;; --set) COMPREPLY=("${cur}") + if [[ "${BASH_VERSINFO[0]}" -ge 4 ]]; then + compopt -o nospace + fi return 0 ;; *) @@ -301,23 +467,46 @@ _x.py() { fi case "${prev}" in --config) + local oldifs + if [ -n "${IFS+x}" ]; then + oldifs="$IFS" + fi + IFS=$'\n' COMPREPLY=($(compgen -f "${cur}")) + if [ -n "${oldifs+x}" ]; then + IFS="$oldifs" + fi + if [[ "${BASH_VERSINFO[0]}" -ge 4 ]]; then + compopt -o filenames + fi return 0 ;; --build-dir) - COMPREPLY=($(compgen -f "${cur}")) + COMPREPLY=() + if [[ "${BASH_VERSINFO[0]}" -ge 4 ]]; then + compopt -o plusdirs + fi return 0 ;; --build) COMPREPLY=("${cur}") + if [[ "${BASH_VERSINFO[0]}" -ge 4 ]]; then + compopt -o nospace + fi return 0 ;; --host) COMPREPLY=("${cur}") + if [[ "${BASH_VERSINFO[0]}" -ge 4 ]]; then + compopt -o nospace + fi return 0 ;; --target) COMPREPLY=("${cur}") + if [[ "${BASH_VERSINFO[0]}" -ge 4 ]]; then + compopt -o nospace + fi return 0 ;; --exclude) @@ -330,6 +519,9 @@ _x.py() { ;; --rustc-error-format) COMPREPLY=("${cur}") + if [[ "${BASH_VERSINFO[0]}" -ge 4 ]]; then + compopt -o nospace + fi return 0 ;; --on-fail) @@ -338,26 +530,44 @@ _x.py() { ;; --stage) COMPREPLY=("${cur}") + if [[ "${BASH_VERSINFO[0]}" -ge 4 ]]; then + compopt -o nospace + fi return 0 ;; --keep-stage) COMPREPLY=("${cur}") + if [[ "${BASH_VERSINFO[0]}" -ge 4 ]]; then + compopt -o nospace + fi return 0 ;; --keep-stage-std) COMPREPLY=("${cur}") + if [[ "${BASH_VERSINFO[0]}" -ge 4 ]]; then + compopt -o nospace + fi return 0 ;; --src) - COMPREPLY=($(compgen -f "${cur}")) + COMPREPLY=() + if [[ "${BASH_VERSINFO[0]}" -ge 4 ]]; then + compopt -o plusdirs + fi return 0 ;; --jobs) COMPREPLY=("${cur}") + if [[ "${BASH_VERSINFO[0]}" -ge 4 ]]; then + compopt -o nospace + fi return 0 ;; -j) COMPREPLY=("${cur}") + if [[ "${BASH_VERSINFO[0]}" -ge 4 ]]; then + compopt -o nospace + fi return 0 ;; --warnings) @@ -366,6 +576,9 @@ _x.py() { ;; --error-format) COMPREPLY=("${cur}") + if [[ "${BASH_VERSINFO[0]}" -ge 4 ]]; then + compopt -o nospace + fi return 0 ;; --color) @@ -377,15 +590,48 @@ _x.py() { return 0 ;; --rust-profile-generate) + local oldifs + if [ -n "${IFS+x}" ]; then + oldifs="$IFS" + fi + IFS=$'\n' COMPREPLY=($(compgen -f "${cur}")) + if [ -n "${oldifs+x}" ]; then + IFS="$oldifs" + fi + if [[ "${BASH_VERSINFO[0]}" -ge 4 ]]; then + compopt -o filenames + fi return 0 ;; --rust-profile-use) + local oldifs + if [ -n "${IFS+x}" ]; then + oldifs="$IFS" + fi + IFS=$'\n' COMPREPLY=($(compgen -f "${cur}")) + if [ -n "${oldifs+x}" ]; then + IFS="$oldifs" + fi + if [[ "${BASH_VERSINFO[0]}" -ge 4 ]]; then + compopt -o filenames + fi return 0 ;; --llvm-profile-use) + local oldifs + if [ -n "${IFS+x}" ]; then + oldifs="$IFS" + fi + IFS=$'\n' COMPREPLY=($(compgen -f "${cur}")) + if [ -n "${oldifs+x}" ]; then + IFS="$oldifs" + fi + if [[ "${BASH_VERSINFO[0]}" -ge 4 ]]; then + compopt -o filenames + fi return 0 ;; --reproducible-artifact) @@ -394,6 +640,9 @@ _x.py() { ;; --set) COMPREPLY=("${cur}") + if [[ "${BASH_VERSINFO[0]}" -ge 4 ]]; then + compopt -o nospace + fi return 0 ;; *) @@ -411,23 +660,46 @@ _x.py() { fi case "${prev}" in --config) + local oldifs + if [ -n "${IFS+x}" ]; then + oldifs="$IFS" + fi + IFS=$'\n' COMPREPLY=($(compgen -f "${cur}")) + if [ -n "${oldifs+x}" ]; then + IFS="$oldifs" + fi + if [[ "${BASH_VERSINFO[0]}" -ge 4 ]]; then + compopt -o filenames + fi return 0 ;; --build-dir) - COMPREPLY=($(compgen -f "${cur}")) + COMPREPLY=() + if [[ "${BASH_VERSINFO[0]}" -ge 4 ]]; then + compopt -o plusdirs + fi return 0 ;; --build) COMPREPLY=("${cur}") + if [[ "${BASH_VERSINFO[0]}" -ge 4 ]]; then + compopt -o nospace + fi return 0 ;; --host) COMPREPLY=("${cur}") + if [[ "${BASH_VERSINFO[0]}" -ge 4 ]]; then + compopt -o nospace + fi return 0 ;; --target) COMPREPLY=("${cur}") + if [[ "${BASH_VERSINFO[0]}" -ge 4 ]]; then + compopt -o nospace + fi return 0 ;; --exclude) @@ -440,6 +712,9 @@ _x.py() { ;; --rustc-error-format) COMPREPLY=("${cur}") + if [[ "${BASH_VERSINFO[0]}" -ge 4 ]]; then + compopt -o nospace + fi return 0 ;; --on-fail) @@ -448,26 +723,44 @@ _x.py() { ;; --stage) COMPREPLY=("${cur}") + if [[ "${BASH_VERSINFO[0]}" -ge 4 ]]; then + compopt -o nospace + fi return 0 ;; --keep-stage) COMPREPLY=("${cur}") + if [[ "${BASH_VERSINFO[0]}" -ge 4 ]]; then + compopt -o nospace + fi return 0 ;; --keep-stage-std) COMPREPLY=("${cur}") + if [[ "${BASH_VERSINFO[0]}" -ge 4 ]]; then + compopt -o nospace + fi return 0 ;; --src) - COMPREPLY=($(compgen -f "${cur}")) + COMPREPLY=() + if [[ "${BASH_VERSINFO[0]}" -ge 4 ]]; then + compopt -o plusdirs + fi return 0 ;; --jobs) COMPREPLY=("${cur}") + if [[ "${BASH_VERSINFO[0]}" -ge 4 ]]; then + compopt -o nospace + fi return 0 ;; -j) COMPREPLY=("${cur}") + if [[ "${BASH_VERSINFO[0]}" -ge 4 ]]; then + compopt -o nospace + fi return 0 ;; --warnings) @@ -476,6 +769,9 @@ _x.py() { ;; --error-format) COMPREPLY=("${cur}") + if [[ "${BASH_VERSINFO[0]}" -ge 4 ]]; then + compopt -o nospace + fi return 0 ;; --color) @@ -487,15 +783,48 @@ _x.py() { return 0 ;; --rust-profile-generate) + local oldifs + if [ -n "${IFS+x}" ]; then + oldifs="$IFS" + fi + IFS=$'\n' COMPREPLY=($(compgen -f "${cur}")) + if [ -n "${oldifs+x}" ]; then + IFS="$oldifs" + fi + if [[ "${BASH_VERSINFO[0]}" -ge 4 ]]; then + compopt -o filenames + fi return 0 ;; --rust-profile-use) + local oldifs + if [ -n "${IFS+x}" ]; then + oldifs="$IFS" + fi + IFS=$'\n' COMPREPLY=($(compgen -f "${cur}")) + if [ -n "${oldifs+x}" ]; then + IFS="$oldifs" + fi + if [[ "${BASH_VERSINFO[0]}" -ge 4 ]]; then + compopt -o filenames + fi return 0 ;; --llvm-profile-use) + local oldifs + if [ -n "${IFS+x}" ]; then + oldifs="$IFS" + fi + IFS=$'\n' COMPREPLY=($(compgen -f "${cur}")) + if [ -n "${oldifs+x}" ]; then + IFS="$oldifs" + fi + if [[ "${BASH_VERSINFO[0]}" -ge 4 ]]; then + compopt -o filenames + fi return 0 ;; --reproducible-artifact) @@ -504,6 +833,9 @@ _x.py() { ;; --set) COMPREPLY=("${cur}") + if [[ "${BASH_VERSINFO[0]}" -ge 4 ]]; then + compopt -o nospace + fi return 0 ;; *) @@ -525,23 +857,46 @@ _x.py() { return 0 ;; --config) + local oldifs + if [ -n "${IFS+x}" ]; then + oldifs="$IFS" + fi + IFS=$'\n' COMPREPLY=($(compgen -f "${cur}")) + if [ -n "${oldifs+x}" ]; then + IFS="$oldifs" + fi + if [[ "${BASH_VERSINFO[0]}" -ge 4 ]]; then + compopt -o filenames + fi return 0 ;; --build-dir) - COMPREPLY=($(compgen -f "${cur}")) + COMPREPLY=() + if [[ "${BASH_VERSINFO[0]}" -ge 4 ]]; then + compopt -o plusdirs + fi return 0 ;; --build) COMPREPLY=("${cur}") + if [[ "${BASH_VERSINFO[0]}" -ge 4 ]]; then + compopt -o nospace + fi return 0 ;; --host) COMPREPLY=("${cur}") + if [[ "${BASH_VERSINFO[0]}" -ge 4 ]]; then + compopt -o nospace + fi return 0 ;; --target) COMPREPLY=("${cur}") + if [[ "${BASH_VERSINFO[0]}" -ge 4 ]]; then + compopt -o nospace + fi return 0 ;; --exclude) @@ -554,6 +909,9 @@ _x.py() { ;; --rustc-error-format) COMPREPLY=("${cur}") + if [[ "${BASH_VERSINFO[0]}" -ge 4 ]]; then + compopt -o nospace + fi return 0 ;; --on-fail) @@ -562,22 +920,37 @@ _x.py() { ;; --keep-stage) COMPREPLY=("${cur}") + if [[ "${BASH_VERSINFO[0]}" -ge 4 ]]; then + compopt -o nospace + fi return 0 ;; --keep-stage-std) COMPREPLY=("${cur}") + if [[ "${BASH_VERSINFO[0]}" -ge 4 ]]; then + compopt -o nospace + fi return 0 ;; --src) - COMPREPLY=($(compgen -f "${cur}")) + COMPREPLY=() + if [[ "${BASH_VERSINFO[0]}" -ge 4 ]]; then + compopt -o plusdirs + fi return 0 ;; --jobs) COMPREPLY=("${cur}") + if [[ "${BASH_VERSINFO[0]}" -ge 4 ]]; then + compopt -o nospace + fi return 0 ;; -j) COMPREPLY=("${cur}") + if [[ "${BASH_VERSINFO[0]}" -ge 4 ]]; then + compopt -o nospace + fi return 0 ;; --warnings) @@ -586,6 +959,9 @@ _x.py() { ;; --error-format) COMPREPLY=("${cur}") + if [[ "${BASH_VERSINFO[0]}" -ge 4 ]]; then + compopt -o nospace + fi return 0 ;; --color) @@ -597,15 +973,48 @@ _x.py() { return 0 ;; --rust-profile-generate) + local oldifs + if [ -n "${IFS+x}" ]; then + oldifs="$IFS" + fi + IFS=$'\n' COMPREPLY=($(compgen -f "${cur}")) + if [ -n "${oldifs+x}" ]; then + IFS="$oldifs" + fi + if [[ "${BASH_VERSINFO[0]}" -ge 4 ]]; then + compopt -o filenames + fi return 0 ;; --rust-profile-use) + local oldifs + if [ -n "${IFS+x}" ]; then + oldifs="$IFS" + fi + IFS=$'\n' COMPREPLY=($(compgen -f "${cur}")) + if [ -n "${oldifs+x}" ]; then + IFS="$oldifs" + fi + if [[ "${BASH_VERSINFO[0]}" -ge 4 ]]; then + compopt -o filenames + fi return 0 ;; --llvm-profile-use) + local oldifs + if [ -n "${IFS+x}" ]; then + oldifs="$IFS" + fi + IFS=$'\n' COMPREPLY=($(compgen -f "${cur}")) + if [ -n "${oldifs+x}" ]; then + IFS="$oldifs" + fi + if [[ "${BASH_VERSINFO[0]}" -ge 4 ]]; then + compopt -o filenames + fi return 0 ;; --reproducible-artifact) @@ -614,6 +1023,9 @@ _x.py() { ;; --set) COMPREPLY=("${cur}") + if [[ "${BASH_VERSINFO[0]}" -ge 4 ]]; then + compopt -o nospace + fi return 0 ;; *) @@ -647,23 +1059,46 @@ _x.py() { return 0 ;; --config) + local oldifs + if [ -n "${IFS+x}" ]; then + oldifs="$IFS" + fi + IFS=$'\n' COMPREPLY=($(compgen -f "${cur}")) + if [ -n "${oldifs+x}" ]; then + IFS="$oldifs" + fi + if [[ "${BASH_VERSINFO[0]}" -ge 4 ]]; then + compopt -o filenames + fi return 0 ;; --build-dir) - COMPREPLY=($(compgen -f "${cur}")) + COMPREPLY=() + if [[ "${BASH_VERSINFO[0]}" -ge 4 ]]; then + compopt -o plusdirs + fi return 0 ;; --build) COMPREPLY=("${cur}") + if [[ "${BASH_VERSINFO[0]}" -ge 4 ]]; then + compopt -o nospace + fi return 0 ;; --host) COMPREPLY=("${cur}") + if [[ "${BASH_VERSINFO[0]}" -ge 4 ]]; then + compopt -o nospace + fi return 0 ;; --target) COMPREPLY=("${cur}") + if [[ "${BASH_VERSINFO[0]}" -ge 4 ]]; then + compopt -o nospace + fi return 0 ;; --exclude) @@ -676,6 +1111,9 @@ _x.py() { ;; --rustc-error-format) COMPREPLY=("${cur}") + if [[ "${BASH_VERSINFO[0]}" -ge 4 ]]; then + compopt -o nospace + fi return 0 ;; --on-fail) @@ -684,26 +1122,44 @@ _x.py() { ;; --stage) COMPREPLY=("${cur}") + if [[ "${BASH_VERSINFO[0]}" -ge 4 ]]; then + compopt -o nospace + fi return 0 ;; --keep-stage) COMPREPLY=("${cur}") + if [[ "${BASH_VERSINFO[0]}" -ge 4 ]]; then + compopt -o nospace + fi return 0 ;; --keep-stage-std) COMPREPLY=("${cur}") + if [[ "${BASH_VERSINFO[0]}" -ge 4 ]]; then + compopt -o nospace + fi return 0 ;; --src) - COMPREPLY=($(compgen -f "${cur}")) + COMPREPLY=() + if [[ "${BASH_VERSINFO[0]}" -ge 4 ]]; then + compopt -o plusdirs + fi return 0 ;; --jobs) COMPREPLY=("${cur}") + if [[ "${BASH_VERSINFO[0]}" -ge 4 ]]; then + compopt -o nospace + fi return 0 ;; -j) COMPREPLY=("${cur}") + if [[ "${BASH_VERSINFO[0]}" -ge 4 ]]; then + compopt -o nospace + fi return 0 ;; --warnings) @@ -712,6 +1168,9 @@ _x.py() { ;; --error-format) COMPREPLY=("${cur}") + if [[ "${BASH_VERSINFO[0]}" -ge 4 ]]; then + compopt -o nospace + fi return 0 ;; --color) @@ -723,15 +1182,48 @@ _x.py() { return 0 ;; --rust-profile-generate) + local oldifs + if [ -n "${IFS+x}" ]; then + oldifs="$IFS" + fi + IFS=$'\n' COMPREPLY=($(compgen -f "${cur}")) + if [ -n "${oldifs+x}" ]; then + IFS="$oldifs" + fi + if [[ "${BASH_VERSINFO[0]}" -ge 4 ]]; then + compopt -o filenames + fi return 0 ;; --rust-profile-use) + local oldifs + if [ -n "${IFS+x}" ]; then + oldifs="$IFS" + fi + IFS=$'\n' COMPREPLY=($(compgen -f "${cur}")) + if [ -n "${oldifs+x}" ]; then + IFS="$oldifs" + fi + if [[ "${BASH_VERSINFO[0]}" -ge 4 ]]; then + compopt -o filenames + fi return 0 ;; --llvm-profile-use) + local oldifs + if [ -n "${IFS+x}" ]; then + oldifs="$IFS" + fi + IFS=$'\n' COMPREPLY=($(compgen -f "${cur}")) + if [ -n "${oldifs+x}" ]; then + IFS="$oldifs" + fi + if [[ "${BASH_VERSINFO[0]}" -ge 4 ]]; then + compopt -o filenames + fi return 0 ;; --reproducible-artifact) @@ -740,6 +1232,9 @@ _x.py() { ;; --set) COMPREPLY=("${cur}") + if [[ "${BASH_VERSINFO[0]}" -ge 4 ]]; then + compopt -o nospace + fi return 0 ;; *) @@ -757,23 +1252,46 @@ _x.py() { fi case "${prev}" in --config) + local oldifs + if [ -n "${IFS+x}" ]; then + oldifs="$IFS" + fi + IFS=$'\n' COMPREPLY=($(compgen -f "${cur}")) + if [ -n "${oldifs+x}" ]; then + IFS="$oldifs" + fi + if [[ "${BASH_VERSINFO[0]}" -ge 4 ]]; then + compopt -o filenames + fi return 0 ;; --build-dir) - COMPREPLY=($(compgen -f "${cur}")) + COMPREPLY=() + if [[ "${BASH_VERSINFO[0]}" -ge 4 ]]; then + compopt -o plusdirs + fi return 0 ;; --build) COMPREPLY=("${cur}") + if [[ "${BASH_VERSINFO[0]}" -ge 4 ]]; then + compopt -o nospace + fi return 0 ;; --host) COMPREPLY=("${cur}") + if [[ "${BASH_VERSINFO[0]}" -ge 4 ]]; then + compopt -o nospace + fi return 0 ;; --target) COMPREPLY=("${cur}") + if [[ "${BASH_VERSINFO[0]}" -ge 4 ]]; then + compopt -o nospace + fi return 0 ;; --exclude) @@ -786,6 +1304,9 @@ _x.py() { ;; --rustc-error-format) COMPREPLY=("${cur}") + if [[ "${BASH_VERSINFO[0]}" -ge 4 ]]; then + compopt -o nospace + fi return 0 ;; --on-fail) @@ -794,26 +1315,44 @@ _x.py() { ;; --stage) COMPREPLY=("${cur}") + if [[ "${BASH_VERSINFO[0]}" -ge 4 ]]; then + compopt -o nospace + fi return 0 ;; --keep-stage) COMPREPLY=("${cur}") + if [[ "${BASH_VERSINFO[0]}" -ge 4 ]]; then + compopt -o nospace + fi return 0 ;; --keep-stage-std) COMPREPLY=("${cur}") + if [[ "${BASH_VERSINFO[0]}" -ge 4 ]]; then + compopt -o nospace + fi return 0 ;; --src) - COMPREPLY=($(compgen -f "${cur}")) + COMPREPLY=() + if [[ "${BASH_VERSINFO[0]}" -ge 4 ]]; then + compopt -o plusdirs + fi return 0 ;; --jobs) COMPREPLY=("${cur}") + if [[ "${BASH_VERSINFO[0]}" -ge 4 ]]; then + compopt -o nospace + fi return 0 ;; -j) COMPREPLY=("${cur}") + if [[ "${BASH_VERSINFO[0]}" -ge 4 ]]; then + compopt -o nospace + fi return 0 ;; --warnings) @@ -822,6 +1361,9 @@ _x.py() { ;; --error-format) COMPREPLY=("${cur}") + if [[ "${BASH_VERSINFO[0]}" -ge 4 ]]; then + compopt -o nospace + fi return 0 ;; --color) @@ -833,15 +1375,48 @@ _x.py() { return 0 ;; --rust-profile-generate) + local oldifs + if [ -n "${IFS+x}" ]; then + oldifs="$IFS" + fi + IFS=$'\n' COMPREPLY=($(compgen -f "${cur}")) + if [ -n "${oldifs+x}" ]; then + IFS="$oldifs" + fi + if [[ "${BASH_VERSINFO[0]}" -ge 4 ]]; then + compopt -o filenames + fi return 0 ;; --rust-profile-use) + local oldifs + if [ -n "${IFS+x}" ]; then + oldifs="$IFS" + fi + IFS=$'\n' COMPREPLY=($(compgen -f "${cur}")) + if [ -n "${oldifs+x}" ]; then + IFS="$oldifs" + fi + if [[ "${BASH_VERSINFO[0]}" -ge 4 ]]; then + compopt -o filenames + fi return 0 ;; --llvm-profile-use) + local oldifs + if [ -n "${IFS+x}" ]; then + oldifs="$IFS" + fi + IFS=$'\n' COMPREPLY=($(compgen -f "${cur}")) + if [ -n "${oldifs+x}" ]; then + IFS="$oldifs" + fi + if [[ "${BASH_VERSINFO[0]}" -ge 4 ]]; then + compopt -o filenames + fi return 0 ;; --reproducible-artifact) @@ -850,6 +1425,9 @@ _x.py() { ;; --set) COMPREPLY=("${cur}") + if [[ "${BASH_VERSINFO[0]}" -ge 4 ]]; then + compopt -o nospace + fi return 0 ;; *) @@ -867,23 +1445,46 @@ _x.py() { fi case "${prev}" in --config) + local oldifs + if [ -n "${IFS+x}" ]; then + oldifs="$IFS" + fi + IFS=$'\n' COMPREPLY=($(compgen -f "${cur}")) + if [ -n "${oldifs+x}" ]; then + IFS="$oldifs" + fi + if [[ "${BASH_VERSINFO[0]}" -ge 4 ]]; then + compopt -o filenames + fi return 0 ;; --build-dir) - COMPREPLY=($(compgen -f "${cur}")) + COMPREPLY=() + if [[ "${BASH_VERSINFO[0]}" -ge 4 ]]; then + compopt -o plusdirs + fi return 0 ;; --build) COMPREPLY=("${cur}") + if [[ "${BASH_VERSINFO[0]}" -ge 4 ]]; then + compopt -o nospace + fi return 0 ;; --host) COMPREPLY=("${cur}") + if [[ "${BASH_VERSINFO[0]}" -ge 4 ]]; then + compopt -o nospace + fi return 0 ;; --target) COMPREPLY=("${cur}") + if [[ "${BASH_VERSINFO[0]}" -ge 4 ]]; then + compopt -o nospace + fi return 0 ;; --exclude) @@ -896,6 +1497,9 @@ _x.py() { ;; --rustc-error-format) COMPREPLY=("${cur}") + if [[ "${BASH_VERSINFO[0]}" -ge 4 ]]; then + compopt -o nospace + fi return 0 ;; --on-fail) @@ -904,26 +1508,44 @@ _x.py() { ;; --stage) COMPREPLY=("${cur}") + if [[ "${BASH_VERSINFO[0]}" -ge 4 ]]; then + compopt -o nospace + fi return 0 ;; --keep-stage) COMPREPLY=("${cur}") + if [[ "${BASH_VERSINFO[0]}" -ge 4 ]]; then + compopt -o nospace + fi return 0 ;; --keep-stage-std) COMPREPLY=("${cur}") + if [[ "${BASH_VERSINFO[0]}" -ge 4 ]]; then + compopt -o nospace + fi return 0 ;; --src) - COMPREPLY=($(compgen -f "${cur}")) + COMPREPLY=() + if [[ "${BASH_VERSINFO[0]}" -ge 4 ]]; then + compopt -o plusdirs + fi return 0 ;; --jobs) COMPREPLY=("${cur}") + if [[ "${BASH_VERSINFO[0]}" -ge 4 ]]; then + compopt -o nospace + fi return 0 ;; -j) COMPREPLY=("${cur}") + if [[ "${BASH_VERSINFO[0]}" -ge 4 ]]; then + compopt -o nospace + fi return 0 ;; --warnings) @@ -932,6 +1554,9 @@ _x.py() { ;; --error-format) COMPREPLY=("${cur}") + if [[ "${BASH_VERSINFO[0]}" -ge 4 ]]; then + compopt -o nospace + fi return 0 ;; --color) @@ -943,15 +1568,48 @@ _x.py() { return 0 ;; --rust-profile-generate) + local oldifs + if [ -n "${IFS+x}" ]; then + oldifs="$IFS" + fi + IFS=$'\n' COMPREPLY=($(compgen -f "${cur}")) + if [ -n "${oldifs+x}" ]; then + IFS="$oldifs" + fi + if [[ "${BASH_VERSINFO[0]}" -ge 4 ]]; then + compopt -o filenames + fi return 0 ;; --rust-profile-use) + local oldifs + if [ -n "${IFS+x}" ]; then + oldifs="$IFS" + fi + IFS=$'\n' COMPREPLY=($(compgen -f "${cur}")) + if [ -n "${oldifs+x}" ]; then + IFS="$oldifs" + fi + if [[ "${BASH_VERSINFO[0]}" -ge 4 ]]; then + compopt -o filenames + fi return 0 ;; --llvm-profile-use) + local oldifs + if [ -n "${IFS+x}" ]; then + oldifs="$IFS" + fi + IFS=$'\n' COMPREPLY=($(compgen -f "${cur}")) + if [ -n "${oldifs+x}" ]; then + IFS="$oldifs" + fi + if [[ "${BASH_VERSINFO[0]}" -ge 4 ]]; then + compopt -o filenames + fi return 0 ;; --reproducible-artifact) @@ -960,6 +1618,9 @@ _x.py() { ;; --set) COMPREPLY=("${cur}") + if [[ "${BASH_VERSINFO[0]}" -ge 4 ]]; then + compopt -o nospace + fi return 0 ;; *) @@ -977,23 +1638,46 @@ _x.py() { fi case "${prev}" in --config) + local oldifs + if [ -n "${IFS+x}" ]; then + oldifs="$IFS" + fi + IFS=$'\n' COMPREPLY=($(compgen -f "${cur}")) + if [ -n "${oldifs+x}" ]; then + IFS="$oldifs" + fi + if [[ "${BASH_VERSINFO[0]}" -ge 4 ]]; then + compopt -o filenames + fi return 0 ;; --build-dir) - COMPREPLY=($(compgen -f "${cur}")) + COMPREPLY=() + if [[ "${BASH_VERSINFO[0]}" -ge 4 ]]; then + compopt -o plusdirs + fi return 0 ;; --build) COMPREPLY=("${cur}") + if [[ "${BASH_VERSINFO[0]}" -ge 4 ]]; then + compopt -o nospace + fi return 0 ;; --host) COMPREPLY=("${cur}") + if [[ "${BASH_VERSINFO[0]}" -ge 4 ]]; then + compopt -o nospace + fi return 0 ;; --target) COMPREPLY=("${cur}") + if [[ "${BASH_VERSINFO[0]}" -ge 4 ]]; then + compopt -o nospace + fi return 0 ;; --exclude) @@ -1006,6 +1690,9 @@ _x.py() { ;; --rustc-error-format) COMPREPLY=("${cur}") + if [[ "${BASH_VERSINFO[0]}" -ge 4 ]]; then + compopt -o nospace + fi return 0 ;; --on-fail) @@ -1014,26 +1701,44 @@ _x.py() { ;; --stage) COMPREPLY=("${cur}") + if [[ "${BASH_VERSINFO[0]}" -ge 4 ]]; then + compopt -o nospace + fi return 0 ;; --keep-stage) COMPREPLY=("${cur}") + if [[ "${BASH_VERSINFO[0]}" -ge 4 ]]; then + compopt -o nospace + fi return 0 ;; --keep-stage-std) COMPREPLY=("${cur}") + if [[ "${BASH_VERSINFO[0]}" -ge 4 ]]; then + compopt -o nospace + fi return 0 ;; --src) - COMPREPLY=($(compgen -f "${cur}")) + COMPREPLY=() + if [[ "${BASH_VERSINFO[0]}" -ge 4 ]]; then + compopt -o plusdirs + fi return 0 ;; --jobs) COMPREPLY=("${cur}") + if [[ "${BASH_VERSINFO[0]}" -ge 4 ]]; then + compopt -o nospace + fi return 0 ;; -j) COMPREPLY=("${cur}") + if [[ "${BASH_VERSINFO[0]}" -ge 4 ]]; then + compopt -o nospace + fi return 0 ;; --warnings) @@ -1042,6 +1747,9 @@ _x.py() { ;; --error-format) COMPREPLY=("${cur}") + if [[ "${BASH_VERSINFO[0]}" -ge 4 ]]; then + compopt -o nospace + fi return 0 ;; --color) @@ -1053,15 +1761,48 @@ _x.py() { return 0 ;; --rust-profile-generate) + local oldifs + if [ -n "${IFS+x}" ]; then + oldifs="$IFS" + fi + IFS=$'\n' COMPREPLY=($(compgen -f "${cur}")) + if [ -n "${oldifs+x}" ]; then + IFS="$oldifs" + fi + if [[ "${BASH_VERSINFO[0]}" -ge 4 ]]; then + compopt -o filenames + fi return 0 ;; --rust-profile-use) + local oldifs + if [ -n "${IFS+x}" ]; then + oldifs="$IFS" + fi + IFS=$'\n' COMPREPLY=($(compgen -f "${cur}")) + if [ -n "${oldifs+x}" ]; then + IFS="$oldifs" + fi + if [[ "${BASH_VERSINFO[0]}" -ge 4 ]]; then + compopt -o filenames + fi return 0 ;; --llvm-profile-use) + local oldifs + if [ -n "${IFS+x}" ]; then + oldifs="$IFS" + fi + IFS=$'\n' COMPREPLY=($(compgen -f "${cur}")) + if [ -n "${oldifs+x}" ]; then + IFS="$oldifs" + fi + if [[ "${BASH_VERSINFO[0]}" -ge 4 ]]; then + compopt -o filenames + fi return 0 ;; --reproducible-artifact) @@ -1070,6 +1811,9 @@ _x.py() { ;; --set) COMPREPLY=("${cur}") + if [[ "${BASH_VERSINFO[0]}" -ge 4 ]]; then + compopt -o nospace + fi return 0 ;; *) @@ -1087,23 +1831,46 @@ _x.py() { fi case "${prev}" in --config) + local oldifs + if [ -n "${IFS+x}" ]; then + oldifs="$IFS" + fi + IFS=$'\n' COMPREPLY=($(compgen -f "${cur}")) + if [ -n "${oldifs+x}" ]; then + IFS="$oldifs" + fi + if [[ "${BASH_VERSINFO[0]}" -ge 4 ]]; then + compopt -o filenames + fi return 0 ;; --build-dir) - COMPREPLY=($(compgen -f "${cur}")) + COMPREPLY=() + if [[ "${BASH_VERSINFO[0]}" -ge 4 ]]; then + compopt -o plusdirs + fi return 0 ;; --build) COMPREPLY=("${cur}") + if [[ "${BASH_VERSINFO[0]}" -ge 4 ]]; then + compopt -o nospace + fi return 0 ;; --host) COMPREPLY=("${cur}") + if [[ "${BASH_VERSINFO[0]}" -ge 4 ]]; then + compopt -o nospace + fi return 0 ;; --target) COMPREPLY=("${cur}") + if [[ "${BASH_VERSINFO[0]}" -ge 4 ]]; then + compopt -o nospace + fi return 0 ;; --exclude) @@ -1116,6 +1883,9 @@ _x.py() { ;; --rustc-error-format) COMPREPLY=("${cur}") + if [[ "${BASH_VERSINFO[0]}" -ge 4 ]]; then + compopt -o nospace + fi return 0 ;; --on-fail) @@ -1124,26 +1894,44 @@ _x.py() { ;; --stage) COMPREPLY=("${cur}") + if [[ "${BASH_VERSINFO[0]}" -ge 4 ]]; then + compopt -o nospace + fi return 0 ;; --keep-stage) COMPREPLY=("${cur}") + if [[ "${BASH_VERSINFO[0]}" -ge 4 ]]; then + compopt -o nospace + fi return 0 ;; --keep-stage-std) COMPREPLY=("${cur}") + if [[ "${BASH_VERSINFO[0]}" -ge 4 ]]; then + compopt -o nospace + fi return 0 ;; --src) - COMPREPLY=($(compgen -f "${cur}")) + COMPREPLY=() + if [[ "${BASH_VERSINFO[0]}" -ge 4 ]]; then + compopt -o plusdirs + fi return 0 ;; --jobs) COMPREPLY=("${cur}") + if [[ "${BASH_VERSINFO[0]}" -ge 4 ]]; then + compopt -o nospace + fi return 0 ;; -j) COMPREPLY=("${cur}") + if [[ "${BASH_VERSINFO[0]}" -ge 4 ]]; then + compopt -o nospace + fi return 0 ;; --warnings) @@ -1152,6 +1940,9 @@ _x.py() { ;; --error-format) COMPREPLY=("${cur}") + if [[ "${BASH_VERSINFO[0]}" -ge 4 ]]; then + compopt -o nospace + fi return 0 ;; --color) @@ -1163,15 +1954,48 @@ _x.py() { return 0 ;; --rust-profile-generate) + local oldifs + if [ -n "${IFS+x}" ]; then + oldifs="$IFS" + fi + IFS=$'\n' COMPREPLY=($(compgen -f "${cur}")) + if [ -n "${oldifs+x}" ]; then + IFS="$oldifs" + fi + if [[ "${BASH_VERSINFO[0]}" -ge 4 ]]; then + compopt -o filenames + fi return 0 ;; --rust-profile-use) + local oldifs + if [ -n "${IFS+x}" ]; then + oldifs="$IFS" + fi + IFS=$'\n' COMPREPLY=($(compgen -f "${cur}")) + if [ -n "${oldifs+x}" ]; then + IFS="$oldifs" + fi + if [[ "${BASH_VERSINFO[0]}" -ge 4 ]]; then + compopt -o filenames + fi return 0 ;; --llvm-profile-use) + local oldifs + if [ -n "${IFS+x}" ]; then + oldifs="$IFS" + fi + IFS=$'\n' COMPREPLY=($(compgen -f "${cur}")) + if [ -n "${oldifs+x}" ]; then + IFS="$oldifs" + fi + if [[ "${BASH_VERSINFO[0]}" -ge 4 ]]; then + compopt -o filenames + fi return 0 ;; --reproducible-artifact) @@ -1180,6 +2004,9 @@ _x.py() { ;; --set) COMPREPLY=("${cur}") + if [[ "${BASH_VERSINFO[0]}" -ge 4 ]]; then + compopt -o nospace + fi return 0 ;; *) @@ -1197,23 +2024,46 @@ _x.py() { fi case "${prev}" in --config) + local oldifs + if [ -n "${IFS+x}" ]; then + oldifs="$IFS" + fi + IFS=$'\n' COMPREPLY=($(compgen -f "${cur}")) + if [ -n "${oldifs+x}" ]; then + IFS="$oldifs" + fi + if [[ "${BASH_VERSINFO[0]}" -ge 4 ]]; then + compopt -o filenames + fi return 0 ;; --build-dir) - COMPREPLY=($(compgen -f "${cur}")) + COMPREPLY=() + if [[ "${BASH_VERSINFO[0]}" -ge 4 ]]; then + compopt -o plusdirs + fi return 0 ;; --build) COMPREPLY=("${cur}") + if [[ "${BASH_VERSINFO[0]}" -ge 4 ]]; then + compopt -o nospace + fi return 0 ;; --host) COMPREPLY=("${cur}") + if [[ "${BASH_VERSINFO[0]}" -ge 4 ]]; then + compopt -o nospace + fi return 0 ;; --target) COMPREPLY=("${cur}") + if [[ "${BASH_VERSINFO[0]}" -ge 4 ]]; then + compopt -o nospace + fi return 0 ;; --exclude) @@ -1226,6 +2076,9 @@ _x.py() { ;; --rustc-error-format) COMPREPLY=("${cur}") + if [[ "${BASH_VERSINFO[0]}" -ge 4 ]]; then + compopt -o nospace + fi return 0 ;; --on-fail) @@ -1234,26 +2087,44 @@ _x.py() { ;; --stage) COMPREPLY=("${cur}") + if [[ "${BASH_VERSINFO[0]}" -ge 4 ]]; then + compopt -o nospace + fi return 0 ;; --keep-stage) COMPREPLY=("${cur}") + if [[ "${BASH_VERSINFO[0]}" -ge 4 ]]; then + compopt -o nospace + fi return 0 ;; --keep-stage-std) COMPREPLY=("${cur}") + if [[ "${BASH_VERSINFO[0]}" -ge 4 ]]; then + compopt -o nospace + fi return 0 ;; --src) - COMPREPLY=($(compgen -f "${cur}")) + COMPREPLY=() + if [[ "${BASH_VERSINFO[0]}" -ge 4 ]]; then + compopt -o plusdirs + fi return 0 ;; --jobs) COMPREPLY=("${cur}") + if [[ "${BASH_VERSINFO[0]}" -ge 4 ]]; then + compopt -o nospace + fi return 0 ;; -j) COMPREPLY=("${cur}") + if [[ "${BASH_VERSINFO[0]}" -ge 4 ]]; then + compopt -o nospace + fi return 0 ;; --warnings) @@ -1262,6 +2133,9 @@ _x.py() { ;; --error-format) COMPREPLY=("${cur}") + if [[ "${BASH_VERSINFO[0]}" -ge 4 ]]; then + compopt -o nospace + fi return 0 ;; --color) @@ -1273,15 +2147,48 @@ _x.py() { return 0 ;; --rust-profile-generate) + local oldifs + if [ -n "${IFS+x}" ]; then + oldifs="$IFS" + fi + IFS=$'\n' COMPREPLY=($(compgen -f "${cur}")) + if [ -n "${oldifs+x}" ]; then + IFS="$oldifs" + fi + if [[ "${BASH_VERSINFO[0]}" -ge 4 ]]; then + compopt -o filenames + fi return 0 ;; --rust-profile-use) + local oldifs + if [ -n "${IFS+x}" ]; then + oldifs="$IFS" + fi + IFS=$'\n' COMPREPLY=($(compgen -f "${cur}")) + if [ -n "${oldifs+x}" ]; then + IFS="$oldifs" + fi + if [[ "${BASH_VERSINFO[0]}" -ge 4 ]]; then + compopt -o filenames + fi return 0 ;; --llvm-profile-use) + local oldifs + if [ -n "${IFS+x}" ]; then + oldifs="$IFS" + fi + IFS=$'\n' COMPREPLY=($(compgen -f "${cur}")) + if [ -n "${oldifs+x}" ]; then + IFS="$oldifs" + fi + if [[ "${BASH_VERSINFO[0]}" -ge 4 ]]; then + compopt -o filenames + fi return 0 ;; --reproducible-artifact) @@ -1290,6 +2197,9 @@ _x.py() { ;; --set) COMPREPLY=("${cur}") + if [[ "${BASH_VERSINFO[0]}" -ge 4 ]]; then + compopt -o nospace + fi return 0 ;; *) @@ -1311,23 +2221,46 @@ _x.py() { return 0 ;; --config) + local oldifs + if [ -n "${IFS+x}" ]; then + oldifs="$IFS" + fi + IFS=$'\n' COMPREPLY=($(compgen -f "${cur}")) + if [ -n "${oldifs+x}" ]; then + IFS="$oldifs" + fi + if [[ "${BASH_VERSINFO[0]}" -ge 4 ]]; then + compopt -o filenames + fi return 0 ;; --build-dir) - COMPREPLY=($(compgen -f "${cur}")) + COMPREPLY=() + if [[ "${BASH_VERSINFO[0]}" -ge 4 ]]; then + compopt -o plusdirs + fi return 0 ;; --build) COMPREPLY=("${cur}") + if [[ "${BASH_VERSINFO[0]}" -ge 4 ]]; then + compopt -o nospace + fi return 0 ;; --host) COMPREPLY=("${cur}") + if [[ "${BASH_VERSINFO[0]}" -ge 4 ]]; then + compopt -o nospace + fi return 0 ;; --target) COMPREPLY=("${cur}") + if [[ "${BASH_VERSINFO[0]}" -ge 4 ]]; then + compopt -o nospace + fi return 0 ;; --exclude) @@ -1340,6 +2273,9 @@ _x.py() { ;; --rustc-error-format) COMPREPLY=("${cur}") + if [[ "${BASH_VERSINFO[0]}" -ge 4 ]]; then + compopt -o nospace + fi return 0 ;; --on-fail) @@ -1348,26 +2284,44 @@ _x.py() { ;; --stage) COMPREPLY=("${cur}") + if [[ "${BASH_VERSINFO[0]}" -ge 4 ]]; then + compopt -o nospace + fi return 0 ;; --keep-stage) COMPREPLY=("${cur}") + if [[ "${BASH_VERSINFO[0]}" -ge 4 ]]; then + compopt -o nospace + fi return 0 ;; --keep-stage-std) COMPREPLY=("${cur}") + if [[ "${BASH_VERSINFO[0]}" -ge 4 ]]; then + compopt -o nospace + fi return 0 ;; --src) - COMPREPLY=($(compgen -f "${cur}")) + COMPREPLY=() + if [[ "${BASH_VERSINFO[0]}" -ge 4 ]]; then + compopt -o plusdirs + fi return 0 ;; --jobs) COMPREPLY=("${cur}") + if [[ "${BASH_VERSINFO[0]}" -ge 4 ]]; then + compopt -o nospace + fi return 0 ;; -j) COMPREPLY=("${cur}") + if [[ "${BASH_VERSINFO[0]}" -ge 4 ]]; then + compopt -o nospace + fi return 0 ;; --warnings) @@ -1376,6 +2330,9 @@ _x.py() { ;; --error-format) COMPREPLY=("${cur}") + if [[ "${BASH_VERSINFO[0]}" -ge 4 ]]; then + compopt -o nospace + fi return 0 ;; --color) @@ -1387,15 +2344,48 @@ _x.py() { return 0 ;; --rust-profile-generate) + local oldifs + if [ -n "${IFS+x}" ]; then + oldifs="$IFS" + fi + IFS=$'\n' COMPREPLY=($(compgen -f "${cur}")) + if [ -n "${oldifs+x}" ]; then + IFS="$oldifs" + fi + if [[ "${BASH_VERSINFO[0]}" -ge 4 ]]; then + compopt -o filenames + fi return 0 ;; --rust-profile-use) + local oldifs + if [ -n "${IFS+x}" ]; then + oldifs="$IFS" + fi + IFS=$'\n' COMPREPLY=($(compgen -f "${cur}")) + if [ -n "${oldifs+x}" ]; then + IFS="$oldifs" + fi + if [[ "${BASH_VERSINFO[0]}" -ge 4 ]]; then + compopt -o filenames + fi return 0 ;; --llvm-profile-use) + local oldifs + if [ -n "${IFS+x}" ]; then + oldifs="$IFS" + fi + IFS=$'\n' COMPREPLY=($(compgen -f "${cur}")) + if [ -n "${oldifs+x}" ]; then + IFS="$oldifs" + fi + if [[ "${BASH_VERSINFO[0]}" -ge 4 ]]; then + compopt -o filenames + fi return 0 ;; --reproducible-artifact) @@ -1404,6 +2394,9 @@ _x.py() { ;; --set) COMPREPLY=("${cur}") + if [[ "${BASH_VERSINFO[0]}" -ge 4 ]]; then + compopt -o nospace + fi return 0 ;; *) @@ -1421,23 +2414,46 @@ _x.py() { fi case "${prev}" in --config) + local oldifs + if [ -n "${IFS+x}" ]; then + oldifs="$IFS" + fi + IFS=$'\n' COMPREPLY=($(compgen -f "${cur}")) + if [ -n "${oldifs+x}" ]; then + IFS="$oldifs" + fi + if [[ "${BASH_VERSINFO[0]}" -ge 4 ]]; then + compopt -o filenames + fi return 0 ;; --build-dir) - COMPREPLY=($(compgen -f "${cur}")) + COMPREPLY=() + if [[ "${BASH_VERSINFO[0]}" -ge 4 ]]; then + compopt -o plusdirs + fi return 0 ;; --build) COMPREPLY=("${cur}") + if [[ "${BASH_VERSINFO[0]}" -ge 4 ]]; then + compopt -o nospace + fi return 0 ;; --host) COMPREPLY=("${cur}") + if [[ "${BASH_VERSINFO[0]}" -ge 4 ]]; then + compopt -o nospace + fi return 0 ;; --target) COMPREPLY=("${cur}") + if [[ "${BASH_VERSINFO[0]}" -ge 4 ]]; then + compopt -o nospace + fi return 0 ;; --exclude) @@ -1450,6 +2466,9 @@ _x.py() { ;; --rustc-error-format) COMPREPLY=("${cur}") + if [[ "${BASH_VERSINFO[0]}" -ge 4 ]]; then + compopt -o nospace + fi return 0 ;; --on-fail) @@ -1458,26 +2477,44 @@ _x.py() { ;; --stage) COMPREPLY=("${cur}") + if [[ "${BASH_VERSINFO[0]}" -ge 4 ]]; then + compopt -o nospace + fi return 0 ;; --keep-stage) COMPREPLY=("${cur}") + if [[ "${BASH_VERSINFO[0]}" -ge 4 ]]; then + compopt -o nospace + fi return 0 ;; --keep-stage-std) COMPREPLY=("${cur}") + if [[ "${BASH_VERSINFO[0]}" -ge 4 ]]; then + compopt -o nospace + fi return 0 ;; --src) - COMPREPLY=($(compgen -f "${cur}")) + COMPREPLY=() + if [[ "${BASH_VERSINFO[0]}" -ge 4 ]]; then + compopt -o plusdirs + fi return 0 ;; --jobs) COMPREPLY=("${cur}") + if [[ "${BASH_VERSINFO[0]}" -ge 4 ]]; then + compopt -o nospace + fi return 0 ;; -j) COMPREPLY=("${cur}") + if [[ "${BASH_VERSINFO[0]}" -ge 4 ]]; then + compopt -o nospace + fi return 0 ;; --warnings) @@ -1486,6 +2523,9 @@ _x.py() { ;; --error-format) COMPREPLY=("${cur}") + if [[ "${BASH_VERSINFO[0]}" -ge 4 ]]; then + compopt -o nospace + fi return 0 ;; --color) @@ -1497,15 +2537,48 @@ _x.py() { return 0 ;; --rust-profile-generate) + local oldifs + if [ -n "${IFS+x}" ]; then + oldifs="$IFS" + fi + IFS=$'\n' COMPREPLY=($(compgen -f "${cur}")) + if [ -n "${oldifs+x}" ]; then + IFS="$oldifs" + fi + if [[ "${BASH_VERSINFO[0]}" -ge 4 ]]; then + compopt -o filenames + fi return 0 ;; --rust-profile-use) + local oldifs + if [ -n "${IFS+x}" ]; then + oldifs="$IFS" + fi + IFS=$'\n' COMPREPLY=($(compgen -f "${cur}")) + if [ -n "${oldifs+x}" ]; then + IFS="$oldifs" + fi + if [[ "${BASH_VERSINFO[0]}" -ge 4 ]]; then + compopt -o filenames + fi return 0 ;; --llvm-profile-use) + local oldifs + if [ -n "${IFS+x}" ]; then + oldifs="$IFS" + fi + IFS=$'\n' COMPREPLY=($(compgen -f "${cur}")) + if [ -n "${oldifs+x}" ]; then + IFS="$oldifs" + fi + if [[ "${BASH_VERSINFO[0]}" -ge 4 ]]; then + compopt -o filenames + fi return 0 ;; --reproducible-artifact) @@ -1514,6 +2587,9 @@ _x.py() { ;; --set) COMPREPLY=("${cur}") + if [[ "${BASH_VERSINFO[0]}" -ge 4 ]]; then + compopt -o nospace + fi return 0 ;; *) @@ -1535,23 +2611,46 @@ _x.py() { return 0 ;; --config) + local oldifs + if [ -n "${IFS+x}" ]; then + oldifs="$IFS" + fi + IFS=$'\n' COMPREPLY=($(compgen -f "${cur}")) + if [ -n "${oldifs+x}" ]; then + IFS="$oldifs" + fi + if [[ "${BASH_VERSINFO[0]}" -ge 4 ]]; then + compopt -o filenames + fi return 0 ;; --build-dir) - COMPREPLY=($(compgen -f "${cur}")) + COMPREPLY=() + if [[ "${BASH_VERSINFO[0]}" -ge 4 ]]; then + compopt -o plusdirs + fi return 0 ;; --build) COMPREPLY=("${cur}") + if [[ "${BASH_VERSINFO[0]}" -ge 4 ]]; then + compopt -o nospace + fi return 0 ;; --host) COMPREPLY=("${cur}") + if [[ "${BASH_VERSINFO[0]}" -ge 4 ]]; then + compopt -o nospace + fi return 0 ;; --target) COMPREPLY=("${cur}") + if [[ "${BASH_VERSINFO[0]}" -ge 4 ]]; then + compopt -o nospace + fi return 0 ;; --exclude) @@ -1564,6 +2663,9 @@ _x.py() { ;; --rustc-error-format) COMPREPLY=("${cur}") + if [[ "${BASH_VERSINFO[0]}" -ge 4 ]]; then + compopt -o nospace + fi return 0 ;; --on-fail) @@ -1572,26 +2674,44 @@ _x.py() { ;; --stage) COMPREPLY=("${cur}") + if [[ "${BASH_VERSINFO[0]}" -ge 4 ]]; then + compopt -o nospace + fi return 0 ;; --keep-stage) COMPREPLY=("${cur}") + if [[ "${BASH_VERSINFO[0]}" -ge 4 ]]; then + compopt -o nospace + fi return 0 ;; --keep-stage-std) COMPREPLY=("${cur}") + if [[ "${BASH_VERSINFO[0]}" -ge 4 ]]; then + compopt -o nospace + fi return 0 ;; --src) - COMPREPLY=($(compgen -f "${cur}")) + COMPREPLY=() + if [[ "${BASH_VERSINFO[0]}" -ge 4 ]]; then + compopt -o plusdirs + fi return 0 ;; --jobs) COMPREPLY=("${cur}") + if [[ "${BASH_VERSINFO[0]}" -ge 4 ]]; then + compopt -o nospace + fi return 0 ;; -j) COMPREPLY=("${cur}") + if [[ "${BASH_VERSINFO[0]}" -ge 4 ]]; then + compopt -o nospace + fi return 0 ;; --warnings) @@ -1600,6 +2720,9 @@ _x.py() { ;; --error-format) COMPREPLY=("${cur}") + if [[ "${BASH_VERSINFO[0]}" -ge 4 ]]; then + compopt -o nospace + fi return 0 ;; --color) @@ -1611,15 +2734,48 @@ _x.py() { return 0 ;; --rust-profile-generate) + local oldifs + if [ -n "${IFS+x}" ]; then + oldifs="$IFS" + fi + IFS=$'\n' COMPREPLY=($(compgen -f "${cur}")) + if [ -n "${oldifs+x}" ]; then + IFS="$oldifs" + fi + if [[ "${BASH_VERSINFO[0]}" -ge 4 ]]; then + compopt -o filenames + fi return 0 ;; --rust-profile-use) + local oldifs + if [ -n "${IFS+x}" ]; then + oldifs="$IFS" + fi + IFS=$'\n' COMPREPLY=($(compgen -f "${cur}")) + if [ -n "${oldifs+x}" ]; then + IFS="$oldifs" + fi + if [[ "${BASH_VERSINFO[0]}" -ge 4 ]]; then + compopt -o filenames + fi return 0 ;; --llvm-profile-use) + local oldifs + if [ -n "${IFS+x}" ]; then + oldifs="$IFS" + fi + IFS=$'\n' COMPREPLY=($(compgen -f "${cur}")) + if [ -n "${oldifs+x}" ]; then + IFS="$oldifs" + fi + if [[ "${BASH_VERSINFO[0]}" -ge 4 ]]; then + compopt -o filenames + fi return 0 ;; --reproducible-artifact) @@ -1628,6 +2784,9 @@ _x.py() { ;; --set) COMPREPLY=("${cur}") + if [[ "${BASH_VERSINFO[0]}" -ge 4 ]]; then + compopt -o nospace + fi return 0 ;; *) @@ -1645,23 +2804,46 @@ _x.py() { fi case "${prev}" in --config) + local oldifs + if [ -n "${IFS+x}" ]; then + oldifs="$IFS" + fi + IFS=$'\n' COMPREPLY=($(compgen -f "${cur}")) + if [ -n "${oldifs+x}" ]; then + IFS="$oldifs" + fi + if [[ "${BASH_VERSINFO[0]}" -ge 4 ]]; then + compopt -o filenames + fi return 0 ;; --build-dir) - COMPREPLY=($(compgen -f "${cur}")) + COMPREPLY=() + if [[ "${BASH_VERSINFO[0]}" -ge 4 ]]; then + compopt -o plusdirs + fi return 0 ;; --build) COMPREPLY=("${cur}") + if [[ "${BASH_VERSINFO[0]}" -ge 4 ]]; then + compopt -o nospace + fi return 0 ;; --host) COMPREPLY=("${cur}") + if [[ "${BASH_VERSINFO[0]}" -ge 4 ]]; then + compopt -o nospace + fi return 0 ;; --target) COMPREPLY=("${cur}") + if [[ "${BASH_VERSINFO[0]}" -ge 4 ]]; then + compopt -o nospace + fi return 0 ;; --exclude) @@ -1674,6 +2856,9 @@ _x.py() { ;; --rustc-error-format) COMPREPLY=("${cur}") + if [[ "${BASH_VERSINFO[0]}" -ge 4 ]]; then + compopt -o nospace + fi return 0 ;; --on-fail) @@ -1682,26 +2867,44 @@ _x.py() { ;; --stage) COMPREPLY=("${cur}") + if [[ "${BASH_VERSINFO[0]}" -ge 4 ]]; then + compopt -o nospace + fi return 0 ;; --keep-stage) COMPREPLY=("${cur}") + if [[ "${BASH_VERSINFO[0]}" -ge 4 ]]; then + compopt -o nospace + fi return 0 ;; --keep-stage-std) COMPREPLY=("${cur}") + if [[ "${BASH_VERSINFO[0]}" -ge 4 ]]; then + compopt -o nospace + fi return 0 ;; --src) - COMPREPLY=($(compgen -f "${cur}")) + COMPREPLY=() + if [[ "${BASH_VERSINFO[0]}" -ge 4 ]]; then + compopt -o plusdirs + fi return 0 ;; --jobs) COMPREPLY=("${cur}") + if [[ "${BASH_VERSINFO[0]}" -ge 4 ]]; then + compopt -o nospace + fi return 0 ;; -j) COMPREPLY=("${cur}") + if [[ "${BASH_VERSINFO[0]}" -ge 4 ]]; then + compopt -o nospace + fi return 0 ;; --warnings) @@ -1710,6 +2913,9 @@ _x.py() { ;; --error-format) COMPREPLY=("${cur}") + if [[ "${BASH_VERSINFO[0]}" -ge 4 ]]; then + compopt -o nospace + fi return 0 ;; --color) @@ -1721,15 +2927,48 @@ _x.py() { return 0 ;; --rust-profile-generate) + local oldifs + if [ -n "${IFS+x}" ]; then + oldifs="$IFS" + fi + IFS=$'\n' COMPREPLY=($(compgen -f "${cur}")) + if [ -n "${oldifs+x}" ]; then + IFS="$oldifs" + fi + if [[ "${BASH_VERSINFO[0]}" -ge 4 ]]; then + compopt -o filenames + fi return 0 ;; --rust-profile-use) + local oldifs + if [ -n "${IFS+x}" ]; then + oldifs="$IFS" + fi + IFS=$'\n' COMPREPLY=($(compgen -f "${cur}")) + if [ -n "${oldifs+x}" ]; then + IFS="$oldifs" + fi + if [[ "${BASH_VERSINFO[0]}" -ge 4 ]]; then + compopt -o filenames + fi return 0 ;; --llvm-profile-use) + local oldifs + if [ -n "${IFS+x}" ]; then + oldifs="$IFS" + fi + IFS=$'\n' COMPREPLY=($(compgen -f "${cur}")) + if [ -n "${oldifs+x}" ]; then + IFS="$oldifs" + fi + if [[ "${BASH_VERSINFO[0]}" -ge 4 ]]; then + compopt -o filenames + fi return 0 ;; --reproducible-artifact) @@ -1738,6 +2977,9 @@ _x.py() { ;; --set) COMPREPLY=("${cur}") + if [[ "${BASH_VERSINFO[0]}" -ge 4 ]]; then + compopt -o nospace + fi return 0 ;; *) @@ -1755,23 +2997,46 @@ _x.py() { fi case "${prev}" in --config) + local oldifs + if [ -n "${IFS+x}" ]; then + oldifs="$IFS" + fi + IFS=$'\n' COMPREPLY=($(compgen -f "${cur}")) + if [ -n "${oldifs+x}" ]; then + IFS="$oldifs" + fi + if [[ "${BASH_VERSINFO[0]}" -ge 4 ]]; then + compopt -o filenames + fi return 0 ;; --build-dir) - COMPREPLY=($(compgen -f "${cur}")) + COMPREPLY=() + if [[ "${BASH_VERSINFO[0]}" -ge 4 ]]; then + compopt -o plusdirs + fi return 0 ;; --build) COMPREPLY=("${cur}") + if [[ "${BASH_VERSINFO[0]}" -ge 4 ]]; then + compopt -o nospace + fi return 0 ;; --host) COMPREPLY=("${cur}") + if [[ "${BASH_VERSINFO[0]}" -ge 4 ]]; then + compopt -o nospace + fi return 0 ;; --target) COMPREPLY=("${cur}") + if [[ "${BASH_VERSINFO[0]}" -ge 4 ]]; then + compopt -o nospace + fi return 0 ;; --exclude) @@ -1784,6 +3049,9 @@ _x.py() { ;; --rustc-error-format) COMPREPLY=("${cur}") + if [[ "${BASH_VERSINFO[0]}" -ge 4 ]]; then + compopt -o nospace + fi return 0 ;; --on-fail) @@ -1792,26 +3060,44 @@ _x.py() { ;; --stage) COMPREPLY=("${cur}") + if [[ "${BASH_VERSINFO[0]}" -ge 4 ]]; then + compopt -o nospace + fi return 0 ;; --keep-stage) COMPREPLY=("${cur}") + if [[ "${BASH_VERSINFO[0]}" -ge 4 ]]; then + compopt -o nospace + fi return 0 ;; --keep-stage-std) COMPREPLY=("${cur}") + if [[ "${BASH_VERSINFO[0]}" -ge 4 ]]; then + compopt -o nospace + fi return 0 ;; --src) - COMPREPLY=($(compgen -f "${cur}")) + COMPREPLY=() + if [[ "${BASH_VERSINFO[0]}" -ge 4 ]]; then + compopt -o plusdirs + fi return 0 ;; --jobs) COMPREPLY=("${cur}") + if [[ "${BASH_VERSINFO[0]}" -ge 4 ]]; then + compopt -o nospace + fi return 0 ;; -j) COMPREPLY=("${cur}") + if [[ "${BASH_VERSINFO[0]}" -ge 4 ]]; then + compopt -o nospace + fi return 0 ;; --warnings) @@ -1820,6 +3106,9 @@ _x.py() { ;; --error-format) COMPREPLY=("${cur}") + if [[ "${BASH_VERSINFO[0]}" -ge 4 ]]; then + compopt -o nospace + fi return 0 ;; --color) @@ -1831,15 +3120,48 @@ _x.py() { return 0 ;; --rust-profile-generate) + local oldifs + if [ -n "${IFS+x}" ]; then + oldifs="$IFS" + fi + IFS=$'\n' COMPREPLY=($(compgen -f "${cur}")) + if [ -n "${oldifs+x}" ]; then + IFS="$oldifs" + fi + if [[ "${BASH_VERSINFO[0]}" -ge 4 ]]; then + compopt -o filenames + fi return 0 ;; --rust-profile-use) + local oldifs + if [ -n "${IFS+x}" ]; then + oldifs="$IFS" + fi + IFS=$'\n' COMPREPLY=($(compgen -f "${cur}")) + if [ -n "${oldifs+x}" ]; then + IFS="$oldifs" + fi + if [[ "${BASH_VERSINFO[0]}" -ge 4 ]]; then + compopt -o filenames + fi return 0 ;; --llvm-profile-use) + local oldifs + if [ -n "${IFS+x}" ]; then + oldifs="$IFS" + fi + IFS=$'\n' COMPREPLY=($(compgen -f "${cur}")) + if [ -n "${oldifs+x}" ]; then + IFS="$oldifs" + fi + if [[ "${BASH_VERSINFO[0]}" -ge 4 ]]; then + compopt -o filenames + fi return 0 ;; --reproducible-artifact) @@ -1848,6 +3170,9 @@ _x.py() { ;; --set) COMPREPLY=("${cur}") + if [[ "${BASH_VERSINFO[0]}" -ge 4 ]]; then + compopt -o nospace + fi return 0 ;; *) @@ -1889,23 +3214,46 @@ _x.py() { return 0 ;; --config) + local oldifs + if [ -n "${IFS+x}" ]; then + oldifs="$IFS" + fi + IFS=$'\n' COMPREPLY=($(compgen -f "${cur}")) + if [ -n "${oldifs+x}" ]; then + IFS="$oldifs" + fi + if [[ "${BASH_VERSINFO[0]}" -ge 4 ]]; then + compopt -o filenames + fi return 0 ;; --build-dir) - COMPREPLY=($(compgen -f "${cur}")) + COMPREPLY=() + if [[ "${BASH_VERSINFO[0]}" -ge 4 ]]; then + compopt -o plusdirs + fi return 0 ;; --build) COMPREPLY=("${cur}") + if [[ "${BASH_VERSINFO[0]}" -ge 4 ]]; then + compopt -o nospace + fi return 0 ;; --host) COMPREPLY=("${cur}") + if [[ "${BASH_VERSINFO[0]}" -ge 4 ]]; then + compopt -o nospace + fi return 0 ;; --target) COMPREPLY=("${cur}") + if [[ "${BASH_VERSINFO[0]}" -ge 4 ]]; then + compopt -o nospace + fi return 0 ;; --exclude) @@ -1918,6 +3266,9 @@ _x.py() { ;; --rustc-error-format) COMPREPLY=("${cur}") + if [[ "${BASH_VERSINFO[0]}" -ge 4 ]]; then + compopt -o nospace + fi return 0 ;; --on-fail) @@ -1926,26 +3277,44 @@ _x.py() { ;; --stage) COMPREPLY=("${cur}") + if [[ "${BASH_VERSINFO[0]}" -ge 4 ]]; then + compopt -o nospace + fi return 0 ;; --keep-stage) COMPREPLY=("${cur}") + if [[ "${BASH_VERSINFO[0]}" -ge 4 ]]; then + compopt -o nospace + fi return 0 ;; --keep-stage-std) COMPREPLY=("${cur}") + if [[ "${BASH_VERSINFO[0]}" -ge 4 ]]; then + compopt -o nospace + fi return 0 ;; --src) - COMPREPLY=($(compgen -f "${cur}")) + COMPREPLY=() + if [[ "${BASH_VERSINFO[0]}" -ge 4 ]]; then + compopt -o plusdirs + fi return 0 ;; --jobs) COMPREPLY=("${cur}") + if [[ "${BASH_VERSINFO[0]}" -ge 4 ]]; then + compopt -o nospace + fi return 0 ;; -j) COMPREPLY=("${cur}") + if [[ "${BASH_VERSINFO[0]}" -ge 4 ]]; then + compopt -o nospace + fi return 0 ;; --warnings) @@ -1954,6 +3323,9 @@ _x.py() { ;; --error-format) COMPREPLY=("${cur}") + if [[ "${BASH_VERSINFO[0]}" -ge 4 ]]; then + compopt -o nospace + fi return 0 ;; --color) @@ -1965,15 +3337,48 @@ _x.py() { return 0 ;; --rust-profile-generate) + local oldifs + if [ -n "${IFS+x}" ]; then + oldifs="$IFS" + fi + IFS=$'\n' COMPREPLY=($(compgen -f "${cur}")) + if [ -n "${oldifs+x}" ]; then + IFS="$oldifs" + fi + if [[ "${BASH_VERSINFO[0]}" -ge 4 ]]; then + compopt -o filenames + fi return 0 ;; --rust-profile-use) + local oldifs + if [ -n "${IFS+x}" ]; then + oldifs="$IFS" + fi + IFS=$'\n' COMPREPLY=($(compgen -f "${cur}")) + if [ -n "${oldifs+x}" ]; then + IFS="$oldifs" + fi + if [[ "${BASH_VERSINFO[0]}" -ge 4 ]]; then + compopt -o filenames + fi return 0 ;; --llvm-profile-use) + local oldifs + if [ -n "${IFS+x}" ]; then + oldifs="$IFS" + fi + IFS=$'\n' COMPREPLY=($(compgen -f "${cur}")) + if [ -n "${oldifs+x}" ]; then + IFS="$oldifs" + fi + if [[ "${BASH_VERSINFO[0]}" -ge 4 ]]; then + compopt -o filenames + fi return 0 ;; --reproducible-artifact) @@ -1982,6 +3387,9 @@ _x.py() { ;; --set) COMPREPLY=("${cur}") + if [[ "${BASH_VERSINFO[0]}" -ge 4 ]]; then + compopt -o nospace + fi return 0 ;; *) @@ -2003,23 +3411,46 @@ _x.py() { return 0 ;; --config) + local oldifs + if [ -n "${IFS+x}" ]; then + oldifs="$IFS" + fi + IFS=$'\n' COMPREPLY=($(compgen -f "${cur}")) + if [ -n "${oldifs+x}" ]; then + IFS="$oldifs" + fi + if [[ "${BASH_VERSINFO[0]}" -ge 4 ]]; then + compopt -o filenames + fi return 0 ;; --build-dir) - COMPREPLY=($(compgen -f "${cur}")) + COMPREPLY=() + if [[ "${BASH_VERSINFO[0]}" -ge 4 ]]; then + compopt -o plusdirs + fi return 0 ;; --build) COMPREPLY=("${cur}") + if [[ "${BASH_VERSINFO[0]}" -ge 4 ]]; then + compopt -o nospace + fi return 0 ;; --host) COMPREPLY=("${cur}") + if [[ "${BASH_VERSINFO[0]}" -ge 4 ]]; then + compopt -o nospace + fi return 0 ;; --target) COMPREPLY=("${cur}") + if [[ "${BASH_VERSINFO[0]}" -ge 4 ]]; then + compopt -o nospace + fi return 0 ;; --exclude) @@ -2032,6 +3463,9 @@ _x.py() { ;; --rustc-error-format) COMPREPLY=("${cur}") + if [[ "${BASH_VERSINFO[0]}" -ge 4 ]]; then + compopt -o nospace + fi return 0 ;; --on-fail) @@ -2040,26 +3474,44 @@ _x.py() { ;; --stage) COMPREPLY=("${cur}") + if [[ "${BASH_VERSINFO[0]}" -ge 4 ]]; then + compopt -o nospace + fi return 0 ;; --keep-stage) COMPREPLY=("${cur}") + if [[ "${BASH_VERSINFO[0]}" -ge 4 ]]; then + compopt -o nospace + fi return 0 ;; --keep-stage-std) COMPREPLY=("${cur}") + if [[ "${BASH_VERSINFO[0]}" -ge 4 ]]; then + compopt -o nospace + fi return 0 ;; --src) - COMPREPLY=($(compgen -f "${cur}")) + COMPREPLY=() + if [[ "${BASH_VERSINFO[0]}" -ge 4 ]]; then + compopt -o plusdirs + fi return 0 ;; --jobs) COMPREPLY=("${cur}") + if [[ "${BASH_VERSINFO[0]}" -ge 4 ]]; then + compopt -o nospace + fi return 0 ;; -j) COMPREPLY=("${cur}") + if [[ "${BASH_VERSINFO[0]}" -ge 4 ]]; then + compopt -o nospace + fi return 0 ;; --warnings) @@ -2068,6 +3520,9 @@ _x.py() { ;; --error-format) COMPREPLY=("${cur}") + if [[ "${BASH_VERSINFO[0]}" -ge 4 ]]; then + compopt -o nospace + fi return 0 ;; --color) @@ -2079,15 +3534,48 @@ _x.py() { return 0 ;; --rust-profile-generate) + local oldifs + if [ -n "${IFS+x}" ]; then + oldifs="$IFS" + fi + IFS=$'\n' COMPREPLY=($(compgen -f "${cur}")) + if [ -n "${oldifs+x}" ]; then + IFS="$oldifs" + fi + if [[ "${BASH_VERSINFO[0]}" -ge 4 ]]; then + compopt -o filenames + fi return 0 ;; --rust-profile-use) + local oldifs + if [ -n "${IFS+x}" ]; then + oldifs="$IFS" + fi + IFS=$'\n' COMPREPLY=($(compgen -f "${cur}")) + if [ -n "${oldifs+x}" ]; then + IFS="$oldifs" + fi + if [[ "${BASH_VERSINFO[0]}" -ge 4 ]]; then + compopt -o filenames + fi return 0 ;; --llvm-profile-use) + local oldifs + if [ -n "${IFS+x}" ]; then + oldifs="$IFS" + fi + IFS=$'\n' COMPREPLY=($(compgen -f "${cur}")) + if [ -n "${oldifs+x}" ]; then + IFS="$oldifs" + fi + if [[ "${BASH_VERSINFO[0]}" -ge 4 ]]; then + compopt -o filenames + fi return 0 ;; --reproducible-artifact) @@ -2096,6 +3584,9 @@ _x.py() { ;; --set) COMPREPLY=("${cur}") + if [[ "${BASH_VERSINFO[0]}" -ge 4 ]]; then + compopt -o nospace + fi return 0 ;; *) diff --git a/src/etc/completions/x.py.zsh b/src/etc/completions/x.py.zsh index 688f692da24..ae076b88345 100644 --- a/src/etc/completions/x.py.zsh +++ b/src/etc/completions/x.py.zsh @@ -14,7 +14,7 @@ _x.py() { fi local context curcontext="$curcontext" state line - _arguments "${_arguments_options[@]}" \ + _arguments "${_arguments_options[@]}" : \ '--config=[TOML configuration file for build]:FILE:_files' \ '--build-dir=[Build directory, overrides \`build.build-dir\` in \`config.toml\`]:DIR:_files -/' \ '--build=[build target of the stage0 compiler]:BUILD:( )' \ @@ -65,7 +65,7 @@ _x.py() { curcontext="${curcontext%:*:*}:x.py-command-$line[3]:" case $line[3] in (build) -_arguments "${_arguments_options[@]}" \ +_arguments "${_arguments_options[@]}" : \ '--config=[TOML configuration file for build]:FILE:_files' \ '--build-dir=[Build directory, overrides \`build.build-dir\` in \`config.toml\`]:DIR:_files -/' \ '--build=[build target of the stage0 compiler]:BUILD:( )' \ @@ -108,7 +108,7 @@ _arguments "${_arguments_options[@]}" \ && ret=0 ;; (check) -_arguments "${_arguments_options[@]}" \ +_arguments "${_arguments_options[@]}" : \ '--config=[TOML configuration file for build]:FILE:_files' \ '--build-dir=[Build directory, overrides \`build.build-dir\` in \`config.toml\`]:DIR:_files -/' \ '--build=[build target of the stage0 compiler]:BUILD:( )' \ @@ -152,7 +152,7 @@ _arguments "${_arguments_options[@]}" \ && ret=0 ;; (clippy) -_arguments "${_arguments_options[@]}" \ +_arguments "${_arguments_options[@]}" : \ '*-A+[clippy lints to allow]:LINT: ' \ '*-D+[clippy lints to deny]:LINT: ' \ '*-W+[clippy lints to warn on]:LINT: ' \ @@ -202,7 +202,7 @@ _arguments "${_arguments_options[@]}" \ && ret=0 ;; (fix) -_arguments "${_arguments_options[@]}" \ +_arguments "${_arguments_options[@]}" : \ '--config=[TOML configuration file for build]:FILE:_files' \ '--build-dir=[Build directory, overrides \`build.build-dir\` in \`config.toml\`]:DIR:_files -/' \ '--build=[build target of the stage0 compiler]:BUILD:( )' \ @@ -245,7 +245,7 @@ _arguments "${_arguments_options[@]}" \ && ret=0 ;; (fmt) -_arguments "${_arguments_options[@]}" \ +_arguments "${_arguments_options[@]}" : \ '--config=[TOML configuration file for build]:FILE:_files' \ '--build-dir=[Build directory, overrides \`build.build-dir\` in \`config.toml\`]:DIR:_files -/' \ '--build=[build target of the stage0 compiler]:BUILD:( )' \ @@ -290,7 +290,7 @@ _arguments "${_arguments_options[@]}" \ && ret=0 ;; (doc) -_arguments "${_arguments_options[@]}" \ +_arguments "${_arguments_options[@]}" : \ '--config=[TOML configuration file for build]:FILE:_files' \ '--build-dir=[Build directory, overrides \`build.build-dir\` in \`config.toml\`]:DIR:_files -/' \ '--build=[build target of the stage0 compiler]:BUILD:( )' \ @@ -335,7 +335,7 @@ _arguments "${_arguments_options[@]}" \ && ret=0 ;; (test) -_arguments "${_arguments_options[@]}" \ +_arguments "${_arguments_options[@]}" : \ '*--test-args=[extra arguments to be passed for the test tool being used (e.g. libtest, compiletest or rustdoc)]:ARGS: ' \ '*--compiletest-rustc-args=[extra options to pass the compiler when running compiletest tests]:ARGS: ' \ '--extra-checks=[comma-separated list of other files types to check (accepts py, py\:lint, py\:fmt, shell)]:EXTRA_CHECKS: ' \ @@ -391,7 +391,7 @@ _arguments "${_arguments_options[@]}" \ && ret=0 ;; (miri) -_arguments "${_arguments_options[@]}" \ +_arguments "${_arguments_options[@]}" : \ '*--test-args=[extra arguments to be passed for the test tool being used (e.g. libtest, compiletest or rustdoc)]:ARGS: ' \ '--config=[TOML configuration file for build]:FILE:_files' \ '--build-dir=[Build directory, overrides \`build.build-dir\` in \`config.toml\`]:DIR:_files -/' \ @@ -438,7 +438,7 @@ _arguments "${_arguments_options[@]}" \ && ret=0 ;; (bench) -_arguments "${_arguments_options[@]}" \ +_arguments "${_arguments_options[@]}" : \ '*--test-args=[]:TEST_ARGS: ' \ '--config=[TOML configuration file for build]:FILE:_files' \ '--build-dir=[Build directory, overrides \`build.build-dir\` in \`config.toml\`]:DIR:_files -/' \ @@ -482,7 +482,7 @@ _arguments "${_arguments_options[@]}" \ && ret=0 ;; (clean) -_arguments "${_arguments_options[@]}" \ +_arguments "${_arguments_options[@]}" : \ '--stage=[Clean a specific stage without touching other artifacts. By default, every stage is cleaned if this option is not used]:N: ' \ '--config=[TOML configuration file for build]:FILE:_files' \ '--build-dir=[Build directory, overrides \`build.build-dir\` in \`config.toml\`]:DIR:_files -/' \ @@ -526,7 +526,7 @@ _arguments "${_arguments_options[@]}" \ && ret=0 ;; (dist) -_arguments "${_arguments_options[@]}" \ +_arguments "${_arguments_options[@]}" : \ '--config=[TOML configuration file for build]:FILE:_files' \ '--build-dir=[Build directory, overrides \`build.build-dir\` in \`config.toml\`]:DIR:_files -/' \ '--build=[build target of the stage0 compiler]:BUILD:( )' \ @@ -569,7 +569,7 @@ _arguments "${_arguments_options[@]}" \ && ret=0 ;; (install) -_arguments "${_arguments_options[@]}" \ +_arguments "${_arguments_options[@]}" : \ '--config=[TOML configuration file for build]:FILE:_files' \ '--build-dir=[Build directory, overrides \`build.build-dir\` in \`config.toml\`]:DIR:_files -/' \ '--build=[build target of the stage0 compiler]:BUILD:( )' \ @@ -612,7 +612,7 @@ _arguments "${_arguments_options[@]}" \ && ret=0 ;; (run) -_arguments "${_arguments_options[@]}" \ +_arguments "${_arguments_options[@]}" : \ '*--args=[arguments for the tool]:ARGS: ' \ '--config=[TOML configuration file for build]:FILE:_files' \ '--build-dir=[Build directory, overrides \`build.build-dir\` in \`config.toml\`]:DIR:_files -/' \ @@ -656,7 +656,7 @@ _arguments "${_arguments_options[@]}" \ && ret=0 ;; (setup) -_arguments "${_arguments_options[@]}" \ +_arguments "${_arguments_options[@]}" : \ '--config=[TOML configuration file for build]:FILE:_files' \ '--build-dir=[Build directory, overrides \`build.build-dir\` in \`config.toml\`]:DIR:_files -/' \ '--build=[build target of the stage0 compiler]:BUILD:( )' \ @@ -700,7 +700,7 @@ _arguments "${_arguments_options[@]}" \ && ret=0 ;; (suggest) -_arguments "${_arguments_options[@]}" \ +_arguments "${_arguments_options[@]}" : \ '--config=[TOML configuration file for build]:FILE:_files' \ '--build-dir=[Build directory, overrides \`build.build-dir\` in \`config.toml\`]:DIR:_files -/' \ '--build=[build target of the stage0 compiler]:BUILD:( )' \ @@ -744,7 +744,7 @@ _arguments "${_arguments_options[@]}" \ && ret=0 ;; (vendor) -_arguments "${_arguments_options[@]}" \ +_arguments "${_arguments_options[@]}" : \ '*--sync=[Additional \`Cargo.toml\` to sync and vendor]:SYNC:_files' \ '--config=[TOML configuration file for build]:FILE:_files' \ '--build-dir=[Build directory, overrides \`build.build-dir\` in \`config.toml\`]:DIR:_files -/' \ @@ -789,7 +789,7 @@ _arguments "${_arguments_options[@]}" \ && ret=0 ;; (perf) -_arguments "${_arguments_options[@]}" \ +_arguments "${_arguments_options[@]}" : \ '--config=[TOML configuration file for build]:FILE:_files' \ '--build-dir=[Build directory, overrides \`build.build-dir\` in \`config.toml\`]:DIR:_files -/' \ '--build=[build target of the stage0 compiler]:BUILD:( )' \ diff --git a/src/librustdoc/clean/mod.rs b/src/librustdoc/clean/mod.rs index 53757349a9b..db81b4c4282 100644 --- a/src/librustdoc/clean/mod.rs +++ b/src/librustdoc/clean/mod.rs @@ -3094,16 +3094,10 @@ fn clean_maybe_renamed_foreign_item<'tcx>( let def_id = item.owner_id.to_def_id(); cx.with_param_env(def_id, |cx| { let kind = match item.kind { - hir::ForeignItemKind::Fn(decl, names, generics, safety) => { - let (generics, decl) = enter_impl_trait(cx, |cx| { - // NOTE: generics must be cleaned before args - let generics = clean_generics(generics, cx); - let args = clean_args_from_types_and_names(cx, decl.inputs, names); - let decl = clean_fn_decl_with_args(cx, decl, None, args); - (generics, decl) - }); - ForeignFunctionItem(Box::new(Function { decl, generics }), safety) - } + hir::ForeignItemKind::Fn(sig, names, generics) => ForeignFunctionItem( + clean_function(cx, &sig, generics, FunctionArgs::Names(names)), + sig.header.safety, + ), hir::ForeignItemKind::Static(ty, mutability, safety) => ForeignStaticItem( Static { type_: Box::new(clean_ty(ty, cx)), mutability, expr: None }, safety, diff --git a/src/librustdoc/doctest/runner.rs b/src/librustdoc/doctest/runner.rs index b91333e5f81..d49fa3ac5ac 100644 --- a/src/librustdoc/doctest/runner.rs +++ b/src/librustdoc/doctest/runner.rs @@ -75,7 +75,6 @@ impl DocTestRunner { #![allow(internal_features)] #![feature(test)] #![feature(rustc_attrs)] -#![feature(coverage_attribute)] " .to_string(); @@ -135,7 +134,6 @@ mod __doctest_mod {{ }} #[rustc_main] -#[coverage(off)] fn main() -> std::process::ExitCode {{ const TESTS: [test::TestDescAndFn; {nb_tests}] = [{ids}]; let bin_marker = std::ffi::OsStr::new(__doctest_mod::BIN_OPTION); @@ -235,11 +233,9 @@ fn main() {returns_result} {{ writeln!( output, " -#[rustc_test_marker = {test_name:?}] pub const TEST: test::TestDescAndFn = test::TestDescAndFn::new_doctest( {test_name:?}, {ignore}, {file:?}, {line}, {no_run}, {should_panic}, test::StaticTestFn( - #[coverage(off)] || {{{runner}}}, )); }}", diff --git a/src/librustdoc/json/mod.rs b/src/librustdoc/json/mod.rs index a424faaf999..e2860292aa3 100644 --- a/src/librustdoc/json/mod.rs +++ b/src/librustdoc/json/mod.rs @@ -39,8 +39,10 @@ pub(crate) struct JsonRenderer<'tcx> { /// A mapping of IDs that contains all local items for this crate which gets output as a top /// level field of the JSON blob. index: Rc<RefCell<FxHashMap<types::Id, types::Item>>>, - /// The directory where the blob will be written to. - out_path: Option<PathBuf>, + /// The directory where the JSON blob should be written to. + /// + /// If this is `None`, the blob will be printed to `stdout` instead. + out_dir: Option<PathBuf>, cache: Rc<Cache>, imported_items: DefIdSet, } @@ -101,18 +103,20 @@ impl<'tcx> JsonRenderer<'tcx> { .unwrap_or_default() } - fn write<T: Write>( + fn serialize_and_write<T: Write>( &self, - output: types::Crate, + output_crate: types::Crate, mut writer: BufWriter<T>, path: &str, ) -> Result<(), Error> { - self.tcx - .sess - .time("rustdoc_json_serialization", || serde_json::ser::to_writer(&mut writer, &output)) - .unwrap(); - try_err!(writer.flush(), path); - Ok(()) + self.sess().time("rustdoc_json_serialize_and_write", || { + try_err!( + serde_json::ser::to_writer(&mut writer, &output_crate).map_err(|e| e.to_string()), + path + ); + try_err!(writer.flush(), path); + Ok(()) + }) } } @@ -137,7 +141,7 @@ impl<'tcx> FormatRenderer<'tcx> for JsonRenderer<'tcx> { JsonRenderer { tcx, index: Rc::new(RefCell::new(FxHashMap::default())), - out_path: if options.output_to_stdout { None } else { Some(options.output) }, + out_dir: if options.output_to_stdout { None } else { Some(options.output) }, cache: Rc::new(cache), imported_items, }, @@ -237,7 +241,7 @@ impl<'tcx> FormatRenderer<'tcx> for JsonRenderer<'tcx> { let index = (*self.index).clone().into_inner(); debug!("Constructing Output"); - let output = types::Crate { + let output_crate = types::Crate { root: types::Id(format!("0:0:{}", e.name(self.tcx).as_u32())), crate_version: self.cache.crate_version.clone(), includes_private: self.cache.document_private, @@ -278,20 +282,20 @@ impl<'tcx> FormatRenderer<'tcx> for JsonRenderer<'tcx> { .collect(), format_version: types::FORMAT_VERSION, }; - if let Some(ref out_path) = self.out_path { - let out_dir = out_path.clone(); + if let Some(ref out_dir) = self.out_dir { try_err!(create_dir_all(&out_dir), out_dir); - let mut p = out_dir; - p.push(output.index.get(&output.root).unwrap().name.clone().unwrap()); + let mut p = out_dir.clone(); + p.push(output_crate.index.get(&output_crate.root).unwrap().name.clone().unwrap()); p.set_extension("json"); - self.write( - output, + + self.serialize_and_write( + output_crate, BufWriter::new(try_err!(File::create(&p), p)), &p.display().to_string(), ) } else { - self.write(output, BufWriter::new(stdout()), "<stdout>") + self.serialize_and_write(output_crate, BufWriter::new(stdout().lock()), "<stdout>") } } diff --git a/src/tools/build-manifest/src/main.rs b/src/tools/build-manifest/src/main.rs index 2b263f848e8..92b21f7dbaa 100644 --- a/src/tools/build-manifest/src/main.rs +++ b/src/tools/build-manifest/src/main.rs @@ -54,6 +54,7 @@ static TARGETS: &[&str] = &[ "arm64e-apple-darwin", "aarch64-apple-ios", "arm64e-apple-ios", + "aarch64-apple-ios-macabi", "aarch64-apple-ios-sim", "aarch64-unknown-fuchsia", "aarch64-linux-android", @@ -161,6 +162,7 @@ static TARGETS: &[&str] = &[ "wasm32-wasip2", "x86_64-apple-darwin", "x86_64-apple-ios", + "x86_64-apple-ios-macabi", "x86_64-fortanix-unknown-sgx", "x86_64-unknown-fuchsia", "x86_64-linux-android", diff --git a/src/tools/cargo b/src/tools/cargo -Subproject 2f738d617c6ead388f899802dd1a7fd66858a69 +Subproject ba8b39413c74d08494f94a7542fe79aa636e166 diff --git a/src/tools/clippy/clippy_utils/src/qualify_min_const_fn.rs b/src/tools/clippy/clippy_utils/src/qualify_min_const_fn.rs index 553af913ef9..95fbf0b2ea2 100644 --- a/src/tools/clippy/clippy_utils/src/qualify_min_const_fn.rs +++ b/src/tools/clippy/clippy_utils/src/qualify_min_const_fn.rs @@ -110,7 +110,7 @@ fn check_rvalue<'tcx>( ) -> McfResult { match rvalue { Rvalue::ThreadLocalRef(_) => Err((span, "cannot access thread local storage in const fn".into())), - Rvalue::Len(place) | Rvalue::Discriminant(place) | Rvalue::Ref(_, _, place) | Rvalue::AddressOf(_, place) => { + Rvalue::Len(place) | Rvalue::Discriminant(place) | Rvalue::Ref(_, _, place) | Rvalue::RawPtr(_, place) => { check_place(tcx, *place, span, body, msrv) }, Rvalue::CopyForDeref(place) => check_place(tcx, *place, span, body, msrv), diff --git a/src/tools/compiletest/src/command-list.rs b/src/tools/compiletest/src/command-list.rs index 50c909793f5..7f8080235c8 100644 --- a/src/tools/compiletest/src/command-list.rs +++ b/src/tools/compiletest/src/command-list.rs @@ -92,10 +92,12 @@ const KNOWN_DIRECTIVE_NAMES: &[&str] = &[ "ignore-nvptx64-nvidia-cuda", "ignore-openbsd", "ignore-pass", + "ignore-powerpc", "ignore-remote", "ignore-riscv64", "ignore-s390x", "ignore-sgx", + "ignore-sparc64", "ignore-spirv", "ignore-stable", "ignore-stage1", @@ -123,6 +125,7 @@ const KNOWN_DIRECTIVE_NAMES: &[&str] = &[ "ignore-x86", "ignore-x86_64", "ignore-x86_64-apple-darwin", + "ignore-x86_64-pc-windows-gnu", "ignore-x86_64-unknown-linux-gnu", "incremental", "known-bug", @@ -142,7 +145,6 @@ const KNOWN_DIRECTIVE_NAMES: &[&str] = &[ "needs-relocation-model-pic", "needs-run-enabled", "needs-rust-lld", - "needs-rust-lldb", "needs-sanitizer-address", "needs-sanitizer-cfi", "needs-sanitizer-dataflow", @@ -191,7 +193,9 @@ const KNOWN_DIRECTIVE_NAMES: &[&str] = &[ "only-msvc", "only-nightly", "only-nvptx64", + "only-powerpc", "only-riscv64", + "only-s390x", "only-sparc", "only-sparc64", "only-stable", diff --git a/src/tools/compiletest/src/common.rs b/src/tools/compiletest/src/common.rs index 70ebefe3f41..5831f7c3cf2 100644 --- a/src/tools/compiletest/src/common.rs +++ b/src/tools/compiletest/src/common.rs @@ -296,15 +296,9 @@ pub struct Config { /// Version of GDB, encoded as ((major * 1000) + minor) * 1000 + patch pub gdb_version: Option<u32>, - /// Whether GDB has native rust support - pub gdb_native_rust: bool, - /// Version of LLDB pub lldb_version: Option<u32>, - /// Whether LLDB has native rust support - pub lldb_native_rust: bool, - /// Version of LLVM pub llvm_version: Option<u32>, diff --git a/src/tools/compiletest/src/header/needs.rs b/src/tools/compiletest/src/header/needs.rs index 5b2665f7d0b..8f935d5b744 100644 --- a/src/tools/compiletest/src/header/needs.rs +++ b/src/tools/compiletest/src/header/needs.rs @@ -1,4 +1,4 @@ -use crate::common::{Config, Debugger, Sanitizer}; +use crate::common::{Config, Sanitizer}; use crate::header::IgnoreDecision; pub(super) fn handle_needs( @@ -115,11 +115,6 @@ pub(super) fn handle_needs( ignore_reason: "ignored on targets without Rust's LLD", }, Need { - name: "needs-rust-lldb", - condition: config.debugger != Some(Debugger::Lldb) || config.lldb_native_rust, - ignore_reason: "ignored on targets without Rust's LLDB", - }, - Need { name: "needs-dlltool", condition: cache.dlltool, ignore_reason: "ignored when dlltool for the current architecture is not present", diff --git a/src/tools/compiletest/src/lib.rs b/src/tools/compiletest/src/lib.rs index 6acf46f9196..7018362af54 100644 --- a/src/tools/compiletest/src/lib.rs +++ b/src/tools/compiletest/src/lib.rs @@ -194,14 +194,8 @@ pub fn parse_config(args: Vec<String>) -> Config { let target = opt_str2(matches.opt_str("target")); let android_cross_path = opt_path(matches, "android-cross-path"); let (cdb, cdb_version) = analyze_cdb(matches.opt_str("cdb"), &target); - let (gdb, gdb_version, gdb_native_rust) = - analyze_gdb(matches.opt_str("gdb"), &target, &android_cross_path); - let (lldb_version, lldb_native_rust) = matches - .opt_str("lldb-version") - .as_deref() - .and_then(extract_lldb_version) - .map(|(v, b)| (Some(v), b)) - .unwrap_or((None, false)); + let (gdb, gdb_version) = analyze_gdb(matches.opt_str("gdb"), &target, &android_cross_path); + let lldb_version = matches.opt_str("lldb-version").as_deref().and_then(extract_lldb_version); let color = match matches.opt_str("color").as_deref() { Some("auto") | None => ColorConfig::AutoColor, Some("always") => ColorConfig::AlwaysColor, @@ -298,9 +292,7 @@ pub fn parse_config(args: Vec<String>) -> Config { cdb_version, gdb, gdb_version, - gdb_native_rust, lldb_version, - lldb_native_rust, llvm_version, system_llvm: matches.opt_present("system-llvm"), android_cross_path, @@ -1035,19 +1027,17 @@ fn extract_cdb_version(full_version_line: &str) -> Option<[u16; 4]> { Some([major, minor, patch, build]) } -/// Returns (Path to GDB, GDB Version, GDB has Rust Support) +/// Returns (Path to GDB, GDB Version) fn analyze_gdb( gdb: Option<String>, target: &str, android_cross_path: &PathBuf, -) -> (Option<String>, Option<u32>, bool) { +) -> (Option<String>, Option<u32>) { #[cfg(not(windows))] const GDB_FALLBACK: &str = "gdb"; #[cfg(windows)] const GDB_FALLBACK: &str = "gdb.exe"; - const MIN_GDB_WITH_RUST: u32 = 7011010; - let fallback_gdb = || { if is_android_gdb_target(target) { let mut gdb_path = match android_cross_path.to_str() { @@ -1076,12 +1066,10 @@ fn analyze_gdb( let version = match version_line { Some(line) => extract_gdb_version(&line), - None => return (None, None, false), + None => return (None, None), }; - let gdb_native_rust = version.map_or(false, |v| v >= MIN_GDB_WITH_RUST); - - (Some(gdb), version, gdb_native_rust) + (Some(gdb), version) } fn extract_gdb_version(full_version_line: &str) -> Option<u32> { @@ -1131,8 +1119,8 @@ fn extract_gdb_version(full_version_line: &str) -> Option<u32> { Some(((major * 1000) + minor) * 1000 + patch) } -/// Returns (LLDB version, LLDB is rust-enabled) -fn extract_lldb_version(full_version_line: &str) -> Option<(u32, bool)> { +/// Returns LLDB version +fn extract_lldb_version(full_version_line: &str) -> Option<u32> { // Extract the major LLDB version from the given version string. // LLDB version strings are different for Apple and non-Apple platforms. // The Apple variant looks like this: @@ -1149,9 +1137,7 @@ fn extract_lldb_version(full_version_line: &str) -> Option<(u32, bool)> { // There doesn't seem to be a way to correlate the Apple version // with the upstream version, and since the tests were originally // written against Apple versions, we make a fake Apple version by - // multiplying the first number by 100. This is a hack, but - // normally fine because the only non-Apple version we test is - // rust-enabled. + // multiplying the first number by 100. This is a hack. let full_version_line = full_version_line.trim(); @@ -1160,12 +1146,12 @@ fn extract_lldb_version(full_version_line: &str) -> Option<(u32, bool)> { { if let Some(idx) = apple_ver.find(not_a_digit) { let version: u32 = apple_ver[..idx].parse().unwrap(); - return Some((version, full_version_line.contains("rust-enabled"))); + return Some(version); } } else if let Some(lldb_ver) = full_version_line.strip_prefix("lldb version ") { if let Some(idx) = lldb_ver.find(not_a_digit) { let version: u32 = lldb_ver[..idx].parse().ok()?; - return Some((version * 100, full_version_line.contains("rust-enabled"))); + return Some(version * 100); } } None diff --git a/src/tools/compiletest/src/runtest.rs b/src/tools/compiletest/src/runtest.rs index 59fce44d1c7..eca21e55989 100644 --- a/src/tools/compiletest/src/runtest.rs +++ b/src/tools/compiletest/src/runtest.rs @@ -856,22 +856,10 @@ impl<'test> TestCx<'test> { } fn run_debuginfo_gdb_test_no_opt(&self) { - let prefixes = if self.config.gdb_native_rust { - // GDB with Rust - static PREFIXES: &[&str] = &["gdb", "gdbr"]; - println!("NOTE: compiletest thinks it is using GDB with native rust support"); - PREFIXES - } else { - // Generic GDB - static PREFIXES: &[&str] = &["gdb", "gdbg"]; - println!("NOTE: compiletest thinks it is using GDB without native rust support"); - PREFIXES - }; - let dbg_cmds = DebuggerCommands::parse_from( &self.testpaths.file, self.config, - prefixes, + &["gdb"], self.revision, ) .unwrap_or_else(|e| self.fatal(&e)); @@ -1053,9 +1041,7 @@ impl<'test> TestCx<'test> { .push_str(&format!("file {}\n", exe_file.to_str().unwrap().replace(r"\", r"\\"))); // Force GDB to print values in the Rust format. - if self.config.gdb_native_rust { - script_str.push_str("set language rust\n"); - } + script_str.push_str("set language rust\n"); // Add line breakpoints for line in &dbg_cmds.breakpoint_lines { @@ -1140,21 +1126,11 @@ impl<'test> TestCx<'test> { } } - let prefixes = if self.config.lldb_native_rust { - static PREFIXES: &[&str] = &["lldb", "lldbr"]; - println!("NOTE: compiletest thinks it is using LLDB with native rust support"); - PREFIXES - } else { - static PREFIXES: &[&str] = &["lldb", "lldbg"]; - println!("NOTE: compiletest thinks it is using LLDB without native rust support"); - PREFIXES - }; - // Parse debugger commands etc from test files let dbg_cmds = DebuggerCommands::parse_from( &self.testpaths.file, self.config, - prefixes, + &["lldb"], self.revision, ) .unwrap_or_else(|e| self.fatal(&e)); diff --git a/src/tools/compiletest/src/tests.rs b/src/tools/compiletest/src/tests.rs index 4292f234adc..7c2e7b0f023 100644 --- a/src/tools/compiletest/src/tests.rs +++ b/src/tools/compiletest/src/tests.rs @@ -48,12 +48,12 @@ fn test_extract_gdb_version() { #[test] fn test_extract_lldb_version() { // Apple variants - assert_eq!(extract_lldb_version("LLDB-179.5"), Some((179, false))); - assert_eq!(extract_lldb_version("lldb-300.2.51"), Some((300, false))); + assert_eq!(extract_lldb_version("LLDB-179.5"), Some(179)); + assert_eq!(extract_lldb_version("lldb-300.2.51"), Some(300)); // Upstream versions - assert_eq!(extract_lldb_version("lldb version 6.0.1"), Some((600, false))); - assert_eq!(extract_lldb_version("lldb version 9.0.0"), Some((900, false))); + assert_eq!(extract_lldb_version("lldb version 6.0.1"), Some(600)); + assert_eq!(extract_lldb_version("lldb version 9.0.0"), Some(900)); } #[test] diff --git a/src/tools/miri/rust-version b/src/tools/miri/rust-version index c3f4f4b5d82..1eca86baeaa 100644 --- a/src/tools/miri/rust-version +++ b/src/tools/miri/rust-version @@ -1 +1 @@ -f24a6ba06f4190d8ec4f22d1baa800e64b1900cb +fdf61d499c8a8421ecf98e7924bb87caf43a9938 diff --git a/src/tools/miri/src/eval.rs b/src/tools/miri/src/eval.rs index 0850a8f24d9..bb623c66892 100644 --- a/src/tools/miri/src/eval.rs +++ b/src/tools/miri/src/eval.rs @@ -458,7 +458,14 @@ pub fn eval_entry<'tcx>( panic::resume_unwind(panic_payload) }); // `Ok` can never happen. + #[cfg(not(bootstrap))] let Err(res) = res; + #[cfg(bootstrap)] + let res = match res { + Err(res) => res, + // `Ok` can never happen + Ok(never) => match never {}, + }; // Machine cleanup. Only do this if all threads have terminated; threads that are still running // might cause Stacked Borrows errors (https://github.com/rust-lang/miri/issues/2396). diff --git a/src/tools/miri/tests/fail/dangling_pointers/dangling_pointer_to_raw_pointer.rs b/src/tools/miri/tests/fail/dangling_pointers/dangling_pointer_to_raw_pointer.rs index 023bce1616b..3e20b8da622 100644 --- a/src/tools/miri/tests/fail/dangling_pointers/dangling_pointer_to_raw_pointer.rs +++ b/src/tools/miri/tests/fail/dangling_pointers/dangling_pointer_to_raw_pointer.rs @@ -1,4 +1,3 @@ -#![feature(raw_ref_op)] #![feature(strict_provenance)] use std::ptr; diff --git a/src/tools/miri/tests/fail/function_calls/return_pointer_aliasing_read.rs b/src/tools/miri/tests/fail/function_calls/return_pointer_aliasing_read.rs index c8e0782eff2..a6e0134bd17 100644 --- a/src/tools/miri/tests/fail/function_calls/return_pointer_aliasing_read.rs +++ b/src/tools/miri/tests/fail/function_calls/return_pointer_aliasing_read.rs @@ -1,7 +1,6 @@ //@revisions: stack tree none //@[tree]compile-flags: -Zmiri-tree-borrows //@[none]compile-flags: -Zmiri-disable-stacked-borrows -#![feature(raw_ref_op)] #![feature(core_intrinsics)] #![feature(custom_mir)] diff --git a/src/tools/miri/tests/fail/function_calls/return_pointer_aliasing_write.rs b/src/tools/miri/tests/fail/function_calls/return_pointer_aliasing_write.rs index 8de0b12b8b0..6155e925c4b 100644 --- a/src/tools/miri/tests/fail/function_calls/return_pointer_aliasing_write.rs +++ b/src/tools/miri/tests/fail/function_calls/return_pointer_aliasing_write.rs @@ -1,7 +1,6 @@ // This does need an aliasing model and protectors. //@revisions: stack tree //@[tree]compile-flags: -Zmiri-tree-borrows -#![feature(raw_ref_op)] #![feature(core_intrinsics)] #![feature(custom_mir)] diff --git a/src/tools/miri/tests/fail/function_calls/return_pointer_aliasing_write_tail_call.rs b/src/tools/miri/tests/fail/function_calls/return_pointer_aliasing_write_tail_call.rs index facc323bbc5..37ee7ae1b0d 100644 --- a/src/tools/miri/tests/fail/function_calls/return_pointer_aliasing_write_tail_call.rs +++ b/src/tools/miri/tests/fail/function_calls/return_pointer_aliasing_write_tail_call.rs @@ -1,7 +1,6 @@ // This does need an aliasing model and protectors. //@revisions: stack tree //@[tree]compile-flags: -Zmiri-tree-borrows -#![feature(raw_ref_op)] #![feature(core_intrinsics)] #![feature(custom_mir)] #![feature(explicit_tail_calls)] diff --git a/src/tools/miri/tests/fail/function_calls/return_pointer_on_unwind.rs b/src/tools/miri/tests/fail/function_calls/return_pointer_on_unwind.rs index 244acd8f2be..698a893f897 100644 --- a/src/tools/miri/tests/fail/function_calls/return_pointer_on_unwind.rs +++ b/src/tools/miri/tests/fail/function_calls/return_pointer_on_unwind.rs @@ -1,6 +1,5 @@ // Doesn't need an aliasing model. //@compile-flags: -Zmiri-disable-stacked-borrows -#![feature(raw_ref_op)] #![feature(core_intrinsics)] #![feature(custom_mir)] diff --git a/src/tools/miri/tests/pass/function_calls/return_place_on_heap.rs b/src/tools/miri/tests/pass/function_calls/return_place_on_heap.rs index a5cbe2a0d1d..04a55d7007c 100644 --- a/src/tools/miri/tests/pass/function_calls/return_place_on_heap.rs +++ b/src/tools/miri/tests/pass/function_calls/return_place_on_heap.rs @@ -1,4 +1,3 @@ -#![feature(raw_ref_op)] #![feature(core_intrinsics)] #![feature(custom_mir)] diff --git a/src/tools/run-make-support/Cargo.toml b/src/tools/run-make-support/Cargo.toml index eae6022b803..1a13d56b0e4 100644 --- a/src/tools/run-make-support/Cargo.toml +++ b/src/tools/run-make-support/Cargo.toml @@ -7,7 +7,7 @@ edition = "2021" bstr = "1.6.0" object = "0.36.2" similar = "2.5.0" -wasmparser = { version = "0.214", default-features = false, features = ["std"] } +wasmparser = { version = "0.215", default-features = false, features = ["std"] } regex = "1.8" # 1.8 to avoid memchr 2.6.0, as 2.5.0 is pinned in the workspace gimli = "0.31.0" build_helper = { path = "../build_helper" } diff --git a/src/tools/rustfmt/tests/target/unsafe_attributes.rs b/src/tools/rustfmt/tests/target/unsafe_attributes.rs index a05bedc751a..d79c56f2147 100644 --- a/src/tools/rustfmt/tests/target/unsafe_attributes.rs +++ b/src/tools/rustfmt/tests/target/unsafe_attributes.rs @@ -1,4 +1,3 @@ -#![feature(unsafe_attributes)] // https://github.com/rust-lang/rust/issues/123757 // #![simple_ident] diff --git a/src/tools/tidy/src/deps.rs b/src/tools/tidy/src/deps.rs index 89011bbb48f..28367f25267 100644 --- a/src/tools/tidy/src/deps.rs +++ b/src/tools/tidy/src/deps.rs @@ -98,13 +98,7 @@ const EXCEPTIONS: ExceptionList = &[ ("ryu", "Apache-2.0 OR BSL-1.0"), // BSL is not acceptble, but we use it under Apache-2.0 // cargo/... (because of serde) ("self_cell", "Apache-2.0"), // rustc (fluent translations) ("snap", "BSD-3-Clause"), // rustc - ("wasm-encoder", "Apache-2.0 WITH LLVM-exception"), // rustc - ("wasm-metadata", "Apache-2.0 WITH LLVM-exception"), // rustc - ("wasmparser", "Apache-2.0 WITH LLVM-exception"), // rustc - ("wast", "Apache-2.0 WITH LLVM-exception"), // rustc - ("wat", "Apache-2.0 WITH LLVM-exception"), // rustc - ("wit-component", "Apache-2.0 WITH LLVM-exception"), // rustc - ("wit-parser", "Apache-2.0 WITH LLVM-exception"), // rustc + ("wasi-preview1-component-adapter-provider", "Apache-2.0 WITH LLVM-exception"), // rustc // tidy-alphabetical-end ]; diff --git a/tests/codegen/is_val_statically_known.rs b/tests/codegen/is_val_statically_known.rs index 6af4f353a48..fe432d3bcc4 100644 --- a/tests/codegen/is_val_statically_known.rs +++ b/tests/codegen/is_val_statically_known.rs @@ -1,6 +1,7 @@ //@ compile-flags: --crate-type=lib -Zmerge-functions=disabled -O #![feature(core_intrinsics)] +#![feature(f16, f128)] use std::intrinsics::is_val_statically_known; @@ -49,7 +50,7 @@ pub fn _bool_false(b: bool) -> i32 { #[inline] pub fn _iref(a: &u8) -> i32 { - if unsafe { is_val_statically_known(a) } { 5 } else { 4 } + if is_val_statically_known(a) { 5 } else { 4 } } // CHECK-LABEL: @_iref_borrow( @@ -68,7 +69,7 @@ pub fn _iref_arg(a: &u8) -> i32 { #[inline] pub fn _slice_ref(a: &[u8]) -> i32 { - if unsafe { is_val_statically_known(a) } { 7 } else { 6 } + if is_val_statically_known(a) { 7 } else { 6 } } // CHECK-LABEL: @_slice_ref_borrow( @@ -84,3 +85,79 @@ pub fn _slice_ref_arg(a: &[u8]) -> i32 { // CHECK: ret i32 6 _slice_ref(a) } + +#[inline] +pub fn _f16(a: f16) -> i32 { + if is_val_statically_known(a) { 1 } else { 0 } +} + +// CHECK-LABEL: @_f16_true( +#[no_mangle] +pub fn _f16_true() -> i32 { + // CHECK: ret i32 1 + _f16(1.0) +} + +// CHECK-LABEL: @_f16_false( +#[no_mangle] +pub fn _f16_false(a: f16) -> i32 { + // CHECK: ret i32 0 + _f16(a) +} + +#[inline] +pub fn _f32(a: f32) -> i32 { + if is_val_statically_known(a) { 1 } else { 0 } +} + +// CHECK-LABEL: @_f32_true( +#[no_mangle] +pub fn _f32_true() -> i32 { + // CHECK: ret i32 1 + _f32(1.0) +} + +// CHECK-LABEL: @_f32_false( +#[no_mangle] +pub fn _f32_false(a: f32) -> i32 { + // CHECK: ret i32 0 + _f32(a) +} + +#[inline] +pub fn _f64(a: f64) -> i32 { + if is_val_statically_known(a) { 1 } else { 0 } +} + +// CHECK-LABEL: @_f64_true( +#[no_mangle] +pub fn _f64_true() -> i32 { + // CHECK: ret i32 1 + _f64(1.0) +} + +// CHECK-LABEL: @_f64_false( +#[no_mangle] +pub fn _f64_false(a: f64) -> i32 { + // CHECK: ret i32 0 + _f64(a) +} + +#[inline] +pub fn _f128(a: f128) -> i32 { + if is_val_statically_known(a) { 1 } else { 0 } +} + +// CHECK-LABEL: @_f128_true( +#[no_mangle] +pub fn _f128_true() -> i32 { + // CHECK: ret i32 1 + _f128(1.0) +} + +// CHECK-LABEL: @_f128_false( +#[no_mangle] +pub fn _f128_false(a: f128) -> i32 { + // CHECK: ret i32 0 + _f128(a) +} diff --git a/tests/crashes/128810.rs b/tests/crashes/128810.rs deleted file mode 100644 index 68214ff010c..00000000000 --- a/tests/crashes/128810.rs +++ /dev/null @@ -1,25 +0,0 @@ -//@ known-bug: rust-lang/rust#128810 - -#![feature(fn_delegation)] - -use std::marker::PhantomData; - -pub struct InvariantRef<'a, T: ?Sized>(&'a T, PhantomData<&'a mut &'a T>); - -impl<'a> InvariantRef<'a, ()> { - pub const NEW: Self = InvariantRef::new(&()); -} - -trait Trait { - fn foo(&self) -> u8 { 0 } - fn bar(&self) -> u8 { 1 } - fn meh(&self) -> u8 { 2 } -} - -struct Z(u8); - -impl Trait for Z { - reuse <u8 as Trait>::{foo, bar, meh} { &const { InvariantRef::<'a>::NEW } } -} - -fn main() { } diff --git a/tests/crashes/129150.rs b/tests/crashes/129150.rs new file mode 100644 index 00000000000..9f8c2ba1739 --- /dev/null +++ b/tests/crashes/129150.rs @@ -0,0 +1,7 @@ +//@ known-bug: rust-lang/rust#129150 +//@ only-x86_64 +use std::arch::x86_64::_mm_blend_ps; + +pub fn main() { + _mm_blend_ps(1, 2, &const {} ); +} diff --git a/tests/crashes/129166.rs b/tests/crashes/129166.rs new file mode 100644 index 00000000000..d3635d410db --- /dev/null +++ b/tests/crashes/129166.rs @@ -0,0 +1,7 @@ +//@ known-bug: rust-lang/rust#129166 + +fn main() { + #[cfg_eval] + #[cfg] + 0 +} diff --git a/tests/crashes/129205.rs b/tests/crashes/129205.rs new file mode 100644 index 00000000000..f328fca247a --- /dev/null +++ b/tests/crashes/129205.rs @@ -0,0 +1,5 @@ +//@ known-bug: rust-lang/rust#129205 + +fn x<T: Copy>() { + T::try_from(); +} diff --git a/tests/crashes/129209.rs b/tests/crashes/129209.rs new file mode 100644 index 00000000000..249fa41552e --- /dev/null +++ b/tests/crashes/129209.rs @@ -0,0 +1,11 @@ +//@ known-bug: rust-lang/rust#129209 + +impl< + const N: usize = { + static || { + Foo([0; X]); + } + }, + > PartialEq for True +{ +} diff --git a/tests/crashes/129214.rs b/tests/crashes/129214.rs new file mode 100644 index 00000000000..e14b9f379d6 --- /dev/null +++ b/tests/crashes/129214.rs @@ -0,0 +1,30 @@ +//@ known-bug: rust-lang/rust#129214 +//@ compile-flags: -Zvalidate-mir -Copt-level=3 --crate-type=lib + +trait to_str {} + +trait map<T> { + fn map<U, F>(&self, f: F) -> Vec<U> + where + F: FnMut(&Box<usize>) -> U; +} +impl<T> map<T> for Vec<T> { + fn map<U, F>(&self, mut f: F) -> Vec<U> + where + F: FnMut(&T) -> U, + { + let mut r = Vec::new(); + for i in self { + r.push(f(i)); + } + r + } +} + +fn foo<U, T: map<U>>(x: T) -> Vec<String> { + x.map(|_e| "hi".to_string()) +} + +pub fn main() { + assert_eq!(foo(vec![1]), ["hi".to_string()]); +} diff --git a/tests/crashes/129216.rs b/tests/crashes/129216.rs new file mode 100644 index 00000000000..0ad6bc5c71b --- /dev/null +++ b/tests/crashes/129216.rs @@ -0,0 +1,12 @@ +//@ known-bug: rust-lang/rust#129216 +//@ only-linux + +trait Mirror { + type Assoc; +} + +struct Foo; + +fn main() { + <Foo as Mirror>::Assoc::new(); +} diff --git a/tests/crashes/129219.rs b/tests/crashes/129219.rs new file mode 100644 index 00000000000..effbfcd8b8e --- /dev/null +++ b/tests/crashes/129219.rs @@ -0,0 +1,26 @@ +//@ known-bug: rust-lang/rust#129219 +//@ compile-flags: -Zmir-opt-level=5 -Zvalidate-mir --edition=2018 + +use core::marker::Unsize; + +pub trait CastTo<T: ?Sized>: Unsize<T> {} + +impl<T: ?Sized, U: ?Sized> CastTo<T> for U {} + +impl<T: ?Sized> Cast for T {} +pub trait Cast { + fn cast<T: ?Sized>(&self) -> &T + where + Self: CastTo<T>, + { + self + } +} + +pub trait Foo {} +impl Foo for [i32; 0] {} + +fn main() { + let x: &dyn Foo = &[]; + let x = x.cast::<[i32]>(); +} diff --git a/tests/debuginfo/associated-types.rs b/tests/debuginfo/associated-types.rs index d1d4e320b05..b20bd520936 100644 --- a/tests/debuginfo/associated-types.rs +++ b/tests/debuginfo/associated-types.rs @@ -1,15 +1,10 @@ -// Some versions of the non-rust-enabled LLDB print the wrong generic -// parameter type names in this test. -//@ needs-rust-lldb - //@ compile-flags:-g // === GDB TESTS =================================================================================== // gdb-command:run // gdb-command:print arg -// gdbg-check:$1 = {b = -1, b1 = 0} -// gdbr-check:$1 = associated_types::Struct<i32> {b: -1, b1: 0} +// gdb-check:$1 = associated_types::Struct<i32> {b: -1, b1: 0} // gdb-command:continue // gdb-command:print inferred @@ -23,8 +18,7 @@ // gdb-command:continue // gdb-command:print arg -// gdbg-check:$5 = {__0 = 4, __1 = 5} -// gdbr-check:$5 = (4, 5) +// gdb-check:$5 = (4, 5) // gdb-command:continue // gdb-command:print a @@ -43,42 +37,33 @@ // lldb-command:run // lldb-command:v arg -// lldbg-check:[...] { b = -1, b1 = 0 } -// lldbr-check:(associated_types::Struct<i32>) arg = { b = -1, b1 = 0 } +// lldb-check:[...] { b = -1 b1 = 0 } // lldb-command:continue // lldb-command:v inferred -// lldbg-check:[...] 1 -// lldbr-check:(i64) inferred = 1 +// lldb-check:[...] 1 // lldb-command:v explicitly -// lldbg-check:[...] 1 -// lldbr-check:(i64) explicitly = 1 +// lldb-check:[...] 1 // lldb-command:continue // lldb-command:v arg -// lldbg-check:[...] 2 -// lldbr-check:(i64) arg = 2 +// lldb-check:[...] 2 // lldb-command:continue // lldb-command:v arg -// lldbg-check:[...] (4, 5) -// lldbr-check:((i32, i64)) arg = { = 4 = 5 } +// lldb-check:[...] { 0 = 4 1 = 5 } // lldb-command:continue // lldb-command:v a -// lldbg-check:[...] 6 -// lldbr-check:(i32) a = 6 +// lldb-check:[...] 6 // lldb-command:v b -// lldbg-check:[...] 7 -// lldbr-check:(i64) b = 7 +// lldb-check:[...] 7 // lldb-command:continue // lldb-command:v a -// lldbg-check:[...] 8 -// lldbr-check:(i64) a = 8 +// lldb-check:[...] 8 // lldb-command:v b -// lldbg-check:[...] 9 -// lldbr-check:(i32) b = 9 +// lldb-check:[...] 9 // lldb-command:continue #![allow(unused_variables)] diff --git a/tests/debuginfo/basic-types-globals-metadata.rs b/tests/debuginfo/basic-types-globals-metadata.rs index 13678c31e76..53fc550a2dc 100644 --- a/tests/debuginfo/basic-types-globals-metadata.rs +++ b/tests/debuginfo/basic-types-globals-metadata.rs @@ -1,51 +1,35 @@ -//@ min-lldb-version: 310 - //@ compile-flags:-g + // gdb-command:run -// gdbg-command:whatis 'basic_types_globals_metadata::B' -// gdbr-command:whatis basic_types_globals_metadata::B +// gdb-command:whatis basic_types_globals_metadata::B // gdb-check:type = bool -// gdbg-command:whatis 'basic_types_globals_metadata::I' -// gdbr-command:whatis basic_types_globals_metadata::I +// gdb-command:whatis basic_types_globals_metadata::I // gdb-check:type = isize -// gdbg-command:whatis 'basic_types_globals_metadata::C' -// gdbr-command:whatis basic_types_globals_metadata::C +// gdb-command:whatis basic_types_globals_metadata::C // gdb-check:type = char -// gdbg-command:whatis 'basic_types_globals_metadata::I8' -// gdbr-command:whatis basic_types_globals_metadata::I8 +// gdb-command:whatis basic_types_globals_metadata::I8 // gdb-check:type = i8 -// gdbg-command:whatis 'basic_types_globals_metadata::I16' -// gdbr-command:whatis basic_types_globals_metadata::I16 +// gdb-command:whatis basic_types_globals_metadata::I16 // gdb-check:type = i16 -// gdbg-command:whatis 'basic_types_globals_metadata::I32' -// gdbr-command:whatis basic_types_globals_metadata::I32 +// gdb-command:whatis basic_types_globals_metadata::I32 // gdb-check:type = i32 -// gdbg-command:whatis 'basic_types_globals_metadata::I64' -// gdbr-command:whatis basic_types_globals_metadata::I64 +// gdb-command:whatis basic_types_globals_metadata::I64 // gdb-check:type = i64 -// gdbg-command:whatis 'basic_types_globals_metadata::U' -// gdbr-command:whatis basic_types_globals_metadata::U +// gdb-command:whatis basic_types_globals_metadata::U // gdb-check:type = usize -// gdbg-command:whatis 'basic_types_globals_metadata::U8' -// gdbr-command:whatis basic_types_globals_metadata::U8 +// gdb-command:whatis basic_types_globals_metadata::U8 // gdb-check:type = u8 -// gdbg-command:whatis 'basic_types_globals_metadata::U16' -// gdbr-command:whatis basic_types_globals_metadata::U16 +// gdb-command:whatis basic_types_globals_metadata::U16 // gdb-check:type = u16 -// gdbg-command:whatis 'basic_types_globals_metadata::U32' -// gdbr-command:whatis basic_types_globals_metadata::U32 +// gdb-command:whatis basic_types_globals_metadata::U32 // gdb-check:type = u32 -// gdbg-command:whatis 'basic_types_globals_metadata::U64' -// gdbr-command:whatis basic_types_globals_metadata::U64 +// gdb-command:whatis basic_types_globals_metadata::U64 // gdb-check:type = u64 -// gdbg-command:whatis 'basic_types_globals_metadata::F16' -// gdbr-command:whatis basic_types_globals_metadata::F16 +// gdb-command:whatis basic_types_globals_metadata::F16 // gdb-check:type = f16 -// gdbg-command:whatis 'basic_types_globals_metadata::F32' -// gdbr-command:whatis basic_types_globals_metadata::F32 +// gdb-command:whatis basic_types_globals_metadata::F32 // gdb-check:type = f32 -// gdbg-command:whatis 'basic_types_globals_metadata::F64' -// gdbr-command:whatis basic_types_globals_metadata::F64 +// gdb-command:whatis basic_types_globals_metadata::F64 // gdb-check:type = f64 // gdb-command:continue diff --git a/tests/debuginfo/basic-types-globals.rs b/tests/debuginfo/basic-types-globals.rs index 0425d14fa5a..41b69939650 100644 --- a/tests/debuginfo/basic-types-globals.rs +++ b/tests/debuginfo/basic-types-globals.rs @@ -1,9 +1,3 @@ -// Caveat - gdb doesn't know about UTF-32 character encoding and will print a -// rust char as only its numerical value. - -//@ min-lldb-version: 310 -//@ min-gdb-version: 8.0 - //@ revisions: lto no-lto //@ compile-flags:-g @@ -12,51 +6,35 @@ //@ [lto] no-prefer-dynamic // gdb-command:run -// gdbg-command:print 'basic_types_globals::B' -// gdbr-command:print B +// gdb-command:print B // gdb-check:$1 = false -// gdbg-command:print 'basic_types_globals::I' -// gdbr-command:print I +// gdb-command:print I // gdb-check:$2 = -1 -// gdbg-command:print 'basic_types_globals::C' -// gdbr-command:print/d C -// gdbg-check:$3 = 97 -// gdbr-check:$3 = 97 -// gdbg-command:print/d 'basic_types_globals::I8' -// gdbr-command:print I8 +// gdb-command:print/d C +// gdb-check:$3 = 97 +// gdb-command:print I8 // gdb-check:$4 = 68 -// gdbg-command:print 'basic_types_globals::I16' -// gdbr-command:print I16 +// gdb-command:print I16 // gdb-check:$5 = -16 -// gdbg-command:print 'basic_types_globals::I32' -// gdbr-command:print I32 +// gdb-command:print I32 // gdb-check:$6 = -32 -// gdbg-command:print 'basic_types_globals::I64' -// gdbr-command:print I64 +// gdb-command:print I64 // gdb-check:$7 = -64 -// gdbg-command:print 'basic_types_globals::U' -// gdbr-command:print U +// gdb-command:print U // gdb-check:$8 = 1 -// gdbg-command:print/d 'basic_types_globals::U8' -// gdbr-command:print U8 +// gdb-command:print U8 // gdb-check:$9 = 100 -// gdbg-command:print 'basic_types_globals::U16' -// gdbr-command:print U16 +// gdb-command:print U16 // gdb-check:$10 = 16 -// gdbg-command:print 'basic_types_globals::U32' -// gdbr-command:print U32 +// gdb-command:print U32 // gdb-check:$11 = 32 -// gdbg-command:print 'basic_types_globals::U64' -// gdbr-command:print U64 +// gdb-command:print U64 // gdb-check:$12 = 64 -// gdbg-command:print 'basic_types_globals::F16' -// gdbr-command:print F16 +// gdb-command:print F16 // gdb-check:$13 = 1.5 -// gdbg-command:print 'basic_types_globals::F32' -// gdbr-command:print F32 +// gdb-command:print F32 // gdb-check:$14 = 2.5 -// gdbg-command:print 'basic_types_globals::F64' -// gdbr-command:print F64 +// gdb-command:print F64 // gdb-check:$15 = 3.5 // gdb-command:continue diff --git a/tests/debuginfo/basic-types-metadata.rs b/tests/debuginfo/basic-types-metadata.rs index 3aebf2577b6..6b7cfbdebca 100644 --- a/tests/debuginfo/basic-types-metadata.rs +++ b/tests/debuginfo/basic-types-metadata.rs @@ -1,6 +1,5 @@ -//@ min-lldb-version: 310 - //@ compile-flags:-g + // gdb-command:run // gdb-command:whatis unit // gdb-check:type = () @@ -37,29 +36,18 @@ // gdb-command:whatis fnptr // gdb-check:type = *mut fn () // gdb-command:info functions _yyy -// gdbg-check:[...]![...]_yyy([...]); -// gdbr-check:static fn basic_types_metadata::_yyy(); +// gdb-check:static fn basic_types_metadata::_yyy(); // gdb-command:ptype closure_0 -// gdbr-check: type = struct basic_types_metadata::main::{closure_env#0} -// gdbg-check: type = struct closure { -// gdbg-check: <no data fields> -// gdbg-check: } +// gdb-check: type = struct basic_types_metadata::main::{closure_env#0} // gdb-command:ptype closure_1 -// gdbg-check: type = struct closure { -// gdbg-check: bool *__0; -// gdbg-check: } -// gdbr-check: type = struct basic_types_metadata::main::{closure_env#1} { -// gdbr-check: *mut bool, -// gdbr-check: } +// gdb-check: type = struct basic_types_metadata::main::{closure_env#1} { +// gdb-check: *mut bool, +// gdb-check: } // gdb-command:ptype closure_2 -// gdbg-check: type = struct closure { -// gdbg-check: bool *__0; -// gdbg-check: isize *__1; -// gdbg-check: } -// gdbr-check: type = struct basic_types_metadata::main::{closure_env#2} { -// gdbr-check: *mut bool, -// gdbr-check: *mut isize, -// gdbr-check: } +// gdb-check: type = struct basic_types_metadata::main::{closure_env#2} { +// gdb-check: *mut bool, +// gdb-check: *mut isize, +// gdb-check: } // // gdb-command:continue diff --git a/tests/debuginfo/basic-types-mut-globals.rs b/tests/debuginfo/basic-types-mut-globals.rs index c676fd73771..f6a2399d230 100644 --- a/tests/debuginfo/basic-types-mut-globals.rs +++ b/tests/debuginfo/basic-types-mut-globals.rs @@ -4,107 +4,73 @@ // about UTF-32 character encoding and will print a rust char as only // its numerical value. -//@ min-lldb-version: 310 - //@ compile-flags:-g // gdb-command:run // Check initializers -// gdbg-command:print 'basic_types_mut_globals::B' -// gdbr-command:print B +// gdb-command:print B // gdb-check:$1 = false -// gdbg-command:print 'basic_types_mut_globals::I' -// gdbr-command:print I +// gdb-command:print I // gdb-check:$2 = -1 -// gdbg-command:print/d 'basic_types_mut_globals::C' -// gdbr-command:print C -// gdbg-check:$3 = 97 -// gdbr-check:$3 = 97 'a' -// gdbg-command:print/d 'basic_types_mut_globals::I8' -// gdbr-command:print I8 +// gdb-command:print C +// gdb-check:$3 = 97 'a' +// gdb-command:print I8 // gdb-check:$4 = 68 -// gdbg-command:print 'basic_types_mut_globals::I16' -// gdbr-command:print I16 +// gdb-command:print I16 // gdb-check:$5 = -16 -// gdbg-command:print 'basic_types_mut_globals::I32' -// gdbr-command:print I32 +// gdb-command:print I32 // gdb-check:$6 = -32 -// gdbg-command:print 'basic_types_mut_globals::I64' -// gdbr-command:print I64 +// gdb-command:print I64 // gdb-check:$7 = -64 -// gdbg-command:print 'basic_types_mut_globals::U' -// gdbr-command:print U +// gdb-command:print U // gdb-check:$8 = 1 -// gdbg-command:print/d 'basic_types_mut_globals::U8' -// gdbr-command:print U8 +// gdb-command:print U8 // gdb-check:$9 = 100 -// gdbg-command:print 'basic_types_mut_globals::U16' -// gdbr-command:print U16 +// gdb-command:print U16 // gdb-check:$10 = 16 -// gdbg-command:print 'basic_types_mut_globals::U32' -// gdbr-command:print U32 +// gdb-command:print U32 // gdb-check:$11 = 32 -// gdbg-command:print 'basic_types_mut_globals::U64' -// gdbr-command:print U64 +// gdb-command:print U64 // gdb-check:$12 = 64 -// gdbg-command:print 'basic_types_mut_globals::F16' -// gdbr-command:print F16 +// gdb-command:print F16 // gdb-check:$13 = 1.5 -// gdbg-command:print 'basic_types_mut_globals::F32' -// gdbr-command:print F32 +// gdb-command:print F32 // gdb-check:$14 = 2.5 -// gdbg-command:print 'basic_types_mut_globals::F64' -// gdbr-command:print F64 +// gdb-command:print F64 // gdb-check:$15 = 3.5 // gdb-command:continue // Check new values -// gdbg-command:print 'basic_types_mut_globals'::B -// gdbr-command:print B +// gdb-command:print B // gdb-check:$16 = true -// gdbg-command:print 'basic_types_mut_globals'::I -// gdbr-command:print I +// gdb-command:print I // gdb-check:$17 = 2 -// gdbg-command:print/d 'basic_types_mut_globals'::C -// gdbr-command:print C -// gdbg-check:$18 = 102 -// gdbr-check:$18 = 102 'f' -// gdbg-command:print/d 'basic_types_mut_globals'::I8 -// gdbr-command:print/d I8 +// gdb-command:print C +// gdb-check:$18 = 102 'f' +// gdb-command:print/d I8 // gdb-check:$19 = 78 -// gdbg-command:print 'basic_types_mut_globals'::I16 -// gdbr-command:print I16 +// gdb-command:print I16 // gdb-check:$20 = -26 -// gdbg-command:print 'basic_types_mut_globals'::I32 -// gdbr-command:print I32 +// gdb-command:print I32 // gdb-check:$21 = -12 -// gdbg-command:print 'basic_types_mut_globals'::I64 -// gdbr-command:print I64 +// gdb-command:print I64 // gdb-check:$22 = -54 -// gdbg-command:print 'basic_types_mut_globals'::U -// gdbr-command:print U +// gdb-command:print U // gdb-check:$23 = 5 -// gdbg-command:print/d 'basic_types_mut_globals'::U8 -// gdbr-command:print/d U8 +// gdb-command:print/d U8 // gdb-check:$24 = 20 -// gdbg-command:print 'basic_types_mut_globals'::U16 -// gdbr-command:print U16 +// gdb-command:print U16 // gdb-check:$25 = 32 -// gdbg-command:print 'basic_types_mut_globals'::U32 -// gdbr-command:print U32 +// gdb-command:print U32 // gdb-check:$26 = 16 -// gdbg-command:print 'basic_types_mut_globals'::U64 -// gdbr-command:print U64 +// gdb-command:print U64 // gdb-check:$27 = 128 -// gdbg-command:print 'basic_types_mut_globals'::F16 -// gdbr-command:print F16 +// gdb-command:print F16 // gdb-check:$28 = 2.25 -// gdbg-command:print 'basic_types_mut_globals'::F32 -// gdbr-command:print F32 +// gdb-command:print F32 // gdb-check:$29 = 5.75 -// gdbg-command:print 'basic_types_mut_globals'::F64 -// gdbr-command:print F64 +// gdb-command:print F64 // gdb-check:$30 = 9.25 #![allow(unused_variables)] diff --git a/tests/debuginfo/basic-types.rs b/tests/debuginfo/basic-types.rs index d836525240a..fea5262bc41 100644 --- a/tests/debuginfo/basic-types.rs +++ b/tests/debuginfo/basic-types.rs @@ -4,8 +4,6 @@ // about UTF-32 character encoding and will print a rust char as only // its numerical value. -//@ min-lldb-version: 310 - //@ compile-flags:-g // === GDB TESTS =================================================================================== @@ -16,8 +14,7 @@ // gdb-command:print i // gdb-check:$2 = -1 // gdb-command:print c -// gdbg-check:$3 = 97 -// gdbr-check:$3 = 97 'a' +// gdb-check:$3 = 97 'a' // gdb-command:print/d i8 // gdb-check:$4 = 68 // gdb-command:print i16 @@ -43,56 +40,38 @@ // gdb-command:print f64 // gdb-check:$15 = 3.5 // gdb-command:print s -// gdbg-check:$16 = {data_ptr = [...] "Hello, World!", length = 13} -// gdbr-check:$16 = "Hello, World!" +// gdb-check:$16 = "Hello, World!" // === LLDB TESTS ================================================================================== // lldb-command:run // lldb-command:v b -// lldbg-check:[...] false -// lldbr-check:(bool) b = false +// lldb-check:[...] false // lldb-command:v i -// lldbg-check:[...] -1 -// lldbr-check:(isize) i = -1 - -// NOTE: only rust-enabled lldb supports 32bit chars -// lldbr-command:print c -// lldbr-check:(char) c = 'a' +// lldb-check:[...] -1 // lldb-command:v i8 -// lldbg-check:[...] 'D' -// lldbr-check:(i8) i8 = 68 +// lldb-check:[...] 'D' // lldb-command:v i16 -// lldbg-check:[...] -16 -// lldbr-check:(i16) i16 = -16 +// lldb-check:[...] -16 // lldb-command:v i32 -// lldbg-check:[...] -32 -// lldbr-check:(i32) i32 = -32 +// lldb-check:[...] -32 // lldb-command:v i64 -// lldbg-check:[...] -64 -// lldbr-check:(i64) i64 = -64 +// lldb-check:[...] -64 // lldb-command:v u -// lldbg-check:[...] 1 -// lldbr-check:(usize) u = 1 +// lldb-check:[...] 1 // lldb-command:v u8 -// lldbg-check:[...] 'd' -// lldbr-check:(u8) u8 = 100 +// lldb-check:[...] 'd' // lldb-command:v u16 -// lldbg-check:[...] 16 -// lldbr-check:(u16) u16 = 16 +// lldb-check:[...] 16 // lldb-command:v u32 -// lldbg-check:[...] 32 -// lldbr-check:(u32) u32 = 32 +// lldb-check:[...] 32 // lldb-command:v u64 -// lldbg-check:[...] 64 -// lldbr-check:(u64) u64 = 64 +// lldb-check:[...] 64 // lldb-command:v f32 -// lldbg-check:[...] 2.5 -// lldbr-check:(f32) f32 = 2.5 +// lldb-check:[...] 2.5 // lldb-command:v f64 -// lldbg-check:[...] 3.5 -// lldbr-check:(f64) f64 = 3.5 +// lldb-check:[...] 3.5 // === CDB TESTS =================================================================================== diff --git a/tests/debuginfo/borrowed-basic.rs b/tests/debuginfo/borrowed-basic.rs index e3cf74dab1e..91de691e78e 100644 --- a/tests/debuginfo/borrowed-basic.rs +++ b/tests/debuginfo/borrowed-basic.rs @@ -1,5 +1,4 @@ //@ compile-flags:-g -//@ min-lldb-version: 310 // === GDB TESTS =================================================================================== @@ -14,8 +13,7 @@ // gdb-check:$3 = 97 // gdb-command:print *i8_ref -// gdbg-check:$4 = 68 'D' -// gdbr-check:$4 = 68 +// gdb-check:$4 = 68 // gdb-command:print *i16_ref // gdb-check:$5 = -16 @@ -30,8 +28,7 @@ // gdb-check:$8 = 1 // gdb-command:print *u8_ref -// gdbg-check:$9 = 100 'd' -// gdbr-check:$9 = 100 +// gdb-check:$9 = 100 // gdb-command:print *u16_ref // gdb-check:$10 = 16 @@ -56,64 +53,47 @@ // lldb-command:run // lldb-command:v *bool_ref -// lldbg-check:[...] true -// lldbr-check:(bool) *bool_ref = true +// lldb-check:[...] true // lldb-command:v *int_ref -// lldbg-check:[...] -1 -// lldbr-check:(isize) *int_ref = -1 +// lldb-check:[...] -1 -// NOTE: only rust-enabled lldb supports 32bit chars -// lldbr-command:print *char_ref -// lldbr-check:(char) *char_ref = 'a' // lldb-command:v *i8_ref -// lldbg-check:[...] 'D' -// lldbr-check:(i8) *i8_ref = 68 +// lldb-check:[...] 'D' // lldb-command:v *i16_ref -// lldbg-check:[...] -16 -// lldbr-check:(i16) *i16_ref = -16 +// lldb-check:[...] -16 // lldb-command:v *i32_ref -// lldbg-check:[...] -32 -// lldbr-check:(i32) *i32_ref = -32 +// lldb-check:[...] -32 // lldb-command:v *i64_ref -// lldbg-check:[...] -64 -// lldbr-check:(i64) *i64_ref = -64 +// lldb-check:[...] -64 // lldb-command:v *uint_ref -// lldbg-check:[...] 1 -// lldbr-check:(usize) *uint_ref = 1 +// lldb-check:[...] 1 // lldb-command:v *u8_ref -// lldbg-check:[...] 'd' -// lldbr-check:(u8) *u8_ref = 100 +// lldb-check:[...] 'd' // lldb-command:v *u16_ref -// lldbg-check:[...] 16 -// lldbr-check:(u16) *u16_ref = 16 +// lldb-check:[...] 16 // lldb-command:v *u32_ref -// lldbg-check:[...] 32 -// lldbr-check:(u32) *u32_ref = 32 +// lldb-check:[...] 32 // lldb-command:v *u64_ref -// lldbg-check:[...] 64 -// lldbr-check:(u64) *u64_ref = 64 +// lldb-check:[...] 64 // lldb-command:v *f16_ref -// lldbg-check:[...] 1.5 -// lldbr-check:(f16) *f16_ref = 1.5 +// lldb-check:[...] 1.5 // lldb-command:v *f32_ref -// lldbg-check:[...] 2.5 -// lldbr-check:(f32) *f32_ref = 2.5 +// lldb-check:[...] 2.5 // lldb-command:v *f64_ref -// lldbg-check:[...] 3.5 -// lldbr-check:(f64) *f64_ref = 3.5 +// lldb-check:[...] 3.5 #![allow(unused_variables)] #![feature(omit_gdb_pretty_printer_section)] diff --git a/tests/debuginfo/borrowed-c-style-enum.rs b/tests/debuginfo/borrowed-c-style-enum.rs index 1a582e8a6d9..6a91d4f9650 100644 --- a/tests/debuginfo/borrowed-c-style-enum.rs +++ b/tests/debuginfo/borrowed-c-style-enum.rs @@ -1,21 +1,17 @@ //@ compile-flags:-g -//@ min-lldb-version: 310 // === GDB TESTS =================================================================================== // gdb-command:run // gdb-command:print *the_a_ref -// gdbg-check:$1 = TheA -// gdbr-check:$1 = borrowed_c_style_enum::ABC::TheA +// gdb-check:$1 = borrowed_c_style_enum::ABC::TheA // gdb-command:print *the_b_ref -// gdbg-check:$2 = TheB -// gdbr-check:$2 = borrowed_c_style_enum::ABC::TheB +// gdb-check:$2 = borrowed_c_style_enum::ABC::TheB // gdb-command:print *the_c_ref -// gdbg-check:$3 = TheC -// gdbr-check:$3 = borrowed_c_style_enum::ABC::TheC +// gdb-check:$3 = borrowed_c_style_enum::ABC::TheC // === LLDB TESTS ================================================================================== @@ -23,16 +19,13 @@ // lldb-command:run // lldb-command:v *the_a_ref -// lldbg-check:[...] TheA -// lldbr-check:(borrowed_c_style_enum::ABC) *the_a_ref = borrowed_c_style_enum::ABC::TheA +// lldb-check:[...] TheA // lldb-command:v *the_b_ref -// lldbg-check:[...] TheB -// lldbr-check:(borrowed_c_style_enum::ABC) *the_b_ref = borrowed_c_style_enum::ABC::TheB +// lldb-check:[...] TheB // lldb-command:v *the_c_ref -// lldbg-check:[...] TheC -// lldbr-check:(borrowed_c_style_enum::ABC) *the_c_ref = borrowed_c_style_enum::ABC::TheC +// lldb-check:[...] TheC #![allow(unused_variables)] #![feature(omit_gdb_pretty_printer_section)] diff --git a/tests/debuginfo/borrowed-enum.rs b/tests/debuginfo/borrowed-enum.rs index fc2ab62a21c..c5a795fdede 100644 --- a/tests/debuginfo/borrowed-enum.rs +++ b/tests/debuginfo/borrowed-enum.rs @@ -1,5 +1,3 @@ -// Require a gdb or lldb that can read DW_TAG_variant_part. -//@ min-gdb-version: 8.2 //@ min-lldb-version: 1800 //@ compile-flags:-g @@ -9,13 +7,13 @@ // gdb-command:run // gdb-command:print *the_a_ref -// gdbr-check:$1 = borrowed_enum::ABC::TheA{x: 0, y: 8970181431921507452} +// gdb-check:$1 = borrowed_enum::ABC::TheA{x: 0, y: 8970181431921507452} // gdb-command:print *the_b_ref -// gdbr-check:$2 = borrowed_enum::ABC::TheB(0, 286331153, 286331153) +// gdb-check:$2 = borrowed_enum::ABC::TheB(0, 286331153, 286331153) // gdb-command:print *univariant_ref -// gdbr-check:$3 = borrowed_enum::Univariant::TheOnlyCase(4820353753753434) +// gdb-check:$3 = borrowed_enum::Univariant::TheOnlyCase(4820353753753434) // === LLDB TESTS ================================================================================== @@ -23,14 +21,11 @@ // lldb-command:run // lldb-command:v *the_a_ref -// lldbg-check:(borrowed_enum::ABC) *the_a_ref = { value = { x = 0 y = 8970181431921507452 } $discr$ = 0 } -// lldbr-check:(borrowed_enum::ABC::TheA) *the_a_ref = TheA { TheA: 0, TheB: 8970181431921507452 } +// lldb-check:(borrowed_enum::ABC) *the_a_ref = { value = { x = 0 y = 8970181431921507452 } $discr$ = 0 } // lldb-command:v *the_b_ref -// lldbg-check:(borrowed_enum::ABC) *the_b_ref = { value = { 0 = 0 1 = 286331153 2 = 286331153 } $discr$ = 1 } -// lldbr-check:(borrowed_enum::ABC::TheB) *the_b_ref = { = 0 = 286331153 = 286331153 } +// lldb-check:(borrowed_enum::ABC) *the_b_ref = { value = { 0 = 0 1 = 286331153 2 = 286331153 } $discr$ = 1 } // lldb-command:v *univariant_ref -// lldbg-check:(borrowed_enum::Univariant) *univariant_ref = { value = { 0 = 4820353753753434 } } -// lldbr-check:(borrowed_enum::Univariant) *univariant_ref = { TheOnlyCase = { = 4820353753753434 } } +// lldb-check:(borrowed_enum::Univariant) *univariant_ref = { value = { 0 = 4820353753753434 } } #![allow(unused_variables)] #![feature(omit_gdb_pretty_printer_section)] diff --git a/tests/debuginfo/borrowed-struct.rs b/tests/debuginfo/borrowed-struct.rs index d108a29592b..245af35f505 100644 --- a/tests/debuginfo/borrowed-struct.rs +++ b/tests/debuginfo/borrowed-struct.rs @@ -1,13 +1,11 @@ //@ compile-flags:-g -//@ min-lldb-version: 310 // === GDB TESTS =================================================================================== // gdb-command:run // gdb-command:print *stack_val_ref -// gdbg-check:$1 = {x = 10, y = 23.5} -// gdbr-check:$1 = borrowed_struct::SomeStruct {x: 10, y: 23.5} +// gdb-check:$1 = borrowed_struct::SomeStruct {x: 10, y: 23.5} // gdb-command:print *stack_val_interior_ref_1 // gdb-check:$2 = 10 @@ -16,12 +14,10 @@ // gdb-check:$3 = 23.5 // gdb-command:print *ref_to_unnamed -// gdbg-check:$4 = {x = 11, y = 24.5} -// gdbr-check:$4 = borrowed_struct::SomeStruct {x: 11, y: 24.5} +// gdb-check:$4 = borrowed_struct::SomeStruct {x: 11, y: 24.5} // gdb-command:print *unique_val_ref -// gdbg-check:$5 = {x = 13, y = 26.5} -// gdbr-check:$5 = borrowed_struct::SomeStruct {x: 13, y: 26.5} +// gdb-check:$5 = borrowed_struct::SomeStruct {x: 13, y: 26.5} // gdb-command:print *unique_val_interior_ref_1 // gdb-check:$6 = 13 @@ -35,32 +31,25 @@ // lldb-command:run // lldb-command:v *stack_val_ref -// lldbg-check:[...] { x = 10 y = 23.5 } -// lldbr-check:(borrowed_struct::SomeStruct) *stack_val_ref = (x = 10, y = 23.5) +// lldb-check:[...] { x = 10 y = 23.5 } // lldb-command:v *stack_val_interior_ref_1 -// lldbg-check:[...] 10 -// lldbr-check:(isize) *stack_val_interior_ref_1 = 10 +// lldb-check:[...] 10 // lldb-command:v *stack_val_interior_ref_2 -// lldbg-check:[...] 23.5 -// lldbr-check:(f64) *stack_val_interior_ref_2 = 23.5 +// lldb-check:[...] 23.5 // lldb-command:v *ref_to_unnamed -// lldbg-check:[...] { x = 11 y = 24.5 } -// lldbr-check:(borrowed_struct::SomeStruct) *ref_to_unnamed = (x = 11, y = 24.5) +// lldb-check:[...] { x = 11 y = 24.5 } // lldb-command:v *unique_val_ref -// lldbg-check:[...] { x = 13 y = 26.5 } -// lldbr-check:(borrowed_struct::SomeStruct) *unique_val_ref = (x = 13, y = 26.5) +// lldb-check:[...] { x = 13 y = 26.5 } // lldb-command:v *unique_val_interior_ref_1 -// lldbg-check:[...] 13 -// lldbr-check:(isize) *unique_val_interior_ref_1 = 13 +// lldb-check:[...] 13 // lldb-command:v *unique_val_interior_ref_2 -// lldbg-check:[...] 26.5 -// lldbr-check:(f64) *unique_val_interior_ref_2 = 26.5 +// lldb-check:[...] 26.5 #![allow(unused_variables)] #![feature(omit_gdb_pretty_printer_section)] diff --git a/tests/debuginfo/borrowed-tuple.rs b/tests/debuginfo/borrowed-tuple.rs index 4c5643deb9d..9e4ceec033e 100644 --- a/tests/debuginfo/borrowed-tuple.rs +++ b/tests/debuginfo/borrowed-tuple.rs @@ -1,5 +1,3 @@ -//@ min-lldb-version: 310 - //@ compile-flags:-g // === GDB TESTS =================================================================================== @@ -7,16 +5,13 @@ // gdb-command:run // gdb-command:print *stack_val_ref -// gdbg-check:$1 = {__0 = -14, __1 = -19} -// gdbr-check:$1 = (-14, -19) +// gdb-check:$1 = (-14, -19) // gdb-command:print *ref_to_unnamed -// gdbg-check:$2 = {__0 = -15, __1 = -20} -// gdbr-check:$2 = (-15, -20) +// gdb-check:$2 = (-15, -20) // gdb-command:print *unique_val_ref -// gdbg-check:$3 = {__0 = -17, __1 = -22} -// gdbr-check:$3 = (-17, -22) +// gdb-check:$3 = (-17, -22) // === LLDB TESTS ================================================================================== @@ -24,16 +19,13 @@ // lldb-command:run // lldb-command:v *stack_val_ref -// lldbg-check:[...] { 0 = -14 1 = -19 } -// lldbr-check:((i16, f32)) *stack_val_ref = { 0 = -14 1 = -19 } +// lldb-check:[...] { 0 = -14 1 = -19 } // lldb-command:v *ref_to_unnamed -// lldbg-check:[...] { 0 = -15 1 = -20 } -// lldbr-check:((i16, f32)) *ref_to_unnamed = { 0 = -15 1 = -20 } +// lldb-check:[...] { 0 = -15 1 = -20 } // lldb-command:v *unique_val_ref -// lldbg-check:[...] { 0 = -17 1 = -22 } -// lldbr-check:((i16, f32)) *unique_val_ref = { 0 = -17 1 = -22 } +// lldb-check:[...] { 0 = -17 1 = -22 } #![allow(unused_variables)] diff --git a/tests/debuginfo/borrowed-unique-basic.rs b/tests/debuginfo/borrowed-unique-basic.rs index e952ec8cebb..7a9b4d1df82 100644 --- a/tests/debuginfo/borrowed-unique-basic.rs +++ b/tests/debuginfo/borrowed-unique-basic.rs @@ -1,5 +1,3 @@ -//@ min-lldb-version: 310 - //@ compile-flags:-g // === GDB TESTS =================================================================================== @@ -59,64 +57,47 @@ // lldb-command:run // lldb-command:v *bool_ref -// lldbg-check:[...] true -// lldbr-check:(bool) *bool_ref = true +// lldb-check:[...] true // lldb-command:v *int_ref -// lldbg-check:[...] -1 -// lldbr-check:(isize) *int_ref = -1 +// lldb-check:[...] -1 -// NOTE: only rust-enabled lldb supports 32bit chars -// lldbr-command:print *char_ref -// lldbr-check:(char) *char_ref = 97 // lldb-command:v *i8_ref -// lldbg-check:[...] 68 -// lldbr-check:(i8) *i8_ref = 68 +// lldb-check:[...] 68 // lldb-command:v *i16_ref -// lldbg-check:[...] -16 -// lldbr-check:(i16) *i16_ref = -16 +// lldb-check:[...] -16 // lldb-command:v *i32_ref -// lldbg-check:[...] -32 -// lldbr-check:(i32) *i32_ref = -32 +// lldb-check:[...] -32 // lldb-command:v *i64_ref -// lldbg-check:[...] -64 -// lldbr-check:(i64) *i64_ref = -64 +// lldb-check:[...] -64 // lldb-command:v *uint_ref -// lldbg-check:[...] 1 -// lldbr-check:(usize) *uint_ref = 1 +// lldb-check:[...] 1 // lldb-command:v *u8_ref -// lldbg-check:[...] 100 -// lldbr-check:(u8) *u8_ref = 100 +// lldb-check:[...] 100 // lldb-command:v *u16_ref -// lldbg-check:[...] 16 -// lldbr-check:(u16) *u16_ref = 16 +// lldb-check:[...] 16 // lldb-command:v *u32_ref -// lldbg-check:[...] 32 -// lldbr-check:(u32) *u32_ref = 32 +// lldb-check:[...] 32 // lldb-command:v *u64_ref -// lldbg-check:[...] 64 -// lldbr-check:(u64) *u64_ref = 64 +// lldb-check:[...] 64 // lldb-command:v *f16_ref -// lldbg-check:[...] 1.5 -// lldbr-check:(f16) *f16_ref = 1.5 +// lldb-check:[...] 1.5 // lldb-command:v *f32_ref -// lldbg-check:[...] 2.5 -// lldbr-check:(f32) *f32_ref = 2.5 +// lldb-check:[...] 2.5 // lldb-command:v *f64_ref -// lldbg-check:[...] 3.5 -// lldbr-check:(f64) *f64_ref = 3.5 +// lldb-check:[...] 3.5 #![allow(unused_variables)] #![feature(omit_gdb_pretty_printer_section)] diff --git a/tests/debuginfo/box.rs b/tests/debuginfo/box.rs index 46019bcb1a7..d22566c0b17 100644 --- a/tests/debuginfo/box.rs +++ b/tests/debuginfo/box.rs @@ -1,5 +1,3 @@ -//@ min-lldb-version: 310 - //@ compile-flags:-g // === GDB TESTS =================================================================================== @@ -9,19 +7,16 @@ // gdb-command:print *a // gdb-check:$1 = 1 // gdb-command:print *b -// gdbg-check:$2 = {__0 = 2, __1 = 3.5} -// gdbr-check:$2 = (2, 3.5) +// gdb-check:$2 = (2, 3.5) // === LLDB TESTS ================================================================================== // lldb-command:run // lldb-command:v *a -// lldbg-check:[...] 1 -// lldbr-check:(i32) *a = 1 +// lldb-check:[...] 1 // lldb-command:v *b -// lldbg-check:[...] { 0 = 2 1 = 3.5 } -// lldbr-check:((i32, f64)) *b = { 0 = 2 1 = 3.5 } +// lldb-check:[...] { 0 = 2 1 = 3.5 } #![allow(unused_variables)] #![feature(omit_gdb_pretty_printer_section)] diff --git a/tests/debuginfo/boxed-struct.rs b/tests/debuginfo/boxed-struct.rs index 1ee639690ea..158609fb2ed 100644 --- a/tests/debuginfo/boxed-struct.rs +++ b/tests/debuginfo/boxed-struct.rs @@ -1,5 +1,3 @@ -//@ min-lldb-version: 310 - //@ compile-flags:-g // === GDB TESTS =================================================================================== @@ -7,12 +5,10 @@ // gdb-command:run // gdb-command:print *boxed_with_padding -// gdbg-check:$1 = {x = 99, y = 999, z = 9999, w = 99999} -// gdbr-check:$1 = boxed_struct::StructWithSomePadding {x: 99, y: 999, z: 9999, w: 99999} +// gdb-check:$1 = boxed_struct::StructWithSomePadding {x: 99, y: 999, z: 9999, w: 99999} // gdb-command:print *boxed_with_dtor -// gdbg-check:$2 = {x = 77, y = 777, z = 7777, w = 77777} -// gdbr-check:$2 = boxed_struct::StructWithDestructor {x: 77, y: 777, z: 7777, w: 77777} +// gdb-check:$2 = boxed_struct::StructWithDestructor {x: 77, y: 777, z: 7777, w: 77777} // === LLDB TESTS ================================================================================== @@ -20,12 +16,10 @@ // lldb-command:run // lldb-command:v *boxed_with_padding -// lldbg-check:[...] { x = 99 y = 999 z = 9999 w = 99999 } -// lldbr-check:(boxed_struct::StructWithSomePadding) *boxed_with_padding = { x = 99 y = 999 z = 9999 w = 99999 } +// lldb-check:[...] { x = 99 y = 999 z = 9999 w = 99999 } // lldb-command:v *boxed_with_dtor -// lldbg-check:[...] { x = 77 y = 777 z = 7777 w = 77777 } -// lldbr-check:(boxed_struct::StructWithDestructor) *boxed_with_dtor = { x = 77 y = 777 z = 7777 w = 77777 } +// lldb-check:[...] { x = 77 y = 777 z = 7777 w = 77777 } #![allow(unused_variables)] #![feature(omit_gdb_pretty_printer_section)] diff --git a/tests/debuginfo/by-value-non-immediate-argument.rs b/tests/debuginfo/by-value-non-immediate-argument.rs index 68717b79533..f0a39a45195 100644 --- a/tests/debuginfo/by-value-non-immediate-argument.rs +++ b/tests/debuginfo/by-value-non-immediate-argument.rs @@ -7,13 +7,11 @@ // gdb-command:run // gdb-command:print s -// gdbg-check:$1 = {a = 1, b = 2.5} -// gdbr-check:$1 = by_value_non_immediate_argument::Struct {a: 1, b: 2.5} +// gdb-check:$1 = by_value_non_immediate_argument::Struct {a: 1, b: 2.5} // gdb-command:continue // gdb-command:print x -// gdbg-check:$2 = {a = 3, b = 4.5} -// gdbr-check:$2 = by_value_non_immediate_argument::Struct {a: 3, b: 4.5} +// gdb-check:$2 = by_value_non_immediate_argument::Struct {a: 3, b: 4.5} // gdb-command:print y // gdb-check:$3 = 5 // gdb-command:print z @@ -21,18 +19,15 @@ // gdb-command:continue // gdb-command:print a -// gdbg-check:$5 = {__0 = 7, __1 = 8, __2 = 9.5, __3 = 10.5} -// gdbr-check:$5 = (7, 8, 9.5, 10.5) +// gdb-check:$5 = (7, 8, 9.5, 10.5) // gdb-command:continue // gdb-command:print a -// gdbg-check:$6 = {__0 = 11.5, __1 = 12.5, __2 = 13, __3 = 14} -// gdbr-check:$6 = by_value_non_immediate_argument::Newtype (11.5, 12.5, 13, 14) +// gdb-check:$6 = by_value_non_immediate_argument::Newtype (11.5, 12.5, 13, 14) // gdb-command:continue // gdb-command:print x -// gdbg-check:$7 = {{RUST$ENUM$DISR = Case1, x = 0, y = 8970181431921507452}, {RUST$ENUM$DISR = Case1, [...]}} -// gdbr-check:$7 = by_value_non_immediate_argument::Enum::Case1{x: 0, y: 8970181431921507452} +// gdb-check:$7 = by_value_non_immediate_argument::Enum::Case1{x: 0, y: 8970181431921507452} // gdb-command:continue diff --git a/tests/debuginfo/by-value-self-argument-in-trait-impl.rs b/tests/debuginfo/by-value-self-argument-in-trait-impl.rs index 5276ec82733..6981fdfc9e1 100644 --- a/tests/debuginfo/by-value-self-argument-in-trait-impl.rs +++ b/tests/debuginfo/by-value-self-argument-in-trait-impl.rs @@ -1,5 +1,3 @@ -//@ min-lldb-version: 310 - //@ compile-flags:-g // === GDB TESTS =================================================================================== @@ -11,13 +9,11 @@ // gdb-command:continue // gdb-command:print self -// gdbg-check:$2 = {x = 2222, y = 3333} -// gdbr-check:$2 = by_value_self_argument_in_trait_impl::Struct {x: 2222, y: 3333} +// gdb-check:$2 = by_value_self_argument_in_trait_impl::Struct {x: 2222, y: 3333} // gdb-command:continue // gdb-command:print self -// gdbg-check:$3 = {__0 = 4444.5, __1 = 5555, __2 = 6666, __3 = 7777.5} -// gdbr-check:$3 = (4444.5, 5555, 6666, 7777.5) +// gdb-check:$3 = (4444.5, 5555, 6666, 7777.5) // gdb-command:continue @@ -26,18 +22,15 @@ // lldb-command:run // lldb-command:v self -// lldbg-check:[...] 1111 -// lldbr-check:(isize) self = 1111 +// lldb-check:[...] 1111 // lldb-command:continue // lldb-command:v self -// lldbg-check:[...] { x = 2222 y = 3333 } -// lldbr-check:(by_value_self_argument_in_trait_impl::Struct) self = { x = 2222 y = 3333 } +// lldb-check:[...] { x = 2222 y = 3333 } // lldb-command:continue // lldb-command:v self -// lldbg-check:[...] { 0 = 4444.5 1 = 5555 2 = 6666 3 = 7777.5 } -// lldbr-check:((f64, isize, isize, f64)) self = { 0 = 4444.5 1 = 5555 2 = 6666 3 = 7777.5 } +// lldb-check:[...] { 0 = 4444.5 1 = 5555 2 = 6666 3 = 7777.5 } // lldb-command:continue #![feature(omit_gdb_pretty_printer_section)] diff --git a/tests/debuginfo/c-style-enum-in-composite.rs b/tests/debuginfo/c-style-enum-in-composite.rs index ec11d5f4655..642879cf3b6 100644 --- a/tests/debuginfo/c-style-enum-in-composite.rs +++ b/tests/debuginfo/c-style-enum-in-composite.rs @@ -1,5 +1,3 @@ -//@ min-lldb-version: 310 - //@ compile-flags:-g // === GDB TESTS =================================================================================== @@ -7,64 +5,50 @@ // gdb-command:run // gdb-command:print tuple_interior_padding -// gdbg-check:$1 = {__0 = 0, __1 = OneHundred} -// gdbr-check:$1 = (0, c_style_enum_in_composite::AnEnum::OneHundred) +// gdb-check:$1 = (0, c_style_enum_in_composite::AnEnum::OneHundred) // gdb-command:print tuple_padding_at_end -// gdbg-check:$2 = {__0 = {__0 = 1, __1 = OneThousand}, __1 = 2} -// gdbr-check:$2 = ((1, c_style_enum_in_composite::AnEnum::OneThousand), 2) +// gdb-check:$2 = ((1, c_style_enum_in_composite::AnEnum::OneThousand), 2) // gdb-command:print tuple_different_enums -// gdbg-check:$3 = {__0 = OneThousand, __1 = MountainView, __2 = OneMillion, __3 = Vienna} -// gdbr-check:$3 = (c_style_enum_in_composite::AnEnum::OneThousand, c_style_enum_in_composite::AnotherEnum::MountainView, c_style_enum_in_composite::AnEnum::OneMillion, c_style_enum_in_composite::AnotherEnum::Vienna) +// gdb-check:$3 = (c_style_enum_in_composite::AnEnum::OneThousand, c_style_enum_in_composite::AnotherEnum::MountainView, c_style_enum_in_composite::AnEnum::OneMillion, c_style_enum_in_composite::AnotherEnum::Vienna) // gdb-command:print padded_struct -// gdbg-check:$4 = {a = 3, b = OneMillion, c = 4, d = Toronto, e = 5} -// gdbr-check:$4 = c_style_enum_in_composite::PaddedStruct {a: 3, b: c_style_enum_in_composite::AnEnum::OneMillion, c: 4, d: c_style_enum_in_composite::AnotherEnum::Toronto, e: 5} +// gdb-check:$4 = c_style_enum_in_composite::PaddedStruct {a: 3, b: c_style_enum_in_composite::AnEnum::OneMillion, c: 4, d: c_style_enum_in_composite::AnotherEnum::Toronto, e: 5} // gdb-command:print packed_struct -// gdbg-check:$5 = {a = 6, b = OneHundred, c = 7, d = Vienna, e = 8} -// gdbr-check:$5 = c_style_enum_in_composite::PackedStruct {a: 6, b: c_style_enum_in_composite::AnEnum::OneHundred, c: 7, d: c_style_enum_in_composite::AnotherEnum::Vienna, e: 8} +// gdb-check:$5 = c_style_enum_in_composite::PackedStruct {a: 6, b: c_style_enum_in_composite::AnEnum::OneHundred, c: 7, d: c_style_enum_in_composite::AnotherEnum::Vienna, e: 8} // gdb-command:print non_padded_struct -// gdbg-check:$6 = {a = OneMillion, b = MountainView, c = OneThousand, d = Toronto} -// gdbr-check:$6 = c_style_enum_in_composite::NonPaddedStruct {a: c_style_enum_in_composite::AnEnum::OneMillion, b: c_style_enum_in_composite::AnotherEnum::MountainView, c: c_style_enum_in_composite::AnEnum::OneThousand, d: c_style_enum_in_composite::AnotherEnum::Toronto} +// gdb-check:$6 = c_style_enum_in_composite::NonPaddedStruct {a: c_style_enum_in_composite::AnEnum::OneMillion, b: c_style_enum_in_composite::AnotherEnum::MountainView, c: c_style_enum_in_composite::AnEnum::OneThousand, d: c_style_enum_in_composite::AnotherEnum::Toronto} // gdb-command:print struct_with_drop -// gdbg-check:$7 = {__0 = {a = OneHundred, b = Vienna}, __1 = 9} -// gdbr-check:$7 = (c_style_enum_in_composite::StructWithDrop {a: c_style_enum_in_composite::AnEnum::OneHundred, b: c_style_enum_in_composite::AnotherEnum::Vienna}, 9) +// gdb-check:$7 = (c_style_enum_in_composite::StructWithDrop {a: c_style_enum_in_composite::AnEnum::OneHundred, b: c_style_enum_in_composite::AnotherEnum::Vienna}, 9) // === LLDB TESTS ================================================================================== // lldb-command:run // lldb-command:v tuple_interior_padding -// lldbg-check:[...] { 0 = 0 1 = OneHundred } -// lldbr-check:((i16, c_style_enum_in_composite::AnEnum)) tuple_interior_padding = { 0 = 0 1 = OneHundred } +// lldb-check:[...] { 0 = 0 1 = OneHundred } // lldb-command:v tuple_padding_at_end -// lldbg-check:[...] { 0 = { 0 = 1 1 = OneThousand } 1 = 2 } -// lldbr-check:(((u64, c_style_enum_in_composite::AnEnum), u64)) tuple_padding_at_end = { 0 = { 0 = 1 1 = OneThousand } 1 = 2 } +// lldb-check:[...] { 0 = { 0 = 1 1 = OneThousand } 1 = 2 } // lldb-command:v tuple_different_enums -// lldbg-check:[...] { 0 = OneThousand 1 = MountainView 2 = OneMillion 3 = Vienna } -// lldbr-check:((c_style_enum_in_composite::AnEnum, c_style_enum_in_composite::AnotherEnum, c_style_enum_in_composite::AnEnum, c_style_enum_in_composite::AnotherEnum)) tuple_different_enums = { 0 = c_style_enum_in_composite::AnEnum::OneThousand 1 = c_style_enum_in_composite::AnotherEnum::MountainView 2 = c_style_enum_in_composite::AnEnum::OneMillion 3 = c_style_enum_in_composite::AnotherEnum::Vienna } +// lldb-check:[...] { 0 = OneThousand 1 = MountainView 2 = OneMillion 3 = Vienna } // lldb-command:v padded_struct -// lldbg-check:[...] { a = 3 b = OneMillion c = 4 d = Toronto e = 5 } -// lldbr-check:(c_style_enum_in_composite::PaddedStruct) padded_struct = { a = 3 b = c_style_enum_in_composite::AnEnum::OneMillion c = 4 d = Toronto e = 5 } +// lldb-check:[...] { a = 3 b = OneMillion c = 4 d = Toronto e = 5 } // lldb-command:v packed_struct -// lldbg-check:[...] { a = 6 b = OneHundred c = 7 d = Vienna e = 8 } -// lldbr-check:(c_style_enum_in_composite::PackedStruct) packed_struct = { a = 6 b = c_style_enum_in_composite::AnEnum::OneHundred c = 7 d = Vienna e = 8 } +// lldb-check:[...] { a = 6 b = OneHundred c = 7 d = Vienna e = 8 } // lldb-command:v non_padded_struct -// lldbg-check:[...] { a = OneMillion b = MountainView c = OneThousand d = Toronto } -// lldbr-check:(c_style_enum_in_composite::NonPaddedStruct) non_padded_struct = { a = c_style_enum_in_composite::AnEnum::OneMillion, b = c_style_enum_in_composite::AnotherEnum::MountainView, c = c_style_enum_in_composite::AnEnum::OneThousand, d = c_style_enum_in_composite::AnotherEnum::Toronto } +// lldb-check:[...] { a = OneMillion b = MountainView c = OneThousand d = Toronto } // lldb-command:v struct_with_drop -// lldbg-check:[...] { 0 = { a = OneHundred b = Vienna } 1 = 9 } -// lldbr-check:((c_style_enum_in_composite::StructWithDrop, i64)) struct_with_drop = { 0 = { a = c_style_enum_in_composite::AnEnum::OneHundred b = c_style_enum_in_composite::AnotherEnum::Vienna } 1 = 9 } +// lldb-check:[...] { 0 = { a = OneHundred b = Vienna } 1 = 9 } #![allow(unused_variables)] #![feature(omit_gdb_pretty_printer_section)] diff --git a/tests/debuginfo/c-style-enum.rs b/tests/debuginfo/c-style-enum.rs index 2ab5d5ccf2c..08378f7af18 100644 --- a/tests/debuginfo/c-style-enum.rs +++ b/tests/debuginfo/c-style-enum.rs @@ -1,94 +1,64 @@ //@ ignore-aarch64 -//@ min-lldb-version: 310 //@ compile-flags:-g // === GDB TESTS =================================================================================== -// gdbg-command:print 'c_style_enum::SINGLE_VARIANT' -// gdbr-command:print c_style_enum::SINGLE_VARIANT -// gdbg-check:$1 = TheOnlyVariant -// gdbr-check:$1 = c_style_enum::SingleVariant::TheOnlyVariant - -// gdbg-command:print 'c_style_enum::AUTO_ONE' -// gdbr-command:print c_style_enum::AUTO_ONE -// gdbg-check:$2 = One -// gdbr-check:$2 = c_style_enum::AutoDiscriminant::One - -// gdbg-command:print 'c_style_enum::AUTO_TWO' -// gdbr-command:print c_style_enum::AUTO_TWO -// gdbg-check:$3 = One -// gdbr-check:$3 = c_style_enum::AutoDiscriminant::One - -// gdbg-command:print 'c_style_enum::AUTO_THREE' -// gdbr-command:print c_style_enum::AUTO_THREE -// gdbg-check:$4 = One -// gdbr-check:$4 = c_style_enum::AutoDiscriminant::One - -// gdbg-command:print 'c_style_enum::MANUAL_ONE' -// gdbr-command:print c_style_enum::MANUAL_ONE -// gdbg-check:$5 = OneHundred -// gdbr-check:$5 = c_style_enum::ManualDiscriminant::OneHundred - -// gdbg-command:print 'c_style_enum::MANUAL_TWO' -// gdbr-command:print c_style_enum::MANUAL_TWO -// gdbg-check:$6 = OneHundred -// gdbr-check:$6 = c_style_enum::ManualDiscriminant::OneHundred - -// gdbg-command:print 'c_style_enum::MANUAL_THREE' -// gdbr-command:print c_style_enum::MANUAL_THREE -// gdbg-check:$7 = OneHundred -// gdbr-check:$7 = c_style_enum::ManualDiscriminant::OneHundred +// gdb-command:print c_style_enum::SINGLE_VARIANT +// gdb-check:$1 = c_style_enum::SingleVariant::TheOnlyVariant + +// gdb-command:print c_style_enum::AUTO_ONE +// gdb-check:$2 = c_style_enum::AutoDiscriminant::One + +// gdb-command:print c_style_enum::AUTO_TWO +// gdb-check:$3 = c_style_enum::AutoDiscriminant::One + +// gdb-command:print c_style_enum::AUTO_THREE +// gdb-check:$4 = c_style_enum::AutoDiscriminant::One + +// gdb-command:print c_style_enum::MANUAL_ONE +// gdb-check:$5 = c_style_enum::ManualDiscriminant::OneHundred + +// gdb-command:print c_style_enum::MANUAL_TWO +// gdb-check:$6 = c_style_enum::ManualDiscriminant::OneHundred + +// gdb-command:print c_style_enum::MANUAL_THREE +// gdb-check:$7 = c_style_enum::ManualDiscriminant::OneHundred // gdb-command:run // gdb-command:print auto_one -// gdbg-check:$8 = One -// gdbr-check:$8 = c_style_enum::AutoDiscriminant::One +// gdb-check:$8 = c_style_enum::AutoDiscriminant::One // gdb-command:print auto_two -// gdbg-check:$9 = Two -// gdbr-check:$9 = c_style_enum::AutoDiscriminant::Two +// gdb-check:$9 = c_style_enum::AutoDiscriminant::Two // gdb-command:print auto_three -// gdbg-check:$10 = Three -// gdbr-check:$10 = c_style_enum::AutoDiscriminant::Three +// gdb-check:$10 = c_style_enum::AutoDiscriminant::Three // gdb-command:print manual_one_hundred -// gdbg-check:$11 = OneHundred -// gdbr-check:$11 = c_style_enum::ManualDiscriminant::OneHundred +// gdb-check:$11 = c_style_enum::ManualDiscriminant::OneHundred // gdb-command:print manual_one_thousand -// gdbg-check:$12 = OneThousand -// gdbr-check:$12 = c_style_enum::ManualDiscriminant::OneThousand +// gdb-check:$12 = c_style_enum::ManualDiscriminant::OneThousand // gdb-command:print manual_one_million -// gdbg-check:$13 = OneMillion -// gdbr-check:$13 = c_style_enum::ManualDiscriminant::OneMillion +// gdb-check:$13 = c_style_enum::ManualDiscriminant::OneMillion // gdb-command:print single_variant -// gdbg-check:$14 = TheOnlyVariant -// gdbr-check:$14 = c_style_enum::SingleVariant::TheOnlyVariant +// gdb-check:$14 = c_style_enum::SingleVariant::TheOnlyVariant -// gdbg-command:print 'c_style_enum::AUTO_TWO' -// gdbr-command:print AUTO_TWO -// gdbg-check:$15 = Two -// gdbr-check:$15 = c_style_enum::AutoDiscriminant::Two +// gdb-command:print AUTO_TWO +// gdb-check:$15 = c_style_enum::AutoDiscriminant::Two -// gdbg-command:print 'c_style_enum::AUTO_THREE' -// gdbr-command:print AUTO_THREE -// gdbg-check:$16 = Three -// gdbr-check:$16 = c_style_enum::AutoDiscriminant::Three +// gdb-command:print AUTO_THREE +// gdb-check:$16 = c_style_enum::AutoDiscriminant::Three -// gdbg-command:print 'c_style_enum::MANUAL_TWO' -// gdbr-command:print MANUAL_TWO -// gdbg-check:$17 = OneThousand -// gdbr-check:$17 = c_style_enum::ManualDiscriminant::OneThousand +// gdb-command:print MANUAL_TWO +// gdb-check:$17 = c_style_enum::ManualDiscriminant::OneThousand -// gdbg-command:print 'c_style_enum::MANUAL_THREE' -// gdbr-command:print MANUAL_THREE -// gdbg-check:$18 = OneMillion -// gdbr-check:$18 = c_style_enum::ManualDiscriminant::OneMillion +// gdb-command:print MANUAL_THREE +// gdb-check:$18 = c_style_enum::ManualDiscriminant::OneMillion // === LLDB TESTS ================================================================================== @@ -96,32 +66,25 @@ // lldb-command:run // lldb-command:v auto_one -// lldbg-check:[...] One -// lldbr-check:(c_style_enum::AutoDiscriminant) auto_one = c_style_enum::AutoDiscriminant::One +// lldb-check:[...] One // lldb-command:v auto_two -// lldbg-check:[...] Two -// lldbr-check:(c_style_enum::AutoDiscriminant) auto_two = c_style_enum::AutoDiscriminant::Two +// lldb-check:[...] Two // lldb-command:v auto_three -// lldbg-check:[...] Three -// lldbr-check:(c_style_enum::AutoDiscriminant) auto_three = c_style_enum::AutoDiscriminant::Three +// lldb-check:[...] Three // lldb-command:v manual_one_hundred -// lldbg-check:[...] OneHundred -// lldbr-check:(c_style_enum::ManualDiscriminant) manual_one_hundred = c_style_enum::ManualDiscriminant::OneHundred +// lldb-check:[...] OneHundred // lldb-command:v manual_one_thousand -// lldbg-check:[...] OneThousand -// lldbr-check:(c_style_enum::ManualDiscriminant) manual_one_thousand = c_style_enum::ManualDiscriminant::OneThousand +// lldb-check:[...] OneThousand // lldb-command:v manual_one_million -// lldbg-check:[...] OneMillion -// lldbr-check:(c_style_enum::ManualDiscriminant) manual_one_million = c_style_enum::ManualDiscriminant::OneMillion +// lldb-check:[...] OneMillion // lldb-command:v single_variant -// lldbg-check:[...] TheOnlyVariant -// lldbr-check:(c_style_enum::SingleVariant) single_variant = c_style_enum::SingleVariant::TheOnlyVariant +// lldb-check:[...] TheOnlyVariant #![allow(unused_variables)] #![allow(dead_code)] diff --git a/tests/debuginfo/captured-fields-1.rs b/tests/debuginfo/captured-fields-1.rs index d96f2590570..69ca3ecd812 100644 --- a/tests/debuginfo/captured-fields-1.rs +++ b/tests/debuginfo/captured-fields-1.rs @@ -4,44 +4,44 @@ // gdb-command:run // gdb-command:print test -// gdbr-check:$1 = captured_fields_1::main::{closure_env#0} {_ref__my_ref__my_field1: 0x[...]} +// gdb-check:$1 = captured_fields_1::main::{closure_env#0} {_ref__my_ref__my_field1: 0x[...]} // gdb-command:continue // gdb-command:print test -// gdbr-check:$2 = captured_fields_1::main::{closure_env#1} {_ref__my_ref__my_field2: 0x[...]} +// gdb-check:$2 = captured_fields_1::main::{closure_env#1} {_ref__my_ref__my_field2: 0x[...]} // gdb-command:continue // gdb-command:print test -// gdbr-check:$3 = captured_fields_1::main::{closure_env#2} {_ref__my_ref: 0x[...]} +// gdb-check:$3 = captured_fields_1::main::{closure_env#2} {_ref__my_ref: 0x[...]} // gdb-command:continue // gdb-command:print test -// gdbr-check:$4 = captured_fields_1::main::{closure_env#3} {my_ref: 0x[...]} +// gdb-check:$4 = captured_fields_1::main::{closure_env#3} {my_ref: 0x[...]} // gdb-command:continue // gdb-command:print test -// gdbr-check:$5 = captured_fields_1::main::{closure_env#4} {my_var__my_field2: 22} +// gdb-check:$5 = captured_fields_1::main::{closure_env#4} {my_var__my_field2: 22} // gdb-command:continue // gdb-command:print test -// gdbr-check:$6 = captured_fields_1::main::{closure_env#5} {my_var: captured_fields_1::MyStruct {my_field1: 11, my_field2: 22}} +// gdb-check:$6 = captured_fields_1::main::{closure_env#5} {my_var: captured_fields_1::MyStruct {my_field1: 11, my_field2: 22}} // gdb-command:continue // === LLDB TESTS ================================================================================== // lldb-command:run // lldb-command:v test -// lldbg-check:(captured_fields_1::main::{closure_env#0}) test = { _ref__my_ref__my_field1 = 0x[...] } +// lldb-check:(captured_fields_1::main::{closure_env#0}) test = { _ref__my_ref__my_field1 = 0x[...] } // lldb-command:continue // lldb-command:v test -// lldbg-check:(captured_fields_1::main::{closure_env#1}) test = { _ref__my_ref__my_field2 = 0x[...] } +// lldb-check:(captured_fields_1::main::{closure_env#1}) test = { _ref__my_ref__my_field2 = 0x[...] } // lldb-command:continue // lldb-command:v test -// lldbg-check:(captured_fields_1::main::{closure_env#2}) test = { _ref__my_ref = 0x[...] } +// lldb-check:(captured_fields_1::main::{closure_env#2}) test = { _ref__my_ref = 0x[...] } // lldb-command:continue // lldb-command:v test -// lldbg-check:(captured_fields_1::main::{closure_env#3}) test = { my_ref = 0x[...] } +// lldb-check:(captured_fields_1::main::{closure_env#3}) test = { my_ref = 0x[...] } // lldb-command:continue // lldb-command:v test -// lldbg-check:(captured_fields_1::main::{closure_env#4}) test = { my_var__my_field2 = 22 } +// lldb-check:(captured_fields_1::main::{closure_env#4}) test = { my_var__my_field2 = 22 } // lldb-command:continue // lldb-command:v test -// lldbg-check:(captured_fields_1::main::{closure_env#5}) test = { my_var = { my_field1 = 11 my_field2 = 22 } } +// lldb-check:(captured_fields_1::main::{closure_env#5}) test = { my_var = { my_field1 = 11 my_field2 = 22 } } // lldb-command:continue #![allow(unused)] diff --git a/tests/debuginfo/captured-fields-2.rs b/tests/debuginfo/captured-fields-2.rs index 446c5c70fef..24bff1d3f35 100644 --- a/tests/debuginfo/captured-fields-2.rs +++ b/tests/debuginfo/captured-fields-2.rs @@ -4,20 +4,20 @@ // gdb-command:run // gdb-command:print my_ref__my_field1 -// gdbr-check:$1 = 11 +// gdb-check:$1 = 11 // gdb-command:continue // gdb-command:print my_var__my_field2 -// gdbr-check:$2 = 22 +// gdb-check:$2 = 22 // gdb-command:continue // === LLDB TESTS ================================================================================== // lldb-command:run // lldb-command:v my_ref__my_field1 -// lldbg-check:(unsigned int) my_ref__my_field1 = 11 +// lldb-check:(unsigned int) my_ref__my_field1 = 11 // lldb-command:continue // lldb-command:v my_var__my_field2 -// lldbg-check:(unsigned int) my_var__my_field2 = 22 +// lldb-check:(unsigned int) my_var__my_field2 = 22 // lldb-command:continue #![allow(unused)] diff --git a/tests/debuginfo/closure-in-generic-function.rs b/tests/debuginfo/closure-in-generic-function.rs index ef0f2b0b464..0c6a6fdfca1 100644 --- a/tests/debuginfo/closure-in-generic-function.rs +++ b/tests/debuginfo/closure-in-generic-function.rs @@ -1,5 +1,3 @@ -//@ min-lldb-version: 310 - //@ compile-flags:-g // === GDB TESTS =================================================================================== @@ -24,19 +22,15 @@ // lldb-command:run // lldb-command:v x -// lldbg-check:[...] 0.5 -// lldbr-check:(f64) x = 0.5 +// lldb-check:[...] 0.5 // lldb-command:v y -// lldbg-check:[...] 10 -// lldbr-check:(i32) y = 10 +// lldb-check:[...] 10 // lldb-command:continue // lldb-command:v *x -// lldbg-check:[...] 29 -// lldbr-check:(i32) *x = 29 +// lldb-check:[...] 29 // lldb-command:v *y -// lldbg-check:[...] 110 -// lldbr-check:(i32) *y = 110 +// lldb-check:[...] 110 // lldb-command:continue #![feature(omit_gdb_pretty_printer_section)] diff --git a/tests/debuginfo/constant-debug-locs.rs b/tests/debuginfo/constant-debug-locs.rs index d834d990985..81115fc3c38 100644 --- a/tests/debuginfo/constant-debug-locs.rs +++ b/tests/debuginfo/constant-debug-locs.rs @@ -1,5 +1,3 @@ -//@ min-lldb-version: 310 - //@ compile-flags:-g #![allow(dead_code, unused_variables)] diff --git a/tests/debuginfo/constant-in-match-pattern.rs b/tests/debuginfo/constant-in-match-pattern.rs index f34284be164..952db216deb 100644 --- a/tests/debuginfo/constant-in-match-pattern.rs +++ b/tests/debuginfo/constant-in-match-pattern.rs @@ -1,5 +1,3 @@ -//@ min-lldb-version: 310 - //@ compile-flags:-g #![allow(dead_code, unused_variables)] diff --git a/tests/debuginfo/coroutine-locals.rs b/tests/debuginfo/coroutine-locals.rs index c019998040b..f3593adc945 100644 --- a/tests/debuginfo/coroutine-locals.rs +++ b/tests/debuginfo/coroutine-locals.rs @@ -1,5 +1,3 @@ -//@ min-lldb-version: 310 - //@ compile-flags:-g // === GDB TESTS =================================================================================== diff --git a/tests/debuginfo/coroutine-objects.rs b/tests/debuginfo/coroutine-objects.rs index 746b7e40eda..242c76c2989 100644 --- a/tests/debuginfo/coroutine-objects.rs +++ b/tests/debuginfo/coroutine-objects.rs @@ -1,5 +1,3 @@ -// Require a gdb that can read DW_TAG_variant_part. -//@ min-gdb-version: 8.2 //@ min-lldb-version: 1800 // LLDB (18.1+) now supports DW_TAG_variant_part, but there is some bug in either compiler or LLDB diff --git a/tests/debuginfo/cross-crate-spans.rs b/tests/debuginfo/cross-crate-spans.rs index a93c8f46930..e337aaf5a6c 100644 --- a/tests/debuginfo/cross-crate-spans.rs +++ b/tests/debuginfo/cross-crate-spans.rs @@ -1,8 +1,6 @@ #![feature(omit_gdb_pretty_printer_section)] #![omit_gdb_pretty_printer_section] -//@ min-lldb-version: 310 - //@ aux-build:cross_crate_spans.rs extern crate cross_crate_spans; @@ -15,8 +13,7 @@ extern crate cross_crate_spans; // gdb-command:run // gdb-command:print result -// gdbg-check:$1 = {__0 = 17, __1 = 17} -// gdbr-check:$1 = (17, 17) +// gdb-check:$1 = (17, 17) // gdb-command:print a_variable // gdb-check:$2 = 123456789 // gdb-command:print another_variable @@ -24,8 +21,7 @@ extern crate cross_crate_spans; // gdb-command:continue // gdb-command:print result -// gdbg-check:$4 = {__0 = 1212, __1 = 1212} -// gdbr-check:$4 = (1212, 1212) +// gdb-check:$4 = (1212, 1212) // gdb-command:print a_variable // gdb-check:$5 = 123456789 // gdb-command:print another_variable @@ -40,25 +36,19 @@ extern crate cross_crate_spans; // lldb-command:run // lldb-command:v result -// lldbg-check:[...] { 0 = 17 1 = 17 } -// lldbr-check:((u32, u32)) result = { 0 = 17 1 = 17 } +// lldb-check:[...] { 0 = 17 1 = 17 } // lldb-command:v a_variable -// lldbg-check:[...] 123456789 -// lldbr-check:(u32) a_variable = 123456789 +// lldb-check:[...] 123456789 // lldb-command:v another_variable -// lldbg-check:[...] 123456789.5 -// lldbr-check:(f64) another_variable = 123456789.5 +// lldb-check:[...] 123456789.5 // lldb-command:continue // lldb-command:v result -// lldbg-check:[...] { 0 = 1212 1 = 1212 } -// lldbr-check:((i16, i16)) result = { 0 = 1212 1 = 1212 } +// lldb-check:[...] { 0 = 1212 1 = 1212 } // lldb-command:v a_variable -// lldbg-check:[...] 123456789 -// lldbr-check:(u32) a_variable = 123456789 +// lldb-check:[...] 123456789 // lldb-command:v another_variable -// lldbg-check:[...] 123456789.5 -// lldbr-check:(f64) another_variable = 123456789.5 +// lldb-check:[...] 123456789.5 // lldb-command:continue diff --git a/tests/debuginfo/cross-crate-type-uniquing.rs b/tests/debuginfo/cross-crate-type-uniquing.rs index 88f8bac5d6f..28ebc343884 100644 --- a/tests/debuginfo/cross-crate-type-uniquing.rs +++ b/tests/debuginfo/cross-crate-type-uniquing.rs @@ -1,5 +1,3 @@ -//@ min-lldb-version: 310 - //@ aux-build:cross_crate_debuginfo_type_uniquing.rs extern crate cross_crate_debuginfo_type_uniquing; diff --git a/tests/debuginfo/destructured-fn-argument.rs b/tests/debuginfo/destructured-fn-argument.rs index 74e18a594d7..37a7bb2b778 100644 --- a/tests/debuginfo/destructured-fn-argument.rs +++ b/tests/debuginfo/destructured-fn-argument.rs @@ -1,5 +1,3 @@ -//@ min-lldb-version: 310 - //@ compile-flags:-g // === GDB TESTS =================================================================================== @@ -23,15 +21,13 @@ // gdb-command:print a // gdb-check:$6 = 5 // gdb-command:print b -// gdbg-check:$7 = {__0 = 6, __1 = 7} -// gdbr-check:$7 = (6, 7) +// gdb-check:$7 = (6, 7) // gdb-command:continue // gdb-command:print h // gdb-check:$8 = 8 // gdb-command:print i -// gdbg-check:$9 = {a = 9, b = 10} -// gdbr-check:$9 = destructured_fn_argument::Struct {a: 9, b: 10} +// gdb-check:$9 = destructured_fn_argument::Struct {a: 9, b: 10} // gdb-command:print j // gdb-check:$10 = 11 // gdb-command:continue @@ -57,8 +53,7 @@ // gdb-command:print q // gdb-check:$17 = 20 // gdb-command:print r -// gdbg-check:$18 = {a = 21, b = 22} -// gdbr-check:$18 = destructured_fn_argument::Struct {a: 21, b: 22} +// gdb-check:$18 = destructured_fn_argument::Struct {a: 21, b: 22} // gdb-command:continue // gdb-command:print s @@ -88,13 +83,11 @@ // gdb-command:continue // gdb-command:print aa -// gdbg-check:$30 = {__0 = 34, __1 = 35} -// gdbr-check:$30 = (34, 35) +// gdb-check:$30 = (34, 35) // gdb-command:continue // gdb-command:print bb -// gdbg-check:$31 = {__0 = 36, __1 = 37} -// gdbr-check:$31 = (36, 37) +// gdb-check:$31 = (36, 37) // gdb-command:continue // gdb-command:print cc @@ -102,20 +95,17 @@ // gdb-command:continue // gdb-command:print dd -// gdbg-check:$33 = {__0 = 40, __1 = 41, __2 = 42} -// gdbr-check:$33 = (40, 41, 42) +// gdb-check:$33 = (40, 41, 42) // gdb-command:continue // gdb-command:print *ee -// gdbg-check:$34 = {__0 = 43, __1 = 44, __2 = 45} -// gdbr-check:$34 = (43, 44, 45) +// gdb-check:$34 = (43, 44, 45) // gdb-command:continue // gdb-command:print *ff // gdb-check:$35 = 46 // gdb-command:print gg -// gdbg-check:$36 = {__0 = 47, __1 = 48} -// gdbr-check:$36 = (47, 48) +// gdb-check:$36 = (47, 48) // gdb-command:continue // gdb-command:print *hh @@ -164,196 +154,147 @@ // lldb-command:run // lldb-command:v a -// lldbg-check:[...] 1 -// lldbr-check:(isize) a = 1 +// lldb-check:[...] 1 // lldb-command:v b -// lldbg-check:[...] false -// lldbr-check:(bool) b = false +// lldb-check:[...] false // lldb-command:continue // lldb-command:v a -// lldbg-check:[...] 2 -// lldbr-check:(isize) a = 2 +// lldb-check:[...] 2 // lldb-command:v b -// lldbg-check:[...] 3 -// lldbr-check:(u16) b = 3 +// lldb-check:[...] 3 // lldb-command:v c -// lldbg-check:[...] 4 -// lldbr-check:(u16) c = 4 +// lldb-check:[...] 4 // lldb-command:continue // lldb-command:v a -// lldbg-check:[...] 5 -// lldbr-check:(isize) a = 5 +// lldb-check:[...] 5 // lldb-command:v b -// lldbg-check:[...] { 0 = 6 1 = 7 } -// lldbr-check:((u32, u32)) b = { 0 = 6 1 = 7 } +// lldb-check:[...] { 0 = 6 1 = 7 } // lldb-command:continue // lldb-command:v h -// lldbg-check:[...] 8 -// lldbr-check:(i16) h = 8 +// lldb-check:[...] 8 // lldb-command:v i -// lldbg-check:[...] { a = 9 b = 10 } -// lldbr-check:(destructured_fn_argument::Struct) i = { a = 9 b = 10 } +// lldb-check:[...] { a = 9 b = 10 } // lldb-command:v j -// lldbg-check:[...] 11 -// lldbr-check:(i16) j = 11 +// lldb-check:[...] 11 // lldb-command:continue // lldb-command:v k -// lldbg-check:[...] 12 -// lldbr-check:(i64) k = 12 +// lldb-check:[...] 12 // lldb-command:v l -// lldbg-check:[...] 13 -// lldbr-check:(i32) l = 13 +// lldb-check:[...] 13 // lldb-command:continue // lldb-command:v m -// lldbg-check:[...] 14 -// lldbr-check:(isize) m = 14 +// lldb-check:[...] 14 // lldb-command:v n -// lldbg-check:[...] 16 -// lldbr-check:(i32) n = 16 +// lldb-check:[...] 16 // lldb-command:continue // lldb-command:v o -// lldbg-check:[...] 18 -// lldbr-check:(i32) o = 18 +// lldb-check:[...] 18 // lldb-command:continue // lldb-command:v p -// lldbg-check:[...] 19 -// lldbr-check:(i64) p = 19 +// lldb-check:[...] 19 // lldb-command:v q -// lldbg-check:[...] 20 -// lldbr-check:(i32) q = 20 +// lldb-check:[...] 20 // lldb-command:v r -// lldbg-check:[...] { a = 21 b = 22 } -// lldbr-check:(destructured_fn_argument::Struct) r = { a = 21, b = 22 } +// lldb-check:[...] { a = 21 b = 22 } // lldb-command:continue // lldb-command:v s -// lldbg-check:[...] 24 -// lldbr-check:(i32) s = 24 +// lldb-check:[...] 24 // lldb-command:v t -// lldbg-check:[...] 23 -// lldbr-check:(i64) t = 23 +// lldb-check:[...] 23 // lldb-command:continue // lldb-command:v u -// lldbg-check:[...] 25 -// lldbr-check:(i16) u = 25 +// lldb-check:[...] 25 // lldb-command:v v -// lldbg-check:[...] 26 -// lldbr-check:(i32) v = 26 +// lldb-check:[...] 26 // lldb-command:v w -// lldbg-check:[...] 27 -// lldbr-check:(i64) w = 27 +// lldb-check:[...] 27 // lldb-command:v x -// lldbg-check:[...] 28 -// lldbr-check:(i32) x = 28 +// lldb-check:[...] 28 // lldb-command:v y -// lldbg-check:[...] 29 -// lldbr-check:(i64) y = 29 +// lldb-check:[...] 29 // lldb-command:v z -// lldbg-check:[...] 30 -// lldbr-check:(i32) z = 30 +// lldb-check:[...] 30 // lldb-command:v ae -// lldbg-check:[...] 31 -// lldbr-check:(i64) ae = 31 +// lldb-check:[...] 31 // lldb-command:v oe -// lldbg-check:[...] 32 -// lldbr-check:(i32) oe = 32 +// lldb-check:[...] 32 // lldb-command:v ue -// lldbg-check:[...] 33 -// lldbr-check:(u16) ue = 33 +// lldb-check:[...] 33 // lldb-command:continue // lldb-command:v aa -// lldbg-check:[...] { 0 = 34 1 = 35 } -// lldbr-check:((isize, isize)) aa = { 0 = 34 1 = 35 } +// lldb-check:[...] { 0 = 34 1 = 35 } // lldb-command:continue // lldb-command:v bb -// lldbg-check:[...] { 0 = 36 1 = 37 } -// lldbr-check:((isize, isize)) bb = { 0 = 36 1 = 37 } +// lldb-check:[...] { 0 = 36 1 = 37 } // lldb-command:continue // lldb-command:v cc -// lldbg-check:[...] 38 -// lldbr-check:(isize) cc = 38 +// lldb-check:[...] 38 // lldb-command:continue // lldb-command:v dd -// lldbg-check:[...] { 0 = 40 1 = 41 2 = 42 } -// lldbr-check:((isize, isize, isize)) dd = { 0 = 40 1 = 41 2 = 42 } +// lldb-check:[...] { 0 = 40 1 = 41 2 = 42 } // lldb-command:continue // lldb-command:v *ee -// lldbg-check:[...] { 0 = 43 1 = 44 2 = 45 } -// lldbr-check:((isize, isize, isize)) *ee = { 0 = 43 1 = 44 2 = 45 } +// lldb-check:[...] { 0 = 43 1 = 44 2 = 45 } // lldb-command:continue // lldb-command:v *ff -// lldbg-check:[...] 46 -// lldbr-check:(isize) *ff = 46 +// lldb-check:[...] 46 // lldb-command:v gg -// lldbg-check:[...] { 0 = 47 1 = 48 } -// lldbr-check:((isize, isize)) gg = { 0 = 47 1 = 48 } +// lldb-check:[...] { 0 = 47 1 = 48 } // lldb-command:continue // lldb-command:v *hh -// lldbg-check:[...] 50 -// lldbr-check:(i32) *hh = 50 +// lldb-check:[...] 50 // lldb-command:continue // lldb-command:v ii -// lldbg-check:[...] 51 -// lldbr-check:(i32) ii = 51 +// lldb-check:[...] 51 // lldb-command:continue // lldb-command:v *jj -// lldbg-check:[...] 52 -// lldbr-check:(i32) *jj = 52 +// lldb-check:[...] 52 // lldb-command:continue // lldb-command:v kk -// lldbg-check:[...] 53 -// lldbr-check:(f64) kk = 53 +// lldb-check:[...] 53 // lldb-command:v ll -// lldbg-check:[...] 54 -// lldbr-check:(isize) ll = 54 +// lldb-check:[...] 54 // lldb-command:continue // lldb-command:v mm -// lldbg-check:[...] 55 -// lldbr-check:(f64) mm = 55 +// lldb-check:[...] 55 // lldb-command:v *nn -// lldbg-check:[...] 56 -// lldbr-check:(isize) *nn = 56 +// lldb-check:[...] 56 // lldb-command:continue // lldb-command:v oo -// lldbg-check:[...] 57 -// lldbr-check:(isize) oo = 57 +// lldb-check:[...] 57 // lldb-command:v pp -// lldbg-check:[...] 58 -// lldbr-check:(isize) pp = 58 +// lldb-check:[...] 58 // lldb-command:v qq -// lldbg-check:[...] 59 -// lldbr-check:(isize) qq = 59 +// lldb-check:[...] 59 // lldb-command:continue // lldb-command:v rr -// lldbg-check:[...] 60 -// lldbr-check:(isize) rr = 60 +// lldb-check:[...] 60 // lldb-command:v ss -// lldbg-check:[...] 61 -// lldbr-check:(isize) ss = 61 +// lldb-check:[...] 61 // lldb-command:v tt -// lldbg-check:[...] 62 -// lldbr-check:(isize) tt = 62 +// lldb-check:[...] 62 // lldb-command:continue #![allow(unused_variables)] diff --git a/tests/debuginfo/destructured-for-loop-variable.rs b/tests/debuginfo/destructured-for-loop-variable.rs index a8c7cc1489f..cc16be1268a 100644 --- a/tests/debuginfo/destructured-for-loop-variable.rs +++ b/tests/debuginfo/destructured-for-loop-variable.rs @@ -1,5 +1,3 @@ -//@ min-lldb-version: 310 - //@ compile-flags:-g // === GDB TESTS =================================================================================== @@ -63,13 +61,11 @@ // gdb-command:continue // gdb-command:print simple_struct_ident -// gdbg-check:$23 = {x = 3537, y = 35437.5, z = true} -// gdbr-check:$23 = destructured_for_loop_variable::Struct {x: 3537, y: 35437.5, z: true} +// gdb-check:$23 = destructured_for_loop_variable::Struct {x: 3537, y: 35437.5, z: true} // gdb-command:continue // gdb-command:print simple_tuple_ident -// gdbg-check:$24 = {__0 = 34903493, __1 = 232323} -// gdbr-check:$24 = (34903493, 232323) +// gdb-check:$24 = (34903493, 232323) // gdb-command:continue // === LLDB TESTS ================================================================================== @@ -81,90 +77,66 @@ // DESTRUCTURED STRUCT // lldb-command:v x -// lldbg-check:[...] 400 -// lldbr-check:(i16) x = 400 +// lldb-check:[...] 400 // lldb-command:v y -// lldbg-check:[...] 401.5 -// lldbr-check:(f32) y = 401.5 +// lldb-check:[...] 401.5 // lldb-command:v z -// lldbg-check:[...] true -// lldbr-check:(bool) z = true +// lldb-check:[...] true // lldb-command:continue // DESTRUCTURED TUPLE // lldb-command:v _i8 -// lldbg-check:[...] 0x6f -// lldbr-check:(i8) _i8 = 111 +// lldb-check:[...] 0x6f // lldb-command:v _u8 -// lldbg-check:[...] 0x70 -// lldbr-check:(u8) _u8 = 112 +// lldb-check:[...] 0x70 // lldb-command:v _i16 -// lldbg-check:[...] -113 -// lldbr-check:(i16) _i16 = -113 +// lldb-check:[...] -113 // lldb-command:v _u16 -// lldbg-check:[...] 114 -// lldbr-check:(u16) _u16 = 114 +// lldb-check:[...] 114 // lldb-command:v _i32 -// lldbg-check:[...] -115 -// lldbr-check:(i32) _i32 = -115 +// lldb-check:[...] -115 // lldb-command:v _u32 -// lldbg-check:[...] 116 -// lldbr-check:(u32) _u32 = 116 +// lldb-check:[...] 116 // lldb-command:v _i64 -// lldbg-check:[...] -117 -// lldbr-check:(i64) _i64 = -117 +// lldb-check:[...] -117 // lldb-command:v _u64 -// lldbg-check:[...] 118 -// lldbr-check:(u64) _u64 = 118 +// lldb-check:[...] 118 // lldb-command:v _f32 -// lldbg-check:[...] 119.5 -// lldbr-check:(f32) _f32 = 119.5 +// lldb-check:[...] 119.5 // lldb-command:v _f64 -// lldbg-check:[...] 120.5 -// lldbr-check:(f64) _f64 = 120.5 +// lldb-check:[...] 120.5 // lldb-command:continue // MORE COMPLEX CASE // lldb-command:v v1 -// lldbg-check:[...] 80000 -// lldbr-check:(i32) v1 = 80000 +// lldb-check:[...] 80000 // lldb-command:v x1 -// lldbg-check:[...] 8000 -// lldbr-check:(i16) x1 = 8000 +// lldb-check:[...] 8000 // lldb-command:v *y1 -// lldbg-check:[...] 80001.5 -// lldbr-check:(f32) *y1 = 80001.5 +// lldb-check:[...] 80001.5 // lldb-command:v z1 -// lldbg-check:[...] false -// lldbr-check:(bool) z1 = false +// lldb-check:[...] false // lldb-command:v *x2 -// lldbg-check:[...] -30000 -// lldbr-check:(i16) *x2 = -30000 +// lldb-check:[...] -30000 // lldb-command:v y2 -// lldbg-check:[...] -300001.5 -// lldbr-check:(f32) y2 = -300001.5 +// lldb-check:[...] -300001.5 // lldb-command:v *z2 -// lldbg-check:[...] true -// lldbr-check:(bool) *z2 = true +// lldb-check:[...] true // lldb-command:v v2 -// lldbg-check:[...] 854237.5 -// lldbr-check:(f64) v2 = 854237.5 +// lldb-check:[...] 854237.5 // lldb-command:continue // SIMPLE IDENTIFIER // lldb-command:v i -// lldbg-check:[...] 1234 -// lldbr-check:(i32) i = 1234 +// lldb-check:[...] 1234 // lldb-command:continue // lldb-command:v simple_struct_ident -// lldbg-check:[...] { x = 3537 y = 35437.5 z = true } -// lldbr-check:(destructured_for_loop_variable::Struct) simple_struct_ident = { x = 3537 y = 35437.5 z = true } +// lldb-check:[...] { x = 3537 y = 35437.5 z = true } // lldb-command:continue // lldb-command:v simple_tuple_ident -// lldbg-check:[...] { 0 = 34903493 1 = 232323 } -// lldbr-check:((u32, i64)) simple_tuple_ident = { 0 = 34903493 1 = 232323 } +// lldb-check:[...] { 0 = 34903493 1 = 232323 } // lldb-command:continue #![allow(unused_variables)] diff --git a/tests/debuginfo/destructured-local.rs b/tests/debuginfo/destructured-local.rs index 8d62fe5db03..fad96ca7d4b 100644 --- a/tests/debuginfo/destructured-local.rs +++ b/tests/debuginfo/destructured-local.rs @@ -1,5 +1,3 @@ -//@ min-lldb-version: 310 - //@ compile-flags:-g // === GDB TESTS =================================================================================== @@ -21,14 +19,12 @@ // gdb-command:print f // gdb-check:$6 = 5 // gdb-command:print g -// gdbg-check:$7 = {__0 = 6, __1 = 7} -// gdbr-check:$7 = (6, 7) +// gdb-check:$7 = (6, 7) // gdb-command:print h // gdb-check:$8 = 8 // gdb-command:print i -// gdbg-check:$9 = {a = 9, b = 10} -// gdbr-check:$9 = destructured_local::Struct {a: 9, b: 10} +// gdb-check:$9 = destructured_local::Struct {a: 9, b: 10} // gdb-command:print j // gdb-check:$10 = 11 @@ -50,8 +46,7 @@ // gdb-command:print q // gdb-check:$17 = 20 // gdb-command:print r -// gdbg-check:$18 = {a = 21, b = 22} -// gdbr-check:$18 = destructured_local::Struct {a: 21, b: 22} +// gdb-check:$18 = destructured_local::Struct {a: 21, b: 22} // gdb-command:print s // gdb-check:$19 = 24 @@ -78,30 +73,25 @@ // gdb-check:$29 = 33 // gdb-command:print aa -// gdbg-check:$30 = {__0 = 34, __1 = 35} -// gdbr-check:$30 = (34, 35) +// gdb-check:$30 = (34, 35) // gdb-command:print bb -// gdbg-check:$31 = {__0 = 36, __1 = 37} -// gdbr-check:$31 = (36, 37) +// gdb-check:$31 = (36, 37) // gdb-command:print cc // gdb-check:$32 = 38 // gdb-command:print dd -// gdbg-check:$33 = {__0 = 40, __1 = 41, __2 = 42} -// gdbr-check:$33 = (40, 41, 42) +// gdb-check:$33 = (40, 41, 42) // gdb-command:print *ee -// gdbg-check:$34 = {__0 = 43, __1 = 44, __2 = 45} -// gdbr-check:$34 = (43, 44, 45) +// gdb-check:$34 = (43, 44, 45) // gdb-command:print *ff // gdb-check:$35 = 46 // gdb-command:print gg -// gdbg-check:$36 = {__0 = 47, __1 = 48} -// gdbr-check:$36 = (47, 48) +// gdb-check:$36 = (47, 48) // gdb-command:print *hh // gdb-check:$37 = 50 @@ -130,157 +120,114 @@ // lldb-command:run // lldb-command:v a -// lldbg-check:[...] 1 -// lldbr-check:(isize) a = 1 +// lldb-check:[...] 1 // lldb-command:v b -// lldbg-check:[...] false -// lldbr-check:(bool) b = false +// lldb-check:[...] false // lldb-command:v c -// lldbg-check:[...] 2 -// lldbr-check:(isize) c = 2 +// lldb-check:[...] 2 // lldb-command:v d -// lldbg-check:[...] 3 -// lldbr-check:(u16) d = 3 +// lldb-check:[...] 3 // lldb-command:v e -// lldbg-check:[...] 4 -// lldbr-check:(u16) e = 4 +// lldb-check:[...] 4 // lldb-command:v f -// lldbg-check:[...] 5 -// lldbr-check:(isize) f = 5 +// lldb-check:[...] 5 // lldb-command:v g -// lldbg-check:[...] { 0 = 6 1 = 7 } -// lldbr-check:((u32, u32)) g = { 0 = 6 1 = 7 } +// lldb-check:[...] { 0 = 6 1 = 7 } // lldb-command:v h -// lldbg-check:[...] 8 -// lldbr-check:(i16) h = 8 +// lldb-check:[...] 8 // lldb-command:v i -// lldbg-check:[...] { a = 9 b = 10 } -// lldbr-check:(destructured_local::Struct) i = { a = 9 b = 10 } +// lldb-check:[...] { a = 9 b = 10 } // lldb-command:v j -// lldbg-check:[...] 11 -// lldbr-check:(i16) j = 11 +// lldb-check:[...] 11 // lldb-command:v k -// lldbg-check:[...] 12 -// lldbr-check:(i64) k = 12 +// lldb-check:[...] 12 // lldb-command:v l -// lldbg-check:[...] 13 -// lldbr-check:(i32) l = 13 +// lldb-check:[...] 13 // lldb-command:v m -// lldbg-check:[...] 14 -// lldbr-check:(i32) m = 14 +// lldb-check:[...] 14 // lldb-command:v n -// lldbg-check:[...] 16 -// lldbr-check:(i32) n = 16 +// lldb-check:[...] 16 // lldb-command:v o -// lldbg-check:[...] 18 -// lldbr-check:(i32) o = 18 +// lldb-check:[...] 18 // lldb-command:v p -// lldbg-check:[...] 19 -// lldbr-check:(i64) p = 19 +// lldb-check:[...] 19 // lldb-command:v q -// lldbg-check:[...] 20 -// lldbr-check:(i32) q = 20 +// lldb-check:[...] 20 // lldb-command:v r -// lldbg-check:[...] { a = 21 b = 22 } -// lldbr-check:(destructured_local::Struct) r = { a = 21 b = 22 } +// lldb-check:[...] { a = 21 b = 22 } // lldb-command:v s -// lldbg-check:[...] 24 -// lldbr-check:(i32) s = 24 +// lldb-check:[...] 24 // lldb-command:v t -// lldbg-check:[...] 23 -// lldbr-check:(i64) t = 23 +// lldb-check:[...] 23 // lldb-command:v u -// lldbg-check:[...] 25 -// lldbr-check:(i32) u = 25 +// lldb-check:[...] 25 // lldb-command:v v -// lldbg-check:[...] 26 -// lldbr-check:(i32) v = 26 +// lldb-check:[...] 26 // lldb-command:v w -// lldbg-check:[...] 27 -// lldbr-check:(i32) w = 27 +// lldb-check:[...] 27 // lldb-command:v x -// lldbg-check:[...] 28 -// lldbr-check:(i32) x = 28 +// lldb-check:[...] 28 // lldb-command:v y -// lldbg-check:[...] 29 -// lldbr-check:(i64) y = 29 +// lldb-check:[...] 29 // lldb-command:v z -// lldbg-check:[...] 30 -// lldbr-check:(i32) z = 30 +// lldb-check:[...] 30 // lldb-command:v ae -// lldbg-check:[...] 31 -// lldbr-check:(i64) ae = 31 +// lldb-check:[...] 31 // lldb-command:v oe -// lldbg-check:[...] 32 -// lldbr-check:(i32) oe = 32 +// lldb-check:[...] 32 // lldb-command:v ue -// lldbg-check:[...] 33 -// lldbr-check:(i32) ue = 33 +// lldb-check:[...] 33 // lldb-command:v aa -// lldbg-check:[...] { 0 = 34 1 = 35 } -// lldbr-check:((i32, i32)) aa = { 0 = 34 1 = 35 } +// lldb-check:[...] { 0 = 34 1 = 35 } // lldb-command:v bb -// lldbg-check:[...] { 0 = 36 1 = 37 } -// lldbr-check:((i32, i32)) bb = { 0 = 36 1 = 37 } +// lldb-check:[...] { 0 = 36 1 = 37 } // lldb-command:v cc -// lldbg-check:[...] 38 -// lldbr-check:(i32) cc = 38 +// lldb-check:[...] 38 // lldb-command:v dd -// lldbg-check:[...] { 0 = 40 1 = 41 2 = 42 } -// lldbr-check:((i32, i32, i32)) dd = { 0 = 40 1 = 41 2 = 42} +// lldb-check:[...] { 0 = 40 1 = 41 2 = 42 } // lldb-command:v *ee -// lldbg-check:[...] { 0 = 43 1 = 44 2 = 45 } -// lldbr-check:((i32, i32, i32)) *ee = { 0 = 43 1 = 44 2 = 45} +// lldb-check:[...] { 0 = 43 1 = 44 2 = 45 } // lldb-command:v *ff -// lldbg-check:[...] 46 -// lldbr-check:(i32) *ff = 46 +// lldb-check:[...] 46 // lldb-command:v gg -// lldbg-check:[...] { 0 = 47 1 = 48 } -// lldbr-check:((i32, i32)) gg = { 0 = 47 1 = 48 } +// lldb-check:[...] { 0 = 47 1 = 48 } // lldb-command:v *hh -// lldbg-check:[...] 50 -// lldbr-check:(i32) *hh = 50 +// lldb-check:[...] 50 // lldb-command:v ii -// lldbg-check:[...] 51 -// lldbr-check:(i32) ii = 51 +// lldb-check:[...] 51 // lldb-command:v *jj -// lldbg-check:[...] 52 -// lldbr-check:(i32) *jj = 52 +// lldb-check:[...] 52 // lldb-command:v kk -// lldbg-check:[...] 53 -// lldbr-check:(f64) kk = 53 +// lldb-check:[...] 53 // lldb-command:v ll -// lldbg-check:[...] 54 -// lldbr-check:(isize) ll = 54 +// lldb-check:[...] 54 // lldb-command:v mm -// lldbg-check:[...] 55 -// lldbr-check:(f64) mm = 55 +// lldb-check:[...] 55 // lldb-command:v *nn -// lldbg-check:[...] 56 -// lldbr-check:(isize) *nn = 56 +// lldb-check:[...] 56 #![allow(unused_variables)] diff --git a/tests/debuginfo/drop-locations.rs b/tests/debuginfo/drop-locations.rs index 0777313d198..a55cf7b50a8 100644 --- a/tests/debuginfo/drop-locations.rs +++ b/tests/debuginfo/drop-locations.rs @@ -1,6 +1,4 @@ -//@ ignore-windows //@ ignore-android -//@ min-lldb-version: 310 //@ ignore-test: #128971 #![allow(unused)] diff --git a/tests/debuginfo/embedded-visualizer.rs b/tests/debuginfo/embedded-visualizer.rs index 69afd273f77..cbd8691394d 100644 --- a/tests/debuginfo/embedded-visualizer.rs +++ b/tests/debuginfo/embedded-visualizer.rs @@ -1,7 +1,6 @@ //@ compile-flags:-g -//@ min-gdb-version: 8.1 //@ ignore-lldb -//@ ignore-windows-gnu // emit_debug_gdb_scripts is disabled on Windows +//@ ignore-windows-gnu: #128981 // === CDB TESTS ================================================================================== diff --git a/tests/debuginfo/empty-string.rs b/tests/debuginfo/empty-string.rs index 35b68ed91c0..014465c27ca 100644 --- a/tests/debuginfo/empty-string.rs +++ b/tests/debuginfo/empty-string.rs @@ -1,9 +1,6 @@ -//@ ignore-windows failing on win32 bot +//@ ignore-windows-gnu: #128981 //@ ignore-android: FIXME(#10381) //@ compile-flags:-g -//@ min-gdb-version: 8.1 -//@ ignore-gdb-version: 7.11.90 - 8.0.9 -//@ min-lldb-version: 310 // === GDB TESTS =================================================================================== diff --git a/tests/debuginfo/enum-thinlto.rs b/tests/debuginfo/enum-thinlto.rs index 42a0d1e28f8..af77145c312 100644 --- a/tests/debuginfo/enum-thinlto.rs +++ b/tests/debuginfo/enum-thinlto.rs @@ -1,5 +1,3 @@ -// Require a gdb that can read DW_TAG_variant_part. -//@ min-gdb-version: 8.2 //@ min-lldb-version: 1800 //@ compile-flags:-g -Z thinlto @@ -8,15 +6,14 @@ // gdb-command:run // gdb-command:print *abc -// gdbr-check:$1 = enum_thinlto::ABC::TheA{x: 0, y: 8970181431921507452} +// gdb-check:$1 = enum_thinlto::ABC::TheA{x: 0, y: 8970181431921507452} // === LLDB TESTS ================================================================================== // lldb-command:run // lldb-command:v *abc -// lldbg-check:(enum_thinlto::ABC) *abc = { value = { x = 0 y = 8970181431921507452 } $discr$ = 0 } -// lldbr-check:(enum_thinlto::ABC) *abc = (x = 0, y = 8970181431921507452) +// lldb-check:(enum_thinlto::ABC) *abc = { value = { x = 0 y = 8970181431921507452 } $discr$ = 0 } #![allow(unused_variables)] #![feature(omit_gdb_pretty_printer_section)] diff --git a/tests/debuginfo/evec-in-struct.rs b/tests/debuginfo/evec-in-struct.rs index 2283e96c0ad..303669cf06c 100644 --- a/tests/debuginfo/evec-in-struct.rs +++ b/tests/debuginfo/evec-in-struct.rs @@ -1,5 +1,3 @@ -//@ min-lldb-version: 310 - //@ compile-flags:-g // === GDB TESTS =================================================================================== @@ -7,23 +5,18 @@ // gdb-command:run // gdb-command:print no_padding1 -// gdbg-check:$1 = {x = {0, 1, 2}, y = -3, z = {4.5, 5.5}} -// gdbr-check:$1 = evec_in_struct::NoPadding1 {x: [0, 1, 2], y: -3, z: [4.5, 5.5]} +// gdb-check:$1 = evec_in_struct::NoPadding1 {x: [0, 1, 2], y: -3, z: [4.5, 5.5]} // gdb-command:print no_padding2 -// gdbg-check:$2 = {x = {6, 7, 8}, y = {{9, 10}, {11, 12}}} -// gdbr-check:$2 = evec_in_struct::NoPadding2 {x: [6, 7, 8], y: [[9, 10], [11, 12]]} +// gdb-check:$2 = evec_in_struct::NoPadding2 {x: [6, 7, 8], y: [[9, 10], [11, 12]]} // gdb-command:print struct_internal_padding -// gdbg-check:$3 = {x = {13, 14}, y = {15, 16}} -// gdbr-check:$3 = evec_in_struct::StructInternalPadding {x: [13, 14], y: [15, 16]} +// gdb-check:$3 = evec_in_struct::StructInternalPadding {x: [13, 14], y: [15, 16]} // gdb-command:print single_vec -// gdbg-check:$4 = {x = {17, 18, 19, 20, 21}} -// gdbr-check:$4 = evec_in_struct::SingleVec {x: [17, 18, 19, 20, 21]} +// gdb-check:$4 = evec_in_struct::SingleVec {x: [17, 18, 19, 20, 21]} // gdb-command:print struct_padded_at_end -// gdbg-check:$5 = {x = {22, 23}, y = {24, 25}} -// gdbr-check:$5 = evec_in_struct::StructPaddedAtEnd {x: [22, 23], y: [24, 25]} +// gdb-check:$5 = evec_in_struct::StructPaddedAtEnd {x: [22, 23], y: [24, 25]} // === LLDB TESTS ================================================================================== @@ -31,23 +24,18 @@ // lldb-command:run // lldb-command:v no_padding1 -// lldbg-check:[...] { x = { [0] = 0 [1] = 1 [2] = 2 } y = -3 z = { [0] = 4.5 [1] = 5.5 } } -// lldbr-check:(evec_in_struct::NoPadding1) no_padding1 = { x = { [0] = 0 [1] = 1 [2] = 2 } y = -3 z = { [0] = 4.5 [1] = 5.5 } } +// lldb-check:[...] { x = { [0] = 0 [1] = 1 [2] = 2 } y = -3 z = { [0] = 4.5 [1] = 5.5 } } // lldb-command:v no_padding2 -// lldbg-check:[...] { x = { [0] = 6 [1] = 7 [2] = 8 } y = { [0] = { [0] = 9 [1] = 10 } [1] = { [0] = 11 [1] = 12 } } } -// lldbr-check:(evec_in_struct::NoPadding2) no_padding2 = { x = { [0] = 6 [1] = 7 [2] = 8 } y = { [0] = { [0] = 9 [1] = 10 } [1] = { [0] = 11 [1] = 12 } } } +// lldb-check:[...] { x = { [0] = 6 [1] = 7 [2] = 8 } y = { [0] = { [0] = 9 [1] = 10 } [1] = { [0] = 11 [1] = 12 } } } // lldb-command:v struct_internal_padding -// lldbg-check:[...] { x = { [0] = 13 [1] = 14 } y = { [0] = 15 [1] = 16 } } -// lldbr-check:(evec_in_struct::StructInternalPadding) struct_internal_padding = { x = { [0] = 13 [1] = 14 } y = { [0] = 15 [1] = 16 } } +// lldb-check:[...] { x = { [0] = 13 [1] = 14 } y = { [0] = 15 [1] = 16 } } // lldb-command:v single_vec -// lldbg-check:[...] { x = { [0] = 17 [1] = 18 [2] = 19 [3] = 20 [4] = 21 } } -// lldbr-check:(evec_in_struct::SingleVec) single_vec = { x = { [0] = 17 [1] = 18 [2] = 19 [3] = 20 [4] = 21 } } +// lldb-check:[...] { x = { [0] = 17 [1] = 18 [2] = 19 [3] = 20 [4] = 21 } } // lldb-command:v struct_padded_at_end -// lldbg-check:[...] { x = { [0] = 22 [1] = 23 } y = { [0] = 24 [1] = 25 } } -// lldbr-check:(evec_in_struct::StructPaddedAtEnd) struct_padded_at_end = { x = { [0] = 22 [1] = 23 } y = { [0] = 24 [1] = 25 } } +// lldb-check:[...] { x = { [0] = 22 [1] = 23 } y = { [0] = 24 [1] = 25 } } #![allow(unused_variables)] #![feature(omit_gdb_pretty_printer_section)] diff --git a/tests/debuginfo/extern-c-fn.rs b/tests/debuginfo/extern-c-fn.rs index b45a073ed05..4642073faab 100644 --- a/tests/debuginfo/extern-c-fn.rs +++ b/tests/debuginfo/extern-c-fn.rs @@ -1,5 +1,3 @@ -//@ min-lldb-version: 310 - //@ compile-flags:-g // === GDB TESTS =================================================================================== @@ -22,17 +20,13 @@ // lldb-command:run // lldb-command:v len -// lldbg-check:[...] 20 -// lldbr-check:(i32) len = 20 +// lldb-check:[...] 20 // lldb-command:v local0 -// lldbg-check:[...] 19 -// lldbr-check:(i32) local0 = 19 +// lldb-check:[...] 19 // lldb-command:v local1 -// lldbg-check:[...] true -// lldbr-check:(bool) local1 = true +// lldb-check:[...] true // lldb-command:v local2 -// lldbg-check:[...] 20.5 -// lldbr-check:(f64) local2 = 20.5 +// lldb-check:[...] 20.5 // lldb-command:continue diff --git a/tests/debuginfo/function-arg-initialization.rs b/tests/debuginfo/function-arg-initialization.rs index c641a35c9a5..ae54d56623c 100644 --- a/tests/debuginfo/function-arg-initialization.rs +++ b/tests/debuginfo/function-arg-initialization.rs @@ -24,10 +24,8 @@ // NON IMMEDIATE ARGS // gdb-command:print a -// gdbg-check:$4 = {a = 3, b = 4, c = 5, d = 6, e = 7, f = 8, g = 9, h = 10} // gdbt-check:$4 = function_arg_initialization::BigStruct {a: 3, b: 4, c: 5, d: 6, e: 7, f: 8, g: 9, h: 10} // gdb-command:print b -// gdbg-check:$5 = {a = 11, b = 12, c = 13, d = 14, e = 15, f = 16, g = 17, h = 18} // gdbt-check:$5 = function_arg_initialization::BigStruct {a: 11, b: 12, c: 13, d: 14, e: 15, f: 16, g: 17, h: 18} // gdb-command:continue diff --git a/tests/debuginfo/function-arguments.rs b/tests/debuginfo/function-arguments.rs index b0afa1d0772..21c0c7d859c 100644 --- a/tests/debuginfo/function-arguments.rs +++ b/tests/debuginfo/function-arguments.rs @@ -1,5 +1,3 @@ -//@ min-lldb-version: 310 - //@ compile-flags:-g // === GDB TESTS =================================================================================== @@ -23,19 +21,15 @@ // lldb-command:run // lldb-command:v x -// lldbg-check:[...] 111102 -// lldbr-check:(isize) x = 111102 +// lldb-check:[...] 111102 // lldb-command:v y -// lldbg-check:[...] true -// lldbr-check:(bool) y = true +// lldb-check:[...] true // lldb-command:continue // lldb-command:v a -// lldbg-check:[...] 2000 -// lldbr-check:(i32) a = 2000 +// lldb-check:[...] 2000 // lldb-command:v b -// lldbg-check:[...] 3000 -// lldbr-check:(i64) b = 3000 +// lldb-check:[...] 3000 // lldb-command:continue diff --git a/tests/debuginfo/gdb-pretty-struct-and-enums.rs b/tests/debuginfo/gdb-pretty-struct-and-enums.rs index 235295e887c..08e01333a37 100644 --- a/tests/debuginfo/gdb-pretty-struct-and-enums.rs +++ b/tests/debuginfo/gdb-pretty-struct-and-enums.rs @@ -1,30 +1,24 @@ //@ ignore-lldb //@ ignore-android: FIXME(#10381) -//@ min-gdb-version: 8.1 //@ compile-flags:-g // gdb-command: run // gdb-command: print regular_struct -// gdbg-check:$1 = {the_first_field = 101, the_second_field = 102.5, the_third_field = false} -// gdbr-check:$1 = gdb_pretty_struct_and_enums::RegularStruct {the_first_field: 101, the_second_field: 102.5, the_third_field: false} +// gdb-check:$1 = gdb_pretty_struct_and_enums::RegularStruct {the_first_field: 101, the_second_field: 102.5, the_third_field: false} // gdb-command: print empty_struct -// gdbg-check:$2 = EmptyStruct -// gdbr-check:$2 = gdb_pretty_struct_and_enums::EmptyStruct +// gdb-check:$2 = gdb_pretty_struct_and_enums::EmptyStruct // gdb-command: print c_style_enum1 -// gdbg-check:$3 = CStyleEnumVar1 -// gdbr-check:$3 = gdb_pretty_struct_and_enums::CStyleEnum::CStyleEnumVar1 +// gdb-check:$3 = gdb_pretty_struct_and_enums::CStyleEnum::CStyleEnumVar1 // gdb-command: print c_style_enum2 -// gdbg-check:$4 = CStyleEnumVar2 -// gdbr-check:$4 = gdb_pretty_struct_and_enums::CStyleEnum::CStyleEnumVar2 +// gdb-check:$4 = gdb_pretty_struct_and_enums::CStyleEnum::CStyleEnumVar2 // gdb-command: print c_style_enum3 -// gdbg-check:$5 = CStyleEnumVar3 -// gdbr-check:$5 = gdb_pretty_struct_and_enums::CStyleEnum::CStyleEnumVar3 +// gdb-check:$5 = gdb_pretty_struct_and_enums::CStyleEnum::CStyleEnumVar3 #![allow(dead_code, unused_variables)] diff --git a/tests/debuginfo/generic-enum-with-different-disr-sizes.rs b/tests/debuginfo/generic-enum-with-different-disr-sizes.rs index 7b23221213a..e723543a37b 100644 --- a/tests/debuginfo/generic-enum-with-different-disr-sizes.rs +++ b/tests/debuginfo/generic-enum-with-different-disr-sizes.rs @@ -1,8 +1,4 @@ //@ ignore-lldb: FIXME(#27089) -//@ min-lldb-version: 310 - -// Require a gdb that can read DW_TAG_variant_part. -//@ min-gdb-version: 8.2 //@ compile-flags:-g @@ -10,29 +6,29 @@ // gdb-command:run // gdb-command:print eight_bytes1 -// gdbr-check:$1 = generic_enum_with_different_disr_sizes::Enum<f64>::Variant1(100) +// gdb-check:$1 = generic_enum_with_different_disr_sizes::Enum<f64>::Variant1(100) // gdb-command:print four_bytes1 -// gdbr-check:$2 = generic_enum_with_different_disr_sizes::Enum<i32>::Variant1(101) +// gdb-check:$2 = generic_enum_with_different_disr_sizes::Enum<i32>::Variant1(101) // gdb-command:print two_bytes1 -// gdbr-check:$3 = generic_enum_with_different_disr_sizes::Enum<i16>::Variant1(102) +// gdb-check:$3 = generic_enum_with_different_disr_sizes::Enum<i16>::Variant1(102) // gdb-command:print one_byte1 -// gdbr-check:$4 = generic_enum_with_different_disr_sizes::Enum<u8>::Variant1(65) +// gdb-check:$4 = generic_enum_with_different_disr_sizes::Enum<u8>::Variant1(65) // gdb-command:print eight_bytes2 -// gdbr-check:$5 = generic_enum_with_different_disr_sizes::Enum<f64>::Variant2(100) +// gdb-check:$5 = generic_enum_with_different_disr_sizes::Enum<f64>::Variant2(100) // gdb-command:print four_bytes2 -// gdbr-check:$6 = generic_enum_with_different_disr_sizes::Enum<i32>::Variant2(101) +// gdb-check:$6 = generic_enum_with_different_disr_sizes::Enum<i32>::Variant2(101) // gdb-command:print two_bytes2 -// gdbr-check:$7 = generic_enum_with_different_disr_sizes::Enum<i16>::Variant2(102) +// gdb-check:$7 = generic_enum_with_different_disr_sizes::Enum<i16>::Variant2(102) // gdb-command:print one_byte2 -// gdbr-check:$8 = generic_enum_with_different_disr_sizes::Enum<u8>::Variant2(65) +// gdb-check:$8 = generic_enum_with_different_disr_sizes::Enum<u8>::Variant2(65) // gdb-command:continue diff --git a/tests/debuginfo/generic-function.rs b/tests/debuginfo/generic-function.rs index e131ebfa306..4be8d5ad45a 100644 --- a/tests/debuginfo/generic-function.rs +++ b/tests/debuginfo/generic-function.rs @@ -1,5 +1,3 @@ -//@ min-lldb-version: 310 - //@ compile-flags:-g // === GDB TESTS =================================================================================== @@ -21,8 +19,7 @@ // gdb-command:print *t0 // gdb-check:$5 = 5 // gdb-command:print *t1 -// gdbg-check:$6 = {a = 6, b = 7.5} -// gdbr-check:$6 = generic_function::Struct {a: 6, b: 7.5} +// gdb-check:$6 = generic_function::Struct {a: 6, b: 7.5} // gdb-command:continue // === LLDB TESTS ================================================================================== @@ -30,27 +27,21 @@ // lldb-command:run // lldb-command:v *t0 -// lldbg-check:[...] 1 -// lldbr-check:(i32) *t0 = 1 +// lldb-check:[...] 1 // lldb-command:v *t1 -// lldbg-check:[...] 2.5 -// lldbr-check:(f64) *t1 = 2.5 +// lldb-check:[...] 2.5 // lldb-command:continue // lldb-command:v *t0 -// lldbg-check:[...] 3.5 -// lldbr-check:(f64) *t0 = 3.5 +// lldb-check:[...] 3.5 // lldb-command:v *t1 -// lldbg-check:[...] 4 -// lldbr-check:(u16) *t1 = 4 +// lldb-check:[...] 4 // lldb-command:continue // lldb-command:v *t0 -// lldbg-check:[...] 5 -// lldbr-check:(i32) *t0 = 5 +// lldb-check:[...] 5 // lldb-command:v *t1 -// lldbg-check:[...] { a = 6 b = 7.5 } -// lldbr-check:(generic_function::Struct) *t1 = { a = 6 b = 7.5 } +// lldb-check:[...] { a = 6 b = 7.5 } // lldb-command:continue #![feature(omit_gdb_pretty_printer_section)] diff --git a/tests/debuginfo/generic-functions-nested.rs b/tests/debuginfo/generic-functions-nested.rs index eee0c151182..7e0c20f8903 100644 --- a/tests/debuginfo/generic-functions-nested.rs +++ b/tests/debuginfo/generic-functions-nested.rs @@ -1,5 +1,3 @@ -//@ min-lldb-version: 310 - //@ compile-flags:-g // === GDB TESTS =================================================================================== @@ -36,35 +34,27 @@ // lldb-command:run // lldb-command:v x -// lldbg-check:[...] -1 -// lldbr-check:(i32) x = -1 +// lldb-check:[...] -1 // lldb-command:v y -// lldbg-check:[...] 1 -// lldbr-check:(i32) y = 1 +// lldb-check:[...] 1 // lldb-command:continue // lldb-command:v x -// lldbg-check:[...] -1 -// lldbr-check:(i32) x = -1 +// lldb-check:[...] -1 // lldb-command:v y -// lldbg-check:[...] 2.5 -// lldbr-check:(f64) y = 2.5 +// lldb-check:[...] 2.5 // lldb-command:continue // lldb-command:v x -// lldbg-check:[...] -2.5 -// lldbr-check:(f64) x = -2.5 +// lldb-check:[...] -2.5 // lldb-command:v y -// lldbg-check:[...] 1 -// lldbr-check:(i32) y = 1 +// lldb-check:[...] 1 // lldb-command:continue // lldb-command:v x -// lldbg-check:[...] -2.5 -// lldbr-check:(f64) x = -2.5 +// lldb-check:[...] -2.5 // lldb-command:v y -// lldbg-check:[...] 2.5 -// lldbr-check:(f64) y = 2.5 +// lldb-check:[...] 2.5 // lldb-command:continue diff --git a/tests/debuginfo/generic-method-on-generic-struct.rs b/tests/debuginfo/generic-method-on-generic-struct.rs index 0f706740410..9c587ca2839 100644 --- a/tests/debuginfo/generic-method-on-generic-struct.rs +++ b/tests/debuginfo/generic-method-on-generic-struct.rs @@ -1,17 +1,12 @@ //@ compile-flags:-g -// Some versions of the non-rust-enabled LLDB print the wrong generic -// parameter type names in this test. -//@ needs-rust-lldb - // === GDB TESTS =================================================================================== // gdb-command:run // STACK BY REF // gdb-command:print *self -// gdbg-check:$1 = {x = {__0 = 8888, __1 = -8888}} -// gdbr-check:$1 = generic_method_on_generic_struct::Struct<(u32, i32)> {x: (8888, -8888)} +// gdb-check:$1 = generic_method_on_generic_struct::Struct<(u32, i32)> {x: (8888, -8888)} // gdb-command:print arg1 // gdb-check:$2 = -1 // gdb-command:print arg2 @@ -20,8 +15,7 @@ // STACK BY VAL // gdb-command:print self -// gdbg-check:$4 = {x = {__0 = 8888, __1 = -8888}} -// gdbr-check:$4 = generic_method_on_generic_struct::Struct<(u32, i32)> {x: (8888, -8888)} +// gdb-check:$4 = generic_method_on_generic_struct::Struct<(u32, i32)> {x: (8888, -8888)} // gdb-command:print arg1 // gdb-check:$5 = -3 // gdb-command:print arg2 @@ -30,8 +24,7 @@ // OWNED BY REF // gdb-command:print *self -// gdbg-check:$7 = {x = 1234.5} -// gdbr-check:$7 = generic_method_on_generic_struct::Struct<f64> {x: 1234.5} +// gdb-check:$7 = generic_method_on_generic_struct::Struct<f64> {x: 1234.5} // gdb-command:print arg1 // gdb-check:$8 = -5 // gdb-command:print arg2 @@ -40,8 +33,7 @@ // OWNED BY VAL // gdb-command:print self -// gdbg-check:$10 = {x = 1234.5} -// gdbr-check:$10 = generic_method_on_generic_struct::Struct<f64> {x: 1234.5} +// gdb-check:$10 = generic_method_on_generic_struct::Struct<f64> {x: 1234.5} // gdb-command:print arg1 // gdb-check:$11 = -7 // gdb-command:print arg2 @@ -50,8 +42,7 @@ // OWNED MOVED // gdb-command:print *self -// gdbg-check:$13 = {x = 1234.5} -// gdbr-check:$13 = generic_method_on_generic_struct::Struct<f64> {x: 1234.5} +// gdb-check:$13 = generic_method_on_generic_struct::Struct<f64> {x: 1234.5} // gdb-command:print arg1 // gdb-check:$14 = -9 // gdb-command:print arg2 @@ -65,62 +56,47 @@ // STACK BY REF // lldb-command:v *self -// lldbg-check:[...] { x = { 0 = 8888, 1 = -8888 } } -// lldbr-check:(generic_method_on_generic_struct::Struct<(u32, i32)>) *self = { x = { 0 = 8888 1 = -8888 } } +// lldb-check:[...] { x = { 0 = 8888 1 = -8888 } } // lldb-command:v arg1 -// lldbg-check:[...] -1 -// lldbr-check:(isize) arg1 = -1 +// lldb-check:[...] -1 // lldb-command:v arg2 -// lldbg-check:[...] 2 -// lldbr-check:(u16) arg2 = 2 +// lldb-check:[...] 2 // lldb-command:continue // STACK BY VAL // lldb-command:v self -// lldbg-check:[...] { x = { 0 = 8888, 1 = -8888 } } -// lldbr-check:(generic_method_on_generic_struct::Struct<(u32, i32)>) self = { x = { 0 = 8888, 1 = -8888 } } +// lldb-check:[...] { x = { 0 = 8888 1 = -8888 } } // lldb-command:v arg1 -// lldbg-check:[...] -3 -// lldbr-check:(isize) arg1 = -3 +// lldb-check:[...] -3 // lldb-command:v arg2 -// lldbg-check:[...] -4 -// lldbr-check:(i16) arg2 = -4 +// lldb-check:[...] -4 // lldb-command:continue // OWNED BY REF // lldb-command:v *self -// lldbg-check:[...] { x = 1234.5 } -// lldbr-check:(generic_method_on_generic_struct::Struct<f64>) *self = { x = 1234.5 } +// lldb-check:[...] { x = 1234.5 } // lldb-command:v arg1 -// lldbg-check:[...] -5 -// lldbr-check:(isize) arg1 = -5 +// lldb-check:[...] -5 // lldb-command:v arg2 -// lldbg-check:[...] -6 -// lldbr-check:(i32) arg2 = -6 +// lldb-check:[...] -6 // lldb-command:continue // OWNED BY VAL // lldb-command:v self -// lldbg-check:[...] { x = 1234.5 } -// lldbr-check:(generic_method_on_generic_struct::Struct<f64>) self = { x = 1234.5 } +// lldb-check:[...] { x = 1234.5 } // lldb-command:v arg1 -// lldbg-check:[...] -7 -// lldbr-check:(isize) arg1 = -7 +// lldb-check:[...] -7 // lldb-command:v arg2 -// lldbg-check:[...] -8 -// lldbr-check:(i64) arg2 = -8 +// lldb-check:[...] -8 // lldb-command:continue // OWNED MOVED // lldb-command:v *self -// lldbg-check:[...] { x = 1234.5 } -// lldbr-check:(generic_method_on_generic_struct::Struct<f64>) *self = { x = 1234.5 } +// lldb-check:[...] { x = 1234.5 } // lldb-command:v arg1 -// lldbg-check:[...] -9 -// lldbr-check:(isize) arg1 = -9 +// lldb-check:[...] -9 // lldb-command:v arg2 -// lldbg-check:[...] -10.5 -// lldbr-check:(f32) arg2 = -10.5 +// lldb-check:[...] -10.5 // lldb-command:continue #![feature(omit_gdb_pretty_printer_section)] diff --git a/tests/debuginfo/generic-static-method-on-struct-and-enum.rs b/tests/debuginfo/generic-static-method-on-struct-and-enum.rs index 98608e32914..79fe2144cf4 100644 --- a/tests/debuginfo/generic-static-method-on-struct-and-enum.rs +++ b/tests/debuginfo/generic-static-method-on-struct-and-enum.rs @@ -1,5 +1,3 @@ -//@ min-lldb-version: 310 - //@ compile-flags:-g // gdb-command:run diff --git a/tests/debuginfo/generic-struct-style-enum.rs b/tests/debuginfo/generic-struct-style-enum.rs index 7d929b91064..a5529ab8027 100644 --- a/tests/debuginfo/generic-struct-style-enum.rs +++ b/tests/debuginfo/generic-struct-style-enum.rs @@ -1,24 +1,19 @@ -//@ min-lldb-version: 310 - -// Require a gdb that can read DW_TAG_variant_part. -//@ min-gdb-version: 8.2 - //@ compile-flags:-g // gdb-command:set print union on // gdb-command:run // gdb-command:print case1 -// gdbr-check:$1 = generic_struct_style_enum::Regular<u16, u32, i64>::Case1{a: 0, b: 31868, c: 31868, d: 31868, e: 31868} +// gdb-check:$1 = generic_struct_style_enum::Regular<u16, u32, i64>::Case1{a: 0, b: 31868, c: 31868, d: 31868, e: 31868} // gdb-command:print case2 -// gdbr-check:$2 = generic_struct_style_enum::Regular<i16, u32, i64>::Case2{a: 0, b: 286331153, c: 286331153} +// gdb-check:$2 = generic_struct_style_enum::Regular<i16, u32, i64>::Case2{a: 0, b: 286331153, c: 286331153} // gdb-command:print case3 -// gdbr-check:$3 = generic_struct_style_enum::Regular<u16, i32, u64>::Case3{a: 0, b: 6438275382588823897} +// gdb-check:$3 = generic_struct_style_enum::Regular<u16, i32, u64>::Case3{a: 0, b: 6438275382588823897} // gdb-command:print univariant -// gdbr-check:$4 = generic_struct_style_enum::Univariant<i32>::TheOnlyCase{a: -1} +// gdb-check:$4 = generic_struct_style_enum::Univariant<i32>::TheOnlyCase{a: -1} #![feature(omit_gdb_pretty_printer_section)] diff --git a/tests/debuginfo/generic-struct.rs b/tests/debuginfo/generic-struct.rs index 8c74aa42d2c..f26d823d4f2 100644 --- a/tests/debuginfo/generic-struct.rs +++ b/tests/debuginfo/generic-struct.rs @@ -1,7 +1,3 @@ -// Some versions of the non-rust-enabled LLDB print the wrong generic -// parameter type names in this test. -//@ needs-rust-lldb - //@ compile-flags:-g // === GDB TESTS =================================================================================== @@ -9,35 +5,27 @@ // gdb-command:run // gdb-command:print int_int -// gdbg-check:$1 = {key = 0, value = 1} -// gdbr-check:$1 = generic_struct::AGenericStruct<i32, i32> {key: 0, value: 1} +// gdb-check:$1 = generic_struct::AGenericStruct<i32, i32> {key: 0, value: 1} // gdb-command:print int_float -// gdbg-check:$2 = {key = 2, value = 3.5} -// gdbr-check:$2 = generic_struct::AGenericStruct<i32, f64> {key: 2, value: 3.5} +// gdb-check:$2 = generic_struct::AGenericStruct<i32, f64> {key: 2, value: 3.5} // gdb-command:print float_int -// gdbg-check:$3 = {key = 4.5, value = 5} -// gdbr-check:$3 = generic_struct::AGenericStruct<f64, i32> {key: 4.5, value: 5} +// gdb-check:$3 = generic_struct::AGenericStruct<f64, i32> {key: 4.5, value: 5} // gdb-command:print float_int_float -// gdbg-check:$4 = {key = 6.5, value = {key = 7, value = 8.5}} -// gdbr-check:$4 = generic_struct::AGenericStruct<f64, generic_struct::AGenericStruct<i32, f64>> {key: 6.5, value: generic_struct::AGenericStruct<i32, f64> {key: 7, value: 8.5}} +// gdb-check:$4 = generic_struct::AGenericStruct<f64, generic_struct::AGenericStruct<i32, f64>> {key: 6.5, value: generic_struct::AGenericStruct<i32, f64> {key: 7, value: 8.5}} // === LLDB TESTS ================================================================================== // lldb-command:run // lldb-command:v int_int -// lldbg-check:[...] AGenericStruct<i32, i32> { key: 0, value: 1 } -// lldbr-check:(generic_struct::AGenericStruct<i32, i32>) int_int = AGenericStruct<i32, i32> { key: 0, value: 1 } +// lldb-check:[...]AGenericStruct<int, int>) int_int = { key = 0 value = 1 } // lldb-command:v int_float -// lldbg-check:[...] AGenericStruct<i32, f64> { key: 2, value: 3.5 } -// lldbr-check:(generic_struct::AGenericStruct<i32, f64>) int_float = AGenericStruct<i32, f64> { key: 2, value: 3.5 } +// lldb-check:[...]AGenericStruct<int, double>) int_float = { key = 2 value = 3.5 } // lldb-command:v float_int -// lldbg-check:[...] AGenericStruct<f64, i32> { key: 4.5, value: 5 } -// lldbr-check:(generic_struct::AGenericStruct<f64, i32>) float_int = AGenericStruct<f64, i32> { key: 4.5, value: 5 } +// lldb-check:[...]AGenericStruct<double, int>) float_int = { key = 4.5 value = 5 } // lldb-command:v float_int_float -// lldbg-check:[...] AGenericStruct<f64, generic_struct::AGenericStruct<i32, f64>> { key: 6.5, value: AGenericStruct<i32, f64> { key: 7, value: 8.5 } } -// lldbr-check:(generic_struct::AGenericStruct<f64, generic_struct::AGenericStruct<i32, f64>>) float_int_float = AGenericStruct<f64, generic_struct::AGenericStruct<i32, f64>> { key: 6.5, value: AGenericStruct<i32, f64> { key: 7, value: 8.5 } } +// lldb-check:[...]AGenericStruct<double, generic_struct::AGenericStruct<int, double> >) float_int_float = { key = 6.5 value = { key = 7 value = 8.5 } } // === CDB TESTS =================================================================================== diff --git a/tests/debuginfo/generic-tuple-style-enum.rs b/tests/debuginfo/generic-tuple-style-enum.rs index af90c6ce30e..4a5996645cb 100644 --- a/tests/debuginfo/generic-tuple-style-enum.rs +++ b/tests/debuginfo/generic-tuple-style-enum.rs @@ -1,7 +1,3 @@ -// Require a gdb or lldb that can read DW_TAG_variant_part. -//@ min-gdb-version: 8.2 -//@ needs-rust-lldb - //@ compile-flags:-g // === GDB TESTS =================================================================================== @@ -10,16 +6,16 @@ // gdb-command:run // gdb-command:print case1 -// gdbr-check:$1 = generic_tuple_style_enum::Regular<u16, u32, u64>::Case1(0, 31868, 31868, 31868, 31868) +// gdb-check:$1 = generic_tuple_style_enum::Regular<u16, u32, u64>::Case1(0, 31868, 31868, 31868, 31868) // gdb-command:print case2 -// gdbr-check:$2 = generic_tuple_style_enum::Regular<i16, i32, i64>::Case2(0, 286331153, 286331153) +// gdb-check:$2 = generic_tuple_style_enum::Regular<i16, i32, i64>::Case2(0, 286331153, 286331153) // gdb-command:print case3 -// gdbr-check:$3 = generic_tuple_style_enum::Regular<i16, i32, i64>::Case3(0, 6438275382588823897) +// gdb-check:$3 = generic_tuple_style_enum::Regular<i16, i32, i64>::Case3(0, 6438275382588823897) // gdb-command:print univariant -// gdbr-check:$4 = generic_tuple_style_enum::Univariant<i64>::TheOnlyCase(-1) +// gdb-check:$4 = generic_tuple_style_enum::Univariant<i64>::TheOnlyCase(-1) // === LLDB TESTS ================================================================================== @@ -27,16 +23,12 @@ // lldb-command:run // lldb-command:v case1 -// lldbr-check:(generic_tuple_style_enum::Regular<u16, u32, u64>::Case1) case1 = { __0 = 0 __1 = 31868 __2 = 31868 __3 = 31868 __4 = 31868 } // lldb-command:v case2 -// lldbr-check:(generic_tuple_style_enum::Regular<i16, i32, i64>::Case2) case2 = Regular<i16, i32, i64>::Case2 { Case1: 0, Case2: 286331153, Case3: 286331153 } // lldb-command:v case3 -// lldbr-check:(generic_tuple_style_enum::Regular<i16, i32, i64>::Case3) case3 = Regular<i16, i32, i64>::Case3 { Case1: 0, Case2: 6438275382588823897 } // lldb-command:v univariant -// lldbr-check:(generic_tuple_style_enum::Univariant<i64>) univariant = Univariant<i64> { TheOnlyCase: Univariant<i64>::TheOnlyCase(-1) } #![feature(omit_gdb_pretty_printer_section)] #![omit_gdb_pretty_printer_section] diff --git a/tests/debuginfo/include_string.rs b/tests/debuginfo/include_string.rs index 628ac92fe34..704b85e1ac2 100644 --- a/tests/debuginfo/include_string.rs +++ b/tests/debuginfo/include_string.rs @@ -1,4 +1,3 @@ -//@ min-lldb-version: 310 //@ ignore-gdb-version: 15.0 - 99.0 // ^ test temporarily disabled as it fails under gdb 15 @@ -18,14 +17,11 @@ // lldb-command:run // lldb-command:v string1.length -// lldbg-check:[...] 48 -// lldbr-check:(usize) length = 48 +// lldb-check:[...] 48 // lldb-command:v string2.length -// lldbg-check:[...] 49 -// lldbr-check:(usize) length = 49 +// lldb-check:[...] 49 // lldb-command:v string3.length -// lldbg-check:[...] 50 -// lldbr-check:(usize) length = 50 +// lldb-check:[...] 50 // lldb-command:continue diff --git a/tests/debuginfo/issue-12886.rs b/tests/debuginfo/issue-12886.rs index c6cf0dd4e05..48250e88537 100644 --- a/tests/debuginfo/issue-12886.rs +++ b/tests/debuginfo/issue-12886.rs @@ -1,4 +1,3 @@ -//@ ignore-windows failing on 64-bit bots FIXME #17638 //@ ignore-lldb //@ ignore-aarch64 @@ -6,7 +5,7 @@ // gdb-command:run // gdb-command:next -// gdb-check:[...]24[...]let s = Some(5).unwrap(); // #break +// gdb-check:[...]23[...]let s = Some(5).unwrap(); // #break // gdb-command:continue #![feature(omit_gdb_pretty_printer_section)] diff --git a/tests/debuginfo/issue-13213.rs b/tests/debuginfo/issue-13213.rs index 7ef9178ce9d..b43a6f90ffc 100644 --- a/tests/debuginfo/issue-13213.rs +++ b/tests/debuginfo/issue-13213.rs @@ -1,4 +1,3 @@ -//@ min-lldb-version: 310 //@ ignore-cdb: Fails with exit code 0xc0000135 ("the application failed to initialize properly") //@ aux-build:issue-13213-aux.rs diff --git a/tests/debuginfo/issue-14411.rs b/tests/debuginfo/issue-14411.rs index 3258fec1e87..7da5fb16d44 100644 --- a/tests/debuginfo/issue-14411.rs +++ b/tests/debuginfo/issue-14411.rs @@ -1,5 +1,3 @@ -//@ min-lldb-version: 310 - //@ compile-flags:-g // No debugger interaction required: just make sure it compiles without diff --git a/tests/debuginfo/issue-22656.rs b/tests/debuginfo/issue-22656.rs index 5a5442acd95..eb0b38cfa4d 100644 --- a/tests/debuginfo/issue-22656.rs +++ b/tests/debuginfo/issue-22656.rs @@ -2,7 +2,6 @@ // when trying to handle a Vec<> or anything else that contains zero-sized // fields. -//@ min-lldb-version: 310 //@ ignore-gdb //@ compile-flags:-g @@ -11,12 +10,9 @@ // lldb-command:run // lldb-command:v v -// lldbg-check:[...] size=3 { [0] = 1 [1] = 2 [2] = 3 } -// lldbr-check:(alloc::vec::Vec<i32>) v = size=3 { [0] = 1 [1] = 2 [2] = 3 } +// lldb-check:[...] size=3 { [0] = 1 [1] = 2 [2] = 3 } // lldb-command:v zs -// lldbg-check:[...] { x = y = 123 z = w = 456 } -// lldbr-check:(issue_22656::StructWithZeroSizedField) zs = { x = y = 123 z = w = 456 } -// lldbr-command:continue +// lldb-check:[...] { x = y = 123 z = w = 456 } #![allow(unused_variables)] #![allow(dead_code)] diff --git a/tests/debuginfo/issue-57822.rs b/tests/debuginfo/issue-57822.rs index cadd9b542e9..7abac1c14d3 100644 --- a/tests/debuginfo/issue-57822.rs +++ b/tests/debuginfo/issue-57822.rs @@ -1,8 +1,6 @@ // This test makes sure that the LLDB pretty printer does not throw an exception // for nested closures and coroutines. -// Require a gdb that can read DW_TAG_variant_part. -//@ min-gdb-version: 8.2 //@ min-lldb-version: 1800 //@ compile-flags:-g @@ -21,10 +19,10 @@ // lldb-command:run // lldb-command:v g -// lldbg-check:(issue_57822::main::{closure_env#1}) g = { f = { x = 1 } } +// lldb-check:(issue_57822::main::{closure_env#1}) g = { f = { x = 1 } } // lldb-command:v b -// lldbg-check:(issue_57822::main::{coroutine_env#3}) b = { value = { a = { value = { y = 2 } $discr$ = '\x02' } } $discr$ = '\x02' } +// lldb-check:(issue_57822::main::{coroutine_env#3}) b = { value = { a = { value = { y = 2 } $discr$ = '\x02' } } $discr$ = '\x02' } #![feature(omit_gdb_pretty_printer_section, coroutines, coroutine_trait, stmt_expr_attributes)] #![omit_gdb_pretty_printer_section] diff --git a/tests/debuginfo/issue-7712.rs b/tests/debuginfo/issue-7712.rs index 35e6b10c4e5..11143f79161 100644 --- a/tests/debuginfo/issue-7712.rs +++ b/tests/debuginfo/issue-7712.rs @@ -1,5 +1,4 @@ //@ compile-flags:-C debuginfo=1 -//@ min-lldb-version: 310 pub trait TraitWithDefaultMethod : Sized { fn method(self) { diff --git a/tests/debuginfo/lexical-scope-in-for-loop.rs b/tests/debuginfo/lexical-scope-in-for-loop.rs index 1b1f106fece..08f244f89a0 100644 --- a/tests/debuginfo/lexical-scope-in-for-loop.rs +++ b/tests/debuginfo/lexical-scope-in-for-loop.rs @@ -1,5 +1,3 @@ -//@ min-lldb-version: 310 - //@ compile-flags:-g // === GDB TESTS =================================================================================== @@ -45,41 +43,34 @@ // FIRST ITERATION // lldb-command:v x -// lldbg-check:[...] 1 -// lldbr-check:(i32) x = 1 +// lldb-check:[...] 1 // lldb-command:continue // lldb-command:v x -// lldbg-check:[...] -1 -// lldbr-check:(i32) x = -1 +// lldb-check:[...] -1 // lldb-command:continue // SECOND ITERATION // lldb-command:v x -// lldbg-check:[...] 2 -// lldbr-check:(i32) x = 2 +// lldb-check:[...] 2 // lldb-command:continue // lldb-command:v x -// lldbg-check:[...] -2 -// lldbr-check:(i32) x = -2 +// lldb-check:[...] -2 // lldb-command:continue // THIRD ITERATION // lldb-command:v x -// lldbg-check:[...] 3 -// lldbr-check:(i32) x = 3 +// lldb-check:[...] 3 // lldb-command:continue // lldb-command:v x -// lldbg-check:[...] -3 -// lldbr-check:(i32) x = -3 +// lldb-check:[...] -3 // lldb-command:continue // AFTER LOOP // lldb-command:v x -// lldbg-check:[...] 1000000 -// lldbr-check:(i32) x = 1000000 +// lldb-check:[...] 1000000 // lldb-command:continue #![feature(omit_gdb_pretty_printer_section)] diff --git a/tests/debuginfo/lexical-scope-in-if.rs b/tests/debuginfo/lexical-scope-in-if.rs index d472a50f697..c0e1f2f3e05 100644 --- a/tests/debuginfo/lexical-scope-in-if.rs +++ b/tests/debuginfo/lexical-scope-in-if.rs @@ -1,5 +1,3 @@ -//@ min-lldb-version: 310 - //@ compile-flags:-g // === GDB TESTS =================================================================================== @@ -69,74 +67,58 @@ // BEFORE if // lldb-command:v x -// lldbg-check:[...] 999 -// lldbr-check:(i32) x = 999 +// lldb-check:[...] 999 // lldb-command:v y -// lldbg-check:[...] -1 -// lldbr-check:(i32) y = -1 +// lldb-check:[...] -1 // lldb-command:continue // AT BEGINNING of 'then' block // lldb-command:v x -// lldbg-check:[...] 999 -// lldbr-check:(i32) x = 999 +// lldb-check:[...] 999 // lldb-command:v y -// lldbg-check:[...] -1 -// lldbr-check:(i32) y = -1 +// lldb-check:[...] -1 // lldb-command:continue // AFTER 1st redeclaration of 'x' // lldb-command:v x -// lldbg-check:[...] 1001 -// lldbr-check:(i32) x = 1001 +// lldb-check:[...] 1001 // lldb-command:v y -// lldbg-check:[...] -1 -// lldbr-check:(i32) y = -1 +// lldb-check:[...] -1 // lldb-command:continue // AFTER 2st redeclaration of 'x' // lldb-command:v x -// lldbg-check:[...] 1002 -// lldbr-check:(i32) x = 1002 +// lldb-check:[...] 1002 // lldb-command:v y -// lldbg-check:[...] 1003 -// lldbr-check:(i32) y = 1003 +// lldb-check:[...] 1003 // lldb-command:continue // AFTER 1st if expression // lldb-command:v x -// lldbg-check:[...] 999 -// lldbr-check:(i32) x = 999 +// lldb-check:[...] 999 // lldb-command:v y -// lldbg-check:[...] -1 -// lldbr-check:(i32) y = -1 +// lldb-check:[...] -1 // lldb-command:continue // BEGINNING of else branch // lldb-command:v x -// lldbg-check:[...] 999 -// lldbr-check:(i32) x = 999 +// lldb-check:[...] 999 // lldb-command:v y -// lldbg-check:[...] -1 -// lldbr-check:(i32) y = -1 +// lldb-check:[...] -1 // lldb-command:continue // BEGINNING of else branch // lldb-command:v x -// lldbg-check:[...] 1004 -// lldbr-check:(i32) x = 1004 +// lldb-check:[...] 1004 // lldb-command:v y -// lldbg-check:[...] 1005 -// lldbr-check:(i32) y = 1005 +// lldb-check:[...] 1005 // lldb-command:continue // BEGINNING of else branch // lldb-command:v x -// lldbg-check:[...] 999 -// lldbr-check:(i32) x = 999 +// lldb-check:[...] 999 // lldb-command:v y -// lldbg-check:[...] -1 -// lldbr-check:(i32) y = -1 +// lldb-check:[...] -1 // lldb-command:continue #![feature(omit_gdb_pretty_printer_section)] diff --git a/tests/debuginfo/lexical-scope-in-match.rs b/tests/debuginfo/lexical-scope-in-match.rs index d5f0fcbe892..9169c19c6a3 100644 --- a/tests/debuginfo/lexical-scope-in-match.rs +++ b/tests/debuginfo/lexical-scope-in-match.rs @@ -1,5 +1,3 @@ -//@ min-lldb-version: 310 - //@ compile-flags:-g // === GDB TESTS =================================================================================== @@ -64,73 +62,55 @@ // lldb-command:run // lldb-command:v shadowed -// lldbg-check:[...] 231 -// lldbr-check:(i32) shadowed = 231 +// lldb-check:[...] 231 // lldb-command:v not_shadowed -// lldbg-check:[...] 232 -// lldbr-check:(i32) not_shadowed = 232 +// lldb-check:[...] 232 // lldb-command:continue // lldb-command:v shadowed -// lldbg-check:[...] 233 -// lldbr-check:(i32) shadowed = 233 +// lldb-check:[...] 233 // lldb-command:v not_shadowed -// lldbg-check:[...] 232 -// lldbr-check:(i32) not_shadowed = 232 +// lldb-check:[...] 232 // lldb-command:v local_to_arm -// lldbg-check:[...] 234 -// lldbr-check:(i32) local_to_arm = 234 +// lldb-check:[...] 234 // lldb-command:continue // lldb-command:v shadowed -// lldbg-check:[...] 236 -// lldbr-check:(i32) shadowed = 236 +// lldb-check:[...] 236 // lldb-command:v not_shadowed -// lldbg-check:[...] 232 -// lldbr-check:(i32) not_shadowed = 232 +// lldb-check:[...] 232 // lldb-command:continue // lldb-command:v shadowed -// lldbg-check:[...] 237 -// lldbr-check:(isize) shadowed = 237 +// lldb-check:[...] 237 // lldb-command:v not_shadowed -// lldbg-check:[...] 232 -// lldbr-check:(i32) not_shadowed = 232 +// lldb-check:[...] 232 // lldb-command:v local_to_arm -// lldbg-check:[...] 238 -// lldbr-check:(isize) local_to_arm = 238 +// lldb-check:[...] 238 // lldb-command:continue // lldb-command:v shadowed -// lldbg-check:[...] 239 -// lldbr-check:(isize) shadowed = 239 +// lldb-check:[...] 239 // lldb-command:v not_shadowed -// lldbg-check:[...] 232 -// lldbr-check:(i32) not_shadowed = 232 +// lldb-check:[...] 232 // lldb-command:continue // lldb-command:v shadowed -// lldbg-check:[...] 241 -// lldbr-check:(isize) shadowed = 241 +// lldb-check:[...] 241 // lldb-command:v not_shadowed -// lldbg-check:[...] 232 -// lldbr-check:(i32) not_shadowed = 232 +// lldb-check:[...] 232 // lldb-command:continue // lldb-command:v shadowed -// lldbg-check:[...] 243 -// lldbr-check:(i32) shadowed = 243 +// lldb-check:[...] 243 // lldb-command:v *local_to_arm -// lldbg-check:[...] 244 -// lldbr-check:(i32) *local_to_arm = 244 +// lldb-check:[...] 244 // lldb-command:continue // lldb-command:v shadowed -// lldbg-check:[...] 231 -// lldbr-check:(i32) shadowed = 231 +// lldb-check:[...] 231 // lldb-command:v not_shadowed -// lldbg-check:[...] 232 -// lldbr-check:(i32) not_shadowed = 232 +// lldb-check:[...] 232 // lldb-command:continue #![feature(omit_gdb_pretty_printer_section)] diff --git a/tests/debuginfo/lexical-scope-in-parameterless-closure.rs b/tests/debuginfo/lexical-scope-in-parameterless-closure.rs index fa2cd281c80..dd6da95d388 100644 --- a/tests/debuginfo/lexical-scope-in-parameterless-closure.rs +++ b/tests/debuginfo/lexical-scope-in-parameterless-closure.rs @@ -1,5 +1,3 @@ -//@ min-lldb-version: 310 - //@ compile-flags:-C debuginfo=1 // gdb-command:run diff --git a/tests/debuginfo/lexical-scope-in-stack-closure.rs b/tests/debuginfo/lexical-scope-in-stack-closure.rs index 92582e10c42..d01162c39d6 100644 --- a/tests/debuginfo/lexical-scope-in-stack-closure.rs +++ b/tests/debuginfo/lexical-scope-in-stack-closure.rs @@ -1,5 +1,3 @@ -//@ min-lldb-version: 310 - //@ compile-flags:-g // === GDB TESTS =================================================================================== @@ -36,33 +34,27 @@ // lldb-command:run // lldb-command:v x -// lldbg-check:[...] false -// lldbr-check:(bool) x = false +// lldb-check:[...] false // lldb-command:continue // lldb-command:v x -// lldbg-check:[...] false -// lldbr-check:(bool) x = false +// lldb-check:[...] false // lldb-command:continue // lldb-command:v x -// lldbg-check:[...] 1000 -// lldbr-check:(isize) x = 1000 +// lldb-check:[...] 1000 // lldb-command:continue // lldb-command:v x -// lldbg-check:[...] 2.5 -// lldbr-check:(f64) x = 2.5 +// lldb-check:[...] 2.5 // lldb-command:continue // lldb-command:v x -// lldbg-check:[...] true -// lldbr-check:(bool) x = true +// lldb-check:[...] true // lldb-command:continue // lldb-command:v x -// lldbg-check:[...] false -// lldbr-check:(bool) x = false +// lldb-check:[...] false // lldb-command:continue #![feature(omit_gdb_pretty_printer_section)] diff --git a/tests/debuginfo/lexical-scope-in-unconditional-loop.rs b/tests/debuginfo/lexical-scope-in-unconditional-loop.rs index b1af018f3eb..dfec570218f 100644 --- a/tests/debuginfo/lexical-scope-in-unconditional-loop.rs +++ b/tests/debuginfo/lexical-scope-in-unconditional-loop.rs @@ -1,5 +1,3 @@ -//@ min-lldb-version: 310 - //@ compile-flags:-g // === GDB TESTS =================================================================================== @@ -68,70 +66,57 @@ // FIRST ITERATION // lldb-command:v x -// lldbg-check:[...] 0 -// lldbr-check:(i32) x = 0 +// lldb-check:[...] 0 // lldb-command:continue // lldb-command:v x -// lldbg-check:[...] 1 -// lldbr-check:(i32) x = 1 +// lldb-check:[...] 1 // lldb-command:continue // lldb-command:v x -// lldbg-check:[...] 101 -// lldbr-check:(i32) x = 101 +// lldb-check:[...] 101 // lldb-command:continue // lldb-command:v x -// lldbg-check:[...] 101 -// lldbr-check:(i32) x = 101 +// lldb-check:[...] 101 // lldb-command:continue // lldb-command:v x -// lldbg-check:[...] -987 -// lldbr-check:(i32) x = -987 +// lldb-check:[...] -987 // lldb-command:continue // lldb-command:v x -// lldbg-check:[...] 101 -// lldbr-check:(i32) x = 101 +// lldb-check:[...] 101 // lldb-command:continue // SECOND ITERATION // lldb-command:v x -// lldbg-check:[...] 1 -// lldbr-check:(i32) x = 1 +// lldb-check:[...] 1 // lldb-command:continue // lldb-command:v x -// lldbg-check:[...] 2 -// lldbr-check:(i32) x = 2 +// lldb-check:[...] 2 // lldb-command:continue // lldb-command:v x -// lldbg-check:[...] 102 -// lldbr-check:(i32) x = 102 +// lldb-check:[...] 102 // lldb-command:continue // lldb-command:v x -// lldbg-check:[...] 102 -// lldbr-check:(i32) x = 102 +// lldb-check:[...] 102 // lldb-command:continue // lldb-command:v x -// lldbg-check:[...] -987 -// lldbr-check:(i32) x = -987 +// lldb-check:[...] -987 // lldb-command:continue // lldb-command:v x -// lldbg-check:[...] 102 -// lldbr-check:(i32) x = 102 +// lldb-check:[...] 102 // lldb-command:continue // lldb-command:v x -// lldbg-check:[...] 2 -// lldbr-check:(i32) x = 2 +// lldb-check:[...] 2 // lldb-command:continue #![feature(omit_gdb_pretty_printer_section)] diff --git a/tests/debuginfo/lexical-scope-in-unique-closure.rs b/tests/debuginfo/lexical-scope-in-unique-closure.rs index a08c2af05cc..db84005121a 100644 --- a/tests/debuginfo/lexical-scope-in-unique-closure.rs +++ b/tests/debuginfo/lexical-scope-in-unique-closure.rs @@ -1,5 +1,3 @@ -//@ min-lldb-version: 310 - //@ compile-flags:-g // === GDB TESTS =================================================================================== @@ -36,33 +34,27 @@ // lldb-command:run // lldb-command:v x -// lldbg-check:[...] false -// lldbr-check:(bool) x = false +// lldb-check:[...] false // lldb-command:continue // lldb-command:v x -// lldbg-check:[...] false -// lldbr-check:(bool) x = false +// lldb-check:[...] false // lldb-command:continue // lldb-command:v x -// lldbg-check:[...] 1000 -// lldbr-check:(isize) x = 1000 +// lldb-check:[...] 1000 // lldb-command:continue // lldb-command:v x -// lldbg-check:[...] 2.5 -// lldbr-check:(f64) x = 2.5 +// lldb-check:[...] 2.5 // lldb-command:continue // lldb-command:v x -// lldbg-check:[...] true -// lldbr-check:(bool) x = true +// lldb-check:[...] true // lldb-command:continue // lldb-command:v x -// lldbg-check:[...] false -// lldbr-check:(bool) x = false +// lldb-check:[...] false // lldb-command:continue diff --git a/tests/debuginfo/lexical-scope-in-while.rs b/tests/debuginfo/lexical-scope-in-while.rs index bd885b5b10c..d6536d77545 100644 --- a/tests/debuginfo/lexical-scope-in-while.rs +++ b/tests/debuginfo/lexical-scope-in-while.rs @@ -1,5 +1,3 @@ -//@ min-lldb-version: 310 - //@ compile-flags:-g // === GDB TESTS =================================================================================== @@ -68,70 +66,57 @@ // FIRST ITERATION // lldb-command:v x -// lldbg-check:[...] 0 -// lldbr-check:(i32) x = 0 +// lldb-check:[...] 0 // lldb-command:continue // lldb-command:v x -// lldbg-check:[...] 1 -// lldbr-check:(i32) x = 1 +// lldb-check:[...] 1 // lldb-command:continue // lldb-command:v x -// lldbg-check:[...] 101 -// lldbr-check:(i32) x = 101 +// lldb-check:[...] 101 // lldb-command:continue // lldb-command:v x -// lldbg-check:[...] 101 -// lldbr-check:(i32) x = 101 +// lldb-check:[...] 101 // lldb-command:continue // lldb-command:v x -// lldbg-check:[...] -987 -// lldbr-check:(i32) x = -987 +// lldb-check:[...] -987 // lldb-command:continue // lldb-command:v x -// lldbg-check:[...] 101 -// lldbr-check:(i32) x = 101 +// lldb-check:[...] 101 // lldb-command:continue // SECOND ITERATION // lldb-command:v x -// lldbg-check:[...] 1 -// lldbr-check:(i32) x = 1 +// lldb-check:[...] 1 // lldb-command:continue // lldb-command:v x -// lldbg-check:[...] 2 -// lldbr-check:(i32) x = 2 +// lldb-check:[...] 2 // lldb-command:continue // lldb-command:v x -// lldbg-check:[...] 102 -// lldbr-check:(i32) x = 102 +// lldb-check:[...] 102 // lldb-command:continue // lldb-command:v x -// lldbg-check:[...] 102 -// lldbr-check:(i32) x = 102 +// lldb-check:[...] 102 // lldb-command:continue // lldb-command:v x -// lldbg-check:[...] -987 -// lldbr-check:(i32) x = -987 +// lldb-check:[...] -987 // lldb-command:continue // lldb-command:v x -// lldbg-check:[...] 102 -// lldbr-check:(i32) x = 102 +// lldb-check:[...] 102 // lldb-command:continue // lldb-command:v x -// lldbg-check:[...] 2 -// lldbr-check:(i32) x = 2 +// lldb-check:[...] 2 // lldb-command:continue #![feature(omit_gdb_pretty_printer_section)] diff --git a/tests/debuginfo/lexical-scope-with-macro.rs b/tests/debuginfo/lexical-scope-with-macro.rs index 7ea3dc62e45..6e8fef201ea 100644 --- a/tests/debuginfo/lexical-scope-with-macro.rs +++ b/tests/debuginfo/lexical-scope-with-macro.rs @@ -1,6 +1,3 @@ -//@ min-lldb-version: 310 -//@ ignore-lldb FIXME #48807 - //@ compile-flags:-g // === GDB TESTS =================================================================================== @@ -57,58 +54,48 @@ // lldb-command:run // lldb-command:v a -// lldbg-check:[...] 10 -// lldbr-check:(i32) a = 10 +// lldb-check:[...] 10 // lldb-command:v b -// lldbg-check:[...] 34 -// lldbr-check:(i32) b = 34 +// lldb-check:[...] 34 // lldb-command:continue // lldb-command:v a -// lldbg-check:[...] 890242 -// lldbr-check:(i32) a = 10 +// lldb-check:[...] 890242 // lldb-command:v b -// lldbg-check:[...] 34 -// lldbr-check:(i32) b = 34 +// lldb-check:[...] 34 // lldb-command:continue // lldb-command:v a -// lldbg-check:[...] 10 -// lldbr-check:(i32) a = 10 +// lldb-check:[...] 10 // lldb-command:v b -// lldbg-check:[...] 34 -// lldbr-check:(i32) b = 34 +// lldb-check:[...] 34 // lldb-command:continue // lldb-command:v a -// lldbg-check:[...] 102 -// lldbr-check:(i32) a = 10 +// lldb-check:[...] 102 // lldb-command:v b -// lldbg-check:[...] 34 -// lldbr-check:(i32) b = 34 +// lldb-check:[...] 34 // lldb-command:continue -// Don't test this with rust-enabled lldb for now; see issue #48807 -// lldbg-command:print a -// lldbg-check:[...] 110 -// lldbg-command:print b -// lldbg-check:[...] 34 -// lldbg-command:continue - -// lldbg-command:print a -// lldbg-check:[...] 10 -// lldbg-command:print b -// lldbg-check:[...] 34 -// lldbg-command:continue - -// lldbg-command:print a -// lldbg-check:[...] 10 -// lldbg-command:print b -// lldbg-check:[...] 34 -// lldbg-command:print c -// lldbg-check:[...] 400 -// lldbg-command:continue +// lldb-command:print a +// lldb-check:[...] 110 +// lldb-command:print b +// lldb-check:[...] 34 +// lldb-command:continue +// lldb-command:print a +// lldb-check:[...] 10 +// lldb-command:print b +// lldb-check:[...] 34 +// lldb-command:continue + +// lldb-command:print a +// lldb-check:[...] 10 +// lldb-command:print b +// lldb-check:[...] 34 +// lldb-command:print c +// lldb-check:[...] 400 +// lldb-command:continue #![feature(omit_gdb_pretty_printer_section)] #![omit_gdb_pretty_printer_section] diff --git a/tests/debuginfo/lexical-scopes-in-block-expression.rs b/tests/debuginfo/lexical-scopes-in-block-expression.rs index bd5a607586d..cd27c88db58 100644 --- a/tests/debuginfo/lexical-scopes-in-block-expression.rs +++ b/tests/debuginfo/lexical-scopes-in-block-expression.rs @@ -1,13 +1,10 @@ -//@ min-lldb-version: 310 - //@ compile-flags:-g // === GDB TESTS =================================================================================== // gdb-command:run -// gdbg-command:print 'lexical_scopes_in_block_expression::MUT_INT' -// gdbr-command:print lexical_scopes_in_block_expression::MUT_INT +// gdb-command:print lexical_scopes_in_block_expression::MUT_INT // gdb-check:$1 = 0 // STRUCT EXPRESSION @@ -19,8 +16,7 @@ // gdb-command:print val // gdb-check:$4 = 11 -// gdbg-command:print 'lexical_scopes_in_block_expression::MUT_INT' -// gdbr-command:print lexical_scopes_in_block_expression::MUT_INT +// gdb-command:print lexical_scopes_in_block_expression::MUT_INT // gdb-check:$5 = 1 // gdb-command:print ten // gdb-check:$6 = 10 @@ -41,8 +37,7 @@ // gdb-command:print val // gdb-check:$11 = 12 -// gdbg-command:print 'lexical_scopes_in_block_expression::MUT_INT' -// gdbr-command:print lexical_scopes_in_block_expression::MUT_INT +// gdb-command:print lexical_scopes_in_block_expression::MUT_INT // gdb-check:$12 = 2 // gdb-command:print ten // gdb-check:$13 = 10 @@ -63,8 +58,7 @@ // gdb-command:print val // gdb-check:$18 = 13 -// gdbg-command:print 'lexical_scopes_in_block_expression::MUT_INT' -// gdbr-command:print lexical_scopes_in_block_expression::MUT_INT +// gdb-command:print lexical_scopes_in_block_expression::MUT_INT // gdb-check:$19 = 3 // gdb-command:print ten // gdb-check:$20 = 10 @@ -85,8 +79,7 @@ // gdb-command:print val // gdb-check:$25 = 14 -// gdbg-command:print 'lexical_scopes_in_block_expression::MUT_INT' -// gdbr-command:print lexical_scopes_in_block_expression::MUT_INT +// gdb-command:print lexical_scopes_in_block_expression::MUT_INT // gdb-check:$26 = 4 // gdb-command:print ten // gdb-check:$27 = 10 @@ -107,8 +100,7 @@ // gdb-command:print val // gdb-check:$32 = 15 -// gdbg-command:print 'lexical_scopes_in_block_expression::MUT_INT' -// gdbr-command:print lexical_scopes_in_block_expression::MUT_INT +// gdb-command:print lexical_scopes_in_block_expression::MUT_INT // gdb-check:$33 = 5 // gdb-command:print ten // gdb-check:$34 = 10 @@ -129,8 +121,7 @@ // gdb-command:print val // gdb-check:$39 = 16 -// gdbg-command:print 'lexical_scopes_in_block_expression::MUT_INT' -// gdbr-command:print lexical_scopes_in_block_expression::MUT_INT +// gdb-command:print lexical_scopes_in_block_expression::MUT_INT // gdb-check:$40 = 6 // gdb-command:print ten // gdb-check:$41 = 10 @@ -152,8 +143,7 @@ // gdb-command:print val // gdb-check:$46 = 17 -// gdbg-command:print 'lexical_scopes_in_block_expression::MUT_INT' -// gdbr-command:print lexical_scopes_in_block_expression::MUT_INT +// gdb-command:print lexical_scopes_in_block_expression::MUT_INT // gdb-check:$47 = 7 // gdb-command:print ten // gdb-check:$48 = 10 @@ -174,8 +164,7 @@ // gdb-command:print val // gdb-check:$53 = 18 -// gdbg-command:print 'lexical_scopes_in_block_expression::MUT_INT' -// gdbr-command:print lexical_scopes_in_block_expression::MUT_INT +// gdb-command:print lexical_scopes_in_block_expression::MUT_INT // gdb-check:$54 = 8 // gdb-command:print ten // gdb-check:$55 = 10 @@ -194,203 +183,155 @@ // STRUCT EXPRESSION // lldb-command:v val -// lldbg-check:[...] -1 -// lldbr-check:(i32) val = -1 +// lldb-check:[...] -1 // lldb-command:v ten -// lldbg-check:[...] 10 -// lldbr-check:(isize) ten = 10 +// lldb-check:[...] 10 // lldb-command:continue // lldb-command:v val -// lldbg-check:[...] 11 -// lldbr-check:(isize) val = 11 +// lldb-check:[...] 11 // lldb-command:v ten -// lldbg-check:[...] 10 -// lldbr-check:(isize) ten = 10 +// lldb-check:[...] 10 // lldb-command:continue // lldb-command:v val -// lldbg-check:[...] -1 -// lldbr-check:(i32) val = -1 +// lldb-check:[...] -1 // lldb-command:v ten -// lldbg-check:[...] 10 -// lldbr-check:(isize) ten = 10 +// lldb-check:[...] 10 // lldb-command:continue // FUNCTION CALL // lldb-command:v val -// lldbg-check:[...] -1 -// lldbr-check:(i32) val = -1 +// lldb-check:[...] -1 // lldb-command:v ten -// lldbg-check:[...] 10 -// lldbr-check:(isize) ten = 10 +// lldb-check:[...] 10 // lldb-command:continue // lldb-command:v val -// lldbg-check:[...] 12 -// lldbr-check:(isize) val = 12 +// lldb-check:[...] 12 // lldb-command:v ten -// lldbg-check:[...] 10 -// lldbr-check:(isize) ten = 10 +// lldb-check:[...] 10 // lldb-command:continue // lldb-command:v val -// lldbg-check:[...] -1 -// lldbr-check:(i32) val = -1 +// lldb-check:[...] -1 // lldb-command:v ten -// lldbg-check:[...] 10 -// lldbr-check:(isize) ten = 10 +// lldb-check:[...] 10 // lldb-command:continue // TUPLE EXPRESSION // lldb-command:v val -// lldbg-check:[...] -1 -// lldbr-check:(i32) val = -1 +// lldb-check:[...] -1 // lldb-command:v ten -// lldbg-check:[...] 10 -// lldbr-check:(isize) ten = 10 +// lldb-check:[...] 10 // lldb-command:continue // lldb-command:v val -// lldbg-check:[...] 13 -// lldbr-check:(isize) val = 13 +// lldb-check:[...] 13 // lldb-command:v ten -// lldbg-check:[...] 10 -// lldbr-check:(isize) ten = 10 +// lldb-check:[...] 10 // lldb-command:continue // lldb-command:v val -// lldbg-check:[...] -1 -// lldbr-check:(i32) val = -1 +// lldb-check:[...] -1 // lldb-command:v ten -// lldbg-check:[...] 10 -// lldbr-check:(isize) ten = 10 +// lldb-check:[...] 10 // lldb-command:continue // VEC EXPRESSION // lldb-command:v val -// lldbg-check:[...] -1 -// lldbr-check:(i32) val = -1 +// lldb-check:[...] -1 // lldb-command:v ten -// lldbg-check:[...] 10 -// lldbr-check:(isize) ten = 10 +// lldb-check:[...] 10 // lldb-command:continue // lldb-command:v val -// lldbg-check:[...] 14 -// lldbr-check:(isize) val = 14 +// lldb-check:[...] 14 // lldb-command:v ten -// lldbg-check:[...] 10 -// lldbr-check:(isize) ten = 10 +// lldb-check:[...] 10 // lldb-command:continue // lldb-command:v val -// lldbg-check:[...] -1 -// lldbr-check:(i32) val = -1 +// lldb-check:[...] -1 // lldb-command:v ten -// lldbg-check:[...] 10 -// lldbr-check:(isize) ten = 10 +// lldb-check:[...] 10 // lldb-command:continue // REPEAT VEC EXPRESSION // lldb-command:v val -// lldbg-check:[...] -1 -// lldbr-check:(i32) val = -1 +// lldb-check:[...] -1 // lldb-command:v ten -// lldbg-check:[...] 10 -// lldbr-check:(isize) ten = 10 +// lldb-check:[...] 10 // lldb-command:continue // lldb-command:v val -// lldbg-check:[...] 15 -// lldbr-check:(isize) val = 15 +// lldb-check:[...] 15 // lldb-command:v ten -// lldbg-check:[...] 10 -// lldbr-check:(isize) ten = 10 +// lldb-check:[...] 10 // lldb-command:continue // lldb-command:v val -// lldbg-check:[...] -1 -// lldbr-check:(i32) val = -1 +// lldb-check:[...] -1 // lldb-command:v ten -// lldbg-check:[...] 10 -// lldbr-check:(isize) ten = 10 +// lldb-check:[...] 10 // lldb-command:continue // ASSIGNMENT EXPRESSION // lldb-command:v val -// lldbg-check:[...] -1 -// lldbr-check:(i32) val = -1 +// lldb-check:[...] -1 // lldb-command:v ten -// lldbg-check:[...] 10 -// lldbr-check:(isize) ten = 10 +// lldb-check:[...] 10 // lldb-command:continue // lldb-command:v val -// lldbg-check:[...] 16 -// lldbr-check:(isize) val = 16 +// lldb-check:[...] 16 // lldb-command:v ten -// lldbg-check:[...] 10 -// lldbr-check:(isize) ten = 10 +// lldb-check:[...] 10 // lldb-command:continue // lldb-command:v val -// lldbg-check:[...] -1 -// lldbr-check:(i32) val = -1 +// lldb-check:[...] -1 // lldb-command:v ten -// lldbg-check:[...] 10 -// lldbr-check:(isize) ten = 10 +// lldb-check:[...] 10 // lldb-command:continue // ARITHMETIC EXPRESSION // lldb-command:v val -// lldbg-check:[...] -1 -// lldbr-check:(i32) val = -1 +// lldb-check:[...] -1 // lldb-command:v ten -// lldbg-check:[...] 10 -// lldbr-check:(isize) ten = 10 +// lldb-check:[...] 10 // lldb-command:continue // lldb-command:v val -// lldbg-check:[...] 17 -// lldbr-check:(isize) val = 17 +// lldb-check:[...] 17 // lldb-command:v ten -// lldbg-check:[...] 10 -// lldbr-check:(isize) ten = 10 +// lldb-check:[...] 10 // lldb-command:continue // lldb-command:v val -// lldbg-check:[...] -1 -// lldbr-check:(i32) val = -1 +// lldb-check:[...] -1 // lldb-command:v ten -// lldbg-check:[...] 10 -// lldbr-check:(isize) ten = 10 +// lldb-check:[...] 10 // lldb-command:continue // INDEX EXPRESSION // lldb-command:v val -// lldbg-check:[...] -1 -// lldbr-check:(i32) val = -1 +// lldb-check:[...] -1 // lldb-command:v ten -// lldbg-check:[...] 10 -// lldbr-check:(isize) ten = 10 +// lldb-check:[...] 10 // lldb-command:continue // lldb-command:v val -// lldbg-check:[...] 18 -// lldbr-check:(isize) val = 18 +// lldb-check:[...] 18 // lldb-command:v ten -// lldbg-check:[...] 10 -// lldbr-check:(isize) ten = 10 +// lldb-check:[...] 10 // lldb-command:continue // lldb-command:v val -// lldbg-check:[...] -1 -// lldbr-check:(i32) val = -1 +// lldb-check:[...] -1 // lldb-command:v ten -// lldbg-check:[...] 10 -// lldbr-check:(isize) ten = 10 +// lldb-check:[...] 10 // lldb-command:continue #![allow(unused_variables)] diff --git a/tests/debuginfo/limited-debuginfo.rs b/tests/debuginfo/limited-debuginfo.rs index 2e49acd2401..fb453d8078c 100644 --- a/tests/debuginfo/limited-debuginfo.rs +++ b/tests/debuginfo/limited-debuginfo.rs @@ -4,14 +4,10 @@ // Make sure functions have proper names // gdb-command:info functions -// gdbg-check:[...]void[...]main([...]); -// gdbr-check:fn limited_debuginfo::main(); -// gdbg-check:[...]void[...]some_function([...]); -// gdbr-check:fn limited_debuginfo::some_function(); -// gdbg-check:[...]void[...]some_other_function([...]); -// gdbr-check:fn limited_debuginfo::some_other_function(); -// gdbg-check:[...]void[...]zzz([...]); -// gdbr-check:fn limited_debuginfo::zzz(); +// gdb-check:fn limited_debuginfo::main(); +// gdb-check:fn limited_debuginfo::some_function(); +// gdb-check:fn limited_debuginfo::some_other_function(); +// gdb-check:fn limited_debuginfo::zzz(); // gdb-command:run diff --git a/tests/debuginfo/macro-stepping.rs b/tests/debuginfo/macro-stepping.rs index 3edac3c7832..35bb6de4fef 100644 --- a/tests/debuginfo/macro-stepping.rs +++ b/tests/debuginfo/macro-stepping.rs @@ -1,4 +1,3 @@ -//@ ignore-windows //@ ignore-android //@ ignore-aarch64 //@ min-lldb-version: 1800 diff --git a/tests/debuginfo/method-on-enum.rs b/tests/debuginfo/method-on-enum.rs index 7bee54451aa..a570144450d 100644 --- a/tests/debuginfo/method-on-enum.rs +++ b/tests/debuginfo/method-on-enum.rs @@ -9,8 +9,7 @@ // STACK BY REF // gdb-command:print *self -// gdbg-check:$1 = {{RUST$ENUM$DISR = Variant2, [...]}, {RUST$ENUM$DISR = Variant2, __0 = 117901063}} -// gdbr-check:$1 = method_on_enum::Enum::Variant2(117901063) +// gdb-check:$1 = method_on_enum::Enum::Variant2(117901063) // gdb-command:print arg1 // gdb-check:$2 = -1 // gdb-command:print arg2 @@ -19,8 +18,7 @@ // STACK BY VAL // gdb-command:print self -// gdbg-check:$4 = {{RUST$ENUM$DISR = Variant2, [...]}, {RUST$ENUM$DISR = Variant2, __0 = 117901063}} -// gdbr-check:$4 = method_on_enum::Enum::Variant2(117901063) +// gdb-check:$4 = method_on_enum::Enum::Variant2(117901063) // gdb-command:print arg1 // gdb-check:$5 = -3 // gdb-command:print arg2 @@ -29,8 +27,7 @@ // OWNED BY REF // gdb-command:print *self -// gdbg-check:$7 = {{RUST$ENUM$DISR = Variant1, x = 1799, y = 1799}, {RUST$ENUM$DISR = Variant1, [...]}} -// gdbr-check:$7 = method_on_enum::Enum::Variant1{x: 1799, y: 1799} +// gdb-check:$7 = method_on_enum::Enum::Variant1{x: 1799, y: 1799} // gdb-command:print arg1 // gdb-check:$8 = -5 // gdb-command:print arg2 @@ -39,8 +36,7 @@ // OWNED BY VAL // gdb-command:print self -// gdbg-check:$10 = {{RUST$ENUM$DISR = Variant1, x = 1799, y = 1799}, {RUST$ENUM$DISR = Variant1, [...]}} -// gdbr-check:$10 = method_on_enum::Enum::Variant1{x: 1799, y: 1799} +// gdb-check:$10 = method_on_enum::Enum::Variant1{x: 1799, y: 1799} // gdb-command:print arg1 // gdb-check:$11 = -7 // gdb-command:print arg2 @@ -49,8 +45,7 @@ // OWNED MOVED // gdb-command:print *self -// gdbg-check:$13 = {{RUST$ENUM$DISR = Variant1, x = 1799, y = 1799}, {RUST$ENUM$DISR = Variant1, [...]}} -// gdbr-check:$13 = method_on_enum::Enum::Variant1{x: 1799, y: 1799} +// gdb-check:$13 = method_on_enum::Enum::Variant1{x: 1799, y: 1799} // gdb-command:print arg1 // gdb-check:$14 = -9 // gdb-command:print arg2 diff --git a/tests/debuginfo/method-on-generic-struct.rs b/tests/debuginfo/method-on-generic-struct.rs index 64ef0e6bb0c..1e6c9d66178 100644 --- a/tests/debuginfo/method-on-generic-struct.rs +++ b/tests/debuginfo/method-on-generic-struct.rs @@ -1,7 +1,3 @@ -// Some versions of the non-rust-enabled LLDB print the wrong generic -// parameter type names in this test. -//@ needs-rust-lldb - //@ compile-flags:-g // === GDB TESTS =================================================================================== @@ -10,8 +6,7 @@ // STACK BY REF // gdb-command:print *self -// gdbg-check:$1 = {x = {__0 = 8888, __1 = -8888}} -// gdbr-check:$1 = method_on_generic_struct::Struct<(u32, i32)> {x: (8888, -8888)} +// gdb-check:$1 = method_on_generic_struct::Struct<(u32, i32)> {x: (8888, -8888)} // gdb-command:print arg1 // gdb-check:$2 = -1 // gdb-command:print arg2 @@ -20,8 +15,7 @@ // STACK BY VAL // gdb-command:print self -// gdbg-check:$4 = {x = {__0 = 8888, __1 = -8888}} -// gdbr-check:$4 = method_on_generic_struct::Struct<(u32, i32)> {x: (8888, -8888)} +// gdb-check:$4 = method_on_generic_struct::Struct<(u32, i32)> {x: (8888, -8888)} // gdb-command:print arg1 // gdb-check:$5 = -3 // gdb-command:print arg2 @@ -30,8 +24,7 @@ // OWNED BY REF // gdb-command:print *self -// gdbg-check:$7 = {x = 1234.5} -// gdbr-check:$7 = method_on_generic_struct::Struct<f64> {x: 1234.5} +// gdb-check:$7 = method_on_generic_struct::Struct<f64> {x: 1234.5} // gdb-command:print arg1 // gdb-check:$8 = -5 // gdb-command:print arg2 @@ -40,8 +33,7 @@ // OWNED BY VAL // gdb-command:print self -// gdbg-check:$10 = {x = 1234.5} -// gdbr-check:$10 = method_on_generic_struct::Struct<f64> {x: 1234.5} +// gdb-check:$10 = method_on_generic_struct::Struct<f64> {x: 1234.5} // gdb-command:print arg1 // gdb-check:$11 = -7 // gdb-command:print arg2 @@ -50,8 +42,7 @@ // OWNED MOVED // gdb-command:print *self -// gdbg-check:$13 = {x = 1234.5} -// gdbr-check:$13 = method_on_generic_struct::Struct<f64> {x: 1234.5} +// gdb-check:$13 = method_on_generic_struct::Struct<f64> {x: 1234.5} // gdb-command:print arg1 // gdb-check:$14 = -9 // gdb-command:print arg2 @@ -65,62 +56,47 @@ // STACK BY REF // lldb-command:v *self -// lldbg-check:[...] Struct<(u32, i32)> { x: (8888, -8888) } -// lldbr-check:(method_on_generic_struct::Struct<(u32, i32)>) *self = { x = { = 8888 = -8888 } } +// lldb-check:[...]Struct<(u32, i32)>) *self = { x = { 0 = 8888 1 = -8888 } } // lldb-command:v arg1 -// lldbg-check:[...] -1 -// lldbr-check:(isize) arg1 = -1 +// lldb-check:[...] -1 // lldb-command:v arg2 -// lldbg-check:[...] -2 -// lldbr-check:(isize) arg2 = -2 +// lldb-check:[...] -2 // lldb-command:continue // STACK BY VAL // lldb-command:v self -// lldbg-check:[...] Struct<(u32, i32)> { x: (8888, -8888) } -// lldbr-check:(method_on_generic_struct::Struct<(u32, i32)>) self = { x = { = 8888 = -8888 } } +// lldb-check:[...]Struct<(u32, i32)>) self = { x = { 0 = 8888 1 = -8888 } } // lldb-command:v arg1 -// lldbg-check:[...] -3 -// lldbr-check:(isize) arg1 = -3 +// lldb-check:[...] -3 // lldb-command:v arg2 -// lldbg-check:[...] -4 -// lldbr-check:(isize) arg2 = -4 +// lldb-check:[...] -4 // lldb-command:continue // OWNED BY REF // lldb-command:v *self -// lldbg-check:[...] Struct<f64> { x: 1234.5 } -// lldbr-check:(method_on_generic_struct::Struct<f64>) *self = Struct<f64> { x: 1234.5 } +// lldb-check:[...]Struct<double>) *self = { x = 1234.5 } // lldb-command:v arg1 -// lldbg-check:[...] -5 -// lldbr-check:(isize) arg1 = -5 +// lldb-check:[...] -5 // lldb-command:v arg2 -// lldbg-check:[...] -6 -// lldbr-check:(isize) arg2 = -6 +// lldb-check:[...] -6 // lldb-command:continue // OWNED BY VAL // lldb-command:v self -// lldbg-check:[...] Struct<f64> { x: 1234.5 } -// lldbr-check:(method_on_generic_struct::Struct<f64>) self = Struct<f64> { x: 1234.5 } +// lldb-check:[...]Struct<double>) self = { x = 1234.5 } // lldb-command:v arg1 -// lldbg-check:[...] -7 -// lldbr-check:(isize) arg1 = -7 +// lldb-check:[...] -7 // lldb-command:v arg2 -// lldbg-check:[...] -8 -// lldbr-check:(isize) arg2 = -8 +// lldb-check:[...] -8 // lldb-command:continue // OWNED MOVED // lldb-command:v *self -// lldbg-check:[...] Struct<f64> { x: 1234.5 } -// lldbr-check:(method_on_generic_struct::Struct<f64>) *self = Struct<f64> { x: 1234.5 } +// lldb-check:[...]Struct<double>) *self = { x = 1234.5 } // lldb-command:v arg1 -// lldbg-check:[...] -9 -// lldbr-check:(isize) arg1 = -9 +// lldb-check:[...] -9 // lldb-command:v arg2 -// lldbg-check:[...] -10 -// lldbr-check:(isize) arg2 = -10 +// lldb-check:[...] -10 // lldb-command:continue #![feature(omit_gdb_pretty_printer_section)] diff --git a/tests/debuginfo/method-on-struct.rs b/tests/debuginfo/method-on-struct.rs index a4129af5429..91f609365e9 100644 --- a/tests/debuginfo/method-on-struct.rs +++ b/tests/debuginfo/method-on-struct.rs @@ -1,5 +1,3 @@ -//@ min-lldb-version: 310 - //@ compile-flags:-g // === GDB TESTS =================================================================================== @@ -8,8 +6,7 @@ // STACK BY REF // gdb-command:print *self -// gdbg-check:$1 = {x = 100} -// gdbr-check:$1 = method_on_struct::Struct {x: 100} +// gdb-check:$1 = method_on_struct::Struct {x: 100} // gdb-command:print arg1 // gdb-check:$2 = -1 // gdb-command:print arg2 @@ -18,8 +15,7 @@ // STACK BY VAL // gdb-command:print self -// gdbg-check:$4 = {x = 100} -// gdbr-check:$4 = method_on_struct::Struct {x: 100} +// gdb-check:$4 = method_on_struct::Struct {x: 100} // gdb-command:print arg1 // gdb-check:$5 = -3 // gdb-command:print arg2 @@ -28,8 +24,7 @@ // OWNED BY REF // gdb-command:print *self -// gdbg-check:$7 = {x = 200} -// gdbr-check:$7 = method_on_struct::Struct {x: 200} +// gdb-check:$7 = method_on_struct::Struct {x: 200} // gdb-command:print arg1 // gdb-check:$8 = -5 // gdb-command:print arg2 @@ -38,8 +33,7 @@ // OWNED BY VAL // gdb-command:print self -// gdbg-check:$10 = {x = 200} -// gdbr-check:$10 = method_on_struct::Struct {x: 200} +// gdb-check:$10 = method_on_struct::Struct {x: 200} // gdb-command:print arg1 // gdb-check:$11 = -7 // gdb-command:print arg2 @@ -48,8 +42,7 @@ // OWNED MOVED // gdb-command:print *self -// gdbg-check:$13 = {x = 200} -// gdbr-check:$13 = method_on_struct::Struct {x: 200} +// gdb-check:$13 = method_on_struct::Struct {x: 200} // gdb-command:print arg1 // gdb-check:$14 = -9 // gdb-command:print arg2 @@ -63,62 +56,47 @@ // STACK BY REF // lldb-command:v *self -// lldbg-check:[...] { x = 100 } -// lldbr-check:(method_on_struct::Struct) *self = Struct { x: 100 } +// lldb-check:[...] { x = 100 } // lldb-command:v arg1 -// lldbg-check:[...] -1 -// lldbr-check:(isize) arg1 = -1 +// lldb-check:[...] -1 // lldb-command:v arg2 -// lldbg-check:[...] -2 -// lldbr-check:(isize) arg2 = -2 +// lldb-check:[...] -2 // lldb-command:continue // STACK BY VAL // lldb-command:v self -// lldbg-check:[...] { x = 100 } -// lldbr-check:(method_on_struct::Struct) self = Struct { x: 100 } +// lldb-check:[...] { x = 100 } // lldb-command:v arg1 -// lldbg-check:[...] -3 -// lldbr-check:(isize) arg1 = -3 +// lldb-check:[...] -3 // lldb-command:v arg2 -// lldbg-check:[...] -4 -// lldbr-check:(isize) arg2 = -4 +// lldb-check:[...] -4 // lldb-command:continue // OWNED BY REF // lldb-command:v *self -// lldbg-check:[...] { x = 200 } -// lldbr-check:(method_on_struct::Struct) *self = Struct { x: 200 } +// lldb-check:[...] { x = 200 } // lldb-command:v arg1 -// lldbg-check:[...] -5 -// lldbr-check:(isize) arg1 = -5 +// lldb-check:[...] -5 // lldb-command:v arg2 -// lldbg-check:[...] -6 -// lldbr-check:(isize) arg2 = -6 +// lldb-check:[...] -6 // lldb-command:continue // OWNED BY VAL // lldb-command:v self -// lldbg-check:[...] { x = 200 } -// lldbr-check:(method_on_struct::Struct) self = Struct { x: 200 } +// lldb-check:[...] { x = 200 } // lldb-command:v arg1 -// lldbg-check:[...] -7 -// lldbr-check:(isize) arg1 = -7 +// lldb-check:[...] -7 // lldb-command:v arg2 -// lldbg-check:[...] -8 -// lldbr-check:(isize) arg2 = -8 +// lldb-check:[...] -8 // lldb-command:continue // OWNED MOVED // lldb-command:v *self -// lldbg-check:[...] { x = 200 } -// lldbr-check:(method_on_struct::Struct) *self = Struct { x: 200 } +// lldb-check:[...] { x = 200 } // lldb-command:v arg1 -// lldbg-check:[...] -9 -// lldbr-check:(isize) arg1 = -9 +// lldb-check:[...] -9 // lldb-command:v arg2 -// lldbg-check:[...] -10 -// lldbr-check:(isize) arg2 = -10 +// lldb-check:[...] -10 // lldb-command:continue #![feature(omit_gdb_pretty_printer_section)] diff --git a/tests/debuginfo/method-on-trait.rs b/tests/debuginfo/method-on-trait.rs index 0934c267ab1..7b95e1f81c7 100644 --- a/tests/debuginfo/method-on-trait.rs +++ b/tests/debuginfo/method-on-trait.rs @@ -1,5 +1,3 @@ -//@ min-lldb-version: 310 - //@ compile-flags:-g // === GDB TESTS =================================================================================== @@ -8,8 +6,7 @@ // STACK BY REF // gdb-command:print *self -// gdbg-check:$1 = {x = 100} -// gdbr-check:$1 = method_on_trait::Struct {x: 100} +// gdb-check:$1 = method_on_trait::Struct {x: 100} // gdb-command:print arg1 // gdb-check:$2 = -1 // gdb-command:print arg2 @@ -18,8 +15,7 @@ // STACK BY VAL // gdb-command:print self -// gdbg-check:$4 = {x = 100} -// gdbr-check:$4 = method_on_trait::Struct {x: 100} +// gdb-check:$4 = method_on_trait::Struct {x: 100} // gdb-command:print arg1 // gdb-check:$5 = -3 // gdb-command:print arg2 @@ -28,8 +24,7 @@ // OWNED BY REF // gdb-command:print *self -// gdbg-check:$7 = {x = 200} -// gdbr-check:$7 = method_on_trait::Struct {x: 200} +// gdb-check:$7 = method_on_trait::Struct {x: 200} // gdb-command:print arg1 // gdb-check:$8 = -5 // gdb-command:print arg2 @@ -38,8 +33,7 @@ // OWNED BY VAL // gdb-command:print self -// gdbg-check:$10 = {x = 200} -// gdbr-check:$10 = method_on_trait::Struct {x: 200} +// gdb-check:$10 = method_on_trait::Struct {x: 200} // gdb-command:print arg1 // gdb-check:$11 = -7 // gdb-command:print arg2 @@ -48,8 +42,7 @@ // OWNED MOVED // gdb-command:print *self -// gdbg-check:$13 = {x = 200} -// gdbr-check:$13 = method_on_trait::Struct {x: 200} +// gdb-check:$13 = method_on_trait::Struct {x: 200} // gdb-command:print arg1 // gdb-check:$14 = -9 // gdb-command:print arg2 @@ -63,62 +56,47 @@ // STACK BY REF // lldb-command:v *self -// lldbg-check:[...] { x = 100 } -// lldbr-check:(method_on_trait::Struct) *self = { x = 100 } +// lldb-check:[...] { x = 100 } // lldb-command:v arg1 -// lldbg-check:[...] -1 -// lldbr-check:(isize) arg1 = -1 +// lldb-check:[...] -1 // lldb-command:v arg2 -// lldbg-check:[...] -2 -// lldbr-check:(isize) arg2 = -2 +// lldb-check:[...] -2 // lldb-command:continue // STACK BY VAL // lldb-command:v self -// lldbg-check:[...] { x = 100 } -// lldbr-check:(method_on_trait::Struct) self = { x = 100 } +// lldb-check:[...] { x = 100 } // lldb-command:v arg1 -// lldbg-check:[...] -3 -// lldbr-check:(isize) arg1 = -3 +// lldb-check:[...] -3 // lldb-command:v arg2 -// lldbg-check:[...] -4 -// lldbr-check:(isize) arg2 = -4 +// lldb-check:[...] -4 // lldb-command:continue // OWNED BY REF // lldb-command:v *self -// lldbg-check:[...] { x = 200 } -// lldbr-check:(method_on_trait::Struct) *self = { x = 200 } +// lldb-check:[...] { x = 200 } // lldb-command:v arg1 -// lldbg-check:[...] -5 -// lldbr-check:(isize) arg1 = -5 +// lldb-check:[...] -5 // lldb-command:v arg2 -// lldbg-check:[...] -6 -// lldbr-check:(isize) arg2 = -6 +// lldb-check:[...] -6 // lldb-command:continue // OWNED BY VAL // lldb-command:v self -// lldbg-check:[...] { x = 200 } -// lldbr-check:(method_on_trait::Struct) self = { x = 200 } +// lldb-check:[...] { x = 200 } // lldb-command:v arg1 -// lldbg-check:[...] -7 -// lldbr-check:(isize) arg1 = -7 +// lldb-check:[...] -7 // lldb-command:v arg2 -// lldbg-check:[...] -8 -// lldbr-check:(isize) arg2 = -8 +// lldb-check:[...] -8 // lldb-command:continue // OWNED MOVED // lldb-command:v *self -// lldbg-check:[...] { x = 200 } -// lldbr-check:(method_on_trait::Struct) *self = { x = 200 } +// lldb-check:[...] { x = 200 } // lldb-command:v arg1 -// lldbg-check:[...] -9 -// lldbr-check:(isize) arg1 = -9 +// lldb-check:[...] -9 // lldb-command:v arg2 -// lldbg-check:[...] -10 -// lldbr-check:(isize) arg2 = -10 +// lldb-check:[...] -10 // lldb-command:continue #![feature(omit_gdb_pretty_printer_section)] diff --git a/tests/debuginfo/method-on-tuple-struct.rs b/tests/debuginfo/method-on-tuple-struct.rs index 9cf9c6d7fba..04c00d88302 100644 --- a/tests/debuginfo/method-on-tuple-struct.rs +++ b/tests/debuginfo/method-on-tuple-struct.rs @@ -1,5 +1,3 @@ -//@ min-lldb-version: 310 - //@ compile-flags:-g // === GDB TESTS =================================================================================== @@ -8,8 +6,7 @@ // STACK BY REF // gdb-command:print *self -// gdbg-check:$1 = {__0 = 100, __1 = -100.5} -// gdbr-check:$1 = method_on_tuple_struct::TupleStruct (100, -100.5) +// gdb-check:$1 = method_on_tuple_struct::TupleStruct (100, -100.5) // gdb-command:print arg1 // gdb-check:$2 = -1 // gdb-command:print arg2 @@ -18,8 +15,7 @@ // STACK BY VAL // gdb-command:print self -// gdbg-check:$4 = {__0 = 100, __1 = -100.5} -// gdbr-check:$4 = method_on_tuple_struct::TupleStruct (100, -100.5) +// gdb-check:$4 = method_on_tuple_struct::TupleStruct (100, -100.5) // gdb-command:print arg1 // gdb-check:$5 = -3 // gdb-command:print arg2 @@ -28,8 +24,7 @@ // OWNED BY REF // gdb-command:print *self -// gdbg-check:$7 = {__0 = 200, __1 = -200.5} -// gdbr-check:$7 = method_on_tuple_struct::TupleStruct (200, -200.5) +// gdb-check:$7 = method_on_tuple_struct::TupleStruct (200, -200.5) // gdb-command:print arg1 // gdb-check:$8 = -5 // gdb-command:print arg2 @@ -38,8 +33,7 @@ // OWNED BY VAL // gdb-command:print self -// gdbg-check:$10 = {__0 = 200, __1 = -200.5} -// gdbr-check:$10 = method_on_tuple_struct::TupleStruct (200, -200.5) +// gdb-check:$10 = method_on_tuple_struct::TupleStruct (200, -200.5) // gdb-command:print arg1 // gdb-check:$11 = -7 // gdb-command:print arg2 @@ -48,8 +42,7 @@ // OWNED MOVED // gdb-command:print *self -// gdbg-check:$13 = {__0 = 200, __1 = -200.5} -// gdbr-check:$13 = method_on_tuple_struct::TupleStruct (200, -200.5) +// gdb-check:$13 = method_on_tuple_struct::TupleStruct (200, -200.5) // gdb-command:print arg1 // gdb-check:$14 = -9 // gdb-command:print arg2 @@ -63,62 +56,47 @@ // STACK BY REF // lldb-command:v *self -// lldbg-check:[...] { 0 = 100 1 = -100.5 } -// lldbr-check:(method_on_tuple_struct::TupleStruct) *self = { 0 = 100 1 = -100.5 } +// lldb-check:[...] { 0 = 100 1 = -100.5 } // lldb-command:v arg1 -// lldbg-check:[...] -1 -// lldbr-check:(isize) arg1 = -1 +// lldb-check:[...] -1 // lldb-command:v arg2 -// lldbg-check:[...] -2 -// lldbr-check:(isize) arg2 = -2 +// lldb-check:[...] -2 // lldb-command:continue // STACK BY VAL // lldb-command:v self -// lldbg-check:[...] { 0 = 100 1 = -100.5 } -// lldbr-check:(method_on_tuple_struct::TupleStruct) self = { 0 = 100 1 = -100.5 } +// lldb-check:[...] { 0 = 100 1 = -100.5 } // lldb-command:v arg1 -// lldbg-check:[...] -3 -// lldbr-check:(isize) arg1 = -3 +// lldb-check:[...] -3 // lldb-command:v arg2 -// lldbg-check:[...] -4 -// lldbr-check:(isize) arg2 = -4 +// lldb-check:[...] -4 // lldb-command:continue // OWNED BY REF // lldb-command:v *self -// lldbg-check:[...] { 0 = 200 1 = -200.5 } -// lldbr-check:(method_on_tuple_struct::TupleStruct) *self = { 0 = 200 1 = -200.5 } +// lldb-check:[...] { 0 = 200 1 = -200.5 } // lldb-command:v arg1 -// lldbg-check:[...] -5 -// lldbr-check:(isize) arg1 = -5 +// lldb-check:[...] -5 // lldb-command:v arg2 -// lldbg-check:[...] -6 -// lldbr-check:(isize) arg2 = -6 +// lldb-check:[...] -6 // lldb-command:continue // OWNED BY VAL // lldb-command:v self -// lldbg-check:[...] { 0 = 200 1 = -200.5 } -// lldbr-check:(method_on_tuple_struct::TupleStruct) self = { 0 = 200 1 = -200.5 } +// lldb-check:[...] { 0 = 200 1 = -200.5 } // lldb-command:v arg1 -// lldbg-check:[...] -7 -// lldbr-check:(isize) arg1 = -7 +// lldb-check:[...] -7 // lldb-command:v arg2 -// lldbg-check:[...] -8 -// lldbr-check:(isize) arg2 = -8 +// lldb-check:[...] -8 // lldb-command:continue // OWNED MOVED // lldb-command:v *self -// lldbg-check:[...] { 0 = 200 1 = -200.5 } -// lldbr-check:(method_on_tuple_struct::TupleStruct) *self = { 0 = 200 1 = -200.5 } +// lldb-check:[...] { 0 = 200 1 = -200.5 } // lldb-command:v arg1 -// lldbg-check:[...] -9 -// lldbr-check:(isize) arg1 = -9 +// lldb-check:[...] -9 // lldb-command:v arg2 -// lldbg-check:[...] -10 -// lldbr-check:(isize) arg2 = -10 +// lldb-check:[...] -10 // lldb-command:continue #![feature(omit_gdb_pretty_printer_section)] diff --git a/tests/debuginfo/msvc-pretty-enums.rs b/tests/debuginfo/msvc-pretty-enums.rs index a2e2b32cfd1..d60a7b81944 100644 --- a/tests/debuginfo/msvc-pretty-enums.rs +++ b/tests/debuginfo/msvc-pretty-enums.rs @@ -6,72 +6,72 @@ // lldb-command:run // lldb-command:v a -// lldbg-check:(core::option::Option<msvc_pretty_enums::CStyleEnum>) a = { value = { 0 = Low } } +// lldb-check:(core::option::Option<msvc_pretty_enums::CStyleEnum>) a = { value = { 0 = Low } } // lldb-command:v b -// lldbg-check:(core::option::Option<msvc_pretty_enums::CStyleEnum>) b = { value = $discr$ = '\x01' } +// lldb-check:(core::option::Option<msvc_pretty_enums::CStyleEnum>) b = { value = $discr$ = '\x01' } // lldb-command:v c -// lldbg-check:(msvc_pretty_enums::NicheLayoutEnum) c = { value = $discr$ = '\x11' } +// lldb-check:(msvc_pretty_enums::NicheLayoutEnum) c = { value = $discr$ = '\x11' } // lldb-command:v d -// lldbg-check:(msvc_pretty_enums::NicheLayoutEnum) d = { value = { my_data = High } } +// lldb-check:(msvc_pretty_enums::NicheLayoutEnum) d = { value = { my_data = High } } // lldb-command:v e -// lldbg-check:(msvc_pretty_enums::NicheLayoutEnum) e = { value = $discr$ = '\x13' } +// lldb-check:(msvc_pretty_enums::NicheLayoutEnum) e = { value = $discr$ = '\x13' } // lldb-command:v h -// lldbg-check:(core::option::Option<u32>) h = { value = { 0 = 12 } $discr$ = 1 } +// lldb-check:(core::option::Option<u32>) h = { value = { 0 = 12 } $discr$ = 1 } // lldb-command:v i -// lldbg-check:(core::option::Option<u32>) i = { value = $discr$ = 0 } +// lldb-check:(core::option::Option<u32>) i = { value = $discr$ = 0 } // lldb-command:v j -// lldbg-check:(msvc_pretty_enums::CStyleEnum) j = High +// lldb-check:(msvc_pretty_enums::CStyleEnum) j = High // lldb-command:v k -// lldbg-check:(core::option::Option<alloc::string::String>) k = { value = { 0 = "IAMA optional string!" { vec = size=21 { [0] = 'I' [1] = 'A' [2] = 'M' [3] = 'A' [4] = ' ' [5] = 'o' [6] = 'p' [7] = 't' [8] = 'i' [9] = 'o' [10] = 'n' [11] = 'a' [12] = 'l' [13] = ' ' [14] = 's' [15] = 't' [16] = 'r' [17] = 'i' [18] = 'n' [19] = 'g' [20] = '!' } } } } +// lldb-check:(core::option::Option<alloc::string::String>) k = { value = { 0 = "IAMA optional string!" { vec = size=21 { [0] = 'I' [1] = 'A' [2] = 'M' [3] = 'A' [4] = ' ' [5] = 'o' [6] = 'p' [7] = 't' [8] = 'i' [9] = 'o' [10] = 'n' [11] = 'a' [12] = 'l' [13] = ' ' [14] = 's' [15] = 't' [16] = 'r' [17] = 'i' [18] = 'n' [19] = 'g' [20] = '!' } } } } // lldb-command:v l -// lldbg-check:(core::result::Result<u32, msvc_pretty_enums::Empty>) l = { value = { 0 = {} } } +// lldb-check:(core::result::Result<u32, msvc_pretty_enums::Empty>) l = { value = { 0 = {} } } // lldb-command:v niche128_some -// lldbg-check:(core::option::Option<core::num::nonzero::NonZero<i128>>) niche128_some = { value = $discr$ = 123456 } +// lldb-check:(core::option::Option<core::num::nonzero::NonZero<i128>>) niche128_some = { value = $discr$ = 123456 } // lldb-command:v niche128_none -// lldbg-check:(core::option::Option<core::num::nonzero::NonZero<i128>>) niche128_none = { value = $discr$ = 0 } +// lldb-check:(core::option::Option<core::num::nonzero::NonZero<i128>>) niche128_none = { value = $discr$ = 0 } // lldb-command:v wrapping_niche128_untagged -// lldbg-check:(msvc_pretty_enums::Wrapping128Niche) wrapping_niche128_untagged = { value = { 0 = { 0 = 340282366920938463463374607431768211454 } } } +// lldb-check:(msvc_pretty_enums::Wrapping128Niche) wrapping_niche128_untagged = { value = { 0 = { 0 = 340282366920938463463374607431768211454 } } } // lldb-command:v wrapping_niche128_none1 -// lldbg-check:(msvc_pretty_enums::Wrapping128Niche) wrapping_niche128_none1 = { value = { 0 = { 0 = 2 } } } +// lldb-check:(msvc_pretty_enums::Wrapping128Niche) wrapping_niche128_none1 = { value = { 0 = { 0 = 2 } } } // lldb-command:v direct_tag_128_a -// lldbg-check:(msvc_pretty_enums::DirectTag128) direct_tag_128_a = { value = { 0 = 42 } $discr$ = 0 } +// lldb-check:(msvc_pretty_enums::DirectTag128) direct_tag_128_a = { value = { 0 = 42 } $discr$ = 0 } // lldb-command:v direct_tag_128_b -// lldbg-check:(msvc_pretty_enums::DirectTag128) direct_tag_128_b = { value = { 0 = 137 } $discr$ = 1 } +// lldb-check:(msvc_pretty_enums::DirectTag128) direct_tag_128_b = { value = { 0 = 137 } $discr$ = 1 } // &u32 is incorrectly formatted and LLDB thinks it's a char* so skipping niche_w_fields_1_some // lldb-command:v niche_w_fields_1_none -// lldbg-check:(msvc_pretty_enums::NicheLayoutWithFields1) niche_w_fields_1_none = { value = { 0 = 99 } $discr$ = 1 } +// lldb-check:(msvc_pretty_enums::NicheLayoutWithFields1) niche_w_fields_1_none = { value = { 0 = 99 } $discr$ = 1 } // lldb-command:v niche_w_fields_2_some -// lldbg-check:(msvc_pretty_enums::NicheLayoutWithFields2) niche_w_fields_2_some = { value = { 0 = 800 { __0 = { 0 = 800 } } 1 = 900 } $discr$ = 0 } +// lldb-check:(msvc_pretty_enums::NicheLayoutWithFields2) niche_w_fields_2_some = { value = { 0 = 800 { __0 = { 0 = 800 } } 1 = 900 } $discr$ = 0 } // lldb-command:v niche_w_fields_3_some -// lldbg-check:(msvc_pretty_enums::NicheLayoutWithFields3) niche_w_fields_3_some = { value = { 0 = '\x89' 1 = true } } +// lldb-check:(msvc_pretty_enums::NicheLayoutWithFields3) niche_w_fields_3_some = { value = { 0 = '\x89' 1 = true } } // lldb-command:v niche_w_fields_3_niche3 -// lldbg-check:(msvc_pretty_enums::NicheLayoutWithFields3) niche_w_fields_3_niche3 = { value = { 0 = '"' } $discr$ = '\x04' } +// lldb-check:(msvc_pretty_enums::NicheLayoutWithFields3) niche_w_fields_3_niche3 = { value = { 0 = '"' } $discr$ = '\x04' } // lldb-command:v arbitrary_discr1 -// lldbg-check:(msvc_pretty_enums::ArbitraryDiscr) arbitrary_discr1 = { value = { 0 = 1234 } $discr$ = 1000 } +// lldb-check:(msvc_pretty_enums::ArbitraryDiscr) arbitrary_discr1 = { value = { 0 = 1234 } $discr$ = 1000 } // lldb-command:v arbitrary_discr2 -// lldbg-check:(msvc_pretty_enums::ArbitraryDiscr) arbitrary_discr2 = { value = { 0 = 5678 } $discr$ = 5000000 } +// lldb-check:(msvc_pretty_enums::ArbitraryDiscr) arbitrary_discr2 = { value = { 0 = 5678 } $discr$ = 5000000 } // === CDB TESTS ================================================================================== diff --git a/tests/debuginfo/multi-byte-chars.rs b/tests/debuginfo/multi-byte-chars.rs index 8fb066c7185..2ab98d265b8 100644 --- a/tests/debuginfo/multi-byte-chars.rs +++ b/tests/debuginfo/multi-byte-chars.rs @@ -1,5 +1,3 @@ -//@ min-lldb-version: 310 - //@ compile-flags:-g // This test checks whether debuginfo generation can handle multi-byte UTF-8 diff --git a/tests/debuginfo/multi-cgu.rs b/tests/debuginfo/multi-cgu.rs index 32fd6895877..3bb5269adea 100644 --- a/tests/debuginfo/multi-cgu.rs +++ b/tests/debuginfo/multi-cgu.rs @@ -1,9 +1,6 @@ // This test case makes sure that we get proper break points for binaries // compiled with multiple codegen units. (see #39160) - -//@ min-lldb-version: 310 - //@ compile-flags:-g -Ccodegen-units=2 // === GDB TESTS =============================================================== @@ -24,13 +21,11 @@ // lldb-command:run // lldb-command:v xxx -// lldbg-check:[...] 12345 -// lldbr-check:(u32) xxx = 12345 +// lldb-check:[...] 12345 // lldb-command:continue // lldb-command:v yyy -// lldbg-check:[...] 67890 -// lldbr-check:(u64) yyy = 67890 +// lldb-check:[...] 67890 // lldb-command:continue diff --git a/tests/debuginfo/multiple-functions-equal-var-names.rs b/tests/debuginfo/multiple-functions-equal-var-names.rs index 2d9caf75290..6ae9225d55c 100644 --- a/tests/debuginfo/multiple-functions-equal-var-names.rs +++ b/tests/debuginfo/multiple-functions-equal-var-names.rs @@ -1,5 +1,3 @@ -//@ min-lldb-version: 310 - //@ compile-flags:-g // === GDB TESTS =================================================================================== @@ -23,18 +21,15 @@ // lldb-command:run // lldb-command:v abc -// lldbg-check:[...] 10101 -// lldbr-check:(i32) abc = 10101 +// lldb-check:[...] 10101 // lldb-command:continue // lldb-command:v abc -// lldbg-check:[...] 20202 -// lldbr-check:(i32) abc = 20202 +// lldb-check:[...] 20202 // lldb-command:continue // lldb-command:v abc -// lldbg-check:[...] 30303 -// lldbr-check:(i32) abc = 30303 +// lldb-check:[...] 30303 #![allow(unused_variables)] #![feature(omit_gdb_pretty_printer_section)] diff --git a/tests/debuginfo/multiple-functions.rs b/tests/debuginfo/multiple-functions.rs index 5c01a427051..3f7a0ded91b 100644 --- a/tests/debuginfo/multiple-functions.rs +++ b/tests/debuginfo/multiple-functions.rs @@ -1,5 +1,3 @@ -//@ min-lldb-version: 310 - //@ compile-flags:-g // === GDB TESTS =================================================================================== @@ -23,18 +21,15 @@ // lldb-command:run // lldb-command:v a -// lldbg-check:[...] 10101 -// lldbr-check:(i32) a = 10101 +// lldb-check:[...] 10101 // lldb-command:continue // lldb-command:v b -// lldbg-check:[...] 20202 -// lldbr-check:(i32) b = 20202 +// lldb-check:[...] 20202 // lldb-command:continue // lldb-command:v c -// lldbg-check:[...] 30303 -// lldbr-check:(i32) c = 30303 +// lldb-check:[...] 30303 #![allow(unused_variables)] #![feature(omit_gdb_pretty_printer_section)] diff --git a/tests/debuginfo/name-shadowing-and-scope-nesting.rs b/tests/debuginfo/name-shadowing-and-scope-nesting.rs index 8813793e59e..d3829b60713 100644 --- a/tests/debuginfo/name-shadowing-and-scope-nesting.rs +++ b/tests/debuginfo/name-shadowing-and-scope-nesting.rs @@ -1,5 +1,3 @@ -//@ min-lldb-version: 310 - //@ compile-flags:-g // === GDB TESTS =================================================================================== @@ -48,51 +46,39 @@ // lldb-command:run // lldb-command:v x -// lldbg-check:[...] false -// lldbr-check:(bool) x = false +// lldb-check:[...] false // lldb-command:v y -// lldbg-check:[...] true -// lldbr-check:(bool) y = true +// lldb-check:[...] true // lldb-command:continue // lldb-command:v x -// lldbg-check:[...] 10 -// lldbr-check:(i32) x = 10 +// lldb-check:[...] 10 // lldb-command:v y -// lldbg-check:[...] true -// lldbr-check:(bool) y = true +// lldb-check:[...] true // lldb-command:continue // lldb-command:v x -// lldbg-check:[...] 10.5 -// lldbr-check:(f64) x = 10.5 +// lldb-check:[...] 10.5 // lldb-command:v y -// lldbg-check:[...] 20 -// lldbr-check:(i32) y = 20 +// lldb-check:[...] 20 // lldb-command:continue // lldb-command:v x -// lldbg-check:[...] true -// lldbr-check:(bool) x = true +// lldb-check:[...] true // lldb-command:v y -// lldbg-check:[...] 2220 -// lldbr-check:(i32) y = 2220 +// lldb-check:[...] 2220 // lldb-command:continue // lldb-command:v x -// lldbg-check:[...] 203203.5 -// lldbr-check:(f64) x = 203203.5 +// lldb-check:[...] 203203.5 // lldb-command:v y -// lldbg-check:[...] 2220 -// lldbr-check:(i32) y = 2220 +// lldb-check:[...] 2220 // lldb-command:continue // lldb-command:v x -// lldbg-check:[...] 10.5 -// lldbr-check:(f64) x = 10.5 +// lldb-check:[...] 10.5 // lldb-command:v y -// lldbg-check:[...] 20 -// lldbr-check:(i32) y = 20 +// lldb-check:[...] 20 // lldb-command:continue #![feature(omit_gdb_pretty_printer_section)] diff --git a/tests/debuginfo/numeric-types.rs b/tests/debuginfo/numeric-types.rs index 98bc31e8855..9d232578979 100644 --- a/tests/debuginfo/numeric-types.rs +++ b/tests/debuginfo/numeric-types.rs @@ -1,7 +1,6 @@ //@ compile-flags:-g -//@ min-gdb-version: 8.1 -//@ ignore-windows-gnu // emit_debug_gdb_scripts is disabled on Windows +//@ ignore-windows-gnu: #128981 // Tests the visualizations for `NonZero<T>`, `Wrapping<T>` and // `Atomic{Bool,I8,I16,I32,I64,Isize,U8,U16,U32,U64,Usize}` located in `libcore.natvis`. diff --git a/tests/debuginfo/option-like-enum.rs b/tests/debuginfo/option-like-enum.rs index da556d613d0..d370796efa9 100644 --- a/tests/debuginfo/option-like-enum.rs +++ b/tests/debuginfo/option-like-enum.rs @@ -8,36 +8,28 @@ // gdb-command:run // gdb-command:print some -// gdbg-check:$1 = {RUST$ENCODED$ENUM$0$None = {__0 = 0x12345678}} -// gdbr-check:$1 = core::option::Option<&u32>::Some(0x12345678) +// gdb-check:$1 = core::option::Option<&u32>::Some(0x12345678) // gdb-command:print none -// gdbg-check:$2 = {RUST$ENCODED$ENUM$0$None = {__0 = 0x0}} -// gdbr-check:$2 = core::option::Option<&u32>::None +// gdb-check:$2 = core::option::Option<&u32>::None // gdb-command:print full -// gdbg-check:$3 = {RUST$ENCODED$ENUM$1$Empty = {__0 = 454545, __1 = 0x87654321, __2 = 9988}} -// gdbr-check:$3 = option_like_enum::MoreFields::Full(454545, 0x87654321, 9988) +// gdb-check:$3 = option_like_enum::MoreFields::Full(454545, 0x87654321, 9988) -// gdbg-command:print empty_gdb->discr -// gdbr-command:print empty_gdb.discr +// gdb-command:print empty_gdb.discr // gdb-check:$4 = (*mut isize) 0x1 // gdb-command:print droid -// gdbg-check:$5 = {RUST$ENCODED$ENUM$2$Void = {id = 675675, range = 10000001, internals = 0x43218765}} -// gdbr-check:$5 = option_like_enum::NamedFields::Droid{id: 675675, range: 10000001, internals: 0x43218765} +// gdb-check:$5 = option_like_enum::NamedFields::Droid{id: 675675, range: 10000001, internals: 0x43218765} -// gdbg-command:print void_droid_gdb->internals -// gdbr-command:print void_droid_gdb.internals +// gdb-command:print void_droid_gdb.internals // gdb-check:$6 = (*mut isize) 0x1 // gdb-command:print nested_non_zero_yep -// gdbg-check:$7 = {RUST$ENCODED$ENUM$1$2$Nope = {__0 = 10.5, __1 = {a = 10, b = 20, c = [...]}}} -// gdbr-check:$7 = option_like_enum::NestedNonZero::Yep(10.5, option_like_enum::NestedNonZeroField {a: 10, b: 20, c: 0x[...]}) +// gdb-check:$7 = option_like_enum::NestedNonZero::Yep(10.5, option_like_enum::NestedNonZeroField {a: 10, b: 20, c: 0x[...]}) // gdb-command:print nested_non_zero_nope -// gdbg-check:$8 = {RUST$ENCODED$ENUM$1$2$Nope = {__0 = [...], __1 = {a = [...], b = [...], c = 0x0}}} -// gdbr-check:$8 = option_like_enum::NestedNonZero::Nope +// gdb-check:$8 = option_like_enum::NestedNonZero::Nope // gdb-command:continue diff --git a/tests/debuginfo/packed-struct-with-destructor.rs b/tests/debuginfo/packed-struct-with-destructor.rs index f9bac844376..f923d36953c 100644 --- a/tests/debuginfo/packed-struct-with-destructor.rs +++ b/tests/debuginfo/packed-struct-with-destructor.rs @@ -1,5 +1,3 @@ -//@ min-lldb-version: 310 - //@ compile-flags:-g // === GDB TESTS =================================================================================== @@ -7,37 +5,29 @@ // gdb-command:run // gdb-command:print packed -// gdbg-check:$1 = {x = 123, y = 234, z = 345} -// gdbr-check:$1 = packed_struct_with_destructor::Packed {x: 123, y: 234, z: 345} +// gdb-check:$1 = packed_struct_with_destructor::Packed {x: 123, y: 234, z: 345} // gdb-command:print packedInPacked -// gdbg-check:$2 = {a = 1111, b = {x = 2222, y = 3333, z = 4444}, c = 5555, d = {x = 6666, y = 7777, z = 8888}} -// gdbr-check:$2 = packed_struct_with_destructor::PackedInPacked {a: 1111, b: packed_struct_with_destructor::Packed {x: 2222, y: 3333, z: 4444}, c: 5555, d: packed_struct_with_destructor::Packed {x: 6666, y: 7777, z: 8888}} +// gdb-check:$2 = packed_struct_with_destructor::PackedInPacked {a: 1111, b: packed_struct_with_destructor::Packed {x: 2222, y: 3333, z: 4444}, c: 5555, d: packed_struct_with_destructor::Packed {x: 6666, y: 7777, z: 8888}} // gdb-command:print packedInUnpacked -// gdbg-check:$3 = {a = -1111, b = {x = -2222, y = -3333, z = -4444}, c = -5555, d = {x = -6666, y = -7777, z = -8888}} -// gdbr-check:$3 = packed_struct_with_destructor::PackedInUnpacked {a: -1111, b: packed_struct_with_destructor::Packed {x: -2222, y: -3333, z: -4444}, c: -5555, d: packed_struct_with_destructor::Packed {x: -6666, y: -7777, z: -8888}} +// gdb-check:$3 = packed_struct_with_destructor::PackedInUnpacked {a: -1111, b: packed_struct_with_destructor::Packed {x: -2222, y: -3333, z: -4444}, c: -5555, d: packed_struct_with_destructor::Packed {x: -6666, y: -7777, z: -8888}} // gdb-command:print unpackedInPacked -// gdbg-check:$4 = {a = 987, b = {x = 876, y = 765, z = 654}, c = {x = 543, y = 432, z = 321}, d = 210} -// gdbr-check:$4 = packed_struct_with_destructor::UnpackedInPacked {a: 987, b: packed_struct_with_destructor::Unpacked {x: 876, y: 765, z: 654}, c: packed_struct_with_destructor::Unpacked {x: 543, y: 432, z: 321}, d: 210} +// gdb-check:$4 = packed_struct_with_destructor::UnpackedInPacked {a: 987, b: packed_struct_with_destructor::Unpacked {x: 876, y: 765, z: 654}, c: packed_struct_with_destructor::Unpacked {x: 543, y: 432, z: 321}, d: 210} // gdb-command:print packedInPackedWithDrop -// gdbg-check:$5 = {a = 11, b = {x = 22, y = 33, z = 44}, c = 55, d = {x = 66, y = 77, z = 88}} -// gdbr-check:$5 = packed_struct_with_destructor::PackedInPackedWithDrop {a: 11, b: packed_struct_with_destructor::Packed {x: 22, y: 33, z: 44}, c: 55, d: packed_struct_with_destructor::Packed {x: 66, y: 77, z: 88}} +// gdb-check:$5 = packed_struct_with_destructor::PackedInPackedWithDrop {a: 11, b: packed_struct_with_destructor::Packed {x: 22, y: 33, z: 44}, c: 55, d: packed_struct_with_destructor::Packed {x: 66, y: 77, z: 88}} // gdb-command:print packedInUnpackedWithDrop -// gdbg-check:$6 = {a = -11, b = {x = -22, y = -33, z = -44}, c = -55, d = {x = -66, y = -77, z = -88}} -// gdbr-check:$6 = packed_struct_with_destructor::PackedInUnpackedWithDrop {a: -11, b: packed_struct_with_destructor::Packed {x: -22, y: -33, z: -44}, c: -55, d: packed_struct_with_destructor::Packed {x: -66, y: -77, z: -88}} +// gdb-check:$6 = packed_struct_with_destructor::PackedInUnpackedWithDrop {a: -11, b: packed_struct_with_destructor::Packed {x: -22, y: -33, z: -44}, c: -55, d: packed_struct_with_destructor::Packed {x: -66, y: -77, z: -88}} // gdb-command:print unpackedInPackedWithDrop -// gdbg-check:$7 = {a = 98, b = {x = 87, y = 76, z = 65}, c = {x = 54, y = 43, z = 32}, d = 21} -// gdbr-check:$7 = packed_struct_with_destructor::UnpackedInPackedWithDrop {a: 98, b: packed_struct_with_destructor::Unpacked {x: 87, y: 76, z: 65}, c: packed_struct_with_destructor::Unpacked {x: 54, y: 43, z: 32}, d: 21} +// gdb-check:$7 = packed_struct_with_destructor::UnpackedInPackedWithDrop {a: 98, b: packed_struct_with_destructor::Unpacked {x: 87, y: 76, z: 65}, c: packed_struct_with_destructor::Unpacked {x: 54, y: 43, z: 32}, d: 21} // gdb-command:print deeplyNested -// gdbg-check:$8 = {a = {a = 1, b = {x = 2, y = 3, z = 4}, c = 5, d = {x = 6, y = 7, z = 8}}, b = {a = 9, b = {x = 10, y = 11, z = 12}, c = {x = 13, y = 14, z = 15}, d = 16}, c = {a = 17, b = {x = 18, y = 19, z = 20}, c = 21, d = {x = 22, y = 23, z = 24}}, d = {a = 25, b = {x = 26, y = 27, z = 28}, c = 29, d = {x = 30, y = 31, z = 32}}, e = {a = 33, b = {x = 34, y = 35, z = 36}, c = {x = 37, y = 38, z = 39}, d = 40}, f = {a = 41, b = {x = 42, y = 43, z = 44}, c = 45, d = {x = 46, y = 47, z = 48}}} -// gdbr-check:$8 = packed_struct_with_destructor::DeeplyNested {a: packed_struct_with_destructor::PackedInPacked {a: 1, b: packed_struct_with_destructor::Packed {x: 2, y: 3, z: 4}, c: 5, d: packed_struct_with_destructor::Packed {x: 6, y: 7, z: 8}}, b: packed_struct_with_destructor::UnpackedInPackedWithDrop {a: 9, b: packed_struct_with_destructor::Unpacked {x: 10, y: 11, z: 12}, c: packed_struct_with_destructor::Unpacked {x: 13, y: 14, z: 15}, d: 16}, c: packed_struct_with_destructor::PackedInUnpacked {a: 17, b: packed_struct_with_destructor::Packed {x: 18, y: 19, z: 20}, c: 21, d: packed_struct_with_destructor::Packed {x: 22, y: 23, z: 24}}, d: packed_struct_with_destructor::PackedInUnpackedWithDrop {a: 25, b: packed_struct_with_destructor::Packed {x: 26, y: 27, z: 28}, c: 29, d: packed_struct_with_destructor::Packed {x: 30, y: 31, z: 32}}, e: packed_struct_with_destructor::UnpackedInPacked {a: 33, b: packed_struct_with_destructor::Unpacked {x: 34, y: 35, z: 36}, c: packed_struct_with_destructor::Unpacked {x: 37, y: 38, z: 39}, d: 40}, f: packed_struct_with_destructor::PackedInPackedWithDrop {a: 41, b: packed_struct_with_destructor::Packed {x: 42, y: 43, z: 44}, c: 45, d: packed_struct_with_destructor::Packed {x: 46, y: 47, z: 48}}} +// gdb-check:$8 = packed_struct_with_destructor::DeeplyNested {a: packed_struct_with_destructor::PackedInPacked {a: 1, b: packed_struct_with_destructor::Packed {x: 2, y: 3, z: 4}, c: 5, d: packed_struct_with_destructor::Packed {x: 6, y: 7, z: 8}}, b: packed_struct_with_destructor::UnpackedInPackedWithDrop {a: 9, b: packed_struct_with_destructor::Unpacked {x: 10, y: 11, z: 12}, c: packed_struct_with_destructor::Unpacked {x: 13, y: 14, z: 15}, d: 16}, c: packed_struct_with_destructor::PackedInUnpacked {a: 17, b: packed_struct_with_destructor::Packed {x: 18, y: 19, z: 20}, c: 21, d: packed_struct_with_destructor::Packed {x: 22, y: 23, z: 24}}, d: packed_struct_with_destructor::PackedInUnpackedWithDrop {a: 25, b: packed_struct_with_destructor::Packed {x: 26, y: 27, z: 28}, c: 29, d: packed_struct_with_destructor::Packed {x: 30, y: 31, z: 32}}, e: packed_struct_with_destructor::UnpackedInPacked {a: 33, b: packed_struct_with_destructor::Unpacked {x: 34, y: 35, z: 36}, c: packed_struct_with_destructor::Unpacked {x: 37, y: 38, z: 39}, d: 40}, f: packed_struct_with_destructor::PackedInPackedWithDrop {a: 41, b: packed_struct_with_destructor::Packed {x: 42, y: 43, z: 44}, c: 45, d: packed_struct_with_destructor::Packed {x: 46, y: 47, z: 48}}} // === LLDB TESTS ================================================================================== @@ -45,36 +35,28 @@ // lldb-command:run // lldb-command:v packed -// lldbg-check:[...] { x = 123 y = 234 z = 345 } -// lldbr-check:(packed_struct_with_destructor::Packed) packed = { x = 123 y = 234 z = 345 } +// lldb-check:[...] { x = 123 y = 234 z = 345 } // lldb-command:v packedInPacked -// lldbg-check:[...] { a = 1111 b = { x = 2222 y = 3333 z = 4444 } c = 5555 d = { x = 6666 y = 7777 z = 8888 } } -// lldbr-check:(packed_struct_with_destructor::PackedInPacked) packedInPacked = { a = 1111 b = { x = 2222 y = 3333 z = 4444 } c = 5555 d = { x = 6666 y = 7777 z = 8888 } } +// lldb-check:[...] { a = 1111 b = { x = 2222 y = 3333 z = 4444 } c = 5555 d = { x = 6666 y = 7777 z = 8888 } } // lldb-command:v packedInUnpacked -// lldbg-check:[...] { a = -1111 b = { x = -2222 y = -3333 z = -4444 } c = -5555 d = { x = -6666 y = -7777 z = -8888 } } -// lldbr-check:(packed_struct_with_destructor::PackedInUnpacked) packedInUnpacked = { a = -1111 b = { x = -2222 y = -3333 z = -4444 } c = -5555 d = { x = -6666 y = -7777 z = -8888 } } +// lldb-check:[...] { a = -1111 b = { x = -2222 y = -3333 z = -4444 } c = -5555 d = { x = -6666 y = -7777 z = -8888 } } // lldb-command:v unpackedInPacked -// lldbg-check:[...] { a = 987 b = { x = 876 y = 765 z = 654 } c = { x = 543 y = 432 z = 321 } d = 210 } -// lldbr-check:(packed_struct_with_destructor::UnpackedInPacked) unpackedInPacked = { a = 987 b = { x = 876 y = 765 z = 654 } c = { x = 543 y = 432 z = 321 } d = 210 } +// lldb-check:[...] { a = 987 b = { x = 876 y = 765 z = 654 } c = { x = 543 y = 432 z = 321 } d = 210 } // lldb-command:v packedInPackedWithDrop -// lldbg-check:[...] { a = 11 b = { x = 22 y = 33 z = 44 } c = 55 d = { x = 66 y = 77 z = 88 } } -// lldbr-check:(packed_struct_with_destructor::PackedInPackedWithDrop) packedInPackedWithDrop = { a = 11 b = { x = 22 y = 33 z = 44 } c = 55 d = { x = 66 y = 77 z = 88 } } +// lldb-check:[...] { a = 11 b = { x = 22 y = 33 z = 44 } c = 55 d = { x = 66 y = 77 z = 88 } } // lldb-command:v packedInUnpackedWithDrop -// lldbg-check:[...] { a = -11 b = { x = -22 y = -33 z = -44 } c = -55 d = { x = -66 y = -77 z = -88 } } -// lldbr-check:(packed_struct_with_destructor::PackedInUnpackedWithDrop) packedInUnpackedWithDrop = { a = -11 b = { x = -22 y = -33 z = -44 } c = -55 d = { x = -66 y = -77 z = -88 } } +// lldb-check:[...] { a = -11 b = { x = -22 y = -33 z = -44 } c = -55 d = { x = -66 y = -77 z = -88 } } // lldb-command:v unpackedInPackedWithDrop -// lldbg-check:[...] { a = 98 b = { x = 87 y = 76 z = 65 } c = { x = 54 y = 43 z = 32 } d = 21 } -// lldbr-check:(packed_struct_with_destructor::UnpackedInPackedWithDrop) unpackedInPackedWithDrop = { a = 98 b = { x = 87 y = 76 z = 65 } c = { x = 54 y = 43 z = 32 } d = 21 } +// lldb-check:[...] { a = 98 b = { x = 87 y = 76 z = 65 } c = { x = 54 y = 43 z = 32 } d = 21 } // lldb-command:v deeplyNested -// lldbg-check:[...] { a = { a = 1 b = { x = 2 y = 3 z = 4 } c = 5 d = { x = 6 y = 7 z = 8 } } b = { a = 9 b = { x = 10 y = 11 z = 12 } c = { x = 13 y = 14 z = 15 } d = 16 } c = { a = 17 b = { x = 18 y = 19 z = 20 } c = 21 d = { x = 22 y = 23 z = 24 } } d = { a = 25 b = { x = 26 y = 27 z = 28 } c = 29 d = { x = 30 y = 31 z = 32 } } e = { a = 33 b = { x = 34 y = 35 z = 36 } c = { x = 37 y = 38 z = 39 } d = 40 } f = { a = 41 b = { x = 42 y = 43 z = 44 } c = 45 d = { x = 46 y = 47 z = 48 } } } -// lldbr-check:(packed_struct_with_destructor::DeeplyNested) deeplyNested = { a = { a = 1 b = { x = 2 y = 3 z = 4 } c = 5 d = { x = 6 y = 7 z = 8 } } b = { a = 9 b = { x = 10 y = 11 z = 12 } c = { x = 13 y = 14 z = 15 } d = 16 } c = { a = 17 b = { x = 18 y = 19 z = 20 } c = 21 d = { x = 22 y = 23 z = 24 } } d = { a = 25 b = { x = 26 y = 27 z = 28 } c = 29 d = { x = 30 y = 31 z = 32 } } e = { a = 33 b = { x = 34 y = 35 z = 36 } c = { x = 37 y = 38 z = 39 } d = 40 } f = { a = 41 b = { x = 42 y = 43 z = 44 } c = 45 d = { x = 46 y = 47 z = 48 } } } +// lldb-check:[...] { a = { a = 1 b = { x = 2 y = 3 z = 4 } c = 5 d = { x = 6 y = 7 z = 8 } } b = { a = 9 b = { x = 10 y = 11 z = 12 } c = { x = 13 y = 14 z = 15 } d = 16 } c = { a = 17 b = { x = 18 y = 19 z = 20 } c = 21 d = { x = 22 y = 23 z = 24 } } d = { a = 25 b = { x = 26 y = 27 z = 28 } c = 29 d = { x = 30 y = 31 z = 32 } } e = { a = 33 b = { x = 34 y = 35 z = 36 } c = { x = 37 y = 38 z = 39 } d = 40 } f = { a = 41 b = { x = 42 y = 43 z = 44 } c = 45 d = { x = 46 y = 47 z = 48 } } } #![allow(unused_variables)] diff --git a/tests/debuginfo/packed-struct.rs b/tests/debuginfo/packed-struct.rs index ea9aa22ba55..2b3652fe861 100644 --- a/tests/debuginfo/packed-struct.rs +++ b/tests/debuginfo/packed-struct.rs @@ -1,6 +1,3 @@ -//@ min-lldb-version: 310 -//@ ignore-gdb-version: 7.11.90 - 7.12.9 - //@ compile-flags:-g // === GDB TESTS =================================================================================== @@ -8,20 +5,16 @@ // gdb-command:run // gdb-command:print packed -// gdbg-check:$1 = {x = 123, y = 234, z = 345} -// gdbr-check:$1 = packed_struct::Packed {x: 123, y: 234, z: 345} +// gdb-check:$1 = packed_struct::Packed {x: 123, y: 234, z: 345} // gdb-command:print packedInPacked -// gdbg-check:$2 = {a = 1111, b = {x = 2222, y = 3333, z = 4444}, c = 5555, d = {x = 6666, y = 7777, z = 8888}} -// gdbr-check:$2 = packed_struct::PackedInPacked {a: 1111, b: packed_struct::Packed {x: 2222, y: 3333, z: 4444}, c: 5555, d: packed_struct::Packed {x: 6666, y: 7777, z: 8888}} +// gdb-check:$2 = packed_struct::PackedInPacked {a: 1111, b: packed_struct::Packed {x: 2222, y: 3333, z: 4444}, c: 5555, d: packed_struct::Packed {x: 6666, y: 7777, z: 8888}} // gdb-command:print packedInUnpacked -// gdbg-check:$3 = {a = -1111, b = {x = -2222, y = -3333, z = -4444}, c = -5555, d = {x = -6666, y = -7777, z = -8888}} -// gdbr-check:$3 = packed_struct::PackedInUnpacked {a: -1111, b: packed_struct::Packed {x: -2222, y: -3333, z: -4444}, c: -5555, d: packed_struct::Packed {x: -6666, y: -7777, z: -8888}} +// gdb-check:$3 = packed_struct::PackedInUnpacked {a: -1111, b: packed_struct::Packed {x: -2222, y: -3333, z: -4444}, c: -5555, d: packed_struct::Packed {x: -6666, y: -7777, z: -8888}} // gdb-command:print unpackedInPacked -// gdbg-check:$4 = {a = 987, b = {x = 876, y = 765, z = 654, w = 543}, c = {x = 432, y = 321, z = 210, w = 109}, d = -98} -// gdbr-check:$4 = packed_struct::UnpackedInPacked {a: 987, b: packed_struct::Unpacked {x: 876, y: 765, z: 654, w: 543}, c: packed_struct::Unpacked {x: 432, y: 321, z: 210, w: 109}, d: -98} +// gdb-check:$4 = packed_struct::UnpackedInPacked {a: 987, b: packed_struct::Unpacked {x: 876, y: 765, z: 654, w: 543}, c: packed_struct::Unpacked {x: 432, y: 321, z: 210, w: 109}, d: -98} // gdb-command:print sizeof(packed) // gdb-check:$5 = 14 @@ -35,28 +28,22 @@ // lldb-command:run // lldb-command:v packed -// lldbg-check:[...] { x = 123 y = 234 z = 345 } -// lldbr-check:(packed_struct::Packed) packed = { x = 123 y = 234 z = 345 } +// lldb-check:[...] { x = 123 y = 234 z = 345 } // lldb-command:v packedInPacked -// lldbg-check:[...] { a = 1111 b = { x = 2222 y = 3333 z = 4444 } c = 5555 d = { x = 6666 y = 7777 z = 8888 } } -// lldbr-check:(packed_struct::PackedInPacked) packedInPacked = { a = 1111 b = { x = 2222 y = 3333 z = 4444 } c = 5555 d = { x = 6666 y = 7777 z = 8888 } } +// lldb-check:[...] { a = 1111 b = { x = 2222 y = 3333 z = 4444 } c = 5555 d = { x = 6666 y = 7777 z = 8888 } } // lldb-command:v packedInUnpacked -// lldbg-check:[...] { a = -1111 b = { x = -2222 y = -3333 z = -4444 } c = -5555 d = { x = -6666 y = -7777 z = -8888 } } -// lldbr-check:(packed_struct::PackedInUnpacked) packedInUnpacked = { a = -1111 b = { x = -2222 y = -3333 z = -4444 } c = -5555 d = { x = -6666 y = -7777 z = -8888 } } +// lldb-check:[...] { a = -1111 b = { x = -2222 y = -3333 z = -4444 } c = -5555 d = { x = -6666 y = -7777 z = -8888 } } // lldb-command:v unpackedInPacked -// lldbg-check:[...] { a = 987 b = { x = 876 y = 765 z = 654 w = 543 } c = { x = 432 y = 321 z = 210 w = 109 } d = -98 } -// lldbr-check:(packed_struct::UnpackedInPacked) unpackedInPacked = { a = 987 b = { x = 876 y = 765 z = 654 w = 543 } c = { x = 432 y = 321 z = 210 w = 109 } d = -98 } +// lldb-check:[...] { a = 987 b = { x = 876 y = 765 z = 654 w = 543 } c = { x = 432 y = 321 z = 210 w = 109 } d = -98 } // lldb-command:expr sizeof(packed) -// lldbg-check:[...] 14 -// lldbr-check:(usize) [...] 14 +// lldb-check:[...] 14 // lldb-command:expr sizeof(packedInPacked) -// lldbg-check:[...] 40 -// lldbr-check:(usize) [...] 40 +// lldb-check:[...] 40 #![allow(unused_variables)] #![feature(omit_gdb_pretty_printer_section)] diff --git a/tests/debuginfo/pretty-huge-vec.rs b/tests/debuginfo/pretty-huge-vec.rs index dcf3521175d..093fbc5b12d 100644 --- a/tests/debuginfo/pretty-huge-vec.rs +++ b/tests/debuginfo/pretty-huge-vec.rs @@ -1,8 +1,6 @@ -//@ ignore-windows failing on win32 bot +//@ ignore-windows-gnu: #128981 //@ ignore-android: FIXME(#10381) //@ compile-flags:-g -//@ min-gdb-version: 8.1 -//@ min-lldb-version: 310 // === GDB TESTS =================================================================================== diff --git a/tests/debuginfo/pretty-slices.rs b/tests/debuginfo/pretty-slices.rs index 9defa344be0..f1aad836434 100644 --- a/tests/debuginfo/pretty-slices.rs +++ b/tests/debuginfo/pretty-slices.rs @@ -1,16 +1,14 @@ //@ ignore-android: FIXME(#10381) -//@ ignore-windows +//@ ignore-windows-gnu: #128981 //@ compile-flags:-g // gdb-command: run // gdb-command: print slice -// gdbg-check: $1 = struct &[i32](size=3) = {0, 1, 2} -// gdbr-check: $1 = &[i32](size=3) = {0, 1, 2} +// gdb-check: $1 = &[i32](size=3) = {0, 1, 2} // gdb-command: print mut_slice -// gdbg-check: $2 = struct &mut [i32](size=4) = {2, 3, 5, 7} -// gdbr-check: $2 = &mut [i32](size=4) = {2, 3, 5, 7} +// gdb-check: $2 = &mut [i32](size=4) = {2, 3, 5, 7} // gdb-command: print str_slice // gdb-check: $3 = "string slice" diff --git a/tests/debuginfo/pretty-std-collections.rs b/tests/debuginfo/pretty-std-collections.rs index 3d5a30d19a9..5e133ee718e 100644 --- a/tests/debuginfo/pretty-std-collections.rs +++ b/tests/debuginfo/pretty-std-collections.rs @@ -1,14 +1,7 @@ -//@ ignore-windows failing on win32 bot //@ ignore-android: FIXME(#10381) //@ ignore-windows-gnu: #128981 //@ compile-flags:-g -// The pretty printers being tested here require the patch from -// https://sourceware.org/bugzilla/show_bug.cgi?id=21763 -//@ min-gdb-version: 8.1 - -//@ min-lldb-version: 310 - // === GDB TESTS =================================================================================== // gdb-command: run @@ -59,20 +52,16 @@ // lldb-command:run // lldb-command:v vec_deque -// lldbg-check:[...] size=3 { [0] = 5 [1] = 3 [2] = 7 } -// lldbr-check:(alloc::collections::vec_deque::VecDeque<i32>) vec_deque = size=3 = { [0] = 5 [1] = 3 [2] = 7 } +// lldb-check:[...] size=3 { [0] = 5 [1] = 3 [2] = 7 } // lldb-command:v vec_deque2 -// lldbg-check:[...] size=7 { [0] = 2 [1] = 3 [2] = 4 [3] = 5 [4] = 6 [5] = 7 [6] = 8 } -// lldbr-check:(alloc::collections::vec_deque::VecDeque<i32>) vec_deque2 = size=7 = { [0] = 2 [1] = 3 [2] = 4 [3] = 5 [4] = 6 [5] = 7 [6] = 8 } +// lldb-check:[...] size=7 { [0] = 2 [1] = 3 [2] = 4 [3] = 5 [4] = 6 [5] = 7 [6] = 8 } // lldb-command:v hash_map -// lldbg-check:[...] size=4 { [0] = { 0 = 1 1 = 10 } [1] = { 0 = 2 1 = 20 } [2] = { 0 = 3 1 = 30 } [3] = { 0 = 4 1 = 40 } } -// lldbr-check:(std::collections::hash::map::HashMap<u64, u64, [...]>) hash_map = size=4 size=4 { [0] = { 0 = 1 1 = 10 } [1] = { 0 = 2 1 = 20 } [2] = { 0 = 3 1 = 30 } [3] = { 0 = 4 1 = 40 } } +// lldb-check:[...] size=4 { [0] = { 0 = 1 1 = 10 } [1] = { 0 = 2 1 = 20 } [2] = { 0 = 3 1 = 30 } [3] = { 0 = 4 1 = 40 } } // lldb-command:v hash_set -// lldbg-check:[...] size=4 { [0] = 1 [1] = 2 [2] = 3 [3] = 4 } -// lldbr-check:(std::collections::hash::set::HashSet<u64, [...]>) hash_set = size=4 { [0] = 1 [1] = 2 [2] = 3 [3] = 4 } +// lldb-check:[...] size=4 { [0] = 1 [1] = 2 [2] = 3 [3] = 4 } #![allow(unused_variables)] use std::collections::BTreeMap; diff --git a/tests/debuginfo/pretty-std.rs b/tests/debuginfo/pretty-std.rs index 933be977234..d7c640a5bea 100644 --- a/tests/debuginfo/pretty-std.rs +++ b/tests/debuginfo/pretty-std.rs @@ -2,7 +2,6 @@ //@ ignore-windows-gnu: #128981 //@ ignore-android: FIXME(#10381) //@ compile-flags:-g -//@ min-gdb-version: 7.7 //@ min-lldb-version: 1800 //@ min-cdb-version: 10.0.18317.1001 @@ -26,8 +25,7 @@ // gdb-check:$5 = core::option::Option<i16>::Some(8) // gdb-command: print none -// gdbg-check:$6 = None -// gdbr-check:$6 = core::option::Option<i64>::None +// gdb-check:$6 = core::option::Option<i64>::None // gdb-command: print os_string // gdb-check:$7 = "IAMA OS string 😃" diff --git a/tests/debuginfo/pretty-uninitialized-vec.rs b/tests/debuginfo/pretty-uninitialized-vec.rs index 5206ff23fd5..cea2f26ef58 100644 --- a/tests/debuginfo/pretty-uninitialized-vec.rs +++ b/tests/debuginfo/pretty-uninitialized-vec.rs @@ -1,8 +1,6 @@ -//@ ignore-windows failing on win32 bot +//@ ignore-windows-gnu: #128981 //@ ignore-android: FIXME(#10381) //@ compile-flags:-g -//@ min-gdb-version: 8.1 -//@ min-lldb-version: 310 // === GDB TESTS =================================================================================== diff --git a/tests/debuginfo/rc_arc.rs b/tests/debuginfo/rc_arc.rs index 688dc625ce4..f636c60702c 100644 --- a/tests/debuginfo/rc_arc.rs +++ b/tests/debuginfo/rc_arc.rs @@ -1,7 +1,6 @@ //@ ignore-windows-gnu: #128981 //@ compile-flags:-g -//@ min-gdb-version: 8.1 //@ min-cdb-version: 10.0.18317.1001 // === GDB TESTS ================================================================================== diff --git a/tests/debuginfo/recursive-struct.rs b/tests/debuginfo/recursive-struct.rs index 1d039527d1a..a97eb295eb4 100644 --- a/tests/debuginfo/recursive-struct.rs +++ b/tests/debuginfo/recursive-struct.rs @@ -1,61 +1,58 @@ //@ ignore-lldb -// Require a gdb that can read DW_TAG_variant_part. -//@ min-gdb-version: 8.2 - //@ compile-flags:-g // gdb-command:run // gdb-command:print stack_unique.value // gdb-check:$1 = 0 -// gdbr-command:print stack_unique.next.val.value +// gdb-command:print stack_unique.next.val.value // gdb-check:$2 = 1 -// gdbr-command:print unique_unique.value +// gdb-command:print unique_unique.value // gdb-check:$3 = 2 -// gdbr-command:print unique_unique.next.val.value +// gdb-command:print unique_unique.next.val.value // gdb-check:$4 = 3 // gdb-command:print vec_unique[0].value // gdb-check:$5 = 6.5 -// gdbr-command:print vec_unique[0].next.val.value +// gdb-command:print vec_unique[0].next.val.value // gdb-check:$6 = 7.5 -// gdbr-command:print borrowed_unique.value +// gdb-command:print borrowed_unique.value // gdb-check:$7 = 8.5 -// gdbr-command:print borrowed_unique.next.val.value +// gdb-command:print borrowed_unique.next.val.value // gdb-check:$8 = 9.5 // LONG CYCLE // gdb-command:print long_cycle1.value // gdb-check:$9 = 20 -// gdbr-command:print long_cycle1.next.value +// gdb-command:print long_cycle1.next.value // gdb-check:$10 = 21 -// gdbr-command:print long_cycle1.next.next.value +// gdb-command:print long_cycle1.next.next.value // gdb-check:$11 = 22 -// gdbr-command:print long_cycle1.next.next.next.value +// gdb-command:print long_cycle1.next.next.next.value // gdb-check:$12 = 23 // gdb-command:print long_cycle2.value // gdb-check:$13 = 24 -// gdbr-command:print long_cycle2.next.value +// gdb-command:print long_cycle2.next.value // gdb-check:$14 = 25 -// gdbr-command:print long_cycle2.next.next.value +// gdb-command:print long_cycle2.next.next.value // gdb-check:$15 = 26 // gdb-command:print long_cycle3.value // gdb-check:$16 = 27 -// gdbr-command:print long_cycle3.next.value +// gdb-command:print long_cycle3.next.value // gdb-check:$17 = 28 // gdb-command:print long_cycle4.value // gdb-check:$18 = 29.5 -// gdbr-command:print long_cycle_w_anon_types.value +// gdb-command:print long_cycle_w_anon_types.value // gdb-check:$19 = 30 -// gdbr-command:print long_cycle_w_anon_types.next.val.value +// gdb-command:print long_cycle_w_anon_types.next.val.value // gdb-check:$20 = 31 // gdb-command:continue diff --git a/tests/debuginfo/reference-debuginfo.rs b/tests/debuginfo/reference-debuginfo.rs index e2fb964ace5..773c3ae4bc3 100644 --- a/tests/debuginfo/reference-debuginfo.rs +++ b/tests/debuginfo/reference-debuginfo.rs @@ -3,7 +3,6 @@ // and leaves codegen to create a ladder of allocations so as `*a == b`. // //@ compile-flags:-g -Zmir-enable-passes=+ReferencePropagation,-ConstDebugInfo -//@ min-lldb-version: 310 // === GDB TESTS =================================================================================== @@ -18,8 +17,7 @@ // gdb-check:$3 = 97 // gdb-command:print *i8_ref -// gdbg-check:$4 = 68 'D' -// gdbr-check:$4 = 68 +// gdb-check:$4 = 68 // gdb-command:print *i16_ref // gdb-check:$5 = -16 @@ -34,8 +32,7 @@ // gdb-check:$8 = 1 // gdb-command:print *u8_ref -// gdbg-check:$9 = 100 'd' -// gdbr-check:$9 = 100 +// gdb-check:$9 = 100 // gdb-command:print *u16_ref // gdb-check:$10 = 16 @@ -63,68 +60,50 @@ // lldb-command:run // lldb-command:v *bool_ref -// lldbg-check:[...] true -// lldbr-check:(bool) *bool_ref = true +// lldb-check:[...] true // lldb-command:v *int_ref -// lldbg-check:[...] -1 -// lldbr-check:(isize) *int_ref = -1 +// lldb-check:[...] -1 -// NOTE: only rust-enabled lldb supports 32bit chars -// lldbr-command:print *char_ref -// lldbr-check:(char) *char_ref = 'a' // lldb-command:v *i8_ref -// lldbg-check:[...] 'D' -// lldbr-check:(i8) *i8_ref = 68 +// lldb-check:[...] 'D' // lldb-command:v *i16_ref -// lldbg-check:[...] -16 -// lldbr-check:(i16) *i16_ref = -16 +// lldb-check:[...] -16 // lldb-command:v *i32_ref -// lldbg-check:[...] -32 -// lldbr-check:(i32) *i32_ref = -32 +// lldb-check:[...] -32 // lldb-command:v *i64_ref -// lldbg-check:[...] -64 -// lldbr-check:(i64) *i64_ref = -64 +// lldb-check:[...] -64 // lldb-command:v *uint_ref -// lldbg-check:[...] 1 -// lldbr-check:(usize) *uint_ref = 1 +// lldb-check:[...] 1 // lldb-command:v *u8_ref -// lldbg-check:[...] 'd' -// lldbr-check:(u8) *u8_ref = 100 +// lldb-check:[...] 'd' // lldb-command:v *u16_ref -// lldbg-check:[...] 16 -// lldbr-check:(u16) *u16_ref = 16 +// lldb-check:[...] 16 // lldb-command:v *u32_ref -// lldbg-check:[...] 32 -// lldbr-check:(u32) *u32_ref = 32 +// lldb-check:[...] 32 // lldb-command:v *u64_ref -// lldbg-check:[...] 64 -// lldbr-check:(u64) *u64_ref = 64 +// lldb-check:[...] 64 // lldb-command:v *f16_ref -// lldbg-check:[...] 1.5 -// lldbr-check:(f16) *f16_ref = 1.5 +// lldb-check:[...] 1.5 // lldb-command:v *f32_ref -// lldbg-check:[...] 2.5 -// lldbr-check:(f32) *f32_ref = 2.5 +// lldb-check:[...] 2.5 // lldb-command:v *f64_ref -// lldbg-check:[...] 3.5 -// lldbr-check:(f64) *f64_ref = 3.5 +// lldb-check:[...] 3.5 // lldb-command:v *f64_double_ref -// lldbg-check:[...] 3.5 -// lldbr-check:(f64) **f64_double_ref = 3.5 +// lldb-check:[...] 3.5 #![allow(unused_variables)] #![feature(omit_gdb_pretty_printer_section)] diff --git a/tests/debuginfo/regression-bad-location-list-67992.rs b/tests/debuginfo/regression-bad-location-list-67992.rs index fe410942d51..0ec474b5b5a 100644 --- a/tests/debuginfo/regression-bad-location-list-67992.rs +++ b/tests/debuginfo/regression-bad-location-list-67992.rs @@ -11,8 +11,7 @@ // lldb-command:run // lldb-command:v a -// lldbg-check:(regression_bad_location_list_67992::Foo) [...] -// lldbr-check:(regression_bad_location_list_67992::Foo) a = [...] +// lldb-check:(regression_bad_location_list_67992::Foo) [...] const ARRAY_SIZE: usize = 1024; diff --git a/tests/debuginfo/self-in-default-method.rs b/tests/debuginfo/self-in-default-method.rs index 374951475fc..02fc01d96eb 100644 --- a/tests/debuginfo/self-in-default-method.rs +++ b/tests/debuginfo/self-in-default-method.rs @@ -1,5 +1,3 @@ -//@ min-lldb-version: 310 - //@ compile-flags:-g // === GDB TESTS =================================================================================== @@ -8,8 +6,7 @@ // STACK BY REF // gdb-command:print *self -// gdbg-check:$1 = {x = 100} -// gdbr-check:$1 = self_in_default_method::Struct {x: 100} +// gdb-check:$1 = self_in_default_method::Struct {x: 100} // gdb-command:print arg1 // gdb-check:$2 = -1 // gdb-command:print arg2 @@ -18,8 +15,7 @@ // STACK BY VAL // gdb-command:print self -// gdbg-check:$4 = {x = 100} -// gdbr-check:$4 = self_in_default_method::Struct {x: 100} +// gdb-check:$4 = self_in_default_method::Struct {x: 100} // gdb-command:print arg1 // gdb-check:$5 = -3 // gdb-command:print arg2 @@ -28,8 +24,7 @@ // OWNED BY REF // gdb-command:print *self -// gdbg-check:$7 = {x = 200} -// gdbr-check:$7 = self_in_default_method::Struct {x: 200} +// gdb-check:$7 = self_in_default_method::Struct {x: 200} // gdb-command:print arg1 // gdb-check:$8 = -5 // gdb-command:print arg2 @@ -38,8 +33,7 @@ // OWNED BY VAL // gdb-command:print self -// gdbg-check:$10 = {x = 200} -// gdbr-check:$10 = self_in_default_method::Struct {x: 200} +// gdb-check:$10 = self_in_default_method::Struct {x: 200} // gdb-command:print arg1 // gdb-check:$11 = -7 // gdb-command:print arg2 @@ -48,8 +42,7 @@ // OWNED MOVED // gdb-command:print *self -// gdbg-check:$13 = {x = 200} -// gdbr-check:$13 = self_in_default_method::Struct {x: 200} +// gdb-check:$13 = self_in_default_method::Struct {x: 200} // gdb-command:print arg1 // gdb-check:$14 = -9 // gdb-command:print arg2 @@ -63,62 +56,47 @@ // STACK BY REF // lldb-command:v *self -// lldbg-check:[...] { x = 100 } -// lldbr-check:(self_in_default_method::Struct) *self = Struct { x: 100 } +// lldb-check:[...] { x = 100 } // lldb-command:v arg1 -// lldbg-check:[...] -1 -// lldbr-check:(isize) arg1 = -1 +// lldb-check:[...] -1 // lldb-command:v arg2 -// lldbg-check:[...] -2 -// lldbr-check:(isize) arg2 = -2 +// lldb-check:[...] -2 // lldb-command:continue // STACK BY VAL // lldb-command:v self -// lldbg-check:[...] { x = 100 } -// lldbr-check:(self_in_default_method::Struct) self = Struct { x: 100 } +// lldb-check:[...] { x = 100 } // lldb-command:v arg1 -// lldbg-check:[...] -3 -// lldbr-check:(isize) arg1 = -3 +// lldb-check:[...] -3 // lldb-command:v arg2 -// lldbg-check:[...] -4 -// lldbr-check:(isize) arg2 = -4 +// lldb-check:[...] -4 // lldb-command:continue // OWNED BY REF // lldb-command:v *self -// lldbg-check:[...] { x = 200 } -// lldbr-check:(self_in_default_method::Struct) *self = Struct { x: 200 } +// lldb-check:[...] { x = 200 } // lldb-command:v arg1 -// lldbg-check:[...] -5 -// lldbr-check:(isize) arg1 = -5 +// lldb-check:[...] -5 // lldb-command:v arg2 -// lldbg-check:[...] -6 -// lldbr-check:(isize) arg2 = -6 +// lldb-check:[...] -6 // lldb-command:continue // OWNED BY VAL // lldb-command:v self -// lldbg-check:[...] { x = 200 } -// lldbr-check:(self_in_default_method::Struct) self = Struct { x: 200 } +// lldb-check:[...] { x = 200 } // lldb-command:v arg1 -// lldbg-check:[...] -7 -// lldbr-check:(isize) arg1 = -7 +// lldb-check:[...] -7 // lldb-command:v arg2 -// lldbg-check:[...] -8 -// lldbr-check:(isize) arg2 = -8 +// lldb-check:[...] -8 // lldb-command:continue // OWNED MOVED // lldb-command:v *self -// lldbg-check:[...] { x = 200 } -// lldbr-check:(self_in_default_method::Struct) *self = Struct { x: 200 } +// lldb-check:[...] { x = 200 } // lldb-command:v arg1 -// lldbg-check:[...] -9 -// lldbr-check:(isize) arg1 = -9 +// lldb-check:[...] -9 // lldb-command:v arg2 -// lldbg-check:[...] -10 -// lldbr-check:(isize) arg2 = -10 +// lldb-check:[...] -10 // lldb-command:continue #![feature(omit_gdb_pretty_printer_section)] diff --git a/tests/debuginfo/self-in-generic-default-method.rs b/tests/debuginfo/self-in-generic-default-method.rs index 4759ca3ecdc..65018e549ee 100644 --- a/tests/debuginfo/self-in-generic-default-method.rs +++ b/tests/debuginfo/self-in-generic-default-method.rs @@ -1,5 +1,3 @@ -//@ min-lldb-version: 310 - //@ compile-flags:-g // === GDB TESTS =================================================================================== @@ -8,8 +6,7 @@ // STACK BY REF // gdb-command:print *self -// gdbg-check:$1 = {x = 987} -// gdbr-check:$1 = self_in_generic_default_method::Struct {x: 987} +// gdb-check:$1 = self_in_generic_default_method::Struct {x: 987} // gdb-command:print arg1 // gdb-check:$2 = -1 // gdb-command:print arg2 @@ -18,8 +15,7 @@ // STACK BY VAL // gdb-command:print self -// gdbg-check:$4 = {x = 987} -// gdbr-check:$4 = self_in_generic_default_method::Struct {x: 987} +// gdb-check:$4 = self_in_generic_default_method::Struct {x: 987} // gdb-command:print arg1 // gdb-check:$5 = -3 // gdb-command:print arg2 @@ -28,8 +24,7 @@ // OWNED BY REF // gdb-command:print *self -// gdbg-check:$7 = {x = 879} -// gdbr-check:$7 = self_in_generic_default_method::Struct {x: 879} +// gdb-check:$7 = self_in_generic_default_method::Struct {x: 879} // gdb-command:print arg1 // gdb-check:$8 = -5 // gdb-command:print arg2 @@ -38,8 +33,7 @@ // OWNED BY VAL // gdb-command:print self -// gdbg-check:$10 = {x = 879} -// gdbr-check:$10 = self_in_generic_default_method::Struct {x: 879} +// gdb-check:$10 = self_in_generic_default_method::Struct {x: 879} // gdb-command:print arg1 // gdb-check:$11 = -7 // gdb-command:print arg2 @@ -48,8 +42,7 @@ // OWNED MOVED // gdb-command:print *self -// gdbg-check:$13 = {x = 879} -// gdbr-check:$13 = self_in_generic_default_method::Struct {x: 879} +// gdb-check:$13 = self_in_generic_default_method::Struct {x: 879} // gdb-command:print arg1 // gdb-check:$14 = -9 // gdb-command:print arg2 @@ -63,62 +56,47 @@ // STACK BY REF // lldb-command:v *self -// lldbg-check:[...] { x = 987 } -// lldbr-check:(self_in_generic_default_method::Struct) *self = Struct { x: 987 } +// lldb-check:[...] { x = 987 } // lldb-command:v arg1 -// lldbg-check:[...] -1 -// lldbr-check:(isize) arg1 = -1 +// lldb-check:[...] -1 // lldb-command:v arg2 -// lldbg-check:[...] 2 -// lldbr-check:(u16) arg2 = 2 +// lldb-check:[...] 2 // lldb-command:continue // STACK BY VAL // lldb-command:v self -// lldbg-check:[...] { x = 987 } -// lldbr-check:(self_in_generic_default_method::Struct) self = Struct { x: 987 } +// lldb-check:[...] { x = 987 } // lldb-command:v arg1 -// lldbg-check:[...] -3 -// lldbr-check:(isize) arg1 = -3 +// lldb-check:[...] -3 // lldb-command:v arg2 -// lldbg-check:[...] -4 -// lldbr-check:(i16) arg2 = -4 +// lldb-check:[...] -4 // lldb-command:continue // OWNED BY REF // lldb-command:v *self -// lldbg-check:[...] { x = 879 } -// lldbr-check:(self_in_generic_default_method::Struct) *self = Struct { x: 879 } +// lldb-check:[...] { x = 879 } // lldb-command:v arg1 -// lldbg-check:[...] -5 -// lldbr-check:(isize) arg1 = -5 +// lldb-check:[...] -5 // lldb-command:v arg2 -// lldbg-check:[...] -6 -// lldbr-check:(i32) arg2 = -6 +// lldb-check:[...] -6 // lldb-command:continue // OWNED BY VAL // lldb-command:v self -// lldbg-check:[...] { x = 879 } -// lldbr-check:(self_in_generic_default_method::Struct) self = Struct { x: 879 } +// lldb-check:[...] { x = 879 } // lldb-command:v arg1 -// lldbg-check:[...] -7 -// lldbr-check:(isize) arg1 = -7 +// lldb-check:[...] -7 // lldb-command:v arg2 -// lldbg-check:[...] -8 -// lldbr-check:(i64) arg2 = -8 +// lldb-check:[...] -8 // lldb-command:continue // OWNED MOVED // lldb-command:v *self -// lldbg-check:[...] { x = 879 } -// lldbr-check:(self_in_generic_default_method::Struct) *self = Struct { x: 879 } +// lldb-check:[...] { x = 879 } // lldb-command:v arg1 -// lldbg-check:[...] -9 -// lldbr-check:(isize) arg1 = -9 +// lldb-check:[...] -9 // lldb-command:v arg2 -// lldbg-check:[...] -10.5 -// lldbr-check:(f32) arg2 = -10.5 +// lldb-check:[...] -10.5 // lldb-command:continue #![feature(omit_gdb_pretty_printer_section)] diff --git a/tests/debuginfo/shadowed-argument.rs b/tests/debuginfo/shadowed-argument.rs index e7bc731336e..3a575b4addf 100644 --- a/tests/debuginfo/shadowed-argument.rs +++ b/tests/debuginfo/shadowed-argument.rs @@ -1,5 +1,3 @@ -//@ min-lldb-version: 310 - //@ compile-flags:-g // === GDB TESTS =================================================================================== @@ -30,27 +28,21 @@ // lldb-command:run // lldb-command:v x -// lldbg-check:[...] false -// lldbr-check:(bool) x = false +// lldb-check:[...] false // lldb-command:v y -// lldbg-check:[...] true -// lldbr-check:(bool) y = true +// lldb-check:[...] true // lldb-command:continue // lldb-command:v x -// lldbg-check:[...] 10 -// lldbr-check:(i32) x = 10 +// lldb-check:[...] 10 // lldb-command:v y -// lldbg-check:[...] true -// lldbr-check:(bool) y = true +// lldb-check:[...] true // lldb-command:continue // lldb-command:v x -// lldbg-check:[...] 10.5 -// lldbr-check:(f64) x = 10.5 +// lldb-check:[...] 10.5 // lldb-command:v y -// lldbg-check:[...] 20 -// lldbr-check:(i32) y = 20 +// lldb-check:[...] 20 // lldb-command:continue diff --git a/tests/debuginfo/shadowed-variable.rs b/tests/debuginfo/shadowed-variable.rs index 3cc5fe14cb2..752e4c233f1 100644 --- a/tests/debuginfo/shadowed-variable.rs +++ b/tests/debuginfo/shadowed-variable.rs @@ -1,4 +1,3 @@ -//@ min-lldb-version: 310 //@ compile-flags:-g // === GDB TESTS =================================================================================== @@ -40,43 +39,33 @@ // lldb-command:run // lldb-command:v x -// lldbg-check:[...] false -// lldbr-check:(bool) x = false +// lldb-check:[...] false // lldb-command:v y -// lldbg-check:[...] true -// lldbr-check:(bool) y = true +// lldb-check:[...] true // lldb-command:continue // lldb-command:v x -// lldbg-check:[...] 10 -// lldbr-check:(i32) x = 10 +// lldb-check:[...] 10 // lldb-command:v y -// lldbg-check:[...] true -// lldbr-check:(bool) y = true +// lldb-check:[...] true // lldb-command:continue // lldb-command:v x -// lldbg-check:[...] 10.5 -// lldbr-check:(f64) x = 10.5 +// lldb-check:[...] 10.5 // lldb-command:v y -// lldbg-check:[...] 20 -// lldbr-check:(i32) y = 20 +// lldb-check:[...] 20 // lldb-command:continue // lldb-command:v x -// lldbg-check:[...] 10.5 -// lldbr-check:(f64) x = 10.5 +// lldb-check:[...] 10.5 // lldb-command:v y -// lldbg-check:[...] 20 -// lldbr-check:(i32) y = 20 +// lldb-check:[...] 20 // lldb-command:continue // lldb-command:v x -// lldbg-check:[...] 11.5 -// lldbr-check:(f64) x = 11.5 +// lldb-check:[...] 11.5 // lldb-command:v y -// lldbg-check:[...] 20 -// lldbr-check:(i32) y = 20 +// lldb-check:[...] 20 // lldb-command:continue #![feature(omit_gdb_pretty_printer_section)] diff --git a/tests/debuginfo/should-fail.rs b/tests/debuginfo/should-fail.rs index 0f153394a44..bc9b83fc242 100644 --- a/tests/debuginfo/should-fail.rs +++ b/tests/debuginfo/should-fail.rs @@ -1,5 +1,3 @@ -//@ min-lldb-version: 310 - // == Test [gdb|lldb]-[command|check] are parsed correctly === //@ should-fail //@ needs-run-enabled diff --git a/tests/debuginfo/simd.rs b/tests/debuginfo/simd.rs index a5dd2e61a8d..e4fe262235b 100644 --- a/tests/debuginfo/simd.rs +++ b/tests/debuginfo/simd.rs @@ -9,46 +9,28 @@ //@ compile-flags:-g // gdb-command:run -// gdbg-command:print/d vi8x16 -// gdbr-command:print vi8x16 -// gdbg-check:$1 = {__0 = 0, __1 = 1, __2 = 2, __3 = 3, __4 = 4, __5 = 5, __6 = 6, __7 = 7, __8 = 8, __9 = 9, __10 = 10, __11 = 11, __12 = 12, __13 = 13, __14 = 14, __15 = 15} -// gdbr-check:$1 = simd::i8x16 (0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15) -// gdbg-command:print/d vi16x8 -// gdbr-command:print vi16x8 -// gdbg-check:$2 = {__0 = 16, __1 = 17, __2 = 18, __3 = 19, __4 = 20, __5 = 21, __6 = 22, __7 = 23} -// gdbr-check:$2 = simd::i16x8 (16, 17, 18, 19, 20, 21, 22, 23) -// gdbg-command:print/d vi32x4 -// gdbr-command:print vi32x4 -// gdbg-check:$3 = {__0 = 24, __1 = 25, __2 = 26, __3 = 27} -// gdbr-check:$3 = simd::i32x4 (24, 25, 26, 27) -// gdbg-command:print/d vi64x2 -// gdbr-command:print vi64x2 -// gdbg-check:$4 = {__0 = 28, __1 = 29} -// gdbr-check:$4 = simd::i64x2 (28, 29) +// gdb-command:print vi8x16 +// gdb-check:$1 = simd::i8x16 (0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15) +// gdb-command:print vi16x8 +// gdb-check:$2 = simd::i16x8 (16, 17, 18, 19, 20, 21, 22, 23) +// gdb-command:print vi32x4 +// gdb-check:$3 = simd::i32x4 (24, 25, 26, 27) +// gdb-command:print vi64x2 +// gdb-check:$4 = simd::i64x2 (28, 29) -// gdbg-command:print/d vu8x16 -// gdbr-command:print vu8x16 -// gdbg-check:$5 = {__0 = 30, __1 = 31, __2 = 32, __3 = 33, __4 = 34, __5 = 35, __6 = 36, __7 = 37, __8 = 38, __9 = 39, __10 = 40, __11 = 41, __12 = 42, __13 = 43, __14 = 44, __15 = 45} -// gdbr-check:$5 = simd::u8x16 (30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45) -// gdbg-command:print/d vu16x8 -// gdbr-command:print vu16x8 -// gdbg-check:$6 = {__0 = 46, __1 = 47, __2 = 48, __3 = 49, __4 = 50, __5 = 51, __6 = 52, __7 = 53} -// gdbr-check:$6 = simd::u16x8 (46, 47, 48, 49, 50, 51, 52, 53) -// gdbg-command:print/d vu32x4 -// gdbr-command:print vu32x4 -// gdbg-check:$7 = {__0 = 54, __1 = 55, __2 = 56, __3 = 57} -// gdbr-check:$7 = simd::u32x4 (54, 55, 56, 57) -// gdbg-command:print/d vu64x2 -// gdbr-command:print vu64x2 -// gdbg-check:$8 = {__0 = 58, __1 = 59} -// gdbr-check:$8 = simd::u64x2 (58, 59) +// gdb-command:print vu8x16 +// gdb-check:$5 = simd::u8x16 (30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45) +// gdb-command:print vu16x8 +// gdb-check:$6 = simd::u16x8 (46, 47, 48, 49, 50, 51, 52, 53) +// gdb-command:print vu32x4 +// gdb-check:$7 = simd::u32x4 (54, 55, 56, 57) +// gdb-command:print vu64x2 +// gdb-check:$8 = simd::u64x2 (58, 59) // gdb-command:print vf32x4 -// gdbg-check:$9 = {__0 = 60.5, __1 = 61.5, __2 = 62.5, __3 = 63.5} -// gdbr-check:$9 = simd::f32x4 (60.5, 61.5, 62.5, 63.5) +// gdb-check:$9 = simd::f32x4 (60.5, 61.5, 62.5, 63.5) // gdb-command:print vf64x2 -// gdbg-check:$10 = {__0 = 64.5, __1 = 65.5} -// gdbr-check:$10 = simd::f64x2 (64.5, 65.5) +// gdb-check:$10 = simd::f64x2 (64.5, 65.5) // gdb-command:continue diff --git a/tests/debuginfo/simple-lexical-scope.rs b/tests/debuginfo/simple-lexical-scope.rs index 4156e68f8b1..6008489bd65 100644 --- a/tests/debuginfo/simple-lexical-scope.rs +++ b/tests/debuginfo/simple-lexical-scope.rs @@ -1,5 +1,3 @@ -//@ min-lldb-version: 310 - //@ compile-flags:-g // === GDB TESTS =================================================================================== @@ -40,38 +38,31 @@ // lldb-command:run // lldb-command:v x -// lldbg-check:[...] false -// lldbr-check:(bool) x = false +// lldb-check:[...] false // lldb-command:continue // lldb-command:v x -// lldbg-check:[...] false -// lldbr-check:(bool) x = false +// lldb-check:[...] false // lldb-command:continue // lldb-command:v x -// lldbg-check:[...] 10 -// lldbr-check:(i32) x = 10 +// lldb-check:[...] 10 // lldb-command:continue // lldb-command:v x -// lldbg-check:[...] 10 -// lldbr-check:(i32) x = 10 +// lldb-check:[...] 10 // lldb-command:continue // lldb-command:v x -// lldbg-check:[...] 10.5 -// lldbr-check:(f64) x = 10.5 +// lldb-check:[...] 10.5 // lldb-command:continue // lldb-command:v x -// lldbg-check:[...] 10 -// lldbr-check:(i32) x = 10 +// lldb-check:[...] 10 // lldb-command:continue // lldb-command:v x -// lldbg-check:[...] false -// lldbr-check:(bool) x = false +// lldb-check:[...] false // lldb-command:continue diff --git a/tests/debuginfo/simple-struct.rs b/tests/debuginfo/simple-struct.rs index aaa654aeb7a..bb6b2b79810 100644 --- a/tests/debuginfo/simple-struct.rs +++ b/tests/debuginfo/simple-struct.rs @@ -1,94 +1,62 @@ -//@ min-lldb-version: 310 - //@ compile-flags: -g -Zmir-enable-passes=-CheckAlignment // === GDB TESTS =================================================================================== -// gdbg-command:print 'simple_struct::NO_PADDING_16' -// gdbr-command:print simple_struct::NO_PADDING_16 -// gdbg-check:$1 = {x = 1000, y = -1001} -// gdbr-check:$1 = simple_struct::NoPadding16 {x: 1000, y: -1001} +// gdb-command:print simple_struct::NO_PADDING_16 +// gdb-check:$1 = simple_struct::NoPadding16 {x: 1000, y: -1001} -// gdbg-command:print 'simple_struct::NO_PADDING_32' -// gdbr-command:print simple_struct::NO_PADDING_32 -// gdbg-check:$2 = {x = 1, y = 2, z = 3} -// gdbr-check:$2 = simple_struct::NoPadding32 {x: 1, y: 2, z: 3} +// gdb-command:print simple_struct::NO_PADDING_32 +// gdb-check:$2 = simple_struct::NoPadding32 {x: 1, y: 2, z: 3} -// gdbg-command:print 'simple_struct::NO_PADDING_64' -// gdbr-command:print simple_struct::NO_PADDING_64 -// gdbg-check:$3 = {x = 4, y = 5, z = 6} -// gdbr-check:$3 = simple_struct::NoPadding64 {x: 4, y: 5, z: 6} +// gdb-command:print simple_struct::NO_PADDING_64 +// gdb-check:$3 = simple_struct::NoPadding64 {x: 4, y: 5, z: 6} -// gdbg-command:print 'simple_struct::NO_PADDING_163264' -// gdbr-command:print simple_struct::NO_PADDING_163264 -// gdbg-check:$4 = {a = 7, b = 8, c = 9, d = 10} -// gdbr-check:$4 = simple_struct::NoPadding163264 {a: 7, b: 8, c: 9, d: 10} +// gdb-command:print simple_struct::NO_PADDING_163264 +// gdb-check:$4 = simple_struct::NoPadding163264 {a: 7, b: 8, c: 9, d: 10} -// gdbg-command:print 'simple_struct::INTERNAL_PADDING' -// gdbr-command:print simple_struct::INTERNAL_PADDING -// gdbg-check:$5 = {x = 11, y = 12} -// gdbr-check:$5 = simple_struct::InternalPadding {x: 11, y: 12} +// gdb-command:print simple_struct::INTERNAL_PADDING +// gdb-check:$5 = simple_struct::InternalPadding {x: 11, y: 12} -// gdbg-command:print 'simple_struct::PADDING_AT_END' -// gdbr-command:print simple_struct::PADDING_AT_END -// gdbg-check:$6 = {x = 13, y = 14} -// gdbr-check:$6 = simple_struct::PaddingAtEnd {x: 13, y: 14} +// gdb-command:print simple_struct::PADDING_AT_END +// gdb-check:$6 = simple_struct::PaddingAtEnd {x: 13, y: 14} // gdb-command:run // gdb-command:print no_padding16 -// gdbg-check:$7 = {x = 10000, y = -10001} -// gdbr-check:$7 = simple_struct::NoPadding16 {x: 10000, y: -10001} +// gdb-check:$7 = simple_struct::NoPadding16 {x: 10000, y: -10001} // gdb-command:print no_padding32 -// gdbg-check:$8 = {x = -10002, y = -10003.5, z = 10004} -// gdbr-check:$8 = simple_struct::NoPadding32 {x: -10002, y: -10003.5, z: 10004} +// gdb-check:$8 = simple_struct::NoPadding32 {x: -10002, y: -10003.5, z: 10004} // gdb-command:print no_padding64 -// gdbg-check:$9 = {x = -10005.5, y = 10006, z = 10007} -// gdbr-check:$9 = simple_struct::NoPadding64 {x: -10005.5, y: 10006, z: 10007} +// gdb-check:$9 = simple_struct::NoPadding64 {x: -10005.5, y: 10006, z: 10007} // gdb-command:print no_padding163264 -// gdbg-check:$10 = {a = -10008, b = 10009, c = 10010, d = 10011} -// gdbr-check:$10 = simple_struct::NoPadding163264 {a: -10008, b: 10009, c: 10010, d: 10011} +// gdb-check:$10 = simple_struct::NoPadding163264 {a: -10008, b: 10009, c: 10010, d: 10011} // gdb-command:print internal_padding -// gdbg-check:$11 = {x = 10012, y = -10013} -// gdbr-check:$11 = simple_struct::InternalPadding {x: 10012, y: -10013} +// gdb-check:$11 = simple_struct::InternalPadding {x: 10012, y: -10013} // gdb-command:print padding_at_end -// gdbg-check:$12 = {x = -10014, y = 10015} -// gdbr-check:$12 = simple_struct::PaddingAtEnd {x: -10014, y: 10015} - -// gdbg-command:print 'simple_struct::NO_PADDING_16' -// gdbr-command:print simple_struct::NO_PADDING_16 -// gdbg-check:$13 = {x = 100, y = -101} -// gdbr-check:$13 = simple_struct::NoPadding16 {x: 100, y: -101} - -// gdbg-command:print 'simple_struct::NO_PADDING_32' -// gdbr-command:print simple_struct::NO_PADDING_32 -// gdbg-check:$14 = {x = -15, y = -16, z = 17} -// gdbr-check:$14 = simple_struct::NoPadding32 {x: -15, y: -16, z: 17} - -// gdbg-command:print 'simple_struct::NO_PADDING_64' -// gdbr-command:print simple_struct::NO_PADDING_64 -// gdbg-check:$15 = {x = -18, y = 19, z = 20} -// gdbr-check:$15 = simple_struct::NoPadding64 {x: -18, y: 19, z: 20} - -// gdbg-command:print 'simple_struct::NO_PADDING_163264' -// gdbr-command:print simple_struct::NO_PADDING_163264 -// gdbg-check:$16 = {a = -21, b = 22, c = 23, d = 24} -// gdbr-check:$16 = simple_struct::NoPadding163264 {a: -21, b: 22, c: 23, d: 24} - -// gdbg-command:print 'simple_struct::INTERNAL_PADDING' -// gdbr-command:print simple_struct::INTERNAL_PADDING -// gdbg-check:$17 = {x = 25, y = -26} -// gdbr-check:$17 = simple_struct::InternalPadding {x: 25, y: -26} - -// gdbg-command:print 'simple_struct::PADDING_AT_END' -// gdbr-command:print simple_struct::PADDING_AT_END -// gdbg-check:$18 = {x = -27, y = 28} -// gdbr-check:$18 = simple_struct::PaddingAtEnd {x: -27, y: 28} +// gdb-check:$12 = simple_struct::PaddingAtEnd {x: -10014, y: 10015} + +// gdb-command:print simple_struct::NO_PADDING_16 +// gdb-check:$13 = simple_struct::NoPadding16 {x: 100, y: -101} + +// gdb-command:print simple_struct::NO_PADDING_32 +// gdb-check:$14 = simple_struct::NoPadding32 {x: -15, y: -16, z: 17} + +// gdb-command:print simple_struct::NO_PADDING_64 +// gdb-check:$15 = simple_struct::NoPadding64 {x: -18, y: 19, z: 20} + +// gdb-command:print simple_struct::NO_PADDING_163264 +// gdb-check:$16 = simple_struct::NoPadding163264 {a: -21, b: 22, c: 23, d: 24} + +// gdb-command:print simple_struct::INTERNAL_PADDING +// gdb-check:$17 = simple_struct::InternalPadding {x: 25, y: -26} + +// gdb-command:print simple_struct::PADDING_AT_END +// gdb-check:$18 = simple_struct::PaddingAtEnd {x: -27, y: 28} // gdb-command:continue @@ -97,28 +65,22 @@ // lldb-command:run // lldb-command:v no_padding16 -// lldbg-check:[...] { x = 10000 y = -10001 } -// lldbr-check:(simple_struct::NoPadding16) no_padding16 = { x = 10000 y = -10001 } +// lldb-check:[...] { x = 10000 y = -10001 } // lldb-command:v no_padding32 -// lldbg-check:[...] { x = -10002 y = -10003.5 z = 10004 } -// lldbr-check:(simple_struct::NoPadding32) no_padding32 = { x = -10002 y = -10003.5 z = 10004 } +// lldb-check:[...] { x = -10002 y = -10003.5 z = 10004 } // lldb-command:v no_padding64 -// lldbg-check:[...] { x = -10005.5 y = 10006 z = 10007 } -// lldbr-check:(simple_struct::NoPadding64) no_padding64 = { x = -10005.5 y = 10006 z = 10007 } +// lldb-check:[...] { x = -10005.5 y = 10006 z = 10007 } // lldb-command:v no_padding163264 -// lldbg-check:[...] { a = -10008 b = 10009 c = 10010 d = 10011 } -// lldbr-check:(simple_struct::NoPadding163264) no_padding163264 = { a = -10008 b = 10009 c = 10010 d = 10011 } +// lldb-check:[...] { a = -10008 b = 10009 c = 10010 d = 10011 } // lldb-command:v internal_padding -// lldbg-check:[...] { x = 10012 y = -10013 } -// lldbr-check:(simple_struct::InternalPadding) internal_padding = { x = 10012 y = -10013 } +// lldb-check:[...] { x = 10012 y = -10013 } // lldb-command:v padding_at_end -// lldbg-check:[...] { x = -10014 y = 10015 } -// lldbr-check:(simple_struct::PaddingAtEnd) padding_at_end = { x = -10014 y = 10015 } +// lldb-check:[...] { x = -10014 y = 10015 } #![allow(unused_variables)] #![allow(dead_code)] diff --git a/tests/debuginfo/simple-tuple.rs b/tests/debuginfo/simple-tuple.rs index 9d809a11cac..82467ef3bcf 100644 --- a/tests/debuginfo/simple-tuple.rs +++ b/tests/debuginfo/simple-tuple.rs @@ -1,97 +1,59 @@ -//@ min-lldb-version: 310 - //@ compile-flags:-g // === GDB TESTS =================================================================================== -// gdbg-command:print/d 'simple_tuple::NO_PADDING_8' -// gdbr-command:print simple_tuple::NO_PADDING_8 -// gdbg-check:$1 = {__0 = -50, __1 = 50} -// gdbr-check:$1 = (-50, 50) -// gdbg-command:print 'simple_tuple::NO_PADDING_16' -// gdbr-command:print simple_tuple::NO_PADDING_16 -// gdbg-check:$2 = {__0 = -1, __1 = 2, __2 = 3} -// gdbr-check:$2 = (-1, 2, 3) -// gdbg-command:print 'simple_tuple::NO_PADDING_32' -// gdbr-command:print simple_tuple::NO_PADDING_32 -// gdbg-check:$3 = {__0 = 4, __1 = 5, __2 = 6} -// gdbr-check:$3 = (4, 5, 6) -// gdbg-command:print 'simple_tuple::NO_PADDING_64' -// gdbr-command:print simple_tuple::NO_PADDING_64 -// gdbg-check:$4 = {__0 = 7, __1 = 8, __2 = 9} -// gdbr-check:$4 = (7, 8, 9) - -// gdbg-command:print 'simple_tuple::INTERNAL_PADDING_1' -// gdbr-command:print simple_tuple::INTERNAL_PADDING_1 -// gdbg-check:$5 = {__0 = 10, __1 = 11} -// gdbr-check:$5 = (10, 11) -// gdbg-command:print 'simple_tuple::INTERNAL_PADDING_2' -// gdbr-command:print simple_tuple::INTERNAL_PADDING_2 -// gdbg-check:$6 = {__0 = 12, __1 = 13, __2 = 14, __3 = 15} -// gdbr-check:$6 = (12, 13, 14, 15) - -// gdbg-command:print 'simple_tuple::PADDING_AT_END' -// gdbr-command:print simple_tuple::PADDING_AT_END -// gdbg-check:$7 = {__0 = 16, __1 = 17} -// gdbr-check:$7 = (16, 17) +// gdb-command:print simple_tuple::NO_PADDING_8 +// gdb-check:$1 = (-50, 50) +// gdb-command:print simple_tuple::NO_PADDING_16 +// gdb-check:$2 = (-1, 2, 3) +// gdb-command:print simple_tuple::NO_PADDING_32 +// gdb-check:$3 = (4, 5, 6) +// gdb-command:print simple_tuple::NO_PADDING_64 +// gdb-check:$4 = (7, 8, 9) + +// gdb-command:print simple_tuple::INTERNAL_PADDING_1 +// gdb-check:$5 = (10, 11) +// gdb-command:print simple_tuple::INTERNAL_PADDING_2 +// gdb-check:$6 = (12, 13, 14, 15) + +// gdb-command:print simple_tuple::PADDING_AT_END +// gdb-check:$7 = (16, 17) // gdb-command:run -// gdbg-command:print/d noPadding8 -// gdbr-command:print noPadding8 -// gdbg-check:$8 = {__0 = -100, __1 = 100} -// gdbr-check:$8 = (-100, 100) +// gdb-command:print noPadding8 +// gdb-check:$8 = (-100, 100) // gdb-command:print noPadding16 -// gdbg-check:$9 = {__0 = 0, __1 = 1, __2 = 2} -// gdbr-check:$9 = (0, 1, 2) +// gdb-check:$9 = (0, 1, 2) // gdb-command:print noPadding32 -// gdbg-check:$10 = {__0 = 3, __1 = 4.5, __2 = 5} -// gdbr-check:$10 = (3, 4.5, 5) +// gdb-check:$10 = (3, 4.5, 5) // gdb-command:print noPadding64 -// gdbg-check:$11 = {__0 = 6, __1 = 7.5, __2 = 8} -// gdbr-check:$11 = (6, 7.5, 8) +// gdb-check:$11 = (6, 7.5, 8) // gdb-command:print internalPadding1 -// gdbg-check:$12 = {__0 = 9, __1 = 10} -// gdbr-check:$12 = (9, 10) +// gdb-check:$12 = (9, 10) // gdb-command:print internalPadding2 -// gdbg-check:$13 = {__0 = 11, __1 = 12, __2 = 13, __3 = 14} -// gdbr-check:$13 = (11, 12, 13, 14) +// gdb-check:$13 = (11, 12, 13, 14) // gdb-command:print paddingAtEnd -// gdbg-check:$14 = {__0 = 15, __1 = 16} -// gdbr-check:$14 = (15, 16) - -// gdbg-command:print/d 'simple_tuple::NO_PADDING_8' -// gdbr-command:print simple_tuple::NO_PADDING_8 -// gdbg-check:$15 = {__0 = -127, __1 = 127} -// gdbr-check:$15 = (-127, 127) -// gdbg-command:print 'simple_tuple::NO_PADDING_16' -// gdbr-command:print simple_tuple::NO_PADDING_16 -// gdbg-check:$16 = {__0 = -10, __1 = 10, __2 = 9} -// gdbr-check:$16 = (-10, 10, 9) -// gdbg-command:print 'simple_tuple::NO_PADDING_32' -// gdbr-command:print simple_tuple::NO_PADDING_32 -// gdbg-check:$17 = {__0 = 14, __1 = 15, __2 = 16} -// gdbr-check:$17 = (14, 15, 16) -// gdbg-command:print 'simple_tuple::NO_PADDING_64' -// gdbr-command:print simple_tuple::NO_PADDING_64 -// gdbg-check:$18 = {__0 = 17, __1 = 18, __2 = 19} -// gdbr-check:$18 = (17, 18, 19) - -// gdbg-command:print 'simple_tuple::INTERNAL_PADDING_1' -// gdbr-command:print simple_tuple::INTERNAL_PADDING_1 -// gdbg-check:$19 = {__0 = 110, __1 = 111} -// gdbr-check:$19 = (110, 111) -// gdbg-command:print 'simple_tuple::INTERNAL_PADDING_2' -// gdbr-command:print simple_tuple::INTERNAL_PADDING_2 -// gdbg-check:$20 = {__0 = 112, __1 = 113, __2 = 114, __3 = 115} -// gdbr-check:$20 = (112, 113, 114, 115) - -// gdbg-command:print 'simple_tuple::PADDING_AT_END' -// gdbr-command:print simple_tuple::PADDING_AT_END -// gdbg-check:$21 = {__0 = 116, __1 = 117} -// gdbr-check:$21 = (116, 117) +// gdb-check:$14 = (15, 16) + +// gdb-command:print simple_tuple::NO_PADDING_8 +// gdb-check:$15 = (-127, 127) +// gdb-command:print simple_tuple::NO_PADDING_16 +// gdb-check:$16 = (-10, 10, 9) +// gdb-command:print simple_tuple::NO_PADDING_32 +// gdb-check:$17 = (14, 15, 16) +// gdb-command:print simple_tuple::NO_PADDING_64 +// gdb-check:$18 = (17, 18, 19) + +// gdb-command:print simple_tuple::INTERNAL_PADDING_1 +// gdb-check:$19 = (110, 111) +// gdb-command:print simple_tuple::INTERNAL_PADDING_2 +// gdb-check:$20 = (112, 113, 114, 115) + +// gdb-command:print simple_tuple::PADDING_AT_END +// gdb-check:$21 = (116, 117) // === LLDB TESTS ================================================================================== @@ -99,28 +61,21 @@ // lldb-command:run // lldb-command:v/d noPadding8 -// lldbg-check:[...] { 0 = -100 1 = 100 } -// lldbr-check:((i8, u8)) noPadding8 = { 0 = -100 1 = 100 } +// lldb-check:[...] { 0 = -100 1 = 100 } // lldb-command:v noPadding16 -// lldbg-check:[...] { 0 = 0 1 = 1 2 = 2 } -// lldbr-check:((i16, i16, u16)) noPadding16 = { 0 = 0 1 = 1 2 = 2 } +// lldb-check:[...] { 0 = 0 1 = 1 2 = 2 } // lldb-command:v noPadding32 -// lldbg-check:[...] { 0 = 3 1 = 4.5 2 = 5 } -// lldbr-check:((i32, f32, u32)) noPadding32 = { 0 = 3 1 = 4.5 2 = 5 } +// lldb-check:[...] { 0 = 3 1 = 4.5 2 = 5 } // lldb-command:v noPadding64 -// lldbg-check:[...] { 0 = 6 1 = 7.5 2 = 8 } -// lldbr-check:((i64, f64, u64)) noPadding64 = { 0 = 6 1 = 7.5 2 = 8 } +// lldb-check:[...] { 0 = 6 1 = 7.5 2 = 8 } // lldb-command:v internalPadding1 -// lldbg-check:[...] { 0 = 9 1 = 10 } -// lldbr-check:((i16, i32)) internalPadding1 = { 0 = 9 1 = 10 } +// lldb-check:[...] { 0 = 9 1 = 10 } // lldb-command:v internalPadding2 -// lldbg-check:[...] { 0 = 11 1 = 12 2 = 13 3 = 14 } -// lldbr-check:((i16, i32, u32, u64)) internalPadding2 = { 0 = 11 1 = 12 2 = 13 3 = 14 } +// lldb-check:[...] { 0 = 11 1 = 12 2 = 13 3 = 14 } // lldb-command:v paddingAtEnd -// lldbg-check:[...] { 0 = 15 1 = 16 } -// lldbr-check:((i32, i16)) paddingAtEnd = { 0 = 15 1 = 16 } +// lldb-check:[...] { 0 = 15 1 = 16 } // === CDB TESTS ================================================================================== diff --git a/tests/debuginfo/static-method-on-struct-and-enum.rs b/tests/debuginfo/static-method-on-struct-and-enum.rs index b4ec4543572..b487512a52f 100644 --- a/tests/debuginfo/static-method-on-struct-and-enum.rs +++ b/tests/debuginfo/static-method-on-struct-and-enum.rs @@ -1,5 +1,3 @@ -//@ min-lldb-version: 310 - //@ compile-flags:-g // === GDB TESTS =================================================================================== @@ -29,23 +27,18 @@ // STRUCT // lldb-command:v arg1 -// lldbg-check:[...] 1 -// lldbr-check:(isize) arg1 = 1 +// lldb-check:[...] 1 // lldb-command:v arg2 -// lldbg-check:[...] 2 -// lldbr-check:(isize) arg2 = 2 +// lldb-check:[...] 2 // lldb-command:continue // ENUM // lldb-command:v arg1 -// lldbg-check:[...] -3 -// lldbr-check:(isize) arg1 = -3 +// lldb-check:[...] -3 // lldb-command:v arg2 -// lldbg-check:[...] 4.5 -// lldbr-check:(f64) arg2 = 4.5 +// lldb-check:[...] 4.5 // lldb-command:v arg3 -// lldbg-check:[...] 5 -// lldbr-check:(usize) arg3 = 5 +// lldb-check:[...] 5 // lldb-command:continue #![feature(omit_gdb_pretty_printer_section)] diff --git a/tests/debuginfo/strings-and-strs.rs b/tests/debuginfo/strings-and-strs.rs index 2d29ac12bd8..b7ee3312d13 100644 --- a/tests/debuginfo/strings-and-strs.rs +++ b/tests/debuginfo/strings-and-strs.rs @@ -7,37 +7,37 @@ // gdb-command:run // gdb-command:print plain_string -// gdbr-check:$1 = alloc::string::String {vec: alloc::vec::Vec<u8, alloc::alloc::Global> {buf: alloc::raw_vec::RawVec<u8, alloc::alloc::Global> {inner: alloc::raw_vec::RawVecInner<alloc::alloc::Global> {ptr: core::ptr::unique::Unique<u8> {pointer: core::ptr::non_null::NonNull<u8> {pointer: 0x[...]}, _marker: core::marker::PhantomData<u8>}, cap: alloc::raw_vec::Cap (5), alloc: alloc::alloc::Global}, _marker: core::marker::PhantomData<u8>}, len: 5}} +// gdb-check:$1 = alloc::string::String {vec: alloc::vec::Vec<u8, alloc::alloc::Global> {buf: alloc::raw_vec::RawVec<u8, alloc::alloc::Global> {inner: alloc::raw_vec::RawVecInner<alloc::alloc::Global> {ptr: core::ptr::unique::Unique<u8> {pointer: core::ptr::non_null::NonNull<u8> {pointer: 0x[...]}, _marker: core::marker::PhantomData<u8>}, cap: alloc::raw_vec::Cap (5), alloc: alloc::alloc::Global}, _marker: core::marker::PhantomData<u8>}, len: 5}} // gdb-command:print plain_str -// gdbr-check:$2 = "Hello" +// gdb-check:$2 = "Hello" // gdb-command:print str_in_struct -// gdbr-check:$3 = strings_and_strs::Foo {inner: "Hello"} +// gdb-check:$3 = strings_and_strs::Foo {inner: "Hello"} // gdb-command:print str_in_tuple -// gdbr-check:$4 = ("Hello", "World") +// gdb-check:$4 = ("Hello", "World") // gdb-command:print str_in_rc -// gdbr-check:$5 = alloc::rc::Rc<&str, alloc::alloc::Global> {ptr: core::ptr::non_null::NonNull<alloc::rc::RcBox<&str>> {pointer: 0x[...]}, phantom: core::marker::PhantomData<alloc::rc::RcBox<&str>>, alloc: alloc::alloc::Global} +// gdb-check:$5 = alloc::rc::Rc<&str, alloc::alloc::Global> {ptr: core::ptr::non_null::NonNull<alloc::rc::RcBox<&str>> {pointer: 0x[...]}, phantom: core::marker::PhantomData<alloc::rc::RcBox<&str>>, alloc: alloc::alloc::Global} // === LLDB TESTS ================================================================================== // lldb-command:run // lldb-command:v plain_string -// lldbg-check:(alloc::string::String) plain_string = "Hello" { vec = size=5 { [0] = 'H' [1] = 'e' [2] = 'l' [3] = 'l' [4] = 'o' } } +// lldb-check:(alloc::string::String) plain_string = "Hello" { vec = size=5 { [0] = 'H' [1] = 'e' [2] = 'l' [3] = 'l' [4] = 'o' } } // lldb-command:v plain_str -// lldbg-check:(&str) plain_str = "Hello" { [0] = 'H' [1] = 'e' [2] = 'l' [3] = 'l' [4] = 'o' } +// lldb-check:(&str) plain_str = "Hello" { [0] = 'H' [1] = 'e' [2] = 'l' [3] = 'l' [4] = 'o' } // lldb-command:v str_in_struct -// lldbg-check:((&str, &str)) str_in_tuple = { 0 = "Hello" { [0] = 'H' [1] = 'e' [2] = 'l' [3] = 'l' [4] = 'o' } 1 = "World" { [0] = 'W' [1] = 'o' [2] = 'r' [3] = 'l' [4] = 'd' } } +// lldb-check:((&str, &str)) str_in_tuple = { 0 = "Hello" { [0] = 'H' [1] = 'e' [2] = 'l' [3] = 'l' [4] = 'o' } 1 = "World" { [0] = 'W' [1] = 'o' [2] = 'r' [3] = 'l' [4] = 'd' } } // lldb-command:v str_in_tuple -// lldbg-check:((&str, &str)) str_in_tuple = { 0 = "Hello" { [0] = 'H' [1] = 'e' [2] = 'l' [3] = 'l' [4] = 'o' } 1 = "World" { [0] = 'W' [1] = 'o' [2] = 'r' [3] = 'l' [4] = 'd' } } +// lldb-check:((&str, &str)) str_in_tuple = { 0 = "Hello" { [0] = 'H' [1] = 'e' [2] = 'l' [3] = 'l' [4] = 'o' } 1 = "World" { [0] = 'W' [1] = 'o' [2] = 'r' [3] = 'l' [4] = 'd' } } // lldb-command:v str_in_rc -// lldbg-check:(alloc::rc::Rc<&str, alloc::alloc::Global>) str_in_rc = strong=1, weak=0 { value = "Hello" { [0] = 'H' [1] = 'e' [2] = 'l' [3] = 'l' [4] = 'o' } } +// lldb-check:(alloc::rc::Rc<&str, alloc::alloc::Global>) str_in_rc = strong=1, weak=0 { value = "Hello" { [0] = 'H' [1] = 'e' [2] = 'l' [3] = 'l' [4] = 'o' } } #![allow(unused_variables)] diff --git a/tests/debuginfo/struct-in-enum.rs b/tests/debuginfo/struct-in-enum.rs index e4b647a4ac1..bc2c59fe4aa 100644 --- a/tests/debuginfo/struct-in-enum.rs +++ b/tests/debuginfo/struct-in-enum.rs @@ -1,5 +1,4 @@ //@ min-lldb-version: 1800 -//@ ignore-gdb-version: 7.11.90 - 7.12.9 //@ compile-flags:-g @@ -9,16 +8,13 @@ // gdb-command:run // gdb-command:print case1 -// gdbg-check:$1 = {{RUST$ENUM$DISR = Case1, __0 = 0, __1 = {x = 2088533116, y = 2088533116, z = 31868}}, {RUST$ENUM$DISR = Case1, [...]}} -// gdbr-check:$1 = struct_in_enum::Regular::Case1(0, struct_in_enum::Struct {x: 2088533116, y: 2088533116, z: 31868}) +// gdb-check:$1 = struct_in_enum::Regular::Case1(0, struct_in_enum::Struct {x: 2088533116, y: 2088533116, z: 31868}) // gdb-command:print case2 -// gdbg-check:$2 = {{RUST$ENUM$DISR = Case2, [...]}, {RUST$ENUM$DISR = Case2, __0 = 0, __1 = 1229782938247303441, __2 = 4369}} -// gdbr-check:$2 = struct_in_enum::Regular::Case2(0, 1229782938247303441, 4369) +// gdb-check:$2 = struct_in_enum::Regular::Case2(0, 1229782938247303441, 4369) // gdb-command:print univariant -// gdbg-check:$3 = {{__0 = {x = 123, y = 456, z = 789}}} -// gdbr-check:$3 = struct_in_enum::Univariant::TheOnlyCase(struct_in_enum::Struct {x: 123, y: 456, z: 789}) +// gdb-check:$3 = struct_in_enum::Univariant::TheOnlyCase(struct_in_enum::Struct {x: 123, y: 456, z: 789}) // === LLDB TESTS ================================================================================== diff --git a/tests/debuginfo/struct-in-struct.rs b/tests/debuginfo/struct-in-struct.rs index 7ca0e3a5ef6..3cf48470391 100644 --- a/tests/debuginfo/struct-in-struct.rs +++ b/tests/debuginfo/struct-in-struct.rs @@ -1,5 +1,3 @@ -//@ min-lldb-version: 310 - //@ compile-flags:-g // === GDB TESTS =================================================================================== @@ -7,16 +5,13 @@ // gdb-command:run // gdb-command:print three_simple_structs -// gdbg-check:$1 = {x = {x = 1}, y = {x = 2}, z = {x = 3}} -// gdbr-check:$1 = struct_in_struct::ThreeSimpleStructs {x: struct_in_struct::Simple {x: 1}, y: struct_in_struct::Simple {x: 2}, z: struct_in_struct::Simple {x: 3}} +// gdb-check:$1 = struct_in_struct::ThreeSimpleStructs {x: struct_in_struct::Simple {x: 1}, y: struct_in_struct::Simple {x: 2}, z: struct_in_struct::Simple {x: 3}} // gdb-command:print internal_padding_parent -// gdbg-check:$2 = {x = {x = 4, y = 5}, y = {x = 6, y = 7}, z = {x = 8, y = 9}} -// gdbr-check:$2 = struct_in_struct::InternalPaddingParent {x: struct_in_struct::InternalPadding {x: 4, y: 5}, y: struct_in_struct::InternalPadding {x: 6, y: 7}, z: struct_in_struct::InternalPadding {x: 8, y: 9}} +// gdb-check:$2 = struct_in_struct::InternalPaddingParent {x: struct_in_struct::InternalPadding {x: 4, y: 5}, y: struct_in_struct::InternalPadding {x: 6, y: 7}, z: struct_in_struct::InternalPadding {x: 8, y: 9}} // gdb-command:print padding_at_end_parent -// gdbg-check:$3 = {x = {x = 10, y = 11}, y = {x = 12, y = 13}, z = {x = 14, y = 15}} -// gdbr-check:$3 = struct_in_struct::PaddingAtEndParent {x: struct_in_struct::PaddingAtEnd {x: 10, y: 11}, y: struct_in_struct::PaddingAtEnd {x: 12, y: 13}, z: struct_in_struct::PaddingAtEnd {x: 14, y: 15}} +// gdb-check:$3 = struct_in_struct::PaddingAtEndParent {x: struct_in_struct::PaddingAtEnd {x: 10, y: 11}, y: struct_in_struct::PaddingAtEnd {x: 12, y: 13}, z: struct_in_struct::PaddingAtEnd {x: 14, y: 15}} // === LLDB TESTS ================================================================================== @@ -24,36 +19,28 @@ // lldb-command:run // lldb-command:v three_simple_structs -// lldbg-check:[...] { x = { x = 1 } y = { x = 2 } z = { x = 3 } } -// lldbr-check:(struct_in_struct::ThreeSimpleStructs) three_simple_structs = { x = { x = 1 } y = { x = 2 } z = { x = 3 } } +// lldb-check:[...] { x = { x = 1 } y = { x = 2 } z = { x = 3 } } // lldb-command:v internal_padding_parent -// lldbg-check:[...] { x = { x = 4 y = 5 } y = { x = 6 y = 7 } z = { x = 8 y = 9 } } -// lldbr-check:(struct_in_struct::InternalPaddingParent) internal_padding_parent = { x = { x = 4 y = 5 } y = { x = 6 y = 7 } z = { x = 8 y = 9 } } +// lldb-check:[...] { x = { x = 4 y = 5 } y = { x = 6 y = 7 } z = { x = 8 y = 9 } } // lldb-command:v padding_at_end_parent -// lldbg-check:[...] { x = { x = 10 y = 11 } y = { x = 12 y = 13 } z = { x = 14 y = 15 } } -// lldbr-check:(struct_in_struct::PaddingAtEndParent) padding_at_end_parent = { x = { x = 10 y = 11 } y = { x = 12 y = 13 } z = { x = 14 y = 15 } } +// lldb-check:[...] { x = { x = 10 y = 11 } y = { x = 12 y = 13 } z = { x = 14 y = 15 } } // lldb-command:v mixed -// lldbg-check:[...] { x = { x = 16 y = 17 } y = { x = 18 y = 19 } z = { x = 20 } w = 21 } -// lldbr-check:(struct_in_struct::Mixed) mixed = { x = { x = 16 y = 17 } y = { x = 18 y = 19 } z = { x = 20 } w = 21 } +// lldb-check:[...] { x = { x = 16 y = 17 } y = { x = 18 y = 19 } z = { x = 20 } w = 21 } // lldb-command:v bag -// lldbg-check:[...] { x = { x = 22 } } -// lldbr-check:(struct_in_struct::Bag) bag = { x = { x = 22 } } +// lldb-check:[...] { x = { x = 22 } } // lldb-command:v bag_in_bag -// lldbg-check:[...] { x = { x = { x = 23 } } } -// lldbr-check:(struct_in_struct::BagInBag) bag_in_bag = { x = { x = { x = 23 } } } +// lldb-check:[...] { x = { x = { x = 23 } } } // lldb-command:v tjo -// lldbg-check:[...] { x = { x = { x = { x = 24 } } } } -// lldbr-check:(struct_in_struct::ThatsJustOverkill) tjo = { x = { x = { x = { x = 24 } } } } +// lldb-check:[...] { x = { x = { x = { x = 24 } } } } // lldb-command:v tree -// lldbg-check:[...] { x = { x = 25 } y = { x = { x = 26 y = 27 } y = { x = 28 y = 29 } z = { x = 30 y = 31 } } z = { x = { x = { x = 32 } } } } -// lldbr-check:(struct_in_struct::Tree) tree = { x = { x = 25 } y = { x = { x = 26 y = 27 } y = { x = 28 y = 29 } z = { x = 30 y = 31 } } z = { x = { x = { x = 32 } } } } +// lldb-check:[...] { x = { x = 25 } y = { x = { x = 26 y = 27 } y = { x = 28 y = 29 } z = { x = 30 y = 31 } } z = { x = { x = { x = 32 } } } } #![allow(unused_variables)] #![feature(omit_gdb_pretty_printer_section)] diff --git a/tests/debuginfo/struct-namespace.rs b/tests/debuginfo/struct-namespace.rs index 3cae51e83dd..95788419100 100644 --- a/tests/debuginfo/struct-namespace.rs +++ b/tests/debuginfo/struct-namespace.rs @@ -1,23 +1,18 @@ //@ ignore-gdb //@ compile-flags:-g -//@ min-lldb-version: 310 // Check that structs get placed in the correct namespace // lldb-command:run // lldb-command:v struct1 -// lldbg-check:(struct_namespace::Struct1)[...] -// lldbr-check:(struct_namespace::Struct1) struct1 = Struct1 { a: 0, b: 1 } +// lldb-check:(struct_namespace::Struct1)[...] // lldb-command:v struct2 -// lldbg-check:(struct_namespace::Struct2)[...] -// lldbr-check:(struct_namespace::Struct2) struct2 = { = 2 } +// lldb-check:(struct_namespace::Struct2)[...] // lldb-command:v mod1_struct1 -// lldbg-check:(struct_namespace::mod1::Struct1)[...] -// lldbr-check:(struct_namespace::mod1::Struct1) mod1_struct1 = Struct1 { a: 3, b: 4 } +// lldb-check:(struct_namespace::mod1::Struct1)[...] // lldb-command:v mod1_struct2 -// lldbg-check:(struct_namespace::mod1::Struct2)[...] -// lldbr-check:(struct_namespace::mod1::Struct2) mod1_struct2 = { = 5 } +// lldb-check:(struct_namespace::mod1::Struct2)[...] #![allow(unused_variables)] #![allow(dead_code)] diff --git a/tests/debuginfo/struct-style-enum.rs b/tests/debuginfo/struct-style-enum.rs index 42368017cae..cea9f3def8b 100644 --- a/tests/debuginfo/struct-style-enum.rs +++ b/tests/debuginfo/struct-style-enum.rs @@ -1,5 +1,3 @@ -// Require a gdb or lldb that can read DW_TAG_variant_part. -//@ min-gdb-version: 8.2 //@ min-lldb-version: 1800 //@ compile-flags:-g @@ -9,16 +7,16 @@ // gdb-command:run // gdb-command:print case1 -// gdbr-check:$1 = struct_style_enum::Regular::Case1{a: 0, b: 31868, c: 31868, d: 31868, e: 31868} +// gdb-check:$1 = struct_style_enum::Regular::Case1{a: 0, b: 31868, c: 31868, d: 31868, e: 31868} // gdb-command:print case2 -// gdbr-check:$2 = struct_style_enum::Regular::Case2{a: 0, b: 286331153, c: 286331153} +// gdb-check:$2 = struct_style_enum::Regular::Case2{a: 0, b: 286331153, c: 286331153} // gdb-command:print case3 -// gdbr-check:$3 = struct_style_enum::Regular::Case3{a: 0, b: 6438275382588823897} +// gdb-check:$3 = struct_style_enum::Regular::Case3{a: 0, b: 6438275382588823897} // gdb-command:print univariant -// gdbr-check:$4 = struct_style_enum::Univariant::TheOnlyCase{a: -1} +// gdb-check:$4 = struct_style_enum::Univariant::TheOnlyCase{a: -1} // === LLDB TESTS ================================================================================== @@ -26,20 +24,16 @@ // lldb-command:run // lldb-command:v case1 -// lldbg-check:(struct_style_enum::Regular) case1 = { value = { a = 0 b = 31868 c = 31868 d = 31868 e = 31868 } $discr$ = 0 } -// lldbr-check:(struct_style_enum::Regular::Case1) case1 = { a = 0 b = 31868 c = 31868 d = 31868 e = 31868 } +// lldb-check:(struct_style_enum::Regular) case1 = { value = { a = 0 b = 31868 c = 31868 d = 31868 e = 31868 } $discr$ = 0 } // lldb-command:v case2 -// lldbg-check:(struct_style_enum::Regular) case2 = { value = { a = 0 b = 286331153 c = 286331153 } $discr$ = 1 } -// lldbr-check:(struct_style_enum::Regular::Case2) case2 = Case2 { Case1: 0, Case2: 286331153, Case3: 286331153 } +// lldb-check:(struct_style_enum::Regular) case2 = { value = { a = 0 b = 286331153 c = 286331153 } $discr$ = 1 } // lldb-command:v case3 -// lldbg-check:(struct_style_enum::Regular) case3 = { value = { a = 0 b = 6438275382588823897 } $discr$ = 2 } -// lldbr-check:(struct_style_enum::Regular::Case3) case3 = Case3 { Case1: 0, Case2: 6438275382588823897 } +// lldb-check:(struct_style_enum::Regular) case3 = { value = { a = 0 b = 6438275382588823897 } $discr$ = 2 } // lldb-command:v univariant -// lldbg-check:(struct_style_enum::Univariant) univariant = { value = { a = -1 } } -// lldbr-check:(struct_style_enum::Univariant) univariant = Univariant { TheOnlyCase: TheOnlyCase { a: -1 } } +// lldb-check:(struct_style_enum::Univariant) univariant = { value = { a = -1 } } #![allow(unused_variables)] #![feature(omit_gdb_pretty_printer_section)] diff --git a/tests/debuginfo/struct-with-destructor.rs b/tests/debuginfo/struct-with-destructor.rs index 12e2ac4225c..c159824980a 100644 --- a/tests/debuginfo/struct-with-destructor.rs +++ b/tests/debuginfo/struct-with-destructor.rs @@ -1,45 +1,35 @@ -//@ min-lldb-version: 310 - //@ compile-flags:-g // === GDB TESTS =================================================================================== // gdb-command:run // gdb-command:print simple -// gdbg-check:$1 = {x = 10, y = 20} -// gdbr-check:$1 = struct_with_destructor::WithDestructor {x: 10, y: 20} +// gdb-check:$1 = struct_with_destructor::WithDestructor {x: 10, y: 20} // gdb-command:print noDestructor -// gdbg-check:$2 = {a = {x = 10, y = 20}, guard = -1} -// gdbr-check:$2 = struct_with_destructor::NoDestructorGuarded {a: struct_with_destructor::NoDestructor {x: 10, y: 20}, guard: -1} +// gdb-check:$2 = struct_with_destructor::NoDestructorGuarded {a: struct_with_destructor::NoDestructor {x: 10, y: 20}, guard: -1} // gdb-command:print withDestructor -// gdbg-check:$3 = {a = {x = 10, y = 20}, guard = -1} -// gdbr-check:$3 = struct_with_destructor::WithDestructorGuarded {a: struct_with_destructor::WithDestructor {x: 10, y: 20}, guard: -1} +// gdb-check:$3 = struct_with_destructor::WithDestructorGuarded {a: struct_with_destructor::WithDestructor {x: 10, y: 20}, guard: -1} // gdb-command:print nested -// gdbg-check:$4 = {a = {a = {x = 7890, y = 9870}}} -// gdbr-check:$4 = struct_with_destructor::NestedOuter {a: struct_with_destructor::NestedInner {a: struct_with_destructor::WithDestructor {x: 7890, y: 9870}}} +// gdb-check:$4 = struct_with_destructor::NestedOuter {a: struct_with_destructor::NestedInner {a: struct_with_destructor::WithDestructor {x: 7890, y: 9870}}} // === LLDB TESTS ================================================================================== // lldb-command:run // lldb-command:v simple -// lldbg-check:[...] { x = 10 y = 20 } -// lldbr-check:(struct_with_destructor::WithDestructor) simple = { x = 10 y = 20 } +// lldb-check:[...] { x = 10 y = 20 } // lldb-command:v noDestructor -// lldbg-check:[...] { a = { x = 10 y = 20 } guard = -1 } -// lldbr-check:(struct_with_destructor::NoDestructorGuarded) noDestructor = { a = { x = 10 y = 20 } guard = -1 } +// lldb-check:[...] { a = { x = 10 y = 20 } guard = -1 } // lldb-command:v withDestructor -// lldbg-check:[...] { a = { x = 10 y = 20 } guard = -1 } -// lldbr-check:(struct_with_destructor::WithDestructorGuarded) withDestructor = { a = { x = 10 y = 20 } guard = -1 } +// lldb-check:[...] { a = { x = 10 y = 20 } guard = -1 } // lldb-command:v nested -// lldbg-check:[...] { a = { a = { x = 7890 y = 9870 } } } -// lldbr-check:(struct_with_destructor::NestedOuter) nested = { a = { a = { x = 7890 y = 9870 } } } +// lldb-check:[...] { a = { a = { x = 7890 y = 9870 } } } #![allow(unused_variables)] #![feature(omit_gdb_pretty_printer_section)] diff --git a/tests/debuginfo/thread-names.rs b/tests/debuginfo/thread-names.rs index 6b3b0c7f4b2..265b9271cf3 100644 --- a/tests/debuginfo/thread-names.rs +++ b/tests/debuginfo/thread-names.rs @@ -4,7 +4,7 @@ //@[macos] only-macos //@[win] only-windows //@ ignore-sgx -//@ ignore-windows-gnu +//@ ignore-windows-gnu: gdb on windows-gnu does not print thread names // === GDB TESTS ================================================================================== // diff --git a/tests/debuginfo/trait-pointers.rs b/tests/debuginfo/trait-pointers.rs index 2b4dde4d3a0..71da71b897a 100644 --- a/tests/debuginfo/trait-pointers.rs +++ b/tests/debuginfo/trait-pointers.rs @@ -1,5 +1,3 @@ -//@ min-lldb-version: 310 - //@ compile-flags:-g // gdb-command:run // lldb-command:run diff --git a/tests/debuginfo/tuple-in-struct.rs b/tests/debuginfo/tuple-in-struct.rs index e36d924e925..a74d6203f5f 100644 --- a/tests/debuginfo/tuple-in-struct.rs +++ b/tests/debuginfo/tuple-in-struct.rs @@ -1,43 +1,31 @@ -//@ min-lldb-version: 310 - //@ compile-flags:-g // gdb-command:run // gdb-command:print no_padding1 -// gdbg-check:$1 = {x = {__0 = 0, __1 = 1}, y = 2, z = {__0 = 3, __1 = 4, __2 = 5}} -// gdbr-check:$1 = tuple_in_struct::NoPadding1 {x: (0, 1), y: 2, z: (3, 4, 5)} +// gdb-check:$1 = tuple_in_struct::NoPadding1 {x: (0, 1), y: 2, z: (3, 4, 5)} // gdb-command:print no_padding2 -// gdbg-check:$2 = {x = {__0 = 6, __1 = 7}, y = {__0 = {__0 = 8, __1 = 9}, __1 = 10}} -// gdbr-check:$2 = tuple_in_struct::NoPadding2 {x: (6, 7), y: ((8, 9), 10)} +// gdb-check:$2 = tuple_in_struct::NoPadding2 {x: (6, 7), y: ((8, 9), 10)} // gdb-command:print tuple_internal_padding -// gdbg-check:$3 = {x = {__0 = 11, __1 = 12}, y = {__0 = 13, __1 = 14}} -// gdbr-check:$3 = tuple_in_struct::TupleInternalPadding {x: (11, 12), y: (13, 14)} +// gdb-check:$3 = tuple_in_struct::TupleInternalPadding {x: (11, 12), y: (13, 14)} // gdb-command:print struct_internal_padding -// gdbg-check:$4 = {x = {__0 = 15, __1 = 16}, y = {__0 = 17, __1 = 18}} -// gdbr-check:$4 = tuple_in_struct::StructInternalPadding {x: (15, 16), y: (17, 18)} +// gdb-check:$4 = tuple_in_struct::StructInternalPadding {x: (15, 16), y: (17, 18)} // gdb-command:print both_internally_padded -// gdbg-check:$5 = {x = {__0 = 19, __1 = 20, __2 = 21}, y = {__0 = 22, __1 = 23}} -// gdbr-check:$5 = tuple_in_struct::BothInternallyPadded {x: (19, 20, 21), y: (22, 23)} +// gdb-check:$5 = tuple_in_struct::BothInternallyPadded {x: (19, 20, 21), y: (22, 23)} // gdb-command:print single_tuple -// gdbg-check:$6 = {x = {__0 = 24, __1 = 25, __2 = 26}} -// gdbr-check:$6 = tuple_in_struct::SingleTuple {x: (24, 25, 26)} +// gdb-check:$6 = tuple_in_struct::SingleTuple {x: (24, 25, 26)} // gdb-command:print tuple_padded_at_end -// gdbg-check:$7 = {x = {__0 = 27, __1 = 28}, y = {__0 = 29, __1 = 30}} -// gdbr-check:$7 = tuple_in_struct::TuplePaddedAtEnd {x: (27, 28), y: (29, 30)} +// gdb-check:$7 = tuple_in_struct::TuplePaddedAtEnd {x: (27, 28), y: (29, 30)} // gdb-command:print struct_padded_at_end -// gdbg-check:$8 = {x = {__0 = 31, __1 = 32}, y = {__0 = 33, __1 = 34}} -// gdbr-check:$8 = tuple_in_struct::StructPaddedAtEnd {x: (31, 32), y: (33, 34)} +// gdb-check:$8 = tuple_in_struct::StructPaddedAtEnd {x: (31, 32), y: (33, 34)} // gdb-command:print both_padded_at_end -// gdbg-check:$9 = {x = {__0 = 35, __1 = 36, __2 = 37}, y = {__0 = 38, __1 = 39}} -// gdbr-check:$9 = tuple_in_struct::BothPaddedAtEnd {x: (35, 36, 37), y: (38, 39)} +// gdb-check:$9 = tuple_in_struct::BothPaddedAtEnd {x: (35, 36, 37), y: (38, 39)} // gdb-command:print mixed_padding -// gdbg-check:$10 = {x = {__0 = {__0 = 40, __1 = 41, __2 = 42}, __1 = {__0 = 43, __1 = 44}}, y = {__0 = 45, __1 = 46, __2 = 47, __3 = 48}} -// gdbr-check:$10 = tuple_in_struct::MixedPadding {x: ((40, 41, 42), (43, 44)), y: (45, 46, 47, 48)} +// gdb-check:$10 = tuple_in_struct::MixedPadding {x: ((40, 41, 42), (43, 44)), y: (45, 46, 47, 48)} #![allow(unused_variables)] #![feature(omit_gdb_pretty_printer_section)] diff --git a/tests/debuginfo/tuple-in-tuple.rs b/tests/debuginfo/tuple-in-tuple.rs index 8ed0e1f9c13..d4388095ad7 100644 --- a/tests/debuginfo/tuple-in-tuple.rs +++ b/tests/debuginfo/tuple-in-tuple.rs @@ -1,5 +1,3 @@ -//@ min-lldb-version: 310 - //@ compile-flags:-g // === GDB TESTS =================================================================================== @@ -7,28 +5,21 @@ // gdb-command:run // gdb-command:print no_padding1 -// gdbg-check:$1 = {__0 = {__0 = 0, __1 = 1}, __1 = 2, __2 = 3} -// gdbr-check:$1 = ((0, 1), 2, 3) +// gdb-check:$1 = ((0, 1), 2, 3) // gdb-command:print no_padding2 -// gdbg-check:$2 = {__0 = 4, __1 = {__0 = 5, __1 = 6}, __2 = 7} -// gdbr-check:$2 = (4, (5, 6), 7) +// gdb-check:$2 = (4, (5, 6), 7) // gdb-command:print no_padding3 -// gdbg-check:$3 = {__0 = 8, __1 = 9, __2 = {__0 = 10, __1 = 11}} -// gdbr-check:$3 = (8, 9, (10, 11)) +// gdb-check:$3 = (8, 9, (10, 11)) // gdb-command:print internal_padding1 -// gdbg-check:$4 = {__0 = 12, __1 = {__0 = 13, __1 = 14}} -// gdbr-check:$4 = (12, (13, 14)) +// gdb-check:$4 = (12, (13, 14)) // gdb-command:print internal_padding2 -// gdbg-check:$5 = {__0 = 15, __1 = {__0 = 16, __1 = 17}} -// gdbr-check:$5 = (15, (16, 17)) +// gdb-check:$5 = (15, (16, 17)) // gdb-command:print padding_at_end1 -// gdbg-check:$6 = {__0 = 18, __1 = {__0 = 19, __1 = 20}} -// gdbr-check:$6 = (18, (19, 20)) +// gdb-check:$6 = (18, (19, 20)) // gdb-command:print padding_at_end2 -// gdbg-check:$7 = {__0 = {__0 = 21, __1 = 22}, __1 = 23} -// gdbr-check:$7 = ((21, 22), 23) +// gdb-check:$7 = ((21, 22), 23) // === LLDB TESTS ================================================================================== @@ -36,28 +27,21 @@ // lldb-command:run // lldb-command:v no_padding1 -// lldbg-check:[...] { 0 = { 0 = 0 1 = 1 } 1 = 2 2 = 3 } -// lldbr-check:(((u32, u32), u32, u32)) no_padding1 = { 0 = { 0 = 0 1 = 1 } 1 = 2 2 = 3 } +// lldb-check:[...] { 0 = { 0 = 0 1 = 1 } 1 = 2 2 = 3 } // lldb-command:v no_padding2 -// lldbg-check:[...] { 0 = 4 1 = { 0 = 5 1 = 6 } 2 = 7 } -// lldbr-check:((u32, (u32, u32), u32)) no_padding2 = { 0 = 4 1 = { 0 = 5 1 = 6 } 2 = 7 } +// lldb-check:[...] { 0 = 4 1 = { 0 = 5 1 = 6 } 2 = 7 } // lldb-command:v no_padding3 -// lldbg-check:[...] { 0 = 8 1 = 9 2 = { 0 = 10 1 = 11 } } -// lldbr-check:((u32, u32, (u32, u32))) no_padding3 = { 0 = 8 1 = 9 2 = { 0 = 10 1 = 11 } } +// lldb-check:[...] { 0 = 8 1 = 9 2 = { 0 = 10 1 = 11 } } // lldb-command:v internal_padding1 -// lldbg-check:[...] { 0 = 12 1 = { 0 = 13 1 = 14 } } -// lldbr-check:((i16, (i32, i32))) internal_padding1 = { 0 = 12 1 = { 0 = 13 1 = 14 } } +// lldb-check:[...] { 0 = 12 1 = { 0 = 13 1 = 14 } } // lldb-command:v internal_padding2 -// lldbg-check:[...] { 0 = 15 1 = { 0 = 16 1 = 17 } } -// lldbr-check:((i16, (i16, i32))) internal_padding2 = { 0 = 15 1 = { 0 = 16 1 = 17 } } +// lldb-check:[...] { 0 = 15 1 = { 0 = 16 1 = 17 } } // lldb-command:v padding_at_end1 -// lldbg-check:[...] { 0 = 18 1 = { 0 = 19 1 = 20 } } -// lldbr-check:((i32, (i32, i16))) padding_at_end1 = { 0 = 18 1 = { 0 = 19 1 = 20 } } +// lldb-check:[...] { 0 = 18 1 = { 0 = 19 1 = 20 } } // lldb-command:v padding_at_end2 -// lldbg-check:[...] { 0 = { 0 = 21 1 = 22 } 1 = 23 } -// lldbr-check:(((i32, i16), i32)) padding_at_end2 = { 0 = { 0 = 21 1 = 22 } 1 = 23 } +// lldb-check:[...] { 0 = { 0 = 21 1 = 22 } 1 = 23 } // === CDB TESTS ================================================================================== diff --git a/tests/debuginfo/tuple-struct.rs b/tests/debuginfo/tuple-struct.rs index 88b1ae19e29..0110203a7c7 100644 --- a/tests/debuginfo/tuple-struct.rs +++ b/tests/debuginfo/tuple-struct.rs @@ -1,5 +1,3 @@ -//@ min-lldb-version: 310 - //@ compile-flags:-g // === GDB TESTS =================================================================================== @@ -7,28 +5,22 @@ // gdb-command:run // gdb-command:print no_padding16 -// gdbg-check:$1 = {__0 = 10000, __1 = -10001} -// gdbr-check:$1 = tuple_struct::NoPadding16 (10000, -10001) +// gdb-check:$1 = tuple_struct::NoPadding16 (10000, -10001) // gdb-command:print no_padding32 -// gdbg-check:$2 = {__0 = -10002, __1 = -10003.5, __2 = 10004} -// gdbr-check:$2 = tuple_struct::NoPadding32 (-10002, -10003.5, 10004) +// gdb-check:$2 = tuple_struct::NoPadding32 (-10002, -10003.5, 10004) // gdb-command:print no_padding64 -// gdbg-check:$3 = {__0 = -10005.5, __1 = 10006, __2 = 10007} -// gdbr-check:$3 = tuple_struct::NoPadding64 (-10005.5, 10006, 10007) +// gdb-check:$3 = tuple_struct::NoPadding64 (-10005.5, 10006, 10007) // gdb-command:print no_padding163264 -// gdbg-check:$4 = {__0 = -10008, __1 = 10009, __2 = 10010, __3 = 10011} -// gdbr-check:$4 = tuple_struct::NoPadding163264 (-10008, 10009, 10010, 10011) +// gdb-check:$4 = tuple_struct::NoPadding163264 (-10008, 10009, 10010, 10011) // gdb-command:print internal_padding -// gdbg-check:$5 = {__0 = 10012, __1 = -10013} -// gdbr-check:$5 = tuple_struct::InternalPadding (10012, -10013) +// gdb-check:$5 = tuple_struct::InternalPadding (10012, -10013) // gdb-command:print padding_at_end -// gdbg-check:$6 = {__0 = -10014, __1 = 10015} -// gdbr-check:$6 = tuple_struct::PaddingAtEnd (-10014, 10015) +// gdb-check:$6 = tuple_struct::PaddingAtEnd (-10014, 10015) // === LLDB TESTS ================================================================================== @@ -36,28 +28,22 @@ // lldb-command:run // lldb-command:v no_padding16 -// lldbg-check:[...] { 0 = 10000 1 = -10001 } -// lldbr-check:(tuple_struct::NoPadding16) no_padding16 = { 0 = 10000 1 = -10001 } +// lldb-check:[...] { 0 = 10000 1 = -10001 } // lldb-command:v no_padding32 -// lldbg-check:[...] { 0 = -10002 1 = -10003.5 2 = 10004 } -// lldbr-check:(tuple_struct::NoPadding32) no_padding32 = { 0 = -10002 1 = -10003.5 2 = 10004 } +// lldb-check:[...] { 0 = -10002 1 = -10003.5 2 = 10004 } // lldb-command:v no_padding64 -// lldbg-check:[...] { 0 = -10005.5 1 = 10006 2 = 10007 } -// lldbr-check:(tuple_struct::NoPadding64) no_padding64 = { 0 = -10005.5 1 = 10006 2 = 10007 } +// lldb-check:[...] { 0 = -10005.5 1 = 10006 2 = 10007 } // lldb-command:v no_padding163264 -// lldbg-check:[...] { 0 = -10008 1 = 10009 2 = 10010 3 = 10011 } -// lldbr-check:(tuple_struct::NoPadding163264) no_padding163264 = { 0 = -10008 1 = 10009 2 = 10010 3 = 10011 } +// lldb-check:[...] { 0 = -10008 1 = 10009 2 = 10010 3 = 10011 } // lldb-command:v internal_padding -// lldbg-check:[...] { 0 = 10012 1 = -10013 } -// lldbr-check:(tuple_struct::InternalPadding) internal_padding = { 0 = 10012 1 = -10013 } +// lldb-check:[...] { 0 = 10012 1 = -10013 } // lldb-command:v padding_at_end -// lldbg-check:[...] { 0 = -10014 1 = 10015 } -// lldbr-check:(tuple_struct::PaddingAtEnd) padding_at_end = { 0 = -10014 1 = 10015 } +// lldb-check:[...] { 0 = -10014 1 = 10015 } // This test case mainly makes sure that no field names are generated for tuple structs (as opposed // to all fields having the name "<unnamed_field>"). Otherwise they are handled the same a normal diff --git a/tests/debuginfo/tuple-style-enum.rs b/tests/debuginfo/tuple-style-enum.rs index 3de4ecb1284..a759ad61c05 100644 --- a/tests/debuginfo/tuple-style-enum.rs +++ b/tests/debuginfo/tuple-style-enum.rs @@ -1,5 +1,3 @@ -// Require a gdb or lldb that can read DW_TAG_variant_part. -//@ min-gdb-version: 8.2 //@ min-lldb-version: 1800 //@ compile-flags:-g @@ -10,16 +8,16 @@ // gdb-command:run // gdb-command:print case1 -// gdbr-check:$1 = tuple_style_enum::Regular::Case1(0, 31868, 31868, 31868, 31868) +// gdb-check:$1 = tuple_style_enum::Regular::Case1(0, 31868, 31868, 31868, 31868) // gdb-command:print case2 -// gdbr-check:$2 = tuple_style_enum::Regular::Case2(0, 286331153, 286331153) +// gdb-check:$2 = tuple_style_enum::Regular::Case2(0, 286331153, 286331153) // gdb-command:print case3 -// gdbr-check:$3 = tuple_style_enum::Regular::Case3(0, 6438275382588823897) +// gdb-check:$3 = tuple_style_enum::Regular::Case3(0, 6438275382588823897) // gdb-command:print univariant -// gdbr-check:$4 = tuple_style_enum::Univariant::TheOnlyCase(-1) +// gdb-check:$4 = tuple_style_enum::Univariant::TheOnlyCase(-1) // === LLDB TESTS ================================================================================== @@ -27,20 +25,16 @@ // lldb-command:run // lldb-command:v case1 -// lldbg-check:(tuple_style_enum::Regular) case1 = { value = { 0 = 0 1 = 31868 2 = 31868 3 = 31868 4 = 31868 } $discr$ = 0 } -// lldbr-check:(tuple_style_enum::Regular::Case1) case1 = { = 0 = 31868 = 31868 = 31868 = 31868 } +// lldb-check:(tuple_style_enum::Regular) case1 = { value = { 0 = 0 1 = 31868 2 = 31868 3 = 31868 4 = 31868 } $discr$ = 0 } // lldb-command:v case2 -// lldbg-check:(tuple_style_enum::Regular) case2 = { value = { 0 = 0 1 = 286331153 2 = 286331153 } $discr$ = 1 } -// lldbr-check:(tuple_style_enum::Regular::Case2) case2 = Case2 { Case1: 0, Case2: 286331153, Case3: 286331153 } +// lldb-check:(tuple_style_enum::Regular) case2 = { value = { 0 = 0 1 = 286331153 2 = 286331153 } $discr$ = 1 } // lldb-command:v case3 -// lldbg-check:(tuple_style_enum::Regular) case3 = { value = { 0 = 0 1 = 6438275382588823897 } $discr$ = 2 } -// lldbr-check:(tuple_style_enum::Regular::Case3) case3 = Case3 { Case1: 0, Case2: 6438275382588823897 } +// lldb-check:(tuple_style_enum::Regular) case3 = { value = { 0 = 0 1 = 6438275382588823897 } $discr$ = 2 } // lldb-command:v univariant -// lldbg-check:(tuple_style_enum::Univariant) univariant = { value = { 0 = -1 } } -// lldbr-check:(tuple_style_enum::Univariant) univariant = { TheOnlyCase = { = -1 } } +// lldb-check:(tuple_style_enum::Univariant) univariant = { value = { 0 = -1 } } #![allow(unused_variables)] #![feature(omit_gdb_pretty_printer_section)] diff --git a/tests/debuginfo/union-smoke.rs b/tests/debuginfo/union-smoke.rs index d786ba61271..6043240069e 100644 --- a/tests/debuginfo/union-smoke.rs +++ b/tests/debuginfo/union-smoke.rs @@ -1,30 +1,21 @@ -//@ min-lldb-version: 310 - -//@ ignore-gdb-version: 7.11.90 - 7.12.9 - //@ compile-flags:-g // === GDB TESTS =================================================================================== // gdb-command:run // gdb-command:print u -// gdbg-check:$1 = {a = {__0 = 2 '\002', __1 = 2 '\002'}, b = 514} -// gdbr-check:$1 = union_smoke::U {a: (2, 2), b: 514} +// gdb-check:$1 = union_smoke::U {a: (2, 2), b: 514} // gdb-command:print union_smoke::SU -// gdbg-check:$2 = {a = {__0 = 1 '\001', __1 = 1 '\001'}, b = 257} -// gdbr-check:$2 = union_smoke::U {a: (1, 1), b: 257} +// gdb-check:$2 = union_smoke::U {a: (1, 1), b: 257} // === LLDB TESTS ================================================================================== // lldb-command:run // lldb-command:v u -// lldbg-check:[...] { a = { 0 = '\x02' 1 = '\x02' } b = 514 } -// lldbr-check:(union_smoke::U) u = { a = { 0 = '\x02' 1 = '\x02' } b = 514 } +// lldb-check:[...] { a = { 0 = '\x02' 1 = '\x02' } b = 514 } -// Don't test this with rust-enabled lldb for now; see -// https://github.com/rust-lang-nursery/lldb/issues/18 -// lldbg-command:print union_smoke::SU -// lldbg-check:[...] { a = { 0 = '\x01' 1 = '\x01' } b = 257 } +// lldb-command:print union_smoke::SU +// lldb-check:[...] { a = { 0 = '\x01' 1 = '\x01' } b = 257 } #![allow(unused)] #![feature(omit_gdb_pretty_printer_section)] diff --git a/tests/debuginfo/unique-enum.rs b/tests/debuginfo/unique-enum.rs index 514c7c50812..230429278aa 100644 --- a/tests/debuginfo/unique-enum.rs +++ b/tests/debuginfo/unique-enum.rs @@ -1,5 +1,3 @@ -// Require a gdb or lldb that can read DW_TAG_variant_part. -//@ min-gdb-version: 8.2 //@ min-lldb-version: 1800 //@ compile-flags:-g @@ -9,13 +7,13 @@ // gdb-command:run // gdb-command:print *the_a -// gdbr-check:$1 = unique_enum::ABC::TheA{x: 0, y: 8970181431921507452} +// gdb-check:$1 = unique_enum::ABC::TheA{x: 0, y: 8970181431921507452} // gdb-command:print *the_b -// gdbr-check:$2 = unique_enum::ABC::TheB(0, 286331153, 286331153) +// gdb-check:$2 = unique_enum::ABC::TheB(0, 286331153, 286331153) // gdb-command:print *univariant -// gdbr-check:$3 = unique_enum::Univariant::TheOnlyCase(123234) +// gdb-check:$3 = unique_enum::Univariant::TheOnlyCase(123234) // === LLDB TESTS ================================================================================== @@ -23,16 +21,13 @@ // lldb-command:run // lldb-command:v *the_a -// lldbg-check:(unique_enum::ABC) *the_a = { value = { x = 0 y = 8970181431921507452 } $discr$ = 0 } -// lldbr-check:(unique_enum::ABC::TheA) *the_a = TheA { TheA: 0, TheB: 8970181431921507452 } +// lldb-check:(unique_enum::ABC) *the_a = { value = { x = 0 y = 8970181431921507452 } $discr$ = 0 } // lldb-command:v *the_b -// lldbg-check:(unique_enum::ABC) *the_b = { value = { 0 = 0 1 = 286331153 2 = 286331153 } $discr$ = 1 } -// lldbr-check:(unique_enum::ABC::TheB) *the_b = { = 0 = 286331153 = 286331153 } +// lldb-check:(unique_enum::ABC) *the_b = { value = { 0 = 0 1 = 286331153 2 = 286331153 } $discr$ = 1 } // lldb-command:v *univariant -// lldbg-check:(unique_enum::Univariant) *univariant = { value = { 0 = 123234 } } -// lldbr-check:(unique_enum::Univariant) *univariant = { TheOnlyCase = { = 123234 } } +// lldb-check:(unique_enum::Univariant) *univariant = { value = { 0 = 123234 } } #![allow(unused_variables)] #![feature(omit_gdb_pretty_printer_section)] diff --git a/tests/debuginfo/unit-type.rs b/tests/debuginfo/unit-type.rs index 60b105fc53d..42c0ff11f71 100644 --- a/tests/debuginfo/unit-type.rs +++ b/tests/debuginfo/unit-type.rs @@ -1,8 +1,5 @@ //@ compile-flags:-g -// We only test Rust-aware versions of GDB: -//@ min-gdb-version: 8.2 - // === GDB TESTS =================================================================================== // gdb-command: run diff --git a/tests/debuginfo/unreachable-locals.rs b/tests/debuginfo/unreachable-locals.rs index 72effc10391..d4416387e0b 100644 --- a/tests/debuginfo/unreachable-locals.rs +++ b/tests/debuginfo/unreachable-locals.rs @@ -1,5 +1,3 @@ -//@ min-lldb-version: 310 - //@ compile-flags:-g #![allow(unused_variables)] diff --git a/tests/debuginfo/unsized.rs b/tests/debuginfo/unsized.rs index 982ab003a2a..acfe511be7c 100644 --- a/tests/debuginfo/unsized.rs +++ b/tests/debuginfo/unsized.rs @@ -7,28 +7,22 @@ // gdb-command:run // gdb-command:print a -// gdbg-check:$1 = {data_ptr = [...], length = 4} -// gdbr-check:$1 = &unsized::Foo<[u8]> {data_ptr: [...], length: 4} +// gdb-check:$1 = &unsized::Foo<[u8]> {data_ptr: [...], length: 4} // gdb-command:print b -// gdbg-check:$2 = {data_ptr = [...], length = 4} -// gdbr-check:$2 = &unsized::Foo<unsized::Foo<[u8]>> {data_ptr: [...], length: 4} +// gdb-check:$2 = &unsized::Foo<unsized::Foo<[u8]>> {data_ptr: [...], length: 4} // gdb-command:print c -// gdbg-check:$3 = {pointer = [...], vtable = [...]} -// gdbr-check:$3 = &unsized::Foo<dyn core::fmt::Debug> {pointer: [...], vtable: [...]} +// gdb-check:$3 = &unsized::Foo<dyn core::fmt::Debug> {pointer: [...], vtable: [...]} // gdb-command:print _box -// gdbg-check:$4 = {pointer = [...], vtable = [...]} -// gdbr-check:$4 = alloc::boxed::Box<unsized::Foo<dyn core::fmt::Debug>, alloc::alloc::Global> {pointer: [...], vtable: [...]} +// gdb-check:$4 = alloc::boxed::Box<unsized::Foo<dyn core::fmt::Debug>, alloc::alloc::Global> {pointer: [...], vtable: [...]} // gdb-command:print tuple_slice -// gdbg-check:$5 = {data_ptr = [...], length = 2} -// gdbr-check:$5 = &(i32, i32, [i32]) {data_ptr: [...], length: 2} +// gdb-check:$5 = &(i32, i32, [i32]) {data_ptr: [...], length: 2} // gdb-command:print tuple_dyn -// gdbg-check:$6 = {pointer = [...], vtable = [...]} -// gdbr-check:$6 = &(i32, i32, dyn core::fmt::Debug) {pointer: [...], vtable: [...]} +// gdb-check:$6 = &(i32, i32, dyn core::fmt::Debug) {pointer: [...], vtable: [...]} // === CDB TESTS =================================================================================== diff --git a/tests/debuginfo/var-captured-in-nested-closure.rs b/tests/debuginfo/var-captured-in-nested-closure.rs index 7772ec00337..4e8700015ba 100644 --- a/tests/debuginfo/var-captured-in-nested-closure.rs +++ b/tests/debuginfo/var-captured-in-nested-closure.rs @@ -1,5 +1,3 @@ -//@ min-lldb-version: 310 - //@ compile-flags:-g // === GDB TESTS =================================================================================== @@ -11,11 +9,9 @@ // gdb-command:print constant // gdb-check:$2 = 2 // gdb-command:print a_struct -// gdbg-check:$3 = {a = -3, b = 4.5, c = 5} -// gdbr-check:$3 = var_captured_in_nested_closure::Struct {a: -3, b: 4.5, c: 5} +// gdb-check:$3 = var_captured_in_nested_closure::Struct {a: -3, b: 4.5, c: 5} // gdb-command:print *struct_ref -// gdbg-check:$4 = {a = -3, b = 4.5, c = 5} -// gdbr-check:$4 = var_captured_in_nested_closure::Struct {a: -3, b: 4.5, c: 5} +// gdb-check:$4 = var_captured_in_nested_closure::Struct {a: -3, b: 4.5, c: 5} // gdb-command:print *owned // gdb-check:$5 = 6 // gdb-command:print closure_local @@ -27,11 +23,9 @@ // gdb-command:print constant // gdb-check:$8 = 2 // gdb-command:print a_struct -// gdbg-check:$9 = {a = -3, b = 4.5, c = 5} -// gdbr-check:$9 = var_captured_in_nested_closure::Struct {a: -3, b: 4.5, c: 5} +// gdb-check:$9 = var_captured_in_nested_closure::Struct {a: -3, b: 4.5, c: 5} // gdb-command:print *struct_ref -// gdbg-check:$10 = {a = -3, b = 4.5, c = 5} -// gdbr-check:$10 = var_captured_in_nested_closure::Struct {a: -3, b: 4.5, c: 5} +// gdb-check:$10 = var_captured_in_nested_closure::Struct {a: -3, b: 4.5, c: 5} // gdb-command:print *owned // gdb-check:$11 = 6 // gdb-command:print closure_local @@ -44,43 +38,31 @@ // lldb-command:run // lldb-command:v variable -// lldbg-check:[...] 1 -// lldbr-check:(isize) variable = 1 +// lldb-check:[...] 1 // lldb-command:v constant -// lldbg-check:[...] 2 -// lldbr-check:(isize) constant = 2 +// lldb-check:[...] 2 // lldb-command:v a_struct -// lldbg-check:[...] { a = -3 b = 4.5 c = 5 } -// lldbr-check:(var_captured_in_nested_closure::Struct) a_struct = { a = -3 b = 4.5 c = 5 } +// lldb-check:[...] { a = -3 b = 4.5 c = 5 } // lldb-command:v *struct_ref -// lldbg-check:[...] { a = -3 b = 4.5 c = 5 } -// lldbr-check:(var_captured_in_nested_closure::Struct) *struct_ref = { a = -3 b = 4.5 c = 5 } +// lldb-check:[...] { a = -3 b = 4.5 c = 5 } // lldb-command:v *owned -// lldbg-check:[...] 6 -// lldbr-check:(isize) *owned = 6 +// lldb-check:[...] 6 // lldb-command:v closure_local -// lldbg-check:[...] 8 -// lldbr-check:(isize) closure_local = 8 +// lldb-check:[...] 8 // lldb-command:continue // lldb-command:v variable -// lldbg-check:[...] 1 -// lldbr-check:(isize) variable = 1 +// lldb-check:[...] 1 // lldb-command:v constant -// lldbg-check:[...] 2 -// lldbr-check:(isize) constant = 2 +// lldb-check:[...] 2 // lldb-command:v a_struct -// lldbg-check:[...] { a = -3 b = 4.5 c = 5 } -// lldbr-check:(var_captured_in_nested_closure::Struct) a_struct = { a = -3 b = 4.5 c = 5 } +// lldb-check:[...] { a = -3 b = 4.5 c = 5 } // lldb-command:v *struct_ref -// lldbg-check:[...] { a = -3 b = 4.5 c = 5 } -// lldbr-check:(var_captured_in_nested_closure::Struct) *struct_ref = { a = -3 b = 4.5 c = 5 } +// lldb-check:[...] { a = -3 b = 4.5 c = 5 } // lldb-command:v *owned -// lldbg-check:[...] 6 -// lldbr-check:(isize) *owned = 6 +// lldb-check:[...] 6 // lldb-command:v closure_local -// lldbg-check:[...] 8 -// lldbr-check:(isize) closure_local = 8 +// lldb-check:[...] 8 // lldb-command:continue diff --git a/tests/debuginfo/var-captured-in-sendable-closure.rs b/tests/debuginfo/var-captured-in-sendable-closure.rs index 782a7d11373..cbb09daeb5f 100644 --- a/tests/debuginfo/var-captured-in-sendable-closure.rs +++ b/tests/debuginfo/var-captured-in-sendable-closure.rs @@ -1,5 +1,3 @@ -//@ min-lldb-version: 310 - //@ compile-flags:-g // === GDB TESTS =================================================================================== @@ -9,8 +7,7 @@ // gdb-command:print constant // gdb-check:$1 = 1 // gdb-command:print a_struct -// gdbg-check:$2 = {a = -2, b = 3.5, c = 4} -// gdbr-check:$2 = var_captured_in_sendable_closure::Struct {a: -2, b: 3.5, c: 4} +// gdb-check:$2 = var_captured_in_sendable_closure::Struct {a: -2, b: 3.5, c: 4} // gdb-command:print *owned // gdb-check:$3 = 5 // gdb-command:continue @@ -24,14 +21,11 @@ // lldb-command:run // lldb-command:v constant -// lldbg-check:[...] 1 -// lldbr-check:(isize) constant = 1 +// lldb-check:[...] 1 // lldb-command:v a_struct -// lldbg-check:[...] { a = -2 b = 3.5 c = 4 } -// lldbr-check:(var_captured_in_sendable_closure::Struct) a_struct = { a = -2 b = 3.5 c = 4 } +// lldb-check:[...] { a = -2 b = 3.5 c = 4 } // lldb-command:v *owned -// lldbg-check:[...] 5 -// lldbr-check:(isize) *owned = 5 +// lldb-check:[...] 5 #![allow(unused_variables)] #![feature(omit_gdb_pretty_printer_section)] diff --git a/tests/debuginfo/var-captured-in-stack-closure.rs b/tests/debuginfo/var-captured-in-stack-closure.rs index c9a93cd7b7f..0f84ea57b00 100644 --- a/tests/debuginfo/var-captured-in-stack-closure.rs +++ b/tests/debuginfo/var-captured-in-stack-closure.rs @@ -1,5 +1,3 @@ -//@ min-lldb-version: 310 - //@ compile-flags:-g // === GDB TESTS =================================================================================== @@ -11,11 +9,9 @@ // gdb-command:print constant // gdb-check:$2 = 2 // gdb-command:print a_struct -// gdbg-check:$3 = {a = -3, b = 4.5, c = 5} -// gdbr-check:$3 = var_captured_in_stack_closure::Struct {a: -3, b: 4.5, c: 5} +// gdb-check:$3 = var_captured_in_stack_closure::Struct {a: -3, b: 4.5, c: 5} // gdb-command:print *struct_ref -// gdbg-check:$4 = {a = -3, b = 4.5, c = 5} -// gdbr-check:$4 = var_captured_in_stack_closure::Struct {a: -3, b: 4.5, c: 5} +// gdb-check:$4 = var_captured_in_stack_closure::Struct {a: -3, b: 4.5, c: 5} // gdb-command:print *owned // gdb-check:$5 = 6 @@ -26,11 +22,9 @@ // gdb-command:print constant // gdb-check:$7 = 2 // gdb-command:print a_struct -// gdbg-check:$8 = {a = -3, b = 4.5, c = 5} -// gdbr-check:$8 = var_captured_in_stack_closure::Struct {a: -3, b: 4.5, c: 5} +// gdb-check:$8 = var_captured_in_stack_closure::Struct {a: -3, b: 4.5, c: 5} // gdb-command:print *struct_ref -// gdbg-check:$9 = {a = -3, b = 4.5, c = 5} -// gdbr-check:$9 = var_captured_in_stack_closure::Struct {a: -3, b: 4.5, c: 5} +// gdb-check:$9 = var_captured_in_stack_closure::Struct {a: -3, b: 4.5, c: 5} // gdb-command:print *owned // gdb-check:$10 = 6 @@ -40,38 +34,28 @@ // lldb-command:run // lldb-command:v variable -// lldbg-check:[...] 1 -// lldbr-check:(isize) variable = 1 +// lldb-check:[...] 1 // lldb-command:v constant -// lldbg-check:[...] 2 -// lldbr-check:(isize) constant = 2 +// lldb-check:[...] 2 // lldb-command:v a_struct -// lldbg-check:[...] { a = -3 b = 4.5 c = 5 } -// lldbr-check:(var_captured_in_stack_closure::Struct) a_struct = { a = -3 b = 4.5 c = 5 } +// lldb-check:[...] { a = -3 b = 4.5 c = 5 } // lldb-command:v *struct_ref -// lldbg-check:[...] { a = -3 b = 4.5 c = 5 } -// lldbr-check:(var_captured_in_stack_closure::Struct) *struct_ref = { a = -3 b = 4.5 c = 5 } +// lldb-check:[...] { a = -3 b = 4.5 c = 5 } // lldb-command:v *owned -// lldbg-check:[...] 6 -// lldbr-check:(isize) *owned = 6 +// lldb-check:[...] 6 // lldb-command:continue // lldb-command:v variable -// lldbg-check:[...] 2 -// lldbr-check:(isize) variable = 2 +// lldb-check:[...] 2 // lldb-command:v constant -// lldbg-check:[...] 2 -// lldbr-check:(isize) constant = 2 +// lldb-check:[...] 2 // lldb-command:v a_struct -// lldbg-check:[...] { a = -3 b = 4.5 c = 5 } -// lldbr-check:(var_captured_in_stack_closure::Struct) a_struct = { a = -3 b = 4.5 c = 5 } +// lldb-check:[...] { a = -3 b = 4.5 c = 5 } // lldb-command:v *struct_ref -// lldbg-check:[...] { a = -3 b = 4.5 c = 5 } -// lldbr-check:(var_captured_in_stack_closure::Struct) *struct_ref = { a = -3 b = 4.5 c = 5 } +// lldb-check:[...] { a = -3 b = 4.5 c = 5 } // lldb-command:v *owned -// lldbg-check:[...] 6 -// lldbr-check:(isize) *owned = 6 +// lldb-check:[...] 6 // === CDB TESTS =================================================================================== diff --git a/tests/debuginfo/vec-slices.rs b/tests/debuginfo/vec-slices.rs index a8235dba40c..2b4d624976a 100644 --- a/tests/debuginfo/vec-slices.rs +++ b/tests/debuginfo/vec-slices.rs @@ -1,4 +1,3 @@ -//@ min-lldb-version: 310 //@ ignore-gdb-version: 15.0 - 99.0 // ^ test temporarily disabled as it fails under gdb 15 @@ -12,89 +11,64 @@ // gdb-command:print singleton.length // gdb-check:$2 = 1 -// gdbg-command:print *((i64[1]*)(singleton.data_ptr)) -// gdbr-command:print *(singleton.data_ptr as *const [i64; 1]) -// gdbg-check:$3 = {1} -// gdbr-check:$3 = [1] +// gdb-command:print *(singleton.data_ptr as *const [i64; 1]) +// gdb-check:$3 = [1] // gdb-command:print multiple.length // gdb-check:$4 = 4 -// gdbg-command:print *((i64[4]*)(multiple.data_ptr)) -// gdbr-command:print *(multiple.data_ptr as *const [i64; 4]) -// gdbg-check:$5 = {2, 3, 4, 5} -// gdbr-check:$5 = [2, 3, 4, 5] +// gdb-command:print *(multiple.data_ptr as *const [i64; 4]) +// gdb-check:$5 = [2, 3, 4, 5] // gdb-command:print slice_of_slice.length // gdb-check:$6 = 2 -// gdbg-command:print *((i64[2]*)(slice_of_slice.data_ptr)) -// gdbr-command:print *(slice_of_slice.data_ptr as *const [i64; 2]) -// gdbg-check:$7 = {3, 4} -// gdbr-check:$7 = [3, 4] +// gdb-command:print *(slice_of_slice.data_ptr as *const [i64; 2]) +// gdb-check:$7 = [3, 4] // gdb-command:print padded_tuple.length // gdb-check:$8 = 2 // gdb-command:print padded_tuple.data_ptr[0] -// gdbg-check:$9 = {__0 = 6, __1 = 7} -// gdbr-check:$9 = (6, 7) +// gdb-check:$9 = (6, 7) // gdb-command:print padded_tuple.data_ptr[1] -// gdbg-check:$10 = {__0 = 8, __1 = 9} -// gdbr-check:$10 = (8, 9) +// gdb-check:$10 = (8, 9) // gdb-command:print padded_struct.length // gdb-check:$11 = 2 // gdb-command:print padded_struct.data_ptr[0] -// gdbg-check:$12 = {x = 10, y = 11, z = 12} -// gdbr-check:$12 = vec_slices::AStruct {x: 10, y: 11, z: 12} +// gdb-check:$12 = vec_slices::AStruct {x: 10, y: 11, z: 12} // gdb-command:print padded_struct.data_ptr[1] -// gdbg-check:$13 = {x = 13, y = 14, z = 15} -// gdbr-check:$13 = vec_slices::AStruct {x: 13, y: 14, z: 15} +// gdb-check:$13 = vec_slices::AStruct {x: 13, y: 14, z: 15} // gdb-command:print mut_slice.length // gdb-check:$14 = 5 -// gdbg-command:print *((i64[5]*)(mut_slice.data_ptr)) -// gdbr-command:print *(mut_slice.data_ptr as *const [i64; 5]) -// gdbg-check:$15 = {1, 2, 3, 4, 5} -// gdbr-check:$15 = [1, 2, 3, 4, 5] - -// Some lines below are marked with [ignored] because old GDB versions seem to have trouble -// accessing globals. - -// [ignored] gdbg-command:print 'vec_slices::MUT_VECT_SLICE'.length -// gdbr-command:print MUT_VECT_SLICE.length -// [ignored] gdbg-check:$16 = 2 -// gdbr-check:$16 = 2 -// [ignored] gdbg-command:print *((i64[2]*)('vec_slices::MUT_VECT_SLICE'.data_ptr)) -// gdbr-command:print *(MUT_VECT_SLICE.data_ptr as *const [i64; 2]) -// [ignored] gdbg-check:$17 = {64, 65} -// gdbr-check:$17 = [64, 65] +// gdb-command:print *(mut_slice.data_ptr as *const [i64; 5]) +// gdb-check:$15 = [1, 2, 3, 4, 5] + +// gdb-command:print MUT_VECT_SLICE.length +// gdb-check:$16 = 2 +// gdb-command:print *(MUT_VECT_SLICE.data_ptr as *const [i64; 2]) +// gdb-check:$17 = [64, 65] // === LLDB TESTS ================================================================================== // lldb-command:run // lldb-command:v empty -// lldbg-check:[...] size=0 -// lldbr-check:(&[i64]) empty = size=0 +// lldb-check:[...] size=0 // lldb-command:v singleton -// lldbg-check:[...] size=1 { [0] = 1 } -// lldbr-check:(&[i64]) singleton = &[1] +// lldb-check:[...] size=1 { [0] = 1 } // lldb-command:v multiple -// lldbg-check:[...] size=4 { [0] = 2 [1] = 3 [2] = 4 [3] = 5 } -// lldbr-check:(&[i64]) multiple = size=4 { [0] = 2 [1] = 3 [2] = 4 [3] = 5 } +// lldb-check:[...] size=4 { [0] = 2 [1] = 3 [2] = 4 [3] = 5 } // lldb-command:v slice_of_slice -// lldbg-check:[...] size=2 { [0] = 3 [1] = 4 } -// lldbr-check:(&[i64]) slice_of_slice = size=2 { [0] = 3 [1] = 4 } +// lldb-check:[...] size=2 { [0] = 3 [1] = 4 } // lldb-command:v padded_tuple -// lldbg-check:[...] size=2 { [0] = { 0 = 6 1 = 7 } [1] = { 0 = 8 1 = 9 } } -// lldbr-check:(&[(i32, i16)]) padded_tuple = size=2 { [0] = { 0 = 6 1 = 7 } [1] = { 0 = 8 1 = 9 } } +// lldb-check:[...] size=2 { [0] = { 0 = 6 1 = 7 } [1] = { 0 = 8 1 = 9 } } // lldb-command:v padded_struct -// lldbg-check:[...] size=2 { [0] = { x = 10 y = 11 z = 12 } [1] = { x = 13 y = 14 z = 15 } } -// lldbr-check:(&[vec_slices::AStruct]) padded_struct = size=2 { [0] = { x = 10 y = 11 z = 12 } [1] = { x = 13 y = 14 z = 15 } } +// lldb-check:[...] size=2 { [0] = { x = 10 y = 11 z = 12 } [1] = { x = 13 y = 14 z = 15 } } #![allow(dead_code, unused_variables)] #![feature(omit_gdb_pretty_printer_section)] diff --git a/tests/debuginfo/vec.rs b/tests/debuginfo/vec.rs index 20cfd785ca7..1093e38d878 100644 --- a/tests/debuginfo/vec.rs +++ b/tests/debuginfo/vec.rs @@ -1,24 +1,19 @@ -//@ min-lldb-version: 310 - //@ compile-flags:-g // === GDB TESTS =================================================================================== // gdb-command:run // gdb-command:print a -// gdbg-check:$1 = {1, 2, 3} -// gdbr-check:$1 = [1, 2, 3] +// gdb-check:$1 = [1, 2, 3] // gdb-command:print vec::VECT -// gdbg-check:$2 = {4, 5, 6} -// gdbr-check:$2 = [4, 5, 6] +// gdb-check:$2 = [4, 5, 6] // === LLDB TESTS ================================================================================== // lldb-command:run // lldb-command:v a -// lldbg-check:[...] { [0] = 1 [1] = 2 [2] = 3 } -// lldbr-check:([i32; 3]) a = { [0] = 1 [1] = 2 [2] = 3 } +// lldb-check:[...] { [0] = 1 [1] = 2 [2] = 3 } #![allow(unused_variables)] #![feature(omit_gdb_pretty_printer_section)] diff --git a/tests/mir-opt/address_of.address_of_reborrow.SimplifyCfg-initial.after.mir b/tests/mir-opt/address_of.address_of_reborrow.SimplifyCfg-initial.after.mir index cb72ad3d253..be636da4517 100644 --- a/tests/mir-opt/address_of.address_of_reborrow.SimplifyCfg-initial.after.mir +++ b/tests/mir-opt/address_of.address_of_reborrow.SimplifyCfg-initial.after.mir @@ -140,7 +140,7 @@ fn address_of_reborrow() -> () { StorageLive(_6); _6 = &raw const (*_1); AscribeUserType(_6, o, UserTypeProjection { base: UserType(0), projs: [] }); - _5 = _6; + _5 = copy _6; StorageDead(_6); StorageDead(_5); StorageLive(_7); @@ -153,7 +153,7 @@ fn address_of_reborrow() -> () { _9 = move _10 as *const dyn std::marker::Send (PointerCoercion(Unsize)); StorageDead(_10); AscribeUserType(_9, o, UserTypeProjection { base: UserType(1), projs: [] }); - _8 = _9; + _8 = copy _9; StorageDead(_9); StorageDead(_8); StorageLive(_11); @@ -194,7 +194,7 @@ fn address_of_reborrow() -> () { StorageLive(_22); _22 = &raw const (*_3); AscribeUserType(_22, o, UserTypeProjection { base: UserType(10), projs: [] }); - _21 = _22; + _21 = copy _22; StorageDead(_22); StorageDead(_21); StorageLive(_23); @@ -207,7 +207,7 @@ fn address_of_reborrow() -> () { _25 = move _26 as *const dyn std::marker::Send (PointerCoercion(Unsize)); StorageDead(_26); AscribeUserType(_25, o, UserTypeProjection { base: UserType(11), projs: [] }); - _24 = _25; + _24 = copy _25; StorageDead(_25); StorageDead(_24); StorageLive(_27); @@ -242,7 +242,7 @@ fn address_of_reborrow() -> () { StorageLive(_36); _36 = &raw mut (*_3); AscribeUserType(_36, o, UserTypeProjection { base: UserType(20), projs: [] }); - _35 = _36; + _35 = copy _36; StorageDead(_36); StorageDead(_35); StorageLive(_37); @@ -255,7 +255,7 @@ fn address_of_reborrow() -> () { _39 = move _40 as *mut dyn std::marker::Send (PointerCoercion(Unsize)); StorageDead(_40); AscribeUserType(_39, o, UserTypeProjection { base: UserType(21), projs: [] }); - _38 = _39; + _38 = copy _39; StorageDead(_39); StorageDead(_38); StorageLive(_41); diff --git a/tests/mir-opt/array_index_is_temporary.main.SimplifyCfg-pre-optimizations.after.panic-abort.mir b/tests/mir-opt/array_index_is_temporary.main.SimplifyCfg-pre-optimizations.after.panic-abort.mir index ef51b07827f..a467987e886 100644 --- a/tests/mir-opt/array_index_is_temporary.main.SimplifyCfg-pre-optimizations.after.panic-abort.mir +++ b/tests/mir-opt/array_index_is_temporary.main.SimplifyCfg-pre-optimizations.after.panic-abort.mir @@ -33,17 +33,17 @@ fn main() -> () { StorageDead(_4); StorageLive(_5); StorageLive(_6); - _6 = _3; + _6 = copy _3; _5 = foo(move _6) -> [return: bb1, unwind unreachable]; } bb1: { StorageDead(_6); StorageLive(_7); - _7 = _2; + _7 = copy _2; _8 = Len(_1); - _9 = Lt(_7, _8); - assert(move _9, "index out of bounds: the length is {} but the index is {}", move _8, _7) -> [success: bb2, unwind unreachable]; + _9 = Lt(copy _7, copy _8); + assert(move _9, "index out of bounds: the length is {} but the index is {}", move _8, copy _7) -> [success: bb2, unwind unreachable]; } bb2: { diff --git a/tests/mir-opt/array_index_is_temporary.main.SimplifyCfg-pre-optimizations.after.panic-unwind.mir b/tests/mir-opt/array_index_is_temporary.main.SimplifyCfg-pre-optimizations.after.panic-unwind.mir index d1aa9382a2c..bd7365543bd 100644 --- a/tests/mir-opt/array_index_is_temporary.main.SimplifyCfg-pre-optimizations.after.panic-unwind.mir +++ b/tests/mir-opt/array_index_is_temporary.main.SimplifyCfg-pre-optimizations.after.panic-unwind.mir @@ -33,17 +33,17 @@ fn main() -> () { StorageDead(_4); StorageLive(_5); StorageLive(_6); - _6 = _3; + _6 = copy _3; _5 = foo(move _6) -> [return: bb1, unwind continue]; } bb1: { StorageDead(_6); StorageLive(_7); - _7 = _2; + _7 = copy _2; _8 = Len(_1); - _9 = Lt(_7, _8); - assert(move _9, "index out of bounds: the length is {} but the index is {}", move _8, _7) -> [success: bb2, unwind continue]; + _9 = Lt(copy _7, copy _8); + assert(move _9, "index out of bounds: the length is {} but the index is {}", move _8, copy _7) -> [success: bb2, unwind continue]; } bb2: { diff --git a/tests/mir-opt/array_index_is_temporary.rs b/tests/mir-opt/array_index_is_temporary.rs index 771fb3771b5..cda9e86b3e6 100644 --- a/tests/mir-opt/array_index_is_temporary.rs +++ b/tests/mir-opt/array_index_is_temporary.rs @@ -15,7 +15,7 @@ fn main() { // CHECK: debug x => [[x:_.*]]; // CHECK: debug y => [[y:_.*]]; // CHECK: [[y]] = const 1_usize; - // CHECK: [[tmp:_.*]] = [[y]]; + // CHECK: [[tmp:_.*]] = copy [[y]]; // CHECK: [[x]][[[tmp]]] = let mut x = [42, 43, 44]; let mut y = 1; diff --git a/tests/mir-opt/async_closure_shims.main-{closure#0}-{closure#0}-{closure#0}.coroutine_by_move.0.panic-abort.mir b/tests/mir-opt/async_closure_shims.main-{closure#0}-{closure#0}-{closure#0}.coroutine_by_move.0.panic-abort.mir index 1c34955a8d9..1f5bb551b8e 100644 --- a/tests/mir-opt/async_closure_shims.main-{closure#0}-{closure#0}-{closure#0}.coroutine_by_move.0.panic-abort.mir +++ b/tests/mir-opt/async_closure_shims.main-{closure#0}-{closure#0}-{closure#0}.coroutine_by_move.0.panic-abort.mir @@ -22,7 +22,7 @@ yields () bb0: { StorageLive(_3); - _3 = (_1.0: i32); + _3 = copy (_1.0: i32); FakeRead(ForLet(None), _3); StorageLive(_4); _4 = &_3; diff --git a/tests/mir-opt/async_closure_shims.main-{closure#0}-{closure#0}-{closure#0}.coroutine_by_move.0.panic-unwind.mir b/tests/mir-opt/async_closure_shims.main-{closure#0}-{closure#0}-{closure#0}.coroutine_by_move.0.panic-unwind.mir index 1c34955a8d9..1f5bb551b8e 100644 --- a/tests/mir-opt/async_closure_shims.main-{closure#0}-{closure#0}-{closure#0}.coroutine_by_move.0.panic-unwind.mir +++ b/tests/mir-opt/async_closure_shims.main-{closure#0}-{closure#0}-{closure#0}.coroutine_by_move.0.panic-unwind.mir @@ -22,7 +22,7 @@ yields () bb0: { StorageLive(_3); - _3 = (_1.0: i32); + _3 = copy (_1.0: i32); FakeRead(ForLet(None), _3); StorageLive(_4); _4 = &_3; diff --git a/tests/mir-opt/async_closure_shims.main-{closure#0}-{closure#1}-{closure#0}.coroutine_by_move.0.panic-abort.mir b/tests/mir-opt/async_closure_shims.main-{closure#0}-{closure#1}-{closure#0}.coroutine_by_move.0.panic-abort.mir index 516908144a6..17fa9314806 100644 --- a/tests/mir-opt/async_closure_shims.main-{closure#0}-{closure#1}-{closure#0}.coroutine_by_move.0.panic-abort.mir +++ b/tests/mir-opt/async_closure_shims.main-{closure#0}-{closure#1}-{closure#0}.coroutine_by_move.0.panic-abort.mir @@ -22,7 +22,7 @@ yields () bb0: { StorageLive(_3); - _3 = (_1.0: i32); + _3 = copy (_1.0: i32); FakeRead(ForLet(None), _3); StorageLive(_4); _4 = &_3; diff --git a/tests/mir-opt/async_closure_shims.main-{closure#0}-{closure#1}-{closure#0}.coroutine_by_move.0.panic-unwind.mir b/tests/mir-opt/async_closure_shims.main-{closure#0}-{closure#1}-{closure#0}.coroutine_by_move.0.panic-unwind.mir index 516908144a6..17fa9314806 100644 --- a/tests/mir-opt/async_closure_shims.main-{closure#0}-{closure#1}-{closure#0}.coroutine_by_move.0.panic-unwind.mir +++ b/tests/mir-opt/async_closure_shims.main-{closure#0}-{closure#1}-{closure#0}.coroutine_by_move.0.panic-unwind.mir @@ -22,7 +22,7 @@ yields () bb0: { StorageLive(_3); - _3 = (_1.0: i32); + _3 = copy (_1.0: i32); FakeRead(ForLet(None), _3); StorageLive(_4); _4 = &_3; diff --git a/tests/mir-opt/async_closure_shims.main-{closure#0}-{closure#1}.coroutine_closure_by_ref.0.panic-abort.mir b/tests/mir-opt/async_closure_shims.main-{closure#0}-{closure#1}.coroutine_closure_by_ref.0.panic-abort.mir index ba20c28cd01..3fdc81791de 100644 --- a/tests/mir-opt/async_closure_shims.main-{closure#0}-{closure#1}.coroutine_closure_by_ref.0.panic-abort.mir +++ b/tests/mir-opt/async_closure_shims.main-{closure#0}-{closure#1}.coroutine_closure_by_ref.0.panic-abort.mir @@ -4,7 +4,7 @@ fn main::{closure#0}::{closure#1}(_1: &{async closure@$DIR/async_closure_shims.r let mut _0: {async closure body@$DIR/async_closure_shims.rs:62:48: 65:10}; bb0: { - _0 = {coroutine@$DIR/async_closure_shims.rs:62:48: 65:10 (#0)} { a: move _2, b: ((*_1).0: &i32) }; + _0 = {coroutine@$DIR/async_closure_shims.rs:62:48: 65:10 (#0)} { a: move _2, b: copy ((*_1).0: &i32) }; return; } } diff --git a/tests/mir-opt/async_closure_shims.main-{closure#0}-{closure#1}.coroutine_closure_by_ref.0.panic-unwind.mir b/tests/mir-opt/async_closure_shims.main-{closure#0}-{closure#1}.coroutine_closure_by_ref.0.panic-unwind.mir index ba20c28cd01..3fdc81791de 100644 --- a/tests/mir-opt/async_closure_shims.main-{closure#0}-{closure#1}.coroutine_closure_by_ref.0.panic-unwind.mir +++ b/tests/mir-opt/async_closure_shims.main-{closure#0}-{closure#1}.coroutine_closure_by_ref.0.panic-unwind.mir @@ -4,7 +4,7 @@ fn main::{closure#0}::{closure#1}(_1: &{async closure@$DIR/async_closure_shims.r let mut _0: {async closure body@$DIR/async_closure_shims.rs:62:48: 65:10}; bb0: { - _0 = {coroutine@$DIR/async_closure_shims.rs:62:48: 65:10 (#0)} { a: move _2, b: ((*_1).0: &i32) }; + _0 = {coroutine@$DIR/async_closure_shims.rs:62:48: 65:10 (#0)} { a: move _2, b: copy ((*_1).0: &i32) }; return; } } diff --git a/tests/mir-opt/basic_assignment.main.ElaborateDrops.diff b/tests/mir-opt/basic_assignment.main.ElaborateDrops.diff index f187f959727..2d6adaca19e 100644 --- a/tests/mir-opt/basic_assignment.main.ElaborateDrops.diff +++ b/tests/mir-opt/basic_assignment.main.ElaborateDrops.diff @@ -27,7 +27,7 @@ _1 = const false; StorageLive(_2); StorageLive(_3); - _3 = _1; + _3 = copy _1; _2 = move _3; StorageDead(_3); StorageLive(_4); diff --git a/tests/mir-opt/basic_assignment.main.SimplifyCfg-initial.after.mir b/tests/mir-opt/basic_assignment.main.SimplifyCfg-initial.after.mir index 5c0d1e9b93f..d4f0363e443 100644 --- a/tests/mir-opt/basic_assignment.main.SimplifyCfg-initial.after.mir +++ b/tests/mir-opt/basic_assignment.main.SimplifyCfg-initial.after.mir @@ -31,7 +31,7 @@ fn main() -> () { FakeRead(ForLet(None), _1); StorageLive(_2); StorageLive(_3); - _3 = _1; + _3 = copy _1; _2 = move _3; StorageDead(_3); StorageLive(_4); diff --git a/tests/mir-opt/box_expr.rs b/tests/mir-opt/box_expr.rs index a2d3ab94db6..41cd4ca57bf 100644 --- a/tests/mir-opt/box_expr.rs +++ b/tests/mir-opt/box_expr.rs @@ -7,7 +7,7 @@ fn main() { // CHECK-LABEL: fn main( // CHECK: [[box:_.*]] = ShallowInitBox( - // CHECK: [[ptr:_.*]] = ((([[box]].0: std::ptr::Unique<S>).0: std::ptr::NonNull<S>).0: *const S); + // CHECK: [[ptr:_.*]] = copy ((([[box]].0: std::ptr::Unique<S>).0: std::ptr::NonNull<S>).0: *const S); // CHECK: (*[[ptr]]) = S::new() -> [return: [[ret:bb.*]], unwind: [[unwind:bb.*]]]; // CHECK: [[ret]]: { // CHECK: [[box2:_.*]] = move [[box]]; diff --git a/tests/mir-opt/building/async_await.b-{closure#0}.coroutine_resume.0.mir b/tests/mir-opt/building/async_await.b-{closure#0}.coroutine_resume.0.mir index c0f16ee7ec0..c1c2fdcfa94 100644 --- a/tests/mir-opt/building/async_await.b-{closure#0}.coroutine_resume.0.mir +++ b/tests/mir-opt/building/async_await.b-{closure#0}.coroutine_resume.0.mir @@ -151,7 +151,7 @@ fn b::{closure#0}(_1: Pin<&mut {async fn body of b()}>, _2: &mut Context<'_>) -> StorageLive(_13); StorageLive(_14); StorageLive(_15); - _15 = _38; + _15 = copy _38; _14 = move _15; goto -> bb6; } @@ -194,8 +194,8 @@ fn b::{closure#0}(_1: Pin<&mut {async fn body of b()}>, _2: &mut Context<'_>) -> bb10: { StorageLive(_17); - _17 = ((_9 as Ready).0: ()); - _3 = _17; + _17 = copy ((_9 as Ready).0: ()); + _3 = copy _17; StorageDead(_17); StorageDead(_14); StorageDead(_12); @@ -253,7 +253,7 @@ fn b::{closure#0}(_1: Pin<&mut {async fn body of b()}>, _2: &mut Context<'_>) -> StorageLive(_29); StorageLive(_30); StorageLive(_31); - _31 = _38; + _31 = copy _38; _30 = move _31; goto -> bb18; } @@ -291,8 +291,8 @@ fn b::{closure#0}(_1: Pin<&mut {async fn body of b()}>, _2: &mut Context<'_>) -> bb21: { StorageLive(_33); - _33 = ((_25 as Ready).0: ()); - _37 = _33; + _33 = copy ((_25 as Ready).0: ()); + _37 = copy _33; StorageDead(_33); StorageDead(_30); StorageDead(_28); diff --git a/tests/mir-opt/building/custom/aggregate_exprs.adt.built.after.mir b/tests/mir-opt/building/custom/aggregate_exprs.adt.built.after.mir index c14882142f5..6d4d261b895 100644 --- a/tests/mir-opt/building/custom/aggregate_exprs.adt.built.after.mir +++ b/tests/mir-opt/building/custom/aggregate_exprs.adt.built.after.mir @@ -9,8 +9,8 @@ fn adt() -> Onion { bb0: { _1 = const 1_i32; _2 = Foo { a: const 1_i32, b: const 2_i32 }; - _3 = Bar::Foo(move _2, _1); - _0 = Onion { neon: ((_3 as variant#0).1: i32) }; + _3 = Bar::Foo(move _2, copy _1); + _0 = Onion { neon: copy ((_3 as variant#0).1: i32) }; return; } } diff --git a/tests/mir-opt/building/custom/aggregate_exprs.array.built.after.mir b/tests/mir-opt/building/custom/aggregate_exprs.array.built.after.mir index fde007abab0..2c14258956a 100644 --- a/tests/mir-opt/building/custom/aggregate_exprs.array.built.after.mir +++ b/tests/mir-opt/building/custom/aggregate_exprs.array.built.after.mir @@ -8,7 +8,7 @@ fn array() -> [i32; 2] { bb0: { _1 = [const 42_i32, const 43_i32]; _2 = const 1_i32; - _1 = [_2, const 2_i32]; + _1 = [copy _2, const 2_i32]; _0 = move _1; return; } diff --git a/tests/mir-opt/building/custom/arbitrary_let.arbitrary_let.built.after.mir b/tests/mir-opt/building/custom/arbitrary_let.arbitrary_let.built.after.mir index 189996f1179..72a16b35885 100644 --- a/tests/mir-opt/building/custom/arbitrary_let.arbitrary_let.built.after.mir +++ b/tests/mir-opt/building/custom/arbitrary_let.arbitrary_let.built.after.mir @@ -6,17 +6,17 @@ fn arbitrary_let(_1: i32) -> i32 { let mut _3: i32; bb0: { - _2 = _1; + _2 = copy _1; goto -> bb2; } bb1: { - _0 = _3; + _0 = copy _3; return; } bb2: { - _3 = _2; + _3 = copy _2; goto -> bb1; } } diff --git a/tests/mir-opt/building/custom/arrays.arrays.built.after.mir b/tests/mir-opt/building/custom/arrays.arrays.built.after.mir index eaeba302f15..30d11e31e4d 100644 --- a/tests/mir-opt/building/custom/arrays.arrays.built.after.mir +++ b/tests/mir-opt/building/custom/arrays.arrays.built.after.mir @@ -8,7 +8,7 @@ fn arrays() -> usize { bb0: { _1 = [const 5_i32; C]; _2 = Len(_1); - _0 = _2; + _0 = copy _2; return; } } diff --git a/tests/mir-opt/building/custom/as_cast.float_to_int.built.after.mir b/tests/mir-opt/building/custom/as_cast.float_to_int.built.after.mir index e3334bc7dbe..93750719d27 100644 --- a/tests/mir-opt/building/custom/as_cast.float_to_int.built.after.mir +++ b/tests/mir-opt/building/custom/as_cast.float_to_int.built.after.mir @@ -4,7 +4,7 @@ fn float_to_int(_1: f32) -> i32 { let mut _0: i32; bb0: { - _0 = _1 as i32 (FloatToInt); + _0 = copy _1 as i32 (FloatToInt); return; } } diff --git a/tests/mir-opt/building/custom/as_cast.int_to_int.built.after.mir b/tests/mir-opt/building/custom/as_cast.int_to_int.built.after.mir index d71cb9d78d3..9adec45d64b 100644 --- a/tests/mir-opt/building/custom/as_cast.int_to_int.built.after.mir +++ b/tests/mir-opt/building/custom/as_cast.int_to_int.built.after.mir @@ -4,7 +4,7 @@ fn int_to_int(_1: u32) -> i32 { let mut _0: i32; bb0: { - _0 = _1 as i32 (IntToInt); + _0 = copy _1 as i32 (IntToInt); return; } } diff --git a/tests/mir-opt/building/custom/as_cast.int_to_ptr.built.after.mir b/tests/mir-opt/building/custom/as_cast.int_to_ptr.built.after.mir index faff79e8c57..aa642258095 100644 --- a/tests/mir-opt/building/custom/as_cast.int_to_ptr.built.after.mir +++ b/tests/mir-opt/building/custom/as_cast.int_to_ptr.built.after.mir @@ -4,7 +4,7 @@ fn int_to_ptr(_1: usize) -> *const i32 { let mut _0: *const i32; bb0: { - _0 = _1 as *const i32 (PointerWithExposedProvenance); + _0 = copy _1 as *const i32 (PointerWithExposedProvenance); return; } } diff --git a/tests/mir-opt/building/custom/assume.assume_local.built.after.mir b/tests/mir-opt/building/custom/assume.assume_local.built.after.mir index 7ea1fcd30c2..36e2859ce16 100644 --- a/tests/mir-opt/building/custom/assume.assume_local.built.after.mir +++ b/tests/mir-opt/building/custom/assume.assume_local.built.after.mir @@ -4,7 +4,7 @@ fn assume_local(_1: bool) -> () { let mut _0: (); bb0: { - assume(_1); + assume(copy _1); return; } } diff --git a/tests/mir-opt/building/custom/assume.assume_place.built.after.mir b/tests/mir-opt/building/custom/assume.assume_place.built.after.mir index ce914618d3d..074af333d63 100644 --- a/tests/mir-opt/building/custom/assume.assume_place.built.after.mir +++ b/tests/mir-opt/building/custom/assume.assume_place.built.after.mir @@ -4,7 +4,7 @@ fn assume_place(_1: (bool, u8)) -> () { let mut _0: (); bb0: { - assume((_1.0: bool)); + assume(copy (_1.0: bool)); return; } } diff --git a/tests/mir-opt/building/custom/enums.switch_bool.built.after.mir b/tests/mir-opt/building/custom/enums.switch_bool.built.after.mir index f82e5f1c6fd..beefef331df 100644 --- a/tests/mir-opt/building/custom/enums.switch_bool.built.after.mir +++ b/tests/mir-opt/building/custom/enums.switch_bool.built.after.mir @@ -4,7 +4,7 @@ fn switch_bool(_1: bool) -> u32 { let mut _0: u32; bb0: { - switchInt(_1) -> [1: bb1, 0: bb2, otherwise: bb2]; + switchInt(copy _1) -> [1: bb1, 0: bb2, otherwise: bb2]; } bb1: { diff --git a/tests/mir-opt/building/custom/enums.switch_option.built.after.mir b/tests/mir-opt/building/custom/enums.switch_option.built.after.mir index fa03f274be3..a854df87866 100644 --- a/tests/mir-opt/building/custom/enums.switch_option.built.after.mir +++ b/tests/mir-opt/building/custom/enums.switch_option.built.after.mir @@ -6,7 +6,7 @@ fn switch_option(_1: Option<()>) -> bool { bb0: { _2 = discriminant(_1); - switchInt(_2) -> [0: bb1, 1: bb2, otherwise: bb2]; + switchInt(copy _2) -> [0: bb1, 1: bb2, otherwise: bb2]; } bb1: { diff --git a/tests/mir-opt/building/custom/enums.switch_option_repr.built.after.mir b/tests/mir-opt/building/custom/enums.switch_option_repr.built.after.mir index eec2197a8bd..4ffc08772a8 100644 --- a/tests/mir-opt/building/custom/enums.switch_option_repr.built.after.mir +++ b/tests/mir-opt/building/custom/enums.switch_option_repr.built.after.mir @@ -6,7 +6,7 @@ fn switch_option_repr(_1: Bool) -> bool { bb0: { _2 = discriminant(_1); - switchInt(_2) -> [0: bb2, otherwise: bb1]; + switchInt(copy _2) -> [0: bb2, otherwise: bb1]; } bb1: { diff --git a/tests/mir-opt/building/custom/operators.f.built.after.mir b/tests/mir-opt/building/custom/operators.f.built.after.mir index cac82f7b3ea..ed6cddd548f 100644 --- a/tests/mir-opt/building/custom/operators.f.built.after.mir +++ b/tests/mir-opt/building/custom/operators.f.built.after.mir @@ -5,26 +5,26 @@ fn f(_1: i32, _2: bool) -> i32 { let mut _3: (i32, bool); bb0: { - _1 = Neg(_1); - _2 = Not(_2); - _1 = Add(_1, _1); - _1 = Sub(_1, _1); - _1 = Mul(_1, _1); - _1 = Div(_1, _1); - _1 = Rem(_1, _1); - _1 = BitXor(_1, _1); - _1 = BitAnd(_1, _1); - _1 = Shl(_1, _1); - _1 = Shr(_1, _1); - _2 = Eq(_1, _1); - _2 = Lt(_1, _1); - _2 = Le(_1, _1); - _2 = Ge(_1, _1); - _2 = Gt(_1, _1); - _3 = AddWithOverflow(_1, _1); - _2 = (_3.1: bool); - _1 = (_3.0: i32); - _0 = _1; + _1 = Neg(copy _1); + _2 = Not(copy _2); + _1 = Add(copy _1, copy _1); + _1 = Sub(copy _1, copy _1); + _1 = Mul(copy _1, copy _1); + _1 = Div(copy _1, copy _1); + _1 = Rem(copy _1, copy _1); + _1 = BitXor(copy _1, copy _1); + _1 = BitAnd(copy _1, copy _1); + _1 = Shl(copy _1, copy _1); + _1 = Shr(copy _1, copy _1); + _2 = Eq(copy _1, copy _1); + _2 = Lt(copy _1, copy _1); + _2 = Le(copy _1, copy _1); + _2 = Ge(copy _1, copy _1); + _2 = Gt(copy _1, copy _1); + _3 = AddWithOverflow(copy _1, copy _1); + _2 = copy (_3.1: bool); + _1 = copy (_3.0: i32); + _0 = copy _1; return; } } diff --git a/tests/mir-opt/building/custom/operators.g.runtime.after.mir b/tests/mir-opt/building/custom/operators.g.runtime.after.mir index a0ad7d0f93f..7d87fd93278 100644 --- a/tests/mir-opt/building/custom/operators.g.runtime.after.mir +++ b/tests/mir-opt/building/custom/operators.g.runtime.after.mir @@ -6,8 +6,8 @@ fn g(_1: *const i32, _2: *const [i32]) -> () { let mut _4: usize; bb0: { - _3 = PtrMetadata(_1); - _4 = PtrMetadata(_2); + _3 = PtrMetadata(copy _1); + _4 = PtrMetadata(copy _2); return; } } diff --git a/tests/mir-opt/building/custom/projections.copy_for_deref.built.after.mir b/tests/mir-opt/building/custom/projections.copy_for_deref.built.after.mir index b1ba5f9314d..b28e96f10ea 100644 --- a/tests/mir-opt/building/custom/projections.copy_for_deref.built.after.mir +++ b/tests/mir-opt/building/custom/projections.copy_for_deref.built.after.mir @@ -6,7 +6,7 @@ fn copy_for_deref(_1: (&i32, i32)) -> i32 { bb0: { _2 = deref_copy (_1.0: &i32); - _0 = (*_2); + _0 = copy (*_2); return; } } diff --git a/tests/mir-opt/building/custom/projections.simple_index.built.after.mir b/tests/mir-opt/building/custom/projections.simple_index.built.after.mir index f74c61009d3..2cd781696da 100644 --- a/tests/mir-opt/building/custom/projections.simple_index.built.after.mir +++ b/tests/mir-opt/building/custom/projections.simple_index.built.after.mir @@ -6,8 +6,8 @@ fn simple_index(_1: [i32; 10], _2: &[i32]) -> i32 { bb0: { _3 = const 3_usize; - _0 = _1[_3]; - _0 = (*_2)[_3]; + _0 = copy _1[_3]; + _0 = copy (*_2)[_3]; return; } } diff --git a/tests/mir-opt/building/custom/projections.tuples.built.after.mir b/tests/mir-opt/building/custom/projections.tuples.built.after.mir index a370de2ed84..d07269cd0d3 100644 --- a/tests/mir-opt/building/custom/projections.tuples.built.after.mir +++ b/tests/mir-opt/building/custom/projections.tuples.built.after.mir @@ -4,8 +4,8 @@ fn tuples(_1: (u32, i32)) -> (u32, i32) { let mut _0: (u32, i32); bb0: { - (_0.0: u32) = (_1.0: u32); - (_0.1: i32) = (_1.1: i32); + (_0.0: u32) = copy (_1.0: u32); + (_0.1: i32) = copy (_1.1: i32); return; } } diff --git a/tests/mir-opt/building/custom/projections.unions.built.after.mir b/tests/mir-opt/building/custom/projections.unions.built.after.mir index 4189b329e8c..fe4f7acebb5 100644 --- a/tests/mir-opt/building/custom/projections.unions.built.after.mir +++ b/tests/mir-opt/building/custom/projections.unions.built.after.mir @@ -4,7 +4,7 @@ fn unions(_1: U) -> i32 { let mut _0: i32; bb0: { - _0 = (_1.0: i32); + _0 = copy (_1.0: i32); return; } } diff --git a/tests/mir-opt/building/custom/projections.unwrap.built.after.mir b/tests/mir-opt/building/custom/projections.unwrap.built.after.mir index 0c43bdc9d24..ea706e0a97d 100644 --- a/tests/mir-opt/building/custom/projections.unwrap.built.after.mir +++ b/tests/mir-opt/building/custom/projections.unwrap.built.after.mir @@ -4,7 +4,7 @@ fn unwrap(_1: Option<i32>) -> i32 { let mut _0: i32; bb0: { - _0 = ((_1 as variant#1).0: i32); + _0 = copy ((_1 as variant#1).0: i32); return; } } diff --git a/tests/mir-opt/building/custom/projections.unwrap_deref.built.after.mir b/tests/mir-opt/building/custom/projections.unwrap_deref.built.after.mir index 39e97851343..eb83dcece3e 100644 --- a/tests/mir-opt/building/custom/projections.unwrap_deref.built.after.mir +++ b/tests/mir-opt/building/custom/projections.unwrap_deref.built.after.mir @@ -4,7 +4,7 @@ fn unwrap_deref(_1: Option<&i32>) -> i32 { let mut _0: i32; bb0: { - _0 = (*((_1 as variant#1).0: &i32)); + _0 = copy (*((_1 as variant#1).0: &i32)); return; } } diff --git a/tests/mir-opt/building/custom/references.raw_pointer_offset.built.after.mir b/tests/mir-opt/building/custom/references.raw_pointer_offset.built.after.mir index 8046b543eef..3893613bff9 100644 --- a/tests/mir-opt/building/custom/references.raw_pointer_offset.built.after.mir +++ b/tests/mir-opt/building/custom/references.raw_pointer_offset.built.after.mir @@ -4,7 +4,7 @@ fn raw_pointer_offset(_1: *const i32) -> *const i32 { let mut _0: *const i32; bb0: { - _0 = Offset(_1, const 1_isize); + _0 = Offset(copy _1, const 1_isize); return; } } diff --git a/tests/mir-opt/building/custom/simple_assign.simple.built.after.mir b/tests/mir-opt/building/custom/simple_assign.simple.built.after.mir index 6f7aaeed979..10ad840f98c 100644 --- a/tests/mir-opt/building/custom/simple_assign.simple.built.after.mir +++ b/tests/mir-opt/building/custom/simple_assign.simple.built.after.mir @@ -7,14 +7,14 @@ fn simple(_1: i32) -> i32 { bb0: { StorageLive(_2); - _2 = _1; + _2 = copy _1; goto -> bb1; } bb1: { _3 = move _2; StorageDead(_2); - _0 = _3; + _0 = copy _3; return; } } diff --git a/tests/mir-opt/building/custom/terminators.assert_nonzero.built.after.mir b/tests/mir-opt/building/custom/terminators.assert_nonzero.built.after.mir index 9cf26dff350..44030abc797 100644 --- a/tests/mir-opt/building/custom/terminators.assert_nonzero.built.after.mir +++ b/tests/mir-opt/building/custom/terminators.assert_nonzero.built.after.mir @@ -4,7 +4,7 @@ fn assert_nonzero(_1: i32) -> () { let mut _0: (); bb0: { - switchInt(_1) -> [0: bb1, otherwise: bb2]; + switchInt(copy _1) -> [0: bb1, otherwise: bb2]; } bb1: { diff --git a/tests/mir-opt/building/custom/terminators.direct_call.built.after.mir b/tests/mir-opt/building/custom/terminators.direct_call.built.after.mir index 07044ceaef4..b29d4ec7095 100644 --- a/tests/mir-opt/building/custom/terminators.direct_call.built.after.mir +++ b/tests/mir-opt/building/custom/terminators.direct_call.built.after.mir @@ -4,7 +4,7 @@ fn direct_call(_1: i32) -> i32 { let mut _0: i32; bb0: { - _0 = ident::<i32>(_1) -> [return: bb1, unwind continue]; + _0 = ident::<i32>(copy _1) -> [return: bb1, unwind continue]; } bb1: { diff --git a/tests/mir-opt/building/custom/terminators.indirect_call.built.after.mir b/tests/mir-opt/building/custom/terminators.indirect_call.built.after.mir index 3b849354dcd..b88f6603026 100644 --- a/tests/mir-opt/building/custom/terminators.indirect_call.built.after.mir +++ b/tests/mir-opt/building/custom/terminators.indirect_call.built.after.mir @@ -4,7 +4,7 @@ fn indirect_call(_1: i32, _2: fn(i32) -> i32) -> i32 { let mut _0: i32; bb0: { - _0 = _2(_1) -> [return: bb1, unwind continue]; + _0 = copy _2(copy _1) -> [return: bb1, unwind continue]; } bb1: { diff --git a/tests/mir-opt/building/custom/terminators.tail_call.built.after.mir b/tests/mir-opt/building/custom/terminators.tail_call.built.after.mir index 4cf6e459aa8..ab3925dae1c 100644 --- a/tests/mir-opt/building/custom/terminators.tail_call.built.after.mir +++ b/tests/mir-opt/building/custom/terminators.tail_call.built.after.mir @@ -5,7 +5,7 @@ fn tail_call(_1: i32) -> i32 { let mut _2: i32; bb0: { - _2 = Add(_1, const 42_i32); - tailcall ident::<i32>(Spanned { node: _2, span: $DIR/terminators.rs:32:28: 32:29 (#0) }); + _2 = Add(copy _1, const 42_i32); + tailcall ident::<i32>(Spanned { node: copy _2, span: $DIR/terminators.rs:32:28: 32:29 (#0) }); } } diff --git a/tests/mir-opt/building/enum_cast.bar.built.after.mir b/tests/mir-opt/building/enum_cast.bar.built.after.mir index 512c7321619..72d0cf5d1e8 100644 --- a/tests/mir-opt/building/enum_cast.bar.built.after.mir +++ b/tests/mir-opt/building/enum_cast.bar.built.after.mir @@ -12,8 +12,8 @@ fn bar(_1: Bar) -> usize { StorageLive(_2); _2 = move _1; _3 = discriminant(_2); - _4 = _3 as u8 (IntToInt); - _5 = Le(_4, const 1_u8); + _4 = copy _3 as u8 (IntToInt); + _5 = Le(copy _4, const 1_u8); assume(move _5); _0 = move _3 as usize (IntToInt); StorageDead(_2); diff --git a/tests/mir-opt/building/enum_cast.boo.built.after.mir b/tests/mir-opt/building/enum_cast.boo.built.after.mir index ad0adf14e4a..91e06dc8862 100644 --- a/tests/mir-opt/building/enum_cast.boo.built.after.mir +++ b/tests/mir-opt/building/enum_cast.boo.built.after.mir @@ -12,8 +12,8 @@ fn boo(_1: Boo) -> usize { StorageLive(_2); _2 = move _1; _3 = discriminant(_2); - _4 = _3 as u8 (IntToInt); - _5 = Le(_4, const 1_u8); + _4 = copy _3 as u8 (IntToInt); + _5 = Le(copy _4, const 1_u8); assume(move _5); _0 = move _3 as usize (IntToInt); StorageDead(_2); diff --git a/tests/mir-opt/building/enum_cast.droppy.built.after.mir b/tests/mir-opt/building/enum_cast.droppy.built.after.mir index ea0edb610f5..f53c9199a49 100644 --- a/tests/mir-opt/building/enum_cast.droppy.built.after.mir +++ b/tests/mir-opt/building/enum_cast.droppy.built.after.mir @@ -31,8 +31,8 @@ fn droppy() -> () { StorageLive(_4); _4 = move _2; _5 = discriminant(_4); - _6 = _5 as u8 (IntToInt); - _7 = Le(_6, const 2_u8); + _6 = copy _5 as u8 (IntToInt); + _7 = Le(copy _6, const 2_u8); assume(move _7); _3 = move _5 as usize (IntToInt); drop(_4) -> [return: bb1, unwind: bb4]; diff --git a/tests/mir-opt/building/enum_cast.far.built.after.mir b/tests/mir-opt/building/enum_cast.far.built.after.mir index e75803c706d..14eaf344190 100644 --- a/tests/mir-opt/building/enum_cast.far.built.after.mir +++ b/tests/mir-opt/building/enum_cast.far.built.after.mir @@ -12,8 +12,8 @@ fn far(_1: Far) -> isize { StorageLive(_2); _2 = move _1; _3 = discriminant(_2); - _4 = _3 as u16 (IntToInt); - _5 = Le(_4, const 1_u16); + _4 = copy _3 as u16 (IntToInt); + _5 = Le(copy _4, const 1_u16); assume(move _5); _0 = move _3 as isize (IntToInt); StorageDead(_2); diff --git a/tests/mir-opt/building/enum_cast.offsetty.built.after.mir b/tests/mir-opt/building/enum_cast.offsetty.built.after.mir index 282859d7cd0..1c2acbe3023 100644 --- a/tests/mir-opt/building/enum_cast.offsetty.built.after.mir +++ b/tests/mir-opt/building/enum_cast.offsetty.built.after.mir @@ -14,9 +14,9 @@ fn offsetty(_1: NotStartingAtZero) -> u32 { StorageLive(_2); _2 = move _1; _3 = discriminant(_2); - _4 = _3 as u8 (IntToInt); - _5 = Ge(_4, const 4_u8); - _6 = Le(_4, const 8_u8); + _4 = copy _3 as u8 (IntToInt); + _5 = Ge(copy _4, const 4_u8); + _6 = Le(copy _4, const 8_u8); _7 = BitAnd(move _5, move _6); assume(move _7); _0 = move _3 as u32 (IntToInt); diff --git a/tests/mir-opt/building/enum_cast.signy.built.after.mir b/tests/mir-opt/building/enum_cast.signy.built.after.mir index a9f7d6c7800..39b6dfaf005 100644 --- a/tests/mir-opt/building/enum_cast.signy.built.after.mir +++ b/tests/mir-opt/building/enum_cast.signy.built.after.mir @@ -14,9 +14,9 @@ fn signy(_1: SignedAroundZero) -> i16 { StorageLive(_2); _2 = move _1; _3 = discriminant(_2); - _4 = _3 as u16 (IntToInt); - _5 = Ge(_4, const 65534_u16); - _6 = Le(_4, const 2_u16); + _4 = copy _3 as u16 (IntToInt); + _5 = Ge(copy _4, const 65534_u16); + _6 = Le(copy _4, const 2_u16); _7 = BitOr(move _5, move _6); assume(move _7); _0 = move _3 as i16 (IntToInt); diff --git a/tests/mir-opt/building/eq_never_type._f.built.after.mir b/tests/mir-opt/building/eq_never_type._f.built.after.mir index 39438258c2e..4711af46f1c 100644 --- a/tests/mir-opt/building/eq_never_type._f.built.after.mir +++ b/tests/mir-opt/building/eq_never_type._f.built.after.mir @@ -16,7 +16,7 @@ fn _f(_1: !, _2: !) -> () { StorageLive(_4); StorageLive(_5); StorageLive(_6); - _6 = _1; + _6 = copy _1; unreachable; } @@ -25,7 +25,7 @@ fn _f(_1: !, _2: !) -> () { StorageLive(_7); StorageLive(_8); StorageLive(_9); - _9 = _2; + _9 = copy _2; unreachable; } diff --git a/tests/mir-opt/building/issue_101867.main.built.after.mir b/tests/mir-opt/building/issue_101867.main.built.after.mir index 5c50b3db5ca..34e5bedf4ce 100644 --- a/tests/mir-opt/building/issue_101867.main.built.after.mir +++ b/tests/mir-opt/building/issue_101867.main.built.after.mir @@ -55,7 +55,7 @@ fn main() -> () { } bb6: { - _5 = ((_1 as Some).0: u8); + _5 = copy ((_1 as Some).0: u8); _0 = const (); StorageDead(_5); StorageDead(_1); diff --git a/tests/mir-opt/building/issue_49232.main.built.after.mir b/tests/mir-opt/building/issue_49232.main.built.after.mir index d09a1748a8b..b78f6691d54 100644 --- a/tests/mir-opt/building/issue_49232.main.built.after.mir +++ b/tests/mir-opt/building/issue_49232.main.built.after.mir @@ -25,7 +25,7 @@ fn main() -> () { StorageLive(_3); _3 = const true; PlaceMention(_3); - switchInt(_3) -> [0: bb4, otherwise: bb6]; + switchInt(copy _3) -> [0: bb4, otherwise: bb6]; } bb3: { diff --git a/tests/mir-opt/building/logical_or_in_conditional.test_complex.built.after.mir b/tests/mir-opt/building/logical_or_in_conditional.test_complex.built.after.mir index 3e16efe6980..72bd4605b26 100644 --- a/tests/mir-opt/building/logical_or_in_conditional.test_complex.built.after.mir +++ b/tests/mir-opt/building/logical_or_in_conditional.test_complex.built.after.mir @@ -54,7 +54,7 @@ fn test_complex() -> () { StorageLive(_6); StorageLive(_7); _7 = Droppy(const 0_u8); - _6 = (_7.0: u8); + _6 = copy (_7.0: u8); _5 = Gt(move _6, const 0_u8); switchInt(move _5) -> [0: bb10, otherwise: bb9]; } @@ -92,7 +92,7 @@ fn test_complex() -> () { StorageLive(_9); StorageLive(_10); _10 = Droppy(const 1_u8); - _9 = (_10.0: u8); + _9 = copy (_10.0: u8); _8 = Gt(move _9, const 1_u8); switchInt(move _8) -> [0: bb16, otherwise: bb15]; } diff --git a/tests/mir-opt/building/logical_or_in_conditional.test_or.built.after.mir b/tests/mir-opt/building/logical_or_in_conditional.test_or.built.after.mir index 3e7c116016c..2fc19e7e0fd 100644 --- a/tests/mir-opt/building/logical_or_in_conditional.test_or.built.after.mir +++ b/tests/mir-opt/building/logical_or_in_conditional.test_or.built.after.mir @@ -14,7 +14,7 @@ fn test_or() -> () { StorageLive(_2); StorageLive(_3); _3 = Droppy(const 0_u8); - _2 = (_3.0: u8); + _2 = copy (_3.0: u8); _1 = Gt(move _2, const 0_u8); switchInt(move _1) -> [0: bb2, otherwise: bb1]; } @@ -44,7 +44,7 @@ fn test_or() -> () { StorageLive(_5); StorageLive(_6); _6 = Droppy(const 1_u8); - _5 = (_6.0: u8); + _5 = copy (_6.0: u8); _4 = Gt(move _5, const 1_u8); switchInt(move _4) -> [0: bb7, otherwise: bb6]; } diff --git a/tests/mir-opt/building/match/deref-patterns/string.foo.PreCodegen.after.mir b/tests/mir-opt/building/match/deref-patterns/string.foo.PreCodegen.after.mir index 1e4f7485089..9f52a8cd1e5 100644 --- a/tests/mir-opt/building/match/deref-patterns/string.foo.PreCodegen.after.mir +++ b/tests/mir-opt/building/match/deref-patterns/string.foo.PreCodegen.after.mir @@ -26,7 +26,7 @@ fn foo(_1: Option<String>) -> i32 { } bb2: { - _6 = <str as PartialEq>::eq(_5, const "a") -> [return: bb3, unwind unreachable]; + _6 = <str as PartialEq>::eq(copy _5, const "a") -> [return: bb3, unwind unreachable]; } bb3: { @@ -52,7 +52,7 @@ fn foo(_1: Option<String>) -> i32 { } bb7: { - switchInt(_2) -> [0: bb9, otherwise: bb8]; + switchInt(copy _2) -> [0: bb9, otherwise: bb8]; } bb8: { diff --git a/tests/mir-opt/building/match/exponential_or.match_tuple.SimplifyCfg-initial.after.mir b/tests/mir-opt/building/match/exponential_or.match_tuple.SimplifyCfg-initial.after.mir index 596dcef85fd..d52241b459e 100644 --- a/tests/mir-opt/building/match/exponential_or.match_tuple.SimplifyCfg-initial.after.mir +++ b/tests/mir-opt/building/match/exponential_or.match_tuple.SimplifyCfg-initial.after.mir @@ -19,7 +19,7 @@ fn match_tuple(_1: (u32, bool, Option<i32>, u32)) -> u32 { bb0: { PlaceMention(_1); - switchInt((_1.0: u32)) -> [1: bb2, 4: bb2, otherwise: bb1]; + switchInt(copy (_1.0: u32)) -> [1: bb2, 4: bb2, otherwise: bb1]; } bb1: { @@ -33,26 +33,26 @@ fn match_tuple(_1: (u32, bool, Option<i32>, u32)) -> u32 { } bb3: { - switchInt((((_1.2: std::option::Option<i32>) as Some).0: i32)) -> [1: bb4, 8: bb4, otherwise: bb1]; + switchInt(copy (((_1.2: std::option::Option<i32>) as Some).0: i32)) -> [1: bb4, 8: bb4, otherwise: bb1]; } bb4: { - _5 = Le(const 6_u32, (_1.3: u32)); + _5 = Le(const 6_u32, copy (_1.3: u32)); switchInt(move _5) -> [0: bb5, otherwise: bb7]; } bb5: { - _3 = Le(const 13_u32, (_1.3: u32)); + _3 = Le(const 13_u32, copy (_1.3: u32)); switchInt(move _3) -> [0: bb1, otherwise: bb6]; } bb6: { - _4 = Le((_1.3: u32), const 16_u32); + _4 = Le(copy (_1.3: u32), const 16_u32); switchInt(move _4) -> [0: bb1, otherwise: bb8]; } bb7: { - _6 = Le((_1.3: u32), const 9_u32); + _6 = Le(copy (_1.3: u32), const 9_u32); switchInt(move _6) -> [0: bb5, otherwise: bb8]; } @@ -62,13 +62,13 @@ fn match_tuple(_1: (u32, bool, Option<i32>, u32)) -> u32 { bb9: { StorageLive(_7); - _7 = (_1.0: u32); + _7 = copy (_1.0: u32); StorageLive(_8); - _8 = (_1.3: u32); + _8 = copy (_1.3: u32); StorageLive(_9); - _9 = _7; + _9 = copy _7; StorageLive(_10); - _10 = _8; + _10 = copy _8; _0 = BitXor(move _9, move _10); StorageDead(_10); StorageDead(_9); diff --git a/tests/mir-opt/building/match/match_false_edges.full_tested_match.built.after.mir b/tests/mir-opt/building/match/match_false_edges.full_tested_match.built.after.mir index a93743edfac..4b0cdcfbb86 100644 --- a/tests/mir-opt/building/match/match_false_edges.full_tested_match.built.after.mir +++ b/tests/mir-opt/building/match/match_false_edges.full_tested_match.built.after.mir @@ -59,9 +59,9 @@ fn full_tested_match() -> () { bb7: { StorageLive(_9); - _9 = ((_2 as Some).0: i32); + _9 = copy ((_2 as Some).0: i32); StorageLive(_10); - _10 = _9; + _10 = copy _9; _1 = (const 2_i32, move _10); StorageDead(_10); StorageDead(_9); @@ -89,9 +89,9 @@ fn full_tested_match() -> () { FakeRead(ForMatchGuard, _3); FakeRead(ForGuardBinding, _6); StorageLive(_5); - _5 = ((_2 as Some).0: i32); + _5 = copy ((_2 as Some).0: i32); StorageLive(_8); - _8 = _5; + _8 = copy _5; _1 = (const 1_i32, move _8); StorageDead(_8); StorageDead(_5); diff --git a/tests/mir-opt/building/match/match_false_edges.full_tested_match2.built.after.mir b/tests/mir-opt/building/match/match_false_edges.full_tested_match2.built.after.mir index 0d0ea2be1b0..63ec71fdf51 100644 --- a/tests/mir-opt/building/match/match_false_edges.full_tested_match2.built.after.mir +++ b/tests/mir-opt/building/match/match_false_edges.full_tested_match2.built.after.mir @@ -42,9 +42,9 @@ fn full_tested_match2() -> () { bb3: { StorageLive(_9); - _9 = ((_2 as Some).0: i32); + _9 = copy ((_2 as Some).0: i32); StorageLive(_10); - _10 = _9; + _10 = copy _9; _1 = (const 2_i32, move _10); StorageDead(_10); StorageDead(_9); @@ -89,9 +89,9 @@ fn full_tested_match2() -> () { FakeRead(ForMatchGuard, _3); FakeRead(ForGuardBinding, _6); StorageLive(_5); - _5 = ((_2 as Some).0: i32); + _5 = copy ((_2 as Some).0: i32); StorageLive(_8); - _8 = _5; + _8 = copy _5; _1 = (const 1_i32, move _8); StorageDead(_8); StorageDead(_5); diff --git a/tests/mir-opt/building/match/match_false_edges.main.built.after.mir b/tests/mir-opt/building/match/match_false_edges.main.built.after.mir index 87b7e29848f..3b10adb499c 100644 --- a/tests/mir-opt/building/match/match_false_edges.main.built.after.mir +++ b/tests/mir-opt/building/match/match_false_edges.main.built.after.mir @@ -61,7 +61,7 @@ fn main() -> () { bb5: { StorageLive(_14); - _14 = _2; + _14 = copy _2; _1 = const 4_i32; StorageDead(_14); goto -> bb22; @@ -86,7 +86,7 @@ fn main() -> () { _3 = &fake shallow _2; StorageLive(_12); StorageLive(_13); - _13 = (*_11); + _13 = copy (*_11); _12 = guard2(move _13) -> [return: bb18, unwind: bb24]; } @@ -96,7 +96,7 @@ fn main() -> () { bb11: { StorageLive(_9); - _9 = _2; + _9 = copy _2; _1 = const 2_i32; StorageDead(_9); goto -> bb22; @@ -123,7 +123,7 @@ fn main() -> () { FakeRead(ForMatchGuard, _3); FakeRead(ForGuardBinding, _7); StorageLive(_6); - _6 = ((_2 as Some).0: i32); + _6 = copy ((_2 as Some).0: i32); _1 = const 1_i32; StorageDead(_6); StorageDead(_7); @@ -150,7 +150,7 @@ fn main() -> () { FakeRead(ForMatchGuard, _3); FakeRead(ForGuardBinding, _11); StorageLive(_10); - _10 = ((_2 as Some).0: i32); + _10 = copy ((_2 as Some).0: i32); _1 = const 3_i32; StorageDead(_10); StorageDead(_11); diff --git a/tests/mir-opt/building/match/simple_match.match_bool.built.after.mir b/tests/mir-opt/building/match/simple_match.match_bool.built.after.mir index b0ebdc37b06..0e82d9591a6 100644 --- a/tests/mir-opt/building/match/simple_match.match_bool.built.after.mir +++ b/tests/mir-opt/building/match/simple_match.match_bool.built.after.mir @@ -6,7 +6,7 @@ fn match_bool(_1: bool) -> usize { bb0: { PlaceMention(_1); - switchInt(_1) -> [0: bb1, otherwise: bb2]; + switchInt(copy _1) -> [0: bb1, otherwise: bb2]; } bb1: { diff --git a/tests/mir-opt/building/match/sort_candidates.constant_eq.SimplifyCfg-initial.after.mir b/tests/mir-opt/building/match/sort_candidates.constant_eq.SimplifyCfg-initial.after.mir index 2bce79a3ae7..b8f54fef0fa 100644 --- a/tests/mir-opt/building/match/sort_candidates.constant_eq.SimplifyCfg-initial.after.mir +++ b/tests/mir-opt/building/match/sort_candidates.constant_eq.SimplifyCfg-initial.after.mir @@ -16,18 +16,18 @@ fn constant_eq(_1: &str, _2: bool) -> u32 { bb0: { StorageLive(_3); StorageLive(_4); - _4 = _1; + _4 = copy _1; StorageLive(_5); - _5 = _2; + _5 = copy _2; _3 = (move _4, move _5); StorageDead(_5); StorageDead(_4); PlaceMention(_3); - _9 = <str as PartialEq>::eq((_3.0: &str), const "a") -> [return: bb9, unwind: bb19]; + _9 = <str as PartialEq>::eq(copy (_3.0: &str), const "a") -> [return: bb9, unwind: bb19]; } bb1: { - switchInt((_3.1: bool)) -> [0: bb10, otherwise: bb11]; + switchInt(copy (_3.1: bool)) -> [0: bb10, otherwise: bb11]; } bb2: { @@ -35,7 +35,7 @@ fn constant_eq(_1: &str, _2: bool) -> u32 { } bb3: { - switchInt((_3.1: bool)) -> [0: bb1, otherwise: bb4]; + switchInt(copy (_3.1: bool)) -> [0: bb1, otherwise: bb4]; } bb4: { @@ -43,11 +43,11 @@ fn constant_eq(_1: &str, _2: bool) -> u32 { } bb5: { - _8 = <str as PartialEq>::eq((_3.0: &str), const "b") -> [return: bb8, unwind: bb19]; + _8 = <str as PartialEq>::eq(copy (_3.0: &str), const "b") -> [return: bb8, unwind: bb19]; } bb6: { - switchInt((_3.1: bool)) -> [0: bb1, otherwise: bb7]; + switchInt(copy (_3.1: bool)) -> [0: bb1, otherwise: bb7]; } bb7: { diff --git a/tests/mir-opt/building/match/sort_candidates.disjoint_ranges.SimplifyCfg-initial.after.mir b/tests/mir-opt/building/match/sort_candidates.disjoint_ranges.SimplifyCfg-initial.after.mir index e521fb4509a..d6251680814 100644 --- a/tests/mir-opt/building/match/sort_candidates.disjoint_ranges.SimplifyCfg-initial.after.mir +++ b/tests/mir-opt/building/match/sort_candidates.disjoint_ranges.SimplifyCfg-initial.after.mir @@ -13,7 +13,7 @@ fn disjoint_ranges(_1: i32, _2: bool) -> u32 { bb0: { PlaceMention(_1); - _6 = Le(const 0_i32, _1); + _6 = Le(const 0_i32, copy _1); switchInt(move _6) -> [0: bb3, otherwise: bb8]; } @@ -27,7 +27,7 @@ fn disjoint_ranges(_1: i32, _2: bool) -> u32 { } bb3: { - _4 = Le(const 10_i32, _1); + _4 = Le(const 10_i32, copy _1); switchInt(move _4) -> [0: bb5, otherwise: bb7]; } @@ -36,7 +36,7 @@ fn disjoint_ranges(_1: i32, _2: bool) -> u32 { } bb5: { - switchInt(_1) -> [4294967295: bb6, otherwise: bb1]; + switchInt(copy _1) -> [4294967295: bb6, otherwise: bb1]; } bb6: { @@ -44,12 +44,12 @@ fn disjoint_ranges(_1: i32, _2: bool) -> u32 { } bb7: { - _5 = Le(_1, const 20_i32); + _5 = Le(copy _1, const 20_i32); switchInt(move _5) -> [0: bb5, otherwise: bb4]; } bb8: { - _7 = Lt(_1, const 10_i32); + _7 = Lt(copy _1, const 10_i32); switchInt(move _7) -> [0: bb3, otherwise: bb2]; } @@ -66,7 +66,7 @@ fn disjoint_ranges(_1: i32, _2: bool) -> u32 { bb11: { _3 = &fake shallow _1; StorageLive(_8); - _8 = _2; + _8 = copy _2; switchInt(move _8) -> [0: bb13, otherwise: bb12]; } diff --git a/tests/mir-opt/building/match/sort_candidates.rs b/tests/mir-opt/building/match/sort_candidates.rs index 593a975a7a4..d7dd82791ff 100644 --- a/tests/mir-opt/building/match/sort_candidates.rs +++ b/tests/mir-opt/building/match/sort_candidates.rs @@ -25,7 +25,7 @@ fn disjoint_ranges(x: i32, b: bool) -> u32 { // CHECK-LABEL: fn disjoint_ranges( // CHECK: debug b => _2; // CHECK: bb0: { - // CHECK: switchInt(_2) -> [0: [[jump:bb.*]], otherwise: {{bb.*}}]; + // CHECK: switchInt(copy _2) -> [0: [[jump:bb.*]], otherwise: {{bb.*}}]; // CHECK: [[jump]]: { // CHECK-NEXT: _0 = const 3_u32; // CHECK-NEXT: return; diff --git a/tests/mir-opt/building/receiver_ptr_mutability.main.built.after.mir b/tests/mir-opt/building/receiver_ptr_mutability.main.built.after.mir index 1855bb0787d..296d71a319d 100644 --- a/tests/mir-opt/building/receiver_ptr_mutability.main.built.after.mir +++ b/tests/mir-opt/building/receiver_ptr_mutability.main.built.after.mir @@ -38,7 +38,7 @@ fn main() -> () { StorageLive(_2); StorageLive(_3); StorageLive(_4); - _4 = _1; + _4 = copy _1; _3 = move _4 as *const Test (PointerCoercion(MutToConstPointer)); StorageDead(_4); _2 = Test::x(move _3) -> [return: bb2, unwind: bb4]; @@ -63,7 +63,7 @@ fn main() -> () { StorageLive(_10); StorageLive(_11); StorageLive(_12); - _12 = (*(*(*(*_5)))); + _12 = copy (*(*(*(*_5)))); _11 = move _12 as *const Test (PointerCoercion(MutToConstPointer)); StorageDead(_12); _10 = Test::x(move _11) -> [return: bb3, unwind: bb4]; diff --git a/tests/mir-opt/building/shifts.shift_signed.built.after.mir b/tests/mir-opt/building/shifts.shift_signed.built.after.mir index 8706ee9d446..65e2db300cd 100644 --- a/tests/mir-opt/building/shifts.shift_signed.built.after.mir +++ b/tests/mir-opt/building/shifts.shift_signed.built.after.mir @@ -44,12 +44,12 @@ fn shift_signed(_1: i8, _2: u128, _3: i8, _4: i32, _5: i128) -> ([i8; 3], [u128; StorageLive(_6); StorageLive(_7); StorageLive(_8); - _8 = _1; + _8 = copy _1; StorageLive(_9); - _9 = _3; - _10 = _9 as u8 (IntToInt); + _9 = copy _3; + _10 = copy _9 as u8 (IntToInt); _11 = Lt(move _10, const 8_u8); - assert(move _11, "attempt to shift right by `{}`, which would overflow", _9) -> [success: bb1, unwind: bb7]; + assert(move _11, "attempt to shift right by `{}`, which would overflow", copy _9) -> [success: bb1, unwind: bb7]; } bb1: { @@ -58,12 +58,12 @@ fn shift_signed(_1: i8, _2: u128, _3: i8, _4: i32, _5: i128) -> ([i8; 3], [u128; StorageDead(_8); StorageLive(_12); StorageLive(_13); - _13 = _1; + _13 = copy _1; StorageLive(_14); - _14 = _4; - _15 = _14 as u32 (IntToInt); + _14 = copy _4; + _15 = copy _14 as u32 (IntToInt); _16 = Lt(move _15, const 8_u32); - assert(move _16, "attempt to shift right by `{}`, which would overflow", _14) -> [success: bb2, unwind: bb7]; + assert(move _16, "attempt to shift right by `{}`, which would overflow", copy _14) -> [success: bb2, unwind: bb7]; } bb2: { @@ -72,12 +72,12 @@ fn shift_signed(_1: i8, _2: u128, _3: i8, _4: i32, _5: i128) -> ([i8; 3], [u128; StorageDead(_13); StorageLive(_17); StorageLive(_18); - _18 = _1; + _18 = copy _1; StorageLive(_19); - _19 = _5; - _20 = _19 as u128 (IntToInt); + _19 = copy _5; + _20 = copy _19 as u128 (IntToInt); _21 = Lt(move _20, const 8_u128); - assert(move _21, "attempt to shift right by `{}`, which would overflow", _19) -> [success: bb3, unwind: bb7]; + assert(move _21, "attempt to shift right by `{}`, which would overflow", copy _19) -> [success: bb3, unwind: bb7]; } bb3: { @@ -91,12 +91,12 @@ fn shift_signed(_1: i8, _2: u128, _3: i8, _4: i32, _5: i128) -> ([i8; 3], [u128; StorageLive(_22); StorageLive(_23); StorageLive(_24); - _24 = _2; + _24 = copy _2; StorageLive(_25); - _25 = _3; - _26 = _25 as u8 (IntToInt); + _25 = copy _3; + _26 = copy _25 as u8 (IntToInt); _27 = Lt(move _26, const 128_u8); - assert(move _27, "attempt to shift left by `{}`, which would overflow", _25) -> [success: bb4, unwind: bb7]; + assert(move _27, "attempt to shift left by `{}`, which would overflow", copy _25) -> [success: bb4, unwind: bb7]; } bb4: { @@ -105,12 +105,12 @@ fn shift_signed(_1: i8, _2: u128, _3: i8, _4: i32, _5: i128) -> ([i8; 3], [u128; StorageDead(_24); StorageLive(_28); StorageLive(_29); - _29 = _2; + _29 = copy _2; StorageLive(_30); - _30 = _4; - _31 = _30 as u32 (IntToInt); + _30 = copy _4; + _31 = copy _30 as u32 (IntToInt); _32 = Lt(move _31, const 128_u32); - assert(move _32, "attempt to shift left by `{}`, which would overflow", _30) -> [success: bb5, unwind: bb7]; + assert(move _32, "attempt to shift left by `{}`, which would overflow", copy _30) -> [success: bb5, unwind: bb7]; } bb5: { @@ -119,12 +119,12 @@ fn shift_signed(_1: i8, _2: u128, _3: i8, _4: i32, _5: i128) -> ([i8; 3], [u128; StorageDead(_29); StorageLive(_33); StorageLive(_34); - _34 = _2; + _34 = copy _2; StorageLive(_35); - _35 = _5; - _36 = _35 as u128 (IntToInt); + _35 = copy _5; + _36 = copy _35 as u128 (IntToInt); _37 = Lt(move _36, const 128_u128); - assert(move _37, "attempt to shift left by `{}`, which would overflow", _35) -> [success: bb6, unwind: bb7]; + assert(move _37, "attempt to shift left by `{}`, which would overflow", copy _35) -> [success: bb6, unwind: bb7]; } bb6: { diff --git a/tests/mir-opt/building/shifts.shift_unsigned.built.after.mir b/tests/mir-opt/building/shifts.shift_unsigned.built.after.mir index dfd3b5b35ad..62536833e49 100644 --- a/tests/mir-opt/building/shifts.shift_unsigned.built.after.mir +++ b/tests/mir-opt/building/shifts.shift_unsigned.built.after.mir @@ -38,11 +38,11 @@ fn shift_unsigned(_1: u8, _2: i128, _3: u8, _4: u32, _5: u128) -> ([u8; 3], [i12 StorageLive(_6); StorageLive(_7); StorageLive(_8); - _8 = _1; + _8 = copy _1; StorageLive(_9); - _9 = _3; - _10 = Lt(_9, const 8_u8); - assert(move _10, "attempt to shift right by `{}`, which would overflow", _9) -> [success: bb1, unwind: bb7]; + _9 = copy _3; + _10 = Lt(copy _9, const 8_u8); + assert(move _10, "attempt to shift right by `{}`, which would overflow", copy _9) -> [success: bb1, unwind: bb7]; } bb1: { @@ -51,11 +51,11 @@ fn shift_unsigned(_1: u8, _2: i128, _3: u8, _4: u32, _5: u128) -> ([u8; 3], [i12 StorageDead(_8); StorageLive(_11); StorageLive(_12); - _12 = _1; + _12 = copy _1; StorageLive(_13); - _13 = _4; - _14 = Lt(_13, const 8_u32); - assert(move _14, "attempt to shift right by `{}`, which would overflow", _13) -> [success: bb2, unwind: bb7]; + _13 = copy _4; + _14 = Lt(copy _13, const 8_u32); + assert(move _14, "attempt to shift right by `{}`, which would overflow", copy _13) -> [success: bb2, unwind: bb7]; } bb2: { @@ -64,11 +64,11 @@ fn shift_unsigned(_1: u8, _2: i128, _3: u8, _4: u32, _5: u128) -> ([u8; 3], [i12 StorageDead(_12); StorageLive(_15); StorageLive(_16); - _16 = _1; + _16 = copy _1; StorageLive(_17); - _17 = _5; - _18 = Lt(_17, const 8_u128); - assert(move _18, "attempt to shift right by `{}`, which would overflow", _17) -> [success: bb3, unwind: bb7]; + _17 = copy _5; + _18 = Lt(copy _17, const 8_u128); + assert(move _18, "attempt to shift right by `{}`, which would overflow", copy _17) -> [success: bb3, unwind: bb7]; } bb3: { @@ -82,11 +82,11 @@ fn shift_unsigned(_1: u8, _2: i128, _3: u8, _4: u32, _5: u128) -> ([u8; 3], [i12 StorageLive(_19); StorageLive(_20); StorageLive(_21); - _21 = _2; + _21 = copy _2; StorageLive(_22); - _22 = _3; - _23 = Lt(_22, const 128_u8); - assert(move _23, "attempt to shift left by `{}`, which would overflow", _22) -> [success: bb4, unwind: bb7]; + _22 = copy _3; + _23 = Lt(copy _22, const 128_u8); + assert(move _23, "attempt to shift left by `{}`, which would overflow", copy _22) -> [success: bb4, unwind: bb7]; } bb4: { @@ -95,11 +95,11 @@ fn shift_unsigned(_1: u8, _2: i128, _3: u8, _4: u32, _5: u128) -> ([u8; 3], [i12 StorageDead(_21); StorageLive(_24); StorageLive(_25); - _25 = _2; + _25 = copy _2; StorageLive(_26); - _26 = _4; - _27 = Lt(_26, const 128_u32); - assert(move _27, "attempt to shift left by `{}`, which would overflow", _26) -> [success: bb5, unwind: bb7]; + _26 = copy _4; + _27 = Lt(copy _26, const 128_u32); + assert(move _27, "attempt to shift left by `{}`, which would overflow", copy _26) -> [success: bb5, unwind: bb7]; } bb5: { @@ -108,11 +108,11 @@ fn shift_unsigned(_1: u8, _2: i128, _3: u8, _4: u32, _5: u128) -> ([u8; 3], [i12 StorageDead(_25); StorageLive(_28); StorageLive(_29); - _29 = _2; + _29 = copy _2; StorageLive(_30); - _30 = _5; - _31 = Lt(_30, const 128_u128); - assert(move _31, "attempt to shift left by `{}`, which would overflow", _30) -> [success: bb6, unwind: bb7]; + _30 = copy _5; + _31 = Lt(copy _30, const 128_u128); + assert(move _31, "attempt to shift left by `{}`, which would overflow", copy _30) -> [success: bb6, unwind: bb7]; } bb6: { diff --git a/tests/mir-opt/building/while_storage.rs b/tests/mir-opt/building/while_storage.rs index 83095316f00..cd226eb0c1e 100644 --- a/tests/mir-opt/building/while_storage.rs +++ b/tests/mir-opt/building/while_storage.rs @@ -15,7 +15,7 @@ fn while_loop(c: bool) { // CHECK: bb1: { // CHECK-NEXT: StorageLive(_3); // CHECK-NEXT: StorageLive(_2); - // CHECK-NEXT: _2 = _1; + // CHECK-NEXT: _2 = copy _1; // CHECK-NEXT: _3 = get_bool(move _2) -> [return: bb2, unwind // CHECK: bb2: { // CHECK-NEXT: switchInt(move _3) -> [0: bb3, otherwise: bb4]; @@ -29,7 +29,7 @@ fn while_loop(c: bool) { // CHECK-NEXT: StorageDead(_2); // CHECK-NEXT: StorageLive(_5); // CHECK-NEXT: StorageLive(_4); - // CHECK-NEXT: _4 = _1; + // CHECK-NEXT: _4 = copy _1; // CHECK-NEXT: _5 = get_bool(move _4) -> [return: bb5, unwind // CHECK: bb5: { // CHECK-NEXT: switchInt(move _5) -> [0: bb6, otherwise: bb7]; diff --git a/tests/mir-opt/building/while_storage.while_loop.PreCodegen.after.panic-abort.mir b/tests/mir-opt/building/while_storage.while_loop.PreCodegen.after.panic-abort.mir index 26c82edf2d5..44a8b7342b2 100644 --- a/tests/mir-opt/building/while_storage.while_loop.PreCodegen.after.panic-abort.mir +++ b/tests/mir-opt/building/while_storage.while_loop.PreCodegen.after.panic-abort.mir @@ -20,7 +20,7 @@ fn while_loop(_1: bool) -> () { bb1: { StorageLive(_3); StorageLive(_2); - _2 = _1; + _2 = copy _1; _3 = get_bool(move _2) -> [return: bb2, unwind unreachable]; } @@ -40,7 +40,7 @@ fn while_loop(_1: bool) -> () { StorageDead(_2); StorageLive(_5); StorageLive(_4); - _4 = _1; + _4 = copy _1; _5 = get_bool(move _4) -> [return: bb5, unwind unreachable]; } diff --git a/tests/mir-opt/building/while_storage.while_loop.PreCodegen.after.panic-unwind.mir b/tests/mir-opt/building/while_storage.while_loop.PreCodegen.after.panic-unwind.mir index 1bb72074846..9a640300674 100644 --- a/tests/mir-opt/building/while_storage.while_loop.PreCodegen.after.panic-unwind.mir +++ b/tests/mir-opt/building/while_storage.while_loop.PreCodegen.after.panic-unwind.mir @@ -20,7 +20,7 @@ fn while_loop(_1: bool) -> () { bb1: { StorageLive(_3); StorageLive(_2); - _2 = _1; + _2 = copy _1; _3 = get_bool(move _2) -> [return: bb2, unwind continue]; } @@ -40,7 +40,7 @@ fn while_loop(_1: bool) -> () { StorageDead(_2); StorageLive(_5); StorageLive(_4); - _4 = _1; + _4 = copy _1; _5 = get_bool(move _4) -> [return: bb5, unwind continue]; } diff --git a/tests/mir-opt/const_allocation.main.GVN.after.32bit.mir b/tests/mir-opt/const_allocation.main.GVN.after.32bit.mir index 10d99a13463..a2bd2bc0d92 100644 --- a/tests/mir-opt/const_allocation.main.GVN.after.32bit.mir +++ b/tests/mir-opt/const_allocation.main.GVN.after.32bit.mir @@ -9,7 +9,7 @@ fn main() -> () { StorageLive(_1); StorageLive(_2); _2 = const {ALLOC9: &&[(Option<i32>, &[&str])]}; - _1 = (*_2); + _1 = copy (*_2); StorageDead(_2); StorageDead(_1); _0 = const (); diff --git a/tests/mir-opt/const_allocation.main.GVN.after.64bit.mir b/tests/mir-opt/const_allocation.main.GVN.after.64bit.mir index 2f23dbe9ee4..a431104d08b 100644 --- a/tests/mir-opt/const_allocation.main.GVN.after.64bit.mir +++ b/tests/mir-opt/const_allocation.main.GVN.after.64bit.mir @@ -9,7 +9,7 @@ fn main() -> () { StorageLive(_1); StorageLive(_2); _2 = const {ALLOC9: &&[(Option<i32>, &[&str])]}; - _1 = (*_2); + _1 = copy (*_2); StorageDead(_2); StorageDead(_1); _0 = const (); diff --git a/tests/mir-opt/const_allocation2.main.GVN.after.32bit.mir b/tests/mir-opt/const_allocation2.main.GVN.after.32bit.mir index 6499e3676aa..6fae163f107 100644 --- a/tests/mir-opt/const_allocation2.main.GVN.after.32bit.mir +++ b/tests/mir-opt/const_allocation2.main.GVN.after.32bit.mir @@ -9,7 +9,7 @@ fn main() -> () { StorageLive(_1); StorageLive(_2); _2 = const {ALLOC9: &&[(Option<i32>, &[&u8])]}; - _1 = (*_2); + _1 = copy (*_2); StorageDead(_2); StorageDead(_1); _0 = const (); diff --git a/tests/mir-opt/const_allocation2.main.GVN.after.64bit.mir b/tests/mir-opt/const_allocation2.main.GVN.after.64bit.mir index 02f5ebab847..f2bb5f46b16 100644 --- a/tests/mir-opt/const_allocation2.main.GVN.after.64bit.mir +++ b/tests/mir-opt/const_allocation2.main.GVN.after.64bit.mir @@ -9,7 +9,7 @@ fn main() -> () { StorageLive(_1); StorageLive(_2); _2 = const {ALLOC9: &&[(Option<i32>, &[&u8])]}; - _1 = (*_2); + _1 = copy (*_2); StorageDead(_2); StorageDead(_1); _0 = const (); diff --git a/tests/mir-opt/const_allocation3.main.GVN.after.32bit.mir b/tests/mir-opt/const_allocation3.main.GVN.after.32bit.mir index c95e696946a..58776b446fa 100644 --- a/tests/mir-opt/const_allocation3.main.GVN.after.32bit.mir +++ b/tests/mir-opt/const_allocation3.main.GVN.after.32bit.mir @@ -9,7 +9,7 @@ fn main() -> () { StorageLive(_1); StorageLive(_2); _2 = const {ALLOC4: &&Packed}; - _1 = (*_2); + _1 = copy (*_2); StorageDead(_2); StorageDead(_1); _0 = const (); diff --git a/tests/mir-opt/const_allocation3.main.GVN.after.64bit.mir b/tests/mir-opt/const_allocation3.main.GVN.after.64bit.mir index 198bc8bd07e..3ccf4211971 100644 --- a/tests/mir-opt/const_allocation3.main.GVN.after.64bit.mir +++ b/tests/mir-opt/const_allocation3.main.GVN.after.64bit.mir @@ -9,7 +9,7 @@ fn main() -> () { StorageLive(_1); StorageLive(_2); _2 = const {ALLOC2: &&Packed}; - _1 = (*_2); + _1 = copy (*_2); StorageDead(_2); StorageDead(_1); _0 = const (); diff --git a/tests/mir-opt/const_goto_const_eval_fail.f.JumpThreading.diff b/tests/mir-opt/const_goto_const_eval_fail.f.JumpThreading.diff index 4fc9254b7ba..086abeba0f8 100644 --- a/tests/mir-opt/const_goto_const_eval_fail.f.JumpThreading.diff +++ b/tests/mir-opt/const_goto_const_eval_fail.f.JumpThreading.diff @@ -22,7 +22,7 @@ } bb3: { - switchInt(_1) -> [0: bb5, otherwise: bb4]; + switchInt(copy _1) -> [0: bb5, otherwise: bb4]; } bb4: { diff --git a/tests/mir-opt/const_prop/address_of_pair.fn0.GVN.diff b/tests/mir-opt/const_prop/address_of_pair.fn0.GVN.diff index ac372f83726..e33185f17bc 100644 --- a/tests/mir-opt/const_prop/address_of_pair.fn0.GVN.diff +++ b/tests/mir-opt/const_prop/address_of_pair.fn0.GVN.diff @@ -34,10 +34,10 @@ - StorageLive(_5); + nop; StorageLive(_6); - _6 = (_2.1: bool); + _6 = copy (_2.1: bool); _5 = Not(move _6); StorageDead(_6); - _0 = _5; + _0 = copy _5; - StorageDead(_5); + nop; StorageDead(_3); diff --git a/tests/mir-opt/const_prop/address_of_pair.rs b/tests/mir-opt/const_prop/address_of_pair.rs index 9acaaa0ccaf..df1ab229d6e 100644 --- a/tests/mir-opt/const_prop/address_of_pair.rs +++ b/tests/mir-opt/const_prop/address_of_pair.rs @@ -10,13 +10,13 @@ pub fn fn0() -> bool { // CHECK: (*[[ptr]]) = const true; // CHECK-NOT: = const false; // CHECK-NOT: = const true; - // CHECK: [[tmp:_.*]] = ([[pair]].1: bool); + // CHECK: [[tmp:_.*]] = copy ([[pair]].1: bool); // CHECK-NOT: = const false; // CHECK-NOT: = const true; // CHECK: [[ret]] = Not(move [[tmp]]); // CHECK-NOT: = const false; // CHECK-NOT: = const true; - // CHECK: _0 = [[ret]]; + // CHECK: _0 = copy [[ret]]; let mut pair = (1, false); let ptr = core::ptr::addr_of_mut!(pair.1); pair = (1, false); diff --git a/tests/mir-opt/const_prop/aggregate.foo.GVN.panic-abort.diff b/tests/mir-opt/const_prop/aggregate.foo.GVN.panic-abort.diff index 4f0f7fa8fa2..c6d3bad0790 100644 --- a/tests/mir-opt/const_prop/aggregate.foo.GVN.panic-abort.diff +++ b/tests/mir-opt/const_prop/aggregate.foo.GVN.panic-abort.diff @@ -24,11 +24,11 @@ StorageLive(_3); StorageLive(_4); StorageLive(_5); - _5 = _1; + _5 = copy _1; - _4 = (const 0_i32, move _5); -+ _4 = (const 0_i32, _1); ++ _4 = (const 0_i32, copy _1); StorageDead(_5); -- _3 = (_4.0: i32); +- _3 = copy (_4.0: i32); - _2 = Add(move _3, const 1_i32); + _3 = const 0_i32; + _2 = const 1_i32; @@ -38,11 +38,11 @@ StorageLive(_7); StorageLive(_8); StorageLive(_9); - _9 = _1; + _9 = copy _1; - _8 = (move _9, const 1_i32); -+ _8 = (_1, const 1_i32); ++ _8 = (copy _1, const 1_i32); StorageDead(_9); -- _7 = (_8.1: i32); +- _7 = copy (_8.1: i32); - _6 = Add(move _7, const 2_i32); + _7 = const 1_i32; + _6 = const 3_i32; diff --git a/tests/mir-opt/const_prop/aggregate.foo.GVN.panic-unwind.diff b/tests/mir-opt/const_prop/aggregate.foo.GVN.panic-unwind.diff index 4f0f7fa8fa2..c6d3bad0790 100644 --- a/tests/mir-opt/const_prop/aggregate.foo.GVN.panic-unwind.diff +++ b/tests/mir-opt/const_prop/aggregate.foo.GVN.panic-unwind.diff @@ -24,11 +24,11 @@ StorageLive(_3); StorageLive(_4); StorageLive(_5); - _5 = _1; + _5 = copy _1; - _4 = (const 0_i32, move _5); -+ _4 = (const 0_i32, _1); ++ _4 = (const 0_i32, copy _1); StorageDead(_5); -- _3 = (_4.0: i32); +- _3 = copy (_4.0: i32); - _2 = Add(move _3, const 1_i32); + _3 = const 0_i32; + _2 = const 1_i32; @@ -38,11 +38,11 @@ StorageLive(_7); StorageLive(_8); StorageLive(_9); - _9 = _1; + _9 = copy _1; - _8 = (move _9, const 1_i32); -+ _8 = (_1, const 1_i32); ++ _8 = (copy _1, const 1_i32); StorageDead(_9); -- _7 = (_8.1: i32); +- _7 = copy (_8.1: i32); - _6 = Add(move _7, const 2_i32); + _7 = const 1_i32; + _6 = const 3_i32; diff --git a/tests/mir-opt/const_prop/aggregate.main.GVN.panic-abort.diff b/tests/mir-opt/const_prop/aggregate.main.GVN.panic-abort.diff index 854e27445af..0a59c59c2ed 100644 --- a/tests/mir-opt/const_prop/aggregate.main.GVN.panic-abort.diff +++ b/tests/mir-opt/const_prop/aggregate.main.GVN.panic-abort.diff @@ -18,7 +18,7 @@ StorageLive(_2); StorageLive(_3); _3 = (const 0_i32, const 1_u8, const 2_i32); -- _2 = (_3.1: u8); +- _2 = copy (_3.1: u8); - _1 = Add(move _2, const 0_u8); + _2 = const 1_u8; + _1 = const 1_u8; @@ -26,7 +26,7 @@ StorageDead(_3); StorageLive(_4); StorageLive(_5); -- _5 = _1; +- _5 = copy _1; - _4 = foo(move _5) -> [return: bb1, unwind unreachable]; + _5 = const 1_u8; + _4 = foo(const 1_u8) -> [return: bb1, unwind unreachable]; diff --git a/tests/mir-opt/const_prop/aggregate.main.GVN.panic-unwind.diff b/tests/mir-opt/const_prop/aggregate.main.GVN.panic-unwind.diff index f6c4b2c9240..100369a2eee 100644 --- a/tests/mir-opt/const_prop/aggregate.main.GVN.panic-unwind.diff +++ b/tests/mir-opt/const_prop/aggregate.main.GVN.panic-unwind.diff @@ -18,7 +18,7 @@ StorageLive(_2); StorageLive(_3); _3 = (const 0_i32, const 1_u8, const 2_i32); -- _2 = (_3.1: u8); +- _2 = copy (_3.1: u8); - _1 = Add(move _2, const 0_u8); + _2 = const 1_u8; + _1 = const 1_u8; @@ -26,7 +26,7 @@ StorageDead(_3); StorageLive(_4); StorageLive(_5); -- _5 = _1; +- _5 = copy _1; - _4 = foo(move _5) -> [return: bb1, unwind continue]; + _5 = const 1_u8; + _4 = foo(const 1_u8) -> [return: bb1, unwind continue]; diff --git a/tests/mir-opt/const_prop/array_index.main.GVN.32bit.panic-abort.diff b/tests/mir-opt/const_prop/array_index.main.GVN.32bit.panic-abort.diff index 6d00dd5b212..e754af95ce3 100644 --- a/tests/mir-opt/const_prop/array_index.main.GVN.32bit.panic-abort.diff +++ b/tests/mir-opt/const_prop/array_index.main.GVN.32bit.panic-abort.diff @@ -19,15 +19,15 @@ StorageLive(_3); _3 = const 2_usize; - _4 = Len(_2); -- _5 = Lt(_3, _4); -- assert(move _5, "index out of bounds: the length is {} but the index is {}", move _4, _3) -> [success: bb1, unwind unreachable]; +- _5 = Lt(copy _3, copy _4); +- assert(move _5, "index out of bounds: the length is {} but the index is {}", move _4, copy _3) -> [success: bb1, unwind unreachable]; + _4 = const 4_usize; + _5 = const true; + assert(const true, "index out of bounds: the length is {} but the index is {}", const 4_usize, const 2_usize) -> [success: bb1, unwind unreachable]; } bb1: { -- _1 = _2[_3]; +- _1 = copy _2[_3]; + _1 = const 2_u32; StorageDead(_3); StorageDead(_2); diff --git a/tests/mir-opt/const_prop/array_index.main.GVN.32bit.panic-unwind.diff b/tests/mir-opt/const_prop/array_index.main.GVN.32bit.panic-unwind.diff index 7e2f72ab31b..e15a35c7fe9 100644 --- a/tests/mir-opt/const_prop/array_index.main.GVN.32bit.panic-unwind.diff +++ b/tests/mir-opt/const_prop/array_index.main.GVN.32bit.panic-unwind.diff @@ -19,15 +19,15 @@ StorageLive(_3); _3 = const 2_usize; - _4 = Len(_2); -- _5 = Lt(_3, _4); -- assert(move _5, "index out of bounds: the length is {} but the index is {}", move _4, _3) -> [success: bb1, unwind continue]; +- _5 = Lt(copy _3, copy _4); +- assert(move _5, "index out of bounds: the length is {} but the index is {}", move _4, copy _3) -> [success: bb1, unwind continue]; + _4 = const 4_usize; + _5 = const true; + assert(const true, "index out of bounds: the length is {} but the index is {}", const 4_usize, const 2_usize) -> [success: bb1, unwind continue]; } bb1: { -- _1 = _2[_3]; +- _1 = copy _2[_3]; + _1 = const 2_u32; StorageDead(_3); StorageDead(_2); diff --git a/tests/mir-opt/const_prop/array_index.main.GVN.64bit.panic-abort.diff b/tests/mir-opt/const_prop/array_index.main.GVN.64bit.panic-abort.diff index 6d00dd5b212..e754af95ce3 100644 --- a/tests/mir-opt/const_prop/array_index.main.GVN.64bit.panic-abort.diff +++ b/tests/mir-opt/const_prop/array_index.main.GVN.64bit.panic-abort.diff @@ -19,15 +19,15 @@ StorageLive(_3); _3 = const 2_usize; - _4 = Len(_2); -- _5 = Lt(_3, _4); -- assert(move _5, "index out of bounds: the length is {} but the index is {}", move _4, _3) -> [success: bb1, unwind unreachable]; +- _5 = Lt(copy _3, copy _4); +- assert(move _5, "index out of bounds: the length is {} but the index is {}", move _4, copy _3) -> [success: bb1, unwind unreachable]; + _4 = const 4_usize; + _5 = const true; + assert(const true, "index out of bounds: the length is {} but the index is {}", const 4_usize, const 2_usize) -> [success: bb1, unwind unreachable]; } bb1: { -- _1 = _2[_3]; +- _1 = copy _2[_3]; + _1 = const 2_u32; StorageDead(_3); StorageDead(_2); diff --git a/tests/mir-opt/const_prop/array_index.main.GVN.64bit.panic-unwind.diff b/tests/mir-opt/const_prop/array_index.main.GVN.64bit.panic-unwind.diff index 7e2f72ab31b..e15a35c7fe9 100644 --- a/tests/mir-opt/const_prop/array_index.main.GVN.64bit.panic-unwind.diff +++ b/tests/mir-opt/const_prop/array_index.main.GVN.64bit.panic-unwind.diff @@ -19,15 +19,15 @@ StorageLive(_3); _3 = const 2_usize; - _4 = Len(_2); -- _5 = Lt(_3, _4); -- assert(move _5, "index out of bounds: the length is {} but the index is {}", move _4, _3) -> [success: bb1, unwind continue]; +- _5 = Lt(copy _3, copy _4); +- assert(move _5, "index out of bounds: the length is {} but the index is {}", move _4, copy _3) -> [success: bb1, unwind continue]; + _4 = const 4_usize; + _5 = const true; + assert(const true, "index out of bounds: the length is {} but the index is {}", const 4_usize, const 2_usize) -> [success: bb1, unwind continue]; } bb1: { -- _1 = _2[_3]; +- _1 = copy _2[_3]; + _1 = const 2_u32; StorageDead(_3); StorageDead(_2); diff --git a/tests/mir-opt/const_prop/bad_op_div_by_zero.main.GVN.panic-abort.diff b/tests/mir-opt/const_prop/bad_op_div_by_zero.main.GVN.panic-abort.diff index 4838efba6f9..8c535b567c3 100644 --- a/tests/mir-opt/const_prop/bad_op_div_by_zero.main.GVN.panic-abort.diff +++ b/tests/mir-opt/const_prop/bad_op_div_by_zero.main.GVN.panic-abort.diff @@ -23,8 +23,8 @@ _1 = const 0_i32; StorageLive(_2); StorageLive(_3); -- _3 = _1; -- _4 = Eq(_3, const 0_i32); +- _3 = copy _1; +- _4 = Eq(copy _3, const 0_i32); - assert(!move _4, "attempt to divide `{}` by zero", const 1_i32) -> [success: bb1, unwind unreachable]; + _3 = const 0_i32; + _4 = const true; @@ -32,10 +32,10 @@ } bb1: { -- _5 = Eq(_3, const -1_i32); +- _5 = Eq(copy _3, const -1_i32); - _6 = Eq(const 1_i32, const i32::MIN); - _7 = BitAnd(move _5, move _6); -- assert(!move _7, "attempt to compute `{} / {}`, which would overflow", const 1_i32, _3) -> [success: bb2, unwind unreachable]; +- assert(!move _7, "attempt to compute `{} / {}`, which would overflow", const 1_i32, copy _3) -> [success: bb2, unwind unreachable]; + _5 = const false; + _6 = const false; + _7 = const false; diff --git a/tests/mir-opt/const_prop/bad_op_div_by_zero.main.GVN.panic-unwind.diff b/tests/mir-opt/const_prop/bad_op_div_by_zero.main.GVN.panic-unwind.diff index 7f403d6efc1..045f4d81db6 100644 --- a/tests/mir-opt/const_prop/bad_op_div_by_zero.main.GVN.panic-unwind.diff +++ b/tests/mir-opt/const_prop/bad_op_div_by_zero.main.GVN.panic-unwind.diff @@ -23,8 +23,8 @@ _1 = const 0_i32; StorageLive(_2); StorageLive(_3); -- _3 = _1; -- _4 = Eq(_3, const 0_i32); +- _3 = copy _1; +- _4 = Eq(copy _3, const 0_i32); - assert(!move _4, "attempt to divide `{}` by zero", const 1_i32) -> [success: bb1, unwind continue]; + _3 = const 0_i32; + _4 = const true; @@ -32,10 +32,10 @@ } bb1: { -- _5 = Eq(_3, const -1_i32); +- _5 = Eq(copy _3, const -1_i32); - _6 = Eq(const 1_i32, const i32::MIN); - _7 = BitAnd(move _5, move _6); -- assert(!move _7, "attempt to compute `{} / {}`, which would overflow", const 1_i32, _3) -> [success: bb2, unwind continue]; +- assert(!move _7, "attempt to compute `{} / {}`, which would overflow", const 1_i32, copy _3) -> [success: bb2, unwind continue]; + _5 = const false; + _6 = const false; + _7 = const false; diff --git a/tests/mir-opt/const_prop/bad_op_mod_by_zero.main.GVN.panic-abort.diff b/tests/mir-opt/const_prop/bad_op_mod_by_zero.main.GVN.panic-abort.diff index 59f2eb86f50..e5a8726b855 100644 --- a/tests/mir-opt/const_prop/bad_op_mod_by_zero.main.GVN.panic-abort.diff +++ b/tests/mir-opt/const_prop/bad_op_mod_by_zero.main.GVN.panic-abort.diff @@ -23,8 +23,8 @@ _1 = const 0_i32; StorageLive(_2); StorageLive(_3); -- _3 = _1; -- _4 = Eq(_3, const 0_i32); +- _3 = copy _1; +- _4 = Eq(copy _3, const 0_i32); - assert(!move _4, "attempt to calculate the remainder of `{}` with a divisor of zero", const 1_i32) -> [success: bb1, unwind unreachable]; + _3 = const 0_i32; + _4 = const true; @@ -32,10 +32,10 @@ } bb1: { -- _5 = Eq(_3, const -1_i32); +- _5 = Eq(copy _3, const -1_i32); - _6 = Eq(const 1_i32, const i32::MIN); - _7 = BitAnd(move _5, move _6); -- assert(!move _7, "attempt to compute the remainder of `{} % {}`, which would overflow", const 1_i32, _3) -> [success: bb2, unwind unreachable]; +- assert(!move _7, "attempt to compute the remainder of `{} % {}`, which would overflow", const 1_i32, copy _3) -> [success: bb2, unwind unreachable]; + _5 = const false; + _6 = const false; + _7 = const false; diff --git a/tests/mir-opt/const_prop/bad_op_mod_by_zero.main.GVN.panic-unwind.diff b/tests/mir-opt/const_prop/bad_op_mod_by_zero.main.GVN.panic-unwind.diff index 9b866082788..1110ff186dc 100644 --- a/tests/mir-opt/const_prop/bad_op_mod_by_zero.main.GVN.panic-unwind.diff +++ b/tests/mir-opt/const_prop/bad_op_mod_by_zero.main.GVN.panic-unwind.diff @@ -23,8 +23,8 @@ _1 = const 0_i32; StorageLive(_2); StorageLive(_3); -- _3 = _1; -- _4 = Eq(_3, const 0_i32); +- _3 = copy _1; +- _4 = Eq(copy _3, const 0_i32); - assert(!move _4, "attempt to calculate the remainder of `{}` with a divisor of zero", const 1_i32) -> [success: bb1, unwind continue]; + _3 = const 0_i32; + _4 = const true; @@ -32,10 +32,10 @@ } bb1: { -- _5 = Eq(_3, const -1_i32); +- _5 = Eq(copy _3, const -1_i32); - _6 = Eq(const 1_i32, const i32::MIN); - _7 = BitAnd(move _5, move _6); -- assert(!move _7, "attempt to compute the remainder of `{} % {}`, which would overflow", const 1_i32, _3) -> [success: bb2, unwind continue]; +- assert(!move _7, "attempt to compute the remainder of `{} % {}`, which would overflow", const 1_i32, copy _3) -> [success: bb2, unwind continue]; + _5 = const false; + _6 = const false; + _7 = const false; diff --git a/tests/mir-opt/const_prop/bad_op_unsafe_oob_for_slices.main.GVN.32bit.panic-abort.diff b/tests/mir-opt/const_prop/bad_op_unsafe_oob_for_slices.main.GVN.32bit.panic-abort.diff index 826f4c34277..52aa4da49ef 100644 --- a/tests/mir-opt/const_prop/bad_op_unsafe_oob_for_slices.main.GVN.32bit.panic-abort.diff +++ b/tests/mir-opt/const_prop/bad_op_unsafe_oob_for_slices.main.GVN.32bit.panic-abort.diff @@ -33,15 +33,15 @@ StorageLive(_6); _6 = const 3_usize; _7 = Len((*_1)); -- _8 = Lt(_6, _7); -- assert(move _8, "index out of bounds: the length is {} but the index is {}", move _7, _6) -> [success: bb1, unwind unreachable]; -+ _8 = Lt(const 3_usize, _7); +- _8 = Lt(copy _6, copy _7); +- assert(move _8, "index out of bounds: the length is {} but the index is {}", move _7, copy _6) -> [success: bb1, unwind unreachable]; ++ _8 = Lt(const 3_usize, copy _7); + assert(move _8, "index out of bounds: the length is {} but the index is {}", move _7, const 3_usize) -> [success: bb1, unwind unreachable]; } bb1: { -- _5 = (*_1)[_6]; -+ _5 = (*_1)[3 of 4]; +- _5 = copy (*_1)[_6]; ++ _5 = copy (*_1)[3 of 4]; StorageDead(_6); _0 = const (); StorageDead(_5); diff --git a/tests/mir-opt/const_prop/bad_op_unsafe_oob_for_slices.main.GVN.32bit.panic-unwind.diff b/tests/mir-opt/const_prop/bad_op_unsafe_oob_for_slices.main.GVN.32bit.panic-unwind.diff index 0e2ec65652f..242ff0e664f 100644 --- a/tests/mir-opt/const_prop/bad_op_unsafe_oob_for_slices.main.GVN.32bit.panic-unwind.diff +++ b/tests/mir-opt/const_prop/bad_op_unsafe_oob_for_slices.main.GVN.32bit.panic-unwind.diff @@ -33,15 +33,15 @@ StorageLive(_6); _6 = const 3_usize; _7 = Len((*_1)); -- _8 = Lt(_6, _7); -- assert(move _8, "index out of bounds: the length is {} but the index is {}", move _7, _6) -> [success: bb1, unwind continue]; -+ _8 = Lt(const 3_usize, _7); +- _8 = Lt(copy _6, copy _7); +- assert(move _8, "index out of bounds: the length is {} but the index is {}", move _7, copy _6) -> [success: bb1, unwind continue]; ++ _8 = Lt(const 3_usize, copy _7); + assert(move _8, "index out of bounds: the length is {} but the index is {}", move _7, const 3_usize) -> [success: bb1, unwind continue]; } bb1: { -- _5 = (*_1)[_6]; -+ _5 = (*_1)[3 of 4]; +- _5 = copy (*_1)[_6]; ++ _5 = copy (*_1)[3 of 4]; StorageDead(_6); _0 = const (); StorageDead(_5); diff --git a/tests/mir-opt/const_prop/bad_op_unsafe_oob_for_slices.main.GVN.64bit.panic-abort.diff b/tests/mir-opt/const_prop/bad_op_unsafe_oob_for_slices.main.GVN.64bit.panic-abort.diff index 826f4c34277..52aa4da49ef 100644 --- a/tests/mir-opt/const_prop/bad_op_unsafe_oob_for_slices.main.GVN.64bit.panic-abort.diff +++ b/tests/mir-opt/const_prop/bad_op_unsafe_oob_for_slices.main.GVN.64bit.panic-abort.diff @@ -33,15 +33,15 @@ StorageLive(_6); _6 = const 3_usize; _7 = Len((*_1)); -- _8 = Lt(_6, _7); -- assert(move _8, "index out of bounds: the length is {} but the index is {}", move _7, _6) -> [success: bb1, unwind unreachable]; -+ _8 = Lt(const 3_usize, _7); +- _8 = Lt(copy _6, copy _7); +- assert(move _8, "index out of bounds: the length is {} but the index is {}", move _7, copy _6) -> [success: bb1, unwind unreachable]; ++ _8 = Lt(const 3_usize, copy _7); + assert(move _8, "index out of bounds: the length is {} but the index is {}", move _7, const 3_usize) -> [success: bb1, unwind unreachable]; } bb1: { -- _5 = (*_1)[_6]; -+ _5 = (*_1)[3 of 4]; +- _5 = copy (*_1)[_6]; ++ _5 = copy (*_1)[3 of 4]; StorageDead(_6); _0 = const (); StorageDead(_5); diff --git a/tests/mir-opt/const_prop/bad_op_unsafe_oob_for_slices.main.GVN.64bit.panic-unwind.diff b/tests/mir-opt/const_prop/bad_op_unsafe_oob_for_slices.main.GVN.64bit.panic-unwind.diff index 0e2ec65652f..242ff0e664f 100644 --- a/tests/mir-opt/const_prop/bad_op_unsafe_oob_for_slices.main.GVN.64bit.panic-unwind.diff +++ b/tests/mir-opt/const_prop/bad_op_unsafe_oob_for_slices.main.GVN.64bit.panic-unwind.diff @@ -33,15 +33,15 @@ StorageLive(_6); _6 = const 3_usize; _7 = Len((*_1)); -- _8 = Lt(_6, _7); -- assert(move _8, "index out of bounds: the length is {} but the index is {}", move _7, _6) -> [success: bb1, unwind continue]; -+ _8 = Lt(const 3_usize, _7); +- _8 = Lt(copy _6, copy _7); +- assert(move _8, "index out of bounds: the length is {} but the index is {}", move _7, copy _6) -> [success: bb1, unwind continue]; ++ _8 = Lt(const 3_usize, copy _7); + assert(move _8, "index out of bounds: the length is {} but the index is {}", move _7, const 3_usize) -> [success: bb1, unwind continue]; } bb1: { -- _5 = (*_1)[_6]; -+ _5 = (*_1)[3 of 4]; +- _5 = copy (*_1)[_6]; ++ _5 = copy (*_1)[3 of 4]; StorageDead(_6); _0 = const (); StorageDead(_5); diff --git a/tests/mir-opt/const_prop/bad_op_unsafe_oob_for_slices.rs b/tests/mir-opt/const_prop/bad_op_unsafe_oob_for_slices.rs index 0f8d278535d..139d0fa2e0f 100644 --- a/tests/mir-opt/const_prop/bad_op_unsafe_oob_for_slices.rs +++ b/tests/mir-opt/const_prop/bad_op_unsafe_oob_for_slices.rs @@ -8,7 +8,7 @@ fn main() { // CHECK-LABEL: fn main( // CHECK: debug a => [[a:_.*]]; // CHECK: debug _b => [[b:_.*]]; - // CHECK: [[b]] = (*[[a]])[3 of 4]; + // CHECK: [[b]] = copy (*[[a]])[3 of 4]; let a: *const [_] = &[1, 2, 3]; unsafe { let _b = (*a)[3]; diff --git a/tests/mir-opt/const_prop/boolean_identities.test.GVN.diff b/tests/mir-opt/const_prop/boolean_identities.test.GVN.diff index 0bd8413289e..3fe70302b21 100644 --- a/tests/mir-opt/const_prop/boolean_identities.test.GVN.diff +++ b/tests/mir-opt/const_prop/boolean_identities.test.GVN.diff @@ -22,22 +22,22 @@ - StorageLive(_3); + nop; StorageLive(_4); - _4 = _2; + _4 = copy _2; - _3 = BitOr(move _4, const true); + _3 = const true; StorageDead(_4); - StorageLive(_5); + nop; StorageLive(_6); - _6 = _1; + _6 = copy _1; - _5 = BitAnd(move _6, const false); + _5 = const false; StorageDead(_6); StorageLive(_7); -- _7 = _3; +- _7 = copy _3; + _7 = const true; StorageLive(_8); -- _8 = _5; +- _8 = copy _5; - _0 = BitAnd(move _7, move _8); + _8 = const false; + _0 = const false; diff --git a/tests/mir-opt/const_prop/boxes.main.GVN.panic-abort.diff b/tests/mir-opt/const_prop/boxes.main.GVN.panic-abort.diff index a408c197fd1..d5f15b750d4 100644 --- a/tests/mir-opt/const_prop/boxes.main.GVN.panic-abort.diff +++ b/tests/mir-opt/const_prop/boxes.main.GVN.panic-abort.diff @@ -32,15 +32,15 @@ bb1: { StorageLive(_7); _7 = ShallowInitBox(move _6, i32); - _8 = (((_7.0: std::ptr::Unique<i32>).0: std::ptr::NonNull<i32>).0: *const i32); + _8 = copy (((_7.0: std::ptr::Unique<i32>).0: std::ptr::NonNull<i32>).0: *const i32); (*_8) = const 42_i32; _3 = move _7; StorageDead(_7); - _9 = (((_3.0: std::ptr::Unique<i32>).0: std::ptr::NonNull<i32>).0: *const i32); - _2 = (*_9); + _9 = copy (((_3.0: std::ptr::Unique<i32>).0: std::ptr::NonNull<i32>).0: *const i32); + _2 = copy (*_9); - _1 = Add(move _2, const 0_i32); - StorageDead(_2); -+ _1 = _2; ++ _1 = copy _2; + nop; drop(_3) -> [return: bb2, unwind unreachable]; } diff --git a/tests/mir-opt/const_prop/boxes.main.GVN.panic-unwind.diff b/tests/mir-opt/const_prop/boxes.main.GVN.panic-unwind.diff index 5706a739602..d4d4f21be6e 100644 --- a/tests/mir-opt/const_prop/boxes.main.GVN.panic-unwind.diff +++ b/tests/mir-opt/const_prop/boxes.main.GVN.panic-unwind.diff @@ -32,15 +32,15 @@ bb1: { StorageLive(_7); _7 = ShallowInitBox(move _6, i32); - _8 = (((_7.0: std::ptr::Unique<i32>).0: std::ptr::NonNull<i32>).0: *const i32); + _8 = copy (((_7.0: std::ptr::Unique<i32>).0: std::ptr::NonNull<i32>).0: *const i32); (*_8) = const 42_i32; _3 = move _7; StorageDead(_7); - _9 = (((_3.0: std::ptr::Unique<i32>).0: std::ptr::NonNull<i32>).0: *const i32); - _2 = (*_9); + _9 = copy (((_3.0: std::ptr::Unique<i32>).0: std::ptr::NonNull<i32>).0: *const i32); + _2 = copy (*_9); - _1 = Add(move _2, const 0_i32); - StorageDead(_2); -+ _1 = _2; ++ _1 = copy _2; + nop; drop(_3) -> [return: bb2, unwind: bb3]; } diff --git a/tests/mir-opt/const_prop/boxes.rs b/tests/mir-opt/const_prop/boxes.rs index 7813352261e..f04db260e27 100644 --- a/tests/mir-opt/const_prop/boxes.rs +++ b/tests/mir-opt/const_prop/boxes.rs @@ -11,8 +11,8 @@ fn main() { // CHECK-LABEL: fn main( // CHECK: debug x => [[x:_.*]]; // CHECK: (*{{_.*}}) = const 42_i32; - // CHECK: [[tmp:_.*]] = (*{{_.*}}); - // CHECK: [[x]] = [[tmp]]; + // CHECK: [[tmp:_.*]] = copy (*{{_.*}}); + // CHECK: [[x]] = copy [[tmp]]; let x = *(#[rustc_box] Box::new(42)) + 0; diff --git a/tests/mir-opt/const_prop/discriminant.main.GVN.32bit.diff b/tests/mir-opt/const_prop/discriminant.main.GVN.32bit.diff index 70c3c3fe7e4..2543cf6257d 100644 --- a/tests/mir-opt/const_prop/discriminant.main.GVN.32bit.diff +++ b/tests/mir-opt/const_prop/discriminant.main.GVN.32bit.diff @@ -26,7 +26,7 @@ } bb1: { -- switchInt(((_3 as Some).0: bool)) -> [0: bb3, otherwise: bb2]; +- switchInt(copy ((_3 as Some).0: bool)) -> [0: bb3, otherwise: bb2]; + switchInt(const true) -> [0: bb3, otherwise: bb2]; } diff --git a/tests/mir-opt/const_prop/discriminant.main.GVN.64bit.diff b/tests/mir-opt/const_prop/discriminant.main.GVN.64bit.diff index 70c3c3fe7e4..2543cf6257d 100644 --- a/tests/mir-opt/const_prop/discriminant.main.GVN.64bit.diff +++ b/tests/mir-opt/const_prop/discriminant.main.GVN.64bit.diff @@ -26,7 +26,7 @@ } bb1: { -- switchInt(((_3 as Some).0: bool)) -> [0: bb3, otherwise: bb2]; +- switchInt(copy ((_3 as Some).0: bool)) -> [0: bb3, otherwise: bb2]; + switchInt(const true) -> [0: bb3, otherwise: bb2]; } diff --git a/tests/mir-opt/const_prop/indirect.main.GVN.panic-abort.diff b/tests/mir-opt/const_prop/indirect.main.GVN.panic-abort.diff index f24b9755eae..208845942c7 100644 --- a/tests/mir-opt/const_prop/indirect.main.GVN.panic-abort.diff +++ b/tests/mir-opt/const_prop/indirect.main.GVN.panic-abort.diff @@ -14,7 +14,7 @@ StorageLive(_1); StorageLive(_2); - _2 = const 2_u32 as u8 (IntToInt); -- _3 = AddWithOverflow(_2, const 1_u8); +- _3 = AddWithOverflow(copy _2, const 1_u8); - assert(!move (_3.1: bool), "attempt to compute `{} + {}`, which would overflow", move _2, const 1_u8) -> [success: bb1, unwind unreachable]; + _2 = const 2_u8; + _3 = const (3_u8, false); diff --git a/tests/mir-opt/const_prop/indirect.main.GVN.panic-unwind.diff b/tests/mir-opt/const_prop/indirect.main.GVN.panic-unwind.diff index 44ff313b532..4a7c69bae3c 100644 --- a/tests/mir-opt/const_prop/indirect.main.GVN.panic-unwind.diff +++ b/tests/mir-opt/const_prop/indirect.main.GVN.panic-unwind.diff @@ -14,7 +14,7 @@ StorageLive(_1); StorageLive(_2); - _2 = const 2_u32 as u8 (IntToInt); -- _3 = AddWithOverflow(_2, const 1_u8); +- _3 = AddWithOverflow(copy _2, const 1_u8); - assert(!move (_3.1: bool), "attempt to compute `{} + {}`, which would overflow", move _2, const 1_u8) -> [success: bb1, unwind continue]; + _2 = const 2_u8; + _3 = const (3_u8, false); diff --git a/tests/mir-opt/const_prop/indirect_mutation.bar.GVN.diff b/tests/mir-opt/const_prop/indirect_mutation.bar.GVN.diff index 99a6ba7d08a..849a57e2030 100644 --- a/tests/mir-opt/const_prop/indirect_mutation.bar.GVN.diff +++ b/tests/mir-opt/const_prop/indirect_mutation.bar.GVN.diff @@ -28,7 +28,7 @@ StorageDead(_2); StorageLive(_4); StorageLive(_5); - _5 = (_1.0: i32); + _5 = copy (_1.0: i32); _4 = Eq(move _5, const 5_i32); StorageDead(_5); _0 = const (); diff --git a/tests/mir-opt/const_prop/indirect_mutation.foo.GVN.diff b/tests/mir-opt/const_prop/indirect_mutation.foo.GVN.diff index c21869dece6..2435f81206b 100644 --- a/tests/mir-opt/const_prop/indirect_mutation.foo.GVN.diff +++ b/tests/mir-opt/const_prop/indirect_mutation.foo.GVN.diff @@ -24,7 +24,7 @@ StorageDead(_2); StorageLive(_3); StorageLive(_4); - _4 = (_1.0: i32); + _4 = copy (_1.0: i32); _3 = Eq(move _4, const 5_i32); StorageDead(_4); _0 = const (); diff --git a/tests/mir-opt/const_prop/indirect_mutation.rs b/tests/mir-opt/const_prop/indirect_mutation.rs index 32ff8f142b1..e82be0a8388 100644 --- a/tests/mir-opt/const_prop/indirect_mutation.rs +++ b/tests/mir-opt/const_prop/indirect_mutation.rs @@ -1,6 +1,5 @@ //@ test-mir-pass: GVN // Check that we do not propagate past an indirect mutation. -#![feature(raw_ref_op)] // EMIT_MIR indirect_mutation.foo.GVN.diff fn foo() { @@ -10,7 +9,7 @@ fn foo() { // CHECK: _1 = const (1_i32,); // CHECK: _2 = &mut (_1.0: i32); // CHECK: (*_2) = const 5_i32; - // CHECK: _4 = (_1.0: i32); + // CHECK: _4 = copy (_1.0: i32); // CHECK: _3 = Eq(move _4, const 5_i32); let mut u = (1,); @@ -25,7 +24,7 @@ fn bar() { // CHECK: debug y => _4; // CHECK: _3 = &raw mut (_1.0: i32); // CHECK: (*_3) = const 5_i32; - // CHECK: _5 = (_1.0: i32); + // CHECK: _5 = copy (_1.0: i32); // CHECK: _4 = Eq(move _5, const 5_i32); let mut v = (1,); diff --git a/tests/mir-opt/const_prop/inherit_overflow.main.GVN.panic-abort.diff b/tests/mir-opt/const_prop/inherit_overflow.main.GVN.panic-abort.diff index de9cb7a47a2..ab39c5be4e3 100644 --- a/tests/mir-opt/const_prop/inherit_overflow.main.GVN.panic-abort.diff +++ b/tests/mir-opt/const_prop/inherit_overflow.main.GVN.panic-abort.diff @@ -19,8 +19,8 @@ StorageLive(_3); _3 = const 1_u8; StorageLive(_4); -- _4 = AddWithOverflow(_2, _3); -- assert(!move (_4.1: bool), "attempt to compute `{} + {}`, which would overflow", _2, _3) -> [success: bb1, unwind unreachable]; +- _4 = AddWithOverflow(copy _2, copy _3); +- assert(!move (_4.1: bool), "attempt to compute `{} + {}`, which would overflow", copy _2, copy _3) -> [success: bb1, unwind unreachable]; + _4 = const (0_u8, true); + assert(!const true, "attempt to compute `{} + {}`, which would overflow", const u8::MAX, const 1_u8) -> [success: bb1, unwind unreachable]; } diff --git a/tests/mir-opt/const_prop/inherit_overflow.main.GVN.panic-unwind.diff b/tests/mir-opt/const_prop/inherit_overflow.main.GVN.panic-unwind.diff index 1f19a13c1e8..1aea0dbb5d5 100644 --- a/tests/mir-opt/const_prop/inherit_overflow.main.GVN.panic-unwind.diff +++ b/tests/mir-opt/const_prop/inherit_overflow.main.GVN.panic-unwind.diff @@ -19,8 +19,8 @@ StorageLive(_3); _3 = const 1_u8; StorageLive(_4); -- _4 = AddWithOverflow(_2, _3); -- assert(!move (_4.1: bool), "attempt to compute `{} + {}`, which would overflow", _2, _3) -> [success: bb1, unwind continue]; +- _4 = AddWithOverflow(copy _2, copy _3); +- assert(!move (_4.1: bool), "attempt to compute `{} + {}`, which would overflow", copy _2, copy _3) -> [success: bb1, unwind continue]; + _4 = const (0_u8, true); + assert(!const true, "attempt to compute `{} + {}`, which would overflow", const u8::MAX, const 1_u8) -> [success: bb1, unwind continue]; } diff --git a/tests/mir-opt/const_prop/invalid_constant.main.GVN.diff b/tests/mir-opt/const_prop/invalid_constant.main.GVN.diff index f5041365604..5e843da8679 100644 --- a/tests/mir-opt/const_prop/invalid_constant.main.GVN.diff +++ b/tests/mir-opt/const_prop/invalid_constant.main.GVN.diff @@ -29,13 +29,13 @@ StorageLive(_1); StorageLive(_2); _2 = InvalidChar { int: const 1114113_u32 }; - _1 = (_2.1: char); + _1 = copy (_2.1: char); StorageDead(_2); StorageLive(_3); StorageLive(_4); StorageLive(_5); _5 = InvalidTag { int: const 4_u32 }; - _4 = (_5.1: E); + _4 = copy (_5.1: E); _3 = [move _4]; StorageDead(_4); StorageDead(_5); diff --git a/tests/mir-opt/const_prop/invalid_constant.main.RemoveZsts.diff b/tests/mir-opt/const_prop/invalid_constant.main.RemoveZsts.diff index 6e5ad8d6b81..6593b329756 100644 --- a/tests/mir-opt/const_prop/invalid_constant.main.RemoveZsts.diff +++ b/tests/mir-opt/const_prop/invalid_constant.main.RemoveZsts.diff @@ -31,13 +31,13 @@ StorageLive(_1); StorageLive(_2); _2 = InvalidChar { int: const 1114113_u32 }; - _1 = (_2.1: char); + _1 = copy (_2.1: char); StorageDead(_2); StorageLive(_3); StorageLive(_4); StorageLive(_5); _5 = InvalidTag { int: const 4_u32 }; - _4 = (_5.1: E); + _4 = copy (_5.1: E); _3 = [move _4]; StorageDead(_4); StorageDead(_5); @@ -47,7 +47,7 @@ + nop; StorageLive(_8); _8 = NoVariants { int: const 0_u32 }; -- _7 = (_8.1: Empty); +- _7 = copy (_8.1: Empty); - _6 = [move _7]; - StorageDead(_7); + nop; diff --git a/tests/mir-opt/const_prop/large_array_index.main.GVN.32bit.panic-abort.diff b/tests/mir-opt/const_prop/large_array_index.main.GVN.32bit.panic-abort.diff index bd987c01ab1..49ea51deed6 100644 --- a/tests/mir-opt/const_prop/large_array_index.main.GVN.32bit.panic-abort.diff +++ b/tests/mir-opt/const_prop/large_array_index.main.GVN.32bit.panic-abort.diff @@ -19,15 +19,15 @@ StorageLive(_3); _3 = const 2_usize; - _4 = Len(_2); -- _5 = Lt(_3, _4); -- assert(move _5, "index out of bounds: the length is {} but the index is {}", move _4, _3) -> [success: bb1, unwind unreachable]; +- _5 = Lt(copy _3, copy _4); +- assert(move _5, "index out of bounds: the length is {} but the index is {}", move _4, copy _3) -> [success: bb1, unwind unreachable]; + _4 = const 5000_usize; + _5 = const true; + assert(const true, "index out of bounds: the length is {} but the index is {}", const 5000_usize, const 2_usize) -> [success: bb1, unwind unreachable]; } bb1: { -- _1 = _2[_3]; +- _1 = copy _2[_3]; + _1 = const 0_u8; StorageDead(_3); StorageDead(_2); diff --git a/tests/mir-opt/const_prop/large_array_index.main.GVN.32bit.panic-unwind.diff b/tests/mir-opt/const_prop/large_array_index.main.GVN.32bit.panic-unwind.diff index e9ebef84ae0..103bfbcaf64 100644 --- a/tests/mir-opt/const_prop/large_array_index.main.GVN.32bit.panic-unwind.diff +++ b/tests/mir-opt/const_prop/large_array_index.main.GVN.32bit.panic-unwind.diff @@ -19,15 +19,15 @@ StorageLive(_3); _3 = const 2_usize; - _4 = Len(_2); -- _5 = Lt(_3, _4); -- assert(move _5, "index out of bounds: the length is {} but the index is {}", move _4, _3) -> [success: bb1, unwind continue]; +- _5 = Lt(copy _3, copy _4); +- assert(move _5, "index out of bounds: the length is {} but the index is {}", move _4, copy _3) -> [success: bb1, unwind continue]; + _4 = const 5000_usize; + _5 = const true; + assert(const true, "index out of bounds: the length is {} but the index is {}", const 5000_usize, const 2_usize) -> [success: bb1, unwind continue]; } bb1: { -- _1 = _2[_3]; +- _1 = copy _2[_3]; + _1 = const 0_u8; StorageDead(_3); StorageDead(_2); diff --git a/tests/mir-opt/const_prop/large_array_index.main.GVN.64bit.panic-abort.diff b/tests/mir-opt/const_prop/large_array_index.main.GVN.64bit.panic-abort.diff index bd987c01ab1..49ea51deed6 100644 --- a/tests/mir-opt/const_prop/large_array_index.main.GVN.64bit.panic-abort.diff +++ b/tests/mir-opt/const_prop/large_array_index.main.GVN.64bit.panic-abort.diff @@ -19,15 +19,15 @@ StorageLive(_3); _3 = const 2_usize; - _4 = Len(_2); -- _5 = Lt(_3, _4); -- assert(move _5, "index out of bounds: the length is {} but the index is {}", move _4, _3) -> [success: bb1, unwind unreachable]; +- _5 = Lt(copy _3, copy _4); +- assert(move _5, "index out of bounds: the length is {} but the index is {}", move _4, copy _3) -> [success: bb1, unwind unreachable]; + _4 = const 5000_usize; + _5 = const true; + assert(const true, "index out of bounds: the length is {} but the index is {}", const 5000_usize, const 2_usize) -> [success: bb1, unwind unreachable]; } bb1: { -- _1 = _2[_3]; +- _1 = copy _2[_3]; + _1 = const 0_u8; StorageDead(_3); StorageDead(_2); diff --git a/tests/mir-opt/const_prop/large_array_index.main.GVN.64bit.panic-unwind.diff b/tests/mir-opt/const_prop/large_array_index.main.GVN.64bit.panic-unwind.diff index e9ebef84ae0..103bfbcaf64 100644 --- a/tests/mir-opt/const_prop/large_array_index.main.GVN.64bit.panic-unwind.diff +++ b/tests/mir-opt/const_prop/large_array_index.main.GVN.64bit.panic-unwind.diff @@ -19,15 +19,15 @@ StorageLive(_3); _3 = const 2_usize; - _4 = Len(_2); -- _5 = Lt(_3, _4); -- assert(move _5, "index out of bounds: the length is {} but the index is {}", move _4, _3) -> [success: bb1, unwind continue]; +- _5 = Lt(copy _3, copy _4); +- assert(move _5, "index out of bounds: the length is {} but the index is {}", move _4, copy _3) -> [success: bb1, unwind continue]; + _4 = const 5000_usize; + _5 = const true; + assert(const true, "index out of bounds: the length is {} but the index is {}", const 5000_usize, const 2_usize) -> [success: bb1, unwind continue]; } bb1: { -- _1 = _2[_3]; +- _1 = copy _2[_3]; + _1 = const 0_u8; StorageDead(_3); StorageDead(_2); diff --git a/tests/mir-opt/const_prop/mult_by_zero.test.GVN.diff b/tests/mir-opt/const_prop/mult_by_zero.test.GVN.diff index 6c2aab45d48..290d9d62ce0 100644 --- a/tests/mir-opt/const_prop/mult_by_zero.test.GVN.diff +++ b/tests/mir-opt/const_prop/mult_by_zero.test.GVN.diff @@ -8,7 +8,7 @@ bb0: { StorageLive(_2); - _2 = _1; + _2 = copy _1; - _0 = Mul(move _2, const 0_i32); + _0 = const 0_i32; StorageDead(_2); diff --git a/tests/mir-opt/const_prop/mutable_variable.main.GVN.diff b/tests/mir-opt/const_prop/mutable_variable.main.GVN.diff index 11464e32400..cc25b6caf90 100644 --- a/tests/mir-opt/const_prop/mutable_variable.main.GVN.diff +++ b/tests/mir-opt/const_prop/mutable_variable.main.GVN.diff @@ -17,7 +17,7 @@ _1 = const 42_i32; _1 = const 99_i32; StorageLive(_2); - _2 = _1; + _2 = copy _1; _0 = const (); StorageDead(_2); StorageDead(_1); diff --git a/tests/mir-opt/const_prop/mutable_variable.rs b/tests/mir-opt/const_prop/mutable_variable.rs index 9698fba6a11..3aa1b1bcd21 100644 --- a/tests/mir-opt/const_prop/mutable_variable.rs +++ b/tests/mir-opt/const_prop/mutable_variable.rs @@ -7,7 +7,7 @@ fn main() { // CHECK: debug y => [[y:_.*]]; // CHECK: [[x]] = const 42_i32; // CHECK: [[x]] = const 99_i32; - // CHECK: [[y]] = [[x]]; + // CHECK: [[y]] = copy [[x]]; let mut x = 42; x = 99; let y = x; diff --git a/tests/mir-opt/const_prop/mutable_variable_aggregate.main.GVN.diff b/tests/mir-opt/const_prop/mutable_variable_aggregate.main.GVN.diff index 7584353620e..3cc71eee710 100644 --- a/tests/mir-opt/const_prop/mutable_variable_aggregate.main.GVN.diff +++ b/tests/mir-opt/const_prop/mutable_variable_aggregate.main.GVN.diff @@ -18,7 +18,7 @@ + _1 = const (42_i32, 43_i32); (_1.1: i32) = const 99_i32; StorageLive(_2); - _2 = _1; + _2 = copy _1; _0 = const (); StorageDead(_2); StorageDead(_1); diff --git a/tests/mir-opt/const_prop/mutable_variable_aggregate.rs b/tests/mir-opt/const_prop/mutable_variable_aggregate.rs index 80cd75215c1..bb8bf7f7164 100644 --- a/tests/mir-opt/const_prop/mutable_variable_aggregate.rs +++ b/tests/mir-opt/const_prop/mutable_variable_aggregate.rs @@ -8,7 +8,7 @@ fn main() { // CHECK: debug y => [[y:_.*]]; // CHECK: [[x]] = const (42_i32, 43_i32); // CHECK: ([[x]].1: i32) = const 99_i32; - // CHECK: [[y]] = [[x]]; + // CHECK: [[y]] = copy [[x]]; let mut x = (42, 43); x.1 = 99; let y = x; diff --git a/tests/mir-opt/const_prop/mutable_variable_aggregate_mut_ref.main.GVN.diff b/tests/mir-opt/const_prop/mutable_variable_aggregate_mut_ref.main.GVN.diff index e16e2969eb8..569ad62b5cc 100644 --- a/tests/mir-opt/const_prop/mutable_variable_aggregate_mut_ref.main.GVN.diff +++ b/tests/mir-opt/const_prop/mutable_variable_aggregate_mut_ref.main.GVN.diff @@ -24,7 +24,7 @@ _2 = &mut _1; ((*_2).1: i32) = const 99_i32; StorageLive(_3); - _3 = _1; + _3 = copy _1; _0 = const (); StorageDead(_3); StorageDead(_2); diff --git a/tests/mir-opt/const_prop/mutable_variable_aggregate_mut_ref.rs b/tests/mir-opt/const_prop/mutable_variable_aggregate_mut_ref.rs index 856afd53ab4..332cac96f75 100644 --- a/tests/mir-opt/const_prop/mutable_variable_aggregate_mut_ref.rs +++ b/tests/mir-opt/const_prop/mutable_variable_aggregate_mut_ref.rs @@ -10,7 +10,7 @@ fn main() { // CHECK: [[x]] = const (42_i32, 43_i32); // CHECK: [[z]] = &mut [[x]]; // CHECK: ((*[[z]]).1: i32) = const 99_i32; - // CHECK: [[y]] = [[x]]; + // CHECK: [[y]] = copy [[x]]; let mut x = (42, 43); let z = &mut x; z.1 = 99; diff --git a/tests/mir-opt/const_prop/mutable_variable_aggregate_partial_read.main.GVN.panic-abort.diff b/tests/mir-opt/const_prop/mutable_variable_aggregate_partial_read.main.GVN.panic-abort.diff index 6480e480f8c..5b4d18a3c07 100644 --- a/tests/mir-opt/const_prop/mutable_variable_aggregate_partial_read.main.GVN.panic-abort.diff +++ b/tests/mir-opt/const_prop/mutable_variable_aggregate_partial_read.main.GVN.panic-abort.diff @@ -21,7 +21,7 @@ (_1.1: i32) = const 99_i32; (_1.0: i32) = const 42_i32; StorageLive(_2); - _2 = (_1.1: i32); + _2 = copy (_1.1: i32); _0 = const (); StorageDead(_2); StorageDead(_1); diff --git a/tests/mir-opt/const_prop/mutable_variable_aggregate_partial_read.main.GVN.panic-unwind.diff b/tests/mir-opt/const_prop/mutable_variable_aggregate_partial_read.main.GVN.panic-unwind.diff index fb757801082..d58febe368d 100644 --- a/tests/mir-opt/const_prop/mutable_variable_aggregate_partial_read.main.GVN.panic-unwind.diff +++ b/tests/mir-opt/const_prop/mutable_variable_aggregate_partial_read.main.GVN.panic-unwind.diff @@ -21,7 +21,7 @@ (_1.1: i32) = const 99_i32; (_1.0: i32) = const 42_i32; StorageLive(_2); - _2 = (_1.1: i32); + _2 = copy (_1.1: i32); _0 = const (); StorageDead(_2); StorageDead(_1); diff --git a/tests/mir-opt/const_prop/mutable_variable_aggregate_partial_read.rs b/tests/mir-opt/const_prop/mutable_variable_aggregate_partial_read.rs index 6f99e6be246..e27437a1c75 100644 --- a/tests/mir-opt/const_prop/mutable_variable_aggregate_partial_read.rs +++ b/tests/mir-opt/const_prop/mutable_variable_aggregate_partial_read.rs @@ -9,7 +9,7 @@ fn main() { // CHECK: [[x]] = foo() // CHECK: ([[x]].1: i32) = const 99_i32; // CHECK: ([[x]].0: i32) = const 42_i32; - // CHECK: [[y]] = ([[x]].1: i32); + // CHECK: [[y]] = copy ([[x]].1: i32); let mut x: (i32, i32) = foo(); x.1 = 99; x.0 = 42; diff --git a/tests/mir-opt/const_prop/mutable_variable_no_prop.main.GVN.diff b/tests/mir-opt/const_prop/mutable_variable_no_prop.main.GVN.diff index 31c839f6749..3f8dc12f4ae 100644 --- a/tests/mir-opt/const_prop/mutable_variable_no_prop.main.GVN.diff +++ b/tests/mir-opt/const_prop/mutable_variable_no_prop.main.GVN.diff @@ -22,14 +22,14 @@ StorageLive(_3); StorageLive(_4); _4 = const {ALLOC0: *mut u32}; - _3 = (*_4); + _3 = copy (*_4); _1 = move _3; StorageDead(_3); StorageDead(_4); _2 = const (); StorageDead(_2); StorageLive(_5); - _5 = _1; + _5 = copy _1; _0 = const (); StorageDead(_5); StorageDead(_1); diff --git a/tests/mir-opt/const_prop/mutable_variable_no_prop.rs b/tests/mir-opt/const_prop/mutable_variable_no_prop.rs index 8289832f81e..66af5bf1d5d 100644 --- a/tests/mir-opt/const_prop/mutable_variable_no_prop.rs +++ b/tests/mir-opt/const_prop/mutable_variable_no_prop.rs @@ -9,9 +9,9 @@ fn main() { // CHECK: debug x => [[x:_.*]]; // CHECK: debug y => [[y:_.*]]; // CHECK: [[x]] = const 42_u32; - // CHECK: [[tmp:_.*]] = (*{{_.*}}); + // CHECK: [[tmp:_.*]] = copy (*{{_.*}}); // CHECK: [[x]] = move [[tmp]]; - // CHECK: [[y]] = [[x]]; + // CHECK: [[y]] = copy [[x]]; let mut x = 42; unsafe { x = STATIC; diff --git a/tests/mir-opt/const_prop/mutable_variable_unprop_assign.main.GVN.panic-abort.diff b/tests/mir-opt/const_prop/mutable_variable_unprop_assign.main.GVN.panic-abort.diff index 19d79694666..7ca1b39d771 100644 --- a/tests/mir-opt/const_prop/mutable_variable_unprop_assign.main.GVN.panic-abort.diff +++ b/tests/mir-opt/const_prop/mutable_variable_unprop_assign.main.GVN.panic-abort.diff @@ -32,14 +32,14 @@ - _2 = (const 1_i32, const 2_i32); + _2 = const (1_i32, 2_i32); StorageLive(_3); - _3 = _1; + _3 = copy _1; - (_2.1: i32) = move _3; -+ (_2.1: i32) = _1; ++ (_2.1: i32) = copy _1; StorageDead(_3); StorageLive(_4); - _4 = (_2.1: i32); + _4 = copy (_2.1: i32); StorageLive(_5); - _5 = (_2.0: i32); + _5 = copy (_2.0: i32); _0 = const (); StorageDead(_5); StorageDead(_4); diff --git a/tests/mir-opt/const_prop/mutable_variable_unprop_assign.main.GVN.panic-unwind.diff b/tests/mir-opt/const_prop/mutable_variable_unprop_assign.main.GVN.panic-unwind.diff index 2bb277bf27f..f6379513806 100644 --- a/tests/mir-opt/const_prop/mutable_variable_unprop_assign.main.GVN.panic-unwind.diff +++ b/tests/mir-opt/const_prop/mutable_variable_unprop_assign.main.GVN.panic-unwind.diff @@ -32,14 +32,14 @@ - _2 = (const 1_i32, const 2_i32); + _2 = const (1_i32, 2_i32); StorageLive(_3); - _3 = _1; + _3 = copy _1; - (_2.1: i32) = move _3; -+ (_2.1: i32) = _1; ++ (_2.1: i32) = copy _1; StorageDead(_3); StorageLive(_4); - _4 = (_2.1: i32); + _4 = copy (_2.1: i32); StorageLive(_5); - _5 = (_2.0: i32); + _5 = copy (_2.0: i32); _0 = const (); StorageDead(_5); StorageDead(_4); diff --git a/tests/mir-opt/const_prop/mutable_variable_unprop_assign.rs b/tests/mir-opt/const_prop/mutable_variable_unprop_assign.rs index 2c6cc0db6b2..1f4421331bc 100644 --- a/tests/mir-opt/const_prop/mutable_variable_unprop_assign.rs +++ b/tests/mir-opt/const_prop/mutable_variable_unprop_assign.rs @@ -11,9 +11,9 @@ fn main() { // CHECK: debug z => [[z:_.*]]; // CHECK: [[a]] = foo() // CHECK: [[x]] = const (1_i32, 2_i32); - // CHECK: ([[x]].1: i32) = [[a]]; - // CHECK: [[y]] = ([[x]].1: i32); - // CHECK: [[z]] = ([[x]].0: i32); + // CHECK: ([[x]].1: i32) = copy [[a]]; + // CHECK: [[y]] = copy ([[x]].1: i32); + // CHECK: [[z]] = copy ([[x]].0: i32); let a = foo(); let mut x: (i32, i32) = (1, 2); x.1 = a; diff --git a/tests/mir-opt/const_prop/overwrite_with_const_with_params.rs b/tests/mir-opt/const_prop/overwrite_with_const_with_params.rs index a43558223fe..1d8890bf369 100644 --- a/tests/mir-opt/const_prop/overwrite_with_const_with_params.rs +++ b/tests/mir-opt/const_prop/overwrite_with_const_with_params.rs @@ -15,7 +15,7 @@ fn size_of<T>() -> usize { // CHECK-LABEL: fn size_of( // CHECK: _1 = const 0_usize; // CHECK-NEXT: _1 = const SizeOfConst::<T>::SIZE; - // CHECK-NEXT: _0 = _1; + // CHECK-NEXT: _0 = copy _1; let mut a = 0; a = SizeOfConst::<T>::SIZE; a diff --git a/tests/mir-opt/const_prop/overwrite_with_const_with_params.size_of.GVN.diff b/tests/mir-opt/const_prop/overwrite_with_const_with_params.size_of.GVN.diff index 1eadffa4f36..da6ef0a978b 100644 --- a/tests/mir-opt/const_prop/overwrite_with_const_with_params.size_of.GVN.diff +++ b/tests/mir-opt/const_prop/overwrite_with_const_with_params.size_of.GVN.diff @@ -12,7 +12,7 @@ StorageLive(_1); _1 = const 0_usize; _1 = const SizeOfConst::<T>::SIZE; - _0 = _1; + _0 = copy _1; StorageDead(_1); return; } diff --git a/tests/mir-opt/const_prop/pointer_expose_provenance.main.GVN.panic-abort.diff b/tests/mir-opt/const_prop/pointer_expose_provenance.main.GVN.panic-abort.diff index 79a95b618d1..657fa7a5fea 100644 --- a/tests/mir-opt/const_prop/pointer_expose_provenance.main.GVN.panic-abort.diff +++ b/tests/mir-opt/const_prop/pointer_expose_provenance.main.GVN.panic-abort.diff @@ -24,9 +24,9 @@ StorageDead(_3); StorageLive(_4); StorageLive(_5); - _5 = _1; + _5 = copy _1; - _4 = read(move _5) -> [return: bb1, unwind unreachable]; -+ _4 = read(_1) -> [return: bb1, unwind unreachable]; ++ _4 = read(copy _1) -> [return: bb1, unwind unreachable]; } bb1: { diff --git a/tests/mir-opt/const_prop/pointer_expose_provenance.main.GVN.panic-unwind.diff b/tests/mir-opt/const_prop/pointer_expose_provenance.main.GVN.panic-unwind.diff index 9d1bcd92fef..8fef6591d41 100644 --- a/tests/mir-opt/const_prop/pointer_expose_provenance.main.GVN.panic-unwind.diff +++ b/tests/mir-opt/const_prop/pointer_expose_provenance.main.GVN.panic-unwind.diff @@ -24,9 +24,9 @@ StorageDead(_3); StorageLive(_4); StorageLive(_5); - _5 = _1; + _5 = copy _1; - _4 = read(move _5) -> [return: bb1, unwind continue]; -+ _4 = read(_1) -> [return: bb1, unwind continue]; ++ _4 = read(copy _1) -> [return: bb1, unwind continue]; } bb1: { diff --git a/tests/mir-opt/const_prop/pointer_expose_provenance.rs b/tests/mir-opt/const_prop/pointer_expose_provenance.rs index a76fead9859..bee8a985f8f 100644 --- a/tests/mir-opt/const_prop/pointer_expose_provenance.rs +++ b/tests/mir-opt/const_prop/pointer_expose_provenance.rs @@ -10,7 +10,7 @@ fn main() { // CHECK: [[ptr:_.*]] = const main::FOO; // CHECK: [[ref:_.*]] = &raw const (*[[ptr]]); // CHECK: [[x:_.*]] = move [[ref]] as usize (PointerExposeProvenance); - // CHECK: = read([[x]]) + // CHECK: = read(copy [[x]]) const FOO: &i32 = &1; let x = FOO as *const i32 as usize; read(x); diff --git a/tests/mir-opt/const_prop/read_immutable_static.main.GVN.diff b/tests/mir-opt/const_prop/read_immutable_static.main.GVN.diff index 38f23505230..8df262b351f 100644 --- a/tests/mir-opt/const_prop/read_immutable_static.main.GVN.diff +++ b/tests/mir-opt/const_prop/read_immutable_static.main.GVN.diff @@ -19,12 +19,12 @@ + nop; + nop; _3 = const {ALLOC0: &u8}; -- _2 = (*_3); +- _2 = copy (*_3); + _2 = const 2_u8; StorageLive(_4); StorageLive(_5); _5 = const {ALLOC0: &u8}; -- _4 = (*_5); +- _4 = copy (*_5); - _1 = Add(move _2, move _4); + _4 = const 2_u8; + _1 = const 4_u8; diff --git a/tests/mir-opt/const_prop/ref_deref.main.GVN.diff b/tests/mir-opt/const_prop/ref_deref.main.GVN.diff index 509924a91c5..b9e269266b0 100644 --- a/tests/mir-opt/const_prop/ref_deref.main.GVN.diff +++ b/tests/mir-opt/const_prop/ref_deref.main.GVN.diff @@ -16,7 +16,7 @@ StorageLive(_2); _4 = const main::promoted[0]; _2 = &(*_4); -- _1 = (*_2); +- _1 = copy (*_2); + _1 = const 4_i32; StorageDead(_2); _0 = const (); diff --git a/tests/mir-opt/const_prop/ref_deref_project.main.GVN.diff b/tests/mir-opt/const_prop/ref_deref_project.main.GVN.diff index 820c6cc0680..dcc13c9251c 100644 --- a/tests/mir-opt/const_prop/ref_deref_project.main.GVN.diff +++ b/tests/mir-opt/const_prop/ref_deref_project.main.GVN.diff @@ -16,7 +16,7 @@ StorageLive(_2); _4 = const main::promoted[0]; _2 = &((*_4).1: i32); -- _1 = (*_2); +- _1 = copy (*_2); + _1 = const 5_i32; StorageDead(_2); _0 = const (); diff --git a/tests/mir-opt/const_prop/repeat.main.GVN.32bit.panic-abort.diff b/tests/mir-opt/const_prop/repeat.main.GVN.32bit.panic-abort.diff index 71635b8e9c3..f7c1c2da01f 100644 --- a/tests/mir-opt/const_prop/repeat.main.GVN.32bit.panic-abort.diff +++ b/tests/mir-opt/const_prop/repeat.main.GVN.32bit.panic-abort.diff @@ -21,15 +21,15 @@ StorageLive(_4); _4 = const 2_usize; - _5 = Len(_3); -- _6 = Lt(_4, _5); -- assert(move _6, "index out of bounds: the length is {} but the index is {}", move _5, _4) -> [success: bb1, unwind unreachable]; +- _6 = Lt(copy _4, copy _5); +- assert(move _6, "index out of bounds: the length is {} but the index is {}", move _5, copy _4) -> [success: bb1, unwind unreachable]; + _5 = const 8_usize; + _6 = const true; + assert(const true, "index out of bounds: the length is {} but the index is {}", const 8_usize, const 2_usize) -> [success: bb1, unwind unreachable]; } bb1: { -- _2 = _3[_4]; +- _2 = copy _3[_4]; - _1 = Add(move _2, const 0_u32); + _2 = const 42_u32; + _1 = const 42_u32; diff --git a/tests/mir-opt/const_prop/repeat.main.GVN.32bit.panic-unwind.diff b/tests/mir-opt/const_prop/repeat.main.GVN.32bit.panic-unwind.diff index 84205028d6d..436773c8556 100644 --- a/tests/mir-opt/const_prop/repeat.main.GVN.32bit.panic-unwind.diff +++ b/tests/mir-opt/const_prop/repeat.main.GVN.32bit.panic-unwind.diff @@ -21,15 +21,15 @@ StorageLive(_4); _4 = const 2_usize; - _5 = Len(_3); -- _6 = Lt(_4, _5); -- assert(move _6, "index out of bounds: the length is {} but the index is {}", move _5, _4) -> [success: bb1, unwind continue]; +- _6 = Lt(copy _4, copy _5); +- assert(move _6, "index out of bounds: the length is {} but the index is {}", move _5, copy _4) -> [success: bb1, unwind continue]; + _5 = const 8_usize; + _6 = const true; + assert(const true, "index out of bounds: the length is {} but the index is {}", const 8_usize, const 2_usize) -> [success: bb1, unwind continue]; } bb1: { -- _2 = _3[_4]; +- _2 = copy _3[_4]; - _1 = Add(move _2, const 0_u32); + _2 = const 42_u32; + _1 = const 42_u32; diff --git a/tests/mir-opt/const_prop/repeat.main.GVN.64bit.panic-abort.diff b/tests/mir-opt/const_prop/repeat.main.GVN.64bit.panic-abort.diff index 71635b8e9c3..f7c1c2da01f 100644 --- a/tests/mir-opt/const_prop/repeat.main.GVN.64bit.panic-abort.diff +++ b/tests/mir-opt/const_prop/repeat.main.GVN.64bit.panic-abort.diff @@ -21,15 +21,15 @@ StorageLive(_4); _4 = const 2_usize; - _5 = Len(_3); -- _6 = Lt(_4, _5); -- assert(move _6, "index out of bounds: the length is {} but the index is {}", move _5, _4) -> [success: bb1, unwind unreachable]; +- _6 = Lt(copy _4, copy _5); +- assert(move _6, "index out of bounds: the length is {} but the index is {}", move _5, copy _4) -> [success: bb1, unwind unreachable]; + _5 = const 8_usize; + _6 = const true; + assert(const true, "index out of bounds: the length is {} but the index is {}", const 8_usize, const 2_usize) -> [success: bb1, unwind unreachable]; } bb1: { -- _2 = _3[_4]; +- _2 = copy _3[_4]; - _1 = Add(move _2, const 0_u32); + _2 = const 42_u32; + _1 = const 42_u32; diff --git a/tests/mir-opt/const_prop/repeat.main.GVN.64bit.panic-unwind.diff b/tests/mir-opt/const_prop/repeat.main.GVN.64bit.panic-unwind.diff index 84205028d6d..436773c8556 100644 --- a/tests/mir-opt/const_prop/repeat.main.GVN.64bit.panic-unwind.diff +++ b/tests/mir-opt/const_prop/repeat.main.GVN.64bit.panic-unwind.diff @@ -21,15 +21,15 @@ StorageLive(_4); _4 = const 2_usize; - _5 = Len(_3); -- _6 = Lt(_4, _5); -- assert(move _6, "index out of bounds: the length is {} but the index is {}", move _5, _4) -> [success: bb1, unwind continue]; +- _6 = Lt(copy _4, copy _5); +- assert(move _6, "index out of bounds: the length is {} but the index is {}", move _5, copy _4) -> [success: bb1, unwind continue]; + _5 = const 8_usize; + _6 = const true; + assert(const true, "index out of bounds: the length is {} but the index is {}", const 8_usize, const 2_usize) -> [success: bb1, unwind continue]; } bb1: { -- _2 = _3[_4]; +- _2 = copy _3[_4]; - _1 = Add(move _2, const 0_u32); + _2 = const 42_u32; + _1 = const 42_u32; diff --git a/tests/mir-opt/const_prop/scalar_literal_propagation.main.GVN.panic-abort.diff b/tests/mir-opt/const_prop/scalar_literal_propagation.main.GVN.panic-abort.diff index 0a20fb0e59e..3c73d34474c 100644 --- a/tests/mir-opt/const_prop/scalar_literal_propagation.main.GVN.panic-abort.diff +++ b/tests/mir-opt/const_prop/scalar_literal_propagation.main.GVN.panic-abort.diff @@ -16,7 +16,7 @@ _1 = const 1_u32; StorageLive(_2); StorageLive(_3); -- _3 = _1; +- _3 = copy _1; - _2 = consume(move _3) -> [return: bb1, unwind unreachable]; + _3 = const 1_u32; + _2 = consume(const 1_u32) -> [return: bb1, unwind unreachable]; diff --git a/tests/mir-opt/const_prop/scalar_literal_propagation.main.GVN.panic-unwind.diff b/tests/mir-opt/const_prop/scalar_literal_propagation.main.GVN.panic-unwind.diff index 8b9519d3adc..0a7fddee39b 100644 --- a/tests/mir-opt/const_prop/scalar_literal_propagation.main.GVN.panic-unwind.diff +++ b/tests/mir-opt/const_prop/scalar_literal_propagation.main.GVN.panic-unwind.diff @@ -16,7 +16,7 @@ _1 = const 1_u32; StorageLive(_2); StorageLive(_3); -- _3 = _1; +- _3 = copy _1; - _2 = consume(move _3) -> [return: bb1, unwind continue]; + _3 = const 1_u32; + _2 = consume(const 1_u32) -> [return: bb1, unwind continue]; diff --git a/tests/mir-opt/const_prop/slice_len.main.GVN.32bit.panic-abort.diff b/tests/mir-opt/const_prop/slice_len.main.GVN.32bit.panic-abort.diff index 21d91d0320a..e834a5802c3 100644 --- a/tests/mir-opt/const_prop/slice_len.main.GVN.32bit.panic-abort.diff +++ b/tests/mir-opt/const_prop/slice_len.main.GVN.32bit.panic-abort.diff @@ -22,24 +22,24 @@ StorageLive(_3); StorageLive(_4); _9 = const main::promoted[0]; - _4 = _9; -- _3 = _4; + _4 = copy _9; +- _3 = copy _4; - _2 = move _3 as &[u32] (PointerCoercion(Unsize)); -+ _3 = _9; -+ _2 = _9 as &[u32] (PointerCoercion(Unsize)); ++ _3 = copy _9; ++ _2 = copy _9 as &[u32] (PointerCoercion(Unsize)); StorageDead(_3); StorageLive(_6); _6 = const 1_usize; - _7 = Len((*_2)); -- _8 = Lt(_6, _7); -- assert(move _8, "index out of bounds: the length is {} but the index is {}", move _7, _6) -> [success: bb1, unwind unreachable]; +- _8 = Lt(copy _6, copy _7); +- assert(move _8, "index out of bounds: the length is {} but the index is {}", move _7, copy _6) -> [success: bb1, unwind unreachable]; + _7 = const 3_usize; + _8 = const true; + assert(const true, "index out of bounds: the length is {} but the index is {}", const 3_usize, const 1_usize) -> [success: bb1, unwind unreachable]; } bb1: { -- _1 = (*_2)[_6]; +- _1 = copy (*_2)[_6]; + _1 = const 2_u32; StorageDead(_6); StorageDead(_4); diff --git a/tests/mir-opt/const_prop/slice_len.main.GVN.32bit.panic-unwind.diff b/tests/mir-opt/const_prop/slice_len.main.GVN.32bit.panic-unwind.diff index 889114c9862..55ffc501805 100644 --- a/tests/mir-opt/const_prop/slice_len.main.GVN.32bit.panic-unwind.diff +++ b/tests/mir-opt/const_prop/slice_len.main.GVN.32bit.panic-unwind.diff @@ -22,24 +22,24 @@ StorageLive(_3); StorageLive(_4); _9 = const main::promoted[0]; - _4 = _9; -- _3 = _4; + _4 = copy _9; +- _3 = copy _4; - _2 = move _3 as &[u32] (PointerCoercion(Unsize)); -+ _3 = _9; -+ _2 = _9 as &[u32] (PointerCoercion(Unsize)); ++ _3 = copy _9; ++ _2 = copy _9 as &[u32] (PointerCoercion(Unsize)); StorageDead(_3); StorageLive(_6); _6 = const 1_usize; - _7 = Len((*_2)); -- _8 = Lt(_6, _7); -- assert(move _8, "index out of bounds: the length is {} but the index is {}", move _7, _6) -> [success: bb1, unwind continue]; +- _8 = Lt(copy _6, copy _7); +- assert(move _8, "index out of bounds: the length is {} but the index is {}", move _7, copy _6) -> [success: bb1, unwind continue]; + _7 = const 3_usize; + _8 = const true; + assert(const true, "index out of bounds: the length is {} but the index is {}", const 3_usize, const 1_usize) -> [success: bb1, unwind continue]; } bb1: { -- _1 = (*_2)[_6]; +- _1 = copy (*_2)[_6]; + _1 = const 2_u32; StorageDead(_6); StorageDead(_4); diff --git a/tests/mir-opt/const_prop/slice_len.main.GVN.64bit.panic-abort.diff b/tests/mir-opt/const_prop/slice_len.main.GVN.64bit.panic-abort.diff index 21d91d0320a..e834a5802c3 100644 --- a/tests/mir-opt/const_prop/slice_len.main.GVN.64bit.panic-abort.diff +++ b/tests/mir-opt/const_prop/slice_len.main.GVN.64bit.panic-abort.diff @@ -22,24 +22,24 @@ StorageLive(_3); StorageLive(_4); _9 = const main::promoted[0]; - _4 = _9; -- _3 = _4; + _4 = copy _9; +- _3 = copy _4; - _2 = move _3 as &[u32] (PointerCoercion(Unsize)); -+ _3 = _9; -+ _2 = _9 as &[u32] (PointerCoercion(Unsize)); ++ _3 = copy _9; ++ _2 = copy _9 as &[u32] (PointerCoercion(Unsize)); StorageDead(_3); StorageLive(_6); _6 = const 1_usize; - _7 = Len((*_2)); -- _8 = Lt(_6, _7); -- assert(move _8, "index out of bounds: the length is {} but the index is {}", move _7, _6) -> [success: bb1, unwind unreachable]; +- _8 = Lt(copy _6, copy _7); +- assert(move _8, "index out of bounds: the length is {} but the index is {}", move _7, copy _6) -> [success: bb1, unwind unreachable]; + _7 = const 3_usize; + _8 = const true; + assert(const true, "index out of bounds: the length is {} but the index is {}", const 3_usize, const 1_usize) -> [success: bb1, unwind unreachable]; } bb1: { -- _1 = (*_2)[_6]; +- _1 = copy (*_2)[_6]; + _1 = const 2_u32; StorageDead(_6); StorageDead(_4); diff --git a/tests/mir-opt/const_prop/slice_len.main.GVN.64bit.panic-unwind.diff b/tests/mir-opt/const_prop/slice_len.main.GVN.64bit.panic-unwind.diff index 889114c9862..55ffc501805 100644 --- a/tests/mir-opt/const_prop/slice_len.main.GVN.64bit.panic-unwind.diff +++ b/tests/mir-opt/const_prop/slice_len.main.GVN.64bit.panic-unwind.diff @@ -22,24 +22,24 @@ StorageLive(_3); StorageLive(_4); _9 = const main::promoted[0]; - _4 = _9; -- _3 = _4; + _4 = copy _9; +- _3 = copy _4; - _2 = move _3 as &[u32] (PointerCoercion(Unsize)); -+ _3 = _9; -+ _2 = _9 as &[u32] (PointerCoercion(Unsize)); ++ _3 = copy _9; ++ _2 = copy _9 as &[u32] (PointerCoercion(Unsize)); StorageDead(_3); StorageLive(_6); _6 = const 1_usize; - _7 = Len((*_2)); -- _8 = Lt(_6, _7); -- assert(move _8, "index out of bounds: the length is {} but the index is {}", move _7, _6) -> [success: bb1, unwind continue]; +- _8 = Lt(copy _6, copy _7); +- assert(move _8, "index out of bounds: the length is {} but the index is {}", move _7, copy _6) -> [success: bb1, unwind continue]; + _7 = const 3_usize; + _8 = const true; + assert(const true, "index out of bounds: the length is {} but the index is {}", const 3_usize, const 1_usize) -> [success: bb1, unwind continue]; } bb1: { -- _1 = (*_2)[_6]; +- _1 = copy (*_2)[_6]; + _1 = const 2_u32; StorageDead(_6); StorageDead(_4); diff --git a/tests/mir-opt/const_prop/slice_len.rs b/tests/mir-opt/const_prop/slice_len.rs index 3d1b58965ac..46604cfe1e0 100644 --- a/tests/mir-opt/const_prop/slice_len.rs +++ b/tests/mir-opt/const_prop/slice_len.rs @@ -7,7 +7,7 @@ fn main() { // CHECK-LABEL: fn main( // CHECK: debug a => [[a:_.*]]; - // CHECK: [[slice:_.*]] = {{.*}} as &[u32] (PointerCoercion(Unsize)); + // CHECK: [[slice:_.*]] = copy {{.*}} as &[u32] (PointerCoercion(Unsize)); // CHECK: assert(const true, // CHECK: [[a]] = const 2_u32; let a = (&[1u32, 2, 3] as &[u32])[1]; diff --git a/tests/mir-opt/const_prop/switch_int.main.GVN.panic-abort.diff b/tests/mir-opt/const_prop/switch_int.main.GVN.panic-abort.diff index ee9f2d5c7f5..2339f110f5a 100644 --- a/tests/mir-opt/const_prop/switch_int.main.GVN.panic-abort.diff +++ b/tests/mir-opt/const_prop/switch_int.main.GVN.panic-abort.diff @@ -8,7 +8,7 @@ bb0: { StorageLive(_1); _1 = const 1_i32; -- switchInt(_1) -> [1: bb2, otherwise: bb1]; +- switchInt(copy _1) -> [1: bb2, otherwise: bb1]; + switchInt(const 1_i32) -> [1: bb2, otherwise: bb1]; } diff --git a/tests/mir-opt/const_prop/switch_int.main.GVN.panic-unwind.diff b/tests/mir-opt/const_prop/switch_int.main.GVN.panic-unwind.diff index 143d04ac984..49082e6ba52 100644 --- a/tests/mir-opt/const_prop/switch_int.main.GVN.panic-unwind.diff +++ b/tests/mir-opt/const_prop/switch_int.main.GVN.panic-unwind.diff @@ -8,7 +8,7 @@ bb0: { StorageLive(_1); _1 = const 1_i32; -- switchInt(_1) -> [1: bb2, otherwise: bb1]; +- switchInt(copy _1) -> [1: bb2, otherwise: bb1]; + switchInt(const 1_i32) -> [1: bb2, otherwise: bb1]; } diff --git a/tests/mir-opt/const_prop/transmute.unreachable_box.GVN.32bit.diff b/tests/mir-opt/const_prop/transmute.unreachable_box.GVN.32bit.diff index 7a289563c50..de0b1a57f80 100644 --- a/tests/mir-opt/const_prop/transmute.unreachable_box.GVN.32bit.diff +++ b/tests/mir-opt/const_prop/transmute.unreachable_box.GVN.32bit.diff @@ -12,7 +12,7 @@ bb0: { StorageLive(_1); - _1 = const 1_usize as std::boxed::Box<Never> (Transmute); -- _2 = (((_1.0: std::ptr::Unique<Never>).0: std::ptr::NonNull<Never>).0: *const Never); +- _2 = copy (((_1.0: std::ptr::Unique<Never>).0: std::ptr::NonNull<Never>).0: *const Never); + _1 = const Box::<Never>(Unique::<Never> {{ pointer: NonNull::<Never> {{ pointer: {0x1 as *const Never} }}, _marker: PhantomData::<Never> }}, std::alloc::Global); + _2 = const {0x1 as *const Never}; unreachable; diff --git a/tests/mir-opt/const_prop/transmute.unreachable_box.GVN.64bit.diff b/tests/mir-opt/const_prop/transmute.unreachable_box.GVN.64bit.diff index 7a289563c50..de0b1a57f80 100644 --- a/tests/mir-opt/const_prop/transmute.unreachable_box.GVN.64bit.diff +++ b/tests/mir-opt/const_prop/transmute.unreachable_box.GVN.64bit.diff @@ -12,7 +12,7 @@ bb0: { StorageLive(_1); - _1 = const 1_usize as std::boxed::Box<Never> (Transmute); -- _2 = (((_1.0: std::ptr::Unique<Never>).0: std::ptr::NonNull<Never>).0: *const Never); +- _2 = copy (((_1.0: std::ptr::Unique<Never>).0: std::ptr::NonNull<Never>).0: *const Never); + _1 = const Box::<Never>(Unique::<Never> {{ pointer: NonNull::<Never> {{ pointer: {0x1 as *const Never} }}, _marker: PhantomData::<Never> }}, std::alloc::Global); + _2 = const {0x1 as *const Never}; unreachable; diff --git a/tests/mir-opt/const_prop/tuple_literal_propagation.main.GVN.panic-abort.diff b/tests/mir-opt/const_prop/tuple_literal_propagation.main.GVN.panic-abort.diff index bf8fece3d37..01d86ce8717 100644 --- a/tests/mir-opt/const_prop/tuple_literal_propagation.main.GVN.panic-abort.diff +++ b/tests/mir-opt/const_prop/tuple_literal_propagation.main.GVN.panic-abort.diff @@ -17,7 +17,7 @@ + _1 = const (1_u32, 2_u32); StorageLive(_2); StorageLive(_3); -- _3 = _1; +- _3 = copy _1; - _2 = consume(move _3) -> [return: bb1, unwind unreachable]; + _3 = const (1_u32, 2_u32); + _2 = consume(const (1_u32, 2_u32)) -> [return: bb1, unwind unreachable]; diff --git a/tests/mir-opt/const_prop/tuple_literal_propagation.main.GVN.panic-unwind.diff b/tests/mir-opt/const_prop/tuple_literal_propagation.main.GVN.panic-unwind.diff index 02a75849d88..bd7d494212c 100644 --- a/tests/mir-opt/const_prop/tuple_literal_propagation.main.GVN.panic-unwind.diff +++ b/tests/mir-opt/const_prop/tuple_literal_propagation.main.GVN.panic-unwind.diff @@ -17,7 +17,7 @@ + _1 = const (1_u32, 2_u32); StorageLive(_2); StorageLive(_3); -- _3 = _1; +- _3 = copy _1; - _2 = consume(move _3) -> [return: bb1, unwind continue]; + _3 = const (1_u32, 2_u32); + _2 = consume(const (1_u32, 2_u32)) -> [return: bb1, unwind continue]; diff --git a/tests/mir-opt/const_prop/while_let_loops.change_loop_body.GVN.diff b/tests/mir-opt/const_prop/while_let_loops.change_loop_body.GVN.diff index 9548afc9d40..f830624cae7 100644 --- a/tests/mir-opt/const_prop/while_let_loops.change_loop_body.GVN.diff +++ b/tests/mir-opt/const_prop/while_let_loops.change_loop_body.GVN.diff @@ -30,7 +30,7 @@ } bb1: { -- switchInt(((_3 as Some).0: u32)) -> [0: bb2, otherwise: bb3]; +- switchInt(copy ((_3 as Some).0: u32)) -> [0: bb2, otherwise: bb3]; + switchInt(const Indirect { alloc_id: ALLOC0, offset: Size(4 bytes) }: u32) -> [0: bb2, otherwise: bb3]; } diff --git a/tests/mir-opt/copy-prop/borrowed_local.borrowed.CopyProp.panic-abort.diff b/tests/mir-opt/copy-prop/borrowed_local.borrowed.CopyProp.panic-abort.diff index 897592a0e2f..40e8c06f357 100644 --- a/tests/mir-opt/copy-prop/borrowed_local.borrowed.CopyProp.panic-abort.diff +++ b/tests/mir-opt/copy-prop/borrowed_local.borrowed.CopyProp.panic-abort.diff @@ -7,14 +7,14 @@ let mut _3: &T; bb0: { -- _2 = _1; +- _2 = copy _1; _3 = &_1; - _0 = opaque::<&T>(_3) -> [return: bb1, unwind unreachable]; + _0 = opaque::<&T>(copy _3) -> [return: bb1, unwind unreachable]; } bb1: { -- _0 = opaque::<T>(_2) -> [return: bb2, unwind unreachable]; -+ _0 = opaque::<T>(_1) -> [return: bb2, unwind unreachable]; +- _0 = opaque::<T>(copy _2) -> [return: bb2, unwind unreachable]; ++ _0 = opaque::<T>(copy _1) -> [return: bb2, unwind unreachable]; } bb2: { diff --git a/tests/mir-opt/copy-prop/borrowed_local.borrowed.CopyProp.panic-unwind.diff b/tests/mir-opt/copy-prop/borrowed_local.borrowed.CopyProp.panic-unwind.diff index 33c05af91a1..d09c96c0f2b 100644 --- a/tests/mir-opt/copy-prop/borrowed_local.borrowed.CopyProp.panic-unwind.diff +++ b/tests/mir-opt/copy-prop/borrowed_local.borrowed.CopyProp.panic-unwind.diff @@ -7,14 +7,14 @@ let mut _3: &T; bb0: { -- _2 = _1; +- _2 = copy _1; _3 = &_1; - _0 = opaque::<&T>(_3) -> [return: bb1, unwind continue]; + _0 = opaque::<&T>(copy _3) -> [return: bb1, unwind continue]; } bb1: { -- _0 = opaque::<T>(_2) -> [return: bb2, unwind continue]; -+ _0 = opaque::<T>(_1) -> [return: bb2, unwind continue]; +- _0 = opaque::<T>(copy _2) -> [return: bb2, unwind continue]; ++ _0 = opaque::<T>(copy _1) -> [return: bb2, unwind continue]; } bb2: { diff --git a/tests/mir-opt/copy-prop/borrowed_local.compare_address.CopyProp.panic-abort.diff b/tests/mir-opt/copy-prop/borrowed_local.compare_address.CopyProp.panic-abort.diff index 3d6b5dffba4..7e63911d843 100644 --- a/tests/mir-opt/copy-prop/borrowed_local.compare_address.CopyProp.panic-abort.diff +++ b/tests/mir-opt/copy-prop/borrowed_local.compare_address.CopyProp.panic-abort.diff @@ -11,13 +11,13 @@ bb0: { _1 = const 5_u8; _2 = &_1; - _3 = _1; + _3 = copy _1; _4 = &_3; - _0 = cmp_ref(_2, _4) -> [return: bb1, unwind unreachable]; + _0 = cmp_ref(copy _2, copy _4) -> [return: bb1, unwind unreachable]; } bb1: { - _0 = opaque::<u8>(_3) -> [return: bb2, unwind unreachable]; + _0 = opaque::<u8>(copy _3) -> [return: bb2, unwind unreachable]; } bb2: { diff --git a/tests/mir-opt/copy-prop/borrowed_local.compare_address.CopyProp.panic-unwind.diff b/tests/mir-opt/copy-prop/borrowed_local.compare_address.CopyProp.panic-unwind.diff index 0f29d2681de..8e5f8b21fe7 100644 --- a/tests/mir-opt/copy-prop/borrowed_local.compare_address.CopyProp.panic-unwind.diff +++ b/tests/mir-opt/copy-prop/borrowed_local.compare_address.CopyProp.panic-unwind.diff @@ -11,13 +11,13 @@ bb0: { _1 = const 5_u8; _2 = &_1; - _3 = _1; + _3 = copy _1; _4 = &_3; - _0 = cmp_ref(_2, _4) -> [return: bb1, unwind continue]; + _0 = cmp_ref(copy _2, copy _4) -> [return: bb1, unwind continue]; } bb1: { - _0 = opaque::<u8>(_3) -> [return: bb2, unwind continue]; + _0 = opaque::<u8>(copy _3) -> [return: bb2, unwind continue]; } bb2: { diff --git a/tests/mir-opt/copy-prop/borrowed_local.non_freeze.CopyProp.panic-abort.diff b/tests/mir-opt/copy-prop/borrowed_local.non_freeze.CopyProp.panic-abort.diff index af2aeb0dcab..99dda2a95ff 100644 --- a/tests/mir-opt/copy-prop/borrowed_local.non_freeze.CopyProp.panic-abort.diff +++ b/tests/mir-opt/copy-prop/borrowed_local.non_freeze.CopyProp.panic-abort.diff @@ -7,13 +7,13 @@ let mut _3: &T; bb0: { - _2 = _1; + _2 = copy _1; _3 = &_1; - _0 = opaque::<&T>(_3) -> [return: bb1, unwind unreachable]; + _0 = opaque::<&T>(copy _3) -> [return: bb1, unwind unreachable]; } bb1: { - _0 = opaque::<T>(_2) -> [return: bb2, unwind unreachable]; + _0 = opaque::<T>(copy _2) -> [return: bb2, unwind unreachable]; } bb2: { diff --git a/tests/mir-opt/copy-prop/borrowed_local.non_freeze.CopyProp.panic-unwind.diff b/tests/mir-opt/copy-prop/borrowed_local.non_freeze.CopyProp.panic-unwind.diff index 040ed0aec16..6eb48cd8dbc 100644 --- a/tests/mir-opt/copy-prop/borrowed_local.non_freeze.CopyProp.panic-unwind.diff +++ b/tests/mir-opt/copy-prop/borrowed_local.non_freeze.CopyProp.panic-unwind.diff @@ -7,13 +7,13 @@ let mut _3: &T; bb0: { - _2 = _1; + _2 = copy _1; _3 = &_1; - _0 = opaque::<&T>(_3) -> [return: bb1, unwind continue]; + _0 = opaque::<&T>(copy _3) -> [return: bb1, unwind continue]; } bb1: { - _0 = opaque::<T>(_2) -> [return: bb2, unwind continue]; + _0 = opaque::<T>(copy _2) -> [return: bb2, unwind continue]; } bb2: { diff --git a/tests/mir-opt/copy-prop/borrowed_local.rs b/tests/mir-opt/copy-prop/borrowed_local.rs index dd1679513f6..8db19fbd377 100644 --- a/tests/mir-opt/copy-prop/borrowed_local.rs +++ b/tests/mir-opt/copy-prop/borrowed_local.rs @@ -21,11 +21,11 @@ fn compare_address() -> bool { // CHECK: bb0: { // CHECK-NEXT: _1 = const 5_u8; // CHECK-NEXT: _2 = &_1; - // CHECK-NEXT: _3 = _1; + // CHECK-NEXT: _3 = copy _1; // CHECK-NEXT: _4 = &_3; - // CHECK-NEXT: _0 = cmp_ref(_2, _4) + // CHECK-NEXT: _0 = cmp_ref(copy _2, copy _4) // CHECK: bb1: { - // CHECK-NEXT: _0 = opaque::<u8>(_3) + // CHECK-NEXT: _0 = opaque::<u8>(copy _3) mir! { { let a = 5_u8; @@ -51,9 +51,9 @@ fn borrowed<T: Copy + Freeze>(x: T) -> bool { // CHECK-LABEL: fn borrowed( // CHECK: bb0: { // CHECK-NEXT: _3 = &_1; - // CHECK-NEXT: _0 = opaque::<&T>(_3) + // CHECK-NEXT: _0 = opaque::<&T>(copy _3) // CHECK: bb1: { - // CHECK-NEXT: _0 = opaque::<T>(_1) + // CHECK-NEXT: _0 = opaque::<T>(copy _1) mir! { { let a = x; @@ -74,11 +74,11 @@ fn borrowed<T: Copy + Freeze>(x: T) -> bool { fn non_freeze<T: Copy>(x: T) -> bool { // CHECK-LABEL: fn non_freeze( // CHECK: bb0: { - // CHECK-NEXT: _2 = _1; + // CHECK-NEXT: _2 = copy _1; // CHECK-NEXT: _3 = &_1; - // CHECK-NEXT: _0 = opaque::<&T>(_3) + // CHECK-NEXT: _0 = opaque::<&T>(copy _3) // CHECK: bb1: { - // CHECK-NEXT: _0 = opaque::<T>(_2) + // CHECK-NEXT: _0 = opaque::<T>(copy _2) mir! { { let a = x; diff --git a/tests/mir-opt/copy-prop/branch.foo.CopyProp.panic-abort.diff b/tests/mir-opt/copy-prop/branch.foo.CopyProp.panic-abort.diff index 3334cdf92e7..c8889ee716f 100644 --- a/tests/mir-opt/copy-prop/branch.foo.CopyProp.panic-abort.diff +++ b/tests/mir-opt/copy-prop/branch.foo.CopyProp.panic-abort.diff @@ -30,7 +30,7 @@ } bb3: { - _2 = _1; + _2 = copy _1; goto -> bb6; } @@ -41,13 +41,13 @@ bb5: { StorageDead(_4); - _2 = _1; + _2 = copy _1; goto -> bb6; } bb6: { StorageDead(_3); - _0 = _2; + _0 = copy _2; StorageDead(_2); StorageDead(_1); return; diff --git a/tests/mir-opt/copy-prop/branch.foo.CopyProp.panic-unwind.diff b/tests/mir-opt/copy-prop/branch.foo.CopyProp.panic-unwind.diff index 2f92d8818cf..a41c28cb8c8 100644 --- a/tests/mir-opt/copy-prop/branch.foo.CopyProp.panic-unwind.diff +++ b/tests/mir-opt/copy-prop/branch.foo.CopyProp.panic-unwind.diff @@ -30,7 +30,7 @@ } bb3: { - _2 = _1; + _2 = copy _1; goto -> bb6; } @@ -41,13 +41,13 @@ bb5: { StorageDead(_4); - _2 = _1; + _2 = copy _1; goto -> bb6; } bb6: { StorageDead(_3); - _0 = _2; + _0 = copy _2; StorageDead(_2); StorageDead(_1); return; diff --git a/tests/mir-opt/copy-prop/calls.multiple_edges.CopyProp.diff b/tests/mir-opt/copy-prop/calls.multiple_edges.CopyProp.diff index 4d56a8b25d3..9d0a1644ae4 100644 --- a/tests/mir-opt/copy-prop/calls.multiple_edges.CopyProp.diff +++ b/tests/mir-opt/copy-prop/calls.multiple_edges.CopyProp.diff @@ -6,7 +6,7 @@ let mut _2: u8; bb0: { - switchInt(_1) -> [1: bb1, otherwise: bb2]; + switchInt(copy _1) -> [1: bb1, otherwise: bb2]; } bb1: { @@ -14,7 +14,7 @@ } bb2: { - _0 = _2; + _0 = copy _2; return; } } diff --git a/tests/mir-opt/copy-prop/calls.nrvo.CopyProp.diff b/tests/mir-opt/copy-prop/calls.nrvo.CopyProp.diff index b5d56909b0d..29d9ec3f2fc 100644 --- a/tests/mir-opt/copy-prop/calls.nrvo.CopyProp.diff +++ b/tests/mir-opt/copy-prop/calls.nrvo.CopyProp.diff @@ -16,7 +16,7 @@ } bb1: { -- _0 = _1; +- _0 = copy _1; - StorageDead(_1); return; } diff --git a/tests/mir-opt/copy-prop/copy_propagation_arg.arg_src.CopyProp.panic-abort.diff b/tests/mir-opt/copy-prop/copy_propagation_arg.arg_src.CopyProp.panic-abort.diff index 70674a912ed..280908ac63a 100644 --- a/tests/mir-opt/copy-prop/copy_propagation_arg.arg_src.CopyProp.panic-abort.diff +++ b/tests/mir-opt/copy-prop/copy_propagation_arg.arg_src.CopyProp.panic-abort.diff @@ -12,10 +12,10 @@ bb0: { - StorageLive(_2); -- _2 = _1; -+ _0 = _1; +- _2 = copy _1; ++ _0 = copy _1; _1 = const 123_i32; -- _0 = _2; +- _0 = copy _2; - StorageDead(_2); return; } diff --git a/tests/mir-opt/copy-prop/copy_propagation_arg.arg_src.CopyProp.panic-unwind.diff b/tests/mir-opt/copy-prop/copy_propagation_arg.arg_src.CopyProp.panic-unwind.diff index 70674a912ed..280908ac63a 100644 --- a/tests/mir-opt/copy-prop/copy_propagation_arg.arg_src.CopyProp.panic-unwind.diff +++ b/tests/mir-opt/copy-prop/copy_propagation_arg.arg_src.CopyProp.panic-unwind.diff @@ -12,10 +12,10 @@ bb0: { - StorageLive(_2); -- _2 = _1; -+ _0 = _1; +- _2 = copy _1; ++ _0 = copy _1; _1 = const 123_i32; -- _0 = _2; +- _0 = copy _2; - StorageDead(_2); return; } diff --git a/tests/mir-opt/copy-prop/copy_propagation_arg.bar.CopyProp.panic-abort.diff b/tests/mir-opt/copy-prop/copy_propagation_arg.bar.CopyProp.panic-abort.diff index 9ec014e2b25..eea07d5839d 100644 --- a/tests/mir-opt/copy-prop/copy_propagation_arg.bar.CopyProp.panic-abort.diff +++ b/tests/mir-opt/copy-prop/copy_propagation_arg.bar.CopyProp.panic-abort.diff @@ -10,7 +10,7 @@ bb0: { StorageLive(_2); StorageLive(_3); - _3 = _1; + _3 = copy _1; _2 = dummy(move _3) -> [return: bb1, unwind unreachable]; } diff --git a/tests/mir-opt/copy-prop/copy_propagation_arg.bar.CopyProp.panic-unwind.diff b/tests/mir-opt/copy-prop/copy_propagation_arg.bar.CopyProp.panic-unwind.diff index ef9c343a264..b0e5219913a 100644 --- a/tests/mir-opt/copy-prop/copy_propagation_arg.bar.CopyProp.panic-unwind.diff +++ b/tests/mir-opt/copy-prop/copy_propagation_arg.bar.CopyProp.panic-unwind.diff @@ -10,7 +10,7 @@ bb0: { StorageLive(_2); StorageLive(_3); - _3 = _1; + _3 = copy _1; _2 = dummy(move _3) -> [return: bb1, unwind continue]; } diff --git a/tests/mir-opt/copy-prop/copy_propagation_arg.baz.CopyProp.panic-abort.diff b/tests/mir-opt/copy-prop/copy_propagation_arg.baz.CopyProp.panic-abort.diff index 71facf91df7..5fb14902fef 100644 --- a/tests/mir-opt/copy-prop/copy_propagation_arg.baz.CopyProp.panic-abort.diff +++ b/tests/mir-opt/copy-prop/copy_propagation_arg.baz.CopyProp.panic-abort.diff @@ -8,10 +8,10 @@ bb0: { StorageLive(_2); - _2 = _1; + _2 = copy _1; _1 = move _2; StorageDead(_2); - _0 = _1; + _0 = copy _1; return; } } diff --git a/tests/mir-opt/copy-prop/copy_propagation_arg.baz.CopyProp.panic-unwind.diff b/tests/mir-opt/copy-prop/copy_propagation_arg.baz.CopyProp.panic-unwind.diff index 71facf91df7..5fb14902fef 100644 --- a/tests/mir-opt/copy-prop/copy_propagation_arg.baz.CopyProp.panic-unwind.diff +++ b/tests/mir-opt/copy-prop/copy_propagation_arg.baz.CopyProp.panic-unwind.diff @@ -8,10 +8,10 @@ bb0: { StorageLive(_2); - _2 = _1; + _2 = copy _1; _1 = move _2; StorageDead(_2); - _0 = _1; + _0 = copy _1; return; } } diff --git a/tests/mir-opt/copy-prop/copy_propagation_arg.foo.CopyProp.panic-abort.diff b/tests/mir-opt/copy-prop/copy_propagation_arg.foo.CopyProp.panic-abort.diff index 81b73e18763..685a290492e 100644 --- a/tests/mir-opt/copy-prop/copy_propagation_arg.foo.CopyProp.panic-abort.diff +++ b/tests/mir-opt/copy-prop/copy_propagation_arg.foo.CopyProp.panic-abort.diff @@ -10,7 +10,7 @@ bb0: { StorageLive(_2); StorageLive(_3); - _3 = _1; + _3 = copy _1; _2 = dummy(move _3) -> [return: bb1, unwind unreachable]; } diff --git a/tests/mir-opt/copy-prop/copy_propagation_arg.foo.CopyProp.panic-unwind.diff b/tests/mir-opt/copy-prop/copy_propagation_arg.foo.CopyProp.panic-unwind.diff index 769089e16f3..4a0601431ab 100644 --- a/tests/mir-opt/copy-prop/copy_propagation_arg.foo.CopyProp.panic-unwind.diff +++ b/tests/mir-opt/copy-prop/copy_propagation_arg.foo.CopyProp.panic-unwind.diff @@ -10,7 +10,7 @@ bb0: { StorageLive(_2); StorageLive(_3); - _3 = _1; + _3 = copy _1; _2 = dummy(move _3) -> [return: bb1, unwind continue]; } diff --git a/tests/mir-opt/copy-prop/custom_move_arg.f.CopyProp.panic-abort.diff b/tests/mir-opt/copy-prop/custom_move_arg.f.CopyProp.panic-abort.diff index 7ba85301051..1445b899dee 100644 --- a/tests/mir-opt/copy-prop/custom_move_arg.f.CopyProp.panic-abort.diff +++ b/tests/mir-opt/copy-prop/custom_move_arg.f.CopyProp.panic-abort.diff @@ -7,15 +7,15 @@ let mut _3: NotCopy; bb0: { -- _2 = _1; +- _2 = copy _1; - _0 = opaque::<NotCopy>(move _1) -> [return: bb1, unwind unreachable]; -+ _0 = opaque::<NotCopy>(_1) -> [return: bb1, unwind unreachable]; ++ _0 = opaque::<NotCopy>(copy _1) -> [return: bb1, unwind unreachable]; } bb1: { - _3 = move _2; -- _0 = opaque::<NotCopy>(_3) -> [return: bb2, unwind unreachable]; -+ _0 = opaque::<NotCopy>(_1) -> [return: bb2, unwind unreachable]; +- _0 = opaque::<NotCopy>(copy _3) -> [return: bb2, unwind unreachable]; ++ _0 = opaque::<NotCopy>(copy _1) -> [return: bb2, unwind unreachable]; } bb2: { diff --git a/tests/mir-opt/copy-prop/custom_move_arg.f.CopyProp.panic-unwind.diff b/tests/mir-opt/copy-prop/custom_move_arg.f.CopyProp.panic-unwind.diff index 7ba85301051..1445b899dee 100644 --- a/tests/mir-opt/copy-prop/custom_move_arg.f.CopyProp.panic-unwind.diff +++ b/tests/mir-opt/copy-prop/custom_move_arg.f.CopyProp.panic-unwind.diff @@ -7,15 +7,15 @@ let mut _3: NotCopy; bb0: { -- _2 = _1; +- _2 = copy _1; - _0 = opaque::<NotCopy>(move _1) -> [return: bb1, unwind unreachable]; -+ _0 = opaque::<NotCopy>(_1) -> [return: bb1, unwind unreachable]; ++ _0 = opaque::<NotCopy>(copy _1) -> [return: bb1, unwind unreachable]; } bb1: { - _3 = move _2; -- _0 = opaque::<NotCopy>(_3) -> [return: bb2, unwind unreachable]; -+ _0 = opaque::<NotCopy>(_1) -> [return: bb2, unwind unreachable]; +- _0 = opaque::<NotCopy>(copy _3) -> [return: bb2, unwind unreachable]; ++ _0 = opaque::<NotCopy>(copy _1) -> [return: bb2, unwind unreachable]; } bb2: { diff --git a/tests/mir-opt/copy-prop/cycle.main.CopyProp.panic-abort.diff b/tests/mir-opt/copy-prop/cycle.main.CopyProp.panic-abort.diff index 8f97c4e439e..d133091e6a4 100644 --- a/tests/mir-opt/copy-prop/cycle.main.CopyProp.panic-abort.diff +++ b/tests/mir-opt/copy-prop/cycle.main.CopyProp.panic-abort.diff @@ -27,17 +27,17 @@ bb1: { - StorageLive(_2); - _2 = _1; + _2 = copy _1; - StorageLive(_3); -- _3 = _2; +- _3 = copy _2; - StorageLive(_4); -- _4 = _3; +- _4 = copy _3; - _1 = move _4; - StorageDead(_4); -+ _1 = _2; ++ _1 = copy _2; StorageLive(_5); StorageLive(_6); - _6 = _1; + _6 = copy _1; _5 = std::mem::drop::<i32>(move _6) -> [return: bb2, unwind unreachable]; } diff --git a/tests/mir-opt/copy-prop/cycle.main.CopyProp.panic-unwind.diff b/tests/mir-opt/copy-prop/cycle.main.CopyProp.panic-unwind.diff index e343b78924a..bd4ad737cec 100644 --- a/tests/mir-opt/copy-prop/cycle.main.CopyProp.panic-unwind.diff +++ b/tests/mir-opt/copy-prop/cycle.main.CopyProp.panic-unwind.diff @@ -27,17 +27,17 @@ bb1: { - StorageLive(_2); - _2 = _1; + _2 = copy _1; - StorageLive(_3); -- _3 = _2; +- _3 = copy _2; - StorageLive(_4); -- _4 = _3; +- _4 = copy _3; - _1 = move _4; - StorageDead(_4); -+ _1 = _2; ++ _1 = copy _2; StorageLive(_5); StorageLive(_6); - _6 = _1; + _6 = copy _1; _5 = std::mem::drop::<i32>(move _6) -> [return: bb2, unwind continue]; } diff --git a/tests/mir-opt/copy-prop/dead_stores_79191.f.CopyProp.after.panic-abort.mir b/tests/mir-opt/copy-prop/dead_stores_79191.f.CopyProp.after.panic-abort.mir index 02b88d14003..4781fdfd902 100644 --- a/tests/mir-opt/copy-prop/dead_stores_79191.f.CopyProp.after.panic-abort.mir +++ b/tests/mir-opt/copy-prop/dead_stores_79191.f.CopyProp.after.panic-abort.mir @@ -11,11 +11,11 @@ fn f(_1: usize) -> usize { } bb0: { - _2 = _1; + _2 = copy _1; _1 = const 5_usize; - _1 = _2; + _1 = copy _2; StorageLive(_4); - _4 = _1; + _4 = copy _1; _0 = id::<usize>(move _4) -> [return: bb1, unwind unreachable]; } diff --git a/tests/mir-opt/copy-prop/dead_stores_79191.f.CopyProp.after.panic-unwind.mir b/tests/mir-opt/copy-prop/dead_stores_79191.f.CopyProp.after.panic-unwind.mir index f8c285ff384..f5fded45c13 100644 --- a/tests/mir-opt/copy-prop/dead_stores_79191.f.CopyProp.after.panic-unwind.mir +++ b/tests/mir-opt/copy-prop/dead_stores_79191.f.CopyProp.after.panic-unwind.mir @@ -11,11 +11,11 @@ fn f(_1: usize) -> usize { } bb0: { - _2 = _1; + _2 = copy _1; _1 = const 5_usize; - _1 = _2; + _1 = copy _2; StorageLive(_4); - _4 = _1; + _4 = copy _1; _0 = id::<usize>(move _4) -> [return: bb1, unwind continue]; } diff --git a/tests/mir-opt/copy-prop/dead_stores_better.f.CopyProp.after.panic-abort.mir b/tests/mir-opt/copy-prop/dead_stores_better.f.CopyProp.after.panic-abort.mir index 02b88d14003..4781fdfd902 100644 --- a/tests/mir-opt/copy-prop/dead_stores_better.f.CopyProp.after.panic-abort.mir +++ b/tests/mir-opt/copy-prop/dead_stores_better.f.CopyProp.after.panic-abort.mir @@ -11,11 +11,11 @@ fn f(_1: usize) -> usize { } bb0: { - _2 = _1; + _2 = copy _1; _1 = const 5_usize; - _1 = _2; + _1 = copy _2; StorageLive(_4); - _4 = _1; + _4 = copy _1; _0 = id::<usize>(move _4) -> [return: bb1, unwind unreachable]; } diff --git a/tests/mir-opt/copy-prop/dead_stores_better.f.CopyProp.after.panic-unwind.mir b/tests/mir-opt/copy-prop/dead_stores_better.f.CopyProp.after.panic-unwind.mir index f8c285ff384..f5fded45c13 100644 --- a/tests/mir-opt/copy-prop/dead_stores_better.f.CopyProp.after.panic-unwind.mir +++ b/tests/mir-opt/copy-prop/dead_stores_better.f.CopyProp.after.panic-unwind.mir @@ -11,11 +11,11 @@ fn f(_1: usize) -> usize { } bb0: { - _2 = _1; + _2 = copy _1; _1 = const 5_usize; - _1 = _2; + _1 = copy _2; StorageLive(_4); - _4 = _1; + _4 = copy _1; _0 = id::<usize>(move _4) -> [return: bb1, unwind continue]; } diff --git a/tests/mir-opt/copy-prop/issue_107511.main.CopyProp.panic-abort.diff b/tests/mir-opt/copy-prop/issue_107511.main.CopyProp.panic-abort.diff index 51390e2abbe..f4411886f9a 100644 --- a/tests/mir-opt/copy-prop/issue_107511.main.CopyProp.panic-abort.diff +++ b/tests/mir-opt/copy-prop/issue_107511.main.CopyProp.panic-abort.diff @@ -88,15 +88,15 @@ bb6: { - StorageLive(_16); - _16 = ((_11 as Some).0: usize); + _16 = copy ((_11 as Some).0: usize); StorageLive(_17); - StorageLive(_18); -- _18 = _16; +- _18 = copy _16; _19 = Len(_2); -- _20 = Lt(_18, _19); -- assert(move _20, "index out of bounds: the length is {} but the index is {}", move _19, _18) -> [success: bb8, unwind unreachable]; -+ _20 = Lt(_16, _19); -+ assert(move _20, "index out of bounds: the length is {} but the index is {}", move _19, _16) -> [success: bb8, unwind unreachable]; +- _20 = Lt(copy _18, copy _19); +- assert(move _20, "index out of bounds: the length is {} but the index is {}", move _19, copy _18) -> [success: bb8, unwind unreachable]; ++ _20 = Lt(copy _16, copy _19); ++ assert(move _20, "index out of bounds: the length is {} but the index is {}", move _19, copy _16) -> [success: bb8, unwind unreachable]; } bb7: { @@ -112,9 +112,9 @@ } bb8: { -- _17 = _2[_18]; -+ _17 = _2[_16]; - _1 = Add(_1, move _17); +- _17 = copy _2[_18]; ++ _17 = copy _2[_16]; + _1 = Add(copy _1, move _17); StorageDead(_17); - StorageDead(_18); - _10 = const (); diff --git a/tests/mir-opt/copy-prop/issue_107511.main.CopyProp.panic-unwind.diff b/tests/mir-opt/copy-prop/issue_107511.main.CopyProp.panic-unwind.diff index 8a2cbb68824..833588aa4e9 100644 --- a/tests/mir-opt/copy-prop/issue_107511.main.CopyProp.panic-unwind.diff +++ b/tests/mir-opt/copy-prop/issue_107511.main.CopyProp.panic-unwind.diff @@ -88,15 +88,15 @@ bb6: { - StorageLive(_16); - _16 = ((_11 as Some).0: usize); + _16 = copy ((_11 as Some).0: usize); StorageLive(_17); - StorageLive(_18); -- _18 = _16; +- _18 = copy _16; _19 = Len(_2); -- _20 = Lt(_18, _19); -- assert(move _20, "index out of bounds: the length is {} but the index is {}", move _19, _18) -> [success: bb8, unwind continue]; -+ _20 = Lt(_16, _19); -+ assert(move _20, "index out of bounds: the length is {} but the index is {}", move _19, _16) -> [success: bb8, unwind continue]; +- _20 = Lt(copy _18, copy _19); +- assert(move _20, "index out of bounds: the length is {} but the index is {}", move _19, copy _18) -> [success: bb8, unwind continue]; ++ _20 = Lt(copy _16, copy _19); ++ assert(move _20, "index out of bounds: the length is {} but the index is {}", move _19, copy _16) -> [success: bb8, unwind continue]; } bb7: { @@ -112,9 +112,9 @@ } bb8: { -- _17 = _2[_18]; -+ _17 = _2[_16]; - _1 = Add(_1, move _17); +- _17 = copy _2[_18]; ++ _17 = copy _2[_16]; + _1 = Add(copy _1, move _17); StorageDead(_17); - StorageDead(_18); - _10 = const (); diff --git a/tests/mir-opt/copy-prop/move_arg.f.CopyProp.panic-abort.diff b/tests/mir-opt/copy-prop/move_arg.f.CopyProp.panic-abort.diff index cf04f213efb..da9904bfa01 100644 --- a/tests/mir-opt/copy-prop/move_arg.f.CopyProp.panic-abort.diff +++ b/tests/mir-opt/copy-prop/move_arg.f.CopyProp.panic-abort.diff @@ -15,14 +15,14 @@ bb0: { - StorageLive(_2); -- _2 = _1; +- _2 = copy _1; StorageLive(_3); - StorageLive(_4); -- _4 = _1; +- _4 = copy _1; - StorageLive(_5); -- _5 = _2; +- _5 = copy _2; - _3 = g::<T>(move _4, move _5) -> [return: bb1, unwind unreachable]; -+ _3 = g::<T>(_1, _1) -> [return: bb1, unwind unreachable]; ++ _3 = g::<T>(copy _1, copy _1) -> [return: bb1, unwind unreachable]; } bb1: { diff --git a/tests/mir-opt/copy-prop/move_arg.f.CopyProp.panic-unwind.diff b/tests/mir-opt/copy-prop/move_arg.f.CopyProp.panic-unwind.diff index 0c6a3c6d5c9..9b0de655bd2 100644 --- a/tests/mir-opt/copy-prop/move_arg.f.CopyProp.panic-unwind.diff +++ b/tests/mir-opt/copy-prop/move_arg.f.CopyProp.panic-unwind.diff @@ -15,14 +15,14 @@ bb0: { - StorageLive(_2); -- _2 = _1; +- _2 = copy _1; StorageLive(_3); - StorageLive(_4); -- _4 = _1; +- _4 = copy _1; - StorageLive(_5); -- _5 = _2; +- _5 = copy _2; - _3 = g::<T>(move _4, move _5) -> [return: bb1, unwind continue]; -+ _3 = g::<T>(_1, _1) -> [return: bb1, unwind continue]; ++ _3 = g::<T>(copy _1, copy _1) -> [return: bb1, unwind continue]; } bb1: { diff --git a/tests/mir-opt/copy-prop/move_projection.f.CopyProp.panic-abort.diff b/tests/mir-opt/copy-prop/move_projection.f.CopyProp.panic-abort.diff index b2b89968d70..973bcd6de83 100644 --- a/tests/mir-opt/copy-prop/move_projection.f.CopyProp.panic-abort.diff +++ b/tests/mir-opt/copy-prop/move_projection.f.CopyProp.panic-abort.diff @@ -7,11 +7,11 @@ let mut _3: u8; bb0: { -- _2 = _1; +- _2 = copy _1; - _3 = move (_2.0: u8); - _0 = opaque::<Foo>(move _1) -> [return: bb1, unwind unreachable]; -+ _3 = (_1.0: u8); -+ _0 = opaque::<Foo>(_1) -> [return: bb1, unwind unreachable]; ++ _3 = copy (_1.0: u8); ++ _0 = opaque::<Foo>(copy _1) -> [return: bb1, unwind unreachable]; } bb1: { diff --git a/tests/mir-opt/copy-prop/move_projection.f.CopyProp.panic-unwind.diff b/tests/mir-opt/copy-prop/move_projection.f.CopyProp.panic-unwind.diff index b2b89968d70..973bcd6de83 100644 --- a/tests/mir-opt/copy-prop/move_projection.f.CopyProp.panic-unwind.diff +++ b/tests/mir-opt/copy-prop/move_projection.f.CopyProp.panic-unwind.diff @@ -7,11 +7,11 @@ let mut _3: u8; bb0: { -- _2 = _1; +- _2 = copy _1; - _3 = move (_2.0: u8); - _0 = opaque::<Foo>(move _1) -> [return: bb1, unwind unreachable]; -+ _3 = (_1.0: u8); -+ _0 = opaque::<Foo>(_1) -> [return: bb1, unwind unreachable]; ++ _3 = copy (_1.0: u8); ++ _0 = opaque::<Foo>(copy _1) -> [return: bb1, unwind unreachable]; } bb1: { diff --git a/tests/mir-opt/copy-prop/mutate_through_pointer.f.CopyProp.diff b/tests/mir-opt/copy-prop/mutate_through_pointer.f.CopyProp.diff index 7f6802beeae..f96be627129 100644 --- a/tests/mir-opt/copy-prop/mutate_through_pointer.f.CopyProp.diff +++ b/tests/mir-opt/copy-prop/mutate_through_pointer.f.CopyProp.diff @@ -8,11 +8,11 @@ let mut _4: *mut bool; bb0: { - _2 = _1; + _2 = copy _1; _3 = &raw const _2; _4 = &raw mut (*_3); (*_4) = const false; - _0 = _1; + _0 = copy _1; return; } } diff --git a/tests/mir-opt/copy-prop/non_dominate.f.CopyProp.diff b/tests/mir-opt/copy-prop/non_dominate.f.CopyProp.diff index 5bf2335943c..6955d694e5a 100644 --- a/tests/mir-opt/copy-prop/non_dominate.f.CopyProp.diff +++ b/tests/mir-opt/copy-prop/non_dominate.f.CopyProp.diff @@ -11,18 +11,18 @@ } bb1: { - _3 = _1; - switchInt(_3) -> [0: bb3, otherwise: bb2]; + _3 = copy _1; + switchInt(copy _3) -> [0: bb3, otherwise: bb2]; } bb2: { - _2 = _3; + _2 = copy _3; _1 = const false; goto -> bb1; } bb3: { - _0 = _2; + _0 = copy _2; return; } } diff --git a/tests/mir-opt/copy-prop/reborrow.demiraw.CopyProp.panic-abort.diff b/tests/mir-opt/copy-prop/reborrow.demiraw.CopyProp.panic-abort.diff index ef30ac2fc8c..676c5cee343 100644 --- a/tests/mir-opt/copy-prop/reborrow.demiraw.CopyProp.panic-abort.diff +++ b/tests/mir-opt/copy-prop/reborrow.demiraw.CopyProp.panic-abort.diff @@ -30,12 +30,12 @@ _3 = &mut (*_4); StorageDead(_4); - StorageLive(_5); -- _5 = _2; +- _5 = copy _2; StorageLive(_6); - StorageLive(_7); -- _7 = _5; +- _7 = copy _5; - _6 = opaque::<*mut u8>(move _7) -> [return: bb1, unwind unreachable]; -+ _6 = opaque::<*mut u8>(_2) -> [return: bb1, unwind unreachable]; ++ _6 = opaque::<*mut u8>(copy _2) -> [return: bb1, unwind unreachable]; } bb1: { diff --git a/tests/mir-opt/copy-prop/reborrow.demiraw.CopyProp.panic-unwind.diff b/tests/mir-opt/copy-prop/reborrow.demiraw.CopyProp.panic-unwind.diff index a743a3e829a..ca2232ce54a 100644 --- a/tests/mir-opt/copy-prop/reborrow.demiraw.CopyProp.panic-unwind.diff +++ b/tests/mir-opt/copy-prop/reborrow.demiraw.CopyProp.panic-unwind.diff @@ -30,12 +30,12 @@ _3 = &mut (*_4); StorageDead(_4); - StorageLive(_5); -- _5 = _2; +- _5 = copy _2; StorageLive(_6); - StorageLive(_7); -- _7 = _5; +- _7 = copy _5; - _6 = opaque::<*mut u8>(move _7) -> [return: bb1, unwind continue]; -+ _6 = opaque::<*mut u8>(_2) -> [return: bb1, unwind continue]; ++ _6 = opaque::<*mut u8>(copy _2) -> [return: bb1, unwind continue]; } bb1: { diff --git a/tests/mir-opt/copy-prop/reborrow.miraw.CopyProp.panic-abort.diff b/tests/mir-opt/copy-prop/reborrow.miraw.CopyProp.panic-abort.diff index 2de6f85ce64..1968696905f 100644 --- a/tests/mir-opt/copy-prop/reborrow.miraw.CopyProp.panic-abort.diff +++ b/tests/mir-opt/copy-prop/reborrow.miraw.CopyProp.panic-abort.diff @@ -26,12 +26,12 @@ StorageLive(_3); _3 = &raw mut (*_2); - StorageLive(_4); -- _4 = _2; +- _4 = copy _2; StorageLive(_5); - StorageLive(_6); -- _6 = _4; +- _6 = copy _4; - _5 = opaque::<*mut u8>(move _6) -> [return: bb1, unwind unreachable]; -+ _5 = opaque::<*mut u8>(_2) -> [return: bb1, unwind unreachable]; ++ _5 = opaque::<*mut u8>(copy _2) -> [return: bb1, unwind unreachable]; } bb1: { diff --git a/tests/mir-opt/copy-prop/reborrow.miraw.CopyProp.panic-unwind.diff b/tests/mir-opt/copy-prop/reborrow.miraw.CopyProp.panic-unwind.diff index 2afec4898bc..9a3c9665bc8 100644 --- a/tests/mir-opt/copy-prop/reborrow.miraw.CopyProp.panic-unwind.diff +++ b/tests/mir-opt/copy-prop/reborrow.miraw.CopyProp.panic-unwind.diff @@ -26,12 +26,12 @@ StorageLive(_3); _3 = &raw mut (*_2); - StorageLive(_4); -- _4 = _2; +- _4 = copy _2; StorageLive(_5); - StorageLive(_6); -- _6 = _4; +- _6 = copy _4; - _5 = opaque::<*mut u8>(move _6) -> [return: bb1, unwind continue]; -+ _5 = opaque::<*mut u8>(_2) -> [return: bb1, unwind continue]; ++ _5 = opaque::<*mut u8>(copy _2) -> [return: bb1, unwind continue]; } bb1: { diff --git a/tests/mir-opt/copy-prop/reborrow.rs b/tests/mir-opt/copy-prop/reborrow.rs index 2f1720556cd..51a1f92cde2 100644 --- a/tests/mir-opt/copy-prop/reborrow.rs +++ b/tests/mir-opt/copy-prop/reborrow.rs @@ -3,8 +3,6 @@ // Check that CopyProp considers reborrows as not mutating the pointer. //@ test-mir-pass: CopyProp -#![feature(raw_ref_op)] - #[inline(never)] fn opaque(_: impl Sized) {} diff --git a/tests/mir-opt/coverage/branch_match_arms.main.InstrumentCoverage.diff b/tests/mir-opt/coverage/branch_match_arms.main.InstrumentCoverage.diff index 3d791734f46..eeeac70b5b8 100644 --- a/tests/mir-opt/coverage/branch_match_arms.main.InstrumentCoverage.diff +++ b/tests/mir-opt/coverage/branch_match_arms.main.InstrumentCoverage.diff @@ -71,33 +71,33 @@ bb5: { + Coverage::ExpressionUsed(2); StorageLive(_9); - _9 = ((_1 as A).0: u32); + _9 = copy ((_1 as A).0: u32); StorageLive(_10); - _10 = _9; + _10 = copy _9; _0 = consume(move _10) -> [return: bb12, unwind: bb14]; } bb6: { StorageLive(_7); - _7 = ((_1 as B).0: u32); + _7 = copy ((_1 as B).0: u32); StorageLive(_8); - _8 = _7; + _8 = copy _7; _0 = consume(move _8) -> [return: bb11, unwind: bb14]; } bb7: { StorageLive(_5); - _5 = ((_1 as C).0: u32); + _5 = copy ((_1 as C).0: u32); StorageLive(_6); - _6 = _5; + _6 = copy _5; _0 = consume(move _6) -> [return: bb10, unwind: bb14]; } bb8: { StorageLive(_3); - _3 = ((_1 as D).0: u32); + _3 = copy ((_1 as D).0: u32); StorageLive(_4); - _4 = _3; + _4 = copy _3; _0 = consume(move _4) -> [return: bb9, unwind: bb14]; } diff --git a/tests/mir-opt/dataflow-const-prop/aggregate_copy.foo.DataflowConstProp.diff b/tests/mir-opt/dataflow-const-prop/aggregate_copy.foo.DataflowConstProp.diff index 3b739a25cb8..8dd34d84580 100644 --- a/tests/mir-opt/dataflow-const-prop/aggregate_copy.foo.DataflowConstProp.diff +++ b/tests/mir-opt/dataflow-const-prop/aggregate_copy.foo.DataflowConstProp.diff @@ -22,14 +22,14 @@ StorageLive(_1); _1 = const Foo; StorageLive(_2); -- _2 = _1; +- _2 = copy _1; + _2 = const (5_u32, 3_u32); StorageLive(_3); -- _3 = (_2.1: u32); +- _3 = copy (_2.1: u32); + _3 = const 3_u32; StorageLive(_4); StorageLive(_5); -- _5 = _3; +- _5 = copy _3; - _4 = Ge(move _5, const 2_u32); - switchInt(move _4) -> [0: bb2, otherwise: bb1]; + _5 = const 3_u32; @@ -39,7 +39,7 @@ bb1: { StorageDead(_5); -- _0 = (_2.0: u32); +- _0 = copy (_2.0: u32); + _0 = const 5_u32; goto -> bb3; } diff --git a/tests/mir-opt/dataflow-const-prop/array_index.main.DataflowConstProp.32bit.panic-abort.diff b/tests/mir-opt/dataflow-const-prop/array_index.main.DataflowConstProp.32bit.panic-abort.diff index 212ddc5b154..a46daef435f 100644 --- a/tests/mir-opt/dataflow-const-prop/array_index.main.DataflowConstProp.32bit.panic-abort.diff +++ b/tests/mir-opt/dataflow-const-prop/array_index.main.DataflowConstProp.32bit.panic-abort.diff @@ -19,16 +19,16 @@ StorageLive(_3); _3 = const 2_usize; - _4 = Len(_2); -- _5 = Lt(_3, _4); -- assert(move _5, "index out of bounds: the length is {} but the index is {}", move _4, _3) -> [success: bb1, unwind unreachable]; +- _5 = Lt(copy _3, copy _4); +- assert(move _5, "index out of bounds: the length is {} but the index is {}", move _4, copy _3) -> [success: bb1, unwind unreachable]; + _4 = const 4_usize; + _5 = const true; + assert(const true, "index out of bounds: the length is {} but the index is {}", const 4_usize, const 2_usize) -> [success: bb1, unwind unreachable]; } bb1: { -- _1 = _2[_3]; -+ _1 = _2[2 of 3]; +- _1 = copy _2[_3]; ++ _1 = copy _2[2 of 3]; StorageDead(_3); StorageDead(_2); _0 = const (); diff --git a/tests/mir-opt/dataflow-const-prop/array_index.main.DataflowConstProp.32bit.panic-unwind.diff b/tests/mir-opt/dataflow-const-prop/array_index.main.DataflowConstProp.32bit.panic-unwind.diff index 5c53d4f4461..1a4e15b45fa 100644 --- a/tests/mir-opt/dataflow-const-prop/array_index.main.DataflowConstProp.32bit.panic-unwind.diff +++ b/tests/mir-opt/dataflow-const-prop/array_index.main.DataflowConstProp.32bit.panic-unwind.diff @@ -19,16 +19,16 @@ StorageLive(_3); _3 = const 2_usize; - _4 = Len(_2); -- _5 = Lt(_3, _4); -- assert(move _5, "index out of bounds: the length is {} but the index is {}", move _4, _3) -> [success: bb1, unwind continue]; +- _5 = Lt(copy _3, copy _4); +- assert(move _5, "index out of bounds: the length is {} but the index is {}", move _4, copy _3) -> [success: bb1, unwind continue]; + _4 = const 4_usize; + _5 = const true; + assert(const true, "index out of bounds: the length is {} but the index is {}", const 4_usize, const 2_usize) -> [success: bb1, unwind continue]; } bb1: { -- _1 = _2[_3]; -+ _1 = _2[2 of 3]; +- _1 = copy _2[_3]; ++ _1 = copy _2[2 of 3]; StorageDead(_3); StorageDead(_2); _0 = const (); diff --git a/tests/mir-opt/dataflow-const-prop/array_index.main.DataflowConstProp.64bit.panic-abort.diff b/tests/mir-opt/dataflow-const-prop/array_index.main.DataflowConstProp.64bit.panic-abort.diff index 212ddc5b154..a46daef435f 100644 --- a/tests/mir-opt/dataflow-const-prop/array_index.main.DataflowConstProp.64bit.panic-abort.diff +++ b/tests/mir-opt/dataflow-const-prop/array_index.main.DataflowConstProp.64bit.panic-abort.diff @@ -19,16 +19,16 @@ StorageLive(_3); _3 = const 2_usize; - _4 = Len(_2); -- _5 = Lt(_3, _4); -- assert(move _5, "index out of bounds: the length is {} but the index is {}", move _4, _3) -> [success: bb1, unwind unreachable]; +- _5 = Lt(copy _3, copy _4); +- assert(move _5, "index out of bounds: the length is {} but the index is {}", move _4, copy _3) -> [success: bb1, unwind unreachable]; + _4 = const 4_usize; + _5 = const true; + assert(const true, "index out of bounds: the length is {} but the index is {}", const 4_usize, const 2_usize) -> [success: bb1, unwind unreachable]; } bb1: { -- _1 = _2[_3]; -+ _1 = _2[2 of 3]; +- _1 = copy _2[_3]; ++ _1 = copy _2[2 of 3]; StorageDead(_3); StorageDead(_2); _0 = const (); diff --git a/tests/mir-opt/dataflow-const-prop/array_index.main.DataflowConstProp.64bit.panic-unwind.diff b/tests/mir-opt/dataflow-const-prop/array_index.main.DataflowConstProp.64bit.panic-unwind.diff index 5c53d4f4461..1a4e15b45fa 100644 --- a/tests/mir-opt/dataflow-const-prop/array_index.main.DataflowConstProp.64bit.panic-unwind.diff +++ b/tests/mir-opt/dataflow-const-prop/array_index.main.DataflowConstProp.64bit.panic-unwind.diff @@ -19,16 +19,16 @@ StorageLive(_3); _3 = const 2_usize; - _4 = Len(_2); -- _5 = Lt(_3, _4); -- assert(move _5, "index out of bounds: the length is {} but the index is {}", move _4, _3) -> [success: bb1, unwind continue]; +- _5 = Lt(copy _3, copy _4); +- assert(move _5, "index out of bounds: the length is {} but the index is {}", move _4, copy _3) -> [success: bb1, unwind continue]; + _4 = const 4_usize; + _5 = const true; + assert(const true, "index out of bounds: the length is {} but the index is {}", const 4_usize, const 2_usize) -> [success: bb1, unwind continue]; } bb1: { -- _1 = _2[_3]; -+ _1 = _2[2 of 3]; +- _1 = copy _2[_3]; ++ _1 = copy _2[2 of 3]; StorageDead(_3); StorageDead(_2); _0 = const (); diff --git a/tests/mir-opt/dataflow-const-prop/array_index.rs b/tests/mir-opt/dataflow-const-prop/array_index.rs index daf9c7729c6..e442ef99f79 100644 --- a/tests/mir-opt/dataflow-const-prop/array_index.rs +++ b/tests/mir-opt/dataflow-const-prop/array_index.rs @@ -16,6 +16,6 @@ fn main() { // CHECK: {{_.*}} = const 4_usize; // CHECK: {{_.*}} = const true; // CHECK: assert(const true - // CHECK: [[x]] = [[array_lit]][2 of 3]; + // CHECK: [[x]] = copy [[array_lit]][2 of 3]; let x: u32 = [0, 1, 2, 3][2]; } diff --git a/tests/mir-opt/dataflow-const-prop/boolean_identities.test.DataflowConstProp.diff b/tests/mir-opt/dataflow-const-prop/boolean_identities.test.DataflowConstProp.diff index 5440c38ce4b..89175fbad5c 100644 --- a/tests/mir-opt/dataflow-const-prop/boolean_identities.test.DataflowConstProp.diff +++ b/tests/mir-opt/dataflow-const-prop/boolean_identities.test.DataflowConstProp.diff @@ -13,13 +13,13 @@ bb0: { StorageLive(_3); StorageLive(_4); - _4 = _2; + _4 = copy _2; - _3 = BitOr(move _4, const true); + _3 = const true; StorageDead(_4); StorageLive(_5); StorageLive(_6); - _6 = _1; + _6 = copy _1; - _5 = BitAnd(move _6, const false); + _5 = const false; StorageDead(_6); diff --git a/tests/mir-opt/dataflow-const-prop/cast.main.DataflowConstProp.diff b/tests/mir-opt/dataflow-const-prop/cast.main.DataflowConstProp.diff index 0ca446c89f2..f2c262f9fe2 100644 --- a/tests/mir-opt/dataflow-const-prop/cast.main.DataflowConstProp.diff +++ b/tests/mir-opt/dataflow-const-prop/cast.main.DataflowConstProp.diff @@ -20,7 +20,7 @@ StorageLive(_2); StorageLive(_3); StorageLive(_4); -- _4 = _1; +- _4 = copy _1; - _3 = move _4 as u8 (IntToInt); + _4 = const 257_i32; + _3 = const 1_u8; diff --git a/tests/mir-opt/dataflow-const-prop/checked.main.DataflowConstProp.panic-abort.diff b/tests/mir-opt/dataflow-const-prop/checked.main.DataflowConstProp.panic-abort.diff index 79ea5561748..867e768790f 100644 --- a/tests/mir-opt/dataflow-const-prop/checked.main.DataflowConstProp.panic-abort.diff +++ b/tests/mir-opt/dataflow-const-prop/checked.main.DataflowConstProp.panic-abort.diff @@ -36,11 +36,11 @@ _2 = const 2_i32; StorageLive(_3); StorageLive(_4); -- _4 = _1; +- _4 = copy _1; + _4 = const 1_i32; StorageLive(_5); -- _5 = _2; -- _6 = AddWithOverflow(_4, _5); +- _5 = copy _2; +- _6 = AddWithOverflow(copy _4, copy _5); - assert(!move (_6.1: bool), "attempt to compute `{} + {}`, which would overflow", move _4, move _5) -> [success: bb1, unwind unreachable]; + _5 = const 2_i32; + _6 = const (3_i32, false); @@ -56,8 +56,8 @@ _7 = const core::num::<impl i32>::MAX; StorageLive(_8); StorageLive(_9); -- _9 = _7; -- _10 = AddWithOverflow(_9, const 1_i32); +- _9 = copy _7; +- _10 = AddWithOverflow(copy _9, const 1_i32); - assert(!move (_10.1: bool), "attempt to compute `{} + {}`, which would overflow", move _9, const 1_i32) -> [success: bb2, unwind unreachable]; + _9 = const i32::MAX; + _10 = const (i32::MIN, true); diff --git a/tests/mir-opt/dataflow-const-prop/checked.main.DataflowConstProp.panic-unwind.diff b/tests/mir-opt/dataflow-const-prop/checked.main.DataflowConstProp.panic-unwind.diff index bd22c50dd8f..c22edaaec40 100644 --- a/tests/mir-opt/dataflow-const-prop/checked.main.DataflowConstProp.panic-unwind.diff +++ b/tests/mir-opt/dataflow-const-prop/checked.main.DataflowConstProp.panic-unwind.diff @@ -36,11 +36,11 @@ _2 = const 2_i32; StorageLive(_3); StorageLive(_4); -- _4 = _1; +- _4 = copy _1; + _4 = const 1_i32; StorageLive(_5); -- _5 = _2; -- _6 = AddWithOverflow(_4, _5); +- _5 = copy _2; +- _6 = AddWithOverflow(copy _4, copy _5); - assert(!move (_6.1: bool), "attempt to compute `{} + {}`, which would overflow", move _4, move _5) -> [success: bb1, unwind continue]; + _5 = const 2_i32; + _6 = const (3_i32, false); @@ -56,8 +56,8 @@ _7 = const core::num::<impl i32>::MAX; StorageLive(_8); StorageLive(_9); -- _9 = _7; -- _10 = AddWithOverflow(_9, const 1_i32); +- _9 = copy _7; +- _10 = AddWithOverflow(copy _9, const 1_i32); - assert(!move (_10.1: bool), "attempt to compute `{} + {}`, which would overflow", move _9, const 1_i32) -> [success: bb2, unwind continue]; + _9 = const i32::MAX; + _10 = const (i32::MIN, true); diff --git a/tests/mir-opt/dataflow-const-prop/default_boxed_slice.main.GVN.32bit.panic-abort.diff b/tests/mir-opt/dataflow-const-prop/default_boxed_slice.main.GVN.32bit.panic-abort.diff index 9d96e895c8a..c7870a7902b 100644 --- a/tests/mir-opt/dataflow-const-prop/default_boxed_slice.main.GVN.32bit.panic-abort.diff +++ b/tests/mir-opt/dataflow-const-prop/default_boxed_slice.main.GVN.32bit.panic-abort.diff @@ -50,7 +50,7 @@ StorageLive(_6); StorageLive(_7); - _7 = AlignOf([bool; 0]); -- _6 = _7 as *mut [bool; 0] (Transmute); +- _6 = copy _7 as *mut [bool; 0] (Transmute); + _7 = const 1_usize; + _6 = const {0x1 as *mut [bool; 0]}; StorageDead(_7); @@ -67,7 +67,7 @@ bb2: { StorageLive(_10); -- _10 = _6 as *mut () (PtrToPtr); +- _10 = copy _6 as *mut () (PtrToPtr); - _9 = NonNull::<T>::new_unchecked::precondition_check(move _10) -> [return: bb3, unwind unreachable]; + _10 = const {0x1 as *mut ()}; + _9 = NonNull::<T>::new_unchecked::precondition_check(const {0x1 as *mut ()}) -> [return: bb3, unwind unreachable]; @@ -80,8 +80,8 @@ bb4: { StorageDead(_8); -- _11 = _6 as *const [bool; 0] (PtrToPtr); -- _5 = NonNull::<[bool; 0]> { pointer: _11 }; +- _11 = copy _6 as *const [bool; 0] (PtrToPtr); +- _5 = NonNull::<[bool; 0]> { pointer: copy _11 }; + _11 = const {0x1 as *const [bool; 0]}; + _5 = const NonNull::<[bool; 0]> {{ pointer: {0x1 as *const [bool; 0]} }}; StorageDead(_11); @@ -92,7 +92,7 @@ - _3 = move _4 as std::ptr::Unique<[bool]> (PointerCoercion(Unsize)); + _3 = const Unique::<[bool]> {{ pointer: NonNull::<[bool]> {{ pointer: Indirect { alloc_id: ALLOC0, offset: Size(0 bytes) }: *const [bool] }}, _marker: PhantomData::<[bool]> }}; StorageDead(_4); -- _2 = Box::<[bool]>(_3, const std::alloc::Global); +- _2 = Box::<[bool]>(copy _3, const std::alloc::Global); + _2 = const Box::<[bool]>(Unique::<[bool]> {{ pointer: NonNull::<[bool]> {{ pointer: Indirect { alloc_id: ALLOC1, offset: Size(0 bytes) }: *const [bool] }}, _marker: PhantomData::<[bool]> }}, std::alloc::Global); StorageDead(_9); StorageDead(_3); diff --git a/tests/mir-opt/dataflow-const-prop/default_boxed_slice.main.GVN.32bit.panic-unwind.diff b/tests/mir-opt/dataflow-const-prop/default_boxed_slice.main.GVN.32bit.panic-unwind.diff index 0bdff584b01..f5de7a361bc 100644 --- a/tests/mir-opt/dataflow-const-prop/default_boxed_slice.main.GVN.32bit.panic-unwind.diff +++ b/tests/mir-opt/dataflow-const-prop/default_boxed_slice.main.GVN.32bit.panic-unwind.diff @@ -50,7 +50,7 @@ StorageLive(_6); StorageLive(_7); - _7 = AlignOf([bool; 0]); -- _6 = _7 as *mut [bool; 0] (Transmute); +- _6 = copy _7 as *mut [bool; 0] (Transmute); + _7 = const 1_usize; + _6 = const {0x1 as *mut [bool; 0]}; StorageDead(_7); @@ -71,7 +71,7 @@ bb3: { StorageLive(_10); -- _10 = _6 as *mut () (PtrToPtr); +- _10 = copy _6 as *mut () (PtrToPtr); - _9 = NonNull::<T>::new_unchecked::precondition_check(move _10) -> [return: bb4, unwind unreachable]; + _10 = const {0x1 as *mut ()}; + _9 = NonNull::<T>::new_unchecked::precondition_check(const {0x1 as *mut ()}) -> [return: bb4, unwind unreachable]; @@ -84,8 +84,8 @@ bb5: { StorageDead(_8); -- _11 = _6 as *const [bool; 0] (PtrToPtr); -- _5 = NonNull::<[bool; 0]> { pointer: _11 }; +- _11 = copy _6 as *const [bool; 0] (PtrToPtr); +- _5 = NonNull::<[bool; 0]> { pointer: copy _11 }; + _11 = const {0x1 as *const [bool; 0]}; + _5 = const NonNull::<[bool; 0]> {{ pointer: {0x1 as *const [bool; 0]} }}; StorageDead(_11); @@ -96,7 +96,7 @@ - _3 = move _4 as std::ptr::Unique<[bool]> (PointerCoercion(Unsize)); + _3 = const Unique::<[bool]> {{ pointer: NonNull::<[bool]> {{ pointer: Indirect { alloc_id: ALLOC0, offset: Size(0 bytes) }: *const [bool] }}, _marker: PhantomData::<[bool]> }}; StorageDead(_4); -- _2 = Box::<[bool]>(_3, const std::alloc::Global); +- _2 = Box::<[bool]>(copy _3, const std::alloc::Global); + _2 = const Box::<[bool]>(Unique::<[bool]> {{ pointer: NonNull::<[bool]> {{ pointer: Indirect { alloc_id: ALLOC1, offset: Size(0 bytes) }: *const [bool] }}, _marker: PhantomData::<[bool]> }}, std::alloc::Global); StorageDead(_9); StorageDead(_3); diff --git a/tests/mir-opt/dataflow-const-prop/default_boxed_slice.main.GVN.64bit.panic-abort.diff b/tests/mir-opt/dataflow-const-prop/default_boxed_slice.main.GVN.64bit.panic-abort.diff index 99e96fe5d70..3b0bc6377da 100644 --- a/tests/mir-opt/dataflow-const-prop/default_boxed_slice.main.GVN.64bit.panic-abort.diff +++ b/tests/mir-opt/dataflow-const-prop/default_boxed_slice.main.GVN.64bit.panic-abort.diff @@ -50,7 +50,7 @@ StorageLive(_6); StorageLive(_7); - _7 = AlignOf([bool; 0]); -- _6 = _7 as *mut [bool; 0] (Transmute); +- _6 = copy _7 as *mut [bool; 0] (Transmute); + _7 = const 1_usize; + _6 = const {0x1 as *mut [bool; 0]}; StorageDead(_7); @@ -67,7 +67,7 @@ bb2: { StorageLive(_10); -- _10 = _6 as *mut () (PtrToPtr); +- _10 = copy _6 as *mut () (PtrToPtr); - _9 = NonNull::<T>::new_unchecked::precondition_check(move _10) -> [return: bb3, unwind unreachable]; + _10 = const {0x1 as *mut ()}; + _9 = NonNull::<T>::new_unchecked::precondition_check(const {0x1 as *mut ()}) -> [return: bb3, unwind unreachable]; @@ -80,8 +80,8 @@ bb4: { StorageDead(_8); -- _11 = _6 as *const [bool; 0] (PtrToPtr); -- _5 = NonNull::<[bool; 0]> { pointer: _11 }; +- _11 = copy _6 as *const [bool; 0] (PtrToPtr); +- _5 = NonNull::<[bool; 0]> { pointer: copy _11 }; + _11 = const {0x1 as *const [bool; 0]}; + _5 = const NonNull::<[bool; 0]> {{ pointer: {0x1 as *const [bool; 0]} }}; StorageDead(_11); @@ -92,7 +92,7 @@ - _3 = move _4 as std::ptr::Unique<[bool]> (PointerCoercion(Unsize)); + _3 = const Unique::<[bool]> {{ pointer: NonNull::<[bool]> {{ pointer: Indirect { alloc_id: ALLOC0, offset: Size(0 bytes) }: *const [bool] }}, _marker: PhantomData::<[bool]> }}; StorageDead(_4); -- _2 = Box::<[bool]>(_3, const std::alloc::Global); +- _2 = Box::<[bool]>(copy _3, const std::alloc::Global); + _2 = const Box::<[bool]>(Unique::<[bool]> {{ pointer: NonNull::<[bool]> {{ pointer: Indirect { alloc_id: ALLOC1, offset: Size(0 bytes) }: *const [bool] }}, _marker: PhantomData::<[bool]> }}, std::alloc::Global); StorageDead(_9); StorageDead(_3); diff --git a/tests/mir-opt/dataflow-const-prop/default_boxed_slice.main.GVN.64bit.panic-unwind.diff b/tests/mir-opt/dataflow-const-prop/default_boxed_slice.main.GVN.64bit.panic-unwind.diff index 5eefabeac38..5dd7ad9a117 100644 --- a/tests/mir-opt/dataflow-const-prop/default_boxed_slice.main.GVN.64bit.panic-unwind.diff +++ b/tests/mir-opt/dataflow-const-prop/default_boxed_slice.main.GVN.64bit.panic-unwind.diff @@ -50,7 +50,7 @@ StorageLive(_6); StorageLive(_7); - _7 = AlignOf([bool; 0]); -- _6 = _7 as *mut [bool; 0] (Transmute); +- _6 = copy _7 as *mut [bool; 0] (Transmute); + _7 = const 1_usize; + _6 = const {0x1 as *mut [bool; 0]}; StorageDead(_7); @@ -71,7 +71,7 @@ bb3: { StorageLive(_10); -- _10 = _6 as *mut () (PtrToPtr); +- _10 = copy _6 as *mut () (PtrToPtr); - _9 = NonNull::<T>::new_unchecked::precondition_check(move _10) -> [return: bb4, unwind unreachable]; + _10 = const {0x1 as *mut ()}; + _9 = NonNull::<T>::new_unchecked::precondition_check(const {0x1 as *mut ()}) -> [return: bb4, unwind unreachable]; @@ -84,8 +84,8 @@ bb5: { StorageDead(_8); -- _11 = _6 as *const [bool; 0] (PtrToPtr); -- _5 = NonNull::<[bool; 0]> { pointer: _11 }; +- _11 = copy _6 as *const [bool; 0] (PtrToPtr); +- _5 = NonNull::<[bool; 0]> { pointer: copy _11 }; + _11 = const {0x1 as *const [bool; 0]}; + _5 = const NonNull::<[bool; 0]> {{ pointer: {0x1 as *const [bool; 0]} }}; StorageDead(_11); @@ -96,7 +96,7 @@ - _3 = move _4 as std::ptr::Unique<[bool]> (PointerCoercion(Unsize)); + _3 = const Unique::<[bool]> {{ pointer: NonNull::<[bool]> {{ pointer: Indirect { alloc_id: ALLOC0, offset: Size(0 bytes) }: *const [bool] }}, _marker: PhantomData::<[bool]> }}; StorageDead(_4); -- _2 = Box::<[bool]>(_3, const std::alloc::Global); +- _2 = Box::<[bool]>(copy _3, const std::alloc::Global); + _2 = const Box::<[bool]>(Unique::<[bool]> {{ pointer: NonNull::<[bool]> {{ pointer: Indirect { alloc_id: ALLOC1, offset: Size(0 bytes) }: *const [bool] }}, _marker: PhantomData::<[bool]> }}, std::alloc::Global); StorageDead(_9); StorageDead(_3); diff --git a/tests/mir-opt/dataflow-const-prop/enum.constant.DataflowConstProp.32bit.diff b/tests/mir-opt/dataflow-const-prop/enum.constant.DataflowConstProp.32bit.diff index 9da1caf9004..ef3b24cd440 100644 --- a/tests/mir-opt/dataflow-const-prop/enum.constant.DataflowConstProp.32bit.diff +++ b/tests/mir-opt/dataflow-const-prop/enum.constant.DataflowConstProp.32bit.diff @@ -37,16 +37,16 @@ bb2: { StorageLive(_5); - _5 = ((_1 as V2).0: i32); - _2 = _5; + _5 = copy ((_1 as V2).0: i32); + _2 = copy _5; StorageDead(_5); goto -> bb4; } bb3: { StorageLive(_4); -- _4 = ((_1 as V1).0: i32); -- _2 = _4; +- _4 = copy ((_1 as V1).0: i32); +- _2 = copy _4; + _4 = const 0_i32; + _2 = const 0_i32; StorageDead(_4); diff --git a/tests/mir-opt/dataflow-const-prop/enum.constant.DataflowConstProp.64bit.diff b/tests/mir-opt/dataflow-const-prop/enum.constant.DataflowConstProp.64bit.diff index 9da1caf9004..ef3b24cd440 100644 --- a/tests/mir-opt/dataflow-const-prop/enum.constant.DataflowConstProp.64bit.diff +++ b/tests/mir-opt/dataflow-const-prop/enum.constant.DataflowConstProp.64bit.diff @@ -37,16 +37,16 @@ bb2: { StorageLive(_5); - _5 = ((_1 as V2).0: i32); - _2 = _5; + _5 = copy ((_1 as V2).0: i32); + _2 = copy _5; StorageDead(_5); goto -> bb4; } bb3: { StorageLive(_4); -- _4 = ((_1 as V1).0: i32); -- _2 = _4; +- _4 = copy ((_1 as V1).0: i32); +- _2 = copy _4; + _4 = const 0_i32; + _2 = const 0_i32; StorageDead(_4); diff --git a/tests/mir-opt/dataflow-const-prop/enum.multiple.DataflowConstProp.32bit.diff b/tests/mir-opt/dataflow-const-prop/enum.multiple.DataflowConstProp.32bit.diff index 10d33767c90..db8352bcbcf 100644 --- a/tests/mir-opt/dataflow-const-prop/enum.multiple.DataflowConstProp.32bit.diff +++ b/tests/mir-opt/dataflow-const-prop/enum.multiple.DataflowConstProp.32bit.diff @@ -28,13 +28,13 @@ bb0: { StorageLive(_3); StorageLive(_4); - _4 = _1; + _4 = copy _1; switchInt(move _4) -> [0: bb2, otherwise: bb1]; } bb1: { StorageLive(_5); - _5 = _2; + _5 = copy _2; _3 = Option::<u8>::Some(move _5); StorageDead(_5); goto -> bb3; @@ -63,15 +63,15 @@ bb6: { StorageLive(_8); - _8 = ((_3 as Some).0: u8); - _6 = _8; + _8 = copy ((_3 as Some).0: u8); + _6 = copy _8; StorageDead(_8); goto -> bb7; } bb7: { StorageLive(_9); - _9 = _6; + _9 = copy _6; _0 = const (); StorageDead(_9); StorageDead(_6); diff --git a/tests/mir-opt/dataflow-const-prop/enum.multiple.DataflowConstProp.64bit.diff b/tests/mir-opt/dataflow-const-prop/enum.multiple.DataflowConstProp.64bit.diff index 10d33767c90..db8352bcbcf 100644 --- a/tests/mir-opt/dataflow-const-prop/enum.multiple.DataflowConstProp.64bit.diff +++ b/tests/mir-opt/dataflow-const-prop/enum.multiple.DataflowConstProp.64bit.diff @@ -28,13 +28,13 @@ bb0: { StorageLive(_3); StorageLive(_4); - _4 = _1; + _4 = copy _1; switchInt(move _4) -> [0: bb2, otherwise: bb1]; } bb1: { StorageLive(_5); - _5 = _2; + _5 = copy _2; _3 = Option::<u8>::Some(move _5); StorageDead(_5); goto -> bb3; @@ -63,15 +63,15 @@ bb6: { StorageLive(_8); - _8 = ((_3 as Some).0: u8); - _6 = _8; + _8 = copy ((_3 as Some).0: u8); + _6 = copy _8; StorageDead(_8); goto -> bb7; } bb7: { StorageLive(_9); - _9 = _6; + _9 = copy _6; _0 = const (); StorageDead(_9); StorageDead(_6); diff --git a/tests/mir-opt/dataflow-const-prop/enum.mutate_discriminant.DataflowConstProp.32bit.diff b/tests/mir-opt/dataflow-const-prop/enum.mutate_discriminant.DataflowConstProp.32bit.diff index 960e69ee916..e2cd73404be 100644 --- a/tests/mir-opt/dataflow-const-prop/enum.mutate_discriminant.DataflowConstProp.32bit.diff +++ b/tests/mir-opt/dataflow-const-prop/enum.mutate_discriminant.DataflowConstProp.32bit.diff @@ -10,7 +10,7 @@ discriminant(_1) = 1; (((_1 as variant#1).0: NonZeroUsize).0: usize) = const 0_usize; _2 = discriminant(_1); - switchInt(_2) -> [0: bb1, otherwise: bb2]; + switchInt(copy _2) -> [0: bb1, otherwise: bb2]; } bb1: { diff --git a/tests/mir-opt/dataflow-const-prop/enum.mutate_discriminant.DataflowConstProp.64bit.diff b/tests/mir-opt/dataflow-const-prop/enum.mutate_discriminant.DataflowConstProp.64bit.diff index 960e69ee916..e2cd73404be 100644 --- a/tests/mir-opt/dataflow-const-prop/enum.mutate_discriminant.DataflowConstProp.64bit.diff +++ b/tests/mir-opt/dataflow-const-prop/enum.mutate_discriminant.DataflowConstProp.64bit.diff @@ -10,7 +10,7 @@ discriminant(_1) = 1; (((_1 as variant#1).0: NonZeroUsize).0: usize) = const 0_usize; _2 = discriminant(_1); - switchInt(_2) -> [0: bb1, otherwise: bb2]; + switchInt(copy _2) -> [0: bb1, otherwise: bb2]; } bb1: { diff --git a/tests/mir-opt/dataflow-const-prop/enum.rs b/tests/mir-opt/dataflow-const-prop/enum.rs index 37304e3a270..207e29e63df 100644 --- a/tests/mir-opt/dataflow-const-prop/enum.rs +++ b/tests/mir-opt/dataflow-const-prop/enum.rs @@ -73,7 +73,7 @@ fn statics() { static RC: &E = &E::V2(4); // CHECK: [[t:_.*]] = const {alloc5: &&E}; - // CHECK: [[e2]] = (*[[t]]); + // CHECK: [[e2]] = copy (*[[t]]); let e2 = RC; // CHECK: switchInt({{move _.*}}) -> {{.*}} @@ -108,7 +108,7 @@ fn mutate_discriminant() -> u8 { // CHECK: [[a:_.*]] = discriminant({{_.*}}); let a = Discriminant(x); - // CHECK: switchInt([[a]]) -> [0: {{bb.*}}, otherwise: {{bb.*}}]; + // CHECK: switchInt(copy [[a]]) -> [0: {{bb.*}}, otherwise: {{bb.*}}]; match a { 0 => bb1, _ => bad, @@ -143,8 +143,8 @@ fn multiple(x: bool, i: u8) { // discriminant(e) => Top // (e as Some).0 => Top // CHECK: [[x2]] = const 0_u8; - // CHECK: [[some:_.*]] = (({{_.*}} as Some).0: u8) - // CHECK: [[x2]] = [[some]]; + // CHECK: [[some:_.*]] = copy (({{_.*}} as Some).0: u8) + // CHECK: [[x2]] = copy [[some]]; let x2 = match e { Some(i) => i, None => 0, @@ -153,7 +153,7 @@ fn multiple(x: bool, i: u8) { // Therefore, `x2` should be `Top` here, and no replacement shall happen. // CHECK-NOT: [[y]] = const - // CHECK: [[y]] = [[x2]]; + // CHECK: [[y]] = copy [[x2]]; // CHECK-NOT: [[y]] = const let y = x2; } diff --git a/tests/mir-opt/dataflow-const-prop/enum.simple.DataflowConstProp.32bit.diff b/tests/mir-opt/dataflow-const-prop/enum.simple.DataflowConstProp.32bit.diff index a64dda0d06c..d79c163effc 100644 --- a/tests/mir-opt/dataflow-const-prop/enum.simple.DataflowConstProp.32bit.diff +++ b/tests/mir-opt/dataflow-const-prop/enum.simple.DataflowConstProp.32bit.diff @@ -38,16 +38,16 @@ bb2: { StorageLive(_5); - _5 = ((_1 as V2).0: i32); - _2 = _5; + _5 = copy ((_1 as V2).0: i32); + _2 = copy _5; StorageDead(_5); goto -> bb4; } bb3: { StorageLive(_4); -- _4 = ((_1 as V1).0: i32); -- _2 = _4; +- _4 = copy ((_1 as V1).0: i32); +- _2 = copy _4; + _4 = const 0_i32; + _2 = const 0_i32; StorageDead(_4); diff --git a/tests/mir-opt/dataflow-const-prop/enum.simple.DataflowConstProp.64bit.diff b/tests/mir-opt/dataflow-const-prop/enum.simple.DataflowConstProp.64bit.diff index a64dda0d06c..d79c163effc 100644 --- a/tests/mir-opt/dataflow-const-prop/enum.simple.DataflowConstProp.64bit.diff +++ b/tests/mir-opt/dataflow-const-prop/enum.simple.DataflowConstProp.64bit.diff @@ -38,16 +38,16 @@ bb2: { StorageLive(_5); - _5 = ((_1 as V2).0: i32); - _2 = _5; + _5 = copy ((_1 as V2).0: i32); + _2 = copy _5; StorageDead(_5); goto -> bb4; } bb3: { StorageLive(_4); -- _4 = ((_1 as V1).0: i32); -- _2 = _4; +- _4 = copy ((_1 as V1).0: i32); +- _2 = copy _4; + _4 = const 0_i32; + _2 = const 0_i32; StorageDead(_4); diff --git a/tests/mir-opt/dataflow-const-prop/enum.statics.DataflowConstProp.32bit.diff b/tests/mir-opt/dataflow-const-prop/enum.statics.DataflowConstProp.32bit.diff index b4d14f25fe2..9823a48785a 100644 --- a/tests/mir-opt/dataflow-const-prop/enum.statics.DataflowConstProp.32bit.diff +++ b/tests/mir-opt/dataflow-const-prop/enum.statics.DataflowConstProp.32bit.diff @@ -44,7 +44,7 @@ StorageLive(_1); StorageLive(_2); _2 = const {ALLOC0: &E}; -- _1 = (*_2); +- _1 = copy (*_2); + _1 = const E::V1(0_i32); StorageDead(_2); StorageLive(_3); @@ -60,16 +60,16 @@ bb2: { StorageLive(_6); - _6 = ((_1 as V2).0: i32); - _3 = _6; + _6 = copy ((_1 as V2).0: i32); + _3 = copy _6; StorageDead(_6); goto -> bb4; } bb3: { StorageLive(_5); -- _5 = ((_1 as V1).0: i32); -- _3 = _5; +- _5 = copy ((_1 as V1).0: i32); +- _3 = copy _5; + _5 = const 0_i32; + _3 = const 0_i32; StorageDead(_5); @@ -80,7 +80,7 @@ StorageLive(_7); StorageLive(_8); _8 = const {ALLOC1: &&E}; - _7 = (*_8); + _7 = copy (*_8); StorageDead(_8); StorageLive(_9); _10 = discriminant((*_7)); @@ -98,7 +98,7 @@ bb6: { StorageLive(_11); _11 = &(((*_7) as V1).0: i32); - _9 = _11; + _9 = copy _11; StorageDead(_11); goto -> bb7; } diff --git a/tests/mir-opt/dataflow-const-prop/enum.statics.DataflowConstProp.64bit.diff b/tests/mir-opt/dataflow-const-prop/enum.statics.DataflowConstProp.64bit.diff index 57d02b87d13..e4e68483f25 100644 --- a/tests/mir-opt/dataflow-const-prop/enum.statics.DataflowConstProp.64bit.diff +++ b/tests/mir-opt/dataflow-const-prop/enum.statics.DataflowConstProp.64bit.diff @@ -44,7 +44,7 @@ StorageLive(_1); StorageLive(_2); _2 = const {ALLOC0: &E}; -- _1 = (*_2); +- _1 = copy (*_2); + _1 = const E::V1(0_i32); StorageDead(_2); StorageLive(_3); @@ -60,16 +60,16 @@ bb2: { StorageLive(_6); - _6 = ((_1 as V2).0: i32); - _3 = _6; + _6 = copy ((_1 as V2).0: i32); + _3 = copy _6; StorageDead(_6); goto -> bb4; } bb3: { StorageLive(_5); -- _5 = ((_1 as V1).0: i32); -- _3 = _5; +- _5 = copy ((_1 as V1).0: i32); +- _3 = copy _5; + _5 = const 0_i32; + _3 = const 0_i32; StorageDead(_5); @@ -80,7 +80,7 @@ StorageLive(_7); StorageLive(_8); _8 = const {ALLOC1: &&E}; - _7 = (*_8); + _7 = copy (*_8); StorageDead(_8); StorageLive(_9); _10 = discriminant((*_7)); @@ -98,7 +98,7 @@ bb6: { StorageLive(_11); _11 = &(((*_7) as V1).0: i32); - _9 = _11; + _9 = copy _11; StorageDead(_11); goto -> bb7; } diff --git a/tests/mir-opt/dataflow-const-prop/if.main.DataflowConstProp.diff b/tests/mir-opt/dataflow-const-prop/if.main.DataflowConstProp.diff index 355f28b03db..5f013b1d134 100644 --- a/tests/mir-opt/dataflow-const-prop/if.main.DataflowConstProp.diff +++ b/tests/mir-opt/dataflow-const-prop/if.main.DataflowConstProp.diff @@ -37,7 +37,7 @@ StorageLive(_2); StorageLive(_3); StorageLive(_4); -- _4 = _1; +- _4 = copy _1; - _3 = Eq(move _4, const 1_i32); - switchInt(move _3) -> [0: bb2, otherwise: bb1]; + _4 = const 1_i32; @@ -61,7 +61,7 @@ StorageDead(_3); StorageLive(_5); StorageLive(_6); -- _6 = _2; +- _6 = copy _2; - _5 = Add(move _6, const 1_i32); + _6 = const 2_i32; + _5 = const 3_i32; @@ -69,7 +69,7 @@ StorageLive(_7); StorageLive(_8); StorageLive(_9); -- _9 = _1; +- _9 = copy _1; - _8 = Eq(move _9, const 1_i32); - switchInt(move _8) -> [0: bb5, otherwise: bb4]; + _9 = const 1_i32; @@ -79,7 +79,7 @@ bb4: { StorageDead(_9); -- _7 = _1; +- _7 = copy _1; + _7 = const 1_i32; goto -> bb6; } @@ -87,7 +87,7 @@ bb5: { StorageDead(_9); StorageLive(_10); - _10 = _1; + _10 = copy _1; _7 = Add(move _10, const 1_i32); StorageDead(_10); goto -> bb6; @@ -97,7 +97,7 @@ StorageDead(_8); StorageLive(_11); StorageLive(_12); -- _12 = _7; +- _12 = copy _7; - _11 = Add(move _12, const 1_i32); + _12 = const 1_i32; + _11 = const 2_i32; diff --git a/tests/mir-opt/dataflow-const-prop/inherit_overflow.main.DataflowConstProp.panic-abort.diff b/tests/mir-opt/dataflow-const-prop/inherit_overflow.main.DataflowConstProp.panic-abort.diff index 8d62de0c821..1b695e4b53c 100644 --- a/tests/mir-opt/dataflow-const-prop/inherit_overflow.main.DataflowConstProp.panic-abort.diff +++ b/tests/mir-opt/dataflow-const-prop/inherit_overflow.main.DataflowConstProp.panic-abort.diff @@ -19,8 +19,8 @@ StorageLive(_3); _3 = const 1_u8; StorageLive(_4); -- _4 = AddWithOverflow(_2, _3); -- assert(!move (_4.1: bool), "attempt to compute `{} + {}`, which would overflow", _2, _3) -> [success: bb1, unwind unreachable]; +- _4 = AddWithOverflow(copy _2, copy _3); +- assert(!move (_4.1: bool), "attempt to compute `{} + {}`, which would overflow", copy _2, copy _3) -> [success: bb1, unwind unreachable]; + _4 = const (0_u8, true); + assert(!const true, "attempt to compute `{} + {}`, which would overflow", const u8::MAX, const 1_u8) -> [success: bb1, unwind unreachable]; } diff --git a/tests/mir-opt/dataflow-const-prop/inherit_overflow.main.DataflowConstProp.panic-unwind.diff b/tests/mir-opt/dataflow-const-prop/inherit_overflow.main.DataflowConstProp.panic-unwind.diff index 25624851cb3..a0bd8e17d8c 100644 --- a/tests/mir-opt/dataflow-const-prop/inherit_overflow.main.DataflowConstProp.panic-unwind.diff +++ b/tests/mir-opt/dataflow-const-prop/inherit_overflow.main.DataflowConstProp.panic-unwind.diff @@ -19,8 +19,8 @@ StorageLive(_3); _3 = const 1_u8; StorageLive(_4); -- _4 = AddWithOverflow(_2, _3); -- assert(!move (_4.1: bool), "attempt to compute `{} + {}`, which would overflow", _2, _3) -> [success: bb1, unwind continue]; +- _4 = AddWithOverflow(copy _2, copy _3); +- assert(!move (_4.1: bool), "attempt to compute `{} + {}`, which would overflow", copy _2, copy _3) -> [success: bb1, unwind continue]; + _4 = const (0_u8, true); + assert(!const true, "attempt to compute `{} + {}`, which would overflow", const u8::MAX, const 1_u8) -> [success: bb1, unwind continue]; } diff --git a/tests/mir-opt/dataflow-const-prop/large_array_index.main.DataflowConstProp.32bit.panic-abort.diff b/tests/mir-opt/dataflow-const-prop/large_array_index.main.DataflowConstProp.32bit.panic-abort.diff index 6c612d46725..b7ff0b671f7 100644 --- a/tests/mir-opt/dataflow-const-prop/large_array_index.main.DataflowConstProp.32bit.panic-abort.diff +++ b/tests/mir-opt/dataflow-const-prop/large_array_index.main.DataflowConstProp.32bit.panic-abort.diff @@ -19,16 +19,16 @@ StorageLive(_3); _3 = const 2_usize; - _4 = Len(_2); -- _5 = Lt(_3, _4); -- assert(move _5, "index out of bounds: the length is {} but the index is {}", move _4, _3) -> [success: bb1, unwind unreachable]; +- _5 = Lt(copy _3, copy _4); +- assert(move _5, "index out of bounds: the length is {} but the index is {}", move _4, copy _3) -> [success: bb1, unwind unreachable]; + _4 = const 5000_usize; + _5 = const true; + assert(const true, "index out of bounds: the length is {} but the index is {}", const 5000_usize, const 2_usize) -> [success: bb1, unwind unreachable]; } bb1: { -- _1 = _2[_3]; -+ _1 = _2[2 of 3]; +- _1 = copy _2[_3]; ++ _1 = copy _2[2 of 3]; StorageDead(_3); StorageDead(_2); _0 = const (); diff --git a/tests/mir-opt/dataflow-const-prop/large_array_index.main.DataflowConstProp.32bit.panic-unwind.diff b/tests/mir-opt/dataflow-const-prop/large_array_index.main.DataflowConstProp.32bit.panic-unwind.diff index 87024da2628..af6e3626142 100644 --- a/tests/mir-opt/dataflow-const-prop/large_array_index.main.DataflowConstProp.32bit.panic-unwind.diff +++ b/tests/mir-opt/dataflow-const-prop/large_array_index.main.DataflowConstProp.32bit.panic-unwind.diff @@ -19,16 +19,16 @@ StorageLive(_3); _3 = const 2_usize; - _4 = Len(_2); -- _5 = Lt(_3, _4); -- assert(move _5, "index out of bounds: the length is {} but the index is {}", move _4, _3) -> [success: bb1, unwind continue]; +- _5 = Lt(copy _3, copy _4); +- assert(move _5, "index out of bounds: the length is {} but the index is {}", move _4, copy _3) -> [success: bb1, unwind continue]; + _4 = const 5000_usize; + _5 = const true; + assert(const true, "index out of bounds: the length is {} but the index is {}", const 5000_usize, const 2_usize) -> [success: bb1, unwind continue]; } bb1: { -- _1 = _2[_3]; -+ _1 = _2[2 of 3]; +- _1 = copy _2[_3]; ++ _1 = copy _2[2 of 3]; StorageDead(_3); StorageDead(_2); _0 = const (); diff --git a/tests/mir-opt/dataflow-const-prop/large_array_index.main.DataflowConstProp.64bit.panic-abort.diff b/tests/mir-opt/dataflow-const-prop/large_array_index.main.DataflowConstProp.64bit.panic-abort.diff index 6c612d46725..b7ff0b671f7 100644 --- a/tests/mir-opt/dataflow-const-prop/large_array_index.main.DataflowConstProp.64bit.panic-abort.diff +++ b/tests/mir-opt/dataflow-const-prop/large_array_index.main.DataflowConstProp.64bit.panic-abort.diff @@ -19,16 +19,16 @@ StorageLive(_3); _3 = const 2_usize; - _4 = Len(_2); -- _5 = Lt(_3, _4); -- assert(move _5, "index out of bounds: the length is {} but the index is {}", move _4, _3) -> [success: bb1, unwind unreachable]; +- _5 = Lt(copy _3, copy _4); +- assert(move _5, "index out of bounds: the length is {} but the index is {}", move _4, copy _3) -> [success: bb1, unwind unreachable]; + _4 = const 5000_usize; + _5 = const true; + assert(const true, "index out of bounds: the length is {} but the index is {}", const 5000_usize, const 2_usize) -> [success: bb1, unwind unreachable]; } bb1: { -- _1 = _2[_3]; -+ _1 = _2[2 of 3]; +- _1 = copy _2[_3]; ++ _1 = copy _2[2 of 3]; StorageDead(_3); StorageDead(_2); _0 = const (); diff --git a/tests/mir-opt/dataflow-const-prop/large_array_index.main.DataflowConstProp.64bit.panic-unwind.diff b/tests/mir-opt/dataflow-const-prop/large_array_index.main.DataflowConstProp.64bit.panic-unwind.diff index 87024da2628..af6e3626142 100644 --- a/tests/mir-opt/dataflow-const-prop/large_array_index.main.DataflowConstProp.64bit.panic-unwind.diff +++ b/tests/mir-opt/dataflow-const-prop/large_array_index.main.DataflowConstProp.64bit.panic-unwind.diff @@ -19,16 +19,16 @@ StorageLive(_3); _3 = const 2_usize; - _4 = Len(_2); -- _5 = Lt(_3, _4); -- assert(move _5, "index out of bounds: the length is {} but the index is {}", move _4, _3) -> [success: bb1, unwind continue]; +- _5 = Lt(copy _3, copy _4); +- assert(move _5, "index out of bounds: the length is {} but the index is {}", move _4, copy _3) -> [success: bb1, unwind continue]; + _4 = const 5000_usize; + _5 = const true; + assert(const true, "index out of bounds: the length is {} but the index is {}", const 5000_usize, const 2_usize) -> [success: bb1, unwind continue]; } bb1: { -- _1 = _2[_3]; -+ _1 = _2[2 of 3]; +- _1 = copy _2[_3]; ++ _1 = copy _2[2 of 3]; StorageDead(_3); StorageDead(_2); _0 = const (); diff --git a/tests/mir-opt/dataflow-const-prop/large_array_index.rs b/tests/mir-opt/dataflow-const-prop/large_array_index.rs index e74fd88d002..e9f2fa2badf 100644 --- a/tests/mir-opt/dataflow-const-prop/large_array_index.rs +++ b/tests/mir-opt/dataflow-const-prop/large_array_index.rs @@ -13,6 +13,6 @@ fn main() { // CHECK: {{_.*}} = const 5000_usize; // CHECK: {{_.*}} = const true; // CHECK: assert(const true - // CHECK: [[x]] = [[array_lit]][2 of 3]; + // CHECK: [[x]] = copy [[array_lit]][2 of 3]; let x: u8 = [0_u8; 5000][2]; } diff --git a/tests/mir-opt/dataflow-const-prop/mult_by_zero.test.DataflowConstProp.diff b/tests/mir-opt/dataflow-const-prop/mult_by_zero.test.DataflowConstProp.diff index 91bc10a562f..8b05386b38a 100644 --- a/tests/mir-opt/dataflow-const-prop/mult_by_zero.test.DataflowConstProp.diff +++ b/tests/mir-opt/dataflow-const-prop/mult_by_zero.test.DataflowConstProp.diff @@ -8,7 +8,7 @@ bb0: { StorageLive(_2); - _2 = _1; + _2 = copy _1; - _0 = Mul(move _2, const 0_i32); + _0 = const 0_i32; StorageDead(_2); diff --git a/tests/mir-opt/dataflow-const-prop/ref_without_sb.main.DataflowConstProp.panic-abort.diff b/tests/mir-opt/dataflow-const-prop/ref_without_sb.main.DataflowConstProp.panic-abort.diff index fbbfd61bbed..a0e83265d31 100644 --- a/tests/mir-opt/dataflow-const-prop/ref_without_sb.main.DataflowConstProp.panic-abort.diff +++ b/tests/mir-opt/dataflow-const-prop/ref_without_sb.main.DataflowConstProp.panic-abort.diff @@ -39,7 +39,7 @@ bb2: { StorageDead(_5); StorageLive(_6); - _6 = _1; + _6 = copy _1; _0 = const (); StorageDead(_6); StorageDead(_1); diff --git a/tests/mir-opt/dataflow-const-prop/ref_without_sb.main.DataflowConstProp.panic-unwind.diff b/tests/mir-opt/dataflow-const-prop/ref_without_sb.main.DataflowConstProp.panic-unwind.diff index 4e1d26acfa3..6dead031a9f 100644 --- a/tests/mir-opt/dataflow-const-prop/ref_without_sb.main.DataflowConstProp.panic-unwind.diff +++ b/tests/mir-opt/dataflow-const-prop/ref_without_sb.main.DataflowConstProp.panic-unwind.diff @@ -39,7 +39,7 @@ bb2: { StorageDead(_5); StorageLive(_6); - _6 = _1; + _6 = copy _1; _0 = const (); StorageDead(_6); StorageDead(_1); diff --git a/tests/mir-opt/dataflow-const-prop/ref_without_sb.rs b/tests/mir-opt/dataflow-const-prop/ref_without_sb.rs index 399de921a59..1c4eb41f35e 100644 --- a/tests/mir-opt/dataflow-const-prop/ref_without_sb.rs +++ b/tests/mir-opt/dataflow-const-prop/ref_without_sb.rs @@ -24,7 +24,7 @@ fn main() { // This should currently not be propagated. // CHECK-NOT: [[b]] = const - // CHECK: [[b]] = [[a]]; + // CHECK: [[b]] = copy [[a]]; // CHECK-NOT: [[b]] = const let b = a; } diff --git a/tests/mir-opt/dataflow-const-prop/repeat.main.DataflowConstProp.32bit.panic-abort.diff b/tests/mir-opt/dataflow-const-prop/repeat.main.DataflowConstProp.32bit.panic-abort.diff index a18ef6c9db7..dfa541b1200 100644 --- a/tests/mir-opt/dataflow-const-prop/repeat.main.DataflowConstProp.32bit.panic-abort.diff +++ b/tests/mir-opt/dataflow-const-prop/repeat.main.DataflowConstProp.32bit.panic-abort.diff @@ -21,16 +21,16 @@ StorageLive(_4); _4 = const 2_usize; - _5 = Len(_3); -- _6 = Lt(_4, _5); -- assert(move _6, "index out of bounds: the length is {} but the index is {}", move _5, _4) -> [success: bb1, unwind unreachable]; +- _6 = Lt(copy _4, copy _5); +- assert(move _6, "index out of bounds: the length is {} but the index is {}", move _5, copy _4) -> [success: bb1, unwind unreachable]; + _5 = const 8_usize; + _6 = const true; + assert(const true, "index out of bounds: the length is {} but the index is {}", const 8_usize, const 2_usize) -> [success: bb1, unwind unreachable]; } bb1: { -- _2 = _3[_4]; -+ _2 = _3[2 of 3]; +- _2 = copy _3[_4]; ++ _2 = copy _3[2 of 3]; _1 = Add(move _2, const 0_u32); StorageDead(_2); StorageDead(_4); diff --git a/tests/mir-opt/dataflow-const-prop/repeat.main.DataflowConstProp.32bit.panic-unwind.diff b/tests/mir-opt/dataflow-const-prop/repeat.main.DataflowConstProp.32bit.panic-unwind.diff index 3356ef98b14..9ede3c5f7ac 100644 --- a/tests/mir-opt/dataflow-const-prop/repeat.main.DataflowConstProp.32bit.panic-unwind.diff +++ b/tests/mir-opt/dataflow-const-prop/repeat.main.DataflowConstProp.32bit.panic-unwind.diff @@ -21,16 +21,16 @@ StorageLive(_4); _4 = const 2_usize; - _5 = Len(_3); -- _6 = Lt(_4, _5); -- assert(move _6, "index out of bounds: the length is {} but the index is {}", move _5, _4) -> [success: bb1, unwind continue]; +- _6 = Lt(copy _4, copy _5); +- assert(move _6, "index out of bounds: the length is {} but the index is {}", move _5, copy _4) -> [success: bb1, unwind continue]; + _5 = const 8_usize; + _6 = const true; + assert(const true, "index out of bounds: the length is {} but the index is {}", const 8_usize, const 2_usize) -> [success: bb1, unwind continue]; } bb1: { -- _2 = _3[_4]; -+ _2 = _3[2 of 3]; +- _2 = copy _3[_4]; ++ _2 = copy _3[2 of 3]; _1 = Add(move _2, const 0_u32); StorageDead(_2); StorageDead(_4); diff --git a/tests/mir-opt/dataflow-const-prop/repeat.main.DataflowConstProp.64bit.panic-abort.diff b/tests/mir-opt/dataflow-const-prop/repeat.main.DataflowConstProp.64bit.panic-abort.diff index a18ef6c9db7..dfa541b1200 100644 --- a/tests/mir-opt/dataflow-const-prop/repeat.main.DataflowConstProp.64bit.panic-abort.diff +++ b/tests/mir-opt/dataflow-const-prop/repeat.main.DataflowConstProp.64bit.panic-abort.diff @@ -21,16 +21,16 @@ StorageLive(_4); _4 = const 2_usize; - _5 = Len(_3); -- _6 = Lt(_4, _5); -- assert(move _6, "index out of bounds: the length is {} but the index is {}", move _5, _4) -> [success: bb1, unwind unreachable]; +- _6 = Lt(copy _4, copy _5); +- assert(move _6, "index out of bounds: the length is {} but the index is {}", move _5, copy _4) -> [success: bb1, unwind unreachable]; + _5 = const 8_usize; + _6 = const true; + assert(const true, "index out of bounds: the length is {} but the index is {}", const 8_usize, const 2_usize) -> [success: bb1, unwind unreachable]; } bb1: { -- _2 = _3[_4]; -+ _2 = _3[2 of 3]; +- _2 = copy _3[_4]; ++ _2 = copy _3[2 of 3]; _1 = Add(move _2, const 0_u32); StorageDead(_2); StorageDead(_4); diff --git a/tests/mir-opt/dataflow-const-prop/repeat.main.DataflowConstProp.64bit.panic-unwind.diff b/tests/mir-opt/dataflow-const-prop/repeat.main.DataflowConstProp.64bit.panic-unwind.diff index 3356ef98b14..9ede3c5f7ac 100644 --- a/tests/mir-opt/dataflow-const-prop/repeat.main.DataflowConstProp.64bit.panic-unwind.diff +++ b/tests/mir-opt/dataflow-const-prop/repeat.main.DataflowConstProp.64bit.panic-unwind.diff @@ -21,16 +21,16 @@ StorageLive(_4); _4 = const 2_usize; - _5 = Len(_3); -- _6 = Lt(_4, _5); -- assert(move _6, "index out of bounds: the length is {} but the index is {}", move _5, _4) -> [success: bb1, unwind continue]; +- _6 = Lt(copy _4, copy _5); +- assert(move _6, "index out of bounds: the length is {} but the index is {}", move _5, copy _4) -> [success: bb1, unwind continue]; + _5 = const 8_usize; + _6 = const true; + assert(const true, "index out of bounds: the length is {} but the index is {}", const 8_usize, const 2_usize) -> [success: bb1, unwind continue]; } bb1: { -- _2 = _3[_4]; -+ _2 = _3[2 of 3]; +- _2 = copy _3[_4]; ++ _2 = copy _3[2 of 3]; _1 = Add(move _2, const 0_u32); StorageDead(_2); StorageDead(_4); diff --git a/tests/mir-opt/dataflow-const-prop/repeat.rs b/tests/mir-opt/dataflow-const-prop/repeat.rs index e32c0d0877d..2067aa3d709 100644 --- a/tests/mir-opt/dataflow-const-prop/repeat.rs +++ b/tests/mir-opt/dataflow-const-prop/repeat.rs @@ -14,8 +14,8 @@ fn main() { // CHECK: {{_.*}} = const true; // CHECK: assert(const true - // CHECK-NOT: [[t:_.*]] = [[array_lit]][_ - // CHECK: [[t:_.*]] = [[array_lit]][2 of 3]; + // CHECK-NOT: [[t:_.*]] = {{copy|move}} [[array_lit]][_ + // CHECK: [[t:_.*]] = copy [[array_lit]][2 of 3]; // CHECK: [[x]] = Add(move [[t]], const 0_u32); let x: u32 = [42; 8][2] + 0; } diff --git a/tests/mir-opt/dataflow-const-prop/repr_transparent.main.DataflowConstProp.diff b/tests/mir-opt/dataflow-const-prop/repr_transparent.main.DataflowConstProp.diff index 98bd40ab2c3..d0915432aaa 100644 --- a/tests/mir-opt/dataflow-const-prop/repr_transparent.main.DataflowConstProp.diff +++ b/tests/mir-opt/dataflow-const-prop/repr_transparent.main.DataflowConstProp.diff @@ -22,10 +22,10 @@ StorageLive(_2); StorageLive(_3); StorageLive(_4); -- _4 = (_1.0: i32); +- _4 = copy (_1.0: i32); + _4 = const 0_i32; StorageLive(_5); -- _5 = (_1.0: i32); +- _5 = copy (_1.0: i32); - _3 = Add(move _4, move _5); + _5 = const 0_i32; + _3 = const 0_i32; diff --git a/tests/mir-opt/dataflow-const-prop/self_assign.main.DataflowConstProp.diff b/tests/mir-opt/dataflow-const-prop/self_assign.main.DataflowConstProp.diff index fbdbb3fa35c..e54a0d64b16 100644 --- a/tests/mir-opt/dataflow-const-prop/self_assign.main.DataflowConstProp.diff +++ b/tests/mir-opt/dataflow-const-prop/self_assign.main.DataflowConstProp.diff @@ -20,21 +20,21 @@ StorageLive(_1); _1 = const 0_i32; StorageLive(_2); - _2 = _1; + _2 = copy _1; _1 = Add(move _2, const 1_i32); StorageDead(_2); StorageLive(_3); - _3 = _1; + _3 = copy _1; _1 = move _3; StorageDead(_3); StorageLive(_4); _4 = &_1; StorageLive(_5); - _5 = _4; + _5 = copy _4; _4 = move _5; StorageDead(_5); StorageLive(_6); - _6 = (*_4); + _6 = copy (*_4); _1 = move _6; StorageDead(_6); _0 = const (); diff --git a/tests/mir-opt/dataflow-const-prop/self_assign_add.main.DataflowConstProp.diff b/tests/mir-opt/dataflow-const-prop/self_assign_add.main.DataflowConstProp.diff index e2468a9645d..77762ed9041 100644 --- a/tests/mir-opt/dataflow-const-prop/self_assign_add.main.DataflowConstProp.diff +++ b/tests/mir-opt/dataflow-const-prop/self_assign_add.main.DataflowConstProp.diff @@ -11,8 +11,8 @@ bb0: { StorageLive(_1); _1 = const 0_i32; -- _1 = Add(_1, const 1_i32); -- _1 = Add(_1, const 1_i32); +- _1 = Add(copy _1, const 1_i32); +- _1 = Add(copy _1, const 1_i32); + _1 = const 1_i32; + _1 = const 2_i32; _0 = const (); diff --git a/tests/mir-opt/dataflow-const-prop/sibling_ptr.main.DataflowConstProp.panic-abort.diff b/tests/mir-opt/dataflow-const-prop/sibling_ptr.main.DataflowConstProp.panic-abort.diff index a5e40990751..178ebad6105 100644 --- a/tests/mir-opt/dataflow-const-prop/sibling_ptr.main.DataflowConstProp.panic-abort.diff +++ b/tests/mir-opt/dataflow-const-prop/sibling_ptr.main.DataflowConstProp.panic-abort.diff @@ -27,7 +27,7 @@ _3 = &raw mut (_1.0: u8); StorageLive(_4); StorageLive(_5); - _5 = _3; + _5 = copy _3; _4 = std::ptr::mut_ptr::<impl *mut u8>::add(move _5, const 1_usize) -> [return: bb1, unwind unreachable]; } @@ -39,7 +39,7 @@ StorageDead(_3); StorageDead(_2); StorageLive(_6); - _6 = (_1.1: u8); + _6 = copy (_1.1: u8); _0 = const (); StorageDead(_6); StorageDead(_1); diff --git a/tests/mir-opt/dataflow-const-prop/sibling_ptr.main.DataflowConstProp.panic-unwind.diff b/tests/mir-opt/dataflow-const-prop/sibling_ptr.main.DataflowConstProp.panic-unwind.diff index ce2178ddbee..ce2545589f1 100644 --- a/tests/mir-opt/dataflow-const-prop/sibling_ptr.main.DataflowConstProp.panic-unwind.diff +++ b/tests/mir-opt/dataflow-const-prop/sibling_ptr.main.DataflowConstProp.panic-unwind.diff @@ -27,7 +27,7 @@ _3 = &raw mut (_1.0: u8); StorageLive(_4); StorageLive(_5); - _5 = _3; + _5 = copy _3; _4 = std::ptr::mut_ptr::<impl *mut u8>::add(move _5, const 1_usize) -> [return: bb1, unwind continue]; } @@ -39,7 +39,7 @@ StorageDead(_3); StorageDead(_2); StorageLive(_6); - _6 = (_1.1: u8); + _6 = copy (_1.1: u8); _0 = const (); StorageDead(_6); StorageDead(_1); diff --git a/tests/mir-opt/dataflow-const-prop/sibling_ptr.rs b/tests/mir-opt/dataflow-const-prop/sibling_ptr.rs index be7f311cdc1..b123f06807d 100644 --- a/tests/mir-opt/dataflow-const-prop/sibling_ptr.rs +++ b/tests/mir-opt/dataflow-const-prop/sibling_ptr.rs @@ -20,6 +20,6 @@ fn main() { *p.add(1) = 1; } - // CHECK: [[x1]] = ({{_.*}}.1: u8); + // CHECK: [[x1]] = copy ({{_.*}}.1: u8); let x1 = x.1; // should not be propagated } diff --git a/tests/mir-opt/dataflow-const-prop/slice_len.main.DataflowConstProp.32bit.panic-abort.diff b/tests/mir-opt/dataflow-const-prop/slice_len.main.DataflowConstProp.32bit.panic-abort.diff index efba4a4646c..40632db667a 100644 --- a/tests/mir-opt/dataflow-const-prop/slice_len.main.DataflowConstProp.32bit.panic-abort.diff +++ b/tests/mir-opt/dataflow-const-prop/slice_len.main.DataflowConstProp.32bit.panic-abort.diff @@ -30,23 +30,23 @@ StorageLive(_3); StorageLive(_4); _14 = const main::promoted[0]; - _4 = _14; - _3 = _4; + _4 = copy _14; + _3 = copy _4; _2 = move _3 as &[u32] (PointerCoercion(Unsize)); StorageDead(_3); StorageLive(_6); _6 = const 1_usize; - _7 = Len((*_2)); -- _8 = Lt(_6, _7); -- assert(move _8, "index out of bounds: the length is {} but the index is {}", move _7, _6) -> [success: bb1, unwind unreachable]; +- _8 = Lt(copy _6, copy _7); +- assert(move _8, "index out of bounds: the length is {} but the index is {}", move _7, copy _6) -> [success: bb1, unwind unreachable]; + _7 = const 3_usize; + _8 = const true; + assert(const true, "index out of bounds: the length is {} but the index is {}", const 3_usize, const 1_usize) -> [success: bb1, unwind unreachable]; } bb1: { -- _1 = (*_2)[_6]; -+ _1 = (*_2)[1 of 2]; +- _1 = copy (*_2)[_6]; ++ _1 = copy (*_2)[1 of 2]; StorageDead(_6); StorageDead(_4); StorageDead(_2); @@ -56,16 +56,16 @@ StorageLive(_11); _11 = const 1_usize; - _12 = Len((*_10)); -- _13 = Lt(_11, _12); -- assert(move _13, "index out of bounds: the length is {} but the index is {}", move _12, _11) -> [success: bb2, unwind unreachable]; +- _13 = Lt(copy _11, copy _12); +- assert(move _13, "index out of bounds: the length is {} but the index is {}", move _12, copy _11) -> [success: bb2, unwind unreachable]; + _12 = const 3_usize; + _13 = const true; + assert(const true, "index out of bounds: the length is {} but the index is {}", const 3_usize, const 1_usize) -> [success: bb2, unwind unreachable]; } bb2: { -- _9 = (*_10)[_11]; -+ _9 = (*_10)[1 of 2]; +- _9 = copy (*_10)[_11]; ++ _9 = copy (*_10)[1 of 2]; StorageDead(_11); StorageDead(_10); _0 = const (); diff --git a/tests/mir-opt/dataflow-const-prop/slice_len.main.DataflowConstProp.32bit.panic-unwind.diff b/tests/mir-opt/dataflow-const-prop/slice_len.main.DataflowConstProp.32bit.panic-unwind.diff index bf477d7e041..596b4ac9b1e 100644 --- a/tests/mir-opt/dataflow-const-prop/slice_len.main.DataflowConstProp.32bit.panic-unwind.diff +++ b/tests/mir-opt/dataflow-const-prop/slice_len.main.DataflowConstProp.32bit.panic-unwind.diff @@ -30,23 +30,23 @@ StorageLive(_3); StorageLive(_4); _14 = const main::promoted[0]; - _4 = _14; - _3 = _4; + _4 = copy _14; + _3 = copy _4; _2 = move _3 as &[u32] (PointerCoercion(Unsize)); StorageDead(_3); StorageLive(_6); _6 = const 1_usize; - _7 = Len((*_2)); -- _8 = Lt(_6, _7); -- assert(move _8, "index out of bounds: the length is {} but the index is {}", move _7, _6) -> [success: bb1, unwind continue]; +- _8 = Lt(copy _6, copy _7); +- assert(move _8, "index out of bounds: the length is {} but the index is {}", move _7, copy _6) -> [success: bb1, unwind continue]; + _7 = const 3_usize; + _8 = const true; + assert(const true, "index out of bounds: the length is {} but the index is {}", const 3_usize, const 1_usize) -> [success: bb1, unwind continue]; } bb1: { -- _1 = (*_2)[_6]; -+ _1 = (*_2)[1 of 2]; +- _1 = copy (*_2)[_6]; ++ _1 = copy (*_2)[1 of 2]; StorageDead(_6); StorageDead(_4); StorageDead(_2); @@ -56,16 +56,16 @@ StorageLive(_11); _11 = const 1_usize; - _12 = Len((*_10)); -- _13 = Lt(_11, _12); -- assert(move _13, "index out of bounds: the length is {} but the index is {}", move _12, _11) -> [success: bb2, unwind continue]; +- _13 = Lt(copy _11, copy _12); +- assert(move _13, "index out of bounds: the length is {} but the index is {}", move _12, copy _11) -> [success: bb2, unwind continue]; + _12 = const 3_usize; + _13 = const true; + assert(const true, "index out of bounds: the length is {} but the index is {}", const 3_usize, const 1_usize) -> [success: bb2, unwind continue]; } bb2: { -- _9 = (*_10)[_11]; -+ _9 = (*_10)[1 of 2]; +- _9 = copy (*_10)[_11]; ++ _9 = copy (*_10)[1 of 2]; StorageDead(_11); StorageDead(_10); _0 = const (); diff --git a/tests/mir-opt/dataflow-const-prop/slice_len.main.DataflowConstProp.64bit.panic-abort.diff b/tests/mir-opt/dataflow-const-prop/slice_len.main.DataflowConstProp.64bit.panic-abort.diff index efba4a4646c..40632db667a 100644 --- a/tests/mir-opt/dataflow-const-prop/slice_len.main.DataflowConstProp.64bit.panic-abort.diff +++ b/tests/mir-opt/dataflow-const-prop/slice_len.main.DataflowConstProp.64bit.panic-abort.diff @@ -30,23 +30,23 @@ StorageLive(_3); StorageLive(_4); _14 = const main::promoted[0]; - _4 = _14; - _3 = _4; + _4 = copy _14; + _3 = copy _4; _2 = move _3 as &[u32] (PointerCoercion(Unsize)); StorageDead(_3); StorageLive(_6); _6 = const 1_usize; - _7 = Len((*_2)); -- _8 = Lt(_6, _7); -- assert(move _8, "index out of bounds: the length is {} but the index is {}", move _7, _6) -> [success: bb1, unwind unreachable]; +- _8 = Lt(copy _6, copy _7); +- assert(move _8, "index out of bounds: the length is {} but the index is {}", move _7, copy _6) -> [success: bb1, unwind unreachable]; + _7 = const 3_usize; + _8 = const true; + assert(const true, "index out of bounds: the length is {} but the index is {}", const 3_usize, const 1_usize) -> [success: bb1, unwind unreachable]; } bb1: { -- _1 = (*_2)[_6]; -+ _1 = (*_2)[1 of 2]; +- _1 = copy (*_2)[_6]; ++ _1 = copy (*_2)[1 of 2]; StorageDead(_6); StorageDead(_4); StorageDead(_2); @@ -56,16 +56,16 @@ StorageLive(_11); _11 = const 1_usize; - _12 = Len((*_10)); -- _13 = Lt(_11, _12); -- assert(move _13, "index out of bounds: the length is {} but the index is {}", move _12, _11) -> [success: bb2, unwind unreachable]; +- _13 = Lt(copy _11, copy _12); +- assert(move _13, "index out of bounds: the length is {} but the index is {}", move _12, copy _11) -> [success: bb2, unwind unreachable]; + _12 = const 3_usize; + _13 = const true; + assert(const true, "index out of bounds: the length is {} but the index is {}", const 3_usize, const 1_usize) -> [success: bb2, unwind unreachable]; } bb2: { -- _9 = (*_10)[_11]; -+ _9 = (*_10)[1 of 2]; +- _9 = copy (*_10)[_11]; ++ _9 = copy (*_10)[1 of 2]; StorageDead(_11); StorageDead(_10); _0 = const (); diff --git a/tests/mir-opt/dataflow-const-prop/slice_len.main.DataflowConstProp.64bit.panic-unwind.diff b/tests/mir-opt/dataflow-const-prop/slice_len.main.DataflowConstProp.64bit.panic-unwind.diff index bf477d7e041..596b4ac9b1e 100644 --- a/tests/mir-opt/dataflow-const-prop/slice_len.main.DataflowConstProp.64bit.panic-unwind.diff +++ b/tests/mir-opt/dataflow-const-prop/slice_len.main.DataflowConstProp.64bit.panic-unwind.diff @@ -30,23 +30,23 @@ StorageLive(_3); StorageLive(_4); _14 = const main::promoted[0]; - _4 = _14; - _3 = _4; + _4 = copy _14; + _3 = copy _4; _2 = move _3 as &[u32] (PointerCoercion(Unsize)); StorageDead(_3); StorageLive(_6); _6 = const 1_usize; - _7 = Len((*_2)); -- _8 = Lt(_6, _7); -- assert(move _8, "index out of bounds: the length is {} but the index is {}", move _7, _6) -> [success: bb1, unwind continue]; +- _8 = Lt(copy _6, copy _7); +- assert(move _8, "index out of bounds: the length is {} but the index is {}", move _7, copy _6) -> [success: bb1, unwind continue]; + _7 = const 3_usize; + _8 = const true; + assert(const true, "index out of bounds: the length is {} but the index is {}", const 3_usize, const 1_usize) -> [success: bb1, unwind continue]; } bb1: { -- _1 = (*_2)[_6]; -+ _1 = (*_2)[1 of 2]; +- _1 = copy (*_2)[_6]; ++ _1 = copy (*_2)[1 of 2]; StorageDead(_6); StorageDead(_4); StorageDead(_2); @@ -56,16 +56,16 @@ StorageLive(_11); _11 = const 1_usize; - _12 = Len((*_10)); -- _13 = Lt(_11, _12); -- assert(move _13, "index out of bounds: the length is {} but the index is {}", move _12, _11) -> [success: bb2, unwind continue]; +- _13 = Lt(copy _11, copy _12); +- assert(move _13, "index out of bounds: the length is {} but the index is {}", move _12, copy _11) -> [success: bb2, unwind continue]; + _12 = const 3_usize; + _13 = const true; + assert(const true, "index out of bounds: the length is {} but the index is {}", const 3_usize, const 1_usize) -> [success: bb2, unwind continue]; } bb2: { -- _9 = (*_10)[_11]; -+ _9 = (*_10)[1 of 2]; +- _9 = copy (*_10)[_11]; ++ _9 = copy (*_10)[1 of 2]; StorageDead(_11); StorageDead(_10); _0 = const (); diff --git a/tests/mir-opt/dataflow-const-prop/slice_len.rs b/tests/mir-opt/dataflow-const-prop/slice_len.rs index 64c043cca79..e0e68f9fde5 100644 --- a/tests/mir-opt/dataflow-const-prop/slice_len.rs +++ b/tests/mir-opt/dataflow-const-prop/slice_len.rs @@ -17,7 +17,7 @@ fn main() { // CHECK: {{_.*}} = const true; // CHECK: assert(const true, - // CHECK: [[local]] = (*{{_.*}})[1 of 2]; + // CHECK: [[local]] = copy (*{{_.*}})[1 of 2]; let local = (&[1u32, 2, 3] as &[u32])[1]; // CHECK-NOT: {{_.*}} = Len( @@ -28,7 +28,7 @@ fn main() { // CHECK: {{_.*}} = const true; // CHECK: assert(const true, - // CHECK-NOT: [[constant]] = (*{{_.*}})[_ - // CHECK: [[constant]] = (*{{_.*}})[1 of 2]; + // CHECK-NOT: [[constant]] = {{copy|move}} (*{{_.*}})[_ + // CHECK: [[constant]] = copy (*{{_.*}})[1 of 2]; let constant = SLICE[1]; } diff --git a/tests/mir-opt/dataflow-const-prop/struct.main.DataflowConstProp.32bit.diff b/tests/mir-opt/dataflow-const-prop/struct.main.DataflowConstProp.32bit.diff index 5e89382ea8f..3ea49265cee 100644 --- a/tests/mir-opt/dataflow-const-prop/struct.main.DataflowConstProp.32bit.diff +++ b/tests/mir-opt/dataflow-const-prop/struct.main.DataflowConstProp.32bit.diff @@ -83,7 +83,7 @@ + _1 = const S(1_i32); StorageLive(_2); StorageLive(_3); -- _3 = (_1.0: i32); +- _3 = copy (_1.0: i32); - _2 = Add(move _3, const 2_i32); + _3 = const 1_i32; + _2 = const 3_i32; @@ -91,10 +91,10 @@ (_1.0: i32) = const 3_i32; StorageLive(_4); StorageLive(_5); -- _5 = _2; +- _5 = copy _2; + _5 = const 3_i32; StorageLive(_6); -- _6 = (_1.0: i32); +- _6 = copy (_1.0: i32); - _4 = Add(move _5, move _6); + _6 = const 3_i32; + _4 = const 6_i32; @@ -103,35 +103,35 @@ StorageLive(_10); _10 = const main::SMALL_VAL; StorageLive(_7); -- _7 = (_10.0: f32); +- _7 = copy (_10.0: f32); + _7 = const 4f32; StorageLive(_8); - _8 = (_10.1: std::option::Option<S>); + _8 = copy (_10.1: std::option::Option<S>); StorageLive(_9); - _9 = (_10.2: &[f32]); + _9 = copy (_10.2: &[f32]); StorageDead(_10); StorageLive(_14); _14 = const {ALLOC0: &&SmallStruct}; _31 = deref_copy (*_14); StorageLive(_11); _32 = deref_copy (*_14); -- _11 = ((*_32).0: f32); +- _11 = copy ((*_32).0: f32); + _11 = const 9f32; StorageLive(_12); _33 = deref_copy (*_14); - _12 = ((*_33).1: std::option::Option<S>); + _12 = copy ((*_33).1: std::option::Option<S>); StorageLive(_13); _34 = deref_copy (*_14); - _13 = ((*_34).2: &[f32]); + _13 = copy ((*_34).2: &[f32]); StorageDead(_14); StorageLive(_15); StorageLive(_16); -- _16 = _11; +- _16 = copy _11; + _16 = const 9f32; StorageLive(_17); - _17 = _12; + _17 = copy _12; StorageLive(_18); - _18 = _13; + _18 = copy _13; - _15 = SmallStruct(move _16, move _17, move _18); + _15 = SmallStruct(const 9f32, move _17, move _18); StorageDead(_18); @@ -140,35 +140,35 @@ StorageLive(_22); _22 = const main::BIG_VAL; StorageLive(_19); -- _19 = (_22.0: f32); +- _19 = copy (_22.0: f32); + _19 = const 25f32; StorageLive(_20); - _20 = (_22.1: std::option::Option<S>); + _20 = copy (_22.1: std::option::Option<S>); StorageLive(_21); - _21 = (_22.2: &[f32]); + _21 = copy (_22.2: &[f32]); StorageDead(_22); StorageLive(_26); _26 = const {ALLOC1: &&BigStruct}; _35 = deref_copy (*_26); StorageLive(_23); _36 = deref_copy (*_26); -- _23 = ((*_36).0: f32); +- _23 = copy ((*_36).0: f32); + _23 = const 82f32; StorageLive(_24); _37 = deref_copy (*_26); - _24 = ((*_37).1: std::option::Option<S>); + _24 = copy ((*_37).1: std::option::Option<S>); StorageLive(_25); _38 = deref_copy (*_26); - _25 = ((*_38).2: &[f32]); + _25 = copy ((*_38).2: &[f32]); StorageDead(_26); StorageLive(_27); StorageLive(_28); -- _28 = _23; +- _28 = copy _23; + _28 = const 82f32; StorageLive(_29); - _29 = _24; + _29 = copy _24; StorageLive(_30); - _30 = _25; + _30 = copy _25; - _27 = BigStruct(move _28, move _29, move _30); + _27 = BigStruct(const 82f32, move _29, move _30); StorageDead(_30); diff --git a/tests/mir-opt/dataflow-const-prop/struct.main.DataflowConstProp.64bit.diff b/tests/mir-opt/dataflow-const-prop/struct.main.DataflowConstProp.64bit.diff index a707d7e5e76..78a0944975c 100644 --- a/tests/mir-opt/dataflow-const-prop/struct.main.DataflowConstProp.64bit.diff +++ b/tests/mir-opt/dataflow-const-prop/struct.main.DataflowConstProp.64bit.diff @@ -83,7 +83,7 @@ + _1 = const S(1_i32); StorageLive(_2); StorageLive(_3); -- _3 = (_1.0: i32); +- _3 = copy (_1.0: i32); - _2 = Add(move _3, const 2_i32); + _3 = const 1_i32; + _2 = const 3_i32; @@ -91,10 +91,10 @@ (_1.0: i32) = const 3_i32; StorageLive(_4); StorageLive(_5); -- _5 = _2; +- _5 = copy _2; + _5 = const 3_i32; StorageLive(_6); -- _6 = (_1.0: i32); +- _6 = copy (_1.0: i32); - _4 = Add(move _5, move _6); + _6 = const 3_i32; + _4 = const 6_i32; @@ -103,35 +103,35 @@ StorageLive(_10); _10 = const main::SMALL_VAL; StorageLive(_7); -- _7 = (_10.0: f32); +- _7 = copy (_10.0: f32); + _7 = const 4f32; StorageLive(_8); - _8 = (_10.1: std::option::Option<S>); + _8 = copy (_10.1: std::option::Option<S>); StorageLive(_9); - _9 = (_10.2: &[f32]); + _9 = copy (_10.2: &[f32]); StorageDead(_10); StorageLive(_14); _14 = const {ALLOC0: &&SmallStruct}; _31 = deref_copy (*_14); StorageLive(_11); _32 = deref_copy (*_14); -- _11 = ((*_32).0: f32); +- _11 = copy ((*_32).0: f32); + _11 = const 9f32; StorageLive(_12); _33 = deref_copy (*_14); - _12 = ((*_33).1: std::option::Option<S>); + _12 = copy ((*_33).1: std::option::Option<S>); StorageLive(_13); _34 = deref_copy (*_14); - _13 = ((*_34).2: &[f32]); + _13 = copy ((*_34).2: &[f32]); StorageDead(_14); StorageLive(_15); StorageLive(_16); -- _16 = _11; +- _16 = copy _11; + _16 = const 9f32; StorageLive(_17); - _17 = _12; + _17 = copy _12; StorageLive(_18); - _18 = _13; + _18 = copy _13; - _15 = SmallStruct(move _16, move _17, move _18); + _15 = SmallStruct(const 9f32, move _17, move _18); StorageDead(_18); @@ -140,35 +140,35 @@ StorageLive(_22); _22 = const main::BIG_VAL; StorageLive(_19); -- _19 = (_22.0: f32); +- _19 = copy (_22.0: f32); + _19 = const 25f32; StorageLive(_20); - _20 = (_22.1: std::option::Option<S>); + _20 = copy (_22.1: std::option::Option<S>); StorageLive(_21); - _21 = (_22.2: &[f32]); + _21 = copy (_22.2: &[f32]); StorageDead(_22); StorageLive(_26); _26 = const {ALLOC1: &&BigStruct}; _35 = deref_copy (*_26); StorageLive(_23); _36 = deref_copy (*_26); -- _23 = ((*_36).0: f32); +- _23 = copy ((*_36).0: f32); + _23 = const 82f32; StorageLive(_24); _37 = deref_copy (*_26); - _24 = ((*_37).1: std::option::Option<S>); + _24 = copy ((*_37).1: std::option::Option<S>); StorageLive(_25); _38 = deref_copy (*_26); - _25 = ((*_38).2: &[f32]); + _25 = copy ((*_38).2: &[f32]); StorageDead(_26); StorageLive(_27); StorageLive(_28); -- _28 = _23; +- _28 = copy _23; + _28 = const 82f32; StorageLive(_29); - _29 = _24; + _29 = copy _24; StorageLive(_30); - _30 = _25; + _30 = copy _25; - _27 = BigStruct(move _28, move _29, move _30); + _27 = BigStruct(const 82f32, move _29, move _30); StorageDead(_30); diff --git a/tests/mir-opt/dataflow-const-prop/struct.rs b/tests/mir-opt/dataflow-const-prop/struct.rs index 89ad1b87029..44591ffb6de 100644 --- a/tests/mir-opt/dataflow-const-prop/struct.rs +++ b/tests/mir-opt/dataflow-const-prop/struct.rs @@ -46,15 +46,15 @@ fn main() { const SMALL_VAL: SmallStruct = SmallStruct(4., Some(S(1)), &[]); // CHECK: [[a1]] = const 4f32; - // CHECK: [[b1]] = ({{_.*}}.1: std::option::Option<S>); - // CHECK: [[c1]] = ({{_.*}}.2: &[f32]); + // CHECK: [[b1]] = copy ({{_.*}}.1: std::option::Option<S>); + // CHECK: [[c1]] = copy ({{_.*}}.2: &[f32]); let SmallStruct(a1, b1, c1) = SMALL_VAL; static SMALL_STAT: &SmallStruct = &SmallStruct(9., None, &[13.]); // CHECK: [[a2]] = const 9f32; - // CHECK: [[b2]] = ((*{{_.*}}).1: std::option::Option<S>); - // CHECK: [[c2]] = ((*{{_.*}}).2: &[f32]); + // CHECK: [[b2]] = copy ((*{{_.*}}).1: std::option::Option<S>); + // CHECK: [[c2]] = copy ((*{{_.*}}).2: &[f32]); let SmallStruct(a2, b2, c2) = *SMALL_STAT; // CHECK: [[ss]] = SmallStruct(const 9f32, move {{_.*}}, move {{_.*}}); @@ -63,14 +63,14 @@ fn main() { const BIG_VAL: BigStruct = BigStruct(25., None, &[]); // CHECK: [[a3]] = const 25f32; - // CHECK: [[b3]] = ({{_.*}}.1: std::option::Option<S>); - // CHECK: [[c3]] = ({{_.*}}.2: &[f32]); + // CHECK: [[b3]] = copy ({{_.*}}.1: std::option::Option<S>); + // CHECK: [[c3]] = copy ({{_.*}}.2: &[f32]); let BigStruct(a3, b3, c3) = BIG_VAL; static BIG_STAT: &BigStruct = &BigStruct(82., Some(S(35)), &[45., 72.]); // CHECK: [[a4]] = const 82f32; - // CHECK: [[b4]] = ((*{{_.*}}).1: std::option::Option<S>); - // CHECK: [[c4]] = ((*{{_.*}}).2: &[f32]); + // CHECK: [[b4]] = copy ((*{{_.*}}).1: std::option::Option<S>); + // CHECK: [[c4]] = copy ((*{{_.*}}).2: &[f32]); let BigStruct(a4, b4, c4) = *BIG_STAT; // We arbitrarily limit the size of synthetized values to 4 pointers. diff --git a/tests/mir-opt/dataflow-const-prop/terminator.main.DataflowConstProp.panic-abort.diff b/tests/mir-opt/dataflow-const-prop/terminator.main.DataflowConstProp.panic-abort.diff index c0f378cc21f..e13b2aa9f7e 100644 --- a/tests/mir-opt/dataflow-const-prop/terminator.main.DataflowConstProp.panic-abort.diff +++ b/tests/mir-opt/dataflow-const-prop/terminator.main.DataflowConstProp.panic-abort.diff @@ -17,7 +17,7 @@ StorageLive(_2); StorageLive(_3); StorageLive(_4); -- _4 = _1; +- _4 = copy _1; - _3 = Add(move _4, const 1_i32); + _4 = const 1_i32; + _3 = const 2_i32; diff --git a/tests/mir-opt/dataflow-const-prop/terminator.main.DataflowConstProp.panic-unwind.diff b/tests/mir-opt/dataflow-const-prop/terminator.main.DataflowConstProp.panic-unwind.diff index 395620fec52..4be25fdcc38 100644 --- a/tests/mir-opt/dataflow-const-prop/terminator.main.DataflowConstProp.panic-unwind.diff +++ b/tests/mir-opt/dataflow-const-prop/terminator.main.DataflowConstProp.panic-unwind.diff @@ -17,7 +17,7 @@ StorageLive(_2); StorageLive(_3); StorageLive(_4); -- _4 = _1; +- _4 = copy _1; - _3 = Add(move _4, const 1_i32); + _4 = const 1_i32; + _3 = const 2_i32; diff --git a/tests/mir-opt/dataflow-const-prop/transmute.unreachable_box.DataflowConstProp.32bit.diff b/tests/mir-opt/dataflow-const-prop/transmute.unreachable_box.DataflowConstProp.32bit.diff index 258e2b454eb..2d67ac92209 100644 --- a/tests/mir-opt/dataflow-const-prop/transmute.unreachable_box.DataflowConstProp.32bit.diff +++ b/tests/mir-opt/dataflow-const-prop/transmute.unreachable_box.DataflowConstProp.32bit.diff @@ -13,7 +13,7 @@ StorageLive(_1); - _1 = const 1_usize as std::boxed::Box<Never> (Transmute); + _1 = const Box::<Never>(Unique::<Never> {{ pointer: NonNull::<Never> {{ pointer: {0x1 as *const Never} }}, _marker: PhantomData::<Never> }}, std::alloc::Global); - _2 = (((_1.0: std::ptr::Unique<Never>).0: std::ptr::NonNull<Never>).0: *const Never); + _2 = copy (((_1.0: std::ptr::Unique<Never>).0: std::ptr::NonNull<Never>).0: *const Never); unreachable; } } diff --git a/tests/mir-opt/dataflow-const-prop/transmute.unreachable_box.DataflowConstProp.64bit.diff b/tests/mir-opt/dataflow-const-prop/transmute.unreachable_box.DataflowConstProp.64bit.diff index 258e2b454eb..2d67ac92209 100644 --- a/tests/mir-opt/dataflow-const-prop/transmute.unreachable_box.DataflowConstProp.64bit.diff +++ b/tests/mir-opt/dataflow-const-prop/transmute.unreachable_box.DataflowConstProp.64bit.diff @@ -13,7 +13,7 @@ StorageLive(_1); - _1 = const 1_usize as std::boxed::Box<Never> (Transmute); + _1 = const Box::<Never>(Unique::<Never> {{ pointer: NonNull::<Never> {{ pointer: {0x1 as *const Never} }}, _marker: PhantomData::<Never> }}, std::alloc::Global); - _2 = (((_1.0: std::ptr::Unique<Never>).0: std::ptr::NonNull<Never>).0: *const Never); + _2 = copy (((_1.0: std::ptr::Unique<Never>).0: std::ptr::NonNull<Never>).0: *const Never); unreachable; } } diff --git a/tests/mir-opt/dataflow-const-prop/tuple.main.DataflowConstProp.32bit.diff b/tests/mir-opt/dataflow-const-prop/tuple.main.DataflowConstProp.32bit.diff index e4031b65caa..f7846823e19 100644 --- a/tests/mir-opt/dataflow-const-prop/tuple.main.DataflowConstProp.32bit.diff +++ b/tests/mir-opt/dataflow-const-prop/tuple.main.DataflowConstProp.32bit.diff @@ -37,10 +37,10 @@ StorageLive(_2); StorageLive(_3); StorageLive(_4); -- _4 = (_1.0: i32); +- _4 = copy (_1.0: i32); + _4 = const 1_i32; StorageLive(_5); -- _5 = (_1.1: i32); +- _5 = copy (_1.1: i32); - _3 = Add(move _4, move _5); + _5 = const 2_i32; + _3 = const 3_i32; @@ -54,17 +54,17 @@ StorageLive(_6); StorageLive(_7); StorageLive(_8); -- _8 = (_1.0: i32); +- _8 = copy (_1.0: i32); + _8 = const 2_i32; StorageLive(_9); -- _9 = (_1.1: i32); +- _9 = copy (_1.1: i32); - _7 = Add(move _8, move _9); + _9 = const 3_i32; + _7 = const 5_i32; StorageDead(_9); StorageDead(_8); StorageLive(_10); -- _10 = _2; +- _10 = copy _2; - _6 = Add(move _7, move _10); + _10 = const 6_i32; + _6 = const 11_i32; @@ -72,13 +72,13 @@ StorageDead(_7); StorageLive(_11); StorageLive(_12); -- _12 = _2; +- _12 = copy _2; + _12 = const 6_i32; StorageLive(_13); -- _13 = _1; +- _13 = copy _1; + _13 = const (2_i32, 3_i32); StorageLive(_14); -- _14 = _6; +- _14 = copy _6; - _11 = (move _12, move _13, move _14); + _14 = const 11_i32; + _11 = (const 6_i32, const (2_i32, 3_i32), const 11_i32); diff --git a/tests/mir-opt/dataflow-const-prop/tuple.main.DataflowConstProp.64bit.diff b/tests/mir-opt/dataflow-const-prop/tuple.main.DataflowConstProp.64bit.diff index e4031b65caa..f7846823e19 100644 --- a/tests/mir-opt/dataflow-const-prop/tuple.main.DataflowConstProp.64bit.diff +++ b/tests/mir-opt/dataflow-const-prop/tuple.main.DataflowConstProp.64bit.diff @@ -37,10 +37,10 @@ StorageLive(_2); StorageLive(_3); StorageLive(_4); -- _4 = (_1.0: i32); +- _4 = copy (_1.0: i32); + _4 = const 1_i32; StorageLive(_5); -- _5 = (_1.1: i32); +- _5 = copy (_1.1: i32); - _3 = Add(move _4, move _5); + _5 = const 2_i32; + _3 = const 3_i32; @@ -54,17 +54,17 @@ StorageLive(_6); StorageLive(_7); StorageLive(_8); -- _8 = (_1.0: i32); +- _8 = copy (_1.0: i32); + _8 = const 2_i32; StorageLive(_9); -- _9 = (_1.1: i32); +- _9 = copy (_1.1: i32); - _7 = Add(move _8, move _9); + _9 = const 3_i32; + _7 = const 5_i32; StorageDead(_9); StorageDead(_8); StorageLive(_10); -- _10 = _2; +- _10 = copy _2; - _6 = Add(move _7, move _10); + _10 = const 6_i32; + _6 = const 11_i32; @@ -72,13 +72,13 @@ StorageDead(_7); StorageLive(_11); StorageLive(_12); -- _12 = _2; +- _12 = copy _2; + _12 = const 6_i32; StorageLive(_13); -- _13 = _1; +- _13 = copy _1; + _13 = const (2_i32, 3_i32); StorageLive(_14); -- _14 = _6; +- _14 = copy _6; - _11 = (move _12, move _13, move _14); + _14 = const 11_i32; + _11 = (const 6_i32, const (2_i32, 3_i32), const 11_i32); diff --git a/tests/mir-opt/dead-store-elimination/call_arg_copy.move_packed.DeadStoreElimination-final.panic-abort.diff b/tests/mir-opt/dead-store-elimination/call_arg_copy.move_packed.DeadStoreElimination-final.panic-abort.diff index 07fb8301b9a..80b727dd1a4 100644 --- a/tests/mir-opt/dead-store-elimination/call_arg_copy.move_packed.DeadStoreElimination-final.panic-abort.diff +++ b/tests/mir-opt/dead-store-elimination/call_arg_copy.move_packed.DeadStoreElimination-final.panic-abort.diff @@ -5,7 +5,7 @@ let mut _0: (); bb0: { - _0 = use_both(const 0_i32, (_1.1: i32)) -> [return: bb1, unwind unreachable]; + _0 = use_both(const 0_i32, copy (_1.1: i32)) -> [return: bb1, unwind unreachable]; } bb1: { diff --git a/tests/mir-opt/dead-store-elimination/call_arg_copy.move_packed.DeadStoreElimination-final.panic-unwind.diff b/tests/mir-opt/dead-store-elimination/call_arg_copy.move_packed.DeadStoreElimination-final.panic-unwind.diff index cac3badfa67..c7aff795bd8 100644 --- a/tests/mir-opt/dead-store-elimination/call_arg_copy.move_packed.DeadStoreElimination-final.panic-unwind.diff +++ b/tests/mir-opt/dead-store-elimination/call_arg_copy.move_packed.DeadStoreElimination-final.panic-unwind.diff @@ -5,7 +5,7 @@ let mut _0: (); bb0: { - _0 = use_both(const 0_i32, (_1.1: i32)) -> [return: bb1, unwind continue]; + _0 = use_both(const 0_i32, copy (_1.1: i32)) -> [return: bb1, unwind continue]; } bb1: { diff --git a/tests/mir-opt/dead-store-elimination/call_arg_copy.move_simple.DeadStoreElimination-final.panic-abort.diff b/tests/mir-opt/dead-store-elimination/call_arg_copy.move_simple.DeadStoreElimination-final.panic-abort.diff index f9bc9405d6a..a09ef3e4f34 100644 --- a/tests/mir-opt/dead-store-elimination/call_arg_copy.move_simple.DeadStoreElimination-final.panic-abort.diff +++ b/tests/mir-opt/dead-store-elimination/call_arg_copy.move_simple.DeadStoreElimination-final.panic-abort.diff @@ -10,8 +10,8 @@ bb0: { StorageLive(_2); -- _2 = use_both(_1, _1) -> [return: bb1, unwind unreachable]; -+ _2 = use_both(_1, move _1) -> [return: bb1, unwind unreachable]; +- _2 = use_both(copy _1, copy _1) -> [return: bb1, unwind unreachable]; ++ _2 = use_both(copy _1, move _1) -> [return: bb1, unwind unreachable]; } bb1: { diff --git a/tests/mir-opt/dead-store-elimination/call_arg_copy.move_simple.DeadStoreElimination-final.panic-unwind.diff b/tests/mir-opt/dead-store-elimination/call_arg_copy.move_simple.DeadStoreElimination-final.panic-unwind.diff index efe165422d9..09413c99fef 100644 --- a/tests/mir-opt/dead-store-elimination/call_arg_copy.move_simple.DeadStoreElimination-final.panic-unwind.diff +++ b/tests/mir-opt/dead-store-elimination/call_arg_copy.move_simple.DeadStoreElimination-final.panic-unwind.diff @@ -10,8 +10,8 @@ bb0: { StorageLive(_2); -- _2 = use_both(_1, _1) -> [return: bb1, unwind continue]; -+ _2 = use_both(_1, move _1) -> [return: bb1, unwind continue]; +- _2 = use_both(copy _1, copy _1) -> [return: bb1, unwind continue]; ++ _2 = use_both(copy _1, move _1) -> [return: bb1, unwind continue]; } bb1: { diff --git a/tests/mir-opt/dead-store-elimination/call_arg_copy.rs b/tests/mir-opt/dead-store-elimination/call_arg_copy.rs index 2556848ec46..27b5ccdb936 100644 --- a/tests/mir-opt/dead-store-elimination/call_arg_copy.rs +++ b/tests/mir-opt/dead-store-elimination/call_arg_copy.rs @@ -14,7 +14,7 @@ fn use_both(_: i32, _: i32) {} // EMIT_MIR call_arg_copy.move_simple.DeadStoreElimination-final.diff fn move_simple(x: i32) { // CHECK-LABEL: fn move_simple( - // CHECK: = use_both(_1, move _1) + // CHECK: = use_both(copy _1, move _1) use_both(x, x); } @@ -28,7 +28,7 @@ struct Packed { #[custom_mir(dialect = "analysis")] fn move_packed(packed: Packed) { // CHECK-LABEL: fn move_packed( - // CHECK: = use_both(const 0_i32, (_1.1: i32)) + // CHECK: = use_both(const 0_i32, copy (_1.1: i32)) mir! { { // We have a packed struct, verify that the copy is not turned into a move. diff --git a/tests/mir-opt/dead-store-elimination/cycle.cycle.DeadStoreElimination-initial.diff b/tests/mir-opt/dead-store-elimination/cycle.cycle.DeadStoreElimination-initial.diff index 2766b6ce6a9..ff18df1efcf 100644 --- a/tests/mir-opt/dead-store-elimination/cycle.cycle.DeadStoreElimination-initial.diff +++ b/tests/mir-opt/dead-store-elimination/cycle.cycle.DeadStoreElimination-initial.diff @@ -11,14 +11,14 @@ } bb1: { - switchInt(_4) -> [1: bb2, otherwise: bb3]; + switchInt(copy _4) -> [1: bb2, otherwise: bb3]; } bb2: { -- _5 = _3; -- _3 = _2; -- _2 = _1; -- _1 = _5; +- _5 = copy _3; +- _3 = copy _2; +- _2 = copy _1; +- _1 = copy _5; + nop; + nop; + nop; diff --git a/tests/mir-opt/dead-store-elimination/provenance_soundness.pointer_to_int.DeadStoreElimination-initial.diff b/tests/mir-opt/dead-store-elimination/provenance_soundness.pointer_to_int.DeadStoreElimination-initial.diff index 56d5c24ae1d..5d054e2ea16 100644 --- a/tests/mir-opt/dead-store-elimination/provenance_soundness.pointer_to_int.DeadStoreElimination-initial.diff +++ b/tests/mir-opt/dead-store-elimination/provenance_soundness.pointer_to_int.DeadStoreElimination-initial.diff @@ -18,12 +18,12 @@ bb0: { StorageLive(_2); StorageLive(_3); - _3 = _1; + _3 = copy _1; _2 = move _3 as usize (PointerExposeProvenance); StorageDead(_3); StorageLive(_4); StorageLive(_5); - _5 = _1; + _5 = copy _1; _4 = move _5 as isize (PointerExposeProvenance); StorageDead(_5); _0 = const (); diff --git a/tests/mir-opt/deduplicate_blocks.is_line_doc_comment_2.DeduplicateBlocks.panic-abort.diff b/tests/mir-opt/deduplicate_blocks.is_line_doc_comment_2.DeduplicateBlocks.panic-abort.diff index efb28ba344b..60742ef0e9a 100644 --- a/tests/mir-opt/deduplicate_blocks.is_line_doc_comment_2.DeduplicateBlocks.panic-abort.diff +++ b/tests/mir-opt/deduplicate_blocks.is_line_doc_comment_2.DeduplicateBlocks.panic-abort.diff @@ -37,40 +37,40 @@ } bb3: { - switchInt((*_2)[0 of 4]) -> [47: bb4, otherwise: bb2]; + switchInt(copy (*_2)[0 of 4]) -> [47: bb4, otherwise: bb2]; } bb4: { - switchInt((*_2)[1 of 4]) -> [47: bb5, otherwise: bb2]; + switchInt(copy (*_2)[1 of 4]) -> [47: bb5, otherwise: bb2]; } bb5: { - switchInt((*_2)[2 of 4]) -> [47: bb6, otherwise: bb2]; + switchInt(copy (*_2)[2 of 4]) -> [47: bb6, otherwise: bb2]; } bb6: { -- switchInt((*_2)[3 of 4]) -> [47: bb13, otherwise: bb2]; -+ switchInt((*_2)[3 of 4]) -> [47: bb11, otherwise: bb2]; +- switchInt(copy (*_2)[3 of 4]) -> [47: bb13, otherwise: bb2]; ++ switchInt(copy (*_2)[3 of 4]) -> [47: bb11, otherwise: bb2]; } bb7: { - _0 = const false; - goto -> bb14; -+ switchInt((*_2)[0 of 3]) -> [47: bb8, otherwise: bb11]; ++ switchInt(copy (*_2)[0 of 3]) -> [47: bb8, otherwise: bb11]; } bb8: { -- switchInt((*_2)[0 of 3]) -> [47: bb9, otherwise: bb7]; -+ switchInt((*_2)[1 of 3]) -> [47: bb9, otherwise: bb11]; +- switchInt(copy (*_2)[0 of 3]) -> [47: bb9, otherwise: bb7]; ++ switchInt(copy (*_2)[1 of 3]) -> [47: bb9, otherwise: bb11]; } bb9: { -- switchInt((*_2)[1 of 3]) -> [47: bb10, otherwise: bb7]; -+ switchInt((*_2)[2 of 3]) -> [47: bb10, 33: bb10, otherwise: bb11]; +- switchInt(copy (*_2)[1 of 3]) -> [47: bb10, otherwise: bb7]; ++ switchInt(copy (*_2)[2 of 3]) -> [47: bb10, 33: bb10, otherwise: bb11]; } bb10: { -- switchInt((*_2)[2 of 3]) -> [47: bb12, 33: bb11, otherwise: bb7]; +- switchInt(copy (*_2)[2 of 3]) -> [47: bb12, 33: bb11, otherwise: bb7]; - } - - bb11: { diff --git a/tests/mir-opt/deduplicate_blocks.is_line_doc_comment_2.DeduplicateBlocks.panic-unwind.diff b/tests/mir-opt/deduplicate_blocks.is_line_doc_comment_2.DeduplicateBlocks.panic-unwind.diff index c6e2d3a5512..7337a32f525 100644 --- a/tests/mir-opt/deduplicate_blocks.is_line_doc_comment_2.DeduplicateBlocks.panic-unwind.diff +++ b/tests/mir-opt/deduplicate_blocks.is_line_doc_comment_2.DeduplicateBlocks.panic-unwind.diff @@ -37,40 +37,40 @@ } bb3: { - switchInt((*_2)[0 of 4]) -> [47: bb4, otherwise: bb2]; + switchInt(copy (*_2)[0 of 4]) -> [47: bb4, otherwise: bb2]; } bb4: { - switchInt((*_2)[1 of 4]) -> [47: bb5, otherwise: bb2]; + switchInt(copy (*_2)[1 of 4]) -> [47: bb5, otherwise: bb2]; } bb5: { - switchInt((*_2)[2 of 4]) -> [47: bb6, otherwise: bb2]; + switchInt(copy (*_2)[2 of 4]) -> [47: bb6, otherwise: bb2]; } bb6: { -- switchInt((*_2)[3 of 4]) -> [47: bb13, otherwise: bb2]; -+ switchInt((*_2)[3 of 4]) -> [47: bb11, otherwise: bb2]; +- switchInt(copy (*_2)[3 of 4]) -> [47: bb13, otherwise: bb2]; ++ switchInt(copy (*_2)[3 of 4]) -> [47: bb11, otherwise: bb2]; } bb7: { - _0 = const false; - goto -> bb14; -+ switchInt((*_2)[0 of 3]) -> [47: bb8, otherwise: bb11]; ++ switchInt(copy (*_2)[0 of 3]) -> [47: bb8, otherwise: bb11]; } bb8: { -- switchInt((*_2)[0 of 3]) -> [47: bb9, otherwise: bb7]; -+ switchInt((*_2)[1 of 3]) -> [47: bb9, otherwise: bb11]; +- switchInt(copy (*_2)[0 of 3]) -> [47: bb9, otherwise: bb7]; ++ switchInt(copy (*_2)[1 of 3]) -> [47: bb9, otherwise: bb11]; } bb9: { -- switchInt((*_2)[1 of 3]) -> [47: bb10, otherwise: bb7]; -+ switchInt((*_2)[2 of 3]) -> [47: bb10, 33: bb10, otherwise: bb11]; +- switchInt(copy (*_2)[1 of 3]) -> [47: bb10, otherwise: bb7]; ++ switchInt(copy (*_2)[2 of 3]) -> [47: bb10, 33: bb10, otherwise: bb11]; } bb10: { -- switchInt((*_2)[2 of 3]) -> [47: bb12, 33: bb11, otherwise: bb7]; +- switchInt(copy (*_2)[2 of 3]) -> [47: bb12, 33: bb11, otherwise: bb7]; - } - - bb11: { diff --git a/tests/mir-opt/derefer_complex_case.main.Derefer.panic-abort.diff b/tests/mir-opt/derefer_complex_case.main.Derefer.panic-abort.diff index 4ead50e96d8..bac62c88668 100644 --- a/tests/mir-opt/derefer_complex_case.main.Derefer.panic-abort.diff +++ b/tests/mir-opt/derefer_complex_case.main.Derefer.panic-abort.diff @@ -64,11 +64,11 @@ bb5: { StorageLive(_12); -- _12 = (*((_7 as Some).0: &i32)); +- _12 = copy (*((_7 as Some).0: &i32)); + _15 = deref_copy ((_7 as Some).0: &i32); -+ _12 = (*_15); ++ _12 = copy (*_15); StorageLive(_13); - _13 = _12; + _13 = copy _12; _6 = std::mem::drop::<i32>(move _13) -> [return: bb7, unwind: bb8]; } diff --git a/tests/mir-opt/derefer_complex_case.main.Derefer.panic-unwind.diff b/tests/mir-opt/derefer_complex_case.main.Derefer.panic-unwind.diff index c7cf5f02e0e..55cd2e427ee 100644 --- a/tests/mir-opt/derefer_complex_case.main.Derefer.panic-unwind.diff +++ b/tests/mir-opt/derefer_complex_case.main.Derefer.panic-unwind.diff @@ -64,11 +64,11 @@ bb5: { StorageLive(_12); -- _12 = (*((_7 as Some).0: &i32)); +- _12 = copy (*((_7 as Some).0: &i32)); + _15 = deref_copy ((_7 as Some).0: &i32); -+ _12 = (*_15); ++ _12 = copy (*_15); StorageLive(_13); - _13 = _12; + _13 = copy _12; _6 = std::mem::drop::<i32>(move _13) -> [return: bb7, unwind continue]; } diff --git a/tests/mir-opt/derefer_terminator_test.main.Derefer.panic-abort.diff b/tests/mir-opt/derefer_terminator_test.main.Derefer.panic-abort.diff index f4c034517f7..012d2eb8b72 100644 --- a/tests/mir-opt/derefer_terminator_test.main.Derefer.panic-abort.diff +++ b/tests/mir-opt/derefer_terminator_test.main.Derefer.panic-abort.diff @@ -52,7 +52,7 @@ _5 = &_6; _4 = &_5; - PlaceMention((*(*(*(*_4))))); -- switchInt((*(*(*(*_4))))) -> [0: bb3, otherwise: bb4]; +- switchInt(copy (*(*(*(*_4))))) -> [0: bb3, otherwise: bb4]; + _10 = deref_copy (*_4); + _11 = deref_copy (*_10); + _12 = deref_copy (*_11); @@ -60,7 +60,7 @@ + _13 = deref_copy (*_4); + _14 = deref_copy (*_13); + _15 = deref_copy (*_14); -+ switchInt((*_15)) -> [0: bb3, otherwise: bb4]; ++ switchInt(copy (*_15)) -> [0: bb3, otherwise: bb4]; } bb3: { diff --git a/tests/mir-opt/derefer_terminator_test.main.Derefer.panic-unwind.diff b/tests/mir-opt/derefer_terminator_test.main.Derefer.panic-unwind.diff index e3c0c6b7dd2..43cee292335 100644 --- a/tests/mir-opt/derefer_terminator_test.main.Derefer.panic-unwind.diff +++ b/tests/mir-opt/derefer_terminator_test.main.Derefer.panic-unwind.diff @@ -52,7 +52,7 @@ _5 = &_6; _4 = &_5; - PlaceMention((*(*(*(*_4))))); -- switchInt((*(*(*(*_4))))) -> [0: bb3, otherwise: bb4]; +- switchInt(copy (*(*(*(*_4))))) -> [0: bb3, otherwise: bb4]; + _10 = deref_copy (*_4); + _11 = deref_copy (*_10); + _12 = deref_copy (*_11); @@ -60,7 +60,7 @@ + _13 = deref_copy (*_4); + _14 = deref_copy (*_13); + _15 = deref_copy (*_14); -+ switchInt((*_15)) -> [0: bb3, otherwise: bb4]; ++ switchInt(copy (*_15)) -> [0: bb3, otherwise: bb4]; } bb3: { diff --git a/tests/mir-opt/dest-prop/branch.foo.DestinationPropagation.panic-abort.diff b/tests/mir-opt/dest-prop/branch.foo.DestinationPropagation.panic-abort.diff index 10ec3aa555e..775d51ea49f 100644 --- a/tests/mir-opt/dest-prop/branch.foo.DestinationPropagation.panic-abort.diff +++ b/tests/mir-opt/dest-prop/branch.foo.DestinationPropagation.panic-abort.diff @@ -35,7 +35,7 @@ } bb3: { -- _2 = _1; +- _2 = copy _1; + nop; goto -> bb6; } @@ -47,14 +47,14 @@ bb5: { StorageDead(_4); -- _2 = _1; +- _2 = copy _1; + nop; goto -> bb6; } bb6: { StorageDead(_3); -- _0 = _2; +- _0 = copy _2; - StorageDead(_2); - StorageDead(_1); + nop; diff --git a/tests/mir-opt/dest-prop/branch.foo.DestinationPropagation.panic-unwind.diff b/tests/mir-opt/dest-prop/branch.foo.DestinationPropagation.panic-unwind.diff index 759c1cabf45..875ef8829d0 100644 --- a/tests/mir-opt/dest-prop/branch.foo.DestinationPropagation.panic-unwind.diff +++ b/tests/mir-opt/dest-prop/branch.foo.DestinationPropagation.panic-unwind.diff @@ -35,7 +35,7 @@ } bb3: { -- _2 = _1; +- _2 = copy _1; + nop; goto -> bb6; } @@ -47,14 +47,14 @@ bb5: { StorageDead(_4); -- _2 = _1; +- _2 = copy _1; + nop; goto -> bb6; } bb6: { StorageDead(_3); -- _0 = _2; +- _0 = copy _2; - StorageDead(_2); - StorageDead(_1); + nop; diff --git a/tests/mir-opt/dest-prop/copy_propagation_arg.arg_src.DestinationPropagation.panic-abort.diff b/tests/mir-opt/dest-prop/copy_propagation_arg.arg_src.DestinationPropagation.panic-abort.diff index 1aed07f9e6a..a4908c05e2e 100644 --- a/tests/mir-opt/dest-prop/copy_propagation_arg.arg_src.DestinationPropagation.panic-abort.diff +++ b/tests/mir-opt/dest-prop/copy_propagation_arg.arg_src.DestinationPropagation.panic-abort.diff @@ -12,11 +12,11 @@ bb0: { - StorageLive(_2); -- _2 = _1; +- _2 = copy _1; + nop; -+ _0 = _1; ++ _0 = copy _1; _1 = const 123_i32; -- _0 = _2; +- _0 = copy _2; - StorageDead(_2); + nop; + nop; diff --git a/tests/mir-opt/dest-prop/copy_propagation_arg.arg_src.DestinationPropagation.panic-unwind.diff b/tests/mir-opt/dest-prop/copy_propagation_arg.arg_src.DestinationPropagation.panic-unwind.diff index 1aed07f9e6a..a4908c05e2e 100644 --- a/tests/mir-opt/dest-prop/copy_propagation_arg.arg_src.DestinationPropagation.panic-unwind.diff +++ b/tests/mir-opt/dest-prop/copy_propagation_arg.arg_src.DestinationPropagation.panic-unwind.diff @@ -12,11 +12,11 @@ bb0: { - StorageLive(_2); -- _2 = _1; +- _2 = copy _1; + nop; -+ _0 = _1; ++ _0 = copy _1; _1 = const 123_i32; -- _0 = _2; +- _0 = copy _2; - StorageDead(_2); + nop; + nop; diff --git a/tests/mir-opt/dest-prop/copy_propagation_arg.bar.DestinationPropagation.panic-abort.diff b/tests/mir-opt/dest-prop/copy_propagation_arg.bar.DestinationPropagation.panic-abort.diff index 641dea594e1..24f2b464e2c 100644 --- a/tests/mir-opt/dest-prop/copy_propagation_arg.bar.DestinationPropagation.panic-abort.diff +++ b/tests/mir-opt/dest-prop/copy_propagation_arg.bar.DestinationPropagation.panic-abort.diff @@ -10,7 +10,7 @@ bb0: { StorageLive(_2); - StorageLive(_3); -- _3 = _1; +- _3 = copy _1; - _2 = dummy(move _3) -> [return: bb1, unwind unreachable]; + nop; + nop; diff --git a/tests/mir-opt/dest-prop/copy_propagation_arg.bar.DestinationPropagation.panic-unwind.diff b/tests/mir-opt/dest-prop/copy_propagation_arg.bar.DestinationPropagation.panic-unwind.diff index 8b2835c8ced..d42ac52b631 100644 --- a/tests/mir-opt/dest-prop/copy_propagation_arg.bar.DestinationPropagation.panic-unwind.diff +++ b/tests/mir-opt/dest-prop/copy_propagation_arg.bar.DestinationPropagation.panic-unwind.diff @@ -10,7 +10,7 @@ bb0: { StorageLive(_2); - StorageLive(_3); -- _3 = _1; +- _3 = copy _1; - _2 = dummy(move _3) -> [return: bb1, unwind continue]; + nop; + nop; diff --git a/tests/mir-opt/dest-prop/copy_propagation_arg.baz.DestinationPropagation.panic-abort.diff b/tests/mir-opt/dest-prop/copy_propagation_arg.baz.DestinationPropagation.panic-abort.diff index 4cddaec01d2..f1f1714b472 100644 --- a/tests/mir-opt/dest-prop/copy_propagation_arg.baz.DestinationPropagation.panic-abort.diff +++ b/tests/mir-opt/dest-prop/copy_propagation_arg.baz.DestinationPropagation.panic-abort.diff @@ -8,14 +8,14 @@ bb0: { - StorageLive(_2); -- _2 = _1; +- _2 = copy _1; - _1 = move _2; - StorageDead(_2); + nop; + nop; + nop; + nop; - _0 = _1; + _0 = copy _1; return; } } diff --git a/tests/mir-opt/dest-prop/copy_propagation_arg.baz.DestinationPropagation.panic-unwind.diff b/tests/mir-opt/dest-prop/copy_propagation_arg.baz.DestinationPropagation.panic-unwind.diff index 4cddaec01d2..f1f1714b472 100644 --- a/tests/mir-opt/dest-prop/copy_propagation_arg.baz.DestinationPropagation.panic-unwind.diff +++ b/tests/mir-opt/dest-prop/copy_propagation_arg.baz.DestinationPropagation.panic-unwind.diff @@ -8,14 +8,14 @@ bb0: { - StorageLive(_2); -- _2 = _1; +- _2 = copy _1; - _1 = move _2; - StorageDead(_2); + nop; + nop; + nop; + nop; - _0 = _1; + _0 = copy _1; return; } } diff --git a/tests/mir-opt/dest-prop/copy_propagation_arg.foo.DestinationPropagation.panic-abort.diff b/tests/mir-opt/dest-prop/copy_propagation_arg.foo.DestinationPropagation.panic-abort.diff index b461869be31..0328fc6b745 100644 --- a/tests/mir-opt/dest-prop/copy_propagation_arg.foo.DestinationPropagation.panic-abort.diff +++ b/tests/mir-opt/dest-prop/copy_propagation_arg.foo.DestinationPropagation.panic-abort.diff @@ -10,7 +10,7 @@ bb0: { StorageLive(_2); - StorageLive(_3); -- _3 = _1; +- _3 = copy _1; - _2 = dummy(move _3) -> [return: bb1, unwind unreachable]; + nop; + nop; diff --git a/tests/mir-opt/dest-prop/copy_propagation_arg.foo.DestinationPropagation.panic-unwind.diff b/tests/mir-opt/dest-prop/copy_propagation_arg.foo.DestinationPropagation.panic-unwind.diff index d5c2e07c6c2..30e2248db82 100644 --- a/tests/mir-opt/dest-prop/copy_propagation_arg.foo.DestinationPropagation.panic-unwind.diff +++ b/tests/mir-opt/dest-prop/copy_propagation_arg.foo.DestinationPropagation.panic-unwind.diff @@ -10,7 +10,7 @@ bb0: { StorageLive(_2); - StorageLive(_3); -- _3 = _1; +- _3 = copy _1; - _2 = dummy(move _3) -> [return: bb1, unwind continue]; + nop; + nop; diff --git a/tests/mir-opt/dest-prop/copy_propagation_arg.rs b/tests/mir-opt/dest-prop/copy_propagation_arg.rs index 084bd0544c1..ef531f4afa2 100644 --- a/tests/mir-opt/dest-prop/copy_propagation_arg.rs +++ b/tests/mir-opt/dest-prop/copy_propagation_arg.rs @@ -41,9 +41,9 @@ fn arg_src(mut x: i32) -> i32 { // CHECK-LABEL: fn arg_src( // CHECK: debug x => [[x:_.*]]; // CHECK: debug y => [[y:_.*]]; - // CHECK: [[y]] = [[x]] + // CHECK: [[y]] = copy [[x]] // CHECK: [[x]] = const 123_i32; - // CHECK-NOT: {{_.*}} = [[y]]; + // CHECK-NOT: {{_.*}} = copy [[y]]; let y = x; x = 123; // Don't propagate this assignment to `y` y diff --git a/tests/mir-opt/dest-prop/cycle.main.DestinationPropagation.panic-abort.diff b/tests/mir-opt/dest-prop/cycle.main.DestinationPropagation.panic-abort.diff index 98b4ee866d2..5d8aaedae37 100644 --- a/tests/mir-opt/dest-prop/cycle.main.DestinationPropagation.panic-abort.diff +++ b/tests/mir-opt/dest-prop/cycle.main.DestinationPropagation.panic-abort.diff @@ -31,11 +31,11 @@ bb1: { - StorageLive(_2); -- _2 = _1; +- _2 = copy _1; - StorageLive(_3); -- _3 = _2; +- _3 = copy _2; - StorageLive(_4); -- _4 = _3; +- _4 = copy _3; - _1 = move _4; - StorageDead(_4); + nop; @@ -48,7 +48,7 @@ + nop; StorageLive(_5); - StorageLive(_6); -- _6 = _1; +- _6 = copy _1; + nop; + nop; _5 = std::mem::drop::<i32>(move _6) -> [return: bb2, unwind unreachable]; diff --git a/tests/mir-opt/dest-prop/cycle.main.DestinationPropagation.panic-unwind.diff b/tests/mir-opt/dest-prop/cycle.main.DestinationPropagation.panic-unwind.diff index 6f6e01d37b1..05c9bcc1d73 100644 --- a/tests/mir-opt/dest-prop/cycle.main.DestinationPropagation.panic-unwind.diff +++ b/tests/mir-opt/dest-prop/cycle.main.DestinationPropagation.panic-unwind.diff @@ -31,11 +31,11 @@ bb1: { - StorageLive(_2); -- _2 = _1; +- _2 = copy _1; - StorageLive(_3); -- _3 = _2; +- _3 = copy _2; - StorageLive(_4); -- _4 = _3; +- _4 = copy _3; - _1 = move _4; - StorageDead(_4); + nop; @@ -48,7 +48,7 @@ + nop; StorageLive(_5); - StorageLive(_6); -- _6 = _1; +- _6 = copy _1; + nop; + nop; _5 = std::mem::drop::<i32>(move _6) -> [return: bb2, unwind continue]; diff --git a/tests/mir-opt/dest-prop/dead_stores_79191.f.DestinationPropagation.after.panic-abort.mir b/tests/mir-opt/dest-prop/dead_stores_79191.f.DestinationPropagation.after.panic-abort.mir index eb160fc194a..eb4209731c6 100644 --- a/tests/mir-opt/dest-prop/dead_stores_79191.f.DestinationPropagation.after.panic-abort.mir +++ b/tests/mir-opt/dest-prop/dead_stores_79191.f.DestinationPropagation.after.panic-abort.mir @@ -12,7 +12,7 @@ fn f(_1: usize) -> usize { bb0: { nop; - _3 = _1; + _3 = copy _1; _1 = const 5_usize; nop; nop; diff --git a/tests/mir-opt/dest-prop/dead_stores_79191.f.DestinationPropagation.after.panic-unwind.mir b/tests/mir-opt/dest-prop/dead_stores_79191.f.DestinationPropagation.after.panic-unwind.mir index 9147de2ec47..fe9a7376a58 100644 --- a/tests/mir-opt/dest-prop/dead_stores_79191.f.DestinationPropagation.after.panic-unwind.mir +++ b/tests/mir-opt/dest-prop/dead_stores_79191.f.DestinationPropagation.after.panic-unwind.mir @@ -12,7 +12,7 @@ fn f(_1: usize) -> usize { bb0: { nop; - _3 = _1; + _3 = copy _1; _1 = const 5_usize; nop; nop; diff --git a/tests/mir-opt/dest-prop/dead_stores_79191.rs b/tests/mir-opt/dest-prop/dead_stores_79191.rs index 61060e4f850..d035de5ce07 100644 --- a/tests/mir-opt/dest-prop/dead_stores_79191.rs +++ b/tests/mir-opt/dest-prop/dead_stores_79191.rs @@ -10,7 +10,7 @@ fn f(mut a: usize) -> usize { // CHECK-LABEL: fn f( // CHECK: debug a => [[a:_.*]]; // CHECK: debug b => [[b:_.*]]; - // CHECK: [[b]] = [[a]]; + // CHECK: [[b]] = copy [[a]]; // CHECK: [[a]] = const 5_usize; // CHECK: [[a]] = move [[b]]; // CHECK: id::<usize>(move [[a]]) diff --git a/tests/mir-opt/dest-prop/dead_stores_better.f.DestinationPropagation.after.panic-abort.mir b/tests/mir-opt/dest-prop/dead_stores_better.f.DestinationPropagation.after.panic-abort.mir index eb160fc194a..eb4209731c6 100644 --- a/tests/mir-opt/dest-prop/dead_stores_better.f.DestinationPropagation.after.panic-abort.mir +++ b/tests/mir-opt/dest-prop/dead_stores_better.f.DestinationPropagation.after.panic-abort.mir @@ -12,7 +12,7 @@ fn f(_1: usize) -> usize { bb0: { nop; - _3 = _1; + _3 = copy _1; _1 = const 5_usize; nop; nop; diff --git a/tests/mir-opt/dest-prop/dead_stores_better.f.DestinationPropagation.after.panic-unwind.mir b/tests/mir-opt/dest-prop/dead_stores_better.f.DestinationPropagation.after.panic-unwind.mir index 9147de2ec47..fe9a7376a58 100644 --- a/tests/mir-opt/dest-prop/dead_stores_better.f.DestinationPropagation.after.panic-unwind.mir +++ b/tests/mir-opt/dest-prop/dead_stores_better.f.DestinationPropagation.after.panic-unwind.mir @@ -12,7 +12,7 @@ fn f(_1: usize) -> usize { bb0: { nop; - _3 = _1; + _3 = copy _1; _1 = const 5_usize; nop; nop; diff --git a/tests/mir-opt/dest-prop/dead_stores_better.rs b/tests/mir-opt/dest-prop/dead_stores_better.rs index d2b9fe05712..d4c297fd97a 100644 --- a/tests/mir-opt/dest-prop/dead_stores_better.rs +++ b/tests/mir-opt/dest-prop/dead_stores_better.rs @@ -14,7 +14,7 @@ pub fn f(mut a: usize) -> usize { // CHECK-LABEL: fn f( // CHECK: debug a => [[a:_.*]]; // CHECK: debug b => [[b:_.*]]; - // CHECK: [[b]] = [[a]]; + // CHECK: [[b]] = copy [[a]]; // CHECK: [[a]] = const 5_usize; // CHECK: [[a]] = move [[b]]; // CHECK: id::<usize>(move [[a]]) diff --git a/tests/mir-opt/dest-prop/simple.nrvo.DestinationPropagation.panic-abort.diff b/tests/mir-opt/dest-prop/simple.nrvo.DestinationPropagation.panic-abort.diff index 4d34f43fd5c..e9fbcf20a72 100644 --- a/tests/mir-opt/dest-prop/simple.nrvo.DestinationPropagation.panic-abort.diff +++ b/tests/mir-opt/dest-prop/simple.nrvo.DestinationPropagation.panic-abort.diff @@ -18,7 +18,7 @@ _2 = [const 0_u8; 1024]; StorageLive(_3); - StorageLive(_4); -- _4 = _1; +- _4 = copy _1; + nop; + nop; StorageLive(_5); @@ -35,7 +35,7 @@ + nop; StorageDead(_6); StorageDead(_3); - _0 = _2; + _0 = copy _2; StorageDead(_2); return; } diff --git a/tests/mir-opt/dest-prop/simple.nrvo.DestinationPropagation.panic-unwind.diff b/tests/mir-opt/dest-prop/simple.nrvo.DestinationPropagation.panic-unwind.diff index 9c3cbef38d6..95d5fe1b930 100644 --- a/tests/mir-opt/dest-prop/simple.nrvo.DestinationPropagation.panic-unwind.diff +++ b/tests/mir-opt/dest-prop/simple.nrvo.DestinationPropagation.panic-unwind.diff @@ -18,7 +18,7 @@ _2 = [const 0_u8; 1024]; StorageLive(_3); - StorageLive(_4); -- _4 = _1; +- _4 = copy _1; + nop; + nop; StorageLive(_5); @@ -35,7 +35,7 @@ + nop; StorageDead(_6); StorageDead(_3); - _0 = _2; + _0 = copy _2; StorageDead(_2); return; } diff --git a/tests/mir-opt/dest-prop/simple.rs b/tests/mir-opt/dest-prop/simple.rs index 833d49b8c46..927a9c5b24c 100644 --- a/tests/mir-opt/dest-prop/simple.rs +++ b/tests/mir-opt/dest-prop/simple.rs @@ -7,9 +7,9 @@ fn nrvo(init: fn(&mut [u8; 1024])) -> [u8; 1024] { // CHECK: debug init => [[init:_.*]]; // CHECK: debug buf => [[buf:_.*]]; // CHECK: [[buf]] = [const 0_u8; 1024]; - // CHECK-NOT: {{_.*}} = [[init]]; + // CHECK-NOT: {{_.*}} = copy [[init]]; // CHECK: move [[init]](move {{_.*}}) - // CHECK: {{_.*}} = [[buf]] + // CHECK: {{_.*}} = copy [[buf]] let mut buf = [0; 1024]; init(&mut buf); buf diff --git a/tests/mir-opt/dest-prop/union.main.DestinationPropagation.panic-abort.diff b/tests/mir-opt/dest-prop/union.main.DestinationPropagation.panic-abort.diff index b596e25ddfd..557320f0179 100644 --- a/tests/mir-opt/dest-prop/union.main.DestinationPropagation.panic-abort.diff +++ b/tests/mir-opt/dest-prop/union.main.DestinationPropagation.panic-abort.diff @@ -22,7 +22,7 @@ _1 = Un { us: const 1_u32 }; StorageDead(_2); StorageLive(_3); - _3 = (_1.0: u32); + _3 = copy (_1.0: u32); StorageDead(_3); StorageDead(_1); return; diff --git a/tests/mir-opt/dest-prop/union.main.DestinationPropagation.panic-unwind.diff b/tests/mir-opt/dest-prop/union.main.DestinationPropagation.panic-unwind.diff index b596e25ddfd..557320f0179 100644 --- a/tests/mir-opt/dest-prop/union.main.DestinationPropagation.panic-unwind.diff +++ b/tests/mir-opt/dest-prop/union.main.DestinationPropagation.panic-unwind.diff @@ -22,7 +22,7 @@ _1 = Un { us: const 1_u32 }; StorageDead(_2); StorageLive(_3); - _3 = (_1.0: u32); + _3 = copy (_1.0: u32); StorageDead(_3); StorageDead(_1); return; diff --git a/tests/mir-opt/early_otherwise_branch.opt1.EarlyOtherwiseBranch.diff b/tests/mir-opt/early_otherwise_branch.opt1.EarlyOtherwiseBranch.diff index 4af3ed3e1d1..51c41996678 100644 --- a/tests/mir-opt/early_otherwise_branch.opt1.EarlyOtherwiseBranch.diff +++ b/tests/mir-opt/early_otherwise_branch.opt1.EarlyOtherwiseBranch.diff @@ -20,9 +20,9 @@ bb0: { StorageLive(_3); StorageLive(_4); - _4 = _1; + _4 = copy _1; StorageLive(_5); - _5 = _2; + _5 = copy _2; _3 = (move _4, move _5); StorageDead(_5); StorageDead(_4); @@ -42,9 +42,9 @@ bb3: { StorageLive(_8); - _8 = (((_3.0: std::option::Option<u32>) as Some).0: u32); + _8 = copy (((_3.0: std::option::Option<u32>) as Some).0: u32); StorageLive(_9); - _9 = (((_3.1: std::option::Option<u32>) as Some).0: u32); + _9 = copy (((_3.1: std::option::Option<u32>) as Some).0: u32); _0 = const 0_u32; StorageDead(_9); StorageDead(_8); diff --git a/tests/mir-opt/early_otherwise_branch.opt2.EarlyOtherwiseBranch.diff b/tests/mir-opt/early_otherwise_branch.opt2.EarlyOtherwiseBranch.diff index 41ae2fd3af3..f17ebee9416 100644 --- a/tests/mir-opt/early_otherwise_branch.opt2.EarlyOtherwiseBranch.diff +++ b/tests/mir-opt/early_otherwise_branch.opt2.EarlyOtherwiseBranch.diff @@ -21,9 +21,9 @@ bb0: { StorageLive(_3); StorageLive(_4); - _4 = _1; + _4 = copy _1; StorageLive(_5); - _5 = _2; + _5 = copy _2; _3 = (move _4, move _5); StorageDead(_5); StorageDead(_4); @@ -53,9 +53,9 @@ bb5: { StorageLive(_9); - _9 = (((_3.0: std::option::Option<u32>) as Some).0: u32); + _9 = copy (((_3.0: std::option::Option<u32>) as Some).0: u32); StorageLive(_10); - _10 = (((_3.1: std::option::Option<u32>) as Some).0: u32); + _10 = copy (((_3.1: std::option::Option<u32>) as Some).0: u32); _0 = const 0_u32; StorageDead(_10); StorageDead(_9); diff --git a/tests/mir-opt/early_otherwise_branch.opt3.EarlyOtherwiseBranch.diff b/tests/mir-opt/early_otherwise_branch.opt3.EarlyOtherwiseBranch.diff index 302fd0bfded..7b94a4c2bf7 100644 --- a/tests/mir-opt/early_otherwise_branch.opt3.EarlyOtherwiseBranch.diff +++ b/tests/mir-opt/early_otherwise_branch.opt3.EarlyOtherwiseBranch.diff @@ -35,7 +35,7 @@ + StorageLive(_12); + _12 = discriminant((_3.1: Option2<bool>)); + StorageLive(_13); -+ _13 = Ne(_9, move _12); ++ _13 = Ne(copy _9, move _12); + StorageDead(_12); + switchInt(move _13) -> [0: bb7, otherwise: bb1]; } @@ -78,9 +78,9 @@ - bb7: { + bb4: { StorageLive(_10); - _10 = (((_3.0: Option2<u32>) as Some).0: u32); + _10 = copy (((_3.0: Option2<u32>) as Some).0: u32); StorageLive(_11); - _11 = (((_3.1: Option2<bool>) as Some).0: bool); + _11 = copy (((_3.1: Option2<bool>) as Some).0: bool); _0 = const 0_u32; StorageDead(_11); StorageDead(_10); @@ -101,7 +101,7 @@ + + bb7: { + StorageDead(_13); -+ switchInt(_9) -> [0: bb4, 1: bb3, 2: bb2, otherwise: bb6]; ++ switchInt(copy _9) -> [0: bb4, 1: bb3, 2: bb2, otherwise: bb6]; } } diff --git a/tests/mir-opt/early_otherwise_branch.opt4.EarlyOtherwiseBranch.diff b/tests/mir-opt/early_otherwise_branch.opt4.EarlyOtherwiseBranch.diff index eef4fb3278c..f52795baef8 100644 --- a/tests/mir-opt/early_otherwise_branch.opt4.EarlyOtherwiseBranch.diff +++ b/tests/mir-opt/early_otherwise_branch.opt4.EarlyOtherwiseBranch.diff @@ -35,7 +35,7 @@ + StorageLive(_12); + _12 = discriminant((_3.1: Option2<u32>)); + StorageLive(_13); -+ _13 = Ne(_9, move _12); ++ _13 = Ne(copy _9, move _12); + StorageDead(_12); + switchInt(move _13) -> [0: bb7, otherwise: bb1]; } @@ -78,9 +78,9 @@ - bb7: { + bb4: { StorageLive(_10); - _10 = (((_3.0: Option2<u32>) as Some).0: u32); + _10 = copy (((_3.0: Option2<u32>) as Some).0: u32); StorageLive(_11); - _11 = (((_3.1: Option2<u32>) as Some).0: u32); + _11 = copy (((_3.1: Option2<u32>) as Some).0: u32); _0 = const 0_u32; StorageDead(_11); StorageDead(_10); @@ -101,7 +101,7 @@ + + bb7: { + StorageDead(_13); -+ switchInt(_9) -> [0: bb4, 1: bb3, 2: bb2, otherwise: bb6]; ++ switchInt(copy _9) -> [0: bb4, 1: bb3, 2: bb2, otherwise: bb6]; } } diff --git a/tests/mir-opt/early_otherwise_branch.rs b/tests/mir-opt/early_otherwise_branch.rs index b047c50df97..47bd4be295b 100644 --- a/tests/mir-opt/early_otherwise_branch.rs +++ b/tests/mir-opt/early_otherwise_branch.rs @@ -49,7 +49,7 @@ fn opt3(x: Option2<u32>, y: Option2<bool>) -> u32 { // CHECK: bb0: { // CHECK: [[LOCAL1:_.*]] = discriminant({{.*}}); // CHECK: [[LOCAL2:_.*]] = discriminant({{.*}}); - // CHECK: [[CMP_LOCAL]] = Ne([[LOCAL1]], move [[LOCAL2]]); + // CHECK: [[CMP_LOCAL]] = Ne(copy [[LOCAL1]], move [[LOCAL2]]); // CHECK: switchInt(move [[CMP_LOCAL]]) -> [ // CHECK-NEXT: } match (x, y) { @@ -67,7 +67,7 @@ fn opt4(x: Option2<u32>, y: Option2<u32>) -> u32 { // CHECK: bb0: { // CHECK: [[LOCAL1:_.*]] = discriminant({{.*}}); // CHECK: [[LOCAL2:_.*]] = discriminant({{.*}}); - // CHECK: [[CMP_LOCAL]] = Ne([[LOCAL1]], move [[LOCAL2]]); + // CHECK: [[CMP_LOCAL]] = Ne(copy [[LOCAL1]], move [[LOCAL2]]); // CHECK: switchInt(move [[CMP_LOCAL]]) -> [ // CHECK-NEXT: } match (x, y) { diff --git a/tests/mir-opt/early_otherwise_branch_3_element_tuple.opt1.EarlyOtherwiseBranch.diff b/tests/mir-opt/early_otherwise_branch_3_element_tuple.opt1.EarlyOtherwiseBranch.diff index cb03e2697cc..98df9934af0 100644 --- a/tests/mir-opt/early_otherwise_branch_3_element_tuple.opt1.EarlyOtherwiseBranch.diff +++ b/tests/mir-opt/early_otherwise_branch_3_element_tuple.opt1.EarlyOtherwiseBranch.diff @@ -27,11 +27,11 @@ bb0: { StorageLive(_4); StorageLive(_5); - _5 = _1; + _5 = copy _1; StorageLive(_6); - _6 = _2; + _6 = copy _2; StorageLive(_7); - _7 = _3; + _7 = copy _3; _4 = (move _5, move _6, move _7); StorageDead(_7); StorageDead(_6); @@ -72,11 +72,11 @@ bb7: { StorageLive(_13); - _13 = (((_4.0: std::option::Option<u32>) as Some).0: u32); + _13 = copy (((_4.0: std::option::Option<u32>) as Some).0: u32); StorageLive(_14); - _14 = (((_4.1: std::option::Option<u32>) as Some).0: u32); + _14 = copy (((_4.1: std::option::Option<u32>) as Some).0: u32); StorageLive(_15); - _15 = (((_4.2: std::option::Option<u32>) as Some).0: u32); + _15 = copy (((_4.2: std::option::Option<u32>) as Some).0: u32); _0 = const 0_u32; StorageDead(_15); StorageDead(_14); diff --git a/tests/mir-opt/early_otherwise_branch_3_element_tuple.opt2.EarlyOtherwiseBranch.diff b/tests/mir-opt/early_otherwise_branch_3_element_tuple.opt2.EarlyOtherwiseBranch.diff index 5634df253a5..831d8cbb4d6 100644 --- a/tests/mir-opt/early_otherwise_branch_3_element_tuple.opt2.EarlyOtherwiseBranch.diff +++ b/tests/mir-opt/early_otherwise_branch_3_element_tuple.opt2.EarlyOtherwiseBranch.diff @@ -45,7 +45,7 @@ + StorageLive(_18); + _18 = discriminant((_4.1: Option2<u32>)); + StorageLive(_19); -+ _19 = Ne(_14, move _18); ++ _19 = Ne(copy _14, move _18); + StorageDead(_18); + switchInt(move _19) -> [0: bb10, otherwise: bb1]; } @@ -109,11 +109,11 @@ - bb10: { + bb7: { StorageLive(_15); - _15 = (((_4.0: Option2<u32>) as Some).0: u32); + _15 = copy (((_4.0: Option2<u32>) as Some).0: u32); StorageLive(_16); - _16 = (((_4.1: Option2<u32>) as Some).0: u32); + _16 = copy (((_4.1: Option2<u32>) as Some).0: u32); StorageLive(_17); - _17 = (((_4.2: Option2<u32>) as Some).0: u32); + _17 = copy (((_4.2: Option2<u32>) as Some).0: u32); _0 = const 0_u32; StorageDead(_17); StorageDead(_16); @@ -135,7 +135,7 @@ + + bb10: { + StorageDead(_19); -+ switchInt(_14) -> [0: bb2, 1: bb3, 2: bb4, otherwise: bb9]; ++ switchInt(copy _14) -> [0: bb2, 1: bb3, 2: bb4, otherwise: bb9]; } } diff --git a/tests/mir-opt/early_otherwise_branch_3_element_tuple.rs b/tests/mir-opt/early_otherwise_branch_3_element_tuple.rs index d2a3e1f59ff..d6b27fbce48 100644 --- a/tests/mir-opt/early_otherwise_branch_3_element_tuple.rs +++ b/tests/mir-opt/early_otherwise_branch_3_element_tuple.rs @@ -32,7 +32,7 @@ fn opt2(x: Option2<u32>, y: Option2<u32>, z: Option2<u32>) -> u32 { // CHECK: bb0: { // CHECK: [[LOCAL1:_.*]] = discriminant({{.*}}); // CHECK: [[LOCAL2:_.*]] = discriminant({{.*}}); - // CHECK: [[CMP_LOCAL]] = Ne([[LOCAL1]], move [[LOCAL2]]); + // CHECK: [[CMP_LOCAL]] = Ne(copy [[LOCAL1]], move [[LOCAL2]]); // CHECK: switchInt(move [[CMP_LOCAL]]) -> [ // CHECK-NEXT: } match (x, y, z) { diff --git a/tests/mir-opt/early_otherwise_branch_68867.try_sum.EarlyOtherwiseBranch.diff b/tests/mir-opt/early_otherwise_branch_68867.try_sum.EarlyOtherwiseBranch.diff index 8179d9dd115..fec318c1ab4 100644 --- a/tests/mir-opt/early_otherwise_branch_68867.try_sum.EarlyOtherwiseBranch.diff +++ b/tests/mir-opt/early_otherwise_branch_68867.try_sum.EarlyOtherwiseBranch.diff @@ -70,9 +70,9 @@ StorageLive(_3); StorageLive(_4); StorageLive(_5); - _5 = _1; + _5 = copy _1; StorageLive(_6); - _6 = _2; + _6 = copy _2; _4 = (move _5, move _6); StorageDead(_6); StorageDead(_5); @@ -118,15 +118,15 @@ bb6: { StorageLive(_27); _39 = deref_copy (_4.0: &ViewportPercentageLength); - _27 = (((*_39) as Vmax).0: f32); + _27 = copy (((*_39) as Vmax).0: f32); StorageLive(_28); _40 = deref_copy (_4.1: &ViewportPercentageLength); - _28 = (((*_40) as Vmax).0: f32); + _28 = copy (((*_40) as Vmax).0: f32); StorageLive(_29); StorageLive(_30); - _30 = _27; + _30 = copy _27; StorageLive(_31); - _31 = _28; + _31 = copy _28; _29 = Add(move _30, move _31); StorageDead(_31); StorageDead(_30); @@ -140,15 +140,15 @@ bb7: { StorageLive(_22); _41 = deref_copy (_4.0: &ViewportPercentageLength); - _22 = (((*_41) as Vmin).0: f32); + _22 = copy (((*_41) as Vmin).0: f32); StorageLive(_23); _42 = deref_copy (_4.1: &ViewportPercentageLength); - _23 = (((*_42) as Vmin).0: f32); + _23 = copy (((*_42) as Vmin).0: f32); StorageLive(_24); StorageLive(_25); - _25 = _22; + _25 = copy _22; StorageLive(_26); - _26 = _23; + _26 = copy _23; _24 = Add(move _25, move _26); StorageDead(_26); StorageDead(_25); @@ -162,15 +162,15 @@ bb8: { StorageLive(_17); _43 = deref_copy (_4.0: &ViewportPercentageLength); - _17 = (((*_43) as Vh).0: f32); + _17 = copy (((*_43) as Vh).0: f32); StorageLive(_18); _44 = deref_copy (_4.1: &ViewportPercentageLength); - _18 = (((*_44) as Vh).0: f32); + _18 = copy (((*_44) as Vh).0: f32); StorageLive(_19); StorageLive(_20); - _20 = _17; + _20 = copy _17; StorageLive(_21); - _21 = _18; + _21 = copy _18; _19 = Add(move _20, move _21); StorageDead(_21); StorageDead(_20); @@ -184,15 +184,15 @@ bb9: { StorageLive(_12); _45 = deref_copy (_4.0: &ViewportPercentageLength); - _12 = (((*_45) as Vw).0: f32); + _12 = copy (((*_45) as Vw).0: f32); StorageLive(_13); _46 = deref_copy (_4.1: &ViewportPercentageLength); - _13 = (((*_46) as Vw).0: f32); + _13 = copy (((*_46) as Vw).0: f32); StorageLive(_14); StorageLive(_15); - _15 = _12; + _15 = copy _12; StorageLive(_16); - _16 = _13; + _16 = copy _13; _14 = Add(move _15, move _16); StorageDead(_16); StorageDead(_15); diff --git a/tests/mir-opt/early_otherwise_branch_noopt.noopt1.EarlyOtherwiseBranch.diff b/tests/mir-opt/early_otherwise_branch_noopt.noopt1.EarlyOtherwiseBranch.diff index 651b1de4ddd..8ed2274a72b 100644 --- a/tests/mir-opt/early_otherwise_branch_noopt.noopt1.EarlyOtherwiseBranch.diff +++ b/tests/mir-opt/early_otherwise_branch_noopt.noopt1.EarlyOtherwiseBranch.diff @@ -29,9 +29,9 @@ bb0: { StorageLive(_3); StorageLive(_4); - _4 = _1; + _4 = copy _1; StorageLive(_5); - _5 = _2; + _5 = copy _2; _3 = (move _4, move _5); StorageDead(_5); StorageDead(_4); @@ -60,7 +60,7 @@ bb5: { StorageLive(_12); - _12 = (((_3.1: std::option::Option<u32>) as Some).0: u32); + _12 = copy (((_3.1: std::option::Option<u32>) as Some).0: u32); _0 = const 2_u32; StorageDead(_12); goto -> bb8; @@ -68,7 +68,7 @@ bb6: { StorageLive(_11); - _11 = (((_3.0: std::option::Option<u32>) as Some).0: u32); + _11 = copy (((_3.0: std::option::Option<u32>) as Some).0: u32); _0 = const 1_u32; StorageDead(_11); goto -> bb8; @@ -76,9 +76,9 @@ bb7: { StorageLive(_9); - _9 = (((_3.0: std::option::Option<u32>) as Some).0: u32); + _9 = copy (((_3.0: std::option::Option<u32>) as Some).0: u32); StorageLive(_10); - _10 = (((_3.1: std::option::Option<u32>) as Some).0: u32); + _10 = copy (((_3.1: std::option::Option<u32>) as Some).0: u32); _0 = const 0_u32; StorageDead(_10); StorageDead(_9); diff --git a/tests/mir-opt/early_otherwise_branch_soundness.no_deref_ptr.EarlyOtherwiseBranch.diff b/tests/mir-opt/early_otherwise_branch_soundness.no_deref_ptr.EarlyOtherwiseBranch.diff index 8eab59823f4..eeb8b766b5d 100644 --- a/tests/mir-opt/early_otherwise_branch_soundness.no_deref_ptr.EarlyOtherwiseBranch.diff +++ b/tests/mir-opt/early_otherwise_branch_soundness.no_deref_ptr.EarlyOtherwiseBranch.diff @@ -34,8 +34,8 @@ bb4: { StorageLive(_5); - _5 = (((*_2) as Some).0: i32); - _0 = _5; + _5 = copy (((*_2) as Some).0: i32); + _0 = copy _5; StorageDead(_5); goto -> bb5; } diff --git a/tests/mir-opt/enum_opt.cand.EnumSizeOpt.32bit.diff b/tests/mir-opt/enum_opt.cand.EnumSizeOpt.32bit.diff index 085c55caaa0..727efe4b0d9 100644 --- a/tests/mir-opt/enum_opt.cand.EnumSizeOpt.32bit.diff +++ b/tests/mir-opt/enum_opt.cand.EnumSizeOpt.32bit.diff @@ -38,28 +38,28 @@ + StorageLive(_4); + _4 = const [2_usize, 8197_usize]; + _5 = discriminant(_2); -+ _6 = _5 as usize (IntToInt); -+ _7 = _4[_6]; ++ _6 = copy _5 as usize (IntToInt); ++ _7 = copy _4[_6]; + _8 = &raw mut _1; -+ _9 = _8 as *mut u8 (PtrToPtr); ++ _9 = copy _8 as *mut u8 (PtrToPtr); + _10 = &raw const _2; -+ _11 = _10 as *const u8 (PtrToPtr); ++ _11 = copy _10 as *const u8 (PtrToPtr); + Deinit(_8); -+ copy_nonoverlapping(dst = _9, src = _11, count = _7); ++ copy_nonoverlapping(dst = copy _9, src = copy _11, count = copy _7); + StorageDead(_4); StorageDead(_2); - _0 = move _1; + StorageLive(_12); + _12 = const [2_usize, 8197_usize]; + _13 = discriminant(_1); -+ _14 = _13 as usize (IntToInt); -+ _15 = _12[_14]; ++ _14 = copy _13 as usize (IntToInt); ++ _15 = copy _12[_14]; + _16 = &raw mut _0; -+ _17 = _16 as *mut u8 (PtrToPtr); ++ _17 = copy _16 as *mut u8 (PtrToPtr); + _18 = &raw const _1; -+ _19 = _18 as *const u8 (PtrToPtr); ++ _19 = copy _18 as *const u8 (PtrToPtr); + Deinit(_16); -+ copy_nonoverlapping(dst = _17, src = _19, count = _15); ++ copy_nonoverlapping(dst = copy _17, src = copy _19, count = copy _15); + StorageDead(_12); StorageDead(_1); return; diff --git a/tests/mir-opt/enum_opt.cand.EnumSizeOpt.64bit.diff b/tests/mir-opt/enum_opt.cand.EnumSizeOpt.64bit.diff index 798b7c10fe8..8d0cd97f786 100644 --- a/tests/mir-opt/enum_opt.cand.EnumSizeOpt.64bit.diff +++ b/tests/mir-opt/enum_opt.cand.EnumSizeOpt.64bit.diff @@ -38,28 +38,28 @@ + StorageLive(_4); + _4 = const [2_usize, 8197_usize]; + _5 = discriminant(_2); -+ _6 = _5 as usize (IntToInt); -+ _7 = _4[_6]; ++ _6 = copy _5 as usize (IntToInt); ++ _7 = copy _4[_6]; + _8 = &raw mut _1; -+ _9 = _8 as *mut u8 (PtrToPtr); ++ _9 = copy _8 as *mut u8 (PtrToPtr); + _10 = &raw const _2; -+ _11 = _10 as *const u8 (PtrToPtr); ++ _11 = copy _10 as *const u8 (PtrToPtr); + Deinit(_8); -+ copy_nonoverlapping(dst = _9, src = _11, count = _7); ++ copy_nonoverlapping(dst = copy _9, src = copy _11, count = copy _7); + StorageDead(_4); StorageDead(_2); - _0 = move _1; + StorageLive(_12); + _12 = const [2_usize, 8197_usize]; + _13 = discriminant(_1); -+ _14 = _13 as usize (IntToInt); -+ _15 = _12[_14]; ++ _14 = copy _13 as usize (IntToInt); ++ _15 = copy _12[_14]; + _16 = &raw mut _0; -+ _17 = _16 as *mut u8 (PtrToPtr); ++ _17 = copy _16 as *mut u8 (PtrToPtr); + _18 = &raw const _1; -+ _19 = _18 as *const u8 (PtrToPtr); ++ _19 = copy _18 as *const u8 (PtrToPtr); + Deinit(_16); -+ copy_nonoverlapping(dst = _17, src = _19, count = _15); ++ copy_nonoverlapping(dst = copy _17, src = copy _19, count = copy _15); + StorageDead(_12); StorageDead(_1); return; diff --git a/tests/mir-opt/enum_opt.unin.EnumSizeOpt.32bit.diff b/tests/mir-opt/enum_opt.unin.EnumSizeOpt.32bit.diff index a04829af4b5..6d1e2a72fdb 100644 --- a/tests/mir-opt/enum_opt.unin.EnumSizeOpt.32bit.diff +++ b/tests/mir-opt/enum_opt.unin.EnumSizeOpt.32bit.diff @@ -38,28 +38,28 @@ + StorageLive(_4); + _4 = const [8197_usize, 1_usize]; + _5 = discriminant(_2); -+ _6 = _5 as usize (IntToInt); -+ _7 = _4[_6]; ++ _6 = copy _5 as usize (IntToInt); ++ _7 = copy _4[_6]; + _8 = &raw mut _1; -+ _9 = _8 as *mut u8 (PtrToPtr); ++ _9 = copy _8 as *mut u8 (PtrToPtr); + _10 = &raw const _2; -+ _11 = _10 as *const u8 (PtrToPtr); ++ _11 = copy _10 as *const u8 (PtrToPtr); + Deinit(_8); -+ copy_nonoverlapping(dst = _9, src = _11, count = _7); ++ copy_nonoverlapping(dst = copy _9, src = copy _11, count = copy _7); + StorageDead(_4); StorageDead(_2); - _0 = move _1; + StorageLive(_12); + _12 = const [8197_usize, 1_usize]; + _13 = discriminant(_1); -+ _14 = _13 as usize (IntToInt); -+ _15 = _12[_14]; ++ _14 = copy _13 as usize (IntToInt); ++ _15 = copy _12[_14]; + _16 = &raw mut _0; -+ _17 = _16 as *mut u8 (PtrToPtr); ++ _17 = copy _16 as *mut u8 (PtrToPtr); + _18 = &raw const _1; -+ _19 = _18 as *const u8 (PtrToPtr); ++ _19 = copy _18 as *const u8 (PtrToPtr); + Deinit(_16); -+ copy_nonoverlapping(dst = _17, src = _19, count = _15); ++ copy_nonoverlapping(dst = copy _17, src = copy _19, count = copy _15); + StorageDead(_12); StorageDead(_1); return; diff --git a/tests/mir-opt/enum_opt.unin.EnumSizeOpt.64bit.diff b/tests/mir-opt/enum_opt.unin.EnumSizeOpt.64bit.diff index f5521a1e22a..4b1406d0d62 100644 --- a/tests/mir-opt/enum_opt.unin.EnumSizeOpt.64bit.diff +++ b/tests/mir-opt/enum_opt.unin.EnumSizeOpt.64bit.diff @@ -38,28 +38,28 @@ + StorageLive(_4); + _4 = const [8197_usize, 1_usize]; + _5 = discriminant(_2); -+ _6 = _5 as usize (IntToInt); -+ _7 = _4[_6]; ++ _6 = copy _5 as usize (IntToInt); ++ _7 = copy _4[_6]; + _8 = &raw mut _1; -+ _9 = _8 as *mut u8 (PtrToPtr); ++ _9 = copy _8 as *mut u8 (PtrToPtr); + _10 = &raw const _2; -+ _11 = _10 as *const u8 (PtrToPtr); ++ _11 = copy _10 as *const u8 (PtrToPtr); + Deinit(_8); -+ copy_nonoverlapping(dst = _9, src = _11, count = _7); ++ copy_nonoverlapping(dst = copy _9, src = copy _11, count = copy _7); + StorageDead(_4); StorageDead(_2); - _0 = move _1; + StorageLive(_12); + _12 = const [8197_usize, 1_usize]; + _13 = discriminant(_1); -+ _14 = _13 as usize (IntToInt); -+ _15 = _12[_14]; ++ _14 = copy _13 as usize (IntToInt); ++ _15 = copy _12[_14]; + _16 = &raw mut _0; -+ _17 = _16 as *mut u8 (PtrToPtr); ++ _17 = copy _16 as *mut u8 (PtrToPtr); + _18 = &raw const _1; -+ _19 = _18 as *const u8 (PtrToPtr); ++ _19 = copy _18 as *const u8 (PtrToPtr); + Deinit(_16); -+ copy_nonoverlapping(dst = _17, src = _19, count = _15); ++ copy_nonoverlapping(dst = copy _17, src = copy _19, count = copy _15); + StorageDead(_12); StorageDead(_1); return; diff --git a/tests/mir-opt/funky_arms.float_to_exponential_common.GVN.panic-abort.diff b/tests/mir-opt/funky_arms.float_to_exponential_common.GVN.panic-abort.diff index 8a701641ff9..ed72ca72629 100644 --- a/tests/mir-opt/funky_arms.float_to_exponential_common.GVN.panic-abort.diff +++ b/tests/mir-opt/funky_arms.float_to_exponential_common.GVN.panic-abort.diff @@ -42,13 +42,13 @@ StorageLive(_4); StorageLive(_20); StorageLive(_21); - _21 = ((*_1).0: u32); + _21 = copy ((*_1).0: u32); _20 = BitAnd(move _21, const 1_u32); StorageDead(_21); _4 = Ne(move _20, const 0_u32); StorageDead(_20); StorageLive(_5); - switchInt(_4) -> [0: bb2, otherwise: bb1]; + switchInt(copy _4) -> [0: bb2, otherwise: bb1]; } bb1: { @@ -65,7 +65,7 @@ bb3: { StorageLive(_6); - _6 = ((*_1).4: std::option::Option<usize>); + _6 = copy ((*_1).4: std::option::Option<usize>); _7 = discriminant(_6); switchInt(move _7) -> [1: bb4, 0: bb6, otherwise: bb9]; } @@ -73,26 +73,26 @@ bb4: { - StorageLive(_8); + nop; - _8 = ((_6 as Some).0: usize); + _8 = copy ((_6 as Some).0: usize); StorageLive(_9); - _9 = _1; + _9 = copy _1; StorageLive(_10); - _10 = _2; + _10 = copy _2; StorageLive(_11); - _11 = _5; + _11 = copy _5; StorageLive(_12); StorageLive(_13); StorageLive(_14); - _14 = _8; + _14 = copy _8; - _13 = move _14 as u32 (IntToInt); -+ _13 = _8 as u32 (IntToInt); ++ _13 = copy _8 as u32 (IntToInt); StorageDead(_14); _12 = Add(move _13, const 1_u32); StorageDead(_13); StorageLive(_15); - _15 = _3; + _15 = copy _3; - _0 = float_to_exponential_common_exact::<T>(move _9, move _10, move _11, move _12, move _15) -> [return: bb5, unwind unreachable]; -+ _0 = float_to_exponential_common_exact::<T>(_1, _2, move _11, move _12, _3) -> [return: bb5, unwind unreachable]; ++ _0 = float_to_exponential_common_exact::<T>(copy _1, copy _2, move _11, move _12, copy _3) -> [return: bb5, unwind unreachable]; } bb5: { @@ -108,15 +108,15 @@ bb6: { StorageLive(_16); - _16 = _1; + _16 = copy _1; StorageLive(_17); - _17 = _2; + _17 = copy _2; StorageLive(_18); - _18 = _5; + _18 = copy _5; StorageLive(_19); - _19 = _3; + _19 = copy _3; - _0 = float_to_exponential_common_shortest::<T>(move _16, move _17, move _18, move _19) -> [return: bb7, unwind unreachable]; -+ _0 = float_to_exponential_common_shortest::<T>(_1, _2, move _18, _3) -> [return: bb7, unwind unreachable]; ++ _0 = float_to_exponential_common_shortest::<T>(copy _1, copy _2, move _18, copy _3) -> [return: bb7, unwind unreachable]; } bb7: { diff --git a/tests/mir-opt/funky_arms.float_to_exponential_common.GVN.panic-unwind.diff b/tests/mir-opt/funky_arms.float_to_exponential_common.GVN.panic-unwind.diff index 5e65700ee4a..42d99883749 100644 --- a/tests/mir-opt/funky_arms.float_to_exponential_common.GVN.panic-unwind.diff +++ b/tests/mir-opt/funky_arms.float_to_exponential_common.GVN.panic-unwind.diff @@ -42,13 +42,13 @@ StorageLive(_4); StorageLive(_20); StorageLive(_21); - _21 = ((*_1).0: u32); + _21 = copy ((*_1).0: u32); _20 = BitAnd(move _21, const 1_u32); StorageDead(_21); _4 = Ne(move _20, const 0_u32); StorageDead(_20); StorageLive(_5); - switchInt(_4) -> [0: bb2, otherwise: bb1]; + switchInt(copy _4) -> [0: bb2, otherwise: bb1]; } bb1: { @@ -65,7 +65,7 @@ bb3: { StorageLive(_6); - _6 = ((*_1).4: std::option::Option<usize>); + _6 = copy ((*_1).4: std::option::Option<usize>); _7 = discriminant(_6); switchInt(move _7) -> [1: bb4, 0: bb6, otherwise: bb9]; } @@ -73,26 +73,26 @@ bb4: { - StorageLive(_8); + nop; - _8 = ((_6 as Some).0: usize); + _8 = copy ((_6 as Some).0: usize); StorageLive(_9); - _9 = _1; + _9 = copy _1; StorageLive(_10); - _10 = _2; + _10 = copy _2; StorageLive(_11); - _11 = _5; + _11 = copy _5; StorageLive(_12); StorageLive(_13); StorageLive(_14); - _14 = _8; + _14 = copy _8; - _13 = move _14 as u32 (IntToInt); -+ _13 = _8 as u32 (IntToInt); ++ _13 = copy _8 as u32 (IntToInt); StorageDead(_14); _12 = Add(move _13, const 1_u32); StorageDead(_13); StorageLive(_15); - _15 = _3; + _15 = copy _3; - _0 = float_to_exponential_common_exact::<T>(move _9, move _10, move _11, move _12, move _15) -> [return: bb5, unwind continue]; -+ _0 = float_to_exponential_common_exact::<T>(_1, _2, move _11, move _12, _3) -> [return: bb5, unwind continue]; ++ _0 = float_to_exponential_common_exact::<T>(copy _1, copy _2, move _11, move _12, copy _3) -> [return: bb5, unwind continue]; } bb5: { @@ -108,15 +108,15 @@ bb6: { StorageLive(_16); - _16 = _1; + _16 = copy _1; StorageLive(_17); - _17 = _2; + _17 = copy _2; StorageLive(_18); - _18 = _5; + _18 = copy _5; StorageLive(_19); - _19 = _3; + _19 = copy _3; - _0 = float_to_exponential_common_shortest::<T>(move _16, move _17, move _18, move _19) -> [return: bb7, unwind continue]; -+ _0 = float_to_exponential_common_shortest::<T>(_1, _2, move _18, _3) -> [return: bb7, unwind continue]; ++ _0 = float_to_exponential_common_shortest::<T>(copy _1, copy _2, move _18, copy _3) -> [return: bb7, unwind continue]; } bb7: { diff --git a/tests/mir-opt/gvn.arithmetic.GVN.panic-abort.diff b/tests/mir-opt/gvn.arithmetic.GVN.panic-abort.diff index cb87d902015..f980645b1d0 100644 --- a/tests/mir-opt/gvn.arithmetic.GVN.panic-abort.diff +++ b/tests/mir-opt/gvn.arithmetic.GVN.panic-abort.diff @@ -82,12 +82,12 @@ StorageLive(_2); StorageLive(_3); StorageLive(_4); - _4 = _1; + _4 = copy _1; - _3 = Add(move _4, const 0_u64); -+ _3 = _1; ++ _3 = copy _1; StorageDead(_4); - _2 = opaque::<u64>(move _3) -> [return: bb1, unwind unreachable]; -+ _2 = opaque::<u64>(_1) -> [return: bb1, unwind unreachable]; ++ _2 = opaque::<u64>(copy _1) -> [return: bb1, unwind unreachable]; } bb1: { @@ -96,12 +96,12 @@ StorageLive(_5); StorageLive(_6); StorageLive(_7); - _7 = _1; + _7 = copy _1; - _6 = Sub(move _7, const 0_u64); -+ _6 = _1; ++ _6 = copy _1; StorageDead(_7); - _5 = opaque::<u64>(move _6) -> [return: bb2, unwind unreachable]; -+ _5 = opaque::<u64>(_1) -> [return: bb2, unwind unreachable]; ++ _5 = opaque::<u64>(copy _1) -> [return: bb2, unwind unreachable]; } bb2: { @@ -111,9 +111,9 @@ - StorageLive(_9); + nop; StorageLive(_10); - _10 = _1; + _10 = copy _1; StorageLive(_11); - _11 = _1; + _11 = copy _1; - _9 = Sub(move _10, move _11); + _9 = const 0_u64; StorageDead(_11); @@ -129,7 +129,7 @@ StorageLive(_12); StorageLive(_13); StorageLive(_14); - _14 = _1; + _14 = copy _1; - _13 = Mul(move _14, const 0_u64); + _13 = const 0_u64; StorageDead(_14); @@ -143,12 +143,12 @@ StorageLive(_15); StorageLive(_16); StorageLive(_17); - _17 = _1; + _17 = copy _1; - _16 = Mul(move _17, const 1_u64); -+ _16 = _1; ++ _16 = copy _1; StorageDead(_17); - _15 = opaque::<u64>(move _16) -> [return: bb5, unwind unreachable]; -+ _15 = opaque::<u64>(_1) -> [return: bb5, unwind unreachable]; ++ _15 = opaque::<u64>(copy _1) -> [return: bb5, unwind unreachable]; } bb5: { @@ -157,16 +157,16 @@ StorageLive(_18); StorageLive(_19); StorageLive(_20); - _20 = _1; + _20 = copy _1; - _21 = Eq(const 0_u64, const 0_u64); -- assert(!move _21, "attempt to divide `{}` by zero", _20) -> [success: bb6, unwind unreachable]; +- assert(!move _21, "attempt to divide `{}` by zero", copy _20) -> [success: bb6, unwind unreachable]; + _21 = const true; -+ assert(!const true, "attempt to divide `{}` by zero", _1) -> [success: bb6, unwind unreachable]; ++ assert(!const true, "attempt to divide `{}` by zero", copy _1) -> [success: bb6, unwind unreachable]; } bb6: { - _19 = Div(move _20, const 0_u64); -+ _19 = Div(_1, const 0_u64); ++ _19 = Div(copy _1, const 0_u64); StorageDead(_20); _18 = opaque::<u64>(move _19) -> [return: bb7, unwind unreachable]; } @@ -177,19 +177,19 @@ StorageLive(_22); StorageLive(_23); StorageLive(_24); - _24 = _1; + _24 = copy _1; - _25 = Eq(const 1_u64, const 0_u64); -- assert(!move _25, "attempt to divide `{}` by zero", _24) -> [success: bb8, unwind unreachable]; +- assert(!move _25, "attempt to divide `{}` by zero", copy _24) -> [success: bb8, unwind unreachable]; + _25 = const false; -+ assert(!const false, "attempt to divide `{}` by zero", _1) -> [success: bb8, unwind unreachable]; ++ assert(!const false, "attempt to divide `{}` by zero", copy _1) -> [success: bb8, unwind unreachable]; } bb8: { - _23 = Div(move _24, const 1_u64); -+ _23 = _1; ++ _23 = copy _1; StorageDead(_24); - _22 = opaque::<u64>(move _23) -> [return: bb9, unwind unreachable]; -+ _22 = opaque::<u64>(_1) -> [return: bb9, unwind unreachable]; ++ _22 = opaque::<u64>(copy _1) -> [return: bb9, unwind unreachable]; } bb9: { @@ -198,11 +198,11 @@ StorageLive(_26); StorageLive(_27); StorageLive(_28); - _28 = _1; -- _29 = Eq(_28, const 0_u64); + _28 = copy _1; +- _29 = Eq(copy _28, const 0_u64); - assert(!move _29, "attempt to divide `{}` by zero", const 0_u64) -> [success: bb10, unwind unreachable]; -+ _29 = Eq(_1, const 0_u64); -+ assert(!_29, "attempt to divide `{}` by zero", const 0_u64) -> [success: bb10, unwind unreachable]; ++ _29 = Eq(copy _1, const 0_u64); ++ assert(!copy _29, "attempt to divide `{}` by zero", const 0_u64) -> [success: bb10, unwind unreachable]; } bb10: { @@ -219,16 +219,16 @@ StorageLive(_30); StorageLive(_31); StorageLive(_32); - _32 = _1; -- _33 = Eq(_32, const 0_u64); + _32 = copy _1; +- _33 = Eq(copy _32, const 0_u64); - assert(!move _33, "attempt to divide `{}` by zero", const 1_u64) -> [success: bb12, unwind unreachable]; -+ _33 = _29; -+ assert(!_29, "attempt to divide `{}` by zero", const 1_u64) -> [success: bb12, unwind unreachable]; ++ _33 = copy _29; ++ assert(!copy _29, "attempt to divide `{}` by zero", const 1_u64) -> [success: bb12, unwind unreachable]; } bb12: { - _31 = Div(const 1_u64, move _32); -+ _31 = Div(const 1_u64, _1); ++ _31 = Div(const 1_u64, copy _1); StorageDead(_32); _30 = opaque::<u64>(move _31) -> [return: bb13, unwind unreachable]; } @@ -239,16 +239,16 @@ StorageLive(_34); StorageLive(_35); StorageLive(_36); - _36 = _1; + _36 = copy _1; - _37 = Eq(const 0_u64, const 0_u64); -- assert(!move _37, "attempt to calculate the remainder of `{}` with a divisor of zero", _36) -> [success: bb14, unwind unreachable]; +- assert(!move _37, "attempt to calculate the remainder of `{}` with a divisor of zero", copy _36) -> [success: bb14, unwind unreachable]; + _37 = const true; -+ assert(!const true, "attempt to calculate the remainder of `{}` with a divisor of zero", _1) -> [success: bb14, unwind unreachable]; ++ assert(!const true, "attempt to calculate the remainder of `{}` with a divisor of zero", copy _1) -> [success: bb14, unwind unreachable]; } bb14: { - _35 = Rem(move _36, const 0_u64); -+ _35 = Rem(_1, const 0_u64); ++ _35 = Rem(copy _1, const 0_u64); StorageDead(_36); _34 = opaque::<u64>(move _35) -> [return: bb15, unwind unreachable]; } @@ -259,11 +259,11 @@ StorageLive(_38); StorageLive(_39); StorageLive(_40); - _40 = _1; + _40 = copy _1; - _41 = Eq(const 1_u64, const 0_u64); -- assert(!move _41, "attempt to calculate the remainder of `{}` with a divisor of zero", _40) -> [success: bb16, unwind unreachable]; +- assert(!move _41, "attempt to calculate the remainder of `{}` with a divisor of zero", copy _40) -> [success: bb16, unwind unreachable]; + _41 = const false; -+ assert(!const false, "attempt to calculate the remainder of `{}` with a divisor of zero", _1) -> [success: bb16, unwind unreachable]; ++ assert(!const false, "attempt to calculate the remainder of `{}` with a divisor of zero", copy _1) -> [success: bb16, unwind unreachable]; } bb16: { @@ -280,11 +280,11 @@ StorageLive(_42); StorageLive(_43); StorageLive(_44); - _44 = _1; -- _45 = Eq(_44, const 0_u64); + _44 = copy _1; +- _45 = Eq(copy _44, const 0_u64); - assert(!move _45, "attempt to calculate the remainder of `{}` with a divisor of zero", const 0_u64) -> [success: bb18, unwind unreachable]; -+ _45 = _29; -+ assert(!_29, "attempt to calculate the remainder of `{}` with a divisor of zero", const 0_u64) -> [success: bb18, unwind unreachable]; ++ _45 = copy _29; ++ assert(!copy _29, "attempt to calculate the remainder of `{}` with a divisor of zero", const 0_u64) -> [success: bb18, unwind unreachable]; } bb18: { @@ -301,16 +301,16 @@ StorageLive(_46); StorageLive(_47); StorageLive(_48); - _48 = _1; -- _49 = Eq(_48, const 0_u64); + _48 = copy _1; +- _49 = Eq(copy _48, const 0_u64); - assert(!move _49, "attempt to calculate the remainder of `{}` with a divisor of zero", const 1_u64) -> [success: bb20, unwind unreachable]; -+ _49 = _29; -+ assert(!_29, "attempt to calculate the remainder of `{}` with a divisor of zero", const 1_u64) -> [success: bb20, unwind unreachable]; ++ _49 = copy _29; ++ assert(!copy _29, "attempt to calculate the remainder of `{}` with a divisor of zero", const 1_u64) -> [success: bb20, unwind unreachable]; } bb20: { - _47 = Rem(const 1_u64, move _48); -+ _47 = Rem(const 1_u64, _1); ++ _47 = Rem(const 1_u64, copy _1); StorageDead(_48); _46 = opaque::<u64>(move _47) -> [return: bb21, unwind unreachable]; } @@ -321,7 +321,7 @@ StorageLive(_50); StorageLive(_51); StorageLive(_52); - _52 = _1; + _52 = copy _1; - _51 = BitAnd(move _52, const 0_u64); + _51 = const 0_u64; StorageDead(_52); @@ -335,12 +335,12 @@ StorageLive(_53); StorageLive(_54); StorageLive(_55); - _55 = _1; + _55 = copy _1; - _54 = BitAnd(move _55, const core::num::<impl u64>::MAX); -+ _54 = _1; ++ _54 = copy _1; StorageDead(_55); - _53 = opaque::<u64>(move _54) -> [return: bb23, unwind unreachable]; -+ _53 = opaque::<u64>(_1) -> [return: bb23, unwind unreachable]; ++ _53 = opaque::<u64>(copy _1) -> [return: bb23, unwind unreachable]; } bb23: { @@ -349,12 +349,12 @@ StorageLive(_56); StorageLive(_57); StorageLive(_58); - _58 = _1; + _58 = copy _1; - _57 = BitOr(move _58, const 0_u64); -+ _57 = _1; ++ _57 = copy _1; StorageDead(_58); - _56 = opaque::<u64>(move _57) -> [return: bb24, unwind unreachable]; -+ _56 = opaque::<u64>(_1) -> [return: bb24, unwind unreachable]; ++ _56 = opaque::<u64>(copy _1) -> [return: bb24, unwind unreachable]; } bb24: { @@ -363,7 +363,7 @@ StorageLive(_59); StorageLive(_60); StorageLive(_61); - _61 = _1; + _61 = copy _1; - _60 = BitOr(move _61, const core::num::<impl u64>::MAX); + _60 = const u64::MAX; StorageDead(_61); @@ -377,12 +377,12 @@ StorageLive(_62); StorageLive(_63); StorageLive(_64); - _64 = _1; + _64 = copy _1; - _63 = BitXor(move _64, const 0_u64); -+ _63 = _1; ++ _63 = copy _1; StorageDead(_64); - _62 = opaque::<u64>(move _63) -> [return: bb26, unwind unreachable]; -+ _62 = opaque::<u64>(_1) -> [return: bb26, unwind unreachable]; ++ _62 = opaque::<u64>(copy _1) -> [return: bb26, unwind unreachable]; } bb26: { @@ -391,9 +391,9 @@ StorageLive(_65); StorageLive(_66); StorageLive(_67); - _67 = _1; + _67 = copy _1; StorageLive(_68); - _68 = _1; + _68 = copy _1; - _66 = BitXor(move _67, move _68); + _66 = const 0_u64; StorageDead(_68); @@ -408,12 +408,12 @@ StorageLive(_69); StorageLive(_70); StorageLive(_71); - _71 = _1; + _71 = copy _1; - _70 = Shr(move _71, const 0_i32); -+ _70 = _1; ++ _70 = copy _1; StorageDead(_71); - _69 = opaque::<u64>(move _70) -> [return: bb28, unwind unreachable]; -+ _69 = opaque::<u64>(_1) -> [return: bb28, unwind unreachable]; ++ _69 = opaque::<u64>(copy _1) -> [return: bb28, unwind unreachable]; } bb28: { @@ -422,12 +422,12 @@ StorageLive(_72); StorageLive(_73); StorageLive(_74); - _74 = _1; + _74 = copy _1; - _73 = Shl(move _74, const 0_i32); -+ _73 = _1; ++ _73 = copy _1; StorageDead(_74); - _72 = opaque::<u64>(move _73) -> [return: bb29, unwind unreachable]; -+ _72 = opaque::<u64>(_1) -> [return: bb29, unwind unreachable]; ++ _72 = opaque::<u64>(copy _1) -> [return: bb29, unwind unreachable]; } bb29: { diff --git a/tests/mir-opt/gvn.arithmetic.GVN.panic-unwind.diff b/tests/mir-opt/gvn.arithmetic.GVN.panic-unwind.diff index fa7536efc8e..b8e4967fe8b 100644 --- a/tests/mir-opt/gvn.arithmetic.GVN.panic-unwind.diff +++ b/tests/mir-opt/gvn.arithmetic.GVN.panic-unwind.diff @@ -82,12 +82,12 @@ StorageLive(_2); StorageLive(_3); StorageLive(_4); - _4 = _1; + _4 = copy _1; - _3 = Add(move _4, const 0_u64); -+ _3 = _1; ++ _3 = copy _1; StorageDead(_4); - _2 = opaque::<u64>(move _3) -> [return: bb1, unwind continue]; -+ _2 = opaque::<u64>(_1) -> [return: bb1, unwind continue]; ++ _2 = opaque::<u64>(copy _1) -> [return: bb1, unwind continue]; } bb1: { @@ -96,12 +96,12 @@ StorageLive(_5); StorageLive(_6); StorageLive(_7); - _7 = _1; + _7 = copy _1; - _6 = Sub(move _7, const 0_u64); -+ _6 = _1; ++ _6 = copy _1; StorageDead(_7); - _5 = opaque::<u64>(move _6) -> [return: bb2, unwind continue]; -+ _5 = opaque::<u64>(_1) -> [return: bb2, unwind continue]; ++ _5 = opaque::<u64>(copy _1) -> [return: bb2, unwind continue]; } bb2: { @@ -111,9 +111,9 @@ - StorageLive(_9); + nop; StorageLive(_10); - _10 = _1; + _10 = copy _1; StorageLive(_11); - _11 = _1; + _11 = copy _1; - _9 = Sub(move _10, move _11); + _9 = const 0_u64; StorageDead(_11); @@ -129,7 +129,7 @@ StorageLive(_12); StorageLive(_13); StorageLive(_14); - _14 = _1; + _14 = copy _1; - _13 = Mul(move _14, const 0_u64); + _13 = const 0_u64; StorageDead(_14); @@ -143,12 +143,12 @@ StorageLive(_15); StorageLive(_16); StorageLive(_17); - _17 = _1; + _17 = copy _1; - _16 = Mul(move _17, const 1_u64); -+ _16 = _1; ++ _16 = copy _1; StorageDead(_17); - _15 = opaque::<u64>(move _16) -> [return: bb5, unwind continue]; -+ _15 = opaque::<u64>(_1) -> [return: bb5, unwind continue]; ++ _15 = opaque::<u64>(copy _1) -> [return: bb5, unwind continue]; } bb5: { @@ -157,16 +157,16 @@ StorageLive(_18); StorageLive(_19); StorageLive(_20); - _20 = _1; + _20 = copy _1; - _21 = Eq(const 0_u64, const 0_u64); -- assert(!move _21, "attempt to divide `{}` by zero", _20) -> [success: bb6, unwind continue]; +- assert(!move _21, "attempt to divide `{}` by zero", copy _20) -> [success: bb6, unwind continue]; + _21 = const true; -+ assert(!const true, "attempt to divide `{}` by zero", _1) -> [success: bb6, unwind continue]; ++ assert(!const true, "attempt to divide `{}` by zero", copy _1) -> [success: bb6, unwind continue]; } bb6: { - _19 = Div(move _20, const 0_u64); -+ _19 = Div(_1, const 0_u64); ++ _19 = Div(copy _1, const 0_u64); StorageDead(_20); _18 = opaque::<u64>(move _19) -> [return: bb7, unwind continue]; } @@ -177,19 +177,19 @@ StorageLive(_22); StorageLive(_23); StorageLive(_24); - _24 = _1; + _24 = copy _1; - _25 = Eq(const 1_u64, const 0_u64); -- assert(!move _25, "attempt to divide `{}` by zero", _24) -> [success: bb8, unwind continue]; +- assert(!move _25, "attempt to divide `{}` by zero", copy _24) -> [success: bb8, unwind continue]; + _25 = const false; -+ assert(!const false, "attempt to divide `{}` by zero", _1) -> [success: bb8, unwind continue]; ++ assert(!const false, "attempt to divide `{}` by zero", copy _1) -> [success: bb8, unwind continue]; } bb8: { - _23 = Div(move _24, const 1_u64); -+ _23 = _1; ++ _23 = copy _1; StorageDead(_24); - _22 = opaque::<u64>(move _23) -> [return: bb9, unwind continue]; -+ _22 = opaque::<u64>(_1) -> [return: bb9, unwind continue]; ++ _22 = opaque::<u64>(copy _1) -> [return: bb9, unwind continue]; } bb9: { @@ -198,11 +198,11 @@ StorageLive(_26); StorageLive(_27); StorageLive(_28); - _28 = _1; -- _29 = Eq(_28, const 0_u64); + _28 = copy _1; +- _29 = Eq(copy _28, const 0_u64); - assert(!move _29, "attempt to divide `{}` by zero", const 0_u64) -> [success: bb10, unwind continue]; -+ _29 = Eq(_1, const 0_u64); -+ assert(!_29, "attempt to divide `{}` by zero", const 0_u64) -> [success: bb10, unwind continue]; ++ _29 = Eq(copy _1, const 0_u64); ++ assert(!copy _29, "attempt to divide `{}` by zero", const 0_u64) -> [success: bb10, unwind continue]; } bb10: { @@ -219,16 +219,16 @@ StorageLive(_30); StorageLive(_31); StorageLive(_32); - _32 = _1; -- _33 = Eq(_32, const 0_u64); + _32 = copy _1; +- _33 = Eq(copy _32, const 0_u64); - assert(!move _33, "attempt to divide `{}` by zero", const 1_u64) -> [success: bb12, unwind continue]; -+ _33 = _29; -+ assert(!_29, "attempt to divide `{}` by zero", const 1_u64) -> [success: bb12, unwind continue]; ++ _33 = copy _29; ++ assert(!copy _29, "attempt to divide `{}` by zero", const 1_u64) -> [success: bb12, unwind continue]; } bb12: { - _31 = Div(const 1_u64, move _32); -+ _31 = Div(const 1_u64, _1); ++ _31 = Div(const 1_u64, copy _1); StorageDead(_32); _30 = opaque::<u64>(move _31) -> [return: bb13, unwind continue]; } @@ -239,16 +239,16 @@ StorageLive(_34); StorageLive(_35); StorageLive(_36); - _36 = _1; + _36 = copy _1; - _37 = Eq(const 0_u64, const 0_u64); -- assert(!move _37, "attempt to calculate the remainder of `{}` with a divisor of zero", _36) -> [success: bb14, unwind continue]; +- assert(!move _37, "attempt to calculate the remainder of `{}` with a divisor of zero", copy _36) -> [success: bb14, unwind continue]; + _37 = const true; -+ assert(!const true, "attempt to calculate the remainder of `{}` with a divisor of zero", _1) -> [success: bb14, unwind continue]; ++ assert(!const true, "attempt to calculate the remainder of `{}` with a divisor of zero", copy _1) -> [success: bb14, unwind continue]; } bb14: { - _35 = Rem(move _36, const 0_u64); -+ _35 = Rem(_1, const 0_u64); ++ _35 = Rem(copy _1, const 0_u64); StorageDead(_36); _34 = opaque::<u64>(move _35) -> [return: bb15, unwind continue]; } @@ -259,11 +259,11 @@ StorageLive(_38); StorageLive(_39); StorageLive(_40); - _40 = _1; + _40 = copy _1; - _41 = Eq(const 1_u64, const 0_u64); -- assert(!move _41, "attempt to calculate the remainder of `{}` with a divisor of zero", _40) -> [success: bb16, unwind continue]; +- assert(!move _41, "attempt to calculate the remainder of `{}` with a divisor of zero", copy _40) -> [success: bb16, unwind continue]; + _41 = const false; -+ assert(!const false, "attempt to calculate the remainder of `{}` with a divisor of zero", _1) -> [success: bb16, unwind continue]; ++ assert(!const false, "attempt to calculate the remainder of `{}` with a divisor of zero", copy _1) -> [success: bb16, unwind continue]; } bb16: { @@ -280,11 +280,11 @@ StorageLive(_42); StorageLive(_43); StorageLive(_44); - _44 = _1; -- _45 = Eq(_44, const 0_u64); + _44 = copy _1; +- _45 = Eq(copy _44, const 0_u64); - assert(!move _45, "attempt to calculate the remainder of `{}` with a divisor of zero", const 0_u64) -> [success: bb18, unwind continue]; -+ _45 = _29; -+ assert(!_29, "attempt to calculate the remainder of `{}` with a divisor of zero", const 0_u64) -> [success: bb18, unwind continue]; ++ _45 = copy _29; ++ assert(!copy _29, "attempt to calculate the remainder of `{}` with a divisor of zero", const 0_u64) -> [success: bb18, unwind continue]; } bb18: { @@ -301,16 +301,16 @@ StorageLive(_46); StorageLive(_47); StorageLive(_48); - _48 = _1; -- _49 = Eq(_48, const 0_u64); + _48 = copy _1; +- _49 = Eq(copy _48, const 0_u64); - assert(!move _49, "attempt to calculate the remainder of `{}` with a divisor of zero", const 1_u64) -> [success: bb20, unwind continue]; -+ _49 = _29; -+ assert(!_29, "attempt to calculate the remainder of `{}` with a divisor of zero", const 1_u64) -> [success: bb20, unwind continue]; ++ _49 = copy _29; ++ assert(!copy _29, "attempt to calculate the remainder of `{}` with a divisor of zero", const 1_u64) -> [success: bb20, unwind continue]; } bb20: { - _47 = Rem(const 1_u64, move _48); -+ _47 = Rem(const 1_u64, _1); ++ _47 = Rem(const 1_u64, copy _1); StorageDead(_48); _46 = opaque::<u64>(move _47) -> [return: bb21, unwind continue]; } @@ -321,7 +321,7 @@ StorageLive(_50); StorageLive(_51); StorageLive(_52); - _52 = _1; + _52 = copy _1; - _51 = BitAnd(move _52, const 0_u64); + _51 = const 0_u64; StorageDead(_52); @@ -335,12 +335,12 @@ StorageLive(_53); StorageLive(_54); StorageLive(_55); - _55 = _1; + _55 = copy _1; - _54 = BitAnd(move _55, const core::num::<impl u64>::MAX); -+ _54 = _1; ++ _54 = copy _1; StorageDead(_55); - _53 = opaque::<u64>(move _54) -> [return: bb23, unwind continue]; -+ _53 = opaque::<u64>(_1) -> [return: bb23, unwind continue]; ++ _53 = opaque::<u64>(copy _1) -> [return: bb23, unwind continue]; } bb23: { @@ -349,12 +349,12 @@ StorageLive(_56); StorageLive(_57); StorageLive(_58); - _58 = _1; + _58 = copy _1; - _57 = BitOr(move _58, const 0_u64); -+ _57 = _1; ++ _57 = copy _1; StorageDead(_58); - _56 = opaque::<u64>(move _57) -> [return: bb24, unwind continue]; -+ _56 = opaque::<u64>(_1) -> [return: bb24, unwind continue]; ++ _56 = opaque::<u64>(copy _1) -> [return: bb24, unwind continue]; } bb24: { @@ -363,7 +363,7 @@ StorageLive(_59); StorageLive(_60); StorageLive(_61); - _61 = _1; + _61 = copy _1; - _60 = BitOr(move _61, const core::num::<impl u64>::MAX); + _60 = const u64::MAX; StorageDead(_61); @@ -377,12 +377,12 @@ StorageLive(_62); StorageLive(_63); StorageLive(_64); - _64 = _1; + _64 = copy _1; - _63 = BitXor(move _64, const 0_u64); -+ _63 = _1; ++ _63 = copy _1; StorageDead(_64); - _62 = opaque::<u64>(move _63) -> [return: bb26, unwind continue]; -+ _62 = opaque::<u64>(_1) -> [return: bb26, unwind continue]; ++ _62 = opaque::<u64>(copy _1) -> [return: bb26, unwind continue]; } bb26: { @@ -391,9 +391,9 @@ StorageLive(_65); StorageLive(_66); StorageLive(_67); - _67 = _1; + _67 = copy _1; StorageLive(_68); - _68 = _1; + _68 = copy _1; - _66 = BitXor(move _67, move _68); + _66 = const 0_u64; StorageDead(_68); @@ -408,12 +408,12 @@ StorageLive(_69); StorageLive(_70); StorageLive(_71); - _71 = _1; + _71 = copy _1; - _70 = Shr(move _71, const 0_i32); -+ _70 = _1; ++ _70 = copy _1; StorageDead(_71); - _69 = opaque::<u64>(move _70) -> [return: bb28, unwind continue]; -+ _69 = opaque::<u64>(_1) -> [return: bb28, unwind continue]; ++ _69 = opaque::<u64>(copy _1) -> [return: bb28, unwind continue]; } bb28: { @@ -422,12 +422,12 @@ StorageLive(_72); StorageLive(_73); StorageLive(_74); - _74 = _1; + _74 = copy _1; - _73 = Shl(move _74, const 0_i32); -+ _73 = _1; ++ _73 = copy _1; StorageDead(_74); - _72 = opaque::<u64>(move _73) -> [return: bb29, unwind continue]; -+ _72 = opaque::<u64>(_1) -> [return: bb29, unwind continue]; ++ _72 = opaque::<u64>(copy _1) -> [return: bb29, unwind continue]; } bb29: { diff --git a/tests/mir-opt/gvn.arithmetic_checked.GVN.panic-abort.diff b/tests/mir-opt/gvn.arithmetic_checked.GVN.panic-abort.diff index 0e3f2459fae..acf8bfc71be 100644 --- a/tests/mir-opt/gvn.arithmetic_checked.GVN.panic-abort.diff +++ b/tests/mir-opt/gvn.arithmetic_checked.GVN.panic-abort.diff @@ -30,19 +30,19 @@ StorageLive(_2); StorageLive(_3); StorageLive(_4); - _4 = _1; -- _5 = AddWithOverflow(_4, const 0_u64); + _4 = copy _1; +- _5 = AddWithOverflow(copy _4, const 0_u64); - assert(!move (_5.1: bool), "attempt to compute `{} + {}`, which would overflow", move _4, const 0_u64) -> [success: bb1, unwind unreachable]; -+ _5 = AddWithOverflow(_1, const 0_u64); -+ assert(!const false, "attempt to compute `{} + {}`, which would overflow", _1, const 0_u64) -> [success: bb1, unwind unreachable]; ++ _5 = AddWithOverflow(copy _1, const 0_u64); ++ assert(!const false, "attempt to compute `{} + {}`, which would overflow", copy _1, const 0_u64) -> [success: bb1, unwind unreachable]; } bb1: { - _3 = move (_5.0: u64); -+ _3 = _1; ++ _3 = copy _1; StorageDead(_4); - _2 = opaque::<u64>(move _3) -> [return: bb2, unwind unreachable]; -+ _2 = opaque::<u64>(_1) -> [return: bb2, unwind unreachable]; ++ _2 = opaque::<u64>(copy _1) -> [return: bb2, unwind unreachable]; } bb2: { @@ -51,19 +51,19 @@ StorageLive(_6); StorageLive(_7); StorageLive(_8); - _8 = _1; -- _9 = SubWithOverflow(_8, const 0_u64); + _8 = copy _1; +- _9 = SubWithOverflow(copy _8, const 0_u64); - assert(!move (_9.1: bool), "attempt to compute `{} - {}`, which would overflow", move _8, const 0_u64) -> [success: bb3, unwind unreachable]; -+ _9 = _5; -+ assert(!const false, "attempt to compute `{} - {}`, which would overflow", _1, const 0_u64) -> [success: bb3, unwind unreachable]; ++ _9 = copy _5; ++ assert(!const false, "attempt to compute `{} - {}`, which would overflow", copy _1, const 0_u64) -> [success: bb3, unwind unreachable]; } bb3: { - _7 = move (_9.0: u64); -+ _7 = _1; ++ _7 = copy _1; StorageDead(_8); - _6 = opaque::<u64>(move _7) -> [return: bb4, unwind unreachable]; -+ _6 = opaque::<u64>(_1) -> [return: bb4, unwind unreachable]; ++ _6 = opaque::<u64>(copy _1) -> [return: bb4, unwind unreachable]; } bb4: { @@ -73,13 +73,13 @@ - StorageLive(_11); + nop; StorageLive(_12); - _12 = _1; + _12 = copy _1; StorageLive(_13); - _13 = _1; -- _14 = SubWithOverflow(_12, _13); + _13 = copy _1; +- _14 = SubWithOverflow(copy _12, copy _13); - assert(!move (_14.1: bool), "attempt to compute `{} - {}`, which would overflow", move _12, move _13) -> [success: bb5, unwind unreachable]; + _14 = const (0_u64, false); -+ assert(!const false, "attempt to compute `{} - {}`, which would overflow", _1, _1) -> [success: bb5, unwind unreachable]; ++ assert(!const false, "attempt to compute `{} - {}`, which would overflow", copy _1, copy _1) -> [success: bb5, unwind unreachable]; } bb5: { @@ -98,11 +98,11 @@ StorageLive(_15); StorageLive(_16); StorageLive(_17); - _17 = _1; -- _18 = MulWithOverflow(_17, const 0_u64); + _17 = copy _1; +- _18 = MulWithOverflow(copy _17, const 0_u64); - assert(!move (_18.1: bool), "attempt to compute `{} * {}`, which would overflow", move _17, const 0_u64) -> [success: bb7, unwind unreachable]; + _18 = const (0_u64, false); -+ assert(!const false, "attempt to compute `{} * {}`, which would overflow", _1, const 0_u64) -> [success: bb7, unwind unreachable]; ++ assert(!const false, "attempt to compute `{} * {}`, which would overflow", copy _1, const 0_u64) -> [success: bb7, unwind unreachable]; } bb7: { @@ -119,19 +119,19 @@ StorageLive(_19); StorageLive(_20); StorageLive(_21); - _21 = _1; -- _22 = MulWithOverflow(_21, const 1_u64); + _21 = copy _1; +- _22 = MulWithOverflow(copy _21, const 1_u64); - assert(!move (_22.1: bool), "attempt to compute `{} * {}`, which would overflow", move _21, const 1_u64) -> [success: bb9, unwind unreachable]; -+ _22 = _5; -+ assert(!const false, "attempt to compute `{} * {}`, which would overflow", _1, const 1_u64) -> [success: bb9, unwind unreachable]; ++ _22 = copy _5; ++ assert(!const false, "attempt to compute `{} * {}`, which would overflow", copy _1, const 1_u64) -> [success: bb9, unwind unreachable]; } bb9: { - _20 = move (_22.0: u64); -+ _20 = _1; ++ _20 = copy _1; StorageDead(_21); - _19 = opaque::<u64>(move _20) -> [return: bb10, unwind unreachable]; -+ _19 = opaque::<u64>(_1) -> [return: bb10, unwind unreachable]; ++ _19 = opaque::<u64>(copy _1) -> [return: bb10, unwind unreachable]; } bb10: { diff --git a/tests/mir-opt/gvn.arithmetic_checked.GVN.panic-unwind.diff b/tests/mir-opt/gvn.arithmetic_checked.GVN.panic-unwind.diff index 2873d7ef0ab..f3f6b381a81 100644 --- a/tests/mir-opt/gvn.arithmetic_checked.GVN.panic-unwind.diff +++ b/tests/mir-opt/gvn.arithmetic_checked.GVN.panic-unwind.diff @@ -30,19 +30,19 @@ StorageLive(_2); StorageLive(_3); StorageLive(_4); - _4 = _1; -- _5 = AddWithOverflow(_4, const 0_u64); + _4 = copy _1; +- _5 = AddWithOverflow(copy _4, const 0_u64); - assert(!move (_5.1: bool), "attempt to compute `{} + {}`, which would overflow", move _4, const 0_u64) -> [success: bb1, unwind continue]; -+ _5 = AddWithOverflow(_1, const 0_u64); -+ assert(!const false, "attempt to compute `{} + {}`, which would overflow", _1, const 0_u64) -> [success: bb1, unwind continue]; ++ _5 = AddWithOverflow(copy _1, const 0_u64); ++ assert(!const false, "attempt to compute `{} + {}`, which would overflow", copy _1, const 0_u64) -> [success: bb1, unwind continue]; } bb1: { - _3 = move (_5.0: u64); -+ _3 = _1; ++ _3 = copy _1; StorageDead(_4); - _2 = opaque::<u64>(move _3) -> [return: bb2, unwind continue]; -+ _2 = opaque::<u64>(_1) -> [return: bb2, unwind continue]; ++ _2 = opaque::<u64>(copy _1) -> [return: bb2, unwind continue]; } bb2: { @@ -51,19 +51,19 @@ StorageLive(_6); StorageLive(_7); StorageLive(_8); - _8 = _1; -- _9 = SubWithOverflow(_8, const 0_u64); + _8 = copy _1; +- _9 = SubWithOverflow(copy _8, const 0_u64); - assert(!move (_9.1: bool), "attempt to compute `{} - {}`, which would overflow", move _8, const 0_u64) -> [success: bb3, unwind continue]; -+ _9 = _5; -+ assert(!const false, "attempt to compute `{} - {}`, which would overflow", _1, const 0_u64) -> [success: bb3, unwind continue]; ++ _9 = copy _5; ++ assert(!const false, "attempt to compute `{} - {}`, which would overflow", copy _1, const 0_u64) -> [success: bb3, unwind continue]; } bb3: { - _7 = move (_9.0: u64); -+ _7 = _1; ++ _7 = copy _1; StorageDead(_8); - _6 = opaque::<u64>(move _7) -> [return: bb4, unwind continue]; -+ _6 = opaque::<u64>(_1) -> [return: bb4, unwind continue]; ++ _6 = opaque::<u64>(copy _1) -> [return: bb4, unwind continue]; } bb4: { @@ -73,13 +73,13 @@ - StorageLive(_11); + nop; StorageLive(_12); - _12 = _1; + _12 = copy _1; StorageLive(_13); - _13 = _1; -- _14 = SubWithOverflow(_12, _13); + _13 = copy _1; +- _14 = SubWithOverflow(copy _12, copy _13); - assert(!move (_14.1: bool), "attempt to compute `{} - {}`, which would overflow", move _12, move _13) -> [success: bb5, unwind continue]; + _14 = const (0_u64, false); -+ assert(!const false, "attempt to compute `{} - {}`, which would overflow", _1, _1) -> [success: bb5, unwind continue]; ++ assert(!const false, "attempt to compute `{} - {}`, which would overflow", copy _1, copy _1) -> [success: bb5, unwind continue]; } bb5: { @@ -98,11 +98,11 @@ StorageLive(_15); StorageLive(_16); StorageLive(_17); - _17 = _1; -- _18 = MulWithOverflow(_17, const 0_u64); + _17 = copy _1; +- _18 = MulWithOverflow(copy _17, const 0_u64); - assert(!move (_18.1: bool), "attempt to compute `{} * {}`, which would overflow", move _17, const 0_u64) -> [success: bb7, unwind continue]; + _18 = const (0_u64, false); -+ assert(!const false, "attempt to compute `{} * {}`, which would overflow", _1, const 0_u64) -> [success: bb7, unwind continue]; ++ assert(!const false, "attempt to compute `{} * {}`, which would overflow", copy _1, const 0_u64) -> [success: bb7, unwind continue]; } bb7: { @@ -119,19 +119,19 @@ StorageLive(_19); StorageLive(_20); StorageLive(_21); - _21 = _1; -- _22 = MulWithOverflow(_21, const 1_u64); + _21 = copy _1; +- _22 = MulWithOverflow(copy _21, const 1_u64); - assert(!move (_22.1: bool), "attempt to compute `{} * {}`, which would overflow", move _21, const 1_u64) -> [success: bb9, unwind continue]; -+ _22 = _5; -+ assert(!const false, "attempt to compute `{} * {}`, which would overflow", _1, const 1_u64) -> [success: bb9, unwind continue]; ++ _22 = copy _5; ++ assert(!const false, "attempt to compute `{} * {}`, which would overflow", copy _1, const 1_u64) -> [success: bb9, unwind continue]; } bb9: { - _20 = move (_22.0: u64); -+ _20 = _1; ++ _20 = copy _1; StorageDead(_21); - _19 = opaque::<u64>(move _20) -> [return: bb10, unwind continue]; -+ _19 = opaque::<u64>(_1) -> [return: bb10, unwind continue]; ++ _19 = opaque::<u64>(copy _1) -> [return: bb10, unwind continue]; } bb10: { diff --git a/tests/mir-opt/gvn.arithmetic_float.GVN.panic-abort.diff b/tests/mir-opt/gvn.arithmetic_float.GVN.panic-abort.diff index b332100eaf0..31a85468126 100644 --- a/tests/mir-opt/gvn.arithmetic_float.GVN.panic-abort.diff +++ b/tests/mir-opt/gvn.arithmetic_float.GVN.panic-abort.diff @@ -38,9 +38,9 @@ StorageLive(_2); StorageLive(_3); StorageLive(_4); - _4 = _1; + _4 = copy _1; - _3 = Add(move _4, const 0f64); -+ _3 = Add(_1, const 0f64); ++ _3 = Add(copy _1, const 0f64); StorageDead(_4); _2 = opaque::<f64>(move _3) -> [return: bb1, unwind unreachable]; } @@ -51,9 +51,9 @@ StorageLive(_5); StorageLive(_6); StorageLive(_7); - _7 = _1; + _7 = copy _1; - _6 = Sub(move _7, const 0f64); -+ _6 = Sub(_1, const 0f64); ++ _6 = Sub(copy _1, const 0f64); StorageDead(_7); _5 = opaque::<f64>(move _6) -> [return: bb2, unwind unreachable]; } @@ -64,9 +64,9 @@ StorageLive(_8); StorageLive(_9); StorageLive(_10); - _10 = _1; + _10 = copy _1; - _9 = Mul(move _10, const 0f64); -+ _9 = Mul(_1, const 0f64); ++ _9 = Mul(copy _1, const 0f64); StorageDead(_10); _8 = opaque::<f64>(move _9) -> [return: bb3, unwind unreachable]; } @@ -77,9 +77,9 @@ StorageLive(_11); StorageLive(_12); StorageLive(_13); - _13 = _1; + _13 = copy _1; - _12 = Div(move _13, const 0f64); -+ _12 = Div(_1, const 0f64); ++ _12 = Div(copy _1, const 0f64); StorageDead(_13); _11 = opaque::<f64>(move _12) -> [return: bb4, unwind unreachable]; } @@ -90,9 +90,9 @@ StorageLive(_14); StorageLive(_15); StorageLive(_16); - _16 = _1; + _16 = copy _1; - _15 = Div(const 0f64, move _16); -+ _15 = Div(const 0f64, _1); ++ _15 = Div(const 0f64, copy _1); StorageDead(_16); _14 = opaque::<f64>(move _15) -> [return: bb5, unwind unreachable]; } @@ -103,9 +103,9 @@ StorageLive(_17); StorageLive(_18); StorageLive(_19); - _19 = _1; + _19 = copy _1; - _18 = Rem(move _19, const 0f64); -+ _18 = Rem(_1, const 0f64); ++ _18 = Rem(copy _1, const 0f64); StorageDead(_19); _17 = opaque::<f64>(move _18) -> [return: bb6, unwind unreachable]; } @@ -116,9 +116,9 @@ StorageLive(_20); StorageLive(_21); StorageLive(_22); - _22 = _1; + _22 = copy _1; - _21 = Rem(const 0f64, move _22); -+ _21 = Rem(const 0f64, _1); ++ _21 = Rem(const 0f64, copy _1); StorageDead(_22); _20 = opaque::<f64>(move _21) -> [return: bb7, unwind unreachable]; } @@ -129,11 +129,11 @@ StorageLive(_23); StorageLive(_24); StorageLive(_25); - _25 = _1; + _25 = copy _1; StorageLive(_26); - _26 = _1; + _26 = copy _1; - _24 = Eq(move _25, move _26); -+ _24 = Eq(_1, _1); ++ _24 = Eq(copy _1, copy _1); StorageDead(_26); StorageDead(_25); _23 = opaque::<bool>(move _24) -> [return: bb8, unwind unreachable]; @@ -145,11 +145,11 @@ StorageLive(_27); StorageLive(_28); StorageLive(_29); - _29 = _1; + _29 = copy _1; StorageLive(_30); - _30 = _1; + _30 = copy _1; - _28 = Ne(move _29, move _30); -+ _28 = Ne(_1, _1); ++ _28 = Ne(copy _1, copy _1); StorageDead(_30); StorageDead(_29); _27 = opaque::<bool>(move _28) -> [return: bb9, unwind unreachable]; diff --git a/tests/mir-opt/gvn.arithmetic_float.GVN.panic-unwind.diff b/tests/mir-opt/gvn.arithmetic_float.GVN.panic-unwind.diff index 28664cb0ac8..4e42b1af4fc 100644 --- a/tests/mir-opt/gvn.arithmetic_float.GVN.panic-unwind.diff +++ b/tests/mir-opt/gvn.arithmetic_float.GVN.panic-unwind.diff @@ -38,9 +38,9 @@ StorageLive(_2); StorageLive(_3); StorageLive(_4); - _4 = _1; + _4 = copy _1; - _3 = Add(move _4, const 0f64); -+ _3 = Add(_1, const 0f64); ++ _3 = Add(copy _1, const 0f64); StorageDead(_4); _2 = opaque::<f64>(move _3) -> [return: bb1, unwind continue]; } @@ -51,9 +51,9 @@ StorageLive(_5); StorageLive(_6); StorageLive(_7); - _7 = _1; + _7 = copy _1; - _6 = Sub(move _7, const 0f64); -+ _6 = Sub(_1, const 0f64); ++ _6 = Sub(copy _1, const 0f64); StorageDead(_7); _5 = opaque::<f64>(move _6) -> [return: bb2, unwind continue]; } @@ -64,9 +64,9 @@ StorageLive(_8); StorageLive(_9); StorageLive(_10); - _10 = _1; + _10 = copy _1; - _9 = Mul(move _10, const 0f64); -+ _9 = Mul(_1, const 0f64); ++ _9 = Mul(copy _1, const 0f64); StorageDead(_10); _8 = opaque::<f64>(move _9) -> [return: bb3, unwind continue]; } @@ -77,9 +77,9 @@ StorageLive(_11); StorageLive(_12); StorageLive(_13); - _13 = _1; + _13 = copy _1; - _12 = Div(move _13, const 0f64); -+ _12 = Div(_1, const 0f64); ++ _12 = Div(copy _1, const 0f64); StorageDead(_13); _11 = opaque::<f64>(move _12) -> [return: bb4, unwind continue]; } @@ -90,9 +90,9 @@ StorageLive(_14); StorageLive(_15); StorageLive(_16); - _16 = _1; + _16 = copy _1; - _15 = Div(const 0f64, move _16); -+ _15 = Div(const 0f64, _1); ++ _15 = Div(const 0f64, copy _1); StorageDead(_16); _14 = opaque::<f64>(move _15) -> [return: bb5, unwind continue]; } @@ -103,9 +103,9 @@ StorageLive(_17); StorageLive(_18); StorageLive(_19); - _19 = _1; + _19 = copy _1; - _18 = Rem(move _19, const 0f64); -+ _18 = Rem(_1, const 0f64); ++ _18 = Rem(copy _1, const 0f64); StorageDead(_19); _17 = opaque::<f64>(move _18) -> [return: bb6, unwind continue]; } @@ -116,9 +116,9 @@ StorageLive(_20); StorageLive(_21); StorageLive(_22); - _22 = _1; + _22 = copy _1; - _21 = Rem(const 0f64, move _22); -+ _21 = Rem(const 0f64, _1); ++ _21 = Rem(const 0f64, copy _1); StorageDead(_22); _20 = opaque::<f64>(move _21) -> [return: bb7, unwind continue]; } @@ -129,11 +129,11 @@ StorageLive(_23); StorageLive(_24); StorageLive(_25); - _25 = _1; + _25 = copy _1; StorageLive(_26); - _26 = _1; + _26 = copy _1; - _24 = Eq(move _25, move _26); -+ _24 = Eq(_1, _1); ++ _24 = Eq(copy _1, copy _1); StorageDead(_26); StorageDead(_25); _23 = opaque::<bool>(move _24) -> [return: bb8, unwind continue]; @@ -145,11 +145,11 @@ StorageLive(_27); StorageLive(_28); StorageLive(_29); - _29 = _1; + _29 = copy _1; StorageLive(_30); - _30 = _1; + _30 = copy _1; - _28 = Ne(move _29, move _30); -+ _28 = Ne(_1, _1); ++ _28 = Ne(copy _1, copy _1); StorageDead(_30); StorageDead(_29); _27 = opaque::<bool>(move _28) -> [return: bb9, unwind continue]; diff --git a/tests/mir-opt/gvn.borrowed.GVN.panic-abort.diff b/tests/mir-opt/gvn.borrowed.GVN.panic-abort.diff index 9520bd382ee..b0702696e18 100644 --- a/tests/mir-opt/gvn.borrowed.GVN.panic-abort.diff +++ b/tests/mir-opt/gvn.borrowed.GVN.panic-abort.diff @@ -7,19 +7,19 @@ let mut _3: &T; bb0: { - _2 = _1; + _2 = copy _1; _3 = &_1; - _0 = opaque::<&T>(_3) -> [return: bb1, unwind unreachable]; + _0 = opaque::<&T>(copy _3) -> [return: bb1, unwind unreachable]; } bb1: { -- _0 = opaque::<T>(_2) -> [return: bb2, unwind unreachable]; -+ _0 = opaque::<T>(_1) -> [return: bb2, unwind unreachable]; +- _0 = opaque::<T>(copy _2) -> [return: bb2, unwind unreachable]; ++ _0 = opaque::<T>(copy _1) -> [return: bb2, unwind unreachable]; } bb2: { -- _0 = opaque::<T>((*_3)) -> [return: bb3, unwind unreachable]; -+ _0 = opaque::<T>(_1) -> [return: bb3, unwind unreachable]; +- _0 = opaque::<T>(copy (*_3)) -> [return: bb3, unwind unreachable]; ++ _0 = opaque::<T>(copy _1) -> [return: bb3, unwind unreachable]; } bb3: { diff --git a/tests/mir-opt/gvn.borrowed.GVN.panic-unwind.diff b/tests/mir-opt/gvn.borrowed.GVN.panic-unwind.diff index 4f5d76d5644..fe05d4deeed 100644 --- a/tests/mir-opt/gvn.borrowed.GVN.panic-unwind.diff +++ b/tests/mir-opt/gvn.borrowed.GVN.panic-unwind.diff @@ -7,19 +7,19 @@ let mut _3: &T; bb0: { - _2 = _1; + _2 = copy _1; _3 = &_1; - _0 = opaque::<&T>(_3) -> [return: bb1, unwind continue]; + _0 = opaque::<&T>(copy _3) -> [return: bb1, unwind continue]; } bb1: { -- _0 = opaque::<T>(_2) -> [return: bb2, unwind continue]; -+ _0 = opaque::<T>(_1) -> [return: bb2, unwind continue]; +- _0 = opaque::<T>(copy _2) -> [return: bb2, unwind continue]; ++ _0 = opaque::<T>(copy _1) -> [return: bb2, unwind continue]; } bb2: { -- _0 = opaque::<T>((*_3)) -> [return: bb3, unwind continue]; -+ _0 = opaque::<T>(_1) -> [return: bb3, unwind continue]; +- _0 = opaque::<T>(copy (*_3)) -> [return: bb3, unwind continue]; ++ _0 = opaque::<T>(copy _1) -> [return: bb3, unwind continue]; } bb3: { diff --git a/tests/mir-opt/gvn.cast.GVN.panic-abort.diff b/tests/mir-opt/gvn.cast.GVN.panic-abort.diff index d43198c9911..1d523d22ca6 100644 --- a/tests/mir-opt/gvn.cast.GVN.panic-abort.diff +++ b/tests/mir-opt/gvn.cast.GVN.panic-abort.diff @@ -116,7 +116,7 @@ StorageLive(_4); StorageLive(_5); StorageLive(_6); -- _6 = _1; +- _6 = copy _1; - _5 = move _6 as u8 (IntToInt); + _6 = const 1_i64; + _5 = const 1_u8; @@ -131,7 +131,7 @@ StorageLive(_7); StorageLive(_8); StorageLive(_9); -- _9 = _1; +- _9 = copy _1; - _8 = move _9 as u16 (IntToInt); + _9 = const 1_i64; + _8 = const 1_u16; @@ -146,7 +146,7 @@ StorageLive(_10); StorageLive(_11); StorageLive(_12); -- _12 = _1; +- _12 = copy _1; - _11 = move _12 as u32 (IntToInt); + _12 = const 1_i64; + _11 = const 1_u32; @@ -161,7 +161,7 @@ StorageLive(_13); StorageLive(_14); StorageLive(_15); -- _15 = _1; +- _15 = copy _1; - _14 = move _15 as u64 (IntToInt); + _15 = const 1_i64; + _14 = const 1_u64; @@ -176,7 +176,7 @@ StorageLive(_16); StorageLive(_17); StorageLive(_18); -- _18 = _1; +- _18 = copy _1; - _17 = move _18 as i8 (IntToInt); + _18 = const 1_i64; + _17 = const 1_i8; @@ -191,7 +191,7 @@ StorageLive(_19); StorageLive(_20); StorageLive(_21); -- _21 = _1; +- _21 = copy _1; - _20 = move _21 as i16 (IntToInt); + _21 = const 1_i64; + _20 = const 1_i16; @@ -206,7 +206,7 @@ StorageLive(_22); StorageLive(_23); StorageLive(_24); -- _24 = _1; +- _24 = copy _1; - _23 = move _24 as i32 (IntToInt); + _24 = const 1_i64; + _23 = const 1_i32; @@ -220,7 +220,7 @@ StorageDead(_22); StorageLive(_25); StorageLive(_26); -- _26 = _1; +- _26 = copy _1; - _25 = opaque::<i64>(move _26) -> [return: bb8, unwind unreachable]; + _26 = const 1_i64; + _25 = opaque::<i64>(const 1_i64) -> [return: bb8, unwind unreachable]; @@ -232,7 +232,7 @@ StorageLive(_27); StorageLive(_28); StorageLive(_29); -- _29 = _1; +- _29 = copy _1; - _28 = move _29 as f32 (IntToFloat); + _29 = const 1_i64; + _28 = const 1f32; @@ -247,7 +247,7 @@ StorageLive(_30); StorageLive(_31); StorageLive(_32); -- _32 = _1; +- _32 = copy _1; - _31 = move _32 as f64 (IntToFloat); + _32 = const 1_i64; + _31 = const 1f64; @@ -262,7 +262,7 @@ StorageLive(_33); StorageLive(_34); StorageLive(_35); -- _35 = _2; +- _35 = copy _2; - _34 = move _35 as u8 (IntToInt); + _35 = const 1_u64; + _34 = const 1_u8; @@ -277,7 +277,7 @@ StorageLive(_36); StorageLive(_37); StorageLive(_38); -- _38 = _2; +- _38 = copy _2; - _37 = move _38 as u16 (IntToInt); + _38 = const 1_u64; + _37 = const 1_u16; @@ -292,7 +292,7 @@ StorageLive(_39); StorageLive(_40); StorageLive(_41); -- _41 = _2; +- _41 = copy _2; - _40 = move _41 as u32 (IntToInt); + _41 = const 1_u64; + _40 = const 1_u32; @@ -306,7 +306,7 @@ StorageDead(_39); StorageLive(_42); StorageLive(_43); -- _43 = _2; +- _43 = copy _2; - _42 = opaque::<u64>(move _43) -> [return: bb14, unwind unreachable]; + _43 = const 1_u64; + _42 = opaque::<u64>(const 1_u64) -> [return: bb14, unwind unreachable]; @@ -318,7 +318,7 @@ StorageLive(_44); StorageLive(_45); StorageLive(_46); -- _46 = _2; +- _46 = copy _2; - _45 = move _46 as i8 (IntToInt); + _46 = const 1_u64; + _45 = const 1_i8; @@ -333,7 +333,7 @@ StorageLive(_47); StorageLive(_48); StorageLive(_49); -- _49 = _2; +- _49 = copy _2; - _48 = move _49 as i16 (IntToInt); + _49 = const 1_u64; + _48 = const 1_i16; @@ -348,7 +348,7 @@ StorageLive(_50); StorageLive(_51); StorageLive(_52); -- _52 = _2; +- _52 = copy _2; - _51 = move _52 as i32 (IntToInt); + _52 = const 1_u64; + _51 = const 1_i32; @@ -363,7 +363,7 @@ StorageLive(_53); StorageLive(_54); StorageLive(_55); -- _55 = _2; +- _55 = copy _2; - _54 = move _55 as i64 (IntToInt); + _55 = const 1_u64; + _54 = const 1_i64; @@ -378,7 +378,7 @@ StorageLive(_56); StorageLive(_57); StorageLive(_58); -- _58 = _2; +- _58 = copy _2; - _57 = move _58 as f32 (IntToFloat); + _58 = const 1_u64; + _57 = const 1f32; @@ -393,7 +393,7 @@ StorageLive(_59); StorageLive(_60); StorageLive(_61); -- _61 = _2; +- _61 = copy _2; - _60 = move _61 as f64 (IntToFloat); + _61 = const 1_u64; + _60 = const 1f64; @@ -408,7 +408,7 @@ StorageLive(_62); StorageLive(_63); StorageLive(_64); -- _64 = _3; +- _64 = copy _3; - _63 = move _64 as u8 (FloatToInt); + _64 = const 1f64; + _63 = const 1_u8; @@ -423,7 +423,7 @@ StorageLive(_65); StorageLive(_66); StorageLive(_67); -- _67 = _3; +- _67 = copy _3; - _66 = move _67 as u16 (FloatToInt); + _67 = const 1f64; + _66 = const 1_u16; @@ -438,7 +438,7 @@ StorageLive(_68); StorageLive(_69); StorageLive(_70); -- _70 = _3; +- _70 = copy _3; - _69 = move _70 as u32 (FloatToInt); + _70 = const 1f64; + _69 = const 1_u32; @@ -453,7 +453,7 @@ StorageLive(_71); StorageLive(_72); StorageLive(_73); -- _73 = _3; +- _73 = copy _3; - _72 = move _73 as u64 (FloatToInt); + _73 = const 1f64; + _72 = const 1_u64; @@ -468,7 +468,7 @@ StorageLive(_74); StorageLive(_75); StorageLive(_76); -- _76 = _3; +- _76 = copy _3; - _75 = move _76 as i8 (FloatToInt); + _76 = const 1f64; + _75 = const 1_i8; @@ -483,7 +483,7 @@ StorageLive(_77); StorageLive(_78); StorageLive(_79); -- _79 = _3; +- _79 = copy _3; - _78 = move _79 as i16 (FloatToInt); + _79 = const 1f64; + _78 = const 1_i16; @@ -498,7 +498,7 @@ StorageLive(_80); StorageLive(_81); StorageLive(_82); -- _82 = _3; +- _82 = copy _3; - _81 = move _82 as i32 (FloatToInt); + _82 = const 1f64; + _81 = const 1_i32; @@ -513,7 +513,7 @@ StorageLive(_83); StorageLive(_84); StorageLive(_85); -- _85 = _3; +- _85 = copy _3; - _84 = move _85 as i64 (FloatToInt); + _85 = const 1f64; + _84 = const 1_i64; @@ -528,7 +528,7 @@ StorageLive(_86); StorageLive(_87); StorageLive(_88); -- _88 = _3; +- _88 = copy _3; - _87 = move _88 as f32 (FloatToFloat); + _88 = const 1f64; + _87 = const 1f32; @@ -542,7 +542,7 @@ StorageDead(_86); StorageLive(_89); StorageLive(_90); -- _90 = _3; +- _90 = copy _3; - _89 = opaque::<f64>(move _90) -> [return: bb30, unwind unreachable]; + _90 = const 1f64; + _89 = opaque::<f64>(const 1f64) -> [return: bb30, unwind unreachable]; diff --git a/tests/mir-opt/gvn.cast.GVN.panic-unwind.diff b/tests/mir-opt/gvn.cast.GVN.panic-unwind.diff index 08b97e13aa0..3541c10da64 100644 --- a/tests/mir-opt/gvn.cast.GVN.panic-unwind.diff +++ b/tests/mir-opt/gvn.cast.GVN.panic-unwind.diff @@ -116,7 +116,7 @@ StorageLive(_4); StorageLive(_5); StorageLive(_6); -- _6 = _1; +- _6 = copy _1; - _5 = move _6 as u8 (IntToInt); + _6 = const 1_i64; + _5 = const 1_u8; @@ -131,7 +131,7 @@ StorageLive(_7); StorageLive(_8); StorageLive(_9); -- _9 = _1; +- _9 = copy _1; - _8 = move _9 as u16 (IntToInt); + _9 = const 1_i64; + _8 = const 1_u16; @@ -146,7 +146,7 @@ StorageLive(_10); StorageLive(_11); StorageLive(_12); -- _12 = _1; +- _12 = copy _1; - _11 = move _12 as u32 (IntToInt); + _12 = const 1_i64; + _11 = const 1_u32; @@ -161,7 +161,7 @@ StorageLive(_13); StorageLive(_14); StorageLive(_15); -- _15 = _1; +- _15 = copy _1; - _14 = move _15 as u64 (IntToInt); + _15 = const 1_i64; + _14 = const 1_u64; @@ -176,7 +176,7 @@ StorageLive(_16); StorageLive(_17); StorageLive(_18); -- _18 = _1; +- _18 = copy _1; - _17 = move _18 as i8 (IntToInt); + _18 = const 1_i64; + _17 = const 1_i8; @@ -191,7 +191,7 @@ StorageLive(_19); StorageLive(_20); StorageLive(_21); -- _21 = _1; +- _21 = copy _1; - _20 = move _21 as i16 (IntToInt); + _21 = const 1_i64; + _20 = const 1_i16; @@ -206,7 +206,7 @@ StorageLive(_22); StorageLive(_23); StorageLive(_24); -- _24 = _1; +- _24 = copy _1; - _23 = move _24 as i32 (IntToInt); + _24 = const 1_i64; + _23 = const 1_i32; @@ -220,7 +220,7 @@ StorageDead(_22); StorageLive(_25); StorageLive(_26); -- _26 = _1; +- _26 = copy _1; - _25 = opaque::<i64>(move _26) -> [return: bb8, unwind continue]; + _26 = const 1_i64; + _25 = opaque::<i64>(const 1_i64) -> [return: bb8, unwind continue]; @@ -232,7 +232,7 @@ StorageLive(_27); StorageLive(_28); StorageLive(_29); -- _29 = _1; +- _29 = copy _1; - _28 = move _29 as f32 (IntToFloat); + _29 = const 1_i64; + _28 = const 1f32; @@ -247,7 +247,7 @@ StorageLive(_30); StorageLive(_31); StorageLive(_32); -- _32 = _1; +- _32 = copy _1; - _31 = move _32 as f64 (IntToFloat); + _32 = const 1_i64; + _31 = const 1f64; @@ -262,7 +262,7 @@ StorageLive(_33); StorageLive(_34); StorageLive(_35); -- _35 = _2; +- _35 = copy _2; - _34 = move _35 as u8 (IntToInt); + _35 = const 1_u64; + _34 = const 1_u8; @@ -277,7 +277,7 @@ StorageLive(_36); StorageLive(_37); StorageLive(_38); -- _38 = _2; +- _38 = copy _2; - _37 = move _38 as u16 (IntToInt); + _38 = const 1_u64; + _37 = const 1_u16; @@ -292,7 +292,7 @@ StorageLive(_39); StorageLive(_40); StorageLive(_41); -- _41 = _2; +- _41 = copy _2; - _40 = move _41 as u32 (IntToInt); + _41 = const 1_u64; + _40 = const 1_u32; @@ -306,7 +306,7 @@ StorageDead(_39); StorageLive(_42); StorageLive(_43); -- _43 = _2; +- _43 = copy _2; - _42 = opaque::<u64>(move _43) -> [return: bb14, unwind continue]; + _43 = const 1_u64; + _42 = opaque::<u64>(const 1_u64) -> [return: bb14, unwind continue]; @@ -318,7 +318,7 @@ StorageLive(_44); StorageLive(_45); StorageLive(_46); -- _46 = _2; +- _46 = copy _2; - _45 = move _46 as i8 (IntToInt); + _46 = const 1_u64; + _45 = const 1_i8; @@ -333,7 +333,7 @@ StorageLive(_47); StorageLive(_48); StorageLive(_49); -- _49 = _2; +- _49 = copy _2; - _48 = move _49 as i16 (IntToInt); + _49 = const 1_u64; + _48 = const 1_i16; @@ -348,7 +348,7 @@ StorageLive(_50); StorageLive(_51); StorageLive(_52); -- _52 = _2; +- _52 = copy _2; - _51 = move _52 as i32 (IntToInt); + _52 = const 1_u64; + _51 = const 1_i32; @@ -363,7 +363,7 @@ StorageLive(_53); StorageLive(_54); StorageLive(_55); -- _55 = _2; +- _55 = copy _2; - _54 = move _55 as i64 (IntToInt); + _55 = const 1_u64; + _54 = const 1_i64; @@ -378,7 +378,7 @@ StorageLive(_56); StorageLive(_57); StorageLive(_58); -- _58 = _2; +- _58 = copy _2; - _57 = move _58 as f32 (IntToFloat); + _58 = const 1_u64; + _57 = const 1f32; @@ -393,7 +393,7 @@ StorageLive(_59); StorageLive(_60); StorageLive(_61); -- _61 = _2; +- _61 = copy _2; - _60 = move _61 as f64 (IntToFloat); + _61 = const 1_u64; + _60 = const 1f64; @@ -408,7 +408,7 @@ StorageLive(_62); StorageLive(_63); StorageLive(_64); -- _64 = _3; +- _64 = copy _3; - _63 = move _64 as u8 (FloatToInt); + _64 = const 1f64; + _63 = const 1_u8; @@ -423,7 +423,7 @@ StorageLive(_65); StorageLive(_66); StorageLive(_67); -- _67 = _3; +- _67 = copy _3; - _66 = move _67 as u16 (FloatToInt); + _67 = const 1f64; + _66 = const 1_u16; @@ -438,7 +438,7 @@ StorageLive(_68); StorageLive(_69); StorageLive(_70); -- _70 = _3; +- _70 = copy _3; - _69 = move _70 as u32 (FloatToInt); + _70 = const 1f64; + _69 = const 1_u32; @@ -453,7 +453,7 @@ StorageLive(_71); StorageLive(_72); StorageLive(_73); -- _73 = _3; +- _73 = copy _3; - _72 = move _73 as u64 (FloatToInt); + _73 = const 1f64; + _72 = const 1_u64; @@ -468,7 +468,7 @@ StorageLive(_74); StorageLive(_75); StorageLive(_76); -- _76 = _3; +- _76 = copy _3; - _75 = move _76 as i8 (FloatToInt); + _76 = const 1f64; + _75 = const 1_i8; @@ -483,7 +483,7 @@ StorageLive(_77); StorageLive(_78); StorageLive(_79); -- _79 = _3; +- _79 = copy _3; - _78 = move _79 as i16 (FloatToInt); + _79 = const 1f64; + _78 = const 1_i16; @@ -498,7 +498,7 @@ StorageLive(_80); StorageLive(_81); StorageLive(_82); -- _82 = _3; +- _82 = copy _3; - _81 = move _82 as i32 (FloatToInt); + _82 = const 1f64; + _81 = const 1_i32; @@ -513,7 +513,7 @@ StorageLive(_83); StorageLive(_84); StorageLive(_85); -- _85 = _3; +- _85 = copy _3; - _84 = move _85 as i64 (FloatToInt); + _85 = const 1f64; + _84 = const 1_i64; @@ -528,7 +528,7 @@ StorageLive(_86); StorageLive(_87); StorageLive(_88); -- _88 = _3; +- _88 = copy _3; - _87 = move _88 as f32 (FloatToFloat); + _88 = const 1f64; + _87 = const 1f32; @@ -542,7 +542,7 @@ StorageDead(_86); StorageLive(_89); StorageLive(_90); -- _90 = _3; +- _90 = copy _3; - _89 = opaque::<f64>(move _90) -> [return: bb30, unwind continue]; + _90 = const 1f64; + _89 = opaque::<f64>(const 1f64) -> [return: bb30, unwind continue]; diff --git a/tests/mir-opt/gvn.cast_pointer_eq.GVN.panic-abort.diff b/tests/mir-opt/gvn.cast_pointer_eq.GVN.panic-abort.diff index 757ab959813..f66aed0f441 100644 --- a/tests/mir-opt/gvn.cast_pointer_eq.GVN.panic-abort.diff +++ b/tests/mir-opt/gvn.cast_pointer_eq.GVN.panic-abort.diff @@ -52,70 +52,70 @@ - StorageLive(_5); + nop; StorageLive(_6); - _6 = _1; + _6 = copy _1; - _5 = move _6 as *const u32 (PtrToPtr); -+ _5 = _1 as *const u32 (PtrToPtr); ++ _5 = copy _1 as *const u32 (PtrToPtr); StorageDead(_6); StorageLive(_7); - StorageLive(_8); + nop; StorageLive(_9); - _9 = _2; + _9 = copy _2; - _8 = move _9 as *const u32 (PtrToPtr); -+ _8 = _2 as *const u32 (PtrToPtr); ++ _8 = copy _2 as *const u32 (PtrToPtr); StorageDead(_9); - _7 = move _8 as *const u32 (PtrToPtr); - StorageDead(_8); -+ _7 = _8; ++ _7 = copy _8; + nop; StorageLive(_10); - StorageLive(_11); + nop; StorageLive(_12); - _12 = _3; + _12 = copy _3; - _11 = move _12 as *const u32 (PtrToPtr); -+ _11 = _3 as *const u32 (PtrToPtr); ++ _11 = copy _3 as *const u32 (PtrToPtr); StorageDead(_12); - _10 = move _11 as *const u32 (PtrToPtr); - StorageDead(_11); - StorageLive(_13); -+ _10 = _11; ++ _10 = copy _11; + nop; + nop; StorageLive(_14); - _14 = _4; + _14 = copy _4; - _13 = move _14 as *const u32 (PtrToPtr); -+ _13 = _4 as *const u32 (PtrToPtr); ++ _13 = copy _4 as *const u32 (PtrToPtr); StorageDead(_14); StorageLive(_15); StorageLive(_16); - _16 = _5; + _16 = copy _5; StorageLive(_17); -- _17 = _7; +- _17 = copy _7; - _15 = Eq(move _16, move _17); -+ _17 = _8; -+ _15 = Eq(_5, _8); ++ _17 = copy _8; ++ _15 = Eq(copy _5, copy _8); StorageDead(_17); StorageDead(_16); StorageLive(_18); StorageLive(_19); -- _19 = _7; -+ _19 = _8; +- _19 = copy _7; ++ _19 = copy _8; StorageLive(_20); -- _20 = _10; +- _20 = copy _10; - _18 = Eq(move _19, move _20); -+ _20 = _11; -+ _18 = Eq(_2, _3); ++ _20 = copy _11; ++ _18 = Eq(copy _2, copy _3); StorageDead(_20); StorageDead(_19); StorageLive(_21); StorageLive(_22); -- _22 = _10; -+ _22 = _11; +- _22 = copy _10; ++ _22 = copy _11; StorageLive(_23); - _23 = _13; + _23 = copy _13; - _21 = Eq(move _22, move _23); -+ _21 = Eq(_11, _13); ++ _21 = Eq(copy _11, copy _13); StorageDead(_23); StorageDead(_22); _0 = const (); diff --git a/tests/mir-opt/gvn.cast_pointer_eq.GVN.panic-unwind.diff b/tests/mir-opt/gvn.cast_pointer_eq.GVN.panic-unwind.diff index 757ab959813..f66aed0f441 100644 --- a/tests/mir-opt/gvn.cast_pointer_eq.GVN.panic-unwind.diff +++ b/tests/mir-opt/gvn.cast_pointer_eq.GVN.panic-unwind.diff @@ -52,70 +52,70 @@ - StorageLive(_5); + nop; StorageLive(_6); - _6 = _1; + _6 = copy _1; - _5 = move _6 as *const u32 (PtrToPtr); -+ _5 = _1 as *const u32 (PtrToPtr); ++ _5 = copy _1 as *const u32 (PtrToPtr); StorageDead(_6); StorageLive(_7); - StorageLive(_8); + nop; StorageLive(_9); - _9 = _2; + _9 = copy _2; - _8 = move _9 as *const u32 (PtrToPtr); -+ _8 = _2 as *const u32 (PtrToPtr); ++ _8 = copy _2 as *const u32 (PtrToPtr); StorageDead(_9); - _7 = move _8 as *const u32 (PtrToPtr); - StorageDead(_8); -+ _7 = _8; ++ _7 = copy _8; + nop; StorageLive(_10); - StorageLive(_11); + nop; StorageLive(_12); - _12 = _3; + _12 = copy _3; - _11 = move _12 as *const u32 (PtrToPtr); -+ _11 = _3 as *const u32 (PtrToPtr); ++ _11 = copy _3 as *const u32 (PtrToPtr); StorageDead(_12); - _10 = move _11 as *const u32 (PtrToPtr); - StorageDead(_11); - StorageLive(_13); -+ _10 = _11; ++ _10 = copy _11; + nop; + nop; StorageLive(_14); - _14 = _4; + _14 = copy _4; - _13 = move _14 as *const u32 (PtrToPtr); -+ _13 = _4 as *const u32 (PtrToPtr); ++ _13 = copy _4 as *const u32 (PtrToPtr); StorageDead(_14); StorageLive(_15); StorageLive(_16); - _16 = _5; + _16 = copy _5; StorageLive(_17); -- _17 = _7; +- _17 = copy _7; - _15 = Eq(move _16, move _17); -+ _17 = _8; -+ _15 = Eq(_5, _8); ++ _17 = copy _8; ++ _15 = Eq(copy _5, copy _8); StorageDead(_17); StorageDead(_16); StorageLive(_18); StorageLive(_19); -- _19 = _7; -+ _19 = _8; +- _19 = copy _7; ++ _19 = copy _8; StorageLive(_20); -- _20 = _10; +- _20 = copy _10; - _18 = Eq(move _19, move _20); -+ _20 = _11; -+ _18 = Eq(_2, _3); ++ _20 = copy _11; ++ _18 = Eq(copy _2, copy _3); StorageDead(_20); StorageDead(_19); StorageLive(_21); StorageLive(_22); -- _22 = _10; -+ _22 = _11; +- _22 = copy _10; ++ _22 = copy _11; StorageLive(_23); - _23 = _13; + _23 = copy _13; - _21 = Eq(move _22, move _23); -+ _21 = Eq(_11, _13); ++ _21 = Eq(copy _11, copy _13); StorageDead(_23); StorageDead(_22); _0 = const (); diff --git a/tests/mir-opt/gvn.cast_pointer_then_transmute.GVN.panic-abort.diff b/tests/mir-opt/gvn.cast_pointer_then_transmute.GVN.panic-abort.diff index 8133f6e0b00..d9f945d2c41 100644 --- a/tests/mir-opt/gvn.cast_pointer_then_transmute.GVN.panic-abort.diff +++ b/tests/mir-opt/gvn.cast_pointer_then_transmute.GVN.panic-abort.diff @@ -22,19 +22,19 @@ StorageLive(_3); StorageLive(_4); StorageLive(_5); - _5 = _1; + _5 = copy _1; - _4 = move _5 as *const () (PtrToPtr); -+ _4 = _1 as *const () (PtrToPtr); ++ _4 = copy _1 as *const () (PtrToPtr); StorageDead(_5); - _3 = move _4 as usize (Transmute); -+ _3 = _1 as usize (Transmute); ++ _3 = copy _1 as usize (Transmute); StorageDead(_4); StorageLive(_6); StorageLive(_7); StorageLive(_8); - _8 = _2; + _8 = copy _2; - _7 = move _8 as *const () (PtrToPtr); -+ _7 = _2 as *const () (PtrToPtr); ++ _7 = copy _2 as *const () (PtrToPtr); StorageDead(_8); _6 = move _7 as usize (Transmute); StorageDead(_7); diff --git a/tests/mir-opt/gvn.cast_pointer_then_transmute.GVN.panic-unwind.diff b/tests/mir-opt/gvn.cast_pointer_then_transmute.GVN.panic-unwind.diff index 8133f6e0b00..d9f945d2c41 100644 --- a/tests/mir-opt/gvn.cast_pointer_then_transmute.GVN.panic-unwind.diff +++ b/tests/mir-opt/gvn.cast_pointer_then_transmute.GVN.panic-unwind.diff @@ -22,19 +22,19 @@ StorageLive(_3); StorageLive(_4); StorageLive(_5); - _5 = _1; + _5 = copy _1; - _4 = move _5 as *const () (PtrToPtr); -+ _4 = _1 as *const () (PtrToPtr); ++ _4 = copy _1 as *const () (PtrToPtr); StorageDead(_5); - _3 = move _4 as usize (Transmute); -+ _3 = _1 as usize (Transmute); ++ _3 = copy _1 as usize (Transmute); StorageDead(_4); StorageLive(_6); StorageLive(_7); StorageLive(_8); - _8 = _2; + _8 = copy _2; - _7 = move _8 as *const () (PtrToPtr); -+ _7 = _2 as *const () (PtrToPtr); ++ _7 = copy _2 as *const () (PtrToPtr); StorageDead(_8); _6 = move _7 as usize (Transmute); StorageDead(_7); diff --git a/tests/mir-opt/gvn.casts_before_aggregate_raw_ptr.GVN.panic-abort.diff b/tests/mir-opt/gvn.casts_before_aggregate_raw_ptr.GVN.panic-abort.diff index 6e5bdb16595..fd09310fabd 100644 --- a/tests/mir-opt/gvn.casts_before_aggregate_raw_ptr.GVN.panic-abort.diff +++ b/tests/mir-opt/gvn.casts_before_aggregate_raw_ptr.GVN.panic-abort.diff @@ -25,28 +25,28 @@ - StorageLive(_2); + nop; StorageLive(_3); - _3 = _1; + _3 = copy _1; - _2 = move _3 as *const [u8; 4] (PtrToPtr); -+ _2 = _1 as *const [u8; 4] (PtrToPtr); ++ _2 = copy _1 as *const [u8; 4] (PtrToPtr); StorageDead(_3); - StorageLive(_4); + nop; StorageLive(_5); - _5 = _2; + _5 = copy _2; - _4 = move _5 as *const u8 (PtrToPtr); -+ _4 = _1 as *const u8 (PtrToPtr); ++ _4 = copy _1 as *const u8 (PtrToPtr); StorageDead(_5); - StorageLive(_6); + nop; StorageLive(_7); - _7 = _4; + _7 = copy _4; - _6 = move _7 as *const () (PtrToPtr); -+ _6 = _1 as *const () (PtrToPtr); ++ _6 = copy _1 as *const () (PtrToPtr); StorageDead(_7); StorageLive(_8); - _8 = _6; + _8 = copy _6; - _0 = *const [u8] from (move _8, const 4_usize); -+ _0 = *const [u8] from (_1, const 4_usize); ++ _0 = *const [u8] from (copy _1, const 4_usize); StorageDead(_8); - StorageDead(_6); - StorageDead(_4); diff --git a/tests/mir-opt/gvn.casts_before_aggregate_raw_ptr.GVN.panic-unwind.diff b/tests/mir-opt/gvn.casts_before_aggregate_raw_ptr.GVN.panic-unwind.diff index 6e5bdb16595..fd09310fabd 100644 --- a/tests/mir-opt/gvn.casts_before_aggregate_raw_ptr.GVN.panic-unwind.diff +++ b/tests/mir-opt/gvn.casts_before_aggregate_raw_ptr.GVN.panic-unwind.diff @@ -25,28 +25,28 @@ - StorageLive(_2); + nop; StorageLive(_3); - _3 = _1; + _3 = copy _1; - _2 = move _3 as *const [u8; 4] (PtrToPtr); -+ _2 = _1 as *const [u8; 4] (PtrToPtr); ++ _2 = copy _1 as *const [u8; 4] (PtrToPtr); StorageDead(_3); - StorageLive(_4); + nop; StorageLive(_5); - _5 = _2; + _5 = copy _2; - _4 = move _5 as *const u8 (PtrToPtr); -+ _4 = _1 as *const u8 (PtrToPtr); ++ _4 = copy _1 as *const u8 (PtrToPtr); StorageDead(_5); - StorageLive(_6); + nop; StorageLive(_7); - _7 = _4; + _7 = copy _4; - _6 = move _7 as *const () (PtrToPtr); -+ _6 = _1 as *const () (PtrToPtr); ++ _6 = copy _1 as *const () (PtrToPtr); StorageDead(_7); StorageLive(_8); - _8 = _6; + _8 = copy _6; - _0 = *const [u8] from (move _8, const 4_usize); -+ _0 = *const [u8] from (_1, const 4_usize); ++ _0 = *const [u8] from (copy _1, const 4_usize); StorageDead(_8); - StorageDead(_6); - StorageDead(_4); diff --git a/tests/mir-opt/gvn.comparison.GVN.panic-abort.diff b/tests/mir-opt/gvn.comparison.GVN.panic-abort.diff index fefdf14bddc..7b25dedbb88 100644 --- a/tests/mir-opt/gvn.comparison.GVN.panic-abort.diff +++ b/tests/mir-opt/gvn.comparison.GVN.panic-abort.diff @@ -26,9 +26,9 @@ StorageLive(_3); StorageLive(_4); StorageLive(_5); - _5 = _1; + _5 = copy _1; StorageLive(_6); - _6 = _1; + _6 = copy _1; - _4 = Eq(move _5, move _6); + _4 = const true; StorageDead(_6); @@ -43,9 +43,9 @@ StorageLive(_7); StorageLive(_8); StorageLive(_9); - _9 = _1; + _9 = copy _1; StorageLive(_10); - _10 = _1; + _10 = copy _1; - _8 = Ne(move _9, move _10); + _8 = const false; StorageDead(_10); @@ -60,11 +60,11 @@ StorageLive(_11); StorageLive(_12); StorageLive(_13); - _13 = _1; + _13 = copy _1; StorageLive(_14); - _14 = _2; + _14 = copy _2; - _12 = Eq(move _13, move _14); -+ _12 = Eq(_1, _2); ++ _12 = Eq(copy _1, copy _2); StorageDead(_14); StorageDead(_13); _11 = opaque::<bool>(move _12) -> [return: bb3, unwind unreachable]; @@ -76,11 +76,11 @@ StorageLive(_15); StorageLive(_16); StorageLive(_17); - _17 = _1; + _17 = copy _1; StorageLive(_18); - _18 = _2; + _18 = copy _2; - _16 = Ne(move _17, move _18); -+ _16 = Ne(_1, _2); ++ _16 = Ne(copy _1, copy _2); StorageDead(_18); StorageDead(_17); _15 = opaque::<bool>(move _16) -> [return: bb4, unwind unreachable]; diff --git a/tests/mir-opt/gvn.comparison.GVN.panic-unwind.diff b/tests/mir-opt/gvn.comparison.GVN.panic-unwind.diff index 9f19b2b59fa..416ae1ee559 100644 --- a/tests/mir-opt/gvn.comparison.GVN.panic-unwind.diff +++ b/tests/mir-opt/gvn.comparison.GVN.panic-unwind.diff @@ -26,9 +26,9 @@ StorageLive(_3); StorageLive(_4); StorageLive(_5); - _5 = _1; + _5 = copy _1; StorageLive(_6); - _6 = _1; + _6 = copy _1; - _4 = Eq(move _5, move _6); + _4 = const true; StorageDead(_6); @@ -43,9 +43,9 @@ StorageLive(_7); StorageLive(_8); StorageLive(_9); - _9 = _1; + _9 = copy _1; StorageLive(_10); - _10 = _1; + _10 = copy _1; - _8 = Ne(move _9, move _10); + _8 = const false; StorageDead(_10); @@ -60,11 +60,11 @@ StorageLive(_11); StorageLive(_12); StorageLive(_13); - _13 = _1; + _13 = copy _1; StorageLive(_14); - _14 = _2; + _14 = copy _2; - _12 = Eq(move _13, move _14); -+ _12 = Eq(_1, _2); ++ _12 = Eq(copy _1, copy _2); StorageDead(_14); StorageDead(_13); _11 = opaque::<bool>(move _12) -> [return: bb3, unwind continue]; @@ -76,11 +76,11 @@ StorageLive(_15); StorageLive(_16); StorageLive(_17); - _17 = _1; + _17 = copy _1; StorageLive(_18); - _18 = _2; + _18 = copy _2; - _16 = Ne(move _17, move _18); -+ _16 = Ne(_1, _2); ++ _16 = Ne(copy _1, copy _2); StorageDead(_18); StorageDead(_17); _15 = opaque::<bool>(move _16) -> [return: bb4, unwind continue]; diff --git a/tests/mir-opt/gvn.constant_index_overflow.GVN.panic-abort.diff b/tests/mir-opt/gvn.constant_index_overflow.GVN.panic-abort.diff index c417c51f9b7..3f052ee19fd 100644 --- a/tests/mir-opt/gvn.constant_index_overflow.GVN.panic-abort.diff +++ b/tests/mir-opt/gvn.constant_index_overflow.GVN.panic-abort.diff @@ -32,7 +32,7 @@ StorageLive(_3); StorageLive(_4); StorageLive(_5); -- _5 = _2; +- _5 = copy _2; + _5 = const usize::MAX; StorageLive(_6); StorageLive(_7); @@ -51,18 +51,18 @@ StorageDead(_6); StorageDead(_5); StorageLive(_8); -- _8 = _2; +- _8 = copy _2; + _8 = const usize::MAX; _9 = Len((*_1)); -- _10 = Lt(_8, _9); -- assert(move _10, "index out of bounds: the length is {} but the index is {}", move _9, _8) -> [success: bb3, unwind unreachable]; -+ _10 = Lt(const usize::MAX, _9); +- _10 = Lt(copy _8, copy _9); +- assert(move _10, "index out of bounds: the length is {} but the index is {}", move _9, copy _8) -> [success: bb3, unwind unreachable]; ++ _10 = Lt(const usize::MAX, copy _9); + assert(move _10, "index out of bounds: the length is {} but the index is {}", move _9, const usize::MAX) -> [success: bb3, unwind unreachable]; } bb3: { -- _3 = (*_1)[_8]; -+ _3 = (*_1)[_2]; +- _3 = copy (*_1)[_8]; ++ _3 = copy (*_1)[_2]; StorageDead(_8); goto -> bb6; } @@ -73,15 +73,15 @@ StorageLive(_11); _11 = const 0_usize; _12 = Len((*_1)); -- _13 = Lt(_11, _12); -- assert(move _13, "index out of bounds: the length is {} but the index is {}", move _12, _11) -> [success: bb5, unwind unreachable]; -+ _13 = Lt(const 0_usize, _12); +- _13 = Lt(copy _11, copy _12); +- assert(move _13, "index out of bounds: the length is {} but the index is {}", move _12, copy _11) -> [success: bb5, unwind unreachable]; ++ _13 = Lt(const 0_usize, copy _12); + assert(move _13, "index out of bounds: the length is {} but the index is {}", move _12, const 0_usize) -> [success: bb5, unwind unreachable]; } bb5: { -- _3 = (*_1)[_11]; -+ _3 = (*_1)[0 of 1]; +- _3 = copy (*_1)[_11]; ++ _3 = copy (*_1)[0 of 1]; StorageDead(_11); goto -> bb6; } @@ -89,7 +89,7 @@ bb6: { StorageDead(_4); StorageLive(_14); - _14 = _3; + _14 = copy _3; _0 = opaque::<T>(move _14) -> [return: bb7, unwind unreachable]; } diff --git a/tests/mir-opt/gvn.constant_index_overflow.GVN.panic-unwind.diff b/tests/mir-opt/gvn.constant_index_overflow.GVN.panic-unwind.diff index 7a23fbe7cc0..84b738c7804 100644 --- a/tests/mir-opt/gvn.constant_index_overflow.GVN.panic-unwind.diff +++ b/tests/mir-opt/gvn.constant_index_overflow.GVN.panic-unwind.diff @@ -32,7 +32,7 @@ StorageLive(_3); StorageLive(_4); StorageLive(_5); -- _5 = _2; +- _5 = copy _2; + _5 = const usize::MAX; StorageLive(_6); StorageLive(_7); @@ -51,18 +51,18 @@ StorageDead(_6); StorageDead(_5); StorageLive(_8); -- _8 = _2; +- _8 = copy _2; + _8 = const usize::MAX; _9 = Len((*_1)); -- _10 = Lt(_8, _9); -- assert(move _10, "index out of bounds: the length is {} but the index is {}", move _9, _8) -> [success: bb3, unwind continue]; -+ _10 = Lt(const usize::MAX, _9); +- _10 = Lt(copy _8, copy _9); +- assert(move _10, "index out of bounds: the length is {} but the index is {}", move _9, copy _8) -> [success: bb3, unwind continue]; ++ _10 = Lt(const usize::MAX, copy _9); + assert(move _10, "index out of bounds: the length is {} but the index is {}", move _9, const usize::MAX) -> [success: bb3, unwind continue]; } bb3: { -- _3 = (*_1)[_8]; -+ _3 = (*_1)[_2]; +- _3 = copy (*_1)[_8]; ++ _3 = copy (*_1)[_2]; StorageDead(_8); goto -> bb6; } @@ -73,15 +73,15 @@ StorageLive(_11); _11 = const 0_usize; _12 = Len((*_1)); -- _13 = Lt(_11, _12); -- assert(move _13, "index out of bounds: the length is {} but the index is {}", move _12, _11) -> [success: bb5, unwind continue]; -+ _13 = Lt(const 0_usize, _12); +- _13 = Lt(copy _11, copy _12); +- assert(move _13, "index out of bounds: the length is {} but the index is {}", move _12, copy _11) -> [success: bb5, unwind continue]; ++ _13 = Lt(const 0_usize, copy _12); + assert(move _13, "index out of bounds: the length is {} but the index is {}", move _12, const 0_usize) -> [success: bb5, unwind continue]; } bb5: { -- _3 = (*_1)[_11]; -+ _3 = (*_1)[0 of 1]; +- _3 = copy (*_1)[_11]; ++ _3 = copy (*_1)[0 of 1]; StorageDead(_11); goto -> bb6; } @@ -89,7 +89,7 @@ bb6: { StorageDead(_4); StorageLive(_14); - _14 = _3; + _14 = copy _3; _0 = opaque::<T>(move _14) -> [return: bb7, unwind continue]; } diff --git a/tests/mir-opt/gvn.dereferences.GVN.panic-abort.diff b/tests/mir-opt/gvn.dereferences.GVN.panic-abort.diff index 906835530d8..a763614dc64 100644 --- a/tests/mir-opt/gvn.dereferences.GVN.panic-abort.diff +++ b/tests/mir-opt/gvn.dereferences.GVN.panic-abort.diff @@ -48,7 +48,7 @@ bb0: { StorageLive(_4); StorageLive(_5); - _5 = (*_1); + _5 = copy (*_1); _4 = opaque::<u32>(move _5) -> [return: bb1, unwind unreachable]; } @@ -57,7 +57,7 @@ StorageDead(_4); StorageLive(_6); StorageLive(_7); - _7 = (*_1); + _7 = copy (*_1); _6 = opaque::<u32>(move _7) -> [return: bb2, unwind unreachable]; } @@ -68,7 +68,7 @@ _8 = &raw const (*_1); StorageLive(_9); StorageLive(_10); - _10 = (*_8); + _10 = copy (*_8); _9 = opaque::<u32>(move _10) -> [return: bb3, unwind unreachable]; } @@ -77,7 +77,7 @@ StorageDead(_9); StorageLive(_11); StorageLive(_12); - _12 = (*_8); + _12 = copy (*_8); _11 = opaque::<u32>(move _12) -> [return: bb4, unwind unreachable]; } @@ -88,7 +88,7 @@ _13 = &raw mut (*_1); StorageLive(_14); StorageLive(_15); - _15 = (*_13); + _15 = copy (*_13); _14 = opaque::<u32>(move _15) -> [return: bb5, unwind unreachable]; } @@ -97,7 +97,7 @@ StorageDead(_14); StorageLive(_16); StorageLive(_17); - _17 = (*_13); + _17 = copy (*_13); _16 = opaque::<u32>(move _17) -> [return: bb6, unwind unreachable]; } @@ -109,9 +109,9 @@ StorageLive(_19); - StorageLive(_20); + nop; - _20 = (*_18); + _20 = copy (*_18); - _19 = opaque::<u32>(move _20) -> [return: bb7, unwind unreachable]; -+ _19 = opaque::<u32>(_20) -> [return: bb7, unwind unreachable]; ++ _19 = opaque::<u32>(copy _20) -> [return: bb7, unwind unreachable]; } bb7: { @@ -120,10 +120,10 @@ StorageDead(_19); StorageLive(_21); StorageLive(_22); -- _22 = (*_18); +- _22 = copy (*_18); - _21 = opaque::<u32>(move _22) -> [return: bb8, unwind unreachable]; -+ _22 = _20; -+ _21 = opaque::<u32>(_20) -> [return: bb8, unwind unreachable]; ++ _22 = copy _20; ++ _21 = opaque::<u32>(copy _20) -> [return: bb8, unwind unreachable]; } bb8: { @@ -140,7 +140,7 @@ StorageDead(_23); StorageLive(_25); StorageLive(_26); - _26 = (*_2); + _26 = copy (*_2); _25 = opaque::<impl Copy>(move _26) -> [return: bb10, unwind unreachable]; } @@ -149,7 +149,7 @@ StorageDead(_25); StorageLive(_27); StorageLive(_28); - _28 = (*_2); + _28 = copy (*_2); _27 = opaque::<impl Copy>(move _28) -> [return: bb11, unwind unreachable]; } @@ -159,9 +159,9 @@ StorageLive(_29); - StorageLive(_30); + nop; - _30 = ((*_3).0: u32); + _30 = copy ((*_3).0: u32); - _29 = opaque::<u32>(move _30) -> [return: bb12, unwind unreachable]; -+ _29 = opaque::<u32>(_30) -> [return: bb12, unwind unreachable]; ++ _29 = opaque::<u32>(copy _30) -> [return: bb12, unwind unreachable]; } bb12: { @@ -170,10 +170,10 @@ StorageDead(_29); StorageLive(_31); StorageLive(_32); -- _32 = ((*_3).0: u32); +- _32 = copy ((*_3).0: u32); - _31 = opaque::<u32>(move _32) -> [return: bb13, unwind unreachable]; -+ _32 = _30; -+ _31 = opaque::<u32>(_30) -> [return: bb13, unwind unreachable]; ++ _32 = copy _30; ++ _31 = opaque::<u32>(copy _30) -> [return: bb13, unwind unreachable]; } bb13: { diff --git a/tests/mir-opt/gvn.dereferences.GVN.panic-unwind.diff b/tests/mir-opt/gvn.dereferences.GVN.panic-unwind.diff index 006b5da646c..ca6fda48364 100644 --- a/tests/mir-opt/gvn.dereferences.GVN.panic-unwind.diff +++ b/tests/mir-opt/gvn.dereferences.GVN.panic-unwind.diff @@ -48,7 +48,7 @@ bb0: { StorageLive(_4); StorageLive(_5); - _5 = (*_1); + _5 = copy (*_1); _4 = opaque::<u32>(move _5) -> [return: bb1, unwind continue]; } @@ -57,7 +57,7 @@ StorageDead(_4); StorageLive(_6); StorageLive(_7); - _7 = (*_1); + _7 = copy (*_1); _6 = opaque::<u32>(move _7) -> [return: bb2, unwind continue]; } @@ -68,7 +68,7 @@ _8 = &raw const (*_1); StorageLive(_9); StorageLive(_10); - _10 = (*_8); + _10 = copy (*_8); _9 = opaque::<u32>(move _10) -> [return: bb3, unwind continue]; } @@ -77,7 +77,7 @@ StorageDead(_9); StorageLive(_11); StorageLive(_12); - _12 = (*_8); + _12 = copy (*_8); _11 = opaque::<u32>(move _12) -> [return: bb4, unwind continue]; } @@ -88,7 +88,7 @@ _13 = &raw mut (*_1); StorageLive(_14); StorageLive(_15); - _15 = (*_13); + _15 = copy (*_13); _14 = opaque::<u32>(move _15) -> [return: bb5, unwind continue]; } @@ -97,7 +97,7 @@ StorageDead(_14); StorageLive(_16); StorageLive(_17); - _17 = (*_13); + _17 = copy (*_13); _16 = opaque::<u32>(move _17) -> [return: bb6, unwind continue]; } @@ -109,9 +109,9 @@ StorageLive(_19); - StorageLive(_20); + nop; - _20 = (*_18); + _20 = copy (*_18); - _19 = opaque::<u32>(move _20) -> [return: bb7, unwind continue]; -+ _19 = opaque::<u32>(_20) -> [return: bb7, unwind continue]; ++ _19 = opaque::<u32>(copy _20) -> [return: bb7, unwind continue]; } bb7: { @@ -120,10 +120,10 @@ StorageDead(_19); StorageLive(_21); StorageLive(_22); -- _22 = (*_18); +- _22 = copy (*_18); - _21 = opaque::<u32>(move _22) -> [return: bb8, unwind continue]; -+ _22 = _20; -+ _21 = opaque::<u32>(_20) -> [return: bb8, unwind continue]; ++ _22 = copy _20; ++ _21 = opaque::<u32>(copy _20) -> [return: bb8, unwind continue]; } bb8: { @@ -140,7 +140,7 @@ StorageDead(_23); StorageLive(_25); StorageLive(_26); - _26 = (*_2); + _26 = copy (*_2); _25 = opaque::<impl Copy>(move _26) -> [return: bb10, unwind continue]; } @@ -149,7 +149,7 @@ StorageDead(_25); StorageLive(_27); StorageLive(_28); - _28 = (*_2); + _28 = copy (*_2); _27 = opaque::<impl Copy>(move _28) -> [return: bb11, unwind continue]; } @@ -159,9 +159,9 @@ StorageLive(_29); - StorageLive(_30); + nop; - _30 = ((*_3).0: u32); + _30 = copy ((*_3).0: u32); - _29 = opaque::<u32>(move _30) -> [return: bb12, unwind continue]; -+ _29 = opaque::<u32>(_30) -> [return: bb12, unwind continue]; ++ _29 = opaque::<u32>(copy _30) -> [return: bb12, unwind continue]; } bb12: { @@ -170,10 +170,10 @@ StorageDead(_29); StorageLive(_31); StorageLive(_32); -- _32 = ((*_3).0: u32); +- _32 = copy ((*_3).0: u32); - _31 = opaque::<u32>(move _32) -> [return: bb13, unwind continue]; -+ _32 = _30; -+ _31 = opaque::<u32>(_30) -> [return: bb13, unwind continue]; ++ _32 = copy _30; ++ _31 = opaque::<u32>(copy _30) -> [return: bb13, unwind continue]; } bb13: { diff --git a/tests/mir-opt/gvn.duplicate_slice.GVN.panic-abort.diff b/tests/mir-opt/gvn.duplicate_slice.GVN.panic-abort.diff index 7ae1fae68e8..18c2897d528 100644 --- a/tests/mir-opt/gvn.duplicate_slice.GVN.panic-abort.diff +++ b/tests/mir-opt/gvn.duplicate_slice.GVN.panic-abort.diff @@ -16,22 +16,22 @@ bb0: { _7 = (const "a",); - _1 = (_7.0: &str) as u128 (Transmute); - _5 = identity::<&str>((_7.0: &str)) -> [return: bb1, unwind unreachable]; + _1 = copy (_7.0: &str) as u128 (Transmute); + _5 = identity::<&str>(copy (_7.0: &str)) -> [return: bb1, unwind unreachable]; } bb1: { - _3 = _5 as u128 (Transmute); + _3 = copy _5 as u128 (Transmute); _8 = const "a"; - _2 = _8 as u128 (Transmute); - _6 = identity::<&str>(_8) -> [return: bb2, unwind unreachable]; + _2 = copy _8 as u128 (Transmute); + _6 = identity::<&str>(copy _8) -> [return: bb2, unwind unreachable]; } bb2: { - _4 = _6 as u128 (Transmute); - _9 = Eq(_1, _2); - _10 = Eq(_3, _4); - _0 = (_9, _10); + _4 = copy _6 as u128 (Transmute); + _9 = Eq(copy _1, copy _2); + _10 = Eq(copy _3, copy _4); + _0 = (copy _9, copy _10); return; } } diff --git a/tests/mir-opt/gvn.duplicate_slice.GVN.panic-unwind.diff b/tests/mir-opt/gvn.duplicate_slice.GVN.panic-unwind.diff index 8c96edaa280..55f382e926e 100644 --- a/tests/mir-opt/gvn.duplicate_slice.GVN.panic-unwind.diff +++ b/tests/mir-opt/gvn.duplicate_slice.GVN.panic-unwind.diff @@ -16,22 +16,22 @@ bb0: { _7 = (const "a",); - _1 = (_7.0: &str) as u128 (Transmute); - _5 = identity::<&str>((_7.0: &str)) -> [return: bb1, unwind continue]; + _1 = copy (_7.0: &str) as u128 (Transmute); + _5 = identity::<&str>(copy (_7.0: &str)) -> [return: bb1, unwind continue]; } bb1: { - _3 = _5 as u128 (Transmute); + _3 = copy _5 as u128 (Transmute); _8 = const "a"; - _2 = _8 as u128 (Transmute); - _6 = identity::<&str>(_8) -> [return: bb2, unwind continue]; + _2 = copy _8 as u128 (Transmute); + _6 = identity::<&str>(copy _8) -> [return: bb2, unwind continue]; } bb2: { - _4 = _6 as u128 (Transmute); - _9 = Eq(_1, _2); - _10 = Eq(_3, _4); - _0 = (_9, _10); + _4 = copy _6 as u128 (Transmute); + _9 = Eq(copy _1, copy _2); + _10 = Eq(copy _3, copy _4); + _0 = (copy _9, copy _10); return; } } diff --git a/tests/mir-opt/gvn.fn_pointers.GVN.panic-abort.diff b/tests/mir-opt/gvn.fn_pointers.GVN.panic-abort.diff index b5c0cee7846..292b812b50c 100644 --- a/tests/mir-opt/gvn.fn_pointers.GVN.panic-abort.diff +++ b/tests/mir-opt/gvn.fn_pointers.GVN.panic-abort.diff @@ -8,10 +8,10 @@ let mut _3: fn(u8) -> u8; let _5: (); let mut _6: fn(u8) -> u8; - let mut _9: {closure@$DIR/gvn.rs:615:19: 615:21}; + let mut _9: {closure@$DIR/gvn.rs:614:19: 614:21}; let _10: (); let mut _11: fn(); - let mut _13: {closure@$DIR/gvn.rs:615:19: 615:21}; + let mut _13: {closure@$DIR/gvn.rs:614:19: 614:21}; let _14: (); let mut _15: fn(); scope 1 { @@ -19,7 +19,7 @@ let _4: fn(u8) -> u8; scope 2 { debug g => _4; - let _7: {closure@$DIR/gvn.rs:615:19: 615:21}; + let _7: {closure@$DIR/gvn.rs:614:19: 614:21}; scope 3 { debug closure => _7; let _8: fn(); @@ -40,9 +40,9 @@ _1 = identity::<u8> as fn(u8) -> u8 (PointerCoercion(ReifyFnPointer)); StorageLive(_2); StorageLive(_3); - _3 = _1; + _3 = copy _1; - _2 = opaque::<fn(u8) -> u8>(move _3) -> [return: bb1, unwind unreachable]; -+ _2 = opaque::<fn(u8) -> u8>(_1) -> [return: bb1, unwind unreachable]; ++ _2 = opaque::<fn(u8) -> u8>(copy _1) -> [return: bb1, unwind unreachable]; } bb1: { @@ -53,31 +53,31 @@ _4 = identity::<u8> as fn(u8) -> u8 (PointerCoercion(ReifyFnPointer)); StorageLive(_5); StorageLive(_6); - _6 = _4; + _6 = copy _4; - _5 = opaque::<fn(u8) -> u8>(move _6) -> [return: bb2, unwind unreachable]; -+ _5 = opaque::<fn(u8) -> u8>(_4) -> [return: bb2, unwind unreachable]; ++ _5 = opaque::<fn(u8) -> u8>(copy _4) -> [return: bb2, unwind unreachable]; } bb2: { StorageDead(_6); StorageDead(_5); - StorageLive(_7); -- _7 = {closure@$DIR/gvn.rs:615:19: 615:21}; +- _7 = {closure@$DIR/gvn.rs:614:19: 614:21}; - StorageLive(_8); + nop; -+ _7 = const ZeroSized: {closure@$DIR/gvn.rs:615:19: 615:21}; ++ _7 = const ZeroSized: {closure@$DIR/gvn.rs:614:19: 614:21}; + nop; StorageLive(_9); -- _9 = _7; +- _9 = copy _7; - _8 = move _9 as fn() (PointerCoercion(ClosureFnPointer(Safe))); -+ _9 = const ZeroSized: {closure@$DIR/gvn.rs:615:19: 615:21}; -+ _8 = const ZeroSized: {closure@$DIR/gvn.rs:615:19: 615:21} as fn() (PointerCoercion(ClosureFnPointer(Safe))); ++ _9 = const ZeroSized: {closure@$DIR/gvn.rs:614:19: 614:21}; ++ _8 = const ZeroSized: {closure@$DIR/gvn.rs:614:19: 614:21} as fn() (PointerCoercion(ClosureFnPointer(Safe))); StorageDead(_9); StorageLive(_10); StorageLive(_11); - _11 = _8; + _11 = copy _8; - _10 = opaque::<fn()>(move _11) -> [return: bb3, unwind unreachable]; -+ _10 = opaque::<fn()>(_8) -> [return: bb3, unwind unreachable]; ++ _10 = opaque::<fn()>(copy _8) -> [return: bb3, unwind unreachable]; } bb3: { @@ -86,16 +86,16 @@ - StorageLive(_12); + nop; StorageLive(_13); -- _13 = _7; +- _13 = copy _7; - _12 = move _13 as fn() (PointerCoercion(ClosureFnPointer(Safe))); -+ _13 = const ZeroSized: {closure@$DIR/gvn.rs:615:19: 615:21}; -+ _12 = const ZeroSized: {closure@$DIR/gvn.rs:615:19: 615:21} as fn() (PointerCoercion(ClosureFnPointer(Safe))); ++ _13 = const ZeroSized: {closure@$DIR/gvn.rs:614:19: 614:21}; ++ _12 = const ZeroSized: {closure@$DIR/gvn.rs:614:19: 614:21} as fn() (PointerCoercion(ClosureFnPointer(Safe))); StorageDead(_13); StorageLive(_14); StorageLive(_15); - _15 = _12; + _15 = copy _12; - _14 = opaque::<fn()>(move _15) -> [return: bb4, unwind unreachable]; -+ _14 = opaque::<fn()>(_12) -> [return: bb4, unwind unreachable]; ++ _14 = opaque::<fn()>(copy _12) -> [return: bb4, unwind unreachable]; } bb4: { diff --git a/tests/mir-opt/gvn.fn_pointers.GVN.panic-unwind.diff b/tests/mir-opt/gvn.fn_pointers.GVN.panic-unwind.diff index 7bc6573c13d..a60d986132e 100644 --- a/tests/mir-opt/gvn.fn_pointers.GVN.panic-unwind.diff +++ b/tests/mir-opt/gvn.fn_pointers.GVN.panic-unwind.diff @@ -8,10 +8,10 @@ let mut _3: fn(u8) -> u8; let _5: (); let mut _6: fn(u8) -> u8; - let mut _9: {closure@$DIR/gvn.rs:615:19: 615:21}; + let mut _9: {closure@$DIR/gvn.rs:614:19: 614:21}; let _10: (); let mut _11: fn(); - let mut _13: {closure@$DIR/gvn.rs:615:19: 615:21}; + let mut _13: {closure@$DIR/gvn.rs:614:19: 614:21}; let _14: (); let mut _15: fn(); scope 1 { @@ -19,7 +19,7 @@ let _4: fn(u8) -> u8; scope 2 { debug g => _4; - let _7: {closure@$DIR/gvn.rs:615:19: 615:21}; + let _7: {closure@$DIR/gvn.rs:614:19: 614:21}; scope 3 { debug closure => _7; let _8: fn(); @@ -40,9 +40,9 @@ _1 = identity::<u8> as fn(u8) -> u8 (PointerCoercion(ReifyFnPointer)); StorageLive(_2); StorageLive(_3); - _3 = _1; + _3 = copy _1; - _2 = opaque::<fn(u8) -> u8>(move _3) -> [return: bb1, unwind continue]; -+ _2 = opaque::<fn(u8) -> u8>(_1) -> [return: bb1, unwind continue]; ++ _2 = opaque::<fn(u8) -> u8>(copy _1) -> [return: bb1, unwind continue]; } bb1: { @@ -53,31 +53,31 @@ _4 = identity::<u8> as fn(u8) -> u8 (PointerCoercion(ReifyFnPointer)); StorageLive(_5); StorageLive(_6); - _6 = _4; + _6 = copy _4; - _5 = opaque::<fn(u8) -> u8>(move _6) -> [return: bb2, unwind continue]; -+ _5 = opaque::<fn(u8) -> u8>(_4) -> [return: bb2, unwind continue]; ++ _5 = opaque::<fn(u8) -> u8>(copy _4) -> [return: bb2, unwind continue]; } bb2: { StorageDead(_6); StorageDead(_5); - StorageLive(_7); -- _7 = {closure@$DIR/gvn.rs:615:19: 615:21}; +- _7 = {closure@$DIR/gvn.rs:614:19: 614:21}; - StorageLive(_8); + nop; -+ _7 = const ZeroSized: {closure@$DIR/gvn.rs:615:19: 615:21}; ++ _7 = const ZeroSized: {closure@$DIR/gvn.rs:614:19: 614:21}; + nop; StorageLive(_9); -- _9 = _7; +- _9 = copy _7; - _8 = move _9 as fn() (PointerCoercion(ClosureFnPointer(Safe))); -+ _9 = const ZeroSized: {closure@$DIR/gvn.rs:615:19: 615:21}; -+ _8 = const ZeroSized: {closure@$DIR/gvn.rs:615:19: 615:21} as fn() (PointerCoercion(ClosureFnPointer(Safe))); ++ _9 = const ZeroSized: {closure@$DIR/gvn.rs:614:19: 614:21}; ++ _8 = const ZeroSized: {closure@$DIR/gvn.rs:614:19: 614:21} as fn() (PointerCoercion(ClosureFnPointer(Safe))); StorageDead(_9); StorageLive(_10); StorageLive(_11); - _11 = _8; + _11 = copy _8; - _10 = opaque::<fn()>(move _11) -> [return: bb3, unwind continue]; -+ _10 = opaque::<fn()>(_8) -> [return: bb3, unwind continue]; ++ _10 = opaque::<fn()>(copy _8) -> [return: bb3, unwind continue]; } bb3: { @@ -86,16 +86,16 @@ - StorageLive(_12); + nop; StorageLive(_13); -- _13 = _7; +- _13 = copy _7; - _12 = move _13 as fn() (PointerCoercion(ClosureFnPointer(Safe))); -+ _13 = const ZeroSized: {closure@$DIR/gvn.rs:615:19: 615:21}; -+ _12 = const ZeroSized: {closure@$DIR/gvn.rs:615:19: 615:21} as fn() (PointerCoercion(ClosureFnPointer(Safe))); ++ _13 = const ZeroSized: {closure@$DIR/gvn.rs:614:19: 614:21}; ++ _12 = const ZeroSized: {closure@$DIR/gvn.rs:614:19: 614:21} as fn() (PointerCoercion(ClosureFnPointer(Safe))); StorageDead(_13); StorageLive(_14); StorageLive(_15); - _15 = _12; + _15 = copy _12; - _14 = opaque::<fn()>(move _15) -> [return: bb4, unwind continue]; -+ _14 = opaque::<fn()>(_12) -> [return: bb4, unwind continue]; ++ _14 = opaque::<fn()>(copy _12) -> [return: bb4, unwind continue]; } bb4: { diff --git a/tests/mir-opt/gvn.generic_cast_metadata.GVN.panic-abort.diff b/tests/mir-opt/gvn.generic_cast_metadata.GVN.panic-abort.diff index 1d462a8a23c..770c6730775 100644 --- a/tests/mir-opt/gvn.generic_cast_metadata.GVN.panic-abort.diff +++ b/tests/mir-opt/gvn.generic_cast_metadata.GVN.panic-abort.diff @@ -17,21 +17,21 @@ let mut _15: <B as std::ptr::Pointee>::Metadata; bb0: { - _4 = _1 as *const T (PtrToPtr); - _5 = PtrMetadata(_4); - _6 = _1 as *const (&A, [T]) (PtrToPtr); -- _7 = PtrMetadata(_6); -+ _7 = PtrMetadata(_1); - _8 = _2 as *const (T, B) (PtrToPtr); - _9 = PtrMetadata(_8); - _10 = _2 as *const (T, A) (PtrToPtr); -- _11 = PtrMetadata(_10); -+ _11 = PtrMetadata(_2); - _12 = _3 as *mut A (PtrToPtr); - _13 = PtrMetadata(_12); - _14 = _3 as *mut B (PtrToPtr); -- _15 = PtrMetadata(_14); -+ _15 = PtrMetadata(_3); + _4 = copy _1 as *const T (PtrToPtr); + _5 = PtrMetadata(copy _4); + _6 = copy _1 as *const (&A, [T]) (PtrToPtr); +- _7 = PtrMetadata(copy _6); ++ _7 = PtrMetadata(copy _1); + _8 = copy _2 as *const (T, B) (PtrToPtr); + _9 = PtrMetadata(copy _8); + _10 = copy _2 as *const (T, A) (PtrToPtr); +- _11 = PtrMetadata(copy _10); ++ _11 = PtrMetadata(copy _2); + _12 = copy _3 as *mut A (PtrToPtr); + _13 = PtrMetadata(copy _12); + _14 = copy _3 as *mut B (PtrToPtr); +- _15 = PtrMetadata(copy _14); ++ _15 = PtrMetadata(copy _3); return; } } diff --git a/tests/mir-opt/gvn.generic_cast_metadata.GVN.panic-unwind.diff b/tests/mir-opt/gvn.generic_cast_metadata.GVN.panic-unwind.diff index 1d462a8a23c..770c6730775 100644 --- a/tests/mir-opt/gvn.generic_cast_metadata.GVN.panic-unwind.diff +++ b/tests/mir-opt/gvn.generic_cast_metadata.GVN.panic-unwind.diff @@ -17,21 +17,21 @@ let mut _15: <B as std::ptr::Pointee>::Metadata; bb0: { - _4 = _1 as *const T (PtrToPtr); - _5 = PtrMetadata(_4); - _6 = _1 as *const (&A, [T]) (PtrToPtr); -- _7 = PtrMetadata(_6); -+ _7 = PtrMetadata(_1); - _8 = _2 as *const (T, B) (PtrToPtr); - _9 = PtrMetadata(_8); - _10 = _2 as *const (T, A) (PtrToPtr); -- _11 = PtrMetadata(_10); -+ _11 = PtrMetadata(_2); - _12 = _3 as *mut A (PtrToPtr); - _13 = PtrMetadata(_12); - _14 = _3 as *mut B (PtrToPtr); -- _15 = PtrMetadata(_14); -+ _15 = PtrMetadata(_3); + _4 = copy _1 as *const T (PtrToPtr); + _5 = PtrMetadata(copy _4); + _6 = copy _1 as *const (&A, [T]) (PtrToPtr); +- _7 = PtrMetadata(copy _6); ++ _7 = PtrMetadata(copy _1); + _8 = copy _2 as *const (T, B) (PtrToPtr); + _9 = PtrMetadata(copy _8); + _10 = copy _2 as *const (T, A) (PtrToPtr); +- _11 = PtrMetadata(copy _10); ++ _11 = PtrMetadata(copy _2); + _12 = copy _3 as *mut A (PtrToPtr); + _13 = PtrMetadata(copy _12); + _14 = copy _3 as *mut B (PtrToPtr); +- _15 = PtrMetadata(copy _14); ++ _15 = PtrMetadata(copy _3); return; } } diff --git a/tests/mir-opt/gvn.indirect_static.GVN.panic-abort.diff b/tests/mir-opt/gvn.indirect_static.GVN.panic-abort.diff index e84f91e495d..97f41f89fb2 100644 --- a/tests/mir-opt/gvn.indirect_static.GVN.panic-abort.diff +++ b/tests/mir-opt/gvn.indirect_static.GVN.panic-abort.diff @@ -8,7 +8,7 @@ bb0: { _1 = const {ALLOC0: &Option<u8>}; - _2 = (((*_1) as variant#1).0: u8); + _2 = copy (((*_1) as variant#1).0: u8); return; } } diff --git a/tests/mir-opt/gvn.indirect_static.GVN.panic-unwind.diff b/tests/mir-opt/gvn.indirect_static.GVN.panic-unwind.diff index e84f91e495d..97f41f89fb2 100644 --- a/tests/mir-opt/gvn.indirect_static.GVN.panic-unwind.diff +++ b/tests/mir-opt/gvn.indirect_static.GVN.panic-unwind.diff @@ -8,7 +8,7 @@ bb0: { _1 = const {ALLOC0: &Option<u8>}; - _2 = (((*_1) as variant#1).0: u8); + _2 = copy (((*_1) as variant#1).0: u8); return; } } diff --git a/tests/mir-opt/gvn.manual_slice_mut_len.GVN.panic-abort.diff b/tests/mir-opt/gvn.manual_slice_mut_len.GVN.panic-abort.diff index c877d8a3c0e..936fa3db82a 100644 --- a/tests/mir-opt/gvn.manual_slice_mut_len.GVN.panic-abort.diff +++ b/tests/mir-opt/gvn.manual_slice_mut_len.GVN.panic-abort.diff @@ -22,14 +22,14 @@ - StorageLive(_3); + nop; StorageLive(_4); - _4 = _2; + _4 = copy _2; - _3 = move _4 as *const [i32] (PtrToPtr); -+ _3 = _2 as *const [i32] (PtrToPtr); ++ _3 = copy _2 as *const [i32] (PtrToPtr); StorageDead(_4); StorageLive(_5); - _5 = _3; + _5 = copy _3; - _0 = PtrMetadata(move _5); -+ _0 = PtrMetadata(_1); ++ _0 = PtrMetadata(copy _1); StorageDead(_5); - StorageDead(_3); - StorageDead(_2); diff --git a/tests/mir-opt/gvn.manual_slice_mut_len.GVN.panic-unwind.diff b/tests/mir-opt/gvn.manual_slice_mut_len.GVN.panic-unwind.diff index c877d8a3c0e..936fa3db82a 100644 --- a/tests/mir-opt/gvn.manual_slice_mut_len.GVN.panic-unwind.diff +++ b/tests/mir-opt/gvn.manual_slice_mut_len.GVN.panic-unwind.diff @@ -22,14 +22,14 @@ - StorageLive(_3); + nop; StorageLive(_4); - _4 = _2; + _4 = copy _2; - _3 = move _4 as *const [i32] (PtrToPtr); -+ _3 = _2 as *const [i32] (PtrToPtr); ++ _3 = copy _2 as *const [i32] (PtrToPtr); StorageDead(_4); StorageLive(_5); - _5 = _3; + _5 = copy _3; - _0 = PtrMetadata(move _5); -+ _0 = PtrMetadata(_1); ++ _0 = PtrMetadata(copy _1); StorageDead(_5); - StorageDead(_3); - StorageDead(_2); diff --git a/tests/mir-opt/gvn.meta_of_ref_to_slice.GVN.panic-abort.diff b/tests/mir-opt/gvn.meta_of_ref_to_slice.GVN.panic-abort.diff index 73dbabb56b3..3ed6c2b5308 100644 --- a/tests/mir-opt/gvn.meta_of_ref_to_slice.GVN.panic-abort.diff +++ b/tests/mir-opt/gvn.meta_of_ref_to_slice.GVN.panic-abort.diff @@ -15,12 +15,12 @@ - StorageLive(_2); + nop; StorageLive(_3); - _3 = _1; + _3 = copy _1; - _2 = *const [i32] from (move _3, const 1_usize); -+ _2 = *const [i32] from (_1, const 1_usize); ++ _2 = *const [i32] from (copy _1, const 1_usize); StorageDead(_3); StorageLive(_4); - _4 = _2; + _4 = copy _2; - _0 = PtrMetadata(move _4); + _0 = const 1_usize; StorageDead(_4); diff --git a/tests/mir-opt/gvn.meta_of_ref_to_slice.GVN.panic-unwind.diff b/tests/mir-opt/gvn.meta_of_ref_to_slice.GVN.panic-unwind.diff index 73dbabb56b3..3ed6c2b5308 100644 --- a/tests/mir-opt/gvn.meta_of_ref_to_slice.GVN.panic-unwind.diff +++ b/tests/mir-opt/gvn.meta_of_ref_to_slice.GVN.panic-unwind.diff @@ -15,12 +15,12 @@ - StorageLive(_2); + nop; StorageLive(_3); - _3 = _1; + _3 = copy _1; - _2 = *const [i32] from (move _3, const 1_usize); -+ _2 = *const [i32] from (_1, const 1_usize); ++ _2 = *const [i32] from (copy _1, const 1_usize); StorageDead(_3); StorageLive(_4); - _4 = _2; + _4 = copy _2; - _0 = PtrMetadata(move _4); + _0 = const 1_usize; StorageDead(_4); diff --git a/tests/mir-opt/gvn.multiple_branches.GVN.panic-abort.diff b/tests/mir-opt/gvn.multiple_branches.GVN.panic-abort.diff index 29ca1ba5902..f300ce7e884 100644 --- a/tests/mir-opt/gvn.multiple_branches.GVN.panic-abort.diff +++ b/tests/mir-opt/gvn.multiple_branches.GVN.panic-abort.diff @@ -41,9 +41,9 @@ bb0: { StorageLive(_4); StorageLive(_5); - _5 = _1; + _5 = copy _1; - switchInt(move _5) -> [0: bb4, otherwise: bb1]; -+ switchInt(_1) -> [0: bb4, otherwise: bb1]; ++ switchInt(copy _1) -> [0: bb4, otherwise: bb1]; } bb1: { @@ -51,15 +51,15 @@ - StorageLive(_7); + nop; StorageLive(_8); - _8 = _2; + _8 = copy _2; StorageLive(_9); - _9 = _3; + _9 = copy _3; - _7 = Add(move _8, move _9); -+ _7 = Add(_2, _3); ++ _7 = Add(copy _2, copy _3); StorageDead(_9); StorageDead(_8); - _6 = opaque::<u8>(move _7) -> [return: bb2, unwind unreachable]; -+ _6 = opaque::<u8>(_7) -> [return: bb2, unwind unreachable]; ++ _6 = opaque::<u8>(copy _7) -> [return: bb2, unwind unreachable]; } bb2: { @@ -69,15 +69,15 @@ StorageLive(_10); StorageLive(_11); StorageLive(_12); - _12 = _2; + _12 = copy _2; StorageLive(_13); - _13 = _3; + _13 = copy _3; - _11 = Add(move _12, move _13); -+ _11 = _7; ++ _11 = copy _7; StorageDead(_13); StorageDead(_12); - _10 = opaque::<u8>(move _11) -> [return: bb3, unwind unreachable]; -+ _10 = opaque::<u8>(_7) -> [return: bb3, unwind unreachable]; ++ _10 = opaque::<u8>(copy _7) -> [return: bb3, unwind unreachable]; } bb3: { @@ -92,15 +92,15 @@ - StorageLive(_15); + nop; StorageLive(_16); - _16 = _2; + _16 = copy _2; StorageLive(_17); - _17 = _3; + _17 = copy _3; - _15 = Add(move _16, move _17); -+ _15 = Add(_2, _3); ++ _15 = Add(copy _2, copy _3); StorageDead(_17); StorageDead(_16); - _14 = opaque::<u8>(move _15) -> [return: bb5, unwind unreachable]; -+ _14 = opaque::<u8>(_15) -> [return: bb5, unwind unreachable]; ++ _14 = opaque::<u8>(copy _15) -> [return: bb5, unwind unreachable]; } bb5: { @@ -110,15 +110,15 @@ StorageLive(_18); StorageLive(_19); StorageLive(_20); - _20 = _2; + _20 = copy _2; StorageLive(_21); - _21 = _3; + _21 = copy _3; - _19 = Add(move _20, move _21); -+ _19 = _15; ++ _19 = copy _15; StorageDead(_21); StorageDead(_20); - _18 = opaque::<u8>(move _19) -> [return: bb6, unwind unreachable]; -+ _18 = opaque::<u8>(_15) -> [return: bb6, unwind unreachable]; ++ _18 = opaque::<u8>(copy _15) -> [return: bb6, unwind unreachable]; } bb6: { @@ -135,15 +135,15 @@ - StorageLive(_23); + nop; StorageLive(_24); - _24 = _2; + _24 = copy _2; StorageLive(_25); - _25 = _3; + _25 = copy _3; - _23 = Add(move _24, move _25); -+ _23 = Add(_2, _3); ++ _23 = Add(copy _2, copy _3); StorageDead(_25); StorageDead(_24); - _22 = opaque::<u8>(move _23) -> [return: bb8, unwind unreachable]; -+ _22 = opaque::<u8>(_23) -> [return: bb8, unwind unreachable]; ++ _22 = opaque::<u8>(copy _23) -> [return: bb8, unwind unreachable]; } bb8: { @@ -151,24 +151,24 @@ + nop; StorageDead(_22); StorageLive(_26); - _26 = _1; + _26 = copy _1; - switchInt(move _26) -> [0: bb11, otherwise: bb9]; -+ switchInt(_1) -> [0: bb11, otherwise: bb9]; ++ switchInt(copy _1) -> [0: bb11, otherwise: bb9]; } bb9: { StorageLive(_27); StorageLive(_28); StorageLive(_29); - _29 = _2; + _29 = copy _2; StorageLive(_30); - _30 = _3; + _30 = copy _3; - _28 = Add(move _29, move _30); -+ _28 = _23; ++ _28 = copy _23; StorageDead(_30); StorageDead(_29); - _27 = opaque::<u8>(move _28) -> [return: bb10, unwind unreachable]; -+ _27 = opaque::<u8>(_23) -> [return: bb10, unwind unreachable]; ++ _27 = opaque::<u8>(copy _23) -> [return: bb10, unwind unreachable]; } bb10: { @@ -182,15 +182,15 @@ StorageLive(_31); StorageLive(_32); StorageLive(_33); - _33 = _2; + _33 = copy _2; StorageLive(_34); - _34 = _3; + _34 = copy _3; - _32 = Add(move _33, move _34); -+ _32 = _23; ++ _32 = copy _23; StorageDead(_34); StorageDead(_33); - _31 = opaque::<u8>(move _32) -> [return: bb12, unwind unreachable]; -+ _31 = opaque::<u8>(_23) -> [return: bb12, unwind unreachable]; ++ _31 = opaque::<u8>(copy _23) -> [return: bb12, unwind unreachable]; } bb12: { diff --git a/tests/mir-opt/gvn.multiple_branches.GVN.panic-unwind.diff b/tests/mir-opt/gvn.multiple_branches.GVN.panic-unwind.diff index 5394dc8be8a..f34765534cc 100644 --- a/tests/mir-opt/gvn.multiple_branches.GVN.panic-unwind.diff +++ b/tests/mir-opt/gvn.multiple_branches.GVN.panic-unwind.diff @@ -41,9 +41,9 @@ bb0: { StorageLive(_4); StorageLive(_5); - _5 = _1; + _5 = copy _1; - switchInt(move _5) -> [0: bb4, otherwise: bb1]; -+ switchInt(_1) -> [0: bb4, otherwise: bb1]; ++ switchInt(copy _1) -> [0: bb4, otherwise: bb1]; } bb1: { @@ -51,15 +51,15 @@ - StorageLive(_7); + nop; StorageLive(_8); - _8 = _2; + _8 = copy _2; StorageLive(_9); - _9 = _3; + _9 = copy _3; - _7 = Add(move _8, move _9); -+ _7 = Add(_2, _3); ++ _7 = Add(copy _2, copy _3); StorageDead(_9); StorageDead(_8); - _6 = opaque::<u8>(move _7) -> [return: bb2, unwind continue]; -+ _6 = opaque::<u8>(_7) -> [return: bb2, unwind continue]; ++ _6 = opaque::<u8>(copy _7) -> [return: bb2, unwind continue]; } bb2: { @@ -69,15 +69,15 @@ StorageLive(_10); StorageLive(_11); StorageLive(_12); - _12 = _2; + _12 = copy _2; StorageLive(_13); - _13 = _3; + _13 = copy _3; - _11 = Add(move _12, move _13); -+ _11 = _7; ++ _11 = copy _7; StorageDead(_13); StorageDead(_12); - _10 = opaque::<u8>(move _11) -> [return: bb3, unwind continue]; -+ _10 = opaque::<u8>(_7) -> [return: bb3, unwind continue]; ++ _10 = opaque::<u8>(copy _7) -> [return: bb3, unwind continue]; } bb3: { @@ -92,15 +92,15 @@ - StorageLive(_15); + nop; StorageLive(_16); - _16 = _2; + _16 = copy _2; StorageLive(_17); - _17 = _3; + _17 = copy _3; - _15 = Add(move _16, move _17); -+ _15 = Add(_2, _3); ++ _15 = Add(copy _2, copy _3); StorageDead(_17); StorageDead(_16); - _14 = opaque::<u8>(move _15) -> [return: bb5, unwind continue]; -+ _14 = opaque::<u8>(_15) -> [return: bb5, unwind continue]; ++ _14 = opaque::<u8>(copy _15) -> [return: bb5, unwind continue]; } bb5: { @@ -110,15 +110,15 @@ StorageLive(_18); StorageLive(_19); StorageLive(_20); - _20 = _2; + _20 = copy _2; StorageLive(_21); - _21 = _3; + _21 = copy _3; - _19 = Add(move _20, move _21); -+ _19 = _15; ++ _19 = copy _15; StorageDead(_21); StorageDead(_20); - _18 = opaque::<u8>(move _19) -> [return: bb6, unwind continue]; -+ _18 = opaque::<u8>(_15) -> [return: bb6, unwind continue]; ++ _18 = opaque::<u8>(copy _15) -> [return: bb6, unwind continue]; } bb6: { @@ -135,15 +135,15 @@ - StorageLive(_23); + nop; StorageLive(_24); - _24 = _2; + _24 = copy _2; StorageLive(_25); - _25 = _3; + _25 = copy _3; - _23 = Add(move _24, move _25); -+ _23 = Add(_2, _3); ++ _23 = Add(copy _2, copy _3); StorageDead(_25); StorageDead(_24); - _22 = opaque::<u8>(move _23) -> [return: bb8, unwind continue]; -+ _22 = opaque::<u8>(_23) -> [return: bb8, unwind continue]; ++ _22 = opaque::<u8>(copy _23) -> [return: bb8, unwind continue]; } bb8: { @@ -151,24 +151,24 @@ + nop; StorageDead(_22); StorageLive(_26); - _26 = _1; + _26 = copy _1; - switchInt(move _26) -> [0: bb11, otherwise: bb9]; -+ switchInt(_1) -> [0: bb11, otherwise: bb9]; ++ switchInt(copy _1) -> [0: bb11, otherwise: bb9]; } bb9: { StorageLive(_27); StorageLive(_28); StorageLive(_29); - _29 = _2; + _29 = copy _2; StorageLive(_30); - _30 = _3; + _30 = copy _3; - _28 = Add(move _29, move _30); -+ _28 = _23; ++ _28 = copy _23; StorageDead(_30); StorageDead(_29); - _27 = opaque::<u8>(move _28) -> [return: bb10, unwind continue]; -+ _27 = opaque::<u8>(_23) -> [return: bb10, unwind continue]; ++ _27 = opaque::<u8>(copy _23) -> [return: bb10, unwind continue]; } bb10: { @@ -182,15 +182,15 @@ StorageLive(_31); StorageLive(_32); StorageLive(_33); - _33 = _2; + _33 = copy _2; StorageLive(_34); - _34 = _3; + _34 = copy _3; - _32 = Add(move _33, move _34); -+ _32 = _23; ++ _32 = copy _23; StorageDead(_34); StorageDead(_33); - _31 = opaque::<u8>(move _32) -> [return: bb12, unwind continue]; -+ _31 = opaque::<u8>(_23) -> [return: bb12, unwind continue]; ++ _31 = opaque::<u8>(copy _23) -> [return: bb12, unwind continue]; } bb12: { diff --git a/tests/mir-opt/gvn.non_freeze.GVN.panic-abort.diff b/tests/mir-opt/gvn.non_freeze.GVN.panic-abort.diff index 7b6ed096118..377b4d7670c 100644 --- a/tests/mir-opt/gvn.non_freeze.GVN.panic-abort.diff +++ b/tests/mir-opt/gvn.non_freeze.GVN.panic-abort.diff @@ -7,17 +7,17 @@ let mut _3: &T; bb0: { - _2 = _1; + _2 = copy _1; _3 = &_1; - _0 = opaque::<&T>(_3) -> [return: bb1, unwind unreachable]; + _0 = opaque::<&T>(copy _3) -> [return: bb1, unwind unreachable]; } bb1: { - _0 = opaque::<T>(_2) -> [return: bb2, unwind unreachable]; + _0 = opaque::<T>(copy _2) -> [return: bb2, unwind unreachable]; } bb2: { - _0 = opaque::<T>((*_3)) -> [return: bb3, unwind unreachable]; + _0 = opaque::<T>(copy (*_3)) -> [return: bb3, unwind unreachable]; } bb3: { diff --git a/tests/mir-opt/gvn.non_freeze.GVN.panic-unwind.diff b/tests/mir-opt/gvn.non_freeze.GVN.panic-unwind.diff index 641a2f4609a..988eee07cc9 100644 --- a/tests/mir-opt/gvn.non_freeze.GVN.panic-unwind.diff +++ b/tests/mir-opt/gvn.non_freeze.GVN.panic-unwind.diff @@ -7,17 +7,17 @@ let mut _3: &T; bb0: { - _2 = _1; + _2 = copy _1; _3 = &_1; - _0 = opaque::<&T>(_3) -> [return: bb1, unwind continue]; + _0 = opaque::<&T>(copy _3) -> [return: bb1, unwind continue]; } bb1: { - _0 = opaque::<T>(_2) -> [return: bb2, unwind continue]; + _0 = opaque::<T>(copy _2) -> [return: bb2, unwind continue]; } bb2: { - _0 = opaque::<T>((*_3)) -> [return: bb3, unwind continue]; + _0 = opaque::<T>(copy (*_3)) -> [return: bb3, unwind continue]; } bb3: { diff --git a/tests/mir-opt/gvn.references.GVN.panic-abort.diff b/tests/mir-opt/gvn.references.GVN.panic-abort.diff index 7799c611445..62a487dee82 100644 --- a/tests/mir-opt/gvn.references.GVN.panic-abort.diff +++ b/tests/mir-opt/gvn.references.GVN.panic-abort.diff @@ -120,11 +120,11 @@ StorageLive(_21); - _21 = move _18; - _20 = S::<&mut impl Sized>(move _21); -+ _21 = _18; -+ _20 = S::<&mut impl Sized>(_18); ++ _21 = copy _18; ++ _20 = S::<&mut impl Sized>(copy _18); StorageDead(_21); - _19 = move (_20.0: &mut impl Sized); -+ _19 = _18; ++ _19 = copy _18; StorageDead(_20); StorageLive(_22); StorageLive(_23); diff --git a/tests/mir-opt/gvn.references.GVN.panic-unwind.diff b/tests/mir-opt/gvn.references.GVN.panic-unwind.diff index 880e7913fa9..6dd986907fc 100644 --- a/tests/mir-opt/gvn.references.GVN.panic-unwind.diff +++ b/tests/mir-opt/gvn.references.GVN.panic-unwind.diff @@ -120,11 +120,11 @@ StorageLive(_21); - _21 = move _18; - _20 = S::<&mut impl Sized>(move _21); -+ _21 = _18; -+ _20 = S::<&mut impl Sized>(_18); ++ _21 = copy _18; ++ _20 = S::<&mut impl Sized>(copy _18); StorageDead(_21); - _19 = move (_20.0: &mut impl Sized); -+ _19 = _18; ++ _19 = copy _18; StorageDead(_20); StorageLive(_22); StorageLive(_23); diff --git a/tests/mir-opt/gvn.remove_casts_must_change_both_sides.GVN.panic-abort.diff b/tests/mir-opt/gvn.remove_casts_must_change_both_sides.GVN.panic-abort.diff index 8b4bfb70401..98cb34810bc 100644 --- a/tests/mir-opt/gvn.remove_casts_must_change_both_sides.GVN.panic-abort.diff +++ b/tests/mir-opt/gvn.remove_casts_must_change_both_sides.GVN.panic-abort.diff @@ -7,9 +7,9 @@ let mut _4: *const u8; bb0: { - _3 = (*_1) as *const u8 (PtrToPtr); - _4 = _2 as *const u8 (PtrToPtr); - _0 = Eq(_3, _4); + _3 = copy (*_1) as *const u8 (PtrToPtr); + _4 = copy _2 as *const u8 (PtrToPtr); + _0 = Eq(copy _3, copy _4); return; } } diff --git a/tests/mir-opt/gvn.remove_casts_must_change_both_sides.GVN.panic-unwind.diff b/tests/mir-opt/gvn.remove_casts_must_change_both_sides.GVN.panic-unwind.diff index 8b4bfb70401..98cb34810bc 100644 --- a/tests/mir-opt/gvn.remove_casts_must_change_both_sides.GVN.panic-unwind.diff +++ b/tests/mir-opt/gvn.remove_casts_must_change_both_sides.GVN.panic-unwind.diff @@ -7,9 +7,9 @@ let mut _4: *const u8; bb0: { - _3 = (*_1) as *const u8 (PtrToPtr); - _4 = _2 as *const u8 (PtrToPtr); - _0 = Eq(_3, _4); + _3 = copy (*_1) as *const u8 (PtrToPtr); + _4 = copy _2 as *const u8 (PtrToPtr); + _0 = Eq(copy _3, copy _4); return; } } diff --git a/tests/mir-opt/gvn.repeat.GVN.panic-abort.diff b/tests/mir-opt/gvn.repeat.GVN.panic-abort.diff index 37915f8578d..ef2eb1a6677 100644 --- a/tests/mir-opt/gvn.repeat.GVN.panic-abort.diff +++ b/tests/mir-opt/gvn.repeat.GVN.panic-abort.diff @@ -28,34 +28,34 @@ _1 = const 5_i32; StorageLive(_2); StorageLive(_3); -- _3 = _1; +- _3 = copy _1; + _3 = const 5_i32; StorageLive(_4); -- _4 = _1; +- _4 = copy _1; + _4 = const 5_i32; StorageLive(_5); -- _5 = _1; +- _5 = copy _1; + _5 = const 5_i32; StorageLive(_6); -- _6 = _1; +- _6 = copy _1; + _6 = const 5_i32; StorageLive(_7); -- _7 = _1; +- _7 = copy _1; + _7 = const 5_i32; StorageLive(_8); -- _8 = _1; +- _8 = copy _1; + _8 = const 5_i32; StorageLive(_9); -- _9 = _1; +- _9 = copy _1; + _9 = const 5_i32; StorageLive(_10); -- _10 = _1; +- _10 = copy _1; + _10 = const 5_i32; StorageLive(_11); -- _11 = _1; +- _11 = copy _1; + _11 = const 5_i32; StorageLive(_12); -- _12 = _1; +- _12 = copy _1; - _2 = [move _3, move _4, move _5, move _6, move _7, move _8, move _9, move _10, move _11, move _12]; + _12 = const 5_i32; + _2 = [const 5_i32; 10]; diff --git a/tests/mir-opt/gvn.repeat.GVN.panic-unwind.diff b/tests/mir-opt/gvn.repeat.GVN.panic-unwind.diff index 37915f8578d..ef2eb1a6677 100644 --- a/tests/mir-opt/gvn.repeat.GVN.panic-unwind.diff +++ b/tests/mir-opt/gvn.repeat.GVN.panic-unwind.diff @@ -28,34 +28,34 @@ _1 = const 5_i32; StorageLive(_2); StorageLive(_3); -- _3 = _1; +- _3 = copy _1; + _3 = const 5_i32; StorageLive(_4); -- _4 = _1; +- _4 = copy _1; + _4 = const 5_i32; StorageLive(_5); -- _5 = _1; +- _5 = copy _1; + _5 = const 5_i32; StorageLive(_6); -- _6 = _1; +- _6 = copy _1; + _6 = const 5_i32; StorageLive(_7); -- _7 = _1; +- _7 = copy _1; + _7 = const 5_i32; StorageLive(_8); -- _8 = _1; +- _8 = copy _1; + _8 = const 5_i32; StorageLive(_9); -- _9 = _1; +- _9 = copy _1; + _9 = const 5_i32; StorageLive(_10); -- _10 = _1; +- _10 = copy _1; + _10 = const 5_i32; StorageLive(_11); -- _11 = _1; +- _11 = copy _1; + _11 = const 5_i32; StorageLive(_12); -- _12 = _1; +- _12 = copy _1; - _2 = [move _3, move _4, move _5, move _6, move _7, move _8, move _9, move _10, move _11, move _12]; + _12 = const 5_i32; + _2 = [const 5_i32; 10]; diff --git a/tests/mir-opt/gvn.repeated_index.GVN.panic-abort.diff b/tests/mir-opt/gvn.repeated_index.GVN.panic-abort.diff index 8ce05c9b340..d4b22d05f6c 100644 --- a/tests/mir-opt/gvn.repeated_index.GVN.panic-abort.diff +++ b/tests/mir-opt/gvn.repeated_index.GVN.panic-abort.diff @@ -24,27 +24,27 @@ bb0: { StorageLive(_3); StorageLive(_4); - _4 = _1; + _4 = copy _1; - _3 = [move _4; N]; -+ _3 = [_1; N]; ++ _3 = [copy _1; N]; StorageDead(_4); StorageLive(_5); StorageLive(_6); StorageLive(_7); _7 = const 0_usize; - _8 = Len(_3); -- _9 = Lt(_7, _8); -- assert(move _9, "index out of bounds: the length is {} but the index is {}", move _8, _7) -> [success: bb1, unwind unreachable]; +- _9 = Lt(copy _7, copy _8); +- assert(move _9, "index out of bounds: the length is {} but the index is {}", move _8, copy _7) -> [success: bb1, unwind unreachable]; + _8 = const N; + _9 = Lt(const 0_usize, const N); + assert(move _9, "index out of bounds: the length is {} but the index is {}", const N, const 0_usize) -> [success: bb1, unwind unreachable]; } bb1: { -- _6 = _3[_7]; +- _6 = copy _3[_7]; - _5 = opaque::<T>(move _6) -> [return: bb2, unwind unreachable]; -+ _6 = _1; -+ _5 = opaque::<T>(_1) -> [return: bb2, unwind unreachable]; ++ _6 = copy _1; ++ _5 = opaque::<T>(copy _1) -> [return: bb2, unwind unreachable]; } bb2: { @@ -54,20 +54,20 @@ StorageLive(_10); StorageLive(_11); StorageLive(_12); - _12 = _2; + _12 = copy _2; - _13 = Len(_3); -- _14 = Lt(_12, _13); -- assert(move _14, "index out of bounds: the length is {} but the index is {}", move _13, _12) -> [success: bb3, unwind unreachable]; +- _14 = Lt(copy _12, copy _13); +- assert(move _14, "index out of bounds: the length is {} but the index is {}", move _13, copy _12) -> [success: bb3, unwind unreachable]; + _13 = const N; -+ _14 = Lt(_2, const N); -+ assert(move _14, "index out of bounds: the length is {} but the index is {}", const N, _2) -> [success: bb3, unwind unreachable]; ++ _14 = Lt(copy _2, const N); ++ assert(move _14, "index out of bounds: the length is {} but the index is {}", const N, copy _2) -> [success: bb3, unwind unreachable]; } bb3: { -- _11 = _3[_12]; +- _11 = copy _3[_12]; - _10 = opaque::<T>(move _11) -> [return: bb4, unwind unreachable]; -+ _11 = _1; -+ _10 = opaque::<T>(_1) -> [return: bb4, unwind unreachable]; ++ _11 = copy _1; ++ _10 = opaque::<T>(copy _1) -> [return: bb4, unwind unreachable]; } bb4: { diff --git a/tests/mir-opt/gvn.repeated_index.GVN.panic-unwind.diff b/tests/mir-opt/gvn.repeated_index.GVN.panic-unwind.diff index 7ed547eeb4a..708c0f92e54 100644 --- a/tests/mir-opt/gvn.repeated_index.GVN.panic-unwind.diff +++ b/tests/mir-opt/gvn.repeated_index.GVN.panic-unwind.diff @@ -24,27 +24,27 @@ bb0: { StorageLive(_3); StorageLive(_4); - _4 = _1; + _4 = copy _1; - _3 = [move _4; N]; -+ _3 = [_1; N]; ++ _3 = [copy _1; N]; StorageDead(_4); StorageLive(_5); StorageLive(_6); StorageLive(_7); _7 = const 0_usize; - _8 = Len(_3); -- _9 = Lt(_7, _8); -- assert(move _9, "index out of bounds: the length is {} but the index is {}", move _8, _7) -> [success: bb1, unwind continue]; +- _9 = Lt(copy _7, copy _8); +- assert(move _9, "index out of bounds: the length is {} but the index is {}", move _8, copy _7) -> [success: bb1, unwind continue]; + _8 = const N; + _9 = Lt(const 0_usize, const N); + assert(move _9, "index out of bounds: the length is {} but the index is {}", const N, const 0_usize) -> [success: bb1, unwind continue]; } bb1: { -- _6 = _3[_7]; +- _6 = copy _3[_7]; - _5 = opaque::<T>(move _6) -> [return: bb2, unwind continue]; -+ _6 = _1; -+ _5 = opaque::<T>(_1) -> [return: bb2, unwind continue]; ++ _6 = copy _1; ++ _5 = opaque::<T>(copy _1) -> [return: bb2, unwind continue]; } bb2: { @@ -54,20 +54,20 @@ StorageLive(_10); StorageLive(_11); StorageLive(_12); - _12 = _2; + _12 = copy _2; - _13 = Len(_3); -- _14 = Lt(_12, _13); -- assert(move _14, "index out of bounds: the length is {} but the index is {}", move _13, _12) -> [success: bb3, unwind continue]; +- _14 = Lt(copy _12, copy _13); +- assert(move _14, "index out of bounds: the length is {} but the index is {}", move _13, copy _12) -> [success: bb3, unwind continue]; + _13 = const N; -+ _14 = Lt(_2, const N); -+ assert(move _14, "index out of bounds: the length is {} but the index is {}", const N, _2) -> [success: bb3, unwind continue]; ++ _14 = Lt(copy _2, const N); ++ assert(move _14, "index out of bounds: the length is {} but the index is {}", const N, copy _2) -> [success: bb3, unwind continue]; } bb3: { -- _11 = _3[_12]; +- _11 = copy _3[_12]; - _10 = opaque::<T>(move _11) -> [return: bb4, unwind continue]; -+ _11 = _1; -+ _10 = opaque::<T>(_1) -> [return: bb4, unwind continue]; ++ _11 = copy _1; ++ _10 = opaque::<T>(copy _1) -> [return: bb4, unwind continue]; } bb4: { diff --git a/tests/mir-opt/gvn.rs b/tests/mir-opt/gvn.rs index 430f979fec7..faa6faa7017 100644 --- a/tests/mir-opt/gvn.rs +++ b/tests/mir-opt/gvn.rs @@ -3,7 +3,6 @@ // EMIT_MIR_FOR_EACH_PANIC_STRATEGY //@ only-64bit -#![feature(raw_ref_op)] #![feature(rustc_attrs)] #![feature(custom_mir)] #![feature(core_intrinsics)] @@ -21,91 +20,91 @@ struct S<T>(T); fn subexpression_elimination(x: u64, y: u64, mut z: u64) { // CHECK-LABEL: fn subexpression_elimination( - // CHECK: [[add:_.*]] = Add(_1, _2); - // CHECK: opaque::<u64>([[add]]) + // CHECK: [[add:_.*]] = Add(copy _1, copy _2); + // CHECK: opaque::<u64>(copy [[add]]) opaque(x + y); - // CHECK: [[mul:_.*]] = Mul(_1, _2); - // CHECK: opaque::<u64>([[mul]]) + // CHECK: [[mul:_.*]] = Mul(copy _1, copy _2); + // CHECK: opaque::<u64>(copy [[mul]]) opaque(x * y); - // CHECK: [[sub:_.*]] = Sub(_1, _2); - // CHECK: opaque::<u64>([[sub]]) + // CHECK: [[sub:_.*]] = Sub(copy _1, copy _2); + // CHECK: opaque::<u64>(copy [[sub]]) opaque(x - y); - // CHECK: [[div:_.*]] = Div(_1, _2); - // CHECK: opaque::<u64>([[div]]) + // CHECK: [[div:_.*]] = Div(copy _1, copy _2); + // CHECK: opaque::<u64>(copy [[div]]) opaque(x / y); - // CHECK: [[rem:_.*]] = Rem(_1, _2); - // CHECK: opaque::<u64>([[rem]]) + // CHECK: [[rem:_.*]] = Rem(copy _1, copy _2); + // CHECK: opaque::<u64>(copy [[rem]]) opaque(x % y); - // CHECK: [[and:_.*]] = BitAnd(_1, _2); - // CHECK: opaque::<u64>([[and]]) + // CHECK: [[and:_.*]] = BitAnd(copy _1, copy _2); + // CHECK: opaque::<u64>(copy [[and]]) opaque(x & y); - // CHECK: [[or:_.*]] = BitOr(_1, _2); - // CHECK: opaque::<u64>([[or]]) + // CHECK: [[or:_.*]] = BitOr(copy _1, copy _2); + // CHECK: opaque::<u64>(copy [[or]]) opaque(x | y); - // CHECK: [[xor:_.*]] = BitXor(_1, _2); - // CHECK: opaque::<u64>([[xor]]) + // CHECK: [[xor:_.*]] = BitXor(copy _1, copy _2); + // CHECK: opaque::<u64>(copy [[xor]]) opaque(x ^ y); - // CHECK: [[shl:_.*]] = Shl(_1, _2); - // CHECK: opaque::<u64>([[shl]]) + // CHECK: [[shl:_.*]] = Shl(copy _1, copy _2); + // CHECK: opaque::<u64>(copy [[shl]]) opaque(x << y); - // CHECK: [[shr:_.*]] = Shr(_1, _2); - // CHECK: opaque::<u64>([[shr]]) + // CHECK: [[shr:_.*]] = Shr(copy _1, copy _2); + // CHECK: opaque::<u64>(copy [[shr]]) opaque(x >> y); - // CHECK: [[int:_.*]] = _1 as u32 (IntToInt); - // CHECK: opaque::<u32>([[int]]) + // CHECK: [[int:_.*]] = copy _1 as u32 (IntToInt); + // CHECK: opaque::<u32>(copy [[int]]) opaque(x as u32); - // CHECK: [[float:_.*]] = _1 as f32 (IntToFloat); - // CHECK: opaque::<f32>([[float]]) + // CHECK: [[float:_.*]] = copy _1 as f32 (IntToFloat); + // CHECK: opaque::<f32>(copy [[float]]) opaque(x as f32); - // CHECK: [[wrap:_.*]] = S::<u64>(_1); - // CHECK: opaque::<S<u64>>([[wrap]]) + // CHECK: [[wrap:_.*]] = S::<u64>(copy _1); + // CHECK: opaque::<S<u64>>(copy [[wrap]]) opaque(S(x)); - // CHECK: opaque::<u64>(_1) + // CHECK: opaque::<u64>(copy _1) opaque(S(x).0); // Those are duplicates to substitute somehow. - // CHECK: opaque::<u64>([[add]]) + // CHECK: opaque::<u64>(copy [[add]]) opaque(x + y); - // CHECK: opaque::<u64>([[mul]]) + // CHECK: opaque::<u64>(copy [[mul]]) opaque(x * y); - // CHECK: opaque::<u64>([[sub]]) + // CHECK: opaque::<u64>(copy [[sub]]) opaque(x - y); - // CHECK: opaque::<u64>([[div]]) + // CHECK: opaque::<u64>(copy [[div]]) opaque(x / y); - // CHECK: opaque::<u64>([[rem]]) + // CHECK: opaque::<u64>(copy [[rem]]) opaque(x % y); - // CHECK: opaque::<u64>([[and]]) + // CHECK: opaque::<u64>(copy [[and]]) opaque(x & y); - // CHECK: opaque::<u64>([[or]]) + // CHECK: opaque::<u64>(copy [[or]]) opaque(x | y); - // CHECK: opaque::<u64>([[xor]]) + // CHECK: opaque::<u64>(copy [[xor]]) opaque(x ^ y); - // CHECK: opaque::<u64>([[shl]]) + // CHECK: opaque::<u64>(copy [[shl]]) opaque(x << y); - // CHECK: opaque::<u64>([[shr]]) + // CHECK: opaque::<u64>(copy [[shr]]) opaque(x >> y); - // CHECK: opaque::<u32>([[int]]) + // CHECK: opaque::<u32>(copy [[int]]) opaque(x as u32); - // CHECK: opaque::<f32>([[float]]) + // CHECK: opaque::<f32>(copy [[float]]) opaque(x as f32); - // CHECK: opaque::<S<u64>>([[wrap]]) + // CHECK: opaque::<S<u64>>(copy [[wrap]]) opaque(S(x)); - // CHECK: opaque::<u64>(_1) + // CHECK: opaque::<u64>(copy _1) opaque(S(x).0); // We can substitute through a complex expression. - // CHECK: [[compound:_.*]] = Sub([[mul]], _2); - // CHECK: opaque::<u64>([[compound]]) - // CHECK: opaque::<u64>([[compound]]) + // CHECK: [[compound:_.*]] = Sub(copy [[mul]], copy _2); + // CHECK: opaque::<u64>(copy [[compound]]) + // CHECK: opaque::<u64>(copy [[compound]]) opaque((x * y) - y); opaque((x * y) - y); // We can substitute through an immutable reference too. // CHECK: [[ref:_.*]] = &_3; - // CHECK: [[deref:_.*]] = (*[[ref]]); - // CHECK: [[addref:_.*]] = Add([[deref]], _1); - // CHECK: opaque::<u64>([[addref]]) - // CHECK: opaque::<u64>([[addref]]) + // CHECK: [[deref:_.*]] = copy (*[[ref]]); + // CHECK: [[addref:_.*]] = Add(copy [[deref]], copy _1); + // CHECK: opaque::<u64>(copy [[addref]]) + // CHECK: opaque::<u64>(copy [[addref]]) let a = &z; opaque(*a + x); opaque(*a + x); @@ -141,10 +140,10 @@ fn subexpression_elimination(x: u64, y: u64, mut z: u64) { // We can substitute again, but not with the earlier computations. // Important: `e` is not `a`! // CHECK: [[ref2:_.*]] = &_3; - // CHECK: [[deref2:_.*]] = (*[[ref2]]); - // CHECK: [[addref2:_.*]] = Add([[deref2]], _1); - // CHECK: opaque::<u64>([[addref2]]) - // CHECK: opaque::<u64>([[addref2]]) + // CHECK: [[deref2:_.*]] = copy (*[[ref2]]); + // CHECK: [[addref2:_.*]] = Add(copy [[deref2]], copy _1); + // CHECK: opaque::<u64>(copy [[addref2]]) + // CHECK: opaque::<u64>(copy [[addref2]]) let e = &z; opaque(*e + x); opaque(*e + x); @@ -152,9 +151,9 @@ fn subexpression_elimination(x: u64, y: u64, mut z: u64) { fn wrap_unwrap<T: Copy>(x: T) -> T { // CHECK-LABEL: fn wrap_unwrap( - // CHECK: [[some:_.*]] = Option::<T>::Some(_1); + // CHECK: [[some:_.*]] = Option::<T>::Some(copy _1); // CHECK: switchInt(const 1_isize) - // CHECK: _0 = _1; + // CHECK: _0 = copy _1; match Some(x) { Some(y) => y, None => panic!(), @@ -163,35 +162,35 @@ fn wrap_unwrap<T: Copy>(x: T) -> T { fn repeated_index<T: Copy, const N: usize>(x: T, idx: usize) { // CHECK-LABEL: fn repeated_index( - // CHECK: [[a:_.*]] = [_1; N]; + // CHECK: [[a:_.*]] = [copy _1; N]; let a = [x; N]; - // CHECK: opaque::<T>(_1) + // CHECK: opaque::<T>(copy _1) opaque(a[0]); - // CHECK: opaque::<T>(_1) + // CHECK: opaque::<T>(copy _1) opaque(a[idx]); } fn unary(x: i64) { // CHECK-LABEL: fn unary( - // CHECK: opaque::<i64>(_1) + // CHECK: opaque::<i64>(copy _1) opaque(--x); // This is `x`. - // CHECK: [[b:_.*]] = Lt(_1, const 13_i64); - // CHECK: opaque::<bool>([[b]]) + // CHECK: [[b:_.*]] = Lt(copy _1, const 13_i64); + // CHECK: opaque::<bool>(copy [[b]]) let b = x < 13; opaque(!!b); // This is `b`. // Both lines should test the same thing. - // CHECK: [[c:_.*]] = Ne(_1, const 15_i64); - // CHECK: opaque::<bool>([[c]]) - // CHECK: opaque::<bool>([[c]]) + // CHECK: [[c:_.*]] = Ne(copy _1, const 15_i64); + // CHECK: opaque::<bool>(copy [[c]]) + // CHECK: opaque::<bool>(copy [[c]]) opaque(x != 15); opaque(!(x == 15)); // Both lines should test the same thing. - // CHECK: [[d:_.*]] = Eq(_1, const 35_i64); - // CHECK: opaque::<bool>([[d]]) - // CHECK: opaque::<bool>([[d]]) + // CHECK: [[d:_.*]] = Eq(copy _1, const 35_i64); + // CHECK: opaque::<bool>(copy [[d]]) + // CHECK: opaque::<bool>(copy [[d]]) opaque(x == 35); opaque(!(x != 35)); } @@ -199,53 +198,53 @@ fn unary(x: i64) { /// Verify symbolic integer arithmetic simplifications. fn arithmetic(x: u64) { // CHECK-LABEL: fn arithmetic( - // CHECK: opaque::<u64>(_1) + // CHECK: opaque::<u64>(copy _1) opaque(x + 0); - // CHECK: opaque::<u64>(_1) + // CHECK: opaque::<u64>(copy _1) opaque(x - 0); // CHECK: opaque::<u64>(const 0_u64) opaque(x - x); // CHECK: opaque::<u64>(const 0_u64) opaque(x * 0); - // CHECK: opaque::<u64>(_1) + // CHECK: opaque::<u64>(copy _1) opaque(x * 1); // CHECK: assert(!const true, "attempt to divide `{}` by zero", - // CHECK: [[div0:_.*]] = Div(_1, const 0_u64); + // CHECK: [[div0:_.*]] = Div(copy _1, const 0_u64); // CHECK: opaque::<u64>(move [[div0]]) opaque(x / 0); - // CHECK: opaque::<u64>(_1) + // CHECK: opaque::<u64>(copy _1) opaque(x / 1); // CHECK: opaque::<u64>(const 0_u64) opaque(0 / x); - // CHECK: [[odiv:_.*]] = Div(const 1_u64, _1); + // CHECK: [[odiv:_.*]] = Div(const 1_u64, copy _1); // CHECK: opaque::<u64>(move [[odiv]]) opaque(1 / x); // CHECK: assert(!const true, "attempt to calculate the remainder of `{}` with a divisor of zero" - // CHECK: [[rem0:_.*]] = Rem(_1, const 0_u64); + // CHECK: [[rem0:_.*]] = Rem(copy _1, const 0_u64); // CHECK: opaque::<u64>(move [[rem0]]) opaque(x % 0); // CHECK: opaque::<u64>(const 0_u64) opaque(x % 1); // CHECK: opaque::<u64>(const 0_u64) opaque(0 % x); - // CHECK: [[orem:_.*]] = Rem(const 1_u64, _1); + // CHECK: [[orem:_.*]] = Rem(const 1_u64, copy _1); // CHECK: opaque::<u64>(move [[orem]]) opaque(1 % x); // CHECK: opaque::<u64>(const 0_u64) opaque(x & 0); - // CHECK: opaque::<u64>(_1) + // CHECK: opaque::<u64>(copy _1) opaque(x & u64::MAX); - // CHECK: opaque::<u64>(_1) + // CHECK: opaque::<u64>(copy _1) opaque(x | 0); // CHECK: opaque::<u64>(const u64::MAX) opaque(x | u64::MAX); - // CHECK: opaque::<u64>(_1) + // CHECK: opaque::<u64>(copy _1) opaque(x ^ 0); // CHECK: opaque::<u64>(const 0_u64) opaque(x ^ x); - // CHECK: opaque::<u64>(_1) + // CHECK: opaque::<u64>(copy _1) opaque(x >> 0); - // CHECK: opaque::<u64>(_1) + // CHECK: opaque::<u64>(copy _1) opaque(x << 0); } @@ -255,10 +254,10 @@ fn comparison(x: u64, y: u64) { opaque(x == x); // CHECK: opaque::<bool>(const false) opaque(x != x); - // CHECK: [[eqxy:_.*]] = Eq(_1, _2); + // CHECK: [[eqxy:_.*]] = Eq(copy _1, copy _2); // CHECK: opaque::<bool>(move [[eqxy]]) opaque(x == y); - // CHECK: [[nexy:_.*]] = Ne(_1, _2); + // CHECK: [[nexy:_.*]] = Ne(copy _1, copy _2); // CHECK: opaque::<bool>(move [[nexy]]) opaque(x != y); } @@ -268,10 +267,10 @@ fn comparison(x: u64, y: u64) { fn arithmetic_checked(x: u64) { // CHECK-LABEL: fn arithmetic_checked( // CHECK: assert(!const false, - // CHECK: opaque::<u64>(_1) + // CHECK: opaque::<u64>(copy _1) opaque(x + 0); // CHECK: assert(!const false, - // CHECK: opaque::<u64>(_1) + // CHECK: opaque::<u64>(copy _1) opaque(x - 0); // CHECK: assert(!const false, // CHECK: opaque::<u64>(const 0_u64) @@ -280,39 +279,39 @@ fn arithmetic_checked(x: u64) { // CHECK: opaque::<u64>(const 0_u64) opaque(x * 0); // CHECK: assert(!const false, - // CHECK: opaque::<u64>(_1) + // CHECK: opaque::<u64>(copy _1) opaque(x * 1); } /// Verify that we do not apply arithmetic simplifications on floats. fn arithmetic_float(x: f64) { // CHECK-LABEL: fn arithmetic_float( - // CHECK: [[add:_.*]] = Add(_1, const 0f64); + // CHECK: [[add:_.*]] = Add(copy _1, const 0f64); // CHECK: opaque::<f64>(move [[add]]) opaque(x + 0.); - // CHECK: [[sub:_.*]] = Sub(_1, const 0f64); + // CHECK: [[sub:_.*]] = Sub(copy _1, const 0f64); // CHECK: opaque::<f64>(move [[sub]]) opaque(x - 0.); - // CHECK: [[mul:_.*]] = Mul(_1, const 0f64); + // CHECK: [[mul:_.*]] = Mul(copy _1, const 0f64); // CHECK: opaque::<f64>(move [[mul]]) opaque(x * 0.); - // CHECK: [[div0:_.*]] = Div(_1, const 0f64); + // CHECK: [[div0:_.*]] = Div(copy _1, const 0f64); // CHECK: opaque::<f64>(move [[div0]]) opaque(x / 0.); - // CHECK: [[zdiv:_.*]] = Div(const 0f64, _1); + // CHECK: [[zdiv:_.*]] = Div(const 0f64, copy _1); // CHECK: opaque::<f64>(move [[zdiv]]) opaque(0. / x); - // CHECK: [[rem0:_.*]] = Rem(_1, const 0f64); + // CHECK: [[rem0:_.*]] = Rem(copy _1, const 0f64); // CHECK: opaque::<f64>(move [[rem0]]) opaque(x % 0.); - // CHECK: [[zrem:_.*]] = Rem(const 0f64, _1); + // CHECK: [[zrem:_.*]] = Rem(const 0f64, copy _1); // CHECK: opaque::<f64>(move [[zrem]]) opaque(0. % x); // Those are not simplifiable to `true`/`false`, thanks to NaNs. - // CHECK: [[eq:_.*]] = Eq(_1, _1); + // CHECK: [[eq:_.*]] = Eq(copy _1, copy _1); // CHECK: opaque::<bool>(move [[eq]]) opaque(x == x); - // CHECK: [[ne:_.*]] = Ne(_1, _1); + // CHECK: [[ne:_.*]] = Ne(copy _1, copy _1); // CHECK: opaque::<bool>(move [[ne]]) opaque(x != x); } @@ -386,36 +385,36 @@ fn cast() { fn multiple_branches(t: bool, x: u8, y: u8) { // CHECK-LABEL: fn multiple_branches( - // CHECK: switchInt(_1) -> [0: [[bbf:bb.*]], otherwise: [[bbt:bb.*]]]; + // CHECK: switchInt(copy _1) -> [0: [[bbf:bb.*]], otherwise: [[bbt:bb.*]]]; if t { // CHECK: [[bbt]]: { - // CHECK: [[a:_.*]] = Add(_2, _3); - // CHECK: opaque::<u8>([[a]]) - // CHECK: opaque::<u8>([[a]]) + // CHECK: [[a:_.*]] = Add(copy _2, copy _3); + // CHECK: opaque::<u8>(copy [[a]]) + // CHECK: opaque::<u8>(copy [[a]]) // CHECK: goto -> [[bbc:bb.*]]; opaque(x + y); opaque(x + y); } else { // CHECK: [[bbf]]: { - // CHECK: [[b:_.*]] = Add(_2, _3); - // CHECK: opaque::<u8>([[b]]) - // CHECK: opaque::<u8>([[b]]) + // CHECK: [[b:_.*]] = Add(copy _2, copy _3); + // CHECK: opaque::<u8>(copy [[b]]) + // CHECK: opaque::<u8>(copy [[b]]) // CHECK: goto -> [[bbc:bb.*]]; opaque(x + y); opaque(x + y); } // Neither `a` nor `b` dominate `c`, so we cannot reuse any of them. // CHECK: [[bbc]]: { - // CHECK: [[c:_.*]] = Add(_2, _3); - // CHECK: opaque::<u8>([[c]]) + // CHECK: [[c:_.*]] = Add(copy _2, copy _3); + // CHECK: opaque::<u8>(copy [[c]]) opaque(x + y); // `c` dominates both calls, so we can reuse it. if t { - // CHECK: opaque::<u8>([[c]]) + // CHECK: opaque::<u8>(copy [[c]]) opaque(x + y); } else { - // CHECK: opaque::<u8>([[c]]) + // CHECK: opaque::<u8>(copy [[c]]) opaque(x + y); } } @@ -469,18 +468,18 @@ fn dereferences(t: &mut u32, u: &impl Copy, s: &S<u32>) { // CHECK-LABEL: fn dereferences( // Do not reuse dereferences of `&mut`. - // CHECK: [[st1:_.*]] = (*_1); + // CHECK: [[st1:_.*]] = copy (*_1); // CHECK: opaque::<u32>(move [[st1]]) - // CHECK: [[st2:_.*]] = (*_1); + // CHECK: [[st2:_.*]] = copy (*_1); // CHECK: opaque::<u32>(move [[st2]]) opaque(*t); opaque(*t); // Do not reuse dereferences of `*const`. // CHECK: [[raw:_.*]] = &raw const (*_1); - // CHECK: [[st3:_.*]] = (*[[raw]]); + // CHECK: [[st3:_.*]] = copy (*[[raw]]); // CHECK: opaque::<u32>(move [[st3]]) - // CHECK: [[st4:_.*]] = (*[[raw]]); + // CHECK: [[st4:_.*]] = copy (*[[raw]]); // CHECK: opaque::<u32>(move [[st4]]) let z = &raw const *t; unsafe { opaque(*z) }; @@ -488,9 +487,9 @@ fn dereferences(t: &mut u32, u: &impl Copy, s: &S<u32>) { // Do not reuse dereferences of `*mut`. // CHECK: [[ptr:_.*]] = &raw mut (*_1); - // CHECK: [[st5:_.*]] = (*[[ptr]]); + // CHECK: [[st5:_.*]] = copy (*[[ptr]]); // CHECK: opaque::<u32>(move [[st5]]) - // CHECK: [[st6:_.*]] = (*[[ptr]]); + // CHECK: [[st6:_.*]] = copy (*[[ptr]]); // CHECK: opaque::<u32>(move [[st6]]) let z = &raw mut *t; unsafe { opaque(*z) }; @@ -498,9 +497,9 @@ fn dereferences(t: &mut u32, u: &impl Copy, s: &S<u32>) { // We can reuse dereferences of `&Freeze`. // CHECK: [[ref:_.*]] = &(*_1); - // CHECK: [[st7:_.*]] = (*[[ref]]); - // CHECK: opaque::<u32>([[st7]]) - // CHECK: opaque::<u32>([[st7]]) + // CHECK: [[st7:_.*]] = copy (*[[ref]]); + // CHECK: opaque::<u32>(copy [[st7]]) + // CHECK: opaque::<u32>(copy [[st7]]) let z = &*t; opaque(*z); opaque(*z); @@ -510,17 +509,17 @@ fn dereferences(t: &mut u32, u: &impl Copy, s: &S<u32>) { opaque(&*z); // `*u` is not Freeze, so we cannot reuse. - // CHECK: [[st8:_.*]] = (*_2); + // CHECK: [[st8:_.*]] = copy (*_2); // CHECK: opaque::<impl Copy>(move [[st8]]) - // CHECK: [[st9:_.*]] = (*_2); + // CHECK: [[st9:_.*]] = copy (*_2); // CHECK: opaque::<impl Copy>(move [[st9]]) opaque(*u); opaque(*u); - // `*s` is not Copy, by `(*s).0` is, so we can reuse. - // CHECK: [[st10:_.*]] = ((*_3).0: u32); - // CHECK: opaque::<u32>([[st10]]) - // CHECK: opaque::<u32>([[st10]]) + // `*s` is not Copy, but `(*s).0` is, so we can reuse. + // CHECK: [[st10:_.*]] = copy ((*_3).0: u32); + // CHECK: opaque::<u32>(copy [[st10]]) + // CHECK: opaque::<u32>(copy [[st10]]) opaque(s.0); opaque(s.0); } @@ -551,38 +550,38 @@ fn duplicate_slice() -> (bool, bool) { let d: &str; { // CHECK: [[a:_.*]] = (const "a",); - // CHECK: [[au:_.*]] = ([[a]].0: &str) as u128 (Transmute); + // CHECK: [[au:_.*]] = copy ([[a]].0: &str) as u128 (Transmute); let a = ("a",); Call(au = transmute::<_, u128>(a.0), ReturnTo(bb1), UnwindContinue()) } bb1 = { - // CHECK: [[c:_.*]] = identity::<&str>(([[a]].0: &str)) + // CHECK: [[c:_.*]] = identity::<&str>(copy ([[a]].0: &str)) Call(c = identity(a.0), ReturnTo(bb2), UnwindContinue()) } bb2 = { - // CHECK: [[cu:_.*]] = [[c]] as u128 (Transmute); + // CHECK: [[cu:_.*]] = copy [[c]] as u128 (Transmute); Call(cu = transmute::<_, u128>(c), ReturnTo(bb3), UnwindContinue()) } bb3 = { // This slice is different from `a.0`. Hence `bu` is not `au`. // CHECK: [[b:_.*]] = const "a"; - // CHECK: [[bu:_.*]] = [[b]] as u128 (Transmute); + // CHECK: [[bu:_.*]] = copy [[b]] as u128 (Transmute); let b = "a"; Call(bu = transmute::<_, u128>(b), ReturnTo(bb4), UnwindContinue()) } bb4 = { // This returns a copy of `b`, which is not `a`. - // CHECK: [[d:_.*]] = identity::<&str>([[b]]) + // CHECK: [[d:_.*]] = identity::<&str>(copy [[b]]) Call(d = identity(b), ReturnTo(bb5), UnwindContinue()) } bb5 = { - // CHECK: [[du:_.*]] = [[d]] as u128 (Transmute); + // CHECK: [[du:_.*]] = copy [[d]] as u128 (Transmute); Call(du = transmute::<_, u128>(d), ReturnTo(bb6), UnwindContinue()) } bb6 = { // `direct` must not fold to `true`, as `indirect` will not. - // CHECK: = Eq([[au]], [[bu]]); - // CHECK: = Eq([[cu]], [[du]]); + // CHECK: = Eq(copy [[au]], copy [[bu]]); + // CHECK: = Eq(copy [[cu]], copy [[du]]); let direct = au == bu; let indirect = cu == du; RET = (direct, indirect); @@ -602,21 +601,21 @@ fn repeat() { fn fn_pointers() { // CHECK-LABEL: fn fn_pointers( // CHECK: [[f:_.*]] = identity::<u8> as fn(u8) -> u8 (PointerCoercion(ReifyFnPointer - // CHECK: opaque::<fn(u8) -> u8>([[f]]) + // CHECK: opaque::<fn(u8) -> u8>(copy [[f]]) let f = identity as fn(u8) -> u8; opaque(f); // CHECK: [[g:_.*]] = identity::<u8> as fn(u8) -> u8 (PointerCoercion(ReifyFnPointer - // CHECK: opaque::<fn(u8) -> u8>([[g]]) + // CHECK: opaque::<fn(u8) -> u8>(copy [[g]]) let g = identity as fn(u8) -> u8; opaque(g); // CHECK: [[cf:_.*]] = const {{.*}} as fn() (PointerCoercion(ClosureFnPointer - // CHECK: opaque::<fn()>([[cf]]) + // CHECK: opaque::<fn()>(copy [[cf]]) let closure = || {}; let cf = closure as fn(); opaque(cf); // CHECK: [[cg:_.*]] = const {{.*}} as fn() (PointerCoercion(ClosureFnPointer - // CHECK: opaque::<fn()>([[cg]]) + // CHECK: opaque::<fn()>(copy [[cg]]) let cg = closure as fn(); opaque(cg); } @@ -642,9 +641,9 @@ fn constant_index_overflow<T: Copy>(x: &[T]) { // CHECK: debug b => [[b:_.*]]; // CHECK: [[a]] = const usize::MAX; // CHECK-NOT: = (*_1)[{{.*}} of 0]; - // CHECK: [[b]] = (*_1)[[[a]]]; + // CHECK: [[b]] = copy (*_1)[[[a]]]; // CHECK-NOT: = (*_1)[{{.*}} of 0]; - // CHECK: [[b]] = (*_1)[0 of 1]; + // CHECK: [[b]] = copy (*_1)[0 of 1]; // CHECK-NOT: = (*_1)[{{.*}} of 0]; let a = u64::MAX as usize; let b = if a < x.len() { x[a] } else { x[0] }; @@ -657,22 +656,22 @@ fn wide_ptr_provenance() { let a: *const dyn Send = &1 as &dyn Send; let b: *const dyn Send = &1 as &dyn Send; - // CHECK: [[eqp:_.*]] = Eq([[a:_.*]], [[b:_.*]]); + // CHECK: [[eqp:_.*]] = Eq(copy [[a:_.*]], copy [[b:_.*]]); // CHECK: opaque::<bool>(move [[eqp]]) opaque(a == b); - // CHECK: [[nep:_.*]] = Ne([[a]], [[b]]); + // CHECK: [[nep:_.*]] = Ne(copy [[a]], copy [[b]]); // CHECK: opaque::<bool>(move [[nep]]) opaque(a != b); - // CHECK: [[ltp:_.*]] = Lt([[a]], [[b]]); + // CHECK: [[ltp:_.*]] = Lt(copy [[a]], copy [[b]]); // CHECK: opaque::<bool>(move [[ltp]]) opaque(a < b); - // CHECK: [[lep:_.*]] = Le([[a]], [[b]]); + // CHECK: [[lep:_.*]] = Le(copy [[a]], copy [[b]]); // CHECK: opaque::<bool>(move [[lep]]) opaque(a <= b); - // CHECK: [[gtp:_.*]] = Gt([[a]], [[b]]); + // CHECK: [[gtp:_.*]] = Gt(copy [[a]], copy [[b]]); // CHECK: opaque::<bool>(move [[gtp]]) opaque(a > b); - // CHECK: [[gep:_.*]] = Ge([[a]], [[b]]); + // CHECK: [[gep:_.*]] = Ge(copy [[a]], copy [[b]]); // CHECK: opaque::<bool>(move [[gep]]) opaque(a >= b); } @@ -684,22 +683,22 @@ fn wide_ptr_same_provenance() { let a: *const dyn Send = &slice[0] as &dyn Send; let b: *const dyn Send = &slice[1] as &dyn Send; - // CHECK: [[eqp:_.*]] = Eq([[a:_.*]], [[b:_.*]]); + // CHECK: [[eqp:_.*]] = Eq(copy [[a:_.*]], copy [[b:_.*]]); // CHECK: opaque::<bool>(move [[eqp]]) opaque(a == b); - // CHECK: [[nep:_.*]] = Ne([[a]], [[b]]); + // CHECK: [[nep:_.*]] = Ne(copy [[a]], copy [[b]]); // CHECK: opaque::<bool>(move [[nep]]) opaque(a != b); - // CHECK: [[ltp:_.*]] = Lt([[a]], [[b]]); + // CHECK: [[ltp:_.*]] = Lt(copy [[a]], copy [[b]]); // CHECK: opaque::<bool>(move [[ltp]]) opaque(a < b); - // CHECK: [[lep:_.*]] = Le([[a]], [[b]]); + // CHECK: [[lep:_.*]] = Le(copy [[a]], copy [[b]]); // CHECK: opaque::<bool>(move [[lep]]) opaque(a <= b); - // CHECK: [[gtp:_.*]] = Gt([[a]], [[b]]); + // CHECK: [[gtp:_.*]] = Gt(copy [[a]], copy [[b]]); // CHECK: opaque::<bool>(move [[gtp]]) opaque(a > b); - // CHECK: [[gep:_.*]] = Ge([[a]], [[b]]); + // CHECK: [[gep:_.*]] = Ge(copy [[a]], copy [[b]]); // CHECK: opaque::<bool>(move [[gep]]) opaque(a >= b); } @@ -731,13 +730,13 @@ fn wide_ptr_integer() { fn borrowed<T: Copy + Freeze>(x: T) { // CHECK-LABEL: fn borrowed( // CHECK: bb0: { - // CHECK-NEXT: _2 = _1; + // CHECK-NEXT: _2 = copy _1; // CHECK-NEXT: _3 = &_1; - // CHECK-NEXT: _0 = opaque::<&T>(_3) + // CHECK-NEXT: _0 = opaque::<&T>(copy _3) // CHECK: bb1: { - // CHECK-NEXT: _0 = opaque::<T>(_1) + // CHECK-NEXT: _0 = opaque::<T>(copy _1) // CHECK: bb2: { - // CHECK-NEXT: _0 = opaque::<T>(_1) + // CHECK-NEXT: _0 = opaque::<T>(copy _1) mir! { { let a = x; @@ -761,13 +760,13 @@ fn borrowed<T: Copy + Freeze>(x: T) { fn non_freeze<T: Copy>(x: T) { // CHECK-LABEL: fn non_freeze( // CHECK: bb0: { - // CHECK-NEXT: _2 = _1; + // CHECK-NEXT: _2 = copy _1; // CHECK-NEXT: _3 = &_1; - // CHECK-NEXT: _0 = opaque::<&T>(_3) + // CHECK-NEXT: _0 = opaque::<&T>(copy _3) // CHECK: bb1: { - // CHECK-NEXT: _0 = opaque::<T>(_2) + // CHECK-NEXT: _0 = opaque::<T>(copy _2) // CHECK: bb2: { - // CHECK-NEXT: _0 = opaque::<T>((*_3)) + // CHECK-NEXT: _0 = opaque::<T>(copy (*_3)) mir! { { let a = x; @@ -789,7 +788,7 @@ fn non_freeze<T: Copy>(x: T) { // Check that we can const-prop into `from_raw_parts` fn slice_const_length(x: &[i32]) -> *const [i32] { // CHECK-LABEL: fn slice_const_length( - // CHECK: _0 = *const [i32] from ({{_[0-9]+}}, const 123_usize); + // CHECK: _0 = *const [i32] from (copy {{_[0-9]+}}, const 123_usize); let ptr = x.as_ptr(); let len = 123; std::intrinsics::aggregate_raw_ptr(ptr, len) @@ -804,15 +803,15 @@ fn meta_of_ref_to_slice(x: *const i32) -> usize { fn slice_from_raw_parts_as_ptr(x: *const u16, n: usize) -> (*const u16, *const f32) { // CHECK-LABEL: fn slice_from_raw_parts_as_ptr - // CHECK: _8 = _1 as *const f32 (PtrToPtr); - // CHECK: _0 = (_1, move _8); + // CHECK: _8 = copy _1 as *const f32 (PtrToPtr); + // CHECK: _0 = (copy _1, move _8); let ptr: *const [u16] = std::intrinsics::aggregate_raw_ptr(x, n); (ptr as *const u16, ptr as *const f32) } fn casts_before_aggregate_raw_ptr(x: *const u32) -> *const [u8] { // CHECK-LABEL: fn casts_before_aggregate_raw_ptr - // CHECK: _0 = *const [u8] from (_1, const 4_usize); + // CHECK: _0 = *const [u8] from (copy _1, const 4_usize); let x = x as *const [u8; 4]; let x = x as *const u8; let x = x as *const (); @@ -821,7 +820,7 @@ fn casts_before_aggregate_raw_ptr(x: *const u32) -> *const [u8] { fn manual_slice_mut_len(x: &mut [i32]) -> usize { // CHECK-LABEL: fn manual_slice_mut_len - // CHECK: _0 = PtrMetadata(_1); + // CHECK: _0 = PtrMetadata(copy _1); let x: *mut [i32] = x; let x: *const [i32] = x; std::intrinsics::ptr_metadata(x) @@ -844,38 +843,38 @@ fn generic_cast_metadata<T, A: ?Sized, B: ?Sized>(ps: *const [T], pa: *const A, // when the pointee metadata do or don't match, respectively. // Metadata usize -> (), do not optimize. - // CHECK: [[T:_.+]] = _1 as - // CHECK-NEXT: PtrMetadata([[T]]) + // CHECK: [[T:_.+]] = copy _1 as + // CHECK-NEXT: PtrMetadata(copy [[T]]) let t1 = CastPtrToPtr::<_, *const T>(ps); let m1 = PtrMetadata(t1); // `(&A, [T])` has `usize` metadata, same as `[T]`, yes optimize. - // CHECK: [[T:_.+]] = _1 as - // CHECK-NEXT: PtrMetadata(_1) + // CHECK: [[T:_.+]] = copy _1 as + // CHECK-NEXT: PtrMetadata(copy _1) let t2 = CastPtrToPtr::<_, *const (&A, [T])>(ps); let m2 = PtrMetadata(t2); // Tail `A` and tail `B`, do not optimize. - // CHECK: [[T:_.+]] = _2 as - // CHECK-NEXT: PtrMetadata([[T]]) + // CHECK: [[T:_.+]] = copy _2 as + // CHECK-NEXT: PtrMetadata(copy [[T]]) let t3 = CastPtrToPtr::<_, *const (T, B)>(pa); let m3 = PtrMetadata(t3); // Both have tail `A`, yes optimize. - // CHECK: [[T:_.+]] = _2 as - // CHECK-NEXT: PtrMetadata(_2) + // CHECK: [[T:_.+]] = copy _2 as + // CHECK-NEXT: PtrMetadata(copy _2) let t4 = CastPtrToPtr::<_, *const (T, A)>(pa); let m4 = PtrMetadata(t4); // Tail `B` and tail `A`, do not optimize. - // CHECK: [[T:_.+]] = _3 as - // CHECK-NEXT: PtrMetadata([[T]]) + // CHECK: [[T:_.+]] = copy _3 as + // CHECK-NEXT: PtrMetadata(copy [[T]]) let t5 = CastPtrToPtr::<_, *mut A>(pb); let m5 = PtrMetadata(t5); // Both have tail `B`, yes optimize. - // CHECK: [[T:_.+]] = _3 as - // CHECK-NEXT: PtrMetadata(_3) + // CHECK: [[T:_.+]] = copy _3 as + // CHECK-NEXT: PtrMetadata(copy _3) let t6 = CastPtrToPtr::<_, *mut B>(pb); let m6 = PtrMetadata(t6); @@ -891,21 +890,21 @@ fn cast_pointer_eq(p1: *mut u8, p2: *mut u32, p3: *mut u32, p4: *mut [u32]) { // CHECK: debug p3 => [[P3:_3]]; // CHECK: debug p4 => [[P4:_4]]; - // CHECK: [[M1:_.+]] = [[P1]] as *const u32 (PtrToPtr); - // CHECK: [[M2:_.+]] = [[P2]] as *const u32 (PtrToPtr); - // CHECK: [[M3:_.+]] = [[P3]] as *const u32 (PtrToPtr); - // CHECK: [[M4:_.+]] = [[P4]] as *const u32 (PtrToPtr); + // CHECK: [[M1:_.+]] = copy [[P1]] as *const u32 (PtrToPtr); + // CHECK: [[M2:_.+]] = copy [[P2]] as *const u32 (PtrToPtr); + // CHECK: [[M3:_.+]] = copy [[P3]] as *const u32 (PtrToPtr); + // CHECK: [[M4:_.+]] = copy [[P4]] as *const u32 (PtrToPtr); let m1 = p1 as *const u32; let m2 = p2 as *const u32; let m3 = p3 as *const u32; let m4 = p4 as *const u32; // CHECK-NOT: Eq - // CHECK: Eq([[M1]], [[M2]]) + // CHECK: Eq(copy [[M1]], copy [[M2]]) // CHECK-NOT: Eq - // CHECK: Eq([[P2]], [[P3]]) + // CHECK: Eq(copy [[P2]], copy [[P3]]) // CHECK-NOT: Eq - // CHECK: Eq([[M3]], [[M4]]) + // CHECK: Eq(copy [[M3]], copy [[M4]]) // CHECK-NOT: Eq let eq_different_thing = m1 == m2; let eq_optimize = m2 == m3; @@ -918,11 +917,11 @@ fn cast_pointer_eq(p1: *mut u8, p2: *mut u32, p3: *mut u32, p4: *mut [u32]) { unsafe fn cast_pointer_then_transmute(thin: *mut u32, fat: *mut [u8]) { // CHECK-LABEL: fn cast_pointer_then_transmute - // CHECK: [[UNUSED:_.+]] = _1 as *const () (PtrToPtr); - // CHECK: = _1 as usize (Transmute); + // CHECK: [[UNUSED:_.+]] = copy _1 as *const () (PtrToPtr); + // CHECK: = copy _1 as usize (Transmute); let thin_addr: usize = std::intrinsics::transmute(thin as *const ()); - // CHECK: [[TEMP2:_.+]] = _2 as *const () (PtrToPtr); + // CHECK: [[TEMP2:_.+]] = copy _2 as *const () (PtrToPtr); // CHECK: = move [[TEMP2]] as usize (Transmute); let fat_addr: usize = std::intrinsics::transmute(fat as *const ()); } @@ -935,11 +934,11 @@ fn remove_casts_must_change_both_sides(mut_a: &*mut u8, mut_b: *mut u8) -> bool // to be locals, so make sure we don't change one without the other, as // that would be a type error. { - // CHECK: [[A:_.+]] = (*_1) as *const u8 (PtrToPtr); + // CHECK: [[A:_.+]] = copy (*_1) as *const u8 (PtrToPtr); let a = *mut_a as *const u8; - // CHECK: [[B:_.+]] = _2 as *const u8 (PtrToPtr); + // CHECK: [[B:_.+]] = copy _2 as *const u8 (PtrToPtr); let b = mut_b as *const u8; - // CHECK: _0 = Eq([[A]], [[B]]); + // CHECK: _0 = Eq(copy [[A]], copy [[B]]); RET = a == b; Return() } diff --git a/tests/mir-opt/gvn.slice_const_length.GVN.panic-abort.diff b/tests/mir-opt/gvn.slice_const_length.GVN.panic-abort.diff index fd5fa035d81..1a6204e4ac8 100644 --- a/tests/mir-opt/gvn.slice_const_length.GVN.panic-abort.diff +++ b/tests/mir-opt/gvn.slice_const_length.GVN.panic-abort.diff @@ -30,12 +30,12 @@ + nop; _4 = const 123_usize; StorageLive(_5); - _5 = _2; + _5 = copy _2; StorageLive(_6); -- _6 = _4; +- _6 = copy _4; - _0 = *const [i32] from (move _5, move _6); + _6 = const 123_usize; -+ _0 = *const [i32] from (_2, const 123_usize); ++ _0 = *const [i32] from (copy _2, const 123_usize); StorageDead(_6); StorageDead(_5); - StorageDead(_4); diff --git a/tests/mir-opt/gvn.slice_const_length.GVN.panic-unwind.diff b/tests/mir-opt/gvn.slice_const_length.GVN.panic-unwind.diff index 98945cf9724..62d57b0fe28 100644 --- a/tests/mir-opt/gvn.slice_const_length.GVN.panic-unwind.diff +++ b/tests/mir-opt/gvn.slice_const_length.GVN.panic-unwind.diff @@ -30,12 +30,12 @@ + nop; _4 = const 123_usize; StorageLive(_5); - _5 = _2; + _5 = copy _2; StorageLive(_6); -- _6 = _4; +- _6 = copy _4; - _0 = *const [i32] from (move _5, move _6); + _6 = const 123_usize; -+ _0 = *const [i32] from (_2, const 123_usize); ++ _0 = *const [i32] from (copy _2, const 123_usize); StorageDead(_6); StorageDead(_5); - StorageDead(_4); diff --git a/tests/mir-opt/gvn.slice_from_raw_parts_as_ptr.GVN.panic-abort.diff b/tests/mir-opt/gvn.slice_from_raw_parts_as_ptr.GVN.panic-abort.diff index 75bcd2a8d72..4a2cc251891 100644 --- a/tests/mir-opt/gvn.slice_from_raw_parts_as_ptr.GVN.panic-abort.diff +++ b/tests/mir-opt/gvn.slice_from_raw_parts_as_ptr.GVN.panic-abort.diff @@ -20,27 +20,27 @@ - StorageLive(_3); + nop; StorageLive(_4); - _4 = _1; + _4 = copy _1; StorageLive(_5); - _5 = _2; + _5 = copy _2; - _3 = *const [u16] from (move _4, move _5); -+ _3 = *const [u16] from (_1, _2); ++ _3 = *const [u16] from (copy _1, copy _2); StorageDead(_5); StorageDead(_4); StorageLive(_6); StorageLive(_7); - _7 = _3; + _7 = copy _3; - _6 = move _7 as *const u16 (PtrToPtr); -+ _6 = _1; ++ _6 = copy _1; StorageDead(_7); StorageLive(_8); StorageLive(_9); - _9 = _3; + _9 = copy _3; - _8 = move _9 as *const f32 (PtrToPtr); -+ _8 = _1 as *const f32 (PtrToPtr); ++ _8 = copy _1 as *const f32 (PtrToPtr); StorageDead(_9); - _0 = (move _6, move _8); -+ _0 = (_1, move _8); ++ _0 = (copy _1, move _8); StorageDead(_8); StorageDead(_6); - StorageDead(_3); diff --git a/tests/mir-opt/gvn.slice_from_raw_parts_as_ptr.GVN.panic-unwind.diff b/tests/mir-opt/gvn.slice_from_raw_parts_as_ptr.GVN.panic-unwind.diff index 75bcd2a8d72..4a2cc251891 100644 --- a/tests/mir-opt/gvn.slice_from_raw_parts_as_ptr.GVN.panic-unwind.diff +++ b/tests/mir-opt/gvn.slice_from_raw_parts_as_ptr.GVN.panic-unwind.diff @@ -20,27 +20,27 @@ - StorageLive(_3); + nop; StorageLive(_4); - _4 = _1; + _4 = copy _1; StorageLive(_5); - _5 = _2; + _5 = copy _2; - _3 = *const [u16] from (move _4, move _5); -+ _3 = *const [u16] from (_1, _2); ++ _3 = *const [u16] from (copy _1, copy _2); StorageDead(_5); StorageDead(_4); StorageLive(_6); StorageLive(_7); - _7 = _3; + _7 = copy _3; - _6 = move _7 as *const u16 (PtrToPtr); -+ _6 = _1; ++ _6 = copy _1; StorageDead(_7); StorageLive(_8); StorageLive(_9); - _9 = _3; + _9 = copy _3; - _8 = move _9 as *const f32 (PtrToPtr); -+ _8 = _1 as *const f32 (PtrToPtr); ++ _8 = copy _1 as *const f32 (PtrToPtr); StorageDead(_9); - _0 = (move _6, move _8); -+ _0 = (_1, move _8); ++ _0 = (copy _1, move _8); StorageDead(_8); StorageDead(_6); - StorageDead(_3); diff --git a/tests/mir-opt/gvn.slices.GVN.panic-abort.diff b/tests/mir-opt/gvn.slices.GVN.panic-abort.diff index fb67e3d5994..e8e99b44e72 100644 --- a/tests/mir-opt/gvn.slices.GVN.panic-abort.diff +++ b/tests/mir-opt/gvn.slices.GVN.panic-abort.diff @@ -87,22 +87,22 @@ _1 = const "my favourite slice"; StorageLive(_2); StorageLive(_3); - _3 = _1; + _3 = copy _1; - _2 = opaque::<&str>(move _3) -> [return: bb1, unwind unreachable]; -+ _2 = opaque::<&str>(_1) -> [return: bb1, unwind unreachable]; ++ _2 = opaque::<&str>(copy _1) -> [return: bb1, unwind unreachable]; } bb1: { StorageDead(_3); StorageDead(_2); StorageLive(_4); - _4 = _1; + _4 = copy _1; StorageLive(_5); StorageLive(_6); -- _6 = _4; +- _6 = copy _4; - _5 = opaque::<&str>(move _6) -> [return: bb2, unwind unreachable]; -+ _6 = _1; -+ _5 = opaque::<&str>(_1) -> [return: bb2, unwind unreachable]; ++ _6 = copy _1; ++ _5 = opaque::<&str>(copy _1) -> [return: bb2, unwind unreachable]; } bb2: { @@ -138,24 +138,24 @@ - _8 = (move _9, move _12); - StorageDead(_12); - StorageDead(_9); -+ _8 = (_9, _12); ++ _8 = (copy _9, copy _12); + nop; + nop; StorageLive(_15); -- _15 = (_8.0: &*const u8); -+ _15 = _9; +- _15 = copy (_8.0: &*const u8); ++ _15 = copy _9; StorageLive(_16); -- _16 = (_8.1: &*const u8); -+ _16 = _12; +- _16 = copy (_8.1: &*const u8); ++ _16 = copy _12; StorageLive(_17); StorageLive(_18); -- _18 = (*_15); -+ _18 = _10; +- _18 = copy (*_15); ++ _18 = copy _10; StorageLive(_19); -- _19 = (*_16); +- _19 = copy (*_16); - _17 = Eq(move _18, move _19); -+ _19 = _13; -+ _17 = Eq(_10, _13); ++ _19 = copy _13; ++ _17 = Eq(copy _10, copy _13); switchInt(move _17) -> [0: bb6, otherwise: bb5]; } @@ -180,9 +180,9 @@ StorageDead(_30); StorageLive(_31); StorageLive(_32); - _32 = _29; + _32 = copy _29; - _31 = opaque::<&[u8]>(move _32) -> [return: bb7, unwind unreachable]; -+ _31 = opaque::<&[u8]>(_29) -> [return: bb7, unwind unreachable]; ++ _31 = opaque::<&[u8]>(copy _29) -> [return: bb7, unwind unreachable]; } bb6: { @@ -244,24 +244,24 @@ - _34 = (move _35, move _38); - StorageDead(_38); - StorageDead(_35); -+ _34 = (_35, _38); ++ _34 = (copy _35, copy _38); + nop; + nop; StorageLive(_41); -- _41 = (_34.0: &*const u8); -+ _41 = _35; +- _41 = copy (_34.0: &*const u8); ++ _41 = copy _35; StorageLive(_42); -- _42 = (_34.1: &*const u8); -+ _42 = _38; +- _42 = copy (_34.1: &*const u8); ++ _42 = copy _38; StorageLive(_43); StorageLive(_44); -- _44 = (*_41); -+ _44 = _36; +- _44 = copy (*_41); ++ _44 = copy _36; StorageLive(_45); -- _45 = (*_42); +- _45 = copy (*_42); - _43 = Eq(move _44, move _45); -+ _45 = _39; -+ _43 = Eq(_36, _39); ++ _45 = copy _39; ++ _43 = Eq(copy _36, copy _39); switchInt(move _43) -> [0: bb11, otherwise: bb10]; } diff --git a/tests/mir-opt/gvn.slices.GVN.panic-unwind.diff b/tests/mir-opt/gvn.slices.GVN.panic-unwind.diff index ae3013b011e..4296d4d4a59 100644 --- a/tests/mir-opt/gvn.slices.GVN.panic-unwind.diff +++ b/tests/mir-opt/gvn.slices.GVN.panic-unwind.diff @@ -87,22 +87,22 @@ _1 = const "my favourite slice"; StorageLive(_2); StorageLive(_3); - _3 = _1; + _3 = copy _1; - _2 = opaque::<&str>(move _3) -> [return: bb1, unwind continue]; -+ _2 = opaque::<&str>(_1) -> [return: bb1, unwind continue]; ++ _2 = opaque::<&str>(copy _1) -> [return: bb1, unwind continue]; } bb1: { StorageDead(_3); StorageDead(_2); StorageLive(_4); - _4 = _1; + _4 = copy _1; StorageLive(_5); StorageLive(_6); -- _6 = _4; +- _6 = copy _4; - _5 = opaque::<&str>(move _6) -> [return: bb2, unwind continue]; -+ _6 = _1; -+ _5 = opaque::<&str>(_1) -> [return: bb2, unwind continue]; ++ _6 = copy _1; ++ _5 = opaque::<&str>(copy _1) -> [return: bb2, unwind continue]; } bb2: { @@ -138,24 +138,24 @@ - _8 = (move _9, move _12); - StorageDead(_12); - StorageDead(_9); -+ _8 = (_9, _12); ++ _8 = (copy _9, copy _12); + nop; + nop; StorageLive(_15); -- _15 = (_8.0: &*const u8); -+ _15 = _9; +- _15 = copy (_8.0: &*const u8); ++ _15 = copy _9; StorageLive(_16); -- _16 = (_8.1: &*const u8); -+ _16 = _12; +- _16 = copy (_8.1: &*const u8); ++ _16 = copy _12; StorageLive(_17); StorageLive(_18); -- _18 = (*_15); -+ _18 = _10; +- _18 = copy (*_15); ++ _18 = copy _10; StorageLive(_19); -- _19 = (*_16); +- _19 = copy (*_16); - _17 = Eq(move _18, move _19); -+ _19 = _13; -+ _17 = Eq(_10, _13); ++ _19 = copy _13; ++ _17 = Eq(copy _10, copy _13); switchInt(move _17) -> [0: bb6, otherwise: bb5]; } @@ -180,9 +180,9 @@ StorageDead(_30); StorageLive(_31); StorageLive(_32); - _32 = _29; + _32 = copy _29; - _31 = opaque::<&[u8]>(move _32) -> [return: bb7, unwind continue]; -+ _31 = opaque::<&[u8]>(_29) -> [return: bb7, unwind continue]; ++ _31 = opaque::<&[u8]>(copy _29) -> [return: bb7, unwind continue]; } bb6: { @@ -244,24 +244,24 @@ - _34 = (move _35, move _38); - StorageDead(_38); - StorageDead(_35); -+ _34 = (_35, _38); ++ _34 = (copy _35, copy _38); + nop; + nop; StorageLive(_41); -- _41 = (_34.0: &*const u8); -+ _41 = _35; +- _41 = copy (_34.0: &*const u8); ++ _41 = copy _35; StorageLive(_42); -- _42 = (_34.1: &*const u8); -+ _42 = _38; +- _42 = copy (_34.1: &*const u8); ++ _42 = copy _38; StorageLive(_43); StorageLive(_44); -- _44 = (*_41); -+ _44 = _36; +- _44 = copy (*_41); ++ _44 = copy _36; StorageLive(_45); -- _45 = (*_42); +- _45 = copy (*_42); - _43 = Eq(move _44, move _45); -+ _45 = _39; -+ _43 = Eq(_36, _39); ++ _45 = copy _39; ++ _43 = Eq(copy _36, copy _39); switchInt(move _43) -> [0: bb11, otherwise: bb10]; } diff --git a/tests/mir-opt/gvn.subexpression_elimination.GVN.panic-abort.diff b/tests/mir-opt/gvn.subexpression_elimination.GVN.panic-abort.diff index ba9e507560d..7a479bc55da 100644 --- a/tests/mir-opt/gvn.subexpression_elimination.GVN.panic-abort.diff +++ b/tests/mir-opt/gvn.subexpression_elimination.GVN.panic-abort.diff @@ -195,15 +195,15 @@ - StorageLive(_5); + nop; StorageLive(_6); - _6 = _1; + _6 = copy _1; StorageLive(_7); - _7 = _2; + _7 = copy _2; - _5 = Add(move _6, move _7); -+ _5 = Add(_1, _2); ++ _5 = Add(copy _1, copy _2); StorageDead(_7); StorageDead(_6); - _4 = opaque::<u64>(move _5) -> [return: bb1, unwind unreachable]; -+ _4 = opaque::<u64>(_5) -> [return: bb1, unwind unreachable]; ++ _4 = opaque::<u64>(copy _5) -> [return: bb1, unwind unreachable]; } bb1: { @@ -214,15 +214,15 @@ - StorageLive(_9); + nop; StorageLive(_10); - _10 = _1; + _10 = copy _1; StorageLive(_11); - _11 = _2; + _11 = copy _2; - _9 = Mul(move _10, move _11); -+ _9 = Mul(_1, _2); ++ _9 = Mul(copy _1, copy _2); StorageDead(_11); StorageDead(_10); - _8 = opaque::<u64>(move _9) -> [return: bb2, unwind unreachable]; -+ _8 = opaque::<u64>(_9) -> [return: bb2, unwind unreachable]; ++ _8 = opaque::<u64>(copy _9) -> [return: bb2, unwind unreachable]; } bb2: { @@ -233,15 +233,15 @@ - StorageLive(_13); + nop; StorageLive(_14); - _14 = _1; + _14 = copy _1; StorageLive(_15); - _15 = _2; + _15 = copy _2; - _13 = Sub(move _14, move _15); -+ _13 = Sub(_1, _2); ++ _13 = Sub(copy _1, copy _2); StorageDead(_15); StorageDead(_14); - _12 = opaque::<u64>(move _13) -> [return: bb3, unwind unreachable]; -+ _12 = opaque::<u64>(_13) -> [return: bb3, unwind unreachable]; ++ _12 = opaque::<u64>(copy _13) -> [return: bb3, unwind unreachable]; } bb3: { @@ -252,22 +252,22 @@ - StorageLive(_17); + nop; StorageLive(_18); - _18 = _1; + _18 = copy _1; StorageLive(_19); - _19 = _2; -- _20 = Eq(_19, const 0_u64); -- assert(!move _20, "attempt to divide `{}` by zero", _18) -> [success: bb4, unwind unreachable]; -+ _20 = Eq(_2, const 0_u64); -+ assert(!_20, "attempt to divide `{}` by zero", _1) -> [success: bb4, unwind unreachable]; + _19 = copy _2; +- _20 = Eq(copy _19, const 0_u64); +- assert(!move _20, "attempt to divide `{}` by zero", copy _18) -> [success: bb4, unwind unreachable]; ++ _20 = Eq(copy _2, const 0_u64); ++ assert(!copy _20, "attempt to divide `{}` by zero", copy _1) -> [success: bb4, unwind unreachable]; } bb4: { - _17 = Div(move _18, move _19); -+ _17 = Div(_1, _2); ++ _17 = Div(copy _1, copy _2); StorageDead(_19); StorageDead(_18); - _16 = opaque::<u64>(move _17) -> [return: bb5, unwind unreachable]; -+ _16 = opaque::<u64>(_17) -> [return: bb5, unwind unreachable]; ++ _16 = opaque::<u64>(copy _17) -> [return: bb5, unwind unreachable]; } bb5: { @@ -278,22 +278,22 @@ - StorageLive(_22); + nop; StorageLive(_23); - _23 = _1; + _23 = copy _1; StorageLive(_24); - _24 = _2; -- _25 = Eq(_24, const 0_u64); -- assert(!move _25, "attempt to calculate the remainder of `{}` with a divisor of zero", _23) -> [success: bb6, unwind unreachable]; -+ _25 = _20; -+ assert(!_20, "attempt to calculate the remainder of `{}` with a divisor of zero", _1) -> [success: bb6, unwind unreachable]; + _24 = copy _2; +- _25 = Eq(copy _24, const 0_u64); +- assert(!move _25, "attempt to calculate the remainder of `{}` with a divisor of zero", copy _23) -> [success: bb6, unwind unreachable]; ++ _25 = copy _20; ++ assert(!copy _20, "attempt to calculate the remainder of `{}` with a divisor of zero", copy _1) -> [success: bb6, unwind unreachable]; } bb6: { - _22 = Rem(move _23, move _24); -+ _22 = Rem(_1, _2); ++ _22 = Rem(copy _1, copy _2); StorageDead(_24); StorageDead(_23); - _21 = opaque::<u64>(move _22) -> [return: bb7, unwind unreachable]; -+ _21 = opaque::<u64>(_22) -> [return: bb7, unwind unreachable]; ++ _21 = opaque::<u64>(copy _22) -> [return: bb7, unwind unreachable]; } bb7: { @@ -304,15 +304,15 @@ - StorageLive(_27); + nop; StorageLive(_28); - _28 = _1; + _28 = copy _1; StorageLive(_29); - _29 = _2; + _29 = copy _2; - _27 = BitAnd(move _28, move _29); -+ _27 = BitAnd(_1, _2); ++ _27 = BitAnd(copy _1, copy _2); StorageDead(_29); StorageDead(_28); - _26 = opaque::<u64>(move _27) -> [return: bb8, unwind unreachable]; -+ _26 = opaque::<u64>(_27) -> [return: bb8, unwind unreachable]; ++ _26 = opaque::<u64>(copy _27) -> [return: bb8, unwind unreachable]; } bb8: { @@ -323,15 +323,15 @@ - StorageLive(_31); + nop; StorageLive(_32); - _32 = _1; + _32 = copy _1; StorageLive(_33); - _33 = _2; + _33 = copy _2; - _31 = BitOr(move _32, move _33); -+ _31 = BitOr(_1, _2); ++ _31 = BitOr(copy _1, copy _2); StorageDead(_33); StorageDead(_32); - _30 = opaque::<u64>(move _31) -> [return: bb9, unwind unreachable]; -+ _30 = opaque::<u64>(_31) -> [return: bb9, unwind unreachable]; ++ _30 = opaque::<u64>(copy _31) -> [return: bb9, unwind unreachable]; } bb9: { @@ -342,15 +342,15 @@ - StorageLive(_35); + nop; StorageLive(_36); - _36 = _1; + _36 = copy _1; StorageLive(_37); - _37 = _2; + _37 = copy _2; - _35 = BitXor(move _36, move _37); -+ _35 = BitXor(_1, _2); ++ _35 = BitXor(copy _1, copy _2); StorageDead(_37); StorageDead(_36); - _34 = opaque::<u64>(move _35) -> [return: bb10, unwind unreachable]; -+ _34 = opaque::<u64>(_35) -> [return: bb10, unwind unreachable]; ++ _34 = opaque::<u64>(copy _35) -> [return: bb10, unwind unreachable]; } bb10: { @@ -361,15 +361,15 @@ - StorageLive(_39); + nop; StorageLive(_40); - _40 = _1; + _40 = copy _1; StorageLive(_41); - _41 = _2; + _41 = copy _2; - _39 = Shl(move _40, move _41); -+ _39 = Shl(_1, _2); ++ _39 = Shl(copy _1, copy _2); StorageDead(_41); StorageDead(_40); - _38 = opaque::<u64>(move _39) -> [return: bb11, unwind unreachable]; -+ _38 = opaque::<u64>(_39) -> [return: bb11, unwind unreachable]; ++ _38 = opaque::<u64>(copy _39) -> [return: bb11, unwind unreachable]; } bb11: { @@ -380,15 +380,15 @@ - StorageLive(_43); + nop; StorageLive(_44); - _44 = _1; + _44 = copy _1; StorageLive(_45); - _45 = _2; + _45 = copy _2; - _43 = Shr(move _44, move _45); -+ _43 = Shr(_1, _2); ++ _43 = Shr(copy _1, copy _2); StorageDead(_45); StorageDead(_44); - _42 = opaque::<u64>(move _43) -> [return: bb12, unwind unreachable]; -+ _42 = opaque::<u64>(_43) -> [return: bb12, unwind unreachable]; ++ _42 = opaque::<u64>(copy _43) -> [return: bb12, unwind unreachable]; } bb12: { @@ -399,12 +399,12 @@ - StorageLive(_47); + nop; StorageLive(_48); - _48 = _1; + _48 = copy _1; - _47 = move _48 as u32 (IntToInt); -+ _47 = _1 as u32 (IntToInt); ++ _47 = copy _1 as u32 (IntToInt); StorageDead(_48); - _46 = opaque::<u32>(move _47) -> [return: bb13, unwind unreachable]; -+ _46 = opaque::<u32>(_47) -> [return: bb13, unwind unreachable]; ++ _46 = opaque::<u32>(copy _47) -> [return: bb13, unwind unreachable]; } bb13: { @@ -415,12 +415,12 @@ - StorageLive(_50); + nop; StorageLive(_51); - _51 = _1; + _51 = copy _1; - _50 = move _51 as f32 (IntToFloat); -+ _50 = _1 as f32 (IntToFloat); ++ _50 = copy _1 as f32 (IntToFloat); StorageDead(_51); - _49 = opaque::<f32>(move _50) -> [return: bb14, unwind unreachable]; -+ _49 = opaque::<f32>(_50) -> [return: bb14, unwind unreachable]; ++ _49 = opaque::<f32>(copy _50) -> [return: bb14, unwind unreachable]; } bb14: { @@ -431,12 +431,12 @@ - StorageLive(_53); + nop; StorageLive(_54); - _54 = _1; + _54 = copy _1; - _53 = S::<u64>(move _54); -+ _53 = S::<u64>(_1); ++ _53 = S::<u64>(copy _1); StorageDead(_54); - _52 = opaque::<S<u64>>(move _53) -> [return: bb15, unwind unreachable]; -+ _52 = opaque::<S<u64>>(_53) -> [return: bb15, unwind unreachable]; ++ _52 = opaque::<S<u64>>(copy _53) -> [return: bb15, unwind unreachable]; } bb15: { @@ -447,14 +447,14 @@ StorageLive(_56); StorageLive(_57); StorageLive(_58); - _58 = _1; + _58 = copy _1; - _57 = S::<u64>(move _58); -+ _57 = _53; ++ _57 = copy _53; StorageDead(_58); -- _56 = (_57.0: u64); +- _56 = copy (_57.0: u64); - _55 = opaque::<u64>(move _56) -> [return: bb16, unwind unreachable]; -+ _56 = _1; -+ _55 = opaque::<u64>(_1) -> [return: bb16, unwind unreachable]; ++ _56 = copy _1; ++ _55 = opaque::<u64>(copy _1) -> [return: bb16, unwind unreachable]; } bb16: { @@ -464,15 +464,15 @@ StorageLive(_59); StorageLive(_60); StorageLive(_61); - _61 = _1; + _61 = copy _1; StorageLive(_62); - _62 = _2; + _62 = copy _2; - _60 = Add(move _61, move _62); -+ _60 = _5; ++ _60 = copy _5; StorageDead(_62); StorageDead(_61); - _59 = opaque::<u64>(move _60) -> [return: bb17, unwind unreachable]; -+ _59 = opaque::<u64>(_5) -> [return: bb17, unwind unreachable]; ++ _59 = opaque::<u64>(copy _5) -> [return: bb17, unwind unreachable]; } bb17: { @@ -481,15 +481,15 @@ StorageLive(_63); StorageLive(_64); StorageLive(_65); - _65 = _1; + _65 = copy _1; StorageLive(_66); - _66 = _2; + _66 = copy _2; - _64 = Mul(move _65, move _66); -+ _64 = _9; ++ _64 = copy _9; StorageDead(_66); StorageDead(_65); - _63 = opaque::<u64>(move _64) -> [return: bb18, unwind unreachable]; -+ _63 = opaque::<u64>(_9) -> [return: bb18, unwind unreachable]; ++ _63 = opaque::<u64>(copy _9) -> [return: bb18, unwind unreachable]; } bb18: { @@ -498,15 +498,15 @@ StorageLive(_67); StorageLive(_68); StorageLive(_69); - _69 = _1; + _69 = copy _1; StorageLive(_70); - _70 = _2; + _70 = copy _2; - _68 = Sub(move _69, move _70); -+ _68 = _13; ++ _68 = copy _13; StorageDead(_70); StorageDead(_69); - _67 = opaque::<u64>(move _68) -> [return: bb19, unwind unreachable]; -+ _67 = opaque::<u64>(_13) -> [return: bb19, unwind unreachable]; ++ _67 = opaque::<u64>(copy _13) -> [return: bb19, unwind unreachable]; } bb19: { @@ -515,22 +515,22 @@ StorageLive(_71); StorageLive(_72); StorageLive(_73); - _73 = _1; + _73 = copy _1; StorageLive(_74); - _74 = _2; -- _75 = Eq(_74, const 0_u64); -- assert(!move _75, "attempt to divide `{}` by zero", _73) -> [success: bb20, unwind unreachable]; -+ _75 = _20; -+ assert(!_20, "attempt to divide `{}` by zero", _1) -> [success: bb20, unwind unreachable]; + _74 = copy _2; +- _75 = Eq(copy _74, const 0_u64); +- assert(!move _75, "attempt to divide `{}` by zero", copy _73) -> [success: bb20, unwind unreachable]; ++ _75 = copy _20; ++ assert(!copy _20, "attempt to divide `{}` by zero", copy _1) -> [success: bb20, unwind unreachable]; } bb20: { - _72 = Div(move _73, move _74); -+ _72 = _17; ++ _72 = copy _17; StorageDead(_74); StorageDead(_73); - _71 = opaque::<u64>(move _72) -> [return: bb21, unwind unreachable]; -+ _71 = opaque::<u64>(_17) -> [return: bb21, unwind unreachable]; ++ _71 = opaque::<u64>(copy _17) -> [return: bb21, unwind unreachable]; } bb21: { @@ -539,22 +539,22 @@ StorageLive(_76); StorageLive(_77); StorageLive(_78); - _78 = _1; + _78 = copy _1; StorageLive(_79); - _79 = _2; -- _80 = Eq(_79, const 0_u64); -- assert(!move _80, "attempt to calculate the remainder of `{}` with a divisor of zero", _78) -> [success: bb22, unwind unreachable]; -+ _80 = _20; -+ assert(!_20, "attempt to calculate the remainder of `{}` with a divisor of zero", _1) -> [success: bb22, unwind unreachable]; + _79 = copy _2; +- _80 = Eq(copy _79, const 0_u64); +- assert(!move _80, "attempt to calculate the remainder of `{}` with a divisor of zero", copy _78) -> [success: bb22, unwind unreachable]; ++ _80 = copy _20; ++ assert(!copy _20, "attempt to calculate the remainder of `{}` with a divisor of zero", copy _1) -> [success: bb22, unwind unreachable]; } bb22: { - _77 = Rem(move _78, move _79); -+ _77 = _22; ++ _77 = copy _22; StorageDead(_79); StorageDead(_78); - _76 = opaque::<u64>(move _77) -> [return: bb23, unwind unreachable]; -+ _76 = opaque::<u64>(_22) -> [return: bb23, unwind unreachable]; ++ _76 = opaque::<u64>(copy _22) -> [return: bb23, unwind unreachable]; } bb23: { @@ -563,15 +563,15 @@ StorageLive(_81); StorageLive(_82); StorageLive(_83); - _83 = _1; + _83 = copy _1; StorageLive(_84); - _84 = _2; + _84 = copy _2; - _82 = BitAnd(move _83, move _84); -+ _82 = _27; ++ _82 = copy _27; StorageDead(_84); StorageDead(_83); - _81 = opaque::<u64>(move _82) -> [return: bb24, unwind unreachable]; -+ _81 = opaque::<u64>(_27) -> [return: bb24, unwind unreachable]; ++ _81 = opaque::<u64>(copy _27) -> [return: bb24, unwind unreachable]; } bb24: { @@ -580,15 +580,15 @@ StorageLive(_85); StorageLive(_86); StorageLive(_87); - _87 = _1; + _87 = copy _1; StorageLive(_88); - _88 = _2; + _88 = copy _2; - _86 = BitOr(move _87, move _88); -+ _86 = _31; ++ _86 = copy _31; StorageDead(_88); StorageDead(_87); - _85 = opaque::<u64>(move _86) -> [return: bb25, unwind unreachable]; -+ _85 = opaque::<u64>(_31) -> [return: bb25, unwind unreachable]; ++ _85 = opaque::<u64>(copy _31) -> [return: bb25, unwind unreachable]; } bb25: { @@ -597,15 +597,15 @@ StorageLive(_89); StorageLive(_90); StorageLive(_91); - _91 = _1; + _91 = copy _1; StorageLive(_92); - _92 = _2; + _92 = copy _2; - _90 = BitXor(move _91, move _92); -+ _90 = _35; ++ _90 = copy _35; StorageDead(_92); StorageDead(_91); - _89 = opaque::<u64>(move _90) -> [return: bb26, unwind unreachable]; -+ _89 = opaque::<u64>(_35) -> [return: bb26, unwind unreachable]; ++ _89 = opaque::<u64>(copy _35) -> [return: bb26, unwind unreachable]; } bb26: { @@ -614,15 +614,15 @@ StorageLive(_93); StorageLive(_94); StorageLive(_95); - _95 = _1; + _95 = copy _1; StorageLive(_96); - _96 = _2; + _96 = copy _2; - _94 = Shl(move _95, move _96); -+ _94 = _39; ++ _94 = copy _39; StorageDead(_96); StorageDead(_95); - _93 = opaque::<u64>(move _94) -> [return: bb27, unwind unreachable]; -+ _93 = opaque::<u64>(_39) -> [return: bb27, unwind unreachable]; ++ _93 = opaque::<u64>(copy _39) -> [return: bb27, unwind unreachable]; } bb27: { @@ -631,15 +631,15 @@ StorageLive(_97); StorageLive(_98); StorageLive(_99); - _99 = _1; + _99 = copy _1; StorageLive(_100); - _100 = _2; + _100 = copy _2; - _98 = Shr(move _99, move _100); -+ _98 = _43; ++ _98 = copy _43; StorageDead(_100); StorageDead(_99); - _97 = opaque::<u64>(move _98) -> [return: bb28, unwind unreachable]; -+ _97 = opaque::<u64>(_43) -> [return: bb28, unwind unreachable]; ++ _97 = opaque::<u64>(copy _43) -> [return: bb28, unwind unreachable]; } bb28: { @@ -648,12 +648,12 @@ StorageLive(_101); StorageLive(_102); StorageLive(_103); - _103 = _1; + _103 = copy _1; - _102 = move _103 as u32 (IntToInt); -+ _102 = _47; ++ _102 = copy _47; StorageDead(_103); - _101 = opaque::<u32>(move _102) -> [return: bb29, unwind unreachable]; -+ _101 = opaque::<u32>(_47) -> [return: bb29, unwind unreachable]; ++ _101 = opaque::<u32>(copy _47) -> [return: bb29, unwind unreachable]; } bb29: { @@ -662,12 +662,12 @@ StorageLive(_104); StorageLive(_105); StorageLive(_106); - _106 = _1; + _106 = copy _1; - _105 = move _106 as f32 (IntToFloat); -+ _105 = _50; ++ _105 = copy _50; StorageDead(_106); - _104 = opaque::<f32>(move _105) -> [return: bb30, unwind unreachable]; -+ _104 = opaque::<f32>(_50) -> [return: bb30, unwind unreachable]; ++ _104 = opaque::<f32>(copy _50) -> [return: bb30, unwind unreachable]; } bb30: { @@ -676,12 +676,12 @@ StorageLive(_107); StorageLive(_108); StorageLive(_109); - _109 = _1; + _109 = copy _1; - _108 = S::<u64>(move _109); -+ _108 = _53; ++ _108 = copy _53; StorageDead(_109); - _107 = opaque::<S<u64>>(move _108) -> [return: bb31, unwind unreachable]; -+ _107 = opaque::<S<u64>>(_53) -> [return: bb31, unwind unreachable]; ++ _107 = opaque::<S<u64>>(copy _53) -> [return: bb31, unwind unreachable]; } bb31: { @@ -691,14 +691,14 @@ StorageLive(_111); StorageLive(_112); StorageLive(_113); - _113 = _1; + _113 = copy _1; - _112 = S::<u64>(move _113); -+ _112 = _53; ++ _112 = copy _53; StorageDead(_113); -- _111 = (_112.0: u64); +- _111 = copy (_112.0: u64); - _110 = opaque::<u64>(move _111) -> [return: bb32, unwind unreachable]; -+ _111 = _1; -+ _110 = opaque::<u64>(_1) -> [return: bb32, unwind unreachable]; ++ _111 = copy _1; ++ _110 = opaque::<u64>(copy _1) -> [return: bb32, unwind unreachable]; } bb32: { @@ -710,21 +710,21 @@ + nop; StorageLive(_116); StorageLive(_117); - _117 = _1; + _117 = copy _1; StorageLive(_118); - _118 = _2; + _118 = copy _2; - _116 = Mul(move _117, move _118); -+ _116 = _9; ++ _116 = copy _9; StorageDead(_118); StorageDead(_117); StorageLive(_119); - _119 = _2; + _119 = copy _2; - _115 = Sub(move _116, move _119); -+ _115 = Sub(_9, _2); ++ _115 = Sub(copy _9, copy _2); StorageDead(_119); StorageDead(_116); - _114 = opaque::<u64>(move _115) -> [return: bb33, unwind unreachable]; -+ _114 = opaque::<u64>(_115) -> [return: bb33, unwind unreachable]; ++ _114 = opaque::<u64>(copy _115) -> [return: bb33, unwind unreachable]; } bb33: { @@ -735,21 +735,21 @@ StorageLive(_121); StorageLive(_122); StorageLive(_123); - _123 = _1; + _123 = copy _1; StorageLive(_124); - _124 = _2; + _124 = copy _2; - _122 = Mul(move _123, move _124); -+ _122 = _9; ++ _122 = copy _9; StorageDead(_124); StorageDead(_123); StorageLive(_125); - _125 = _2; + _125 = copy _2; - _121 = Sub(move _122, move _125); -+ _121 = _115; ++ _121 = copy _115; StorageDead(_125); StorageDead(_122); - _120 = opaque::<u64>(move _121) -> [return: bb34, unwind unreachable]; -+ _120 = opaque::<u64>(_115) -> [return: bb34, unwind unreachable]; ++ _120 = opaque::<u64>(copy _115) -> [return: bb34, unwind unreachable]; } bb34: { @@ -762,16 +762,16 @@ - StorageLive(_129); + nop; + nop; - _129 = (*_126); + _129 = copy (*_126); StorageLive(_130); - _130 = _1; + _130 = copy _1; - _128 = Add(move _129, move _130); -+ _128 = Add(_129, _1); ++ _128 = Add(copy _129, copy _1); StorageDead(_130); - StorageDead(_129); - _127 = opaque::<u64>(move _128) -> [return: bb35, unwind unreachable]; + nop; -+ _127 = opaque::<u64>(_128) -> [return: bb35, unwind unreachable]; ++ _127 = opaque::<u64>(copy _128) -> [return: bb35, unwind unreachable]; } bb35: { @@ -781,16 +781,16 @@ StorageLive(_131); StorageLive(_132); StorageLive(_133); -- _133 = (*_126); -+ _133 = _129; +- _133 = copy (*_126); ++ _133 = copy _129; StorageLive(_134); - _134 = _1; + _134 = copy _1; - _132 = Add(move _133, move _134); -+ _132 = _128; ++ _132 = copy _128; StorageDead(_134); StorageDead(_133); - _131 = opaque::<u64>(move _132) -> [return: bb36, unwind unreachable]; -+ _131 = opaque::<u64>(_128) -> [return: bb36, unwind unreachable]; ++ _131 = opaque::<u64>(copy _128) -> [return: bb36, unwind unreachable]; } bb36: { @@ -801,11 +801,11 @@ StorageLive(_136); StorageLive(_137); StorageLive(_138); - _138 = (*_135); + _138 = copy (*_135); StorageLive(_139); - _139 = _1; + _139 = copy _1; - _137 = Add(move _138, move _139); -+ _137 = Add(move _138, _1); ++ _137 = Add(move _138, copy _1); StorageDead(_139); StorageDead(_138); _136 = opaque::<u64>(move _137) -> [return: bb37, unwind unreachable]; @@ -817,11 +817,11 @@ StorageLive(_140); StorageLive(_141); StorageLive(_142); - _142 = (*_135); + _142 = copy (*_135); StorageLive(_143); - _143 = _1; + _143 = copy _1; - _141 = Add(move _142, move _143); -+ _141 = Add(move _142, _1); ++ _141 = Add(move _142, copy _1); StorageDead(_143); StorageDead(_142); _140 = opaque::<u64>(move _141) -> [return: bb38, unwind unreachable]; @@ -836,11 +836,11 @@ StorageLive(_146); StorageLive(_147); StorageLive(_148); - _148 = (*_145); + _148 = copy (*_145); StorageLive(_149); - _149 = _1; + _149 = copy _1; - _147 = Add(move _148, move _149); -+ _147 = Add(move _148, _1); ++ _147 = Add(move _148, copy _1); StorageDead(_149); StorageDead(_148); _146 = opaque::<u64>(move _147) -> [return: bb39, unwind unreachable]; @@ -852,11 +852,11 @@ StorageLive(_150); StorageLive(_151); StorageLive(_152); - _152 = (*_145); + _152 = copy (*_145); StorageLive(_153); - _153 = _1; + _153 = copy _1; - _151 = Add(move _152, move _153); -+ _151 = Add(move _152, _1); ++ _151 = Add(move _152, copy _1); StorageDead(_153); StorageDead(_152); _150 = opaque::<u64>(move _151) -> [return: bb40, unwind unreachable]; @@ -870,11 +870,11 @@ StorageLive(_155); StorageLive(_156); StorageLive(_157); - _157 = (*_154); + _157 = copy (*_154); StorageLive(_158); - _158 = _1; + _158 = copy _1; - _156 = Add(move _157, move _158); -+ _156 = Add(move _157, _1); ++ _156 = Add(move _157, copy _1); StorageDead(_158); StorageDead(_157); _155 = opaque::<u64>(move _156) -> [return: bb41, unwind unreachable]; @@ -886,11 +886,11 @@ StorageLive(_159); StorageLive(_160); StorageLive(_161); - _161 = (*_154); + _161 = copy (*_154); StorageLive(_162); - _162 = _1; + _162 = copy _1; - _160 = Add(move _161, move _162); -+ _160 = Add(move _161, _1); ++ _160 = Add(move _161, copy _1); StorageDead(_162); StorageDead(_161); _159 = opaque::<u64>(move _160) -> [return: bb42, unwind unreachable]; @@ -910,16 +910,16 @@ - StorageLive(_166); + nop; + nop; - _166 = (*_163); + _166 = copy (*_163); StorageLive(_167); - _167 = _1; + _167 = copy _1; - _165 = Add(move _166, move _167); -+ _165 = Add(_166, _1); ++ _165 = Add(copy _166, copy _1); StorageDead(_167); - StorageDead(_166); - _164 = opaque::<u64>(move _165) -> [return: bb43, unwind unreachable]; + nop; -+ _164 = opaque::<u64>(_165) -> [return: bb43, unwind unreachable]; ++ _164 = opaque::<u64>(copy _165) -> [return: bb43, unwind unreachable]; } bb43: { @@ -929,16 +929,16 @@ StorageLive(_168); StorageLive(_169); StorageLive(_170); -- _170 = (*_163); -+ _170 = _166; +- _170 = copy (*_163); ++ _170 = copy _166; StorageLive(_171); - _171 = _1; + _171 = copy _1; - _169 = Add(move _170, move _171); -+ _169 = _165; ++ _169 = copy _165; StorageDead(_171); StorageDead(_170); - _168 = opaque::<u64>(move _169) -> [return: bb44, unwind unreachable]; -+ _168 = opaque::<u64>(_165) -> [return: bb44, unwind unreachable]; ++ _168 = opaque::<u64>(copy _165) -> [return: bb44, unwind unreachable]; } bb44: { diff --git a/tests/mir-opt/gvn.subexpression_elimination.GVN.panic-unwind.diff b/tests/mir-opt/gvn.subexpression_elimination.GVN.panic-unwind.diff index 41c01536130..3ca5238663c 100644 --- a/tests/mir-opt/gvn.subexpression_elimination.GVN.panic-unwind.diff +++ b/tests/mir-opt/gvn.subexpression_elimination.GVN.panic-unwind.diff @@ -195,15 +195,15 @@ - StorageLive(_5); + nop; StorageLive(_6); - _6 = _1; + _6 = copy _1; StorageLive(_7); - _7 = _2; + _7 = copy _2; - _5 = Add(move _6, move _7); -+ _5 = Add(_1, _2); ++ _5 = Add(copy _1, copy _2); StorageDead(_7); StorageDead(_6); - _4 = opaque::<u64>(move _5) -> [return: bb1, unwind continue]; -+ _4 = opaque::<u64>(_5) -> [return: bb1, unwind continue]; ++ _4 = opaque::<u64>(copy _5) -> [return: bb1, unwind continue]; } bb1: { @@ -214,15 +214,15 @@ - StorageLive(_9); + nop; StorageLive(_10); - _10 = _1; + _10 = copy _1; StorageLive(_11); - _11 = _2; + _11 = copy _2; - _9 = Mul(move _10, move _11); -+ _9 = Mul(_1, _2); ++ _9 = Mul(copy _1, copy _2); StorageDead(_11); StorageDead(_10); - _8 = opaque::<u64>(move _9) -> [return: bb2, unwind continue]; -+ _8 = opaque::<u64>(_9) -> [return: bb2, unwind continue]; ++ _8 = opaque::<u64>(copy _9) -> [return: bb2, unwind continue]; } bb2: { @@ -233,15 +233,15 @@ - StorageLive(_13); + nop; StorageLive(_14); - _14 = _1; + _14 = copy _1; StorageLive(_15); - _15 = _2; + _15 = copy _2; - _13 = Sub(move _14, move _15); -+ _13 = Sub(_1, _2); ++ _13 = Sub(copy _1, copy _2); StorageDead(_15); StorageDead(_14); - _12 = opaque::<u64>(move _13) -> [return: bb3, unwind continue]; -+ _12 = opaque::<u64>(_13) -> [return: bb3, unwind continue]; ++ _12 = opaque::<u64>(copy _13) -> [return: bb3, unwind continue]; } bb3: { @@ -252,22 +252,22 @@ - StorageLive(_17); + nop; StorageLive(_18); - _18 = _1; + _18 = copy _1; StorageLive(_19); - _19 = _2; -- _20 = Eq(_19, const 0_u64); -- assert(!move _20, "attempt to divide `{}` by zero", _18) -> [success: bb4, unwind continue]; -+ _20 = Eq(_2, const 0_u64); -+ assert(!_20, "attempt to divide `{}` by zero", _1) -> [success: bb4, unwind continue]; + _19 = copy _2; +- _20 = Eq(copy _19, const 0_u64); +- assert(!move _20, "attempt to divide `{}` by zero", copy _18) -> [success: bb4, unwind continue]; ++ _20 = Eq(copy _2, const 0_u64); ++ assert(!copy _20, "attempt to divide `{}` by zero", copy _1) -> [success: bb4, unwind continue]; } bb4: { - _17 = Div(move _18, move _19); -+ _17 = Div(_1, _2); ++ _17 = Div(copy _1, copy _2); StorageDead(_19); StorageDead(_18); - _16 = opaque::<u64>(move _17) -> [return: bb5, unwind continue]; -+ _16 = opaque::<u64>(_17) -> [return: bb5, unwind continue]; ++ _16 = opaque::<u64>(copy _17) -> [return: bb5, unwind continue]; } bb5: { @@ -278,22 +278,22 @@ - StorageLive(_22); + nop; StorageLive(_23); - _23 = _1; + _23 = copy _1; StorageLive(_24); - _24 = _2; -- _25 = Eq(_24, const 0_u64); -- assert(!move _25, "attempt to calculate the remainder of `{}` with a divisor of zero", _23) -> [success: bb6, unwind continue]; -+ _25 = _20; -+ assert(!_20, "attempt to calculate the remainder of `{}` with a divisor of zero", _1) -> [success: bb6, unwind continue]; + _24 = copy _2; +- _25 = Eq(copy _24, const 0_u64); +- assert(!move _25, "attempt to calculate the remainder of `{}` with a divisor of zero", copy _23) -> [success: bb6, unwind continue]; ++ _25 = copy _20; ++ assert(!copy _20, "attempt to calculate the remainder of `{}` with a divisor of zero", copy _1) -> [success: bb6, unwind continue]; } bb6: { - _22 = Rem(move _23, move _24); -+ _22 = Rem(_1, _2); ++ _22 = Rem(copy _1, copy _2); StorageDead(_24); StorageDead(_23); - _21 = opaque::<u64>(move _22) -> [return: bb7, unwind continue]; -+ _21 = opaque::<u64>(_22) -> [return: bb7, unwind continue]; ++ _21 = opaque::<u64>(copy _22) -> [return: bb7, unwind continue]; } bb7: { @@ -304,15 +304,15 @@ - StorageLive(_27); + nop; StorageLive(_28); - _28 = _1; + _28 = copy _1; StorageLive(_29); - _29 = _2; + _29 = copy _2; - _27 = BitAnd(move _28, move _29); -+ _27 = BitAnd(_1, _2); ++ _27 = BitAnd(copy _1, copy _2); StorageDead(_29); StorageDead(_28); - _26 = opaque::<u64>(move _27) -> [return: bb8, unwind continue]; -+ _26 = opaque::<u64>(_27) -> [return: bb8, unwind continue]; ++ _26 = opaque::<u64>(copy _27) -> [return: bb8, unwind continue]; } bb8: { @@ -323,15 +323,15 @@ - StorageLive(_31); + nop; StorageLive(_32); - _32 = _1; + _32 = copy _1; StorageLive(_33); - _33 = _2; + _33 = copy _2; - _31 = BitOr(move _32, move _33); -+ _31 = BitOr(_1, _2); ++ _31 = BitOr(copy _1, copy _2); StorageDead(_33); StorageDead(_32); - _30 = opaque::<u64>(move _31) -> [return: bb9, unwind continue]; -+ _30 = opaque::<u64>(_31) -> [return: bb9, unwind continue]; ++ _30 = opaque::<u64>(copy _31) -> [return: bb9, unwind continue]; } bb9: { @@ -342,15 +342,15 @@ - StorageLive(_35); + nop; StorageLive(_36); - _36 = _1; + _36 = copy _1; StorageLive(_37); - _37 = _2; + _37 = copy _2; - _35 = BitXor(move _36, move _37); -+ _35 = BitXor(_1, _2); ++ _35 = BitXor(copy _1, copy _2); StorageDead(_37); StorageDead(_36); - _34 = opaque::<u64>(move _35) -> [return: bb10, unwind continue]; -+ _34 = opaque::<u64>(_35) -> [return: bb10, unwind continue]; ++ _34 = opaque::<u64>(copy _35) -> [return: bb10, unwind continue]; } bb10: { @@ -361,15 +361,15 @@ - StorageLive(_39); + nop; StorageLive(_40); - _40 = _1; + _40 = copy _1; StorageLive(_41); - _41 = _2; + _41 = copy _2; - _39 = Shl(move _40, move _41); -+ _39 = Shl(_1, _2); ++ _39 = Shl(copy _1, copy _2); StorageDead(_41); StorageDead(_40); - _38 = opaque::<u64>(move _39) -> [return: bb11, unwind continue]; -+ _38 = opaque::<u64>(_39) -> [return: bb11, unwind continue]; ++ _38 = opaque::<u64>(copy _39) -> [return: bb11, unwind continue]; } bb11: { @@ -380,15 +380,15 @@ - StorageLive(_43); + nop; StorageLive(_44); - _44 = _1; + _44 = copy _1; StorageLive(_45); - _45 = _2; + _45 = copy _2; - _43 = Shr(move _44, move _45); -+ _43 = Shr(_1, _2); ++ _43 = Shr(copy _1, copy _2); StorageDead(_45); StorageDead(_44); - _42 = opaque::<u64>(move _43) -> [return: bb12, unwind continue]; -+ _42 = opaque::<u64>(_43) -> [return: bb12, unwind continue]; ++ _42 = opaque::<u64>(copy _43) -> [return: bb12, unwind continue]; } bb12: { @@ -399,12 +399,12 @@ - StorageLive(_47); + nop; StorageLive(_48); - _48 = _1; + _48 = copy _1; - _47 = move _48 as u32 (IntToInt); -+ _47 = _1 as u32 (IntToInt); ++ _47 = copy _1 as u32 (IntToInt); StorageDead(_48); - _46 = opaque::<u32>(move _47) -> [return: bb13, unwind continue]; -+ _46 = opaque::<u32>(_47) -> [return: bb13, unwind continue]; ++ _46 = opaque::<u32>(copy _47) -> [return: bb13, unwind continue]; } bb13: { @@ -415,12 +415,12 @@ - StorageLive(_50); + nop; StorageLive(_51); - _51 = _1; + _51 = copy _1; - _50 = move _51 as f32 (IntToFloat); -+ _50 = _1 as f32 (IntToFloat); ++ _50 = copy _1 as f32 (IntToFloat); StorageDead(_51); - _49 = opaque::<f32>(move _50) -> [return: bb14, unwind continue]; -+ _49 = opaque::<f32>(_50) -> [return: bb14, unwind continue]; ++ _49 = opaque::<f32>(copy _50) -> [return: bb14, unwind continue]; } bb14: { @@ -431,12 +431,12 @@ - StorageLive(_53); + nop; StorageLive(_54); - _54 = _1; + _54 = copy _1; - _53 = S::<u64>(move _54); -+ _53 = S::<u64>(_1); ++ _53 = S::<u64>(copy _1); StorageDead(_54); - _52 = opaque::<S<u64>>(move _53) -> [return: bb15, unwind continue]; -+ _52 = opaque::<S<u64>>(_53) -> [return: bb15, unwind continue]; ++ _52 = opaque::<S<u64>>(copy _53) -> [return: bb15, unwind continue]; } bb15: { @@ -447,14 +447,14 @@ StorageLive(_56); StorageLive(_57); StorageLive(_58); - _58 = _1; + _58 = copy _1; - _57 = S::<u64>(move _58); -+ _57 = _53; ++ _57 = copy _53; StorageDead(_58); -- _56 = (_57.0: u64); +- _56 = copy (_57.0: u64); - _55 = opaque::<u64>(move _56) -> [return: bb16, unwind continue]; -+ _56 = _1; -+ _55 = opaque::<u64>(_1) -> [return: bb16, unwind continue]; ++ _56 = copy _1; ++ _55 = opaque::<u64>(copy _1) -> [return: bb16, unwind continue]; } bb16: { @@ -464,15 +464,15 @@ StorageLive(_59); StorageLive(_60); StorageLive(_61); - _61 = _1; + _61 = copy _1; StorageLive(_62); - _62 = _2; + _62 = copy _2; - _60 = Add(move _61, move _62); -+ _60 = _5; ++ _60 = copy _5; StorageDead(_62); StorageDead(_61); - _59 = opaque::<u64>(move _60) -> [return: bb17, unwind continue]; -+ _59 = opaque::<u64>(_5) -> [return: bb17, unwind continue]; ++ _59 = opaque::<u64>(copy _5) -> [return: bb17, unwind continue]; } bb17: { @@ -481,15 +481,15 @@ StorageLive(_63); StorageLive(_64); StorageLive(_65); - _65 = _1; + _65 = copy _1; StorageLive(_66); - _66 = _2; + _66 = copy _2; - _64 = Mul(move _65, move _66); -+ _64 = _9; ++ _64 = copy _9; StorageDead(_66); StorageDead(_65); - _63 = opaque::<u64>(move _64) -> [return: bb18, unwind continue]; -+ _63 = opaque::<u64>(_9) -> [return: bb18, unwind continue]; ++ _63 = opaque::<u64>(copy _9) -> [return: bb18, unwind continue]; } bb18: { @@ -498,15 +498,15 @@ StorageLive(_67); StorageLive(_68); StorageLive(_69); - _69 = _1; + _69 = copy _1; StorageLive(_70); - _70 = _2; + _70 = copy _2; - _68 = Sub(move _69, move _70); -+ _68 = _13; ++ _68 = copy _13; StorageDead(_70); StorageDead(_69); - _67 = opaque::<u64>(move _68) -> [return: bb19, unwind continue]; -+ _67 = opaque::<u64>(_13) -> [return: bb19, unwind continue]; ++ _67 = opaque::<u64>(copy _13) -> [return: bb19, unwind continue]; } bb19: { @@ -515,22 +515,22 @@ StorageLive(_71); StorageLive(_72); StorageLive(_73); - _73 = _1; + _73 = copy _1; StorageLive(_74); - _74 = _2; -- _75 = Eq(_74, const 0_u64); -- assert(!move _75, "attempt to divide `{}` by zero", _73) -> [success: bb20, unwind continue]; -+ _75 = _20; -+ assert(!_20, "attempt to divide `{}` by zero", _1) -> [success: bb20, unwind continue]; + _74 = copy _2; +- _75 = Eq(copy _74, const 0_u64); +- assert(!move _75, "attempt to divide `{}` by zero", copy _73) -> [success: bb20, unwind continue]; ++ _75 = copy _20; ++ assert(!copy _20, "attempt to divide `{}` by zero", copy _1) -> [success: bb20, unwind continue]; } bb20: { - _72 = Div(move _73, move _74); -+ _72 = _17; ++ _72 = copy _17; StorageDead(_74); StorageDead(_73); - _71 = opaque::<u64>(move _72) -> [return: bb21, unwind continue]; -+ _71 = opaque::<u64>(_17) -> [return: bb21, unwind continue]; ++ _71 = opaque::<u64>(copy _17) -> [return: bb21, unwind continue]; } bb21: { @@ -539,22 +539,22 @@ StorageLive(_76); StorageLive(_77); StorageLive(_78); - _78 = _1; + _78 = copy _1; StorageLive(_79); - _79 = _2; -- _80 = Eq(_79, const 0_u64); -- assert(!move _80, "attempt to calculate the remainder of `{}` with a divisor of zero", _78) -> [success: bb22, unwind continue]; -+ _80 = _20; -+ assert(!_20, "attempt to calculate the remainder of `{}` with a divisor of zero", _1) -> [success: bb22, unwind continue]; + _79 = copy _2; +- _80 = Eq(copy _79, const 0_u64); +- assert(!move _80, "attempt to calculate the remainder of `{}` with a divisor of zero", copy _78) -> [success: bb22, unwind continue]; ++ _80 = copy _20; ++ assert(!copy _20, "attempt to calculate the remainder of `{}` with a divisor of zero", copy _1) -> [success: bb22, unwind continue]; } bb22: { - _77 = Rem(move _78, move _79); -+ _77 = _22; ++ _77 = copy _22; StorageDead(_79); StorageDead(_78); - _76 = opaque::<u64>(move _77) -> [return: bb23, unwind continue]; -+ _76 = opaque::<u64>(_22) -> [return: bb23, unwind continue]; ++ _76 = opaque::<u64>(copy _22) -> [return: bb23, unwind continue]; } bb23: { @@ -563,15 +563,15 @@ StorageLive(_81); StorageLive(_82); StorageLive(_83); - _83 = _1; + _83 = copy _1; StorageLive(_84); - _84 = _2; + _84 = copy _2; - _82 = BitAnd(move _83, move _84); -+ _82 = _27; ++ _82 = copy _27; StorageDead(_84); StorageDead(_83); - _81 = opaque::<u64>(move _82) -> [return: bb24, unwind continue]; -+ _81 = opaque::<u64>(_27) -> [return: bb24, unwind continue]; ++ _81 = opaque::<u64>(copy _27) -> [return: bb24, unwind continue]; } bb24: { @@ -580,15 +580,15 @@ StorageLive(_85); StorageLive(_86); StorageLive(_87); - _87 = _1; + _87 = copy _1; StorageLive(_88); - _88 = _2; + _88 = copy _2; - _86 = BitOr(move _87, move _88); -+ _86 = _31; ++ _86 = copy _31; StorageDead(_88); StorageDead(_87); - _85 = opaque::<u64>(move _86) -> [return: bb25, unwind continue]; -+ _85 = opaque::<u64>(_31) -> [return: bb25, unwind continue]; ++ _85 = opaque::<u64>(copy _31) -> [return: bb25, unwind continue]; } bb25: { @@ -597,15 +597,15 @@ StorageLive(_89); StorageLive(_90); StorageLive(_91); - _91 = _1; + _91 = copy _1; StorageLive(_92); - _92 = _2; + _92 = copy _2; - _90 = BitXor(move _91, move _92); -+ _90 = _35; ++ _90 = copy _35; StorageDead(_92); StorageDead(_91); - _89 = opaque::<u64>(move _90) -> [return: bb26, unwind continue]; -+ _89 = opaque::<u64>(_35) -> [return: bb26, unwind continue]; ++ _89 = opaque::<u64>(copy _35) -> [return: bb26, unwind continue]; } bb26: { @@ -614,15 +614,15 @@ StorageLive(_93); StorageLive(_94); StorageLive(_95); - _95 = _1; + _95 = copy _1; StorageLive(_96); - _96 = _2; + _96 = copy _2; - _94 = Shl(move _95, move _96); -+ _94 = _39; ++ _94 = copy _39; StorageDead(_96); StorageDead(_95); - _93 = opaque::<u64>(move _94) -> [return: bb27, unwind continue]; -+ _93 = opaque::<u64>(_39) -> [return: bb27, unwind continue]; ++ _93 = opaque::<u64>(copy _39) -> [return: bb27, unwind continue]; } bb27: { @@ -631,15 +631,15 @@ StorageLive(_97); StorageLive(_98); StorageLive(_99); - _99 = _1; + _99 = copy _1; StorageLive(_100); - _100 = _2; + _100 = copy _2; - _98 = Shr(move _99, move _100); -+ _98 = _43; ++ _98 = copy _43; StorageDead(_100); StorageDead(_99); - _97 = opaque::<u64>(move _98) -> [return: bb28, unwind continue]; -+ _97 = opaque::<u64>(_43) -> [return: bb28, unwind continue]; ++ _97 = opaque::<u64>(copy _43) -> [return: bb28, unwind continue]; } bb28: { @@ -648,12 +648,12 @@ StorageLive(_101); StorageLive(_102); StorageLive(_103); - _103 = _1; + _103 = copy _1; - _102 = move _103 as u32 (IntToInt); -+ _102 = _47; ++ _102 = copy _47; StorageDead(_103); - _101 = opaque::<u32>(move _102) -> [return: bb29, unwind continue]; -+ _101 = opaque::<u32>(_47) -> [return: bb29, unwind continue]; ++ _101 = opaque::<u32>(copy _47) -> [return: bb29, unwind continue]; } bb29: { @@ -662,12 +662,12 @@ StorageLive(_104); StorageLive(_105); StorageLive(_106); - _106 = _1; + _106 = copy _1; - _105 = move _106 as f32 (IntToFloat); -+ _105 = _50; ++ _105 = copy _50; StorageDead(_106); - _104 = opaque::<f32>(move _105) -> [return: bb30, unwind continue]; -+ _104 = opaque::<f32>(_50) -> [return: bb30, unwind continue]; ++ _104 = opaque::<f32>(copy _50) -> [return: bb30, unwind continue]; } bb30: { @@ -676,12 +676,12 @@ StorageLive(_107); StorageLive(_108); StorageLive(_109); - _109 = _1; + _109 = copy _1; - _108 = S::<u64>(move _109); -+ _108 = _53; ++ _108 = copy _53; StorageDead(_109); - _107 = opaque::<S<u64>>(move _108) -> [return: bb31, unwind continue]; -+ _107 = opaque::<S<u64>>(_53) -> [return: bb31, unwind continue]; ++ _107 = opaque::<S<u64>>(copy _53) -> [return: bb31, unwind continue]; } bb31: { @@ -691,14 +691,14 @@ StorageLive(_111); StorageLive(_112); StorageLive(_113); - _113 = _1; + _113 = copy _1; - _112 = S::<u64>(move _113); -+ _112 = _53; ++ _112 = copy _53; StorageDead(_113); -- _111 = (_112.0: u64); +- _111 = copy (_112.0: u64); - _110 = opaque::<u64>(move _111) -> [return: bb32, unwind continue]; -+ _111 = _1; -+ _110 = opaque::<u64>(_1) -> [return: bb32, unwind continue]; ++ _111 = copy _1; ++ _110 = opaque::<u64>(copy _1) -> [return: bb32, unwind continue]; } bb32: { @@ -710,21 +710,21 @@ + nop; StorageLive(_116); StorageLive(_117); - _117 = _1; + _117 = copy _1; StorageLive(_118); - _118 = _2; + _118 = copy _2; - _116 = Mul(move _117, move _118); -+ _116 = _9; ++ _116 = copy _9; StorageDead(_118); StorageDead(_117); StorageLive(_119); - _119 = _2; + _119 = copy _2; - _115 = Sub(move _116, move _119); -+ _115 = Sub(_9, _2); ++ _115 = Sub(copy _9, copy _2); StorageDead(_119); StorageDead(_116); - _114 = opaque::<u64>(move _115) -> [return: bb33, unwind continue]; -+ _114 = opaque::<u64>(_115) -> [return: bb33, unwind continue]; ++ _114 = opaque::<u64>(copy _115) -> [return: bb33, unwind continue]; } bb33: { @@ -735,21 +735,21 @@ StorageLive(_121); StorageLive(_122); StorageLive(_123); - _123 = _1; + _123 = copy _1; StorageLive(_124); - _124 = _2; + _124 = copy _2; - _122 = Mul(move _123, move _124); -+ _122 = _9; ++ _122 = copy _9; StorageDead(_124); StorageDead(_123); StorageLive(_125); - _125 = _2; + _125 = copy _2; - _121 = Sub(move _122, move _125); -+ _121 = _115; ++ _121 = copy _115; StorageDead(_125); StorageDead(_122); - _120 = opaque::<u64>(move _121) -> [return: bb34, unwind continue]; -+ _120 = opaque::<u64>(_115) -> [return: bb34, unwind continue]; ++ _120 = opaque::<u64>(copy _115) -> [return: bb34, unwind continue]; } bb34: { @@ -762,16 +762,16 @@ - StorageLive(_129); + nop; + nop; - _129 = (*_126); + _129 = copy (*_126); StorageLive(_130); - _130 = _1; + _130 = copy _1; - _128 = Add(move _129, move _130); -+ _128 = Add(_129, _1); ++ _128 = Add(copy _129, copy _1); StorageDead(_130); - StorageDead(_129); - _127 = opaque::<u64>(move _128) -> [return: bb35, unwind continue]; + nop; -+ _127 = opaque::<u64>(_128) -> [return: bb35, unwind continue]; ++ _127 = opaque::<u64>(copy _128) -> [return: bb35, unwind continue]; } bb35: { @@ -781,16 +781,16 @@ StorageLive(_131); StorageLive(_132); StorageLive(_133); -- _133 = (*_126); -+ _133 = _129; +- _133 = copy (*_126); ++ _133 = copy _129; StorageLive(_134); - _134 = _1; + _134 = copy _1; - _132 = Add(move _133, move _134); -+ _132 = _128; ++ _132 = copy _128; StorageDead(_134); StorageDead(_133); - _131 = opaque::<u64>(move _132) -> [return: bb36, unwind continue]; -+ _131 = opaque::<u64>(_128) -> [return: bb36, unwind continue]; ++ _131 = opaque::<u64>(copy _128) -> [return: bb36, unwind continue]; } bb36: { @@ -801,11 +801,11 @@ StorageLive(_136); StorageLive(_137); StorageLive(_138); - _138 = (*_135); + _138 = copy (*_135); StorageLive(_139); - _139 = _1; + _139 = copy _1; - _137 = Add(move _138, move _139); -+ _137 = Add(move _138, _1); ++ _137 = Add(move _138, copy _1); StorageDead(_139); StorageDead(_138); _136 = opaque::<u64>(move _137) -> [return: bb37, unwind continue]; @@ -817,11 +817,11 @@ StorageLive(_140); StorageLive(_141); StorageLive(_142); - _142 = (*_135); + _142 = copy (*_135); StorageLive(_143); - _143 = _1; + _143 = copy _1; - _141 = Add(move _142, move _143); -+ _141 = Add(move _142, _1); ++ _141 = Add(move _142, copy _1); StorageDead(_143); StorageDead(_142); _140 = opaque::<u64>(move _141) -> [return: bb38, unwind continue]; @@ -836,11 +836,11 @@ StorageLive(_146); StorageLive(_147); StorageLive(_148); - _148 = (*_145); + _148 = copy (*_145); StorageLive(_149); - _149 = _1; + _149 = copy _1; - _147 = Add(move _148, move _149); -+ _147 = Add(move _148, _1); ++ _147 = Add(move _148, copy _1); StorageDead(_149); StorageDead(_148); _146 = opaque::<u64>(move _147) -> [return: bb39, unwind continue]; @@ -852,11 +852,11 @@ StorageLive(_150); StorageLive(_151); StorageLive(_152); - _152 = (*_145); + _152 = copy (*_145); StorageLive(_153); - _153 = _1; + _153 = copy _1; - _151 = Add(move _152, move _153); -+ _151 = Add(move _152, _1); ++ _151 = Add(move _152, copy _1); StorageDead(_153); StorageDead(_152); _150 = opaque::<u64>(move _151) -> [return: bb40, unwind continue]; @@ -870,11 +870,11 @@ StorageLive(_155); StorageLive(_156); StorageLive(_157); - _157 = (*_154); + _157 = copy (*_154); StorageLive(_158); - _158 = _1; + _158 = copy _1; - _156 = Add(move _157, move _158); -+ _156 = Add(move _157, _1); ++ _156 = Add(move _157, copy _1); StorageDead(_158); StorageDead(_157); _155 = opaque::<u64>(move _156) -> [return: bb41, unwind continue]; @@ -886,11 +886,11 @@ StorageLive(_159); StorageLive(_160); StorageLive(_161); - _161 = (*_154); + _161 = copy (*_154); StorageLive(_162); - _162 = _1; + _162 = copy _1; - _160 = Add(move _161, move _162); -+ _160 = Add(move _161, _1); ++ _160 = Add(move _161, copy _1); StorageDead(_162); StorageDead(_161); _159 = opaque::<u64>(move _160) -> [return: bb42, unwind continue]; @@ -910,16 +910,16 @@ - StorageLive(_166); + nop; + nop; - _166 = (*_163); + _166 = copy (*_163); StorageLive(_167); - _167 = _1; + _167 = copy _1; - _165 = Add(move _166, move _167); -+ _165 = Add(_166, _1); ++ _165 = Add(copy _166, copy _1); StorageDead(_167); - StorageDead(_166); - _164 = opaque::<u64>(move _165) -> [return: bb43, unwind continue]; + nop; -+ _164 = opaque::<u64>(_165) -> [return: bb43, unwind continue]; ++ _164 = opaque::<u64>(copy _165) -> [return: bb43, unwind continue]; } bb43: { @@ -929,16 +929,16 @@ StorageLive(_168); StorageLive(_169); StorageLive(_170); -- _170 = (*_163); -+ _170 = _166; +- _170 = copy (*_163); ++ _170 = copy _166; StorageLive(_171); - _171 = _1; + _171 = copy _1; - _169 = Add(move _170, move _171); -+ _169 = _165; ++ _169 = copy _165; StorageDead(_171); StorageDead(_170); - _168 = opaque::<u64>(move _169) -> [return: bb44, unwind continue]; -+ _168 = opaque::<u64>(_165) -> [return: bb44, unwind continue]; ++ _168 = opaque::<u64>(copy _165) -> [return: bb44, unwind continue]; } bb44: { diff --git a/tests/mir-opt/gvn.unary.GVN.panic-abort.diff b/tests/mir-opt/gvn.unary.GVN.panic-abort.diff index 9469032f294..d14aec6df5f 100644 --- a/tests/mir-opt/gvn.unary.GVN.panic-abort.diff +++ b/tests/mir-opt/gvn.unary.GVN.panic-abort.diff @@ -37,15 +37,15 @@ StorageLive(_3); StorageLive(_4); StorageLive(_5); - _5 = _1; + _5 = copy _1; - _4 = Neg(move _5); -+ _4 = Neg(_1); ++ _4 = Neg(copy _1); StorageDead(_5); - _3 = Neg(move _4); -+ _3 = _1; ++ _3 = copy _1; StorageDead(_4); - _2 = opaque::<i64>(move _3) -> [return: bb1, unwind unreachable]; -+ _2 = opaque::<i64>(_1) -> [return: bb1, unwind unreachable]; ++ _2 = opaque::<i64>(copy _1) -> [return: bb1, unwind unreachable]; } bb1: { @@ -54,23 +54,23 @@ - StorageLive(_6); + nop; StorageLive(_7); - _7 = _1; + _7 = copy _1; - _6 = Lt(move _7, const 13_i64); -+ _6 = Lt(_1, const 13_i64); ++ _6 = Lt(copy _1, const 13_i64); StorageDead(_7); StorageLive(_8); StorageLive(_9); StorageLive(_10); StorageLive(_11); - _11 = _6; + _11 = copy _6; - _10 = Not(move _11); -+ _10 = Not(_6); ++ _10 = Not(copy _6); StorageDead(_11); - _9 = Not(move _10); -+ _9 = _6; ++ _9 = copy _6; StorageDead(_10); - _8 = opaque::<bool>(move _9) -> [return: bb2, unwind unreachable]; -+ _8 = opaque::<bool>(_6) -> [return: bb2, unwind unreachable]; ++ _8 = opaque::<bool>(copy _6) -> [return: bb2, unwind unreachable]; } bb2: { @@ -80,12 +80,12 @@ - StorageLive(_13); + nop; StorageLive(_14); - _14 = _1; + _14 = copy _1; - _13 = Ne(move _14, const 15_i64); -+ _13 = Ne(_1, const 15_i64); ++ _13 = Ne(copy _1, const 15_i64); StorageDead(_14); - _12 = opaque::<bool>(move _13) -> [return: bb3, unwind unreachable]; -+ _12 = opaque::<bool>(_13) -> [return: bb3, unwind unreachable]; ++ _12 = opaque::<bool>(copy _13) -> [return: bb3, unwind unreachable]; } bb3: { @@ -96,15 +96,15 @@ StorageLive(_16); StorageLive(_17); StorageLive(_18); - _18 = _1; + _18 = copy _1; - _17 = Eq(move _18, const 15_i64); -+ _17 = Eq(_1, const 15_i64); ++ _17 = Eq(copy _1, const 15_i64); StorageDead(_18); - _16 = Not(move _17); -+ _16 = _13; ++ _16 = copy _13; StorageDead(_17); - _15 = opaque::<bool>(move _16) -> [return: bb4, unwind unreachable]; -+ _15 = opaque::<bool>(_13) -> [return: bb4, unwind unreachable]; ++ _15 = opaque::<bool>(copy _13) -> [return: bb4, unwind unreachable]; } bb4: { @@ -114,12 +114,12 @@ - StorageLive(_20); + nop; StorageLive(_21); - _21 = _1; + _21 = copy _1; - _20 = Eq(move _21, const 35_i64); -+ _20 = Eq(_1, const 35_i64); ++ _20 = Eq(copy _1, const 35_i64); StorageDead(_21); - _19 = opaque::<bool>(move _20) -> [return: bb5, unwind unreachable]; -+ _19 = opaque::<bool>(_20) -> [return: bb5, unwind unreachable]; ++ _19 = opaque::<bool>(copy _20) -> [return: bb5, unwind unreachable]; } bb5: { @@ -130,15 +130,15 @@ StorageLive(_23); StorageLive(_24); StorageLive(_25); - _25 = _1; + _25 = copy _1; - _24 = Ne(move _25, const 35_i64); -+ _24 = Ne(_1, const 35_i64); ++ _24 = Ne(copy _1, const 35_i64); StorageDead(_25); - _23 = Not(move _24); -+ _23 = _20; ++ _23 = copy _20; StorageDead(_24); - _22 = opaque::<bool>(move _23) -> [return: bb6, unwind unreachable]; -+ _22 = opaque::<bool>(_20) -> [return: bb6, unwind unreachable]; ++ _22 = opaque::<bool>(copy _20) -> [return: bb6, unwind unreachable]; } bb6: { diff --git a/tests/mir-opt/gvn.unary.GVN.panic-unwind.diff b/tests/mir-opt/gvn.unary.GVN.panic-unwind.diff index e672f6fb6ba..5978f1faa1f 100644 --- a/tests/mir-opt/gvn.unary.GVN.panic-unwind.diff +++ b/tests/mir-opt/gvn.unary.GVN.panic-unwind.diff @@ -37,15 +37,15 @@ StorageLive(_3); StorageLive(_4); StorageLive(_5); - _5 = _1; + _5 = copy _1; - _4 = Neg(move _5); -+ _4 = Neg(_1); ++ _4 = Neg(copy _1); StorageDead(_5); - _3 = Neg(move _4); -+ _3 = _1; ++ _3 = copy _1; StorageDead(_4); - _2 = opaque::<i64>(move _3) -> [return: bb1, unwind continue]; -+ _2 = opaque::<i64>(_1) -> [return: bb1, unwind continue]; ++ _2 = opaque::<i64>(copy _1) -> [return: bb1, unwind continue]; } bb1: { @@ -54,23 +54,23 @@ - StorageLive(_6); + nop; StorageLive(_7); - _7 = _1; + _7 = copy _1; - _6 = Lt(move _7, const 13_i64); -+ _6 = Lt(_1, const 13_i64); ++ _6 = Lt(copy _1, const 13_i64); StorageDead(_7); StorageLive(_8); StorageLive(_9); StorageLive(_10); StorageLive(_11); - _11 = _6; + _11 = copy _6; - _10 = Not(move _11); -+ _10 = Not(_6); ++ _10 = Not(copy _6); StorageDead(_11); - _9 = Not(move _10); -+ _9 = _6; ++ _9 = copy _6; StorageDead(_10); - _8 = opaque::<bool>(move _9) -> [return: bb2, unwind continue]; -+ _8 = opaque::<bool>(_6) -> [return: bb2, unwind continue]; ++ _8 = opaque::<bool>(copy _6) -> [return: bb2, unwind continue]; } bb2: { @@ -80,12 +80,12 @@ - StorageLive(_13); + nop; StorageLive(_14); - _14 = _1; + _14 = copy _1; - _13 = Ne(move _14, const 15_i64); -+ _13 = Ne(_1, const 15_i64); ++ _13 = Ne(copy _1, const 15_i64); StorageDead(_14); - _12 = opaque::<bool>(move _13) -> [return: bb3, unwind continue]; -+ _12 = opaque::<bool>(_13) -> [return: bb3, unwind continue]; ++ _12 = opaque::<bool>(copy _13) -> [return: bb3, unwind continue]; } bb3: { @@ -96,15 +96,15 @@ StorageLive(_16); StorageLive(_17); StorageLive(_18); - _18 = _1; + _18 = copy _1; - _17 = Eq(move _18, const 15_i64); -+ _17 = Eq(_1, const 15_i64); ++ _17 = Eq(copy _1, const 15_i64); StorageDead(_18); - _16 = Not(move _17); -+ _16 = _13; ++ _16 = copy _13; StorageDead(_17); - _15 = opaque::<bool>(move _16) -> [return: bb4, unwind continue]; -+ _15 = opaque::<bool>(_13) -> [return: bb4, unwind continue]; ++ _15 = opaque::<bool>(copy _13) -> [return: bb4, unwind continue]; } bb4: { @@ -114,12 +114,12 @@ - StorageLive(_20); + nop; StorageLive(_21); - _21 = _1; + _21 = copy _1; - _20 = Eq(move _21, const 35_i64); -+ _20 = Eq(_1, const 35_i64); ++ _20 = Eq(copy _1, const 35_i64); StorageDead(_21); - _19 = opaque::<bool>(move _20) -> [return: bb5, unwind continue]; -+ _19 = opaque::<bool>(_20) -> [return: bb5, unwind continue]; ++ _19 = opaque::<bool>(copy _20) -> [return: bb5, unwind continue]; } bb5: { @@ -130,15 +130,15 @@ StorageLive(_23); StorageLive(_24); StorageLive(_25); - _25 = _1; + _25 = copy _1; - _24 = Ne(move _25, const 35_i64); -+ _24 = Ne(_1, const 35_i64); ++ _24 = Ne(copy _1, const 35_i64); StorageDead(_25); - _23 = Not(move _24); -+ _23 = _20; ++ _23 = copy _20; StorageDead(_24); - _22 = opaque::<bool>(move _23) -> [return: bb6, unwind continue]; -+ _22 = opaque::<bool>(_20) -> [return: bb6, unwind continue]; ++ _22 = opaque::<bool>(copy _20) -> [return: bb6, unwind continue]; } bb6: { diff --git a/tests/mir-opt/gvn.wide_ptr_integer.GVN.panic-abort.diff b/tests/mir-opt/gvn.wide_ptr_integer.GVN.panic-abort.diff index 3eed0473f7f..bb938f3ba6a 100644 --- a/tests/mir-opt/gvn.wide_ptr_integer.GVN.panic-abort.diff +++ b/tests/mir-opt/gvn.wide_ptr_integer.GVN.panic-abort.diff @@ -58,10 +58,10 @@ StorageLive(_5); StorageLive(_6); StorageLive(_7); -- _7 = _1; +- _7 = copy _1; + _7 = const Indirect { alloc_id: ALLOC0, offset: Size(0 bytes) }: *const [u8]; StorageLive(_8); -- _8 = _3; +- _8 = copy _3; - _6 = Eq(move _7, move _8); + _8 = const Indirect { alloc_id: ALLOC1, offset: Size(0 bytes) }: *const [u8]; + _6 = const false; @@ -77,10 +77,10 @@ StorageLive(_9); StorageLive(_10); StorageLive(_11); -- _11 = _1; +- _11 = copy _1; + _11 = const Indirect { alloc_id: ALLOC0, offset: Size(0 bytes) }: *const [u8]; StorageLive(_12); -- _12 = _3; +- _12 = copy _3; - _10 = Ne(move _11, move _12); + _12 = const Indirect { alloc_id: ALLOC1, offset: Size(0 bytes) }: *const [u8]; + _10 = const true; @@ -96,10 +96,10 @@ StorageLive(_13); StorageLive(_14); StorageLive(_15); -- _15 = _1; +- _15 = copy _1; + _15 = const Indirect { alloc_id: ALLOC0, offset: Size(0 bytes) }: *const [u8]; StorageLive(_16); -- _16 = _3; +- _16 = copy _3; - _14 = Lt(move _15, move _16); + _16 = const Indirect { alloc_id: ALLOC1, offset: Size(0 bytes) }: *const [u8]; + _14 = const true; @@ -115,10 +115,10 @@ StorageLive(_17); StorageLive(_18); StorageLive(_19); -- _19 = _1; +- _19 = copy _1; + _19 = const Indirect { alloc_id: ALLOC0, offset: Size(0 bytes) }: *const [u8]; StorageLive(_20); -- _20 = _3; +- _20 = copy _3; - _18 = Le(move _19, move _20); + _20 = const Indirect { alloc_id: ALLOC1, offset: Size(0 bytes) }: *const [u8]; + _18 = const true; @@ -134,10 +134,10 @@ StorageLive(_21); StorageLive(_22); StorageLive(_23); -- _23 = _1; +- _23 = copy _1; + _23 = const Indirect { alloc_id: ALLOC0, offset: Size(0 bytes) }: *const [u8]; StorageLive(_24); -- _24 = _3; +- _24 = copy _3; - _22 = Gt(move _23, move _24); + _24 = const Indirect { alloc_id: ALLOC1, offset: Size(0 bytes) }: *const [u8]; + _22 = const false; @@ -153,10 +153,10 @@ StorageLive(_25); StorageLive(_26); StorageLive(_27); -- _27 = _1; +- _27 = copy _1; + _27 = const Indirect { alloc_id: ALLOC0, offset: Size(0 bytes) }: *const [u8]; StorageLive(_28); -- _28 = _3; +- _28 = copy _3; - _26 = Ge(move _27, move _28); + _28 = const Indirect { alloc_id: ALLOC1, offset: Size(0 bytes) }: *const [u8]; + _26 = const false; diff --git a/tests/mir-opt/gvn.wide_ptr_integer.GVN.panic-unwind.diff b/tests/mir-opt/gvn.wide_ptr_integer.GVN.panic-unwind.diff index 9a6e255a872..81432d687eb 100644 --- a/tests/mir-opt/gvn.wide_ptr_integer.GVN.panic-unwind.diff +++ b/tests/mir-opt/gvn.wide_ptr_integer.GVN.panic-unwind.diff @@ -58,10 +58,10 @@ StorageLive(_5); StorageLive(_6); StorageLive(_7); -- _7 = _1; +- _7 = copy _1; + _7 = const Indirect { alloc_id: ALLOC0, offset: Size(0 bytes) }: *const [u8]; StorageLive(_8); -- _8 = _3; +- _8 = copy _3; - _6 = Eq(move _7, move _8); + _8 = const Indirect { alloc_id: ALLOC1, offset: Size(0 bytes) }: *const [u8]; + _6 = const false; @@ -77,10 +77,10 @@ StorageLive(_9); StorageLive(_10); StorageLive(_11); -- _11 = _1; +- _11 = copy _1; + _11 = const Indirect { alloc_id: ALLOC0, offset: Size(0 bytes) }: *const [u8]; StorageLive(_12); -- _12 = _3; +- _12 = copy _3; - _10 = Ne(move _11, move _12); + _12 = const Indirect { alloc_id: ALLOC1, offset: Size(0 bytes) }: *const [u8]; + _10 = const true; @@ -96,10 +96,10 @@ StorageLive(_13); StorageLive(_14); StorageLive(_15); -- _15 = _1; +- _15 = copy _1; + _15 = const Indirect { alloc_id: ALLOC0, offset: Size(0 bytes) }: *const [u8]; StorageLive(_16); -- _16 = _3; +- _16 = copy _3; - _14 = Lt(move _15, move _16); + _16 = const Indirect { alloc_id: ALLOC1, offset: Size(0 bytes) }: *const [u8]; + _14 = const true; @@ -115,10 +115,10 @@ StorageLive(_17); StorageLive(_18); StorageLive(_19); -- _19 = _1; +- _19 = copy _1; + _19 = const Indirect { alloc_id: ALLOC0, offset: Size(0 bytes) }: *const [u8]; StorageLive(_20); -- _20 = _3; +- _20 = copy _3; - _18 = Le(move _19, move _20); + _20 = const Indirect { alloc_id: ALLOC1, offset: Size(0 bytes) }: *const [u8]; + _18 = const true; @@ -134,10 +134,10 @@ StorageLive(_21); StorageLive(_22); StorageLive(_23); -- _23 = _1; +- _23 = copy _1; + _23 = const Indirect { alloc_id: ALLOC0, offset: Size(0 bytes) }: *const [u8]; StorageLive(_24); -- _24 = _3; +- _24 = copy _3; - _22 = Gt(move _23, move _24); + _24 = const Indirect { alloc_id: ALLOC1, offset: Size(0 bytes) }: *const [u8]; + _22 = const false; @@ -153,10 +153,10 @@ StorageLive(_25); StorageLive(_26); StorageLive(_27); -- _27 = _1; +- _27 = copy _1; + _27 = const Indirect { alloc_id: ALLOC0, offset: Size(0 bytes) }: *const [u8]; StorageLive(_28); -- _28 = _3; +- _28 = copy _3; - _26 = Ge(move _27, move _28); + _28 = const Indirect { alloc_id: ALLOC1, offset: Size(0 bytes) }: *const [u8]; + _26 = const false; diff --git a/tests/mir-opt/gvn.wide_ptr_provenance.GVN.panic-abort.diff b/tests/mir-opt/gvn.wide_ptr_provenance.GVN.panic-abort.diff index 629c2225682..c58362e391c 100644 --- a/tests/mir-opt/gvn.wide_ptr_provenance.GVN.panic-abort.diff +++ b/tests/mir-opt/gvn.wide_ptr_provenance.GVN.panic-abort.diff @@ -69,7 +69,7 @@ _2 = &raw const (*_3); - _1 = move _2 as *const dyn std::marker::Send (PointerCoercion(Unsize)); - StorageDead(_2); -+ _1 = _2; ++ _1 = copy _2; + nop; StorageDead(_5); StorageDead(_3); @@ -87,24 +87,24 @@ _8 = &raw const (*_9); - _7 = move _8 as *const dyn std::marker::Send (PointerCoercion(Unsize)); - StorageDead(_8); -+ _7 = _8; ++ _7 = copy _8; + nop; StorageDead(_11); StorageDead(_9); StorageLive(_13); StorageLive(_14); StorageLive(_15); -- _15 = _1; -+ _15 = _2; +- _15 = copy _1; ++ _15 = copy _2; StorageLive(_16); StorageLive(_17); -- _17 = _7; +- _17 = copy _7; - _16 = move _17 as *const dyn std::marker::Send (PointerCoercion(Unsize)); -+ _17 = _8; -+ _16 = _8; ++ _17 = copy _8; ++ _16 = copy _8; StorageDead(_17); - _14 = Eq(move _15, move _16); -+ _14 = Eq(_2, _8); ++ _14 = Eq(copy _2, copy _8); StorageDead(_16); StorageDead(_15); _13 = opaque::<bool>(move _14) -> [return: bb1, unwind unreachable]; @@ -116,17 +116,17 @@ StorageLive(_18); StorageLive(_19); StorageLive(_20); -- _20 = _1; -+ _20 = _2; +- _20 = copy _1; ++ _20 = copy _2; StorageLive(_21); StorageLive(_22); -- _22 = _7; +- _22 = copy _7; - _21 = move _22 as *const dyn std::marker::Send (PointerCoercion(Unsize)); -+ _22 = _8; -+ _21 = _8; ++ _22 = copy _8; ++ _21 = copy _8; StorageDead(_22); - _19 = Ne(move _20, move _21); -+ _19 = Ne(_2, _8); ++ _19 = Ne(copy _2, copy _8); StorageDead(_21); StorageDead(_20); _18 = opaque::<bool>(move _19) -> [return: bb2, unwind unreachable]; @@ -138,17 +138,17 @@ StorageLive(_23); StorageLive(_24); StorageLive(_25); -- _25 = _1; -+ _25 = _2; +- _25 = copy _1; ++ _25 = copy _2; StorageLive(_26); StorageLive(_27); -- _27 = _7; +- _27 = copy _7; - _26 = move _27 as *const dyn std::marker::Send (PointerCoercion(Unsize)); -+ _27 = _8; -+ _26 = _8; ++ _27 = copy _8; ++ _26 = copy _8; StorageDead(_27); - _24 = Lt(move _25, move _26); -+ _24 = Lt(_2, _8); ++ _24 = Lt(copy _2, copy _8); StorageDead(_26); StorageDead(_25); _23 = opaque::<bool>(move _24) -> [return: bb3, unwind unreachable]; @@ -160,17 +160,17 @@ StorageLive(_28); StorageLive(_29); StorageLive(_30); -- _30 = _1; -+ _30 = _2; +- _30 = copy _1; ++ _30 = copy _2; StorageLive(_31); StorageLive(_32); -- _32 = _7; +- _32 = copy _7; - _31 = move _32 as *const dyn std::marker::Send (PointerCoercion(Unsize)); -+ _32 = _8; -+ _31 = _8; ++ _32 = copy _8; ++ _31 = copy _8; StorageDead(_32); - _29 = Le(move _30, move _31); -+ _29 = Le(_2, _8); ++ _29 = Le(copy _2, copy _8); StorageDead(_31); StorageDead(_30); _28 = opaque::<bool>(move _29) -> [return: bb4, unwind unreachable]; @@ -182,17 +182,17 @@ StorageLive(_33); StorageLive(_34); StorageLive(_35); -- _35 = _1; -+ _35 = _2; +- _35 = copy _1; ++ _35 = copy _2; StorageLive(_36); StorageLive(_37); -- _37 = _7; +- _37 = copy _7; - _36 = move _37 as *const dyn std::marker::Send (PointerCoercion(Unsize)); -+ _37 = _8; -+ _36 = _8; ++ _37 = copy _8; ++ _36 = copy _8; StorageDead(_37); - _34 = Gt(move _35, move _36); -+ _34 = Gt(_2, _8); ++ _34 = Gt(copy _2, copy _8); StorageDead(_36); StorageDead(_35); _33 = opaque::<bool>(move _34) -> [return: bb5, unwind unreachable]; @@ -204,17 +204,17 @@ StorageLive(_38); StorageLive(_39); StorageLive(_40); -- _40 = _1; -+ _40 = _2; +- _40 = copy _1; ++ _40 = copy _2; StorageLive(_41); StorageLive(_42); -- _42 = _7; +- _42 = copy _7; - _41 = move _42 as *const dyn std::marker::Send (PointerCoercion(Unsize)); -+ _42 = _8; -+ _41 = _8; ++ _42 = copy _8; ++ _41 = copy _8; StorageDead(_42); - _39 = Ge(move _40, move _41); -+ _39 = Ge(_2, _8); ++ _39 = Ge(copy _2, copy _8); StorageDead(_41); StorageDead(_40); _38 = opaque::<bool>(move _39) -> [return: bb6, unwind unreachable]; diff --git a/tests/mir-opt/gvn.wide_ptr_provenance.GVN.panic-unwind.diff b/tests/mir-opt/gvn.wide_ptr_provenance.GVN.panic-unwind.diff index 3380bc84cb8..b29ee862c81 100644 --- a/tests/mir-opt/gvn.wide_ptr_provenance.GVN.panic-unwind.diff +++ b/tests/mir-opt/gvn.wide_ptr_provenance.GVN.panic-unwind.diff @@ -69,7 +69,7 @@ _2 = &raw const (*_3); - _1 = move _2 as *const dyn std::marker::Send (PointerCoercion(Unsize)); - StorageDead(_2); -+ _1 = _2; ++ _1 = copy _2; + nop; StorageDead(_5); StorageDead(_3); @@ -87,24 +87,24 @@ _8 = &raw const (*_9); - _7 = move _8 as *const dyn std::marker::Send (PointerCoercion(Unsize)); - StorageDead(_8); -+ _7 = _8; ++ _7 = copy _8; + nop; StorageDead(_11); StorageDead(_9); StorageLive(_13); StorageLive(_14); StorageLive(_15); -- _15 = _1; -+ _15 = _2; +- _15 = copy _1; ++ _15 = copy _2; StorageLive(_16); StorageLive(_17); -- _17 = _7; +- _17 = copy _7; - _16 = move _17 as *const dyn std::marker::Send (PointerCoercion(Unsize)); -+ _17 = _8; -+ _16 = _8; ++ _17 = copy _8; ++ _16 = copy _8; StorageDead(_17); - _14 = Eq(move _15, move _16); -+ _14 = Eq(_2, _8); ++ _14 = Eq(copy _2, copy _8); StorageDead(_16); StorageDead(_15); _13 = opaque::<bool>(move _14) -> [return: bb1, unwind continue]; @@ -116,17 +116,17 @@ StorageLive(_18); StorageLive(_19); StorageLive(_20); -- _20 = _1; -+ _20 = _2; +- _20 = copy _1; ++ _20 = copy _2; StorageLive(_21); StorageLive(_22); -- _22 = _7; +- _22 = copy _7; - _21 = move _22 as *const dyn std::marker::Send (PointerCoercion(Unsize)); -+ _22 = _8; -+ _21 = _8; ++ _22 = copy _8; ++ _21 = copy _8; StorageDead(_22); - _19 = Ne(move _20, move _21); -+ _19 = Ne(_2, _8); ++ _19 = Ne(copy _2, copy _8); StorageDead(_21); StorageDead(_20); _18 = opaque::<bool>(move _19) -> [return: bb2, unwind continue]; @@ -138,17 +138,17 @@ StorageLive(_23); StorageLive(_24); StorageLive(_25); -- _25 = _1; -+ _25 = _2; +- _25 = copy _1; ++ _25 = copy _2; StorageLive(_26); StorageLive(_27); -- _27 = _7; +- _27 = copy _7; - _26 = move _27 as *const dyn std::marker::Send (PointerCoercion(Unsize)); -+ _27 = _8; -+ _26 = _8; ++ _27 = copy _8; ++ _26 = copy _8; StorageDead(_27); - _24 = Lt(move _25, move _26); -+ _24 = Lt(_2, _8); ++ _24 = Lt(copy _2, copy _8); StorageDead(_26); StorageDead(_25); _23 = opaque::<bool>(move _24) -> [return: bb3, unwind continue]; @@ -160,17 +160,17 @@ StorageLive(_28); StorageLive(_29); StorageLive(_30); -- _30 = _1; -+ _30 = _2; +- _30 = copy _1; ++ _30 = copy _2; StorageLive(_31); StorageLive(_32); -- _32 = _7; +- _32 = copy _7; - _31 = move _32 as *const dyn std::marker::Send (PointerCoercion(Unsize)); -+ _32 = _8; -+ _31 = _8; ++ _32 = copy _8; ++ _31 = copy _8; StorageDead(_32); - _29 = Le(move _30, move _31); -+ _29 = Le(_2, _8); ++ _29 = Le(copy _2, copy _8); StorageDead(_31); StorageDead(_30); _28 = opaque::<bool>(move _29) -> [return: bb4, unwind continue]; @@ -182,17 +182,17 @@ StorageLive(_33); StorageLive(_34); StorageLive(_35); -- _35 = _1; -+ _35 = _2; +- _35 = copy _1; ++ _35 = copy _2; StorageLive(_36); StorageLive(_37); -- _37 = _7; +- _37 = copy _7; - _36 = move _37 as *const dyn std::marker::Send (PointerCoercion(Unsize)); -+ _37 = _8; -+ _36 = _8; ++ _37 = copy _8; ++ _36 = copy _8; StorageDead(_37); - _34 = Gt(move _35, move _36); -+ _34 = Gt(_2, _8); ++ _34 = Gt(copy _2, copy _8); StorageDead(_36); StorageDead(_35); _33 = opaque::<bool>(move _34) -> [return: bb5, unwind continue]; @@ -204,17 +204,17 @@ StorageLive(_38); StorageLive(_39); StorageLive(_40); -- _40 = _1; -+ _40 = _2; +- _40 = copy _1; ++ _40 = copy _2; StorageLive(_41); StorageLive(_42); -- _42 = _7; +- _42 = copy _7; - _41 = move _42 as *const dyn std::marker::Send (PointerCoercion(Unsize)); -+ _42 = _8; -+ _41 = _8; ++ _42 = copy _8; ++ _41 = copy _8; StorageDead(_42); - _39 = Ge(move _40, move _41); -+ _39 = Ge(_2, _8); ++ _39 = Ge(copy _2, copy _8); StorageDead(_41); StorageDead(_40); _38 = opaque::<bool>(move _39) -> [return: bb6, unwind continue]; diff --git a/tests/mir-opt/gvn.wide_ptr_same_provenance.GVN.panic-abort.diff b/tests/mir-opt/gvn.wide_ptr_same_provenance.GVN.panic-abort.diff index da1662615d2..f4c38b7ab07 100644 --- a/tests/mir-opt/gvn.wide_ptr_same_provenance.GVN.panic-abort.diff +++ b/tests/mir-opt/gvn.wide_ptr_same_provenance.GVN.panic-abort.diff @@ -75,8 +75,8 @@ StorageLive(_8); _8 = const 0_usize; - _9 = Len((*_1)); -- _10 = Lt(_8, _9); -- assert(move _10, "index out of bounds: the length is {} but the index is {}", move _9, _8) -> [success: bb1, unwind unreachable]; +- _10 = Lt(copy _8, copy _9); +- assert(move _10, "index out of bounds: the length is {} but the index is {}", move _9, copy _8) -> [success: bb1, unwind unreachable]; + _9 = const 2_usize; + _10 = const true; + assert(const true, "index out of bounds: the length is {} but the index is {}", const 2_usize, const 0_usize) -> [success: bb1, unwind unreachable]; @@ -91,7 +91,7 @@ _4 = &raw const (*_5); - _3 = move _4 as *const dyn std::marker::Send (PointerCoercion(Unsize)); - StorageDead(_4); -+ _3 = _4; ++ _3 = copy _4; + nop; StorageDead(_7); StorageDead(_5); @@ -104,8 +104,8 @@ StorageLive(_16); _16 = const 1_usize; - _17 = Len((*_1)); -- _18 = Lt(_16, _17); -- assert(move _18, "index out of bounds: the length is {} but the index is {}", move _17, _16) -> [success: bb2, unwind unreachable]; +- _18 = Lt(copy _16, copy _17); +- assert(move _18, "index out of bounds: the length is {} but the index is {}", move _17, copy _16) -> [success: bb2, unwind unreachable]; + _17 = const 2_usize; + _18 = const true; + assert(const true, "index out of bounds: the length is {} but the index is {}", const 2_usize, const 1_usize) -> [success: bb2, unwind unreachable]; @@ -120,24 +120,24 @@ _12 = &raw const (*_13); - _11 = move _12 as *const dyn std::marker::Send (PointerCoercion(Unsize)); - StorageDead(_12); -+ _11 = _12; ++ _11 = copy _12; + nop; StorageDead(_15); StorageDead(_13); StorageLive(_19); StorageLive(_20); StorageLive(_21); -- _21 = _3; -+ _21 = _4; +- _21 = copy _3; ++ _21 = copy _4; StorageLive(_22); StorageLive(_23); -- _23 = _11; +- _23 = copy _11; - _22 = move _23 as *const dyn std::marker::Send (PointerCoercion(Unsize)); -+ _23 = _12; -+ _22 = _12; ++ _23 = copy _12; ++ _22 = copy _12; StorageDead(_23); - _20 = Eq(move _21, move _22); -+ _20 = Eq(_4, _12); ++ _20 = Eq(copy _4, copy _12); StorageDead(_22); StorageDead(_21); _19 = opaque::<bool>(move _20) -> [return: bb3, unwind unreachable]; @@ -149,17 +149,17 @@ StorageLive(_24); StorageLive(_25); StorageLive(_26); -- _26 = _3; -+ _26 = _4; +- _26 = copy _3; ++ _26 = copy _4; StorageLive(_27); StorageLive(_28); -- _28 = _11; +- _28 = copy _11; - _27 = move _28 as *const dyn std::marker::Send (PointerCoercion(Unsize)); -+ _28 = _12; -+ _27 = _12; ++ _28 = copy _12; ++ _27 = copy _12; StorageDead(_28); - _25 = Ne(move _26, move _27); -+ _25 = Ne(_4, _12); ++ _25 = Ne(copy _4, copy _12); StorageDead(_27); StorageDead(_26); _24 = opaque::<bool>(move _25) -> [return: bb4, unwind unreachable]; @@ -171,17 +171,17 @@ StorageLive(_29); StorageLive(_30); StorageLive(_31); -- _31 = _3; -+ _31 = _4; +- _31 = copy _3; ++ _31 = copy _4; StorageLive(_32); StorageLive(_33); -- _33 = _11; +- _33 = copy _11; - _32 = move _33 as *const dyn std::marker::Send (PointerCoercion(Unsize)); -+ _33 = _12; -+ _32 = _12; ++ _33 = copy _12; ++ _32 = copy _12; StorageDead(_33); - _30 = Lt(move _31, move _32); -+ _30 = Lt(_4, _12); ++ _30 = Lt(copy _4, copy _12); StorageDead(_32); StorageDead(_31); _29 = opaque::<bool>(move _30) -> [return: bb5, unwind unreachable]; @@ -193,17 +193,17 @@ StorageLive(_34); StorageLive(_35); StorageLive(_36); -- _36 = _3; -+ _36 = _4; +- _36 = copy _3; ++ _36 = copy _4; StorageLive(_37); StorageLive(_38); -- _38 = _11; +- _38 = copy _11; - _37 = move _38 as *const dyn std::marker::Send (PointerCoercion(Unsize)); -+ _38 = _12; -+ _37 = _12; ++ _38 = copy _12; ++ _37 = copy _12; StorageDead(_38); - _35 = Le(move _36, move _37); -+ _35 = Le(_4, _12); ++ _35 = Le(copy _4, copy _12); StorageDead(_37); StorageDead(_36); _34 = opaque::<bool>(move _35) -> [return: bb6, unwind unreachable]; @@ -215,17 +215,17 @@ StorageLive(_39); StorageLive(_40); StorageLive(_41); -- _41 = _3; -+ _41 = _4; +- _41 = copy _3; ++ _41 = copy _4; StorageLive(_42); StorageLive(_43); -- _43 = _11; +- _43 = copy _11; - _42 = move _43 as *const dyn std::marker::Send (PointerCoercion(Unsize)); -+ _43 = _12; -+ _42 = _12; ++ _43 = copy _12; ++ _42 = copy _12; StorageDead(_43); - _40 = Gt(move _41, move _42); -+ _40 = Gt(_4, _12); ++ _40 = Gt(copy _4, copy _12); StorageDead(_42); StorageDead(_41); _39 = opaque::<bool>(move _40) -> [return: bb7, unwind unreachable]; @@ -237,17 +237,17 @@ StorageLive(_44); StorageLive(_45); StorageLive(_46); -- _46 = _3; -+ _46 = _4; +- _46 = copy _3; ++ _46 = copy _4; StorageLive(_47); StorageLive(_48); -- _48 = _11; +- _48 = copy _11; - _47 = move _48 as *const dyn std::marker::Send (PointerCoercion(Unsize)); -+ _48 = _12; -+ _47 = _12; ++ _48 = copy _12; ++ _47 = copy _12; StorageDead(_48); - _45 = Ge(move _46, move _47); -+ _45 = Ge(_4, _12); ++ _45 = Ge(copy _4, copy _12); StorageDead(_47); StorageDead(_46); _44 = opaque::<bool>(move _45) -> [return: bb8, unwind unreachable]; diff --git a/tests/mir-opt/gvn.wide_ptr_same_provenance.GVN.panic-unwind.diff b/tests/mir-opt/gvn.wide_ptr_same_provenance.GVN.panic-unwind.diff index 6c4f3a91264..03f2d129a9b 100644 --- a/tests/mir-opt/gvn.wide_ptr_same_provenance.GVN.panic-unwind.diff +++ b/tests/mir-opt/gvn.wide_ptr_same_provenance.GVN.panic-unwind.diff @@ -75,8 +75,8 @@ StorageLive(_8); _8 = const 0_usize; - _9 = Len((*_1)); -- _10 = Lt(_8, _9); -- assert(move _10, "index out of bounds: the length is {} but the index is {}", move _9, _8) -> [success: bb1, unwind continue]; +- _10 = Lt(copy _8, copy _9); +- assert(move _10, "index out of bounds: the length is {} but the index is {}", move _9, copy _8) -> [success: bb1, unwind continue]; + _9 = const 2_usize; + _10 = const true; + assert(const true, "index out of bounds: the length is {} but the index is {}", const 2_usize, const 0_usize) -> [success: bb1, unwind continue]; @@ -91,7 +91,7 @@ _4 = &raw const (*_5); - _3 = move _4 as *const dyn std::marker::Send (PointerCoercion(Unsize)); - StorageDead(_4); -+ _3 = _4; ++ _3 = copy _4; + nop; StorageDead(_7); StorageDead(_5); @@ -104,8 +104,8 @@ StorageLive(_16); _16 = const 1_usize; - _17 = Len((*_1)); -- _18 = Lt(_16, _17); -- assert(move _18, "index out of bounds: the length is {} but the index is {}", move _17, _16) -> [success: bb2, unwind continue]; +- _18 = Lt(copy _16, copy _17); +- assert(move _18, "index out of bounds: the length is {} but the index is {}", move _17, copy _16) -> [success: bb2, unwind continue]; + _17 = const 2_usize; + _18 = const true; + assert(const true, "index out of bounds: the length is {} but the index is {}", const 2_usize, const 1_usize) -> [success: bb2, unwind continue]; @@ -120,24 +120,24 @@ _12 = &raw const (*_13); - _11 = move _12 as *const dyn std::marker::Send (PointerCoercion(Unsize)); - StorageDead(_12); -+ _11 = _12; ++ _11 = copy _12; + nop; StorageDead(_15); StorageDead(_13); StorageLive(_19); StorageLive(_20); StorageLive(_21); -- _21 = _3; -+ _21 = _4; +- _21 = copy _3; ++ _21 = copy _4; StorageLive(_22); StorageLive(_23); -- _23 = _11; +- _23 = copy _11; - _22 = move _23 as *const dyn std::marker::Send (PointerCoercion(Unsize)); -+ _23 = _12; -+ _22 = _12; ++ _23 = copy _12; ++ _22 = copy _12; StorageDead(_23); - _20 = Eq(move _21, move _22); -+ _20 = Eq(_4, _12); ++ _20 = Eq(copy _4, copy _12); StorageDead(_22); StorageDead(_21); _19 = opaque::<bool>(move _20) -> [return: bb3, unwind continue]; @@ -149,17 +149,17 @@ StorageLive(_24); StorageLive(_25); StorageLive(_26); -- _26 = _3; -+ _26 = _4; +- _26 = copy _3; ++ _26 = copy _4; StorageLive(_27); StorageLive(_28); -- _28 = _11; +- _28 = copy _11; - _27 = move _28 as *const dyn std::marker::Send (PointerCoercion(Unsize)); -+ _28 = _12; -+ _27 = _12; ++ _28 = copy _12; ++ _27 = copy _12; StorageDead(_28); - _25 = Ne(move _26, move _27); -+ _25 = Ne(_4, _12); ++ _25 = Ne(copy _4, copy _12); StorageDead(_27); StorageDead(_26); _24 = opaque::<bool>(move _25) -> [return: bb4, unwind continue]; @@ -171,17 +171,17 @@ StorageLive(_29); StorageLive(_30); StorageLive(_31); -- _31 = _3; -+ _31 = _4; +- _31 = copy _3; ++ _31 = copy _4; StorageLive(_32); StorageLive(_33); -- _33 = _11; +- _33 = copy _11; - _32 = move _33 as *const dyn std::marker::Send (PointerCoercion(Unsize)); -+ _33 = _12; -+ _32 = _12; ++ _33 = copy _12; ++ _32 = copy _12; StorageDead(_33); - _30 = Lt(move _31, move _32); -+ _30 = Lt(_4, _12); ++ _30 = Lt(copy _4, copy _12); StorageDead(_32); StorageDead(_31); _29 = opaque::<bool>(move _30) -> [return: bb5, unwind continue]; @@ -193,17 +193,17 @@ StorageLive(_34); StorageLive(_35); StorageLive(_36); -- _36 = _3; -+ _36 = _4; +- _36 = copy _3; ++ _36 = copy _4; StorageLive(_37); StorageLive(_38); -- _38 = _11; +- _38 = copy _11; - _37 = move _38 as *const dyn std::marker::Send (PointerCoercion(Unsize)); -+ _38 = _12; -+ _37 = _12; ++ _38 = copy _12; ++ _37 = copy _12; StorageDead(_38); - _35 = Le(move _36, move _37); -+ _35 = Le(_4, _12); ++ _35 = Le(copy _4, copy _12); StorageDead(_37); StorageDead(_36); _34 = opaque::<bool>(move _35) -> [return: bb6, unwind continue]; @@ -215,17 +215,17 @@ StorageLive(_39); StorageLive(_40); StorageLive(_41); -- _41 = _3; -+ _41 = _4; +- _41 = copy _3; ++ _41 = copy _4; StorageLive(_42); StorageLive(_43); -- _43 = _11; +- _43 = copy _11; - _42 = move _43 as *const dyn std::marker::Send (PointerCoercion(Unsize)); -+ _43 = _12; -+ _42 = _12; ++ _43 = copy _12; ++ _42 = copy _12; StorageDead(_43); - _40 = Gt(move _41, move _42); -+ _40 = Gt(_4, _12); ++ _40 = Gt(copy _4, copy _12); StorageDead(_42); StorageDead(_41); _39 = opaque::<bool>(move _40) -> [return: bb7, unwind continue]; @@ -237,17 +237,17 @@ StorageLive(_44); StorageLive(_45); StorageLive(_46); -- _46 = _3; -+ _46 = _4; +- _46 = copy _3; ++ _46 = copy _4; StorageLive(_47); StorageLive(_48); -- _48 = _11; +- _48 = copy _11; - _47 = move _48 as *const dyn std::marker::Send (PointerCoercion(Unsize)); -+ _48 = _12; -+ _47 = _12; ++ _48 = copy _12; ++ _47 = copy _12; StorageDead(_48); - _45 = Ge(move _46, move _47); -+ _45 = Ge(_4, _12); ++ _45 = Ge(copy _4, copy _12); StorageDead(_47); StorageDead(_46); _44 = opaque::<bool>(move _45) -> [return: bb8, unwind continue]; diff --git a/tests/mir-opt/gvn.wrap_unwrap.GVN.panic-abort.diff b/tests/mir-opt/gvn.wrap_unwrap.GVN.panic-abort.diff index a5c29c191ad..0433152bb4f 100644 --- a/tests/mir-opt/gvn.wrap_unwrap.GVN.panic-abort.diff +++ b/tests/mir-opt/gvn.wrap_unwrap.GVN.panic-abort.diff @@ -16,9 +16,9 @@ bb0: { StorageLive(_2); StorageLive(_3); - _3 = _1; + _3 = copy _1; - _2 = Option::<T>::Some(move _3); -+ _2 = Option::<T>::Some(_1); ++ _2 = Option::<T>::Some(copy _1); StorageDead(_3); - _4 = discriminant(_2); - switchInt(move _4) -> [0: bb2, 1: bb3, otherwise: bb1]; @@ -37,10 +37,10 @@ bb3: { StorageLive(_5); -- _5 = ((_2 as Some).0: T); -- _0 = _5; -+ _5 = _1; -+ _0 = _1; +- _5 = copy ((_2 as Some).0: T); +- _0 = copy _5; ++ _5 = copy _1; ++ _0 = copy _1; StorageDead(_5); StorageDead(_2); return; diff --git a/tests/mir-opt/gvn.wrap_unwrap.GVN.panic-unwind.diff b/tests/mir-opt/gvn.wrap_unwrap.GVN.panic-unwind.diff index 6f2e5248271..5722c865c2f 100644 --- a/tests/mir-opt/gvn.wrap_unwrap.GVN.panic-unwind.diff +++ b/tests/mir-opt/gvn.wrap_unwrap.GVN.panic-unwind.diff @@ -16,9 +16,9 @@ bb0: { StorageLive(_2); StorageLive(_3); - _3 = _1; + _3 = copy _1; - _2 = Option::<T>::Some(move _3); -+ _2 = Option::<T>::Some(_1); ++ _2 = Option::<T>::Some(copy _1); StorageDead(_3); - _4 = discriminant(_2); - switchInt(move _4) -> [0: bb2, 1: bb3, otherwise: bb1]; @@ -37,10 +37,10 @@ bb3: { StorageLive(_5); -- _5 = ((_2 as Some).0: T); -- _0 = _5; -+ _5 = _1; -+ _0 = _1; +- _5 = copy ((_2 as Some).0: T); +- _0 = copy _5; ++ _5 = copy _1; ++ _0 = copy _1; StorageDead(_5); StorageDead(_2); return; diff --git a/tests/mir-opt/gvn_copy_moves.fn0.GVN.diff b/tests/mir-opt/gvn_copy_moves.fn0.GVN.diff index b12de636f58..c364da7a3cc 100644 --- a/tests/mir-opt/gvn_copy_moves.fn0.GVN.diff +++ b/tests/mir-opt/gvn_copy_moves.fn0.GVN.diff @@ -14,10 +14,10 @@ _2 = [const 42_u128; 6]; - _2[_1] = const 1_u128; + _2[1 of 2] = const 1_u128; - _3 = (_2,); - _4 = _3; -- _5 = fn1(move (_3.0: [u128; 6]), _4) -> [return: bb1, unwind unreachable]; -+ _5 = fn1((_3.0: [u128; 6]), _3) -> [return: bb1, unwind unreachable]; + _3 = (copy _2,); + _4 = copy _3; +- _5 = fn1(move (_3.0: [u128; 6]), copy _4) -> [return: bb1, unwind unreachable]; ++ _5 = fn1(copy (_3.0: [u128; 6]), copy _3) -> [return: bb1, unwind unreachable]; } bb1: { diff --git a/tests/mir-opt/gvn_copy_moves.rs b/tests/mir-opt/gvn_copy_moves.rs index 1812de16d69..b1fe2caf3a1 100644 --- a/tests/mir-opt/gvn_copy_moves.rs +++ b/tests/mir-opt/gvn_copy_moves.rs @@ -18,9 +18,9 @@ fn fn0() { // CHECK-NEXT: _1 = const 1_usize; // CHECK-NEXT: _2 = [const 42_u128; 6]; // CHECK-NEXT: _2[1 of 2] = const 1_u128; - // CHECK-NEXT: _3 = (_2,); - // CHECK-NEXT: _4 = _3; - // CHECK-NEXT: _5 = fn1((_3.0: [u128; 6]), _3) + // CHECK-NEXT: _3 = (copy _2,); + // CHECK-NEXT: _4 = copy _3; + // CHECK-NEXT: _5 = fn1(copy (_3.0: [u128; 6]), copy _3) a = 1_usize; b = [42; 6]; b[a] = 1; diff --git a/tests/mir-opt/gvn_ptr_eq_with_constant.main.GVN.diff b/tests/mir-opt/gvn_ptr_eq_with_constant.main.GVN.diff index 3af78d9b6ce..1e378d30a3e 100644 --- a/tests/mir-opt/gvn_ptr_eq_with_constant.main.GVN.diff +++ b/tests/mir-opt/gvn_ptr_eq_with_constant.main.GVN.diff @@ -25,20 +25,20 @@ StorageLive(_2); StorageLive(_3); - _3 = AlignOf(u8); -- _2 = _3 as *mut u8 (Transmute); +- _2 = copy _3 as *mut u8 (Transmute); + _3 = const 1_usize; + _2 = const {0x1 as *mut u8}; StorageDead(_3); StorageLive(_4); StorageLive(_5); -- _5 = _2; -- _4 = _2 as *const u8 (PtrToPtr); +- _5 = copy _2; +- _4 = copy _2 as *const u8 (PtrToPtr); + _5 = const {0x1 as *mut u8}; + _4 = const {0x1 as *const u8}; StorageDead(_5); StorageLive(_6); - _6 = const Foo::<u8>::SENTINEL as *const u8 (PtrToPtr); -- _1 = Eq(_4, _6); +- _1 = Eq(copy _4, copy _6); + _6 = const {0x1 as *const u8}; + _1 = const true; StorageDead(_6); diff --git a/tests/mir-opt/gvn_uninhabited.f.GVN.panic-abort.diff b/tests/mir-opt/gvn_uninhabited.f.GVN.panic-abort.diff index 626367766d7..37b7b0d2c9d 100644 --- a/tests/mir-opt/gvn_uninhabited.f.GVN.panic-abort.diff +++ b/tests/mir-opt/gvn_uninhabited.f.GVN.panic-abort.diff @@ -17,14 +17,14 @@ StorageLive(_3); _5 = const f::promoted[0]; _3 = &(*_5); -- _2 = ((*_3).1: E); -+ _2 = ((*_5).1: E); +- _2 = copy ((*_3).1: E); ++ _2 = copy ((*_5).1: E); StorageLive(_1); -- _1 = ((_2 as A).1: u32); +- _1 = copy ((_2 as A).1: u32); + _1 = const 0_u32; StorageDead(_3); StorageDead(_2); -- _0 = _1; +- _0 = copy _1; + _0 = const 0_u32; StorageDead(_1); return; diff --git a/tests/mir-opt/gvn_uninhabited.f.GVN.panic-unwind.diff b/tests/mir-opt/gvn_uninhabited.f.GVN.panic-unwind.diff index 626367766d7..37b7b0d2c9d 100644 --- a/tests/mir-opt/gvn_uninhabited.f.GVN.panic-unwind.diff +++ b/tests/mir-opt/gvn_uninhabited.f.GVN.panic-unwind.diff @@ -17,14 +17,14 @@ StorageLive(_3); _5 = const f::promoted[0]; _3 = &(*_5); -- _2 = ((*_3).1: E); -+ _2 = ((*_5).1: E); +- _2 = copy ((*_3).1: E); ++ _2 = copy ((*_5).1: E); StorageLive(_1); -- _1 = ((_2 as A).1: u32); +- _1 = copy ((_2 as A).1: u32); + _1 = const 0_u32; StorageDead(_3); StorageDead(_2); -- _0 = _1; +- _0 = copy _1; + _0 = const 0_u32; StorageDead(_1); return; diff --git a/tests/mir-opt/if_condition_int.dont_opt_bool.SimplifyComparisonIntegral.diff b/tests/mir-opt/if_condition_int.dont_opt_bool.SimplifyComparisonIntegral.diff index 083515aebc6..2350faa05d3 100644 --- a/tests/mir-opt/if_condition_int.dont_opt_bool.SimplifyComparisonIntegral.diff +++ b/tests/mir-opt/if_condition_int.dont_opt_bool.SimplifyComparisonIntegral.diff @@ -8,7 +8,7 @@ bb0: { StorageLive(_2); - _2 = _1; + _2 = copy _1; switchInt(move _2) -> [0: bb2, otherwise: bb1]; } diff --git a/tests/mir-opt/if_condition_int.dont_opt_floats.SimplifyComparisonIntegral.diff b/tests/mir-opt/if_condition_int.dont_opt_floats.SimplifyComparisonIntegral.diff index 15319586062..94570017730 100644 --- a/tests/mir-opt/if_condition_int.dont_opt_floats.SimplifyComparisonIntegral.diff +++ b/tests/mir-opt/if_condition_int.dont_opt_floats.SimplifyComparisonIntegral.diff @@ -10,7 +10,7 @@ bb0: { StorageLive(_2); StorageLive(_3); - _3 = _1; + _3 = copy _1; _2 = Eq(move _3, const -42f32); switchInt(move _2) -> [0: bb2, otherwise: bb1]; } diff --git a/tests/mir-opt/if_condition_int.dont_remove_comparison.SimplifyComparisonIntegral.diff b/tests/mir-opt/if_condition_int.dont_remove_comparison.SimplifyComparisonIntegral.diff index 218d7fd59b7..d19b4148405 100644 --- a/tests/mir-opt/if_condition_int.dont_remove_comparison.SimplifyComparisonIntegral.diff +++ b/tests/mir-opt/if_condition_int.dont_remove_comparison.SimplifyComparisonIntegral.diff @@ -17,11 +17,11 @@ bb0: { StorageLive(_2); StorageLive(_3); - _3 = _1; + _3 = copy _1; - _2 = Eq(move _3, const 17_i8); - StorageDead(_3); -- switchInt(_2) -> [0: bb2, otherwise: bb1]; -+ _2 = Eq(_3, const 17_i8); +- switchInt(copy _2) -> [0: bb2, otherwise: bb1]; ++ _2 = Eq(copy _3, const 17_i8); + nop; + switchInt(move _3) -> [17: bb1, otherwise: bb2]; } @@ -30,7 +30,7 @@ + StorageDead(_3); StorageLive(_6); StorageLive(_7); - _7 = _2; + _7 = copy _2; _6 = move _7 as i32 (IntToInt); StorageDead(_7); _0 = Add(const 100_i32, move _6); @@ -42,7 +42,7 @@ + StorageDead(_3); StorageLive(_4); StorageLive(_5); - _5 = _2; + _5 = copy _2; _4 = move _5 as i32 (IntToInt); StorageDead(_5); _0 = Add(const 10_i32, move _4); diff --git a/tests/mir-opt/if_condition_int.opt_char.SimplifyComparisonIntegral.diff b/tests/mir-opt/if_condition_int.opt_char.SimplifyComparisonIntegral.diff index fedbd6cdd24..e47b7e52259 100644 --- a/tests/mir-opt/if_condition_int.opt_char.SimplifyComparisonIntegral.diff +++ b/tests/mir-opt/if_condition_int.opt_char.SimplifyComparisonIntegral.diff @@ -10,7 +10,7 @@ bb0: { StorageLive(_2); StorageLive(_3); - _3 = _1; + _3 = copy _1; - _2 = Eq(move _3, const 'x'); - switchInt(move _2) -> [0: bb2, otherwise: bb1]; + nop; diff --git a/tests/mir-opt/if_condition_int.opt_i8.SimplifyComparisonIntegral.diff b/tests/mir-opt/if_condition_int.opt_i8.SimplifyComparisonIntegral.diff index 9c38d8fe065..b6cdc6af8bf 100644 --- a/tests/mir-opt/if_condition_int.opt_i8.SimplifyComparisonIntegral.diff +++ b/tests/mir-opt/if_condition_int.opt_i8.SimplifyComparisonIntegral.diff @@ -10,7 +10,7 @@ bb0: { StorageLive(_2); StorageLive(_3); - _3 = _1; + _3 = copy _1; - _2 = Eq(move _3, const 42_i8); - switchInt(move _2) -> [0: bb2, otherwise: bb1]; + nop; diff --git a/tests/mir-opt/if_condition_int.opt_multiple_ifs.SimplifyComparisonIntegral.diff b/tests/mir-opt/if_condition_int.opt_multiple_ifs.SimplifyComparisonIntegral.diff index 8c85ce78565..31745ac732a 100644 --- a/tests/mir-opt/if_condition_int.opt_multiple_ifs.SimplifyComparisonIntegral.diff +++ b/tests/mir-opt/if_condition_int.opt_multiple_ifs.SimplifyComparisonIntegral.diff @@ -12,7 +12,7 @@ bb0: { StorageLive(_2); StorageLive(_3); - _3 = _1; + _3 = copy _1; - _2 = Eq(move _3, const 42_u32); - switchInt(move _2) -> [0: bb2, otherwise: bb1]; + nop; @@ -29,7 +29,7 @@ StorageDead(_3); StorageLive(_4); StorageLive(_5); - _5 = _1; + _5 = copy _1; - _4 = Ne(move _5, const 21_u32); - switchInt(move _4) -> [0: bb4, otherwise: bb3]; + nop; diff --git a/tests/mir-opt/if_condition_int.opt_negative.SimplifyComparisonIntegral.diff b/tests/mir-opt/if_condition_int.opt_negative.SimplifyComparisonIntegral.diff index 876ed61e9fa..d747985f6e1 100644 --- a/tests/mir-opt/if_condition_int.opt_negative.SimplifyComparisonIntegral.diff +++ b/tests/mir-opt/if_condition_int.opt_negative.SimplifyComparisonIntegral.diff @@ -10,7 +10,7 @@ bb0: { StorageLive(_2); StorageLive(_3); - _3 = _1; + _3 = copy _1; - _2 = Eq(move _3, const -42_i32); - switchInt(move _2) -> [0: bb2, otherwise: bb1]; + nop; diff --git a/tests/mir-opt/if_condition_int.opt_u32.SimplifyComparisonIntegral.diff b/tests/mir-opt/if_condition_int.opt_u32.SimplifyComparisonIntegral.diff index ed3eb47dd3d..1d6809a9438 100644 --- a/tests/mir-opt/if_condition_int.opt_u32.SimplifyComparisonIntegral.diff +++ b/tests/mir-opt/if_condition_int.opt_u32.SimplifyComparisonIntegral.diff @@ -10,7 +10,7 @@ bb0: { StorageLive(_2); StorageLive(_3); - _3 = _1; + _3 = copy _1; - _2 = Eq(move _3, const 42_u32); - switchInt(move _2) -> [0: bb2, otherwise: bb1]; + nop; diff --git a/tests/mir-opt/inline/dyn_trait.get_query.Inline.panic-abort.diff b/tests/mir-opt/inline/dyn_trait.get_query.Inline.panic-abort.diff index 4e495c37fbc..2d64d49ce5c 100644 --- a/tests/mir-opt/inline/dyn_trait.get_query.Inline.panic-abort.diff +++ b/tests/mir-opt/inline/dyn_trait.get_query.Inline.panic-abort.diff @@ -21,17 +21,17 @@ bb0: { StorageLive(_2); StorageLive(_3); - _3 = _1; + _3 = copy _1; _2 = <Q as Query>::cache::<T>(move _3) -> [return: bb1, unwind unreachable]; } bb1: { StorageDead(_3); StorageLive(_4); - _4 = _2; + _4 = copy _2; - _0 = try_execute_query::<<Q as Query>::C>(move _4) -> [return: bb2, unwind unreachable]; + StorageLive(_5); -+ _5 = _4 as &dyn Cache<V = <Q as Query>::V> (PointerCoercion(Unsize)); ++ _5 = copy _4 as &dyn Cache<V = <Q as Query>::V> (PointerCoercion(Unsize)); + _0 = <dyn Cache<V = <Q as Query>::V> as Cache>::store_nocache(move _5) -> [return: bb2, unwind unreachable]; } diff --git a/tests/mir-opt/inline/dyn_trait.get_query.Inline.panic-unwind.diff b/tests/mir-opt/inline/dyn_trait.get_query.Inline.panic-unwind.diff index 7fdb7618212..c5e9654e19c 100644 --- a/tests/mir-opt/inline/dyn_trait.get_query.Inline.panic-unwind.diff +++ b/tests/mir-opt/inline/dyn_trait.get_query.Inline.panic-unwind.diff @@ -21,17 +21,17 @@ bb0: { StorageLive(_2); StorageLive(_3); - _3 = _1; + _3 = copy _1; _2 = <Q as Query>::cache::<T>(move _3) -> [return: bb1, unwind continue]; } bb1: { StorageDead(_3); StorageLive(_4); - _4 = _2; + _4 = copy _2; - _0 = try_execute_query::<<Q as Query>::C>(move _4) -> [return: bb2, unwind continue]; + StorageLive(_5); -+ _5 = _4 as &dyn Cache<V = <Q as Query>::V> (PointerCoercion(Unsize)); ++ _5 = copy _4 as &dyn Cache<V = <Q as Query>::V> (PointerCoercion(Unsize)); + _0 = <dyn Cache<V = <Q as Query>::V> as Cache>::store_nocache(move _5) -> [return: bb2, unwind continue]; } diff --git a/tests/mir-opt/inline/dyn_trait.mk_cycle.Inline.panic-abort.diff b/tests/mir-opt/inline/dyn_trait.mk_cycle.Inline.panic-abort.diff index 8df4408690b..13bc54424d1 100644 --- a/tests/mir-opt/inline/dyn_trait.mk_cycle.Inline.panic-abort.diff +++ b/tests/mir-opt/inline/dyn_trait.mk_cycle.Inline.panic-abort.diff @@ -8,7 +8,7 @@ bb0: { StorageLive(_2); - _2 = _1; + _2 = copy _1; _0 = <dyn Cache<V = V> as Cache>::store_nocache(move _2) -> [return: bb1, unwind unreachable]; } diff --git a/tests/mir-opt/inline/dyn_trait.mk_cycle.Inline.panic-unwind.diff b/tests/mir-opt/inline/dyn_trait.mk_cycle.Inline.panic-unwind.diff index 43a0621f766..35d4db37802 100644 --- a/tests/mir-opt/inline/dyn_trait.mk_cycle.Inline.panic-unwind.diff +++ b/tests/mir-opt/inline/dyn_trait.mk_cycle.Inline.panic-unwind.diff @@ -8,7 +8,7 @@ bb0: { StorageLive(_2); - _2 = _1; + _2 = copy _1; _0 = <dyn Cache<V = V> as Cache>::store_nocache(move _2) -> [return: bb1, unwind continue]; } diff --git a/tests/mir-opt/inline/dyn_trait.try_execute_query.Inline.panic-abort.diff b/tests/mir-opt/inline/dyn_trait.try_execute_query.Inline.panic-abort.diff index e72c312f549..f02ca623317 100644 --- a/tests/mir-opt/inline/dyn_trait.try_execute_query.Inline.panic-abort.diff +++ b/tests/mir-opt/inline/dyn_trait.try_execute_query.Inline.panic-abort.diff @@ -13,7 +13,7 @@ bb0: { StorageLive(_2); StorageLive(_3); - _3 = _1; + _3 = copy _1; _2 = move _3 as &dyn Cache<V = <C as Cache>::V> (PointerCoercion(Unsize)); StorageDead(_3); - _0 = mk_cycle::<<C as Cache>::V>(move _2) -> [return: bb1, unwind unreachable]; diff --git a/tests/mir-opt/inline/dyn_trait.try_execute_query.Inline.panic-unwind.diff b/tests/mir-opt/inline/dyn_trait.try_execute_query.Inline.panic-unwind.diff index 46728f9e2e6..31080dff4de 100644 --- a/tests/mir-opt/inline/dyn_trait.try_execute_query.Inline.panic-unwind.diff +++ b/tests/mir-opt/inline/dyn_trait.try_execute_query.Inline.panic-unwind.diff @@ -13,7 +13,7 @@ bb0: { StorageLive(_2); StorageLive(_3); - _3 = _1; + _3 = copy _1; _2 = move _3 as &dyn Cache<V = <C as Cache>::V> (PointerCoercion(Unsize)); StorageDead(_3); - _0 = mk_cycle::<<C as Cache>::V>(move _2) -> [return: bb1, unwind continue]; diff --git a/tests/mir-opt/inline/inline_any_operand.bar.Inline.after.mir b/tests/mir-opt/inline/inline_any_operand.bar.Inline.after.mir index 2d0b71e0a64..0ee5968419a 100644 --- a/tests/mir-opt/inline/inline_any_operand.bar.Inline.after.mir +++ b/tests/mir-opt/inline/inline_any_operand.bar.Inline.after.mir @@ -18,12 +18,12 @@ fn bar() -> bool { StorageLive(_1); _1 = foo; StorageLive(_2); - _2 = _1; + _2 = copy _1; StorageLive(_3); _3 = const 1_i32; StorageLive(_4); _4 = const -1_i32; - _0 = Eq(_3, _4); + _0 = Eq(copy _3, copy _4); StorageDead(_4); StorageDead(_3); StorageDead(_2); diff --git a/tests/mir-opt/inline/inline_closure.foo.Inline.after.mir b/tests/mir-opt/inline/inline_closure.foo.Inline.after.mir index 8a60f4b1bdc..5bc227c87df 100644 --- a/tests/mir-opt/inline/inline_closure.foo.Inline.after.mir +++ b/tests/mir-opt/inline/inline_closure.foo.Inline.after.mir @@ -26,15 +26,15 @@ fn foo(_1: T, _2: i32) -> i32 { _4 = &_3; StorageLive(_5); StorageLive(_6); - _6 = _2; + _6 = copy _2; StorageLive(_7); - _7 = _2; + _7 = copy _2; _5 = (move _6, move _7); StorageLive(_8); _8 = move (_5.0: i32); StorageLive(_9); _9 = move (_5.1: i32); - _0 = _8; + _0 = copy _8; StorageDead(_9); StorageDead(_8); StorageDead(_7); diff --git a/tests/mir-opt/inline/inline_closure_borrows_arg.foo.Inline.after.mir b/tests/mir-opt/inline/inline_closure_borrows_arg.foo.Inline.after.mir index f524b054b61..7930111cf22 100644 --- a/tests/mir-opt/inline/inline_closure_borrows_arg.foo.Inline.after.mir +++ b/tests/mir-opt/inline/inline_closure_borrows_arg.foo.Inline.after.mir @@ -26,15 +26,15 @@ fn foo(_1: T, _2: &i32) -> i32 { _4 = &_3; StorageLive(_5); StorageLive(_6); - _6 = _2; + _6 = copy _2; StorageLive(_7); - _7 = _2; + _7 = copy _2; _5 = (move _6, move _7); StorageLive(_8); _8 = move (_5.0: &i32); StorageLive(_9); _9 = move (_5.1: &i32); - _0 = (*_8); + _0 = copy (*_8); StorageDead(_9); StorageDead(_8); StorageDead(_7); diff --git a/tests/mir-opt/inline/inline_closure_captures.foo.Inline.after.mir b/tests/mir-opt/inline/inline_closure_captures.foo.Inline.after.mir index 2f9d28ea093..17e6e39a86b 100644 --- a/tests/mir-opt/inline/inline_closure_captures.foo.Inline.after.mir +++ b/tests/mir-opt/inline/inline_closure_captures.foo.Inline.after.mir @@ -34,18 +34,18 @@ fn foo(_1: T, _2: i32) -> (i32, T) { _6 = &_3; StorageLive(_7); StorageLive(_8); - _8 = _2; + _8 = copy _2; _7 = (move _8,); StorageLive(_9); _9 = move (_7.0: i32); StorageLive(_10); StorageLive(_12); StorageLive(_11); - _10 = ((*_6).0: &i32); - _11 = (*_10); + _10 = copy ((*_6).0: &i32); + _11 = copy (*_10); StorageLive(_13); - _12 = ((*_6).1: &T); - _13 = (*_12); + _12 = copy ((*_6).1: &T); + _13 = copy (*_12); _0 = (move _11, move _13); StorageDead(_13); StorageDead(_11); diff --git a/tests/mir-opt/inline/inline_coroutine.main.Inline.panic-abort.diff b/tests/mir-opt/inline/inline_coroutine.main.Inline.panic-abort.diff index 07031a298bc..94017f028cc 100644 --- a/tests/mir-opt/inline/inline_coroutine.main.Inline.panic-abort.diff +++ b/tests/mir-opt/inline/inline_coroutine.main.Inline.panic-abort.diff @@ -34,13 +34,13 @@ - _4 = g() -> [return: bb1, unwind unreachable]; + _4 = {coroutine@$DIR/inline_coroutine.rs:20:5: 20:8 (#0)}; + _3 = &mut _4; -+ _2 = Pin::<&mut {coroutine@$DIR/inline_coroutine.rs:20:5: 20:8}> { __pointer: _3 }; ++ _2 = Pin::<&mut {coroutine@$DIR/inline_coroutine.rs:20:5: 20:8}> { __pointer: copy _3 }; + StorageDead(_3); + StorageLive(_5); + _5 = const false; + StorageLive(_6); + StorageLive(_7); -+ _6 = (_2.0: &mut {coroutine@$DIR/inline_coroutine.rs:20:5: 20:8}); ++ _6 = copy (_2.0: &mut {coroutine@$DIR/inline_coroutine.rs:20:5: 20:8}); + _7 = discriminant((*_6)); + switchInt(move _7) -> [0: bb3, 1: bb7, 3: bb8, otherwise: bb9]; } @@ -68,7 +68,7 @@ - StorageDead(_2); - drop(_4) -> [return: bb4, unwind unreachable]; + StorageLive(_8); -+ switchInt(_5) -> [0: bb4, otherwise: bb5]; ++ switchInt(copy _5) -> [0: bb4, otherwise: bb5]; } bb4: { @@ -99,7 +99,7 @@ + bb8: { + StorageLive(_8); + StorageDead(_8); -+ _1 = CoroutineState::<i32, bool>::Complete(_5); ++ _1 = CoroutineState::<i32, bool>::Complete(copy _5); + discriminant((*_6)) = 1; + goto -> bb2; + } diff --git a/tests/mir-opt/inline/inline_coroutine.main.Inline.panic-unwind.diff b/tests/mir-opt/inline/inline_coroutine.main.Inline.panic-unwind.diff index ab6c62b0baf..858f9ace9b4 100644 --- a/tests/mir-opt/inline/inline_coroutine.main.Inline.panic-unwind.diff +++ b/tests/mir-opt/inline/inline_coroutine.main.Inline.panic-unwind.diff @@ -34,13 +34,13 @@ - _4 = g() -> [return: bb1, unwind continue]; + _4 = {coroutine@$DIR/inline_coroutine.rs:20:5: 20:8 (#0)}; + _3 = &mut _4; -+ _2 = Pin::<&mut {coroutine@$DIR/inline_coroutine.rs:20:5: 20:8}> { __pointer: _3 }; ++ _2 = Pin::<&mut {coroutine@$DIR/inline_coroutine.rs:20:5: 20:8}> { __pointer: copy _3 }; + StorageDead(_3); + StorageLive(_5); + _5 = const false; + StorageLive(_6); + StorageLive(_7); -+ _6 = (_2.0: &mut {coroutine@$DIR/inline_coroutine.rs:20:5: 20:8}); ++ _6 = copy (_2.0: &mut {coroutine@$DIR/inline_coroutine.rs:20:5: 20:8}); + _7 = discriminant((*_6)); + switchInt(move _7) -> [0: bb5, 1: bb9, 3: bb10, otherwise: bb11]; } @@ -84,7 +84,7 @@ - drop(_4) -> [return: bb6, unwind terminate(cleanup)]; + bb5: { + StorageLive(_8); -+ switchInt(_5) -> [0: bb6, otherwise: bb7]; ++ switchInt(copy _5) -> [0: bb6, otherwise: bb7]; } - bb6 (cleanup): { @@ -113,7 +113,7 @@ + bb10: { + StorageLive(_8); + StorageDead(_8); -+ _1 = CoroutineState::<i32, bool>::Complete(_5); ++ _1 = CoroutineState::<i32, bool>::Complete(copy _5); + discriminant((*_6)) = 1; + goto -> bb4; + } diff --git a/tests/mir-opt/inline/inline_diverging.g.Inline.panic-abort.diff b/tests/mir-opt/inline/inline_diverging.g.Inline.panic-abort.diff index d675695eb10..bda85586515 100644 --- a/tests/mir-opt/inline/inline_diverging.g.Inline.panic-abort.diff +++ b/tests/mir-opt/inline/inline_diverging.g.Inline.panic-abort.diff @@ -16,7 +16,7 @@ bb0: { StorageLive(_2); StorageLive(_3); - _3 = _1; + _3 = copy _1; _2 = Gt(move _3, const 0_i32); switchInt(move _2) -> [0: bb2, otherwise: bb1]; } @@ -24,7 +24,7 @@ bb1: { StorageDead(_3); StorageLive(_4); - _4 = _1; + _4 = copy _1; _0 = move _4 as u32 (IntToInt); StorageDead(_4); StorageDead(_2); diff --git a/tests/mir-opt/inline/inline_diverging.g.Inline.panic-unwind.diff b/tests/mir-opt/inline/inline_diverging.g.Inline.panic-unwind.diff index 1142616115f..ecd72d2b37f 100644 --- a/tests/mir-opt/inline/inline_diverging.g.Inline.panic-unwind.diff +++ b/tests/mir-opt/inline/inline_diverging.g.Inline.panic-unwind.diff @@ -16,7 +16,7 @@ bb0: { StorageLive(_2); StorageLive(_3); - _3 = _1; + _3 = copy _1; _2 = Gt(move _3, const 0_i32); switchInt(move _2) -> [0: bb2, otherwise: bb1]; } @@ -24,7 +24,7 @@ bb1: { StorageDead(_3); StorageLive(_4); - _4 = _1; + _4 = copy _1; _0 = move _4 as u32 (IntToInt); StorageDead(_4); StorageDead(_2); diff --git a/tests/mir-opt/inline/inline_diverging.h.Inline.panic-abort.diff b/tests/mir-opt/inline/inline_diverging.h.Inline.panic-abort.diff index 2bbb830fc77..338dca85e5c 100644 --- a/tests/mir-opt/inline/inline_diverging.h.Inline.panic-abort.diff +++ b/tests/mir-opt/inline/inline_diverging.h.Inline.panic-abort.diff @@ -40,7 +40,7 @@ + + bb2: { + StorageDead(_5); -+ _1 = (_4, _6); ++ _1 = (copy _4, copy _6); + drop(_2) -> [return: bb3, unwind unreachable]; + } + diff --git a/tests/mir-opt/inline/inline_diverging.h.Inline.panic-unwind.diff b/tests/mir-opt/inline/inline_diverging.h.Inline.panic-unwind.diff index bc4f2d24df0..a77cb913bfd 100644 --- a/tests/mir-opt/inline/inline_diverging.h.Inline.panic-unwind.diff +++ b/tests/mir-opt/inline/inline_diverging.h.Inline.panic-unwind.diff @@ -43,7 +43,7 @@ + StorageDead(_5); + StorageLive(_7); + _7 = move _4; -+ _1 = (move _7, _6); ++ _1 = (move _7, copy _6); + StorageDead(_7); + StorageDead(_4); + drop(_2) -> [return: bb3, unwind continue]; diff --git a/tests/mir-opt/inline/inline_more_in_non_inline.marked_inline_direct.Inline.after.panic-abort.mir b/tests/mir-opt/inline/inline_more_in_non_inline.marked_inline_direct.Inline.after.panic-abort.mir index 522f772c6f4..9b28aeb271d 100644 --- a/tests/mir-opt/inline/inline_more_in_non_inline.marked_inline_direct.Inline.after.panic-abort.mir +++ b/tests/mir-opt/inline/inline_more_in_non_inline.marked_inline_direct.Inline.after.panic-abort.mir @@ -9,7 +9,7 @@ fn marked_inline_direct(_1: i32) -> () { bb0: { StorageLive(_2); StorageLive(_3); - _3 = _1; + _3 = copy _1; _2 = call_twice(move _3) -> [return: bb1, unwind unreachable]; } diff --git a/tests/mir-opt/inline/inline_more_in_non_inline.marked_inline_direct.Inline.after.panic-unwind.mir b/tests/mir-opt/inline/inline_more_in_non_inline.marked_inline_direct.Inline.after.panic-unwind.mir index 722b02eeba8..929c89940dc 100644 --- a/tests/mir-opt/inline/inline_more_in_non_inline.marked_inline_direct.Inline.after.panic-unwind.mir +++ b/tests/mir-opt/inline/inline_more_in_non_inline.marked_inline_direct.Inline.after.panic-unwind.mir @@ -9,7 +9,7 @@ fn marked_inline_direct(_1: i32) -> () { bb0: { StorageLive(_2); StorageLive(_3); - _3 = _1; + _3 = copy _1; _2 = call_twice(move _3) -> [return: bb1, unwind continue]; } diff --git a/tests/mir-opt/inline/inline_more_in_non_inline.marked_inline_indirect.Inline.after.panic-abort.mir b/tests/mir-opt/inline/inline_more_in_non_inline.marked_inline_indirect.Inline.after.panic-abort.mir index 63b91cbce2d..374ed294d8b 100644 --- a/tests/mir-opt/inline/inline_more_in_non_inline.marked_inline_indirect.Inline.after.panic-abort.mir +++ b/tests/mir-opt/inline/inline_more_in_non_inline.marked_inline_indirect.Inline.after.panic-abort.mir @@ -12,7 +12,7 @@ fn marked_inline_indirect(_1: i32) -> () { bb0: { StorageLive(_2); StorageLive(_3); - _3 = _1; + _3 = copy _1; StorageLive(_4); _4 = call_twice(move _3) -> [return: bb1, unwind unreachable]; } diff --git a/tests/mir-opt/inline/inline_more_in_non_inline.marked_inline_indirect.Inline.after.panic-unwind.mir b/tests/mir-opt/inline/inline_more_in_non_inline.marked_inline_indirect.Inline.after.panic-unwind.mir index 7c84e98dd51..97bed8020ba 100644 --- a/tests/mir-opt/inline/inline_more_in_non_inline.marked_inline_indirect.Inline.after.panic-unwind.mir +++ b/tests/mir-opt/inline/inline_more_in_non_inline.marked_inline_indirect.Inline.after.panic-unwind.mir @@ -12,7 +12,7 @@ fn marked_inline_indirect(_1: i32) -> () { bb0: { StorageLive(_2); StorageLive(_3); - _3 = _1; + _3 = copy _1; StorageLive(_4); _4 = call_twice(move _3) -> [return: bb1, unwind continue]; } diff --git a/tests/mir-opt/inline/inline_more_in_non_inline.monomorphic_not_inline.Inline.after.panic-abort.mir b/tests/mir-opt/inline/inline_more_in_non_inline.monomorphic_not_inline.Inline.after.panic-abort.mir index 989014b8b47..cffe0e96f5c 100644 --- a/tests/mir-opt/inline/inline_more_in_non_inline.monomorphic_not_inline.Inline.after.panic-abort.mir +++ b/tests/mir-opt/inline/inline_more_in_non_inline.monomorphic_not_inline.Inline.after.panic-abort.mir @@ -13,10 +13,10 @@ fn monomorphic_not_inline(_1: i32) -> () { bb0: { StorageLive(_2); StorageLive(_3); - _3 = _1; + _3 = copy _1; StorageLive(_4); StorageLive(_5); - _4 = other_thing(_3) -> [return: bb2, unwind unreachable]; + _4 = other_thing(copy _3) -> [return: bb2, unwind unreachable]; } bb1: { diff --git a/tests/mir-opt/inline/inline_more_in_non_inline.monomorphic_not_inline.Inline.after.panic-unwind.mir b/tests/mir-opt/inline/inline_more_in_non_inline.monomorphic_not_inline.Inline.after.panic-unwind.mir index bd200719bbb..7f3a093012b 100644 --- a/tests/mir-opt/inline/inline_more_in_non_inline.monomorphic_not_inline.Inline.after.panic-unwind.mir +++ b/tests/mir-opt/inline/inline_more_in_non_inline.monomorphic_not_inline.Inline.after.panic-unwind.mir @@ -13,10 +13,10 @@ fn monomorphic_not_inline(_1: i32) -> () { bb0: { StorageLive(_2); StorageLive(_3); - _3 = _1; + _3 = copy _1; StorageLive(_4); StorageLive(_5); - _4 = other_thing(_3) -> [return: bb2, unwind continue]; + _4 = other_thing(copy _3) -> [return: bb2, unwind continue]; } bb1: { diff --git a/tests/mir-opt/inline/inline_retag.bar.Inline.after.mir b/tests/mir-opt/inline/inline_retag.bar.Inline.after.mir index ec3c79e2a37..9a256ea1949 100644 --- a/tests/mir-opt/inline/inline_retag.bar.Inline.after.mir +++ b/tests/mir-opt/inline/inline_retag.bar.Inline.after.mir @@ -26,25 +26,25 @@ fn bar() -> bool { StorageLive(_1); _1 = foo; StorageLive(_2); - _2 = _1; + _2 = copy _1; StorageLive(_3); StorageLive(_4); _10 = const bar::promoted[1]; Retag(_10); - _4 = _10; - _3 = _4; + _4 = copy _10; + _3 = copy _4; StorageLive(_6); StorageLive(_7); _9 = const bar::promoted[0]; Retag(_9); - _7 = _9; - _6 = _7; + _7 = copy _9; + _6 = copy _7; Retag(_3); Retag(_6); StorageLive(_11); - _11 = (*_3); + _11 = copy (*_3); StorageLive(_12); - _12 = (*_6); + _12 = copy (*_6); _0 = Eq(move _11, move _12); StorageDead(_12); StorageDead(_11); diff --git a/tests/mir-opt/inline/inline_shims.clone.Inline.panic-abort.diff b/tests/mir-opt/inline/inline_shims.clone.Inline.panic-abort.diff index 8117e58fa51..26b4dc357f3 100644 --- a/tests/mir-opt/inline/inline_shims.clone.Inline.panic-abort.diff +++ b/tests/mir-opt/inline/inline_shims.clone.Inline.panic-abort.diff @@ -15,7 +15,7 @@ - } - - bb1: { -+ _0 = (*_2); ++ _0 = copy (*_2); StorageDead(_2); return; } diff --git a/tests/mir-opt/inline/inline_shims.clone.Inline.panic-unwind.diff b/tests/mir-opt/inline/inline_shims.clone.Inline.panic-unwind.diff index 00e92a0f5e5..faa12d5c736 100644 --- a/tests/mir-opt/inline/inline_shims.clone.Inline.panic-unwind.diff +++ b/tests/mir-opt/inline/inline_shims.clone.Inline.panic-unwind.diff @@ -15,7 +15,7 @@ - } - - bb1: { -+ _0 = (*_2); ++ _0 = copy (*_2); StorageDead(_2); return; } diff --git a/tests/mir-opt/inline/inline_shims.drop.Inline.panic-abort.diff b/tests/mir-opt/inline/inline_shims.drop.Inline.panic-abort.diff index 2a36ccaab11..581244074b3 100644 --- a/tests/mir-opt/inline/inline_shims.drop.Inline.panic-abort.diff +++ b/tests/mir-opt/inline/inline_shims.drop.Inline.panic-abort.diff @@ -20,7 +20,7 @@ bb0: { StorageLive(_3); StorageLive(_4); - _4 = _1; + _4 = copy _1; - _3 = std::ptr::drop_in_place::<Vec<A>>(move _4) -> [return: bb1, unwind unreachable]; + StorageLive(_6); + StorageLive(_7); @@ -34,7 +34,7 @@ StorageDead(_4); StorageDead(_3); StorageLive(_5); - _5 = _2; + _5 = copy _2; - _0 = std::ptr::drop_in_place::<Option<B>>(move _5) -> [return: bb2, unwind unreachable]; + StorageLive(_8); + StorageLive(_9); diff --git a/tests/mir-opt/inline/inline_shims.drop.Inline.panic-unwind.diff b/tests/mir-opt/inline/inline_shims.drop.Inline.panic-unwind.diff index e11561076e6..d89ca003d77 100644 --- a/tests/mir-opt/inline/inline_shims.drop.Inline.panic-unwind.diff +++ b/tests/mir-opt/inline/inline_shims.drop.Inline.panic-unwind.diff @@ -16,7 +16,7 @@ bb0: { StorageLive(_3); StorageLive(_4); - _4 = _1; + _4 = copy _1; _3 = std::ptr::drop_in_place::<Vec<A>>(move _4) -> [return: bb1, unwind continue]; } @@ -24,7 +24,7 @@ StorageDead(_4); StorageDead(_3); StorageLive(_5); - _5 = _2; + _5 = copy _2; - _0 = std::ptr::drop_in_place::<Option<B>>(move _5) -> [return: bb2, unwind continue]; + StorageLive(_6); + StorageLive(_7); diff --git a/tests/mir-opt/inline/inline_trait_method.test.Inline.after.panic-abort.mir b/tests/mir-opt/inline/inline_trait_method.test.Inline.after.panic-abort.mir index d7b4302b06d..8355cd0070d 100644 --- a/tests/mir-opt/inline/inline_trait_method.test.Inline.after.panic-abort.mir +++ b/tests/mir-opt/inline/inline_trait_method.test.Inline.after.panic-abort.mir @@ -7,7 +7,7 @@ fn test(_1: &dyn X) -> u32 { bb0: { StorageLive(_2); - _2 = _1; + _2 = copy _1; _0 = <dyn X as X>::y(move _2) -> [return: bb1, unwind unreachable]; } diff --git a/tests/mir-opt/inline/inline_trait_method.test.Inline.after.panic-unwind.mir b/tests/mir-opt/inline/inline_trait_method.test.Inline.after.panic-unwind.mir index 0d6f3e61f71..ebfbfeb0b13 100644 --- a/tests/mir-opt/inline/inline_trait_method.test.Inline.after.panic-unwind.mir +++ b/tests/mir-opt/inline/inline_trait_method.test.Inline.after.panic-unwind.mir @@ -7,7 +7,7 @@ fn test(_1: &dyn X) -> u32 { bb0: { StorageLive(_2); - _2 = _1; + _2 = copy _1; _0 = <dyn X as X>::y(move _2) -> [return: bb1, unwind continue]; } diff --git a/tests/mir-opt/inline/inline_trait_method_2.test2.Inline.after.panic-abort.mir b/tests/mir-opt/inline/inline_trait_method_2.test2.Inline.after.panic-abort.mir index af79c7ce196..1105dba06ac 100644 --- a/tests/mir-opt/inline/inline_trait_method_2.test2.Inline.after.panic-abort.mir +++ b/tests/mir-opt/inline/inline_trait_method_2.test2.Inline.after.panic-abort.mir @@ -12,7 +12,7 @@ fn test2(_1: &dyn X) -> bool { bb0: { StorageLive(_2); StorageLive(_3); - _3 = _1; + _3 = copy _1; _2 = move _3; StorageDead(_3); _0 = <dyn X as X>::y(move _2) -> [return: bb1, unwind unreachable]; diff --git a/tests/mir-opt/inline/inline_trait_method_2.test2.Inline.after.panic-unwind.mir b/tests/mir-opt/inline/inline_trait_method_2.test2.Inline.after.panic-unwind.mir index bf5a56b8e62..faa6ef47b18 100644 --- a/tests/mir-opt/inline/inline_trait_method_2.test2.Inline.after.panic-unwind.mir +++ b/tests/mir-opt/inline/inline_trait_method_2.test2.Inline.after.panic-unwind.mir @@ -12,7 +12,7 @@ fn test2(_1: &dyn X) -> bool { bb0: { StorageLive(_2); StorageLive(_3); - _3 = _1; + _3 = copy _1; _2 = move _3; StorageDead(_3); _0 = <dyn X as X>::y(move _2) -> [return: bb1, unwind continue]; diff --git a/tests/mir-opt/inline/issue_106141.outer.Inline.panic-abort.diff b/tests/mir-opt/inline/issue_106141.outer.Inline.panic-abort.diff index 2ab79cc2a50..e87a565f0fc 100644 --- a/tests/mir-opt/inline/issue_106141.outer.Inline.panic-abort.diff +++ b/tests/mir-opt/inline/issue_106141.outer.Inline.panic-abort.diff @@ -25,12 +25,12 @@ bb1: { + StorageLive(_3); -+ _2 = Lt(_0, const 1_usize); -+ assert(move _2, "index out of bounds: the length is {} but the index is {}", const 1_usize, _0) -> [success: bb2, unwind unreachable]; ++ _2 = Lt(copy _0, const 1_usize); ++ assert(move _2, "index out of bounds: the length is {} but the index is {}", const 1_usize, copy _0) -> [success: bb2, unwind unreachable]; + } + + bb2: { -+ _3 = (*_1)[_0]; ++ _3 = copy (*_1)[_0]; + switchInt(move _3) -> [0: bb3, otherwise: bb4]; + } + diff --git a/tests/mir-opt/inline/issue_106141.outer.Inline.panic-unwind.diff b/tests/mir-opt/inline/issue_106141.outer.Inline.panic-unwind.diff index 4d96a862885..834851b75ad 100644 --- a/tests/mir-opt/inline/issue_106141.outer.Inline.panic-unwind.diff +++ b/tests/mir-opt/inline/issue_106141.outer.Inline.panic-unwind.diff @@ -25,12 +25,12 @@ bb1: { + StorageLive(_3); -+ _2 = Lt(_0, const 1_usize); -+ assert(move _2, "index out of bounds: the length is {} but the index is {}", const 1_usize, _0) -> [success: bb2, unwind continue]; ++ _2 = Lt(copy _0, const 1_usize); ++ assert(move _2, "index out of bounds: the length is {} but the index is {}", const 1_usize, copy _0) -> [success: bb2, unwind continue]; + } + + bb2: { -+ _3 = (*_1)[_0]; ++ _3 = copy (*_1)[_0]; + switchInt(move _3) -> [0: bb3, otherwise: bb4]; + } + diff --git a/tests/mir-opt/inline/issue_58867_inline_as_ref_as_mut.a.Inline.after.mir b/tests/mir-opt/inline/issue_58867_inline_as_ref_as_mut.a.Inline.after.mir index 8c457037ec9..a48a9a0bb0c 100644 --- a/tests/mir-opt/inline/issue_58867_inline_as_ref_as_mut.a.Inline.after.mir +++ b/tests/mir-opt/inline/issue_58867_inline_as_ref_as_mut.a.Inline.after.mir @@ -14,11 +14,11 @@ fn a(_1: &mut [T]) -> &mut [T] { StorageLive(_2); StorageLive(_3); StorageLive(_4); - _4 = _1; - _3 = _4; - _2 = _3; + _4 = copy _1; + _3 = copy _4; + _2 = copy _3; StorageDead(_4); - _0 = _2; + _0 = copy _2; StorageDead(_3); StorageDead(_2); return; diff --git a/tests/mir-opt/inline/issue_58867_inline_as_ref_as_mut.b.Inline.after.mir b/tests/mir-opt/inline/issue_58867_inline_as_ref_as_mut.b.Inline.after.mir index e27d9fe38c7..02aadfc1de0 100644 --- a/tests/mir-opt/inline/issue_58867_inline_as_ref_as_mut.b.Inline.after.mir +++ b/tests/mir-opt/inline/issue_58867_inline_as_ref_as_mut.b.Inline.after.mir @@ -16,17 +16,17 @@ fn b(_1: &mut Box<T>) -> &mut T { StorageLive(_2); StorageLive(_3); StorageLive(_4); - _4 = _1; + _4 = copy _1; StorageLive(_5); StorageLive(_6); - _5 = (*_4); - _6 = (((_5.0: std::ptr::Unique<T>).0: std::ptr::NonNull<T>).0: *const T); + _5 = copy (*_4); + _6 = copy (((_5.0: std::ptr::Unique<T>).0: std::ptr::NonNull<T>).0: *const T); _3 = &mut (*_6); StorageDead(_6); StorageDead(_5); - _2 = _3; + _2 = copy _3; StorageDead(_4); - _0 = _2; + _0 = copy _2; StorageDead(_3); StorageDead(_2); return; diff --git a/tests/mir-opt/inline/issue_58867_inline_as_ref_as_mut.c.Inline.after.mir b/tests/mir-opt/inline/issue_58867_inline_as_ref_as_mut.c.Inline.after.mir index da0464c64d6..2d88f9e5524 100644 --- a/tests/mir-opt/inline/issue_58867_inline_as_ref_as_mut.c.Inline.after.mir +++ b/tests/mir-opt/inline/issue_58867_inline_as_ref_as_mut.c.Inline.after.mir @@ -12,9 +12,9 @@ fn c(_1: &[T]) -> &[T] { bb0: { StorageLive(_2); StorageLive(_3); - _3 = _1; - _2 = _3; - _0 = _2; + _3 = copy _1; + _2 = copy _3; + _0 = copy _2; StorageDead(_3); StorageDead(_2); return; diff --git a/tests/mir-opt/inline/issue_58867_inline_as_ref_as_mut.d.Inline.after.mir b/tests/mir-opt/inline/issue_58867_inline_as_ref_as_mut.d.Inline.after.mir index 25eaedfc842..1ea347510fd 100644 --- a/tests/mir-opt/inline/issue_58867_inline_as_ref_as_mut.d.Inline.after.mir +++ b/tests/mir-opt/inline/issue_58867_inline_as_ref_as_mut.d.Inline.after.mir @@ -14,15 +14,15 @@ fn d(_1: &Box<T>) -> &T { bb0: { StorageLive(_2); StorageLive(_3); - _3 = _1; + _3 = copy _1; StorageLive(_4); StorageLive(_5); - _4 = (*_3); - _5 = (((_4.0: std::ptr::Unique<T>).0: std::ptr::NonNull<T>).0: *const T); + _4 = copy (*_3); + _5 = copy (((_4.0: std::ptr::Unique<T>).0: std::ptr::NonNull<T>).0: *const T); _2 = &(*_5); StorageDead(_5); StorageDead(_4); - _0 = _2; + _0 = copy _2; StorageDead(_3); StorageDead(_2); return; diff --git a/tests/mir-opt/inline/unchecked_shifts.unchecked_shl_unsigned_smaller.Inline.panic-abort.diff b/tests/mir-opt/inline/unchecked_shifts.unchecked_shl_unsigned_smaller.Inline.panic-abort.diff index 0d9d58316ea..f36157a762c 100644 --- a/tests/mir-opt/inline/unchecked_shifts.unchecked_shl_unsigned_smaller.Inline.panic-abort.diff +++ b/tests/mir-opt/inline/unchecked_shifts.unchecked_shl_unsigned_smaller.Inline.panic-abort.diff @@ -18,9 +18,9 @@ bb0: { StorageLive(_3); - _3 = _1; + _3 = copy _1; StorageLive(_4); - _4 = _2; + _4 = copy _2; - _0 = core::num::<impl u16>::unchecked_shl(move _3, move _4) -> [return: bb1, unwind unreachable]; + StorageLive(_6); + StorageLive(_5); @@ -29,12 +29,12 @@ } bb1: { -+ _6 = core::num::<impl u16>::unchecked_shl::precondition_check(_4) -> [return: bb2, unwind unreachable]; ++ _6 = core::num::<impl u16>::unchecked_shl::precondition_check(copy _4) -> [return: bb2, unwind unreachable]; + } + + bb2: { + StorageDead(_5); -+ _0 = ShlUnchecked(_3, _4); ++ _0 = ShlUnchecked(copy _3, copy _4); + StorageDead(_6); StorageDead(_4); StorageDead(_3); diff --git a/tests/mir-opt/inline/unchecked_shifts.unchecked_shl_unsigned_smaller.Inline.panic-unwind.diff b/tests/mir-opt/inline/unchecked_shifts.unchecked_shl_unsigned_smaller.Inline.panic-unwind.diff index 82f7eceaa18..be1b066c6c1 100644 --- a/tests/mir-opt/inline/unchecked_shifts.unchecked_shl_unsigned_smaller.Inline.panic-unwind.diff +++ b/tests/mir-opt/inline/unchecked_shifts.unchecked_shl_unsigned_smaller.Inline.panic-unwind.diff @@ -18,9 +18,9 @@ bb0: { StorageLive(_3); - _3 = _1; + _3 = copy _1; StorageLive(_4); - _4 = _2; + _4 = copy _2; - _0 = core::num::<impl u16>::unchecked_shl(move _3, move _4) -> [return: bb1, unwind continue]; + StorageLive(_6); + StorageLive(_5); @@ -29,12 +29,12 @@ } bb1: { -+ _6 = core::num::<impl u16>::unchecked_shl::precondition_check(_4) -> [return: bb2, unwind unreachable]; ++ _6 = core::num::<impl u16>::unchecked_shl::precondition_check(copy _4) -> [return: bb2, unwind unreachable]; + } + + bb2: { + StorageDead(_5); -+ _0 = ShlUnchecked(_3, _4); ++ _0 = ShlUnchecked(copy _3, copy _4); + StorageDead(_6); StorageDead(_4); StorageDead(_3); diff --git a/tests/mir-opt/inline/unchecked_shifts.unchecked_shl_unsigned_smaller.PreCodegen.after.panic-abort.mir b/tests/mir-opt/inline/unchecked_shifts.unchecked_shl_unsigned_smaller.PreCodegen.after.panic-abort.mir index dc27685ee79..611273ab08d 100644 --- a/tests/mir-opt/inline/unchecked_shifts.unchecked_shl_unsigned_smaller.PreCodegen.after.panic-abort.mir +++ b/tests/mir-opt/inline/unchecked_shifts.unchecked_shl_unsigned_smaller.PreCodegen.after.panic-abort.mir @@ -12,7 +12,7 @@ fn unchecked_shl_unsigned_smaller(_1: u16, _2: u32) -> u16 { } bb0: { - _0 = ShlUnchecked(_1, _2); + _0 = ShlUnchecked(copy _1, copy _2); return; } } diff --git a/tests/mir-opt/inline/unchecked_shifts.unchecked_shl_unsigned_smaller.PreCodegen.after.panic-unwind.mir b/tests/mir-opt/inline/unchecked_shifts.unchecked_shl_unsigned_smaller.PreCodegen.after.panic-unwind.mir index dc27685ee79..611273ab08d 100644 --- a/tests/mir-opt/inline/unchecked_shifts.unchecked_shl_unsigned_smaller.PreCodegen.after.panic-unwind.mir +++ b/tests/mir-opt/inline/unchecked_shifts.unchecked_shl_unsigned_smaller.PreCodegen.after.panic-unwind.mir @@ -12,7 +12,7 @@ fn unchecked_shl_unsigned_smaller(_1: u16, _2: u32) -> u16 { } bb0: { - _0 = ShlUnchecked(_1, _2); + _0 = ShlUnchecked(copy _1, copy _2); return; } } diff --git a/tests/mir-opt/inline/unchecked_shifts.unchecked_shr_signed_bigger.Inline.panic-abort.diff b/tests/mir-opt/inline/unchecked_shifts.unchecked_shr_signed_bigger.Inline.panic-abort.diff index 6894b246699..360687f3c4e 100644 --- a/tests/mir-opt/inline/unchecked_shifts.unchecked_shr_signed_bigger.Inline.panic-abort.diff +++ b/tests/mir-opt/inline/unchecked_shifts.unchecked_shr_signed_bigger.Inline.panic-abort.diff @@ -18,9 +18,9 @@ bb0: { StorageLive(_3); - _3 = _1; + _3 = copy _1; StorageLive(_4); - _4 = _2; + _4 = copy _2; - _0 = core::num::<impl i64>::unchecked_shr(move _3, move _4) -> [return: bb1, unwind unreachable]; + StorageLive(_6); + StorageLive(_5); @@ -29,12 +29,12 @@ } bb1: { -+ _6 = core::num::<impl i64>::unchecked_shr::precondition_check(_4) -> [return: bb2, unwind unreachable]; ++ _6 = core::num::<impl i64>::unchecked_shr::precondition_check(copy _4) -> [return: bb2, unwind unreachable]; + } + + bb2: { + StorageDead(_5); -+ _0 = ShrUnchecked(_3, _4); ++ _0 = ShrUnchecked(copy _3, copy _4); + StorageDead(_6); StorageDead(_4); StorageDead(_3); diff --git a/tests/mir-opt/inline/unchecked_shifts.unchecked_shr_signed_bigger.Inline.panic-unwind.diff b/tests/mir-opt/inline/unchecked_shifts.unchecked_shr_signed_bigger.Inline.panic-unwind.diff index 070f4a1c5c8..986df55df03 100644 --- a/tests/mir-opt/inline/unchecked_shifts.unchecked_shr_signed_bigger.Inline.panic-unwind.diff +++ b/tests/mir-opt/inline/unchecked_shifts.unchecked_shr_signed_bigger.Inline.panic-unwind.diff @@ -18,9 +18,9 @@ bb0: { StorageLive(_3); - _3 = _1; + _3 = copy _1; StorageLive(_4); - _4 = _2; + _4 = copy _2; - _0 = core::num::<impl i64>::unchecked_shr(move _3, move _4) -> [return: bb1, unwind continue]; + StorageLive(_6); + StorageLive(_5); @@ -29,12 +29,12 @@ } bb1: { -+ _6 = core::num::<impl i64>::unchecked_shr::precondition_check(_4) -> [return: bb2, unwind unreachable]; ++ _6 = core::num::<impl i64>::unchecked_shr::precondition_check(copy _4) -> [return: bb2, unwind unreachable]; + } + + bb2: { + StorageDead(_5); -+ _0 = ShrUnchecked(_3, _4); ++ _0 = ShrUnchecked(copy _3, copy _4); + StorageDead(_6); StorageDead(_4); StorageDead(_3); diff --git a/tests/mir-opt/inline/unchecked_shifts.unchecked_shr_signed_bigger.PreCodegen.after.panic-abort.mir b/tests/mir-opt/inline/unchecked_shifts.unchecked_shr_signed_bigger.PreCodegen.after.panic-abort.mir index 54f093b87d1..f4ddd0bca04 100644 --- a/tests/mir-opt/inline/unchecked_shifts.unchecked_shr_signed_bigger.PreCodegen.after.panic-abort.mir +++ b/tests/mir-opt/inline/unchecked_shifts.unchecked_shr_signed_bigger.PreCodegen.after.panic-abort.mir @@ -12,7 +12,7 @@ fn unchecked_shr_signed_bigger(_1: i64, _2: u32) -> i64 { } bb0: { - _0 = ShrUnchecked(_1, _2); + _0 = ShrUnchecked(copy _1, copy _2); return; } } diff --git a/tests/mir-opt/inline/unchecked_shifts.unchecked_shr_signed_bigger.PreCodegen.after.panic-unwind.mir b/tests/mir-opt/inline/unchecked_shifts.unchecked_shr_signed_bigger.PreCodegen.after.panic-unwind.mir index 54f093b87d1..f4ddd0bca04 100644 --- a/tests/mir-opt/inline/unchecked_shifts.unchecked_shr_signed_bigger.PreCodegen.after.panic-unwind.mir +++ b/tests/mir-opt/inline/unchecked_shifts.unchecked_shr_signed_bigger.PreCodegen.after.panic-unwind.mir @@ -12,7 +12,7 @@ fn unchecked_shr_signed_bigger(_1: i64, _2: u32) -> i64 { } bb0: { - _0 = ShrUnchecked(_1, _2); + _0 = ShrUnchecked(copy _1, copy _2); return; } } diff --git a/tests/mir-opt/inline/unsized_argument.caller.Inline.diff b/tests/mir-opt/inline/unsized_argument.caller.Inline.diff index 37083973fd1..70671e2089a 100644 --- a/tests/mir-opt/inline/unsized_argument.caller.Inline.diff +++ b/tests/mir-opt/inline/unsized_argument.caller.Inline.diff @@ -12,7 +12,7 @@ StorageLive(_2); StorageLive(_3); _3 = move _1; - _4 = (((_3.0: std::ptr::Unique<[i32]>).0: std::ptr::NonNull<[i32]>).0: *const [i32]); + _4 = copy (((_3.0: std::ptr::Unique<[i32]>).0: std::ptr::NonNull<[i32]>).0: *const [i32]); _2 = callee(move (*_4)) -> [return: bb1, unwind: bb3]; } diff --git a/tests/mir-opt/inline/unwrap_unchecked.unwrap_unchecked.Inline.panic-abort.diff b/tests/mir-opt/inline/unwrap_unchecked.unwrap_unchecked.Inline.panic-abort.diff index c1f7879cf0e..28878736ed7 100644 --- a/tests/mir-opt/inline/unwrap_unchecked.unwrap_unchecked.Inline.panic-abort.diff +++ b/tests/mir-opt/inline/unwrap_unchecked.unwrap_unchecked.Inline.panic-abort.diff @@ -36,7 +36,7 @@ + bb2: { + StorageLive(_4); + _4 = UbChecks(); -+ assume(_4); ++ assume(copy _4); + _5 = unreachable_unchecked::precondition_check() -> [return: bb1, unwind unreachable]; + } + diff --git a/tests/mir-opt/inline/unwrap_unchecked.unwrap_unchecked.Inline.panic-unwind.diff b/tests/mir-opt/inline/unwrap_unchecked.unwrap_unchecked.Inline.panic-unwind.diff index 5271e538daf..27b6bb6a5bb 100644 --- a/tests/mir-opt/inline/unwrap_unchecked.unwrap_unchecked.Inline.panic-unwind.diff +++ b/tests/mir-opt/inline/unwrap_unchecked.unwrap_unchecked.Inline.panic-unwind.diff @@ -40,7 +40,7 @@ + bb2: { + StorageLive(_4); + _4 = UbChecks(); -+ assume(_4); ++ assume(copy _4); + _5 = unreachable_unchecked::precondition_check() -> [return: bb1, unwind unreachable]; + } + diff --git a/tests/mir-opt/inline/unwrap_unchecked.unwrap_unchecked.PreCodegen.after.panic-abort.mir b/tests/mir-opt/inline/unwrap_unchecked.unwrap_unchecked.PreCodegen.after.panic-abort.mir index dcab8a679a8..66ab5e1b962 100644 --- a/tests/mir-opt/inline/unwrap_unchecked.unwrap_unchecked.PreCodegen.after.panic-abort.mir +++ b/tests/mir-opt/inline/unwrap_unchecked.unwrap_unchecked.PreCodegen.after.panic-abort.mir @@ -22,7 +22,7 @@ fn unwrap_unchecked(_1: Option<T>) -> T { } bb1: { - _0 = ((_1 as Some).0: T); + _0 = copy ((_1 as Some).0: T); StorageDead(_2); return; } diff --git a/tests/mir-opt/inline/unwrap_unchecked.unwrap_unchecked.PreCodegen.after.panic-unwind.mir b/tests/mir-opt/inline/unwrap_unchecked.unwrap_unchecked.PreCodegen.after.panic-unwind.mir index dcab8a679a8..66ab5e1b962 100644 --- a/tests/mir-opt/inline/unwrap_unchecked.unwrap_unchecked.PreCodegen.after.panic-unwind.mir +++ b/tests/mir-opt/inline/unwrap_unchecked.unwrap_unchecked.PreCodegen.after.panic-unwind.mir @@ -22,7 +22,7 @@ fn unwrap_unchecked(_1: Option<T>) -> T { } bb1: { - _0 = ((_1 as Some).0: T); + _0 = copy ((_1 as Some).0: T); StorageDead(_2); return; } diff --git a/tests/mir-opt/inline_coroutine_body.run2-{closure#0}.Inline.panic-abort.diff b/tests/mir-opt/inline_coroutine_body.run2-{closure#0}.Inline.panic-abort.diff index f8715789cec..1e33e222b27 100644 --- a/tests/mir-opt/inline_coroutine_body.run2-{closure#0}.Inline.panic-abort.diff +++ b/tests/mir-opt/inline_coroutine_body.run2-{closure#0}.Inline.panic-abort.diff @@ -85,7 +85,7 @@ - } - - bb2: { -+ _4 = Pin::<&mut {async fn body of ActionPermit<'_, T>::perform()}> { __pointer: _5 }; ++ _4 = Pin::<&mut {async fn body of ActionPermit<'_, T>::perform()}> { __pointer: copy _5 }; StorageDead(_5); StorageLive(_6); StorageLive(_7); @@ -160,7 +160,7 @@ + StorageLive(_14); + _14 = (); + StorageLive(_41); -+ _41 = Option::<()>::Some(_14); ++ _41 = Option::<()>::Some(copy _14); + _13 = std::future::Ready::<()>(move _41); + StorageDead(_41); + StorageDead(_14); @@ -193,7 +193,7 @@ + StorageLive(_22); + StorageLive(_23); + StorageLive(_24); -+ _24 = _31; ++ _24 = copy _31; + _23 = move _24; + _22 = &mut (*_23); + StorageDead(_24); @@ -231,8 +231,8 @@ + + bb10: { + StorageLive(_26); -+ _26 = ((_18 as Ready).0: ()); -+ _30 = _26; ++ _26 = copy ((_18 as Ready).0: ()); ++ _30 = copy _26; + StorageDead(_26); + StorageDead(_23); + StorageDead(_21); diff --git a/tests/mir-opt/inline_coroutine_body.run2-{closure#0}.Inline.panic-unwind.diff b/tests/mir-opt/inline_coroutine_body.run2-{closure#0}.Inline.panic-unwind.diff index 494f5591e32..b1840beb3ef 100644 --- a/tests/mir-opt/inline_coroutine_body.run2-{closure#0}.Inline.panic-unwind.diff +++ b/tests/mir-opt/inline_coroutine_body.run2-{closure#0}.Inline.panic-unwind.diff @@ -87,7 +87,7 @@ - } - - bb2: { -+ _4 = Pin::<&mut {async fn body of ActionPermit<'_, T>::perform()}> { __pointer: _5 }; ++ _4 = Pin::<&mut {async fn body of ActionPermit<'_, T>::perform()}> { __pointer: copy _5 }; StorageDead(_5); StorageLive(_6); StorageLive(_7); @@ -177,7 +177,7 @@ + StorageLive(_14); + _14 = (); + StorageLive(_43); -+ _43 = Option::<()>::Some(_14); ++ _43 = Option::<()>::Some(copy _14); + _13 = std::future::Ready::<()>(move _43); + StorageDead(_43); + StorageDead(_14); @@ -212,7 +212,7 @@ + StorageLive(_22); + StorageLive(_23); + StorageLive(_24); -+ _24 = _31; ++ _24 = copy _31; + _23 = move _24; + _22 = &mut (*_23); + StorageDead(_24); @@ -250,8 +250,8 @@ + + bb12: { + StorageLive(_26); -+ _26 = ((_18 as Ready).0: ()); -+ _30 = _26; ++ _26 = copy ((_18 as Ready).0: ()); ++ _30 = copy _26; + StorageDead(_26); + StorageDead(_23); + StorageDead(_21); diff --git a/tests/mir-opt/instsimplify/bool_compare.eq_false.InstSimplify-after-simplifycfg.diff b/tests/mir-opt/instsimplify/bool_compare.eq_false.InstSimplify-after-simplifycfg.diff index fea5f4f02ce..4762123184b 100644 --- a/tests/mir-opt/instsimplify/bool_compare.eq_false.InstSimplify-after-simplifycfg.diff +++ b/tests/mir-opt/instsimplify/bool_compare.eq_false.InstSimplify-after-simplifycfg.diff @@ -10,7 +10,7 @@ bb0: { StorageLive(_2); StorageLive(_3); - _3 = _1; + _3 = copy _1; - _2 = Eq(move _3, const false); + _2 = Not(move _3); switchInt(move _2) -> [0: bb2, otherwise: bb1]; diff --git a/tests/mir-opt/instsimplify/bool_compare.eq_true.InstSimplify-after-simplifycfg.diff b/tests/mir-opt/instsimplify/bool_compare.eq_true.InstSimplify-after-simplifycfg.diff index 9a509ccfa67..6fae0acf439 100644 --- a/tests/mir-opt/instsimplify/bool_compare.eq_true.InstSimplify-after-simplifycfg.diff +++ b/tests/mir-opt/instsimplify/bool_compare.eq_true.InstSimplify-after-simplifycfg.diff @@ -10,7 +10,7 @@ bb0: { StorageLive(_2); StorageLive(_3); - _3 = _1; + _3 = copy _1; - _2 = Eq(move _3, const true); + _2 = move _3; switchInt(move _2) -> [0: bb2, otherwise: bb1]; diff --git a/tests/mir-opt/instsimplify/bool_compare.false_eq.InstSimplify-after-simplifycfg.diff b/tests/mir-opt/instsimplify/bool_compare.false_eq.InstSimplify-after-simplifycfg.diff index e4ec4c80579..7975a808d4f 100644 --- a/tests/mir-opt/instsimplify/bool_compare.false_eq.InstSimplify-after-simplifycfg.diff +++ b/tests/mir-opt/instsimplify/bool_compare.false_eq.InstSimplify-after-simplifycfg.diff @@ -10,7 +10,7 @@ bb0: { StorageLive(_2); StorageLive(_3); - _3 = _1; + _3 = copy _1; - _2 = Eq(const false, move _3); + _2 = Not(move _3); switchInt(move _2) -> [0: bb2, otherwise: bb1]; diff --git a/tests/mir-opt/instsimplify/bool_compare.false_ne.InstSimplify-after-simplifycfg.diff b/tests/mir-opt/instsimplify/bool_compare.false_ne.InstSimplify-after-simplifycfg.diff index 3aea55f4db4..80d0cd62007 100644 --- a/tests/mir-opt/instsimplify/bool_compare.false_ne.InstSimplify-after-simplifycfg.diff +++ b/tests/mir-opt/instsimplify/bool_compare.false_ne.InstSimplify-after-simplifycfg.diff @@ -10,7 +10,7 @@ bb0: { StorageLive(_2); StorageLive(_3); - _3 = _1; + _3 = copy _1; - _2 = Ne(const false, move _3); + _2 = move _3; switchInt(move _2) -> [0: bb2, otherwise: bb1]; diff --git a/tests/mir-opt/instsimplify/bool_compare.ne_false.InstSimplify-after-simplifycfg.diff b/tests/mir-opt/instsimplify/bool_compare.ne_false.InstSimplify-after-simplifycfg.diff index b6e891088a1..c0f8b5261c2 100644 --- a/tests/mir-opt/instsimplify/bool_compare.ne_false.InstSimplify-after-simplifycfg.diff +++ b/tests/mir-opt/instsimplify/bool_compare.ne_false.InstSimplify-after-simplifycfg.diff @@ -10,7 +10,7 @@ bb0: { StorageLive(_2); StorageLive(_3); - _3 = _1; + _3 = copy _1; - _2 = Ne(move _3, const false); + _2 = move _3; switchInt(move _2) -> [0: bb2, otherwise: bb1]; diff --git a/tests/mir-opt/instsimplify/bool_compare.ne_true.InstSimplify-after-simplifycfg.diff b/tests/mir-opt/instsimplify/bool_compare.ne_true.InstSimplify-after-simplifycfg.diff index 974738bb3a9..4627b314408 100644 --- a/tests/mir-opt/instsimplify/bool_compare.ne_true.InstSimplify-after-simplifycfg.diff +++ b/tests/mir-opt/instsimplify/bool_compare.ne_true.InstSimplify-after-simplifycfg.diff @@ -10,7 +10,7 @@ bb0: { StorageLive(_2); StorageLive(_3); - _3 = _1; + _3 = copy _1; - _2 = Ne(move _3, const true); + _2 = Not(move _3); switchInt(move _2) -> [0: bb2, otherwise: bb1]; diff --git a/tests/mir-opt/instsimplify/bool_compare.true_eq.InstSimplify-after-simplifycfg.diff b/tests/mir-opt/instsimplify/bool_compare.true_eq.InstSimplify-after-simplifycfg.diff index 240835bf7f2..91ca1ba553e 100644 --- a/tests/mir-opt/instsimplify/bool_compare.true_eq.InstSimplify-after-simplifycfg.diff +++ b/tests/mir-opt/instsimplify/bool_compare.true_eq.InstSimplify-after-simplifycfg.diff @@ -10,7 +10,7 @@ bb0: { StorageLive(_2); StorageLive(_3); - _3 = _1; + _3 = copy _1; - _2 = Eq(const true, move _3); + _2 = move _3; switchInt(move _2) -> [0: bb2, otherwise: bb1]; diff --git a/tests/mir-opt/instsimplify/bool_compare.true_ne.InstSimplify-after-simplifycfg.diff b/tests/mir-opt/instsimplify/bool_compare.true_ne.InstSimplify-after-simplifycfg.diff index 1e2b2c27f57..744c61b987d 100644 --- a/tests/mir-opt/instsimplify/bool_compare.true_ne.InstSimplify-after-simplifycfg.diff +++ b/tests/mir-opt/instsimplify/bool_compare.true_ne.InstSimplify-after-simplifycfg.diff @@ -10,7 +10,7 @@ bb0: { StorageLive(_2); StorageLive(_3); - _3 = _1; + _3 = copy _1; - _2 = Ne(const true, move _3); + _2 = Not(move _3); switchInt(move _2) -> [0: bb2, otherwise: bb1]; diff --git a/tests/mir-opt/instsimplify/casts.redundant.InstSimplify-after-simplifycfg.diff b/tests/mir-opt/instsimplify/casts.redundant.InstSimplify-after-simplifycfg.diff index 7001589d9e3..afa25ecdbfb 100644 --- a/tests/mir-opt/instsimplify/casts.redundant.InstSimplify-after-simplifycfg.diff +++ b/tests/mir-opt/instsimplify/casts.redundant.InstSimplify-after-simplifycfg.diff @@ -15,16 +15,16 @@ StorageLive(_2); StorageLive(_3); StorageLive(_4); - _4 = _1; + _4 = copy _1; StorageLive(_5); - _5 = _4; + _5 = copy _4; - _3 = move _5 as *const &u8 (PtrToPtr); + _3 = move _5; StorageDead(_5); StorageDead(_4); - _2 = move _3 as *const &u8 (PtrToPtr); + _2 = move _3; - _0 = _2; + _0 = copy _2; StorageDead(_3); StorageDead(_2); return; diff --git a/tests/mir-opt/instsimplify/casts.roundtrip.InstSimplify-after-simplifycfg.diff b/tests/mir-opt/instsimplify/casts.roundtrip.InstSimplify-after-simplifycfg.diff index e1045db9730..12e2913a8ca 100644 --- a/tests/mir-opt/instsimplify/casts.roundtrip.InstSimplify-after-simplifycfg.diff +++ b/tests/mir-opt/instsimplify/casts.roundtrip.InstSimplify-after-simplifycfg.diff @@ -12,7 +12,7 @@ StorageLive(_2); StorageLive(_3); StorageLive(_4); - _4 = _1; + _4 = copy _1; _3 = move _4 as *mut u8 (PtrToPtr); _2 = move _3 as *const u8 (PtrToPtr); StorageDead(_4); diff --git a/tests/mir-opt/instsimplify/casts.rs b/tests/mir-opt/instsimplify/casts.rs index 24dbb67b42d..27308ee52bc 100644 --- a/tests/mir-opt/instsimplify/casts.rs +++ b/tests/mir-opt/instsimplify/casts.rs @@ -19,7 +19,7 @@ pub fn redundant<'a, 'b: 'a>(x: *const &'a u8) -> *const &'a u8 { // EMIT_MIR casts.roundtrip.InstSimplify-after-simplifycfg.diff pub fn roundtrip(x: *const u8) -> *const u8 { // CHECK-LABEL: fn roundtrip( - // CHECK: _4 = _1; + // CHECK: _4 = copy _1; // CHECK: _3 = move _4 as *mut u8 (PtrToPtr); // CHECK: _2 = move _3 as *const u8 (PtrToPtr); x as *mut u8 as *const u8 @@ -28,7 +28,7 @@ pub fn roundtrip(x: *const u8) -> *const u8 { // EMIT_MIR casts.roundtrip.InstSimplify-after-simplifycfg.diff pub fn cast_thin_via_aggregate(x: *const u8) -> *const () { // CHECK-LABEL: fn cast_thin_via_aggregate( - // CHECK: _2 = _1; + // CHECK: _2 = copy _1; // CHECK: _0 = move _2 as *const () (PtrToPtr); std::intrinsics::aggregate_raw_ptr(x, ()) } diff --git a/tests/mir-opt/instsimplify/combine_array_len.norm2.InstSimplify-after-simplifycfg.panic-abort.diff b/tests/mir-opt/instsimplify/combine_array_len.norm2.InstSimplify-after-simplifycfg.panic-abort.diff index a7de09ca386..f39df7ffca0 100644 --- a/tests/mir-opt/instsimplify/combine_array_len.norm2.InstSimplify-after-simplifycfg.panic-abort.diff +++ b/tests/mir-opt/instsimplify/combine_array_len.norm2.InstSimplify-after-simplifycfg.panic-abort.diff @@ -31,38 +31,38 @@ _3 = const 0_usize; - _4 = Len(_1); + _4 = const 2_usize; - _5 = Lt(_3, _4); - assert(move _5, "index out of bounds: the length is {} but the index is {}", move _4, _3) -> [success: bb1, unwind unreachable]; + _5 = Lt(copy _3, copy _4); + assert(move _5, "index out of bounds: the length is {} but the index is {}", move _4, copy _3) -> [success: bb1, unwind unreachable]; } bb1: { - _2 = _1[_3]; + _2 = copy _1[_3]; StorageDead(_3); StorageLive(_6); StorageLive(_7); _7 = const 1_usize; - _8 = Len(_1); + _8 = const 2_usize; - _9 = Lt(_7, _8); - assert(move _9, "index out of bounds: the length is {} but the index is {}", move _8, _7) -> [success: bb2, unwind unreachable]; + _9 = Lt(copy _7, copy _8); + assert(move _9, "index out of bounds: the length is {} but the index is {}", move _8, copy _7) -> [success: bb2, unwind unreachable]; } bb2: { - _6 = _1[_7]; + _6 = copy _1[_7]; StorageDead(_7); StorageLive(_10); StorageLive(_11); - _11 = _2; + _11 = copy _2; StorageLive(_12); - _12 = _2; + _12 = copy _2; _10 = Mul(move _11, move _12); StorageDead(_12); StorageDead(_11); StorageLive(_13); StorageLive(_14); - _14 = _6; + _14 = copy _6; StorageLive(_15); - _15 = _6; + _15 = copy _6; _13 = Mul(move _14, move _15); StorageDead(_15); StorageDead(_14); diff --git a/tests/mir-opt/instsimplify/combine_array_len.norm2.InstSimplify-after-simplifycfg.panic-unwind.diff b/tests/mir-opt/instsimplify/combine_array_len.norm2.InstSimplify-after-simplifycfg.panic-unwind.diff index c15f7e47fe3..0e7d5653c68 100644 --- a/tests/mir-opt/instsimplify/combine_array_len.norm2.InstSimplify-after-simplifycfg.panic-unwind.diff +++ b/tests/mir-opt/instsimplify/combine_array_len.norm2.InstSimplify-after-simplifycfg.panic-unwind.diff @@ -31,38 +31,38 @@ _3 = const 0_usize; - _4 = Len(_1); + _4 = const 2_usize; - _5 = Lt(_3, _4); - assert(move _5, "index out of bounds: the length is {} but the index is {}", move _4, _3) -> [success: bb1, unwind continue]; + _5 = Lt(copy _3, copy _4); + assert(move _5, "index out of bounds: the length is {} but the index is {}", move _4, copy _3) -> [success: bb1, unwind continue]; } bb1: { - _2 = _1[_3]; + _2 = copy _1[_3]; StorageDead(_3); StorageLive(_6); StorageLive(_7); _7 = const 1_usize; - _8 = Len(_1); + _8 = const 2_usize; - _9 = Lt(_7, _8); - assert(move _9, "index out of bounds: the length is {} but the index is {}", move _8, _7) -> [success: bb2, unwind continue]; + _9 = Lt(copy _7, copy _8); + assert(move _9, "index out of bounds: the length is {} but the index is {}", move _8, copy _7) -> [success: bb2, unwind continue]; } bb2: { - _6 = _1[_7]; + _6 = copy _1[_7]; StorageDead(_7); StorageLive(_10); StorageLive(_11); - _11 = _2; + _11 = copy _2; StorageLive(_12); - _12 = _2; + _12 = copy _2; _10 = Mul(move _11, move _12); StorageDead(_12); StorageDead(_11); StorageLive(_13); StorageLive(_14); - _14 = _6; + _14 = copy _6; StorageLive(_15); - _15 = _6; + _15 = copy _6; _13 = Mul(move _14, move _15); StorageDead(_15); StorageDead(_14); diff --git a/tests/mir-opt/instsimplify/combine_clone_of_primitives.{impl#0}-clone.InstSimplify-after-simplifycfg.panic-abort.diff b/tests/mir-opt/instsimplify/combine_clone_of_primitives.{impl#0}-clone.InstSimplify-after-simplifycfg.panic-abort.diff index c6f858d89eb..d0b50c597c4 100644 --- a/tests/mir-opt/instsimplify/combine_clone_of_primitives.{impl#0}-clone.InstSimplify-after-simplifycfg.panic-abort.diff +++ b/tests/mir-opt/instsimplify/combine_clone_of_primitives.{impl#0}-clone.InstSimplify-after-simplifycfg.panic-abort.diff @@ -20,7 +20,7 @@ StorageLive(_4); _4 = &((*_1).0: T); - _3 = &(*_4); -+ _3 = _4; ++ _3 = copy _4; _2 = <T as Clone>::clone(move _3) -> [return: bb1, unwind unreachable]; } @@ -32,8 +32,8 @@ _7 = &((*_1).1: u64); - _6 = &(*_7); - _5 = <u64 as Clone>::clone(move _6) -> [return: bb2, unwind unreachable]; -+ _6 = _7; -+ _5 = (*_6); ++ _6 = copy _7; ++ _5 = copy (*_6); + goto -> bb2; } @@ -45,8 +45,8 @@ _10 = &((*_1).2: [f32; 3]); - _9 = &(*_10); - _8 = <[f32; 3] as Clone>::clone(move _9) -> [return: bb3, unwind unreachable]; -+ _9 = _10; -+ _8 = (*_9); ++ _9 = copy _10; ++ _8 = copy (*_9); + goto -> bb3; } diff --git a/tests/mir-opt/instsimplify/combine_clone_of_primitives.{impl#0}-clone.InstSimplify-after-simplifycfg.panic-unwind.diff b/tests/mir-opt/instsimplify/combine_clone_of_primitives.{impl#0}-clone.InstSimplify-after-simplifycfg.panic-unwind.diff index 691ab1f0e7f..b8f4f348530 100644 --- a/tests/mir-opt/instsimplify/combine_clone_of_primitives.{impl#0}-clone.InstSimplify-after-simplifycfg.panic-unwind.diff +++ b/tests/mir-opt/instsimplify/combine_clone_of_primitives.{impl#0}-clone.InstSimplify-after-simplifycfg.panic-unwind.diff @@ -20,7 +20,7 @@ StorageLive(_4); _4 = &((*_1).0: T); - _3 = &(*_4); -+ _3 = _4; ++ _3 = copy _4; _2 = <T as Clone>::clone(move _3) -> [return: bb1, unwind continue]; } @@ -32,8 +32,8 @@ _7 = &((*_1).1: u64); - _6 = &(*_7); - _5 = <u64 as Clone>::clone(move _6) -> [return: bb2, unwind: bb4]; -+ _6 = _7; -+ _5 = (*_6); ++ _6 = copy _7; ++ _5 = copy (*_6); + goto -> bb2; } @@ -45,8 +45,8 @@ _10 = &((*_1).2: [f32; 3]); - _9 = &(*_10); - _8 = <[f32; 3] as Clone>::clone(move _9) -> [return: bb3, unwind: bb4]; -+ _9 = _10; -+ _8 = (*_9); ++ _9 = copy _10; ++ _8 = copy (*_9); + goto -> bb3; } diff --git a/tests/mir-opt/instsimplify/duplicate_switch_targets.assert_zero.InstSimplify-after-simplifycfg.diff b/tests/mir-opt/instsimplify/duplicate_switch_targets.assert_zero.InstSimplify-after-simplifycfg.diff index 7596aa20308..5d74f0f75db 100644 --- a/tests/mir-opt/instsimplify/duplicate_switch_targets.assert_zero.InstSimplify-after-simplifycfg.diff +++ b/tests/mir-opt/instsimplify/duplicate_switch_targets.assert_zero.InstSimplify-after-simplifycfg.diff @@ -5,8 +5,8 @@ let mut _0: u8; bb0: { -- switchInt(_1) -> [0: bb2, 1: bb1, otherwise: bb1]; -+ switchInt(_1) -> [0: bb2, otherwise: bb1]; +- switchInt(copy _1) -> [0: bb2, 1: bb1, otherwise: bb1]; ++ switchInt(copy _1) -> [0: bb2, otherwise: bb1]; } bb1: { @@ -14,7 +14,7 @@ } bb2: { - _0 = _1; + _0 = copy _1; return; } } diff --git a/tests/mir-opt/instsimplify/ref_of_deref.pointers.InstSimplify-after-simplifycfg.diff b/tests/mir-opt/instsimplify/ref_of_deref.pointers.InstSimplify-after-simplifycfg.diff index ca26f0240f9..b2f720be9e1 100644 --- a/tests/mir-opt/instsimplify/ref_of_deref.pointers.InstSimplify-after-simplifycfg.diff +++ b/tests/mir-opt/instsimplify/ref_of_deref.pointers.InstSimplify-after-simplifycfg.diff @@ -39,12 +39,12 @@ _5 = &mut (*_2); StorageLive(_6); - _6 = &raw const (*_1); -+ _6 = _1; ++ _6 = copy _1; StorageLive(_7); _7 = &raw const (*_2); StorageLive(_8); - _8 = &raw mut (*_2); -+ _8 = _2; ++ _8 = copy _2; _0 = const (); StorageDead(_8); StorageDead(_7); diff --git a/tests/mir-opt/instsimplify/ref_of_deref.references.InstSimplify-after-simplifycfg.diff b/tests/mir-opt/instsimplify/ref_of_deref.references.InstSimplify-after-simplifycfg.diff index 928ee3acaa0..4ea9da46c55 100644 --- a/tests/mir-opt/instsimplify/ref_of_deref.references.InstSimplify-after-simplifycfg.diff +++ b/tests/mir-opt/instsimplify/ref_of_deref.references.InstSimplify-after-simplifycfg.diff @@ -33,12 +33,12 @@ bb0: { StorageLive(_3); - _3 = &(*_1); -+ _3 = _1; ++ _3 = copy _1; StorageLive(_4); _4 = &(*_2); StorageLive(_5); - _5 = &mut (*_2); -+ _5 = _2; ++ _5 = copy _2; StorageLive(_6); _6 = &raw const (*_1); StorageLive(_7); diff --git a/tests/mir-opt/instsimplify/ref_of_deref.rs b/tests/mir-opt/instsimplify/ref_of_deref.rs index dc0f5f8198b..5372d906bda 100644 --- a/tests/mir-opt/instsimplify/ref_of_deref.rs +++ b/tests/mir-opt/instsimplify/ref_of_deref.rs @@ -1,6 +1,5 @@ //@ test-mir-pass: InstSimplify-after-simplifycfg #![crate_type = "lib"] -#![feature(raw_ref_op)] // For each of these, only 2 of the 6 should simplify, // as the others have the wrong types. @@ -8,11 +7,11 @@ // EMIT_MIR ref_of_deref.references.InstSimplify-after-simplifycfg.diff // CHECK-LABEL: references pub fn references(const_ref: &i32, mut_ref: &mut [i32]) { - // CHECK: _3 = _1; + // CHECK: _3 = copy _1; let _a = &*const_ref; // CHECK: _4 = &(*_2); let _b = &*mut_ref; - // CHECK: _5 = _2; + // CHECK: _5 = copy _2; let _c = &mut *mut_ref; // CHECK: _6 = &raw const (*_1); let _d = &raw const *const_ref; @@ -31,10 +30,10 @@ pub unsafe fn pointers(const_ptr: *const [i32], mut_ptr: *mut i32) { let _b = &*mut_ptr; // CHECK: _5 = &mut (*_2); let _c = &mut *mut_ptr; - // CHECK: _6 = _1; + // CHECK: _6 = copy _1; let _d = &raw const *const_ptr; // CHECK: _7 = &raw const (*_2); let _e = &raw const *mut_ptr; - // CHECK: _8 = _2; + // CHECK: _8 = copy _2; let _f = &raw mut *mut_ptr; } diff --git a/tests/mir-opt/instsimplify/ub_check.rs b/tests/mir-opt/instsimplify/ub_check.rs index ee72511c132..b513f60dc7b 100644 --- a/tests/mir-opt/instsimplify/ub_check.rs +++ b/tests/mir-opt/instsimplify/ub_check.rs @@ -6,7 +6,7 @@ pub fn unwrap_unchecked(x: Option<i32>) -> i32 { // CHECK-LABEL: fn unwrap_unchecked( // CHECK-NOT: UbChecks() // CHECK: [[assume:_.*]] = const false; - // CHECK-NEXT: assume([[assume]]); + // CHECK-NEXT: assume(copy [[assume]]); // CHECK-NEXT: unreachable_unchecked::precondition_check unsafe { x.unwrap_unchecked() } } diff --git a/tests/mir-opt/instsimplify/ub_check.unwrap_unchecked.InstSimplify-after-simplifycfg.diff b/tests/mir-opt/instsimplify/ub_check.unwrap_unchecked.InstSimplify-after-simplifycfg.diff index 7ef77e76d12..5fee9a6733d 100644 --- a/tests/mir-opt/instsimplify/ub_check.unwrap_unchecked.InstSimplify-after-simplifycfg.diff +++ b/tests/mir-opt/instsimplify/ub_check.unwrap_unchecked.InstSimplify-after-simplifycfg.diff @@ -21,7 +21,7 @@ bb0: { StorageLive(_2); - _2 = _1; + _2 = copy _1; StorageLive(_3); StorageLive(_5); _3 = discriminant(_2); @@ -36,7 +36,7 @@ StorageLive(_4); - _4 = UbChecks(); + _4 = const false; - assume(_4); + assume(copy _4); _5 = unreachable_unchecked::precondition_check() -> [return: bb1, unwind unreachable]; } diff --git a/tests/mir-opt/issue_101973.inner.GVN.panic-abort.diff b/tests/mir-opt/issue_101973.inner.GVN.panic-abort.diff index 311de9e1c93..ac88fe67bb8 100644 --- a/tests/mir-opt/issue_101973.inner.GVN.panic-abort.diff +++ b/tests/mir-opt/issue_101973.inner.GVN.panic-abort.diff @@ -29,22 +29,22 @@ StorageLive(_3); StorageLive(_4); StorageLive(_5); - _5 = _1; + _5 = copy _1; nop; - StorageLive(_14); -- _14 = BitAnd(_5, const 255_u32); +- _14 = BitAnd(copy _5, const 255_u32); - _4 = BitOr(const 0_u32, move _14); - StorageDead(_14); + nop; -+ _14 = BitAnd(_1, const 255_u32); -+ _4 = _14; ++ _14 = BitAnd(copy _1, const 255_u32); ++ _4 = copy _14; + nop; StorageDead(_5); StorageLive(_6); StorageLive(_7); StorageLive(_8); StorageLive(_9); - _9 = _1; + _9 = copy _1; - _10 = const 8_i32 as u32 (IntToInt); - _11 = Lt(move _10, const 32_u32); - assert(move _11, "attempt to shift right by `{}`, which would overflow", const 8_i32) -> [success: bb1, unwind unreachable]; @@ -55,7 +55,7 @@ bb1: { - _8 = Shr(move _9, const 8_i32); -+ _8 = Shr(_1, const 8_i32); ++ _8 = Shr(copy _1, const 8_i32); StorageDead(_9); _7 = BitAnd(move _8, const 15_u32); StorageDead(_8); @@ -71,7 +71,7 @@ _6 = Shl(move _7, const 1_i32); StorageDead(_7); - _3 = rotate_right::<u32>(move _4, move _6) -> [return: bb3, unwind unreachable]; -+ _3 = rotate_right::<u32>(_14, move _6) -> [return: bb3, unwind unreachable]; ++ _3 = rotate_right::<u32>(copy _14, move _6) -> [return: bb3, unwind unreachable]; } bb3: { diff --git a/tests/mir-opt/issue_101973.inner.GVN.panic-unwind.diff b/tests/mir-opt/issue_101973.inner.GVN.panic-unwind.diff index c5fd042161d..96c3cae2d33 100644 --- a/tests/mir-opt/issue_101973.inner.GVN.panic-unwind.diff +++ b/tests/mir-opt/issue_101973.inner.GVN.panic-unwind.diff @@ -29,22 +29,22 @@ StorageLive(_3); StorageLive(_4); StorageLive(_5); - _5 = _1; + _5 = copy _1; nop; - StorageLive(_14); -- _14 = BitAnd(_5, const 255_u32); +- _14 = BitAnd(copy _5, const 255_u32); - _4 = BitOr(const 0_u32, move _14); - StorageDead(_14); + nop; -+ _14 = BitAnd(_1, const 255_u32); -+ _4 = _14; ++ _14 = BitAnd(copy _1, const 255_u32); ++ _4 = copy _14; + nop; StorageDead(_5); StorageLive(_6); StorageLive(_7); StorageLive(_8); StorageLive(_9); - _9 = _1; + _9 = copy _1; - _10 = const 8_i32 as u32 (IntToInt); - _11 = Lt(move _10, const 32_u32); - assert(move _11, "attempt to shift right by `{}`, which would overflow", const 8_i32) -> [success: bb1, unwind continue]; @@ -55,7 +55,7 @@ bb1: { - _8 = Shr(move _9, const 8_i32); -+ _8 = Shr(_1, const 8_i32); ++ _8 = Shr(copy _1, const 8_i32); StorageDead(_9); _7 = BitAnd(move _8, const 15_u32); StorageDead(_8); @@ -71,7 +71,7 @@ _6 = Shl(move _7, const 1_i32); StorageDead(_7); - _3 = rotate_right::<u32>(move _4, move _6) -> [return: bb3, unwind unreachable]; -+ _3 = rotate_right::<u32>(_14, move _6) -> [return: bb3, unwind unreachable]; ++ _3 = rotate_right::<u32>(copy _14, move _6) -> [return: bb3, unwind unreachable]; } bb3: { diff --git a/tests/mir-opt/issue_38669.main.SimplifyCfg-initial.after.mir b/tests/mir-opt/issue_38669.main.SimplifyCfg-initial.after.mir index 632b5580656..66dbbc0c044 100644 --- a/tests/mir-opt/issue_38669.main.SimplifyCfg-initial.after.mir +++ b/tests/mir-opt/issue_38669.main.SimplifyCfg-initial.after.mir @@ -25,7 +25,7 @@ fn main() -> () { bb2: { StorageLive(_3); StorageLive(_4); - _4 = _1; + _4 = copy _1; switchInt(move _4) -> [0: bb4, otherwise: bb3]; } diff --git a/tests/mir-opt/issue_41110.main.ElaborateDrops.panic-abort.diff b/tests/mir-opt/issue_41110.main.ElaborateDrops.panic-abort.diff index 4469270a9b2..cf952230128 100644 --- a/tests/mir-opt/issue_41110.main.ElaborateDrops.panic-abort.diff +++ b/tests/mir-opt/issue_41110.main.ElaborateDrops.panic-abort.diff @@ -63,7 +63,7 @@ + } + + bb8 (cleanup): { -+ switchInt(_5) -> [0: bb6, otherwise: bb7]; ++ switchInt(copy _5) -> [0: bb6, otherwise: bb7]; } } diff --git a/tests/mir-opt/issue_41110.main.ElaborateDrops.panic-unwind.diff b/tests/mir-opt/issue_41110.main.ElaborateDrops.panic-unwind.diff index 4469270a9b2..cf952230128 100644 --- a/tests/mir-opt/issue_41110.main.ElaborateDrops.panic-unwind.diff +++ b/tests/mir-opt/issue_41110.main.ElaborateDrops.panic-unwind.diff @@ -63,7 +63,7 @@ + } + + bb8 (cleanup): { -+ switchInt(_5) -> [0: bb6, otherwise: bb7]; ++ switchInt(copy _5) -> [0: bb6, otherwise: bb7]; } } diff --git a/tests/mir-opt/issue_41110.test.ElaborateDrops.panic-abort.diff b/tests/mir-opt/issue_41110.test.ElaborateDrops.panic-abort.diff index 78184f6aeeb..15fd95a63ff 100644 --- a/tests/mir-opt/issue_41110.test.ElaborateDrops.panic-abort.diff +++ b/tests/mir-opt/issue_41110.test.ElaborateDrops.panic-abort.diff @@ -93,7 +93,7 @@ + } + + bb12 (cleanup): { -+ switchInt(_6) -> [0: bb10, otherwise: bb11]; ++ switchInt(copy _6) -> [0: bb10, otherwise: bb11]; } } diff --git a/tests/mir-opt/issue_41110.test.ElaborateDrops.panic-unwind.diff b/tests/mir-opt/issue_41110.test.ElaborateDrops.panic-unwind.diff index 688887c3c1f..4a0067981cb 100644 --- a/tests/mir-opt/issue_41110.test.ElaborateDrops.panic-unwind.diff +++ b/tests/mir-opt/issue_41110.test.ElaborateDrops.panic-unwind.diff @@ -93,7 +93,7 @@ + } + + bb12 (cleanup): { -+ switchInt(_6) -> [0: bb10, otherwise: bb11]; ++ switchInt(copy _6) -> [0: bb10, otherwise: bb11]; } } diff --git a/tests/mir-opt/issue_41888.main.ElaborateDrops.panic-abort.diff b/tests/mir-opt/issue_41888.main.ElaborateDrops.panic-abort.diff index 55d2629a551..e2726464ef3 100644 --- a/tests/mir-opt/issue_41888.main.ElaborateDrops.panic-abort.diff +++ b/tests/mir-opt/issue_41888.main.ElaborateDrops.panic-abort.diff @@ -115,7 +115,7 @@ + } + + bb15 (cleanup): { -+ switchInt(_7) -> [0: bb12, otherwise: bb14]; ++ switchInt(copy _7) -> [0: bb12, otherwise: bb14]; + } + + bb16: { @@ -132,7 +132,7 @@ + } + + bb19: { -+ switchInt(_7) -> [0: bb13, otherwise: bb18]; ++ switchInt(copy _7) -> [0: bb13, otherwise: bb18]; + } + + bb20 (cleanup): { @@ -141,7 +141,7 @@ + } + + bb21 (cleanup): { -+ switchInt(_7) -> [0: bb12, otherwise: bb20]; ++ switchInt(copy _7) -> [0: bb12, otherwise: bb20]; } } diff --git a/tests/mir-opt/issue_41888.main.ElaborateDrops.panic-unwind.diff b/tests/mir-opt/issue_41888.main.ElaborateDrops.panic-unwind.diff index c731b5646f6..7efa3330e66 100644 --- a/tests/mir-opt/issue_41888.main.ElaborateDrops.panic-unwind.diff +++ b/tests/mir-opt/issue_41888.main.ElaborateDrops.panic-unwind.diff @@ -115,7 +115,7 @@ + } + + bb15 (cleanup): { -+ switchInt(_7) -> [0: bb12, otherwise: bb14]; ++ switchInt(copy _7) -> [0: bb12, otherwise: bb14]; + } + + bb16: { @@ -132,7 +132,7 @@ + } + + bb19: { -+ switchInt(_7) -> [0: bb13, otherwise: bb18]; ++ switchInt(copy _7) -> [0: bb13, otherwise: bb18]; + } + + bb20 (cleanup): { @@ -141,7 +141,7 @@ + } + + bb21 (cleanup): { -+ switchInt(_7) -> [0: bb12, otherwise: bb20]; ++ switchInt(copy _7) -> [0: bb12, otherwise: bb20]; } } diff --git a/tests/mir-opt/issue_62289.test.ElaborateDrops.before.panic-abort.mir b/tests/mir-opt/issue_62289.test.ElaborateDrops.before.panic-abort.mir index 3104baa5fdb..736a8bbca49 100644 --- a/tests/mir-opt/issue_62289.test.ElaborateDrops.before.panic-abort.mir +++ b/tests/mir-opt/issue_62289.test.ElaborateDrops.before.panic-abort.mir @@ -54,8 +54,8 @@ fn test() -> Option<Box<u32>> { bb4: { StorageLive(_12); - _12 = ((_6 as Continue).0: u32); - (*_5) = _12; + _12 = copy ((_6 as Continue).0: u32); + (*_5) = copy _12; StorageDead(_12); _1 = move _5; drop(_5) -> [return: bb7, unwind: bb11]; @@ -63,9 +63,9 @@ fn test() -> Option<Box<u32>> { bb5: { StorageLive(_9); - _9 = ((_6 as Break).0: std::option::Option<std::convert::Infallible>); + _9 = copy ((_6 as Break).0: std::option::Option<std::convert::Infallible>); StorageLive(_11); - _11 = _9; + _11 = copy _9; _0 = <Option<Box<u32>> as FromResidual<Option<Infallible>>>::from_residual(move _11) -> [return: bb6, unwind: bb12]; } diff --git a/tests/mir-opt/issue_62289.test.ElaborateDrops.before.panic-unwind.mir b/tests/mir-opt/issue_62289.test.ElaborateDrops.before.panic-unwind.mir index da33c830115..1acb1ae20b6 100644 --- a/tests/mir-opt/issue_62289.test.ElaborateDrops.before.panic-unwind.mir +++ b/tests/mir-opt/issue_62289.test.ElaborateDrops.before.panic-unwind.mir @@ -54,8 +54,8 @@ fn test() -> Option<Box<u32>> { bb4: { StorageLive(_12); - _12 = ((_6 as Continue).0: u32); - (*_5) = _12; + _12 = copy ((_6 as Continue).0: u32); + (*_5) = copy _12; StorageDead(_12); _1 = move _5; drop(_5) -> [return: bb7, unwind: bb11]; @@ -63,9 +63,9 @@ fn test() -> Option<Box<u32>> { bb5: { StorageLive(_9); - _9 = ((_6 as Break).0: std::option::Option<std::convert::Infallible>); + _9 = copy ((_6 as Break).0: std::option::Option<std::convert::Infallible>); StorageLive(_11); - _11 = _9; + _11 = copy _9; _0 = <Option<Box<u32>> as FromResidual<Option<Infallible>>>::from_residual(move _11) -> [return: bb6, unwind: bb12]; } diff --git a/tests/mir-opt/issue_72181.bar.built.after.mir b/tests/mir-opt/issue_72181.bar.built.after.mir index b6cc7d22195..569c4a00628 100644 --- a/tests/mir-opt/issue_72181.bar.built.after.mir +++ b/tests/mir-opt/issue_72181.bar.built.after.mir @@ -9,8 +9,8 @@ fn bar(_1: [(Never, u32); 1]) -> u32 { bb0: { StorageLive(_2); - _2 = (_1[0 of 1].1: u32); - _0 = _2; + _2 = copy (_1[0 of 1].1: u32); + _0 = copy _2; StorageDead(_2); return; } diff --git a/tests/mir-opt/issue_72181.foo.built.after.mir b/tests/mir-opt/issue_72181.foo.built.after.mir index f78942cc56f..314cf8b367f 100644 --- a/tests/mir-opt/issue_72181.foo.built.after.mir +++ b/tests/mir-opt/issue_72181.foo.built.after.mir @@ -11,12 +11,12 @@ fn foo(_1: [(Never, u32); 1]) -> u32 { StorageLive(_2); _2 = const 0_usize; _3 = Len(_1); - _4 = Lt(_2, _3); - assert(move _4, "index out of bounds: the length is {} but the index is {}", move _3, _2) -> [success: bb1, unwind: bb2]; + _4 = Lt(copy _2, copy _3); + assert(move _4, "index out of bounds: the length is {} but the index is {}", move _3, copy _2) -> [success: bb1, unwind: bb2]; } bb1: { - _0 = (_1[_2].1: u32); + _0 = copy (_1[_2].1: u32); StorageDead(_2); return; } diff --git a/tests/mir-opt/issue_72181.main.built.after.mir b/tests/mir-opt/issue_72181.main.built.after.mir index 89d351d5172..aade84a6dd2 100644 --- a/tests/mir-opt/issue_72181.main.built.after.mir +++ b/tests/mir-opt/issue_72181.main.built.after.mir @@ -39,8 +39,8 @@ fn main() -> () { StorageLive(_6); _6 = const 0_usize; _7 = Len(_2); - _8 = Lt(_6, _7); - assert(move _8, "index out of bounds: the length is {} but the index is {}", move _7, _6) -> [success: bb3, unwind: bb5]; + _8 = Lt(copy _6, copy _7); + assert(move _8, "index out of bounds: the length is {} but the index is {}", move _7, copy _6) -> [success: bb3, unwind: bb5]; } bb2: { @@ -49,7 +49,7 @@ fn main() -> () { } bb3: { - _5 = (_2[_6].0: u64); + _5 = copy (_2[_6].0: u64); PlaceMention(_5); StorageDead(_6); StorageDead(_5); diff --git a/tests/mir-opt/issue_76432.test.SimplifyComparisonIntegral.panic-abort.diff b/tests/mir-opt/issue_76432.test.SimplifyComparisonIntegral.panic-abort.diff index 861ee1d3d3d..f03691ad673 100644 --- a/tests/mir-opt/issue_76432.test.SimplifyComparisonIntegral.panic-abort.diff +++ b/tests/mir-opt/issue_76432.test.SimplifyComparisonIntegral.panic-abort.diff @@ -24,9 +24,9 @@ bb0: { StorageLive(_4); - _4 = [_1, _1, _1]; + _4 = [copy _1, copy _1, copy _1]; _3 = &_4; - _2 = _3 as &[T] (PointerCoercion(Unsize)); + _2 = copy _3 as &[T] (PointerCoercion(Unsize)); nop; nop; goto -> bb2; diff --git a/tests/mir-opt/issue_76432.test.SimplifyComparisonIntegral.panic-unwind.diff b/tests/mir-opt/issue_76432.test.SimplifyComparisonIntegral.panic-unwind.diff index f27be953384..633e5c740a1 100644 --- a/tests/mir-opt/issue_76432.test.SimplifyComparisonIntegral.panic-unwind.diff +++ b/tests/mir-opt/issue_76432.test.SimplifyComparisonIntegral.panic-unwind.diff @@ -24,9 +24,9 @@ bb0: { StorageLive(_4); - _4 = [_1, _1, _1]; + _4 = [copy _1, copy _1, copy _1]; _3 = &_4; - _2 = _3 as &[T] (PointerCoercion(Unsize)); + _2 = copy _3 as &[T] (PointerCoercion(Unsize)); nop; nop; goto -> bb2; diff --git a/tests/mir-opt/issue_78192.f.InstSimplify-after-simplifycfg.diff b/tests/mir-opt/issue_78192.f.InstSimplify-after-simplifycfg.diff index 53957bb3cb1..aae0570973d 100644 --- a/tests/mir-opt/issue_78192.f.InstSimplify-after-simplifycfg.diff +++ b/tests/mir-opt/issue_78192.f.InstSimplify-after-simplifycfg.diff @@ -17,9 +17,9 @@ StorageLive(_4); _4 = &raw const (*_1); _3 = &_4; - _2 = _3; + _2 = copy _3; StorageDead(_3); - _0 = (*_2); + _0 = copy (*_2); StorageDead(_4); StorageDead(_2); return; diff --git a/tests/mir-opt/issue_91633.foo.built.after.mir b/tests/mir-opt/issue_91633.foo.built.after.mir index a66769f0d11..50fdf08375a 100644 --- a/tests/mir-opt/issue_91633.foo.built.after.mir +++ b/tests/mir-opt/issue_91633.foo.built.after.mir @@ -18,8 +18,8 @@ fn foo(_1: Box<[T]>) -> T { StorageLive(_4); _4 = const 0_usize; _5 = Len((*_1)); - _6 = Lt(_4, _5); - assert(move _6, "index out of bounds: the length is {} but the index is {}", move _5, _4) -> [success: bb1, unwind: bb5]; + _6 = Lt(copy _4, copy _5); + assert(move _6, "index out of bounds: the length is {} but the index is {}", move _5, copy _4) -> [success: bb1, unwind: bb5]; } bb1: { diff --git a/tests/mir-opt/issue_91633.fun.built.after.mir b/tests/mir-opt/issue_91633.fun.built.after.mir index 7175c9e8006..5b41b376719 100644 --- a/tests/mir-opt/issue_91633.fun.built.after.mir +++ b/tests/mir-opt/issue_91633.fun.built.after.mir @@ -16,8 +16,8 @@ fn fun(_1: &[T]) -> &T { StorageLive(_3); _3 = const 0_usize; _4 = Len((*_1)); - _5 = Lt(_3, _4); - assert(move _5, "index out of bounds: the length is {} but the index is {}", move _4, _3) -> [success: bb1, unwind: bb2]; + _5 = Lt(copy _3, copy _4); + assert(move _5, "index out of bounds: the length is {} but the index is {}", move _4, copy _3) -> [success: bb1, unwind: bb2]; } bb1: { diff --git a/tests/mir-opt/issue_99325.main.built.after.32bit.mir b/tests/mir-opt/issue_99325.main.built.after.32bit.mir index 72e7f4794f9..161c73529f5 100644 --- a/tests/mir-opt/issue_99325.main.built.after.32bit.mir +++ b/tests/mir-opt/issue_99325.main.built.after.32bit.mir @@ -83,9 +83,9 @@ fn main() -> () { StorageDead(_3); PlaceMention(_2); StorageLive(_8); - _8 = (_2.0: &&[u8]); + _8 = copy (_2.0: &&[u8]); StorageLive(_9); - _9 = (_2.1: &&[u8; 4]); + _9 = copy (_2.1: &&[u8; 4]); StorageLive(_10); StorageLive(_11); _11 = &(*_8); @@ -187,9 +187,9 @@ fn main() -> () { StorageDead(_24); PlaceMention(_23); StorageLive(_28); - _28 = (_23.0: &&[u8]); + _28 = copy (_23.0: &&[u8]); StorageLive(_29); - _29 = (_23.1: &&[u8; 4]); + _29 = copy (_23.1: &&[u8; 4]); StorageLive(_30); StorageLive(_31); _31 = &(*_28); diff --git a/tests/mir-opt/issue_99325.main.built.after.64bit.mir b/tests/mir-opt/issue_99325.main.built.after.64bit.mir index 72e7f4794f9..161c73529f5 100644 --- a/tests/mir-opt/issue_99325.main.built.after.64bit.mir +++ b/tests/mir-opt/issue_99325.main.built.after.64bit.mir @@ -83,9 +83,9 @@ fn main() -> () { StorageDead(_3); PlaceMention(_2); StorageLive(_8); - _8 = (_2.0: &&[u8]); + _8 = copy (_2.0: &&[u8]); StorageLive(_9); - _9 = (_2.1: &&[u8; 4]); + _9 = copy (_2.1: &&[u8; 4]); StorageLive(_10); StorageLive(_11); _11 = &(*_8); @@ -187,9 +187,9 @@ fn main() -> () { StorageDead(_24); PlaceMention(_23); StorageLive(_28); - _28 = (_23.0: &&[u8]); + _28 = copy (_23.0: &&[u8]); StorageLive(_29); - _29 = (_23.1: &&[u8; 4]); + _29 = copy (_23.1: &&[u8; 4]); StorageLive(_30); StorageLive(_31); _31 = &(*_28); diff --git a/tests/mir-opt/issues/issue_59352.num_to_digit.PreCodegen.after.panic-abort.mir b/tests/mir-opt/issues/issue_59352.num_to_digit.PreCodegen.after.panic-abort.mir index 8da56d59aaa..573c0a12bc1 100644 --- a/tests/mir-opt/issues/issue_59352.num_to_digit.PreCodegen.after.panic-abort.mir +++ b/tests/mir-opt/issues/issue_59352.num_to_digit.PreCodegen.after.panic-abort.mir @@ -19,7 +19,7 @@ fn num_to_digit(_1: char) -> u32 { bb0: { StorageLive(_2); - _2 = char::methods::<impl char>::to_digit(_1, const 8_u32) -> [return: bb1, unwind unreachable]; + _2 = char::methods::<impl char>::to_digit(copy _1, const 8_u32) -> [return: bb1, unwind unreachable]; } bb1: { diff --git a/tests/mir-opt/issues/issue_59352.num_to_digit.PreCodegen.after.panic-unwind.mir b/tests/mir-opt/issues/issue_59352.num_to_digit.PreCodegen.after.panic-unwind.mir index 61bc09d901c..049803041d4 100644 --- a/tests/mir-opt/issues/issue_59352.num_to_digit.PreCodegen.after.panic-unwind.mir +++ b/tests/mir-opt/issues/issue_59352.num_to_digit.PreCodegen.after.panic-unwind.mir @@ -19,7 +19,7 @@ fn num_to_digit(_1: char) -> u32 { bb0: { StorageLive(_2); - _2 = char::methods::<impl char>::to_digit(_1, const 8_u32) -> [return: bb1, unwind continue]; + _2 = char::methods::<impl char>::to_digit(copy _1, const 8_u32) -> [return: bb1, unwind continue]; } bb1: { diff --git a/tests/mir-opt/issues/issue_75439.foo.MatchBranchSimplification.diff b/tests/mir-opt/issues/issue_75439.foo.MatchBranchSimplification.diff index 25ed1b4d0c7..1ab9be96652 100644 --- a/tests/mir-opt/issues/issue_75439.foo.MatchBranchSimplification.diff +++ b/tests/mir-opt/issues/issue_75439.foo.MatchBranchSimplification.diff @@ -19,26 +19,26 @@ bb0: { StorageLive(_2); StorageLive(_3); - _3 = _1; + _3 = copy _1; _2 = move _3 as [u32; 4] (Transmute); StorageDead(_3); - switchInt(_2[0 of 4]) -> [0: bb1, otherwise: bb4]; + switchInt(copy _2[0 of 4]) -> [0: bb1, otherwise: bb4]; } bb1: { - switchInt(_2[1 of 4]) -> [0: bb2, otherwise: bb4]; + switchInt(copy _2[1 of 4]) -> [0: bb2, otherwise: bb4]; } bb2: { - switchInt(_2[2 of 4]) -> [0: bb3, 4294901760: bb3, otherwise: bb4]; + switchInt(copy _2[2 of 4]) -> [0: bb3, 4294901760: bb3, otherwise: bb4]; } bb3: { StorageLive(_4); - _4 = _2[3 of 4]; + _4 = copy _2[3 of 4]; StorageLive(_5); StorageLive(_6); - _6 = _4; + _6 = copy _4; _5 = move _6 as [u8; 4] (Transmute); StorageDead(_6); _0 = Option::<[u8; 4]>::Some(move _5); diff --git a/tests/mir-opt/jump_threading.aggregate.JumpThreading.panic-abort.diff b/tests/mir-opt/jump_threading.aggregate.JumpThreading.panic-abort.diff index e955e669014..a7551c3fb5b 100644 --- a/tests/mir-opt/jump_threading.aggregate.JumpThreading.panic-abort.diff +++ b/tests/mir-opt/jump_threading.aggregate.JumpThreading.panic-abort.diff @@ -18,13 +18,13 @@ StorageLive(_4); _4 = const aggregate::FOO; StorageLive(_2); - _2 = (_4.0: u8); + _2 = copy (_4.0: u8); StorageLive(_3); - _3 = (_4.1: u8); + _3 = copy (_4.1: u8); StorageDead(_4); StorageLive(_5); StorageLive(_6); - _6 = _2; + _6 = copy _2; _5 = Eq(move _6, const 7_u8); - switchInt(move _5) -> [0: bb2, otherwise: bb1]; + goto -> bb2; @@ -32,13 +32,13 @@ bb1: { StorageDead(_6); - _0 = _3; + _0 = copy _3; goto -> bb3; } bb2: { StorageDead(_6); - _0 = _2; + _0 = copy _2; goto -> bb3; } diff --git a/tests/mir-opt/jump_threading.aggregate.JumpThreading.panic-unwind.diff b/tests/mir-opt/jump_threading.aggregate.JumpThreading.panic-unwind.diff index e955e669014..a7551c3fb5b 100644 --- a/tests/mir-opt/jump_threading.aggregate.JumpThreading.panic-unwind.diff +++ b/tests/mir-opt/jump_threading.aggregate.JumpThreading.panic-unwind.diff @@ -18,13 +18,13 @@ StorageLive(_4); _4 = const aggregate::FOO; StorageLive(_2); - _2 = (_4.0: u8); + _2 = copy (_4.0: u8); StorageLive(_3); - _3 = (_4.1: u8); + _3 = copy (_4.1: u8); StorageDead(_4); StorageLive(_5); StorageLive(_6); - _6 = _2; + _6 = copy _2; _5 = Eq(move _6, const 7_u8); - switchInt(move _5) -> [0: bb2, otherwise: bb1]; + goto -> bb2; @@ -32,13 +32,13 @@ bb1: { StorageDead(_6); - _0 = _3; + _0 = copy _3; goto -> bb3; } bb2: { StorageDead(_6); - _0 = _2; + _0 = copy _2; goto -> bb3; } diff --git a/tests/mir-opt/jump_threading.aggregate_copy.JumpThreading.panic-abort.diff b/tests/mir-opt/jump_threading.aggregate_copy.JumpThreading.panic-abort.diff index 0c8e04a1e74..4d639d89f0d 100644 --- a/tests/mir-opt/jump_threading.aggregate_copy.JumpThreading.panic-abort.diff +++ b/tests/mir-opt/jump_threading.aggregate_copy.JumpThreading.panic-abort.diff @@ -22,12 +22,12 @@ StorageLive(_1); _1 = const aggregate_copy::Foo; StorageLive(_2); - _2 = _1; + _2 = copy _1; StorageLive(_3); - _3 = (_2.1: u32); + _3 = copy (_2.1: u32); StorageLive(_4); StorageLive(_5); - _5 = _3; + _5 = copy _3; _4 = Eq(move _5, const 2_u32); - switchInt(move _4) -> [0: bb2, otherwise: bb1]; + goto -> bb2; @@ -35,7 +35,7 @@ bb1: { StorageDead(_5); - _0 = (_2.0: u32); + _0 = copy (_2.0: u32); goto -> bb3; } diff --git a/tests/mir-opt/jump_threading.aggregate_copy.JumpThreading.panic-unwind.diff b/tests/mir-opt/jump_threading.aggregate_copy.JumpThreading.panic-unwind.diff index 0c8e04a1e74..4d639d89f0d 100644 --- a/tests/mir-opt/jump_threading.aggregate_copy.JumpThreading.panic-unwind.diff +++ b/tests/mir-opt/jump_threading.aggregate_copy.JumpThreading.panic-unwind.diff @@ -22,12 +22,12 @@ StorageLive(_1); _1 = const aggregate_copy::Foo; StorageLive(_2); - _2 = _1; + _2 = copy _1; StorageLive(_3); - _3 = (_2.1: u32); + _3 = copy (_2.1: u32); StorageLive(_4); StorageLive(_5); - _5 = _3; + _5 = copy _3; _4 = Eq(move _5, const 2_u32); - switchInt(move _4) -> [0: bb2, otherwise: bb1]; + goto -> bb2; @@ -35,7 +35,7 @@ bb1: { StorageDead(_5); - _0 = (_2.0: u32); + _0 = copy (_2.0: u32); goto -> bb3; } diff --git a/tests/mir-opt/jump_threading.assume.JumpThreading.panic-abort.diff b/tests/mir-opt/jump_threading.assume.JumpThreading.panic-abort.diff index f1f0106fdbc..519cb0f0ab1 100644 --- a/tests/mir-opt/jump_threading.assume.JumpThreading.panic-abort.diff +++ b/tests/mir-opt/jump_threading.assume.JumpThreading.panic-abort.diff @@ -5,11 +5,11 @@ let mut _0: u8; bb0: { - switchInt(_1) -> [7: bb1, otherwise: bb2]; + switchInt(copy _1) -> [7: bb1, otherwise: bb2]; } bb1: { - assume(_2); + assume(copy _2); - goto -> bb3; + goto -> bb6; } @@ -19,7 +19,7 @@ } bb3: { - switchInt(_2) -> [0: bb4, otherwise: bb5]; + switchInt(copy _2) -> [0: bb4, otherwise: bb5]; } bb4: { diff --git a/tests/mir-opt/jump_threading.assume.JumpThreading.panic-unwind.diff b/tests/mir-opt/jump_threading.assume.JumpThreading.panic-unwind.diff index f1f0106fdbc..519cb0f0ab1 100644 --- a/tests/mir-opt/jump_threading.assume.JumpThreading.panic-unwind.diff +++ b/tests/mir-opt/jump_threading.assume.JumpThreading.panic-unwind.diff @@ -5,11 +5,11 @@ let mut _0: u8; bb0: { - switchInt(_1) -> [7: bb1, otherwise: bb2]; + switchInt(copy _1) -> [7: bb1, otherwise: bb2]; } bb1: { - assume(_2); + assume(copy _2); - goto -> bb3; + goto -> bb6; } @@ -19,7 +19,7 @@ } bb3: { - switchInt(_2) -> [0: bb4, otherwise: bb5]; + switchInt(copy _2) -> [0: bb4, otherwise: bb5]; } bb4: { diff --git a/tests/mir-opt/jump_threading.custom_discr.JumpThreading.panic-abort.diff b/tests/mir-opt/jump_threading.custom_discr.JumpThreading.panic-abort.diff index 462cc207785..a86371794eb 100644 --- a/tests/mir-opt/jump_threading.custom_discr.JumpThreading.panic-abort.diff +++ b/tests/mir-opt/jump_threading.custom_discr.JumpThreading.panic-abort.diff @@ -11,7 +11,7 @@ bb0: { StorageLive(_2); StorageLive(_3); - _3 = _1; + _3 = copy _1; switchInt(move _3) -> [0: bb2, otherwise: bb1]; } diff --git a/tests/mir-opt/jump_threading.custom_discr.JumpThreading.panic-unwind.diff b/tests/mir-opt/jump_threading.custom_discr.JumpThreading.panic-unwind.diff index 462cc207785..a86371794eb 100644 --- a/tests/mir-opt/jump_threading.custom_discr.JumpThreading.panic-unwind.diff +++ b/tests/mir-opt/jump_threading.custom_discr.JumpThreading.panic-unwind.diff @@ -11,7 +11,7 @@ bb0: { StorageLive(_2); StorageLive(_3); - _3 = _1; + _3 = copy _1; switchInt(move _3) -> [0: bb2, otherwise: bb1]; } diff --git a/tests/mir-opt/jump_threading.disappearing_bb.JumpThreading.panic-abort.diff b/tests/mir-opt/jump_threading.disappearing_bb.JumpThreading.panic-abort.diff index f290da84e5d..d17f2752f58 100644 --- a/tests/mir-opt/jump_threading.disappearing_bb.JumpThreading.panic-abort.diff +++ b/tests/mir-opt/jump_threading.disappearing_bb.JumpThreading.panic-abort.diff @@ -9,7 +9,7 @@ bb0: { _2 = const true; _3 = const true; - switchInt(_1) -> [0: bb3, 1: bb3, 2: bb1, otherwise: bb2]; + switchInt(copy _1) -> [0: bb3, 1: bb3, 2: bb1, otherwise: bb2]; } bb1: { @@ -28,11 +28,11 @@ } bb4: { - switchInt(_3) -> [0: bb5, otherwise: bb7]; + switchInt(copy _3) -> [0: bb5, otherwise: bb7]; } bb5: { - switchInt(_2) -> [0: bb6, otherwise: bb8]; + switchInt(copy _2) -> [0: bb6, otherwise: bb8]; } bb6: { diff --git a/tests/mir-opt/jump_threading.disappearing_bb.JumpThreading.panic-unwind.diff b/tests/mir-opt/jump_threading.disappearing_bb.JumpThreading.panic-unwind.diff index f290da84e5d..d17f2752f58 100644 --- a/tests/mir-opt/jump_threading.disappearing_bb.JumpThreading.panic-unwind.diff +++ b/tests/mir-opt/jump_threading.disappearing_bb.JumpThreading.panic-unwind.diff @@ -9,7 +9,7 @@ bb0: { _2 = const true; _3 = const true; - switchInt(_1) -> [0: bb3, 1: bb3, 2: bb1, otherwise: bb2]; + switchInt(copy _1) -> [0: bb3, 1: bb3, 2: bb1, otherwise: bb2]; } bb1: { @@ -28,11 +28,11 @@ } bb4: { - switchInt(_3) -> [0: bb5, otherwise: bb7]; + switchInt(copy _3) -> [0: bb5, otherwise: bb7]; } bb5: { - switchInt(_2) -> [0: bb6, otherwise: bb8]; + switchInt(copy _2) -> [0: bb6, otherwise: bb8]; } bb6: { diff --git a/tests/mir-opt/jump_threading.duplicate_chain.JumpThreading.panic-abort.diff b/tests/mir-opt/jump_threading.duplicate_chain.JumpThreading.panic-abort.diff index adcedfb3667..083a6e7487a 100644 --- a/tests/mir-opt/jump_threading.duplicate_chain.JumpThreading.panic-abort.diff +++ b/tests/mir-opt/jump_threading.duplicate_chain.JumpThreading.panic-abort.diff @@ -8,7 +8,7 @@ let mut _4: i32; bb0: { - switchInt(_1) -> [1: bb1, otherwise: bb2]; + switchInt(copy _1) -> [1: bb1, otherwise: bb2]; } bb1: { @@ -28,7 +28,7 @@ bb4: { _4 = const 15_i32; -- switchInt(_2) -> [5: bb5, otherwise: bb6]; +- switchInt(copy _2) -> [5: bb5, otherwise: bb6]; + goto -> bb5; } diff --git a/tests/mir-opt/jump_threading.duplicate_chain.JumpThreading.panic-unwind.diff b/tests/mir-opt/jump_threading.duplicate_chain.JumpThreading.panic-unwind.diff index adcedfb3667..083a6e7487a 100644 --- a/tests/mir-opt/jump_threading.duplicate_chain.JumpThreading.panic-unwind.diff +++ b/tests/mir-opt/jump_threading.duplicate_chain.JumpThreading.panic-unwind.diff @@ -8,7 +8,7 @@ let mut _4: i32; bb0: { - switchInt(_1) -> [1: bb1, otherwise: bb2]; + switchInt(copy _1) -> [1: bb1, otherwise: bb2]; } bb1: { @@ -28,7 +28,7 @@ bb4: { _4 = const 15_i32; -- switchInt(_2) -> [5: bb5, otherwise: bb6]; +- switchInt(copy _2) -> [5: bb5, otherwise: bb6]; + goto -> bb5; } diff --git a/tests/mir-opt/jump_threading.floats.JumpThreading.panic-abort.diff b/tests/mir-opt/jump_threading.floats.JumpThreading.panic-abort.diff index 6ca37e96d29..1192f7c23e1 100644 --- a/tests/mir-opt/jump_threading.floats.JumpThreading.panic-abort.diff +++ b/tests/mir-opt/jump_threading.floats.JumpThreading.panic-abort.diff @@ -33,7 +33,7 @@ StorageDead(_2); StorageLive(_3); StorageLive(_4); - _4 = _1; + _4 = copy _1; _3 = Eq(move _4, const 0f64); switchInt(move _3) -> [0: bb5, otherwise: bb4]; } diff --git a/tests/mir-opt/jump_threading.floats.JumpThreading.panic-unwind.diff b/tests/mir-opt/jump_threading.floats.JumpThreading.panic-unwind.diff index 6ca37e96d29..1192f7c23e1 100644 --- a/tests/mir-opt/jump_threading.floats.JumpThreading.panic-unwind.diff +++ b/tests/mir-opt/jump_threading.floats.JumpThreading.panic-unwind.diff @@ -33,7 +33,7 @@ StorageDead(_2); StorageLive(_3); StorageLive(_4); - _4 = _1; + _4 = copy _1; _3 = Eq(move _4, const 0f64); switchInt(move _3) -> [0: bb5, otherwise: bb4]; } diff --git a/tests/mir-opt/jump_threading.identity.JumpThreading.panic-abort.diff b/tests/mir-opt/jump_threading.identity.JumpThreading.panic-abort.diff index 65379ae8b89..79599f85611 100644 --- a/tests/mir-opt/jump_threading.identity.JumpThreading.panic-abort.diff +++ b/tests/mir-opt/jump_threading.identity.JumpThreading.panic-abort.diff @@ -45,7 +45,7 @@ StorageLive(_2); StorageLive(_3); StorageLive(_4); - _4 = _1; + _4 = copy _1; StorageLive(_10); StorageLive(_11); StorageLive(_12); @@ -59,8 +59,8 @@ bb2: { StorageLive(_9); - _9 = ((_3 as Continue).0: i32); - _2 = _9; + _9 = copy ((_3 as Continue).0: i32); + _2 = copy _9; StorageDead(_9); _0 = Result::<i32, i32>::Ok(move _2); StorageDead(_2); @@ -70,9 +70,9 @@ bb3: { StorageLive(_6); - _6 = ((_3 as Break).0: std::result::Result<std::convert::Infallible, i32>); + _6 = copy ((_3 as Break).0: std::result::Result<std::convert::Infallible, i32>); StorageLive(_8); - _8 = _6; + _8 = copy _6; StorageLive(_14); _14 = move ((_8 as Err).0: i32); StorageLive(_15); @@ -104,7 +104,7 @@ bb6: { _12 = move ((_4 as Err).0: i32); StorageLive(_13); - _13 = Result::<Infallible, i32>::Err(_12); + _13 = Result::<Infallible, i32>::Err(copy _12); _3 = ControlFlow::<Result<Infallible, i32>, i32>::Break(move _13); StorageDead(_13); - goto -> bb5; @@ -113,7 +113,7 @@ bb7: { _11 = move ((_4 as Ok).0: i32); - _3 = ControlFlow::<Result<Infallible, i32>, i32>::Continue(_11); + _3 = ControlFlow::<Result<Infallible, i32>, i32>::Continue(copy _11); goto -> bb5; + } + diff --git a/tests/mir-opt/jump_threading.identity.JumpThreading.panic-unwind.diff b/tests/mir-opt/jump_threading.identity.JumpThreading.panic-unwind.diff index 65379ae8b89..79599f85611 100644 --- a/tests/mir-opt/jump_threading.identity.JumpThreading.panic-unwind.diff +++ b/tests/mir-opt/jump_threading.identity.JumpThreading.panic-unwind.diff @@ -45,7 +45,7 @@ StorageLive(_2); StorageLive(_3); StorageLive(_4); - _4 = _1; + _4 = copy _1; StorageLive(_10); StorageLive(_11); StorageLive(_12); @@ -59,8 +59,8 @@ bb2: { StorageLive(_9); - _9 = ((_3 as Continue).0: i32); - _2 = _9; + _9 = copy ((_3 as Continue).0: i32); + _2 = copy _9; StorageDead(_9); _0 = Result::<i32, i32>::Ok(move _2); StorageDead(_2); @@ -70,9 +70,9 @@ bb3: { StorageLive(_6); - _6 = ((_3 as Break).0: std::result::Result<std::convert::Infallible, i32>); + _6 = copy ((_3 as Break).0: std::result::Result<std::convert::Infallible, i32>); StorageLive(_8); - _8 = _6; + _8 = copy _6; StorageLive(_14); _14 = move ((_8 as Err).0: i32); StorageLive(_15); @@ -104,7 +104,7 @@ bb6: { _12 = move ((_4 as Err).0: i32); StorageLive(_13); - _13 = Result::<Infallible, i32>::Err(_12); + _13 = Result::<Infallible, i32>::Err(copy _12); _3 = ControlFlow::<Result<Infallible, i32>, i32>::Break(move _13); StorageDead(_13); - goto -> bb5; @@ -113,7 +113,7 @@ bb7: { _11 = move ((_4 as Ok).0: i32); - _3 = ControlFlow::<Result<Infallible, i32>, i32>::Continue(_11); + _3 = ControlFlow::<Result<Infallible, i32>, i32>::Continue(copy _11); goto -> bb5; + } + diff --git a/tests/mir-opt/jump_threading.multiple_match.JumpThreading.panic-abort.diff b/tests/mir-opt/jump_threading.multiple_match.JumpThreading.panic-abort.diff index 2ca03e439a0..09c0ad6d485 100644 --- a/tests/mir-opt/jump_threading.multiple_match.JumpThreading.panic-abort.diff +++ b/tests/mir-opt/jump_threading.multiple_match.JumpThreading.panic-abort.diff @@ -7,18 +7,18 @@ let mut _3: u8; bb0: { - switchInt(_1) -> [3: bb1, otherwise: bb2]; + switchInt(copy _1) -> [3: bb1, otherwise: bb2]; } bb1: { - _2 = _1; -- switchInt(_2) -> [3: bb3, otherwise: bb4]; + _2 = copy _1; +- switchInt(copy _2) -> [3: bb3, otherwise: bb4]; + goto -> bb3; } bb2: { - _3 = _1; -- switchInt(_3) -> [3: bb5, otherwise: bb6]; + _3 = copy _1; +- switchInt(copy _3) -> [3: bb5, otherwise: bb6]; + goto -> bb6; } @@ -38,7 +38,7 @@ } bb6: { - switchInt(_3) -> [1: bb7, otherwise: bb8]; + switchInt(copy _3) -> [1: bb7, otherwise: bb8]; } bb7: { diff --git a/tests/mir-opt/jump_threading.multiple_match.JumpThreading.panic-unwind.diff b/tests/mir-opt/jump_threading.multiple_match.JumpThreading.panic-unwind.diff index 2ca03e439a0..09c0ad6d485 100644 --- a/tests/mir-opt/jump_threading.multiple_match.JumpThreading.panic-unwind.diff +++ b/tests/mir-opt/jump_threading.multiple_match.JumpThreading.panic-unwind.diff @@ -7,18 +7,18 @@ let mut _3: u8; bb0: { - switchInt(_1) -> [3: bb1, otherwise: bb2]; + switchInt(copy _1) -> [3: bb1, otherwise: bb2]; } bb1: { - _2 = _1; -- switchInt(_2) -> [3: bb3, otherwise: bb4]; + _2 = copy _1; +- switchInt(copy _2) -> [3: bb3, otherwise: bb4]; + goto -> bb3; } bb2: { - _3 = _1; -- switchInt(_3) -> [3: bb5, otherwise: bb6]; + _3 = copy _1; +- switchInt(copy _3) -> [3: bb5, otherwise: bb6]; + goto -> bb6; } @@ -38,7 +38,7 @@ } bb6: { - switchInt(_3) -> [1: bb7, otherwise: bb8]; + switchInt(copy _3) -> [1: bb7, otherwise: bb8]; } bb7: { diff --git a/tests/mir-opt/jump_threading.mutable_ref.JumpThreading.panic-abort.diff b/tests/mir-opt/jump_threading.mutable_ref.JumpThreading.panic-abort.diff index e9d4352014f..bb47f57b542 100644 --- a/tests/mir-opt/jump_threading.mutable_ref.JumpThreading.panic-abort.diff +++ b/tests/mir-opt/jump_threading.mutable_ref.JumpThreading.panic-abort.diff @@ -27,7 +27,7 @@ StorageDead(_3); StorageLive(_4); StorageLive(_5); - _5 = _1; + _5 = copy _1; _4 = Eq(move _5, const 7_i32); switchInt(move _4) -> [0: bb2, otherwise: bb1]; } diff --git a/tests/mir-opt/jump_threading.mutable_ref.JumpThreading.panic-unwind.diff b/tests/mir-opt/jump_threading.mutable_ref.JumpThreading.panic-unwind.diff index e9d4352014f..bb47f57b542 100644 --- a/tests/mir-opt/jump_threading.mutable_ref.JumpThreading.panic-unwind.diff +++ b/tests/mir-opt/jump_threading.mutable_ref.JumpThreading.panic-unwind.diff @@ -27,7 +27,7 @@ StorageDead(_3); StorageLive(_4); StorageLive(_5); - _5 = _1; + _5 = copy _1; _4 = Eq(move _5, const 7_i32); switchInt(move _4) -> [0: bb2, otherwise: bb1]; } diff --git a/tests/mir-opt/jump_threading.mutate_discriminant.JumpThreading.panic-abort.diff b/tests/mir-opt/jump_threading.mutate_discriminant.JumpThreading.panic-abort.diff index 8821b47c345..7014146cb86 100644 --- a/tests/mir-opt/jump_threading.mutate_discriminant.JumpThreading.panic-abort.diff +++ b/tests/mir-opt/jump_threading.mutate_discriminant.JumpThreading.panic-abort.diff @@ -10,7 +10,7 @@ discriminant(_1) = 1; (((_1 as variant#1).0: NonZeroUsize).0: usize) = const 0_usize; _2 = discriminant(_1); - switchInt(_2) -> [0: bb1, otherwise: bb2]; + switchInt(copy _2) -> [0: bb1, otherwise: bb2]; } bb1: { diff --git a/tests/mir-opt/jump_threading.mutate_discriminant.JumpThreading.panic-unwind.diff b/tests/mir-opt/jump_threading.mutate_discriminant.JumpThreading.panic-unwind.diff index 8821b47c345..7014146cb86 100644 --- a/tests/mir-opt/jump_threading.mutate_discriminant.JumpThreading.panic-unwind.diff +++ b/tests/mir-opt/jump_threading.mutate_discriminant.JumpThreading.panic-unwind.diff @@ -10,7 +10,7 @@ discriminant(_1) = 1; (((_1 as variant#1).0: NonZeroUsize).0: usize) = const 0_usize; _2 = discriminant(_1); - switchInt(_2) -> [0: bb1, otherwise: bb2]; + switchInt(copy _2) -> [0: bb1, otherwise: bb2]; } bb1: { diff --git a/tests/mir-opt/jump_threading.renumbered_bb.JumpThreading.panic-abort.diff b/tests/mir-opt/jump_threading.renumbered_bb.JumpThreading.panic-abort.diff index 2d943a4bee2..9a8bdc8f4d9 100644 --- a/tests/mir-opt/jump_threading.renumbered_bb.JumpThreading.panic-abort.diff +++ b/tests/mir-opt/jump_threading.renumbered_bb.JumpThreading.panic-abort.diff @@ -8,7 +8,7 @@ bb0: { _3 = const false; - switchInt(_1) -> [1: bb1, otherwise: bb2]; + switchInt(copy _1) -> [1: bb1, otherwise: bb2]; } bb1: { @@ -18,17 +18,17 @@ } bb2: { - _2 = _1; - _3 = _1; + _2 = copy _1; + _3 = copy _1; goto -> bb3; } bb3: { - switchInt(_2) -> [0: bb4, otherwise: bb5]; + switchInt(copy _2) -> [0: bb4, otherwise: bb5]; } bb4: { - switchInt(_3) -> [0: bb6, otherwise: bb7]; + switchInt(copy _3) -> [0: bb6, otherwise: bb7]; } bb5: { diff --git a/tests/mir-opt/jump_threading.renumbered_bb.JumpThreading.panic-unwind.diff b/tests/mir-opt/jump_threading.renumbered_bb.JumpThreading.panic-unwind.diff index 2d943a4bee2..9a8bdc8f4d9 100644 --- a/tests/mir-opt/jump_threading.renumbered_bb.JumpThreading.panic-unwind.diff +++ b/tests/mir-opt/jump_threading.renumbered_bb.JumpThreading.panic-unwind.diff @@ -8,7 +8,7 @@ bb0: { _3 = const false; - switchInt(_1) -> [1: bb1, otherwise: bb2]; + switchInt(copy _1) -> [1: bb1, otherwise: bb2]; } bb1: { @@ -18,17 +18,17 @@ } bb2: { - _2 = _1; - _3 = _1; + _2 = copy _1; + _3 = copy _1; goto -> bb3; } bb3: { - switchInt(_2) -> [0: bb4, otherwise: bb5]; + switchInt(copy _2) -> [0: bb4, otherwise: bb5]; } bb4: { - switchInt(_3) -> [0: bb6, otherwise: bb7]; + switchInt(copy _3) -> [0: bb6, otherwise: bb7]; } bb5: { diff --git a/tests/mir-opt/jump_threading.rs b/tests/mir-opt/jump_threading.rs index 6486a321e69..9487a4e7e5f 100644 --- a/tests/mir-opt/jump_threading.rs +++ b/tests/mir-opt/jump_threading.rs @@ -24,11 +24,11 @@ fn too_complex(x: Result<i32, usize>) -> Option<i32> { // CHECK: bb4: { // CHECK: goto -> bb6; // CHECK: bb5: { - // CHECK: {{_.*}} = (([[controlflow]] as Break).0: usize); + // CHECK: {{_.*}} = copy (([[controlflow]] as Break).0: usize); // CHECK: _0 = Option::<i32>::None; // CHECK: goto -> bb7; // CHECK: bb6: { - // CHECK: {{_.*}} = (([[controlflow]] as Continue).0: i32); + // CHECK: {{_.*}} = copy (([[controlflow]] as Continue).0: i32); // CHECK: _0 = Option::<i32>::Some( // CHECK: goto -> bb7; // CHECK: bb7: { @@ -49,16 +49,16 @@ fn too_complex(x: Result<i32, usize>) -> Option<i32> { fn identity(x: Result<i32, i32>) -> Result<i32, i32> { // CHECK-LABEL: fn identity( // CHECK: bb0: { - // CHECK: [[x:_.*]] = _1; + // CHECK: [[x:_.*]] = copy _1; // CHECK: switchInt(move {{_.*}}) -> [0: bb7, 1: bb6, otherwise: bb1]; // CHECK: bb1: { // CHECK: unreachable; // CHECK: bb2: { - // CHECK: {{_.*}} = (([[controlflow:_.*]] as Continue).0: i32); + // CHECK: {{_.*}} = copy (([[controlflow:_.*]] as Continue).0: i32); // CHECK: _0 = Result::<i32, i32>::Ok( // CHECK: goto -> bb4; // CHECK: bb3: { - // CHECK: {{_.*}} = (([[controlflow]] as Break).0: std::result::Result<std::convert::Infallible, i32>); + // CHECK: {{_.*}} = copy (([[controlflow]] as Break).0: std::result::Result<std::convert::Infallible, i32>); // CHECK: _0 = Result::<i32, i32>::Err( // CHECK: goto -> bb4; // CHECK: bb4: { @@ -160,13 +160,13 @@ fn multiple_match(x: u8) -> u8 { mir! { { // CHECK: bb0: { - // CHECK: switchInt([[x:_.*]]) -> [3: bb1, otherwise: bb2]; + // CHECK: switchInt(copy [[x:_.*]]) -> [3: bb1, otherwise: bb2]; match x { 3 => bb1, _ => bb2 } } bb1 = { // We know `x == 3`, so we can take `bb3`. // CHECK: bb1: { - // CHECK: {{_.*}} = [[x]]; + // CHECK: {{_.*}} = copy [[x]]; // CHECK: goto -> bb3; let y = x; match y { 3 => bb3, _ => bb4 } @@ -174,7 +174,7 @@ fn multiple_match(x: u8) -> u8 { bb2 = { // We know `x != 3`, so we can take `bb6`. // CHECK: bb2: { - // CHECK: [[z:_.*]] = [[x]]; + // CHECK: [[z:_.*]] = copy [[x]]; // CHECK: goto -> bb6; let z = x; match z { 3 => bb5, _ => bb6 } @@ -203,7 +203,7 @@ fn multiple_match(x: u8) -> u8 { bb6 = { // We know `z != 3`, so we CANNOT take `bb7`. // CHECK: bb6: { - // CHECK: switchInt([[z]]) -> [1: bb7, otherwise: bb8]; + // CHECK: switchInt(copy [[z]]) -> [1: bb7, otherwise: bb8]; match z { 1 => bb7, _ => bb8 } } bb7 = { @@ -467,12 +467,12 @@ fn assume(a: u8, b: bool) -> u8 { mir! { { // CHECK: bb0: { - // CHECK-NEXT: switchInt(_1) -> [7: bb1, otherwise: bb2] + // CHECK-NEXT: switchInt(copy _1) -> [7: bb1, otherwise: bb2] match a { 7 => bb1, _ => bb2 } } bb1 = { // CHECK: bb1: { - // CHECK-NEXT: assume(_2); + // CHECK-NEXT: assume(copy _2); // CHECK-NEXT: goto -> bb6; Assume(b); Goto(bb3) @@ -484,7 +484,7 @@ fn assume(a: u8, b: bool) -> u8 { } bb3 = { // CHECK: bb3: { - // CHECK-NEXT: switchInt(_2) -> [0: bb4, otherwise: bb5]; + // CHECK-NEXT: switchInt(copy _2) -> [0: bb4, otherwise: bb5]; match b { false => bb4, _ => bb5 } } bb4 = { diff --git a/tests/mir-opt/jump_threading.too_complex.JumpThreading.panic-abort.diff b/tests/mir-opt/jump_threading.too_complex.JumpThreading.panic-abort.diff index 365d9d6b32b..7de35929892 100644 --- a/tests/mir-opt/jump_threading.too_complex.JumpThreading.panic-abort.diff +++ b/tests/mir-opt/jump_threading.too_complex.JumpThreading.panic-abort.diff @@ -39,9 +39,9 @@ bb2: { StorageLive(_6); - _6 = ((_1 as Err).0: usize); + _6 = copy ((_1 as Err).0: usize); StorageLive(_7); - _7 = _6; + _7 = copy _6; _2 = ControlFlow::<usize, i32>::Break(move _7); StorageDead(_7); StorageDead(_6); @@ -51,9 +51,9 @@ bb3: { StorageLive(_4); - _4 = ((_1 as Ok).0: i32); + _4 = copy ((_1 as Ok).0: i32); StorageLive(_5); - _5 = _4; + _5 = copy _4; _2 = ControlFlow::<usize, i32>::Continue(move _5); StorageDead(_5); StorageDead(_4); @@ -68,7 +68,7 @@ bb5: { StorageLive(_11); - _11 = ((_2 as Break).0: usize); + _11 = copy ((_2 as Break).0: usize); _0 = Option::<i32>::None; StorageDead(_11); goto -> bb7; @@ -76,9 +76,9 @@ bb6: { StorageLive(_9); - _9 = ((_2 as Continue).0: i32); + _9 = copy ((_2 as Continue).0: i32); StorageLive(_10); - _10 = _9; + _10 = copy _9; _0 = Option::<i32>::Some(move _10); StorageDead(_10); StorageDead(_9); diff --git a/tests/mir-opt/jump_threading.too_complex.JumpThreading.panic-unwind.diff b/tests/mir-opt/jump_threading.too_complex.JumpThreading.panic-unwind.diff index 365d9d6b32b..7de35929892 100644 --- a/tests/mir-opt/jump_threading.too_complex.JumpThreading.panic-unwind.diff +++ b/tests/mir-opt/jump_threading.too_complex.JumpThreading.panic-unwind.diff @@ -39,9 +39,9 @@ bb2: { StorageLive(_6); - _6 = ((_1 as Err).0: usize); + _6 = copy ((_1 as Err).0: usize); StorageLive(_7); - _7 = _6; + _7 = copy _6; _2 = ControlFlow::<usize, i32>::Break(move _7); StorageDead(_7); StorageDead(_6); @@ -51,9 +51,9 @@ bb3: { StorageLive(_4); - _4 = ((_1 as Ok).0: i32); + _4 = copy ((_1 as Ok).0: i32); StorageLive(_5); - _5 = _4; + _5 = copy _4; _2 = ControlFlow::<usize, i32>::Continue(move _5); StorageDead(_5); StorageDead(_4); @@ -68,7 +68,7 @@ bb5: { StorageLive(_11); - _11 = ((_2 as Break).0: usize); + _11 = copy ((_2 as Break).0: usize); _0 = Option::<i32>::None; StorageDead(_11); goto -> bb7; @@ -76,9 +76,9 @@ bb6: { StorageLive(_9); - _9 = ((_2 as Continue).0: i32); + _9 = copy ((_2 as Continue).0: i32); StorageLive(_10); - _10 = _9; + _10 = copy _9; _0 = Option::<i32>::Some(move _10); StorageDead(_10); StorageDead(_9); diff --git a/tests/mir-opt/lower_array_len.array_bound.GVN.panic-abort.diff b/tests/mir-opt/lower_array_len.array_bound.GVN.panic-abort.diff index 7aca2cb0007..8223cbbb412 100644 --- a/tests/mir-opt/lower_array_len.array_bound.GVN.panic-abort.diff +++ b/tests/mir-opt/lower_array_len.array_bound.GVN.panic-abort.diff @@ -18,7 +18,7 @@ - StorageLive(_3); + nop; StorageLive(_4); - _4 = _1; + _4 = copy _1; - StorageLive(_5); + nop; StorageLive(_6); @@ -35,8 +35,8 @@ StorageDead(_6); - _3 = Lt(move _4, move _5); - switchInt(move _3) -> [0: bb4, otherwise: bb2]; -+ _3 = Lt(_1, const N); -+ switchInt(_3) -> [0: bb4, otherwise: bb2]; ++ _3 = Lt(copy _1, const N); ++ switchInt(copy _3) -> [0: bb4, otherwise: bb2]; } bb2: { @@ -44,18 +44,18 @@ + nop; StorageDead(_4); StorageLive(_8); - _8 = _1; + _8 = copy _1; - _9 = Len((*_2)); -- _10 = Lt(_8, _9); -- assert(move _10, "index out of bounds: the length is {} but the index is {}", move _9, _8) -> [success: bb3, unwind unreachable]; +- _10 = Lt(copy _8, copy _9); +- assert(move _10, "index out of bounds: the length is {} but the index is {}", move _9, copy _8) -> [success: bb3, unwind unreachable]; + _9 = const N; -+ _10 = _3; -+ assert(_3, "index out of bounds: the length is {} but the index is {}", const N, _1) -> [success: bb3, unwind unreachable]; ++ _10 = copy _3; ++ assert(copy _3, "index out of bounds: the length is {} but the index is {}", const N, copy _1) -> [success: bb3, unwind unreachable]; } bb3: { -- _0 = (*_2)[_8]; -+ _0 = (*_2)[_1]; +- _0 = copy (*_2)[_8]; ++ _0 = copy (*_2)[_1]; StorageDead(_8); goto -> bb5; } diff --git a/tests/mir-opt/lower_array_len.array_bound.GVN.panic-unwind.diff b/tests/mir-opt/lower_array_len.array_bound.GVN.panic-unwind.diff index ed39c11319a..d8f33accbc0 100644 --- a/tests/mir-opt/lower_array_len.array_bound.GVN.panic-unwind.diff +++ b/tests/mir-opt/lower_array_len.array_bound.GVN.panic-unwind.diff @@ -18,7 +18,7 @@ - StorageLive(_3); + nop; StorageLive(_4); - _4 = _1; + _4 = copy _1; - StorageLive(_5); + nop; StorageLive(_6); @@ -35,8 +35,8 @@ StorageDead(_6); - _3 = Lt(move _4, move _5); - switchInt(move _3) -> [0: bb4, otherwise: bb2]; -+ _3 = Lt(_1, const N); -+ switchInt(_3) -> [0: bb4, otherwise: bb2]; ++ _3 = Lt(copy _1, const N); ++ switchInt(copy _3) -> [0: bb4, otherwise: bb2]; } bb2: { @@ -44,18 +44,18 @@ + nop; StorageDead(_4); StorageLive(_8); - _8 = _1; + _8 = copy _1; - _9 = Len((*_2)); -- _10 = Lt(_8, _9); -- assert(move _10, "index out of bounds: the length is {} but the index is {}", move _9, _8) -> [success: bb3, unwind continue]; +- _10 = Lt(copy _8, copy _9); +- assert(move _10, "index out of bounds: the length is {} but the index is {}", move _9, copy _8) -> [success: bb3, unwind continue]; + _9 = const N; -+ _10 = _3; -+ assert(_3, "index out of bounds: the length is {} but the index is {}", const N, _1) -> [success: bb3, unwind continue]; ++ _10 = copy _3; ++ assert(copy _3, "index out of bounds: the length is {} but the index is {}", const N, copy _1) -> [success: bb3, unwind continue]; } bb3: { -- _0 = (*_2)[_8]; -+ _0 = (*_2)[_1]; +- _0 = copy (*_2)[_8]; ++ _0 = copy (*_2)[_1]; StorageDead(_8); goto -> bb5; } diff --git a/tests/mir-opt/lower_array_len.array_bound_mut.GVN.panic-abort.diff b/tests/mir-opt/lower_array_len.array_bound_mut.GVN.panic-abort.diff index 734d28e9546..1cb9963c00e 100644 --- a/tests/mir-opt/lower_array_len.array_bound_mut.GVN.panic-abort.diff +++ b/tests/mir-opt/lower_array_len.array_bound_mut.GVN.panic-abort.diff @@ -21,7 +21,7 @@ - StorageLive(_3); + nop; StorageLive(_4); - _4 = _1; + _4 = copy _1; - StorageLive(_5); + nop; StorageLive(_6); @@ -38,8 +38,8 @@ StorageDead(_6); - _3 = Lt(move _4, move _5); - switchInt(move _3) -> [0: bb4, otherwise: bb2]; -+ _3 = Lt(_1, const N); -+ switchInt(_3) -> [0: bb4, otherwise: bb2]; ++ _3 = Lt(copy _1, const N); ++ switchInt(copy _3) -> [0: bb4, otherwise: bb2]; } bb2: { @@ -47,18 +47,18 @@ + nop; StorageDead(_4); StorageLive(_8); - _8 = _1; + _8 = copy _1; - _9 = Len((*_2)); -- _10 = Lt(_8, _9); -- assert(move _10, "index out of bounds: the length is {} but the index is {}", move _9, _8) -> [success: bb3, unwind unreachable]; +- _10 = Lt(copy _8, copy _9); +- assert(move _10, "index out of bounds: the length is {} but the index is {}", move _9, copy _8) -> [success: bb3, unwind unreachable]; + _9 = const N; -+ _10 = _3; -+ assert(_3, "index out of bounds: the length is {} but the index is {}", const N, _1) -> [success: bb3, unwind unreachable]; ++ _10 = copy _3; ++ assert(copy _3, "index out of bounds: the length is {} but the index is {}", const N, copy _1) -> [success: bb3, unwind unreachable]; } bb3: { -- _0 = (*_2)[_8]; -+ _0 = (*_2)[_1]; +- _0 = copy (*_2)[_8]; ++ _0 = copy (*_2)[_1]; StorageDead(_8); goto -> bb6; } @@ -70,8 +70,8 @@ StorageLive(_11); _11 = const 0_usize; - _12 = Len((*_2)); -- _13 = Lt(_11, _12); -- assert(move _13, "index out of bounds: the length is {} but the index is {}", move _12, _11) -> [success: bb5, unwind unreachable]; +- _13 = Lt(copy _11, copy _12); +- assert(move _13, "index out of bounds: the length is {} but the index is {}", move _12, copy _11) -> [success: bb5, unwind unreachable]; + _12 = const N; + _13 = Lt(const 0_usize, const N); + assert(move _13, "index out of bounds: the length is {} but the index is {}", const N, const 0_usize) -> [success: bb5, unwind unreachable]; diff --git a/tests/mir-opt/lower_array_len.array_bound_mut.GVN.panic-unwind.diff b/tests/mir-opt/lower_array_len.array_bound_mut.GVN.panic-unwind.diff index ec569ab5042..fa4e11ed201 100644 --- a/tests/mir-opt/lower_array_len.array_bound_mut.GVN.panic-unwind.diff +++ b/tests/mir-opt/lower_array_len.array_bound_mut.GVN.panic-unwind.diff @@ -21,7 +21,7 @@ - StorageLive(_3); + nop; StorageLive(_4); - _4 = _1; + _4 = copy _1; - StorageLive(_5); + nop; StorageLive(_6); @@ -38,8 +38,8 @@ StorageDead(_6); - _3 = Lt(move _4, move _5); - switchInt(move _3) -> [0: bb4, otherwise: bb2]; -+ _3 = Lt(_1, const N); -+ switchInt(_3) -> [0: bb4, otherwise: bb2]; ++ _3 = Lt(copy _1, const N); ++ switchInt(copy _3) -> [0: bb4, otherwise: bb2]; } bb2: { @@ -47,18 +47,18 @@ + nop; StorageDead(_4); StorageLive(_8); - _8 = _1; + _8 = copy _1; - _9 = Len((*_2)); -- _10 = Lt(_8, _9); -- assert(move _10, "index out of bounds: the length is {} but the index is {}", move _9, _8) -> [success: bb3, unwind continue]; +- _10 = Lt(copy _8, copy _9); +- assert(move _10, "index out of bounds: the length is {} but the index is {}", move _9, copy _8) -> [success: bb3, unwind continue]; + _9 = const N; -+ _10 = _3; -+ assert(_3, "index out of bounds: the length is {} but the index is {}", const N, _1) -> [success: bb3, unwind continue]; ++ _10 = copy _3; ++ assert(copy _3, "index out of bounds: the length is {} but the index is {}", const N, copy _1) -> [success: bb3, unwind continue]; } bb3: { -- _0 = (*_2)[_8]; -+ _0 = (*_2)[_1]; +- _0 = copy (*_2)[_8]; ++ _0 = copy (*_2)[_1]; StorageDead(_8); goto -> bb6; } @@ -70,8 +70,8 @@ StorageLive(_11); _11 = const 0_usize; - _12 = Len((*_2)); -- _13 = Lt(_11, _12); -- assert(move _13, "index out of bounds: the length is {} but the index is {}", move _12, _11) -> [success: bb5, unwind continue]; +- _13 = Lt(copy _11, copy _12); +- assert(move _13, "index out of bounds: the length is {} but the index is {}", move _12, copy _11) -> [success: bb5, unwind continue]; + _12 = const N; + _13 = Lt(const 0_usize, const N); + assert(move _13, "index out of bounds: the length is {} but the index is {}", const N, const 0_usize) -> [success: bb5, unwind continue]; diff --git a/tests/mir-opt/lower_array_len.rs b/tests/mir-opt/lower_array_len.rs index f7ed376726c..6553343cbf0 100644 --- a/tests/mir-opt/lower_array_len.rs +++ b/tests/mir-opt/lower_array_len.rs @@ -6,7 +6,7 @@ pub fn array_bound<const N: usize>(index: usize, slice: &[u8; N]) -> u8 { // CHECK-LABEL: fn array_bound( // CHECK-NOT: Lt - // CHECK: Lt(_1, const N); + // CHECK: Lt(copy _1, const N); // CHECK-NOT: Lt if index < slice.len() { slice[index] } else { 42 } } @@ -15,7 +15,7 @@ pub fn array_bound<const N: usize>(index: usize, slice: &[u8; N]) -> u8 { pub fn array_bound_mut<const N: usize>(index: usize, slice: &mut [u8; N]) -> u8 { // CHECK-LABEL: fn array_bound_mut( // CHECK-NOT: Lt - // CHECK: Lt(_1, const N); + // CHECK: Lt(copy _1, const N); // CHECK-NOT: Lt // CHECK: Lt(const 0_usize, const N) // CHECK-NOT: Lt diff --git a/tests/mir-opt/lower_intrinsics.f_copy_nonoverlapping.LowerIntrinsics.panic-abort.diff b/tests/mir-opt/lower_intrinsics.f_copy_nonoverlapping.LowerIntrinsics.panic-abort.diff index 96b66af66a2..7f325245bce 100644 --- a/tests/mir-opt/lower_intrinsics.f_copy_nonoverlapping.LowerIntrinsics.panic-abort.diff +++ b/tests/mir-opt/lower_intrinsics.f_copy_nonoverlapping.LowerIntrinsics.panic-abort.diff @@ -33,7 +33,7 @@ StorageLive(_7); _7 = &_1; _6 = &raw const (*_7); - _5 = _6; + _5 = copy _6; _4 = move _5 as *const i32 (PtrToPtr); StorageDead(_5); StorageLive(_8); @@ -42,7 +42,7 @@ StorageLive(_11); _11 = &mut _2; _10 = &raw mut (*_11); - _9 = _10; + _9 = copy _10; _8 = move _9 as *mut i32 (PtrToPtr); StorageDead(_9); - _3 = copy_nonoverlapping::<i32>(move _4, move _8, const 0_usize) -> [return: bb1, unwind unreachable]; diff --git a/tests/mir-opt/lower_intrinsics.f_copy_nonoverlapping.LowerIntrinsics.panic-unwind.diff b/tests/mir-opt/lower_intrinsics.f_copy_nonoverlapping.LowerIntrinsics.panic-unwind.diff index 96b66af66a2..7f325245bce 100644 --- a/tests/mir-opt/lower_intrinsics.f_copy_nonoverlapping.LowerIntrinsics.panic-unwind.diff +++ b/tests/mir-opt/lower_intrinsics.f_copy_nonoverlapping.LowerIntrinsics.panic-unwind.diff @@ -33,7 +33,7 @@ StorageLive(_7); _7 = &_1; _6 = &raw const (*_7); - _5 = _6; + _5 = copy _6; _4 = move _5 as *const i32 (PtrToPtr); StorageDead(_5); StorageLive(_8); @@ -42,7 +42,7 @@ StorageLive(_11); _11 = &mut _2; _10 = &raw mut (*_11); - _9 = _10; + _9 = copy _10; _8 = move _9 as *mut i32 (PtrToPtr); StorageDead(_9); - _3 = copy_nonoverlapping::<i32>(move _4, move _8, const 0_usize) -> [return: bb1, unwind unreachable]; diff --git a/tests/mir-opt/lower_intrinsics.get_metadata.LowerIntrinsics.panic-abort.diff b/tests/mir-opt/lower_intrinsics.get_metadata.LowerIntrinsics.panic-abort.diff index d256058c05e..f2cfce1b6e3 100644 --- a/tests/mir-opt/lower_intrinsics.get_metadata.LowerIntrinsics.panic-abort.diff +++ b/tests/mir-opt/lower_intrinsics.get_metadata.LowerIntrinsics.panic-abort.diff @@ -25,7 +25,7 @@ bb0: { StorageLive(_4); StorageLive(_5); - _5 = _1; + _5 = copy _1; - _4 = ptr_metadata::<i32, ()>(move _5) -> [return: bb1, unwind unreachable]; + _4 = PtrMetadata(move _5); + goto -> bb1; @@ -35,7 +35,7 @@ StorageDead(_5); StorageLive(_6); StorageLive(_7); - _7 = _2; + _7 = copy _2; - _6 = ptr_metadata::<[u8], usize>(move _7) -> [return: bb2, unwind unreachable]; + _6 = PtrMetadata(move _7); + goto -> bb2; @@ -45,7 +45,7 @@ StorageDead(_7); StorageLive(_8); StorageLive(_9); - _9 = _3; + _9 = copy _3; - _8 = ptr_metadata::<dyn Debug, DynMetadata<dyn Debug>>(move _9) -> [return: bb3, unwind unreachable]; + _8 = PtrMetadata(move _9); + goto -> bb3; diff --git a/tests/mir-opt/lower_intrinsics.get_metadata.LowerIntrinsics.panic-unwind.diff b/tests/mir-opt/lower_intrinsics.get_metadata.LowerIntrinsics.panic-unwind.diff index d256058c05e..f2cfce1b6e3 100644 --- a/tests/mir-opt/lower_intrinsics.get_metadata.LowerIntrinsics.panic-unwind.diff +++ b/tests/mir-opt/lower_intrinsics.get_metadata.LowerIntrinsics.panic-unwind.diff @@ -25,7 +25,7 @@ bb0: { StorageLive(_4); StorageLive(_5); - _5 = _1; + _5 = copy _1; - _4 = ptr_metadata::<i32, ()>(move _5) -> [return: bb1, unwind unreachable]; + _4 = PtrMetadata(move _5); + goto -> bb1; @@ -35,7 +35,7 @@ StorageDead(_5); StorageLive(_6); StorageLive(_7); - _7 = _2; + _7 = copy _2; - _6 = ptr_metadata::<[u8], usize>(move _7) -> [return: bb2, unwind unreachable]; + _6 = PtrMetadata(move _7); + goto -> bb2; @@ -45,7 +45,7 @@ StorageDead(_7); StorageLive(_8); StorageLive(_9); - _9 = _3; + _9 = copy _3; - _8 = ptr_metadata::<dyn Debug, DynMetadata<dyn Debug>>(move _9) -> [return: bb3, unwind unreachable]; + _8 = PtrMetadata(move _9); + goto -> bb3; diff --git a/tests/mir-opt/lower_intrinsics.make_pointers.LowerIntrinsics.panic-abort.diff b/tests/mir-opt/lower_intrinsics.make_pointers.LowerIntrinsics.panic-abort.diff index 02934d4c01e..b282509c068 100644 --- a/tests/mir-opt/lower_intrinsics.make_pointers.LowerIntrinsics.panic-abort.diff +++ b/tests/mir-opt/lower_intrinsics.make_pointers.LowerIntrinsics.panic-abort.diff @@ -34,7 +34,7 @@ bb0: { StorageLive(_4); StorageLive(_5); - _5 = _1; + _5 = copy _1; StorageLive(_6); _6 = (); - _4 = aggregate_raw_ptr::<*const i32, *const u8, ()>(move _5, move _6) -> [return: bb1, unwind unreachable]; @@ -47,7 +47,7 @@ StorageDead(_5); StorageLive(_7); StorageLive(_8); - _8 = _2; + _8 = copy _2; StorageLive(_9); _9 = (); - _7 = aggregate_raw_ptr::<*mut u8, *mut (), ()>(move _8, move _9) -> [return: bb2, unwind unreachable]; @@ -60,9 +60,9 @@ StorageDead(_8); StorageLive(_10); StorageLive(_11); - _11 = _1; + _11 = copy _1; StorageLive(_12); - _12 = _3; + _12 = copy _3; - _10 = aggregate_raw_ptr::<*const [u16], *const u8, usize>(move _11, move _12) -> [return: bb3, unwind unreachable]; + _10 = *const [u16] from (move _11, move _12); + goto -> bb3; @@ -73,9 +73,9 @@ StorageDead(_11); StorageLive(_13); StorageLive(_14); - _14 = _2; + _14 = copy _2; StorageLive(_15); - _15 = _3; + _15 = copy _3; - _13 = aggregate_raw_ptr::<*mut [u64], *mut (), usize>(move _14, move _15) -> [return: bb4, unwind unreachable]; + _13 = *mut [u64] from (move _14, move _15); + goto -> bb4; diff --git a/tests/mir-opt/lower_intrinsics.make_pointers.LowerIntrinsics.panic-unwind.diff b/tests/mir-opt/lower_intrinsics.make_pointers.LowerIntrinsics.panic-unwind.diff index 02934d4c01e..b282509c068 100644 --- a/tests/mir-opt/lower_intrinsics.make_pointers.LowerIntrinsics.panic-unwind.diff +++ b/tests/mir-opt/lower_intrinsics.make_pointers.LowerIntrinsics.panic-unwind.diff @@ -34,7 +34,7 @@ bb0: { StorageLive(_4); StorageLive(_5); - _5 = _1; + _5 = copy _1; StorageLive(_6); _6 = (); - _4 = aggregate_raw_ptr::<*const i32, *const u8, ()>(move _5, move _6) -> [return: bb1, unwind unreachable]; @@ -47,7 +47,7 @@ StorageDead(_5); StorageLive(_7); StorageLive(_8); - _8 = _2; + _8 = copy _2; StorageLive(_9); _9 = (); - _7 = aggregate_raw_ptr::<*mut u8, *mut (), ()>(move _8, move _9) -> [return: bb2, unwind unreachable]; @@ -60,9 +60,9 @@ StorageDead(_8); StorageLive(_10); StorageLive(_11); - _11 = _1; + _11 = copy _1; StorageLive(_12); - _12 = _3; + _12 = copy _3; - _10 = aggregate_raw_ptr::<*const [u16], *const u8, usize>(move _11, move _12) -> [return: bb3, unwind unreachable]; + _10 = *const [u16] from (move _11, move _12); + goto -> bb3; @@ -73,9 +73,9 @@ StorageDead(_11); StorageLive(_13); StorageLive(_14); - _14 = _2; + _14 = copy _2; StorageLive(_15); - _15 = _3; + _15 = copy _3; - _13 = aggregate_raw_ptr::<*mut [u64], *mut (), usize>(move _14, move _15) -> [return: bb4, unwind unreachable]; + _13 = *mut [u64] from (move _14, move _15); + goto -> bb4; diff --git a/tests/mir-opt/lower_intrinsics.non_const.LowerIntrinsics.panic-abort.diff b/tests/mir-opt/lower_intrinsics.non_const.LowerIntrinsics.panic-abort.diff index 069a82b9521..5aa98698476 100644 --- a/tests/mir-opt/lower_intrinsics.non_const.LowerIntrinsics.panic-abort.diff +++ b/tests/mir-opt/lower_intrinsics.non_const.LowerIntrinsics.panic-abort.diff @@ -13,7 +13,7 @@ StorageLive(_1); _1 = std::intrinsics::size_of::<T>; StorageLive(_2); - _2 = _1; + _2 = copy _1; - _0 = move _2() -> [return: bb1, unwind unreachable]; + _0 = SizeOf(T); + goto -> bb1; diff --git a/tests/mir-opt/lower_intrinsics.non_const.LowerIntrinsics.panic-unwind.diff b/tests/mir-opt/lower_intrinsics.non_const.LowerIntrinsics.panic-unwind.diff index 069a82b9521..5aa98698476 100644 --- a/tests/mir-opt/lower_intrinsics.non_const.LowerIntrinsics.panic-unwind.diff +++ b/tests/mir-opt/lower_intrinsics.non_const.LowerIntrinsics.panic-unwind.diff @@ -13,7 +13,7 @@ StorageLive(_1); _1 = std::intrinsics::size_of::<T>; StorageLive(_2); - _2 = _1; + _2 = copy _1; - _0 = move _2() -> [return: bb1, unwind unreachable]; + _0 = SizeOf(T); + goto -> bb1; diff --git a/tests/mir-opt/lower_intrinsics.ptr_offset.LowerIntrinsics.panic-abort.diff b/tests/mir-opt/lower_intrinsics.ptr_offset.LowerIntrinsics.panic-abort.diff index 4f7ad0b6094..62cce84f695 100644 --- a/tests/mir-opt/lower_intrinsics.ptr_offset.LowerIntrinsics.panic-abort.diff +++ b/tests/mir-opt/lower_intrinsics.ptr_offset.LowerIntrinsics.panic-abort.diff @@ -10,9 +10,9 @@ bb0: { StorageLive(_3); - _3 = _1; + _3 = copy _1; StorageLive(_4); - _4 = _2; + _4 = copy _2; - _0 = offset::<*const i32, isize>(move _3, move _4) -> [return: bb1, unwind unreachable]; + _0 = Offset(move _3, move _4); + goto -> bb1; diff --git a/tests/mir-opt/lower_intrinsics.ptr_offset.LowerIntrinsics.panic-unwind.diff b/tests/mir-opt/lower_intrinsics.ptr_offset.LowerIntrinsics.panic-unwind.diff index 4f7ad0b6094..62cce84f695 100644 --- a/tests/mir-opt/lower_intrinsics.ptr_offset.LowerIntrinsics.panic-unwind.diff +++ b/tests/mir-opt/lower_intrinsics.ptr_offset.LowerIntrinsics.panic-unwind.diff @@ -10,9 +10,9 @@ bb0: { StorageLive(_3); - _3 = _1; + _3 = copy _1; StorageLive(_4); - _4 = _2; + _4 = copy _2; - _0 = offset::<*const i32, isize>(move _3, move _4) -> [return: bb1, unwind unreachable]; + _0 = Offset(move _3, move _4); + goto -> bb1; diff --git a/tests/mir-opt/lower_intrinsics.read_via_copy_primitive.LowerIntrinsics.panic-abort.diff b/tests/mir-opt/lower_intrinsics.read_via_copy_primitive.LowerIntrinsics.panic-abort.diff index 781104be290..95717d03b61 100644 --- a/tests/mir-opt/lower_intrinsics.read_via_copy_primitive.LowerIntrinsics.panic-abort.diff +++ b/tests/mir-opt/lower_intrinsics.read_via_copy_primitive.LowerIntrinsics.panic-abort.diff @@ -10,7 +10,7 @@ StorageLive(_2); _2 = &raw const (*_1); - _0 = read_via_copy::<i32>(move _2) -> [return: bb1, unwind unreachable]; -+ _0 = (*_2); ++ _0 = copy (*_2); + goto -> bb1; } diff --git a/tests/mir-opt/lower_intrinsics.read_via_copy_primitive.LowerIntrinsics.panic-unwind.diff b/tests/mir-opt/lower_intrinsics.read_via_copy_primitive.LowerIntrinsics.panic-unwind.diff index 781104be290..95717d03b61 100644 --- a/tests/mir-opt/lower_intrinsics.read_via_copy_primitive.LowerIntrinsics.panic-unwind.diff +++ b/tests/mir-opt/lower_intrinsics.read_via_copy_primitive.LowerIntrinsics.panic-unwind.diff @@ -10,7 +10,7 @@ StorageLive(_2); _2 = &raw const (*_1); - _0 = read_via_copy::<i32>(move _2) -> [return: bb1, unwind unreachable]; -+ _0 = (*_2); ++ _0 = copy (*_2); + goto -> bb1; } diff --git a/tests/mir-opt/lower_intrinsics.read_via_copy_uninhabited.LowerIntrinsics.panic-abort.diff b/tests/mir-opt/lower_intrinsics.read_via_copy_uninhabited.LowerIntrinsics.panic-abort.diff index 56c357b3776..8828549249e 100644 --- a/tests/mir-opt/lower_intrinsics.read_via_copy_uninhabited.LowerIntrinsics.panic-abort.diff +++ b/tests/mir-opt/lower_intrinsics.read_via_copy_uninhabited.LowerIntrinsics.panic-abort.diff @@ -10,7 +10,7 @@ StorageLive(_2); _2 = &raw const (*_1); - _0 = read_via_copy::<Never>(move _2) -> unwind unreachable; -+ _0 = (*_2); ++ _0 = copy (*_2); + unreachable; } } diff --git a/tests/mir-opt/lower_intrinsics.read_via_copy_uninhabited.LowerIntrinsics.panic-unwind.diff b/tests/mir-opt/lower_intrinsics.read_via_copy_uninhabited.LowerIntrinsics.panic-unwind.diff index 56c357b3776..8828549249e 100644 --- a/tests/mir-opt/lower_intrinsics.read_via_copy_uninhabited.LowerIntrinsics.panic-unwind.diff +++ b/tests/mir-opt/lower_intrinsics.read_via_copy_uninhabited.LowerIntrinsics.panic-unwind.diff @@ -10,7 +10,7 @@ StorageLive(_2); _2 = &raw const (*_1); - _0 = read_via_copy::<Never>(move _2) -> unwind unreachable; -+ _0 = (*_2); ++ _0 = copy (*_2); + unreachable; } } diff --git a/tests/mir-opt/lower_intrinsics.rs b/tests/mir-opt/lower_intrinsics.rs index 2569f4f4de5..4859d935461 100644 --- a/tests/mir-opt/lower_intrinsics.rs +++ b/tests/mir-opt/lower_intrinsics.rs @@ -197,7 +197,7 @@ pub fn with_overflow(a: i32, b: i32) { pub fn read_via_copy_primitive(r: &i32) -> i32 { // CHECK-LABEL: fn read_via_copy_primitive( // CHECK: [[tmp:_.*]] = &raw const (*_1); - // CHECK: _0 = (*[[tmp]]); + // CHECK: _0 = copy (*[[tmp]]); // CHECK: return; unsafe { core::intrinsics::read_via_copy(r) } @@ -207,7 +207,7 @@ pub fn read_via_copy_primitive(r: &i32) -> i32 { pub fn read_via_copy_uninhabited(r: &Never) -> Never { // CHECK-LABEL: fn read_via_copy_uninhabited( // CHECK: [[tmp:_.*]] = &raw const (*_1); - // CHECK: _0 = (*[[tmp]]); + // CHECK: _0 = copy (*[[tmp]]); // CHECK: unreachable; unsafe { core::intrinsics::read_via_copy(r) } diff --git a/tests/mir-opt/lower_intrinsics.three_way_compare_char.LowerIntrinsics.panic-abort.diff b/tests/mir-opt/lower_intrinsics.three_way_compare_char.LowerIntrinsics.panic-abort.diff index 816d6209715..f29bc5dfc6e 100644 --- a/tests/mir-opt/lower_intrinsics.three_way_compare_char.LowerIntrinsics.panic-abort.diff +++ b/tests/mir-opt/lower_intrinsics.three_way_compare_char.LowerIntrinsics.panic-abort.diff @@ -15,9 +15,9 @@ bb0: { StorageLive(_3); StorageLive(_4); - _4 = _1; + _4 = copy _1; StorageLive(_5); - _5 = _2; + _5 = copy _2; - _3 = three_way_compare::<char>(move _4, move _5) -> [return: bb1, unwind unreachable]; + _3 = Cmp(move _4, move _5); + goto -> bb1; diff --git a/tests/mir-opt/lower_intrinsics.three_way_compare_char.LowerIntrinsics.panic-unwind.diff b/tests/mir-opt/lower_intrinsics.three_way_compare_char.LowerIntrinsics.panic-unwind.diff index 80b4bd7a2be..596ad70b3bf 100644 --- a/tests/mir-opt/lower_intrinsics.three_way_compare_char.LowerIntrinsics.panic-unwind.diff +++ b/tests/mir-opt/lower_intrinsics.three_way_compare_char.LowerIntrinsics.panic-unwind.diff @@ -15,9 +15,9 @@ bb0: { StorageLive(_3); StorageLive(_4); - _4 = _1; + _4 = copy _1; StorageLive(_5); - _5 = _2; + _5 = copy _2; - _3 = three_way_compare::<char>(move _4, move _5) -> [return: bb1, unwind continue]; + _3 = Cmp(move _4, move _5); + goto -> bb1; diff --git a/tests/mir-opt/lower_intrinsics.three_way_compare_signed.LowerIntrinsics.panic-abort.diff b/tests/mir-opt/lower_intrinsics.three_way_compare_signed.LowerIntrinsics.panic-abort.diff index 05c20aaa09a..654cb2503df 100644 --- a/tests/mir-opt/lower_intrinsics.three_way_compare_signed.LowerIntrinsics.panic-abort.diff +++ b/tests/mir-opt/lower_intrinsics.three_way_compare_signed.LowerIntrinsics.panic-abort.diff @@ -12,9 +12,9 @@ bb0: { StorageLive(_3); StorageLive(_4); - _4 = _1; + _4 = copy _1; StorageLive(_5); - _5 = _2; + _5 = copy _2; - _3 = three_way_compare::<i16>(move _4, move _5) -> [return: bb1, unwind unreachable]; + _3 = Cmp(move _4, move _5); + goto -> bb1; diff --git a/tests/mir-opt/lower_intrinsics.three_way_compare_signed.LowerIntrinsics.panic-unwind.diff b/tests/mir-opt/lower_intrinsics.three_way_compare_signed.LowerIntrinsics.panic-unwind.diff index 8a254d02a47..987c2166692 100644 --- a/tests/mir-opt/lower_intrinsics.three_way_compare_signed.LowerIntrinsics.panic-unwind.diff +++ b/tests/mir-opt/lower_intrinsics.three_way_compare_signed.LowerIntrinsics.panic-unwind.diff @@ -12,9 +12,9 @@ bb0: { StorageLive(_3); StorageLive(_4); - _4 = _1; + _4 = copy _1; StorageLive(_5); - _5 = _2; + _5 = copy _2; - _3 = three_way_compare::<i16>(move _4, move _5) -> [return: bb1, unwind continue]; + _3 = Cmp(move _4, move _5); + goto -> bb1; diff --git a/tests/mir-opt/lower_intrinsics.three_way_compare_unsigned.LowerIntrinsics.panic-abort.diff b/tests/mir-opt/lower_intrinsics.three_way_compare_unsigned.LowerIntrinsics.panic-abort.diff index 437614ec673..82c89b7ce54 100644 --- a/tests/mir-opt/lower_intrinsics.three_way_compare_unsigned.LowerIntrinsics.panic-abort.diff +++ b/tests/mir-opt/lower_intrinsics.three_way_compare_unsigned.LowerIntrinsics.panic-abort.diff @@ -15,9 +15,9 @@ bb0: { StorageLive(_3); StorageLive(_4); - _4 = _1; + _4 = copy _1; StorageLive(_5); - _5 = _2; + _5 = copy _2; - _3 = three_way_compare::<u32>(move _4, move _5) -> [return: bb1, unwind unreachable]; + _3 = Cmp(move _4, move _5); + goto -> bb1; diff --git a/tests/mir-opt/lower_intrinsics.three_way_compare_unsigned.LowerIntrinsics.panic-unwind.diff b/tests/mir-opt/lower_intrinsics.three_way_compare_unsigned.LowerIntrinsics.panic-unwind.diff index 7d6137979c8..d7ec6dcfa2c 100644 --- a/tests/mir-opt/lower_intrinsics.three_way_compare_unsigned.LowerIntrinsics.panic-unwind.diff +++ b/tests/mir-opt/lower_intrinsics.three_way_compare_unsigned.LowerIntrinsics.panic-unwind.diff @@ -15,9 +15,9 @@ bb0: { StorageLive(_3); StorageLive(_4); - _4 = _1; + _4 = copy _1; StorageLive(_5); - _5 = _2; + _5 = copy _2; - _3 = three_way_compare::<u32>(move _4, move _5) -> [return: bb1, unwind continue]; + _3 = Cmp(move _4, move _5); + goto -> bb1; diff --git a/tests/mir-opt/lower_intrinsics.transmute_inhabited.LowerIntrinsics.panic-abort.diff b/tests/mir-opt/lower_intrinsics.transmute_inhabited.LowerIntrinsics.panic-abort.diff index 6e542c4b5a7..71e84fdd881 100644 --- a/tests/mir-opt/lower_intrinsics.transmute_inhabited.LowerIntrinsics.panic-abort.diff +++ b/tests/mir-opt/lower_intrinsics.transmute_inhabited.LowerIntrinsics.panic-abort.diff @@ -8,7 +8,7 @@ bb0: { StorageLive(_2); - _2 = _1; + _2 = copy _1; - _0 = transmute::<std::cmp::Ordering, i8>(move _2) -> [return: bb1, unwind unreachable]; + _0 = move _2 as i8 (Transmute); + goto -> bb1; diff --git a/tests/mir-opt/lower_intrinsics.transmute_inhabited.LowerIntrinsics.panic-unwind.diff b/tests/mir-opt/lower_intrinsics.transmute_inhabited.LowerIntrinsics.panic-unwind.diff index 6e542c4b5a7..71e84fdd881 100644 --- a/tests/mir-opt/lower_intrinsics.transmute_inhabited.LowerIntrinsics.panic-unwind.diff +++ b/tests/mir-opt/lower_intrinsics.transmute_inhabited.LowerIntrinsics.panic-unwind.diff @@ -8,7 +8,7 @@ bb0: { StorageLive(_2); - _2 = _1; + _2 = copy _1; - _0 = transmute::<std::cmp::Ordering, i8>(move _2) -> [return: bb1, unwind unreachable]; + _0 = move _2 as i8 (Transmute); + goto -> bb1; diff --git a/tests/mir-opt/lower_intrinsics.transmute_ref_dst.LowerIntrinsics.panic-abort.diff b/tests/mir-opt/lower_intrinsics.transmute_ref_dst.LowerIntrinsics.panic-abort.diff index ab4646370f1..37232b826c1 100644 --- a/tests/mir-opt/lower_intrinsics.transmute_ref_dst.LowerIntrinsics.panic-abort.diff +++ b/tests/mir-opt/lower_intrinsics.transmute_ref_dst.LowerIntrinsics.panic-abort.diff @@ -8,7 +8,7 @@ bb0: { StorageLive(_2); - _2 = _1; + _2 = copy _1; - _0 = transmute::<&T, *const T>(move _2) -> [return: bb1, unwind unreachable]; + _0 = move _2 as *const T (Transmute); + goto -> bb1; diff --git a/tests/mir-opt/lower_intrinsics.transmute_ref_dst.LowerIntrinsics.panic-unwind.diff b/tests/mir-opt/lower_intrinsics.transmute_ref_dst.LowerIntrinsics.panic-unwind.diff index ab4646370f1..37232b826c1 100644 --- a/tests/mir-opt/lower_intrinsics.transmute_ref_dst.LowerIntrinsics.panic-unwind.diff +++ b/tests/mir-opt/lower_intrinsics.transmute_ref_dst.LowerIntrinsics.panic-unwind.diff @@ -8,7 +8,7 @@ bb0: { StorageLive(_2); - _2 = _1; + _2 = copy _1; - _0 = transmute::<&T, *const T>(move _2) -> [return: bb1, unwind unreachable]; + _0 = move _2 as *const T (Transmute); + goto -> bb1; diff --git a/tests/mir-opt/lower_intrinsics.transmute_to_box_uninhabited.LowerIntrinsics.panic-abort.diff b/tests/mir-opt/lower_intrinsics.transmute_to_box_uninhabited.LowerIntrinsics.panic-abort.diff index c4a3358ffa3..8ac70f99ad2 100644 --- a/tests/mir-opt/lower_intrinsics.transmute_to_box_uninhabited.LowerIntrinsics.panic-abort.diff +++ b/tests/mir-opt/lower_intrinsics.transmute_to_box_uninhabited.LowerIntrinsics.panic-abort.diff @@ -17,7 +17,7 @@ } bb1: { - _2 = (((_1.0: std::ptr::Unique<Never>).0: std::ptr::NonNull<Never>).0: *const Never); + _2 = copy (((_1.0: std::ptr::Unique<Never>).0: std::ptr::NonNull<Never>).0: *const Never); PlaceMention((*_2)); unreachable; } diff --git a/tests/mir-opt/lower_intrinsics.transmute_to_box_uninhabited.LowerIntrinsics.panic-unwind.diff b/tests/mir-opt/lower_intrinsics.transmute_to_box_uninhabited.LowerIntrinsics.panic-unwind.diff index c4a3358ffa3..8ac70f99ad2 100644 --- a/tests/mir-opt/lower_intrinsics.transmute_to_box_uninhabited.LowerIntrinsics.panic-unwind.diff +++ b/tests/mir-opt/lower_intrinsics.transmute_to_box_uninhabited.LowerIntrinsics.panic-unwind.diff @@ -17,7 +17,7 @@ } bb1: { - _2 = (((_1.0: std::ptr::Unique<Never>).0: std::ptr::NonNull<Never>).0: *const Never); + _2 = copy (((_1.0: std::ptr::Unique<Never>).0: std::ptr::NonNull<Never>).0: *const Never); PlaceMention((*_2)); unreachable; } diff --git a/tests/mir-opt/lower_intrinsics.transmute_uninhabited.LowerIntrinsics.panic-abort.diff b/tests/mir-opt/lower_intrinsics.transmute_uninhabited.LowerIntrinsics.panic-abort.diff index 6d3ad348988..eab969e9fe5 100644 --- a/tests/mir-opt/lower_intrinsics.transmute_uninhabited.LowerIntrinsics.panic-abort.diff +++ b/tests/mir-opt/lower_intrinsics.transmute_uninhabited.LowerIntrinsics.panic-abort.diff @@ -8,7 +8,7 @@ bb0: { StorageLive(_2); - _2 = _1; + _2 = copy _1; - _0 = transmute::<(), Never>(move _2) -> unwind unreachable; + _0 = move _2 as Never (Transmute); + unreachable; diff --git a/tests/mir-opt/lower_intrinsics.transmute_uninhabited.LowerIntrinsics.panic-unwind.diff b/tests/mir-opt/lower_intrinsics.transmute_uninhabited.LowerIntrinsics.panic-unwind.diff index 6d3ad348988..eab969e9fe5 100644 --- a/tests/mir-opt/lower_intrinsics.transmute_uninhabited.LowerIntrinsics.panic-unwind.diff +++ b/tests/mir-opt/lower_intrinsics.transmute_uninhabited.LowerIntrinsics.panic-unwind.diff @@ -8,7 +8,7 @@ bb0: { StorageLive(_2); - _2 = _1; + _2 = copy _1; - _0 = transmute::<(), Never>(move _2) -> unwind unreachable; + _0 = move _2 as Never (Transmute); + unreachable; diff --git a/tests/mir-opt/lower_intrinsics.unchecked.LowerIntrinsics.panic-abort.diff b/tests/mir-opt/lower_intrinsics.unchecked.LowerIntrinsics.panic-abort.diff index 3c9694d0370..d0d38462f8d 100644 --- a/tests/mir-opt/lower_intrinsics.unchecked.LowerIntrinsics.panic-abort.diff +++ b/tests/mir-opt/lower_intrinsics.unchecked.LowerIntrinsics.panic-abort.diff @@ -64,9 +64,9 @@ bb0: { StorageLive(_4); StorageLive(_5); - _5 = _1; + _5 = copy _1; StorageLive(_6); - _6 = _2; + _6 = copy _2; - _4 = unchecked_add::<i32>(move _5, move _6) -> [return: bb1, unwind unreachable]; + _4 = AddUnchecked(move _5, move _6); + goto -> bb1; @@ -77,9 +77,9 @@ StorageDead(_5); StorageLive(_7); StorageLive(_8); - _8 = _1; + _8 = copy _1; StorageLive(_9); - _9 = _2; + _9 = copy _2; - _7 = unchecked_sub::<i32>(move _8, move _9) -> [return: bb2, unwind unreachable]; + _7 = SubUnchecked(move _8, move _9); + goto -> bb2; @@ -90,9 +90,9 @@ StorageDead(_8); StorageLive(_10); StorageLive(_11); - _11 = _1; + _11 = copy _1; StorageLive(_12); - _12 = _2; + _12 = copy _2; - _10 = unchecked_mul::<i32>(move _11, move _12) -> [return: bb3, unwind unreachable]; + _10 = MulUnchecked(move _11, move _12); + goto -> bb3; @@ -103,9 +103,9 @@ StorageDead(_11); StorageLive(_13); StorageLive(_14); - _14 = _1; + _14 = copy _1; StorageLive(_15); - _15 = _2; + _15 = copy _2; - _13 = unchecked_div::<i32>(move _14, move _15) -> [return: bb4, unwind unreachable]; + _13 = Div(move _14, move _15); + goto -> bb4; @@ -116,9 +116,9 @@ StorageDead(_14); StorageLive(_16); StorageLive(_17); - _17 = _1; + _17 = copy _1; StorageLive(_18); - _18 = _2; + _18 = copy _2; - _16 = unchecked_rem::<i32>(move _17, move _18) -> [return: bb5, unwind unreachable]; + _16 = Rem(move _17, move _18); + goto -> bb5; @@ -129,9 +129,9 @@ StorageDead(_17); StorageLive(_19); StorageLive(_20); - _20 = _1; + _20 = copy _1; StorageLive(_21); - _21 = _2; + _21 = copy _2; - _19 = unchecked_shl::<i32, i32>(move _20, move _21) -> [return: bb6, unwind unreachable]; + _19 = ShlUnchecked(move _20, move _21); + goto -> bb6; @@ -142,9 +142,9 @@ StorageDead(_20); StorageLive(_22); StorageLive(_23); - _23 = _1; + _23 = copy _1; StorageLive(_24); - _24 = _2; + _24 = copy _2; - _22 = unchecked_shr::<i32, i32>(move _23, move _24) -> [return: bb7, unwind unreachable]; + _22 = ShrUnchecked(move _23, move _24); + goto -> bb7; @@ -155,9 +155,9 @@ StorageDead(_23); StorageLive(_25); StorageLive(_26); - _26 = _1; + _26 = copy _1; StorageLive(_27); - _27 = _3; + _27 = copy _3; - _25 = unchecked_shl::<i32, u32>(move _26, move _27) -> [return: bb8, unwind unreachable]; + _25 = ShlUnchecked(move _26, move _27); + goto -> bb8; @@ -168,9 +168,9 @@ StorageDead(_26); StorageLive(_28); StorageLive(_29); - _29 = _1; + _29 = copy _1; StorageLive(_30); - _30 = _3; + _30 = copy _3; - _28 = unchecked_shr::<i32, u32>(move _29, move _30) -> [return: bb9, unwind unreachable]; + _28 = ShrUnchecked(move _29, move _30); + goto -> bb9; diff --git a/tests/mir-opt/lower_intrinsics.unchecked.LowerIntrinsics.panic-unwind.diff b/tests/mir-opt/lower_intrinsics.unchecked.LowerIntrinsics.panic-unwind.diff index 3c9694d0370..d0d38462f8d 100644 --- a/tests/mir-opt/lower_intrinsics.unchecked.LowerIntrinsics.panic-unwind.diff +++ b/tests/mir-opt/lower_intrinsics.unchecked.LowerIntrinsics.panic-unwind.diff @@ -64,9 +64,9 @@ bb0: { StorageLive(_4); StorageLive(_5); - _5 = _1; + _5 = copy _1; StorageLive(_6); - _6 = _2; + _6 = copy _2; - _4 = unchecked_add::<i32>(move _5, move _6) -> [return: bb1, unwind unreachable]; + _4 = AddUnchecked(move _5, move _6); + goto -> bb1; @@ -77,9 +77,9 @@ StorageDead(_5); StorageLive(_7); StorageLive(_8); - _8 = _1; + _8 = copy _1; StorageLive(_9); - _9 = _2; + _9 = copy _2; - _7 = unchecked_sub::<i32>(move _8, move _9) -> [return: bb2, unwind unreachable]; + _7 = SubUnchecked(move _8, move _9); + goto -> bb2; @@ -90,9 +90,9 @@ StorageDead(_8); StorageLive(_10); StorageLive(_11); - _11 = _1; + _11 = copy _1; StorageLive(_12); - _12 = _2; + _12 = copy _2; - _10 = unchecked_mul::<i32>(move _11, move _12) -> [return: bb3, unwind unreachable]; + _10 = MulUnchecked(move _11, move _12); + goto -> bb3; @@ -103,9 +103,9 @@ StorageDead(_11); StorageLive(_13); StorageLive(_14); - _14 = _1; + _14 = copy _1; StorageLive(_15); - _15 = _2; + _15 = copy _2; - _13 = unchecked_div::<i32>(move _14, move _15) -> [return: bb4, unwind unreachable]; + _13 = Div(move _14, move _15); + goto -> bb4; @@ -116,9 +116,9 @@ StorageDead(_14); StorageLive(_16); StorageLive(_17); - _17 = _1; + _17 = copy _1; StorageLive(_18); - _18 = _2; + _18 = copy _2; - _16 = unchecked_rem::<i32>(move _17, move _18) -> [return: bb5, unwind unreachable]; + _16 = Rem(move _17, move _18); + goto -> bb5; @@ -129,9 +129,9 @@ StorageDead(_17); StorageLive(_19); StorageLive(_20); - _20 = _1; + _20 = copy _1; StorageLive(_21); - _21 = _2; + _21 = copy _2; - _19 = unchecked_shl::<i32, i32>(move _20, move _21) -> [return: bb6, unwind unreachable]; + _19 = ShlUnchecked(move _20, move _21); + goto -> bb6; @@ -142,9 +142,9 @@ StorageDead(_20); StorageLive(_22); StorageLive(_23); - _23 = _1; + _23 = copy _1; StorageLive(_24); - _24 = _2; + _24 = copy _2; - _22 = unchecked_shr::<i32, i32>(move _23, move _24) -> [return: bb7, unwind unreachable]; + _22 = ShrUnchecked(move _23, move _24); + goto -> bb7; @@ -155,9 +155,9 @@ StorageDead(_23); StorageLive(_25); StorageLive(_26); - _26 = _1; + _26 = copy _1; StorageLive(_27); - _27 = _3; + _27 = copy _3; - _25 = unchecked_shl::<i32, u32>(move _26, move _27) -> [return: bb8, unwind unreachable]; + _25 = ShlUnchecked(move _26, move _27); + goto -> bb8; @@ -168,9 +168,9 @@ StorageDead(_26); StorageLive(_28); StorageLive(_29); - _29 = _1; + _29 = copy _1; StorageLive(_30); - _30 = _3; + _30 = copy _3; - _28 = unchecked_shr::<i32, u32>(move _29, move _30) -> [return: bb9, unwind unreachable]; + _28 = ShrUnchecked(move _29, move _30); + goto -> bb9; diff --git a/tests/mir-opt/lower_intrinsics.with_overflow.LowerIntrinsics.panic-abort.diff b/tests/mir-opt/lower_intrinsics.with_overflow.LowerIntrinsics.panic-abort.diff index efbbeeeac73..a9bb5e7e3a4 100644 --- a/tests/mir-opt/lower_intrinsics.with_overflow.LowerIntrinsics.panic-abort.diff +++ b/tests/mir-opt/lower_intrinsics.with_overflow.LowerIntrinsics.panic-abort.diff @@ -27,9 +27,9 @@ bb0: { StorageLive(_3); StorageLive(_4); - _4 = _1; + _4 = copy _1; StorageLive(_5); - _5 = _2; + _5 = copy _2; - _3 = add_with_overflow::<i32>(move _4, move _5) -> [return: bb1, unwind unreachable]; + _3 = AddWithOverflow(move _4, move _5); + goto -> bb1; @@ -40,9 +40,9 @@ StorageDead(_4); StorageLive(_6); StorageLive(_7); - _7 = _1; + _7 = copy _1; StorageLive(_8); - _8 = _2; + _8 = copy _2; - _6 = sub_with_overflow::<i32>(move _7, move _8) -> [return: bb2, unwind unreachable]; + _6 = SubWithOverflow(move _7, move _8); + goto -> bb2; @@ -53,9 +53,9 @@ StorageDead(_7); StorageLive(_9); StorageLive(_10); - _10 = _1; + _10 = copy _1; StorageLive(_11); - _11 = _2; + _11 = copy _2; - _9 = mul_with_overflow::<i32>(move _10, move _11) -> [return: bb3, unwind unreachable]; + _9 = MulWithOverflow(move _10, move _11); + goto -> bb3; diff --git a/tests/mir-opt/lower_intrinsics.with_overflow.LowerIntrinsics.panic-unwind.diff b/tests/mir-opt/lower_intrinsics.with_overflow.LowerIntrinsics.panic-unwind.diff index efbbeeeac73..a9bb5e7e3a4 100644 --- a/tests/mir-opt/lower_intrinsics.with_overflow.LowerIntrinsics.panic-unwind.diff +++ b/tests/mir-opt/lower_intrinsics.with_overflow.LowerIntrinsics.panic-unwind.diff @@ -27,9 +27,9 @@ bb0: { StorageLive(_3); StorageLive(_4); - _4 = _1; + _4 = copy _1; StorageLive(_5); - _5 = _2; + _5 = copy _2; - _3 = add_with_overflow::<i32>(move _4, move _5) -> [return: bb1, unwind unreachable]; + _3 = AddWithOverflow(move _4, move _5); + goto -> bb1; @@ -40,9 +40,9 @@ StorageDead(_4); StorageLive(_6); StorageLive(_7); - _7 = _1; + _7 = copy _1; StorageLive(_8); - _8 = _2; + _8 = copy _2; - _6 = sub_with_overflow::<i32>(move _7, move _8) -> [return: bb2, unwind unreachable]; + _6 = SubWithOverflow(move _7, move _8); + goto -> bb2; @@ -53,9 +53,9 @@ StorageDead(_7); StorageLive(_9); StorageLive(_10); - _10 = _1; + _10 = copy _1; StorageLive(_11); - _11 = _2; + _11 = copy _2; - _9 = mul_with_overflow::<i32>(move _10, move _11) -> [return: bb3, unwind unreachable]; + _9 = MulWithOverflow(move _10, move _11); + goto -> bb3; diff --git a/tests/mir-opt/lower_intrinsics.wrapping.LowerIntrinsics.panic-abort.diff b/tests/mir-opt/lower_intrinsics.wrapping.LowerIntrinsics.panic-abort.diff index 2acb193e054..552b1a9a32b 100644 --- a/tests/mir-opt/lower_intrinsics.wrapping.LowerIntrinsics.panic-abort.diff +++ b/tests/mir-opt/lower_intrinsics.wrapping.LowerIntrinsics.panic-abort.diff @@ -27,9 +27,9 @@ bb0: { StorageLive(_3); StorageLive(_4); - _4 = _1; + _4 = copy _1; StorageLive(_5); - _5 = _2; + _5 = copy _2; - _3 = std::intrinsics::wrapping_add::<i32>(move _4, move _5) -> [return: bb1, unwind unreachable]; + _3 = Add(move _4, move _5); + goto -> bb1; @@ -40,9 +40,9 @@ StorageDead(_4); StorageLive(_6); StorageLive(_7); - _7 = _1; + _7 = copy _1; StorageLive(_8); - _8 = _2; + _8 = copy _2; - _6 = std::intrinsics::wrapping_sub::<i32>(move _7, move _8) -> [return: bb2, unwind unreachable]; + _6 = Sub(move _7, move _8); + goto -> bb2; @@ -53,9 +53,9 @@ StorageDead(_7); StorageLive(_9); StorageLive(_10); - _10 = _1; + _10 = copy _1; StorageLive(_11); - _11 = _2; + _11 = copy _2; - _9 = wrapping_mul::<i32>(move _10, move _11) -> [return: bb3, unwind unreachable]; + _9 = Mul(move _10, move _11); + goto -> bb3; diff --git a/tests/mir-opt/lower_intrinsics.wrapping.LowerIntrinsics.panic-unwind.diff b/tests/mir-opt/lower_intrinsics.wrapping.LowerIntrinsics.panic-unwind.diff index 2acb193e054..552b1a9a32b 100644 --- a/tests/mir-opt/lower_intrinsics.wrapping.LowerIntrinsics.panic-unwind.diff +++ b/tests/mir-opt/lower_intrinsics.wrapping.LowerIntrinsics.panic-unwind.diff @@ -27,9 +27,9 @@ bb0: { StorageLive(_3); StorageLive(_4); - _4 = _1; + _4 = copy _1; StorageLive(_5); - _5 = _2; + _5 = copy _2; - _3 = std::intrinsics::wrapping_add::<i32>(move _4, move _5) -> [return: bb1, unwind unreachable]; + _3 = Add(move _4, move _5); + goto -> bb1; @@ -40,9 +40,9 @@ StorageDead(_4); StorageLive(_6); StorageLive(_7); - _7 = _1; + _7 = copy _1; StorageLive(_8); - _8 = _2; + _8 = copy _2; - _6 = std::intrinsics::wrapping_sub::<i32>(move _7, move _8) -> [return: bb2, unwind unreachable]; + _6 = Sub(move _7, move _8); + goto -> bb2; @@ -53,9 +53,9 @@ StorageDead(_7); StorageLive(_9); StorageLive(_10); - _10 = _1; + _10 = copy _1; StorageLive(_11); - _11 = _2; + _11 = copy _2; - _9 = wrapping_mul::<i32>(move _10, move _11) -> [return: bb3, unwind unreachable]; + _9 = Mul(move _10, move _11); + goto -> bb3; diff --git a/tests/mir-opt/lower_slice_len.bound.LowerSliceLenCalls.panic-abort.diff b/tests/mir-opt/lower_slice_len.bound.LowerSliceLenCalls.panic-abort.diff index a212ee67881..20001f1248e 100644 --- a/tests/mir-opt/lower_slice_len.bound.LowerSliceLenCalls.panic-abort.diff +++ b/tests/mir-opt/lower_slice_len.bound.LowerSliceLenCalls.panic-abort.diff @@ -16,7 +16,7 @@ bb0: { StorageLive(_3); StorageLive(_4); - _4 = _1; + _4 = copy _1; StorageLive(_5); StorageLive(_6); _6 = &(*_2); @@ -35,14 +35,14 @@ StorageDead(_5); StorageDead(_4); StorageLive(_7); - _7 = _1; + _7 = copy _1; _8 = Len((*_2)); - _9 = Lt(_7, _8); - assert(move _9, "index out of bounds: the length is {} but the index is {}", move _8, _7) -> [success: bb3, unwind unreachable]; + _9 = Lt(copy _7, copy _8); + assert(move _9, "index out of bounds: the length is {} but the index is {}", move _8, copy _7) -> [success: bb3, unwind unreachable]; } bb3: { - _0 = (*_2)[_7]; + _0 = copy (*_2)[_7]; StorageDead(_7); goto -> bb5; } diff --git a/tests/mir-opt/lower_slice_len.bound.LowerSliceLenCalls.panic-unwind.diff b/tests/mir-opt/lower_slice_len.bound.LowerSliceLenCalls.panic-unwind.diff index 38ec8a5b0c7..ca8f92df5de 100644 --- a/tests/mir-opt/lower_slice_len.bound.LowerSliceLenCalls.panic-unwind.diff +++ b/tests/mir-opt/lower_slice_len.bound.LowerSliceLenCalls.panic-unwind.diff @@ -16,7 +16,7 @@ bb0: { StorageLive(_3); StorageLive(_4); - _4 = _1; + _4 = copy _1; StorageLive(_5); StorageLive(_6); _6 = &(*_2); @@ -35,14 +35,14 @@ StorageDead(_5); StorageDead(_4); StorageLive(_7); - _7 = _1; + _7 = copy _1; _8 = Len((*_2)); - _9 = Lt(_7, _8); - assert(move _9, "index out of bounds: the length is {} but the index is {}", move _8, _7) -> [success: bb3, unwind continue]; + _9 = Lt(copy _7, copy _8); + assert(move _9, "index out of bounds: the length is {} but the index is {}", move _8, copy _7) -> [success: bb3, unwind continue]; } bb3: { - _0 = (*_2)[_7]; + _0 = copy (*_2)[_7]; StorageDead(_7); goto -> bb5; } diff --git a/tests/mir-opt/match_arm_scopes.complicated_match.panic-abort.SimplifyCfg-initial.after-ElaborateDrops.after.diff b/tests/mir-opt/match_arm_scopes.complicated_match.panic-abort.SimplifyCfg-initial.after-ElaborateDrops.after.diff index 3c4a84bc243..b3eb3e1f8b9 100644 --- a/tests/mir-opt/match_arm_scopes.complicated_match.panic-abort.SimplifyCfg-initial.after-ElaborateDrops.after.diff +++ b/tests/mir-opt/match_arm_scopes.complicated_match.panic-abort.SimplifyCfg-initial.after-ElaborateDrops.after.diff @@ -32,22 +32,22 @@ bb0: { PlaceMention(_2); -- switchInt((_2.0: bool)) -> [0: bb2, otherwise: bb1]; -+ switchInt((_2.0: bool)) -> [0: bb6, otherwise: bb1]; +- switchInt(copy (_2.0: bool)) -> [0: bb2, otherwise: bb1]; ++ switchInt(copy (_2.0: bool)) -> [0: bb6, otherwise: bb1]; } bb1: { -- switchInt((_2.1: bool)) -> [0: bb4, otherwise: bb3]; -+ switchInt((_2.1: bool)) -> [0: bb5, otherwise: bb2]; +- switchInt(copy (_2.1: bool)) -> [0: bb4, otherwise: bb3]; ++ switchInt(copy (_2.1: bool)) -> [0: bb5, otherwise: bb2]; } bb2: { - falseEdge -> [real: bb9, imaginary: bb1]; -+ switchInt((_2.0: bool)) -> [0: bb3, otherwise: bb4]; ++ switchInt(copy (_2.0: bool)) -> [0: bb3, otherwise: bb4]; } bb3: { -- switchInt((_2.0: bool)) -> [0: bb6, otherwise: bb5]; +- switchInt(copy (_2.0: bool)) -> [0: bb6, otherwise: bb5]; - } - - bb4: { @@ -60,7 +60,7 @@ - - bb6: { StorageLive(_15); - _15 = (_2.1: bool); + _15 = copy (_2.1: bool); StorageLive(_16); _16 = move (_2.2: std::string::String); - goto -> bb20; @@ -70,7 +70,7 @@ - bb7: { + bb4: { StorageLive(_15); - _15 = (_2.1: bool); + _15 = copy (_2.1: bool); StorageLive(_16); _16 = move (_2.2: std::string::String); - goto -> bb20; @@ -87,7 +87,7 @@ - _4 = &fake shallow (_2.1: bool); StorageLive(_12); StorageLive(_13); - _13 = _1; + _13 = copy _1; - switchInt(move _13) -> [0: bb16, otherwise: bb15]; + switchInt(move _13) -> [0: bb13, otherwise: bb12]; } @@ -102,7 +102,7 @@ - _4 = &fake shallow (_2.1: bool); StorageLive(_9); StorageLive(_10); - _10 = _1; + _10 = copy _1; - switchInt(move _10) -> [0: bb12, otherwise: bb11]; + switchInt(move _10) -> [0: bb9, otherwise: bb8]; } @@ -125,7 +125,7 @@ - bb12: { + bb9: { - _9 = (*_6); + _9 = copy (*_6); - switchInt(move _9) -> [0: bb14, otherwise: bb13]; + switchInt(move _9) -> [0: bb11, otherwise: bb10]; } @@ -139,7 +139,7 @@ - FakeRead(ForGuardBinding, _6); - FakeRead(ForGuardBinding, _8); StorageLive(_5); - _5 = (_2.1: bool); + _5 = copy (_2.1: bool); StorageLive(_7); _7 = move (_2.2: std::string::String); - goto -> bb10; @@ -167,7 +167,7 @@ - bb16: { + bb13: { - _12 = (*_6); + _12 = copy (*_6); - switchInt(move _12) -> [0: bb18, otherwise: bb17]; + switchInt(move _12) -> [0: bb15, otherwise: bb14]; } @@ -181,7 +181,7 @@ - FakeRead(ForGuardBinding, _6); - FakeRead(ForGuardBinding, _8); StorageLive(_5); - _5 = (_2.0: bool); + _5 = copy (_2.0: bool); StorageLive(_7); _7 = move (_2.2: std::string::String); - goto -> bb10; diff --git a/tests/mir-opt/match_arm_scopes.complicated_match.panic-unwind.SimplifyCfg-initial.after-ElaborateDrops.after.diff b/tests/mir-opt/match_arm_scopes.complicated_match.panic-unwind.SimplifyCfg-initial.after-ElaborateDrops.after.diff index 3c4a84bc243..b3eb3e1f8b9 100644 --- a/tests/mir-opt/match_arm_scopes.complicated_match.panic-unwind.SimplifyCfg-initial.after-ElaborateDrops.after.diff +++ b/tests/mir-opt/match_arm_scopes.complicated_match.panic-unwind.SimplifyCfg-initial.after-ElaborateDrops.after.diff @@ -32,22 +32,22 @@ bb0: { PlaceMention(_2); -- switchInt((_2.0: bool)) -> [0: bb2, otherwise: bb1]; -+ switchInt((_2.0: bool)) -> [0: bb6, otherwise: bb1]; +- switchInt(copy (_2.0: bool)) -> [0: bb2, otherwise: bb1]; ++ switchInt(copy (_2.0: bool)) -> [0: bb6, otherwise: bb1]; } bb1: { -- switchInt((_2.1: bool)) -> [0: bb4, otherwise: bb3]; -+ switchInt((_2.1: bool)) -> [0: bb5, otherwise: bb2]; +- switchInt(copy (_2.1: bool)) -> [0: bb4, otherwise: bb3]; ++ switchInt(copy (_2.1: bool)) -> [0: bb5, otherwise: bb2]; } bb2: { - falseEdge -> [real: bb9, imaginary: bb1]; -+ switchInt((_2.0: bool)) -> [0: bb3, otherwise: bb4]; ++ switchInt(copy (_2.0: bool)) -> [0: bb3, otherwise: bb4]; } bb3: { -- switchInt((_2.0: bool)) -> [0: bb6, otherwise: bb5]; +- switchInt(copy (_2.0: bool)) -> [0: bb6, otherwise: bb5]; - } - - bb4: { @@ -60,7 +60,7 @@ - - bb6: { StorageLive(_15); - _15 = (_2.1: bool); + _15 = copy (_2.1: bool); StorageLive(_16); _16 = move (_2.2: std::string::String); - goto -> bb20; @@ -70,7 +70,7 @@ - bb7: { + bb4: { StorageLive(_15); - _15 = (_2.1: bool); + _15 = copy (_2.1: bool); StorageLive(_16); _16 = move (_2.2: std::string::String); - goto -> bb20; @@ -87,7 +87,7 @@ - _4 = &fake shallow (_2.1: bool); StorageLive(_12); StorageLive(_13); - _13 = _1; + _13 = copy _1; - switchInt(move _13) -> [0: bb16, otherwise: bb15]; + switchInt(move _13) -> [0: bb13, otherwise: bb12]; } @@ -102,7 +102,7 @@ - _4 = &fake shallow (_2.1: bool); StorageLive(_9); StorageLive(_10); - _10 = _1; + _10 = copy _1; - switchInt(move _10) -> [0: bb12, otherwise: bb11]; + switchInt(move _10) -> [0: bb9, otherwise: bb8]; } @@ -125,7 +125,7 @@ - bb12: { + bb9: { - _9 = (*_6); + _9 = copy (*_6); - switchInt(move _9) -> [0: bb14, otherwise: bb13]; + switchInt(move _9) -> [0: bb11, otherwise: bb10]; } @@ -139,7 +139,7 @@ - FakeRead(ForGuardBinding, _6); - FakeRead(ForGuardBinding, _8); StorageLive(_5); - _5 = (_2.1: bool); + _5 = copy (_2.1: bool); StorageLive(_7); _7 = move (_2.2: std::string::String); - goto -> bb10; @@ -167,7 +167,7 @@ - bb16: { + bb13: { - _12 = (*_6); + _12 = copy (*_6); - switchInt(move _12) -> [0: bb18, otherwise: bb17]; + switchInt(move _12) -> [0: bb15, otherwise: bb14]; } @@ -181,7 +181,7 @@ - FakeRead(ForGuardBinding, _6); - FakeRead(ForGuardBinding, _8); StorageLive(_5); - _5 = (_2.0: bool); + _5 = copy (_2.0: bool); StorageLive(_7); _7 = move (_2.2: std::string::String); - goto -> bb10; diff --git a/tests/mir-opt/matches_reduce_branches.bar.MatchBranchSimplification.diff b/tests/mir-opt/matches_reduce_branches.bar.MatchBranchSimplification.diff index 65da13eec50..597d93926f1 100644 --- a/tests/mir-opt/matches_reduce_branches.bar.MatchBranchSimplification.diff +++ b/tests/mir-opt/matches_reduce_branches.bar.MatchBranchSimplification.diff @@ -33,16 +33,16 @@ StorageLive(_4); StorageLive(_5); StorageLive(_6); -- switchInt(_1) -> [7: bb2, otherwise: bb1]; +- switchInt(copy _1) -> [7: bb2, otherwise: bb1]; - } - - bb1: { - _2 = const true; - _3 = const false; + StorageLive(_11); -+ _11 = _1; -+ _2 = Ne(_11, const 7_i32); -+ _3 = Eq(_11, const 7_i32); ++ _11 = copy _1; ++ _2 = Ne(copy _11, const 7_i32); ++ _3 = Eq(copy _11, const 7_i32); _4 = const false; _5 = const true; _6 = (); @@ -62,13 +62,13 @@ + StorageDead(_11); StorageDead(_6); StorageLive(_7); - _7 = _2; + _7 = copy _2; StorageLive(_8); - _8 = _3; + _8 = copy _3; StorageLive(_9); - _9 = _4; + _9 = copy _4; StorageLive(_10); - _10 = _5; + _10 = copy _5; _0 = (move _7, move _8, move _9, move _10); StorageDead(_10); StorageDead(_9); diff --git a/tests/mir-opt/matches_reduce_branches.foo.MatchBranchSimplification.diff b/tests/mir-opt/matches_reduce_branches.foo.MatchBranchSimplification.diff index 052e2e12664..281f43b355d 100644 --- a/tests/mir-opt/matches_reduce_branches.foo.MatchBranchSimplification.diff +++ b/tests/mir-opt/matches_reduce_branches.foo.MatchBranchSimplification.diff @@ -14,7 +14,7 @@ - switchInt(move _3) -> [0: bb2, otherwise: bb1]; + StorageLive(_4); + _4 = move _3; -+ _2 = Eq(_4, const 0_isize); ++ _2 = Eq(copy _4, const 0_isize); + StorageDead(_4); + switchInt(move _2) -> [0: bb2, otherwise: bb1]; } diff --git a/tests/mir-opt/matches_reduce_branches.match_i128_u128.MatchBranchSimplification.diff b/tests/mir-opt/matches_reduce_branches.match_i128_u128.MatchBranchSimplification.diff index fc34ce7125e..cc7e863d135 100644 --- a/tests/mir-opt/matches_reduce_branches.match_i128_u128.MatchBranchSimplification.diff +++ b/tests/mir-opt/matches_reduce_branches.match_i128_u128.MatchBranchSimplification.diff @@ -39,7 +39,7 @@ - bb6: { + StorageLive(_3); + _3 = move _2; -+ _0 = _3 as u128 (IntToInt); ++ _0 = copy _3 as u128 (IntToInt); + StorageDead(_3); return; } diff --git a/tests/mir-opt/matches_reduce_branches.match_nested_if.MatchBranchSimplification.diff b/tests/mir-opt/matches_reduce_branches.match_nested_if.MatchBranchSimplification.diff index 5a71bef9341..e9143ef1636 100644 --- a/tests/mir-opt/matches_reduce_branches.match_nested_if.MatchBranchSimplification.diff +++ b/tests/mir-opt/matches_reduce_branches.match_nested_if.MatchBranchSimplification.diff @@ -46,7 +46,7 @@ - bb4: { + StorageLive(_7); + _7 = move _6; -+ _5 = Ne(_7, const false); ++ _5 = Ne(copy _7, const false); + StorageDead(_7); + StorageLive(_8); + _8 = move _5; @@ -66,7 +66,7 @@ - } - - bb7: { -+ _4 = Ne(_8, const false); ++ _4 = Ne(copy _8, const false); + StorageDead(_8); + StorageLive(_9); + _9 = move _4; @@ -86,7 +86,7 @@ - } - - bb10: { -+ _3 = Ne(_9, const false); ++ _3 = Ne(copy _9, const false); + StorageDead(_9); + StorageLive(_10); + _10 = move _3; @@ -104,10 +104,10 @@ - } - - bb12: { -+ _1 = Ne(_10, const false); ++ _1 = Ne(copy _10, const false); + StorageDead(_10); StorageDead(_2); - _0 = _1; + _0 = copy _1; StorageDead(_1); return; } diff --git a/tests/mir-opt/matches_reduce_branches.match_sext_i8_i16.MatchBranchSimplification.diff b/tests/mir-opt/matches_reduce_branches.match_sext_i8_i16.MatchBranchSimplification.diff index 7f8c2ab8d37..dbd26adc20f 100644 --- a/tests/mir-opt/matches_reduce_branches.match_sext_i8_i16.MatchBranchSimplification.diff +++ b/tests/mir-opt/matches_reduce_branches.match_sext_i8_i16.MatchBranchSimplification.diff @@ -44,7 +44,7 @@ - bb7: { + StorageLive(_3); + _3 = move _2; -+ _0 = _3 as i16 (IntToInt); ++ _0 = copy _3 as i16 (IntToInt); + StorageDead(_3); return; } diff --git a/tests/mir-opt/matches_reduce_branches.match_sext_i8_u16.MatchBranchSimplification.diff b/tests/mir-opt/matches_reduce_branches.match_sext_i8_u16.MatchBranchSimplification.diff index 86d0d0ba6cf..f273d538835 100644 --- a/tests/mir-opt/matches_reduce_branches.match_sext_i8_u16.MatchBranchSimplification.diff +++ b/tests/mir-opt/matches_reduce_branches.match_sext_i8_u16.MatchBranchSimplification.diff @@ -44,7 +44,7 @@ - bb7: { + StorageLive(_3); + _3 = move _2; -+ _0 = _3 as u16 (IntToInt); ++ _0 = copy _3 as u16 (IntToInt); + StorageDead(_3); return; } diff --git a/tests/mir-opt/matches_reduce_branches.match_trunc_i16_i8.MatchBranchSimplification.diff b/tests/mir-opt/matches_reduce_branches.match_trunc_i16_i8.MatchBranchSimplification.diff index d3d27be2070..6170cf13c00 100644 --- a/tests/mir-opt/matches_reduce_branches.match_trunc_i16_i8.MatchBranchSimplification.diff +++ b/tests/mir-opt/matches_reduce_branches.match_trunc_i16_i8.MatchBranchSimplification.diff @@ -69,7 +69,7 @@ - bb12: { + StorageLive(_3); + _3 = move _2; -+ _0 = _3 as i8 (IntToInt); ++ _0 = copy _3 as i8 (IntToInt); + StorageDead(_3); return; } diff --git a/tests/mir-opt/matches_reduce_branches.match_trunc_i16_u8.MatchBranchSimplification.diff b/tests/mir-opt/matches_reduce_branches.match_trunc_i16_u8.MatchBranchSimplification.diff index 5fe899148eb..c18719ebb55 100644 --- a/tests/mir-opt/matches_reduce_branches.match_trunc_i16_u8.MatchBranchSimplification.diff +++ b/tests/mir-opt/matches_reduce_branches.match_trunc_i16_u8.MatchBranchSimplification.diff @@ -69,7 +69,7 @@ - bb12: { + StorageLive(_3); + _3 = move _2; -+ _0 = _3 as u8 (IntToInt); ++ _0 = copy _3 as u8 (IntToInt); + StorageDead(_3); return; } diff --git a/tests/mir-opt/matches_reduce_branches.match_trunc_u16_i8.MatchBranchSimplification.diff b/tests/mir-opt/matches_reduce_branches.match_trunc_u16_i8.MatchBranchSimplification.diff index 85f97a13cac..401049026f2 100644 --- a/tests/mir-opt/matches_reduce_branches.match_trunc_u16_i8.MatchBranchSimplification.diff +++ b/tests/mir-opt/matches_reduce_branches.match_trunc_u16_i8.MatchBranchSimplification.diff @@ -59,7 +59,7 @@ - bb10: { + StorageLive(_3); + _3 = move _2; -+ _0 = _3 as i8 (IntToInt); ++ _0 = copy _3 as i8 (IntToInt); + StorageDead(_3); return; } diff --git a/tests/mir-opt/matches_reduce_branches.match_trunc_u16_u8.MatchBranchSimplification.diff b/tests/mir-opt/matches_reduce_branches.match_trunc_u16_u8.MatchBranchSimplification.diff index 768d838eaa6..d4dafbd886f 100644 --- a/tests/mir-opt/matches_reduce_branches.match_trunc_u16_u8.MatchBranchSimplification.diff +++ b/tests/mir-opt/matches_reduce_branches.match_trunc_u16_u8.MatchBranchSimplification.diff @@ -59,7 +59,7 @@ - bb10: { + StorageLive(_3); + _3 = move _2; -+ _0 = _3 as u8 (IntToInt); ++ _0 = copy _3 as u8 (IntToInt); + StorageDead(_3); return; } diff --git a/tests/mir-opt/matches_reduce_branches.match_u8_i8.MatchBranchSimplification.diff b/tests/mir-opt/matches_reduce_branches.match_u8_i8.MatchBranchSimplification.diff index d63eed7c019..5ab6f5eac84 100644 --- a/tests/mir-opt/matches_reduce_branches.match_u8_i8.MatchBranchSimplification.diff +++ b/tests/mir-opt/matches_reduce_branches.match_u8_i8.MatchBranchSimplification.diff @@ -39,7 +39,7 @@ - bb6: { + StorageLive(_3); + _3 = move _2; -+ _0 = _3 as i8 (IntToInt); ++ _0 = copy _3 as i8 (IntToInt); + StorageDead(_3); return; } diff --git a/tests/mir-opt/matches_reduce_branches.match_u8_i8_2.MatchBranchSimplification.diff b/tests/mir-opt/matches_reduce_branches.match_u8_i8_2.MatchBranchSimplification.diff index 98dee1835a8..f14b3af9660 100644 --- a/tests/mir-opt/matches_reduce_branches.match_u8_i8_2.MatchBranchSimplification.diff +++ b/tests/mir-opt/matches_reduce_branches.match_u8_i8_2.MatchBranchSimplification.diff @@ -35,8 +35,8 @@ - _3 = const -1_i8; + StorageLive(_8); + _8 = move _5; -+ _2 = _8 as i8 (IntToInt); -+ _3 = _8 as i8 (IntToInt); ++ _2 = copy _8 as i8 (IntToInt); ++ _3 = copy _8 as i8 (IntToInt); _4 = (); - goto -> bb6; - } @@ -66,9 +66,9 @@ + StorageDead(_8); StorageDead(_4); StorageLive(_6); - _6 = _2; + _6 = copy _2; StorageLive(_7); - _7 = _3; + _7 = copy _3; _0 = (move _6, move _7); StorageDead(_7); StorageDead(_6); diff --git a/tests/mir-opt/matches_reduce_branches.match_u8_i8_2_failed.MatchBranchSimplification.diff b/tests/mir-opt/matches_reduce_branches.match_u8_i8_2_failed.MatchBranchSimplification.diff index 901dda58617..92e1a7dbc7d 100644 --- a/tests/mir-opt/matches_reduce_branches.match_u8_i8_2_failed.MatchBranchSimplification.diff +++ b/tests/mir-opt/matches_reduce_branches.match_u8_i8_2_failed.MatchBranchSimplification.diff @@ -60,9 +60,9 @@ bb6: { StorageDead(_4); StorageLive(_6); - _6 = _2; + _6 = copy _2; StorageLive(_7); - _7 = _3; + _7 = copy _3; _0 = (move _6, move _7); StorageDead(_7); StorageDead(_6); diff --git a/tests/mir-opt/matches_reduce_branches.match_u8_i8_failed_len_1.MatchBranchSimplification.diff b/tests/mir-opt/matches_reduce_branches.match_u8_i8_failed_len_1.MatchBranchSimplification.diff index 9ebf2cf27cb..a1d58424ecd 100644 --- a/tests/mir-opt/matches_reduce_branches.match_u8_i8_failed_len_1.MatchBranchSimplification.diff +++ b/tests/mir-opt/matches_reduce_branches.match_u8_i8_failed_len_1.MatchBranchSimplification.diff @@ -7,7 +7,7 @@ bb0: { _2 = discriminant(_1); - switchInt(_2) -> [0: bb1, 127: bb2, 128: bb3, 255: bb4, otherwise: bb5]; + switchInt(copy _2) -> [0: bb1, 127: bb2, 128: bb3, 255: bb4, otherwise: bb5]; } bb1: { diff --git a/tests/mir-opt/matches_reduce_branches.match_u8_i8_failed_len_2.MatchBranchSimplification.diff b/tests/mir-opt/matches_reduce_branches.match_u8_i8_failed_len_2.MatchBranchSimplification.diff index 554856777eb..6c4ade1b6ca 100644 --- a/tests/mir-opt/matches_reduce_branches.match_u8_i8_failed_len_2.MatchBranchSimplification.diff +++ b/tests/mir-opt/matches_reduce_branches.match_u8_i8_failed_len_2.MatchBranchSimplification.diff @@ -7,7 +7,7 @@ bb0: { _2 = discriminant(_1); - switchInt(_2) -> [0: bb1, 127: bb2, 128: bb3, 255: bb4, otherwise: bb5]; + switchInt(copy _2) -> [0: bb1, 127: bb2, 128: bb3, 255: bb4, otherwise: bb5]; } bb1: { diff --git a/tests/mir-opt/matches_reduce_branches.match_zext_u8_i16.MatchBranchSimplification.diff b/tests/mir-opt/matches_reduce_branches.match_zext_u8_i16.MatchBranchSimplification.diff index e00a604fe25..fdf83d91bbd 100644 --- a/tests/mir-opt/matches_reduce_branches.match_zext_u8_i16.MatchBranchSimplification.diff +++ b/tests/mir-opt/matches_reduce_branches.match_zext_u8_i16.MatchBranchSimplification.diff @@ -39,7 +39,7 @@ - bb6: { + StorageLive(_3); + _3 = move _2; -+ _0 = _3 as i16 (IntToInt); ++ _0 = copy _3 as i16 (IntToInt); + StorageDead(_3); return; } diff --git a/tests/mir-opt/matches_reduce_branches.match_zext_u8_u16.MatchBranchSimplification.diff b/tests/mir-opt/matches_reduce_branches.match_zext_u8_u16.MatchBranchSimplification.diff index befb9118907..a888d247275 100644 --- a/tests/mir-opt/matches_reduce_branches.match_zext_u8_u16.MatchBranchSimplification.diff +++ b/tests/mir-opt/matches_reduce_branches.match_zext_u8_u16.MatchBranchSimplification.diff @@ -39,7 +39,7 @@ - bb6: { + StorageLive(_3); + _3 = move _2; -+ _0 = _3 as u16 (IntToInt); ++ _0 = copy _3 as u16 (IntToInt); + StorageDead(_3); return; } diff --git a/tests/mir-opt/matches_u8.exhaustive_match.MatchBranchSimplification.diff b/tests/mir-opt/matches_u8.exhaustive_match.MatchBranchSimplification.diff index 11a18f58e3a..99985b28382 100644 --- a/tests/mir-opt/matches_u8.exhaustive_match.MatchBranchSimplification.diff +++ b/tests/mir-opt/matches_u8.exhaustive_match.MatchBranchSimplification.diff @@ -29,7 +29,7 @@ - bb4: { + StorageLive(_3); + _3 = move _2; -+ _0 = _3 as u8 (IntToInt); ++ _0 = copy _3 as u8 (IntToInt); + StorageDead(_3); return; } diff --git a/tests/mir-opt/matches_u8.exhaustive_match_i8.MatchBranchSimplification.diff b/tests/mir-opt/matches_u8.exhaustive_match_i8.MatchBranchSimplification.diff index 809badc41ba..0fc5032691f 100644 --- a/tests/mir-opt/matches_u8.exhaustive_match_i8.MatchBranchSimplification.diff +++ b/tests/mir-opt/matches_u8.exhaustive_match_i8.MatchBranchSimplification.diff @@ -29,7 +29,7 @@ - bb4: { + StorageLive(_3); + _3 = move _2; -+ _0 = _3 as i8 (IntToInt); ++ _0 = copy _3 as i8 (IntToInt); + StorageDead(_3); return; } diff --git a/tests/mir-opt/nll/region_subtyping_basic.main.nll.0.32bit.mir b/tests/mir-opt/nll/region_subtyping_basic.main.nll.0.32bit.mir index ad456600b0a..d09a422d408 100644 --- a/tests/mir-opt/nll/region_subtyping_basic.main.nll.0.32bit.mir +++ b/tests/mir-opt/nll/region_subtyping_basic.main.nll.0.32bit.mir @@ -50,15 +50,15 @@ fn main() -> () { StorageLive(_3); _3 = const ConstValue(Scalar(0x00000000): usize); _4 = Len(_1); - _5 = Lt(_3, _4); - assert(move _5, "index out of bounds: the length is {} but the index is {}", move _4, _3) -> [success: bb1, unwind: bb7]; + _5 = Lt(copy _3, copy _4); + assert(move _5, "index out of bounds: the length is {} but the index is {}", move _4, copy _3) -> [success: bb1, unwind: bb7]; } bb1: { _2 = &'?2 _1[_3]; FakeRead(ForLet(None), _2); StorageLive(_6); - _6 = _2; + _6 = copy _2; FakeRead(ForLet(None), _6); StorageLive(_7); _7 = const ConstValue(Scalar(0x01): bool); @@ -68,7 +68,7 @@ fn main() -> () { bb2: { StorageLive(_8); StorageLive(_9); - _9 = (*_6); + _9 = copy (*_6); _8 = ConstValue(ZeroSized: fn(usize) -> bool {use_x})(move _9) -> [return: bb3, unwind: bb7]; } diff --git a/tests/mir-opt/nll/region_subtyping_basic.main.nll.0.64bit.mir b/tests/mir-opt/nll/region_subtyping_basic.main.nll.0.64bit.mir index a15d47cd66f..4abb5b0b93b 100644 --- a/tests/mir-opt/nll/region_subtyping_basic.main.nll.0.64bit.mir +++ b/tests/mir-opt/nll/region_subtyping_basic.main.nll.0.64bit.mir @@ -50,15 +50,15 @@ fn main() -> () { StorageLive(_3); _3 = const ConstValue(Scalar(0x0000000000000000): usize); _4 = Len(_1); - _5 = Lt(_3, _4); - assert(move _5, "index out of bounds: the length is {} but the index is {}", move _4, _3) -> [success: bb1, unwind: bb7]; + _5 = Lt(copy _3, copy _4); + assert(move _5, "index out of bounds: the length is {} but the index is {}", move _4, copy _3) -> [success: bb1, unwind: bb7]; } bb1: { _2 = &'?2 _1[_3]; FakeRead(ForLet(None), _2); StorageLive(_6); - _6 = _2; + _6 = copy _2; FakeRead(ForLet(None), _6); StorageLive(_7); _7 = const ConstValue(Scalar(0x01): bool); @@ -68,7 +68,7 @@ fn main() -> () { bb2: { StorageLive(_8); StorageLive(_9); - _9 = (*_6); + _9 = copy (*_6); _8 = ConstValue(ZeroSized: fn(usize) -> bool {use_x})(move _9) -> [return: bb3, unwind: bb7]; } diff --git a/tests/mir-opt/nrvo_miscompile_111005.wrong.RenameReturnPlace.diff b/tests/mir-opt/nrvo_miscompile_111005.wrong.RenameReturnPlace.diff index 260b472daa9..d248c76f261 100644 --- a/tests/mir-opt/nrvo_miscompile_111005.wrong.RenameReturnPlace.diff +++ b/tests/mir-opt/nrvo_miscompile_111005.wrong.RenameReturnPlace.diff @@ -6,10 +6,10 @@ let mut _2: char; bb0: { -- _2 = _1; -- _0 = _2; +- _2 = copy _1; +- _0 = copy _2; - _2 = const 'b'; -+ _0 = _1; ++ _0 = copy _1; + _0 = const 'b'; return; } diff --git a/tests/mir-opt/nrvo_simple.nrvo.RenameReturnPlace.panic-abort.diff b/tests/mir-opt/nrvo_simple.nrvo.RenameReturnPlace.panic-abort.diff index f7bc5559ab7..6dce3ec5303 100644 --- a/tests/mir-opt/nrvo_simple.nrvo.RenameReturnPlace.panic-abort.diff +++ b/tests/mir-opt/nrvo_simple.nrvo.RenameReturnPlace.panic-abort.diff @@ -20,7 +20,7 @@ + _0 = [const 0_u8; 1024]; StorageLive(_3); StorageLive(_4); - _4 = _1; + _4 = copy _1; StorageLive(_5); StorageLive(_6); - _6 = &mut _2; @@ -34,7 +34,7 @@ StorageDead(_4); StorageDead(_6); StorageDead(_3); -- _0 = _2; +- _0 = copy _2; - StorageDead(_2); return; } diff --git a/tests/mir-opt/nrvo_simple.nrvo.RenameReturnPlace.panic-unwind.diff b/tests/mir-opt/nrvo_simple.nrvo.RenameReturnPlace.panic-unwind.diff index 3df8e567f1f..54cbe2871f1 100644 --- a/tests/mir-opt/nrvo_simple.nrvo.RenameReturnPlace.panic-unwind.diff +++ b/tests/mir-opt/nrvo_simple.nrvo.RenameReturnPlace.panic-unwind.diff @@ -20,7 +20,7 @@ + _0 = [const 0_u8; 1024]; StorageLive(_3); StorageLive(_4); - _4 = _1; + _4 = copy _1; StorageLive(_5); StorageLive(_6); - _6 = &mut _2; @@ -34,7 +34,7 @@ StorageDead(_4); StorageDead(_6); StorageDead(_3); -- _0 = _2; +- _0 = copy _2; - StorageDead(_2); return; } diff --git a/tests/mir-opt/or_pattern.shortcut_second_or.SimplifyCfg-initial.after.mir b/tests/mir-opt/or_pattern.shortcut_second_or.SimplifyCfg-initial.after.mir index 6c76a72b775..c5d7a6a1d99 100644 --- a/tests/mir-opt/or_pattern.shortcut_second_or.SimplifyCfg-initial.after.mir +++ b/tests/mir-opt/or_pattern.shortcut_second_or.SimplifyCfg-initial.after.mir @@ -18,15 +18,15 @@ fn shortcut_second_or() -> () { _1 = (move _2, const 0_i32); StorageDead(_2); PlaceMention(_1); - switchInt(((_1.0: (i32, i32)).0: i32)) -> [0: bb2, otherwise: bb1]; + switchInt(copy ((_1.0: (i32, i32)).0: i32)) -> [0: bb2, otherwise: bb1]; } bb1: { - switchInt(((_1.0: (i32, i32)).1: i32)) -> [1: bb4, otherwise: bb3]; + switchInt(copy ((_1.0: (i32, i32)).1: i32)) -> [1: bb4, otherwise: bb3]; } bb2: { - switchInt((_1.1: i32)) -> [2: bb5, 3: bb6, otherwise: bb3]; + switchInt(copy (_1.1: i32)) -> [2: bb5, 3: bb6, otherwise: bb3]; } bb3: { @@ -35,7 +35,7 @@ fn shortcut_second_or() -> () { } bb4: { - switchInt((_1.1: i32)) -> [2: bb7, 3: bb8, otherwise: bb3]; + switchInt(copy (_1.1: i32)) -> [2: bb7, 3: bb8, otherwise: bb3]; } bb5: { @@ -56,33 +56,33 @@ fn shortcut_second_or() -> () { bb9: { StorageLive(_3); - _3 = (_1.0: (i32, i32)); + _3 = copy (_1.0: (i32, i32)); StorageLive(_4); - _4 = (_1.1: i32); + _4 = copy (_1.1: i32); goto -> bb13; } bb10: { StorageLive(_3); - _3 = (_1.0: (i32, i32)); + _3 = copy (_1.0: (i32, i32)); StorageLive(_4); - _4 = (_1.1: i32); + _4 = copy (_1.1: i32); goto -> bb13; } bb11: { StorageLive(_3); - _3 = (_1.0: (i32, i32)); + _3 = copy (_1.0: (i32, i32)); StorageLive(_4); - _4 = (_1.1: i32); + _4 = copy (_1.1: i32); goto -> bb13; } bb12: { StorageLive(_3); - _3 = (_1.0: (i32, i32)); + _3 = copy (_1.0: (i32, i32)); StorageLive(_4); - _4 = (_1.1: i32); + _4 = copy (_1.1: i32); goto -> bb13; } diff --git a/tests/mir-opt/or_pattern.single_switchint.SimplifyCfg-initial.after.mir b/tests/mir-opt/or_pattern.single_switchint.SimplifyCfg-initial.after.mir index 8b0ef7b29d7..889ff6f9f5e 100644 --- a/tests/mir-opt/or_pattern.single_switchint.SimplifyCfg-initial.after.mir +++ b/tests/mir-opt/or_pattern.single_switchint.SimplifyCfg-initial.after.mir @@ -10,15 +10,15 @@ fn single_switchint() -> () { StorageLive(_2); _2 = (const 1_i32, const true); PlaceMention(_2); - switchInt((_2.0: i32)) -> [1: bb2, 2: bb4, otherwise: bb1]; + switchInt(copy (_2.0: i32)) -> [1: bb2, 2: bb4, otherwise: bb1]; } bb1: { - switchInt((_2.0: i32)) -> [3: bb8, 4: bb8, otherwise: bb7]; + switchInt(copy (_2.0: i32)) -> [3: bb8, 4: bb8, otherwise: bb7]; } bb2: { - switchInt((_2.1: bool)) -> [0: bb6, otherwise: bb3]; + switchInt(copy (_2.1: bool)) -> [0: bb6, otherwise: bb3]; } bb3: { @@ -26,7 +26,7 @@ fn single_switchint() -> () { } bb4: { - switchInt((_2.1: bool)) -> [0: bb5, otherwise: bb6]; + switchInt(copy (_2.1: bool)) -> [0: bb5, otherwise: bb6]; } bb5: { diff --git a/tests/mir-opt/pre-codegen/chained_comparison.bitand.PreCodegen.after.mir b/tests/mir-opt/pre-codegen/chained_comparison.bitand.PreCodegen.after.mir index 99ca659c637..9b77bdb7cf6 100644 --- a/tests/mir-opt/pre-codegen/chained_comparison.bitand.PreCodegen.after.mir +++ b/tests/mir-opt/pre-codegen/chained_comparison.bitand.PreCodegen.after.mir @@ -29,17 +29,17 @@ fn bitand(_1: &Blueprint, _2: &Blueprint) -> bool { StorageLive(_9); StorageLive(_5); StorageLive(_3); - _3 = ((*_1).0: u32); + _3 = copy ((*_1).0: u32); StorageLive(_4); - _4 = ((*_2).0: u32); + _4 = copy ((*_2).0: u32); _5 = Eq(move _3, move _4); StorageDead(_4); StorageDead(_3); StorageLive(_8); StorageLive(_6); - _6 = ((*_1).1: u32); + _6 = copy ((*_1).1: u32); StorageLive(_7); - _7 = ((*_2).1: u32); + _7 = copy ((*_2).1: u32); _8 = Eq(move _6, move _7); StorageDead(_7); StorageDead(_6); @@ -48,9 +48,9 @@ fn bitand(_1: &Blueprint, _2: &Blueprint) -> bool { StorageDead(_5); StorageLive(_12); StorageLive(_10); - _10 = ((*_1).2: u32); + _10 = copy ((*_1).2: u32); StorageLive(_11); - _11 = ((*_2).2: u32); + _11 = copy ((*_2).2: u32); _12 = Eq(move _10, move _11); StorageDead(_11); StorageDead(_10); @@ -59,9 +59,9 @@ fn bitand(_1: &Blueprint, _2: &Blueprint) -> bool { StorageDead(_9); StorageLive(_16); StorageLive(_14); - _14 = ((*_1).3: u32); + _14 = copy ((*_1).3: u32); StorageLive(_15); - _15 = ((*_2).3: u32); + _15 = copy ((*_2).3: u32); _16 = Eq(move _14, move _15); StorageDead(_15); StorageDead(_14); @@ -70,9 +70,9 @@ fn bitand(_1: &Blueprint, _2: &Blueprint) -> bool { StorageDead(_13); StorageLive(_20); StorageLive(_18); - _18 = ((*_1).4: u32); + _18 = copy ((*_1).4: u32); StorageLive(_19); - _19 = ((*_2).4: u32); + _19 = copy ((*_2).4: u32); _20 = Eq(move _18, move _19); StorageDead(_19); StorageDead(_18); diff --git a/tests/mir-opt/pre-codegen/chained_comparison.naive.PreCodegen.after.mir b/tests/mir-opt/pre-codegen/chained_comparison.naive.PreCodegen.after.mir index 838e30fa35e..9b3e28ab5b8 100644 --- a/tests/mir-opt/pre-codegen/chained_comparison.naive.PreCodegen.after.mir +++ b/tests/mir-opt/pre-codegen/chained_comparison.naive.PreCodegen.after.mir @@ -22,9 +22,9 @@ fn naive(_1: &Blueprint, _2: &Blueprint) -> bool { bb0: { StorageLive(_5); StorageLive(_3); - _3 = ((*_1).0: u32); + _3 = copy ((*_1).0: u32); StorageLive(_4); - _4 = ((*_2).0: u32); + _4 = copy ((*_2).0: u32); _5 = Eq(move _3, move _4); switchInt(move _5) -> [0: bb1, otherwise: bb2]; } @@ -40,9 +40,9 @@ fn naive(_1: &Blueprint, _2: &Blueprint) -> bool { StorageDead(_3); StorageLive(_8); StorageLive(_6); - _6 = ((*_1).1: u32); + _6 = copy ((*_1).1: u32); StorageLive(_7); - _7 = ((*_2).1: u32); + _7 = copy ((*_2).1: u32); _8 = Eq(move _6, move _7); switchInt(move _8) -> [0: bb3, otherwise: bb4]; } @@ -58,9 +58,9 @@ fn naive(_1: &Blueprint, _2: &Blueprint) -> bool { StorageDead(_6); StorageLive(_11); StorageLive(_9); - _9 = ((*_1).2: u32); + _9 = copy ((*_1).2: u32); StorageLive(_10); - _10 = ((*_2).2: u32); + _10 = copy ((*_2).2: u32); _11 = Eq(move _9, move _10); switchInt(move _11) -> [0: bb5, otherwise: bb6]; } @@ -76,9 +76,9 @@ fn naive(_1: &Blueprint, _2: &Blueprint) -> bool { StorageDead(_9); StorageLive(_14); StorageLive(_12); - _12 = ((*_1).3: u32); + _12 = copy ((*_1).3: u32); StorageLive(_13); - _13 = ((*_2).3: u32); + _13 = copy ((*_2).3: u32); _14 = Eq(move _12, move _13); switchInt(move _14) -> [0: bb7, otherwise: bb9]; } @@ -98,9 +98,9 @@ fn naive(_1: &Blueprint, _2: &Blueprint) -> bool { StorageDead(_13); StorageDead(_12); StorageLive(_15); - _15 = ((*_1).4: u32); + _15 = copy ((*_1).4: u32); StorageLive(_16); - _16 = ((*_2).4: u32); + _16 = copy ((*_2).4: u32); _0 = Eq(move _15, move _16); StorageDead(_16); StorageDead(_15); diff --git a/tests/mir-opt/pre-codegen/chained_comparison.returning.PreCodegen.after.mir b/tests/mir-opt/pre-codegen/chained_comparison.returning.PreCodegen.after.mir index 8452fa12f31..72d52701d11 100644 --- a/tests/mir-opt/pre-codegen/chained_comparison.returning.PreCodegen.after.mir +++ b/tests/mir-opt/pre-codegen/chained_comparison.returning.PreCodegen.after.mir @@ -23,9 +23,9 @@ fn returning(_1: &Blueprint, _2: &Blueprint) -> bool { bb0: { StorageLive(_5); StorageLive(_3); - _3 = ((*_1).0: u32); + _3 = copy ((*_1).0: u32); StorageLive(_4); - _4 = ((*_2).0: u32); + _4 = copy ((*_2).0: u32); _5 = Ne(move _3, move _4); switchInt(move _5) -> [0: bb1, otherwise: bb10]; } @@ -36,9 +36,9 @@ fn returning(_1: &Blueprint, _2: &Blueprint) -> bool { StorageDead(_5); StorageLive(_8); StorageLive(_6); - _6 = ((*_1).1: u32); + _6 = copy ((*_1).1: u32); StorageLive(_7); - _7 = ((*_2).1: u32); + _7 = copy ((*_2).1: u32); _8 = Ne(move _6, move _7); switchInt(move _8) -> [0: bb2, otherwise: bb9]; } @@ -49,9 +49,9 @@ fn returning(_1: &Blueprint, _2: &Blueprint) -> bool { StorageDead(_8); StorageLive(_11); StorageLive(_9); - _9 = ((*_1).2: u32); + _9 = copy ((*_1).2: u32); StorageLive(_10); - _10 = ((*_2).2: u32); + _10 = copy ((*_2).2: u32); _11 = Ne(move _9, move _10); switchInt(move _11) -> [0: bb3, otherwise: bb8]; } @@ -62,9 +62,9 @@ fn returning(_1: &Blueprint, _2: &Blueprint) -> bool { StorageDead(_11); StorageLive(_14); StorageLive(_12); - _12 = ((*_1).3: u32); + _12 = copy ((*_1).3: u32); StorageLive(_13); - _13 = ((*_2).3: u32); + _13 = copy ((*_2).3: u32); _14 = Ne(move _12, move _13); switchInt(move _14) -> [0: bb4, otherwise: bb7]; } @@ -75,9 +75,9 @@ fn returning(_1: &Blueprint, _2: &Blueprint) -> bool { StorageDead(_14); StorageLive(_17); StorageLive(_15); - _15 = ((*_1).4: u32); + _15 = copy ((*_1).4: u32); StorageLive(_16); - _16 = ((*_2).4: u32); + _16 = copy ((*_2).4: u32); _17 = Ne(move _15, move _16); switchInt(move _17) -> [0: bb5, otherwise: bb6]; } diff --git a/tests/mir-opt/pre-codegen/checked_ops.checked_shl.PreCodegen.after.panic-abort.mir b/tests/mir-opt/pre-codegen/checked_ops.checked_shl.PreCodegen.after.panic-abort.mir index 4edf0d2c47c..a9dd8886577 100644 --- a/tests/mir-opt/pre-codegen/checked_ops.checked_shl.PreCodegen.after.panic-abort.mir +++ b/tests/mir-opt/pre-codegen/checked_ops.checked_shl.PreCodegen.after.panic-abort.mir @@ -17,7 +17,7 @@ fn checked_shl(_1: u32, _2: u32) -> Option<u32> { bb0: { StorageLive(_3); - _3 = Lt(_2, const core::num::<impl u32>::BITS); + _3 = Lt(copy _2, const core::num::<impl u32>::BITS); switchInt(move _3) -> [0: bb1, otherwise: bb2]; } @@ -28,7 +28,7 @@ fn checked_shl(_1: u32, _2: u32) -> Option<u32> { bb2: { StorageLive(_4); - _4 = ShlUnchecked(_1, _2); + _4 = ShlUnchecked(copy _1, copy _2); _0 = Option::<u32>::Some(move _4); StorageDead(_4); goto -> bb3; diff --git a/tests/mir-opt/pre-codegen/checked_ops.checked_shl.PreCodegen.after.panic-unwind.mir b/tests/mir-opt/pre-codegen/checked_ops.checked_shl.PreCodegen.after.panic-unwind.mir index 4edf0d2c47c..a9dd8886577 100644 --- a/tests/mir-opt/pre-codegen/checked_ops.checked_shl.PreCodegen.after.panic-unwind.mir +++ b/tests/mir-opt/pre-codegen/checked_ops.checked_shl.PreCodegen.after.panic-unwind.mir @@ -17,7 +17,7 @@ fn checked_shl(_1: u32, _2: u32) -> Option<u32> { bb0: { StorageLive(_3); - _3 = Lt(_2, const core::num::<impl u32>::BITS); + _3 = Lt(copy _2, const core::num::<impl u32>::BITS); switchInt(move _3) -> [0: bb1, otherwise: bb2]; } @@ -28,7 +28,7 @@ fn checked_shl(_1: u32, _2: u32) -> Option<u32> { bb2: { StorageLive(_4); - _4 = ShlUnchecked(_1, _2); + _4 = ShlUnchecked(copy _1, copy _2); _0 = Option::<u32>::Some(move _4); StorageDead(_4); goto -> bb3; diff --git a/tests/mir-opt/pre-codegen/checked_ops.step_forward.PreCodegen.after.panic-abort.mir b/tests/mir-opt/pre-codegen/checked_ops.step_forward.PreCodegen.after.panic-abort.mir index 69c11ebcacc..935e67fc3c0 100644 --- a/tests/mir-opt/pre-codegen/checked_ops.step_forward.PreCodegen.after.panic-abort.mir +++ b/tests/mir-opt/pre-codegen/checked_ops.step_forward.PreCodegen.after.panic-abort.mir @@ -32,18 +32,18 @@ fn step_forward(_1: u16, _2: usize) -> u16 { bb0: { StorageLive(_4); StorageLive(_3); - _3 = Gt(_2, const 65535_usize); + _3 = Gt(copy _2, const 65535_usize); switchInt(move _3) -> [0: bb1, otherwise: bb5]; } bb1: { - _4 = _2 as u16 (IntToInt); + _4 = copy _2 as u16 (IntToInt); StorageDead(_3); StorageLive(_7); StorageLive(_6); StorageLive(_5); - _5 = AddWithOverflow(_1, _4); - _6 = (_5.1: bool); + _5 = AddWithOverflow(copy _1, copy _4); + _6 = copy (_5.1: bool); _7 = unlikely(move _6) -> [return: bb2, unwind unreachable]; } @@ -76,8 +76,8 @@ fn step_forward(_1: u16, _2: usize) -> u16 { bb7: { StorageLive(_8); - _8 = _2 as u16 (IntToInt); - _0 = Add(_1, _8); + _8 = copy _2 as u16 (IntToInt); + _0 = Add(copy _1, copy _8); StorageDead(_8); StorageDead(_4); return; diff --git a/tests/mir-opt/pre-codegen/checked_ops.step_forward.PreCodegen.after.panic-unwind.mir b/tests/mir-opt/pre-codegen/checked_ops.step_forward.PreCodegen.after.panic-unwind.mir index e6ea6c51001..bf1ffd1ef32 100644 --- a/tests/mir-opt/pre-codegen/checked_ops.step_forward.PreCodegen.after.panic-unwind.mir +++ b/tests/mir-opt/pre-codegen/checked_ops.step_forward.PreCodegen.after.panic-unwind.mir @@ -32,18 +32,18 @@ fn step_forward(_1: u16, _2: usize) -> u16 { bb0: { StorageLive(_4); StorageLive(_3); - _3 = Gt(_2, const 65535_usize); + _3 = Gt(copy _2, const 65535_usize); switchInt(move _3) -> [0: bb1, otherwise: bb5]; } bb1: { - _4 = _2 as u16 (IntToInt); + _4 = copy _2 as u16 (IntToInt); StorageDead(_3); StorageLive(_7); StorageLive(_6); StorageLive(_5); - _5 = AddWithOverflow(_1, _4); - _6 = (_5.1: bool); + _5 = AddWithOverflow(copy _1, copy _4); + _6 = copy (_5.1: bool); _7 = unlikely(move _6) -> [return: bb2, unwind unreachable]; } @@ -76,8 +76,8 @@ fn step_forward(_1: u16, _2: usize) -> u16 { bb7: { StorageLive(_8); - _8 = _2 as u16 (IntToInt); - _0 = Add(_1, _8); + _8 = copy _2 as u16 (IntToInt); + _0 = Add(copy _1, copy _8); StorageDead(_8); StorageDead(_4); return; diff --git a/tests/mir-opt/pre-codegen/derived_ord.{impl#0}-partial_cmp.PreCodegen.after.mir b/tests/mir-opt/pre-codegen/derived_ord.{impl#0}-partial_cmp.PreCodegen.after.mir index 47f10451b05..5f4ec1de270 100644 --- a/tests/mir-opt/pre-codegen/derived_ord.{impl#0}-partial_cmp.PreCodegen.after.mir +++ b/tests/mir-opt/pre-codegen/derived_ord.{impl#0}-partial_cmp.PreCodegen.after.mir @@ -22,13 +22,13 @@ fn <impl at $DIR/derived_ord.rs:6:10: 6:20>::partial_cmp(_1: &MultiField, _2: &M bb0: { StorageLive(_3); - _3 = ((*_1).0: char); + _3 = copy ((*_1).0: char); StorageLive(_4); - _4 = ((*_2).0: char); + _4 = copy ((*_2).0: char); _5 = Cmp(move _3, move _4); StorageDead(_4); StorageDead(_3); - _6 = Option::<std::cmp::Ordering>::Some(_5); + _6 = Option::<std::cmp::Ordering>::Some(copy _5); _7 = discriminant(_5); switchInt(move _7) -> [0: bb1, otherwise: bb2]; } @@ -36,9 +36,9 @@ fn <impl at $DIR/derived_ord.rs:6:10: 6:20>::partial_cmp(_1: &MultiField, _2: &M bb1: { StorageLive(_10); StorageLive(_8); - _8 = ((*_1).1: i16); + _8 = copy ((*_1).1: i16); StorageLive(_9); - _9 = ((*_2).1: i16); + _9 = copy ((*_2).1: i16); _10 = Cmp(move _8, move _9); StorageDead(_9); StorageDead(_8); @@ -48,7 +48,7 @@ fn <impl at $DIR/derived_ord.rs:6:10: 6:20>::partial_cmp(_1: &MultiField, _2: &M } bb2: { - _0 = _6; + _0 = copy _6; goto -> bb3; } diff --git a/tests/mir-opt/pre-codegen/issue_117368_print_invalid_constant.main.GVN.32bit.panic-abort.diff b/tests/mir-opt/pre-codegen/issue_117368_print_invalid_constant.main.GVN.32bit.panic-abort.diff index 30c122ddea0..6cac8b109ee 100644 --- a/tests/mir-opt/pre-codegen/issue_117368_print_invalid_constant.main.GVN.32bit.panic-abort.diff +++ b/tests/mir-opt/pre-codegen/issue_117368_print_invalid_constant.main.GVN.32bit.panic-abort.diff @@ -73,12 +73,12 @@ StorageLive(_6); StorageLive(_7); _9 = const main::promoted[0]; - _7 = _9; + _7 = copy _9; StorageLive(_8); -- _8 = _1; +- _8 = copy _1; - _6 = std::alloc::Global::alloc_impl(move _7, move _8, const false) -> [return: bb4, unwind unreachable]; + _8 = const Layout {{ size: Indirect { alloc_id: ALLOC0, offset: Size(4 bytes) }: usize, align: std::ptr::Alignment(Scalar(0x00000000): std::ptr::alignment::AlignmentEnum) }}; -+ _6 = std::alloc::Global::alloc_impl(_9, const Layout {{ size: Indirect { alloc_id: ALLOC0, offset: Size(4 bytes) }: usize, align: std::ptr::Alignment(Scalar(0x00000000): std::ptr::alignment::AlignmentEnum) }}, const false) -> [return: bb4, unwind unreachable]; ++ _6 = std::alloc::Global::alloc_impl(copy _9, const Layout {{ size: Indirect { alloc_id: ALLOC0, offset: Size(4 bytes) }: usize, align: std::ptr::Alignment(Scalar(0x00000000): std::ptr::alignment::AlignmentEnum) }}, const false) -> [return: bb4, unwind unreachable]; } bb4: { @@ -93,7 +93,7 @@ bb5: { StorageLive(_15); _16 = &_13; - _15 = _16 as &dyn std::fmt::Debug (PointerCoercion(Unsize)); + _15 = copy _16 as &dyn std::fmt::Debug (PointerCoercion(Unsize)); _14 = result::unwrap_failed(const "called `Result::unwrap()` on an `Err` value", move _15) -> unwind unreachable; } @@ -104,14 +104,14 @@ StorageDead(_6); - StorageLive(_17); + nop; - _17 = (_5.0: *const [u8]); + _17 = copy (_5.0: *const [u8]); - _4 = move _17 as *mut [u8] (PtrToPtr); - StorageDead(_17); -+ _4 = _17 as *mut [u8] (PtrToPtr); ++ _4 = copy _17 as *mut [u8] (PtrToPtr); + nop; StorageDead(_5); - _3 = move _4 as *mut u8 (PtrToPtr); -+ _3 = _17 as *mut u8 (PtrToPtr); ++ _3 = copy _17 as *mut u8 (PtrToPtr); StorageDead(_4); StorageDead(_3); - StorageDead(_1); diff --git a/tests/mir-opt/pre-codegen/issue_117368_print_invalid_constant.main.GVN.32bit.panic-unwind.diff b/tests/mir-opt/pre-codegen/issue_117368_print_invalid_constant.main.GVN.32bit.panic-unwind.diff index 93449462c3d..5fcece2280d 100644 --- a/tests/mir-opt/pre-codegen/issue_117368_print_invalid_constant.main.GVN.32bit.panic-unwind.diff +++ b/tests/mir-opt/pre-codegen/issue_117368_print_invalid_constant.main.GVN.32bit.panic-unwind.diff @@ -47,14 +47,14 @@ StorageDead(_6); - StorageLive(_12); + nop; - _12 = (_5.0: *const [u8]); + _12 = copy (_5.0: *const [u8]); - _4 = move _12 as *mut [u8] (PtrToPtr); - StorageDead(_12); -+ _4 = _12 as *mut [u8] (PtrToPtr); ++ _4 = copy _12 as *mut [u8] (PtrToPtr); + nop; StorageDead(_5); - _3 = move _4 as *mut u8 (PtrToPtr); -+ _3 = _12 as *mut u8 (PtrToPtr); ++ _3 = copy _12 as *mut u8 (PtrToPtr); StorageDead(_4); StorageDead(_3); - StorageDead(_1); @@ -81,12 +81,12 @@ StorageLive(_6); StorageLive(_7); _9 = const main::promoted[0]; - _7 = _9; + _7 = copy _9; StorageLive(_8); -- _8 = _1; +- _8 = copy _1; - _6 = std::alloc::Global::alloc_impl(move _7, move _8, const false) -> [return: bb5, unwind continue]; + _8 = const Layout {{ size: Indirect { alloc_id: ALLOC0, offset: Size(4 bytes) }: usize, align: std::ptr::Alignment(Scalar(0x00000000): std::ptr::alignment::AlignmentEnum) }}; -+ _6 = std::alloc::Global::alloc_impl(_9, const Layout {{ size: Indirect { alloc_id: ALLOC0, offset: Size(4 bytes) }: usize, align: std::ptr::Alignment(Scalar(0x00000000): std::ptr::alignment::AlignmentEnum) }}, const false) -> [return: bb5, unwind continue]; ++ _6 = std::alloc::Global::alloc_impl(copy _9, const Layout {{ size: Indirect { alloc_id: ALLOC0, offset: Size(4 bytes) }: usize, align: std::ptr::Alignment(Scalar(0x00000000): std::ptr::alignment::AlignmentEnum) }}, const false) -> [return: bb5, unwind continue]; } bb5: { diff --git a/tests/mir-opt/pre-codegen/issue_117368_print_invalid_constant.main.GVN.64bit.panic-abort.diff b/tests/mir-opt/pre-codegen/issue_117368_print_invalid_constant.main.GVN.64bit.panic-abort.diff index 44435956ec4..10fde25e317 100644 --- a/tests/mir-opt/pre-codegen/issue_117368_print_invalid_constant.main.GVN.64bit.panic-abort.diff +++ b/tests/mir-opt/pre-codegen/issue_117368_print_invalid_constant.main.GVN.64bit.panic-abort.diff @@ -73,12 +73,12 @@ StorageLive(_6); StorageLive(_7); _9 = const main::promoted[0]; - _7 = _9; + _7 = copy _9; StorageLive(_8); -- _8 = _1; +- _8 = copy _1; - _6 = std::alloc::Global::alloc_impl(move _7, move _8, const false) -> [return: bb4, unwind unreachable]; + _8 = const Layout {{ size: Indirect { alloc_id: ALLOC0, offset: Size(8 bytes) }: usize, align: std::ptr::Alignment(Scalar(0x0000000000000000): std::ptr::alignment::AlignmentEnum) }}; -+ _6 = std::alloc::Global::alloc_impl(_9, const Layout {{ size: Indirect { alloc_id: ALLOC0, offset: Size(8 bytes) }: usize, align: std::ptr::Alignment(Scalar(0x0000000000000000): std::ptr::alignment::AlignmentEnum) }}, const false) -> [return: bb4, unwind unreachable]; ++ _6 = std::alloc::Global::alloc_impl(copy _9, const Layout {{ size: Indirect { alloc_id: ALLOC0, offset: Size(8 bytes) }: usize, align: std::ptr::Alignment(Scalar(0x0000000000000000): std::ptr::alignment::AlignmentEnum) }}, const false) -> [return: bb4, unwind unreachable]; } bb4: { @@ -93,7 +93,7 @@ bb5: { StorageLive(_15); _16 = &_13; - _15 = _16 as &dyn std::fmt::Debug (PointerCoercion(Unsize)); + _15 = copy _16 as &dyn std::fmt::Debug (PointerCoercion(Unsize)); _14 = result::unwrap_failed(const "called `Result::unwrap()` on an `Err` value", move _15) -> unwind unreachable; } @@ -104,14 +104,14 @@ StorageDead(_6); - StorageLive(_17); + nop; - _17 = (_5.0: *const [u8]); + _17 = copy (_5.0: *const [u8]); - _4 = move _17 as *mut [u8] (PtrToPtr); - StorageDead(_17); -+ _4 = _17 as *mut [u8] (PtrToPtr); ++ _4 = copy _17 as *mut [u8] (PtrToPtr); + nop; StorageDead(_5); - _3 = move _4 as *mut u8 (PtrToPtr); -+ _3 = _17 as *mut u8 (PtrToPtr); ++ _3 = copy _17 as *mut u8 (PtrToPtr); StorageDead(_4); StorageDead(_3); - StorageDead(_1); diff --git a/tests/mir-opt/pre-codegen/issue_117368_print_invalid_constant.main.GVN.64bit.panic-unwind.diff b/tests/mir-opt/pre-codegen/issue_117368_print_invalid_constant.main.GVN.64bit.panic-unwind.diff index c958480a9c7..0821ea272bf 100644 --- a/tests/mir-opt/pre-codegen/issue_117368_print_invalid_constant.main.GVN.64bit.panic-unwind.diff +++ b/tests/mir-opt/pre-codegen/issue_117368_print_invalid_constant.main.GVN.64bit.panic-unwind.diff @@ -47,14 +47,14 @@ StorageDead(_6); - StorageLive(_12); + nop; - _12 = (_5.0: *const [u8]); + _12 = copy (_5.0: *const [u8]); - _4 = move _12 as *mut [u8] (PtrToPtr); - StorageDead(_12); -+ _4 = _12 as *mut [u8] (PtrToPtr); ++ _4 = copy _12 as *mut [u8] (PtrToPtr); + nop; StorageDead(_5); - _3 = move _4 as *mut u8 (PtrToPtr); -+ _3 = _12 as *mut u8 (PtrToPtr); ++ _3 = copy _12 as *mut u8 (PtrToPtr); StorageDead(_4); StorageDead(_3); - StorageDead(_1); @@ -81,12 +81,12 @@ StorageLive(_6); StorageLive(_7); _9 = const main::promoted[0]; - _7 = _9; + _7 = copy _9; StorageLive(_8); -- _8 = _1; +- _8 = copy _1; - _6 = std::alloc::Global::alloc_impl(move _7, move _8, const false) -> [return: bb5, unwind continue]; + _8 = const Layout {{ size: Indirect { alloc_id: ALLOC0, offset: Size(8 bytes) }: usize, align: std::ptr::Alignment(Scalar(0x0000000000000000): std::ptr::alignment::AlignmentEnum) }}; -+ _6 = std::alloc::Global::alloc_impl(_9, const Layout {{ size: Indirect { alloc_id: ALLOC0, offset: Size(8 bytes) }: usize, align: std::ptr::Alignment(Scalar(0x0000000000000000): std::ptr::alignment::AlignmentEnum) }}, const false) -> [return: bb5, unwind continue]; ++ _6 = std::alloc::Global::alloc_impl(copy _9, const Layout {{ size: Indirect { alloc_id: ALLOC0, offset: Size(8 bytes) }: usize, align: std::ptr::Alignment(Scalar(0x0000000000000000): std::ptr::alignment::AlignmentEnum) }}, const false) -> [return: bb5, unwind continue]; } bb5: { diff --git a/tests/mir-opt/pre-codegen/loops.filter_mapped.PreCodegen.after.mir b/tests/mir-opt/pre-codegen/loops.filter_mapped.PreCodegen.after.mir index 8d182069adc..75e8cb1d861 100644 --- a/tests/mir-opt/pre-codegen/loops.filter_mapped.PreCodegen.after.mir +++ b/tests/mir-opt/pre-codegen/loops.filter_mapped.PreCodegen.after.mir @@ -32,7 +32,7 @@ fn filter_mapped(_1: impl Iterator<Item = T>, _2: impl Fn(T) -> Option<U>) -> () bb1: { StorageLive(_4); - _4 = _3; + _4 = copy _3; goto -> bb2; } diff --git a/tests/mir-opt/pre-codegen/loops.int_range.PreCodegen.after.mir b/tests/mir-opt/pre-codegen/loops.int_range.PreCodegen.after.mir index cdb7eea74fb..be69bbf10e7 100644 --- a/tests/mir-opt/pre-codegen/loops.int_range.PreCodegen.after.mir +++ b/tests/mir-opt/pre-codegen/loops.int_range.PreCodegen.after.mir @@ -41,9 +41,9 @@ fn int_range(_1: usize, _2: usize) -> () { } bb0: { - _3 = std::ops::Range::<usize> { start: _1, end: _2 }; + _3 = std::ops::Range::<usize> { start: copy _1, end: copy _2 }; StorageLive(_4); - _4 = _3; + _4 = copy _3; goto -> bb1; } @@ -57,9 +57,9 @@ fn int_range(_1: usize, _2: usize) -> () { StorageLive(_7); _7 = &(_4.1: usize); StorageLive(_8); - _8 = (_4.0: usize); + _8 = copy (_4.0: usize); StorageLive(_9); - _9 = (_4.1: usize); + _9 = copy (_4.1: usize); _10 = Lt(move _8, move _9); StorageDead(_9); StorageDead(_8); @@ -79,18 +79,18 @@ fn int_range(_1: usize, _2: usize) -> () { bb3: { StorageDead(_7); StorageDead(_6); - _11 = (_4.0: usize); + _11 = copy (_4.0: usize); StorageLive(_12); - _12 = <usize as Step>::forward_unchecked(_11, const 1_usize) -> [return: bb4, unwind continue]; + _12 = <usize as Step>::forward_unchecked(copy _11, const 1_usize) -> [return: bb4, unwind continue]; } bb4: { (_4.0: usize) = move _12; StorageDead(_12); - _13 = Option::<usize>::Some(_11); + _13 = Option::<usize>::Some(copy _11); StorageDead(_10); StorageDead(_11); - _14 = ((_13 as Some).0: usize); + _14 = copy ((_13 as Some).0: usize); _15 = opaque::<usize>(move _14) -> [return: bb5, unwind continue]; } diff --git a/tests/mir-opt/pre-codegen/loops.mapped.PreCodegen.after.mir b/tests/mir-opt/pre-codegen/loops.mapped.PreCodegen.after.mir index 51d41e9ff05..4977f39ccef 100644 --- a/tests/mir-opt/pre-codegen/loops.mapped.PreCodegen.after.mir +++ b/tests/mir-opt/pre-codegen/loops.mapped.PreCodegen.after.mir @@ -43,7 +43,7 @@ fn mapped(_1: impl Iterator<Item = T>, _2: impl Fn(T) -> U) -> () { bb1: { StorageLive(_4); - _4 = _3; + _4 = copy _3; goto -> bb2; } @@ -84,7 +84,7 @@ fn mapped(_1: impl Iterator<Item = T>, _2: impl Fn(T) -> U) -> () { _10 = move ((_7 as Some).0: T); StorageLive(_12); StorageLive(_11); - _11 = (_10,); + _11 = (copy _10,); _12 = <&mut impl Fn(T) -> U as FnOnce<(T,)>>::call_once(move _8, move _11) -> [return: bb7, unwind: bb10]; } diff --git a/tests/mir-opt/pre-codegen/mem_replace.manual_replace.PreCodegen.after.panic-abort.mir b/tests/mir-opt/pre-codegen/mem_replace.manual_replace.PreCodegen.after.panic-abort.mir index 3ca24e152a4..c10f3c42962 100644 --- a/tests/mir-opt/pre-codegen/mem_replace.manual_replace.PreCodegen.after.panic-abort.mir +++ b/tests/mir-opt/pre-codegen/mem_replace.manual_replace.PreCodegen.after.panic-abort.mir @@ -9,8 +9,8 @@ fn manual_replace(_1: &mut u32, _2: u32) -> u32 { } bb0: { - _0 = (*_1); - (*_1) = _2; + _0 = copy (*_1); + (*_1) = copy _2; return; } } diff --git a/tests/mir-opt/pre-codegen/mem_replace.manual_replace.PreCodegen.after.panic-unwind.mir b/tests/mir-opt/pre-codegen/mem_replace.manual_replace.PreCodegen.after.panic-unwind.mir index 3ca24e152a4..c10f3c42962 100644 --- a/tests/mir-opt/pre-codegen/mem_replace.manual_replace.PreCodegen.after.panic-unwind.mir +++ b/tests/mir-opt/pre-codegen/mem_replace.manual_replace.PreCodegen.after.panic-unwind.mir @@ -9,8 +9,8 @@ fn manual_replace(_1: &mut u32, _2: u32) -> u32 { } bb0: { - _0 = (*_1); - (*_1) = _2; + _0 = copy (*_1); + (*_1) = copy _2; return; } } diff --git a/tests/mir-opt/pre-codegen/mem_replace.mem_replace.PreCodegen.after.panic-abort.mir b/tests/mir-opt/pre-codegen/mem_replace.mem_replace.PreCodegen.after.panic-abort.mir index a3dc54f73c8..ed494f6e74c 100644 --- a/tests/mir-opt/pre-codegen/mem_replace.mem_replace.PreCodegen.after.panic-abort.mir +++ b/tests/mir-opt/pre-codegen/mem_replace.mem_replace.PreCodegen.after.panic-abort.mir @@ -14,8 +14,8 @@ fn mem_replace(_1: &mut u32, _2: u32) -> u32 { } bb0: { - _0 = (*_1); - (*_1) = _2; + _0 = copy (*_1); + (*_1) = copy _2; return; } } diff --git a/tests/mir-opt/pre-codegen/mem_replace.mem_replace.PreCodegen.after.panic-unwind.mir b/tests/mir-opt/pre-codegen/mem_replace.mem_replace.PreCodegen.after.panic-unwind.mir index a3dc54f73c8..ed494f6e74c 100644 --- a/tests/mir-opt/pre-codegen/mem_replace.mem_replace.PreCodegen.after.panic-unwind.mir +++ b/tests/mir-opt/pre-codegen/mem_replace.mem_replace.PreCodegen.after.panic-unwind.mir @@ -14,8 +14,8 @@ fn mem_replace(_1: &mut u32, _2: u32) -> u32 { } bb0: { - _0 = (*_1); - (*_1) = _2; + _0 = copy (*_1); + (*_1) = copy _2; return; } } diff --git a/tests/mir-opt/pre-codegen/no_inlined_clone.{impl#0}-clone.PreCodegen.after.mir b/tests/mir-opt/pre-codegen/no_inlined_clone.{impl#0}-clone.PreCodegen.after.mir index 71898daa1bf..62a9cd9131f 100644 --- a/tests/mir-opt/pre-codegen/no_inlined_clone.{impl#0}-clone.PreCodegen.after.mir +++ b/tests/mir-opt/pre-codegen/no_inlined_clone.{impl#0}-clone.PreCodegen.after.mir @@ -7,7 +7,7 @@ fn <impl at $DIR/no_inlined_clone.rs:9:10: 9:15>::clone(_1: &Foo) -> Foo { bb0: { StorageLive(_2); - _2 = ((*_1).0: i32); + _2 = copy ((*_1).0: i32); _0 = Foo { a: move _2 }; StorageDead(_2); return; diff --git a/tests/mir-opt/pre-codegen/optimizes_into_variable.main.GVN.32bit.panic-abort.diff b/tests/mir-opt/pre-codegen/optimizes_into_variable.main.GVN.32bit.panic-abort.diff index 45b8d89c0f4..6575610727b 100644 --- a/tests/mir-opt/pre-codegen/optimizes_into_variable.main.GVN.32bit.panic-abort.diff +++ b/tests/mir-opt/pre-codegen/optimizes_into_variable.main.GVN.32bit.panic-abort.diff @@ -39,21 +39,21 @@ StorageLive(_5); _5 = const 3_usize; _6 = const 6_usize; -- _7 = Lt(_5, _6); -- assert(move _7, "index out of bounds: the length is {} but the index is {}", move _6, _5) -> [success: bb2, unwind unreachable]; +- _7 = Lt(copy _5, copy _6); +- assert(move _7, "index out of bounds: the length is {} but the index is {}", move _6, copy _5) -> [success: bb2, unwind unreachable]; + _7 = const true; + assert(const true, "index out of bounds: the length is {} but the index is {}", const 6_usize, const 3_usize) -> [success: bb2, unwind unreachable]; } bb2: { -- _3 = _4[_5]; +- _3 = copy _4[_5]; + _3 = const 3_i32; StorageDead(_5); StorageDead(_4); StorageLive(_8); StorageLive(_9); _9 = const 42_u32; -- _8 = _9; +- _8 = copy _9; + _8 = const 42_u32; StorageDead(_9); StorageDead(_8); diff --git a/tests/mir-opt/pre-codegen/optimizes_into_variable.main.GVN.32bit.panic-unwind.diff b/tests/mir-opt/pre-codegen/optimizes_into_variable.main.GVN.32bit.panic-unwind.diff index e6ee1e6f9a3..1a4ed5767fe 100644 --- a/tests/mir-opt/pre-codegen/optimizes_into_variable.main.GVN.32bit.panic-unwind.diff +++ b/tests/mir-opt/pre-codegen/optimizes_into_variable.main.GVN.32bit.panic-unwind.diff @@ -39,21 +39,21 @@ StorageLive(_5); _5 = const 3_usize; _6 = const 6_usize; -- _7 = Lt(_5, _6); -- assert(move _7, "index out of bounds: the length is {} but the index is {}", move _6, _5) -> [success: bb2, unwind continue]; +- _7 = Lt(copy _5, copy _6); +- assert(move _7, "index out of bounds: the length is {} but the index is {}", move _6, copy _5) -> [success: bb2, unwind continue]; + _7 = const true; + assert(const true, "index out of bounds: the length is {} but the index is {}", const 6_usize, const 3_usize) -> [success: bb2, unwind continue]; } bb2: { -- _3 = _4[_5]; +- _3 = copy _4[_5]; + _3 = const 3_i32; StorageDead(_5); StorageDead(_4); StorageLive(_8); StorageLive(_9); _9 = const 42_u32; -- _8 = _9; +- _8 = copy _9; + _8 = const 42_u32; StorageDead(_9); StorageDead(_8); diff --git a/tests/mir-opt/pre-codegen/optimizes_into_variable.main.GVN.64bit.panic-abort.diff b/tests/mir-opt/pre-codegen/optimizes_into_variable.main.GVN.64bit.panic-abort.diff index 45b8d89c0f4..6575610727b 100644 --- a/tests/mir-opt/pre-codegen/optimizes_into_variable.main.GVN.64bit.panic-abort.diff +++ b/tests/mir-opt/pre-codegen/optimizes_into_variable.main.GVN.64bit.panic-abort.diff @@ -39,21 +39,21 @@ StorageLive(_5); _5 = const 3_usize; _6 = const 6_usize; -- _7 = Lt(_5, _6); -- assert(move _7, "index out of bounds: the length is {} but the index is {}", move _6, _5) -> [success: bb2, unwind unreachable]; +- _7 = Lt(copy _5, copy _6); +- assert(move _7, "index out of bounds: the length is {} but the index is {}", move _6, copy _5) -> [success: bb2, unwind unreachable]; + _7 = const true; + assert(const true, "index out of bounds: the length is {} but the index is {}", const 6_usize, const 3_usize) -> [success: bb2, unwind unreachable]; } bb2: { -- _3 = _4[_5]; +- _3 = copy _4[_5]; + _3 = const 3_i32; StorageDead(_5); StorageDead(_4); StorageLive(_8); StorageLive(_9); _9 = const 42_u32; -- _8 = _9; +- _8 = copy _9; + _8 = const 42_u32; StorageDead(_9); StorageDead(_8); diff --git a/tests/mir-opt/pre-codegen/optimizes_into_variable.main.GVN.64bit.panic-unwind.diff b/tests/mir-opt/pre-codegen/optimizes_into_variable.main.GVN.64bit.panic-unwind.diff index e6ee1e6f9a3..1a4ed5767fe 100644 --- a/tests/mir-opt/pre-codegen/optimizes_into_variable.main.GVN.64bit.panic-unwind.diff +++ b/tests/mir-opt/pre-codegen/optimizes_into_variable.main.GVN.64bit.panic-unwind.diff @@ -39,21 +39,21 @@ StorageLive(_5); _5 = const 3_usize; _6 = const 6_usize; -- _7 = Lt(_5, _6); -- assert(move _7, "index out of bounds: the length is {} but the index is {}", move _6, _5) -> [success: bb2, unwind continue]; +- _7 = Lt(copy _5, copy _6); +- assert(move _7, "index out of bounds: the length is {} but the index is {}", move _6, copy _5) -> [success: bb2, unwind continue]; + _7 = const true; + assert(const true, "index out of bounds: the length is {} but the index is {}", const 6_usize, const 3_usize) -> [success: bb2, unwind continue]; } bb2: { -- _3 = _4[_5]; +- _3 = copy _4[_5]; + _3 = const 3_i32; StorageDead(_5); StorageDead(_4); StorageLive(_8); StorageLive(_9); _9 = const 42_u32; -- _8 = _9; +- _8 = copy _9; + _8 = const 42_u32; StorageDead(_9); StorageDead(_8); diff --git a/tests/mir-opt/pre-codegen/optimizes_into_variable.main.ScalarReplacementOfAggregates.32bit.panic-abort.diff b/tests/mir-opt/pre-codegen/optimizes_into_variable.main.ScalarReplacementOfAggregates.32bit.panic-abort.diff index c01a12eaa4f..e2420a341e0 100644 --- a/tests/mir-opt/pre-codegen/optimizes_into_variable.main.ScalarReplacementOfAggregates.32bit.panic-abort.diff +++ b/tests/mir-opt/pre-codegen/optimizes_into_variable.main.ScalarReplacementOfAggregates.32bit.panic-abort.diff @@ -38,18 +38,18 @@ StorageLive(_5); _5 = const 3_usize; _6 = const 6_usize; - _7 = Lt(_5, _6); - assert(move _7, "index out of bounds: the length is {} but the index is {}", move _6, _5) -> [success: bb2, unwind unreachable]; + _7 = Lt(copy _5, copy _6); + assert(move _7, "index out of bounds: the length is {} but the index is {}", move _6, copy _5) -> [success: bb2, unwind unreachable]; } bb2: { - _3 = _4[_5]; + _3 = copy _4[_5]; StorageDead(_5); StorageDead(_4); StorageLive(_8); - StorageLive(_9); - _9 = Point { x: const 12_u32, y: const 42_u32 }; -- _8 = (_9.1: u32); +- _8 = copy (_9.1: u32); - StorageDead(_9); + StorageLive(_10); + StorageLive(_11); @@ -57,7 +57,7 @@ + _10 = const 12_u32; + _11 = const 42_u32; + nop; -+ _8 = _11; ++ _8 = copy _11; + StorageDead(_10); + StorageDead(_11); + nop; diff --git a/tests/mir-opt/pre-codegen/optimizes_into_variable.main.ScalarReplacementOfAggregates.32bit.panic-unwind.diff b/tests/mir-opt/pre-codegen/optimizes_into_variable.main.ScalarReplacementOfAggregates.32bit.panic-unwind.diff index 64028e4437b..a2fb3b979e6 100644 --- a/tests/mir-opt/pre-codegen/optimizes_into_variable.main.ScalarReplacementOfAggregates.32bit.panic-unwind.diff +++ b/tests/mir-opt/pre-codegen/optimizes_into_variable.main.ScalarReplacementOfAggregates.32bit.panic-unwind.diff @@ -38,18 +38,18 @@ StorageLive(_5); _5 = const 3_usize; _6 = const 6_usize; - _7 = Lt(_5, _6); - assert(move _7, "index out of bounds: the length is {} but the index is {}", move _6, _5) -> [success: bb2, unwind continue]; + _7 = Lt(copy _5, copy _6); + assert(move _7, "index out of bounds: the length is {} but the index is {}", move _6, copy _5) -> [success: bb2, unwind continue]; } bb2: { - _3 = _4[_5]; + _3 = copy _4[_5]; StorageDead(_5); StorageDead(_4); StorageLive(_8); - StorageLive(_9); - _9 = Point { x: const 12_u32, y: const 42_u32 }; -- _8 = (_9.1: u32); +- _8 = copy (_9.1: u32); - StorageDead(_9); + StorageLive(_10); + StorageLive(_11); @@ -57,7 +57,7 @@ + _10 = const 12_u32; + _11 = const 42_u32; + nop; -+ _8 = _11; ++ _8 = copy _11; + StorageDead(_10); + StorageDead(_11); + nop; diff --git a/tests/mir-opt/pre-codegen/optimizes_into_variable.main.ScalarReplacementOfAggregates.64bit.panic-abort.diff b/tests/mir-opt/pre-codegen/optimizes_into_variable.main.ScalarReplacementOfAggregates.64bit.panic-abort.diff index c01a12eaa4f..e2420a341e0 100644 --- a/tests/mir-opt/pre-codegen/optimizes_into_variable.main.ScalarReplacementOfAggregates.64bit.panic-abort.diff +++ b/tests/mir-opt/pre-codegen/optimizes_into_variable.main.ScalarReplacementOfAggregates.64bit.panic-abort.diff @@ -38,18 +38,18 @@ StorageLive(_5); _5 = const 3_usize; _6 = const 6_usize; - _7 = Lt(_5, _6); - assert(move _7, "index out of bounds: the length is {} but the index is {}", move _6, _5) -> [success: bb2, unwind unreachable]; + _7 = Lt(copy _5, copy _6); + assert(move _7, "index out of bounds: the length is {} but the index is {}", move _6, copy _5) -> [success: bb2, unwind unreachable]; } bb2: { - _3 = _4[_5]; + _3 = copy _4[_5]; StorageDead(_5); StorageDead(_4); StorageLive(_8); - StorageLive(_9); - _9 = Point { x: const 12_u32, y: const 42_u32 }; -- _8 = (_9.1: u32); +- _8 = copy (_9.1: u32); - StorageDead(_9); + StorageLive(_10); + StorageLive(_11); @@ -57,7 +57,7 @@ + _10 = const 12_u32; + _11 = const 42_u32; + nop; -+ _8 = _11; ++ _8 = copy _11; + StorageDead(_10); + StorageDead(_11); + nop; diff --git a/tests/mir-opt/pre-codegen/optimizes_into_variable.main.ScalarReplacementOfAggregates.64bit.panic-unwind.diff b/tests/mir-opt/pre-codegen/optimizes_into_variable.main.ScalarReplacementOfAggregates.64bit.panic-unwind.diff index 64028e4437b..a2fb3b979e6 100644 --- a/tests/mir-opt/pre-codegen/optimizes_into_variable.main.ScalarReplacementOfAggregates.64bit.panic-unwind.diff +++ b/tests/mir-opt/pre-codegen/optimizes_into_variable.main.ScalarReplacementOfAggregates.64bit.panic-unwind.diff @@ -38,18 +38,18 @@ StorageLive(_5); _5 = const 3_usize; _6 = const 6_usize; - _7 = Lt(_5, _6); - assert(move _7, "index out of bounds: the length is {} but the index is {}", move _6, _5) -> [success: bb2, unwind continue]; + _7 = Lt(copy _5, copy _6); + assert(move _7, "index out of bounds: the length is {} but the index is {}", move _6, copy _5) -> [success: bb2, unwind continue]; } bb2: { - _3 = _4[_5]; + _3 = copy _4[_5]; StorageDead(_5); StorageDead(_4); StorageLive(_8); - StorageLive(_9); - _9 = Point { x: const 12_u32, y: const 42_u32 }; -- _8 = (_9.1: u32); +- _8 = copy (_9.1: u32); - StorageDead(_9); + StorageLive(_10); + StorageLive(_11); @@ -57,7 +57,7 @@ + _10 = const 12_u32; + _11 = const 42_u32; + nop; -+ _8 = _11; ++ _8 = copy _11; + StorageDead(_10); + StorageDead(_11); + nop; diff --git a/tests/mir-opt/pre-codegen/ptr_offset.demo_byte_add_fat.PreCodegen.after.panic-abort.mir b/tests/mir-opt/pre-codegen/ptr_offset.demo_byte_add_fat.PreCodegen.after.panic-abort.mir index 2f6139712ff..5faa1e210cf 100644 --- a/tests/mir-opt/pre-codegen/ptr_offset.demo_byte_add_fat.PreCodegen.after.panic-abort.mir +++ b/tests/mir-opt/pre-codegen/ptr_offset.demo_byte_add_fat.PreCodegen.after.panic-abort.mir @@ -23,12 +23,12 @@ fn demo_byte_add_fat(_1: *const [u32], _2: usize) -> *const [u32] { bb0: { StorageLive(_4); StorageLive(_3); - _3 = _1 as *const u8 (PtrToPtr); - _4 = Offset(_3, _2); + _3 = copy _1 as *const u8 (PtrToPtr); + _4 = Offset(copy _3, copy _2); StorageDead(_3); StorageLive(_5); - _5 = PtrMetadata(_1); - _0 = *const [u32] from (_4, _5); + _5 = PtrMetadata(copy _1); + _0 = *const [u32] from (copy _4, copy _5); StorageDead(_5); StorageDead(_4); return; diff --git a/tests/mir-opt/pre-codegen/ptr_offset.demo_byte_add_fat.PreCodegen.after.panic-unwind.mir b/tests/mir-opt/pre-codegen/ptr_offset.demo_byte_add_fat.PreCodegen.after.panic-unwind.mir index 2f6139712ff..5faa1e210cf 100644 --- a/tests/mir-opt/pre-codegen/ptr_offset.demo_byte_add_fat.PreCodegen.after.panic-unwind.mir +++ b/tests/mir-opt/pre-codegen/ptr_offset.demo_byte_add_fat.PreCodegen.after.panic-unwind.mir @@ -23,12 +23,12 @@ fn demo_byte_add_fat(_1: *const [u32], _2: usize) -> *const [u32] { bb0: { StorageLive(_4); StorageLive(_3); - _3 = _1 as *const u8 (PtrToPtr); - _4 = Offset(_3, _2); + _3 = copy _1 as *const u8 (PtrToPtr); + _4 = Offset(copy _3, copy _2); StorageDead(_3); StorageLive(_5); - _5 = PtrMetadata(_1); - _0 = *const [u32] from (_4, _5); + _5 = PtrMetadata(copy _1); + _0 = *const [u32] from (copy _4, copy _5); StorageDead(_5); StorageDead(_4); return; diff --git a/tests/mir-opt/pre-codegen/ptr_offset.demo_byte_add_thin.PreCodegen.after.panic-abort.mir b/tests/mir-opt/pre-codegen/ptr_offset.demo_byte_add_thin.PreCodegen.after.panic-abort.mir index 8d47e63eff2..9429785045a 100644 --- a/tests/mir-opt/pre-codegen/ptr_offset.demo_byte_add_thin.PreCodegen.after.panic-abort.mir +++ b/tests/mir-opt/pre-codegen/ptr_offset.demo_byte_add_thin.PreCodegen.after.panic-abort.mir @@ -22,10 +22,10 @@ fn demo_byte_add_thin(_1: *const u32, _2: usize) -> *const u32 { bb0: { StorageLive(_4); StorageLive(_3); - _3 = _1 as *const u8 (PtrToPtr); - _4 = Offset(_3, _2); + _3 = copy _1 as *const u8 (PtrToPtr); + _4 = Offset(copy _3, copy _2); StorageDead(_3); - _0 = _4 as *const u32 (PtrToPtr); + _0 = copy _4 as *const u32 (PtrToPtr); StorageDead(_4); return; } diff --git a/tests/mir-opt/pre-codegen/ptr_offset.demo_byte_add_thin.PreCodegen.after.panic-unwind.mir b/tests/mir-opt/pre-codegen/ptr_offset.demo_byte_add_thin.PreCodegen.after.panic-unwind.mir index 8d47e63eff2..9429785045a 100644 --- a/tests/mir-opt/pre-codegen/ptr_offset.demo_byte_add_thin.PreCodegen.after.panic-unwind.mir +++ b/tests/mir-opt/pre-codegen/ptr_offset.demo_byte_add_thin.PreCodegen.after.panic-unwind.mir @@ -22,10 +22,10 @@ fn demo_byte_add_thin(_1: *const u32, _2: usize) -> *const u32 { bb0: { StorageLive(_4); StorageLive(_3); - _3 = _1 as *const u8 (PtrToPtr); - _4 = Offset(_3, _2); + _3 = copy _1 as *const u8 (PtrToPtr); + _4 = Offset(copy _3, copy _2); StorageDead(_3); - _0 = _4 as *const u32 (PtrToPtr); + _0 = copy _4 as *const u32 (PtrToPtr); StorageDead(_4); return; } diff --git a/tests/mir-opt/pre-codegen/range_iter.forward_loop.PreCodegen.after.panic-abort.mir b/tests/mir-opt/pre-codegen/range_iter.forward_loop.PreCodegen.after.panic-abort.mir index 96b4962854d..5d33c33d73f 100644 --- a/tests/mir-opt/pre-codegen/range_iter.forward_loop.PreCodegen.after.panic-abort.mir +++ b/tests/mir-opt/pre-codegen/range_iter.forward_loop.PreCodegen.after.panic-abort.mir @@ -35,7 +35,7 @@ fn forward_loop(_1: u32, _2: u32, _3: impl Fn(u32)) -> () { bb0: { StorageLive(_4); - _4 = _1; + _4 = copy _1; goto -> bb1; } @@ -44,8 +44,8 @@ fn forward_loop(_1: u32, _2: u32, _3: impl Fn(u32)) -> () { StorageLive(_7); StorageLive(_6); StorageLive(_5); - _5 = _4; - _6 = Lt(move _5, _2); + _5 = copy _4; + _6 = Lt(move _5, copy _2); StorageDead(_5); switchInt(move _6) -> [0: bb2, otherwise: bb4]; } @@ -63,22 +63,22 @@ fn forward_loop(_1: u32, _2: u32, _3: impl Fn(u32)) -> () { } bb4: { - _7 = _4; + _7 = copy _4; StorageLive(_8); - _8 = <u32 as Step>::forward_unchecked(_7, const 1_usize) -> [return: bb5, unwind unreachable]; + _8 = <u32 as Step>::forward_unchecked(copy _7, const 1_usize) -> [return: bb5, unwind unreachable]; } bb5: { _4 = move _8; StorageDead(_8); - _9 = Option::<u32>::Some(_7); + _9 = Option::<u32>::Some(copy _7); StorageDead(_6); StorageDead(_7); - _10 = ((_9 as Some).0: u32); + _10 = copy ((_9 as Some).0: u32); StorageLive(_11); _11 = &_3; StorageLive(_12); - _12 = (_10,); + _12 = (copy _10,); _13 = <impl Fn(u32) as Fn<(u32,)>>::call(move _11, move _12) -> [return: bb6, unwind unreachable]; } diff --git a/tests/mir-opt/pre-codegen/range_iter.forward_loop.PreCodegen.after.panic-unwind.mir b/tests/mir-opt/pre-codegen/range_iter.forward_loop.PreCodegen.after.panic-unwind.mir index ce8e2bd083e..ded30a15520 100644 --- a/tests/mir-opt/pre-codegen/range_iter.forward_loop.PreCodegen.after.panic-unwind.mir +++ b/tests/mir-opt/pre-codegen/range_iter.forward_loop.PreCodegen.after.panic-unwind.mir @@ -35,7 +35,7 @@ fn forward_loop(_1: u32, _2: u32, _3: impl Fn(u32)) -> () { bb0: { StorageLive(_4); - _4 = _1; + _4 = copy _1; goto -> bb1; } @@ -44,8 +44,8 @@ fn forward_loop(_1: u32, _2: u32, _3: impl Fn(u32)) -> () { StorageLive(_7); StorageLive(_6); StorageLive(_5); - _5 = _4; - _6 = Lt(move _5, _2); + _5 = copy _4; + _6 = Lt(move _5, copy _2); StorageDead(_5); switchInt(move _6) -> [0: bb2, otherwise: bb4]; } @@ -63,22 +63,22 @@ fn forward_loop(_1: u32, _2: u32, _3: impl Fn(u32)) -> () { } bb4: { - _7 = _4; + _7 = copy _4; StorageLive(_8); - _8 = <u32 as Step>::forward_unchecked(_7, const 1_usize) -> [return: bb5, unwind: bb7]; + _8 = <u32 as Step>::forward_unchecked(copy _7, const 1_usize) -> [return: bb5, unwind: bb7]; } bb5: { _4 = move _8; StorageDead(_8); - _9 = Option::<u32>::Some(_7); + _9 = Option::<u32>::Some(copy _7); StorageDead(_6); StorageDead(_7); - _10 = ((_9 as Some).0: u32); + _10 = copy ((_9 as Some).0: u32); StorageLive(_11); _11 = &_3; StorageLive(_12); - _12 = (_10,); + _12 = (copy _10,); _13 = <impl Fn(u32) as Fn<(u32,)>>::call(move _11, move _12) -> [return: bb6, unwind: bb7]; } diff --git a/tests/mir-opt/pre-codegen/range_iter.inclusive_loop.PreCodegen.after.panic-abort.mir b/tests/mir-opt/pre-codegen/range_iter.inclusive_loop.PreCodegen.after.panic-abort.mir index a7fe52d8390..60c0b8afa53 100644 --- a/tests/mir-opt/pre-codegen/range_iter.inclusive_loop.PreCodegen.after.panic-abort.mir +++ b/tests/mir-opt/pre-codegen/range_iter.inclusive_loop.PreCodegen.after.panic-abort.mir @@ -28,9 +28,9 @@ fn inclusive_loop(_1: u32, _2: u32, _3: impl Fn(u32)) -> () { } bb0: { - _4 = RangeInclusive::<u32> { start: _1, end: _2, exhausted: const false }; + _4 = RangeInclusive::<u32> { start: copy _1, end: copy _2, exhausted: const false }; StorageLive(_5); - _5 = _4; + _5 = copy _4; goto -> bb1; } @@ -56,11 +56,11 @@ fn inclusive_loop(_1: u32, _2: u32, _3: impl Fn(u32)) -> () { } bb5: { - _9 = ((_7 as Some).0: u32); + _9 = copy ((_7 as Some).0: u32); StorageLive(_10); _10 = &_3; StorageLive(_11); - _11 = (_9,); + _11 = (copy _9,); _12 = <impl Fn(u32) as Fn<(u32,)>>::call(move _10, move _11) -> [return: bb6, unwind unreachable]; } diff --git a/tests/mir-opt/pre-codegen/range_iter.inclusive_loop.PreCodegen.after.panic-unwind.mir b/tests/mir-opt/pre-codegen/range_iter.inclusive_loop.PreCodegen.after.panic-unwind.mir index 3e2bbcd3c91..7145da58ce1 100644 --- a/tests/mir-opt/pre-codegen/range_iter.inclusive_loop.PreCodegen.after.panic-unwind.mir +++ b/tests/mir-opt/pre-codegen/range_iter.inclusive_loop.PreCodegen.after.panic-unwind.mir @@ -28,9 +28,9 @@ fn inclusive_loop(_1: u32, _2: u32, _3: impl Fn(u32)) -> () { } bb0: { - _4 = RangeInclusive::<u32> { start: _1, end: _2, exhausted: const false }; + _4 = RangeInclusive::<u32> { start: copy _1, end: copy _2, exhausted: const false }; StorageLive(_5); - _5 = _4; + _5 = copy _4; goto -> bb1; } @@ -56,11 +56,11 @@ fn inclusive_loop(_1: u32, _2: u32, _3: impl Fn(u32)) -> () { } bb5: { - _9 = ((_7 as Some).0: u32); + _9 = copy ((_7 as Some).0: u32); StorageLive(_10); _10 = &_3; StorageLive(_11); - _11 = (_9,); + _11 = (copy _9,); _12 = <impl Fn(u32) as Fn<(u32,)>>::call(move _10, move _11) -> [return: bb6, unwind: bb8]; } diff --git a/tests/mir-opt/pre-codegen/range_iter.range_iter_next.PreCodegen.after.panic-abort.mir b/tests/mir-opt/pre-codegen/range_iter.range_iter_next.PreCodegen.after.panic-abort.mir index 2ac7e880ccb..2621ec67531 100644 --- a/tests/mir-opt/pre-codegen/range_iter.range_iter_next.PreCodegen.after.panic-abort.mir +++ b/tests/mir-opt/pre-codegen/range_iter.range_iter_next.PreCodegen.after.panic-abort.mir @@ -21,9 +21,9 @@ fn range_iter_next(_1: &mut std::ops::Range<u32>) -> Option<u32> { StorageLive(_5); StorageLive(_4); StorageLive(_2); - _2 = ((*_1).0: u32); + _2 = copy ((*_1).0: u32); StorageLive(_3); - _3 = ((*_1).1: u32); + _3 = copy ((*_1).1: u32); _4 = Lt(move _2, move _3); StorageDead(_3); StorageDead(_2); @@ -36,15 +36,15 @@ fn range_iter_next(_1: &mut std::ops::Range<u32>) -> Option<u32> { } bb2: { - _5 = ((*_1).0: u32); + _5 = copy ((*_1).0: u32); StorageLive(_6); - _6 = <u32 as Step>::forward_unchecked(_5, const 1_usize) -> [return: bb3, unwind unreachable]; + _6 = <u32 as Step>::forward_unchecked(copy _5, const 1_usize) -> [return: bb3, unwind unreachable]; } bb3: { ((*_1).0: u32) = move _6; StorageDead(_6); - _0 = Option::<u32>::Some(_5); + _0 = Option::<u32>::Some(copy _5); goto -> bb4; } diff --git a/tests/mir-opt/pre-codegen/range_iter.range_iter_next.PreCodegen.after.panic-unwind.mir b/tests/mir-opt/pre-codegen/range_iter.range_iter_next.PreCodegen.after.panic-unwind.mir index 60bf644fce6..338fb4b9523 100644 --- a/tests/mir-opt/pre-codegen/range_iter.range_iter_next.PreCodegen.after.panic-unwind.mir +++ b/tests/mir-opt/pre-codegen/range_iter.range_iter_next.PreCodegen.after.panic-unwind.mir @@ -21,9 +21,9 @@ fn range_iter_next(_1: &mut std::ops::Range<u32>) -> Option<u32> { StorageLive(_5); StorageLive(_4); StorageLive(_2); - _2 = ((*_1).0: u32); + _2 = copy ((*_1).0: u32); StorageLive(_3); - _3 = ((*_1).1: u32); + _3 = copy ((*_1).1: u32); _4 = Lt(move _2, move _3); StorageDead(_3); StorageDead(_2); @@ -36,15 +36,15 @@ fn range_iter_next(_1: &mut std::ops::Range<u32>) -> Option<u32> { } bb2: { - _5 = ((*_1).0: u32); + _5 = copy ((*_1).0: u32); StorageLive(_6); - _6 = <u32 as Step>::forward_unchecked(_5, const 1_usize) -> [return: bb3, unwind continue]; + _6 = <u32 as Step>::forward_unchecked(copy _5, const 1_usize) -> [return: bb3, unwind continue]; } bb3: { ((*_1).0: u32) = move _6; StorageDead(_6); - _0 = Option::<u32>::Some(_5); + _0 = Option::<u32>::Some(copy _5); goto -> bb4; } diff --git a/tests/mir-opt/pre-codegen/simple_option_map.ezmap.PreCodegen.after.mir b/tests/mir-opt/pre-codegen/simple_option_map.ezmap.PreCodegen.after.mir index 030f9c3b93e..cbfc58194cc 100644 --- a/tests/mir-opt/pre-codegen/simple_option_map.ezmap.PreCodegen.after.mir +++ b/tests/mir-opt/pre-codegen/simple_option_map.ezmap.PreCodegen.after.mir @@ -25,9 +25,9 @@ fn ezmap(_1: Option<i32>) -> Option<i32> { } bb2: { - _3 = ((_1 as Some).0: i32); + _3 = copy ((_1 as Some).0: i32); StorageLive(_4); - _4 = Add(_3, const 1_i32); + _4 = Add(copy _3, const 1_i32); _0 = Option::<i32>::Some(move _4); StorageDead(_4); goto -> bb3; diff --git a/tests/mir-opt/pre-codegen/slice_filter.variant_a-{closure#0}.PreCodegen.after.mir b/tests/mir-opt/pre-codegen/slice_filter.variant_a-{closure#0}.PreCodegen.after.mir index e382f744723..cbdd194afd3 100644 --- a/tests/mir-opt/pre-codegen/slice_filter.variant_a-{closure#0}.PreCodegen.after.mir +++ b/tests/mir-opt/pre-codegen/slice_filter.variant_a-{closure#0}.PreCodegen.after.mir @@ -68,7 +68,7 @@ fn variant_a::{closure#0}(_1: &mut {closure@$DIR/slice_filter.rs:7:25: 7:39}, _2 } bb0: { - _3 = (*_2); + _3 = copy (*_2); _4 = &((*_3).0: usize); _5 = &((*_3).1: usize); _6 = &((*_3).2: usize); @@ -78,11 +78,11 @@ fn variant_a::{closure#0}(_1: &mut {closure@$DIR/slice_filter.rs:7:25: 7:39}, _2 _8 = &_4; StorageLive(_10); StorageLive(_9); - _9 = _6; + _9 = copy _6; _10 = &_9; - _11 = ((*_3).0: usize); - _12 = ((*_3).2: usize); - _13 = Le(_11, _12); + _11 = copy ((*_3).0: usize); + _12 = copy ((*_3).2: usize); + _13 = Le(copy _11, copy _12); switchInt(move _13) -> [0: bb1, otherwise: bb2]; } @@ -102,12 +102,12 @@ fn variant_a::{closure#0}(_1: &mut {closure@$DIR/slice_filter.rs:7:25: 7:39}, _2 _14 = &_7; StorageLive(_16); StorageLive(_15); - _15 = _5; + _15 = copy _5; _16 = &_15; StorageLive(_17); - _17 = ((*_3).3: usize); + _17 = copy ((*_3).3: usize); StorageLive(_18); - _18 = ((*_3).1: usize); + _18 = copy ((*_3).1: usize); _19 = Le(move _17, move _18); StorageDead(_18); StorageDead(_17); @@ -127,9 +127,9 @@ fn variant_a::{closure#0}(_1: &mut {closure@$DIR/slice_filter.rs:7:25: 7:39}, _2 _20 = &_6; StorageLive(_22); StorageLive(_21); - _21 = _4; + _21 = copy _4; _22 = &_21; - _23 = Le(_12, _11); + _23 = Le(copy _12, copy _11); switchInt(move _23) -> [0: bb5, otherwise: bb6]; } @@ -149,12 +149,12 @@ fn variant_a::{closure#0}(_1: &mut {closure@$DIR/slice_filter.rs:7:25: 7:39}, _2 _24 = &_5; StorageLive(_26); StorageLive(_25); - _25 = _7; + _25 = copy _7; _26 = &_25; StorageLive(_27); - _27 = ((*_3).1: usize); + _27 = copy ((*_3).1: usize); StorageLive(_28); - _28 = ((*_3).3: usize); + _28 = copy ((*_3).3: usize); _0 = Le(move _27, move _28); StorageDead(_28); StorageDead(_27); diff --git a/tests/mir-opt/pre-codegen/slice_filter.variant_b-{closure#0}.PreCodegen.after.mir b/tests/mir-opt/pre-codegen/slice_filter.variant_b-{closure#0}.PreCodegen.after.mir index d9e118d879a..bc7a31d5219 100644 --- a/tests/mir-opt/pre-codegen/slice_filter.variant_b-{closure#0}.PreCodegen.after.mir +++ b/tests/mir-opt/pre-codegen/slice_filter.variant_b-{closure#0}.PreCodegen.after.mir @@ -18,25 +18,25 @@ fn variant_b::{closure#0}(_1: &mut {closure@$DIR/slice_filter.rs:11:25: 11:41}, } bb0: { - _3 = (*_2); - _4 = ((*_3).0: usize); - _5 = ((*_3).1: usize); - _6 = ((*_3).2: usize); - _7 = ((*_3).3: usize); + _3 = copy (*_2); + _4 = copy ((*_3).0: usize); + _5 = copy ((*_3).1: usize); + _6 = copy ((*_3).2: usize); + _7 = copy ((*_3).3: usize); StorageLive(_8); - _8 = Le(_4, _6); + _8 = Le(copy _4, copy _6); switchInt(move _8) -> [0: bb2, otherwise: bb1]; } bb1: { StorageLive(_9); - _9 = Le(_7, _5); + _9 = Le(copy _7, copy _5); switchInt(move _9) -> [0: bb2, otherwise: bb6]; } bb2: { StorageLive(_10); - _10 = Le(_6, _4); + _10 = Le(copy _6, copy _4); switchInt(move _10) -> [0: bb3, otherwise: bb4]; } @@ -46,7 +46,7 @@ fn variant_b::{closure#0}(_1: &mut {closure@$DIR/slice_filter.rs:11:25: 11:41}, } bb4: { - _0 = Le(_5, _7); + _0 = Le(copy _5, copy _7); goto -> bb5; } diff --git a/tests/mir-opt/pre-codegen/slice_index.rs b/tests/mir-opt/pre-codegen/slice_index.rs index 6ddc4ad0220..574062d6c35 100644 --- a/tests/mir-opt/pre-codegen/slice_index.rs +++ b/tests/mir-opt/pre-codegen/slice_index.rs @@ -10,17 +10,17 @@ use std::ops::Range; pub fn slice_index_usize(slice: &[u32], index: usize) -> u32 { // CHECK-LABEL: slice_index_usize // CHECK: [[LEN:_[0-9]+]] = Len((*_1)) - // CHECK: Lt(_2, [[LEN]]) + // CHECK: Lt(copy _2, copy [[LEN]]) // CHECK-NOT: precondition_check - // CHECK: _0 = (*_1)[_2]; + // CHECK: _0 = copy (*_1)[_2]; slice[index] } // EMIT_MIR slice_index.slice_get_mut_usize.PreCodegen.after.mir pub fn slice_get_mut_usize(slice: &mut [u32], index: usize) -> Option<&mut u32> { // CHECK-LABEL: slice_get_mut_usize - // CHECK: [[LEN:_[0-9]+]] = PtrMetadata(_1) - // CHECK: Lt(_2, move [[LEN]]) + // CHECK: [[LEN:_[0-9]+]] = PtrMetadata(copy _1) + // CHECK: Lt(copy _2, move [[LEN]]) // CHECK-NOT: precondition_check slice.get_mut(index) } @@ -37,9 +37,9 @@ pub unsafe fn slice_get_unchecked_mut_range(slice: &mut [u32], index: Range<usiz // CHECK: [[START:_[0-9]+]] = move (_2.0: usize); // CHECK: [[END:_[0-9]+]] = move (_2.1: usize); // CHECK: precondition_check - // CHECK: [[LEN:_[0-9]+]] = SubUnchecked([[END]], [[START]]); - // CHECK: [[PTR:_[0-9]+]] = Offset({{_[0-9]+}}, [[START]]); - // CHECK: [[SLICE:_[0-9]+]] = *mut [u32] from ([[PTR]], [[LEN]]) + // CHECK: [[LEN:_[0-9]+]] = SubUnchecked(copy [[END]], copy [[START]]); + // CHECK: [[PTR:_[0-9]+]] = Offset(copy {{_[0-9]+}}, copy [[START]]); + // CHECK: [[SLICE:_[0-9]+]] = *mut [u32] from (copy [[PTR]], copy [[LEN]]) // CHECK: _0 = &mut (*[[SLICE]]); slice.get_unchecked_mut(index) } @@ -53,8 +53,8 @@ pub unsafe fn slice_ptr_get_unchecked_range( // CHECK: [[START:_[0-9]+]] = move (_2.0: usize); // CHECK: [[END:_[0-9]+]] = move (_2.1: usize); // CHECK: precondition_check - // CHECK: [[LEN:_[0-9]+]] = SubUnchecked([[END]], [[START]]); - // CHECK: [[PTR:_[0-9]+]] = Offset({{_[0-9]+}}, [[START]]); - // CHECK: _0 = *const [u32] from ([[PTR]], [[LEN]]) + // CHECK: [[LEN:_[0-9]+]] = SubUnchecked(copy [[END]], copy [[START]]); + // CHECK: [[PTR:_[0-9]+]] = Offset(copy {{_[0-9]+}}, copy [[START]]); + // CHECK: _0 = *const [u32] from (copy [[PTR]], copy [[LEN]]) slice.get_unchecked(index) } diff --git a/tests/mir-opt/pre-codegen/slice_index.slice_get_mut_usize.PreCodegen.after.panic-abort.mir b/tests/mir-opt/pre-codegen/slice_index.slice_get_mut_usize.PreCodegen.after.panic-abort.mir index 58e9b45a4a0..ec67193bc79 100644 --- a/tests/mir-opt/pre-codegen/slice_index.slice_get_mut_usize.PreCodegen.after.panic-abort.mir +++ b/tests/mir-opt/pre-codegen/slice_index.slice_get_mut_usize.PreCodegen.after.panic-abort.mir @@ -23,8 +23,8 @@ fn slice_get_mut_usize(_1: &mut [u32], _2: usize) -> Option<&mut u32> { StorageLive(_8); StorageLive(_4); StorageLive(_3); - _3 = PtrMetadata(_1); - _4 = Lt(_2, move _3); + _3 = PtrMetadata(copy _1); + _4 = Lt(copy _2, move _3); switchInt(move _4) -> [0: bb1, otherwise: bb2]; } @@ -40,12 +40,12 @@ fn slice_get_mut_usize(_1: &mut [u32], _2: usize) -> Option<&mut u32> { StorageLive(_5); _5 = &raw mut (*_1); StorageLive(_6); - _6 = _5 as *mut u32 (PtrToPtr); - _7 = Offset(_6, _2); + _6 = copy _5 as *mut u32 (PtrToPtr); + _7 = Offset(copy _6, copy _2); StorageDead(_6); StorageDead(_5); _8 = &mut (*_7); - _0 = Option::<&mut u32>::Some(_8); + _0 = Option::<&mut u32>::Some(copy _8); StorageDead(_7); goto -> bb3; } diff --git a/tests/mir-opt/pre-codegen/slice_index.slice_get_mut_usize.PreCodegen.after.panic-unwind.mir b/tests/mir-opt/pre-codegen/slice_index.slice_get_mut_usize.PreCodegen.after.panic-unwind.mir index 58e9b45a4a0..ec67193bc79 100644 --- a/tests/mir-opt/pre-codegen/slice_index.slice_get_mut_usize.PreCodegen.after.panic-unwind.mir +++ b/tests/mir-opt/pre-codegen/slice_index.slice_get_mut_usize.PreCodegen.after.panic-unwind.mir @@ -23,8 +23,8 @@ fn slice_get_mut_usize(_1: &mut [u32], _2: usize) -> Option<&mut u32> { StorageLive(_8); StorageLive(_4); StorageLive(_3); - _3 = PtrMetadata(_1); - _4 = Lt(_2, move _3); + _3 = PtrMetadata(copy _1); + _4 = Lt(copy _2, move _3); switchInt(move _4) -> [0: bb1, otherwise: bb2]; } @@ -40,12 +40,12 @@ fn slice_get_mut_usize(_1: &mut [u32], _2: usize) -> Option<&mut u32> { StorageLive(_5); _5 = &raw mut (*_1); StorageLive(_6); - _6 = _5 as *mut u32 (PtrToPtr); - _7 = Offset(_6, _2); + _6 = copy _5 as *mut u32 (PtrToPtr); + _7 = Offset(copy _6, copy _2); StorageDead(_6); StorageDead(_5); _8 = &mut (*_7); - _0 = Option::<&mut u32>::Some(_8); + _0 = Option::<&mut u32>::Some(copy _8); StorageDead(_7); goto -> bb3; } diff --git a/tests/mir-opt/pre-codegen/slice_index.slice_get_unchecked_mut_range.PreCodegen.after.panic-abort.mir b/tests/mir-opt/pre-codegen/slice_index.slice_get_unchecked_mut_range.PreCodegen.after.panic-abort.mir index ee80726a675..220e881f866 100644 --- a/tests/mir-opt/pre-codegen/slice_index.slice_get_unchecked_mut_range.PreCodegen.after.panic-abort.mir +++ b/tests/mir-opt/pre-codegen/slice_index.slice_get_unchecked_mut_range.PreCodegen.after.panic-abort.mir @@ -40,19 +40,19 @@ fn slice_get_unchecked_mut_range(_1: &mut [u32], _2: std::ops::Range<usize>) -> _5 = &raw mut (*_1); StorageLive(_8); StorageLive(_6); - _6 = PtrMetadata(_1); - _7 = <std::ops::Range<usize> as SliceIndex<[T]>>::get_unchecked_mut::precondition_check(_3, _4, move _6) -> [return: bb1, unwind unreachable]; + _6 = PtrMetadata(copy _1); + _7 = <std::ops::Range<usize> as SliceIndex<[T]>>::get_unchecked_mut::precondition_check(copy _3, copy _4, move _6) -> [return: bb1, unwind unreachable]; } bb1: { StorageDead(_6); - _8 = SubUnchecked(_4, _3); + _8 = SubUnchecked(copy _4, copy _3); StorageLive(_10); StorageLive(_9); - _9 = _5 as *mut u32 (PtrToPtr); - _10 = Offset(_9, _3); + _9 = copy _5 as *mut u32 (PtrToPtr); + _10 = Offset(copy _9, copy _3); StorageDead(_9); - _11 = *mut [u32] from (_10, _8); + _11 = *mut [u32] from (copy _10, copy _8); StorageDead(_10); StorageDead(_8); StorageDead(_5); diff --git a/tests/mir-opt/pre-codegen/slice_index.slice_get_unchecked_mut_range.PreCodegen.after.panic-unwind.mir b/tests/mir-opt/pre-codegen/slice_index.slice_get_unchecked_mut_range.PreCodegen.after.panic-unwind.mir index ee80726a675..220e881f866 100644 --- a/tests/mir-opt/pre-codegen/slice_index.slice_get_unchecked_mut_range.PreCodegen.after.panic-unwind.mir +++ b/tests/mir-opt/pre-codegen/slice_index.slice_get_unchecked_mut_range.PreCodegen.after.panic-unwind.mir @@ -40,19 +40,19 @@ fn slice_get_unchecked_mut_range(_1: &mut [u32], _2: std::ops::Range<usize>) -> _5 = &raw mut (*_1); StorageLive(_8); StorageLive(_6); - _6 = PtrMetadata(_1); - _7 = <std::ops::Range<usize> as SliceIndex<[T]>>::get_unchecked_mut::precondition_check(_3, _4, move _6) -> [return: bb1, unwind unreachable]; + _6 = PtrMetadata(copy _1); + _7 = <std::ops::Range<usize> as SliceIndex<[T]>>::get_unchecked_mut::precondition_check(copy _3, copy _4, move _6) -> [return: bb1, unwind unreachable]; } bb1: { StorageDead(_6); - _8 = SubUnchecked(_4, _3); + _8 = SubUnchecked(copy _4, copy _3); StorageLive(_10); StorageLive(_9); - _9 = _5 as *mut u32 (PtrToPtr); - _10 = Offset(_9, _3); + _9 = copy _5 as *mut u32 (PtrToPtr); + _10 = Offset(copy _9, copy _3); StorageDead(_9); - _11 = *mut [u32] from (_10, _8); + _11 = *mut [u32] from (copy _10, copy _8); StorageDead(_10); StorageDead(_8); StorageDead(_5); diff --git a/tests/mir-opt/pre-codegen/slice_index.slice_index_usize.PreCodegen.after.panic-abort.mir b/tests/mir-opt/pre-codegen/slice_index.slice_index_usize.PreCodegen.after.panic-abort.mir index 210f9d6a124..cc1034229fc 100644 --- a/tests/mir-opt/pre-codegen/slice_index.slice_index_usize.PreCodegen.after.panic-abort.mir +++ b/tests/mir-opt/pre-codegen/slice_index.slice_index_usize.PreCodegen.after.panic-abort.mir @@ -9,12 +9,12 @@ fn slice_index_usize(_1: &[u32], _2: usize) -> u32 { bb0: { _3 = Len((*_1)); - _4 = Lt(_2, _3); - assert(move _4, "index out of bounds: the length is {} but the index is {}", move _3, _2) -> [success: bb1, unwind unreachable]; + _4 = Lt(copy _2, copy _3); + assert(move _4, "index out of bounds: the length is {} but the index is {}", move _3, copy _2) -> [success: bb1, unwind unreachable]; } bb1: { - _0 = (*_1)[_2]; + _0 = copy (*_1)[_2]; return; } } diff --git a/tests/mir-opt/pre-codegen/slice_index.slice_index_usize.PreCodegen.after.panic-unwind.mir b/tests/mir-opt/pre-codegen/slice_index.slice_index_usize.PreCodegen.after.panic-unwind.mir index d576520a8d5..358226fb529 100644 --- a/tests/mir-opt/pre-codegen/slice_index.slice_index_usize.PreCodegen.after.panic-unwind.mir +++ b/tests/mir-opt/pre-codegen/slice_index.slice_index_usize.PreCodegen.after.panic-unwind.mir @@ -9,12 +9,12 @@ fn slice_index_usize(_1: &[u32], _2: usize) -> u32 { bb0: { _3 = Len((*_1)); - _4 = Lt(_2, _3); - assert(move _4, "index out of bounds: the length is {} but the index is {}", move _3, _2) -> [success: bb1, unwind continue]; + _4 = Lt(copy _2, copy _3); + assert(move _4, "index out of bounds: the length is {} but the index is {}", move _3, copy _2) -> [success: bb1, unwind continue]; } bb1: { - _0 = (*_1)[_2]; + _0 = copy (*_1)[_2]; return; } } diff --git a/tests/mir-opt/pre-codegen/slice_index.slice_ptr_get_unchecked_range.PreCodegen.after.panic-abort.mir b/tests/mir-opt/pre-codegen/slice_index.slice_ptr_get_unchecked_range.PreCodegen.after.panic-abort.mir index c61bebe6cc3..1e0df94b67f 100644 --- a/tests/mir-opt/pre-codegen/slice_index.slice_ptr_get_unchecked_range.PreCodegen.after.panic-abort.mir +++ b/tests/mir-opt/pre-codegen/slice_index.slice_ptr_get_unchecked_range.PreCodegen.after.panic-abort.mir @@ -35,19 +35,19 @@ fn slice_ptr_get_unchecked_range(_1: *const [u32], _2: std::ops::Range<usize>) - _4 = move (_2.1: usize); StorageLive(_7); StorageLive(_5); - _5 = PtrMetadata(_1); - _6 = <std::ops::Range<usize> as SliceIndex<[T]>>::get_unchecked::precondition_check(_3, _4, move _5) -> [return: bb1, unwind unreachable]; + _5 = PtrMetadata(copy _1); + _6 = <std::ops::Range<usize> as SliceIndex<[T]>>::get_unchecked::precondition_check(copy _3, copy _4, move _5) -> [return: bb1, unwind unreachable]; } bb1: { StorageDead(_5); - _7 = SubUnchecked(_4, _3); + _7 = SubUnchecked(copy _4, copy _3); StorageLive(_9); StorageLive(_8); - _8 = _1 as *const u32 (PtrToPtr); - _9 = Offset(_8, _3); + _8 = copy _1 as *const u32 (PtrToPtr); + _9 = Offset(copy _8, copy _3); StorageDead(_8); - _0 = *const [u32] from (_9, _7); + _0 = *const [u32] from (copy _9, copy _7); StorageDead(_9); StorageDead(_7); return; diff --git a/tests/mir-opt/pre-codegen/slice_index.slice_ptr_get_unchecked_range.PreCodegen.after.panic-unwind.mir b/tests/mir-opt/pre-codegen/slice_index.slice_ptr_get_unchecked_range.PreCodegen.after.panic-unwind.mir index c61bebe6cc3..1e0df94b67f 100644 --- a/tests/mir-opt/pre-codegen/slice_index.slice_ptr_get_unchecked_range.PreCodegen.after.panic-unwind.mir +++ b/tests/mir-opt/pre-codegen/slice_index.slice_ptr_get_unchecked_range.PreCodegen.after.panic-unwind.mir @@ -35,19 +35,19 @@ fn slice_ptr_get_unchecked_range(_1: *const [u32], _2: std::ops::Range<usize>) - _4 = move (_2.1: usize); StorageLive(_7); StorageLive(_5); - _5 = PtrMetadata(_1); - _6 = <std::ops::Range<usize> as SliceIndex<[T]>>::get_unchecked::precondition_check(_3, _4, move _5) -> [return: bb1, unwind unreachable]; + _5 = PtrMetadata(copy _1); + _6 = <std::ops::Range<usize> as SliceIndex<[T]>>::get_unchecked::precondition_check(copy _3, copy _4, move _5) -> [return: bb1, unwind unreachable]; } bb1: { StorageDead(_5); - _7 = SubUnchecked(_4, _3); + _7 = SubUnchecked(copy _4, copy _3); StorageLive(_9); StorageLive(_8); - _8 = _1 as *const u32 (PtrToPtr); - _9 = Offset(_8, _3); + _8 = copy _1 as *const u32 (PtrToPtr); + _9 = Offset(copy _8, copy _3); StorageDead(_8); - _0 = *const [u32] from (_9, _7); + _0 = *const [u32] from (copy _9, copy _7); StorageDead(_9); StorageDead(_7); return; diff --git a/tests/mir-opt/pre-codegen/slice_iter.enumerated_loop.PreCodegen.after.panic-abort.mir b/tests/mir-opt/pre-codegen/slice_iter.enumerated_loop.PreCodegen.after.panic-abort.mir index 953e7550479..3aa483ed1ae 100644 --- a/tests/mir-opt/pre-codegen/slice_iter.enumerated_loop.PreCodegen.after.panic-abort.mir +++ b/tests/mir-opt/pre-codegen/slice_iter.enumerated_loop.PreCodegen.after.panic-abort.mir @@ -31,7 +31,7 @@ fn enumerated_loop(_1: &[T], _2: impl Fn(usize, &T)) -> () { } scope 19 { scope 20 { - scope 26 (inlined <Option<(usize, &T)> as FromResidual>::from_residual) { + scope 26 (inlined <Option<(usize, &T)> as FromResidual<Option<Infallible>>>::from_residual) { } } } @@ -90,10 +90,10 @@ fn enumerated_loop(_1: &[T], _2: impl Fn(usize, &T)) -> () { StorageLive(_6); StorageLive(_4); StorageLive(_5); - _3 = PtrMetadata(_1); + _3 = PtrMetadata(copy _1); _4 = &raw const (*_1); - _5 = _4 as *const T (PtrToPtr); - _6 = NonNull::<T> { pointer: _5 }; + _5 = copy _4 as *const T (PtrToPtr); + _6 = NonNull::<T> { pointer: copy _5 }; StorageLive(_9); switchInt(const <T as std::mem::SizedTypeProperties>::IS_ZST) -> [0: bb1, otherwise: bb2]; } @@ -101,8 +101,8 @@ fn enumerated_loop(_1: &[T], _2: impl Fn(usize, &T)) -> () { bb1: { StorageLive(_8); StorageLive(_7); - _7 = _4 as *mut T (PtrToPtr); - _8 = Offset(_7, _3); + _7 = copy _4 as *mut T (PtrToPtr); + _8 = Offset(copy _7, copy _3); StorageDead(_7); _9 = move _8 as *const T (PtrToPtr); StorageDead(_8); @@ -110,24 +110,24 @@ fn enumerated_loop(_1: &[T], _2: impl Fn(usize, &T)) -> () { } bb2: { - _9 = _3 as *const T (Transmute); + _9 = copy _3 as *const T (Transmute); goto -> bb3; } bb3: { StorageLive(_10); - _10 = _9; - _11 = std::slice::Iter::<'_, T> { ptr: _6, end_or_len: move _10, _marker: const ZeroSized: PhantomData<&T> }; + _10 = copy _9; + _11 = std::slice::Iter::<'_, T> { ptr: copy _6, end_or_len: move _10, _marker: const ZeroSized: PhantomData<&T> }; StorageDead(_10); StorageDead(_9); StorageDead(_5); StorageDead(_4); StorageDead(_6); StorageDead(_3); - _12 = Enumerate::<std::slice::Iter<'_, T>> { iter: _11, count: const 0_usize }; + _12 = Enumerate::<std::slice::Iter<'_, T>> { iter: copy _11, count: const 0_usize }; StorageDead(_11); StorageLive(_13); - _13 = _12; + _13 = copy _12; goto -> bb4; } @@ -166,25 +166,25 @@ fn enumerated_loop(_1: &[T], _2: impl Fn(usize, &T)) -> () { _17 = move ((_15 as Some).0: &T); StorageDead(_16); StorageDead(_15); - _18 = (_13.1: usize); - _19 = AddWithOverflow((_13.1: usize), const 1_usize); - assert(!move (_19.1: bool), "attempt to compute `{} + {}`, which would overflow", (_13.1: usize), const 1_usize) -> [success: bb9, unwind unreachable]; + _18 = copy (_13.1: usize); + _19 = AddWithOverflow(copy (_13.1: usize), const 1_usize); + assert(!move (_19.1: bool), "attempt to compute `{} + {}`, which would overflow", copy (_13.1: usize), const 1_usize) -> [success: bb9, unwind unreachable]; } bb9: { (_13.1: usize) = move (_19.0: usize); StorageLive(_20); - _20 = (_18, _17); + _20 = (copy _18, copy _17); _21 = Option::<(usize, &T)>::Some(move _20); StorageDead(_20); StorageDead(_19); StorageDead(_18); - _22 = (((_21 as Some).0: (usize, &T)).0: usize); - _23 = (((_21 as Some).0: (usize, &T)).1: &T); + _22 = copy (((_21 as Some).0: (usize, &T)).0: usize); + _23 = copy (((_21 as Some).0: (usize, &T)).1: &T); StorageLive(_24); _24 = &_2; StorageLive(_25); - _25 = (_22, _23); + _25 = (copy _22, copy _23); _26 = <impl Fn(usize, &T) as Fn<(usize, &T)>>::call(move _24, move _25) -> [return: bb10, unwind unreachable]; } diff --git a/tests/mir-opt/pre-codegen/slice_iter.enumerated_loop.PreCodegen.after.panic-unwind.mir b/tests/mir-opt/pre-codegen/slice_iter.enumerated_loop.PreCodegen.after.panic-unwind.mir index 4c766c6497a..4cc0aa0ed78 100644 --- a/tests/mir-opt/pre-codegen/slice_iter.enumerated_loop.PreCodegen.after.panic-unwind.mir +++ b/tests/mir-opt/pre-codegen/slice_iter.enumerated_loop.PreCodegen.after.panic-unwind.mir @@ -65,10 +65,10 @@ fn enumerated_loop(_1: &[T], _2: impl Fn(usize, &T)) -> () { StorageLive(_6); StorageLive(_4); StorageLive(_5); - _3 = PtrMetadata(_1); + _3 = PtrMetadata(copy _1); _4 = &raw const (*_1); - _5 = _4 as *const T (PtrToPtr); - _6 = NonNull::<T> { pointer: _5 }; + _5 = copy _4 as *const T (PtrToPtr); + _6 = NonNull::<T> { pointer: copy _5 }; StorageLive(_9); switchInt(const <T as std::mem::SizedTypeProperties>::IS_ZST) -> [0: bb1, otherwise: bb2]; } @@ -76,8 +76,8 @@ fn enumerated_loop(_1: &[T], _2: impl Fn(usize, &T)) -> () { bb1: { StorageLive(_8); StorageLive(_7); - _7 = _4 as *mut T (PtrToPtr); - _8 = Offset(_7, _3); + _7 = copy _4 as *mut T (PtrToPtr); + _8 = Offset(copy _7, copy _3); StorageDead(_7); _9 = move _8 as *const T (PtrToPtr); StorageDead(_8); @@ -85,24 +85,24 @@ fn enumerated_loop(_1: &[T], _2: impl Fn(usize, &T)) -> () { } bb2: { - _9 = _3 as *const T (Transmute); + _9 = copy _3 as *const T (Transmute); goto -> bb3; } bb3: { StorageLive(_10); - _10 = _9; - _11 = std::slice::Iter::<'_, T> { ptr: _6, end_or_len: move _10, _marker: const ZeroSized: PhantomData<&T> }; + _10 = copy _9; + _11 = std::slice::Iter::<'_, T> { ptr: copy _6, end_or_len: move _10, _marker: const ZeroSized: PhantomData<&T> }; StorageDead(_10); StorageDead(_9); StorageDead(_5); StorageDead(_4); StorageDead(_6); StorageDead(_3); - _12 = Enumerate::<std::slice::Iter<'_, T>> { iter: _11, count: const 0_usize }; + _12 = Enumerate::<std::slice::Iter<'_, T>> { iter: copy _11, count: const 0_usize }; StorageDead(_11); StorageLive(_13); - _13 = _12; + _13 = copy _12; goto -> bb4; } @@ -128,12 +128,12 @@ fn enumerated_loop(_1: &[T], _2: impl Fn(usize, &T)) -> () { } bb8: { - _17 = (((_15 as Some).0: (usize, &T)).0: usize); - _18 = (((_15 as Some).0: (usize, &T)).1: &T); + _17 = copy (((_15 as Some).0: (usize, &T)).0: usize); + _18 = copy (((_15 as Some).0: (usize, &T)).1: &T); StorageLive(_19); _19 = &_2; StorageLive(_20); - _20 = (_17, _18); + _20 = (copy _17, copy _18); _21 = <impl Fn(usize, &T) as Fn<(usize, &T)>>::call(move _19, move _20) -> [return: bb9, unwind: bb11]; } diff --git a/tests/mir-opt/pre-codegen/slice_iter.forward_loop.PreCodegen.after.panic-abort.mir b/tests/mir-opt/pre-codegen/slice_iter.forward_loop.PreCodegen.after.panic-abort.mir index 03de9fd938e..507afa63c68 100644 --- a/tests/mir-opt/pre-codegen/slice_iter.forward_loop.PreCodegen.after.panic-abort.mir +++ b/tests/mir-opt/pre-codegen/slice_iter.forward_loop.PreCodegen.after.panic-abort.mir @@ -57,10 +57,10 @@ fn forward_loop(_1: &[T], _2: impl Fn(&T)) -> () { StorageLive(_6); StorageLive(_4); StorageLive(_5); - _3 = PtrMetadata(_1); + _3 = PtrMetadata(copy _1); _4 = &raw const (*_1); - _5 = _4 as *const T (PtrToPtr); - _6 = NonNull::<T> { pointer: _5 }; + _5 = copy _4 as *const T (PtrToPtr); + _6 = NonNull::<T> { pointer: copy _5 }; StorageLive(_9); switchInt(const <T as std::mem::SizedTypeProperties>::IS_ZST) -> [0: bb1, otherwise: bb2]; } @@ -68,8 +68,8 @@ fn forward_loop(_1: &[T], _2: impl Fn(&T)) -> () { bb1: { StorageLive(_8); StorageLive(_7); - _7 = _4 as *mut T (PtrToPtr); - _8 = Offset(_7, _3); + _7 = copy _4 as *mut T (PtrToPtr); + _8 = Offset(copy _7, copy _3); StorageDead(_7); _9 = move _8 as *const T (PtrToPtr); StorageDead(_8); @@ -77,14 +77,14 @@ fn forward_loop(_1: &[T], _2: impl Fn(&T)) -> () { } bb2: { - _9 = _3 as *const T (Transmute); + _9 = copy _3 as *const T (Transmute); goto -> bb3; } bb3: { StorageLive(_10); - _10 = _9; - _11 = std::slice::Iter::<'_, T> { ptr: _6, end_or_len: move _10, _marker: const ZeroSized: PhantomData<&T> }; + _10 = copy _9; + _11 = std::slice::Iter::<'_, T> { ptr: copy _6, end_or_len: move _10, _marker: const ZeroSized: PhantomData<&T> }; StorageDead(_10); StorageDead(_9); StorageDead(_5); @@ -92,7 +92,7 @@ fn forward_loop(_1: &[T], _2: impl Fn(&T)) -> () { StorageDead(_6); StorageDead(_3); StorageLive(_12); - _12 = _11; + _12 = copy _11; goto -> bb4; } @@ -118,11 +118,11 @@ fn forward_loop(_1: &[T], _2: impl Fn(&T)) -> () { } bb8: { - _16 = ((_14 as Some).0: &T); + _16 = copy ((_14 as Some).0: &T); StorageLive(_17); _17 = &_2; StorageLive(_18); - _18 = (_16,); + _18 = (copy _16,); _19 = <impl Fn(&T) as Fn<(&T,)>>::call(move _17, move _18) -> [return: bb9, unwind unreachable]; } diff --git a/tests/mir-opt/pre-codegen/slice_iter.forward_loop.PreCodegen.after.panic-unwind.mir b/tests/mir-opt/pre-codegen/slice_iter.forward_loop.PreCodegen.after.panic-unwind.mir index c7c722274f2..a25f12edc28 100644 --- a/tests/mir-opt/pre-codegen/slice_iter.forward_loop.PreCodegen.after.panic-unwind.mir +++ b/tests/mir-opt/pre-codegen/slice_iter.forward_loop.PreCodegen.after.panic-unwind.mir @@ -57,10 +57,10 @@ fn forward_loop(_1: &[T], _2: impl Fn(&T)) -> () { StorageLive(_6); StorageLive(_4); StorageLive(_5); - _3 = PtrMetadata(_1); + _3 = PtrMetadata(copy _1); _4 = &raw const (*_1); - _5 = _4 as *const T (PtrToPtr); - _6 = NonNull::<T> { pointer: _5 }; + _5 = copy _4 as *const T (PtrToPtr); + _6 = NonNull::<T> { pointer: copy _5 }; StorageLive(_9); switchInt(const <T as std::mem::SizedTypeProperties>::IS_ZST) -> [0: bb1, otherwise: bb2]; } @@ -68,8 +68,8 @@ fn forward_loop(_1: &[T], _2: impl Fn(&T)) -> () { bb1: { StorageLive(_8); StorageLive(_7); - _7 = _4 as *mut T (PtrToPtr); - _8 = Offset(_7, _3); + _7 = copy _4 as *mut T (PtrToPtr); + _8 = Offset(copy _7, copy _3); StorageDead(_7); _9 = move _8 as *const T (PtrToPtr); StorageDead(_8); @@ -77,14 +77,14 @@ fn forward_loop(_1: &[T], _2: impl Fn(&T)) -> () { } bb2: { - _9 = _3 as *const T (Transmute); + _9 = copy _3 as *const T (Transmute); goto -> bb3; } bb3: { StorageLive(_10); - _10 = _9; - _11 = std::slice::Iter::<'_, T> { ptr: _6, end_or_len: move _10, _marker: const ZeroSized: PhantomData<&T> }; + _10 = copy _9; + _11 = std::slice::Iter::<'_, T> { ptr: copy _6, end_or_len: move _10, _marker: const ZeroSized: PhantomData<&T> }; StorageDead(_10); StorageDead(_9); StorageDead(_5); @@ -92,7 +92,7 @@ fn forward_loop(_1: &[T], _2: impl Fn(&T)) -> () { StorageDead(_6); StorageDead(_3); StorageLive(_12); - _12 = _11; + _12 = copy _11; goto -> bb4; } @@ -118,11 +118,11 @@ fn forward_loop(_1: &[T], _2: impl Fn(&T)) -> () { } bb8: { - _16 = ((_14 as Some).0: &T); + _16 = copy ((_14 as Some).0: &T); StorageLive(_17); _17 = &_2; StorageLive(_18); - _18 = (_16,); + _18 = (copy _16,); _19 = <impl Fn(&T) as Fn<(&T,)>>::call(move _17, move _18) -> [return: bb9, unwind: bb11]; } diff --git a/tests/mir-opt/pre-codegen/slice_iter.range_loop.PreCodegen.after.panic-abort.mir b/tests/mir-opt/pre-codegen/slice_iter.range_loop.PreCodegen.after.panic-abort.mir index cea2fcbcdc0..ecac03ad0f9 100644 --- a/tests/mir-opt/pre-codegen/slice_iter.range_loop.PreCodegen.after.panic-abort.mir +++ b/tests/mir-opt/pre-codegen/slice_iter.range_loop.PreCodegen.after.panic-abort.mir @@ -40,7 +40,7 @@ fn range_loop(_1: &[T], _2: impl Fn(usize, &T)) -> () { } bb0: { - _3 = PtrMetadata(_1); + _3 = PtrMetadata(copy _1); StorageLive(_4); _4 = const 0_usize; goto -> bb1; @@ -51,8 +51,8 @@ fn range_loop(_1: &[T], _2: impl Fn(usize, &T)) -> () { StorageLive(_7); StorageLive(_6); StorageLive(_5); - _5 = _4; - _6 = Lt(move _5, _3); + _5 = copy _4; + _6 = Lt(move _5, copy _3); StorageDead(_5); switchInt(move _6) -> [0: bb2, otherwise: bb4]; } @@ -70,21 +70,21 @@ fn range_loop(_1: &[T], _2: impl Fn(usize, &T)) -> () { } bb4: { - _7 = _4; + _7 = copy _4; StorageLive(_8); - _8 = <usize as Step>::forward_unchecked(_7, const 1_usize) -> [return: bb5, unwind unreachable]; + _8 = <usize as Step>::forward_unchecked(copy _7, const 1_usize) -> [return: bb5, unwind unreachable]; } bb5: { _4 = move _8; StorageDead(_8); - _9 = Option::<usize>::Some(_7); + _9 = Option::<usize>::Some(copy _7); StorageDead(_6); StorageDead(_7); - _10 = ((_9 as Some).0: usize); + _10 = copy ((_9 as Some).0: usize); _11 = Len((*_1)); - _12 = Lt(_10, _11); - assert(move _12, "index out of bounds: the length is {} but the index is {}", move _11, _10) -> [success: bb6, unwind unreachable]; + _12 = Lt(copy _10, copy _11); + assert(move _12, "index out of bounds: the length is {} but the index is {}", move _11, copy _10) -> [success: bb6, unwind unreachable]; } bb6: { @@ -92,7 +92,7 @@ fn range_loop(_1: &[T], _2: impl Fn(usize, &T)) -> () { StorageLive(_14); _14 = &_2; StorageLive(_15); - _15 = (_10, _13); + _15 = (copy _10, copy _13); _16 = <impl Fn(usize, &T) as Fn<(usize, &T)>>::call(move _14, move _15) -> [return: bb7, unwind unreachable]; } diff --git a/tests/mir-opt/pre-codegen/slice_iter.range_loop.PreCodegen.after.panic-unwind.mir b/tests/mir-opt/pre-codegen/slice_iter.range_loop.PreCodegen.after.panic-unwind.mir index bd658a770ea..1032473b9b2 100644 --- a/tests/mir-opt/pre-codegen/slice_iter.range_loop.PreCodegen.after.panic-unwind.mir +++ b/tests/mir-opt/pre-codegen/slice_iter.range_loop.PreCodegen.after.panic-unwind.mir @@ -40,7 +40,7 @@ fn range_loop(_1: &[T], _2: impl Fn(usize, &T)) -> () { } bb0: { - _3 = PtrMetadata(_1); + _3 = PtrMetadata(copy _1); StorageLive(_4); _4 = const 0_usize; goto -> bb1; @@ -51,8 +51,8 @@ fn range_loop(_1: &[T], _2: impl Fn(usize, &T)) -> () { StorageLive(_7); StorageLive(_6); StorageLive(_5); - _5 = _4; - _6 = Lt(move _5, _3); + _5 = copy _4; + _6 = Lt(move _5, copy _3); StorageDead(_5); switchInt(move _6) -> [0: bb2, otherwise: bb4]; } @@ -70,21 +70,21 @@ fn range_loop(_1: &[T], _2: impl Fn(usize, &T)) -> () { } bb4: { - _7 = _4; + _7 = copy _4; StorageLive(_8); - _8 = <usize as Step>::forward_unchecked(_7, const 1_usize) -> [return: bb5, unwind: bb8]; + _8 = <usize as Step>::forward_unchecked(copy _7, const 1_usize) -> [return: bb5, unwind: bb8]; } bb5: { _4 = move _8; StorageDead(_8); - _9 = Option::<usize>::Some(_7); + _9 = Option::<usize>::Some(copy _7); StorageDead(_6); StorageDead(_7); - _10 = ((_9 as Some).0: usize); + _10 = copy ((_9 as Some).0: usize); _11 = Len((*_1)); - _12 = Lt(_10, _11); - assert(move _12, "index out of bounds: the length is {} but the index is {}", move _11, _10) -> [success: bb6, unwind: bb8]; + _12 = Lt(copy _10, copy _11); + assert(move _12, "index out of bounds: the length is {} but the index is {}", move _11, copy _10) -> [success: bb6, unwind: bb8]; } bb6: { @@ -92,7 +92,7 @@ fn range_loop(_1: &[T], _2: impl Fn(usize, &T)) -> () { StorageLive(_14); _14 = &_2; StorageLive(_15); - _15 = (_10, _13); + _15 = (copy _10, copy _13); _16 = <impl Fn(usize, &T) as Fn<(usize, &T)>>::call(move _14, move _15) -> [return: bb7, unwind: bb8]; } diff --git a/tests/mir-opt/pre-codegen/slice_iter.reverse_loop.PreCodegen.after.panic-abort.mir b/tests/mir-opt/pre-codegen/slice_iter.reverse_loop.PreCodegen.after.panic-abort.mir index fbb887fe76a..1b397a4e4cd 100644 --- a/tests/mir-opt/pre-codegen/slice_iter.reverse_loop.PreCodegen.after.panic-abort.mir +++ b/tests/mir-opt/pre-codegen/slice_iter.reverse_loop.PreCodegen.after.panic-abort.mir @@ -65,10 +65,10 @@ fn reverse_loop(_1: &[T], _2: impl Fn(&T)) -> () { StorageLive(_6); StorageLive(_4); StorageLive(_5); - _3 = PtrMetadata(_1); + _3 = PtrMetadata(copy _1); _4 = &raw const (*_1); - _5 = _4 as *const T (PtrToPtr); - _6 = NonNull::<T> { pointer: _5 }; + _5 = copy _4 as *const T (PtrToPtr); + _6 = NonNull::<T> { pointer: copy _5 }; StorageLive(_9); switchInt(const <T as std::mem::SizedTypeProperties>::IS_ZST) -> [0: bb1, otherwise: bb2]; } @@ -76,8 +76,8 @@ fn reverse_loop(_1: &[T], _2: impl Fn(&T)) -> () { bb1: { StorageLive(_8); StorageLive(_7); - _7 = _4 as *mut T (PtrToPtr); - _8 = Offset(_7, _3); + _7 = copy _4 as *mut T (PtrToPtr); + _8 = Offset(copy _7, copy _3); StorageDead(_7); _9 = move _8 as *const T (PtrToPtr); StorageDead(_8); @@ -85,24 +85,24 @@ fn reverse_loop(_1: &[T], _2: impl Fn(&T)) -> () { } bb2: { - _9 = _3 as *const T (Transmute); + _9 = copy _3 as *const T (Transmute); goto -> bb3; } bb3: { StorageLive(_10); - _10 = _9; - _11 = std::slice::Iter::<'_, T> { ptr: _6, end_or_len: move _10, _marker: const ZeroSized: PhantomData<&T> }; + _10 = copy _9; + _11 = std::slice::Iter::<'_, T> { ptr: copy _6, end_or_len: move _10, _marker: const ZeroSized: PhantomData<&T> }; StorageDead(_10); StorageDead(_9); StorageDead(_5); StorageDead(_4); StorageDead(_6); StorageDead(_3); - _12 = Rev::<std::slice::Iter<'_, T>> { iter: _11 }; + _12 = Rev::<std::slice::Iter<'_, T>> { iter: copy _11 }; StorageDead(_11); StorageLive(_13); - _13 = _12; + _13 = copy _12; goto -> bb4; } @@ -130,11 +130,11 @@ fn reverse_loop(_1: &[T], _2: impl Fn(&T)) -> () { } bb8: { - _17 = ((_15 as Some).0: &T); + _17 = copy ((_15 as Some).0: &T); StorageLive(_18); _18 = &_2; StorageLive(_19); - _19 = (_17,); + _19 = (copy _17,); _20 = <impl Fn(&T) as Fn<(&T,)>>::call(move _18, move _19) -> [return: bb9, unwind unreachable]; } diff --git a/tests/mir-opt/pre-codegen/slice_iter.reverse_loop.PreCodegen.after.panic-unwind.mir b/tests/mir-opt/pre-codegen/slice_iter.reverse_loop.PreCodegen.after.panic-unwind.mir index db9409f72ab..77689dd9b51 100644 --- a/tests/mir-opt/pre-codegen/slice_iter.reverse_loop.PreCodegen.after.panic-unwind.mir +++ b/tests/mir-opt/pre-codegen/slice_iter.reverse_loop.PreCodegen.after.panic-unwind.mir @@ -65,10 +65,10 @@ fn reverse_loop(_1: &[T], _2: impl Fn(&T)) -> () { StorageLive(_6); StorageLive(_4); StorageLive(_5); - _3 = PtrMetadata(_1); + _3 = PtrMetadata(copy _1); _4 = &raw const (*_1); - _5 = _4 as *const T (PtrToPtr); - _6 = NonNull::<T> { pointer: _5 }; + _5 = copy _4 as *const T (PtrToPtr); + _6 = NonNull::<T> { pointer: copy _5 }; StorageLive(_9); switchInt(const <T as std::mem::SizedTypeProperties>::IS_ZST) -> [0: bb1, otherwise: bb2]; } @@ -76,8 +76,8 @@ fn reverse_loop(_1: &[T], _2: impl Fn(&T)) -> () { bb1: { StorageLive(_8); StorageLive(_7); - _7 = _4 as *mut T (PtrToPtr); - _8 = Offset(_7, _3); + _7 = copy _4 as *mut T (PtrToPtr); + _8 = Offset(copy _7, copy _3); StorageDead(_7); _9 = move _8 as *const T (PtrToPtr); StorageDead(_8); @@ -85,24 +85,24 @@ fn reverse_loop(_1: &[T], _2: impl Fn(&T)) -> () { } bb2: { - _9 = _3 as *const T (Transmute); + _9 = copy _3 as *const T (Transmute); goto -> bb3; } bb3: { StorageLive(_10); - _10 = _9; - _11 = std::slice::Iter::<'_, T> { ptr: _6, end_or_len: move _10, _marker: const ZeroSized: PhantomData<&T> }; + _10 = copy _9; + _11 = std::slice::Iter::<'_, T> { ptr: copy _6, end_or_len: move _10, _marker: const ZeroSized: PhantomData<&T> }; StorageDead(_10); StorageDead(_9); StorageDead(_5); StorageDead(_4); StorageDead(_6); StorageDead(_3); - _12 = Rev::<std::slice::Iter<'_, T>> { iter: _11 }; + _12 = Rev::<std::slice::Iter<'_, T>> { iter: copy _11 }; StorageDead(_11); StorageLive(_13); - _13 = _12; + _13 = copy _12; goto -> bb4; } @@ -130,11 +130,11 @@ fn reverse_loop(_1: &[T], _2: impl Fn(&T)) -> () { } bb8: { - _17 = ((_15 as Some).0: &T); + _17 = copy ((_15 as Some).0: &T); StorageLive(_18); _18 = &_2; StorageLive(_19); - _19 = (_17,); + _19 = (copy _17,); _20 = <impl Fn(&T) as Fn<(&T,)>>::call(move _18, move _19) -> [return: bb9, unwind: bb11]; } diff --git a/tests/mir-opt/pre-codegen/slice_iter.slice_iter_generic_is_empty.PreCodegen.after.panic-abort.mir b/tests/mir-opt/pre-codegen/slice_iter.slice_iter_generic_is_empty.PreCodegen.after.panic-abort.mir index 96e71c298e0..f8b0e749bfc 100644 --- a/tests/mir-opt/pre-codegen/slice_iter.slice_iter_generic_is_empty.PreCodegen.after.panic-abort.mir +++ b/tests/mir-opt/pre-codegen/slice_iter.slice_iter_generic_is_empty.PreCodegen.after.panic-abort.mir @@ -43,27 +43,27 @@ fn slice_iter_generic_is_empty(_1: &std::slice::Iter<'_, T>) -> bool { StorageLive(_3); StorageLive(_2); _2 = &raw const ((*_1).1: *const T); - _3 = _2 as *const std::ptr::NonNull<T> (PtrToPtr); + _3 = copy _2 as *const std::ptr::NonNull<T> (PtrToPtr); StorageDead(_2); - _4 = (*_3); + _4 = copy (*_3); StorageDead(_3); StorageLive(_6); StorageLive(_7); StorageLive(_5); - _5 = ((*_1).0: std::ptr::NonNull<T>); - _6 = (_5.0: *const T); + _5 = copy ((*_1).0: std::ptr::NonNull<T>); + _6 = copy (_5.0: *const T); StorageDead(_5); - _7 = (_4.0: *const T); - _0 = Eq(_6, _7); + _7 = copy (_4.0: *const T); + _0 = Eq(copy _6, copy _7); StorageDead(_7); StorageDead(_6); goto -> bb3; } bb2: { - _8 = ((*_1).1: *const T); - _9 = _8 as usize (Transmute); - _0 = Eq(_9, const 0_usize); + _8 = copy ((*_1).1: *const T); + _9 = copy _8 as usize (Transmute); + _0 = Eq(copy _9, const 0_usize); goto -> bb3; } diff --git a/tests/mir-opt/pre-codegen/slice_iter.slice_iter_generic_is_empty.PreCodegen.after.panic-unwind.mir b/tests/mir-opt/pre-codegen/slice_iter.slice_iter_generic_is_empty.PreCodegen.after.panic-unwind.mir index 96e71c298e0..f8b0e749bfc 100644 --- a/tests/mir-opt/pre-codegen/slice_iter.slice_iter_generic_is_empty.PreCodegen.after.panic-unwind.mir +++ b/tests/mir-opt/pre-codegen/slice_iter.slice_iter_generic_is_empty.PreCodegen.after.panic-unwind.mir @@ -43,27 +43,27 @@ fn slice_iter_generic_is_empty(_1: &std::slice::Iter<'_, T>) -> bool { StorageLive(_3); StorageLive(_2); _2 = &raw const ((*_1).1: *const T); - _3 = _2 as *const std::ptr::NonNull<T> (PtrToPtr); + _3 = copy _2 as *const std::ptr::NonNull<T> (PtrToPtr); StorageDead(_2); - _4 = (*_3); + _4 = copy (*_3); StorageDead(_3); StorageLive(_6); StorageLive(_7); StorageLive(_5); - _5 = ((*_1).0: std::ptr::NonNull<T>); - _6 = (_5.0: *const T); + _5 = copy ((*_1).0: std::ptr::NonNull<T>); + _6 = copy (_5.0: *const T); StorageDead(_5); - _7 = (_4.0: *const T); - _0 = Eq(_6, _7); + _7 = copy (_4.0: *const T); + _0 = Eq(copy _6, copy _7); StorageDead(_7); StorageDead(_6); goto -> bb3; } bb2: { - _8 = ((*_1).1: *const T); - _9 = _8 as usize (Transmute); - _0 = Eq(_9, const 0_usize); + _8 = copy ((*_1).1: *const T); + _9 = copy _8 as usize (Transmute); + _0 = Eq(copy _9, const 0_usize); goto -> bb3; } diff --git a/tests/mir-opt/pre-codegen/spans.outer.PreCodegen.after.panic-abort.mir b/tests/mir-opt/pre-codegen/spans.outer.PreCodegen.after.panic-abort.mir index c76e5315db9..fe4e2deab87 100644 --- a/tests/mir-opt/pre-codegen/spans.outer.PreCodegen.after.panic-abort.mir +++ b/tests/mir-opt/pre-codegen/spans.outer.PreCodegen.after.panic-abort.mir @@ -10,7 +10,7 @@ fn outer(_1: u8) -> u8 { bb0: { _2 = &_1; // scope 0 at $DIR/spans.rs:11:11: 11:13 - _0 = _1; // scope 1 at $DIR/spans.rs:15:5: 15:7 + _0 = copy _1; // scope 1 at $DIR/spans.rs:15:5: 15:7 return; // scope 0 at $DIR/spans.rs:12:2: 12:2 } } diff --git a/tests/mir-opt/pre-codegen/spans.outer.PreCodegen.after.panic-unwind.mir b/tests/mir-opt/pre-codegen/spans.outer.PreCodegen.after.panic-unwind.mir index c76e5315db9..fe4e2deab87 100644 --- a/tests/mir-opt/pre-codegen/spans.outer.PreCodegen.after.panic-unwind.mir +++ b/tests/mir-opt/pre-codegen/spans.outer.PreCodegen.after.panic-unwind.mir @@ -10,7 +10,7 @@ fn outer(_1: u8) -> u8 { bb0: { _2 = &_1; // scope 0 at $DIR/spans.rs:11:11: 11:13 - _0 = _1; // scope 1 at $DIR/spans.rs:15:5: 15:7 + _0 = copy _1; // scope 1 at $DIR/spans.rs:15:5: 15:7 return; // scope 0 at $DIR/spans.rs:12:2: 12:2 } } diff --git a/tests/mir-opt/pre-codegen/try_identity.new.PreCodegen.after.mir b/tests/mir-opt/pre-codegen/try_identity.new.PreCodegen.after.mir index 16d6d9719b6..baa01e28a94 100644 --- a/tests/mir-opt/pre-codegen/try_identity.new.PreCodegen.after.mir +++ b/tests/mir-opt/pre-codegen/try_identity.new.PreCodegen.after.mir @@ -30,18 +30,18 @@ fn new(_1: Result<T, E>) -> Result<T, E> { bb1: { _3 = move ((_1 as Ok).0: T); - _4 = ControlFlow::<E, T>::Continue(_3); + _4 = ControlFlow::<E, T>::Continue(copy _3); _5 = move ((_4 as Continue).0: T); - _0 = Result::<T, E>::Ok(_5); + _0 = Result::<T, E>::Ok(copy _5); StorageDead(_4); goto -> bb3; } bb2: { _6 = move ((_1 as Err).0: E); - _4 = ControlFlow::<E, T>::Break(_6); + _4 = ControlFlow::<E, T>::Break(copy _6); _7 = move ((_4 as Break).0: E); - _0 = Result::<T, E>::Err(_7); + _0 = Result::<T, E>::Err(copy _7); StorageDead(_4); goto -> bb3; } diff --git a/tests/mir-opt/pre-codegen/try_identity.old.PreCodegen.after.mir b/tests/mir-opt/pre-codegen/try_identity.old.PreCodegen.after.mir index d6883ac9fda..ac485f485b1 100644 --- a/tests/mir-opt/pre-codegen/try_identity.old.PreCodegen.after.mir +++ b/tests/mir-opt/pre-codegen/try_identity.old.PreCodegen.after.mir @@ -20,13 +20,13 @@ fn old(_1: Result<T, E>) -> Result<T, E> { bb1: { _3 = move ((_1 as Ok).0: T); - _0 = Result::<T, E>::Ok(_3); + _0 = Result::<T, E>::Ok(copy _3); goto -> bb3; } bb2: { _4 = move ((_1 as Err).0: E); - _0 = Result::<T, E>::Err(_4); + _0 = Result::<T, E>::Err(copy _4); goto -> bb3; } diff --git a/tests/mir-opt/pre-codegen/vec_deref.vec_deref_to_slice.PreCodegen.after.panic-abort.mir b/tests/mir-opt/pre-codegen/vec_deref.vec_deref_to_slice.PreCodegen.after.panic-abort.mir index 0fe4fd37072..ce1e4a0abd6 100644 --- a/tests/mir-opt/pre-codegen/vec_deref.vec_deref_to_slice.PreCodegen.after.panic-abort.mir +++ b/tests/mir-opt/pre-codegen/vec_deref.vec_deref_to_slice.PreCodegen.after.panic-abort.mir @@ -78,17 +78,17 @@ fn vec_deref_to_slice(_1: &Vec<u8>) -> &[u8] { _3 = &(((*_1).0: alloc::raw_vec::RawVec<u8>).0: alloc::raw_vec::RawVecInner); StorageLive(_6); StorageLive(_4); - _4 = (((((*_1).0: alloc::raw_vec::RawVec<u8>).0: alloc::raw_vec::RawVecInner).0: std::ptr::Unique<u8>).0: std::ptr::NonNull<u8>); - _5 = (_4.0: *const u8); - _6 = NonNull::<u8> { pointer: _5 }; + _4 = copy (((((*_1).0: alloc::raw_vec::RawVec<u8>).0: alloc::raw_vec::RawVecInner).0: std::ptr::Unique<u8>).0: std::ptr::NonNull<u8>); + _5 = copy (_4.0: *const u8); + _6 = NonNull::<u8> { pointer: copy _5 }; StorageDead(_4); StorageDead(_6); StorageDead(_3); StorageDead(_2); StorageLive(_7); - _7 = ((*_1).1: usize); + _7 = copy ((*_1).1: usize); StorageLive(_8); - _8 = *const [u8] from (_5, _7); + _8 = *const [u8] from (copy _5, copy _7); _0 = &(*_8); StorageDead(_8); StorageDead(_7); diff --git a/tests/mir-opt/pre-codegen/vec_deref.vec_deref_to_slice.PreCodegen.after.panic-unwind.mir b/tests/mir-opt/pre-codegen/vec_deref.vec_deref_to_slice.PreCodegen.after.panic-unwind.mir index 0fe4fd37072..ce1e4a0abd6 100644 --- a/tests/mir-opt/pre-codegen/vec_deref.vec_deref_to_slice.PreCodegen.after.panic-unwind.mir +++ b/tests/mir-opt/pre-codegen/vec_deref.vec_deref_to_slice.PreCodegen.after.panic-unwind.mir @@ -78,17 +78,17 @@ fn vec_deref_to_slice(_1: &Vec<u8>) -> &[u8] { _3 = &(((*_1).0: alloc::raw_vec::RawVec<u8>).0: alloc::raw_vec::RawVecInner); StorageLive(_6); StorageLive(_4); - _4 = (((((*_1).0: alloc::raw_vec::RawVec<u8>).0: alloc::raw_vec::RawVecInner).0: std::ptr::Unique<u8>).0: std::ptr::NonNull<u8>); - _5 = (_4.0: *const u8); - _6 = NonNull::<u8> { pointer: _5 }; + _4 = copy (((((*_1).0: alloc::raw_vec::RawVec<u8>).0: alloc::raw_vec::RawVecInner).0: std::ptr::Unique<u8>).0: std::ptr::NonNull<u8>); + _5 = copy (_4.0: *const u8); + _6 = NonNull::<u8> { pointer: copy _5 }; StorageDead(_4); StorageDead(_6); StorageDead(_3); StorageDead(_2); StorageLive(_7); - _7 = ((*_1).1: usize); + _7 = copy ((*_1).1: usize); StorageLive(_8); - _8 = *const [u8] from (_5, _7); + _8 = *const [u8] from (copy _5, copy _7); _0 = &(*_8); StorageDead(_8); StorageDead(_7); diff --git a/tests/mir-opt/reference_prop.dominate_storage.ReferencePropagation.diff b/tests/mir-opt/reference_prop.dominate_storage.ReferencePropagation.diff index 012efa9693e..4715f5110eb 100644 --- a/tests/mir-opt/reference_prop.dominate_storage.ReferencePropagation.diff +++ b/tests/mir-opt/reference_prop.dominate_storage.ReferencePropagation.diff @@ -21,15 +21,15 @@ } bb2: { - _5 = (*_2); - _0 = opaque::<i32>(_5) -> [return: bb3, unwind continue]; + _5 = copy (*_2); + _0 = opaque::<i32>(copy _5) -> [return: bb3, unwind continue]; } bb3: { StorageDead(_1); StorageLive(_1); _6 = const true; - switchInt(_6) -> [0: bb3, otherwise: bb1]; + switchInt(copy _6) -> [0: bb3, otherwise: bb1]; } } diff --git a/tests/mir-opt/reference_prop.maybe_dead.ReferencePropagation.diff b/tests/mir-opt/reference_prop.maybe_dead.ReferencePropagation.diff index c6bd6c21210..b1de380d84d 100644 --- a/tests/mir-opt/reference_prop.maybe_dead.ReferencePropagation.diff +++ b/tests/mir-opt/reference_prop.maybe_dead.ReferencePropagation.diff @@ -19,25 +19,25 @@ _4 = &_2; _5 = &mut _3; (*_5) = const 7_i32; -- _6 = (*_4); -+ _6 = _2; - switchInt(_1) -> [1: bb1, otherwise: bb2]; +- _6 = copy (*_4); ++ _6 = copy _2; + switchInt(copy _1) -> [1: bb1, otherwise: bb2]; } bb1: { StorageDead(_2); StorageDead(_3); - _0 = opaque::<i32>(_6) -> [return: bb2, unwind continue]; + _0 = opaque::<i32>(copy _6) -> [return: bb2, unwind continue]; } bb2: { - _7 = (*_4); - _0 = opaque::<i32>(_7) -> [return: bb3, unwind continue]; + _7 = copy (*_4); + _0 = opaque::<i32>(copy _7) -> [return: bb3, unwind continue]; } bb3: { - _8 = (*_5); - _0 = opaque::<i32>(_8) -> [return: bb4, unwind continue]; + _8 = copy (*_5); + _0 = opaque::<i32>(copy _8) -> [return: bb4, unwind continue]; } bb4: { diff --git a/tests/mir-opt/reference_prop.multiple_storage.ReferencePropagation.diff b/tests/mir-opt/reference_prop.multiple_storage.ReferencePropagation.diff index 0fd74155aa3..2368edea5ba 100644 --- a/tests/mir-opt/reference_prop.multiple_storage.ReferencePropagation.diff +++ b/tests/mir-opt/reference_prop.multiple_storage.ReferencePropagation.diff @@ -13,8 +13,8 @@ _2 = &_1; StorageDead(_1); StorageLive(_1); - _3 = (*_2); - _0 = opaque::<i32>(_3) -> [return: bb1, unwind continue]; + _3 = copy (*_2); + _0 = opaque::<i32>(copy _3) -> [return: bb1, unwind continue]; } bb1: { diff --git a/tests/mir-opt/reference_prop.mut_raw_then_mut_shr.ReferencePropagation.diff b/tests/mir-opt/reference_prop.mut_raw_then_mut_shr.ReferencePropagation.diff index 859097d3966..90fd91764cb 100644 --- a/tests/mir-opt/reference_prop.mut_raw_then_mut_shr.ReferencePropagation.diff +++ b/tests/mir-opt/reference_prop.mut_raw_then_mut_shr.ReferencePropagation.diff @@ -41,23 +41,23 @@ - StorageLive(_5); - _5 = &mut (*_2); - _4 = &raw mut (*_5); -- _3 = _4; +- _3 = copy _4; - StorageDead(_5); - StorageDead(_4); - StorageLive(_6); - _6 = &(*_2); StorageLive(_7); -- _7 = (*_6); +- _7 = copy (*_6); - StorageLive(_8); - (*_3) = const 4_i32; - _8 = const (); - StorageDead(_8); -+ _7 = _1; ++ _7 = copy _1; + _1 = const 4_i32; StorageLive(_9); - _9 = _7; + _9 = copy _7; StorageLive(_10); - _10 = _1; + _10 = copy _1; _0 = (move _9, move _10); StorageDead(_10); StorageDead(_9); diff --git a/tests/mir-opt/reference_prop.read_through_raw.ReferencePropagation.diff b/tests/mir-opt/reference_prop.read_through_raw.ReferencePropagation.diff index 371b0e468b1..064711925e0 100644 --- a/tests/mir-opt/reference_prop.read_through_raw.ReferencePropagation.diff +++ b/tests/mir-opt/reference_prop.read_through_raw.ReferencePropagation.diff @@ -13,10 +13,10 @@ - _3 = &mut (*_2); - _4 = &raw mut (*_2); - _5 = &raw mut (*_3); -- _0 = (*_4); -- _0 = (*_5); -+ _0 = (*_1); -+ _0 = (*_1); +- _0 = copy (*_4); +- _0 = copy (*_5); ++ _0 = copy (*_1); ++ _0 = copy (*_1); return; } } diff --git a/tests/mir-opt/reference_prop.reference_propagation.ReferencePropagation.diff b/tests/mir-opt/reference_prop.reference_propagation.ReferencePropagation.diff index 0dfe8781c18..3c6a9a9614c 100644 --- a/tests/mir-opt/reference_prop.reference_propagation.ReferencePropagation.diff +++ b/tests/mir-opt/reference_prop.reference_propagation.ReferencePropagation.diff @@ -191,8 +191,8 @@ StorageLive(_5); _5 = &_4; StorageLive(_6); -- _6 = (*_5); -+ _6 = _4; +- _6 = copy (*_5); ++ _6 = copy _4; StorageLive(_7); StorageLive(_8); _8 = (); @@ -223,7 +223,7 @@ StorageDead(_13); - StorageDead(_14); StorageLive(_15); - _15 = (*_12); + _15 = copy (*_12); StorageLive(_16); StorageLive(_17); _17 = (); @@ -247,11 +247,11 @@ StorageLive(_21); _21 = &_20; StorageLive(_22); -- _22 = (*_20); -+ _22 = _19; +- _22 = copy (*_20); ++ _22 = copy _19; StorageLive(_23); StorageLive(_24); - _24 = _21; + _24 = copy _21; _23 = opaque::<&&usize>(move _24) -> [return: bb3, unwind continue]; } @@ -272,10 +272,10 @@ StorageLive(_28); _28 = &raw mut _27; StorageLive(_29); - _29 = (*_27); + _29 = copy (*_27); StorageLive(_30); StorageLive(_31); - _31 = _28; + _31 = copy _28; _30 = opaque::<*mut &usize>(move _31) -> [return: bb4, unwind continue]; } @@ -294,11 +294,11 @@ StorageLive(_34); _34 = &_33; StorageLive(_35); -- _35 = (*_34); -+ _35 = _33; +- _35 = copy (*_34); ++ _35 = copy _33; StorageLive(_36); StorageLive(_37); - _37 = _34; + _37 = copy _34; _36 = opaque::<&usize>(move _37) -> [return: bb5, unwind continue]; } @@ -316,18 +316,18 @@ StorageLive(_40); _40 = &_39; StorageLive(_41); -- _41 = (*_40); -+ _41 = _39; +- _41 = copy (*_40); ++ _41 = copy _39; StorageLive(_42); - _42 = _40; + _42 = copy _40; StorageLive(_43); -- _43 = (*_42); -+ _43 = _39; +- _43 = copy (*_42); ++ _43 = copy _39; StorageLive(_44); - _44 = _42; + _44 = copy _42; StorageLive(_45); StorageLive(_46); - _46 = _44; + _46 = copy _44; _45 = opaque::<&usize>(move _46) -> [return: bb6, unwind continue]; } @@ -346,8 +346,8 @@ - StorageLive(_48); - _48 = &(*_1); StorageLive(_49); -- _49 = (*_48); -+ _49 = (*_1); +- _49 = copy (*_48); ++ _49 = copy (*_1); StorageLive(_50); StorageLive(_51); _51 = (); @@ -373,7 +373,7 @@ StorageDead(_54); - StorageDead(_55); StorageLive(_56); - _56 = (*_53); + _56 = copy (*_53); StorageLive(_57); StorageLive(_58); _58 = (); @@ -395,8 +395,8 @@ StorageLive(_62); _62 = &_61; StorageLive(_63); -- _63 = (*_61); -+ _63 = _60; +- _63 = copy (*_61); ++ _63 = copy _60; StorageLive(_64); StorageLive(_65); _65 = (); @@ -419,7 +419,7 @@ StorageLive(_68); _68 = &mut _67; StorageLive(_69); - _69 = (*_67); + _69 = copy (*_67); StorageLive(_70); StorageLive(_71); _71 = (); diff --git a/tests/mir-opt/reference_prop.reference_propagation_const_ptr.ReferencePropagation.diff b/tests/mir-opt/reference_prop.reference_propagation_const_ptr.ReferencePropagation.diff index 21486a8616a..75fe99de938 100644 --- a/tests/mir-opt/reference_prop.reference_propagation_const_ptr.ReferencePropagation.diff +++ b/tests/mir-opt/reference_prop.reference_propagation_const_ptr.ReferencePropagation.diff @@ -208,8 +208,8 @@ StorageLive(_5); _5 = &raw const _4; StorageLive(_6); -- _6 = (*_5); -+ _6 = _4; +- _6 = copy (*_5); ++ _6 = copy _4; StorageLive(_7); StorageLive(_8); _8 = (); @@ -236,7 +236,7 @@ _12 = move _13; StorageDead(_13); StorageLive(_14); - _14 = (*_12); + _14 = copy (*_12); StorageLive(_15); StorageLive(_16); _16 = (); @@ -260,11 +260,11 @@ StorageLive(_20); _20 = &_19; StorageLive(_21); -- _21 = (*_19); -+ _21 = _18; +- _21 = copy (*_19); ++ _21 = copy _18; StorageLive(_22); StorageLive(_23); - _23 = _20; + _23 = copy _20; _22 = opaque::<&*const usize>(move _23) -> [return: bb3, unwind continue]; } @@ -285,10 +285,10 @@ StorageLive(_27); _27 = &raw mut _26; StorageLive(_28); - _28 = (*_26); + _28 = copy (*_26); StorageLive(_29); StorageLive(_30); - _30 = _27; + _30 = copy _27; _29 = opaque::<*mut *const usize>(move _30) -> [return: bb4, unwind continue]; } @@ -307,11 +307,11 @@ StorageLive(_33); _33 = &raw const _32; StorageLive(_34); -- _34 = (*_33); -+ _34 = _32; +- _34 = copy (*_33); ++ _34 = copy _32; StorageLive(_35); StorageLive(_36); - _36 = _33; + _36 = copy _33; _35 = opaque::<*const usize>(move _36) -> [return: bb5, unwind continue]; } @@ -329,18 +329,18 @@ StorageLive(_39); _39 = &raw const _38; StorageLive(_40); -- _40 = (*_39); -+ _40 = _38; +- _40 = copy (*_39); ++ _40 = copy _38; StorageLive(_41); - _41 = _39; + _41 = copy _39; StorageLive(_42); -- _42 = (*_41); -+ _42 = _38; +- _42 = copy (*_41); ++ _42 = copy _38; StorageLive(_43); - _43 = _41; + _43 = copy _41; StorageLive(_44); StorageLive(_45); - _45 = _43; + _45 = copy _43; _44 = opaque::<*const usize>(move _45) -> [return: bb6, unwind continue]; } @@ -359,8 +359,8 @@ - StorageLive(_47); - _47 = &raw const (*_1); StorageLive(_48); -- _48 = (*_47); -+ _48 = (*_1); +- _48 = copy (*_47); ++ _48 = copy (*_1); StorageLive(_49); StorageLive(_50); _50 = (); @@ -382,7 +382,7 @@ _2 = move _53; StorageDead(_53); StorageLive(_54); - _54 = (*_52); + _54 = copy (*_52); StorageLive(_55); StorageLive(_56); _56 = (); @@ -405,8 +405,8 @@ - _60 = &raw const (*_59); + _60 = &raw const _58; StorageLive(_61); -- _61 = (*_60); -+ _61 = _58; +- _61 = copy (*_60); ++ _61 = copy _58; StorageLive(_62); StorageLive(_63); _63 = (); @@ -430,8 +430,8 @@ StorageLive(_67); _67 = &_66; StorageLive(_68); -- _68 = (*_66); -+ _68 = _65; +- _68 = copy (*_66); ++ _68 = copy _65; StorageLive(_69); StorageLive(_70); _70 = (); @@ -454,7 +454,7 @@ StorageLive(_73); _73 = &mut _72; StorageLive(_74); - _74 = (*_72); + _74 = copy (*_72); StorageLive(_75); StorageLive(_76); _76 = (); diff --git a/tests/mir-opt/reference_prop.reference_propagation_mut.ReferencePropagation.diff b/tests/mir-opt/reference_prop.reference_propagation_mut.ReferencePropagation.diff index 7c7f424bba2..f35b4974d6e 100644 --- a/tests/mir-opt/reference_prop.reference_propagation_mut.ReferencePropagation.diff +++ b/tests/mir-opt/reference_prop.reference_propagation_mut.ReferencePropagation.diff @@ -191,8 +191,8 @@ StorageLive(_5); _5 = &mut _4; StorageLive(_6); -- _6 = (*_5); -+ _6 = _4; +- _6 = copy (*_5); ++ _6 = copy _4; StorageLive(_7); StorageLive(_8); _8 = (); @@ -223,7 +223,7 @@ StorageDead(_13); - StorageDead(_14); StorageLive(_15); - _15 = (*_12); + _15 = copy (*_12); StorageLive(_16); StorageLive(_17); _17 = (); @@ -247,10 +247,10 @@ StorageLive(_21); _21 = &_20; StorageLive(_22); - _22 = (*_20); + _22 = copy (*_20); StorageLive(_23); StorageLive(_24); - _24 = _21; + _24 = copy _21; _23 = opaque::<&&mut usize>(move _24) -> [return: bb3, unwind continue]; } @@ -271,10 +271,10 @@ StorageLive(_28); _28 = &raw mut _27; StorageLive(_29); - _29 = (*_27); + _29 = copy (*_27); StorageLive(_30); StorageLive(_31); - _31 = _28; + _31 = copy _28; _30 = opaque::<*mut &mut usize>(move _31) -> [return: bb4, unwind continue]; } @@ -293,7 +293,7 @@ StorageLive(_34); _34 = &mut _33; StorageLive(_35); - _35 = (*_34); + _35 = copy (*_34); StorageLive(_36); StorageLive(_37); _37 = move _34; @@ -314,11 +314,11 @@ StorageLive(_40); _40 = &mut _39; StorageLive(_41); - _41 = (*_40); + _41 = copy (*_40); StorageLive(_42); _42 = move _40; StorageLive(_43); - _43 = (*_42); + _43 = copy (*_42); StorageLive(_44); _44 = move _42; StorageLive(_45); @@ -342,8 +342,8 @@ - StorageLive(_48); - _48 = &mut (*_1); StorageLive(_49); -- _49 = (*_48); -+ _49 = (*_1); +- _49 = copy (*_48); ++ _49 = copy (*_1); StorageLive(_50); StorageLive(_51); _51 = (); @@ -369,7 +369,7 @@ StorageDead(_54); - StorageDead(_55); StorageLive(_56); - _56 = (*_53); + _56 = copy (*_53); StorageLive(_57); StorageLive(_58); _58 = (); @@ -391,7 +391,7 @@ StorageLive(_62); _62 = &_61; StorageLive(_63); - _63 = (*_61); + _63 = copy (*_61); StorageLive(_64); StorageLive(_65); _65 = (); @@ -414,7 +414,7 @@ StorageLive(_68); _68 = &mut _67; StorageLive(_69); - _69 = (*_67); + _69 = copy (*_67); StorageLive(_70); StorageLive(_71); _71 = (); diff --git a/tests/mir-opt/reference_prop.reference_propagation_mut_ptr.ReferencePropagation.diff b/tests/mir-opt/reference_prop.reference_propagation_mut_ptr.ReferencePropagation.diff index 5629d04f1b1..21b322b7218 100644 --- a/tests/mir-opt/reference_prop.reference_propagation_mut_ptr.ReferencePropagation.diff +++ b/tests/mir-opt/reference_prop.reference_propagation_mut_ptr.ReferencePropagation.diff @@ -189,8 +189,8 @@ StorageLive(_5); _5 = &raw mut _4; StorageLive(_6); -- _6 = (*_5); -+ _6 = _4; +- _6 = copy (*_5); ++ _6 = copy _4; StorageLive(_7); StorageLive(_8); _8 = (); @@ -217,7 +217,7 @@ _12 = move _13; StorageDead(_13); StorageLive(_14); - _14 = (*_12); + _14 = copy (*_12); StorageLive(_15); StorageLive(_16); _16 = (); @@ -241,10 +241,10 @@ StorageLive(_20); _20 = &_19; StorageLive(_21); - _21 = (*_19); + _21 = copy (*_19); StorageLive(_22); StorageLive(_23); - _23 = _20; + _23 = copy _20; _22 = opaque::<&*mut usize>(move _23) -> [return: bb3, unwind continue]; } @@ -265,10 +265,10 @@ StorageLive(_27); _27 = &raw mut _26; StorageLive(_28); - _28 = (*_26); + _28 = copy (*_26); StorageLive(_29); StorageLive(_30); - _30 = _27; + _30 = copy _27; _29 = opaque::<*mut *mut usize>(move _30) -> [return: bb4, unwind continue]; } @@ -287,10 +287,10 @@ StorageLive(_33); _33 = &raw mut _32; StorageLive(_34); - _34 = (*_33); + _34 = copy (*_33); StorageLive(_35); StorageLive(_36); - _36 = _33; + _36 = copy _33; _35 = opaque::<*mut usize>(move _36) -> [return: bb5, unwind continue]; } @@ -308,16 +308,16 @@ StorageLive(_39); _39 = &raw mut _38; StorageLive(_40); - _40 = (*_39); + _40 = copy (*_39); StorageLive(_41); - _41 = _39; + _41 = copy _39; StorageLive(_42); - _42 = (*_41); + _42 = copy (*_41); StorageLive(_43); - _43 = _41; + _43 = copy _41; StorageLive(_44); StorageLive(_45); - _45 = _43; + _45 = copy _43; _44 = opaque::<*mut usize>(move _45) -> [return: bb6, unwind continue]; } @@ -336,8 +336,8 @@ - StorageLive(_47); - _47 = &raw mut (*_1); StorageLive(_48); -- _48 = (*_47); -+ _48 = (*_1); +- _48 = copy (*_47); ++ _48 = copy (*_1); StorageLive(_49); StorageLive(_50); _50 = (); @@ -359,7 +359,7 @@ _2 = move _53; StorageDead(_53); StorageLive(_54); - _54 = (*_52); + _54 = copy (*_52); StorageLive(_55); StorageLive(_56); _56 = (); @@ -381,7 +381,7 @@ StorageLive(_60); _60 = &_59; StorageLive(_61); - _61 = (*_59); + _61 = copy (*_59); StorageLive(_62); StorageLive(_63); _63 = (); @@ -404,7 +404,7 @@ StorageLive(_66); _66 = &mut _65; StorageLive(_67); - _67 = (*_65); + _67 = copy (*_65); StorageLive(_68); StorageLive(_69); _69 = (); diff --git a/tests/mir-opt/reference_prop.rs b/tests/mir-opt/reference_prop.rs index 58d8b524ad6..00d48938071 100644 --- a/tests/mir-opt/reference_prop.rs +++ b/tests/mir-opt/reference_prop.rs @@ -2,7 +2,6 @@ //@ test-mir-pass: ReferencePropagation //@ needs-unwind -#![feature(raw_ref_op)] #![feature(core_intrinsics, custom_mir)] #[inline(never)] @@ -16,7 +15,7 @@ fn reference_propagation<'a, T: Copy>(single: &'a T, mut multiple: &'a T) { // CHECK: bb0: { // CHECK: [[a:_.*]] = const 5_usize; // CHECK: [[b:_.*]] = &[[a]]; - // CHECK: [[c:_.*]] = [[a]]; + // CHECK: [[c:_.*]] = copy [[a]]; let a = 5_usize; let b = &a; // This borrow is only used once. @@ -32,7 +31,7 @@ fn reference_propagation<'a, T: Copy>(single: &'a T, mut multiple: &'a T) { // CHECK: [[b:_.*]] = &[[a]]; // CHECK: [[btmp:_.*]] = &[[a2]]; // CHECK: [[b]] = move [[btmp]]; - // CHECK: [[c:_.*]] = (*[[b]]); + // CHECK: [[c:_.*]] = copy (*[[b]]); let a = 5_usize; let a2 = 7_usize; @@ -49,7 +48,7 @@ fn reference_propagation<'a, T: Copy>(single: &'a T, mut multiple: &'a T) { // CHECK: [[a:_.*]] = const 5_usize; // CHECK: [[b:_.*]] = &[[a]]; // CHECK: [[d:_.*]] = &[[b]]; - // CHECK: [[c:_.*]] = [[a]]; + // CHECK: [[c:_.*]] = copy [[a]]; let a = 5_usize; let b = &a; @@ -64,7 +63,7 @@ fn reference_propagation<'a, T: Copy>(single: &'a T, mut multiple: &'a T) { // CHECK: [[a:_.*]] = const 5_usize; // CHECK: [[b:_.*]] = &[[a]]; // CHECK: [[d:_.*]] = &raw mut [[b]]; - // CHECK: [[c:_.*]] = (*[[b]]); + // CHECK: [[c:_.*]] = copy (*[[b]]); let a = 5_usize; let mut b = &a; @@ -78,7 +77,7 @@ fn reference_propagation<'a, T: Copy>(single: &'a T, mut multiple: &'a T) { // CHECK: bb4: { // CHECK: [[a:_.*]] = const 7_usize; // CHECK: [[b:_.*]] = &[[a]]; - // CHECK: [[c:_.*]] = [[a]]; + // CHECK: [[c:_.*]] = copy [[a]]; let a = 7_usize; let b = &a; @@ -91,10 +90,10 @@ fn reference_propagation<'a, T: Copy>(single: &'a T, mut multiple: &'a T) { // CHECK: bb5: { // CHECK: [[a:_.*]] = const 7_usize; // CHECK: [[b1:_.*]] = &[[a]]; - // CHECK: [[c:_.*]] = [[a]]; - // CHECK: [[b2:_.*]] = [[b1]]; - // CHECK: [[c2:_.*]] = [[a]]; - // CHECK: [[b3:_.*]] = [[b2]]; + // CHECK: [[c:_.*]] = copy [[a]]; + // CHECK: [[b2:_.*]] = copy [[b1]]; + // CHECK: [[c2:_.*]] = copy [[a]]; + // CHECK: [[b3:_.*]] = copy [[b2]]; let a = 7_usize; let b1 = &a; @@ -111,7 +110,7 @@ fn reference_propagation<'a, T: Copy>(single: &'a T, mut multiple: &'a T) { { // CHECK: bb6: { // CHECK-NOT: {{_.*}} = &(*_1); - // CHECK: [[b:_.*]] = (*_1); + // CHECK: [[b:_.*]] = copy (*_1); let a = &*single; let b = *a; // This should be optimized as `*single`. @@ -124,7 +123,7 @@ fn reference_propagation<'a, T: Copy>(single: &'a T, mut multiple: &'a T) { // CHECK: [[a:_.*]] = &(*_2); // CHECK: [[tmp:_.*]] = &(*_1); // CHECK: _2 = move [[tmp]]; - // CHECK: [[b:_.*]] = (*[[a]]); + // CHECK: [[b:_.*]] = copy (*[[a]]); let a = &*multiple; multiple = &*single; @@ -138,7 +137,7 @@ fn reference_propagation<'a, T: Copy>(single: &'a T, mut multiple: &'a T) { // CHECK: [[a:_.*]] = const 5_usize; // CHECK: [[b:_.*]] = &[[a]]; // CHECK: [[d:_.*]] = &[[b]]; - // CHECK: [[c:_.*]] = [[a]]; + // CHECK: [[c:_.*]] = copy [[a]]; let a = 5_usize; let b = &a; @@ -154,7 +153,7 @@ fn reference_propagation<'a, T: Copy>(single: &'a T, mut multiple: &'a T) { // CHECK: [[b:_.*]] = &[[a]]; // CHECK: [[d:_.*]] = &mut [[b]]; // FIXME this could be [[a]] - // CHECK: [[c:_.*]] = (*[[b]]); + // CHECK: [[c:_.*]] = copy (*[[b]]); let a = 5_usize; let mut b = &a; @@ -172,7 +171,7 @@ fn reference_propagation_mut<'a, T: Copy>(single: &'a mut T, mut multiple: &'a m // CHECK: bb0: { // CHECK: [[a:_.*]] = const 5_usize; // CHECK: [[b:_.*]] = &mut [[a]]; - // CHECK: [[c:_.*]] = [[a]]; + // CHECK: [[c:_.*]] = copy [[a]]; let mut a = 5_usize; let b = &mut a; // This borrow is only used once. @@ -188,7 +187,7 @@ fn reference_propagation_mut<'a, T: Copy>(single: &'a mut T, mut multiple: &'a m // CHECK: [[b:_.*]] = &mut [[a]]; // CHECK: [[btmp:_.*]] = &mut [[a2]]; // CHECK: [[b]] = move [[btmp]]; - // CHECK: [[c:_.*]] = (*[[b]]); + // CHECK: [[c:_.*]] = copy (*[[b]]); let mut a = 5_usize; let mut a2 = 7_usize; @@ -205,7 +204,7 @@ fn reference_propagation_mut<'a, T: Copy>(single: &'a mut T, mut multiple: &'a m // CHECK: [[a:_.*]] = const 5_usize; // CHECK: [[b:_.*]] = &mut [[a]]; // CHECK: [[d:_.*]] = &[[b]]; - // CHECK: [[c:_.*]] = (*[[b]]); + // CHECK: [[c:_.*]] = copy (*[[b]]); let mut a = 5_usize; let b = &mut a; @@ -220,7 +219,7 @@ fn reference_propagation_mut<'a, T: Copy>(single: &'a mut T, mut multiple: &'a m // CHECK: [[a:_.*]] = const 5_usize; // CHECK: [[b:_.*]] = &mut [[a]]; // CHECK: [[d:_.*]] = &raw mut [[b]]; - // CHECK: [[c:_.*]] = (*[[b]]); + // CHECK: [[c:_.*]] = copy (*[[b]]); let mut a = 5_usize; let mut b = &mut a; @@ -234,7 +233,7 @@ fn reference_propagation_mut<'a, T: Copy>(single: &'a mut T, mut multiple: &'a m // CHECK: bb4: { // CHECK: [[a:_.*]] = const 7_usize; // CHECK: [[b:_.*]] = &mut [[a]]; - // CHECK: [[c:_.*]] = (*[[b]]); + // CHECK: [[c:_.*]] = copy (*[[b]]); let mut a = 7_usize; let b = &mut a; @@ -247,9 +246,9 @@ fn reference_propagation_mut<'a, T: Copy>(single: &'a mut T, mut multiple: &'a m // CHECK: bb5: { // CHECK: [[a:_.*]] = const 7_usize; // CHECK: [[b1:_.*]] = &mut [[a]]; - // CHECK: [[c:_.*]] = (*[[b1]]); + // CHECK: [[c:_.*]] = copy (*[[b1]]); // CHECK: [[b2:_.*]] = move [[b1]]; - // CHECK: [[c2:_.*]] = (*[[b2]]); + // CHECK: [[c2:_.*]] = copy (*[[b2]]); // CHECK: [[b3:_.*]] = move [[b2]]; let mut a = 7_usize; @@ -267,7 +266,7 @@ fn reference_propagation_mut<'a, T: Copy>(single: &'a mut T, mut multiple: &'a m { // CHECK: bb6: { // CHECK-NOT: {{_.*}} = &(*_1); - // CHECK: [[b:_.*]] = (*_1); + // CHECK: [[b:_.*]] = copy (*_1); let a = &mut *single; let b = *a; // This should be optimized as `*single`. @@ -280,7 +279,7 @@ fn reference_propagation_mut<'a, T: Copy>(single: &'a mut T, mut multiple: &'a m // CHECK: [[a:_.*]] = &mut (*_2); // CHECK: [[tmp:_.*]] = &mut (*_1); // CHECK: _2 = move [[tmp]]; - // CHECK: [[b:_.*]] = (*[[a]]); + // CHECK: [[b:_.*]] = copy (*[[a]]); let a = &mut *multiple; multiple = &mut *single; @@ -295,7 +294,7 @@ fn reference_propagation_mut<'a, T: Copy>(single: &'a mut T, mut multiple: &'a m // CHECK: [[b:_.*]] = &mut [[a]]; // CHECK: [[d:_.*]] = &[[b]]; // FIXME this could be [[a]] - // CHECK: [[c:_.*]] = (*[[b]]); + // CHECK: [[c:_.*]] = copy (*[[b]]); let mut a = 5_usize; let b = &mut a; @@ -311,7 +310,7 @@ fn reference_propagation_mut<'a, T: Copy>(single: &'a mut T, mut multiple: &'a m // CHECK: [[b:_.*]] = &mut [[a]]; // CHECK: [[d:_.*]] = &mut [[b]]; // FIXME this could be [[a]] - // CHECK: [[c:_.*]] = (*[[b]]); + // CHECK: [[c:_.*]] = copy (*[[b]]); let mut a = 5_usize; let mut b = &mut a; @@ -329,7 +328,7 @@ fn reference_propagation_const_ptr<T: Copy>(single: *const T, mut multiple: *con // CHECK: bb0: { // CHECK: [[a:_.*]] = const 5_usize; // CHECK: [[b:_.*]] = &raw const [[a]]; - // CHECK: [[c:_.*]] = [[a]]; + // CHECK: [[c:_.*]] = copy [[a]]; let a = 5_usize; let b = &raw const a; // This borrow is only used once. @@ -345,7 +344,7 @@ fn reference_propagation_const_ptr<T: Copy>(single: *const T, mut multiple: *con // CHECK: [[b:_.*]] = &raw const [[a]]; // CHECK: [[btmp:_.*]] = &raw const [[a2]]; // CHECK: [[b]] = move [[btmp]]; - // CHECK: [[c:_.*]] = (*[[b]]); + // CHECK: [[c:_.*]] = copy (*[[b]]); let a = 5_usize; let a2 = 7_usize; @@ -362,7 +361,7 @@ fn reference_propagation_const_ptr<T: Copy>(single: *const T, mut multiple: *con // CHECK: [[a:_.*]] = const 5_usize; // CHECK: [[b:_.*]] = &raw const [[a]]; // CHECK: [[d:_.*]] = &[[b]]; - // CHECK: [[c:_.*]] = [[a]]; + // CHECK: [[c:_.*]] = copy [[a]]; let a = 5_usize; let b = &raw const a; @@ -377,7 +376,7 @@ fn reference_propagation_const_ptr<T: Copy>(single: *const T, mut multiple: *con // CHECK: [[a:_.*]] = const 5_usize; // CHECK: [[b:_.*]] = &raw const [[a]]; // CHECK: [[d:_.*]] = &raw mut [[b]]; - // CHECK: [[c:_.*]] = (*[[b]]); + // CHECK: [[c:_.*]] = copy (*[[b]]); let a = 5_usize; let mut b = &raw const a; @@ -391,7 +390,7 @@ fn reference_propagation_const_ptr<T: Copy>(single: *const T, mut multiple: *con // CHECK: bb4: { // CHECK: [[a:_.*]] = const 7_usize; // CHECK: [[b:_.*]] = &raw const [[a]]; - // CHECK: [[c:_.*]] = [[a]]; + // CHECK: [[c:_.*]] = copy [[a]]; let a = 7_usize; let b = &raw const a; @@ -404,10 +403,10 @@ fn reference_propagation_const_ptr<T: Copy>(single: *const T, mut multiple: *con // CHECK: bb5: { // CHECK: [[a:_.*]] = const 7_usize; // CHECK: [[b1:_.*]] = &raw const [[a]]; - // CHECK: [[c:_.*]] = [[a]]; - // CHECK: [[b2:_.*]] = [[b1]]; - // CHECK: [[c2:_.*]] = [[a]]; - // CHECK: [[b3:_.*]] = [[b2]]; + // CHECK: [[c:_.*]] = copy [[a]]; + // CHECK: [[b2:_.*]] = copy [[b1]]; + // CHECK: [[c2:_.*]] = copy [[a]]; + // CHECK: [[b3:_.*]] = copy [[b2]]; let a = 7_usize; let b1 = &raw const a; @@ -424,7 +423,7 @@ fn reference_propagation_const_ptr<T: Copy>(single: *const T, mut multiple: *con unsafe { // CHECK: bb6: { // CHECK-NOT: {{_.*}} = &(*_1); - // CHECK: [[b:_.*]] = (*_1); + // CHECK: [[b:_.*]] = copy (*_1); let a = &raw const *single; let b = *a; // This should be optimized as `*single`. @@ -437,7 +436,7 @@ fn reference_propagation_const_ptr<T: Copy>(single: *const T, mut multiple: *con // CHECK: [[a:_.*]] = &raw const (*_2); // CHECK: [[tmp:_.*]] = &raw const (*_1); // CHECK: _2 = move [[tmp]]; - // CHECK: [[b:_.*]] = (*[[a]]); + // CHECK: [[b:_.*]] = copy (*[[a]]); let a = &raw const *multiple; multiple = &raw const *single; @@ -451,7 +450,7 @@ fn reference_propagation_const_ptr<T: Copy>(single: *const T, mut multiple: *con // CHECK: [[a:_.*]] = const 13_usize; // CHECK: [[b:_.*]] = &raw const [[a]]; // CHECK: [[d:_.*]] = &raw const [[a]]; - // CHECK: [[c:_.*]] = [[a]]; + // CHECK: [[c:_.*]] = copy [[a]]; let a = 13_usize; let b = &raw const a; @@ -466,7 +465,7 @@ fn reference_propagation_const_ptr<T: Copy>(single: *const T, mut multiple: *con // CHECK: [[a:_.*]] = const 5_usize; // CHECK: [[b:_.*]] = &raw const [[a]]; // CHECK: [[d:_.*]] = &[[b]]; - // CHECK: [[c:_.*]] = [[a]]; + // CHECK: [[c:_.*]] = copy [[a]]; let a = 5_usize; let b = &raw const a; @@ -482,7 +481,7 @@ fn reference_propagation_const_ptr<T: Copy>(single: *const T, mut multiple: *con // CHECK: [[b:_.*]] = &raw const [[a]]; // CHECK: [[d:_.*]] = &mut [[b]]; // FIXME this could be [[a]] - // CHECK: [[c:_.*]] = (*[[b]]); + // CHECK: [[c:_.*]] = copy (*[[b]]); let a = 5_usize; let mut b = &raw const a; @@ -500,7 +499,7 @@ fn reference_propagation_mut_ptr<T: Copy>(single: *mut T, mut multiple: *mut T) // CHECK: bb0: { // CHECK: [[a:_.*]] = const 5_usize; // CHECK: [[b:_.*]] = &raw mut [[a]]; - // CHECK: [[c:_.*]] = [[a]]; + // CHECK: [[c:_.*]] = copy [[a]]; let mut a = 5_usize; let b = &raw mut a; // This borrow is only used once. @@ -516,7 +515,7 @@ fn reference_propagation_mut_ptr<T: Copy>(single: *mut T, mut multiple: *mut T) // CHECK: [[b:_.*]] = &raw mut [[a]]; // CHECK: [[btmp:_.*]] = &raw mut [[a2]]; // CHECK: [[b]] = move [[btmp]]; - // CHECK: [[c:_.*]] = (*[[b]]); + // CHECK: [[c:_.*]] = copy (*[[b]]); let mut a = 5_usize; let mut a2 = 7_usize; @@ -533,7 +532,7 @@ fn reference_propagation_mut_ptr<T: Copy>(single: *mut T, mut multiple: *mut T) // CHECK: [[a:_.*]] = const 5_usize; // CHECK: [[b:_.*]] = &raw mut [[a]]; // CHECK: [[d:_.*]] = &[[b]]; - // CHECK: [[c:_.*]] = (*[[b]]); + // CHECK: [[c:_.*]] = copy (*[[b]]); let mut a = 5_usize; let b = &raw mut a; @@ -548,7 +547,7 @@ fn reference_propagation_mut_ptr<T: Copy>(single: *mut T, mut multiple: *mut T) // CHECK: [[a:_.*]] = const 5_usize; // CHECK: [[b:_.*]] = &raw mut [[a]]; // CHECK: [[d:_.*]] = &raw mut [[b]]; - // CHECK: [[c:_.*]] = (*[[b]]); + // CHECK: [[c:_.*]] = copy (*[[b]]); let mut a = 5_usize; let mut b = &raw mut a; @@ -562,7 +561,7 @@ fn reference_propagation_mut_ptr<T: Copy>(single: *mut T, mut multiple: *mut T) // CHECK: bb4: { // CHECK: [[a:_.*]] = const 7_usize; // CHECK: [[b:_.*]] = &raw mut [[a]]; - // CHECK: [[c:_.*]] = (*[[b]]); + // CHECK: [[c:_.*]] = copy (*[[b]]); let mut a = 7_usize; let b = &raw mut a; @@ -575,10 +574,10 @@ fn reference_propagation_mut_ptr<T: Copy>(single: *mut T, mut multiple: *mut T) // CHECK: bb5: { // CHECK: [[a:_.*]] = const 7_usize; // CHECK: [[b1:_.*]] = &raw mut [[a]]; - // CHECK: [[c:_.*]] = (*[[b1]]); - // CHECK: [[b2:_.*]] = [[b1]]; - // CHECK: [[c2:_.*]] = (*[[b2]]); - // CHECK: [[b3:_.*]] = [[b2]]; + // CHECK: [[c:_.*]] = copy (*[[b1]]); + // CHECK: [[b2:_.*]] = copy [[b1]]; + // CHECK: [[c2:_.*]] = copy (*[[b2]]); + // CHECK: [[b3:_.*]] = copy [[b2]]; let mut a = 7_usize; let b1 = &raw mut a; @@ -595,7 +594,7 @@ fn reference_propagation_mut_ptr<T: Copy>(single: *mut T, mut multiple: *mut T) unsafe { // CHECK: bb6: { // CHECK-NOT: {{_.*}} = &(*_1); - // CHECK: [[b:_.*]] = (*_1); + // CHECK: [[b:_.*]] = copy (*_1); let a = &raw mut *single; let b = *a; // This should be optimized as `*single`. @@ -608,7 +607,7 @@ fn reference_propagation_mut_ptr<T: Copy>(single: *mut T, mut multiple: *mut T) // CHECK: [[a:_.*]] = &raw mut (*_2); // CHECK: [[tmp:_.*]] = &raw mut (*_1); // CHECK: _2 = move [[tmp]]; - // CHECK: [[b:_.*]] = (*[[a]]); + // CHECK: [[b:_.*]] = copy (*[[a]]); let a = &raw mut *multiple; multiple = &raw mut *single; @@ -623,7 +622,7 @@ fn reference_propagation_mut_ptr<T: Copy>(single: *mut T, mut multiple: *mut T) // CHECK: [[b:_.*]] = &raw mut [[a]]; // CHECK: [[d:_.*]] = &[[b]]; // FIXME this could be [[a]] - // CHECK: [[c:_.*]] = (*[[b]]); + // CHECK: [[c:_.*]] = copy (*[[b]]); let mut a = 5_usize; let b = &raw mut a; @@ -639,7 +638,7 @@ fn reference_propagation_mut_ptr<T: Copy>(single: *mut T, mut multiple: *mut T) // CHECK: [[b:_.*]] = &raw mut [[a]]; // CHECK: [[d:_.*]] = &mut [[b]]; // FIXME this could be [[a]] - // CHECK: [[c:_.*]] = (*[[b]]); + // CHECK: [[c:_.*]] = copy (*[[b]]); let mut a = 5_usize; let mut b = &raw mut a; @@ -653,8 +652,8 @@ fn reference_propagation_mut_ptr<T: Copy>(single: *mut T, mut multiple: *mut T) fn read_through_raw(x: &mut usize) -> usize { // CHECK-LABEL: read_through_raw // CHECK: bb0: { - // CHECK-NEXT: _0 = (*_1); - // CHECK-NEXT: _0 = (*_1); + // CHECK-NEXT: _0 = copy (*_1); + // CHECK-NEXT: _0 = copy (*_1); // CHECK-NEXT: return; use std::intrinsics::mir::*; @@ -680,7 +679,7 @@ fn read_through_raw(x: &mut usize) -> usize { #[custom_mir(dialect = "runtime", phase = "post-cleanup")] fn multiple_storage() { // CHECK-LABEL: multiple_storage - // CHECK: _3 = (*_2); + // CHECK: _3 = copy (*_2); use std::intrinsics::mir::*; mir! { @@ -706,7 +705,7 @@ fn multiple_storage() { #[custom_mir(dialect = "runtime", phase = "post-cleanup")] fn dominate_storage() { // CHECK-LABEL: dominate_storage - // CHECK: _5 = (*_2); + // CHECK: _5 = copy (*_2); use std::intrinsics::mir::*; mir! { @@ -798,12 +797,12 @@ fn unique_with_copies() { // CHECK: [[a:_.*]] = const 0_i32; // CHECK: [[x:_.*]] = &raw mut [[a]]; // CHECK-NOT: [[a]] - // CHECK: [[tmp:_.*]] = (*[[x]]); + // CHECK: [[tmp:_.*]] = copy (*[[x]]); // CHECK-NEXT: opaque::<i32>(move [[tmp]]) // CHECK-NOT: [[a]] // CHECK: StorageDead([[a]]); // CHECK-NOT: [[a]] - // CHECK: [[tmp:_.*]] = (*[[x]]); + // CHECK: [[tmp:_.*]] = copy (*[[x]]); // CHECK-NEXT: opaque::<i32>(move [[tmp]]) let y = { diff --git a/tests/mir-opt/reference_prop.unique_with_copies.ReferencePropagation.diff b/tests/mir-opt/reference_prop.unique_with_copies.ReferencePropagation.diff index a5427cea1f8..d2ba9db2b89 100644 --- a/tests/mir-opt/reference_prop.unique_with_copies.ReferencePropagation.diff +++ b/tests/mir-opt/reference_prop.unique_with_copies.ReferencePropagation.diff @@ -29,20 +29,20 @@ _3 = &raw mut _2; StorageLive(_4); StorageLive(_5); - _5 = (*_3); + _5 = copy (*_3); _4 = opaque::<i32>(move _5) -> [return: bb1, unwind continue]; } bb1: { StorageDead(_5); StorageDead(_4); -- _1 = _3; +- _1 = copy _3; - StorageDead(_3); StorageDead(_2); StorageLive(_6); StorageLive(_7); -- _7 = (*_1); -+ _7 = (*_3); +- _7 = copy (*_1); ++ _7 = copy (*_3); _6 = opaque::<i32>(move _7) -> [return: bb2, unwind continue]; } diff --git a/tests/mir-opt/remove_fake_borrows.match_guard.CleanupPostBorrowck.panic-abort.diff b/tests/mir-opt/remove_fake_borrows.match_guard.CleanupPostBorrowck.panic-abort.diff index d76d65a18a7..8c6c5e0d993 100644 --- a/tests/mir-opt/remove_fake_borrows.match_guard.CleanupPostBorrowck.panic-abort.diff +++ b/tests/mir-opt/remove_fake_borrows.match_guard.CleanupPostBorrowck.panic-abort.diff @@ -24,7 +24,7 @@ } bb2: { - switchInt((*(*((_1 as Some).0: &&i32)))) -> [0: bb3, otherwise: bb1]; + switchInt(copy (*(*((_1 as Some).0: &&i32)))) -> [0: bb3, otherwise: bb1]; } bb3: { @@ -42,7 +42,7 @@ + nop; + nop; StorageLive(_8); - _8 = _2; + _8 = copy _2; switchInt(move _8) -> [0: bb6, otherwise: bb5]; } diff --git a/tests/mir-opt/remove_fake_borrows.match_guard.CleanupPostBorrowck.panic-unwind.diff b/tests/mir-opt/remove_fake_borrows.match_guard.CleanupPostBorrowck.panic-unwind.diff index d76d65a18a7..8c6c5e0d993 100644 --- a/tests/mir-opt/remove_fake_borrows.match_guard.CleanupPostBorrowck.panic-unwind.diff +++ b/tests/mir-opt/remove_fake_borrows.match_guard.CleanupPostBorrowck.panic-unwind.diff @@ -24,7 +24,7 @@ } bb2: { - switchInt((*(*((_1 as Some).0: &&i32)))) -> [0: bb3, otherwise: bb1]; + switchInt(copy (*(*((_1 as Some).0: &&i32)))) -> [0: bb3, otherwise: bb1]; } bb3: { @@ -42,7 +42,7 @@ + nop; + nop; StorageLive(_8); - _8 = _2; + _8 = copy _2; switchInt(move _8) -> [0: bb6, otherwise: bb5]; } diff --git a/tests/mir-opt/remove_storage_markers.main.RemoveStorageMarkers.panic-abort.diff b/tests/mir-opt/remove_storage_markers.main.RemoveStorageMarkers.panic-abort.diff index 14762b9c40f..38cdbf5684b 100644 --- a/tests/mir-opt/remove_storage_markers.main.RemoveStorageMarkers.panic-abort.diff +++ b/tests/mir-opt/remove_storage_markers.main.RemoveStorageMarkers.panic-abort.diff @@ -64,10 +64,10 @@ bb5: { - StorageLive(_12); - _12 = ((_7 as Some).0: i32); + _12 = copy ((_7 as Some).0: i32); - StorageLive(_13); - _13 = _12; - _1 = Add(_1, move _13); + _13 = copy _12; + _1 = Add(copy _1, move _13); - StorageDead(_13); _6 = const (); - StorageDead(_12); diff --git a/tests/mir-opt/remove_storage_markers.main.RemoveStorageMarkers.panic-unwind.diff b/tests/mir-opt/remove_storage_markers.main.RemoveStorageMarkers.panic-unwind.diff index 24797424b5c..2b5aaa95fe1 100644 --- a/tests/mir-opt/remove_storage_markers.main.RemoveStorageMarkers.panic-unwind.diff +++ b/tests/mir-opt/remove_storage_markers.main.RemoveStorageMarkers.panic-unwind.diff @@ -64,10 +64,10 @@ bb5: { - StorageLive(_12); - _12 = ((_7 as Some).0: i32); + _12 = copy ((_7 as Some).0: i32); - StorageLive(_13); - _13 = _12; - _1 = Add(_1, move _13); + _13 = copy _12; + _1 = Add(copy _1, move _13); - StorageDead(_13); _6 = const (); - StorageDead(_12); diff --git a/tests/mir-opt/remove_unneeded_drops.opt.RemoveUnneededDrops.panic-abort.diff b/tests/mir-opt/remove_unneeded_drops.opt.RemoveUnneededDrops.panic-abort.diff index 5afeb8620a1..01eb6d4901f 100644 --- a/tests/mir-opt/remove_unneeded_drops.opt.RemoveUnneededDrops.panic-abort.diff +++ b/tests/mir-opt/remove_unneeded_drops.opt.RemoveUnneededDrops.panic-abort.diff @@ -12,7 +12,7 @@ bb0: { - nop; StorageLive(_3); - _3 = _1; + _3 = copy _1; - drop(_3) -> [return: bb1, unwind unreachable]; - } - diff --git a/tests/mir-opt/remove_unneeded_drops.opt.RemoveUnneededDrops.panic-unwind.diff b/tests/mir-opt/remove_unneeded_drops.opt.RemoveUnneededDrops.panic-unwind.diff index b9919ddea56..c2c3cb76e83 100644 --- a/tests/mir-opt/remove_unneeded_drops.opt.RemoveUnneededDrops.panic-unwind.diff +++ b/tests/mir-opt/remove_unneeded_drops.opt.RemoveUnneededDrops.panic-unwind.diff @@ -12,7 +12,7 @@ bb0: { - nop; StorageLive(_3); - _3 = _1; + _3 = copy _1; - drop(_3) -> [return: bb1, unwind continue]; - } - diff --git a/tests/mir-opt/remove_unneeded_drops.opt_generic_copy.RemoveUnneededDrops.panic-abort.diff b/tests/mir-opt/remove_unneeded_drops.opt_generic_copy.RemoveUnneededDrops.panic-abort.diff index b89432dd6d6..a82ede6196e 100644 --- a/tests/mir-opt/remove_unneeded_drops.opt_generic_copy.RemoveUnneededDrops.panic-abort.diff +++ b/tests/mir-opt/remove_unneeded_drops.opt_generic_copy.RemoveUnneededDrops.panic-abort.diff @@ -12,7 +12,7 @@ bb0: { - nop; StorageLive(_3); - _3 = _1; + _3 = copy _1; - drop(_3) -> [return: bb1, unwind unreachable]; - } - diff --git a/tests/mir-opt/remove_unneeded_drops.opt_generic_copy.RemoveUnneededDrops.panic-unwind.diff b/tests/mir-opt/remove_unneeded_drops.opt_generic_copy.RemoveUnneededDrops.panic-unwind.diff index 48d02605332..6e7c9ead740 100644 --- a/tests/mir-opt/remove_unneeded_drops.opt_generic_copy.RemoveUnneededDrops.panic-unwind.diff +++ b/tests/mir-opt/remove_unneeded_drops.opt_generic_copy.RemoveUnneededDrops.panic-unwind.diff @@ -12,7 +12,7 @@ bb0: { - nop; StorageLive(_3); - _3 = _1; + _3 = copy _1; - drop(_3) -> [return: bb1, unwind continue]; - } - diff --git a/tests/mir-opt/retag.array_casts.SimplifyCfg-pre-optimizations.after.panic-abort.mir b/tests/mir-opt/retag.array_casts.SimplifyCfg-pre-optimizations.after.panic-abort.mir index 6dba667dd15..ae7b2cc0b6f 100644 --- a/tests/mir-opt/retag.array_casts.SimplifyCfg-pre-optimizations.after.panic-abort.mir +++ b/tests/mir-opt/retag.array_casts.SimplifyCfg-pre-optimizations.after.panic-abort.mir @@ -70,7 +70,7 @@ fn array_casts() -> () { StorageLive(_5); StorageLive(_6); StorageLive(_7); - _7 = _2; + _7 = copy _2; _6 = std::ptr::mut_ptr::<impl *mut usize>::add(move _7, const 1_usize) -> [return: bb1, unwind unreachable]; } @@ -96,13 +96,13 @@ fn array_casts() -> () { StorageLive(_15); StorageLive(_16); StorageLive(_17); - _17 = _9; + _17 = copy _9; _16 = std::ptr::const_ptr::<impl *const usize>::add(move _17, const 1_usize) -> [return: bb2, unwind unreachable]; } bb2: { StorageDead(_17); - _15 = (*_16); + _15 = copy (*_16); _14 = &_15; StorageLive(_18); _34 = const array_casts::promoted[0]; @@ -113,16 +113,16 @@ fn array_casts() -> () { StorageDead(_18); StorageDead(_14); StorageLive(_20); - _20 = (_13.0: &usize); + _20 = copy (_13.0: &usize); Retag(_20); StorageLive(_21); - _21 = (_13.1: &usize); + _21 = copy (_13.1: &usize); Retag(_21); StorageLive(_22); StorageLive(_23); - _23 = (*_20); + _23 = copy (*_20); StorageLive(_24); - _24 = (*_21); + _24 = copy (*_21); _22 = Eq(move _23, move _24); switchInt(move _22) -> [0: bb4, otherwise: bb3]; } diff --git a/tests/mir-opt/retag.array_casts.SimplifyCfg-pre-optimizations.after.panic-unwind.mir b/tests/mir-opt/retag.array_casts.SimplifyCfg-pre-optimizations.after.panic-unwind.mir index fa812002e26..789bc342638 100644 --- a/tests/mir-opt/retag.array_casts.SimplifyCfg-pre-optimizations.after.panic-unwind.mir +++ b/tests/mir-opt/retag.array_casts.SimplifyCfg-pre-optimizations.after.panic-unwind.mir @@ -70,7 +70,7 @@ fn array_casts() -> () { StorageLive(_5); StorageLive(_6); StorageLive(_7); - _7 = _2; + _7 = copy _2; _6 = std::ptr::mut_ptr::<impl *mut usize>::add(move _7, const 1_usize) -> [return: bb1, unwind continue]; } @@ -96,13 +96,13 @@ fn array_casts() -> () { StorageLive(_15); StorageLive(_16); StorageLive(_17); - _17 = _9; + _17 = copy _9; _16 = std::ptr::const_ptr::<impl *const usize>::add(move _17, const 1_usize) -> [return: bb2, unwind continue]; } bb2: { StorageDead(_17); - _15 = (*_16); + _15 = copy (*_16); _14 = &_15; StorageLive(_18); _34 = const array_casts::promoted[0]; @@ -113,16 +113,16 @@ fn array_casts() -> () { StorageDead(_18); StorageDead(_14); StorageLive(_20); - _20 = (_13.0: &usize); + _20 = copy (_13.0: &usize); Retag(_20); StorageLive(_21); - _21 = (_13.1: &usize); + _21 = copy (_13.1: &usize); Retag(_21); StorageLive(_22); StorageLive(_23); - _23 = (*_20); + _23 = copy (*_20); StorageLive(_24); - _24 = (*_21); + _24 = copy (*_21); _22 = Eq(move _23, move _24); switchInt(move _22) -> [0: bb4, otherwise: bb3]; } diff --git a/tests/mir-opt/retag.box_to_raw_mut.SimplifyCfg-pre-optimizations.after.panic-abort.mir b/tests/mir-opt/retag.box_to_raw_mut.SimplifyCfg-pre-optimizations.after.panic-abort.mir index 0e568f6a568..ca02e7b49cc 100644 --- a/tests/mir-opt/retag.box_to_raw_mut.SimplifyCfg-pre-optimizations.after.panic-abort.mir +++ b/tests/mir-opt/retag.box_to_raw_mut.SimplifyCfg-pre-optimizations.after.panic-abort.mir @@ -9,7 +9,7 @@ fn box_to_raw_mut(_1: &mut Box<i32>) -> *mut i32 { bb0: { Retag([fn entry] _1); _2 = deref_copy (*_1); - _3 = (((_2.0: std::ptr::Unique<i32>).0: std::ptr::NonNull<i32>).0: *const i32); + _3 = copy (((_2.0: std::ptr::Unique<i32>).0: std::ptr::NonNull<i32>).0: *const i32); _0 = &raw mut (*_3); Retag([raw] _0); return; diff --git a/tests/mir-opt/retag.box_to_raw_mut.SimplifyCfg-pre-optimizations.after.panic-unwind.mir b/tests/mir-opt/retag.box_to_raw_mut.SimplifyCfg-pre-optimizations.after.panic-unwind.mir index 0e568f6a568..ca02e7b49cc 100644 --- a/tests/mir-opt/retag.box_to_raw_mut.SimplifyCfg-pre-optimizations.after.panic-unwind.mir +++ b/tests/mir-opt/retag.box_to_raw_mut.SimplifyCfg-pre-optimizations.after.panic-unwind.mir @@ -9,7 +9,7 @@ fn box_to_raw_mut(_1: &mut Box<i32>) -> *mut i32 { bb0: { Retag([fn entry] _1); _2 = deref_copy (*_1); - _3 = (((_2.0: std::ptr::Unique<i32>).0: std::ptr::NonNull<i32>).0: *const i32); + _3 = copy (((_2.0: std::ptr::Unique<i32>).0: std::ptr::NonNull<i32>).0: *const i32); _0 = &raw mut (*_3); Retag([raw] _0); return; diff --git a/tests/mir-opt/retag.main-{closure#0}.SimplifyCfg-pre-optimizations.after.panic-abort.mir b/tests/mir-opt/retag.main-{closure#0}.SimplifyCfg-pre-optimizations.after.panic-abort.mir index 2620929e896..63b32ceb5c0 100644 --- a/tests/mir-opt/retag.main-{closure#0}.SimplifyCfg-pre-optimizations.after.panic-abort.mir +++ b/tests/mir-opt/retag.main-{closure#0}.SimplifyCfg-pre-optimizations.after.panic-abort.mir @@ -12,7 +12,7 @@ fn main::{closure#0}(_1: &{closure@main::{closure#0}}, _2: &i32) -> &i32 { Retag([fn entry] _1); Retag([fn entry] _2); StorageLive(_3); - _3 = _2; + _3 = copy _2; Retag(_3); _0 = &(*_2); StorageDead(_3); diff --git a/tests/mir-opt/retag.main-{closure#0}.SimplifyCfg-pre-optimizations.after.panic-unwind.mir b/tests/mir-opt/retag.main-{closure#0}.SimplifyCfg-pre-optimizations.after.panic-unwind.mir index 2620929e896..63b32ceb5c0 100644 --- a/tests/mir-opt/retag.main-{closure#0}.SimplifyCfg-pre-optimizations.after.panic-unwind.mir +++ b/tests/mir-opt/retag.main-{closure#0}.SimplifyCfg-pre-optimizations.after.panic-unwind.mir @@ -12,7 +12,7 @@ fn main::{closure#0}(_1: &{closure@main::{closure#0}}, _2: &i32) -> &i32 { Retag([fn entry] _1); Retag([fn entry] _2); StorageLive(_3); - _3 = _2; + _3 = copy _2; Retag(_3); _0 = &(*_2); StorageDead(_3); diff --git a/tests/mir-opt/retag.main.SimplifyCfg-pre-optimizations.after.panic-abort.mir b/tests/mir-opt/retag.main.SimplifyCfg-pre-optimizations.after.panic-abort.mir index a35af43cefd..d0f454e4569 100644 --- a/tests/mir-opt/retag.main.SimplifyCfg-pre-optimizations.after.panic-abort.mir +++ b/tests/mir-opt/retag.main.SimplifyCfg-pre-optimizations.after.panic-abort.mir @@ -93,7 +93,7 @@ fn main() -> () { StorageLive(_11); StorageLive(_12); _12 = &raw mut (*_10); - _11 = _12; + _11 = copy _12; StorageDead(_12); _2 = const (); StorageDead(_11); @@ -109,7 +109,7 @@ fn main() -> () { StorageDead(_14); StorageLive(_15); StorageLive(_16); - _16 = _13; + _16 = copy _13; StorageLive(_17); StorageLive(_18); _18 = &_1; @@ -150,7 +150,7 @@ fn main() -> () { StorageLive(_25); StorageLive(_26); _26 = &raw const (*_15); - _25 = _26; + _25 = copy _26; StorageDead(_26); StorageLive(_27); _27 = array_casts() -> [return: bb6, unwind unreachable]; diff --git a/tests/mir-opt/retag.main.SimplifyCfg-pre-optimizations.after.panic-unwind.mir b/tests/mir-opt/retag.main.SimplifyCfg-pre-optimizations.after.panic-unwind.mir index 2495719ec1c..685277d7a53 100644 --- a/tests/mir-opt/retag.main.SimplifyCfg-pre-optimizations.after.panic-unwind.mir +++ b/tests/mir-opt/retag.main.SimplifyCfg-pre-optimizations.after.panic-unwind.mir @@ -93,7 +93,7 @@ fn main() -> () { StorageLive(_11); StorageLive(_12); _12 = &raw mut (*_10); - _11 = _12; + _11 = copy _12; StorageDead(_12); _2 = const (); StorageDead(_11); @@ -109,7 +109,7 @@ fn main() -> () { StorageDead(_14); StorageLive(_15); StorageLive(_16); - _16 = _13; + _16 = copy _13; StorageLive(_17); StorageLive(_18); _18 = &_1; @@ -150,7 +150,7 @@ fn main() -> () { StorageLive(_25); StorageLive(_26); _26 = &raw const (*_15); - _25 = _26; + _25 = copy _26; StorageDead(_26); StorageLive(_27); _27 = array_casts() -> [return: bb6, unwind continue]; diff --git a/tests/mir-opt/retag.{impl#0}-foo_shr.SimplifyCfg-pre-optimizations.after.panic-abort.mir b/tests/mir-opt/retag.{impl#0}-foo_shr.SimplifyCfg-pre-optimizations.after.panic-abort.mir index 4f90413e38b..b873c5aabbf 100644 --- a/tests/mir-opt/retag.{impl#0}-foo_shr.SimplifyCfg-pre-optimizations.after.panic-abort.mir +++ b/tests/mir-opt/retag.{impl#0}-foo_shr.SimplifyCfg-pre-optimizations.after.panic-abort.mir @@ -8,7 +8,7 @@ fn <impl at $DIR/retag.rs:13:1: 13:10>::foo_shr(_1: &Test, _2: &i32) -> &i32 { bb0: { Retag([fn entry] _1); Retag([fn entry] _2); - _0 = _2; + _0 = copy _2; Retag(_0); return; } diff --git a/tests/mir-opt/retag.{impl#0}-foo_shr.SimplifyCfg-pre-optimizations.after.panic-unwind.mir b/tests/mir-opt/retag.{impl#0}-foo_shr.SimplifyCfg-pre-optimizations.after.panic-unwind.mir index 4f90413e38b..b873c5aabbf 100644 --- a/tests/mir-opt/retag.{impl#0}-foo_shr.SimplifyCfg-pre-optimizations.after.panic-unwind.mir +++ b/tests/mir-opt/retag.{impl#0}-foo_shr.SimplifyCfg-pre-optimizations.after.panic-unwind.mir @@ -8,7 +8,7 @@ fn <impl at $DIR/retag.rs:13:1: 13:10>::foo_shr(_1: &Test, _2: &i32) -> &i32 { bb0: { Retag([fn entry] _1); Retag([fn entry] _2); - _0 = _2; + _0 = copy _2; Retag(_0); return; } diff --git a/tests/mir-opt/separate_const_switch.identity.JumpThreading.diff b/tests/mir-opt/separate_const_switch.identity.JumpThreading.diff index 8dd904c7d7b..ce9d812701a 100644 --- a/tests/mir-opt/separate_const_switch.identity.JumpThreading.diff +++ b/tests/mir-opt/separate_const_switch.identity.JumpThreading.diff @@ -50,16 +50,16 @@ } bb2: { - _5 = ((_2 as Continue).0: i32); - _0 = Result::<i32, i32>::Ok(_5); + _5 = copy ((_2 as Continue).0: i32); + _0 = Result::<i32, i32>::Ok(copy _5); StorageDead(_2); return; } bb3: { - _4 = ((_2 as Break).0: std::result::Result<std::convert::Infallible, i32>); - _10 = ((_4 as Err).0: i32); - _0 = Result::<i32, i32>::Err(_10); + _4 = copy ((_2 as Break).0: std::result::Result<std::convert::Infallible, i32>); + _10 = copy ((_4 as Err).0: i32); + _0 = Result::<i32, i32>::Err(copy _10); StorageDead(_2); return; } @@ -74,9 +74,9 @@ } bb5: { - _8 = ((_1 as Err).0: i32); + _8 = copy ((_1 as Err).0: i32); StorageLive(_9); - _9 = Result::<Infallible, i32>::Err(_8); + _9 = Result::<Infallible, i32>::Err(copy _8); _2 = ControlFlow::<Result<Infallible, i32>, i32>::Break(move _9); StorageDead(_9); - goto -> bb4; @@ -84,8 +84,8 @@ } bb6: { - _7 = ((_1 as Ok).0: i32); - _2 = ControlFlow::<Result<Infallible, i32>, i32>::Continue(_7); + _7 = copy ((_1 as Ok).0: i32); + _2 = ControlFlow::<Result<Infallible, i32>, i32>::Continue(copy _7); goto -> bb4; + } + diff --git a/tests/mir-opt/separate_const_switch.too_complex.JumpThreading.diff b/tests/mir-opt/separate_const_switch.too_complex.JumpThreading.diff index f7495862992..c88c63e0c13 100644 --- a/tests/mir-opt/separate_const_switch.too_complex.JumpThreading.diff +++ b/tests/mir-opt/separate_const_switch.too_complex.JumpThreading.diff @@ -35,15 +35,15 @@ } bb2: { - _5 = ((_1 as Err).0: usize); - _2 = ControlFlow::<usize, i32>::Break(_5); + _5 = copy ((_1 as Err).0: usize); + _2 = ControlFlow::<usize, i32>::Break(copy _5); - goto -> bb4; + goto -> bb8; } bb3: { - _4 = ((_1 as Ok).0: i32); - _2 = ControlFlow::<usize, i32>::Continue(_4); + _4 = copy ((_1 as Ok).0: i32); + _2 = ControlFlow::<usize, i32>::Continue(copy _4); goto -> bb4; } @@ -55,15 +55,15 @@ bb5: { StorageLive(_8); - _8 = ((_2 as Break).0: usize); + _8 = copy ((_2 as Break).0: usize); _0 = const Option::<i32>::None; StorageDead(_8); goto -> bb7; } bb6: { - _7 = ((_2 as Continue).0: i32); - _0 = Option::<i32>::Some(_7); + _7 = copy ((_2 as Continue).0: i32); + _0 = Option::<i32>::Some(copy _7); goto -> bb7; } diff --git a/tests/mir-opt/set_no_discriminant.f.JumpThreading.diff b/tests/mir-opt/set_no_discriminant.f.JumpThreading.diff index bc28e81c9a8..3d9852aef65 100644 --- a/tests/mir-opt/set_no_discriminant.f.JumpThreading.diff +++ b/tests/mir-opt/set_no_discriminant.f.JumpThreading.diff @@ -10,7 +10,7 @@ _2 = E::<char>::A; discriminant(_2) = 1; _1 = discriminant(_2); - switchInt(_1) -> [0: bb1, otherwise: bb2]; + switchInt(copy _1) -> [0: bb1, otherwise: bb2]; } bb1: { diff --git a/tests/mir-opt/set_no_discriminant.generic.JumpThreading.diff b/tests/mir-opt/set_no_discriminant.generic.JumpThreading.diff index 78bfeef3c64..c7af1638316 100644 --- a/tests/mir-opt/set_no_discriminant.generic.JumpThreading.diff +++ b/tests/mir-opt/set_no_discriminant.generic.JumpThreading.diff @@ -10,7 +10,7 @@ _2 = E::<T>::A; discriminant(_2) = 1; _1 = discriminant(_2); - switchInt(_1) -> [0: bb1, otherwise: bb2]; + switchInt(copy _1) -> [0: bb1, otherwise: bb2]; } bb1: { diff --git a/tests/mir-opt/simplify_dead_blocks.assert_nonzero_nonmax.SimplifyCfg-after-unreachable-enum-branching.diff b/tests/mir-opt/simplify_dead_blocks.assert_nonzero_nonmax.SimplifyCfg-after-unreachable-enum-branching.diff index 4400cfaef81..9c8efab5c84 100644 --- a/tests/mir-opt/simplify_dead_blocks.assert_nonzero_nonmax.SimplifyCfg-after-unreachable-enum-branching.diff +++ b/tests/mir-opt/simplify_dead_blocks.assert_nonzero_nonmax.SimplifyCfg-after-unreachable-enum-branching.diff @@ -5,8 +5,8 @@ let mut _0: u8; bb0: { -- switchInt(_1) -> [0: bb3, 1: bb2, 255: bb3, otherwise: bb4]; -+ switchInt(_1) -> [0: bb2, 1: bb1, 255: bb2, otherwise: bb3]; +- switchInt(copy _1) -> [0: bb3, 1: bb2, 255: bb3, otherwise: bb4]; ++ switchInt(copy _1) -> [0: bb2, 1: bb1, 255: bb2, otherwise: bb3]; } bb1: { @@ -26,7 +26,7 @@ - bb4: { + bb3: { - _0 = _1; + _0 = copy _1; return; } } diff --git a/tests/mir-opt/simplify_dead_blocks.rs b/tests/mir-opt/simplify_dead_blocks.rs index b9a404fd35c..7f2134c6121 100644 --- a/tests/mir-opt/simplify_dead_blocks.rs +++ b/tests/mir-opt/simplify_dead_blocks.rs @@ -10,7 +10,7 @@ use std::intrinsics::mir::*; pub unsafe fn assert_nonzero_nonmax(x: u8) -> u8 { // CHECK-LABEL: fn assert_nonzero_nonmax( // CHECK: bb0: { - // CHECK-NEXT: switchInt({{.*}}) -> [0: [[unreachable:bb.*]], 1: [[retblock2:bb.*]], 255: [[unreachable:bb.*]], otherwise: [[retblock:bb.*]]]; + // CHECK-NEXT: switchInt(copy {{_[0-9]+}}) -> [0: [[unreachable:bb.*]], 1: [[retblock2:bb.*]], 255: [[unreachable:bb.*]], otherwise: [[retblock:bb.*]]]; // CHECK-NEXT: } // CHECK-NOT: _0 = const 1_u8; // CHECK: [[retblock2]]: { @@ -21,7 +21,7 @@ pub unsafe fn assert_nonzero_nonmax(x: u8) -> u8 { // CHECK-NEXT: unreachable; // CHECK-NEXT: } // CHECK: [[retblock]]: { - // CHECK-NEXT: _0 = _1; + // CHECK-NEXT: _0 = copy _1; // CHECK-NEXT: return; // CHECK-NEXT: } mir! { diff --git a/tests/mir-opt/simplify_locals.expose_provenance.SimplifyLocals-before-const-prop.diff b/tests/mir-opt/simplify_locals.expose_provenance.SimplifyLocals-before-const-prop.diff index cc5c642407e..420fb4270b2 100644 --- a/tests/mir-opt/simplify_locals.expose_provenance.SimplifyLocals-before-const-prop.diff +++ b/tests/mir-opt/simplify_locals.expose_provenance.SimplifyLocals-before-const-prop.diff @@ -10,7 +10,7 @@ bb0: { StorageLive(_2); StorageLive(_3); - _3 = _1; + _3 = copy _1; _2 = move _3 as usize (PointerExposeProvenance); StorageDead(_3); StorageDead(_2); diff --git a/tests/mir-opt/simplify_locals.t1.SimplifyLocals-before-const-prop.diff b/tests/mir-opt/simplify_locals.t1.SimplifyLocals-before-const-prop.diff index 526ff2f25cf..f05a3935d65 100644 --- a/tests/mir-opt/simplify_locals.t1.SimplifyLocals-before-const-prop.diff +++ b/tests/mir-opt/simplify_locals.t1.SimplifyLocals-before-const-prop.diff @@ -10,7 +10,7 @@ - StorageLive(_1); - StorageLive(_2); - _2 = &/*tls*/ mut X; -- _1 = (*_2); +- _1 = copy (*_2); - StorageDead(_2); - StorageDead(_1); _0 = const (); diff --git a/tests/mir-opt/simplify_locals.t3.SimplifyLocals-before-const-prop.diff b/tests/mir-opt/simplify_locals.t3.SimplifyLocals-before-const-prop.diff index 5d45d7ac781..a57c136e64d 100644 --- a/tests/mir-opt/simplify_locals.t3.SimplifyLocals-before-const-prop.diff +++ b/tests/mir-opt/simplify_locals.t3.SimplifyLocals-before-const-prop.diff @@ -13,7 +13,7 @@ - StorageLive(_3); - _3 = &/*tls*/ mut X; - _2 = &mut (*_3); -- _1 = (*_2); +- _1 = copy (*_2); - StorageDead(_3); - StorageDead(_2); - StorageDead(_1); diff --git a/tests/mir-opt/simplify_locals.t4.SimplifyLocals-before-const-prop.diff b/tests/mir-opt/simplify_locals.t4.SimplifyLocals-before-const-prop.diff index 4f4855dbaaf..118193fd4fd 100644 --- a/tests/mir-opt/simplify_locals.t4.SimplifyLocals-before-const-prop.diff +++ b/tests/mir-opt/simplify_locals.t4.SimplifyLocals-before-const-prop.diff @@ -10,7 +10,7 @@ StorageLive(_1); StorageLive(_2); _2 = &/*tls*/ mut X; - _1 = (*_2); + _1 = copy (*_2); _0 = Add(move _1, const 1_u32); StorageDead(_1); StorageDead(_2); diff --git a/tests/mir-opt/simplify_locals_fixedpoint.foo.SimplifyLocals-final.panic-abort.diff b/tests/mir-opt/simplify_locals_fixedpoint.foo.SimplifyLocals-final.panic-abort.diff index c520a159f47..c363dfcbf70 100644 --- a/tests/mir-opt/simplify_locals_fixedpoint.foo.SimplifyLocals-final.panic-abort.diff +++ b/tests/mir-opt/simplify_locals_fixedpoint.foo.SimplifyLocals-final.panic-abort.diff @@ -33,7 +33,7 @@ bb2: { StorageLive(_6); - _6 = (((_1.0: std::option::Option<u8>) as Some).0: u8); + _6 = copy (((_1.0: std::option::Option<u8>) as Some).0: u8); StorageDead(_6); goto -> bb3; } diff --git a/tests/mir-opt/simplify_locals_fixedpoint.foo.SimplifyLocals-final.panic-unwind.diff b/tests/mir-opt/simplify_locals_fixedpoint.foo.SimplifyLocals-final.panic-unwind.diff index 686581591fc..895b0067d2e 100644 --- a/tests/mir-opt/simplify_locals_fixedpoint.foo.SimplifyLocals-final.panic-unwind.diff +++ b/tests/mir-opt/simplify_locals_fixedpoint.foo.SimplifyLocals-final.panic-unwind.diff @@ -33,7 +33,7 @@ bb2: { StorageLive(_6); - _6 = (((_1.0: std::option::Option<u8>) as Some).0: u8); + _6 = copy (((_1.0: std::option::Option<u8>) as Some).0: u8); StorageDead(_6); goto -> bb3; } diff --git a/tests/mir-opt/simplify_locals_removes_unused_consts.main.SimplifyLocals-before-const-prop.panic-abort.diff b/tests/mir-opt/simplify_locals_removes_unused_consts.main.SimplifyLocals-before-const-prop.panic-abort.diff index 54d254ee374..58c265c5e60 100644 --- a/tests/mir-opt/simplify_locals_removes_unused_consts.main.SimplifyLocals-before-const-prop.panic-abort.diff +++ b/tests/mir-opt/simplify_locals_removes_unused_consts.main.SimplifyLocals-before-const-prop.panic-abort.diff @@ -51,7 +51,7 @@ - _5 = (move _6, move _7); + StorageLive(_8); + _8 = Temp { x: const 40_u8 }; -+ _7 = (_8.0: u8); ++ _7 = copy (_8.0: u8); + _6 = Add(move _7, const 2_u8); StorageDead(_7); - StorageDead(_6); @@ -67,7 +67,7 @@ - StorageLive(_10); - StorageLive(_11); - _11 = Temp { x: const 40_u8 }; -- _10 = (_11.0: u8); +- _10 = copy (_11.0: u8); - _9 = Add(move _10, const 2_u8); - StorageDead(_10); - _8 = use_u8(move _9) -> [return: bb2, unwind unreachable]; diff --git a/tests/mir-opt/simplify_locals_removes_unused_consts.main.SimplifyLocals-before-const-prop.panic-unwind.diff b/tests/mir-opt/simplify_locals_removes_unused_consts.main.SimplifyLocals-before-const-prop.panic-unwind.diff index a5d9bbc49af..748e1661c98 100644 --- a/tests/mir-opt/simplify_locals_removes_unused_consts.main.SimplifyLocals-before-const-prop.panic-unwind.diff +++ b/tests/mir-opt/simplify_locals_removes_unused_consts.main.SimplifyLocals-before-const-prop.panic-unwind.diff @@ -51,7 +51,7 @@ - _5 = (move _6, move _7); + StorageLive(_8); + _8 = Temp { x: const 40_u8 }; -+ _7 = (_8.0: u8); ++ _7 = copy (_8.0: u8); + _6 = Add(move _7, const 2_u8); StorageDead(_7); - StorageDead(_6); @@ -67,7 +67,7 @@ - StorageLive(_10); - StorageLive(_11); - _11 = Temp { x: const 40_u8 }; -- _10 = (_11.0: u8); +- _10 = copy (_11.0: u8); - _9 = Add(move _10, const 2_u8); - StorageDead(_10); - _8 = use_u8(move _9) -> [return: bb2, unwind continue]; diff --git a/tests/mir-opt/simplify_match.main.GVN.panic-abort.diff b/tests/mir-opt/simplify_match.main.GVN.panic-abort.diff index 33b36f660cb..9e798cbcac0 100644 --- a/tests/mir-opt/simplify_match.main.GVN.panic-abort.diff +++ b/tests/mir-opt/simplify_match.main.GVN.panic-abort.diff @@ -14,9 +14,9 @@ - StorageLive(_2); + nop; _2 = const false; -- _1 = _2; +- _1 = copy _2; - StorageDead(_2); -- switchInt(_1) -> [0: bb2, otherwise: bb1]; +- switchInt(copy _1) -> [0: bb2, otherwise: bb1]; + _1 = const false; + nop; + switchInt(const false) -> [0: bb2, otherwise: bb1]; diff --git a/tests/mir-opt/simplify_match.main.GVN.panic-unwind.diff b/tests/mir-opt/simplify_match.main.GVN.panic-unwind.diff index e5c3adff623..e243ff45ab0 100644 --- a/tests/mir-opt/simplify_match.main.GVN.panic-unwind.diff +++ b/tests/mir-opt/simplify_match.main.GVN.panic-unwind.diff @@ -14,9 +14,9 @@ - StorageLive(_2); + nop; _2 = const false; -- _1 = _2; +- _1 = copy _2; - StorageDead(_2); -- switchInt(_1) -> [0: bb2, otherwise: bb1]; +- switchInt(copy _1) -> [0: bb2, otherwise: bb1]; + _1 = const false; + nop; + switchInt(const false) -> [0: bb2, otherwise: bb1]; diff --git a/tests/mir-opt/single_use_consts.if_const_debug.SingleUseConsts.panic-abort.diff b/tests/mir-opt/single_use_consts.if_const_debug.SingleUseConsts.panic-abort.diff index ad1a2b300f2..0269c2cba20 100644 --- a/tests/mir-opt/single_use_consts.if_const_debug.SingleUseConsts.panic-abort.diff +++ b/tests/mir-opt/single_use_consts.if_const_debug.SingleUseConsts.panic-abort.diff @@ -22,7 +22,7 @@ bb1: { StorageDead(_2); StorageLive(_3); -- _3 = _1; +- _3 = copy _1; + _3 = const <T as MyTrait>::ASSOC_BOOL; switchInt(move _3) -> [0: bb3, otherwise: bb2]; } diff --git a/tests/mir-opt/single_use_consts.if_const_debug.SingleUseConsts.panic-unwind.diff b/tests/mir-opt/single_use_consts.if_const_debug.SingleUseConsts.panic-unwind.diff index 827a292e5d0..1285b8b33ba 100644 --- a/tests/mir-opt/single_use_consts.if_const_debug.SingleUseConsts.panic-unwind.diff +++ b/tests/mir-opt/single_use_consts.if_const_debug.SingleUseConsts.panic-unwind.diff @@ -22,7 +22,7 @@ bb1: { StorageDead(_2); StorageLive(_3); -- _3 = _1; +- _3 = copy _1; + _3 = const <T as MyTrait>::ASSOC_BOOL; switchInt(move _3) -> [0: bb3, otherwise: bb2]; } diff --git a/tests/mir-opt/single_use_consts.match_const.SingleUseConsts.panic-abort.diff b/tests/mir-opt/single_use_consts.match_const.SingleUseConsts.panic-abort.diff index 998b89919d1..354e0988a00 100644 --- a/tests/mir-opt/single_use_consts.match_const.SingleUseConsts.panic-abort.diff +++ b/tests/mir-opt/single_use_consts.match_const.SingleUseConsts.panic-abort.diff @@ -8,7 +8,7 @@ bb0: { StorageLive(_1); - _1 = const <T as MyTrait>::ASSOC_INT; -- switchInt(_1) -> [7: bb3, 42: bb2, otherwise: bb1]; +- switchInt(copy _1) -> [7: bb3, 42: bb2, otherwise: bb1]; + nop; + switchInt(const <T as MyTrait>::ASSOC_INT) -> [7: bb3, 42: bb2, otherwise: bb1]; } diff --git a/tests/mir-opt/single_use_consts.match_const.SingleUseConsts.panic-unwind.diff b/tests/mir-opt/single_use_consts.match_const.SingleUseConsts.panic-unwind.diff index 998b89919d1..354e0988a00 100644 --- a/tests/mir-opt/single_use_consts.match_const.SingleUseConsts.panic-unwind.diff +++ b/tests/mir-opt/single_use_consts.match_const.SingleUseConsts.panic-unwind.diff @@ -8,7 +8,7 @@ bb0: { StorageLive(_1); - _1 = const <T as MyTrait>::ASSOC_INT; -- switchInt(_1) -> [7: bb3, 42: bb2, otherwise: bb1]; +- switchInt(copy _1) -> [7: bb3, 42: bb2, otherwise: bb1]; + nop; + switchInt(const <T as MyTrait>::ASSOC_INT) -> [7: bb3, 42: bb2, otherwise: bb1]; } diff --git a/tests/mir-opt/single_use_consts.match_const_debug.SingleUseConsts.panic-abort.diff b/tests/mir-opt/single_use_consts.match_const_debug.SingleUseConsts.panic-abort.diff index 30f66ef6b82..5cf37dc97cb 100644 --- a/tests/mir-opt/single_use_consts.match_const_debug.SingleUseConsts.panic-abort.diff +++ b/tests/mir-opt/single_use_consts.match_const_debug.SingleUseConsts.panic-abort.diff @@ -20,7 +20,7 @@ bb1: { StorageDead(_2); -- switchInt(_1) -> [7: bb4, 42: bb3, otherwise: bb2]; +- switchInt(copy _1) -> [7: bb4, 42: bb3, otherwise: bb2]; + switchInt(const <T as MyTrait>::ASSOC_INT) -> [7: bb4, 42: bb3, otherwise: bb2]; } diff --git a/tests/mir-opt/single_use_consts.match_const_debug.SingleUseConsts.panic-unwind.diff b/tests/mir-opt/single_use_consts.match_const_debug.SingleUseConsts.panic-unwind.diff index ed12ad4b93e..bdcf086e8d9 100644 --- a/tests/mir-opt/single_use_consts.match_const_debug.SingleUseConsts.panic-unwind.diff +++ b/tests/mir-opt/single_use_consts.match_const_debug.SingleUseConsts.panic-unwind.diff @@ -20,7 +20,7 @@ bb1: { StorageDead(_2); -- switchInt(_1) -> [7: bb4, 42: bb3, otherwise: bb2]; +- switchInt(copy _1) -> [7: bb4, 42: bb3, otherwise: bb2]; + switchInt(const <T as MyTrait>::ASSOC_INT) -> [7: bb4, 42: bb3, otherwise: bb2]; } diff --git a/tests/mir-opt/slice_drop_shim.core.ptr-drop_in_place.[String].AddMovesForPackedDrops.before.mir b/tests/mir-opt/slice_drop_shim.core.ptr-drop_in_place.[String].AddMovesForPackedDrops.before.mir index 3a8b457a7a1..4d1eaa6ffe3 100644 --- a/tests/mir-opt/slice_drop_shim.core.ptr-drop_in_place.[String].AddMovesForPackedDrops.before.mir +++ b/tests/mir-opt/slice_drop_shim.core.ptr-drop_in_place.[String].AddMovesForPackedDrops.before.mir @@ -28,7 +28,7 @@ fn std::ptr::drop_in_place(_1: *mut [String]) -> () { } bb4 (cleanup): { - _5 = Eq(_3, _2); + _5 = Eq(copy _3, copy _2); switchInt(move _5) -> [0: bb3, otherwise: bb2]; } @@ -39,7 +39,7 @@ fn std::ptr::drop_in_place(_1: *mut [String]) -> () { } bb6: { - _7 = Eq(_3, _2); + _7 = Eq(copy _3, copy _2); switchInt(move _7) -> [0: bb5, otherwise: bb1]; } diff --git a/tests/mir-opt/sroa/lifetimes.foo.ScalarReplacementOfAggregates.diff b/tests/mir-opt/sroa/lifetimes.foo.ScalarReplacementOfAggregates.diff index 819f3f86d14..478dacc3276 100644 --- a/tests/mir-opt/sroa/lifetimes.foo.ScalarReplacementOfAggregates.diff +++ b/tests/mir-opt/sroa/lifetimes.foo.ScalarReplacementOfAggregates.diff @@ -75,8 +75,8 @@ - _5 = move (_1.0: std::result::Result<std::boxed::Box<dyn std::fmt::Display>, <T as Err>::Err>); + _5 = move _29; StorageLive(_6); -- _6 = (_1.1: u32); -+ _6 = _30; +- _6 = copy (_1.1: u32); ++ _6 = copy _30; _7 = discriminant(_5); switchInt(move _7) -> [0: bb2, otherwise: bb7]; } @@ -171,7 +171,7 @@ } bb11: { - switchInt(_25) -> [0: bb10, otherwise: bb12]; + switchInt(copy _25) -> [0: bb10, otherwise: bb12]; } bb12: { diff --git a/tests/mir-opt/sroa/structs.constant.ScalarReplacementOfAggregates.diff b/tests/mir-opt/sroa/structs.constant.ScalarReplacementOfAggregates.diff index 5d21e793982..4da3eb0ed76 100644 --- a/tests/mir-opt/sroa/structs.constant.ScalarReplacementOfAggregates.diff +++ b/tests/mir-opt/sroa/structs.constant.ScalarReplacementOfAggregates.diff @@ -29,11 +29,11 @@ + _4 = move (_1.0: usize); + _5 = move (_1.1: u8); StorageLive(_2); -- _2 = (_1.0: usize); -+ _2 = _4; +- _2 = copy (_1.0: usize); ++ _2 = copy _4; StorageLive(_3); -- _3 = (_1.1: u8); -+ _3 = _5; +- _3 = copy (_1.1: u8); ++ _3 = copy _5; _0 = const (); StorageDead(_3); StorageDead(_2); diff --git a/tests/mir-opt/sroa/structs.copies.ScalarReplacementOfAggregates.diff b/tests/mir-opt/sroa/structs.copies.ScalarReplacementOfAggregates.diff index 3621338635e..cfc086d6596 100644 --- a/tests/mir-opt/sroa/structs.copies.ScalarReplacementOfAggregates.diff +++ b/tests/mir-opt/sroa/structs.copies.ScalarReplacementOfAggregates.diff @@ -43,38 +43,38 @@ bb0: { - StorageLive(_2); -- _2 = _1; +- _2 = copy _1; + StorageLive(_11); + StorageLive(_12); + StorageLive(_13); + StorageLive(_14); + nop; -+ _11 = (_1.0: u8); -+ _12 = (_1.1: ()); -+ _13 = (_1.2: &str); -+ _14 = (_1.3: std::option::Option<isize>); ++ _11 = copy (_1.0: u8); ++ _12 = copy (_1.1: ()); ++ _13 = copy (_1.2: &str); ++ _14 = copy (_1.3: std::option::Option<isize>); + nop; StorageLive(_3); -- _3 = (_2.0: u8); -+ _3 = _11; +- _3 = copy (_2.0: u8); ++ _3 = copy _11; StorageLive(_4); -- _4 = (_2.2: &str); +- _4 = copy (_2.2: &str); - StorageLive(_5); -- _5 = _2; -+ _4 = _13; +- _5 = copy _2; ++ _4 = copy _13; + StorageLive(_7); + StorageLive(_8); + StorageLive(_9); + StorageLive(_10); + nop; -+ _7 = _11; -+ _8 = _12; -+ _9 = _13; -+ _10 = _14; ++ _7 = copy _11; ++ _8 = copy _12; ++ _9 = copy _13; ++ _10 = copy _14; + nop; StorageLive(_6); -- _6 = (_5.1: ()); -+ _6 = _8; +- _6 = copy (_5.1: ()); ++ _6 = copy _8; _0 = const (); StorageDead(_6); - StorageDead(_5); diff --git a/tests/mir-opt/sroa/structs.enums.ScalarReplacementOfAggregates.diff b/tests/mir-opt/sroa/structs.enums.ScalarReplacementOfAggregates.diff index b5e39e63247..eda884de822 100644 --- a/tests/mir-opt/sroa/structs.enums.ScalarReplacementOfAggregates.diff +++ b/tests/mir-opt/sroa/structs.enums.ScalarReplacementOfAggregates.diff @@ -15,7 +15,7 @@ bb0: { StorageLive(_2); StorageLive(_3); - _3 = _1; + _3 = copy _1; _2 = Option::<usize>::Some(move _3); StorageDead(_3); _4 = discriminant(_2); @@ -24,8 +24,8 @@ bb1: { StorageLive(_5); - _5 = ((_2 as Some).0: usize); - _0 = _5; + _5 = copy ((_2 as Some).0: usize); + _0 = copy _5; StorageDead(_5); goto -> bb3; } diff --git a/tests/mir-opt/sroa/structs.flat.ScalarReplacementOfAggregates.diff b/tests/mir-opt/sroa/structs.flat.ScalarReplacementOfAggregates.diff index a84048365a4..77c7c1a9012 100644 --- a/tests/mir-opt/sroa/structs.flat.ScalarReplacementOfAggregates.diff +++ b/tests/mir-opt/sroa/structs.flat.ScalarReplacementOfAggregates.diff @@ -49,18 +49,18 @@ StorageDead(_7); StorageDead(_6); StorageLive(_1); -- _1 = (_5.0: u8); -+ _1 = _8; +- _1 = copy (_5.0: u8); ++ _1 = copy _8; StorageLive(_2); -- _2 = (_5.1: ()); -+ _2 = _9; +- _2 = copy (_5.1: ()); ++ _2 = copy _9; StorageLive(_3); -- _3 = (_5.2: &str); -+ _3 = _10; +- _3 = copy (_5.2: &str); ++ _3 = copy _10; StorageLive(_4); -- _4 = (_5.3: std::option::Option<isize>); +- _4 = copy (_5.3: std::option::Option<isize>); - StorageDead(_5); -+ _4 = _11; ++ _4 = copy _11; + StorageDead(_8); + StorageDead(_9); + StorageDead(_10); diff --git a/tests/mir-opt/sroa/structs.ref_copies.ScalarReplacementOfAggregates.diff b/tests/mir-opt/sroa/structs.ref_copies.ScalarReplacementOfAggregates.diff index 304bf2fb1a7..abe7cd78878 100644 --- a/tests/mir-opt/sroa/structs.ref_copies.ScalarReplacementOfAggregates.diff +++ b/tests/mir-opt/sroa/structs.ref_copies.ScalarReplacementOfAggregates.diff @@ -27,23 +27,23 @@ bb0: { - StorageLive(_2); -- _2 = (*_1); +- _2 = copy (*_1); + StorageLive(_5); + StorageLive(_6); + StorageLive(_7); + StorageLive(_8); + nop; -+ _5 = ((*_1).0: u8); -+ _6 = ((*_1).1: ()); -+ _7 = ((*_1).2: &str); -+ _8 = ((*_1).3: std::option::Option<isize>); ++ _5 = copy ((*_1).0: u8); ++ _6 = copy ((*_1).1: ()); ++ _7 = copy ((*_1).2: &str); ++ _8 = copy ((*_1).3: std::option::Option<isize>); + nop; StorageLive(_3); -- _3 = (_2.0: u8); -+ _3 = _5; +- _3 = copy (_2.0: u8); ++ _3 = copy _5; StorageLive(_4); -- _4 = (_2.2: &str); -+ _4 = _7; +- _4 = copy (_2.2: &str); ++ _4 = copy _7; _0 = const (); StorageDead(_4); StorageDead(_3); diff --git a/tests/mir-opt/sroa/structs.rs b/tests/mir-opt/sroa/structs.rs index a177dbf71cf..d5f13f8b009 100644 --- a/tests/mir-opt/sroa/structs.rs +++ b/tests/mir-opt/sroa/structs.rs @@ -31,8 +31,8 @@ pub fn enums(a: usize) -> usize { // CHECK: bb0: { // CHECK: [[enum]] = Option::<usize>::Some - // CHECK: _5 = (([[enum]] as Some).0: usize) - // CHECK: _0 = _5 + // CHECK: _5 = copy (([[enum]] as Some).0: usize) + // CHECK: _0 = copy _5 if let Some(a) = Some(a) { a } else { 0 } } @@ -51,13 +51,13 @@ pub fn structs(a: f32) -> f32 { // CHECK: bb0: { // CHECK-NOT: [[struct]] - // CHECK: [[a_tmp]] = _1; + // CHECK: [[a_tmp]] = copy _1; // CHECK-NOT: [[struct]] // CHECK: [[foo]] = const 0_usize; // CHECK-NOT: [[struct]] // CHECK: [[a_ret]] = move [[a_tmp]]; // CHECK-NOT: [[struct]] - // CHECK: _0 = [[a_ret]]; + // CHECK: _0 = copy [[a_ret]]; // CHECK-NOT: [[struct]] U { _foo: 0, a }.a } @@ -73,7 +73,7 @@ pub fn unions(a: f32) -> u32 { // CHECK: bb0: { // CHECK: [[union]] = Repr { - // CHECK: _0 = ([[union]].1: u32) + // CHECK: _0 = copy ([[union]].1: u32) unsafe { Repr { f: a }.u } } @@ -156,10 +156,10 @@ fn copies(x: Foo) { // CHECK: [[opt_isize:_[0-9]+]]: std::option::Option<isize>; // CHECK: bb0: { - // CHECK: [[byte]] = ([[external]].0 - // CHECK: [[unit]] = ([[external]].1 - // CHECK: [[str]] = ([[external]].2 - // CHECK: [[opt_isize]] = ([[external]].3 + // CHECK: [[byte]] = copy ([[external]].0 + // CHECK: [[unit]] = copy ([[external]].1 + // CHECK: [[str]] = copy ([[external]].2 + // CHECK: [[opt_isize]] = copy ([[external]].3 let y = x; let t = y.a; @@ -181,10 +181,10 @@ fn ref_copies(x: &Foo) { // CHECK: [[opt_isize:_[0-9]+]]: std::option::Option<isize>; // CHECK: bb0: { - // CHECK: [[byte]] = ((*[[external]]).0 - // CHECK: [[unit]] = ((*[[external]]).1 - // CHECK: [[str]] = ((*[[external]]).2 - // CHECK: [[opt_isize]] = ((*[[external]]).3 + // CHECK: [[byte]] = copy ((*[[external]]).0 + // CHECK: [[unit]] = copy ((*[[external]]).1 + // CHECK: [[str]] = copy ((*[[external]]).2 + // CHECK: [[opt_isize]] = copy ((*[[external]]).3 let y = *x; let t = y.a; diff --git a/tests/mir-opt/sroa/structs.structs.ScalarReplacementOfAggregates.diff b/tests/mir-opt/sroa/structs.structs.ScalarReplacementOfAggregates.diff index bf5c3e3bd03..fe9deabe940 100644 --- a/tests/mir-opt/sroa/structs.structs.ScalarReplacementOfAggregates.diff +++ b/tests/mir-opt/sroa/structs.structs.ScalarReplacementOfAggregates.diff @@ -15,15 +15,15 @@ + StorageLive(_5); + nop; StorageLive(_3); - _3 = _1; + _3 = copy _1; - _2 = U { _foo: const 0_usize, a: move _3 }; + _4 = const 0_usize; + _5 = move _3; + nop; StorageDead(_3); -- _0 = (_2.1: f32); +- _0 = copy (_2.1: f32); - StorageDead(_2); -+ _0 = _5; ++ _0 = copy _5; + StorageDead(_4); + StorageDead(_5); + nop; diff --git a/tests/mir-opt/sroa/structs.unions.ScalarReplacementOfAggregates.diff b/tests/mir-opt/sroa/structs.unions.ScalarReplacementOfAggregates.diff index 2f8dfcc5d63..115f163cda9 100644 --- a/tests/mir-opt/sroa/structs.unions.ScalarReplacementOfAggregates.diff +++ b/tests/mir-opt/sroa/structs.unions.ScalarReplacementOfAggregates.diff @@ -10,10 +10,10 @@ bb0: { StorageLive(_2); StorageLive(_3); - _3 = _1; + _3 = copy _1; _2 = Repr { f: move _3 }; StorageDead(_3); - _0 = (_2.1: u32); + _0 = copy (_2.1: u32); StorageDead(_2); return; } diff --git a/tests/mir-opt/storage_ranges.main.nll.0.mir b/tests/mir-opt/storage_ranges.main.nll.0.mir index 782efd5acc6..bc2dcfe0a64 100644 --- a/tests/mir-opt/storage_ranges.main.nll.0.mir +++ b/tests/mir-opt/storage_ranges.main.nll.0.mir @@ -43,7 +43,7 @@ fn main() -> () { StorageLive(_3); StorageLive(_4); StorageLive(_5); - _5 = _1; + _5 = copy _1; _4 = Option::<i32>::Some(move _5); StorageDead(_5); _3 = &_4; diff --git a/tests/mir-opt/switch_to_self.test.MatchBranchSimplification.diff b/tests/mir-opt/switch_to_self.test.MatchBranchSimplification.diff index c0b599e060b..fef708d9962 100644 --- a/tests/mir-opt/switch_to_self.test.MatchBranchSimplification.diff +++ b/tests/mir-opt/switch_to_self.test.MatchBranchSimplification.diff @@ -9,11 +9,11 @@ } bb1: { - switchInt(_1) -> [0: bb1, otherwise: bb2]; + switchInt(copy _1) -> [0: bb1, otherwise: bb2]; } bb2: { - switchInt(_1) -> [0: bb1, otherwise: bb2]; + switchInt(copy _1) -> [0: bb1, otherwise: bb2]; } } diff --git a/tests/mir-opt/tail_call_drops.f.ElaborateDrops.panic-abort.diff b/tests/mir-opt/tail_call_drops.f.ElaborateDrops.panic-abort.diff index 44673ea00a9..17c64d4baf0 100644 --- a/tests/mir-opt/tail_call_drops.f.ElaborateDrops.panic-abort.diff +++ b/tests/mir-opt/tail_call_drops.f.ElaborateDrops.panic-abort.diff @@ -102,7 +102,7 @@ + } + + bb14 (cleanup): { -+ switchInt(_8) -> [0: bb11, otherwise: bb13]; ++ switchInt(copy _8) -> [0: bb11, otherwise: bb13]; } } diff --git a/tests/mir-opt/tail_call_drops.f.ElaborateDrops.panic-unwind.diff b/tests/mir-opt/tail_call_drops.f.ElaborateDrops.panic-unwind.diff index a6d33a24595..58d8a87986d 100644 --- a/tests/mir-opt/tail_call_drops.f.ElaborateDrops.panic-unwind.diff +++ b/tests/mir-opt/tail_call_drops.f.ElaborateDrops.panic-unwind.diff @@ -103,7 +103,7 @@ + } + + bb14 (cleanup): { -+ switchInt(_8) -> [0: bb11, otherwise: bb13]; ++ switchInt(copy _8) -> [0: bb11, otherwise: bb13]; } } diff --git a/tests/mir-opt/tail_call_drops.f_with_arg.ElaborateDrops.panic-abort.diff b/tests/mir-opt/tail_call_drops.f_with_arg.ElaborateDrops.panic-abort.diff index c7df2bb2207..1a51601bc56 100644 --- a/tests/mir-opt/tail_call_drops.f_with_arg.ElaborateDrops.panic-abort.diff +++ b/tests/mir-opt/tail_call_drops.f_with_arg.ElaborateDrops.panic-abort.diff @@ -178,7 +178,7 @@ + } + + bb31 (cleanup): { -+ switchInt(_12) -> [0: bb26, otherwise: bb30]; ++ switchInt(copy _12) -> [0: bb26, otherwise: bb30]; } } diff --git a/tests/mir-opt/tail_call_drops.f_with_arg.ElaborateDrops.panic-unwind.diff b/tests/mir-opt/tail_call_drops.f_with_arg.ElaborateDrops.panic-unwind.diff index c7df2bb2207..1a51601bc56 100644 --- a/tests/mir-opt/tail_call_drops.f_with_arg.ElaborateDrops.panic-unwind.diff +++ b/tests/mir-opt/tail_call_drops.f_with_arg.ElaborateDrops.panic-unwind.diff @@ -178,7 +178,7 @@ + } + + bb31 (cleanup): { -+ switchInt(_12) -> [0: bb26, otherwise: bb30]; ++ switchInt(copy _12) -> [0: bb26, otherwise: bb30]; } } diff --git a/tests/mir-opt/unnamed-fields/field_access.bar.SimplifyCfg-initial.after.mir b/tests/mir-opt/unnamed-fields/field_access.bar.SimplifyCfg-initial.after.mir index f0311422c17..f1904e5d0f4 100644 --- a/tests/mir-opt/unnamed-fields/field_access.bar.SimplifyCfg-initial.after.mir +++ b/tests/mir-opt/unnamed-fields/field_access.bar.SimplifyCfg-initial.after.mir @@ -15,7 +15,7 @@ fn bar(_1: Bar) -> () { bb0: { StorageLive(_2); StorageLive(_3); - _3 = (_1.0: u8); + _3 = copy (_1.0: u8); _2 = access::<u8>(move _3) -> [return: bb1, unwind: bb5]; } @@ -24,7 +24,7 @@ fn bar(_1: Bar) -> () { StorageDead(_2); StorageLive(_4); StorageLive(_5); - _5 = ((_1.1: Bar::{anon_adt#0}).0: i8); + _5 = copy ((_1.1: Bar::{anon_adt#0}).0: i8); _4 = access::<i8>(move _5) -> [return: bb2, unwind: bb5]; } @@ -33,7 +33,7 @@ fn bar(_1: Bar) -> () { StorageDead(_4); StorageLive(_6); StorageLive(_7); - _7 = ((_1.1: Bar::{anon_adt#0}).1: bool); + _7 = copy ((_1.1: Bar::{anon_adt#0}).1: bool); _6 = access::<bool>(move _7) -> [return: bb3, unwind: bb5]; } @@ -42,7 +42,7 @@ fn bar(_1: Bar) -> () { StorageDead(_6); StorageLive(_8); StorageLive(_9); - _9 = (((_1.2: Bar::{anon_adt#1}).0: Bar::{anon_adt#1}::{anon_adt#0}).0: [u8; 1]); + _9 = copy (((_1.2: Bar::{anon_adt#1}).0: Bar::{anon_adt#1}::{anon_adt#0}).0: [u8; 1]); _8 = access::<[u8; 1]>(move _9) -> [return: bb4, unwind: bb5]; } diff --git a/tests/mir-opt/unnamed-fields/field_access.foo.SimplifyCfg-initial.after.mir b/tests/mir-opt/unnamed-fields/field_access.foo.SimplifyCfg-initial.after.mir index d48a969f06e..c279f590012 100644 --- a/tests/mir-opt/unnamed-fields/field_access.foo.SimplifyCfg-initial.after.mir +++ b/tests/mir-opt/unnamed-fields/field_access.foo.SimplifyCfg-initial.after.mir @@ -15,7 +15,7 @@ fn foo(_1: Foo) -> () { bb0: { StorageLive(_2); StorageLive(_3); - _3 = (_1.0: u8); + _3 = copy (_1.0: u8); _2 = access::<u8>(move _3) -> [return: bb1, unwind: bb5]; } @@ -24,7 +24,7 @@ fn foo(_1: Foo) -> () { StorageDead(_2); StorageLive(_4); StorageLive(_5); - _5 = ((_1.1: Foo::{anon_adt#0}).0: i8); + _5 = copy ((_1.1: Foo::{anon_adt#0}).0: i8); _4 = access::<i8>(move _5) -> [return: bb2, unwind: bb5]; } @@ -33,7 +33,7 @@ fn foo(_1: Foo) -> () { StorageDead(_4); StorageLive(_6); StorageLive(_7); - _7 = ((_1.1: Foo::{anon_adt#0}).1: bool); + _7 = copy ((_1.1: Foo::{anon_adt#0}).1: bool); _6 = access::<bool>(move _7) -> [return: bb3, unwind: bb5]; } @@ -42,7 +42,7 @@ fn foo(_1: Foo) -> () { StorageDead(_6); StorageLive(_8); StorageLive(_9); - _9 = (((_1.2: Foo::{anon_adt#1}).0: Foo::{anon_adt#1}::{anon_adt#0}).0: [u8; 1]); + _9 = copy (((_1.2: Foo::{anon_adt#1}).0: Foo::{anon_adt#1}::{anon_adt#0}).0: [u8; 1]); _8 = access::<[u8; 1]>(move _9) -> [return: bb4, unwind: bb5]; } diff --git a/tests/mir-opt/unreachable.as_match.UnreachablePropagation.panic-abort.diff b/tests/mir-opt/unreachable.as_match.UnreachablePropagation.panic-abort.diff index 1e1ddfae0eb..17ddce0cdf8 100644 --- a/tests/mir-opt/unreachable.as_match.UnreachablePropagation.panic-abort.diff +++ b/tests/mir-opt/unreachable.as_match.UnreachablePropagation.panic-abort.diff @@ -20,7 +20,7 @@ bb1: { _2 = discriminant(_1); - switchInt(move _2) -> [1: bb3, otherwise: bb2]; -+ _5 = Ne(_2, const 1_isize); ++ _5 = Ne(copy _2, const 1_isize); + assume(move _5); + goto -> bb2; } diff --git a/tests/mir-opt/unreachable.as_match.UnreachablePropagation.panic-unwind.diff b/tests/mir-opt/unreachable.as_match.UnreachablePropagation.panic-unwind.diff index 809d24aa15a..2f78092f5bd 100644 --- a/tests/mir-opt/unreachable.as_match.UnreachablePropagation.panic-unwind.diff +++ b/tests/mir-opt/unreachable.as_match.UnreachablePropagation.panic-unwind.diff @@ -20,7 +20,7 @@ bb1: { _2 = discriminant(_1); - switchInt(move _2) -> [1: bb3, otherwise: bb2]; -+ _5 = Ne(_2, const 1_isize); ++ _5 = Ne(copy _2, const 1_isize); + assume(move _5); + goto -> bb2; } diff --git a/tests/mir-opt/unreachable.if_let.UnreachablePropagation.panic-abort.diff b/tests/mir-opt/unreachable.if_let.UnreachablePropagation.panic-abort.diff index 61959732720..2ce37c4422b 100644 --- a/tests/mir-opt/unreachable.if_let.UnreachablePropagation.panic-abort.diff +++ b/tests/mir-opt/unreachable.if_let.UnreachablePropagation.panic-abort.diff @@ -26,7 +26,7 @@ bb1: { _2 = discriminant(_1); - switchInt(move _2) -> [1: bb2, otherwise: bb6]; -+ _8 = Ne(_2, const 1_isize); ++ _8 = Ne(copy _2, const 1_isize); + assume(move _8); + goto -> bb6; } diff --git a/tests/mir-opt/unreachable.if_let.UnreachablePropagation.panic-unwind.diff b/tests/mir-opt/unreachable.if_let.UnreachablePropagation.panic-unwind.diff index 476e2f55994..2dfba10c37d 100644 --- a/tests/mir-opt/unreachable.if_let.UnreachablePropagation.panic-unwind.diff +++ b/tests/mir-opt/unreachable.if_let.UnreachablePropagation.panic-unwind.diff @@ -26,7 +26,7 @@ bb1: { _2 = discriminant(_1); - switchInt(move _2) -> [1: bb2, otherwise: bb6]; -+ _8 = Ne(_2, const 1_isize); ++ _8 = Ne(copy _2, const 1_isize); + assume(move _8); + goto -> bb6; } diff --git a/tests/mir-opt/unreachable_diverging.main.UnreachablePropagation.panic-abort.diff b/tests/mir-opt/unreachable_diverging.main.UnreachablePropagation.panic-abort.diff index 11d7924e736..ba268832ca3 100644 --- a/tests/mir-opt/unreachable_diverging.main.UnreachablePropagation.panic-abort.diff +++ b/tests/mir-opt/unreachable_diverging.main.UnreachablePropagation.panic-abort.diff @@ -35,9 +35,9 @@ _4 = move ((_2 as Some).0: Empty); StorageLive(_5); StorageLive(_6); - _6 = _1; + _6 = copy _1; - switchInt(move _6) -> [0: bb4, otherwise: bb3]; -+ _8 = Ne(_6, const false); ++ _8 = Ne(copy _6, const false); + assume(move _8); + goto -> bb3; } diff --git a/tests/mir-opt/unreachable_diverging.main.UnreachablePropagation.panic-unwind.diff b/tests/mir-opt/unreachable_diverging.main.UnreachablePropagation.panic-unwind.diff index df6f5609fbf..f057f776470 100644 --- a/tests/mir-opt/unreachable_diverging.main.UnreachablePropagation.panic-unwind.diff +++ b/tests/mir-opt/unreachable_diverging.main.UnreachablePropagation.panic-unwind.diff @@ -35,9 +35,9 @@ _4 = move ((_2 as Some).0: Empty); StorageLive(_5); StorageLive(_6); - _6 = _1; + _6 = copy _1; - switchInt(move _6) -> [0: bb4, otherwise: bb3]; -+ _8 = Ne(_6, const false); ++ _8 = Ne(copy _6, const false); + assume(move _8); + goto -> bb3; } diff --git a/tests/mir-opt/unreachable_enum_branching.otherwise_t4_unreachable_default_2.UnreachableEnumBranching.panic-abort.diff b/tests/mir-opt/unreachable_enum_branching.otherwise_t4_unreachable_default_2.UnreachableEnumBranching.panic-abort.diff index 4cd6d3f5683..17e01f38f4e 100644 --- a/tests/mir-opt/unreachable_enum_branching.otherwise_t4_unreachable_default_2.UnreachableEnumBranching.panic-abort.diff +++ b/tests/mir-opt/unreachable_enum_branching.otherwise_t4_unreachable_default_2.UnreachableEnumBranching.panic-abort.diff @@ -29,7 +29,7 @@ } bb2: { - switchInt(((_2 as A).0: i32)) -> [1: bb6, 2: bb5, otherwise: bb1]; + switchInt(copy ((_2 as A).0: i32)) -> [1: bb6, 2: bb5, otherwise: bb1]; } bb3: { diff --git a/tests/mir-opt/unreachable_enum_branching.otherwise_t4_unreachable_default_2.UnreachableEnumBranching.panic-unwind.diff b/tests/mir-opt/unreachable_enum_branching.otherwise_t4_unreachable_default_2.UnreachableEnumBranching.panic-unwind.diff index 4cd6d3f5683..17e01f38f4e 100644 --- a/tests/mir-opt/unreachable_enum_branching.otherwise_t4_unreachable_default_2.UnreachableEnumBranching.panic-unwind.diff +++ b/tests/mir-opt/unreachable_enum_branching.otherwise_t4_unreachable_default_2.UnreachableEnumBranching.panic-unwind.diff @@ -29,7 +29,7 @@ } bb2: { - switchInt(((_2 as A).0: i32)) -> [1: bb6, 2: bb5, otherwise: bb1]; + switchInt(copy ((_2 as A).0: i32)) -> [1: bb6, 2: bb5, otherwise: bb1]; } bb3: { diff --git a/tests/pretty/raw-address-of.rs b/tests/pretty/raw-address-of.rs index 6e97ab99407..c00a16e238a 100644 --- a/tests/pretty/raw-address-of.rs +++ b/tests/pretty/raw-address-of.rs @@ -1,5 +1,4 @@ //@ pp-exact -#![feature(raw_ref_op)] const C_PTR: () = { let a = 1; &raw const a; }; static S_PTR: () = { let b = false; &raw const b; }; diff --git a/tests/run-make/crate-loading/multiple-dep-versions-1.rs b/tests/run-make/crate-loading/multiple-dep-versions-1.rs index 2d351633829..d81462504dd 100644 --- a/tests/run-make/crate-loading/multiple-dep-versions-1.rs +++ b/tests/run-make/crate-loading/multiple-dep-versions-1.rs @@ -1,6 +1,12 @@ #![crate_name = "dependency"] #![crate_type = "rlib"] -pub struct Type; -pub trait Trait {} -impl Trait for Type {} +pub struct Type(pub i32); +pub trait Trait { + fn foo(&self); + fn bar(); +} +impl Trait for Type { + fn foo(&self) {} + fn bar() {} +} pub fn do_something<X: Trait>(_: X) {} diff --git a/tests/run-make/crate-loading/multiple-dep-versions-2.rs b/tests/run-make/crate-loading/multiple-dep-versions-2.rs index a5df3dc61ed..0a566fe2c60 100644 --- a/tests/run-make/crate-loading/multiple-dep-versions-2.rs +++ b/tests/run-make/crate-loading/multiple-dep-versions-2.rs @@ -1,6 +1,12 @@ #![crate_name = "dependency"] #![crate_type = "rlib"] -pub struct Type(pub i32); -pub trait Trait {} -impl Trait for Type {} +pub struct Type; +pub trait Trait { + fn foo(&self); + fn bar(); +} +impl Trait for Type { + fn foo(&self) {} + fn bar() {} +} pub fn do_something<X: Trait>(_: X) {} diff --git a/tests/run-make/crate-loading/multiple-dep-versions-3.rs b/tests/run-make/crate-loading/multiple-dep-versions-3.rs new file mode 100644 index 00000000000..07d888e9f10 --- /dev/null +++ b/tests/run-make/crate-loading/multiple-dep-versions-3.rs @@ -0,0 +1,5 @@ +#![crate_name = "foo"] +#![crate_type = "rlib"] + +extern crate dependency; +pub use dependency::Type; diff --git a/tests/run-make/crate-loading/multiple-dep-versions.rs b/tests/run-make/crate-loading/multiple-dep-versions.rs index 5a6cb03aaa4..8ef042bf418 100644 --- a/tests/run-make/crate-loading/multiple-dep-versions.rs +++ b/tests/run-make/crate-loading/multiple-dep-versions.rs @@ -1,8 +1,10 @@ extern crate dep_2_reexport; extern crate dependency; -use dep_2_reexport::do_something; -use dependency::Type; +use dep_2_reexport::Type; +use dependency::{do_something, Trait}; fn main() { do_something(Type); + Type.foo(); + Type::bar(); } diff --git a/tests/run-make/crate-loading/rmake.rs b/tests/run-make/crate-loading/rmake.rs index d7abd5872c9..13585edf6cc 100644 --- a/tests/run-make/crate-loading/rmake.rs +++ b/tests/run-make/crate-loading/rmake.rs @@ -1,26 +1,100 @@ //@ only-linux //@ ignore-wasm32 //@ ignore-wasm64 +// ignore-tidy-linelength use run_make_support::{rust_lib_name, rustc}; fn main() { rustc().input("multiple-dep-versions-1.rs").run(); rustc().input("multiple-dep-versions-2.rs").extra_filename("2").metadata("2").run(); + rustc() + .input("multiple-dep-versions-3.rs") + .extern_("dependency", rust_lib_name("dependency2")) + .run(); rustc() .input("multiple-dep-versions.rs") .extern_("dependency", rust_lib_name("dependency")) - .extern_("dep_2_reexport", rust_lib_name("dependency2")) + .extern_("dep_2_reexport", rust_lib_name("foo")) .run_fail() .assert_stderr_contains( - "you have multiple different versions of crate `dependency` in your dependency graph", + r#"error[E0277]: the trait bound `dep_2_reexport::Type: Trait` is not satisfied + --> multiple-dep-versions.rs:7:18 + | +7 | do_something(Type); + | ------------ ^^^^ the trait `Trait` is not implemented for `dep_2_reexport::Type` + | | + | required by a bound introduced by this call + | +help: there are multiple different versions of crate `dependency` the your dependency graph + --> multiple-dep-versions.rs:1:1 + | +1 | extern crate dep_2_reexport; + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ one version of crate `dependency` is used here, as a dependency of crate `foo` +2 | extern crate dependency; + | ^^^^^^^^^^^^^^^^^^^^^^^^ one version of crate `dependency` is used here, as a direct dependency of the current crate"#, + ) + .assert_stderr_contains( + r#" +3 | pub struct Type(pub i32); + | ^^^^^^^^^^^^^^^ this type implements the required trait +4 | pub trait Trait { + | --------------- this is the required trait"#, + ) + .assert_stderr_contains( + r#" +3 | pub struct Type; + | ^^^^^^^^^^^^^^^ this type doesn't implement the required trait"#, + ) + .assert_stderr_contains( + r#" +error[E0599]: no method named `foo` found for struct `dep_2_reexport::Type` in the current scope + --> multiple-dep-versions.rs:8:10 + | +8 | Type.foo(); + | ^^^ method not found in `Type` + | +note: there are multiple different versions of crate `dependency` in the dependency graph"#, + ) + .assert_stderr_contains( + r#" +4 | pub trait Trait { + | ^^^^^^^^^^^^^^^ this is the trait that is needed +5 | fn foo(&self); + | -------------- the method is available for `dep_2_reexport::Type` here + | + ::: multiple-dep-versions.rs:4:32 + | +4 | use dependency::{do_something, Trait}; + | ----- `Trait` imported here doesn't correspond to the right version of crate `dependency`"#, ) .assert_stderr_contains( - "two types coming from two different versions of the same crate are different types \ - even if they look the same", + r#" +4 | pub trait Trait { + | --------------- this is the trait that was imported"#, ) - .assert_stderr_contains("this type doesn't implement the required trait") - .assert_stderr_contains("this type implements the required trait") - .assert_stderr_contains("this is the required trait"); + .assert_stderr_contains( + r#" +error[E0599]: no function or associated item named `bar` found for struct `dep_2_reexport::Type` in the current scope + --> multiple-dep-versions.rs:9:11 + | +9 | Type::bar(); + | ^^^ function or associated item not found in `Type` + | +note: there are multiple different versions of crate `dependency` in the dependency graph"#, + ) + .assert_stderr_contains( + r#" +4 | pub trait Trait { + | ^^^^^^^^^^^^^^^ this is the trait that is needed +5 | fn foo(&self); +6 | fn bar(); + | --------- the associated function is available for `dep_2_reexport::Type` here + | + ::: multiple-dep-versions.rs:4:32 + | +4 | use dependency::{do_something, Trait}; + | ----- `Trait` imported here doesn't correspond to the right version of crate `dependency`"#, + ); } diff --git a/tests/run-make/dump-ice-to-disk/rmake.rs b/tests/run-make/dump-ice-to-disk/rmake.rs index 48b4071e065..15f35eb2d3d 100644 --- a/tests/run-make/dump-ice-to-disk/rmake.rs +++ b/tests/run-make/dump-ice-to-disk/rmake.rs @@ -14,11 +14,17 @@ //! that `RUSTC_ICE_PATH` takes precedence and no ICE dump is emitted under `METRICS_PATH`. //! //! See <https://github.com/rust-lang/rust/pull/108714>. +//! +//! # Test history +//! +//! - The previous rmake.rs iteration of this test was flakey for unknown reason on `i686-mingw` +//! *specifically*, so assertion failures in this test was made extremely verbose to help +//! diagnose why the ICE messages was different *specifically* on `i686-mingw`. +//! - An attempt is made to re-enable this test on `i686-mingw` (by removing `ignore-windows`). If +//! this test is still flakey, please restore the `ignore-windows` directive. //@ ignore-windows -// FIXME(#128911): @jieyouxu: This test is sometimes for whatever forsaken reason flakey in -// `i686-mingw`, and I cannot reproduce it locally. The error messages upon assertion failure in -// this test is intentionally extremely verbose to aid debugging that issue. +//FIXME(#128911): still flakey on i686-mingw. use std::cell::OnceCell; use std::path::{Path, PathBuf}; diff --git a/tests/run-make/libtest-json/rmake.rs b/tests/run-make/libtest-json/rmake.rs index acbd88dc46c..c31f4a79b64 100644 --- a/tests/run-make/libtest-json/rmake.rs +++ b/tests/run-make/libtest-json/rmake.rs @@ -3,7 +3,7 @@ //@ ignore-cross-compile //@ needs-unwind (test file contains #[should_panic] test) -use run_make_support::{cmd, diff, python_command, rustc}; +use run_make_support::{cmd, diff, rustc, serde_json}; fn main() { rustc().arg("--test").input("f.rs").run(); @@ -21,7 +21,18 @@ fn run_tests(extra_args: &[&str], expected_file: &str) { .run_fail(); let test_stdout = &cmd_out.stdout_utf8(); - python_command().arg("validate_json.py").stdin(test_stdout).run(); + // Verify that the test process output is JSON Lines, i.e. each line is valid JSON. + for (line, n) in test_stdout.lines().zip(1..) { + if let Err(e) = serde_json::from_str::<serde_json::Value>(line) { + panic!( + "could not parse JSON on line {n}: {e}\n\ + \n\ + === STDOUT ===\n\ + {test_stdout}\ + ==============" + ); + } + } diff() .expected_file(expected_file) diff --git a/tests/run-make/libtest-json/validate_json.py b/tests/run-make/libtest-json/validate_json.py deleted file mode 100755 index 657f732f2bf..00000000000 --- a/tests/run-make/libtest-json/validate_json.py +++ /dev/null @@ -1,8 +0,0 @@ -#!/usr/bin/env python - -import sys -import json - -# Try to decode line in order to ensure it is a valid JSON document -for line in sys.stdin: - json.loads(line) diff --git a/tests/rustdoc-ui/unportable-markdown.rs b/tests/rustdoc-ui/unportable-markdown.rs index 8035e680f3c..105fc1e59d5 100644 --- a/tests/rustdoc-ui/unportable-markdown.rs +++ b/tests/rustdoc-ui/unportable-markdown.rs @@ -19,7 +19,6 @@ pub struct GfmFootnotes; /// <https://github.com/pulldown-cmark/pulldown-cmark/pull/773> /// /// test [^foo][^bar] -//~^ ERROR unportable markdown /// /// [^foo]: test /// [^bar]: test2 diff --git a/tests/rustdoc-ui/unportable-markdown.stderr b/tests/rustdoc-ui/unportable-markdown.stderr index b524aca25ae..952ae4bb6ee 100644 --- a/tests/rustdoc-ui/unportable-markdown.stderr +++ b/tests/rustdoc-ui/unportable-markdown.stderr @@ -1,31 +1,15 @@ error: unportable markdown - --> $DIR/unportable-markdown.rs:21:10 + --> $DIR/unportable-markdown.rs:48:5 | -LL | /// test [^foo][^bar] - | ^^^^^^ +LL | /// >bar + | ^ | - = help: confusing footnote reference and link + = help: confusing block quote with no space after the `>` marker note: the lint level is defined here --> $DIR/unportable-markdown.rs:8:9 | LL | #![deny(rustdoc::unportable_markdown)] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -help: if it should not be a footnote, escape it - | -LL | /// test \[^foo][^bar] - | + -help: if the footnote is intended, add a space - | -LL | /// test [^foo] [^bar] - | + - -error: unportable markdown - --> $DIR/unportable-markdown.rs:49:5 - | -LL | /// >bar - | ^ - | - = help: confusing block quote with no space after the `>` marker help: if the quote is intended, add a space | LL | /// > bar @@ -35,5 +19,5 @@ help: if it should not be a quote, escape it LL | /// \>bar | + -error: aborting due to 2 previous errors +error: aborting due to 1 previous error diff --git a/tests/ui/abi/c-zst.other-linux.stderr b/tests/ui/abi/c-zst.other-linux.stderr new file mode 100644 index 00000000000..5a656e6ea66 --- /dev/null +++ b/tests/ui/abi/c-zst.other-linux.stderr @@ -0,0 +1,67 @@ +error: fn_abi_of(pass_zst) = FnAbi { + args: [ + ArgAbi { + layout: TyAndLayout { + ty: (), + layout: Layout { + size: Size(0 bytes), + align: AbiAndPrefAlign { + abi: $SOME_ALIGN, + pref: $SOME_ALIGN, + }, + abi: Aggregate { + sized: true, + }, + fields: Arbitrary { + offsets: [], + memory_index: [], + }, + largest_niche: None, + variants: Single { + index: 0, + }, + max_repr_align: None, + unadjusted_abi_align: $SOME_ALIGN, + }, + }, + mode: Ignore, + }, + ], + ret: ArgAbi { + layout: TyAndLayout { + ty: (), + layout: Layout { + size: Size(0 bytes), + align: AbiAndPrefAlign { + abi: $SOME_ALIGN, + pref: $SOME_ALIGN, + }, + abi: Aggregate { + sized: true, + }, + fields: Arbitrary { + offsets: [], + memory_index: [], + }, + largest_niche: None, + variants: Single { + index: 0, + }, + max_repr_align: None, + unadjusted_abi_align: $SOME_ALIGN, + }, + }, + mode: Ignore, + }, + c_variadic: false, + fixed_count: 1, + conv: C, + can_unwind: false, + } + --> $DIR/c-zst.rs:27:1 + | +LL | extern "C" fn pass_zst(_: ()) {} + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +error: aborting due to 1 previous error + diff --git a/tests/ui/abi/c-zst.other.stderr b/tests/ui/abi/c-zst.other.stderr new file mode 100644 index 00000000000..5a656e6ea66 --- /dev/null +++ b/tests/ui/abi/c-zst.other.stderr @@ -0,0 +1,67 @@ +error: fn_abi_of(pass_zst) = FnAbi { + args: [ + ArgAbi { + layout: TyAndLayout { + ty: (), + layout: Layout { + size: Size(0 bytes), + align: AbiAndPrefAlign { + abi: $SOME_ALIGN, + pref: $SOME_ALIGN, + }, + abi: Aggregate { + sized: true, + }, + fields: Arbitrary { + offsets: [], + memory_index: [], + }, + largest_niche: None, + variants: Single { + index: 0, + }, + max_repr_align: None, + unadjusted_abi_align: $SOME_ALIGN, + }, + }, + mode: Ignore, + }, + ], + ret: ArgAbi { + layout: TyAndLayout { + ty: (), + layout: Layout { + size: Size(0 bytes), + align: AbiAndPrefAlign { + abi: $SOME_ALIGN, + pref: $SOME_ALIGN, + }, + abi: Aggregate { + sized: true, + }, + fields: Arbitrary { + offsets: [], + memory_index: [], + }, + largest_niche: None, + variants: Single { + index: 0, + }, + max_repr_align: None, + unadjusted_abi_align: $SOME_ALIGN, + }, + }, + mode: Ignore, + }, + c_variadic: false, + fixed_count: 1, + conv: C, + can_unwind: false, + } + --> $DIR/c-zst.rs:27:1 + | +LL | extern "C" fn pass_zst(_: ()) {} + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +error: aborting due to 1 previous error + diff --git a/tests/ui/abi/c-zst.powerpc-linux.stderr b/tests/ui/abi/c-zst.powerpc-linux.stderr new file mode 100644 index 00000000000..ba9738050d8 --- /dev/null +++ b/tests/ui/abi/c-zst.powerpc-linux.stderr @@ -0,0 +1,78 @@ +error: fn_abi_of(pass_zst) = FnAbi { + args: [ + ArgAbi { + layout: TyAndLayout { + ty: (), + layout: Layout { + size: Size(0 bytes), + align: AbiAndPrefAlign { + abi: $SOME_ALIGN, + pref: $SOME_ALIGN, + }, + abi: Aggregate { + sized: true, + }, + fields: Arbitrary { + offsets: [], + memory_index: [], + }, + largest_niche: None, + variants: Single { + index: 0, + }, + max_repr_align: None, + unadjusted_abi_align: $SOME_ALIGN, + }, + }, + mode: Indirect { + attrs: ArgAttributes { + regular: NoAlias | NoCapture | NonNull | NoUndef, + arg_ext: None, + pointee_size: Size(0 bytes), + pointee_align: Some( + Align(1 bytes), + ), + }, + meta_attrs: None, + on_stack: false, + }, + }, + ], + ret: ArgAbi { + layout: TyAndLayout { + ty: (), + layout: Layout { + size: Size(0 bytes), + align: AbiAndPrefAlign { + abi: $SOME_ALIGN, + pref: $SOME_ALIGN, + }, + abi: Aggregate { + sized: true, + }, + fields: Arbitrary { + offsets: [], + memory_index: [], + }, + largest_niche: None, + variants: Single { + index: 0, + }, + max_repr_align: None, + unadjusted_abi_align: $SOME_ALIGN, + }, + }, + mode: Ignore, + }, + c_variadic: false, + fixed_count: 1, + conv: C, + can_unwind: false, + } + --> $DIR/c-zst.rs:27:1 + | +LL | extern "C" fn pass_zst(_: ()) {} + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +error: aborting due to 1 previous error + diff --git a/tests/ui/abi/c-zst.rs b/tests/ui/abi/c-zst.rs new file mode 100644 index 00000000000..0cfd653b37e --- /dev/null +++ b/tests/ui/abi/c-zst.rs @@ -0,0 +1,27 @@ +//@ revisions: other other-linux x86_64-pc-windows-gnu s390x-linux sparc64-linux powerpc-linux +//@ normalize-stderr-test: "(abi|pref|unadjusted_abi_align): Align\([1-8] bytes\)" -> "$1: $$SOME_ALIGN" +// ZSTs are only not ignored when the target_env is "gnu", "musl" or "uclibc". However, Rust does +// not currently support any other target_env on these architectures. + +// Ignore the ZST revisions +//@[other] ignore-x86_64-pc-windows-gnu +//@[other] ignore-linux +//@[other-linux] only-linux +//@[other-linux] ignore-s390x +//@[other-linux] ignore-sparc64 +//@[other-linux] ignore-powerpc + +// Pass the ZST indirectly revisions +//@[x86_64-pc-windows-gnu] only-x86_64-pc-windows-gnu +//@[s390x-linux] only-s390x +//@[s390x-linux] only-linux +//@[sparc64-linux] only-sparc64 +//@[sparc64-linux] only-linux +//@[powerpc-linux] only-powerpc +//@[powerpc-linux] only-linux + +#![feature(rustc_attrs)] +#![crate_type = "lib"] + +#[rustc_abi(debug)] +extern "C" fn pass_zst(_: ()) {} //~ ERROR: fn_abi diff --git a/tests/ui/abi/c-zst.s390x-linux.stderr b/tests/ui/abi/c-zst.s390x-linux.stderr new file mode 100644 index 00000000000..ba9738050d8 --- /dev/null +++ b/tests/ui/abi/c-zst.s390x-linux.stderr @@ -0,0 +1,78 @@ +error: fn_abi_of(pass_zst) = FnAbi { + args: [ + ArgAbi { + layout: TyAndLayout { + ty: (), + layout: Layout { + size: Size(0 bytes), + align: AbiAndPrefAlign { + abi: $SOME_ALIGN, + pref: $SOME_ALIGN, + }, + abi: Aggregate { + sized: true, + }, + fields: Arbitrary { + offsets: [], + memory_index: [], + }, + largest_niche: None, + variants: Single { + index: 0, + }, + max_repr_align: None, + unadjusted_abi_align: $SOME_ALIGN, + }, + }, + mode: Indirect { + attrs: ArgAttributes { + regular: NoAlias | NoCapture | NonNull | NoUndef, + arg_ext: None, + pointee_size: Size(0 bytes), + pointee_align: Some( + Align(1 bytes), + ), + }, + meta_attrs: None, + on_stack: false, + }, + }, + ], + ret: ArgAbi { + layout: TyAndLayout { + ty: (), + layout: Layout { + size: Size(0 bytes), + align: AbiAndPrefAlign { + abi: $SOME_ALIGN, + pref: $SOME_ALIGN, + }, + abi: Aggregate { + sized: true, + }, + fields: Arbitrary { + offsets: [], + memory_index: [], + }, + largest_niche: None, + variants: Single { + index: 0, + }, + max_repr_align: None, + unadjusted_abi_align: $SOME_ALIGN, + }, + }, + mode: Ignore, + }, + c_variadic: false, + fixed_count: 1, + conv: C, + can_unwind: false, + } + --> $DIR/c-zst.rs:27:1 + | +LL | extern "C" fn pass_zst(_: ()) {} + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +error: aborting due to 1 previous error + diff --git a/tests/ui/abi/c-zst.sparc64-linux.stderr b/tests/ui/abi/c-zst.sparc64-linux.stderr new file mode 100644 index 00000000000..ba9738050d8 --- /dev/null +++ b/tests/ui/abi/c-zst.sparc64-linux.stderr @@ -0,0 +1,78 @@ +error: fn_abi_of(pass_zst) = FnAbi { + args: [ + ArgAbi { + layout: TyAndLayout { + ty: (), + layout: Layout { + size: Size(0 bytes), + align: AbiAndPrefAlign { + abi: $SOME_ALIGN, + pref: $SOME_ALIGN, + }, + abi: Aggregate { + sized: true, + }, + fields: Arbitrary { + offsets: [], + memory_index: [], + }, + largest_niche: None, + variants: Single { + index: 0, + }, + max_repr_align: None, + unadjusted_abi_align: $SOME_ALIGN, + }, + }, + mode: Indirect { + attrs: ArgAttributes { + regular: NoAlias | NoCapture | NonNull | NoUndef, + arg_ext: None, + pointee_size: Size(0 bytes), + pointee_align: Some( + Align(1 bytes), + ), + }, + meta_attrs: None, + on_stack: false, + }, + }, + ], + ret: ArgAbi { + layout: TyAndLayout { + ty: (), + layout: Layout { + size: Size(0 bytes), + align: AbiAndPrefAlign { + abi: $SOME_ALIGN, + pref: $SOME_ALIGN, + }, + abi: Aggregate { + sized: true, + }, + fields: Arbitrary { + offsets: [], + memory_index: [], + }, + largest_niche: None, + variants: Single { + index: 0, + }, + max_repr_align: None, + unadjusted_abi_align: $SOME_ALIGN, + }, + }, + mode: Ignore, + }, + c_variadic: false, + fixed_count: 1, + conv: C, + can_unwind: false, + } + --> $DIR/c-zst.rs:27:1 + | +LL | extern "C" fn pass_zst(_: ()) {} + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +error: aborting due to 1 previous error + diff --git a/tests/ui/abi/c-zst.x86_64-pc-windows-gnu.stderr b/tests/ui/abi/c-zst.x86_64-pc-windows-gnu.stderr new file mode 100644 index 00000000000..ba9738050d8 --- /dev/null +++ b/tests/ui/abi/c-zst.x86_64-pc-windows-gnu.stderr @@ -0,0 +1,78 @@ +error: fn_abi_of(pass_zst) = FnAbi { + args: [ + ArgAbi { + layout: TyAndLayout { + ty: (), + layout: Layout { + size: Size(0 bytes), + align: AbiAndPrefAlign { + abi: $SOME_ALIGN, + pref: $SOME_ALIGN, + }, + abi: Aggregate { + sized: true, + }, + fields: Arbitrary { + offsets: [], + memory_index: [], + }, + largest_niche: None, + variants: Single { + index: 0, + }, + max_repr_align: None, + unadjusted_abi_align: $SOME_ALIGN, + }, + }, + mode: Indirect { + attrs: ArgAttributes { + regular: NoAlias | NoCapture | NonNull | NoUndef, + arg_ext: None, + pointee_size: Size(0 bytes), + pointee_align: Some( + Align(1 bytes), + ), + }, + meta_attrs: None, + on_stack: false, + }, + }, + ], + ret: ArgAbi { + layout: TyAndLayout { + ty: (), + layout: Layout { + size: Size(0 bytes), + align: AbiAndPrefAlign { + abi: $SOME_ALIGN, + pref: $SOME_ALIGN, + }, + abi: Aggregate { + sized: true, + }, + fields: Arbitrary { + offsets: [], + memory_index: [], + }, + largest_niche: None, + variants: Single { + index: 0, + }, + max_repr_align: None, + unadjusted_abi_align: $SOME_ALIGN, + }, + }, + mode: Ignore, + }, + c_variadic: false, + fixed_count: 1, + conv: C, + can_unwind: false, + } + --> $DIR/c-zst.rs:27:1 + | +LL | extern "C" fn pass_zst(_: ()) {} + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +error: aborting due to 1 previous error + diff --git a/tests/ui/abi/sysv64-zst.rs b/tests/ui/abi/sysv64-zst.rs new file mode 100644 index 00000000000..6f4497e77a1 --- /dev/null +++ b/tests/ui/abi/sysv64-zst.rs @@ -0,0 +1,8 @@ +//@ only-x86_64 +//@ normalize-stderr-test: "(abi|pref|unadjusted_abi_align): Align\([1-8] bytes\)" -> "$1: $$SOME_ALIGN" + +#![feature(rustc_attrs)] +#![crate_type = "lib"] + +#[rustc_abi(debug)] +extern "sysv64" fn pass_zst(_: ()) {} //~ ERROR: fn_abi diff --git a/tests/ui/abi/sysv64-zst.stderr b/tests/ui/abi/sysv64-zst.stderr new file mode 100644 index 00000000000..8b0b84dfa06 --- /dev/null +++ b/tests/ui/abi/sysv64-zst.stderr @@ -0,0 +1,67 @@ +error: fn_abi_of(pass_zst) = FnAbi { + args: [ + ArgAbi { + layout: TyAndLayout { + ty: (), + layout: Layout { + size: Size(0 bytes), + align: AbiAndPrefAlign { + abi: $SOME_ALIGN, + pref: $SOME_ALIGN, + }, + abi: Aggregate { + sized: true, + }, + fields: Arbitrary { + offsets: [], + memory_index: [], + }, + largest_niche: None, + variants: Single { + index: 0, + }, + max_repr_align: None, + unadjusted_abi_align: $SOME_ALIGN, + }, + }, + mode: Ignore, + }, + ], + ret: ArgAbi { + layout: TyAndLayout { + ty: (), + layout: Layout { + size: Size(0 bytes), + align: AbiAndPrefAlign { + abi: $SOME_ALIGN, + pref: $SOME_ALIGN, + }, + abi: Aggregate { + sized: true, + }, + fields: Arbitrary { + offsets: [], + memory_index: [], + }, + largest_niche: None, + variants: Single { + index: 0, + }, + max_repr_align: None, + unadjusted_abi_align: $SOME_ALIGN, + }, + }, + mode: Ignore, + }, + c_variadic: false, + fixed_count: 1, + conv: X86_64SysV, + can_unwind: false, + } + --> $DIR/sysv64-zst.rs:8:1 + | +LL | extern "sysv64" fn pass_zst(_: ()) {} + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +error: aborting due to 1 previous error + diff --git a/tests/ui/abi/win64-zst.other.stderr b/tests/ui/abi/win64-zst.other.stderr new file mode 100644 index 00000000000..15db141cb57 --- /dev/null +++ b/tests/ui/abi/win64-zst.other.stderr @@ -0,0 +1,67 @@ +error: fn_abi_of(pass_zst) = FnAbi { + args: [ + ArgAbi { + layout: TyAndLayout { + ty: (), + layout: Layout { + size: Size(0 bytes), + align: AbiAndPrefAlign { + abi: $SOME_ALIGN, + pref: $SOME_ALIGN, + }, + abi: Aggregate { + sized: true, + }, + fields: Arbitrary { + offsets: [], + memory_index: [], + }, + largest_niche: None, + variants: Single { + index: 0, + }, + max_repr_align: None, + unadjusted_abi_align: $SOME_ALIGN, + }, + }, + mode: Ignore, + }, + ], + ret: ArgAbi { + layout: TyAndLayout { + ty: (), + layout: Layout { + size: Size(0 bytes), + align: AbiAndPrefAlign { + abi: $SOME_ALIGN, + pref: $SOME_ALIGN, + }, + abi: Aggregate { + sized: true, + }, + fields: Arbitrary { + offsets: [], + memory_index: [], + }, + largest_niche: None, + variants: Single { + index: 0, + }, + max_repr_align: None, + unadjusted_abi_align: $SOME_ALIGN, + }, + }, + mode: Ignore, + }, + c_variadic: false, + fixed_count: 1, + conv: X86_64Win64, + can_unwind: false, + } + --> $DIR/win64-zst.rs:11:1 + | +LL | extern "win64" fn pass_zst(_: ()) {} + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +error: aborting due to 1 previous error + diff --git a/tests/ui/abi/win64-zst.rs b/tests/ui/abi/win64-zst.rs new file mode 100644 index 00000000000..cae32795e16 --- /dev/null +++ b/tests/ui/abi/win64-zst.rs @@ -0,0 +1,11 @@ +//@ only-x86_64 +//@ revisions: other windows-gnu +//@ normalize-stderr-test: "(abi|pref|unadjusted_abi_align): Align\([1-8] bytes\)" -> "$1: $$SOME_ALIGN" +//@[other] ignore-windows-gnu +//@[windows-gnu] only-windows-gnu + +#![feature(rustc_attrs)] +#![crate_type = "lib"] + +#[rustc_abi(debug)] +extern "win64" fn pass_zst(_: ()) {} //~ ERROR: fn_abi diff --git a/tests/ui/abi/win64-zst.windows-gnu.stderr b/tests/ui/abi/win64-zst.windows-gnu.stderr new file mode 100644 index 00000000000..7773e0aa2b5 --- /dev/null +++ b/tests/ui/abi/win64-zst.windows-gnu.stderr @@ -0,0 +1,78 @@ +error: fn_abi_of(pass_zst) = FnAbi { + args: [ + ArgAbi { + layout: TyAndLayout { + ty: (), + layout: Layout { + size: Size(0 bytes), + align: AbiAndPrefAlign { + abi: $SOME_ALIGN, + pref: $SOME_ALIGN, + }, + abi: Aggregate { + sized: true, + }, + fields: Arbitrary { + offsets: [], + memory_index: [], + }, + largest_niche: None, + variants: Single { + index: 0, + }, + max_repr_align: None, + unadjusted_abi_align: $SOME_ALIGN, + }, + }, + mode: Indirect { + attrs: ArgAttributes { + regular: NoAlias | NoCapture | NonNull | NoUndef, + arg_ext: None, + pointee_size: Size(0 bytes), + pointee_align: Some( + Align(1 bytes), + ), + }, + meta_attrs: None, + on_stack: false, + }, + }, + ], + ret: ArgAbi { + layout: TyAndLayout { + ty: (), + layout: Layout { + size: Size(0 bytes), + align: AbiAndPrefAlign { + abi: $SOME_ALIGN, + pref: $SOME_ALIGN, + }, + abi: Aggregate { + sized: true, + }, + fields: Arbitrary { + offsets: [], + memory_index: [], + }, + largest_niche: None, + variants: Single { + index: 0, + }, + max_repr_align: None, + unadjusted_abi_align: $SOME_ALIGN, + }, + }, + mode: Ignore, + }, + c_variadic: false, + fixed_count: 1, + conv: X86_64Win64, + can_unwind: false, + } + --> $DIR/win64-zst.rs:11:1 + | +LL | extern "win64" fn pass_zst(_: ()) {} + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +error: aborting due to 1 previous error + diff --git a/tests/ui/async-await/async-fn/recurse-ice-129215.rs b/tests/ui/async-await/async-fn/recurse-ice-129215.rs new file mode 100644 index 00000000000..06a2d7be9ef --- /dev/null +++ b/tests/ui/async-await/async-fn/recurse-ice-129215.rs @@ -0,0 +1,9 @@ +//@ edition: 2021 + +async fn a() { + //~^ ERROR `()` is not a future + //~| ERROR mismatched types + a() //~ ERROR `()` is not a future +} + +fn main() {} diff --git a/tests/ui/async-await/async-fn/recurse-ice-129215.stderr b/tests/ui/async-await/async-fn/recurse-ice-129215.stderr new file mode 100644 index 00000000000..98c7be2a5a3 --- /dev/null +++ b/tests/ui/async-await/async-fn/recurse-ice-129215.stderr @@ -0,0 +1,34 @@ +error[E0277]: `()` is not a future + --> $DIR/recurse-ice-129215.rs:6:5 + | +LL | a() + | ^^^ `()` is not a future + | + = help: the trait `Future` is not implemented for `()` + +error[E0277]: `()` is not a future + --> $DIR/recurse-ice-129215.rs:3:1 + | +LL | async fn a() { + | ^^^^^^^^^^^^ `()` is not a future + | + = help: the trait `Future` is not implemented for `()` + +error[E0308]: mismatched types + --> $DIR/recurse-ice-129215.rs:3:14 + | +LL | async fn a() { + | ______________^ +LL | | +LL | | +LL | | a() +LL | | } + | |_^ expected `()`, found `async` fn body + | + = note: expected unit type `()` + found `async` fn body `{async fn body of a()}` + +error: aborting due to 3 previous errors + +Some errors have detailed explanations: E0277, E0308. +For more information about an error, try `rustc --explain E0277`. diff --git a/tests/ui/attributes/linkage.rs b/tests/ui/attributes/linkage.rs new file mode 100644 index 00000000000..0d5ce699fa8 --- /dev/null +++ b/tests/ui/attributes/linkage.rs @@ -0,0 +1,42 @@ +#![feature(linkage)] +#![feature(stmt_expr_attributes)] +#![deny(unused_attributes)] +#![allow(dead_code)] + +#[linkage = "weak"] //~ ERROR attribute should be applied to a function or static +type InvalidTy = (); + +#[linkage = "weak"] //~ ERROR attribute should be applied to a function or static +mod invalid_module {} + +#[linkage = "weak"] //~ ERROR attribute should be applied to a function or static +struct F; + +#[linkage = "weak"] //~ ERROR attribute should be applied to a function or static +impl F { + #[linkage = "weak"] + fn valid(&self) {} +} + +#[linkage = "weak"] +fn f() { + #[linkage = "weak"] + { + 1 + }; + //~^^^^ ERROR attribute should be applied to a function or static +} + +extern "C" { + #[linkage = "weak"] + static A: *const (); + + #[linkage = "weak"] + fn bar(); +} + +fn main() { + let _ = #[linkage = "weak"] + (|| 1); + //~^^ ERROR attribute should be applied to a function or static +} diff --git a/tests/ui/attributes/linkage.stderr b/tests/ui/attributes/linkage.stderr new file mode 100644 index 00000000000..d5595529f40 --- /dev/null +++ b/tests/ui/attributes/linkage.stderr @@ -0,0 +1,55 @@ +error: attribute should be applied to a function or static + --> $DIR/linkage.rs:6:1 + | +LL | #[linkage = "weak"] + | ^^^^^^^^^^^^^^^^^^^ +LL | type InvalidTy = (); + | -------------------- not a function definition or static + +error: attribute should be applied to a function or static + --> $DIR/linkage.rs:9:1 + | +LL | #[linkage = "weak"] + | ^^^^^^^^^^^^^^^^^^^ +LL | mod invalid_module {} + | --------------------- not a function definition or static + +error: attribute should be applied to a function or static + --> $DIR/linkage.rs:12:1 + | +LL | #[linkage = "weak"] + | ^^^^^^^^^^^^^^^^^^^ +LL | struct F; + | --------- not a function definition or static + +error: attribute should be applied to a function or static + --> $DIR/linkage.rs:15:1 + | +LL | #[linkage = "weak"] + | ^^^^^^^^^^^^^^^^^^^ +LL | / impl F { +LL | | #[linkage = "weak"] +LL | | fn valid(&self) {} +LL | | } + | |_- not a function definition or static + +error: attribute should be applied to a function or static + --> $DIR/linkage.rs:23:5 + | +LL | #[linkage = "weak"] + | ^^^^^^^^^^^^^^^^^^^ +LL | / { +LL | | 1 +LL | | }; + | |_____- not a function definition or static + +error: attribute should be applied to a function or static + --> $DIR/linkage.rs:39:13 + | +LL | let _ = #[linkage = "weak"] + | ^^^^^^^^^^^^^^^^^^^ +LL | (|| 1); + | ------ not a function definition or static + +error: aborting due to 6 previous errors + diff --git a/tests/ui/attributes/may_dangle.rs b/tests/ui/attributes/may_dangle.rs new file mode 100644 index 00000000000..209ba0e88ad --- /dev/null +++ b/tests/ui/attributes/may_dangle.rs @@ -0,0 +1,53 @@ +#![feature(dropck_eyepatch)] + +struct Implee1<'a, T, const N: usize>(&'a T); +struct Implee2<'a, T, const N: usize>(&'a T); +struct Implee3<'a, T, const N: usize>(&'a T); +trait NotDrop {} + +unsafe impl<#[may_dangle] 'a, T, const N: usize> NotDrop for Implee1<'a, T, N> {} +//~^ ERROR must be applied to a lifetime or type generic parameter in `Drop` impl + +unsafe impl<'a, #[may_dangle] T, const N: usize> NotDrop for Implee2<'a, T, N> {} +//~^ ERROR must be applied to a lifetime or type generic parameter in `Drop` impl + +unsafe impl<'a, T, #[may_dangle] const N: usize> Drop for Implee1<'a, T, N> { + //~^ ERROR must be applied to a lifetime or type generic parameter in `Drop` impl + fn drop(&mut self) {} +} + +// Ok, lifetime param in a `Drop` impl. +unsafe impl<#[may_dangle] 'a, T, const N: usize> Drop for Implee2<'a, T, N> { + fn drop(&mut self) {} +} + +// Ok, type param in a `Drop` impl. +unsafe impl<'a, #[may_dangle] T, const N: usize> Drop for Implee3<'a, T, N> { + fn drop(&mut self) {} +} + +// Check that this check is not textual. +mod fake { + trait Drop { + fn drop(&mut self); + } + struct Implee<T>(T); + + unsafe impl<#[may_dangle] T> Drop for Implee<T> { + //~^ ERROR must be applied to a lifetime or type generic parameter in `Drop` impl + fn drop(&mut self) {} + } +} + +#[may_dangle] //~ ERROR must be applied to a lifetime or type generic parameter in `Drop` impl +struct Dangling; + +#[may_dangle] //~ ERROR must be applied to a lifetime or type generic parameter in `Drop` impl +impl NotDrop for () { +} + +#[may_dangle] //~ ERROR must be applied to a lifetime or type generic parameter in `Drop` impl +fn main() { + #[may_dangle] //~ ERROR must be applied to a lifetime or type generic parameter in `Drop` impl + let () = (); +} diff --git a/tests/ui/attributes/may_dangle.stderr b/tests/ui/attributes/may_dangle.stderr new file mode 100644 index 00000000000..dc24f847f71 --- /dev/null +++ b/tests/ui/attributes/may_dangle.stderr @@ -0,0 +1,50 @@ +error: `#[may_dangle]` must be applied to a lifetime or type generic parameter in `Drop` impl + --> $DIR/may_dangle.rs:8:13 + | +LL | unsafe impl<#[may_dangle] 'a, T, const N: usize> NotDrop for Implee1<'a, T, N> {} + | ^^^^^^^^^^^^^ + +error: `#[may_dangle]` must be applied to a lifetime or type generic parameter in `Drop` impl + --> $DIR/may_dangle.rs:11:17 + | +LL | unsafe impl<'a, #[may_dangle] T, const N: usize> NotDrop for Implee2<'a, T, N> {} + | ^^^^^^^^^^^^^ + +error: `#[may_dangle]` must be applied to a lifetime or type generic parameter in `Drop` impl + --> $DIR/may_dangle.rs:14:20 + | +LL | unsafe impl<'a, T, #[may_dangle] const N: usize> Drop for Implee1<'a, T, N> { + | ^^^^^^^^^^^^^ + +error: `#[may_dangle]` must be applied to a lifetime or type generic parameter in `Drop` impl + --> $DIR/may_dangle.rs:42:1 + | +LL | #[may_dangle] + | ^^^^^^^^^^^^^ + +error: `#[may_dangle]` must be applied to a lifetime or type generic parameter in `Drop` impl + --> $DIR/may_dangle.rs:45:1 + | +LL | #[may_dangle] + | ^^^^^^^^^^^^^ + +error: `#[may_dangle]` must be applied to a lifetime or type generic parameter in `Drop` impl + --> $DIR/may_dangle.rs:49:1 + | +LL | #[may_dangle] + | ^^^^^^^^^^^^^ + +error: `#[may_dangle]` must be applied to a lifetime or type generic parameter in `Drop` impl + --> $DIR/may_dangle.rs:51:5 + | +LL | #[may_dangle] + | ^^^^^^^^^^^^^ + +error: `#[may_dangle]` must be applied to a lifetime or type generic parameter in `Drop` impl + --> $DIR/may_dangle.rs:36:17 + | +LL | unsafe impl<#[may_dangle] T> Drop for Implee<T> { + | ^^^^^^^^^^^^^ + +error: aborting due to 8 previous errors + diff --git a/tests/ui/attributes/unsafe/cfg-unsafe-attributes.rs b/tests/ui/attributes/unsafe/cfg-unsafe-attributes.rs index ce365d1a8b1..6a9853b2f6f 100644 --- a/tests/ui/attributes/unsafe/cfg-unsafe-attributes.rs +++ b/tests/ui/attributes/unsafe/cfg-unsafe-attributes.rs @@ -1,5 +1,4 @@ //@ build-pass -#![feature(unsafe_attributes)] #[cfg_attr(all(), unsafe(no_mangle))] fn a() {} diff --git a/tests/ui/attributes/unsafe/derive-unsafe-attributes.rs b/tests/ui/attributes/unsafe/derive-unsafe-attributes.rs index b8edb4aab90..95fc19f506b 100644 --- a/tests/ui/attributes/unsafe/derive-unsafe-attributes.rs +++ b/tests/ui/attributes/unsafe/derive-unsafe-attributes.rs @@ -1,5 +1,3 @@ -#![feature(unsafe_attributes)] - #[derive(unsafe(Debug))] //~^ ERROR: expected identifier, found keyword `unsafe` //~| ERROR: traits in `#[derive(...)]` don't accept arguments diff --git a/tests/ui/attributes/unsafe/derive-unsafe-attributes.stderr b/tests/ui/attributes/unsafe/derive-unsafe-attributes.stderr index c40a5512fd5..4002c930b63 100644 --- a/tests/ui/attributes/unsafe/derive-unsafe-attributes.stderr +++ b/tests/ui/attributes/unsafe/derive-unsafe-attributes.stderr @@ -1,5 +1,5 @@ error: expected identifier, found keyword `unsafe` - --> $DIR/derive-unsafe-attributes.rs:3:10 + --> $DIR/derive-unsafe-attributes.rs:1:10 | LL | #[derive(unsafe(Debug))] | ^^^^^^ expected identifier, found keyword @@ -10,13 +10,13 @@ LL | #[derive(r#unsafe(Debug))] | ++ error: traits in `#[derive(...)]` don't accept arguments - --> $DIR/derive-unsafe-attributes.rs:3:16 + --> $DIR/derive-unsafe-attributes.rs:1:16 | LL | #[derive(unsafe(Debug))] | ^^^^^^^ help: remove the arguments error: `derive` is not an unsafe attribute - --> $DIR/derive-unsafe-attributes.rs:12:3 + --> $DIR/derive-unsafe-attributes.rs:10:3 | LL | #[unsafe(derive(Debug))] | ^^^^^^ this is not an unsafe attribute @@ -24,7 +24,7 @@ LL | #[unsafe(derive(Debug))] = note: extraneous unsafe is not allowed in attributes error: expected identifier, found keyword `unsafe` - --> $DIR/derive-unsafe-attributes.rs:3:10 + --> $DIR/derive-unsafe-attributes.rs:1:10 | LL | #[derive(unsafe(Debug))] | ^^^^^^ expected identifier, found keyword @@ -36,7 +36,7 @@ LL | #[derive(r#unsafe(Debug))] | ++ error: expected identifier, found keyword `unsafe` - --> $DIR/derive-unsafe-attributes.rs:3:10 + --> $DIR/derive-unsafe-attributes.rs:1:10 | LL | #[derive(unsafe(Debug))] | ^^^^^^ expected identifier, found keyword @@ -48,13 +48,13 @@ LL | #[derive(r#unsafe(Debug))] | ++ error: cannot find derive macro `r#unsafe` in this scope - --> $DIR/derive-unsafe-attributes.rs:3:10 + --> $DIR/derive-unsafe-attributes.rs:1:10 | LL | #[derive(unsafe(Debug))] | ^^^^^^ error: cannot find derive macro `r#unsafe` in this scope - --> $DIR/derive-unsafe-attributes.rs:3:10 + --> $DIR/derive-unsafe-attributes.rs:1:10 | LL | #[derive(unsafe(Debug))] | ^^^^^^ diff --git a/tests/ui/attributes/unsafe/double-unsafe-attributes.rs b/tests/ui/attributes/unsafe/double-unsafe-attributes.rs index a6c0ea578f2..894d1327da7 100644 --- a/tests/ui/attributes/unsafe/double-unsafe-attributes.rs +++ b/tests/ui/attributes/unsafe/double-unsafe-attributes.rs @@ -1,5 +1,3 @@ -#![feature(unsafe_attributes)] - #[unsafe(unsafe(no_mangle))] //~^ ERROR expected identifier, found keyword `unsafe` //~| ERROR cannot find attribute `r#unsafe` in this scope diff --git a/tests/ui/attributes/unsafe/double-unsafe-attributes.stderr b/tests/ui/attributes/unsafe/double-unsafe-attributes.stderr index 950b2636993..0825cf79408 100644 --- a/tests/ui/attributes/unsafe/double-unsafe-attributes.stderr +++ b/tests/ui/attributes/unsafe/double-unsafe-attributes.stderr @@ -1,5 +1,5 @@ error: expected identifier, found keyword `unsafe` - --> $DIR/double-unsafe-attributes.rs:3:10 + --> $DIR/double-unsafe-attributes.rs:1:10 | LL | #[unsafe(unsafe(no_mangle))] | ^^^^^^ expected identifier, found keyword @@ -10,7 +10,7 @@ LL | #[unsafe(r#unsafe(no_mangle))] | ++ error: `r#unsafe` is not an unsafe attribute - --> $DIR/double-unsafe-attributes.rs:3:3 + --> $DIR/double-unsafe-attributes.rs:1:3 | LL | #[unsafe(unsafe(no_mangle))] | ^^^^^^ this is not an unsafe attribute @@ -18,7 +18,7 @@ LL | #[unsafe(unsafe(no_mangle))] = note: extraneous unsafe is not allowed in attributes error: cannot find attribute `r#unsafe` in this scope - --> $DIR/double-unsafe-attributes.rs:3:10 + --> $DIR/double-unsafe-attributes.rs:1:10 | LL | #[unsafe(unsafe(no_mangle))] | ^^^^^^ diff --git a/tests/ui/attributes/unsafe/extraneous-unsafe-attributes.rs b/tests/ui/attributes/unsafe/extraneous-unsafe-attributes.rs index 0181add843b..b561550c198 100644 --- a/tests/ui/attributes/unsafe/extraneous-unsafe-attributes.rs +++ b/tests/ui/attributes/unsafe/extraneous-unsafe-attributes.rs @@ -1,6 +1,5 @@ //@ edition: 2024 //@ compile-flags: -Zunstable-options -#![feature(unsafe_attributes)] #[unsafe(cfg(any()))] //~ ERROR: is not an unsafe attribute fn a() {} diff --git a/tests/ui/attributes/unsafe/extraneous-unsafe-attributes.stderr b/tests/ui/attributes/unsafe/extraneous-unsafe-attributes.stderr index f39074b613d..9fb7f062b91 100644 --- a/tests/ui/attributes/unsafe/extraneous-unsafe-attributes.stderr +++ b/tests/ui/attributes/unsafe/extraneous-unsafe-attributes.stderr @@ -1,5 +1,5 @@ error: `cfg` is not an unsafe attribute - --> $DIR/extraneous-unsafe-attributes.rs:5:3 + --> $DIR/extraneous-unsafe-attributes.rs:4:3 | LL | #[unsafe(cfg(any()))] | ^^^^^^ this is not an unsafe attribute @@ -7,7 +7,7 @@ LL | #[unsafe(cfg(any()))] = note: extraneous unsafe is not allowed in attributes error: `cfg_attr` is not an unsafe attribute - --> $DIR/extraneous-unsafe-attributes.rs:8:3 + --> $DIR/extraneous-unsafe-attributes.rs:7:3 | LL | #[unsafe(cfg_attr(any(), allow(dead_code)))] | ^^^^^^ this is not an unsafe attribute @@ -15,7 +15,7 @@ LL | #[unsafe(cfg_attr(any(), allow(dead_code)))] = note: extraneous unsafe is not allowed in attributes error: `test` is not an unsafe attribute - --> $DIR/extraneous-unsafe-attributes.rs:11:3 + --> $DIR/extraneous-unsafe-attributes.rs:10:3 | LL | #[unsafe(test)] | ^^^^^^ this is not an unsafe attribute @@ -23,7 +23,7 @@ LL | #[unsafe(test)] = note: extraneous unsafe is not allowed in attributes error: `ignore` is not an unsafe attribute - --> $DIR/extraneous-unsafe-attributes.rs:14:3 + --> $DIR/extraneous-unsafe-attributes.rs:13:3 | LL | #[unsafe(ignore = "test")] | ^^^^^^ this is not an unsafe attribute @@ -31,7 +31,7 @@ LL | #[unsafe(ignore = "test")] = note: extraneous unsafe is not allowed in attributes error: `should_panic` is not an unsafe attribute - --> $DIR/extraneous-unsafe-attributes.rs:17:3 + --> $DIR/extraneous-unsafe-attributes.rs:16:3 | LL | #[unsafe(should_panic(expected = "test"))] | ^^^^^^ this is not an unsafe attribute @@ -39,7 +39,7 @@ LL | #[unsafe(should_panic(expected = "test"))] = note: extraneous unsafe is not allowed in attributes error: `macro_use` is not an unsafe attribute - --> $DIR/extraneous-unsafe-attributes.rs:20:3 + --> $DIR/extraneous-unsafe-attributes.rs:19:3 | LL | #[unsafe(macro_use)] | ^^^^^^ this is not an unsafe attribute @@ -47,7 +47,7 @@ LL | #[unsafe(macro_use)] = note: extraneous unsafe is not allowed in attributes error: `macro_export` is not an unsafe attribute - --> $DIR/extraneous-unsafe-attributes.rs:22:7 + --> $DIR/extraneous-unsafe-attributes.rs:21:7 | LL | #[unsafe(macro_export)] | ^^^^^^ this is not an unsafe attribute @@ -55,7 +55,7 @@ LL | #[unsafe(macro_export)] = note: extraneous unsafe is not allowed in attributes error: `used` is not an unsafe attribute - --> $DIR/extraneous-unsafe-attributes.rs:28:3 + --> $DIR/extraneous-unsafe-attributes.rs:27:3 | LL | #[unsafe(used)] | ^^^^^^ this is not an unsafe attribute diff --git a/tests/ui/attributes/unsafe/proc-unsafe-attributes.rs b/tests/ui/attributes/unsafe/proc-unsafe-attributes.rs index f29a5b3252b..eaf8706369a 100644 --- a/tests/ui/attributes/unsafe/proc-unsafe-attributes.rs +++ b/tests/ui/attributes/unsafe/proc-unsafe-attributes.rs @@ -1,5 +1,3 @@ -#![feature(unsafe_attributes)] - #[unsafe(proc_macro)] //~^ ERROR: is not an unsafe attribute //~| ERROR attribute is only usable with crates of the `proc-macro` crate type diff --git a/tests/ui/attributes/unsafe/proc-unsafe-attributes.stderr b/tests/ui/attributes/unsafe/proc-unsafe-attributes.stderr index 79d34d458bd..9c5751c82e4 100644 --- a/tests/ui/attributes/unsafe/proc-unsafe-attributes.stderr +++ b/tests/ui/attributes/unsafe/proc-unsafe-attributes.stderr @@ -1,11 +1,11 @@ error[E0452]: malformed lint attribute input - --> $DIR/proc-unsafe-attributes.rs:28:16 + --> $DIR/proc-unsafe-attributes.rs:26:16 | LL | #[unsafe(allow(unsafe(dead_code)))] | ^^^^^^^^^^^^^^^^^ bad attribute argument error[E0452]: malformed lint attribute input - --> $DIR/proc-unsafe-attributes.rs:28:16 + --> $DIR/proc-unsafe-attributes.rs:26:16 | LL | #[unsafe(allow(unsafe(dead_code)))] | ^^^^^^^^^^^^^^^^^ bad attribute argument @@ -13,7 +13,7 @@ LL | #[unsafe(allow(unsafe(dead_code)))] = note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no` error: `proc_macro` is not an unsafe attribute - --> $DIR/proc-unsafe-attributes.rs:3:3 + --> $DIR/proc-unsafe-attributes.rs:1:3 | LL | #[unsafe(proc_macro)] | ^^^^^^ this is not an unsafe attribute @@ -21,7 +21,7 @@ LL | #[unsafe(proc_macro)] = note: extraneous unsafe is not allowed in attributes error: `proc_macro_derive` is not an unsafe attribute - --> $DIR/proc-unsafe-attributes.rs:9:3 + --> $DIR/proc-unsafe-attributes.rs:7:3 | LL | #[unsafe(proc_macro_derive(Foo))] | ^^^^^^ this is not an unsafe attribute @@ -29,7 +29,7 @@ LL | #[unsafe(proc_macro_derive(Foo))] = note: extraneous unsafe is not allowed in attributes error: expected identifier, found keyword `unsafe` - --> $DIR/proc-unsafe-attributes.rs:14:21 + --> $DIR/proc-unsafe-attributes.rs:12:21 | LL | #[proc_macro_derive(unsafe(Foo))] | ^^^^^^ expected identifier, found keyword @@ -40,7 +40,7 @@ LL | #[proc_macro_derive(r#unsafe(Foo))] | ++ error: `proc_macro_attribute` is not an unsafe attribute - --> $DIR/proc-unsafe-attributes.rs:19:3 + --> $DIR/proc-unsafe-attributes.rs:17:3 | LL | #[unsafe(proc_macro_attribute)] | ^^^^^^ this is not an unsafe attribute @@ -48,7 +48,7 @@ LL | #[unsafe(proc_macro_attribute)] = note: extraneous unsafe is not allowed in attributes error: `allow` is not an unsafe attribute - --> $DIR/proc-unsafe-attributes.rs:24:3 + --> $DIR/proc-unsafe-attributes.rs:22:3 | LL | #[unsafe(allow(dead_code))] | ^^^^^^ this is not an unsafe attribute @@ -56,7 +56,7 @@ LL | #[unsafe(allow(dead_code))] = note: extraneous unsafe is not allowed in attributes error: `allow` is not an unsafe attribute - --> $DIR/proc-unsafe-attributes.rs:28:3 + --> $DIR/proc-unsafe-attributes.rs:26:3 | LL | #[unsafe(allow(unsafe(dead_code)))] | ^^^^^^ this is not an unsafe attribute @@ -64,7 +64,7 @@ LL | #[unsafe(allow(unsafe(dead_code)))] = note: extraneous unsafe is not allowed in attributes error: expected identifier, found keyword `unsafe` - --> $DIR/proc-unsafe-attributes.rs:28:16 + --> $DIR/proc-unsafe-attributes.rs:26:16 | LL | #[unsafe(allow(unsafe(dead_code)))] | ^^^^^^ expected identifier, found keyword @@ -75,31 +75,31 @@ LL | #[unsafe(allow(r#unsafe(dead_code)))] | ++ error: the `#[proc_macro]` attribute is only usable with crates of the `proc-macro` crate type - --> $DIR/proc-unsafe-attributes.rs:3:1 + --> $DIR/proc-unsafe-attributes.rs:1:1 | LL | #[unsafe(proc_macro)] | ^^^^^^^^^^^^^^^^^^^^^ error: the `#[proc_macro_derive]` attribute is only usable with crates of the `proc-macro` crate type - --> $DIR/proc-unsafe-attributes.rs:9:1 + --> $DIR/proc-unsafe-attributes.rs:7:1 | LL | #[unsafe(proc_macro_derive(Foo))] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ error: the `#[proc_macro_derive]` attribute is only usable with crates of the `proc-macro` crate type - --> $DIR/proc-unsafe-attributes.rs:14:1 + --> $DIR/proc-unsafe-attributes.rs:12:1 | LL | #[proc_macro_derive(unsafe(Foo))] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ error: the `#[proc_macro_attribute]` attribute is only usable with crates of the `proc-macro` crate type - --> $DIR/proc-unsafe-attributes.rs:19:1 + --> $DIR/proc-unsafe-attributes.rs:17:1 | LL | #[unsafe(proc_macro_attribute)] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ error[E0452]: malformed lint attribute input - --> $DIR/proc-unsafe-attributes.rs:28:16 + --> $DIR/proc-unsafe-attributes.rs:26:16 | LL | #[unsafe(allow(unsafe(dead_code)))] | ^^^^^^^^^^^^^^^^^ bad attribute argument @@ -107,7 +107,7 @@ LL | #[unsafe(allow(unsafe(dead_code)))] = note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no` error[E0452]: malformed lint attribute input - --> $DIR/proc-unsafe-attributes.rs:28:16 + --> $DIR/proc-unsafe-attributes.rs:26:16 | LL | #[unsafe(allow(unsafe(dead_code)))] | ^^^^^^^^^^^^^^^^^ bad attribute argument diff --git a/tests/ui/attributes/unsafe/unsafe-attributes.rs b/tests/ui/attributes/unsafe/unsafe-attributes.rs index 33a412add50..5c57767b3b9 100644 --- a/tests/ui/attributes/unsafe/unsafe-attributes.rs +++ b/tests/ui/attributes/unsafe/unsafe-attributes.rs @@ -1,5 +1,4 @@ //@ build-pass -#![feature(unsafe_attributes)] #[unsafe(no_mangle)] fn a() {} diff --git a/tests/ui/attributes/unsafe/unsafe-safe-attribute.rs b/tests/ui/attributes/unsafe/unsafe-safe-attribute.rs index 67db36afd2e..5af03a2b8d1 100644 --- a/tests/ui/attributes/unsafe/unsafe-safe-attribute.rs +++ b/tests/ui/attributes/unsafe/unsafe-safe-attribute.rs @@ -1,5 +1,3 @@ -#![feature(unsafe_attributes)] - #[unsafe(repr(C))] //~ ERROR: is not an unsafe attribute struct Foo {} diff --git a/tests/ui/attributes/unsafe/unsafe-safe-attribute.stderr b/tests/ui/attributes/unsafe/unsafe-safe-attribute.stderr index 584b0ea797d..55172c91aae 100644 --- a/tests/ui/attributes/unsafe/unsafe-safe-attribute.stderr +++ b/tests/ui/attributes/unsafe/unsafe-safe-attribute.stderr @@ -1,5 +1,5 @@ error: `repr` is not an unsafe attribute - --> $DIR/unsafe-safe-attribute.rs:3:3 + --> $DIR/unsafe-safe-attribute.rs:1:3 | LL | #[unsafe(repr(C))] | ^^^^^^ this is not an unsafe attribute diff --git a/tests/ui/attributes/unsafe/unsafe-safe-attribute_diagnostic.rs b/tests/ui/attributes/unsafe/unsafe-safe-attribute_diagnostic.rs index ff2eb61b405..0f241cc439f 100644 --- a/tests/ui/attributes/unsafe/unsafe-safe-attribute_diagnostic.rs +++ b/tests/ui/attributes/unsafe/unsafe-safe-attribute_diagnostic.rs @@ -1,5 +1,3 @@ -#![feature(unsafe_attributes)] - #[unsafe(diagnostic::on_unimplemented( //~ ERROR: is not an unsafe attribute message = "testing", ))] diff --git a/tests/ui/attributes/unsafe/unsafe-safe-attribute_diagnostic.stderr b/tests/ui/attributes/unsafe/unsafe-safe-attribute_diagnostic.stderr index 26b5e4e37b9..3bc291db5ac 100644 --- a/tests/ui/attributes/unsafe/unsafe-safe-attribute_diagnostic.stderr +++ b/tests/ui/attributes/unsafe/unsafe-safe-attribute_diagnostic.stderr @@ -1,5 +1,5 @@ error: `diagnostic::on_unimplemented` is not an unsafe attribute - --> $DIR/unsafe-safe-attribute_diagnostic.rs:3:3 + --> $DIR/unsafe-safe-attribute_diagnostic.rs:1:3 | LL | #[unsafe(diagnostic::on_unimplemented( | ^^^^^^ this is not an unsafe attribute diff --git a/tests/ui/borrowck/borrow-raw-address-of-borrowed.rs b/tests/ui/borrowck/borrow-raw-address-of-borrowed.rs index f25fd7f66b3..3ed42d07289 100644 --- a/tests/ui/borrowck/borrow-raw-address-of-borrowed.rs +++ b/tests/ui/borrowck/borrow-raw-address-of-borrowed.rs @@ -1,5 +1,3 @@ -#![feature(raw_ref_op)] - fn address_of_shared() { let mut x = 0; let y = &x; diff --git a/tests/ui/borrowck/borrow-raw-address-of-borrowed.stderr b/tests/ui/borrowck/borrow-raw-address-of-borrowed.stderr index 6f7b7e08070..1a38f8c780e 100644 --- a/tests/ui/borrowck/borrow-raw-address-of-borrowed.stderr +++ b/tests/ui/borrowck/borrow-raw-address-of-borrowed.stderr @@ -1,5 +1,5 @@ error[E0502]: cannot borrow `x` as mutable because it is also borrowed as immutable - --> $DIR/borrow-raw-address-of-borrowed.rs:7:13 + --> $DIR/borrow-raw-address-of-borrowed.rs:5:13 | LL | let y = &x; | -- immutable borrow occurs here @@ -11,7 +11,7 @@ LL | drop(y); | - immutable borrow later used here error[E0502]: cannot borrow `x` as immutable because it is also borrowed as mutable - --> $DIR/borrow-raw-address-of-borrowed.rs:16:13 + --> $DIR/borrow-raw-address-of-borrowed.rs:14:13 | LL | let y = &mut x; | ------ mutable borrow occurs here @@ -23,7 +23,7 @@ LL | drop(y); | - mutable borrow later used here error[E0499]: cannot borrow `x` as mutable more than once at a time - --> $DIR/borrow-raw-address-of-borrowed.rs:17:13 + --> $DIR/borrow-raw-address-of-borrowed.rs:15:13 | LL | let y = &mut x; | ------ first mutable borrow occurs here diff --git a/tests/ui/borrowck/borrow-raw-address-of-deref-mutability-ok.rs b/tests/ui/borrowck/borrow-raw-address-of-deref-mutability-ok.rs index 0dfced34c7e..23409795227 100644 --- a/tests/ui/borrowck/borrow-raw-address-of-deref-mutability-ok.rs +++ b/tests/ui/borrowck/borrow-raw-address-of-deref-mutability-ok.rs @@ -1,7 +1,5 @@ //@ check-pass -#![feature(raw_ref_op)] - fn raw_reborrow() { let x = &0; let y = &mut 0; diff --git a/tests/ui/borrowck/borrow-raw-address-of-deref-mutability.rs b/tests/ui/borrowck/borrow-raw-address-of-deref-mutability.rs index 712873528b5..5b3936ef5a3 100644 --- a/tests/ui/borrowck/borrow-raw-address-of-deref-mutability.rs +++ b/tests/ui/borrowck/borrow-raw-address-of-deref-mutability.rs @@ -1,7 +1,5 @@ // Check that `&raw mut` cannot be used to turn a `&T` into a `*mut T`. -#![feature(raw_ref_op)] - fn raw_reborrow() { let x = &0; diff --git a/tests/ui/borrowck/borrow-raw-address-of-deref-mutability.stderr b/tests/ui/borrowck/borrow-raw-address-of-deref-mutability.stderr index cfc86ff0dc1..ac0241cf9a7 100644 --- a/tests/ui/borrowck/borrow-raw-address-of-deref-mutability.stderr +++ b/tests/ui/borrowck/borrow-raw-address-of-deref-mutability.stderr @@ -1,5 +1,5 @@ error[E0596]: cannot borrow `*x` as mutable, as it is behind a `&` reference - --> $DIR/borrow-raw-address-of-deref-mutability.rs:8:13 + --> $DIR/borrow-raw-address-of-deref-mutability.rs:6:13 | LL | let q = &raw mut *x; | ^^^^^^^^^^^ `x` is a `&` reference, so the data it refers to cannot be borrowed as mutable @@ -10,7 +10,7 @@ LL | let x = &mut 0; | +++ error[E0596]: cannot borrow `*x` as mutable, as it is behind a `*const` pointer - --> $DIR/borrow-raw-address-of-deref-mutability.rs:14:13 + --> $DIR/borrow-raw-address-of-deref-mutability.rs:12:13 | LL | let q = &raw mut *x; | ^^^^^^^^^^^ `x` is a `*const` pointer, so the data it refers to cannot be borrowed as mutable diff --git a/tests/ui/borrowck/borrow-raw-address-of-mutability-ok.rs b/tests/ui/borrowck/borrow-raw-address-of-mutability-ok.rs index 7b0232a9d45..ed8c5502a75 100644 --- a/tests/ui/borrowck/borrow-raw-address-of-mutability-ok.rs +++ b/tests/ui/borrowck/borrow-raw-address-of-mutability-ok.rs @@ -1,7 +1,5 @@ //@ check-pass -#![feature(raw_ref_op)] - fn mutable_address_of() { let mut x = 0; let y = &raw mut x; diff --git a/tests/ui/borrowck/borrow-raw-address-of-mutability.rs b/tests/ui/borrowck/borrow-raw-address-of-mutability.rs index 320c54b806a..2c5d636d096 100644 --- a/tests/ui/borrowck/borrow-raw-address-of-mutability.rs +++ b/tests/ui/borrowck/borrow-raw-address-of-mutability.rs @@ -1,5 +1,3 @@ -#![feature(raw_ref_op)] - fn mutable_address_of() { let x = 0; let y = &raw mut x; //~ ERROR cannot borrow diff --git a/tests/ui/borrowck/borrow-raw-address-of-mutability.stderr b/tests/ui/borrowck/borrow-raw-address-of-mutability.stderr index 4b5b368287e..f81a8c99376 100644 --- a/tests/ui/borrowck/borrow-raw-address-of-mutability.stderr +++ b/tests/ui/borrowck/borrow-raw-address-of-mutability.stderr @@ -1,5 +1,5 @@ error[E0596]: cannot borrow `x` as mutable, as it is not declared as mutable - --> $DIR/borrow-raw-address-of-mutability.rs:5:13 + --> $DIR/borrow-raw-address-of-mutability.rs:3:13 | LL | let y = &raw mut x; | ^^^^^^^^^^ cannot borrow as mutable @@ -10,7 +10,7 @@ LL | let mut x = 0; | +++ error[E0596]: cannot borrow `x` as mutable, as it is not declared as mutable - --> $DIR/borrow-raw-address-of-mutability.rs:11:17 + --> $DIR/borrow-raw-address-of-mutability.rs:9:17 | LL | let y = &raw mut x; | ^^^^^^^^^^ cannot borrow as mutable @@ -21,7 +21,7 @@ LL | let mut x = 0; | +++ error[E0596]: cannot borrow `f` as mutable, as it is not declared as mutable - --> $DIR/borrow-raw-address-of-mutability.rs:21:5 + --> $DIR/borrow-raw-address-of-mutability.rs:19:5 | LL | let y = &raw mut x; | - calling `f` requires mutable binding due to mutable borrow of `x` @@ -35,7 +35,7 @@ LL | let mut f = || { | +++ error[E0596]: cannot borrow `x` as mutable, as it is a captured variable in a `Fn` closure - --> $DIR/borrow-raw-address-of-mutability.rs:29:17 + --> $DIR/borrow-raw-address-of-mutability.rs:27:17 | LL | fn make_fn<F: Fn()>(f: F) -> F { f } | - change this to accept `FnMut` instead of `Fn` @@ -48,7 +48,7 @@ LL | let y = &raw mut x; | ^^^^^^^^^^ cannot borrow as mutable error[E0596]: cannot borrow `x` as mutable, as it is a captured variable in a `Fn` closure - --> $DIR/borrow-raw-address-of-mutability.rs:37:17 + --> $DIR/borrow-raw-address-of-mutability.rs:35:17 | LL | fn make_fn<F: Fn()>(f: F) -> F { f } | - change this to accept `FnMut` instead of `Fn` diff --git a/tests/ui/closures/add_semicolon_non_block_closure.rs b/tests/ui/closures/add_semicolon_non_block_closure.rs index 3ae91be60c5..62c5e343cd3 100644 --- a/tests/ui/closures/add_semicolon_non_block_closure.rs +++ b/tests/ui/closures/add_semicolon_non_block_closure.rs @@ -8,4 +8,5 @@ fn main() { foo(|| bar()) //~^ ERROR mismatched types [E0308] //~| HELP consider using a semicolon here + //~| HELP try adding a return type } diff --git a/tests/ui/closures/add_semicolon_non_block_closure.stderr b/tests/ui/closures/add_semicolon_non_block_closure.stderr index d095e59c7eb..7883db8f98e 100644 --- a/tests/ui/closures/add_semicolon_non_block_closure.stderr +++ b/tests/ui/closures/add_semicolon_non_block_closure.stderr @@ -1,8 +1,6 @@ error[E0308]: mismatched types --> $DIR/add_semicolon_non_block_closure.rs:8:12 | -LL | fn main() { - | - expected `()` because of default return type LL | foo(|| bar()) | ^^^^^ expected `()`, found `i32` | @@ -10,6 +8,10 @@ help: consider using a semicolon here | LL | foo(|| { bar(); }) | + +++ +help: try adding a return type + | +LL | foo(|| -> i32 bar()) + | ++++++ error: aborting due to 1 previous error diff --git a/tests/ui/const-generics/const-ty-is-normalized.rs b/tests/ui/const-generics/const-ty-is-normalized.rs new file mode 100644 index 00000000000..784145f735e --- /dev/null +++ b/tests/ui/const-generics/const-ty-is-normalized.rs @@ -0,0 +1,25 @@ +//@ compile-flags: -Cdebuginfo=2 --crate-type=lib +//@ build-pass +#![feature(adt_const_params)] + +const N_ISLANDS: usize = 4; + +pub type Matrix = [[usize; N_ISLANDS]; N_ISLANDS]; + +const EMPTY_MATRIX: Matrix = [[0; N_ISLANDS]; N_ISLANDS]; + +const fn to_matrix() -> Matrix { + EMPTY_MATRIX +} + +const BRIDGE_MATRIX: [[usize; N_ISLANDS]; N_ISLANDS] = to_matrix(); + +pub struct Walk<const CURRENT: usize, const REMAINING: Matrix> { + _p: (), +} + +impl Walk<0, BRIDGE_MATRIX> { + pub const fn new() -> Self { + Self { _p: () } + } +} diff --git a/tests/ui/consts/const-address-of-interior-mut.rs b/tests/ui/consts/const-address-of-interior-mut.rs index 60c7c31daca..930fa0c492f 100644 --- a/tests/ui/consts/const-address-of-interior-mut.rs +++ b/tests/ui/consts/const-address-of-interior-mut.rs @@ -1,5 +1,3 @@ -#![feature(raw_ref_op)] - use std::cell::Cell; const A: () = { let x = Cell::new(2); &raw const x; }; //~ ERROR interior mutability diff --git a/tests/ui/consts/const-address-of-interior-mut.stderr b/tests/ui/consts/const-address-of-interior-mut.stderr index 12c8917d740..203745f0b01 100644 --- a/tests/ui/consts/const-address-of-interior-mut.stderr +++ b/tests/ui/consts/const-address-of-interior-mut.stderr @@ -1,5 +1,5 @@ error[E0658]: cannot borrow here, since the borrowed element may contain interior mutability - --> $DIR/const-address-of-interior-mut.rs:5:39 + --> $DIR/const-address-of-interior-mut.rs:3:39 | LL | const A: () = { let x = Cell::new(2); &raw const x; }; | ^^^^^^^^^^^^ @@ -9,7 +9,7 @@ LL | const A: () = { let x = Cell::new(2); &raw const x; }; = note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date error[E0658]: cannot borrow here, since the borrowed element may contain interior mutability - --> $DIR/const-address-of-interior-mut.rs:7:40 + --> $DIR/const-address-of-interior-mut.rs:5:40 | LL | static B: () = { let x = Cell::new(2); &raw const x; }; | ^^^^^^^^^^^^ @@ -19,7 +19,7 @@ LL | static B: () = { let x = Cell::new(2); &raw const x; }; = note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date error[E0658]: cannot borrow here, since the borrowed element may contain interior mutability - --> $DIR/const-address-of-interior-mut.rs:9:44 + --> $DIR/const-address-of-interior-mut.rs:7:44 | LL | static mut C: () = { let x = Cell::new(2); &raw const x; }; | ^^^^^^^^^^^^ @@ -29,7 +29,7 @@ LL | static mut C: () = { let x = Cell::new(2); &raw const x; }; = note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date error[E0658]: cannot borrow here, since the borrowed element may contain interior mutability - --> $DIR/const-address-of-interior-mut.rs:13:13 + --> $DIR/const-address-of-interior-mut.rs:11:13 | LL | let y = &raw const x; | ^^^^^^^^^^^^ diff --git a/tests/ui/consts/const-address-of-mut.rs b/tests/ui/consts/const-address-of-mut.rs index 0018bf18e41..c3f37843d3c 100644 --- a/tests/ui/consts/const-address-of-mut.rs +++ b/tests/ui/consts/const-address-of-mut.rs @@ -1,5 +1,3 @@ -#![feature(raw_ref_op)] - const A: () = { let mut x = 2; &raw mut x; }; //~ mutable pointer static B: () = { let mut x = 2; &raw mut x; }; //~ mutable pointer diff --git a/tests/ui/consts/const-address-of-mut.stderr b/tests/ui/consts/const-address-of-mut.stderr index 95a91ff463f..d4243485de1 100644 --- a/tests/ui/consts/const-address-of-mut.stderr +++ b/tests/ui/consts/const-address-of-mut.stderr @@ -1,5 +1,5 @@ error[E0658]: raw mutable pointers are not allowed in constants - --> $DIR/const-address-of-mut.rs:3:32 + --> $DIR/const-address-of-mut.rs:1:32 | LL | const A: () = { let mut x = 2; &raw mut x; }; | ^^^^^^^^^^ @@ -9,7 +9,7 @@ LL | const A: () = { let mut x = 2; &raw mut x; }; = note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date error[E0658]: raw mutable pointers are not allowed in statics - --> $DIR/const-address-of-mut.rs:5:33 + --> $DIR/const-address-of-mut.rs:3:33 | LL | static B: () = { let mut x = 2; &raw mut x; }; | ^^^^^^^^^^ @@ -19,7 +19,7 @@ LL | static B: () = { let mut x = 2; &raw mut x; }; = note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date error[E0658]: raw mutable pointers are not allowed in constant functions - --> $DIR/const-address-of-mut.rs:9:13 + --> $DIR/const-address-of-mut.rs:7:13 | LL | let y = &raw mut x; | ^^^^^^^^^^ diff --git a/tests/ui/consts/const-address-of.rs b/tests/ui/consts/const-address-of.rs index 4eb3c3840ba..39ed430e17e 100644 --- a/tests/ui/consts/const-address-of.rs +++ b/tests/ui/consts/const-address-of.rs @@ -1,7 +1,5 @@ //@ check-pass -#![feature(raw_ref_op)] - const A: *const i32 = &raw const *&2; static B: () = { &raw const *&2; }; static mut C: *const i32 = &raw const *&2; diff --git a/tests/ui/consts/const-float-bits-conv.rs b/tests/ui/consts/const-float-bits-conv.rs index ba8db4c23dc..45e8ea570ed 100644 --- a/tests/ui/consts/const-float-bits-conv.rs +++ b/tests/ui/consts/const-float-bits-conv.rs @@ -23,6 +23,11 @@ macro_rules! const_assert { }; } +fn has_broken_floats() -> bool { + // i586 targets are broken due to <https://github.com/rust-lang/rust/issues/114479>. + std::env::var("TARGET").is_ok_and(|v| v.contains("i586")) +} + fn f32() { const_assert!((1f32).to_bits(), 0x3f800000); const_assert!(u32::from_be_bytes(1f32.to_be_bytes()), 0x3f800000); @@ -38,6 +43,19 @@ fn f32() { const_assert!(f32::from_bits(0x44a72000), 1337.0); const_assert!(f32::from_ne_bytes(0x44a72000u32.to_ne_bytes()), 1337.0); const_assert!(f32::from_bits(0xc1640000), -14.25); + + // Check that NaNs roundtrip their bits regardless of signalingness + // 0xA is 0b1010; 0x5 is 0b0101 -- so these two together clobbers all the mantissa bits + // NOTE: These names assume `f{BITS}::NAN` is a quiet NAN and IEEE754-2008's NaN rules apply! + const QUIET_NAN: u32 = f32::NAN.to_bits() ^ 0x002A_AAAA; + const SIGNALING_NAN: u32 = f32::NAN.to_bits() ^ 0x0055_5555; + + const_assert!(f32::from_bits(QUIET_NAN).is_nan()); + const_assert!(f32::from_bits(SIGNALING_NAN).is_nan()); + const_assert!(f32::from_bits(QUIET_NAN).to_bits(), QUIET_NAN); + if !has_broken_floats() { + const_assert!(f32::from_bits(SIGNALING_NAN).to_bits(), SIGNALING_NAN); + } } fn f64() { @@ -55,6 +73,19 @@ fn f64() { const_assert!(f64::from_bits(0x4094e40000000000), 1337.0); const_assert!(f64::from_ne_bytes(0x4094e40000000000u64.to_ne_bytes()), 1337.0); const_assert!(f64::from_bits(0xc02c800000000000), -14.25); + + // Check that NaNs roundtrip their bits regardless of signalingness + // 0xA is 0b1010; 0x5 is 0b0101 -- so these two together clobbers all the mantissa bits + // NOTE: These names assume `f{BITS}::NAN` is a quiet NAN and IEEE754-2008's NaN rules apply! + const QUIET_NAN: u64 = f64::NAN.to_bits() ^ 0x0005_5555_5555_5555; + const SIGNALING_NAN: u64 = f64::NAN.to_bits() ^ 0x000A_AAAA_AAAA_AAAA; + + const_assert!(f64::from_bits(QUIET_NAN).is_nan()); + const_assert!(f64::from_bits(SIGNALING_NAN).is_nan()); + const_assert!(f64::from_bits(QUIET_NAN).to_bits(), QUIET_NAN); + if !has_broken_floats() { + const_assert!(f64::from_bits(SIGNALING_NAN).to_bits(), SIGNALING_NAN); + } } fn main() { diff --git a/tests/ui/consts/const-float-bits-reject-conv.rs b/tests/ui/consts/const-float-bits-reject-conv.rs deleted file mode 100644 index febb272869a..00000000000 --- a/tests/ui/consts/const-float-bits-reject-conv.rs +++ /dev/null @@ -1,68 +0,0 @@ -//@ compile-flags: -Zmir-opt-level=0 -//@ error-pattern: cannot use f32::to_bits on a NaN -#![feature(const_float_bits_conv)] -#![feature(const_float_classify)] - -// Don't promote -const fn nop<T>(x: T) -> T { x } - -macro_rules! const_assert { - ($a:expr) => { - { - const _: () = assert!($a); - assert!(nop($a)); - } - }; - ($a:expr, $b:expr) => { - { - const _: () = assert!($a == $b); - assert_eq!(nop($a), nop($b)); - } - }; -} - -fn f32() { - // Check that NaNs roundtrip their bits regardless of signalingness - // 0xA is 0b1010; 0x5 is 0b0101 -- so these two together clobbers all the mantissa bits - // ...actually, let's just check that these break. :D - const MASKED_NAN1: u32 = f32::NAN.to_bits() ^ 0x002A_AAAA; - //~^ inside - const MASKED_NAN2: u32 = f32::NAN.to_bits() ^ 0x0055_5555; - //~^ inside - - // The rest of the code is dead because the constants already fail to evaluate. - - const_assert!(f32::from_bits(MASKED_NAN1).is_nan()); - const_assert!(f32::from_bits(MASKED_NAN1).is_nan()); - - // LLVM does not guarantee that loads and stores of NaNs preserve their exact bit pattern. - // In practice, this seems to only cause a problem on x86, since the most widely used calling - // convention mandates that floating point values are returned on the x87 FPU stack. See #73328. - // However, during CTFE we still preserve bit patterns (though that is not a guarantee). - const_assert!(f32::from_bits(MASKED_NAN1).to_bits(), MASKED_NAN1); - const_assert!(f32::from_bits(MASKED_NAN2).to_bits(), MASKED_NAN2); -} - -fn f64() { - // Check that NaNs roundtrip their bits regardless of signalingness - // 0xA is 0b1010; 0x5 is 0b0101 -- so these two together clobbers all the mantissa bits - // ...actually, let's just check that these break. :D - const MASKED_NAN1: u64 = f64::NAN.to_bits() ^ 0x000A_AAAA_AAAA_AAAA; - //~^ inside - const MASKED_NAN2: u64 = f64::NAN.to_bits() ^ 0x0005_5555_5555_5555; - //~^ inside - - // The rest of the code is dead because the constants already fail to evaluate. - - const_assert!(f64::from_bits(MASKED_NAN1).is_nan()); - const_assert!(f64::from_bits(MASKED_NAN1).is_nan()); - - // See comment above. - const_assert!(f64::from_bits(MASKED_NAN1).to_bits(), MASKED_NAN1); - const_assert!(f64::from_bits(MASKED_NAN2).to_bits(), MASKED_NAN2); -} - -fn main() { - f32(); - f64(); -} diff --git a/tests/ui/consts/const-float-bits-reject-conv.stderr b/tests/ui/consts/const-float-bits-reject-conv.stderr deleted file mode 100644 index 1511dab12b0..00000000000 --- a/tests/ui/consts/const-float-bits-reject-conv.stderr +++ /dev/null @@ -1,115 +0,0 @@ -error[E0080]: evaluation of constant value failed - --> $SRC_DIR/core/src/num/f32.rs:LL:COL - | - = note: the evaluated program panicked at 'const-eval error: cannot use f32::to_bits on a NaN', $SRC_DIR/core/src/num/f32.rs:LL:COL - | -note: inside `core::f32::<impl f32>::to_bits::ct_f32_to_u32` - --> $SRC_DIR/core/src/num/f32.rs:LL:COL -note: inside `core::f32::<impl f32>::to_bits` - --> $SRC_DIR/core/src/num/f32.rs:LL:COL -note: inside `f32::MASKED_NAN1` - --> $DIR/const-float-bits-reject-conv.rs:28:30 - | -LL | const MASKED_NAN1: u32 = f32::NAN.to_bits() ^ 0x002A_AAAA; - | ^^^^^^^^^^^^^^^^^^ - = note: this error originates in the macro `$crate::panic::panic_2021` which comes from the expansion of the macro `panic` (in Nightly builds, run with -Z macro-backtrace for more info) - -error[E0080]: evaluation of constant value failed - --> $SRC_DIR/core/src/num/f32.rs:LL:COL - | - = note: the evaluated program panicked at 'const-eval error: cannot use f32::to_bits on a NaN', $SRC_DIR/core/src/num/f32.rs:LL:COL - | -note: inside `core::f32::<impl f32>::to_bits::ct_f32_to_u32` - --> $SRC_DIR/core/src/num/f32.rs:LL:COL -note: inside `core::f32::<impl f32>::to_bits` - --> $SRC_DIR/core/src/num/f32.rs:LL:COL -note: inside `f32::MASKED_NAN2` - --> $DIR/const-float-bits-reject-conv.rs:30:30 - | -LL | const MASKED_NAN2: u32 = f32::NAN.to_bits() ^ 0x0055_5555; - | ^^^^^^^^^^^^^^^^^^ - = note: this error originates in the macro `$crate::panic::panic_2021` which comes from the expansion of the macro `panic` (in Nightly builds, run with -Z macro-backtrace for more info) - -note: erroneous constant encountered - --> $DIR/const-float-bits-reject-conv.rs:35:34 - | -LL | const_assert!(f32::from_bits(MASKED_NAN1).is_nan()); - | ^^^^^^^^^^^ - -note: erroneous constant encountered - --> $DIR/const-float-bits-reject-conv.rs:36:34 - | -LL | const_assert!(f32::from_bits(MASKED_NAN1).is_nan()); - | ^^^^^^^^^^^ - -note: erroneous constant encountered - --> $DIR/const-float-bits-reject-conv.rs:42:34 - | -LL | const_assert!(f32::from_bits(MASKED_NAN1).to_bits(), MASKED_NAN1); - | ^^^^^^^^^^^ - -note: erroneous constant encountered - --> $DIR/const-float-bits-reject-conv.rs:43:34 - | -LL | const_assert!(f32::from_bits(MASKED_NAN2).to_bits(), MASKED_NAN2); - | ^^^^^^^^^^^ - -error[E0080]: evaluation of constant value failed - --> $SRC_DIR/core/src/num/f64.rs:LL:COL - | - = note: the evaluated program panicked at 'const-eval error: cannot use f64::to_bits on a NaN', $SRC_DIR/core/src/num/f64.rs:LL:COL - | -note: inside `core::f64::<impl f64>::to_bits::ct_f64_to_u64` - --> $SRC_DIR/core/src/num/f64.rs:LL:COL -note: inside `core::f64::<impl f64>::to_bits` - --> $SRC_DIR/core/src/num/f64.rs:LL:COL -note: inside `f64::MASKED_NAN1` - --> $DIR/const-float-bits-reject-conv.rs:50:30 - | -LL | const MASKED_NAN1: u64 = f64::NAN.to_bits() ^ 0x000A_AAAA_AAAA_AAAA; - | ^^^^^^^^^^^^^^^^^^ - = note: this error originates in the macro `$crate::panic::panic_2021` which comes from the expansion of the macro `panic` (in Nightly builds, run with -Z macro-backtrace for more info) - -error[E0080]: evaluation of constant value failed - --> $SRC_DIR/core/src/num/f64.rs:LL:COL - | - = note: the evaluated program panicked at 'const-eval error: cannot use f64::to_bits on a NaN', $SRC_DIR/core/src/num/f64.rs:LL:COL - | -note: inside `core::f64::<impl f64>::to_bits::ct_f64_to_u64` - --> $SRC_DIR/core/src/num/f64.rs:LL:COL -note: inside `core::f64::<impl f64>::to_bits` - --> $SRC_DIR/core/src/num/f64.rs:LL:COL -note: inside `f64::MASKED_NAN2` - --> $DIR/const-float-bits-reject-conv.rs:52:30 - | -LL | const MASKED_NAN2: u64 = f64::NAN.to_bits() ^ 0x0005_5555_5555_5555; - | ^^^^^^^^^^^^^^^^^^ - = note: this error originates in the macro `$crate::panic::panic_2021` which comes from the expansion of the macro `panic` (in Nightly builds, run with -Z macro-backtrace for more info) - -note: erroneous constant encountered - --> $DIR/const-float-bits-reject-conv.rs:57:34 - | -LL | const_assert!(f64::from_bits(MASKED_NAN1).is_nan()); - | ^^^^^^^^^^^ - -note: erroneous constant encountered - --> $DIR/const-float-bits-reject-conv.rs:58:34 - | -LL | const_assert!(f64::from_bits(MASKED_NAN1).is_nan()); - | ^^^^^^^^^^^ - -note: erroneous constant encountered - --> $DIR/const-float-bits-reject-conv.rs:61:34 - | -LL | const_assert!(f64::from_bits(MASKED_NAN1).to_bits(), MASKED_NAN1); - | ^^^^^^^^^^^ - -note: erroneous constant encountered - --> $DIR/const-float-bits-reject-conv.rs:62:34 - | -LL | const_assert!(f64::from_bits(MASKED_NAN2).to_bits(), MASKED_NAN2); - | ^^^^^^^^^^^ - -error: aborting due to 4 previous errors - -For more information about this error, try `rustc --explain E0080`. diff --git a/tests/ui/consts/const-mut-refs/const_mut_address_of.rs b/tests/ui/consts/const-mut-refs/const_mut_address_of.rs index 66a4ec50c11..437bdc88722 100644 --- a/tests/ui/consts/const-mut-refs/const_mut_address_of.rs +++ b/tests/ui/consts/const-mut-refs/const_mut_address_of.rs @@ -1,6 +1,5 @@ //@ check-pass #![feature(const_mut_refs)] -#![feature(raw_ref_op)] struct Foo { x: usize diff --git a/tests/ui/consts/const-mut-refs/mut_ref_in_final.rs b/tests/ui/consts/const-mut-refs/mut_ref_in_final.rs index 93197d5bce4..10339ee6798 100644 --- a/tests/ui/consts/const-mut-refs/mut_ref_in_final.rs +++ b/tests/ui/consts/const-mut-refs/mut_ref_in_final.rs @@ -1,5 +1,4 @@ #![feature(const_mut_refs)] -#![feature(raw_ref_op)] const NULL: *mut i32 = std::ptr::null_mut(); const A: *const i32 = &4; diff --git a/tests/ui/consts/const-mut-refs/mut_ref_in_final.stderr b/tests/ui/consts/const-mut-refs/mut_ref_in_final.stderr index 59e6aa4011c..00a8421076b 100644 --- a/tests/ui/consts/const-mut-refs/mut_ref_in_final.stderr +++ b/tests/ui/consts/const-mut-refs/mut_ref_in_final.stderr @@ -1,11 +1,11 @@ error[E0764]: mutable references are not allowed in the final value of constants - --> $DIR/mut_ref_in_final.rs:10:21 + --> $DIR/mut_ref_in_final.rs:9:21 | LL | const B: *mut i32 = &mut 4; | ^^^^^^ error[E0716]: temporary value dropped while borrowed - --> $DIR/mut_ref_in_final.rs:16:40 + --> $DIR/mut_ref_in_final.rs:15:40 | LL | const B3: Option<&mut i32> = Some(&mut 42); | ----------^^- @@ -15,7 +15,7 @@ LL | const B3: Option<&mut i32> = Some(&mut 42); | using this value as a constant requires that borrow lasts for `'static` error[E0716]: temporary value dropped while borrowed - --> $DIR/mut_ref_in_final.rs:19:42 + --> $DIR/mut_ref_in_final.rs:18:42 | LL | const B4: Option<&mut i32> = helper(&mut 42); | ------------^^- @@ -25,7 +25,7 @@ LL | const B4: Option<&mut i32> = helper(&mut 42); | using this value as a constant requires that borrow lasts for `'static` error[E0716]: temporary value dropped while borrowed - --> $DIR/mut_ref_in_final.rs:34:65 + --> $DIR/mut_ref_in_final.rs:33:65 | LL | const FOO: NotAMutex<&mut i32> = NotAMutex(UnsafeCell::new(&mut 42)); | -------------------------------^^-- @@ -35,7 +35,7 @@ LL | const FOO: NotAMutex<&mut i32> = NotAMutex(UnsafeCell::new(&mut 42)); | using this value as a constant requires that borrow lasts for `'static` error[E0716]: temporary value dropped while borrowed - --> $DIR/mut_ref_in_final.rs:37:67 + --> $DIR/mut_ref_in_final.rs:36:67 | LL | static FOO2: NotAMutex<&mut i32> = NotAMutex(UnsafeCell::new(&mut 42)); | -------------------------------^^-- @@ -45,7 +45,7 @@ LL | static FOO2: NotAMutex<&mut i32> = NotAMutex(UnsafeCell::new(&mut 42)); | using this value as a static requires that borrow lasts for `'static` error[E0716]: temporary value dropped while borrowed - --> $DIR/mut_ref_in_final.rs:40:71 + --> $DIR/mut_ref_in_final.rs:39:71 | LL | static mut FOO3: NotAMutex<&mut i32> = NotAMutex(UnsafeCell::new(&mut 42)); | -------------------------------^^-- @@ -55,25 +55,25 @@ LL | static mut FOO3: NotAMutex<&mut i32> = NotAMutex(UnsafeCell::new(&mut 42)); | using this value as a static requires that borrow lasts for `'static` error[E0764]: mutable references are not allowed in the final value of statics - --> $DIR/mut_ref_in_final.rs:53:53 + --> $DIR/mut_ref_in_final.rs:52:53 | LL | static RAW_MUT_CAST_S: SyncPtr<i32> = SyncPtr { x : &mut 42 as *mut _ as *const _ }; | ^^^^^^^ error[E0764]: mutable references are not allowed in the final value of statics - --> $DIR/mut_ref_in_final.rs:55:54 + --> $DIR/mut_ref_in_final.rs:54:54 | LL | static RAW_MUT_COERCE_S: SyncPtr<i32> = SyncPtr { x: &mut 0 }; | ^^^^^^ error[E0764]: mutable references are not allowed in the final value of constants - --> $DIR/mut_ref_in_final.rs:57:52 + --> $DIR/mut_ref_in_final.rs:56:52 | LL | const RAW_MUT_CAST_C: SyncPtr<i32> = SyncPtr { x : &mut 42 as *mut _ as *const _ }; | ^^^^^^^ error[E0764]: mutable references are not allowed in the final value of constants - --> $DIR/mut_ref_in_final.rs:59:53 + --> $DIR/mut_ref_in_final.rs:58:53 | LL | const RAW_MUT_COERCE_C: SyncPtr<i32> = SyncPtr { x: &mut 0 }; | ^^^^^^ diff --git a/tests/ui/consts/const-mut-refs/mut_ref_in_final_dynamic_check.rs b/tests/ui/consts/const-mut-refs/mut_ref_in_final_dynamic_check.rs index c12c22447b5..e208845e747 100644 --- a/tests/ui/consts/const-mut-refs/mut_ref_in_final_dynamic_check.rs +++ b/tests/ui/consts/const-mut-refs/mut_ref_in_final_dynamic_check.rs @@ -2,7 +2,6 @@ //@ normalize-stderr-test: "( 0x[0-9a-f][0-9a-f] │)? ([0-9a-f][0-9a-f] |__ |╾─*ALLOC[0-9]+(\+[a-z0-9]+)?(<imm>)?─*╼ )+ *│.*" -> " HEX_DUMP" //@ normalize-stderr-test: "HEX_DUMP\s*\n\s*HEX_DUMP" -> "HEX_DUMP" #![feature(const_mut_refs, const_refs_to_static)] -#![feature(raw_ref_op)] use std::sync::Mutex; diff --git a/tests/ui/consts/const-mut-refs/mut_ref_in_final_dynamic_check.stderr b/tests/ui/consts/const-mut-refs/mut_ref_in_final_dynamic_check.stderr index ea9dccf0173..4ea6fa62475 100644 --- a/tests/ui/consts/const-mut-refs/mut_ref_in_final_dynamic_check.stderr +++ b/tests/ui/consts/const-mut-refs/mut_ref_in_final_dynamic_check.stderr @@ -1,5 +1,5 @@ error[E0080]: it is undefined behavior to use this value - --> $DIR/mut_ref_in_final_dynamic_check.rs:20:1 + --> $DIR/mut_ref_in_final_dynamic_check.rs:19:1 | LL | const MUT: Option<&mut i32> = helper(); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value at .<enum-variant(Some)>.0: encountered reference to mutable memory in `const` @@ -10,7 +10,7 @@ LL | const MUT: Option<&mut i32> = helper(); } error[E0080]: it is undefined behavior to use this value - --> $DIR/mut_ref_in_final_dynamic_check.rs:27:1 + --> $DIR/mut_ref_in_final_dynamic_check.rs:26:1 | LL | const INT2PTR: Option<&mut i32> = helper_int2ptr(); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value at .<enum-variant(Some)>.0: encountered a dangling reference (0x2a[noalloc] has no provenance) @@ -21,7 +21,7 @@ LL | const INT2PTR: Option<&mut i32> = helper_int2ptr(); } error[E0080]: it is undefined behavior to use this value - --> $DIR/mut_ref_in_final_dynamic_check.rs:29:1 + --> $DIR/mut_ref_in_final_dynamic_check.rs:28:1 | LL | static INT2PTR_STATIC: Option<&mut i32> = helper_int2ptr(); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value at .<enum-variant(Some)>.0: encountered a dangling reference (0x2a[noalloc] has no provenance) @@ -32,7 +32,7 @@ LL | static INT2PTR_STATIC: Option<&mut i32> = helper_int2ptr(); } error[E0080]: it is undefined behavior to use this value - --> $DIR/mut_ref_in_final_dynamic_check.rs:36:1 + --> $DIR/mut_ref_in_final_dynamic_check.rs:35:1 | LL | const DANGLING: Option<&mut i32> = helper_dangling(); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value at .<enum-variant(Some)>.0: encountered a dangling reference (use-after-free) @@ -43,7 +43,7 @@ LL | const DANGLING: Option<&mut i32> = helper_dangling(); } error[E0080]: it is undefined behavior to use this value - --> $DIR/mut_ref_in_final_dynamic_check.rs:37:1 + --> $DIR/mut_ref_in_final_dynamic_check.rs:36:1 | LL | static DANGLING_STATIC: Option<&mut i32> = helper_dangling(); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value at .<enum-variant(Some)>.0: encountered a dangling reference (use-after-free) diff --git a/tests/ui/consts/min_const_fn/address_of.rs b/tests/ui/consts/min_const_fn/address_of.rs index aa75423ca4d..dc481e17ba3 100644 --- a/tests/ui/consts/min_const_fn/address_of.rs +++ b/tests/ui/consts/min_const_fn/address_of.rs @@ -1,5 +1,3 @@ -#![feature(raw_ref_op)] - const fn mutable_address_of_in_const() { let mut a = 0; let b = &raw mut a; //~ ERROR mutable pointer diff --git a/tests/ui/consts/min_const_fn/address_of.stderr b/tests/ui/consts/min_const_fn/address_of.stderr index 143760c0943..dd6fe6486d4 100644 --- a/tests/ui/consts/min_const_fn/address_of.stderr +++ b/tests/ui/consts/min_const_fn/address_of.stderr @@ -1,5 +1,5 @@ error[E0658]: raw mutable pointers are not allowed in constant functions - --> $DIR/address_of.rs:5:13 + --> $DIR/address_of.rs:3:13 | LL | let b = &raw mut a; | ^^^^^^^^^^ @@ -9,7 +9,7 @@ LL | let b = &raw mut a; = note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date error[E0658]: raw mutable pointers are not allowed in constant functions - --> $DIR/address_of.rs:13:17 + --> $DIR/address_of.rs:11:17 | LL | let b = &raw mut a; | ^^^^^^^^^^ diff --git a/tests/ui/consts/min_const_fn/address_of_const.rs b/tests/ui/consts/min_const_fn/address_of_const.rs index 4280d0745c1..1520622679f 100644 --- a/tests/ui/consts/min_const_fn/address_of_const.rs +++ b/tests/ui/consts/min_const_fn/address_of_const.rs @@ -1,7 +1,5 @@ //@ check-pass -#![feature(raw_ref_op)] - const fn const_address_of_in_const() { let mut a = 0; let b = &raw const a; diff --git a/tests/ui/consts/qualif-indirect-mutation-fail.rs b/tests/ui/consts/qualif-indirect-mutation-fail.rs index 420e32128a4..a99d0633ba1 100644 --- a/tests/ui/consts/qualif-indirect-mutation-fail.rs +++ b/tests/ui/consts/qualif-indirect-mutation-fail.rs @@ -2,7 +2,6 @@ #![feature(const_mut_refs)] #![feature(const_precise_live_drops)] #![feature(const_swap)] -#![feature(raw_ref_op)] // Mutable borrow of a field with drop impl. pub const fn f() { diff --git a/tests/ui/consts/qualif-indirect-mutation-fail.stderr b/tests/ui/consts/qualif-indirect-mutation-fail.stderr index 458dc2071c4..21c872ed13f 100644 --- a/tests/ui/consts/qualif-indirect-mutation-fail.stderr +++ b/tests/ui/consts/qualif-indirect-mutation-fail.stderr @@ -1,5 +1,5 @@ error[E0493]: destructor of `Option<String>` cannot be evaluated at compile-time - --> $DIR/qualif-indirect-mutation-fail.rs:15:9 + --> $DIR/qualif-indirect-mutation-fail.rs:14:9 | LL | let mut x = None; | ^^^^^ the destructor for this type cannot be evaluated in constants @@ -16,13 +16,13 @@ note: inside `std::ptr::drop_in_place::<String> - shim(Some(String))` note: inside `std::ptr::drop_in_place::<Option<String>> - shim(Some(Option<String>))` --> $SRC_DIR/core/src/ptr/mod.rs:LL:COL note: inside `A1` - --> $DIR/qualif-indirect-mutation-fail.rs:21:1 + --> $DIR/qualif-indirect-mutation-fail.rs:20:1 | LL | }; | ^ error[E0493]: destructor of `Option<String>` cannot be evaluated at compile-time - --> $DIR/qualif-indirect-mutation-fail.rs:31:9 + --> $DIR/qualif-indirect-mutation-fail.rs:30:9 | LL | let _z = x; | ^^ the destructor for this type cannot be evaluated in constants @@ -39,49 +39,49 @@ note: inside `std::ptr::drop_in_place::<String> - shim(Some(String))` note: inside `std::ptr::drop_in_place::<Option<String>> - shim(Some(Option<String>))` --> $SRC_DIR/core/src/ptr/mod.rs:LL:COL note: inside `A2` - --> $DIR/qualif-indirect-mutation-fail.rs:32:1 + --> $DIR/qualif-indirect-mutation-fail.rs:31:1 | LL | }; | ^ error[E0493]: destructor of `(u32, Option<String>)` cannot be evaluated at compile-time - --> $DIR/qualif-indirect-mutation-fail.rs:9:9 + --> $DIR/qualif-indirect-mutation-fail.rs:8:9 | LL | let mut a: (u32, Option<String>) = (0, None); | ^^^^^ the destructor for this type cannot be evaluated in constant functions error[E0493]: destructor of `Option<T>` cannot be evaluated at compile-time - --> $DIR/qualif-indirect-mutation-fail.rs:36:9 + --> $DIR/qualif-indirect-mutation-fail.rs:35:9 | LL | let x: Option<T> = None; | ^ the destructor for this type cannot be evaluated in constant functions error[E0493]: destructor of `Option<T>` cannot be evaluated at compile-time - --> $DIR/qualif-indirect-mutation-fail.rs:44:9 + --> $DIR/qualif-indirect-mutation-fail.rs:43:9 | LL | let _y = x; | ^^ the destructor for this type cannot be evaluated in constant functions error[E0493]: destructor of `Option<String>` cannot be evaluated at compile-time - --> $DIR/qualif-indirect-mutation-fail.rs:52:9 + --> $DIR/qualif-indirect-mutation-fail.rs:51:9 | LL | let mut y: Option<String> = None; | ^^^^^ the destructor for this type cannot be evaluated in constant functions error[E0493]: destructor of `Option<String>` cannot be evaluated at compile-time - --> $DIR/qualif-indirect-mutation-fail.rs:49:9 + --> $DIR/qualif-indirect-mutation-fail.rs:48:9 | LL | let mut x: Option<String> = None; | ^^^^^ the destructor for this type cannot be evaluated in constant functions error[E0493]: destructor of `Option<String>` cannot be evaluated at compile-time - --> $DIR/qualif-indirect-mutation-fail.rs:62:9 + --> $DIR/qualif-indirect-mutation-fail.rs:61:9 | LL | let y: Option<String> = None; | ^ the destructor for this type cannot be evaluated in constant functions error[E0493]: destructor of `Option<String>` cannot be evaluated at compile-time - --> $DIR/qualif-indirect-mutation-fail.rs:59:9 + --> $DIR/qualif-indirect-mutation-fail.rs:58:9 | LL | let x: Option<String> = None; | ^ the destructor for this type cannot be evaluated in constant functions diff --git a/tests/ui/delegation/correct_body_owner_parent_found_in_diagnostics.rs b/tests/ui/delegation/correct_body_owner_parent_found_in_diagnostics.rs new file mode 100644 index 00000000000..0a7ec5ab5c1 --- /dev/null +++ b/tests/ui/delegation/correct_body_owner_parent_found_in_diagnostics.rs @@ -0,0 +1,34 @@ +#![feature(fn_delegation)] +#![allow(incomplete_features)] + +use std::marker::PhantomData; + +pub struct InvariantRef<'a, T: ?Sized>(&'a T, PhantomData<&'a mut &'a T>); + +impl<'a> InvariantRef<'a, ()> { + pub const NEW: Self = InvariantRef::new(&()); + //~^ ERROR: no function or associated item named `new` found +} + +trait Trait { + fn foo(&self) -> u8 { 0 } + fn bar(&self) -> u8 { 1 } + fn meh(&self) -> u8 { 2 } +} + +struct Z(u8); + +impl Trait for Z { + reuse <u8 as Trait>::{foo, bar, meh} { &const { InvariantRef::<'a>::NEW } } + //~^ ERROR: use of undeclared lifetime name `'a` + //~| ERROR: use of undeclared lifetime name `'a` + //~| ERROR: use of undeclared lifetime name `'a` + //~| ERROR: the trait bound `u8: Trait` is not satisfied + //~| ERROR: the trait bound `u8: Trait` is not satisfied + //~| ERROR: the trait bound `u8: Trait` is not satisfied + //~| ERROR: mismatched types + //~| ERROR: mismatched types + //~| ERROR: mismatched types +} + +fn main() { } diff --git a/tests/ui/delegation/correct_body_owner_parent_found_in_diagnostics.stderr b/tests/ui/delegation/correct_body_owner_parent_found_in_diagnostics.stderr new file mode 100644 index 00000000000..2ce3b388073 --- /dev/null +++ b/tests/ui/delegation/correct_body_owner_parent_found_in_diagnostics.stderr @@ -0,0 +1,113 @@ +error[E0261]: use of undeclared lifetime name `'a` + --> $DIR/correct_body_owner_parent_found_in_diagnostics.rs:22:68 + | +LL | reuse <u8 as Trait>::{foo, bar, meh} { &const { InvariantRef::<'a>::NEW } } + | ^^ undeclared lifetime + | +help: consider introducing lifetime `'a` here + | +LL | reuse <u8 as Trait>::{foo'a, , bar, meh} { &const { InvariantRef::<'a>::NEW } } + | +++ +help: consider introducing lifetime `'a` here + | +LL | impl<'a> Trait for Z { + | ++++ + +error[E0261]: use of undeclared lifetime name `'a` + --> $DIR/correct_body_owner_parent_found_in_diagnostics.rs:22:68 + | +LL | reuse <u8 as Trait>::{foo, bar, meh} { &const { InvariantRef::<'a>::NEW } } + | ^^ undeclared lifetime + | +help: consider introducing lifetime `'a` here + | +LL | reuse <u8 as Trait>::{foo, bar'a, , meh} { &const { InvariantRef::<'a>::NEW } } + | +++ +help: consider introducing lifetime `'a` here + | +LL | impl<'a> Trait for Z { + | ++++ + +error[E0261]: use of undeclared lifetime name `'a` + --> $DIR/correct_body_owner_parent_found_in_diagnostics.rs:22:68 + | +LL | reuse <u8 as Trait>::{foo, bar, meh} { &const { InvariantRef::<'a>::NEW } } + | ^^ undeclared lifetime + | +help: consider introducing lifetime `'a` here + | +LL | reuse <u8 as Trait>::{foo, bar, meh'a, } { &const { InvariantRef::<'a>::NEW } } + | +++ +help: consider introducing lifetime `'a` here + | +LL | impl<'a> Trait for Z { + | ++++ + +error[E0599]: no function or associated item named `new` found for struct `InvariantRef` in the current scope + --> $DIR/correct_body_owner_parent_found_in_diagnostics.rs:9:41 + | +LL | pub struct InvariantRef<'a, T: ?Sized>(&'a T, PhantomData<&'a mut &'a T>); + | -------------------------------------- function or associated item `new` not found for this struct +... +LL | pub const NEW: Self = InvariantRef::new(&()); + | ^^^ function or associated item not found in `InvariantRef<'_, _>` + +error[E0308]: mismatched types + --> $DIR/correct_body_owner_parent_found_in_diagnostics.rs:22:53 + | +LL | reuse <u8 as Trait>::{foo, bar, meh} { &const { InvariantRef::<'a>::NEW } } + | ^^^^^^^^^^^^^^^^^^^^^^^ expected `u8`, found `InvariantRef<'_, ()>` + | + = note: expected type `u8` + found struct `InvariantRef<'_, ()>` + +error[E0277]: the trait bound `u8: Trait` is not satisfied + --> $DIR/correct_body_owner_parent_found_in_diagnostics.rs:22:12 + | +LL | reuse <u8 as Trait>::{foo, bar, meh} { &const { InvariantRef::<'a>::NEW } } + | ^^ the trait `Trait` is not implemented for `u8` + | + = help: the trait `Trait` is implemented for `Z` + +error[E0308]: mismatched types + --> $DIR/correct_body_owner_parent_found_in_diagnostics.rs:22:53 + | +LL | reuse <u8 as Trait>::{foo, bar, meh} { &const { InvariantRef::<'a>::NEW } } + | ^^^^^^^^^^^^^^^^^^^^^^^ expected `u8`, found `InvariantRef<'_, ()>` + | + = note: expected type `u8` + found struct `InvariantRef<'_, ()>` + = note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no` + +error[E0277]: the trait bound `u8: Trait` is not satisfied + --> $DIR/correct_body_owner_parent_found_in_diagnostics.rs:22:12 + | +LL | reuse <u8 as Trait>::{foo, bar, meh} { &const { InvariantRef::<'a>::NEW } } + | ^^ the trait `Trait` is not implemented for `u8` + | + = help: the trait `Trait` is implemented for `Z` + = note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no` + +error[E0308]: mismatched types + --> $DIR/correct_body_owner_parent_found_in_diagnostics.rs:22:53 + | +LL | reuse <u8 as Trait>::{foo, bar, meh} { &const { InvariantRef::<'a>::NEW } } + | ^^^^^^^^^^^^^^^^^^^^^^^ expected `u8`, found `InvariantRef<'_, ()>` + | + = note: expected type `u8` + found struct `InvariantRef<'_, ()>` + = note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no` + +error[E0277]: the trait bound `u8: Trait` is not satisfied + --> $DIR/correct_body_owner_parent_found_in_diagnostics.rs:22:12 + | +LL | reuse <u8 as Trait>::{foo, bar, meh} { &const { InvariantRef::<'a>::NEW } } + | ^^ the trait `Trait` is not implemented for `u8` + | + = help: the trait `Trait` is implemented for `Z` + = note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no` + +error: aborting due to 10 previous errors + +Some errors have detailed explanations: E0261, E0277, E0308, E0599. +For more information about an error, try `rustc --explain E0261`. diff --git a/tests/ui/extern/extern-main-issue-86110.stderr b/tests/ui/extern/extern-main-issue-86110.stderr index 8a3262fbcc7..d69f4e61768 100644 --- a/tests/ui/extern/extern-main-issue-86110.stderr +++ b/tests/ui/extern/extern-main-issue-86110.stderr @@ -2,7 +2,7 @@ error: the `main` function cannot be declared in an `extern` block --> $DIR/extern-main-issue-86110.rs:4:5 | LL | fn main(); - | ^^^^^^^^^ + | ^^^^^^^^^^ error: aborting due to 1 previous error diff --git a/tests/ui/feature-gates/feature-gate-unsafe-attributes.rs b/tests/ui/feature-gates/feature-gate-unsafe-attributes.rs deleted file mode 100644 index 9eba415dda0..00000000000 --- a/tests/ui/feature-gates/feature-gate-unsafe-attributes.rs +++ /dev/null @@ -1,8 +0,0 @@ -#[unsafe(no_mangle)] //~ ERROR [E0658] -extern "C" fn foo() { - -} - -fn main() { - foo(); -} diff --git a/tests/ui/feature-gates/feature-gate-unsafe-attributes.stderr b/tests/ui/feature-gates/feature-gate-unsafe-attributes.stderr deleted file mode 100644 index dfcea756b02..00000000000 --- a/tests/ui/feature-gates/feature-gate-unsafe-attributes.stderr +++ /dev/null @@ -1,13 +0,0 @@ -error[E0658]: `#[unsafe()]` markers for attributes are experimental - --> $DIR/feature-gate-unsafe-attributes.rs:1:3 - | -LL | #[unsafe(no_mangle)] - | ^^^^^^ - | - = note: see issue #123757 <https://github.com/rust-lang/rust/issues/123757> for more information - = help: add `#![feature(unsafe_attributes)]` to the crate attributes to enable - = note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date - -error: aborting due to 1 previous error - -For more information about this error, try `rustc --explain E0658`. diff --git a/tests/ui/foreign/foreign-safe-fn-arg-mismatch.rs b/tests/ui/foreign/foreign-safe-fn-arg-mismatch.rs new file mode 100644 index 00000000000..bb1052b15e9 --- /dev/null +++ b/tests/ui/foreign/foreign-safe-fn-arg-mismatch.rs @@ -0,0 +1,13 @@ +// Make sure we don't ICE when a foreign fn doesn't implement `Fn` due to arg mismatch. + +unsafe extern "Rust" { + pub safe fn foo(); + pub safe fn bar(x: u32); +} + +fn test(_: impl Fn(i32)) {} + +fn main() { + test(foo); //~ ERROR function is expected to take 1 argument, but it takes 0 arguments + test(bar); //~ ERROR type mismatch in function arguments +} diff --git a/tests/ui/foreign/foreign-safe-fn-arg-mismatch.stderr b/tests/ui/foreign/foreign-safe-fn-arg-mismatch.stderr new file mode 100644 index 00000000000..73ccecff5ab --- /dev/null +++ b/tests/ui/foreign/foreign-safe-fn-arg-mismatch.stderr @@ -0,0 +1,44 @@ +error[E0593]: function is expected to take 1 argument, but it takes 0 arguments + --> $DIR/foreign-safe-fn-arg-mismatch.rs:11:10 + | +LL | pub safe fn foo(); + | ------------------ takes 0 arguments +... +LL | test(foo); + | ---- ^^^ expected function that takes 1 argument + | | + | required by a bound introduced by this call + | +note: required by a bound in `test` + --> $DIR/foreign-safe-fn-arg-mismatch.rs:8:17 + | +LL | fn test(_: impl Fn(i32)) {} + | ^^^^^^^ required by this bound in `test` + +error[E0631]: type mismatch in function arguments + --> $DIR/foreign-safe-fn-arg-mismatch.rs:12:10 + | +LL | pub safe fn bar(x: u32); + | ------------------------ found signature defined here +... +LL | test(bar); + | ---- ^^^ expected due to this + | | + | required by a bound introduced by this call + | + = note: expected function signature `fn(i32) -> _` + found function signature `fn(u32) -> _` +note: required by a bound in `test` + --> $DIR/foreign-safe-fn-arg-mismatch.rs:8:17 + | +LL | fn test(_: impl Fn(i32)) {} + | ^^^^^^^ required by this bound in `test` +help: consider wrapping the function in a closure + | +LL | test(|arg0: i32| bar(/* u32 */)); + | +++++++++++ +++++++++++ + +error: aborting due to 2 previous errors + +Some errors have detailed explanations: E0593, E0631. +For more information about an error, try `rustc --explain E0593`. diff --git a/tests/ui/intrinsics/safe-intrinsic-mismatch.effects.stderr b/tests/ui/intrinsics/safe-intrinsic-mismatch.effects.stderr index d9a4960feec..55983a445a4 100644 --- a/tests/ui/intrinsics/safe-intrinsic-mismatch.effects.stderr +++ b/tests/ui/intrinsics/safe-intrinsic-mismatch.effects.stderr @@ -7,13 +7,13 @@ error: intrinsic safety mismatch between list of intrinsics within the compiler --> $DIR/safe-intrinsic-mismatch.rs:11:5 | LL | fn size_of<T>() -> usize; - | ^^^^^^^^^^^^^^^^^^^^^^^^ + | ^^^^^^^^^^^^^^^^^^^^^^^^^ error: intrinsic safety mismatch between list of intrinsics within the compiler and core library intrinsics for intrinsic `size_of` --> $DIR/safe-intrinsic-mismatch.rs:11:5 | LL | fn size_of<T>() -> usize; - | ^^^^^^^^^^^^^^^^^^^^^^^^ + | ^^^^^^^^^^^^^^^^^^^^^^^^^ | = note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no` diff --git a/tests/ui/intrinsics/safe-intrinsic-mismatch.stock.stderr b/tests/ui/intrinsics/safe-intrinsic-mismatch.stock.stderr index 6864c0f36de..c59e357b275 100644 --- a/tests/ui/intrinsics/safe-intrinsic-mismatch.stock.stderr +++ b/tests/ui/intrinsics/safe-intrinsic-mismatch.stock.stderr @@ -2,13 +2,13 @@ error: intrinsic safety mismatch between list of intrinsics within the compiler --> $DIR/safe-intrinsic-mismatch.rs:11:5 | LL | fn size_of<T>() -> usize; - | ^^^^^^^^^^^^^^^^^^^^^^^^ + | ^^^^^^^^^^^^^^^^^^^^^^^^^ error: intrinsic safety mismatch between list of intrinsics within the compiler and core library intrinsics for intrinsic `size_of` --> $DIR/safe-intrinsic-mismatch.rs:11:5 | LL | fn size_of<T>() -> usize; - | ^^^^^^^^^^^^^^^^^^^^^^^^ + | ^^^^^^^^^^^^^^^^^^^^^^^^^ | = note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no` diff --git a/tests/ui/issues/issue-16725.stderr b/tests/ui/issues/issue-16725.stderr index a4a406b3d4b..dcb7d58b0f9 100644 --- a/tests/ui/issues/issue-16725.stderr +++ b/tests/ui/issues/issue-16725.stderr @@ -8,7 +8,7 @@ note: the function `bar` is defined here --> $DIR/auxiliary/issue-16725.rs:2:5 | LL | fn bar(); - | ^^^^^^^^ + | ^^^^^^^^^ error: aborting due to 1 previous error diff --git a/tests/ui/lint/clashing-extern-fn.stderr b/tests/ui/lint/clashing-extern-fn.stderr index 43c8cdead9f..f75ff6d05a1 100644 --- a/tests/ui/lint/clashing-extern-fn.stderr +++ b/tests/ui/lint/clashing-extern-fn.stderr @@ -21,10 +21,10 @@ warning: `clash` redeclared with a different signature --> $DIR/clashing-extern-fn.rs:14:13 | LL | fn clash(x: u8); - | --------------- `clash` previously declared here + | ---------------- `clash` previously declared here ... LL | fn clash(x: u64); - | ^^^^^^^^^^^^^^^^ this signature doesn't match the previous declaration + | ^^^^^^^^^^^^^^^^^ this signature doesn't match the previous declaration | = note: expected `unsafe extern "C" fn(u8)` found `unsafe extern "C" fn(u64)` @@ -41,7 +41,7 @@ LL | #[link_name = "extern_link_name"] | --------------------------------- `extern_link_name` previously declared here ... LL | fn extern_link_name(x: u32); - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ this signature doesn't match the previous declaration + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ this signature doesn't match the previous declaration | = note: expected `unsafe extern "C" fn(i16)` found `unsafe extern "C" fn(u32)` @@ -50,7 +50,7 @@ warning: `some_other_extern_link_name` redeclares `some_other_new_name` with a d --> $DIR/clashing-extern-fn.rs:55:9 | LL | fn some_other_new_name(x: i16); - | ------------------------------ `some_other_new_name` previously declared here + | ------------------------------- `some_other_new_name` previously declared here ... LL | #[link_name = "some_other_new_name"] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ this signature doesn't match the previous declaration @@ -74,10 +74,10 @@ warning: `different_mod` redeclared with a different signature --> $DIR/clashing-extern-fn.rs:72:9 | LL | fn different_mod(x: u8); - | ----------------------- `different_mod` previously declared here + | ------------------------ `different_mod` previously declared here ... LL | fn different_mod(x: u64); - | ^^^^^^^^^^^^^^^^^^^^^^^^ this signature doesn't match the previous declaration + | ^^^^^^^^^^^^^^^^^^^^^^^^^ this signature doesn't match the previous declaration | = note: expected `unsafe extern "C" fn(u8)` found `unsafe extern "C" fn(u64)` @@ -86,10 +86,10 @@ warning: `variadic_decl` redeclared with a different signature --> $DIR/clashing-extern-fn.rs:82:9 | LL | fn variadic_decl(x: u8, ...); - | ---------------------------- `variadic_decl` previously declared here + | ----------------------------- `variadic_decl` previously declared here ... LL | fn variadic_decl(x: u8); - | ^^^^^^^^^^^^^^^^^^^^^^^ this signature doesn't match the previous declaration + | ^^^^^^^^^^^^^^^^^^^^^^^^ this signature doesn't match the previous declaration | = note: expected `unsafe extern "C" fn(u8, ...)` found `unsafe extern "C" fn(u8)` @@ -98,10 +98,10 @@ warning: `weigh_banana` redeclared with a different signature --> $DIR/clashing-extern-fn.rs:142:13 | LL | fn weigh_banana(count: *const Banana) -> u64; - | -------------------------------------------- `weigh_banana` previously declared here + | --------------------------------------------- `weigh_banana` previously declared here ... LL | fn weigh_banana(count: *const Banana) -> u64; - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ this signature doesn't match the previous declaration + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ this signature doesn't match the previous declaration | = note: expected `unsafe extern "C" fn(*const one::Banana) -> u64` found `unsafe extern "C" fn(*const three::Banana) -> u64` @@ -110,10 +110,10 @@ warning: `draw_point` redeclared with a different signature --> $DIR/clashing-extern-fn.rs:171:13 | LL | fn draw_point(p: Point); - | ----------------------- `draw_point` previously declared here + | ------------------------ `draw_point` previously declared here ... LL | fn draw_point(p: Point); - | ^^^^^^^^^^^^^^^^^^^^^^^ this signature doesn't match the previous declaration + | ^^^^^^^^^^^^^^^^^^^^^^^^ this signature doesn't match the previous declaration | = note: expected `unsafe extern "C" fn(sameish_members::a::Point)` found `unsafe extern "C" fn(sameish_members::b::Point)` @@ -122,10 +122,10 @@ warning: `origin` redeclared with a different signature --> $DIR/clashing-extern-fn.rs:197:13 | LL | fn origin() -> Point3; - | --------------------- `origin` previously declared here + | ---------------------- `origin` previously declared here ... LL | fn origin() -> Point3; - | ^^^^^^^^^^^^^^^^^^^^^ this signature doesn't match the previous declaration + | ^^^^^^^^^^^^^^^^^^^^^^ this signature doesn't match the previous declaration | = note: expected `unsafe extern "C" fn() -> same_sized_members_clash::a::Point3` found `unsafe extern "C" fn() -> same_sized_members_clash::b::Point3` @@ -134,10 +134,10 @@ warning: `transparent_incorrect` redeclared with a different signature --> $DIR/clashing-extern-fn.rs:220:13 | LL | fn transparent_incorrect() -> T; - | ------------------------------- `transparent_incorrect` previously declared here + | -------------------------------- `transparent_incorrect` previously declared here ... LL | fn transparent_incorrect() -> isize; - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ this signature doesn't match the previous declaration + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ this signature doesn't match the previous declaration | = note: expected `unsafe extern "C" fn() -> T` found `unsafe extern "C" fn() -> isize` @@ -146,10 +146,10 @@ warning: `missing_return_type` redeclared with a different signature --> $DIR/clashing-extern-fn.rs:259:13 | LL | fn missing_return_type() -> usize; - | --------------------------------- `missing_return_type` previously declared here + | ---------------------------------- `missing_return_type` previously declared here ... LL | fn missing_return_type(); - | ^^^^^^^^^^^^^^^^^^^^^^^^ this signature doesn't match the previous declaration + | ^^^^^^^^^^^^^^^^^^^^^^^^^ this signature doesn't match the previous declaration | = note: expected `unsafe extern "C" fn() -> usize` found `unsafe extern "C" fn()` @@ -158,10 +158,10 @@ warning: `non_zero_usize` redeclared with a different signature --> $DIR/clashing-extern-fn.rs:277:13 | LL | fn non_zero_usize() -> core::num::NonZero<usize>; - | ------------------------------------------------ `non_zero_usize` previously declared here + | ------------------------------------------------- `non_zero_usize` previously declared here ... LL | fn non_zero_usize() -> usize; - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ this signature doesn't match the previous declaration + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ this signature doesn't match the previous declaration | = note: expected `unsafe extern "C" fn() -> NonZero<usize>` found `unsafe extern "C" fn() -> usize` @@ -170,10 +170,10 @@ warning: `non_null_ptr` redeclared with a different signature --> $DIR/clashing-extern-fn.rs:279:13 | LL | fn non_null_ptr() -> core::ptr::NonNull<usize>; - | ---------------------------------------------- `non_null_ptr` previously declared here + | ----------------------------------------------- `non_null_ptr` previously declared here ... LL | fn non_null_ptr() -> *const usize; - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ this signature doesn't match the previous declaration + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ this signature doesn't match the previous declaration | = note: expected `unsafe extern "C" fn() -> NonNull<usize>` found `unsafe extern "C" fn() -> *const usize` @@ -182,10 +182,10 @@ warning: `option_non_zero_usize_incorrect` redeclared with a different signature --> $DIR/clashing-extern-fn.rs:373:13 | LL | fn option_non_zero_usize_incorrect() -> usize; - | --------------------------------------------- `option_non_zero_usize_incorrect` previously declared here + | ---------------------------------------------- `option_non_zero_usize_incorrect` previously declared here ... LL | fn option_non_zero_usize_incorrect() -> isize; - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ this signature doesn't match the previous declaration + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ this signature doesn't match the previous declaration | = note: expected `unsafe extern "C" fn() -> usize` found `unsafe extern "C" fn() -> isize` @@ -194,10 +194,10 @@ warning: `option_non_null_ptr_incorrect` redeclared with a different signature --> $DIR/clashing-extern-fn.rs:375:13 | LL | fn option_non_null_ptr_incorrect() -> *const usize; - | -------------------------------------------------- `option_non_null_ptr_incorrect` previously declared here + | --------------------------------------------------- `option_non_null_ptr_incorrect` previously declared here ... LL | fn option_non_null_ptr_incorrect() -> *const isize; - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ this signature doesn't match the previous declaration + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ this signature doesn't match the previous declaration | = note: expected `unsafe extern "C" fn() -> *const usize` found `unsafe extern "C" fn() -> *const isize` @@ -206,10 +206,10 @@ warning: `hidden_niche_transparent_no_niche` redeclared with a different signatu --> $DIR/clashing-extern-fn.rs:429:13 | LL | fn hidden_niche_transparent_no_niche() -> usize; - | ----------------------------------------------- `hidden_niche_transparent_no_niche` previously declared here + | ------------------------------------------------ `hidden_niche_transparent_no_niche` previously declared here ... LL | fn hidden_niche_transparent_no_niche() -> Option<TransparentNoNiche>; - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ this signature doesn't match the previous declaration + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ this signature doesn't match the previous declaration | = note: expected `unsafe extern "C" fn() -> usize` found `unsafe extern "C" fn() -> Option<TransparentNoNiche>` @@ -218,10 +218,10 @@ warning: `hidden_niche_unsafe_cell` redeclared with a different signature --> $DIR/clashing-extern-fn.rs:433:13 | LL | fn hidden_niche_unsafe_cell() -> usize; - | -------------------------------------- `hidden_niche_unsafe_cell` previously declared here + | --------------------------------------- `hidden_niche_unsafe_cell` previously declared here ... LL | fn hidden_niche_unsafe_cell() -> Option<UnsafeCell<NonZero<usize>>>; - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ this signature doesn't match the previous declaration + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ this signature doesn't match the previous declaration | = note: expected `unsafe extern "C" fn() -> usize` found `unsafe extern "C" fn() -> Option<UnsafeCell<NonZero<usize>>>` diff --git a/tests/ui/lint/issue-1866.stderr b/tests/ui/lint/issue-1866.stderr index 36d323825a4..d19a1349668 100644 --- a/tests/ui/lint/issue-1866.stderr +++ b/tests/ui/lint/issue-1866.stderr @@ -2,10 +2,10 @@ warning: `rust_task_is_unwinding` redeclared with a different signature --> $DIR/issue-1866.rs:23:13 | LL | pub fn rust_task_is_unwinding(rt: *const rust_task) -> bool; - | ----------------------------------------------------------- `rust_task_is_unwinding` previously declared here + | ------------------------------------------------------------ `rust_task_is_unwinding` previously declared here ... LL | pub fn rust_task_is_unwinding(rt: *const rust_task) -> bool; - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ this signature doesn't match the previous declaration + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ this signature doesn't match the previous declaration | = note: expected `unsafe extern "C" fn(*const usize) -> bool` found `unsafe extern "C" fn(*const bool) -> bool` diff --git a/tests/ui/lint/lint-attr-everywhere-late.stderr b/tests/ui/lint/lint-attr-everywhere-late.stderr index ddc31905afb..1937b618236 100644 --- a/tests/ui/lint/lint-attr-everywhere-late.stderr +++ b/tests/ui/lint/lint-attr-everywhere-late.stderr @@ -406,10 +406,10 @@ error: `clashing1` redeclared with a different signature --> $DIR/lint-attr-everywhere-late.rs:123:5 | LL | fn clashing1(); - | -------------- `clashing1` previously declared here + | --------------- `clashing1` previously declared here ... LL | fn clashing1(_: i32); - | ^^^^^^^^^^^^^^^^^^^^ this signature doesn't match the previous declaration + | ^^^^^^^^^^^^^^^^^^^^^ this signature doesn't match the previous declaration | = note: expected `unsafe extern "C" fn()` found `unsafe extern "C" fn(i32)` @@ -423,10 +423,10 @@ error: `clashing2` redeclared with a different signature --> $DIR/lint-attr-everywhere-late.rs:128:5 | LL | fn clashing2(); - | -------------- `clashing2` previously declared here + | --------------- `clashing2` previously declared here ... LL | fn clashing2(_: i32); - | ^^^^^^^^^^^^^^^^^^^^ this signature doesn't match the previous declaration + | ^^^^^^^^^^^^^^^^^^^^^ this signature doesn't match the previous declaration | = note: expected `unsafe extern "C" fn()` found `unsafe extern "C" fn(i32)` diff --git a/tests/ui/lint/lint-missing-doc.stderr b/tests/ui/lint/lint-missing-doc.stderr index 4e9ee4f2769..5165ccc3fd0 100644 --- a/tests/ui/lint/lint-missing-doc.stderr +++ b/tests/ui/lint/lint-missing-doc.stderr @@ -116,7 +116,7 @@ error: missing documentation for a function --> $DIR/lint-missing-doc.rs:196:5 | LL | pub fn extern_fn_undocumented(f: f32) -> f32; - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ error: missing documentation for a static --> $DIR/lint-missing-doc.rs:201:5 diff --git a/tests/ui/lint/lint-unnecessary-parens.fixed b/tests/ui/lint/lint-unnecessary-parens.fixed index 089aa1b7ab7..a8c8dd1d512 100644 --- a/tests/ui/lint/lint-unnecessary-parens.fixed +++ b/tests/ui/lint/lint-unnecessary-parens.fixed @@ -1,7 +1,6 @@ //@ run-rustfix #![deny(unused_parens)] -#![feature(raw_ref_op)] #![allow(while_true)] // for rustfix #[derive(Eq, PartialEq)] diff --git a/tests/ui/lint/lint-unnecessary-parens.rs b/tests/ui/lint/lint-unnecessary-parens.rs index dc77ee00352..02aa78283c7 100644 --- a/tests/ui/lint/lint-unnecessary-parens.rs +++ b/tests/ui/lint/lint-unnecessary-parens.rs @@ -1,7 +1,6 @@ //@ run-rustfix #![deny(unused_parens)] -#![feature(raw_ref_op)] #![allow(while_true)] // for rustfix #[derive(Eq, PartialEq)] diff --git a/tests/ui/lint/lint-unnecessary-parens.stderr b/tests/ui/lint/lint-unnecessary-parens.stderr index c9422437a9f..f2e5debd6e0 100644 --- a/tests/ui/lint/lint-unnecessary-parens.stderr +++ b/tests/ui/lint/lint-unnecessary-parens.stderr @@ -1,5 +1,5 @@ error: unnecessary parentheses around `return` value - --> $DIR/lint-unnecessary-parens.rs:14:12 + --> $DIR/lint-unnecessary-parens.rs:13:12 | LL | return (1); | ^ ^ @@ -16,7 +16,7 @@ LL + return 1; | error: unnecessary parentheses around `return` value - --> $DIR/lint-unnecessary-parens.rs:17:12 + --> $DIR/lint-unnecessary-parens.rs:16:12 | LL | return (X { y }); | ^ ^ @@ -28,7 +28,7 @@ LL + return X { y }; | error: unnecessary parentheses around type - --> $DIR/lint-unnecessary-parens.rs:20:46 + --> $DIR/lint-unnecessary-parens.rs:19:46 | LL | pub fn unused_parens_around_return_type() -> (u32) { | ^ ^ @@ -40,7 +40,7 @@ LL + pub fn unused_parens_around_return_type() -> u32 { | error: unnecessary parentheses around block return value - --> $DIR/lint-unnecessary-parens.rs:26:9 + --> $DIR/lint-unnecessary-parens.rs:25:9 | LL | (5) | ^ ^ @@ -52,7 +52,7 @@ LL + 5 | error: unnecessary parentheses around block return value - --> $DIR/lint-unnecessary-parens.rs:28:5 + --> $DIR/lint-unnecessary-parens.rs:27:5 | LL | (5) | ^ ^ @@ -64,7 +64,7 @@ LL + 5 | error: unnecessary parentheses around `if` condition - --> $DIR/lint-unnecessary-parens.rs:40:7 + --> $DIR/lint-unnecessary-parens.rs:39:7 | LL | if(true) {} | ^ ^ @@ -76,7 +76,7 @@ LL + if true {} | error: unnecessary parentheses around `while` condition - --> $DIR/lint-unnecessary-parens.rs:41:10 + --> $DIR/lint-unnecessary-parens.rs:40:10 | LL | while(true) {} | ^ ^ @@ -88,7 +88,7 @@ LL + while true {} | error: unnecessary parentheses around `for` iterator expression - --> $DIR/lint-unnecessary-parens.rs:42:13 + --> $DIR/lint-unnecessary-parens.rs:41:13 | LL | for _ in(e) {} | ^ ^ @@ -100,7 +100,7 @@ LL + for _ in e {} | error: unnecessary parentheses around `match` scrutinee expression - --> $DIR/lint-unnecessary-parens.rs:43:10 + --> $DIR/lint-unnecessary-parens.rs:42:10 | LL | match(1) { _ => ()} | ^ ^ @@ -112,7 +112,7 @@ LL + match 1 { _ => ()} | error: unnecessary parentheses around `return` value - --> $DIR/lint-unnecessary-parens.rs:44:11 + --> $DIR/lint-unnecessary-parens.rs:43:11 | LL | return(1); | ^ ^ @@ -124,7 +124,7 @@ LL + return 1; | error: unnecessary parentheses around assigned value - --> $DIR/lint-unnecessary-parens.rs:75:31 + --> $DIR/lint-unnecessary-parens.rs:74:31 | LL | pub const CONST_ITEM: usize = (10); | ^ ^ @@ -136,7 +136,7 @@ LL + pub const CONST_ITEM: usize = 10; | error: unnecessary parentheses around assigned value - --> $DIR/lint-unnecessary-parens.rs:76:33 + --> $DIR/lint-unnecessary-parens.rs:75:33 | LL | pub static STATIC_ITEM: usize = (10); | ^ ^ @@ -148,7 +148,7 @@ LL + pub static STATIC_ITEM: usize = 10; | error: unnecessary parentheses around function argument - --> $DIR/lint-unnecessary-parens.rs:80:9 + --> $DIR/lint-unnecessary-parens.rs:79:9 | LL | bar((true)); | ^ ^ @@ -160,7 +160,7 @@ LL + bar(true); | error: unnecessary parentheses around `if` condition - --> $DIR/lint-unnecessary-parens.rs:82:8 + --> $DIR/lint-unnecessary-parens.rs:81:8 | LL | if (true) {} | ^ ^ @@ -172,7 +172,7 @@ LL + if true {} | error: unnecessary parentheses around `while` condition - --> $DIR/lint-unnecessary-parens.rs:83:11 + --> $DIR/lint-unnecessary-parens.rs:82:11 | LL | while (true) {} | ^ ^ @@ -184,7 +184,7 @@ LL + while true {} | error: unnecessary parentheses around `match` scrutinee expression - --> $DIR/lint-unnecessary-parens.rs:84:11 + --> $DIR/lint-unnecessary-parens.rs:83:11 | LL | match (true) { | ^ ^ @@ -196,7 +196,7 @@ LL + match true { | error: unnecessary parentheses around `let` scrutinee expression - --> $DIR/lint-unnecessary-parens.rs:87:16 + --> $DIR/lint-unnecessary-parens.rs:86:16 | LL | if let 1 = (1) {} | ^ ^ @@ -208,7 +208,7 @@ LL + if let 1 = 1 {} | error: unnecessary parentheses around `let` scrutinee expression - --> $DIR/lint-unnecessary-parens.rs:88:19 + --> $DIR/lint-unnecessary-parens.rs:87:19 | LL | while let 1 = (2) {} | ^ ^ @@ -220,7 +220,7 @@ LL + while let 1 = 2 {} | error: unnecessary parentheses around method argument - --> $DIR/lint-unnecessary-parens.rs:104:24 + --> $DIR/lint-unnecessary-parens.rs:103:24 | LL | X { y: false }.foo((true)); | ^ ^ @@ -232,7 +232,7 @@ LL + X { y: false }.foo(true); | error: unnecessary parentheses around assigned value - --> $DIR/lint-unnecessary-parens.rs:106:18 + --> $DIR/lint-unnecessary-parens.rs:105:18 | LL | let mut _a = (0); | ^ ^ @@ -244,7 +244,7 @@ LL + let mut _a = 0; | error: unnecessary parentheses around assigned value - --> $DIR/lint-unnecessary-parens.rs:107:10 + --> $DIR/lint-unnecessary-parens.rs:106:10 | LL | _a = (0); | ^ ^ @@ -256,7 +256,7 @@ LL + _a = 0; | error: unnecessary parentheses around assigned value - --> $DIR/lint-unnecessary-parens.rs:108:11 + --> $DIR/lint-unnecessary-parens.rs:107:11 | LL | _a += (1); | ^ ^ @@ -268,7 +268,7 @@ LL + _a += 1; | error: unnecessary parentheses around pattern - --> $DIR/lint-unnecessary-parens.rs:110:8 + --> $DIR/lint-unnecessary-parens.rs:109:8 | LL | let(mut _a) = 3; | ^ ^ @@ -280,7 +280,7 @@ LL + let mut _a = 3; | error: unnecessary parentheses around pattern - --> $DIR/lint-unnecessary-parens.rs:111:9 + --> $DIR/lint-unnecessary-parens.rs:110:9 | LL | let (mut _a) = 3; | ^ ^ @@ -292,7 +292,7 @@ LL + let mut _a = 3; | error: unnecessary parentheses around pattern - --> $DIR/lint-unnecessary-parens.rs:112:8 + --> $DIR/lint-unnecessary-parens.rs:111:8 | LL | let( mut _a) = 3; | ^^ ^ @@ -304,7 +304,7 @@ LL + let mut _a = 3; | error: unnecessary parentheses around pattern - --> $DIR/lint-unnecessary-parens.rs:114:8 + --> $DIR/lint-unnecessary-parens.rs:113:8 | LL | let(_a) = 3; | ^ ^ @@ -316,7 +316,7 @@ LL + let _a = 3; | error: unnecessary parentheses around pattern - --> $DIR/lint-unnecessary-parens.rs:115:9 + --> $DIR/lint-unnecessary-parens.rs:114:9 | LL | let (_a) = 3; | ^ ^ @@ -328,7 +328,7 @@ LL + let _a = 3; | error: unnecessary parentheses around pattern - --> $DIR/lint-unnecessary-parens.rs:116:8 + --> $DIR/lint-unnecessary-parens.rs:115:8 | LL | let( _a) = 3; | ^^ ^ @@ -340,7 +340,7 @@ LL + let _a = 3; | error: unnecessary parentheses around block return value - --> $DIR/lint-unnecessary-parens.rs:122:9 + --> $DIR/lint-unnecessary-parens.rs:121:9 | LL | (unit!() - One) | ^ ^ @@ -352,7 +352,7 @@ LL + unit!() - One | error: unnecessary parentheses around block return value - --> $DIR/lint-unnecessary-parens.rs:124:9 + --> $DIR/lint-unnecessary-parens.rs:123:9 | LL | (unit![] - One) | ^ ^ @@ -364,7 +364,7 @@ LL + unit![] - One | error: unnecessary parentheses around block return value - --> $DIR/lint-unnecessary-parens.rs:127:9 + --> $DIR/lint-unnecessary-parens.rs:126:9 | LL | (unit! {} - One) | ^ ^ @@ -376,7 +376,7 @@ LL + unit! {} - One | error: unnecessary parentheses around assigned value - --> $DIR/lint-unnecessary-parens.rs:132:14 + --> $DIR/lint-unnecessary-parens.rs:131:14 | LL | let _r = (&x); | ^ ^ @@ -388,7 +388,7 @@ LL + let _r = &x; | error: unnecessary parentheses around assigned value - --> $DIR/lint-unnecessary-parens.rs:133:14 + --> $DIR/lint-unnecessary-parens.rs:132:14 | LL | let _r = (&mut x); | ^ ^ diff --git a/tests/ui/lint/must_not_suspend/other_items.stderr b/tests/ui/lint/must_not_suspend/other_items.stderr index e6c36b78951..dff5210b7e4 100644 --- a/tests/ui/lint/must_not_suspend/other_items.stderr +++ b/tests/ui/lint/must_not_suspend/other_items.stderr @@ -1,10 +1,10 @@ -error: `must_not_suspend` attribute should be applied to a struct, enum, or trait +error: `must_not_suspend` attribute should be applied to a struct, enum, union, or trait --> $DIR/other_items.rs:5:1 | LL | #[must_not_suspend] | ^^^^^^^^^^^^^^^^^^^ LL | mod inner {} - | ------------ is not a struct, enum, or trait + | ------------ is not a struct, enum, union, or trait error: aborting due to 1 previous error diff --git a/tests/ui/lint/must_not_suspend/return.stderr b/tests/ui/lint/must_not_suspend/return.stderr index 5a73064c787..440f8165686 100644 --- a/tests/ui/lint/must_not_suspend/return.stderr +++ b/tests/ui/lint/must_not_suspend/return.stderr @@ -1,4 +1,4 @@ -error: `must_not_suspend` attribute should be applied to a struct, enum, or trait +error: `must_not_suspend` attribute should be applied to a struct, enum, union, or trait --> $DIR/return.rs:5:1 | LL | #[must_not_suspend] @@ -6,7 +6,7 @@ LL | #[must_not_suspend] LL | / fn foo() -> i32 { LL | | 0 LL | | } - | |_- is not a struct, enum, or trait + | |_- is not a struct, enum, union, or trait error: aborting due to 1 previous error diff --git a/tests/ui/lint/unreachable_pub.stderr b/tests/ui/lint/unreachable_pub.stderr index 705a537a3f1..65f45fbd816 100644 --- a/tests/ui/lint/unreachable_pub.stderr +++ b/tests/ui/lint/unreachable_pub.stderr @@ -130,7 +130,7 @@ warning: unreachable `pub` item --> $DIR/unreachable_pub.rs:48:9 | LL | pub fn catalyze() -> bool; - | ---^^^^^^^^^^^^^^^^^^^^^^ + | ---^^^^^^^^^^^^^^^^^^^^^^^ | | | help: consider restricting its visibility: `pub(crate)` | diff --git a/tests/ui/lint/unused/lint-unused-mut-variables.rs b/tests/ui/lint/unused/lint-unused-mut-variables.rs index f0c7dff666e..bc38af9867c 100644 --- a/tests/ui/lint/unused/lint-unused-mut-variables.rs +++ b/tests/ui/lint/unused/lint-unused-mut-variables.rs @@ -3,7 +3,7 @@ // Exercise the unused_mut attribute in some positive and negative cases #![warn(unused_mut)] -#![feature(async_closure, raw_ref_op)] +#![feature(async_closure)] async fn baz_async( mut a: i32, diff --git a/tests/ui/macros/stringify.rs b/tests/ui/macros/stringify.rs index 37409dd066d..f405cd253de 100644 --- a/tests/ui/macros/stringify.rs +++ b/tests/ui/macros/stringify.rs @@ -14,7 +14,6 @@ #![feature(let_chains)] #![feature(more_qualified_paths)] #![feature(never_patterns)] -#![feature(raw_ref_op)] #![feature(trait_alias)] #![feature(try_blocks)] #![feature(type_ascription)] diff --git a/tests/ui/mir/mir_raw_fat_ptr.rs b/tests/ui/mir/mir_raw_fat_ptr.rs index a5a48587e3b..96c030b70e5 100644 --- a/tests/ui/mir/mir_raw_fat_ptr.rs +++ b/tests/ui/mir/mir_raw_fat_ptr.rs @@ -2,7 +2,6 @@ // check raw fat pointer ops in mir // FIXME: please improve this when we get monomorphization support -#![feature(raw_ref_op)] #![allow(ambiguous_wide_pointer_comparisons)] use std::mem; diff --git a/tests/ui/mir/mir_raw_fat_ptr.stderr b/tests/ui/mir/mir_raw_fat_ptr.stderr index a9e9dd66ebd..cd99d566654 100644 --- a/tests/ui/mir/mir_raw_fat_ptr.stderr +++ b/tests/ui/mir/mir_raw_fat_ptr.stderr @@ -1,5 +1,5 @@ warning: method `foo` is never used - --> $DIR/mir_raw_fat_ptr.rs:101:16 + --> $DIR/mir_raw_fat_ptr.rs:100:16 | LL | trait Foo { fn foo(&self) -> usize; } | --- ^^^ diff --git a/tests/ui/packed/packed-struct-address-of-element.rs b/tests/ui/packed/packed-struct-address-of-element.rs index 3fc27d4a96a..5d7c0b3d8b1 100644 --- a/tests/ui/packed/packed-struct-address-of-element.rs +++ b/tests/ui/packed/packed-struct-address-of-element.rs @@ -1,6 +1,5 @@ //@ run-pass #![allow(dead_code)] -#![feature(raw_ref_op)] //@ ignore-emscripten weird assertion? #[repr(packed)] diff --git a/tests/ui/privacy/private-in-public-warn.stderr b/tests/ui/privacy/private-in-public-warn.stderr index 3f7b8c281e7..3743879ffa6 100644 --- a/tests/ui/privacy/private-in-public-warn.stderr +++ b/tests/ui/privacy/private-in-public-warn.stderr @@ -100,7 +100,7 @@ error: type `types::Priv` is more private than the item `types::ef1` --> $DIR/private-in-public-warn.rs:28:9 | LL | pub fn ef1(arg: Priv); - | ^^^^^^^^^^^^^^^^^^^^^ function `types::ef1` is reachable at visibility `pub(crate)` + | ^^^^^^^^^^^^^^^^^^^^^^ function `types::ef1` is reachable at visibility `pub(crate)` | note: but type `types::Priv` is only usable at visibility `pub(self)` --> $DIR/private-in-public-warn.rs:9:5 @@ -112,7 +112,7 @@ error: type `types::Priv` is more private than the item `types::ef2` --> $DIR/private-in-public-warn.rs:29:9 | LL | pub fn ef2() -> Priv; - | ^^^^^^^^^^^^^^^^^^^^ function `types::ef2` is reachable at visibility `pub(crate)` + | ^^^^^^^^^^^^^^^^^^^^^ function `types::ef2` is reachable at visibility `pub(crate)` | note: but type `types::Priv` is only usable at visibility `pub(self)` --> $DIR/private-in-public-warn.rs:9:5 diff --git a/tests/ui/raw-ref-op/feature-raw-ref-op.rs b/tests/ui/raw-ref-op/feature-raw-ref-op.rs deleted file mode 100644 index 0a44b1cde40..00000000000 --- a/tests/ui/raw-ref-op/feature-raw-ref-op.rs +++ /dev/null @@ -1,21 +0,0 @@ -// gate-test-raw_ref_op - -macro_rules! is_expr { - ($e:expr) => {} -} - -is_expr!(&raw const a); //~ ERROR raw address of syntax is experimental -is_expr!(&raw mut a); //~ ERROR raw address of syntax is experimental - -#[cfg(FALSE)] -fn cfgd_out() { - let mut a = 0; - &raw const a; //~ ERROR raw address of syntax is experimental - &raw mut a; //~ ERROR raw address of syntax is experimental -} - -fn main() { - let mut y = 123; - let x = &raw const y; //~ ERROR raw address of syntax is experimental - let x = &raw mut y; //~ ERROR raw address of syntax is experimental -} diff --git a/tests/ui/raw-ref-op/feature-raw-ref-op.stderr b/tests/ui/raw-ref-op/feature-raw-ref-op.stderr deleted file mode 100644 index 4ffd0c90e48..00000000000 --- a/tests/ui/raw-ref-op/feature-raw-ref-op.stderr +++ /dev/null @@ -1,63 +0,0 @@ -error[E0658]: raw address of syntax is experimental - --> $DIR/feature-raw-ref-op.rs:13:5 - | -LL | &raw const a; - | ^^^^^^^^^^ - | - = note: see issue #64490 <https://github.com/rust-lang/rust/issues/64490> for more information - = help: add `#![feature(raw_ref_op)]` to the crate attributes to enable - = note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date - -error[E0658]: raw address of syntax is experimental - --> $DIR/feature-raw-ref-op.rs:14:5 - | -LL | &raw mut a; - | ^^^^^^^^ - | - = note: see issue #64490 <https://github.com/rust-lang/rust/issues/64490> for more information - = help: add `#![feature(raw_ref_op)]` to the crate attributes to enable - = note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date - -error[E0658]: raw address of syntax is experimental - --> $DIR/feature-raw-ref-op.rs:19:13 - | -LL | let x = &raw const y; - | ^^^^^^^^^^ - | - = note: see issue #64490 <https://github.com/rust-lang/rust/issues/64490> for more information - = help: add `#![feature(raw_ref_op)]` to the crate attributes to enable - = note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date - -error[E0658]: raw address of syntax is experimental - --> $DIR/feature-raw-ref-op.rs:20:13 - | -LL | let x = &raw mut y; - | ^^^^^^^^ - | - = note: see issue #64490 <https://github.com/rust-lang/rust/issues/64490> for more information - = help: add `#![feature(raw_ref_op)]` to the crate attributes to enable - = note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date - -error[E0658]: raw address of syntax is experimental - --> $DIR/feature-raw-ref-op.rs:7:10 - | -LL | is_expr!(&raw const a); - | ^^^^^^^^^^ - | - = note: see issue #64490 <https://github.com/rust-lang/rust/issues/64490> for more information - = help: add `#![feature(raw_ref_op)]` to the crate attributes to enable - = note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date - -error[E0658]: raw address of syntax is experimental - --> $DIR/feature-raw-ref-op.rs:8:10 - | -LL | is_expr!(&raw mut a); - | ^^^^^^^^ - | - = note: see issue #64490 <https://github.com/rust-lang/rust/issues/64490> for more information - = help: add `#![feature(raw_ref_op)]` to the crate attributes to enable - = note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date - -error: aborting due to 6 previous errors - -For more information about this error, try `rustc --explain E0658`. diff --git a/tests/ui/raw-ref-op/raw-ref-op.rs b/tests/ui/raw-ref-op/raw-ref-op.rs index 70b7a5a4806..0989a6005dc 100644 --- a/tests/ui/raw-ref-op/raw-ref-op.rs +++ b/tests/ui/raw-ref-op/raw-ref-op.rs @@ -1,7 +1,5 @@ //@ run-pass -#![feature(raw_ref_op)] - fn main() { let mut x = 123; let c_p = &raw const x; diff --git a/tests/ui/raw-ref-op/raw-ref-temp-deref.rs b/tests/ui/raw-ref-op/raw-ref-temp-deref.rs index 5270bdb7a2b..a0078bbc1cd 100644 --- a/tests/ui/raw-ref-op/raw-ref-temp-deref.rs +++ b/tests/ui/raw-ref-op/raw-ref-temp-deref.rs @@ -1,7 +1,7 @@ //@ check-pass // Check that taking the address of a place that contains a dereference is // allowed. -#![feature(raw_ref_op, type_ascription)] +#![feature(type_ascription)] const PAIR_REF: &(i32, i64) = &(1, 2); diff --git a/tests/ui/raw-ref-op/raw-ref-temp.rs b/tests/ui/raw-ref-op/raw-ref-temp.rs index 10e47cb34c5..70f67602af2 100644 --- a/tests/ui/raw-ref-op/raw-ref-temp.rs +++ b/tests/ui/raw-ref-op/raw-ref-temp.rs @@ -1,5 +1,5 @@ // Ensure that we don't allow taking the address of temporary values -#![feature(raw_ref_op, type_ascription)] +#![feature(type_ascription)] const FOUR: u64 = 4; diff --git a/tests/ui/raw-ref-op/unusual_locations.rs b/tests/ui/raw-ref-op/unusual_locations.rs index badf529cb45..eb40fa8a7ee 100644 --- a/tests/ui/raw-ref-op/unusual_locations.rs +++ b/tests/ui/raw-ref-op/unusual_locations.rs @@ -1,7 +1,5 @@ //@ check-pass -#![feature(raw_ref_op)] - const USES_PTR: () = { let u = (); &raw const u; }; static ALSO_USES_PTR: () = { let u = (); &raw const u; }; diff --git a/tests/ui/return/return-from-residual-sugg-issue-125997.fixed b/tests/ui/return/return-from-residual-sugg-issue-125997.fixed index b2eca69aeb9..a5a13399825 100644 --- a/tests/ui/return/return-from-residual-sugg-issue-125997.fixed +++ b/tests/ui/return/return-from-residual-sugg-issue-125997.fixed @@ -33,6 +33,25 @@ macro_rules! mac { }; } +struct A; + +impl A { + fn test4(&self) -> Result<(), Box<dyn std::error::Error>> { + let mut _file = File::create("foo.txt")?; + //~^ ERROR the `?` operator can only be used in a method + + Ok(()) +} + + fn test5(&self) -> Result<(), Box<dyn std::error::Error>> { + let mut _file = File::create("foo.txt")?; + //~^ ERROR the `?` operator can only be used in a method + println!(); + + Ok(()) +} +} + fn main() -> Result<(), Box<dyn std::error::Error>> { let mut _file = File::create("foo.txt")?; //~^ ERROR the `?` operator can only be used in a function diff --git a/tests/ui/return/return-from-residual-sugg-issue-125997.rs b/tests/ui/return/return-from-residual-sugg-issue-125997.rs index dd8550a388b..30ca27eae45 100644 --- a/tests/ui/return/return-from-residual-sugg-issue-125997.rs +++ b/tests/ui/return/return-from-residual-sugg-issue-125997.rs @@ -27,6 +27,21 @@ macro_rules! mac { }; } +struct A; + +impl A { + fn test4(&self) { + let mut _file = File::create("foo.txt")?; + //~^ ERROR the `?` operator can only be used in a method + } + + fn test5(&self) { + let mut _file = File::create("foo.txt")?; + //~^ ERROR the `?` operator can only be used in a method + println!(); + } +} + fn main() { let mut _file = File::create("foo.txt")?; //~^ ERROR the `?` operator can only be used in a function diff --git a/tests/ui/return/return-from-residual-sugg-issue-125997.stderr b/tests/ui/return/return-from-residual-sugg-issue-125997.stderr index ef938f0213d..a59f38c2ec6 100644 --- a/tests/ui/return/return-from-residual-sugg-issue-125997.stderr +++ b/tests/ui/return/return-from-residual-sugg-issue-125997.stderr @@ -37,8 +37,47 @@ LL + Ok(()) LL + } | +error[E0277]: the `?` operator can only be used in a method that returns `Result` or `Option` (or another type that implements `FromResidual`) + --> $DIR/return-from-residual-sugg-issue-125997.rs:34:48 + | +LL | fn test4(&self) { + | --------------- this function should return `Result` or `Option` to accept `?` +LL | let mut _file = File::create("foo.txt")?; + | ^ cannot use the `?` operator in a method that returns `()` + | + = help: the trait `FromResidual<Result<Infallible, std::io::Error>>` is not implemented for `()` +help: consider adding return type + | +LL ~ fn test4(&self) -> Result<(), Box<dyn std::error::Error>> { +LL | let mut _file = File::create("foo.txt")?; +LL | +LL ~ +LL + Ok(()) +LL + } + | + +error[E0277]: the `?` operator can only be used in a method that returns `Result` or `Option` (or another type that implements `FromResidual`) + --> $DIR/return-from-residual-sugg-issue-125997.rs:39:48 + | +LL | fn test5(&self) { + | --------------- this function should return `Result` or `Option` to accept `?` +LL | let mut _file = File::create("foo.txt")?; + | ^ cannot use the `?` operator in a method that returns `()` + | + = help: the trait `FromResidual<Result<Infallible, std::io::Error>>` is not implemented for `()` +help: consider adding return type + | +LL ~ fn test5(&self) -> Result<(), Box<dyn std::error::Error>> { +LL | let mut _file = File::create("foo.txt")?; +LL | +LL | println!(); +LL ~ +LL + Ok(()) +LL + } + | + error[E0277]: the `?` operator can only be used in a function that returns `Result` or `Option` (or another type that implements `FromResidual`) - --> $DIR/return-from-residual-sugg-issue-125997.rs:31:44 + --> $DIR/return-from-residual-sugg-issue-125997.rs:46:44 | LL | fn main() { | --------- this function should return `Result` or `Option` to accept `?` @@ -81,6 +120,6 @@ LL + Ok(()) LL + } | -error: aborting due to 4 previous errors +error: aborting due to 6 previous errors For more information about this error, try `rustc --explain E0277`. diff --git a/tests/ui/rfcs/rfc-2627-raw-dylib/multiple-declarations.stderr b/tests/ui/rfcs/rfc-2627-raw-dylib/multiple-declarations.stderr index 7866af59444..b766b5c8dd8 100644 --- a/tests/ui/rfcs/rfc-2627-raw-dylib/multiple-declarations.stderr +++ b/tests/ui/rfcs/rfc-2627-raw-dylib/multiple-declarations.stderr @@ -2,7 +2,7 @@ error: multiple declarations of external function `f` from library `foo.dll` hav --> $DIR/multiple-declarations.rs:13:9 | LL | fn f(x: i32); - | ^^^^^^^^^^^^ + | ^^^^^^^^^^^^^ error: aborting due to 1 previous error diff --git a/tests/ui/rfcs/rfc-2627-raw-dylib/unsupported-abi.stderr b/tests/ui/rfcs/rfc-2627-raw-dylib/unsupported-abi.stderr index d7c7344b596..ef022404e7f 100644 --- a/tests/ui/rfcs/rfc-2627-raw-dylib/unsupported-abi.stderr +++ b/tests/ui/rfcs/rfc-2627-raw-dylib/unsupported-abi.stderr @@ -2,7 +2,7 @@ error: ABI not supported by `#[link(kind = "raw-dylib")]` on this architecture --> $DIR/unsupported-abi.rs:6:5 | LL | fn f(x: i32); - | ^^^^^^^^^^^^ + | ^^^^^^^^^^^^^ error: aborting due to 1 previous error diff --git a/tests/ui/rust-2024/unsafe-attributes/in_2024_compatibility.rs b/tests/ui/rust-2024/unsafe-attributes/in_2024_compatibility.rs index c6f9115cde7..f3b8645abaf 100644 --- a/tests/ui/rust-2024/unsafe-attributes/in_2024_compatibility.rs +++ b/tests/ui/rust-2024/unsafe-attributes/in_2024_compatibility.rs @@ -1,5 +1,4 @@ #![deny(rust_2024_compatibility)] -#![feature(unsafe_attributes)] #[no_mangle] //~^ ERROR: unsafe attribute used without unsafe diff --git a/tests/ui/rust-2024/unsafe-attributes/in_2024_compatibility.stderr b/tests/ui/rust-2024/unsafe-attributes/in_2024_compatibility.stderr index f0689d9883c..4629a154ac3 100644 --- a/tests/ui/rust-2024/unsafe-attributes/in_2024_compatibility.stderr +++ b/tests/ui/rust-2024/unsafe-attributes/in_2024_compatibility.stderr @@ -1,5 +1,5 @@ error: unsafe attribute used without unsafe - --> $DIR/in_2024_compatibility.rs:4:3 + --> $DIR/in_2024_compatibility.rs:3:3 | LL | #[no_mangle] | ^^^^^^^^^ usage of unsafe attribute diff --git a/tests/ui/rust-2024/unsafe-attributes/unsafe-attribute-marked.rs b/tests/ui/rust-2024/unsafe-attributes/unsafe-attribute-marked.rs index 279ced2525a..7c919fed976 100644 --- a/tests/ui/rust-2024/unsafe-attributes/unsafe-attribute-marked.rs +++ b/tests/ui/rust-2024/unsafe-attributes/unsafe-attribute-marked.rs @@ -4,7 +4,6 @@ //@[edition2024] compile-flags: -Zunstable-options //@ check-pass -#![feature(unsafe_attributes)] #[unsafe(no_mangle)] extern "C" fn foo() {} diff --git a/tests/ui/rust-2024/unsafe-attributes/unsafe-attributes-fix.fixed b/tests/ui/rust-2024/unsafe-attributes/unsafe-attributes-fix.fixed index 6ebdff0334c..586881d1807 100644 --- a/tests/ui/rust-2024/unsafe-attributes/unsafe-attributes-fix.fixed +++ b/tests/ui/rust-2024/unsafe-attributes/unsafe-attributes-fix.fixed @@ -1,5 +1,4 @@ //@ run-rustfix -#![feature(unsafe_attributes)] #![deny(unsafe_attr_outside_unsafe)] macro_rules! tt { diff --git a/tests/ui/rust-2024/unsafe-attributes/unsafe-attributes-fix.rs b/tests/ui/rust-2024/unsafe-attributes/unsafe-attributes-fix.rs index c78ff45ea4c..03e122c7d57 100644 --- a/tests/ui/rust-2024/unsafe-attributes/unsafe-attributes-fix.rs +++ b/tests/ui/rust-2024/unsafe-attributes/unsafe-attributes-fix.rs @@ -1,5 +1,4 @@ //@ run-rustfix -#![feature(unsafe_attributes)] #![deny(unsafe_attr_outside_unsafe)] macro_rules! tt { diff --git a/tests/ui/rust-2024/unsafe-attributes/unsafe-attributes-fix.stderr b/tests/ui/rust-2024/unsafe-attributes/unsafe-attributes-fix.stderr index c95984f58ec..64debc58905 100644 --- a/tests/ui/rust-2024/unsafe-attributes/unsafe-attributes-fix.stderr +++ b/tests/ui/rust-2024/unsafe-attributes/unsafe-attributes-fix.stderr @@ -1,5 +1,5 @@ error: unsafe attribute used without unsafe - --> $DIR/unsafe-attributes-fix.rs:44:6 + --> $DIR/unsafe-attributes-fix.rs:43:6 | LL | tt!([no_mangle]); | ^^^^^^^^^ usage of unsafe attribute @@ -7,7 +7,7 @@ LL | tt!([no_mangle]); = warning: this is accepted in the current edition (Rust 2015) but is a hard error in Rust 2024! = note: for more information, see issue #123757 <https://github.com/rust-lang/rust/issues/123757> note: the lint level is defined here - --> $DIR/unsafe-attributes-fix.rs:3:9 + --> $DIR/unsafe-attributes-fix.rs:2:9 | LL | #![deny(unsafe_attr_outside_unsafe)] | ^^^^^^^^^^^^^^^^^^^^^^^^^^ @@ -17,7 +17,7 @@ LL | tt!([unsafe(no_mangle)]); | +++++++ + error: unsafe attribute used without unsafe - --> $DIR/unsafe-attributes-fix.rs:14:11 + --> $DIR/unsafe-attributes-fix.rs:13:11 | LL | #[$e] | ^^ usage of unsafe attribute @@ -34,7 +34,7 @@ LL | #[unsafe($e)] | +++++++ + error: unsafe attribute used without unsafe - --> $DIR/unsafe-attributes-fix.rs:48:7 + --> $DIR/unsafe-attributes-fix.rs:47:7 | LL | meta!(no_mangle); | ^^^^^^^^^ usage of unsafe attribute @@ -47,7 +47,7 @@ LL | meta!(unsafe(no_mangle)); | +++++++ + error: unsafe attribute used without unsafe - --> $DIR/unsafe-attributes-fix.rs:51:8 + --> $DIR/unsafe-attributes-fix.rs:50:8 | LL | meta2!(export_name = "baw"); | ^^^^^^^^^^^ usage of unsafe attribute @@ -60,7 +60,7 @@ LL | meta2!(unsafe(export_name = "baw")); | +++++++ + error: unsafe attribute used without unsafe - --> $DIR/unsafe-attributes-fix.rs:23:11 + --> $DIR/unsafe-attributes-fix.rs:22:11 | LL | #[$e = $l] | ^^ usage of unsafe attribute @@ -77,7 +77,7 @@ LL | #[unsafe($e = $l)] | +++++++ + error: unsafe attribute used without unsafe - --> $DIR/unsafe-attributes-fix.rs:56:3 + --> $DIR/unsafe-attributes-fix.rs:55:3 | LL | #[no_mangle] | ^^^^^^^^^ usage of unsafe attribute diff --git a/tests/ui/rust-2024/unsafe-attributes/unsafe-attributes.edition2024.stderr b/tests/ui/rust-2024/unsafe-attributes/unsafe-attributes.edition2024.stderr index 35475d66716..fb697e14ef1 100644 --- a/tests/ui/rust-2024/unsafe-attributes/unsafe-attributes.edition2024.stderr +++ b/tests/ui/rust-2024/unsafe-attributes/unsafe-attributes.edition2024.stderr @@ -1,5 +1,5 @@ error: unsafe attribute used without unsafe - --> $DIR/unsafe-attributes.rs:9:3 + --> $DIR/unsafe-attributes.rs:8:3 | LL | #[no_mangle] | ^^^^^^^^^ usage of unsafe attribute diff --git a/tests/ui/rust-2024/unsafe-attributes/unsafe-attributes.rs b/tests/ui/rust-2024/unsafe-attributes/unsafe-attributes.rs index 3a6af9dfb2b..f6f2994bb6d 100644 --- a/tests/ui/rust-2024/unsafe-attributes/unsafe-attributes.rs +++ b/tests/ui/rust-2024/unsafe-attributes/unsafe-attributes.rs @@ -4,7 +4,6 @@ //@[edition2024] edition:2024 //@[edition2024] compile-flags: -Zunstable-options -#![feature(unsafe_attributes)] #[no_mangle] //[edition2024]~ ERROR: unsafe attribute used without unsafe extern "C" fn foo() {} diff --git a/tests/ui/sanitizer/thread.rs b/tests/ui/sanitizer/thread.rs index 9d9ad6ee518..566774d6b1d 100644 --- a/tests/ui/sanitizer/thread.rs +++ b/tests/ui/sanitizer/thread.rs @@ -20,7 +20,6 @@ //@ error-pattern: Location is heap block of size 4 //@ error-pattern: allocated by main thread -#![feature(raw_ref_op)] #![feature(rustc_private)] extern crate libc; diff --git a/tests/ui/static/raw-ref-extern-static.rs b/tests/ui/static/raw-ref-extern-static.rs index 95a53a8640d..81bc5990efe 100644 --- a/tests/ui/static/raw-ref-extern-static.rs +++ b/tests/ui/static/raw-ref-extern-static.rs @@ -1,5 +1,4 @@ //@ check-pass -#![feature(raw_ref_op)] use std::ptr; // see https://github.com/rust-lang/rust/issues/125833 diff --git a/tests/ui/static/raw-ref-static-mut.rs b/tests/ui/static/raw-ref-static-mut.rs index 6855cc7b050..d4159fc65ca 100644 --- a/tests/ui/static/raw-ref-static-mut.rs +++ b/tests/ui/static/raw-ref-static-mut.rs @@ -1,5 +1,4 @@ //@ check-pass -#![feature(raw_ref_op)] use std::ptr; // see https://github.com/rust-lang/rust/issues/125833 diff --git a/tests/ui/transmutability/references/accept_assume_lifetime_extension.rs b/tests/ui/transmutability/references/accept_assume_lifetime_extension.rs new file mode 100644 index 00000000000..3bdd7256791 --- /dev/null +++ b/tests/ui/transmutability/references/accept_assume_lifetime_extension.rs @@ -0,0 +1,91 @@ +//@ check-pass + +//! Accept lifetime extensions with `Assume::LIFETIMES`. + +#![feature(transmutability, core_intrinsics)] + +use std::mem::{Assume, BikeshedIntrinsicFrom}; + +unsafe fn transmute<Src, Dst>(src: Src) -> Dst +where + Dst: BikeshedIntrinsicFrom<Src, { Assume::SAFETY.and(Assume::LIFETIMES) }>, +{ + core::intrinsics::transmute_unchecked(src) +} + +mod bare { + use super::*; + + fn extend_bare<'a>(src: &'a u8) -> &'static u8 { + unsafe { transmute(src) } + } +} + +mod nested { + use super::*; + + fn extend_nested<'a>(src: &'a &'a u8) -> &'a &'static u8 { + unsafe { transmute(src) } + } +} + +mod tuple { + use super::*; + + fn extend_unit<'a>(src: (&'a u8,)) -> (&'static u8,) { + unsafe { transmute(src) } + } + + fn extend_pair<'a>(src: (&'a u8, u8)) -> (&'static u8, u8) { + unsafe { transmute(src) } + } +} + +mod r#struct { + use super::*; + + struct Struct<'a>(&'a u8); + + fn extend_struct<'a>(src: Struct<'a>) -> Struct<'static> { + unsafe { transmute(src) } + } +} + +mod r#enum { + use super::*; + + enum Single<'a> { + A(&'a u8), + } + + fn extend_single<'a>(src: Single<'a>) -> Single<'static> { + unsafe { transmute(src) } + } + + enum Multi<'a> { + A(&'a u8), + B, + C, + } + + fn extend_multi<'a>(src: Multi<'a>) -> Multi<'static> { + unsafe { transmute(src) } + } +} + +mod hrtb { + use super::*; + + fn call_extend_hrtb<'a>(src: &'a u8) -> &'static u8 { + unsafe { extend_hrtb(src) } + } + + unsafe fn extend_hrtb<'a>(src: &'a u8) -> &'static u8 + where + for<'b> &'b u8: BikeshedIntrinsicFrom<&'a u8, { Assume::LIFETIMES }>, + { + core::intrinsics::transmute_unchecked(src) + } +} + +fn main() {} diff --git a/tests/ui/transmutability/references/accept_unexercised_lifetime_extension.rs b/tests/ui/transmutability/references/accept_unexercised_lifetime_extension.rs new file mode 100644 index 00000000000..559ee23a446 --- /dev/null +++ b/tests/ui/transmutability/references/accept_unexercised_lifetime_extension.rs @@ -0,0 +1,68 @@ +//@ check-pass + +//! Accept lifetime extensions of un-exercised lifetimes. + +#![feature(transmutability, core_intrinsics)] + +use std::mem::{Assume, BikeshedIntrinsicFrom}; + +unsafe fn transmute<Src, Dst>(src: Src) -> Dst +where + Dst: BikeshedIntrinsicFrom<Src, { Assume::SAFETY }>, +{ + core::intrinsics::transmute_unchecked(src) +} + +enum Void {} + +mod phantom { + use super::*; + use std::marker::PhantomData; + + fn extend_bare<'a>(src: PhantomData<&'a u8>) -> PhantomData<&'static u8> { + unsafe { transmute(src) } + } +} + + +mod tuple { + use super::*; + + fn extend_pair<'a>(src: (&'a u8, Void)) -> (&'static u8, Void) { + unsafe { transmute(src) } + } +} + +mod r#struct { + use super::*; + + struct Struct<'a>(&'a u8, Void); + + fn extend_struct<'a>(src: Struct<'a>) -> Struct<'static> { + unsafe { transmute(src) } + } +} + +mod r#enum { + use super::*; + + enum Single<'a> { + A(&'a u8, Void), + } + + fn extend_single<'a>(src: Single<'a>) -> Single<'static> { + unsafe { transmute(src) } + } + + enum Multi<'a> { + A(&'a u8, Void), + B, + C, + } + + fn extend_multi<'a>(src: Multi<'a>) -> Multi<'static> { + unsafe { transmute(src) } + } +} + +fn main() {} diff --git a/tests/ui/transmutability/references/reject_lifetime_extension.rs b/tests/ui/transmutability/references/reject_lifetime_extension.rs new file mode 100644 index 00000000000..79bb4e1e556 --- /dev/null +++ b/tests/ui/transmutability/references/reject_lifetime_extension.rs @@ -0,0 +1,91 @@ +//@ check-fail + +//! Reject lifetime extensions. + +#![feature(transmutability, core_intrinsics)] + +use std::mem::{Assume, BikeshedIntrinsicFrom}; + +unsafe fn transmute<Src, Dst>(src: Src) -> Dst +where + Dst: BikeshedIntrinsicFrom<Src, { Assume::SAFETY }>, +{ + core::intrinsics::transmute_unchecked(src) +} + +mod bare { + use super::*; + + fn extend_bare<'a>(src: &'a u8) -> &'static u8 { + unsafe { transmute(src) } //~ ERROR lifetime may not live long enough + } +} + +mod nested { + use super::*; + + fn extend_nested<'a>(src: &'a &'a u8) -> &'a &'static u8 { + unsafe { transmute(src) } //~ ERROR lifetime may not live long enough + } +} + +mod tuple { + use super::*; + + fn extend_unit<'a>(src: (&'a u8,)) -> (&'static u8,) { + unsafe { transmute(src) } //~ ERROR lifetime may not live long enough + } + + fn extend_pair<'a>(src: (&'a u8, u8)) -> (&'static u8, u8) { + unsafe { transmute(src) } //~ ERROR lifetime may not live long enough + } +} + +mod r#struct { + use super::*; + + struct Struct<'a>(&'a u8); + + fn extend_struct<'a>(src: Struct<'a>) -> Struct<'static> { + unsafe { transmute(src) } //~ ERROR lifetime may not live long enough + } +} + +mod r#enum { + use super::*; + + enum Single<'a> { + A(&'a u8), + } + + fn extend_single<'a>(src: Single<'a>) -> Single<'static> { + unsafe { transmute(src) } //~ ERROR lifetime may not live long enough + } + + enum Multi<'a> { + A(&'a u8), + B, + C, + } + + fn extend_multi<'a>(src: Multi<'a>) -> Multi<'static> { + unsafe { transmute(src) } //~ ERROR lifetime may not live long enough + } +} + +mod hrtb { + use super::*; + + fn call_extend_hrtb<'a>(src: &'a u8) -> &'static u8 { + unsafe { extend_hrtb(src) } //~ ERROR borrowed data escapes outside of function + } + + unsafe fn extend_hrtb<'a>(src: &'a u8) -> &'static u8 + where + for<'b> &'b u8: BikeshedIntrinsicFrom<&'a u8>, + { + core::intrinsics::transmute_unchecked(src) + } +} + +fn main() {} diff --git a/tests/ui/transmutability/references/reject_lifetime_extension.stderr b/tests/ui/transmutability/references/reject_lifetime_extension.stderr new file mode 100644 index 00000000000..df1b81f26d2 --- /dev/null +++ b/tests/ui/transmutability/references/reject_lifetime_extension.stderr @@ -0,0 +1,78 @@ +error: lifetime may not live long enough + --> $DIR/reject_lifetime_extension.rs:20:18 + | +LL | fn extend_bare<'a>(src: &'a u8) -> &'static u8 { + | -- lifetime `'a` defined here +LL | unsafe { transmute(src) } + | ^^^^^^^^^^^^^^ returning this value requires that `'a` must outlive `'static` + +error: lifetime may not live long enough + --> $DIR/reject_lifetime_extension.rs:28:18 + | +LL | fn extend_nested<'a>(src: &'a &'a u8) -> &'a &'static u8 { + | -- lifetime `'a` defined here +LL | unsafe { transmute(src) } + | ^^^^^^^^^^^^^^ returning this value requires that `'a` must outlive `'static` + +error: lifetime may not live long enough + --> $DIR/reject_lifetime_extension.rs:36:18 + | +LL | fn extend_unit<'a>(src: (&'a u8,)) -> (&'static u8,) { + | -- lifetime `'a` defined here +LL | unsafe { transmute(src) } + | ^^^^^^^^^^^^^^ returning this value requires that `'a` must outlive `'static` + +error: lifetime may not live long enough + --> $DIR/reject_lifetime_extension.rs:40:18 + | +LL | fn extend_pair<'a>(src: (&'a u8, u8)) -> (&'static u8, u8) { + | -- lifetime `'a` defined here +LL | unsafe { transmute(src) } + | ^^^^^^^^^^^^^^ returning this value requires that `'a` must outlive `'static` + +error: lifetime may not live long enough + --> $DIR/reject_lifetime_extension.rs:50:18 + | +LL | fn extend_struct<'a>(src: Struct<'a>) -> Struct<'static> { + | -- lifetime `'a` defined here +LL | unsafe { transmute(src) } + | ^^^^^^^^^^^^^^ returning this value requires that `'a` must outlive `'static` + +error: lifetime may not live long enough + --> $DIR/reject_lifetime_extension.rs:62:18 + | +LL | fn extend_single<'a>(src: Single<'a>) -> Single<'static> { + | -- lifetime `'a` defined here +LL | unsafe { transmute(src) } + | ^^^^^^^^^^^^^^ returning this value requires that `'a` must outlive `'static` + +error: lifetime may not live long enough + --> $DIR/reject_lifetime_extension.rs:72:18 + | +LL | fn extend_multi<'a>(src: Multi<'a>) -> Multi<'static> { + | -- lifetime `'a` defined here +LL | unsafe { transmute(src) } + | ^^^^^^^^^^^^^^ returning this value requires that `'a` must outlive `'static` + +error[E0521]: borrowed data escapes outside of function + --> $DIR/reject_lifetime_extension.rs:80:18 + | +LL | fn call_extend_hrtb<'a>(src: &'a u8) -> &'static u8 { + | -- --- `src` is a reference that is only valid in the function body + | | + | lifetime `'a` defined here +LL | unsafe { extend_hrtb(src) } + | ^^^^^^^^^^^^^^^^ + | | + | `src` escapes the function body here + | argument requires that `'a` must outlive `'static` + | +note: due to current limitations in the borrow checker, this implies a `'static` lifetime + --> $DIR/reject_lifetime_extension.rs:85:25 + | +LL | for<'b> &'b u8: BikeshedIntrinsicFrom<&'a u8>, + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +error: aborting due to 8 previous errors + +For more information about this error, try `rustc --explain E0521`. diff --git a/tests/ui/typeck/const-in-fn-call-generics.rs b/tests/ui/typeck/const-in-fn-call-generics.rs new file mode 100644 index 00000000000..675dbcc3054 --- /dev/null +++ b/tests/ui/typeck/const-in-fn-call-generics.rs @@ -0,0 +1,16 @@ +fn generic<const N: u32>() {} + +trait Collate<const A: u32> { + type Pass; + fn collate(self) -> Self::Pass; +} + +impl<const B: u32> Collate<B> for i32 { + type Pass = (); + fn collate(self) -> Self::Pass { + generic::<{ true }>() + //~^ ERROR: mismatched types + } +} + +fn main() {} diff --git a/tests/ui/typeck/const-in-fn-call-generics.stderr b/tests/ui/typeck/const-in-fn-call-generics.stderr new file mode 100644 index 00000000000..12dd454188c --- /dev/null +++ b/tests/ui/typeck/const-in-fn-call-generics.stderr @@ -0,0 +1,9 @@ +error[E0308]: mismatched types + --> $DIR/const-in-fn-call-generics.rs:11:21 + | +LL | generic::<{ true }>() + | ^^^^ expected `u32`, found `bool` + +error: aborting due to 1 previous error + +For more information about this error, try `rustc --explain E0308`. diff --git a/tests/ui/unpretty/expanded-exhaustive.rs b/tests/ui/unpretty/expanded-exhaustive.rs index 29472df897a..279d723a26c 100644 --- a/tests/ui/unpretty/expanded-exhaustive.rs +++ b/tests/ui/unpretty/expanded-exhaustive.rs @@ -19,7 +19,6 @@ #![feature(never_type)] #![feature(pattern_types)] #![feature(prelude_import)] -#![feature(raw_ref_op)] #![feature(specialization)] #![feature(trace_macros)] #![feature(trait_alias)] diff --git a/tests/ui/unpretty/expanded-exhaustive.stdout b/tests/ui/unpretty/expanded-exhaustive.stdout index cf2f6f8cbaa..149659693ae 100644 --- a/tests/ui/unpretty/expanded-exhaustive.stdout +++ b/tests/ui/unpretty/expanded-exhaustive.stdout @@ -20,7 +20,6 @@ #![feature(never_type)] #![feature(pattern_types)] #![feature(prelude_import)] -#![feature(raw_ref_op)] #![feature(specialization)] #![feature(trace_macros)] #![feature(trait_alias)] diff --git a/triagebot.toml b/triagebot.toml index a98d5f6a7c2..161fe98fca9 100644 --- a/triagebot.toml +++ b/triagebot.toml @@ -970,7 +970,6 @@ rustdoc = [ docs = [ "@ehuss", "@GuillaumeGomez", - "@JohnTitor", ] query-system = [ "@cjgillot", |
