diff --git a/Cargo.lock b/Cargo.lock index bb709cad86..e238c8be18 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -31,7 +31,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e89da841a80418a9b391ebaea17f5c112ffaaa96f621d2c285b5174da76b9011" dependencies = [ "cfg-if", - "getrandom", + "getrandom 0.2.16", "once_cell", "version_check", "zerocopy", @@ -59,7 +59,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ef6978589202a00cd7e118380c448a08b6ed394c3a8df3a430d0898e3a42d046" dependencies = [ "android-properties", - "bitflags 2.6.0", + "bitflags 2.9.0", "cc", "cesu8", "jni", @@ -81,9 +81,9 @@ checksum = "fc7eb209b1518d6bb87b283c20095f5228ecda460da70b44f0802523dea6da04" [[package]] name = "android_log-sys" -version = "0.3.1" +version = "0.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5ecc8056bf6ab9892dcd53216c83d1597487d7dacac16c8df6b877d127df9937" +checksum = "84521a3cf562bc62942e294181d9eef17eb38ceb8c68677bc49f144e4c3d4f8d" [[package]] name = "android_logger" @@ -146,19 +146,20 @@ dependencies = [ [[package]] name = "anstyle-wincon" -version = "3.0.6" +version = "3.0.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2109dbce0e72be3ec00bed26e6a7479ca384ad226efdd66db8fa2e3a38c83125" +checksum = "ca3534e77181a9cc07539ad51f2141fe32f6c3ffd4df76db8ad92346b003ae4e" dependencies = [ "anstyle", + "once_cell", "windows-sys 0.59.0", ] [[package]] name = "anyhow" -version = "1.0.95" +version = "1.0.98" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "34ac096ce696dc2fcabef30516bb13c0a68a11d30131d3df6f04711467681b04" +checksum = "e16d2d3311acee920a9eb8d33b8cbc1787ce4a264e85f964c2404b969bdcd487" [[package]] name = "ar" @@ -257,9 +258,9 @@ checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" [[package]] name = "bitflags" -version = "2.6.0" +version = "2.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b048fb63fd8b5923fc5aa7b340d8e156aec7ec02f0c78fa8a6ddc2613f6f71de" +checksum = "5c8214115b7bf84099f1309324e63141d4c5d7cc26862f97a0a857dbefe165bd" [[package]] name = "block" @@ -278,24 +279,24 @@ dependencies = [ [[package]] name = "bumpalo" -version = "3.16.0" +version = "3.17.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "79296716171880943b8470b5f8d03aa55eb2e645a4874bdbb28adb49162e012c" +checksum = "1628fb46dfa0b37568d12e5edd512553eccf6a22a78e8bde00bb4aed84d5bdbf" [[package]] name = "bytemuck" -version = "1.21.0" +version = "1.23.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ef657dfab802224e671f5818e9a4935f9b1957ed18e58292690cc39e7a4092a3" +checksum = "9134a6ef01ce4b366b50689c94f82c14bc72bc5d0386829828a2e2752ef7958c" dependencies = [ "bytemuck_derive", ] [[package]] name = "bytemuck_derive" -version = "1.8.1" +version = "1.9.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3fa76293b4f7bb636ab88fd78228235b5248b4d05cc589aed610f954af5d7c7a" +checksum = "7ecc273b49b3205b83d648f0690daa588925572cc5063745bfe547fe7ec8e1a1" dependencies = [ "proc-macro2", "quote", @@ -304,9 +305,9 @@ dependencies = [ [[package]] name = "bytes" -version = "1.9.0" +version = "1.10.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "325918d6fe32f23b19878fe4b34794ae41fc19ddbe53b10571a4874d44ffd39b" +checksum = "d71b6127be86fdcfddb610f7182ac57211d4b18a3e9c82eb2d17662f2227ad6a" [[package]] name = "calloop" @@ -314,10 +315,10 @@ version = "0.13.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b99da2f8558ca23c71f4fd15dc57c906239752dd27ff3c00a1d56b685b7cbfec" dependencies = [ - "bitflags 2.6.0", + "bitflags 2.9.0", "log", "polling", - "rustix", + "rustix 0.38.44", "slab", "thiserror", ] @@ -329,16 +330,16 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "95a66a987056935f7efce4ab5668920b5d0dac4a7c99991a67395f13702ddd20" dependencies = [ "calloop", - "rustix", + "rustix 0.38.44", "wayland-backend", - "wayland-client 0.31.7", + "wayland-client 0.31.10", ] [[package]] name = "cc" -version = "1.2.6" +version = "1.2.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8d6dbb628b8f8555f86d0323c2eb39e3ec81901f4b83e091db8a6a76d316a333" +checksum = "04da6a0d40b948dfc4fa8f5bbf402b0fc1a64a28dbf7d12ffd683550f2c1b63a" dependencies = [ "jobserver", "libc", @@ -371,9 +372,9 @@ checksum = "613afe47fcd5fac7ccf1db93babcb082c5994d996f20b8b159f2ad1658eb5724" [[package]] name = "clap" -version = "4.5.23" +version = "4.5.37" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3135e7ec2ef7b10c6ed8950f0f792ed96ee093fa088608f1c76e569722700c84" +checksum = "eccb054f56cbd38340b380d4a8e69ef1f02f1af43db2f0cc817a4774d80ae071" dependencies = [ "clap_builder", "clap_derive", @@ -381,9 +382,9 @@ dependencies = [ [[package]] name = "clap_builder" -version = "4.5.23" +version = "4.5.37" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "30582fc632330df2bd26877bde0c1f4470d57c582bbc070376afcd04d8cb4838" +checksum = "efd9466fac8543255d3b1fcad4762c5e116ffe808c8a3043d4263cd4fd4862a2" dependencies = [ "anstream", "anstyle", @@ -393,9 +394,9 @@ dependencies = [ [[package]] name = "clap_derive" -version = "4.5.18" +version = "4.5.32" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4ac6a0c7b1a9e9a5186361f67dfa1b88213572f427fb9ab038efb2bd8c582dab" +checksum = "09176aae279615badda0765c0c0b3f6ed53f4709118af73cf4655d85d1530cd7" dependencies = [ "heck", "proc-macro2", @@ -635,18 +636,18 @@ checksum = "96a6ac251f4a2aca6b3f91340350eab87ae57c3f127ffeb585e92bd336717991" [[package]] name = "deranged" -version = "0.3.11" +version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b42b6fa04a440b495c8b04d0e71b707c585f83cb9cb28cf8cd0d976c315e31b4" +checksum = "9c9e6a11ca8224451684bc0d7d5a7adbf8f2fd6887261a1cfc3c0432f9d4068e" dependencies = [ "powerfmt", ] [[package]] name = "derive_more" -version = "0.99.18" +version = "0.99.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5f33878137e4dafd7fa914ad4e259e18a4e8e532b9617a2d0150262bf53abfce" +checksum = "6edb4b64a43d977b8e99788fe3a04d483834fba1215a7e02caa415b626497f7f" dependencies = [ "convert_case", "proc-macro2", @@ -699,9 +700,9 @@ dependencies = [ [[package]] name = "document-features" -version = "0.2.10" +version = "0.2.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cb6969eaabd2421f8a2775cfd2471a2b634372b4a25d41e3bd647b79912850a0" +checksum = "95249b50c6c185bee49034bcb378a49dc2b5dff0be90ff6616d31d64febab05d" dependencies = [ "litrs", ] @@ -720,15 +721,15 @@ checksum = "f25c0e292a7ca6d6498557ff1df68f32c99850012b6ea401cf8daf771f22ff53" [[package]] name = "either" -version = "1.13.0" +version = "1.15.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "60b1af1c220855b6ceac025d3f6ecdd2b7c4894bfe9cd9bda4fbb4bc7c0d4cf0" +checksum = "48c757948c5ede0e46177b7add2e67155f70e33c07fea8284df6576da70b3719" [[package]] name = "elsa" -version = "1.10.0" +version = "1.11.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d98e71ae4df57d214182a2e5cb90230c0192c6ddfcaa05c36453d46a54713e10" +checksum = "9abf33c656a7256451ebb7d0082c5a471820c31269e49d807c538c252352186e" dependencies = [ "indexmap", "stable_deref_trait", @@ -746,28 +747,28 @@ dependencies = [ [[package]] name = "env_logger" -version = "0.11.6" +version = "0.11.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dcaee3d8e3cfc3fd92428d477bc97fc29ec8716d180c0d74c643bb26166660e0" +checksum = "13c863f0904021b108aa8b2f55046443e6b1ebde8fd4a15c399893aae4fa069f" dependencies = [ "anstream", "anstyle", "env_filter", - "humantime", + "jiff", "log", ] [[package]] name = "equivalent" -version = "1.0.1" +version = "1.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5443807d6dff69373d433ab9ef5378ad8df50ca6298caf15de6e52e24aaf54d5" +checksum = "877a4ace8713b0bcf2a4e7eec82529c029f1d0619886d18145fea96c3ffe5c0f" [[package]] name = "errno" -version = "0.3.10" +version = "0.3.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "33d852cb9b869c2a9b3df2f71a3074817f01e1844f839a144f5fcef059a4eb5d" +checksum = "976dd42dc7e85965fe702eb8164f21f450704bdde31faefd6471dba214cb594e" dependencies = [ "libc", "windows-sys 0.59.0", @@ -858,9 +859,9 @@ checksum = "0ce7134b9999ecaf8bcd65542e436736ef32ddca1b3e06094cb6ec5755203b80" [[package]] name = "flate2" -version = "1.0.35" +version = "1.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c936bfdafb507ebbf50b8074c54fa31c5be9a1e7e5f467dd659697041407d07c" +checksum = "7ced92e76e966ca2fd84c8f7aa01a4aea65b0eb6648d72f7c8f3e2764a67fece" dependencies = [ "crc32fast", "miniz_oxide", @@ -868,9 +869,9 @@ dependencies = [ [[package]] name = "foldhash" -version = "0.1.4" +version = "0.1.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a0d2fde1f7b3d48b8395d5f2de76c18a528bd6a9cdde438df747bfcba3e05d6f" +checksum = "d9c4f5dac5e15c24eb999c26181a6ca40b39fe946cbe4c263c7209467bc83af2" [[package]] name = "foreign-types" @@ -1018,20 +1019,32 @@ dependencies = [ [[package]] name = "getrandom" -version = "0.2.15" +version = "0.2.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c4567c8db10ae91089c99af84c68c38da3ec2f087c3f82960bcdbf3656b6f4d7" +checksum = "335ff9f135e4384c8150d6f27c6daed433577f86b4750418338c01a1a2528592" dependencies = [ "cfg-if", "libc", - "wasi", + "wasi 0.11.0+wasi-snapshot-preview1", +] + +[[package]] +name = "getrandom" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "73fea8450eea4bac3940448fb7ae50d91f034f941199fcd9d909a5a07aa455f0" +dependencies = [ + "cfg-if", + "libc", + "r-efi", + "wasi 0.14.2+wasi-0.2.4", ] [[package]] name = "gimli" -version = "0.30.0" +version = "0.31.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e2e1d97fbe9722ba9bbd0c97051c2956e726562b61f86a25a4360398a40edfc9" +checksum = "07e28edb80900c19c28f1072f2e8aeca7fa06b23cd4169cefe1af5aa3260783f" dependencies = [ "fallible-iterator", "indexmap", @@ -1073,9 +1086,9 @@ dependencies = [ [[package]] name = "glutin_wgl_sys" -version = "0.6.0" +version = "0.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0a4e1951bbd9434a81aa496fe59ccc2235af3820d27b85f9314e279609211e2c" +checksum = "2c4ee00b289aba7a9e5306d57c2d05499b2e5dc427f84ac708bd2c090212cf3e" dependencies = [ "gl_generator", ] @@ -1086,7 +1099,7 @@ version = "0.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "fbcd2dba93594b227a1f57ee09b8b9da8892c34d55aa332e034a228d0fe6a171" dependencies = [ - "bitflags 2.6.0", + "bitflags 2.9.0", "gpu-alloc-types", ] @@ -1096,7 +1109,7 @@ version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "98ff03b468aa837d70984d55f5d3f846f6ec31fe34bbb97c4f85219caeee1ca4" dependencies = [ - "bitflags 2.6.0", + "bitflags 2.9.0", ] [[package]] @@ -1117,9 +1130,9 @@ version = "0.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "dcf29e94d6d243368b7a56caa16bc213e4f9f8ed38c4d9557069527b5d5281ca" dependencies = [ - "bitflags 2.6.0", + "bitflags 2.9.0", "gpu-descriptor-types", - "hashbrown 0.15.2", + "hashbrown", ] [[package]] @@ -1128,25 +1141,17 @@ version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "fdf242682df893b86f33a73828fb09ca4b2d3bb6cc95249707fc684d27484b91" dependencies = [ - "bitflags 2.6.0", + "bitflags 2.9.0", ] [[package]] name = "hashbrown" -version = "0.14.5" +version = "0.15.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e5274423e17b7c9fc20b6e7e208532f9b19825d82dfd615708b70edd83df41f1" +checksum = "84b26c544d002229e640969970a2e74021aadf6e2f96372b9c58eff97de08eb3" dependencies = [ - "ahash", "allocator-api2", -] - -[[package]] -name = "hashbrown" -version = "0.15.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bf151400ff0baff5465007dd2f3e717f3fe502074ca563069ce3a6629d07b289" -dependencies = [ + "equivalent", "foldhash", ] @@ -1174,20 +1179,14 @@ version = "0.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "dfa686283ad6dd069f105e5ab091b04c62850d3e4cf5d67debad1933f55023df" -[[package]] -name = "humantime" -version = "2.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9a3a5bfb195931eeb336b2a7b4d761daec841b97f947d34394601737a7bba5e4" - [[package]] name = "indexmap" -version = "2.7.0" +version = "2.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "62f822373a4fe84d4bb149bf54e584a7f4abec90e072ed49cda0edea5b95471f" +checksum = "cea70ddb795996207ad57735b50c5982d8844f38ba9ee5f1aedcfb708a2aa11e" dependencies = [ "equivalent", - "hashbrown 0.15.2", + "hashbrown", ] [[package]] @@ -1245,9 +1244,33 @@ dependencies = [ [[package]] name = "itoa" -version = "1.0.14" +version = "1.0.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d75a2a4b1b190afb6f5425f10f6a8f959d2ea0b9c2b1d79553551850539e4674" +checksum = "4a5f13b858c8d314ee3e8f639011f7ccefe71f97f96e50151fb991f267928e2c" + +[[package]] +name = "jiff" +version = "0.2.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5a064218214dc6a10fbae5ec5fa888d80c45d611aba169222fc272072bf7aef6" +dependencies = [ + "jiff-static", + "log", + "portable-atomic", + "portable-atomic-util", + "serde", +] + +[[package]] +name = "jiff-static" +version = "0.2.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "199b7932d97e325aff3a7030e141eafe7f2c6268e1d1b24859b753a627f45254" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] [[package]] name = "jni" @@ -1273,18 +1296,19 @@ checksum = "8eaf4bc02d17cbdd7ff4c7438cafcdf7fb9a4613313ad11b4f8fefe7d3fa0130" [[package]] name = "jobserver" -version = "0.1.32" +version = "0.1.33" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "48d1dbcbbeb6a7fec7e059840aa538bd62aaccf972c7346c4d9d2059312853d0" +checksum = "38f262f097c174adebe41eb73d66ae9c06b2844fb0da69969647bbddd9b0538a" dependencies = [ + "getrandom 0.3.2", "libc", ] [[package]] name = "js-sys" -version = "0.3.76" +version = "0.3.77" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6717b6b5b077764fb5966237269cb3c64edddde4b14ce42647430a78ced9e7b7" +checksum = "1cfaf33c695fc6e08064efbc1f72ec937429614f25eef83af942d0e227c3a28f" dependencies = [ "once_cell", "wasm-bindgen", @@ -1335,9 +1359,9 @@ checksum = "bbd2bcb4c963f2ddae06a2efc7e9f3591312473c50c6685e1f298068316e66fe" [[package]] name = "libc" -version = "0.2.169" +version = "0.2.172" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b5aba8db14291edd000dfcc4d620c7ebfb122c613afb886ca8803fa4e128a20a" +checksum = "d750af042f7ef4f724306de029d18836c26c1765a54a6a3f094cbd23a7267ffa" [[package]] name = "libloading" @@ -1361,16 +1385,22 @@ version = "0.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c0ff37bd590ca25063e35af745c343cb7a0271906fb7b37e4813e8f79f00268d" dependencies = [ - "bitflags 2.6.0", + "bitflags 2.9.0", "libc", - "redox_syscall 0.5.8", + "redox_syscall 0.5.11", ] [[package]] name = "linux-raw-sys" -version = "0.4.14" +version = "0.4.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d26c52dbd32dccf2d10cac7725f8eae5296885fb5703b261f7d0a0739ec807ab" + +[[package]] +name = "linux-raw-sys" +version = "0.9.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "78b3ae25bc7c8c38cec158d1f2757ee79e9b3740fbc7ccf0e59e4b08d793fa89" +checksum = "cd945864f07fe9f5371a27ad7b52a172b4b499999f1d97574c9fa68373937e12" [[package]] name = "litrs" @@ -1390,9 +1420,9 @@ dependencies = [ [[package]] name = "log" -version = "0.4.22" +version = "0.4.27" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a7a70ba024b9dc04c27ea2f0c0548feb474ec5c54bba33a7f72f873a39d07b24" +checksum = "13dc2df351e3202783a1fe0d44375f7295ffb4049267b0f3018346dc122a1d94" [[package]] name = "longest-increasing-subsequence" @@ -1448,7 +1478,7 @@ version = "0.29.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7ecfd3296f8c56b7c1f6fbac3c71cefa9d78ce009850c45000015f206dc7fa21" dependencies = [ - "bitflags 2.6.0", + "bitflags 2.9.0", "block", "core-graphics-types", "foreign-types", @@ -1485,9 +1515,9 @@ dependencies = [ [[package]] name = "miniz_oxide" -version = "0.8.2" +version = "0.8.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4ffbe83022cedc1d264172192511ae958937694cd57ce297164951b8b3568394" +checksum = "3be647b768db090acb35d5ec5db2b0e1f1de11133ca123b9eacf5137868f892a" dependencies = [ "adler2", ] @@ -1500,7 +1530,7 @@ checksum = "2886843bf800fba2e3377cff24abf6379b4c4d5c6681eaf9ea5b0d15090450bd" dependencies = [ "libc", "log", - "wasi", + "wasi 0.11.0+wasi-snapshot-preview1", "windows-sys 0.52.0", ] @@ -1536,7 +1566,7 @@ checksum = "364f94bc34f61332abebe8cad6f6cd82a5b65cff22c828d05d0968911462ca4f" dependencies = [ "arrayvec", "bit-set", - "bitflags 2.6.0", + "bitflags 2.9.0", "cfg_aliases 0.1.1", "codespan-reporting", "hexf-parse", @@ -1556,7 +1586,7 @@ version = "0.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c3f42e7bbe13d351b6bead8286a43aac9534b82bd3cc43e47037f012ebfd62d4" dependencies = [ - "bitflags 2.6.0", + "bitflags 2.9.0", "jni-sys", "log", "ndk-sys 0.6.0+11769913", @@ -1608,7 +1638,7 @@ version = "7.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c533b4c39709f9ba5005d8002048266593c1cfaf3c5f0739d5b8ab0c6c504009" dependencies = [ - "bitflags 2.6.0", + "bitflags 2.9.0", "filetime", "fsevent-sys", "inotify", @@ -1727,7 +1757,7 @@ version = "0.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e4e89ad9e3d7d297152b17d39ed92cd50ca8063a89a9fa569046d41568891eff" dependencies = [ - "bitflags 2.6.0", + "bitflags 2.9.0", "block2", "libc", "objc2", @@ -1743,7 +1773,7 @@ version = "0.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "74dd3b56391c7a0596a295029734d3c1c5e7e510a4cb30245f8221ccea96b009" dependencies = [ - "bitflags 2.6.0", + "bitflags 2.9.0", "block2", "objc2", "objc2-core-location", @@ -1767,7 +1797,7 @@ version = "0.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "617fbf49e071c178c0b24c080767db52958f716d9eabdf0890523aeae54773ef" dependencies = [ - "bitflags 2.6.0", + "bitflags 2.9.0", "block2", "objc2", "objc2-foundation", @@ -1799,9 +1829,9 @@ dependencies = [ [[package]] name = "objc2-encode" -version = "4.0.3" +version = "4.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7891e71393cd1f227313c9379a26a584ff3d7e6e7159e988851f0934c993f0f8" +checksum = "ef25abbcd74fb2609453eb695bd2f860d389e457f67dc17cafc8b8cbc89d0c33" [[package]] name = "objc2-foundation" @@ -1809,7 +1839,7 @@ version = "0.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0ee638a5da3799329310ad4cfa62fbf045d5f56e3ef5ba4149e7452dcf89d5a8" dependencies = [ - "bitflags 2.6.0", + "bitflags 2.9.0", "block2", "dispatch", "libc", @@ -1834,7 +1864,7 @@ version = "0.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "dd0cba1276f6023976a406a14ffa85e1fdd19df6b0f737b063b95f6c8c7aadd6" dependencies = [ - "bitflags 2.6.0", + "bitflags 2.9.0", "block2", "objc2", "objc2-foundation", @@ -1846,7 +1876,7 @@ version = "0.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e42bee7bff906b14b167da2bac5efe6b6a07e6f7c0a21a7308d40c960242dc7a" dependencies = [ - "bitflags 2.6.0", + "bitflags 2.9.0", "block2", "objc2", "objc2-foundation", @@ -1869,7 +1899,7 @@ version = "0.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b8bb46798b20cd6b91cbd113524c490f1686f4c4e8f49502431415f3512e2b6f" dependencies = [ - "bitflags 2.6.0", + "bitflags 2.9.0", "block2", "objc2", "objc2-cloud-kit", @@ -1901,7 +1931,7 @@ version = "0.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "76cfcbf642358e8689af64cee815d139339f3ed8ad05103ed5eaf73db8d84cb3" dependencies = [ - "bitflags 2.6.0", + "bitflags 2.9.0", "block2", "objc2", "objc2-core-location", @@ -1916,7 +1946,7 @@ checksum = "62948e14d923ea95ea2c7c86c71013138b66525b86bdc08d2dcc262bdb497b87" dependencies = [ "crc32fast", "flate2", - "hashbrown 0.15.2", + "hashbrown", "indexmap", "memchr", "ruzstd", @@ -1925,9 +1955,9 @@ dependencies = [ [[package]] name = "once_cell" -version = "1.20.2" +version = "1.21.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1261fe7e33c73b354eab43b1273a57c8f967d0391e80353e51f764ac02cf6775" +checksum = "42f5e15c9953c5e4ccceeb2e7382a716482c34515315f7b03532b8b4e8393d2d" [[package]] name = "orbclient" @@ -1974,7 +2004,7 @@ checksum = "1e401f977ab385c9e4e3ab30627d6f26d00e2c73eef317493c4ec6d468726cf8" dependencies = [ "cfg-if", "libc", - "redox_syscall 0.5.8", + "redox_syscall 0.5.11", "smallvec", "windows-targets 0.52.6", ] @@ -2003,18 +2033,18 @@ dependencies = [ [[package]] name = "pin-project" -version = "1.1.7" +version = "1.1.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "be57f64e946e500c8ee36ef6331845d40a93055567ec57e8fae13efd33759b95" +checksum = "677f1add503faace112b9f1373e43e9e054bfdd22ff1a63c1bc485eaec6a6a8a" dependencies = [ "pin-project-internal", ] [[package]] name = "pin-project-internal" -version = "1.1.7" +version = "1.1.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3c0f5fad0874fc7abcd4d750e76917eaebbecaa2c20bde22e1dbeeba8beb758c" +checksum = "6e918e4ff8c4549eb882f14b3a4bc8c8bc93de829416eacf579f1207a8fbf861" dependencies = [ "proc-macro2", "quote", @@ -2023,9 +2053,9 @@ dependencies = [ [[package]] name = "pin-project-lite" -version = "0.2.15" +version = "0.2.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "915a1e146535de9163f3987b8944ed8cf49a18bb0056bcebcdcece385cece4ff" +checksum = "3b3cff922bd51709b605d9ead9aa71031d81447142d828eb4a6eba76fe619f9b" [[package]] name = "pin-utils" @@ -2035,15 +2065,15 @@ checksum = "8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184" [[package]] name = "pkg-config" -version = "0.3.31" +version = "0.3.32" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "953ec861398dccce10c670dfeaf3ec4911ca479e9c02154b3a215178c5f566f2" +checksum = "7edddbd0b52d732b21ad9a5fab5c704c14cd949e5e9a1ec5929a24fded1b904c" [[package]] name = "plist" -version = "1.7.0" +version = "1.7.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "42cf17e9a1800f5f396bc67d193dc9411b59012a5876445ef450d449881e1016" +checksum = "eac26e981c03a6e53e0aee43c113e3202f5581d5360dae7bd2c70e800dd0451d" dependencies = [ "base64", "indexmap", @@ -2062,11 +2092,26 @@ dependencies = [ "concurrent-queue", "hermit-abi 0.4.0", "pin-project-lite", - "rustix", + "rustix 0.38.44", "tracing", "windows-sys 0.59.0", ] +[[package]] +name = "portable-atomic" +version = "1.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "350e9b48cbc6b0e028b0473b114454c6316e57336ee184ceab6e53f72c178b3e" + +[[package]] +name = "portable-atomic-util" +version = "0.2.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d8a2f0d8d040d7848a709caf78912debcc3f33ee4b3cac47d73d1e1069e83507" +dependencies = [ + "portable-atomic", +] + [[package]] name = "powerfmt" version = "0.2.0" @@ -2091,18 +2136,18 @@ dependencies = [ [[package]] name = "proc-macro-crate" -version = "3.2.0" +version = "3.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8ecf48c7ca261d60b74ab1a7b20da18bede46776b2e55535cb958eb595c5fa7b" +checksum = "edce586971a4dfaa28950c6f18ed55e0406c1ab88bbce2c6f6293a7aaba73d35" dependencies = [ "toml_edit", ] [[package]] name = "proc-macro2" -version = "1.0.92" +version = "1.0.95" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "37d3544b3f2748c54e147655edb5025752e2303145b5aefb3c3ea2c78b973bb0" +checksum = "02b3e5e68a3a1a02aad3ec490a98007cbc13c37cbe84a3cd7b8e406d76e7f778" dependencies = [ "unicode-ident", ] @@ -2124,27 +2169,33 @@ dependencies = [ [[package]] name = "quick-xml" -version = "0.36.2" +version = "0.37.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f7649a7b4df05aed9ea7ec6f628c67c9953a43869b8bc50929569b2999d443fe" +checksum = "331e97a1af0bf59823e6eadffe373d7b27f485be8748f71471c662c1f269b7fb" dependencies = [ "memchr", ] [[package]] name = "quote" -version = "1.0.38" +version = "1.0.40" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0e4dccaaaf89514f546c693ddc140f729f958c247918a13380cccc6078391acc" +checksum = "1885c039570dc00dcb4ff087a89e185fd56bae234ddc7f056a945bf36467248d" dependencies = [ "proc-macro2", ] +[[package]] +name = "r-efi" +version = "5.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "74765f6d916ee2faa39bc8e68e4f3ed8949b48cccdac59983d287a7cb71ce9c5" + [[package]] name = "range-alloc" -version = "0.1.3" +version = "0.1.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9c8a99fddc9f0ba0a85884b8d14e3592853e787d581ca1816c91349b10e4eeab" +checksum = "c3d6831663a5098ea164f89cff59c6284e95f4e3c76ce9848d4529f5ccca9bde" [[package]] name = "raw-string" @@ -2216,11 +2267,11 @@ dependencies = [ [[package]] name = "redox_syscall" -version = "0.5.8" +version = "0.5.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "03a862b389f93e68874fbf580b9de08dd02facb9a788ebadaf4a3fd33cf58834" +checksum = "d2f103c6d277498fbceb16e84d317e2a400f160f46904d5f5410848c829511a3" dependencies = [ - "bitflags 2.6.0", + "bitflags 2.9.0", ] [[package]] @@ -2229,7 +2280,7 @@ version = "0.4.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ba009ff324d1fc1b900bd1fdb31564febe58a8ccc8a6fdbb93b543d33b13ca43" dependencies = [ - "getrandom", + "getrandom 0.2.16", "libredox", "thiserror", ] @@ -2332,7 +2383,7 @@ dependencies = [ "rspirv", "rustc-demangle", "rustc_codegen_spirv-types", - "rustix", + "rustix 0.38.44", "sanitize-filename", "smallvec", "spirt", @@ -2375,24 +2426,37 @@ dependencies = [ [[package]] name = "rustix" -version = "0.38.42" +version = "0.38.44" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f93dc38ecbab2eb790ff964bb77fa94faf256fd3e73285fd7ba0903b76bedb85" +checksum = "fdb5bc1ae2baa591800df16c9ca78619bf65c0488b41b96ccec5d11220d8c154" dependencies = [ - "bitflags 2.6.0", + "bitflags 2.9.0", "errno", "itoa", "libc", - "linux-raw-sys", + "linux-raw-sys 0.4.15", "once_cell", "windows-sys 0.59.0", ] +[[package]] +name = "rustix" +version = "1.0.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c71e83d6afe7ff64890ec6b71d6a69bb8a610ab78ce364b3352876bb4c801266" +dependencies = [ + "bitflags 2.9.0", + "errno", + "libc", + "linux-raw-sys 0.9.4", + "windows-sys 0.59.0", +] + [[package]] name = "rustversion" -version = "1.0.19" +version = "1.0.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f7c45b9784283f1b2e7fb61b42047c2fd678ef0960d4f6f1eba131594cc369d4" +checksum = "eded382c5f5f786b989652c49544c4877d9f015cc22e145a5ea8ea66c2921cd2" [[package]] name = "ruzstd" @@ -2405,9 +2469,9 @@ dependencies = [ [[package]] name = "ryu" -version = "1.0.18" +version = "1.0.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f3cb5ba0dc43242ce17de99c180e96db90b235b8a9fdc9543c96d2209116bd9f" +checksum = "28d3b2b1366ec20994f1fd18c3c594f05c5dd4bc44d8bb0c1c632c8d6829481f" [[package]] name = "same-file" @@ -2478,24 +2542,24 @@ dependencies = [ [[package]] name = "semver" -version = "1.0.24" +version = "1.0.26" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3cb6eb87a131f756572d7fb904f6e7b68633f09cca868c5df1c4b8d1a694bbba" +checksum = "56e6fa9c48d24d85fb3de5ad847117517440f6beceb7798af16b4a87d616b8d0" [[package]] name = "serde" -version = "1.0.217" +version = "1.0.219" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "02fc4265df13d6fa1d00ecff087228cc0a2b5f3c0e87e258d8b94a156e984c70" +checksum = "5f0e2c6ed6606019b4e29e69dbaba95b11854410e5347d525002456dbbb786b6" dependencies = [ "serde_derive", ] [[package]] name = "serde_derive" -version = "1.0.217" +version = "1.0.219" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5a9bf7cf98d04a2b28aead066b7496853d4779c9cc183c440dbac457641e19a0" +checksum = "5b0276cf7f2c73365f7157c8123c21cd9a50fbbd844757af28ca1f5925fc2a00" dependencies = [ "proc-macro2", "quote", @@ -2504,9 +2568,9 @@ dependencies = [ [[package]] name = "serde_json" -version = "1.0.134" +version = "1.0.140" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d00f4175c42ee48b15416f6193a959ba3a0d67fc699a0db9ad12df9f83991c7d" +checksum = "20068b6e96dc6c9bd23e01df8827e6c7e1f2fddd43c21810382803c136b99373" dependencies = [ "itoa", "memchr", @@ -2573,9 +2637,9 @@ dependencies = [ [[package]] name = "smallvec" -version = "1.13.2" +version = "1.15.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3c5e1a9a646d36c3599cd173a41282daf47c44583ad367b8e6837255952e5c67" +checksum = "8917285742e9f3e1683f0a9c4e6b57960b7314d0b08d30d1ecd426713ee2eee9" dependencies = [ "serde", ] @@ -2586,22 +2650,22 @@ version = "0.19.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3457dea1f0eb631b4034d61d4d8c32074caa6cd1ab2d59f2327bd8461e2c0016" dependencies = [ - "bitflags 2.6.0", + "bitflags 2.9.0", "calloop", "calloop-wayland-source", "cursor-icon", "libc", "log", "memmap2", - "rustix", + "rustix 0.38.44", "thiserror", "wayland-backend", - "wayland-client 0.31.7", + "wayland-client 0.31.10", "wayland-csd-frame", - "wayland-cursor 0.31.7", - "wayland-protocols 0.32.5", + "wayland-cursor 0.31.10", + "wayland-protocols 0.32.8", "wayland-protocols-wlr", - "wayland-scanner 0.31.5", + "wayland-scanner 0.31.6", "xkeysym", ] @@ -2641,7 +2705,7 @@ version = "0.3.0+sdk-1.3.268.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "eda41003dc44290527a59b13432d4a0379379fa074b70174882adfbdfd917844" dependencies = [ - "bitflags 2.6.0", + "bitflags 2.9.0", ] [[package]] @@ -2752,9 +2816,9 @@ dependencies = [ [[package]] name = "syn" -version = "2.0.94" +version = "2.0.101" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "987bc0be1cdea8b10216bd06e2ca407d40b9543468fafd3ddfb02f36e77f71f3" +checksum = "8ce2b7fc941b3a24138a0a7cf8e858bfc6a992e7978a068a5c760deb0ed43caf" dependencies = [ "proc-macro2", "quote", @@ -2763,14 +2827,14 @@ dependencies = [ [[package]] name = "tempfile" -version = "3.14.0" +version = "3.19.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "28cce251fcbc87fac86a866eeb0d6c2d536fc16d06f184bb61aeae11aa4cee0c" +checksum = "7437ac7763b9b123ccf33c338a5cc1bac6f69b45a136c19bdd8a65e3916435bf" dependencies = [ - "cfg-if", "fastrand", + "getrandom 0.3.2", "once_cell", - "rustix", + "rustix 1.0.7", "windows-sys 0.59.0", ] @@ -2829,12 +2893,12 @@ dependencies = [ [[package]] name = "thorin-dwp" -version = "0.8.0" +version = "0.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "813ba76597db32dc4f6992fd8bf8f394715b88d352fd97401da67dab6283b4c6" +checksum = "9e9c1e705f82a260173f3eec93f2ff6d7807f23ad5a8cc2e7316a891733ea7a1" dependencies = [ "gimli", - "hashbrown 0.14.5", + "hashbrown", "object", "tracing", ] @@ -2851,9 +2915,9 @@ dependencies = [ [[package]] name = "time" -version = "0.3.37" +version = "0.3.41" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "35e7868883861bd0e56d9ac6efcaaca0d6d5d82a2a7ec8209ff492c07cf37b21" +checksum = "8a7619e19bc266e0f9c5e6686659d394bc57973859340060a69221e57dbc0c40" dependencies = [ "deranged", "itoa", @@ -2866,15 +2930,15 @@ dependencies = [ [[package]] name = "time-core" -version = "0.1.2" +version = "0.1.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ef927ca75afb808a4d64dd374f00a2adf8d0fcff8e7b184af886c3c87ec4a3f3" +checksum = "c9e9a38711f559d9e3ce1cdb06dd7c5b8ea546bc90052da6d06bb76da74bb07c" [[package]] name = "time-macros" -version = "0.2.19" +version = "0.2.22" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2834e6017e3e5e4b9834939793b282bc03b37a3336245fa820e35e233e2a85de" +checksum = "3526739392ec93fd8b359c8e98514cb3e8e021beb4e5f597b00a0221f8ed8a49" dependencies = [ "num-conv", "time-core", @@ -2907,15 +2971,15 @@ dependencies = [ [[package]] name = "toml_datetime" -version = "0.6.8" +version = "0.6.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0dd7358ecb8fc2f8d014bf86f6f638ce72ba252a2c3a2572f2a795f1d23efb41" +checksum = "3da5db5a963e24bc68be8b17b6fa82814bb22ee8660f192bb182771d498f09a3" [[package]] name = "toml_edit" -version = "0.22.22" +version = "0.22.26" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4ae48d6208a266e853d946088ed816055e556cc6028c5e8e2b84d9fa5dd7c7f5" +checksum = "310068873db2c5b3e7659d2cc35d21855dbafa50d1ce336397c666e3cb08137e" dependencies = [ "indexmap", "toml_datetime", @@ -3026,9 +3090,9 @@ dependencies = [ [[package]] name = "unicode-ident" -version = "1.0.14" +version = "1.0.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "adb9e6ca4f869e1180728b7950e35922a7fc6397f7b641499e8f3ef06e50dc83" +checksum = "5a5f39404a5da50712a4c1eecf25e90dd62b613502b7e925fd4e4d19b5c96512" [[package]] name = "unicode-segmentation" @@ -3056,9 +3120,9 @@ checksum = "06abde3611657adf66d383f00b093d7faecc7fa57071cce2578660c9f1010821" [[package]] name = "valuable" -version = "0.1.0" +version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "830b7e5d4d90034032940e4ace0d9a9a057e7a45cd94e6c007832e39edb82f6d" +checksum = "ba73ea9cf16a25df0c8caa16c51acb937d5712a8429db78a3ee29d5dcacd3a65" [[package]] name = "version-compare" @@ -3088,22 +3152,32 @@ version = "0.11.0+wasi-snapshot-preview1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" +[[package]] +name = "wasi" +version = "0.14.2+wasi-0.2.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9683f9a5a998d873c0d21fcbe3c083009670149a8fab228644b8bd36b2c48cb3" +dependencies = [ + "wit-bindgen-rt", +] + [[package]] name = "wasm-bindgen" -version = "0.2.99" +version = "0.2.100" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a474f6281d1d70c17ae7aa6a613c87fce69a127e2624002df63dcb39d6cf6396" +checksum = "1edc8929d7499fc4e8f0be2262a241556cfc54a0bea223790e71446f2aab1ef5" dependencies = [ "cfg-if", "once_cell", + "rustversion", "wasm-bindgen-macro", ] [[package]] name = "wasm-bindgen-backend" -version = "0.2.99" +version = "0.2.100" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5f89bb38646b4f81674e8f5c3fb81b562be1fd936d84320f3264486418519c79" +checksum = "2f0a0651a5c2bc21487bde11ee802ccaf4c51935d0d3d42a6101f98161700bc6" dependencies = [ "bumpalo", "log", @@ -3115,9 +3189,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-futures" -version = "0.4.49" +version = "0.4.50" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "38176d9b44ea84e9184eff0bc34cc167ed044f816accfe5922e54d84cf48eca2" +checksum = "555d470ec0bc3bb57890405e5d4322cc9ea83cebb085523ced7be4144dac1e61" dependencies = [ "cfg-if", "js-sys", @@ -3128,9 +3202,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro" -version = "0.2.99" +version = "0.2.100" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2cc6181fd9a7492eef6fef1f33961e3695e4579b9872a6f7c83aee556666d4fe" +checksum = "7fe63fc6d09ed3792bd0897b314f53de8e16568c2b3f7982f468c0bf9bd0b407" dependencies = [ "quote", "wasm-bindgen-macro-support", @@ -3138,9 +3212,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro-support" -version = "0.2.99" +version = "0.2.100" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "30d7a95b763d3c45903ed6c81f156801839e5ee968bb07e534c44df0fcd330c2" +checksum = "8ae87ea40c9f689fc23f209965b6fb8a99ad69aeeb0231408be24920604395de" dependencies = [ "proc-macro2", "quote", @@ -3151,31 +3225,34 @@ dependencies = [ [[package]] name = "wasm-bindgen-shared" -version = "0.2.99" +version = "0.2.100" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "943aab3fdaaa029a6e0271b35ea10b72b943135afe9bffca82384098ad0e06a6" +checksum = "1a05d73b933a847d6cccdda8f838a22ff101ad9bf93e33684f39c1f5f0eece3d" +dependencies = [ + "unicode-ident", +] [[package]] name = "wasmparser" -version = "0.222.0" +version = "0.222.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4adf50fde1b1a49c1add6a80d47aea500c88db70551805853aa8b88f3ea27ab5" +checksum = "fa210fd1788e6b37a1d1930f3389c48e1d6ebd1a013d34fa4b7f9e3e3bf03146" dependencies = [ - "bitflags 2.6.0", + "bitflags 2.9.0", ] [[package]] name = "wayland-backend" -version = "0.3.7" +version = "0.3.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "056535ced7a150d45159d3a8dc30f91a2e2d588ca0b23f70e56033622b8016f6" +checksum = "fe770181423e5fc79d3e2a7f4410b7799d5aab1de4372853de3c6aa13ca24121" dependencies = [ "cc", "downcast-rs", - "rustix", + "rustix 0.38.44", "scoped-tls", "smallvec", - "wayland-sys 0.31.5", + "wayland-sys 0.31.6", ] [[package]] @@ -3196,14 +3273,14 @@ dependencies = [ [[package]] name = "wayland-client" -version = "0.31.7" +version = "0.31.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b66249d3fc69f76fd74c82cc319300faa554e9d865dab1f7cd66cc20db10b280" +checksum = "978fa7c67b0847dbd6a9f350ca2569174974cd4082737054dbb7fbb79d7d9a61" dependencies = [ - "bitflags 2.6.0", - "rustix", + "bitflags 2.9.0", + "rustix 0.38.44", "wayland-backend", - "wayland-scanner 0.31.5", + "wayland-scanner 0.31.6", ] [[package]] @@ -3224,7 +3301,7 @@ version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "625c5029dbd43d25e6aa9615e88b829a5cad13b2819c4ae129fdbb7c31ab4c7e" dependencies = [ - "bitflags 2.6.0", + "bitflags 2.9.0", "cursor-icon", "wayland-backend", ] @@ -3242,12 +3319,12 @@ dependencies = [ [[package]] name = "wayland-cursor" -version = "0.31.7" +version = "0.31.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "32b08bc3aafdb0035e7fe0fdf17ba0c09c268732707dca4ae098f60cb28c9e4c" +checksum = "a65317158dec28d00416cb16705934070aef4f8393353d41126c54264ae0f182" dependencies = [ - "rustix", - "wayland-client 0.31.7", + "rustix 0.38.44", + "wayland-client 0.31.10", "xcursor", ] @@ -3265,40 +3342,40 @@ dependencies = [ [[package]] name = "wayland-protocols" -version = "0.32.5" +version = "0.32.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7cd0ade57c4e6e9a8952741325c30bf82f4246885dca8bf561898b86d0c1f58e" +checksum = "779075454e1e9a521794fed15886323ea0feda3f8b0fc1390f5398141310422a" dependencies = [ - "bitflags 2.6.0", + "bitflags 2.9.0", "wayland-backend", - "wayland-client 0.31.7", - "wayland-scanner 0.31.5", + "wayland-client 0.31.10", + "wayland-scanner 0.31.6", ] [[package]] name = "wayland-protocols-plasma" -version = "0.3.5" +version = "0.3.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9b31cab548ee68c7eb155517f2212049dc151f7cd7910c2b66abfd31c3ee12bd" +checksum = "4fd38cdad69b56ace413c6bcc1fbf5acc5e2ef4af9d5f8f1f9570c0c83eae175" dependencies = [ - "bitflags 2.6.0", + "bitflags 2.9.0", "wayland-backend", - "wayland-client 0.31.7", - "wayland-protocols 0.32.5", - "wayland-scanner 0.31.5", + "wayland-client 0.31.10", + "wayland-protocols 0.32.8", + "wayland-scanner 0.31.6", ] [[package]] name = "wayland-protocols-wlr" -version = "0.3.5" +version = "0.3.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "782e12f6cd923c3c316130d56205ebab53f55d6666b7faddfad36cecaeeb4022" +checksum = "1cb6cdc73399c0e06504c437fe3cf886f25568dd5454473d565085b36d6a8bbf" dependencies = [ - "bitflags 2.6.0", + "bitflags 2.9.0", "wayland-backend", - "wayland-client 0.31.7", - "wayland-protocols 0.32.5", - "wayland-scanner 0.31.5", + "wayland-client 0.31.10", + "wayland-protocols 0.32.8", + "wayland-scanner 0.31.6", ] [[package]] @@ -3314,12 +3391,12 @@ dependencies = [ [[package]] name = "wayland-scanner" -version = "0.31.5" +version = "0.31.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "597f2001b2e5fc1121e3d5b9791d3e78f05ba6bfa4641053846248e3a13661c3" +checksum = "896fdafd5d28145fce7958917d69f2fd44469b1d4e861cb5961bcbeebc6d1484" dependencies = [ "proc-macro2", - "quick-xml 0.36.2", + "quick-xml 0.37.5", "quote", ] @@ -3336,9 +3413,9 @@ dependencies = [ [[package]] name = "wayland-sys" -version = "0.31.5" +version = "0.31.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "efa8ac0d8e8ed3e3b5c9fc92c7881406a268e11555abe36493efabe649a29e09" +checksum = "dbcebb399c77d5aa9fa5db874806ee7b4eba4e73650948e8f93963f128896615" dependencies = [ "dlib", "log", @@ -3348,9 +3425,9 @@ dependencies = [ [[package]] name = "web-sys" -version = "0.3.76" +version = "0.3.77" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "04dd7223427d52553d3702c004d3b2fe07c148165faa56313cb00211e31c12bc" +checksum = "33b6dd2ef9186f1f2072e409e99cd22a975331a6b3591b12c764e0e55c60d5d2" dependencies = [ "js-sys", "wasm-bindgen", @@ -3399,7 +3476,7 @@ checksum = "d63c3c478de8e7e01786479919c8769f62a22eec16788d8c2ac77ce2c132778a" dependencies = [ "arrayvec", "bit-vec", - "bitflags 2.6.0", + "bitflags 2.9.0", "bytemuck", "cfg_aliases 0.1.1", "document-features", @@ -3427,7 +3504,7 @@ dependencies = [ "arrayvec", "ash", "bit-set", - "bitflags 2.6.0", + "bitflags 2.9.0", "block", "bytemuck", "cfg_aliases 0.1.1", @@ -3468,7 +3545,7 @@ version = "23.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "610f6ff27778148c31093f3b03abc4840f9636d58d597ca2f5977433acfe0068" dependencies = [ - "bitflags 2.6.0", + "bitflags 2.9.0", "js-sys", "web-sys", ] @@ -3775,14 +3852,14 @@ checksum = "589f6da84c646204747d1270a2a5661ea66ed1cced2631d546fdfb155959f9ec" [[package]] name = "winit" -version = "0.30.7" +version = "0.30.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dba50bc8ef4b6f1a75c9274fb95aa9a8f63fbc66c56f391bd85cf68d51e7b1a3" +checksum = "b0d05bd8908e14618c9609471db04007e644fd9cce6529756046cfc577f9155e" dependencies = [ "ahash", "android-activity", "atomic-waker", - "bitflags 2.6.0", + "bitflags 2.9.0", "block2", "bytemuck", "calloop", @@ -3806,7 +3883,7 @@ dependencies = [ "raw-window-handle 0.5.2", "raw-window-handle 0.6.2", "redox_syscall 0.4.1", - "rustix", + "rustix 0.38.44", "sctk-adwaita", "smithay-client-toolkit", "smol_str", @@ -3815,8 +3892,8 @@ dependencies = [ "wasm-bindgen", "wasm-bindgen-futures", "wayland-backend", - "wayland-client 0.31.7", - "wayland-protocols 0.32.5", + "wayland-client 0.31.10", + "wayland-protocols 0.32.8", "wayland-protocols-plasma", "web-sys", "web-time", @@ -3828,13 +3905,22 @@ dependencies = [ [[package]] name = "winnow" -version = "0.6.21" +version = "0.7.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e6f5bb5257f2407a5425c6e749bfd9692192a73e70a6060516ac04f889087d68" +checksum = "6cb8234a863ea0e8cd7284fcdd4f145233eb00fee02bbdd9861aec44e6477bc5" dependencies = [ "memchr", ] +[[package]] +name = "wit-bindgen-rt" +version = "0.39.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6f42320e61fe2cfd34354ecb597f86f413484a798ba44a8ca1165c58d42da6c1" +dependencies = [ + "bitflags 2.9.0", +] + [[package]] name = "x11-dl" version = "2.21.0" @@ -3857,7 +3943,7 @@ dependencies = [ "libc", "libloading", "once_cell", - "rustix", + "rustix 0.38.44", "x11rb-protocol", ] @@ -3879,7 +3965,7 @@ version = "0.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d039de8032a9a8856a6be89cea3e5d12fdd82306ab7c94d74e6deab2460651c5" dependencies = [ - "bitflags 2.6.0", + "bitflags 2.9.0", "dlib", "log", "once_cell", @@ -3894,9 +3980,9 @@ checksum = "b9cc00251562a284751c9973bace760d86c0276c471b4be569fe6b068ee97a56" [[package]] name = "xml-rs" -version = "0.8.24" +version = "0.8.26" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ea8b391c9a790b496184c29f7f93b9ed5b16abb306c05415b68bcc16e4d06432" +checksum = "a62ce76d9b56901b19a74f19431b0d8b3bc7ca4ad685a746dfd78ca8f4fc6bda" [[package]] name = "yansi" diff --git a/Cargo.toml b/Cargo.toml index 13b1c0337f..2c32344e8b 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -31,7 +31,7 @@ members = [ [workspace.package] version = "0.9.0" authors = ["rust-gpu developers", "Embark "] -edition = "2021" +edition = "2024" license = "MIT OR Apache-2.0" repository = "https://github.com/rust-gpu/rust-gpu" diff --git a/crates/rustc_codegen_spirv/Cargo.toml b/crates/rustc_codegen_spirv/Cargo.toml index f863d086d9..728b45365d 100644 --- a/crates/rustc_codegen_spirv/Cargo.toml +++ b/crates/rustc_codegen_spirv/Cargo.toml @@ -41,8 +41,8 @@ rustix = { version = "0.38.42", features = ["all-apis"] } # HACK(eddyb) deps of `rustc_codegen_ssa`, for `pqp_cg_ssa` (see `build.rs`), # that cannot be handled with just `extern crate` pulling out of the sysroot. -object = { version = "0.36.2", default-features = false, features = ["read_core", "elf", "macho", "pe", "xcoff", "unaligned", "archive", "write", "wasm"] } -thorin-dwp = "0.8" +object = { version = "0.36.2", default-features = false, features = ["read_core", "elf", "macho", "pe", "xcoff", "unaligned", "archive", "write", "wasm"] } +thorin-dwp = "0.9" # Normal dependencies. ar = "0.9.0" @@ -64,6 +64,9 @@ tracing-tree = "0.3.0" [dev-dependencies] pretty_assertions = "1.0" +[lints.rust] +unexpected_cfgs = { level = "warn", check-cfg = ['cfg(bootstrap)', 'cfg(llvm_enzyme)'] } + # HACK(eddyb) can't re-introduce deps of `rustc_codegen_ssa`, for `pqp_cg_ssa` # (see `build.rs`). # tempfile = "3.4" diff --git a/crates/rustc_codegen_spirv/build.rs b/crates/rustc_codegen_spirv/build.rs index b82a0e31c6..4629691e06 100644 --- a/crates/rustc_codegen_spirv/build.rs +++ b/crates/rustc_codegen_spirv/build.rs @@ -15,9 +15,9 @@ use std::{env, fs, mem}; /// `cargo publish`. We need to figure out a way to do this properly, but let's hardcode it for now :/ //const REQUIRED_RUST_TOOLCHAIN: &str = include_str!("../../rust-toolchain.toml"); const REQUIRED_RUST_TOOLCHAIN: &str = r#"[toolchain] -channel = "nightly-2024-11-22" +channel = "nightly-2025-04-28" components = ["rust-src", "rustc-dev", "llvm-tools"] -# commit_hash = b19329a37cedf2027517ae22c87cf201f93d776e"#; +# commit_hash = cb31a009e3e735ab08613cec2d8a5a754e65596f"#; fn rustc_output(arg: &str) -> Result> { let rustc = env::var("RUSTC").unwrap_or_else(|_| "rustc".into()); @@ -206,24 +206,70 @@ mod win {", // HACK(eddyb) very basic extraction of deps from original `Cargo.toml`. let mut all_extern_crates = cg_ssa_lib_rs_extern_crates; let cg_ssa_cargo_toml = fs::read_to_string(out_pqp_cg_ssa_dir.join("Cargo.toml"))?; - let mut toml_directive = None; + + let mut current_section: Option<&str> = None; + for line in cg_ssa_cargo_toml.lines() { let line = line.trim(); if line.starts_with('#') || line.is_empty() { continue; } - if line.starts_with('[') { - toml_directive = Some(line); - } else if toml_directive == Some("[dependencies]") { - if let Some((name, _)) = line.split_once(" = ") { + + if line.starts_with('[') && line.ends_with(']') { + if line == "[dependencies]" { + current_section = Some("[dependencies]"); + } else if line.starts_with("[dependencies.") { + // This is a [dependencies.foo] section header. + // Extract 'foo' from '[dependencies.foo]' + if let Some(name_in_header) = line + .strip_prefix("[dependencies.") + .and_then(|s| s.strip_suffix(']')) + { + let name = name_in_header.trim().trim_matches('"'); + + // HACK(eddyb) ignore a weird edge case. + if name == "thorin-dwp" { + continue; + } + if !name.is_empty() { + let crate_identifier = name.replace('-', "_"); + let extern_crate = format!("extern crate {};", crate_identifier); + + if !all_extern_crates.contains(&extern_crate) { + writeln(&mut all_extern_crates, "#[allow(unused_extern_crates)]"); + writeln(&mut all_extern_crates, &extern_crate); + } + } + + // Set section to None so we don't process lines *within* this table + // (like version="...") as dependency names. + current_section = None; + } else { + // Malformed line like "[dependencies.foo", treat as unknown section + current_section = Some(line); + } + } else { + // It's some other section ([build-dependencies], [workspace], etc.) + current_section = Some(line); + } + } else if current_section == Some("[dependencies]") { + // Look for lines like `name = ...` + if let Some((name_in_line, _)) = line.split_once('=') { + let name = name_in_line.trim().trim_matches('"'); + // HACK(eddyb) ignore a weird edge case. if name == "thorin-dwp" { continue; } - let extern_crate = format!("extern crate {};", name.replace('-', "_")); - if !all_extern_crates.contains(&extern_crate) { - writeln(&mut all_extern_crates, "#[allow(unused_extern_crates)]"); - writeln(&mut all_extern_crates, &extern_crate); + + if !name.is_empty() { + let crate_identifier = name.replace('-', "_"); + let extern_crate = format!("extern crate {};", crate_identifier); + + if !all_extern_crates.contains(&extern_crate) { + writeln(&mut all_extern_crates, "#[allow(unused_extern_crates)]"); + writeln(&mut all_extern_crates, &extern_crate); + } } } } diff --git a/crates/rustc_codegen_spirv/src/abi.rs b/crates/rustc_codegen_spirv/src/abi.rs index 04d1bf9860..d440c55c09 100644 --- a/crates/rustc_codegen_spirv/src/abi.rs +++ b/crates/rustc_codegen_spirv/src/abi.rs @@ -6,6 +6,11 @@ use crate::codegen_cx::CodegenCx; use crate::spirv_type::SpirvType; use itertools::Itertools; use rspirv::spirv::{Dim, ImageFormat, StorageClass, Word}; +use rustc_abi::ExternAbi; +use rustc_abi::{ + Align, BackendRepr, FieldsShape, LayoutData, Primitive, ReprFlags, ReprOptions, Scalar, Size, + TagEncoding, VariantIdx, Variants, +}; use rustc_data_structures::fx::FxHashMap; use rustc_errors::ErrorGuaranteed; use rustc_index::Idx; @@ -20,12 +25,7 @@ use rustc_middle::{bug, span_bug}; use rustc_span::DUMMY_SP; use rustc_span::def_id::DefId; use rustc_span::{Span, Symbol}; -use rustc_target::abi::call::{ArgAbi, ArgAttributes, FnAbi, PassMode}; -use rustc_target::abi::{ - Align, BackendRepr, FieldsShape, LayoutData, Primitive, ReprFlags, ReprOptions, Scalar, Size, - TagEncoding, VariantIdx, Variants, -}; -use rustc_target::spec::abi::Abi; +use rustc_target::callconv::{ArgAbi, ArgAttributes, FnAbi, PassMode}; use std::cell::RefCell; use std::collections::hash_map::Entry; use std::fmt; @@ -46,8 +46,8 @@ pub(crate) fn provide(providers: &mut Providers) { let result = (rustc_interface::DEFAULT_QUERY_PROVIDERS.fn_sig)(tcx, def_id); result.map_bound(|outer| { outer.map_bound(|mut inner| { - if let Abi::C { .. } = inner.abi { - inner.abi = Abi::Unadjusted; + if let ExternAbi::C { .. } = inner.abi { + inner.abi = ExternAbi::Unadjusted; } inner }) @@ -110,6 +110,8 @@ pub(crate) fn provide(providers: &mut Providers) { size, max_repr_align, unadjusted_abi_align, + uninhabited, + randomization_seed, } = *layout; LayoutData { fields: match *fields { @@ -125,6 +127,7 @@ pub(crate) fn provide(providers: &mut Providers) { }, }, variants: match *variants { + Variants::Empty => Variants::Empty, Variants::Single { index } => Variants::Single { index }, Variants::Multiple { tag, @@ -155,6 +158,8 @@ pub(crate) fn provide(providers: &mut Providers) { size, max_repr_align, unadjusted_abi_align, + uninhabited, + randomization_seed, } } @@ -198,6 +203,7 @@ pub(crate) fn provide(providers: &mut Providers) { let trivial_struct = match tcx.hir_node_by_def_id(def_id) { rustc_hir::Node::Item(item) => match item.kind { rustc_hir::ItemKind::Struct( + _, _, &rustc_hir::Generics { params: @@ -462,7 +468,7 @@ impl<'tcx> ConvSpirvType<'tcx> for TyAndLayout<'tcx> { // `ScalarPair`. // There's a few layers that we go through here. First we inspect layout.backend_repr, then if relevant, layout.fields, etc. match self.backend_repr { - BackendRepr::Uninhabited => SpirvType::Adt { + x @ _ if x.is_unsized() => SpirvType::Adt { def_id: def_id_for_spirv_type_adt(*self), size: Some(Size::ZERO), align: Align::from_bytes(0).unwrap(), @@ -523,7 +529,9 @@ impl<'tcx> ConvSpirvType<'tcx> for TyAndLayout<'tcx> { if let TyKind::Adt(adt, _) = self.ty.kind() { if let Variants::Single { index } = self.variants { for i in self.fields.index_by_increasing_offset() { - let field = &adt.variants()[index].fields[i.into()]; + let field_index = rustc_abi::FieldIdx::from_usize(i); + let field: &rustc_middle::ty::FieldDef = + &adt.variants()[index].fields[field_index]; field_names.push(field.name); } } @@ -542,7 +550,7 @@ impl<'tcx> ConvSpirvType<'tcx> for TyAndLayout<'tcx> { } .def_with_name(cx, span, TyLayoutNameKey::from(*self)) } - BackendRepr::Vector { element, count } => { + BackendRepr::SimdVector { element, count } => { let elem_spirv = trans_scalar(cx, span, *self, element, Size::ZERO); SpirvType::Vector { element: elem_spirv, @@ -653,6 +661,7 @@ fn dig_scalar_pointee<'tcx>( let all_fields = (match &layout.variants { Variants::Multiple { variants, .. } => 0..variants.len(), + Variants::Empty => 0..0, Variants::Single { index } => { let i = index.as_usize(); i..i + 1 @@ -811,7 +820,8 @@ fn trans_struct<'tcx>(cx: &CodegenCx<'tcx>, span: Span, ty: TyAndLayout<'tcx>) - field_offsets.push(offset); if let Variants::Single { index } = ty.variants { if let TyKind::Adt(adt, _) = ty.ty.kind() { - let field = &adt.variants()[index].fields[i.into()]; + let field_index = rustc_abi::FieldIdx::from_usize(i); + let field: &rustc_middle::ty::FieldDef = &adt.variants()[index].fields[field_index]; field_names.push(field.name); } else { // FIXME(eddyb) this looks like something that should exist in rustc. @@ -868,6 +878,7 @@ impl<'tcx> From> for TyLayoutNameKey<'tcx> { variant: match layout.variants { Variants::Single { index } => Some(index), Variants::Multiple { .. } => None, + Variants::Empty => None, }, } } @@ -984,11 +995,11 @@ fn trans_intrinsic_type<'tcx>( cx: &CodegenCx<'tcx>, const_: Const<'tcx>, ) -> Result { - let (const_val, const_ty) = const_ - .try_to_valtree() - .expect("expected monomorphic const in codegen"); + let const_val = const_.to_value(); + let const_ty = const_val.ty; assert!(const_ty.is_integral()); const_val + .valtree .try_to_scalar_int() .and_then(P::from_scalar_int) .ok_or_else(|| { diff --git a/crates/rustc_codegen_spirv/src/attr.rs b/crates/rustc_codegen_spirv/src/attr.rs index a47b1ba1ad..8c1cfc4f5a 100644 --- a/crates/rustc_codegen_spirv/src/attr.rs +++ b/crates/rustc_codegen_spirv/src/attr.rs @@ -5,7 +5,7 @@ use crate::codegen_cx::CodegenCx; use crate::symbols::Symbols; use rspirv::spirv::{BuiltIn, ExecutionMode, ExecutionModel, StorageClass}; -use rustc_ast::Attribute; + use rustc_hir as hir; use rustc_hir::def_id::LocalModDefId; use rustc_hir::intravisit::{self, Visitor}; @@ -148,7 +148,7 @@ impl AggregatedSpirvAttributes { /// /// Any errors for malformed/duplicate attributes will have been reported /// prior to codegen, by the `attr` check pass. - pub fn parse<'tcx>(cx: &CodegenCx<'tcx>, attrs: &'tcx [Attribute]) -> Self { + pub fn parse<'tcx>(cx: &CodegenCx<'tcx>, attrs: &'tcx [rustc_hir::Attribute]) -> Self { let mut aggregated_attrs = Self::default(); // NOTE(eddyb) `span_delayed_bug` ensures that if attribute checking fails @@ -254,8 +254,8 @@ fn target_from_impl_item(tcx: TyCtxt<'_>, impl_item: &hir::ImplItem<'_>) -> Targ match impl_item.kind { hir::ImplItemKind::Const(..) => Target::AssocConst, hir::ImplItemKind::Fn(..) => { - let parent_owner_id = tcx.hir().get_parent_item(impl_item.hir_id()); - let containing_item = tcx.hir().expect_item(parent_owner_id.def_id); + let parent_owner_id = tcx.hir_get_parent_item(impl_item.hir_id()); + let containing_item = tcx.hir_expect_item(parent_owner_id.def_id); let containing_impl_is_for_trait = match &containing_item.kind { hir::ItemKind::Impl(hir::Impl { of_trait, .. }) => of_trait.is_some(), _ => unreachable!("parent of an ImplItem must be an Impl"), @@ -281,7 +281,7 @@ impl CheckSpirvAttrVisitor<'_> { let parse_attrs = |attrs| crate::symbols::parse_attrs_for_checking(&self.sym, attrs); - let attrs = self.tcx.hir().attrs(hir_id); + let attrs = self.tcx.hir_attrs(hir_id); for parse_attr_result in parse_attrs(attrs) { let (span, parsed_attr) = match parse_attr_result { Ok(span_and_parsed_attr) => span_and_parsed_attr, @@ -327,10 +327,9 @@ impl CheckSpirvAttrVisitor<'_> { | SpirvAttribute::SpecConstant(_) => match target { Target::Param => { let parent_hir_id = self.tcx.parent_hir_id(hir_id); - let parent_is_entry_point = - parse_attrs(self.tcx.hir().attrs(parent_hir_id)) - .filter_map(|r| r.ok()) - .any(|(_, attr)| matches!(attr, SpirvAttribute::Entry(_))); + let parent_is_entry_point = parse_attrs(self.tcx.hir_attrs(parent_hir_id)) + .filter_map(|r| r.ok()) + .any(|(_, attr)| matches!(attr, SpirvAttribute::Entry(_))); if !parent_is_entry_point { self.tcx.dcx().span_err( span, @@ -418,8 +417,8 @@ impl CheckSpirvAttrVisitor<'_> { impl<'tcx> Visitor<'tcx> for CheckSpirvAttrVisitor<'tcx> { type NestedFilter = nested_filter::OnlyBodies; - fn nested_visit_map(&mut self) -> Self::Map { - self.tcx.hir() + fn maybe_tcx(&mut self) -> Self::MaybeTyCtxt { + self.tcx } fn visit_item(&mut self, item: &'tcx hir::Item<'tcx>) { @@ -498,8 +497,8 @@ fn check_mod_attrs(tcx: TyCtxt<'_>, module_def_id: LocalModDefId) { tcx, sym: Symbols::get(), }; - tcx.hir() - .visit_item_likes_in_module(module_def_id, check_spirv_attr_visitor); + tcx.hir_visit_item_likes_in_module(module_def_id, check_spirv_attr_visitor); + if module_def_id.is_top_level_module() { check_spirv_attr_visitor.check_spirv_attributes(CRATE_HIR_ID, Target::Mod); } diff --git a/crates/rustc_codegen_spirv/src/builder/builder_methods.rs b/crates/rustc_codegen_spirv/src/builder/builder_methods.rs index 3a8b4c1801..79e3d626e3 100644 --- a/crates/rustc_codegen_spirv/src/builder/builder_methods.rs +++ b/crates/rustc_codegen_spirv/src/builder/builder_methods.rs @@ -10,6 +10,7 @@ use crate::spirv_type::SpirvType; use itertools::Itertools; use rspirv::dr::{InsertPoint, Instruction, Operand}; use rspirv::spirv::{Capability, MemoryModel, MemorySemantics, Op, Scope, StorageClass, Word}; +use rustc_abi::{Align, BackendRepr, Scalar, Size, WrappingRange}; use rustc_apfloat::{Float, Round, Status, ieee}; use rustc_codegen_ssa::MemFlags; use rustc_codegen_ssa::common::{ @@ -27,8 +28,7 @@ use rustc_middle::middle::codegen_fn_attrs::CodegenFnAttrs; use rustc_middle::ty::layout::LayoutOf; use rustc_middle::ty::{self, Ty}; use rustc_span::Span; -use rustc_target::abi::call::FnAbi; -use rustc_target::abi::{Align, BackendRepr, Scalar, Size, WrappingRange}; +use rustc_target::callconv::FnAbi; use smallvec::SmallVec; use std::borrow::Cow; use std::cell::Cell; @@ -215,24 +215,16 @@ impl<'a, 'tcx> Builder<'a, 'tcx> { }, SpirvType::Integer(width, true) => match width { 8 => self - .constant_i8(self.span(), unsafe { - std::mem::transmute::(fill_byte) - }) + .constant_i8(self.span(), u8::cast_signed(fill_byte)) .def(self), 16 => self - .constant_i16(self.span(), unsafe { - std::mem::transmute::(memset_fill_u16(fill_byte)) - }) + .constant_i16(self.span(), u16::cast_signed(memset_fill_u16(fill_byte))) .def(self), 32 => self - .constant_i32(self.span(), unsafe { - std::mem::transmute::(memset_fill_u32(fill_byte)) - }) + .constant_i32(self.span(), u32::cast_signed(memset_fill_u32(fill_byte))) .def(self), 64 => self - .constant_i64(self.span(), unsafe { - std::mem::transmute::(memset_fill_u64(fill_byte)) - }) + .constant_i64(self.span(), u64::cast_signed(memset_fill_u64(fill_byte))) .def(self), _ => self.fatal(format!( "memset on integer width {width} not implemented yet" @@ -1259,9 +1251,12 @@ impl<'a, 'tcx> Builder<'a, 'tcx> { }; // TODO: rspirv doesn't have insert_variable function let result_id = builder.id(); - let inst = Instruction::new(Op::Variable, Some(ptr_ty), Some(result_id), vec![ - Operand::StorageClass(StorageClass::Function), - ]); + let inst = Instruction::new( + Op::Variable, + Some(ptr_ty), + Some(result_id), + vec![Operand::StorageClass(StorageClass::Function)], + ); builder.insert_into_block(index, inst).unwrap(); result_id.with_type(ptr_ty) } @@ -1334,13 +1329,16 @@ impl<'a, 'tcx> BuilderMethods<'a, 'tcx> for Builder<'a, 'tcx> { let ((line_start, col_start), (line_end, col_end)) = (line_col_range.start, line_col_range.end); - self.custom_inst(void_ty, CustomInst::SetDebugSrcLoc { - file: Operand::IdRef(file.file_name_op_string_id), - line_start: Operand::IdRef(self.const_u32(line_start).def(self)), - line_end: Operand::IdRef(self.const_u32(line_end).def(self)), - col_start: Operand::IdRef(self.const_u32(col_start).def(self)), - col_end: Operand::IdRef(self.const_u32(col_end).def(self)), - }); + self.custom_inst( + void_ty, + CustomInst::SetDebugSrcLoc { + file: Operand::IdRef(file.file_name_op_string_id), + line_start: Operand::IdRef(self.const_u32(line_start).def(self)), + line_end: Operand::IdRef(self.const_u32(line_end).def(self)), + col_start: Operand::IdRef(self.const_u32(col_start).def(self)), + col_end: Operand::IdRef(self.const_u32(col_end).def(self)), + }, + ); } // HACK(eddyb) remove the previous instruction if made irrelevant. @@ -1689,11 +1687,14 @@ impl<'a, 'tcx> BuilderMethods<'a, 'tcx> for Builder<'a, 'tcx> { let signed = match ty.kind() { ty::Int(_) => true, ty::Uint(_) => false, - other => self.fatal(format!("Unexpected {} type: {other:#?}", match oop { - OverflowOp::Add => "checked add", - OverflowOp::Sub => "checked sub", - OverflowOp::Mul => "checked mul", - })), + other => self.fatal(format!( + "Unexpected {} type: {other:#?}", + match oop { + OverflowOp::Add => "checked add", + OverflowOp::Sub => "checked sub", + OverflowOp::Mul => "checked mul", + } + )), }; let result = if is_add { @@ -1833,7 +1834,7 @@ impl<'a, 'tcx> BuilderMethods<'a, 'tcx> for Builder<'a, 'tcx> { place.val.llval, place.val.align, ); - OperandValue::Immediate(self.to_immediate(llval, place.layout)) + OperandValue::Immediate(llval) } else if let BackendRepr::ScalarPair(a, b) = place.layout.backend_repr { let b_offset = a .primitive() @@ -3541,9 +3542,7 @@ impl<'a, 'tcx> BuilderMethods<'a, 'tcx> for Builder<'a, 'tcx> { .map(|s| Cow::Owned(s.replace('%', "%%"))) .interleave(ref_arg_ids_with_ty_and_spec.iter().map( |&(ref_id, ty, spec)| { - use rustc_target::abi::{ - Float::*, Integer::*, Primitive::*, - }; + use rustc_abi::{Float::*, Integer::*, Primitive::*}; let layout = self.layout_of(ty); diff --git a/crates/rustc_codegen_spirv/src/builder/byte_addressable_buffer.rs b/crates/rustc_codegen_spirv/src/builder/byte_addressable_buffer.rs index 76260a7765..41f42a3eff 100644 --- a/crates/rustc_codegen_spirv/src/builder/byte_addressable_buffer.rs +++ b/crates/rustc_codegen_spirv/src/builder/byte_addressable_buffer.rs @@ -5,11 +5,11 @@ use super::Builder; use crate::builder_spirv::{SpirvValue, SpirvValueExt, SpirvValueKind}; use crate::spirv_type::SpirvType; use rspirv::spirv::Word; +use rustc_abi::{Align, Size}; use rustc_codegen_ssa::traits::BuilderMethods; use rustc_errors::ErrorGuaranteed; use rustc_span::DUMMY_SP; -use rustc_target::abi::call::PassMode; -use rustc_target::abi::{Align, Size}; +use rustc_target::callconv::PassMode; impl<'a, 'tcx> Builder<'a, 'tcx> { fn load_err(&mut self, original_type: Word, invalid_type: Word) -> SpirvValue { diff --git a/crates/rustc_codegen_spirv/src/builder/intrinsics.rs b/crates/rustc_codegen_spirv/src/builder/intrinsics.rs index ef5857de52..b3da7951cb 100644 --- a/crates/rustc_codegen_spirv/src/builder/intrinsics.rs +++ b/crates/rustc_codegen_spirv/src/builder/intrinsics.rs @@ -17,7 +17,7 @@ use rustc_middle::ty::{FnDef, Instance, Ty, TyKind, TypingEnv}; use rustc_middle::{bug, ty}; use rustc_span::Span; use rustc_span::sym; -use rustc_target::abi::call::{FnAbi, PassMode}; +use rustc_target::callconv::{FnAbi, PassMode}; use std::assert_matches::assert_matches; fn int_type_width_signed(ty: Ty<'_>, cx: &CodegenCx<'_>) -> Option<(u64, bool)> { @@ -161,10 +161,11 @@ impl<'a, 'tcx> IntrinsicCallBuilderMethods<'tcx> for Builder<'a, 'tcx> { } sym::sinf32 | sym::sinf64 => self.gl_op(GLOp::Sin, ret_ty, [args[0].immediate()]), sym::cosf32 | sym::cosf64 => self.gl_op(GLOp::Cos, ret_ty, [args[0].immediate()]), - sym::powf32 | sym::powf64 => self.gl_op(GLOp::Pow, ret_ty, [ - args[0].immediate(), - args[1].immediate(), - ]), + sym::powf32 | sym::powf64 => self.gl_op( + GLOp::Pow, + ret_ty, + [args[0].immediate(), args[1].immediate()], + ), sym::expf32 | sym::expf64 => self.gl_op(GLOp::Exp, ret_ty, [args[0].immediate()]), sym::exp2f32 | sym::exp2f64 => self.gl_op(GLOp::Exp2, ret_ty, [args[0].immediate()]), sym::logf32 | sym::logf64 => self.gl_op(GLOp::Log, ret_ty, [args[0].immediate()]), @@ -176,20 +177,26 @@ impl<'a, 'tcx> IntrinsicCallBuilderMethods<'tcx> for Builder<'a, 'tcx> { let ln = self.gl_op(GLOp::Log, ret_ty, [args[0].immediate()]); self.fmul(mul, ln) } - sym::fmaf32 | sym::fmaf64 => self.gl_op(GLOp::Fma, ret_ty, [ - args[0].immediate(), - args[1].immediate(), - args[2].immediate(), - ]), + sym::fmaf32 | sym::fmaf64 => self.gl_op( + GLOp::Fma, + ret_ty, + [ + args[0].immediate(), + args[1].immediate(), + args[2].immediate(), + ], + ), sym::fabsf32 | sym::fabsf64 => self.gl_op(GLOp::FAbs, ret_ty, [args[0].immediate()]), - sym::minnumf32 | sym::minnumf64 => self.gl_op(GLOp::FMin, ret_ty, [ - args[0].immediate(), - args[1].immediate(), - ]), - sym::maxnumf32 | sym::maxnumf64 => self.gl_op(GLOp::FMax, ret_ty, [ - args[0].immediate(), - args[1].immediate(), - ]), + sym::minnumf32 | sym::minnumf64 => self.gl_op( + GLOp::FMin, + ret_ty, + [args[0].immediate(), args[1].immediate()], + ), + sym::maxnumf32 | sym::maxnumf64 => self.gl_op( + GLOp::FMax, + ret_ty, + [args[0].immediate(), args[1].immediate()], + ), sym::copysignf32 | sym::copysignf64 => { let val = args[0].immediate(); let sign = args[1].immediate(); @@ -199,8 +206,7 @@ impl<'a, 'tcx> IntrinsicCallBuilderMethods<'tcx> for Builder<'a, 'tcx> { sym::ceilf32 | sym::ceilf64 => self.gl_op(GLOp::Ceil, ret_ty, [args[0].immediate()]), sym::truncf32 | sym::truncf64 => self.gl_op(GLOp::Trunc, ret_ty, [args[0].immediate()]), // TODO: Correctness of all these rounds - sym::rintf32 | sym::rintf64 => self.gl_op(GLOp::Round, ret_ty, [args[0].immediate()]), - sym::nearbyintf32 | sym::nearbyintf64 | sym::roundf32 | sym::roundf64 => { + sym::round_ties_even_f32 | sym::round_ties_even_f64 => { self.gl_op(GLOp::Round, ret_ty, [args[0].immediate()]) } @@ -483,9 +489,13 @@ impl Builder<'_, '_> { if trailing { let lsb = self .emit() - .ext_inst(u32, None, glsl, GLOp::FindILsb as u32, [Operand::IdRef( - arg, - )]) + .ext_inst( + u32, + None, + glsl, + GLOp::FindILsb as u32, + [Operand::IdRef(arg)], + ) .unwrap(); if offset == 0 { lsb @@ -497,9 +507,13 @@ impl Builder<'_, '_> { // rust is always unsigned, so FindUMsb let msb_bit = self .emit() - .ext_inst(u32, None, glsl, GLOp::FindUMsb as u32, [Operand::IdRef( - arg, - )]) + .ext_inst( + u32, + None, + glsl, + GLOp::FindUMsb as u32, + [Operand::IdRef(arg)], + ) .unwrap(); // the glsl op returns the Msb bit, not the amount of leading zeros of this u32 // leading zeros = 31 - Msb bit @@ -604,18 +618,21 @@ impl Builder<'_, '_> { // so the best thing we can do is use our own custom instruction. let kind_id = self.emit().string(kind); let message_debug_printf_fmt_str_id = self.emit().string(message_debug_printf_fmt_str); - self.custom_inst(void_ty, CustomInst::Abort { - kind: Operand::IdRef(kind_id), - message_debug_printf: [message_debug_printf_fmt_str_id] - .into_iter() - .chain( - message_debug_printf_args - .into_iter() - .map(|arg| arg.def(self)), - ) - .map(Operand::IdRef) - .collect(), - }); + self.custom_inst( + void_ty, + CustomInst::Abort { + kind: Operand::IdRef(kind_id), + message_debug_printf: [message_debug_printf_fmt_str_id] + .into_iter() + .chain( + message_debug_printf_args + .into_iter() + .map(|arg| arg.def(self)), + ) + .map(Operand::IdRef) + .collect(), + }, + ); self.unreachable(); // HACK(eddyb) we still need an active block in case the user of this diff --git a/crates/rustc_codegen_spirv/src/builder/libm_intrinsics.rs b/crates/rustc_codegen_spirv/src/builder/libm_intrinsics.rs index 9ac081d161..4b57dc17c6 100644 --- a/crates/rustc_codegen_spirv/src/builder/libm_intrinsics.rs +++ b/crates/rustc_codegen_spirv/src/builder/libm_intrinsics.rs @@ -230,10 +230,11 @@ impl Builder<'_, '_> { } LibmIntrinsic::Custom(LibmCustomIntrinsic::Cbrt) => { assert_eq!(args.len(), 1); - self.gl_op(GLOp::Pow, result_type, [ - args[0], - self.constant_float(args[0].ty, 1.0 / 3.0), - ]) + self.gl_op( + GLOp::Pow, + result_type, + [args[0], self.constant_float(args[0].ty, 1.0 / 3.0)], + ) } LibmIntrinsic::Custom(LibmCustomIntrinsic::Log10) => { assert_eq!(args.len(), 1); diff --git a/crates/rustc_codegen_spirv/src/builder/mod.rs b/crates/rustc_codegen_spirv/src/builder/mod.rs index 044a9a13e6..bd176b7e7d 100644 --- a/crates/rustc_codegen_spirv/src/builder/mod.rs +++ b/crates/rustc_codegen_spirv/src/builder/mod.rs @@ -17,6 +17,7 @@ use crate::builder_spirv::{BuilderCursor, SpirvValue, SpirvValueExt}; use crate::codegen_cx::CodegenCx; use crate::spirv_type::SpirvType; use rspirv::spirv::Word; +use rustc_abi::{HasDataLayout, Size, TargetDataLayout}; use rustc_codegen_ssa::mir::operand::{OperandRef, OperandValue}; use rustc_codegen_ssa::mir::place::PlaceRef; use rustc_codegen_ssa::traits::{ @@ -34,8 +35,7 @@ use rustc_middle::ty::layout::{ use rustc_middle::ty::{Instance, Ty, TyCtxt, TypingEnv}; use rustc_span::Span; use rustc_span::def_id::DefId; -use rustc_target::abi::call::{ArgAbi, FnAbi, PassMode}; -use rustc_target::abi::{HasDataLayout, Size, TargetDataLayout}; +use rustc_target::callconv::{ArgAbi, FnAbi, PassMode}; use rustc_target::spec::{HasTargetSpec, Target}; use std::ops::{Deref, Range}; @@ -260,7 +260,7 @@ impl<'a, 'tcx> ArgAbiBuilderMethods<'tcx> for Builder<'a, 'tcx> { } } -impl<'a, 'tcx> AbiBuilderMethods<'tcx> for Builder<'a, 'tcx> { +impl<'a, 'tcx> AbiBuilderMethods for Builder<'a, 'tcx> { fn get_param(&mut self, index: usize) -> Self::Value { self.function_parameter_values.borrow()[&self.current_fn.def(self)][index] } diff --git a/crates/rustc_codegen_spirv/src/builder_spirv.rs b/crates/rustc_codegen_spirv/src/builder_spirv.rs index 4c87f0584d..936edf883a 100644 --- a/crates/rustc_codegen_spirv/src/builder_spirv.rs +++ b/crates/rustc_codegen_spirv/src/builder_spirv.rs @@ -12,23 +12,23 @@ use rspirv::spirv::{ AddressingModel, Capability, MemoryModel, Op, SourceLanguage, StorageClass, Word, }; use rspirv::{binary::Assemble, binary::Disassemble}; +use rustc_abi::Size; use rustc_arena::DroplessArena; use rustc_codegen_ssa::traits::ConstCodegenMethods as _; use rustc_data_structures::fx::{FxHashMap, FxHashSet}; -use rustc_data_structures::sync::Lrc; use rustc_middle::bug; use rustc_middle::mir::interpret::ConstAllocation; use rustc_middle::ty::TyCtxt; use rustc_span::source_map::SourceMap; use rustc_span::symbol::Symbol; use rustc_span::{DUMMY_SP, FileName, FileNameDisplayPreference, SourceFile, Span}; -use rustc_target::abi::Size; use std::assert_matches::assert_matches; use std::cell::{RefCell, RefMut}; use std::hash::{Hash, Hasher}; use std::iter; use std::ops::Range; use std::str; +use std::sync::Arc; use std::{fs::File, io::Write, path::Path}; #[derive(Copy, Clone, Debug, Ord, PartialOrd, Eq, PartialEq, Hash)] @@ -346,16 +346,16 @@ struct WithConstLegality { /// equivalent to a whole `rustc` `SourceFile`, but has O(1) `Eq` and `Hash` /// implementations (i.e. not involving the path or the contents of the file). /// -/// This is possible because we can compare `Lrc`s by equality, as +/// This is possible because we can compare `Arc`s by equality, as /// `rustc`'s `SourceMap` already ensures that only one `SourceFile` will be /// allocated for some given file. For hashing, we could hash the address, or /// -struct DebugFileKey(Lrc); +struct DebugFileKey(Arc); impl PartialEq for DebugFileKey { fn eq(&self, other: &Self) -> bool { let (Self(self_sf), Self(other_sf)) = (self, other); - Lrc::ptr_eq(self_sf, other_sf) + Arc::ptr_eq(self_sf, other_sf) } } impl Eq for DebugFileKey {} @@ -829,7 +829,7 @@ impl<'tcx> BuilderSpirv<'tcx> { (self.def_debug_file(lo_loc.file), lo_line_col..hi_line_col) } - fn def_debug_file(&self, sf: Lrc) -> DebugFileSpirv<'tcx> { + fn def_debug_file(&self, sf: Arc) -> DebugFileSpirv<'tcx> { *self .debug_file_cache .borrow_mut() @@ -839,7 +839,7 @@ impl<'tcx> BuilderSpirv<'tcx> { // FIXME(eddyb) it would be nicer if we could just rely on // `RealFileName::to_string_lossy` returning `Cow<'_, str>`, - // but sadly that `'_` is the lifetime of the temporary `Lrc`, + // but sadly that `'_` is the lifetime of the temporary `Arc`, // not `'tcx`, so we have to arena-allocate to get `&'tcx str`. let file_name = match &sf.name { FileName::Real(name) => { diff --git a/crates/rustc_codegen_spirv/src/codegen_cx/constant.rs b/crates/rustc_codegen_spirv/src/codegen_cx/constant.rs index 1461f23246..73ec9d5796 100644 --- a/crates/rustc_codegen_spirv/src/codegen_cx/constant.rs +++ b/crates/rustc_codegen_spirv/src/codegen_cx/constant.rs @@ -6,12 +6,12 @@ use crate::abi::ConvSpirvType; use crate::builder_spirv::{SpirvConst, SpirvValue, SpirvValueExt, SpirvValueKind}; use crate::spirv_type::SpirvType; use rspirv::spirv::Word; +use rustc_abi::{self, AddressSpace, Float, HasDataLayout, Integer, Primitive, Size}; use rustc_codegen_ssa::traits::{ConstCodegenMethods, MiscCodegenMethods, StaticCodegenMethods}; use rustc_middle::bug; use rustc_middle::mir::interpret::{ConstAllocation, GlobalAlloc, Scalar, alloc_range}; use rustc_middle::ty::layout::LayoutOf; use rustc_span::{DUMMY_SP, Span}; -use rustc_target::abi::{self, AddressSpace, Float, HasDataLayout, Integer, Primitive, Size}; impl<'tcx> CodegenCx<'tcx> { pub fn def_constant(&self, ty: Word, val: SpirvConst<'_, 'tcx>) -> SpirvValue { @@ -109,7 +109,7 @@ impl<'tcx> CodegenCx<'tcx> { } } -impl<'tcx> ConstCodegenMethods<'tcx> for CodegenCx<'tcx> { +impl<'tcx> ConstCodegenMethods for CodegenCx<'tcx> { fn const_null(&self, t: Self::Type) -> Self::Value { self.constant_null(t) } @@ -169,11 +169,17 @@ impl<'tcx> ConstCodegenMethods<'tcx> for CodegenCx<'tcx> { .layout_of(self.tcx.types.str_) .spirv_type(DUMMY_SP, self); ( - self.def_constant(self.type_ptr_to(str_ty), SpirvConst::PtrTo { - pointee: self - .constant_composite(str_ty, s.bytes().map(|b| self.const_u8(b).def_cx(self))) - .def_cx(self), - }), + self.def_constant( + self.type_ptr_to(str_ty), + SpirvConst::PtrTo { + pointee: self + .constant_composite( + str_ty, + s.bytes().map(|b| self.const_u8(b).def_cx(self)), + ) + .def_cx(self), + }, + ), self.const_usize(len as u64), ) } @@ -214,7 +220,7 @@ impl<'tcx> ConstCodegenMethods<'tcx> for CodegenCx<'tcx> { fn scalar_to_backend( &self, scalar: Scalar, - layout: abi::Scalar, + layout: rustc_abi::Scalar, ty: Self::Type, ) -> Self::Value { match scalar { @@ -254,13 +260,18 @@ impl<'tcx> ConstCodegenMethods<'tcx> for CodegenCx<'tcx> { (value, AddressSpace::DATA) } GlobalAlloc::Function { instance } => ( - self.get_fn_addr(instance.polymorphize(self.tcx)), + self.get_fn_addr(instance), self.data_layout().instruction_address_space, ), GlobalAlloc::VTable(vty, dyn_ty) => { let alloc = self .tcx - .global_alloc(self.tcx.vtable_allocation((vty, dyn_ty.principal()))) + .global_alloc(self.tcx.vtable_allocation(( + vty, + dyn_ty.principal().map(|principal| { + self.tcx.instantiate_bound_regions_with_erased(principal) + }), + ))) .unwrap_memory(); let pointee = match self.lookup_type(ty) { SpirvType::Pointer { pointee } => pointee, @@ -305,7 +316,13 @@ impl<'tcx> ConstCodegenMethods<'tcx> for CodegenCx<'tcx> { // the actual value generation until after a pointer to this value is cast // to its final type (e.g. that will be loaded as). // FIXME(eddyb) replace this with `qptr` handling of constant data. - fn const_data_from_alloc(&self, alloc: ConstAllocation<'tcx>) -> Self::Value { + fn const_data_from_alloc(&self, alloc: ConstAllocation<'_>) -> Self::Value { + // SAFETY: The `ConstAllocation` provided by `rustc_middle`'s MIR interpretation + // context is derived from the global `TyCtxt` and its arenas, which have the + // lifetime `'tcx`. Although the trait signature uses `ConstAllocation<'_>`, the + // underlying data is guaranteed to be valid for `'tcx`. + let alloc = + unsafe { std::mem::transmute::, ConstAllocation<'tcx>>(alloc) }; let void_type = SpirvType::Void.def(DUMMY_SP, self); self.def_constant(void_type, SpirvConst::ConstDataFromAlloc(alloc)) } @@ -354,12 +371,12 @@ impl<'tcx> CodegenCx<'tcx> { // This function comes from `ty::layout`'s `layout_of_uncached`, // where it's named `scalar_unit`. - pub fn primitive_to_scalar(&self, value: Primitive) -> abi::Scalar { + pub fn primitive_to_scalar(&self, value: Primitive) -> rustc_abi::Scalar { let bits = value.size(self.data_layout()).bits(); assert!(bits <= 128); - abi::Scalar::Initialized { + rustc_abi::Scalar::Initialized { value, - valid_range: abi::WrappingRange { + valid_range: rustc_abi::WrappingRange { start: 0, end: (!0 >> (128 - bits)), }, diff --git a/crates/rustc_codegen_spirv/src/codegen_cx/declare.rs b/crates/rustc_codegen_spirv/src/codegen_cx/declare.rs index eae83d8e93..584946951d 100644 --- a/crates/rustc_codegen_spirv/src/codegen_cx/declare.rs +++ b/crates/rustc_codegen_spirv/src/codegen_cx/declare.rs @@ -9,9 +9,9 @@ use crate::custom_decorations::{CustomDecoration, SrcLocDecoration}; use crate::spirv_type::SpirvType; use itertools::Itertools; use rspirv::spirv::{FunctionControl, LinkageType, StorageClass, Word}; -use rustc_attr::InlineAttr; +use rustc_abi::Align; +use rustc_attr_parsing::InlineAttr; use rustc_codegen_ssa::traits::{PreDefineCodegenMethods, StaticCodegenMethods}; -use rustc_hir::def::DefKind; use rustc_middle::bug; use rustc_middle::middle::codegen_fn_attrs::{CodegenFnAttrFlags, CodegenFnAttrs}; use rustc_middle::mir::mono::{Linkage, MonoItem, Visibility}; @@ -19,13 +19,14 @@ use rustc_middle::ty::layout::{FnAbiOf, LayoutOf}; use rustc_middle::ty::{self, Instance, TypeVisitableExt, TypingEnv}; use rustc_span::Span; use rustc_span::def_id::DefId; -use rustc_target::abi::Align; fn attrs_to_spirv(attrs: &CodegenFnAttrs) -> FunctionControl { let mut control = FunctionControl::NONE; match attrs.inline { InlineAttr::None => (), - InlineAttr::Hint | InlineAttr::Always => control.insert(FunctionControl::INLINE), + InlineAttr::Hint | InlineAttr::Always | InlineAttr::Force { .. } => { + control.insert(FunctionControl::INLINE) + } InlineAttr::Never => control.insert(FunctionControl::DONT_INLINE), } if attrs.flags.contains(CodegenFnAttrFlags::FFI_PURE) { @@ -131,13 +132,7 @@ impl<'tcx> CodegenCx<'tcx> { let declared = fn_id.with_type(function_type); - let attrs = AggregatedSpirvAttributes::parse(self, match self.tcx.def_kind(def_id) { - // This was made to ICE cross-crate at some point, but then got - // reverted in https://github.com/rust-lang/rust/pull/111381. - // FIXME(eddyb) remove this workaround once we rustup past that. - DefKind::Closure => &[], - _ => self.tcx.get_attrs_unchecked(def_id), - }); + let attrs = AggregatedSpirvAttributes::parse(self, self.tcx.get_attrs_unchecked(def_id)); if let Some(entry) = attrs.entry.map(|attr| attr.value) { let entry_name = entry .name @@ -339,9 +334,12 @@ impl<'tcx> PreDefineCodegenMethods<'tcx> for CodegenCx<'tcx> { impl<'tcx> StaticCodegenMethods for CodegenCx<'tcx> { fn static_addr_of(&self, cv: Self::Value, _align: Align, _kind: Option<&str>) -> Self::Value { - self.def_constant(self.type_ptr_to(cv.ty), SpirvConst::PtrTo { - pointee: cv.def_cx(self), - }) + self.def_constant( + self.type_ptr_to(cv.ty), + SpirvConst::PtrTo { + pointee: cv.def_cx(self), + }, + ) } fn codegen_static(&self, def_id: DefId) { diff --git a/crates/rustc_codegen_spirv/src/codegen_cx/entry.rs b/crates/rustc_codegen_spirv/src/codegen_cx/entry.rs index a2ad70a010..7435781173 100644 --- a/crates/rustc_codegen_spirv/src/codegen_cx/entry.rs +++ b/crates/rustc_codegen_spirv/src/codegen_cx/entry.rs @@ -19,7 +19,7 @@ use rustc_middle::span_bug; use rustc_middle::ty::layout::{LayoutOf, TyAndLayout}; use rustc_middle::ty::{self, Instance, Ty}; use rustc_span::Span; -use rustc_target::abi::call::{ArgAbi, FnAbi, PassMode}; +use rustc_target::callconv::{ArgAbi, FnAbi, PassMode}; use std::assert_matches::assert_matches; /// Various information about an entry-point parameter, which can only be deduced @@ -82,7 +82,7 @@ impl<'tcx> CodegenCx<'tcx> { .span_err(span, format!("cannot declare {name} as an entry point")); return; }; - self.tcx.hir().body_owned_by(fn_local_def_id).params + self.tcx.hir_body_owned_by(fn_local_def_id).params }; for (arg_abi, hir_param) in fn_abi.args.iter().zip(hir_params) { match arg_abi.mode { @@ -354,10 +354,13 @@ impl<'tcx> CodegenCx<'tcx> { if !ref_is_read_only && storage_class_requires_read_only { let mut err = self.tcx.dcx().struct_span_err( hir_param.ty_span, - format!("entry-point requires {}...", match explicit_mutbl { - hir::Mutability::Not => "interior mutability", - hir::Mutability::Mut => "a mutable reference", - }), + format!( + "entry-point requires {}...", + match explicit_mutbl { + hir::Mutability::Not => "interior mutability", + hir::Mutability::Mut => "a mutable reference", + } + ), ); { let note_message = @@ -426,7 +429,7 @@ impl<'tcx> CodegenCx<'tcx> { call_args: &mut Vec, decoration_locations: &mut FxHashMap, ) { - let attrs = AggregatedSpirvAttributes::parse(self, self.tcx.hir().attrs(hir_param.hir_id)); + let attrs = AggregatedSpirvAttributes::parse(self, self.tcx.hir_attrs(hir_param.hir_id)); let EntryParamDeducedFromRustRefOrValue { value_layout, @@ -445,9 +448,11 @@ impl<'tcx> CodegenCx<'tcx> { let mut emit = self.emit_global(); let spec_const_id = emit.spec_constant_bit32(value_spirv_type, default.unwrap_or(0)); - emit.decorate(spec_const_id, Decoration::SpecId, [Operand::LiteralBit32( - id, - )]); + emit.decorate( + spec_const_id, + Decoration::SpecId, + [Operand::LiteralBit32(id)], + ); ( Err("`#[spirv(spec_constant)]` is not an entry-point interface variable"), Ok(spec_const_id), @@ -772,10 +777,13 @@ impl<'tcx> CodegenCx<'tcx> { } => true, SpirvType::RuntimeArray { element: elt, .. } | SpirvType::Array { element: elt, .. } => { - matches!(self.lookup_type(elt), SpirvType::Image { - dim: Dim::DimSubpassData, - .. - }) + matches!( + self.lookup_type(elt), + SpirvType::Image { + dim: Dim::DimSubpassData, + .. + } + ) } _ => false, }; diff --git a/crates/rustc_codegen_spirv/src/codegen_cx/mod.rs b/crates/rustc_codegen_spirv/src/codegen_cx/mod.rs index f3a3828018..30ef160b9e 100644 --- a/crates/rustc_codegen_spirv/src/codegen_cx/mod.rs +++ b/crates/rustc_codegen_spirv/src/codegen_cx/mod.rs @@ -16,6 +16,7 @@ use crate::maybe_pqp_cg_ssa as rustc_codegen_ssa; use itertools::Itertools as _; use rspirv::dr::{Module, Operand}; use rspirv::spirv::{Decoration, LinkageType, Op, Word}; +use rustc_abi::{AddressSpace, HasDataLayout, TargetDataLayout}; use rustc_ast::ast::{InlineAsmOptions, InlineAsmTemplatePiece}; use rustc_codegen_ssa::mir::debuginfo::{FunctionDebugContext, VariableKind}; use rustc_codegen_ssa::traits::{ @@ -27,12 +28,11 @@ use rustc_hir::def_id::DefId; use rustc_middle::mir; use rustc_middle::mir::mono::CodegenUnit; use rustc_middle::ty::layout::{HasTyCtxt, HasTypingEnv}; -use rustc_middle::ty::{Instance, PolyExistentialTraitRef, Ty, TyCtxt, TypingEnv}; +use rustc_middle::ty::{ExistentialTraitRef, Instance, Ty, TyCtxt, TypingEnv}; use rustc_session::Session; use rustc_span::symbol::Symbol; use rustc_span::{DUMMY_SP, SourceFile, Span}; -use rustc_target::abi::call::{FnAbi, PassMode}; -use rustc_target::abi::{AddressSpace, HasDataLayout, TargetDataLayout}; +use rustc_target::callconv::{FnAbi, PassMode}; use rustc_target::spec::{HasTargetSpec, Target, TargetTuple}; use std::cell::RefCell; use std::collections::BTreeSet; @@ -52,7 +52,7 @@ pub struct CodegenCx<'tcx> { pub function_parameter_values: RefCell>>, pub type_cache: TypeCache<'tcx>, /// Cache generated vtables - pub vtables: RefCell, Option>), SpirvValue>>, + pub vtables: RefCell, Option>), SpirvValue>>, pub ext_inst: RefCell, /// Invalid SPIR-V IDs that should be stripped from the final binary, /// each with its own reason and span that should be used for reporting @@ -685,10 +685,10 @@ impl CodegenArgs { *current_id = *remap.entry(*current_id).or_insert_with(|| len as u32 + 1); }; module.all_inst_iter_mut().for_each(|inst| { - if let Some(ref mut result_id) = &mut inst.result_id { + if let Some(result_id) = &mut inst.result_id { insert(result_id); } - if let Some(ref mut result_type) = &mut inst.result_type { + if let Some(result_type) = &mut inst.result_type { insert(result_type); } inst.operands.iter_mut().for_each(|op| { @@ -849,7 +849,7 @@ impl<'tcx> MiscCodegenMethods<'tcx> for CodegenCx<'tcx> { #[allow(clippy::type_complexity)] fn vtables( &self, - ) -> &RefCell, Option>), Self::Value>> { + ) -> &RefCell, Option>), Self::Value>> { &self.vtables } @@ -910,7 +910,7 @@ impl<'tcx> DebugInfoCodegenMethods<'tcx> for CodegenCx<'tcx> { fn create_vtable_debuginfo( &self, _ty: Ty<'tcx>, - _trait_ref: Option>, + _trait_ref: Option>, _vtable: Self::Value, ) { // Ignore. @@ -974,4 +974,8 @@ impl<'tcx> AsmCodegenMethods<'tcx> for CodegenCx<'tcx> { ) { todo!() } + + fn mangled_name(&self, _instance: Instance<'tcx>) -> String { + todo!() + } } diff --git a/crates/rustc_codegen_spirv/src/codegen_cx/type_.rs b/crates/rustc_codegen_spirv/src/codegen_cx/type_.rs index f0005a9e42..62a18c32bc 100644 --- a/crates/rustc_codegen_spirv/src/codegen_cx/type_.rs +++ b/crates/rustc_codegen_spirv/src/codegen_cx/type_.rs @@ -5,6 +5,7 @@ use super::CodegenCx; use crate::abi::ConvSpirvType; use crate::spirv_type::SpirvType; use rspirv::spirv::Word; +use rustc_abi::{AddressSpace, BackendRepr, Reg}; use rustc_codegen_ssa::common::TypeKind; use rustc_codegen_ssa::traits::{BaseTypeCodegenMethods, LayoutTypeCodegenMethods}; use rustc_middle::ty::Ty; @@ -14,8 +15,7 @@ use rustc_middle::ty::layout::{ use rustc_middle::{bug, span_bug}; use rustc_span::source_map::Spanned; use rustc_span::{DUMMY_SP, Span}; -use rustc_target::abi::call::{CastTarget, FnAbi, Reg}; -use rustc_target::abi::{AddressSpace, BackendRepr}; +use rustc_target::callconv::{CastTarget, FnAbi}; impl<'tcx> LayoutOfHelpers<'tcx> for CodegenCx<'tcx> { type LayoutOfResult = TyAndLayout<'tcx>; @@ -97,18 +97,17 @@ impl<'tcx> LayoutTypeCodegenMethods<'tcx> for CodegenCx<'tcx> { fn is_backend_immediate(&self, layout: TyAndLayout<'tcx>) -> bool { match layout.backend_repr { - BackendRepr::Scalar(_) | BackendRepr::Vector { .. } => true, + BackendRepr::Scalar(_) | BackendRepr::SimdVector { .. } => true, BackendRepr::ScalarPair(..) => false, - BackendRepr::Uninhabited | BackendRepr::Memory { .. } => layout.is_zst(), + BackendRepr::Memory { .. } => layout.is_zst(), } } fn is_backend_scalar_pair(&self, layout: TyAndLayout<'tcx>) -> bool { match layout.backend_repr { BackendRepr::ScalarPair(..) => true, - BackendRepr::Uninhabited - | BackendRepr::Scalar(_) - | BackendRepr::Vector { .. } + BackendRepr::Scalar(_) + | BackendRepr::SimdVector { .. } | BackendRepr::Memory { .. } => false, } } @@ -130,7 +129,7 @@ impl<'tcx> CodegenCx<'tcx> { } } -impl<'tcx> BaseTypeCodegenMethods<'tcx> for CodegenCx<'tcx> { +impl<'tcx> BaseTypeCodegenMethods for CodegenCx<'tcx> { fn type_i8(&self) -> Self::Type { SpirvType::Integer(8, false).def(DUMMY_SP, self) } diff --git a/crates/rustc_codegen_spirv/src/custom_decorations.rs b/crates/rustc_codegen_spirv/src/custom_decorations.rs index e2cf68158c..1027df9aed 100644 --- a/crates/rustc_codegen_spirv/src/custom_decorations.rs +++ b/crates/rustc_codegen_spirv/src/custom_decorations.rs @@ -7,13 +7,13 @@ use either::Either; use rspirv::dr::{Instruction, Module, Operand}; use rspirv::spirv::{Decoration, Op, Word}; use rustc_data_structures::fx::FxIndexMap; -use rustc_data_structures::sync::Lrc; use rustc_span::{FileName, SourceFile}; use rustc_span::{Span, source_map::SourceMap}; use smallvec::SmallVec; use std::borrow::Cow; use std::marker::PhantomData; use std::path::PathBuf; +use std::sync::Arc; use std::{fmt, iter, slice, str}; /// Decorations not native to SPIR-V require some form of encoding into existing @@ -39,11 +39,16 @@ pub trait CustomDecoration<'a>: Sized { let mut encoded = Self::ENCODING_PREFIX.to_string(); self.encode(&mut encoded).unwrap(); - Instruction::new(Op::DecorateString, None, None, vec![ - Operand::IdRef(id), - Operand::Decoration(Decoration::UserTypeGOOGLE), - Operand::LiteralString(encoded), - ]) + Instruction::new( + Op::DecorateString, + None, + None, + vec![ + Operand::IdRef(id), + Operand::Decoration(Decoration::UserTypeGOOGLE), + Operand::LiteralString(encoded), + ], + ) } fn try_decode_from_inst(inst: &Instruction) -> Option<(Word, LazilyDecoded<'_, Self>)> { @@ -54,10 +59,13 @@ pub trait CustomDecoration<'a>: Sized { let prefixed_encoded = inst.operands[2].unwrap_literal_string(); let encoded = prefixed_encoded.strip_prefix(Self::ENCODING_PREFIX)?; - Some((id, LazilyDecoded { - encoded, - _marker: PhantomData, - })) + Some(( + id, + LazilyDecoded { + encoded, + _marker: PhantomData, + }, + )) } else { None } @@ -313,7 +321,7 @@ struct SpvDebugFile<'a> { /// Source strings from one `OpSource`, and any number of `OpSourceContinued`. op_source_parts: SmallVec<[&'a str; 1]>, - regenerated_rustc_source_file: Option>, + regenerated_rustc_source_file: Option>, } impl<'a> SpanRegenerator<'a> { diff --git a/crates/rustc_codegen_spirv/src/custom_insts.rs b/crates/rustc_codegen_spirv/src/custom_insts.rs index 54a1331c9f..a237dfdb4d 100644 --- a/crates/rustc_codegen_spirv/src/custom_insts.rs +++ b/crates/rustc_codegen_spirv/src/custom_insts.rs @@ -43,7 +43,8 @@ lazy_static! { /// achieved by hashing the `SCHEMA` constant from `def_custom_insts!` below pub static ref CUSTOM_EXT_INST_SET: String = { let schema_hash = { - use rustc_data_structures::stable_hasher::{Hash128, StableHasher}; + use rustc_hashes::Hash128; + use rustc_data_structures::stable_hasher::StableHasher; use std::hash::Hash; let mut hasher = StableHasher::new(); @@ -57,31 +58,38 @@ lazy_static! { pub fn register_to_spirt_context(cx: &spirt::Context) { use spirt::spv::spec::{ExtInstSetDesc, ExtInstSetInstructionDesc}; - cx.register_custom_ext_inst_set(&CUSTOM_EXT_INST_SET, ExtInstSetDesc { - // HACK(eddyb) this is the most compact form I've found, that isn't - // outright lossy by omitting "Rust vs Rust-GPU" or the version. - short_alias: Some( - concat!("Rust-GPU ", join_cargo_pkg_version_major_minor_patch!(".")).into(), - ), - instructions: SCHEMA - .iter() - .map(|&(i, name, operand_names)| { - (i, ExtInstSetInstructionDesc { - name: name.into(), - operand_names: operand_names - .iter() - .map(|name| { - name.strip_prefix("..") - .unwrap_or(name) - .replace('_', " ") - .into() - }) - .collect(), - is_debuginfo: name.contains("Debug") || name.contains("InlinedCallFrame"), + cx.register_custom_ext_inst_set( + &CUSTOM_EXT_INST_SET, + ExtInstSetDesc { + // HACK(eddyb) this is the most compact form I've found, that isn't + // outright lossy by omitting "Rust vs Rust-GPU" or the version. + short_alias: Some( + concat!("Rust-GPU ", join_cargo_pkg_version_major_minor_patch!(".")).into(), + ), + instructions: SCHEMA + .iter() + .map(|&(i, name, operand_names)| { + ( + i, + ExtInstSetInstructionDesc { + name: name.into(), + operand_names: operand_names + .iter() + .map(|name| { + name.strip_prefix("..") + .unwrap_or(name) + .replace('_', " ") + .into() + }) + .collect(), + is_debuginfo: name.contains("Debug") + || name.contains("InlinedCallFrame"), + }, + ) }) - }) - .collect(), - }); + .collect(), + }, + ); } macro_rules! def_custom_insts { @@ -110,7 +118,7 @@ macro_rules! def_custom_insts { pub fn with_operands(self, operands: &[T]) -> CustomInst { match self { $(Self::$name => match operands { - [$($($field,)+ $(ref $variadic_field @ ..)?)?] => CustomInst::$name $({ + [$($($field,)+ $($variadic_field @ ..)?)?] => CustomInst::$name $({ $($field: $field.clone(),)+ $($variadic_field: $variadic_field.iter().cloned().collect())? })?, diff --git a/crates/rustc_codegen_spirv/src/lib.rs b/crates/rustc_codegen_spirv/src/lib.rs index b2bd123dd2..19d9472f10 100644 --- a/crates/rustc_codegen_spirv/src/lib.rs +++ b/crates/rustc_codegen_spirv/src/lib.rs @@ -2,17 +2,20 @@ #![allow(internal_features)] #![allow(rustc::diagnostic_outside_of_impl)] #![allow(rustc::untranslatable_diagnostic)] +#![cfg_attr(bootstrap, feature(let_chains))] #![feature(assert_matches)] #![feature(box_patterns)] -#![feature(debug_closure_helpers)] #![feature(file_buffered)] #![feature(if_let_guard)] -#![feature(let_chains)] #![feature(negative_impls)] #![feature(rustdoc_internals)] +#![feature(string_from_utf8_lossy_owned)] #![feature(trait_alias)] #![feature(try_blocks)] // HACK(eddyb) end of `rustc_codegen_ssa` crate-level attributes (see `build.rs`). +// HACK(LegNeato) including this above throws a warning that may hide other issues, and +// without it we get an error. So we include it here. +#![feature(let_chains)] //! Welcome to the API documentation for the `rust-gpu` project, this API is //! unstable and mainly intended for developing on the project itself. This is @@ -150,8 +153,9 @@ use maybe_pqp_cg_ssa::traits::{ use maybe_pqp_cg_ssa::{CodegenResults, CompiledModule, ModuleCodegen, ModuleKind}; use rspirv::binary::Assemble; use rustc_ast::expand::allocator::AllocatorKind; +use rustc_ast::expand::autodiff_attrs::AutoDiffItem; use rustc_data_structures::fx::FxIndexMap; -use rustc_errors::{DiagCtxtHandle, ErrorGuaranteed, FatalError}; +use rustc_errors::{DiagCtxtHandle, FatalError}; use rustc_metadata::EncodedMetadata; use rustc_middle::dep_graph::{WorkProduct, WorkProductId}; use rustc_middle::mir::mono::{MonoItem, MonoItemData}; @@ -257,15 +261,18 @@ impl CodegenBackend for SpirvCodegenBackend { rustc_errors::DEFAULT_LOCALE_RESOURCE } - fn target_features(&self, sess: &Session, _allow_unstable: bool) -> Vec { + fn target_features_cfg(&self, sess: &Session) -> (Vec, Vec) { let cmdline = sess.opts.cg.target_feature.split(','); let cfg = sess.target.options.features.split(','); - cfg.chain(cmdline) - .filter(|l| l.starts_with('+')) - .map(|l| &l[1..]) - .filter(|l| !l.is_empty()) - .map(Symbol::intern) - .collect() + ( + cfg.chain(cmdline) + .filter(|l| l.starts_with('+')) + .map(|l| &l[1..]) + .filter(|l| !l.is_empty()) + .map(Symbol::intern) + .collect(), + vec![], + ) } fn provide(&self, providers: &mut rustc_middle::util::Providers) { @@ -310,12 +317,7 @@ impl CodegenBackend for SpirvCodegenBackend { .join(sess) } - fn link( - &self, - sess: &Session, - codegen_results: CodegenResults, - outputs: &OutputFilenames, - ) -> Result<(), ErrorGuaranteed> { + fn link(&self, sess: &Session, codegen_results: CodegenResults, outputs: &OutputFilenames) { let timer = sess.timer("link_crate"); link::link( sess, @@ -324,8 +326,6 @@ impl CodegenBackend for SpirvCodegenBackend { codegen_results.crate_info.local_crate_name.as_str(), ); drop(timer); - - sess.dcx().has_errors().map_or(Ok(()), Err) } } @@ -372,7 +372,7 @@ impl WriteBackendMethods for SpirvCodegenBackend { unsafe fn optimize( _: &CodegenContext, _: DiagCtxtHandle<'_>, - _: &ModuleCodegen, + _: &mut ModuleCodegen, _: &ModuleConfig, ) -> Result<(), FatalError> { // TODO: Implement @@ -389,6 +389,7 @@ impl WriteBackendMethods for SpirvCodegenBackend { .to_vec(), name: thin_module.name().to_string(), kind: ModuleKind::Regular, + thin_lto_buffer: None, }; Ok(module) } @@ -408,7 +409,7 @@ impl WriteBackendMethods for SpirvCodegenBackend { ) -> Result { let path = cgcx .output_filenames - .temp_path(OutputType::Object, Some(&module.name)); + .temp_path_for_cgu(OutputType::Object, &module.name, None); // Note: endianness doesn't matter, readers deduce endianness from magic header. let spirv_module = spirv_tools::binary::from_binary(&module.module_llvm); File::create(&path) @@ -423,6 +424,7 @@ impl WriteBackendMethods for SpirvCodegenBackend { bytecode: None, assembly: None, llvm_ir: None, + links_from_incr_cache: vec![], }) } @@ -436,6 +438,15 @@ impl WriteBackendMethods for SpirvCodegenBackend { fn serialize_module(module: ModuleCodegen) -> (String, Self::ModuleBuffer) { (module.name, SpirvModuleBuffer(module.module_llvm)) } + + fn autodiff( + _cgcx: &CodegenContext, + _module: &ModuleCodegen, + _diff_fncs: Vec, + _config: &ModuleConfig, + ) -> Result<(), FatalError> { + todo!() + } } impl ExtraBackendMethods for SpirvCodegenBackend { @@ -510,6 +521,7 @@ impl ExtraBackendMethods for SpirvCodegenBackend { name: cgu_name.to_string(), module_llvm: spirv_module, kind: ModuleKind::Regular, + thin_lto_buffer: None, }, 0, ) @@ -544,7 +556,7 @@ impl Drop for DumpModuleOnPanic<'_, '_, '_> { } /// This is the entrypoint for a hot plugged `rustc_codegen_spirv` -#[no_mangle] +#[unsafe(no_mangle)] pub fn __rustc_codegen_backend() -> Box { // Tweak rustc's default ICE panic hook, to direct people to `rust-gpu`. rustc_driver::install_ice_hook("https://github.com/rust-gpu/rust-gpu/issues/new", |dcx| { diff --git a/crates/rustc_codegen_spirv/src/link.rs b/crates/rustc_codegen_spirv/src/link.rs index 4c702b7c78..ce4fac612a 100644 --- a/crates/rustc_codegen_spirv/src/link.rs +++ b/crates/rustc_codegen_spirv/src/link.rs @@ -65,8 +65,12 @@ pub fn link( if outputs.outputs.should_codegen() { let out_filename = out_filename(sess, crate_type, outputs, Symbol::intern(crate_name)); - let out_filename_file_for_writing = - out_filename.file_for_writing(outputs, OutputType::Exe, None); + let out_filename_file_for_writing = out_filename.file_for_writing( + outputs, + OutputType::Exe, + crate_name, + sess.invocation_temp.as_deref(), + ); match crate_type { CrateType::Rlib => { link_rlib(sess, codegen_results, &out_filename_file_for_writing); @@ -137,7 +141,7 @@ fn link_rlib(sess: &Session, codegen_results: &CodegenResults, out_filename: &Pa create_archive( &file_list, - codegen_results.metadata.raw_data(), + codegen_results.metadata.stub_or_full(), out_filename, ); } @@ -329,7 +333,7 @@ fn do_spirv_opt( match sess.opts.optimize { OptLevel::No => {} - OptLevel::Less | OptLevel::Default | OptLevel::Aggressive => { + OptLevel::Less | OptLevel::More | OptLevel::Aggressive => { optimizer.register_performance_passes(); } OptLevel::Size | OptLevel::SizeMin => { @@ -431,11 +435,12 @@ fn add_upstream_rust_crates( .crate_info .dependency_formats .iter() - .find(|(ty, _)| *ty == crate_type) + .find(|(ty, _)| **ty == crate_type) .expect("failed to find crate type in dependency format list"); for &cnum in &codegen_results.crate_info.used_crates { let src = &codegen_results.crate_info.used_crate_source[&cnum]; - match data[cnum.as_usize() - 1] { + let cnum = rustc_span::def_id::CrateNum::from_usize(cnum.as_usize() - 1); + match data[cnum] { Linkage::NotLinked | Linkage::IncludedFromDylib => {} Linkage::Static => rlibs.push(src.rlib.as_ref().unwrap().0.clone()), //Linkage::Dynamic => rlibs.push(src.dylib.as_ref().unwrap().0.clone()), @@ -455,7 +460,7 @@ fn add_upstream_native_libraries( .crate_info .dependency_formats .iter() - .find(|(ty, _)| *ty == crate_type) + .find(|(ty, _)| **ty == crate_type) .expect("failed to find crate type in dependency format list"); for &cnum in &codegen_results.crate_info.used_crates { @@ -463,11 +468,12 @@ fn add_upstream_native_libraries( if !relevant_lib(sess, lib) { continue; } + let cnum = rustc_span::def_id::CrateNum::from_usize(cnum.as_usize() - 1); match lib.kind { NativeLibKind::Static { bundle: Some(false), .. - } if data[cnum.as_usize() - 1] != Linkage::Static => {} + } if data[cnum] != Linkage::Static => {} NativeLibKind::Static { bundle: None | Some(true), @@ -487,7 +493,7 @@ fn add_upstream_native_libraries( // (see `compiler/rustc_codegen_ssa/src/back/link.rs`) fn relevant_lib(sess: &Session, lib: &NativeLib) -> bool { match lib.cfg { - Some(ref cfg) => rustc_attr::cfg_matches(cfg, sess, CRATE_NODE_ID, None), + Some(ref cfg) => rustc_attr_parsing::cfg_matches(cfg, sess, CRATE_NODE_ID, None), None => true, } } diff --git a/crates/rustc_codegen_spirv/src/linker/duplicates.rs b/crates/rustc_codegen_spirv/src/linker/duplicates.rs index 6b1b45d8cd..0f8a36d8a0 100644 --- a/crates/rustc_codegen_spirv/src/linker/duplicates.rs +++ b/crates/rustc_codegen_spirv/src/linker/duplicates.rs @@ -401,11 +401,12 @@ pub fn remove_duplicate_debuginfo(module: &mut Module) { // as it needs to reset callee-side `DbgLocInst`, // but we can replace it in-place and hope later // it get nop'd out by some real `DbgLocInst`. - insts[inst_idx] - .operands - .splice(1.., [Operand::LiteralExtInstInteger( + insts[inst_idx].operands.splice( + 1.., + [Operand::LiteralExtInstInteger( CustomOp::ClearDebugSrcLoc as u32, - )]); + )], + ); dbg = DbgState { loc: Some(DbgLocInst { inst_idx, diff --git a/crates/rustc_codegen_spirv/src/linker/import_export_link.rs b/crates/rustc_codegen_spirv/src/linker/import_export_link.rs index 68a789104a..af68523745 100644 --- a/crates/rustc_codegen_spirv/src/linker/import_export_link.rs +++ b/crates/rustc_codegen_spirv/src/linker/import_export_link.rs @@ -202,7 +202,7 @@ fn check_tys_equal( fn replace_all_uses_with(module: &mut Module, rules: &FxHashMap) { module.all_inst_iter_mut().for_each(|inst| { - if let Some(ref mut result_type) = &mut inst.result_type { + if let Some(result_type) = &mut inst.result_type { if let Some(&rewrite) = rules.get(result_type) { *result_type = rewrite; } diff --git a/crates/rustc_codegen_spirv/src/linker/inline.rs b/crates/rustc_codegen_spirv/src/linker/inline.rs index 70b2ec4b2b..34a4886ca0 100644 --- a/crates/rustc_codegen_spirv/src/linker/inline.rs +++ b/crates/rustc_codegen_spirv/src/linker/inline.rs @@ -63,9 +63,14 @@ pub fn inline(sess: &Session, module: &mut Module) -> super::Result<()> { custom_ext_inst_set_import: custom_ext_inst_set_import.unwrap_or_else(|| { let id = next_id(header); - let inst = Instruction::new(Op::ExtInstImport, None, Some(id), vec![ - Operand::LiteralString(custom_insts::CUSTOM_EXT_INST_SET.to_string()), - ]); + let inst = Instruction::new( + Op::ExtInstImport, + None, + Some(id), + vec![Operand::LiteralString( + custom_insts::CUSTOM_EXT_INST_SET.to_string(), + )], + ); module.ext_inst_imports.push(inst); id }), @@ -921,10 +926,12 @@ impl Inliner<'_, '_> { .entry(callee_name) .or_insert_with(|| { let id = next_id(self.header); - self.debug_string_source - .push(Instruction::new(Op::String, None, Some(id), vec![ - Operand::LiteralString(callee_name.to_string()), - ])); + self.debug_string_source.push(Instruction::new( + Op::String, + None, + Some(id), + vec![Operand::LiteralString(callee_name.to_string())], + )); id }); let mut mk_debuginfo_prefix_and_suffix = || { diff --git a/crates/rustc_codegen_spirv/src/linker/mem2reg.rs b/crates/rustc_codegen_spirv/src/linker/mem2reg.rs index ba82f95fee..fe571b8c3d 100644 --- a/crates/rustc_codegen_spirv/src/linker/mem2reg.rs +++ b/crates/rustc_codegen_spirv/src/linker/mem2reg.rs @@ -253,10 +253,13 @@ fn collect_access_chains( } let mut variables = FxHashMap::default(); - variables.insert(base_var, VarInfo { - ty: base_var_ty, - indices: vec![], - }); + variables.insert( + base_var, + VarInfo { + ty: base_var_ty, + indices: vec![], + }, + ); // Loop in case a previous block references a later AccessChain loop { let mut changed = false; @@ -345,17 +348,21 @@ fn split_copy_memory( } }; let temp_id = id(header); - block.instructions[inst_index] = - Instruction::new(Op::Load, Some(ty), Some(temp_id), vec![Operand::IdRef( - source, - )]); + block.instructions[inst_index] = Instruction::new( + Op::Load, + Some(ty), + Some(temp_id), + vec![Operand::IdRef(source)], + ); inst_index += 1; block.instructions.insert( inst_index, - Instruction::new(Op::Store, None, None, vec![ - Operand::IdRef(target), - Operand::IdRef(temp_id), - ]), + Instruction::new( + Op::Store, + None, + None, + vec![Operand::IdRef(target), Operand::IdRef(temp_id)], + ), ); } inst_index += 1; @@ -462,10 +469,12 @@ impl Renamer<'_, '_> { let new_id = id(self.header); self.blocks[block].instructions.insert( 0, - Instruction::new(Op::Phi, Some(self.base_var_type), Some(new_id), vec![ - Operand::IdRef(top_def), - Operand::IdRef(from_block_label), - ]), + Instruction::new( + Op::Phi, + Some(self.base_var_type), + Some(new_id), + vec![Operand::IdRef(top_def), Operand::IdRef(from_block_label)], + ), ); self.phi_defs.insert(new_id); new_id diff --git a/crates/rustc_codegen_spirv/src/linker/mod.rs b/crates/rustc_codegen_spirv/src/linker/mod.rs index fa69dc8e7f..da4e28dd0d 100644 --- a/crates/rustc_codegen_spirv/src/linker/mod.rs +++ b/crates/rustc_codegen_spirv/src/linker/mod.rs @@ -336,23 +336,27 @@ pub fn link( for func in &mut output.functions { simple_passes::block_ordering_pass(func); } - output = specializer::specialize(opts, output, specializer::SimpleSpecialization { - specialize_operand: |operand| { - matches!(operand, Operand::StorageClass(StorageClass::Generic)) - }, + output = specializer::specialize( + opts, + output, + specializer::SimpleSpecialization { + specialize_operand: |operand| { + matches!(operand, Operand::StorageClass(StorageClass::Generic)) + }, - // NOTE(eddyb) this can be anything that is guaranteed to pass - // validation - there are no constraints so this is either some - // unused pointer, or perhaps one created using `OpConstantNull` - // and simply never mixed with pointers that have a storage class. - // It would be nice to use `Generic` itself here so that we leave - // some kind of indication of it being unconstrained, but `Generic` - // requires additional capabilities, so we use `Function` instead. - // TODO(eddyb) investigate whether this can end up in a pointer - // type that's the value of a module-scoped variable, and whether - // `Function` is actually invalid! (may need `Private`) - concrete_fallback: Operand::StorageClass(StorageClass::Function), - }); + // NOTE(eddyb) this can be anything that is guaranteed to pass + // validation - there are no constraints so this is either some + // unused pointer, or perhaps one created using `OpConstantNull` + // and simply never mixed with pointers that have a storage class. + // It would be nice to use `Generic` itself here so that we leave + // some kind of indication of it being unconstrained, but `Generic` + // requires additional capabilities, so we use `Function` instead. + // TODO(eddyb) investigate whether this can end up in a pointer + // type that's the value of a module-scoped variable, and whether + // `Function` is actually invalid! (may need `Private`) + concrete_fallback: Operand::StorageClass(StorageClass::Function), + }, + ); } // NOTE(eddyb) with SPIR-T, we can do `mem2reg` before inlining, too! @@ -477,7 +481,11 @@ pub fn link( let (spv_words, module_or_err, lower_from_spv_timer) = spv_module_to_spv_words_and_spirt_module(&output); let module = &mut module_or_err.map_err(|e| { - let spv_path = outputs.temp_path_ext("spirt-lower-from-spv-input.spv", None); + let spv_path = outputs.temp_path_ext_for_cgu( + "spv", + "spirt-lower-from-spv-input", + sess.invocation_temp.as_deref(), + ); let was_saved_msg = match std::fs::write(&spv_path, spirv_tools::binary::from_binary(&spv_words)) { @@ -638,10 +646,13 @@ pub fn link( module.entry_points.push(entry.clone()); let entry_name = entry.operands[2].unwrap_literal_string().to_string(); let mut file_stem = OsString::from( - sanitize_filename::sanitize_with_options(&entry_name, sanitize_filename::Options { - replacement: "-", - ..Default::default() - }) + sanitize_filename::sanitize_with_options( + &entry_name, + sanitize_filename::Options { + replacement: "-", + ..Default::default() + }, + ) .replace("--", "-"), ); // It's always possible to find an unambiguous `file_stem`, but it @@ -765,7 +776,11 @@ impl Drop for SpirtDumpGuard<'_> { self.per_pass_module_for_dumping .push(("", self.module.clone())); } - dump_spirt_file_path = Some(self.outputs.temp_path_ext("spirt", None)); + dump_spirt_file_path = Some(self.outputs.temp_path_ext_for_cgu( + "spirt", + "dump", + self.sess.invocation_temp.as_deref(), + )); } if let Some(dump_spirt_file_path) = &dump_spirt_file_path { diff --git a/crates/rustc_codegen_spirv/src/linker/param_weakening.rs b/crates/rustc_codegen_spirv/src/linker/param_weakening.rs index 8dc6442ccc..5b9997df59 100644 --- a/crates/rustc_codegen_spirv/src/linker/param_weakening.rs +++ b/crates/rustc_codegen_spirv/src/linker/param_weakening.rs @@ -8,7 +8,7 @@ use indexmap::IndexMap; use rspirv::dr::{Builder, Module, Operand}; use rspirv::spirv::{Op, Word}; use rustc_data_structures::fx::FxHashMap; -use rustc_index::bit_set::BitSet; +use rustc_index::bit_set::DenseBitSet; use std::mem; pub fn remove_unused_params(module: Module) -> Module { @@ -17,7 +17,7 @@ pub fn remove_unused_params(module: Module) -> Module { // Gather all of the unused parameters for each function, transitively. // (i.e. parameters which are passed, as call arguments, to functions that // won't use them, are also considered unused, through any number of calls) - let mut unused_params_per_func_id: IndexMap> = IndexMap::new(); + let mut unused_params_per_func_id: IndexMap> = IndexMap::new(); for func_idx in call_graph.post_order() { // Skip entry points, as they're the only "exported" functions, at least // at link-time (likely only relevant to `Kernel`s, but not `Shader`s). @@ -33,7 +33,7 @@ pub fn remove_unused_params(module: Module) -> Module { .enumerate() .map(|(i, p)| (p.result_id.unwrap(), i)) .collect(); - let mut unused_params = BitSet::new_filled(func.parameters.len()); + let mut unused_params = DenseBitSet::new_filled(func.parameters.len()); for inst in func.all_inst_iter() { // If this is a call, we can ignore the arguments passed to the // callee parameters we already determined to be unused, because diff --git a/crates/rustc_codegen_spirv/src/linker/simple_passes.rs b/crates/rustc_codegen_spirv/src/linker/simple_passes.rs index d0e7854895..b17a60a5ce 100644 --- a/crates/rustc_codegen_spirv/src/linker/simple_passes.rs +++ b/crates/rustc_codegen_spirv/src/linker/simple_passes.rs @@ -8,11 +8,11 @@ use std::mem::take; pub fn shift_ids(module: &mut Module, add: u32) { module.all_inst_iter_mut().for_each(|inst| { - if let Some(ref mut result_id) = &mut inst.result_id { + if let Some(result_id) = &mut inst.result_id { *result_id += add; } - if let Some(ref mut result_type) = &mut inst.result_type { + if let Some(result_type) = &mut inst.result_type { *result_type += add; } @@ -110,11 +110,11 @@ pub fn compact_ids(module: &mut Module) -> u32 { }; module.all_inst_iter_mut().for_each(|inst| { - if let Some(ref mut result_id) = &mut inst.result_id { + if let Some(result_id) = &mut inst.result_id { *result_id = insert(*result_id); } - if let Some(ref mut result_type) = &mut inst.result_type { + if let Some(result_type) = &mut inst.result_type { *result_type = insert(*result_type); } diff --git a/crates/rustc_codegen_spirv/src/linker/specializer.rs b/crates/rustc_codegen_spirv/src/linker/specializer.rs index 01c4c9f9b1..9ef949bb83 100644 --- a/crates/rustc_codegen_spirv/src/linker/specializer.rs +++ b/crates/rustc_codegen_spirv/src/linker/specializer.rs @@ -54,7 +54,6 @@ use crate::spirv_type_constraints::{self, InstSig, StorageClassPat, TyListPat, T use indexmap::{IndexMap, IndexSet}; use rspirv::dr::{Builder, Function, Instruction, Module, Operand}; use rspirv::spirv::{Op, StorageClass, Word}; -use rustc_data_structures::captures::Captures; use rustc_data_structures::fx::{FxHashMap, FxHashSet}; use smallvec::SmallVec; use std::collections::{BTreeMap, VecDeque}; @@ -624,12 +623,15 @@ impl Specializer { // Inference variables become "generic" parameters. if param_count > 0 { - self.generics.insert(result_id, Generic { - param_count, - def: inst.clone(), - param_values, - replacements, - }); + self.generics.insert( + result_id, + Generic { + param_count, + def: inst.clone(), + param_values, + replacements, + }, + ); } } } @@ -1112,7 +1114,7 @@ impl<'a> Match<'a> { fn debug_with_infer_cx<'b>( &'b self, cx: &'b InferCx<'a, impl Specialization>, - ) -> impl fmt::Debug + Captures<'a> + '_ { + ) -> impl fmt::Debug + '_ { fn debug_var_found<'a, A: smallvec::Array + 'a, T: 'a, TD: fmt::Display>( var_found: &'a SmallIntMap>>, display: &'a impl Fn(&'a T) -> TD, @@ -2102,10 +2104,13 @@ impl<'a, S: Specialization> InferCx<'a, S> { Op::Return => {} - _ => self.instantiate_instruction(inst, InstructionLocation::FnBody { - block_idx, - inst_idx, - }), + _ => self.instantiate_instruction( + inst, + InstructionLocation::FnBody { + block_idx, + inst_idx, + }, + ), } } } diff --git a/crates/rustc_codegen_spirv/src/linker/spirt_passes/controlflow.rs b/crates/rustc_codegen_spirv/src/linker/spirt_passes/controlflow.rs index 83b603c88b..76ae455e02 100644 --- a/crates/rustc_codegen_spirv/src/linker/spirt_passes/controlflow.rs +++ b/crates/rustc_codegen_spirv/src/linker/spirt_passes/controlflow.rs @@ -228,14 +228,17 @@ pub fn convert_custom_aborts_to_unstructured_returns_in_entry_points( }; let block_insts_maybe_custom = func_at_block_insts.into_iter().map(|func_at_inst| { let data_inst_def = func_at_inst.def(); - (func_at_inst, match cx[data_inst_def.form].kind { - DataInstKind::SpvExtInst { ext_set, inst } - if ext_set == custom_ext_inst_set => - { - Some(CustomOp::decode(inst).with_operands(&data_inst_def.inputs)) - } - _ => None, - }) + ( + func_at_inst, + match cx[data_inst_def.form].kind { + DataInstKind::SpvExtInst { ext_set, inst } + if ext_set == custom_ext_inst_set => + { + Some(CustomOp::decode(inst).with_operands(&data_inst_def.inputs)) + } + _ => None, + }, + ) }); let custom_terminator_inst = block_insts_maybe_custom .clone() diff --git a/crates/rustc_codegen_spirv/src/linker/spirt_passes/diagnostics.rs b/crates/rustc_codegen_spirv/src/linker/spirt_passes/diagnostics.rs index 948f14fe8e..f1688ba150 100644 --- a/crates/rustc_codegen_spirv/src/linker/spirt_passes/diagnostics.rs +++ b/crates/rustc_codegen_spirv/src/linker/spirt_passes/diagnostics.rs @@ -388,7 +388,7 @@ impl DiagnosticReporter<'_> { .use_stack .split_last() .filter( - |( + |&( &UseOrigin::Global { attrs: use_attrs, .. } diff --git a/crates/rustc_codegen_spirv/src/linker/test.rs b/crates/rustc_codegen_spirv/src/linker/test.rs index 529b4c697b..e48382c97e 100644 --- a/crates/rustc_codegen_spirv/src/linker/test.rs +++ b/crates/rustc_codegen_spirv/src/linker/test.rs @@ -66,12 +66,15 @@ fn load(bytes: &[u8]) -> Module { // FIXME(eddyb) shouldn't this be named just `link`? (`assemble_spirv` is separate) fn assemble_and_link(binaries: &[&[u8]]) -> Result { - link_with_linker_opts(binaries, &crate::linker::Options { - compact_ids: true, - dce: true, - keep_link_exports: true, - ..Default::default() - }) + link_with_linker_opts( + binaries, + &crate::linker::Options { + compact_ids: true, + dce: true, + keep_link_exports: true, + ..Default::default() + }, + ) } fn link_with_linker_opts( diff --git a/crates/rustc_codegen_spirv/src/spirv_type.rs b/crates/rustc_codegen_spirv/src/spirv_type.rs index d674f2542f..e774eff77d 100644 --- a/crates/rustc_codegen_spirv/src/spirv_type.rs +++ b/crates/rustc_codegen_spirv/src/spirv_type.rs @@ -4,11 +4,11 @@ use crate::codegen_cx::CodegenCx; use indexmap::IndexSet; use rspirv::dr::Operand; use rspirv::spirv::{Capability, Decoration, Dim, ImageFormat, StorageClass, Word}; +use rustc_abi::{Align, Size}; use rustc_data_structures::fx::FxHashMap; use rustc_middle::span_bug; use rustc_span::def_id::DefId; use rustc_span::{Span, Symbol}; -use rustc_target::abi::{Align, Size}; use std::cell::RefCell; use std::fmt; use std::iter; diff --git a/crates/rustc_codegen_spirv/src/symbols.rs b/crates/rustc_codegen_spirv/src/symbols.rs index e3d4dc2232..6c4b162434 100644 --- a/crates/rustc_codegen_spirv/src/symbols.rs +++ b/crates/rustc_codegen_spirv/src/symbols.rs @@ -1,7 +1,7 @@ use crate::attr::{Entry, ExecutionModeExtra, IntrinsicType, SpecConstant, SpirvAttribute}; use crate::builder::libm_intrinsics; use rspirv::spirv::{BuiltIn, ExecutionMode, ExecutionModel, StorageClass}; -use rustc_ast::ast::{AttrKind, Attribute, LitIntType, LitKind, MetaItemInner, MetaItemLit}; +use rustc_ast::ast::{LitIntType, LitKind, MetaItemInner, MetaItemLit}; use rustc_data_structures::fx::FxHashMap; use rustc_span::Span; use rustc_span::symbol::{Ident, Symbol}; @@ -443,20 +443,20 @@ type ParseAttrError = (Span, String); // FIXME(eddyb) maybe move this to `attr`? pub(crate) fn parse_attrs_for_checking<'a>( sym: &'a Symbols, - attrs: &'a [Attribute], + attrs: &'a [rustc_hir::Attribute], ) -> impl Iterator> + 'a { attrs.iter().flat_map(move |attr| { - let (whole_attr_error, args) = match attr.kind { - AttrKind::Normal(ref normal) => { + let (whole_attr_error, args) = match attr { + rustc_hir::Attribute::Unparsed(item) => { // #[...] - let s = &normal.item.path.segments; - if s.len() > 1 && s[0].ident.name == sym.rust_gpu { + let s = &item.path.segments; + if s.len() > 1 && s[0].name == sym.rust_gpu { // #[rust_gpu ...] - if s.len() != 2 || s[1].ident.name != sym.spirv { + if s.len() != 2 || s[1].name != sym.spirv { // #[rust_gpu::...] but not #[rust_gpu::spirv] ( Some(Err(( - attr.span, + attr.span(), "unknown `rust_gpu` attribute, expected `rust_gpu::spirv`" .to_string(), ))), @@ -469,7 +469,7 @@ pub(crate) fn parse_attrs_for_checking<'a>( // #[rust_gpu::spirv] ( Some(Err(( - attr.span, + attr.span(), "#[rust_gpu::spirv(..)] attribute must have at least one argument" .to_string(), ))), @@ -481,7 +481,10 @@ pub(crate) fn parse_attrs_for_checking<'a>( (None, Default::default()) } } - AttrKind::DocComment(..) => (None, Default::default()), // doccomment + rustc_hir::Attribute::Parsed(rustc_attr_parsing::AttributeKind::DocComment { + .. + }) => (None, Default::default()), // doccomment + _ => unreachable!(), }; whole_attr_error diff --git a/crates/spirv-std/src/arch.rs b/crates/spirv-std/src/arch.rs index 2d9ccdfded..8fbf39fa9a 100644 --- a/crates/spirv-std/src/arch.rs +++ b/crates/spirv-std/src/arch.rs @@ -270,7 +270,7 @@ impl IndexUnchecked for [T] { #[cfg(not(target_arch = "spirv"))] unsafe fn index_unchecked(&self, index: usize) -> &T { - self.get_unchecked(index) + unsafe { self.get_unchecked(index) } } #[cfg(target_arch = "spirv")] @@ -291,7 +291,7 @@ impl IndexUnchecked for [T] { #[cfg(not(target_arch = "spirv"))] unsafe fn index_unchecked_mut(&mut self, index: usize) -> &mut T { - self.get_unchecked_mut(index) + unsafe { self.get_unchecked_mut(index) } } } @@ -312,7 +312,7 @@ impl IndexUnchecked for [T; N] { #[cfg(not(target_arch = "spirv"))] unsafe fn index_unchecked(&self, index: usize) -> &T { - self.get_unchecked(index) + unsafe { self.get_unchecked(index) } } #[cfg(target_arch = "spirv")] @@ -331,6 +331,6 @@ impl IndexUnchecked for [T; N] { #[cfg(not(target_arch = "spirv"))] unsafe fn index_unchecked_mut(&mut self, index: usize) -> &mut T { - self.get_unchecked_mut(index) + unsafe { self.get_unchecked_mut(index) } } } diff --git a/crates/spirv-std/src/byte_addressable_buffer.rs b/crates/spirv-std/src/byte_addressable_buffer.rs index f4c6dba491..9c38e56560 100644 --- a/crates/spirv-std/src/byte_addressable_buffer.rs +++ b/crates/spirv-std/src/byte_addressable_buffer.rs @@ -94,7 +94,7 @@ impl<'a> ByteAddressableBuffer<&'a [u32]> { /// See [`Self`]. pub unsafe fn load(&self, byte_index: u32) -> T { bounds_check::(self.data, byte_index); - buffer_load_intrinsic(self.data, byte_index) + unsafe { buffer_load_intrinsic(self.data, byte_index) } } /// Loads an arbitrary type from the buffer. `byte_index` must be a @@ -103,7 +103,7 @@ impl<'a> ByteAddressableBuffer<&'a [u32]> { /// # Safety /// See [`Self`]. Additionally, bounds or alignment checking is not performed. pub unsafe fn load_unchecked(&self, byte_index: u32) -> T { - buffer_load_intrinsic(self.data, byte_index) + unsafe { buffer_load_intrinsic(self.data, byte_index) } } } @@ -127,7 +127,7 @@ impl<'a> ByteAddressableBuffer<&'a mut [u32]> { /// See [`Self`]. #[inline] pub unsafe fn load(&self, byte_index: u32) -> T { - self.as_ref().load(byte_index) + unsafe { self.as_ref().load(byte_index) } } /// Loads an arbitrary type from the buffer. `byte_index` must be a @@ -137,7 +137,7 @@ impl<'a> ByteAddressableBuffer<&'a mut [u32]> { /// See [`Self`]. Additionally, bounds or alignment checking is not performed. #[inline] pub unsafe fn load_unchecked(&self, byte_index: u32) -> T { - self.as_ref().load_unchecked(byte_index) + unsafe { self.as_ref().load_unchecked(byte_index) } } /// Stores an arbitrary type into the buffer. `byte_index` must be a @@ -147,7 +147,9 @@ impl<'a> ByteAddressableBuffer<&'a mut [u32]> { /// See [`Self`]. pub unsafe fn store(&mut self, byte_index: u32, value: T) { bounds_check::(self.data, byte_index); - buffer_store_intrinsic(self.data, byte_index, value); + unsafe { + buffer_store_intrinsic(self.data, byte_index, value); + } } /// Stores an arbitrary type into the buffer. `byte_index` must be a @@ -156,6 +158,8 @@ impl<'a> ByteAddressableBuffer<&'a mut [u32]> { /// # Safety /// See [`Self`]. Additionally, bounds or alignment checking is not performed. pub unsafe fn store_unchecked(&mut self, byte_index: u32, value: T) { - buffer_store_intrinsic(self.data, byte_index, value); + unsafe { + buffer_store_intrinsic(self.data, byte_index, value); + } } } diff --git a/deny.toml b/deny.toml index 66205b1108..342227c7f7 100644 --- a/deny.toml +++ b/deny.toml @@ -37,10 +37,6 @@ skip = [ { name = "cfg_aliases", version = "=0.1.1" }, { name = "cfg_aliases", version = "=0.2.1" }, - # HACK(eddyb) the newer version hasn't propagated through the ecosystem yet. - { name = "hashbrown", version = "=0.14.5" }, - { name = "hashbrown", version = "=0.15.2" }, - # HACK(eddyb) the newer version hasn't propagated through the ecosystem yet. { name = "ndk-sys", version = "=0.5.0+25.2.9519653" }, { name = "ndk-sys", version = "=0.6.0+11769913" }, @@ -52,8 +48,8 @@ skip = [ skip-tree = [ # HACK(eddyb) `jni` (an `android-activity` dep) uses older `windows-*`. { name = "jni", version = "=0.21.1", depth = 7 }, - # HACK(eddyb) `plist` (an `ash-molten` build dep) uses older `quick-xml`. - { name = "plist", version = "=1.7.0", depth = 2 }, + # HACK(LegNeato) `winit` deps use older `quick-xml`. + { name = "winit", version = "=0.30.10", depth = 7 }, # HACK(eddyb) `minifb` (an `example-runner-cpu` dep) uses older `wayland-*`. { name = "minifb", version = "=0.25.0", depth = 3 }, # HACK(eddyb) `num_cpus` (a `tester` dep) uses older `hermit-abi`. diff --git a/examples/runners/ash/src/main.rs b/examples/runners/ash/src/main.rs index 7a006574ca..e667549421 100644 --- a/examples/runners/ash/src/main.rs +++ b/examples/runners/ash/src/main.rs @@ -128,18 +128,21 @@ pub fn main() { for SpvFile { name, data } in shaders { ctx.insert_shader_module(name, &data); } - ctx.build_pipelines(vk::PipelineCache::null(), vec![( - // HACK(eddyb) used to be `module: "sky_shader"` but we need `multimodule` - // for `debugPrintf` instrumentation to work (see `compile_shaders`). - VertexShaderEntryPoint { - module: "sky_shader::main_vs".into(), - entry_point: "main_vs".into(), - }, - FragmentShaderEntryPoint { - module: "sky_shader::main_fs".into(), - entry_point: "main_fs".into(), - }, - )]); + ctx.build_pipelines( + vk::PipelineCache::null(), + vec![( + // HACK(eddyb) used to be `module: "sky_shader"` but we need `multimodule` + // for `debugPrintf` instrumentation to work (see `compile_shaders`). + VertexShaderEntryPoint { + module: "sky_shader::main_vs".into(), + entry_point: "main_vs".into(), + }, + FragmentShaderEntryPoint { + module: "sky_shader::main_fs".into(), + entry_point: "main_fs".into(), + }, + )], + ); let (compiler_sender, compiler_receiver) = sync_channel(1); diff --git a/rust-toolchain.toml b/rust-toolchain.toml index 551cee7f67..c0f8d6c5ab 100644 --- a/rust-toolchain.toml +++ b/rust-toolchain.toml @@ -1,7 +1,7 @@ [toolchain] -channel = "nightly-2024-11-22" +channel = "nightly-2025-04-28" components = ["rust-src", "rustc-dev", "llvm-tools"] -# commit_hash = b19329a37cedf2027517ae22c87cf201f93d776e +# commit_hash = cb31a009e3e735ab08613cec2d8a5a754e65596f # Whenever changing the nightly channel, update the commit hash above, and make # sure to change `REQUIRED_TOOLCHAIN` in `crates/rustc_codegen_spirv/build.rs` also. diff --git a/tests/src/main.rs b/tests/src/main.rs index 551e6eb92f..ac2d56f654 100644 --- a/tests/src/main.rs +++ b/tests/src/main.rs @@ -155,14 +155,18 @@ impl Runner { let target = format!("{SPIRV_TARGET_PREFIX}{env}"); let libs = build_deps(&self.deps_target_dir, &self.codegen_backend_path, &target); - let mut flags = test_rustc_flags(&self.codegen_backend_path, &libs, &[ - &self - .deps_target_dir - .join(DepKind::SpirvLib.target_dir_suffix(&target)), - &self - .deps_target_dir - .join(DepKind::ProcMacro.target_dir_suffix(&target)), - ]); + let mut flags = test_rustc_flags( + &self.codegen_backend_path, + &libs, + &[ + &self + .deps_target_dir + .join(DepKind::SpirvLib.target_dir_suffix(&target)), + &self + .deps_target_dir + .join(DepKind::ProcMacro.target_dir_suffix(&target)), + ], + ); flags += variation.extra_flags; let config = compiletest::Config {