diff --git a/.buildbot.config.toml b/.buildbot.config.toml index bed72399..e0b42f08 100644 --- a/.buildbot.config.toml +++ b/.buildbot.config.toml @@ -10,7 +10,6 @@ extended = false [llvm] assertions = true # Turn on assertions in LLVM. -use-linker = "gold" # Uses less memory than ld. [install] prefix = "build/rustc_boehm" diff --git a/.github/workflows/sdci.yml b/.github/workflows/sdci.yml new file mode 100644 index 00000000..f20da180 --- /dev/null +++ b/.github/workflows/sdci.yml @@ -0,0 +1,11 @@ +on: + pull_request: + merge_group: + +# This is required to silence emails about the workflow having no jobs. +# We simply define a dummy job that does nothing much. +jobs: + dummy: + runs-on: ubuntu-latest + steps: + - run: /usr/bin/true diff --git a/Cargo.lock b/Cargo.lock index 7908d72f..84502b11 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -4,24 +4,24 @@ version = 3 [[package]] name = "aho-corasick" -version = "0.7.20" +version = "1.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cc936419f96fa211c1b9166887b38e5e40b19958e5b895be7c1f93adec7071ac" +checksum = "b2969dcb958b36655471fc61f7e416fa76033bdd4bfed0678d8fee1e2d07a1f0" dependencies = [ "memchr", ] [[package]] name = "anyhow" -version = "1.0.68" +version = "1.0.75" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2cb2f989d18dd141ab8ae82f64d1a8cdd37e0840f73a406896cf5e99502fab61" +checksum = "a4668cab20f66d8d020e1fbc0ebe47217433c1b6c8f2040faf858554e394ace6" [[package]] name = "arrayvec" -version = "0.7.2" +version = "0.7.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8da52d66c7071e2e3fa2a1e5c6d088fec47b593032b254f5e980de8ea54454d6" +checksum = "96d30a06541fbafbc7f82ed10c06164cfbd2c401138f6addd8404629c4b16711" [[package]] name = "autocfg" @@ -44,11 +44,17 @@ version = "1.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" +[[package]] +name = "bitflags" +version = "2.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "327762f6e5a765692301e5bb513e0d9fef63be86bbc14528052b1cd3e6f03e07" + [[package]] name = "bstr" -version = "1.1.0" +version = "1.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b45ea9b00a7b3f2988e9a65ad3917e62123c38dba709b666506207be96d1790b" +checksum = "542f33a8835a0884b006a0c3df3dadd99c0c3f296ed26c2fdc8028e01ad6230c" dependencies = [ "memchr", "serde", @@ -68,9 +74,9 @@ checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" [[package]] name = "cfgrammar" -version = "0.13.0" +version = "0.13.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a2836ac78906e1f7c9462f161abfb843849d580775a08b62d099f0bca355c915" +checksum = "41879646bd1fbd55efdb9e2c1ac85e63856ad951e4e14b2e3086374802a13e9b" dependencies = [ "indexmap", "lazy_static", @@ -82,9 +88,9 @@ dependencies = [ [[package]] name = "dashmap" -version = "5.4.0" +version = "5.5.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "907076dfda823b0b36d2a1bb5f90c96660a5bbcd7729e10727f07858f22c4edc" +checksum = "978747c1d849a7d2ee5e8adc0159961c48fb7e5db2f06af6723b80123bb53856" dependencies = [ "cfg-if", "hashbrown", @@ -94,48 +100,43 @@ dependencies = [ ] [[package]] -name = "either" -version = "1.8.0" +name = "deranged" +version = "0.3.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "90e5c1c8368803113bf0c9584fc495a58b86dc8a29edbf8fe877d21d9507e797" +checksum = "0f32d04922c60427da6f9fef14d042d9edddef64cb9d4ce0d64d0685fbeb1fd3" +dependencies = [ + "powerfmt", +] [[package]] -name = "enum-iterator" -version = "1.2.0" +name = "either" +version = "1.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "91a4ec26efacf4aeff80887a175a419493cb6f8b5480d26387eb0bd038976187" -dependencies = [ - "enum-iterator-derive", -] +checksum = "a26ae43d7bcc3b814de94796a5e736d4029efb0ee900c12e2d54c993ad1a1e07" [[package]] -name = "enum-iterator-derive" -version = "1.1.0" +name = "equivalent" +version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "828de45d0ca18782232dfb8f3ea9cc428e8ced380eb26a520baaacfc70de39ce" -dependencies = [ - "proc-macro2 1.0.50", - "quote 1.0.23", - "syn 1.0.107", -] +checksum = "5443807d6dff69373d433ab9ef5378ad8df50ca6298caf15de6e52e24aaf54d5" [[package]] name = "filetime" -version = "0.2.19" +version = "0.2.22" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4e884668cd0c7480504233e951174ddc3b382f7c2666e3b7310b5c4e7b0c37f9" +checksum = "d4029edd3e734da6fe05b6cd7bd2960760a616bd2ddd0d59a0124746d6272af0" dependencies = [ "cfg-if", "libc", - "redox_syscall", + "redox_syscall 0.3.5", "windows-sys", ] [[package]] name = "fm" -version = "0.2.1" +version = "0.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "671381339b1671872f5725caff3a4bd05be68a0d8adf2d8a7ff6c16395bbe35a" +checksum = "21bcf4db620a804cf7e9d84fbcb5d4ac83a8c43396203b2507d62ea31814dfd4" dependencies = [ "regex", ] @@ -148,9 +149,9 @@ checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" [[package]] name = "futures" -version = "0.3.25" +version = "0.3.29" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "38390104763dc37a5145a53c29c63c1290b5d316d6086ec32c293f6736051bb0" +checksum = "da0290714b38af9b4a7b094b8a37086d1b4e61f2df9122c3cad2577669145335" dependencies = [ "futures-channel", "futures-core", @@ -163,9 +164,9 @@ dependencies = [ [[package]] name = "futures-channel" -version = "0.3.25" +version = "0.3.29" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "52ba265a92256105f45b719605a571ffe2d1f0fea3807304b522c1d778f79eed" +checksum = "ff4dd66668b557604244583e3e1e1eada8c5c2e96a6d0d6653ede395b78bbacb" dependencies = [ "futures-core", "futures-sink", @@ -173,15 +174,15 @@ dependencies = [ [[package]] name = "futures-core" -version = "0.3.25" +version = "0.3.29" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "04909a7a7e4633ae6c4a9ab280aeb86da1236243a77b694a49eacd659a4bd3ac" +checksum = "eb1d22c66e66d9d72e1758f0bd7d4fd0bee04cad842ee34587d68c07e45d088c" [[package]] name = "futures-executor" -version = "0.3.25" +version = "0.3.29" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7acc85df6714c176ab5edf386123fafe217be88c0840ec11f199441134a074e2" +checksum = "0f4fb8693db0cf099eadcca0efe2a5a22e4550f98ed16aba6c48700da29597bc" dependencies = [ "futures-core", "futures-task", @@ -190,27 +191,27 @@ dependencies = [ [[package]] name = "futures-io" -version = "0.3.25" +version = "0.3.29" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "00f5fb52a06bdcadeb54e8d3671f8888a39697dcb0b81b23b55174030427f4eb" +checksum = "8bf34a163b5c4c52d0478a4d757da8fb65cabef42ba90515efee0f6f9fa45aaa" [[package]] name = "futures-sink" -version = "0.3.25" +version = "0.3.29" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "39c15cf1a4aa79df40f1bb462fb39676d0ad9e366c2a33b590d7c66f4f81fcf9" +checksum = "e36d3378ee38c2a36ad710c5d30c2911d752cb941c00c72dbabfb786a7970817" [[package]] name = "futures-task" -version = "0.3.25" +version = "0.3.29" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2ffb393ac5d9a6eaa9d3fdf37ae2776656b706e200c8e16b1bdb227f5198e6ea" +checksum = "efd193069b0ddadc69c46389b740bbccdd97203899b48d09c5f7969591d6bae2" [[package]] name = "futures-util" -version = "0.3.25" +version = "0.3.29" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "197676987abd2f9cadff84926f410af1c183608d36641465df73ae8211dc65d6" +checksum = "a19526d624e703a3179b3d322efec918b6246ea0fa51d41124525f00f1cc8104" dependencies = [ "futures-channel", "futures-core", @@ -232,23 +233,11 @@ dependencies = [ "unicode-width", ] -[[package]] -name = "getset" -version = "0.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e45727250e75cc04ff2846a66397da8ef2b3db8e40e0cef4df67950a07621eb9" -dependencies = [ - "proc-macro-error", - "proc-macro2 1.0.50", - "quote 1.0.23", - "syn 1.0.107", -] - [[package]] name = "globset" -version = "0.4.10" +version = "0.4.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "029d74589adefde59de1a0c4f4732695c32805624aec7b68d91503d4dba79afc" +checksum = "759c97c1e17c55525b57192c06a267cda0ac5210b222d6b82189a2338fa1c13d" dependencies = [ "aho-corasick", "bstr", @@ -259,18 +248,15 @@ dependencies = [ [[package]] name = "hashbrown" -version = "0.12.3" +version = "0.14.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8a9ee70c43aaf417c914396645a0fa852624801b24ebb7ae78fe8272889ac888" +checksum = "f93e7192158dbcda357bdec5fb5788eebf8bbac027f3f33e719d29135ae84156" [[package]] name = "hermit-abi" -version = "0.2.6" +version = "0.3.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ee512640fe35acbfb4bb779db6f0d80704c2cacfa2e39b601ef3e3f47d1ae4c7" -dependencies = [ - "libc", -] +checksum = "d77f7ec81a6d05a3abb01ab6eb7590f6083d08449fe5a1c8b1e620283546ccb7" [[package]] name = "ignore" @@ -291,11 +277,11 @@ dependencies = [ [[package]] name = "indexmap" -version = "1.9.2" +version = "2.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1885e79c1fc4b10f0e172c475f458b7f7b93061064d98c3293e98c5ba0c8b399" +checksum = "d530e1a18b1cb4c484e6e34556a0d948706958449fca0cab753d649f2bce3d1f" dependencies = [ - "autocfg", + "equivalent", "hashbrown", ] @@ -310,15 +296,15 @@ dependencies = [ [[package]] name = "itoa" -version = "1.0.5" +version = "1.0.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fad582f4b9e86b6caa621cabeb0963332d92eea04729ab12892c2533951e6440" +checksum = "af150ab688ff2122fcef229be89cb50dd66af9e01a4ff320cc137eecc9bacc38" [[package]] name = "lang_tester" -version = "0.7.1" +version = "0.7.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d63df63b7380a561f2c38b0a67ebe3a24b87ff2928391d0b5f8f3cfd39fe112c" +checksum = "5f7fe9f105796d077b01479ccc498e5a88ec54600a404f82aacb6cdbd05012d8" dependencies = [ "fm", "getopts", @@ -338,15 +324,26 @@ checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" [[package]] name = "libc" -version = "0.2.139" +version = "0.2.150" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "201de327520df007757c1f0adce6e827fe8562fbc28bfd9c15571c66ca1f5f79" +checksum = "89d92a4743f9a61002fae18374ed11e7973f530cb3a3255fb354818118b2203c" + +[[package]] +name = "libredox" +version = "0.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3af92c55d7d839293953fcd0fda5ecfe93297cfde6ffbdec13b41d99c0ba6607" +dependencies = [ + "bitflags 2.4.1", + "libc", + "redox_syscall 0.4.1", +] [[package]] name = "lock_api" -version = "0.4.9" +version = "0.4.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "435011366fe56583b16cf956f9df0095b405b82d76425bc8981c0e22e60ec4df" +checksum = "3c168f8615b12bc01f9c17e2eb0cc07dcae1940121185446edc3744920e8ef45" dependencies = [ "autocfg", "scopeguard", @@ -354,36 +351,33 @@ dependencies = [ [[package]] name = "log" -version = "0.4.17" +version = "0.4.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "abb12e687cfb44aa40f41fc3978ef76448f9b6038cad6aef4259d3c095a2382e" -dependencies = [ - "cfg-if", -] +checksum = "b5e6163cb8c49088c2c36f57875e58ccd8c87c7427f7fbd50ea6710b2f3f2e8f" [[package]] name = "lrlex" -version = "0.13.0" +version = "0.13.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b5b7775c88626ab4f91de188a14deb71e4149f89efcd8ee3d1b779cad4b946d3" +checksum = "4d3c956ecfc913cb0e89575c5dd74d2558ec6e12c18f23baabc2985dc48ead28" dependencies = [ "cfgrammar", "getopts", "lazy_static", "lrpar", "num-traits", - "quote 1.0.23", + "quote 1.0.33", "regex", - "regex-syntax", + "regex-syntax 0.7.5", "serde", "vergen", ] [[package]] name = "lrpar" -version = "0.13.0" +version = "0.13.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ceec66ff63c6d3e376acab385dfbd2795ed96e0b834464ec949a51d536d2f1df" +checksum = "c3f2acdd7023dc9f0eb51b13a615477c245519f593537667116874d2c699972d" dependencies = [ "bincode", "cactus", @@ -403,9 +397,9 @@ dependencies = [ [[package]] name = "lrtable" -version = "0.13.0" +version = "0.13.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6f2e2b6439a4ba90b2d55a64bb4aa7c606485218473db67402c45829e1bbcda7" +checksum = "310933a066b41ed437844d548c5972b02b407e63a8254d08204082a05f7a1b34" dependencies = [ "cfgrammar", "fnv", @@ -417,14 +411,14 @@ dependencies = [ [[package]] name = "memchr" -version = "2.5.0" +version = "2.6.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2dffe52ecf27772e601905b7522cb4ef790d2cc203488bbd0e2fe85fcb74566d" +checksum = "f665ee40bc4a3c5590afb1e9677db74a508659dfd71e126420da8274909a0167" [[package]] name = "natrob" version = "0.1.0" -source = "git+https://github.com/softdevteam/natrob#fd99aad6dc023fd078ad033a5beca4b6a9bd021e" +source = "git+https://github.com/softdevteam/natrob#b3133f50c6072c57a83151150d57c7bd54e02c13" dependencies = [ "quote 0.6.13", "syn 0.15.44", @@ -432,9 +426,9 @@ dependencies = [ [[package]] name = "num-bigint" -version = "0.4.3" +version = "0.4.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f93ab6289c7b344a8a9f60f88d80aa20032336fe78da341afc91c8a2341fc75f" +checksum = "608e7659b5c3d7cba262d894801b9ec9d00de989e8a82bd4bef91d08da45cdc0" dependencies = [ "autocfg", "num-integer", @@ -453,18 +447,18 @@ dependencies = [ [[package]] name = "num-traits" -version = "0.2.15" +version = "0.2.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "578ede34cf02f8924ab9447f50c28075b4d3e5b269972345e7e0372b38c6cdcd" +checksum = "39e3200413f237f41ab11ad6d161bc7239c84dcb631773ccd7de3dfe4b5c267c" dependencies = [ "autocfg", ] [[package]] name = "num_cpus" -version = "1.15.0" +version = "1.16.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0fac9e2da13b5eb447a6ce3d392f23a29d8694bff781bf03a16cd9ac8697593b" +checksum = "4161fcb6d602d4d2081af7c3a45852d875a03dd337a6bfdd6e06407b61342a43" dependencies = [ "hermit-abi", "libc", @@ -472,23 +466,32 @@ dependencies = [ [[package]] name = "num_enum" -version = "0.5.7" +version = "0.5.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cf5395665662ef45796a4ff5486c5d41d29e0c09640af4c5f17fd94ee2c119c9" +checksum = "1f646caf906c20226733ed5b1374287eb97e3c2a5c227ce668c1f2ce20ae57c9" dependencies = [ "num_enum_derive", ] [[package]] name = "num_enum_derive" -version = "0.5.7" +version = "0.5.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3b0498641e53dd6ac1a4f22547548caa6864cc4933784319cd1775271c5a46ce" +checksum = "dcbff9bc912032c62bf65ef1d5aea88983b420f4f839db1e9b0c281a25c9c799" dependencies = [ "proc-macro-crate", - "proc-macro2 1.0.50", - "quote 1.0.23", - "syn 1.0.107", + "proc-macro2 1.0.69", + "quote 1.0.33", + "syn 1.0.109", +] + +[[package]] +name = "num_threads" +version = "0.1.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2819ce041d2ee131036f4fc9d6ae7ae125a3a40e97ba64d04fe799ad9dabbb44" +dependencies = [ + "libc", ] [[package]] @@ -499,9 +502,9 @@ checksum = "b8f8bdf33df195859076e54ab11ee78a1b208382d3a26ec40d142ffc1ecc49ef" [[package]] name = "once_cell" -version = "1.17.0" +version = "1.18.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6f61fba1741ea2b3d6a1e3178721804bb716a68a6aeba1149b5d52e3d464ea66" +checksum = "dd8b5dd2ae5ed71462c540258bedcb51965123ad7e7ccf4b9a8cafaa4a63576d" [[package]] name = "packedvec" @@ -525,32 +528,22 @@ dependencies = [ [[package]] name = "parking_lot_core" -version = "0.9.6" +version = "0.9.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ba1ef8814b5c993410bb3adfad7a5ed269563e4a2f90c41f5d85be7fb47133bf" +checksum = "4c42a9226546d68acdd9c0a280d17ce19bfe27a46bf68784e4066115788d008e" dependencies = [ "cfg-if", "libc", - "redox_syscall", + "redox_syscall 0.4.1", "smallvec", - "windows-sys", -] - -[[package]] -name = "pest" -version = "2.5.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4257b4a04d91f7e9e6290be5d3da4804dd5784fafde3a497d73eb2b4a158c30a" -dependencies = [ - "thiserror", - "ucd-trie", + "windows-targets", ] [[package]] name = "pin-project-lite" -version = "0.2.9" +version = "0.2.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e0a7ae3ac2f1173085d398531c705756c94a4c56843785df85a60c1a0afac116" +checksum = "8afb450f006bf6385ca15ef45d71d2288452bc3683ce2e2cacc0d18e4be60b58" [[package]] name = "pin-utils" @@ -559,38 +552,19 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184" [[package]] -name = "proc-macro-crate" -version = "1.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eda0fc3b0fb7c975631757e14d9049da17374063edb6ebbcbc54d880d4fe94e9" -dependencies = [ - "once_cell", - "thiserror", - "toml", -] - -[[package]] -name = "proc-macro-error" -version = "1.0.4" +name = "powerfmt" +version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "da25490ff9892aab3fcf7c36f08cfb902dd3e71ca0f9f9517bea02a73a5ce38c" -dependencies = [ - "proc-macro-error-attr", - "proc-macro2 1.0.50", - "quote 1.0.23", - "syn 1.0.107", - "version_check", -] +checksum = "439ee305def115ba05938db6eb1644ff94165c5ab5e9420d1c1bcedbba909391" [[package]] -name = "proc-macro-error-attr" -version = "1.0.4" +name = "proc-macro-crate" +version = "1.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a1be40180e52ecc98ad80b184934baf3d0d29f979574e439af5a55274b35f869" +checksum = "7f4c021e1093a56626774e81216a4ce732a735e5bad4868a03f3ed65ca0c3919" dependencies = [ - "proc-macro2 1.0.50", - "quote 1.0.23", - "version_check", + "once_cell", + "toml_edit", ] [[package]] @@ -604,9 +578,9 @@ dependencies = [ [[package]] name = "proc-macro2" -version = "1.0.50" +version = "1.0.69" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6ef7d57beacfaf2d8aee5937dab7b7f28de3cb8b1828479bb5de2a7106f2bae2" +checksum = "134c189feb4956b20f6f547d2cf727d4c0fe06722b20a0eec87ed445a97f92da" dependencies = [ "unicode-ident", ] @@ -622,47 +596,71 @@ dependencies = [ [[package]] name = "quote" -version = "1.0.23" +version = "1.0.33" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8856d8364d252a14d474036ea1358d63c9e6965c8e5c1885c18f73d70bff9c7b" +checksum = "5267fca4496028628a95160fc423a33e8b2e6af8a5302579e322e4b520293cae" dependencies = [ - "proc-macro2 1.0.50", + "proc-macro2 1.0.69", ] [[package]] name = "redox_syscall" -version = "0.2.16" +version = "0.3.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fb5a58c1855b4b6819d59012155603f0b22ad30cad752600aadfcb695265519a" +checksum = "567664f262709473930a4bf9e51bf2ebf3348f2e748ccc50dea20646858f8f29" dependencies = [ - "bitflags", + "bitflags 1.3.2", ] [[package]] -name = "redox_termios" -version = "0.1.2" +name = "redox_syscall" +version = "0.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8440d8acb4fd3d277125b4bd01a6f38aee8d814b3b5fc09b3f2b825d37d3fe8f" +checksum = "4722d768eff46b75989dd134e5c353f0d6296e5aaa3132e776cbdb56be7731aa" dependencies = [ - "redox_syscall", + "bitflags 1.3.2", ] +[[package]] +name = "redox_termios" +version = "0.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "20145670ba436b55d91fc92d25e71160fbfbdd57831631c8d7d36377a476f1cb" + [[package]] name = "regex" -version = "1.7.1" +version = "1.10.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "380b951a9c5e80ddfd6136919eef32310721aa4aacd4889a8d39124b026ab343" +dependencies = [ + "aho-corasick", + "memchr", + "regex-automata", + "regex-syntax 0.8.2", +] + +[[package]] +name = "regex-automata" +version = "0.4.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "48aaa5748ba571fb95cd2c85c09f629215d3a6ece942baa100950af03a34f733" +checksum = "5f804c7828047e88b2d32e2d7fe5a105da8ee3264f01902f796c8e067dc2483f" dependencies = [ "aho-corasick", "memchr", - "regex-syntax", + "regex-syntax 0.8.2", ] [[package]] name = "regex-syntax" -version = "0.6.28" +version = "0.7.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "456c603be3e8d448b072f410900c09faf164fbce2d480456f50eea6e25f9c848" +checksum = "dbb5fb1acd8a1a18b3dd5be62d25485eb770e05afb408a9627d14d451bae12da" + +[[package]] +name = "regex-syntax" +version = "0.8.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c08c74e62047bb2de4ff487b251e4a92e24f48745648451635cec7d591162d9f" [[package]] name = "rerun_except" @@ -675,24 +673,24 @@ dependencies = [ [[package]] name = "rustc_version" -version = "0.3.3" +version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f0dfe2087c51c460008730de8b57e6a320782fbfb312e1f4d520e6c6fae155ee" +checksum = "bfa0f585226d2e68097d4f95d113b15b83a82e819ab25717ec0590d9584ef366" dependencies = [ "semver", ] [[package]] name = "rustversion" -version = "1.0.11" +version = "1.0.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5583e89e108996506031660fe09baa5011b9dd0341b89029313006d1fb508d70" +checksum = "7ffc183a10b4478d04cbbbfc96d0873219d962dd5accaff2ffbd4ceb7df837f4" [[package]] name = "ryu" -version = "1.0.12" +version = "1.0.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7b4b9743ed687d4b4bcedf9ff5eaa7398495ae14e61cba0a295704edbc7decde" +checksum = "1ad4cc8da4ef723ed60bced201181d83791ad433213d8c24efffda1eec85d741" [[package]] name = "same-file" @@ -705,46 +703,34 @@ dependencies = [ [[package]] name = "scopeguard" -version = "1.1.0" +version = "1.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d29ab0c6d3fc0ee92fe66e2d99f700eab17a8d57d1c1d3b748380fb20baa78cd" +checksum = "94143f37725109f92c262ed2cf5e59bce7498c01bcc1502d7b9afe439a4e9f49" [[package]] name = "semver" -version = "0.11.0" +version = "1.0.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f301af10236f6df4160f7c3f04eec6dbc70ace82d23326abad5edee88801c6b6" -dependencies = [ - "semver-parser", -] - -[[package]] -name = "semver-parser" -version = "0.10.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "00b0bef5b7f9e0df16536d3961cfb6e84331c065b4066afb39768d0e319411f7" -dependencies = [ - "pest", -] +checksum = "836fa6a3e1e547f9a2c4040802ec865b5d85f4014efe00555d7090a3dcaa1090" [[package]] name = "serde" -version = "1.0.152" +version = "1.0.192" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bb7d1f0d3021d347a83e556fc4683dea2ea09d87bccdf88ff5c12545d89d5efb" +checksum = "bca2a08484b285dcb282d0f67b26cadc0df8b19f8c12502c13d966bf9482f001" dependencies = [ "serde_derive", ] [[package]] name = "serde_derive" -version = "1.0.152" +version = "1.0.192" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "af487d118eecd09402d70a5d72551860e788df87b464af30e5ea6a38c75c541e" +checksum = "d6c7207fbec9faa48073f3e3074cbe553af6ea512d7c21ba46e434e70ea9fbc1" dependencies = [ - "proc-macro2 1.0.50", - "quote 1.0.23", - "syn 1.0.107", + "proc-macro2 1.0.69", + "quote 1.0.33", + "syn 2.0.39", ] [[package]] @@ -767,25 +753,25 @@ version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "079a83df15f85d89a68d64ae1238f142f172b1fa915d0d76b26a7cba1b659a69" dependencies = [ - "proc-macro2 1.0.50", - "quote 1.0.23", - "syn 1.0.107", + "proc-macro2 1.0.69", + "quote 1.0.33", + "syn 1.0.109", ] [[package]] name = "slab" -version = "0.4.7" +version = "0.4.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4614a76b2a8be0058caa9dbbaf66d988527d86d003c11a94fbd335d7661edcef" +checksum = "8f92a496fb766b417c996b9c5e57daf2f7ad3b0bebe1ccfca4856390e3d3bb67" dependencies = [ "autocfg", ] [[package]] name = "smallvec" -version = "1.10.0" +version = "1.11.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a507befe795404456341dfab10cef66ead4c041f62b8b11bbb92bffe5d0953e0" +checksum = "4dccd0940a2dcdf68d092b8cbab7dc0ad8fa938bf95787e1b916b0e3d0e8e970" [[package]] name = "smartstring" @@ -829,62 +815,54 @@ dependencies = [ [[package]] name = "syn" -version = "1.0.107" +version = "1.0.109" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1f4064b5b16e03ae50984a5a8ed5d4f8803e6bc1fd170a3cda91a1be4b18e3f5" +checksum = "72b64191b275b66ffe2469e8af2c1cfe3bafa67b529ead792a6d0160888b4237" dependencies = [ - "proc-macro2 1.0.50", - "quote 1.0.23", + "proc-macro2 1.0.69", + "quote 1.0.33", + "unicode-ident", +] + +[[package]] +name = "syn" +version = "2.0.39" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "23e78b90f2fcf45d3e842032ce32e3f2d1545ba6636271dcbf24fa306d87be7a" +dependencies = [ + "proc-macro2 1.0.69", + "quote 1.0.33", "unicode-ident", ] [[package]] name = "termcolor" -version = "1.2.0" +version = "1.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "be55cf8942feac5c765c2c993422806843c9a9a45d4d5c407ad6dd2ea95eb9b6" +checksum = "6093bad37da69aab9d123a8091e4be0aa4a03e4d601ec641c327398315f62b64" dependencies = [ "winapi-util", ] [[package]] name = "termion" -version = "2.0.1" +version = "2.0.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "659c1f379f3408c7e5e84c7d0da6d93404e3800b6b9d063ba24436419302ec90" +checksum = "c4648c7def6f2043b2568617b9f9b75eae88ca185dbc1f1fda30e95a85d49d7d" dependencies = [ "libc", + "libredox", "numtoa", - "redox_syscall", "redox_termios", ] -[[package]] -name = "thiserror" -version = "1.0.38" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6a9cd18aa97d5c45c6603caea1da6628790b37f7a34b6ca89522331c5180fed0" -dependencies = [ - "thiserror-impl", -] - -[[package]] -name = "thiserror-impl" -version = "1.0.38" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1fb327af4685e4d03fa8cbcf1716380da910eeb2bb8be417e7f9fd3fb164f36f" -dependencies = [ - "proc-macro2 1.0.50", - "quote 1.0.23", - "syn 1.0.107", -] - [[package]] name = "thread_local" -version = "1.1.4" +version = "1.1.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5516c27b78311c50bf42c071425c560ac799b11c30b31f87e3081965fe5e0180" +checksum = "3fdd6f064ccff2d6567adcb3873ca630700f00b5ad3f060c25b5dcfd9a4ce152" dependencies = [ + "cfg-if", "once_cell", ] @@ -899,11 +877,15 @@ dependencies = [ [[package]] name = "time" -version = "0.3.17" +version = "0.3.30" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a561bf4617eebd33bca6434b988f39ed798e527f51a1e797d0ee4f61c0a38376" +checksum = "c4a34ab300f2dee6e562c10a046fc05e358b29f9bf92277f30c3c8d82275f6f5" dependencies = [ + "deranged", "itoa", + "libc", + "num_threads", + "powerfmt", "serde", "time-core", "time-macros", @@ -911,45 +893,47 @@ dependencies = [ [[package]] name = "time-core" -version = "0.1.0" +version = "0.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2e153e1f1acaef8acc537e68b44906d2db6436e2b35ac2c6b42640fff91f00fd" +checksum = "ef927ca75afb808a4d64dd374f00a2adf8d0fcff8e7b184af886c3c87ec4a3f3" [[package]] name = "time-macros" -version = "0.2.6" +version = "0.2.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d967f99f534ca7e495c575c62638eebc2898a8c84c119b89e250477bc4ba16b2" +checksum = "4ad70d68dba9e1f8aceda7aa6711965dfec1cac869f311a51bd08b3a2ccbce20" dependencies = [ "time-core", ] [[package]] -name = "toml" -version = "0.5.10" +name = "toml_datetime" +version = "0.6.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1333c76748e868a4d9d1017b5ab53171dfd095f70c712fdb4653a406547f598f" -dependencies = [ - "serde", -] +checksum = "3550f4e9685620ac18a50ed434eb3aec30db8ba93b0287467bca5826ea25baf1" [[package]] -name = "ucd-trie" -version = "0.1.5" +name = "toml_edit" +version = "0.19.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9e79c4d996edb816c91e4308506774452e55e95c3c9de07b6729e17e15a5ef81" +checksum = "1b5bb770da30e5cbfde35a2d7b9b8a2c4b8ef89548a7a6aeab5c9a576e3e7421" +dependencies = [ + "indexmap", + "toml_datetime", + "winnow", +] [[package]] name = "unicode-ident" -version = "1.0.6" +version = "1.0.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "84a22b9f218b40614adcb3f4ff08b703773ad44fa9423e4e0d346d5db86e4ebc" +checksum = "3354b9ac3fae1ff6755cb6db53683adb661634f67557942dea4facebec0fee4b" [[package]] name = "unicode-width" -version = "0.1.10" +version = "0.1.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c0edd1e5b14653f783770bce4a4dabb4a5108a5370a5f5d8cfe8710c361f6c8b" +checksum = "e51733f11c9c4f72aa0c160008246859e340b00807569a0da0e7a1079b27ba85" [[package]] name = "unicode-xid" @@ -959,16 +943,12 @@ checksum = "fc72304796d0818e357ead4e000d19c9c174ab23dc11093ac919054d20a6a7fc" [[package]] name = "vergen" -version = "7.5.0" +version = "8.2.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "571b69f690c855821462709b6f41d42ceccc316fbd17b60bd06d06928cfe6a99" +checksum = "1290fd64cc4e7d3c9b07d7f333ce0ce0007253e32870e632624835cc80b83939" dependencies = [ "anyhow", - "cfg-if", - "enum-iterator", - "getset", "rustversion", - "thiserror", "time", ] @@ -980,9 +960,9 @@ checksum = "49874b5167b65d7193b8aba1567f5c7d93d001cafc34600cee003eda787e483f" [[package]] name = "vob" -version = "3.0.2" +version = "3.0.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cbdb3eee5dd38a27129832bca4a3171888e699a6ac36de86547975466997986f" +checksum = "c058f4c41e71a043c67744cb76dcc1ae63ece328c1732a72489ccccc2dec23e6" dependencies = [ "num-traits", "rustc_version", @@ -1000,12 +980,11 @@ dependencies = [ [[package]] name = "walkdir" -version = "2.3.2" +version = "2.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "808cf2735cd4b6866113f648b791c6adc5714537bc222d9347bb203386ffda56" +checksum = "d71d857dc86794ca4c280d616f7da00d2dbfd8cd788846559a6813e6aa4b54ee" dependencies = [ "same-file", - "winapi", "winapi-util", ] @@ -1027,9 +1006,9 @@ checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" [[package]] name = "winapi-util" -version = "0.1.5" +version = "0.1.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "70ec6ce85bb158151cae5e5c87f95a8e97d2c0c4b001223f33a334e3ce5de178" +checksum = "f29e6f9198ba0d26b4c9f07dbe6f9ed633e1f3d5b8b414090084349e46a52596" dependencies = [ "winapi", ] @@ -1042,9 +1021,18 @@ checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" [[package]] name = "windows-sys" -version = "0.42.0" +version = "0.48.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "677d2418bec65e3338edb076e806bc1ec15693c5d0104683f2efe857f61056a9" +dependencies = [ + "windows-targets", +] + +[[package]] +name = "windows-targets" +version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5a3e1820f08b8513f676f7ab6c1f99ff312fb97b553d30ff4dd86f9f15728aa7" +checksum = "9a2fa6e2155d7247be68c096456083145c183cbbbc2764150dda45a87197940c" dependencies = [ "windows_aarch64_gnullvm", "windows_aarch64_msvc", @@ -1057,45 +1045,54 @@ dependencies = [ [[package]] name = "windows_aarch64_gnullvm" -version = "0.42.1" +version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8c9864e83243fdec7fc9c5444389dcbbfd258f745e7853198f365e3c4968a608" +checksum = "2b38e32f0abccf9987a4e3079dfb67dcd799fb61361e53e2882c3cbaf0d905d8" [[package]] name = "windows_aarch64_msvc" -version = "0.42.1" +version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4c8b1b673ffc16c47a9ff48570a9d85e25d265735c503681332589af6253c6c7" +checksum = "dc35310971f3b2dbbf3f0690a219f40e2d9afcf64f9ab7cc1be722937c26b4bc" [[package]] name = "windows_i686_gnu" -version = "0.42.1" +version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "de3887528ad530ba7bdbb1faa8275ec7a1155a45ffa57c37993960277145d640" +checksum = "a75915e7def60c94dcef72200b9a8e58e5091744960da64ec734a6c6e9b3743e" [[package]] name = "windows_i686_msvc" -version = "0.42.1" +version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bf4d1122317eddd6ff351aa852118a2418ad4214e6613a50e0191f7004372605" +checksum = "8f55c233f70c4b27f66c523580f78f1004e8b5a8b659e05a4eb49d4166cca406" [[package]] name = "windows_x86_64_gnu" -version = "0.42.1" +version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c1040f221285e17ebccbc2591ffdc2d44ee1f9186324dd3e84e99ac68d699c45" +checksum = "53d40abd2583d23e4718fddf1ebec84dbff8381c07cae67ff7768bbf19c6718e" [[package]] name = "windows_x86_64_gnullvm" -version = "0.42.1" +version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "628bfdf232daa22b0d64fdb62b09fcc36bb01f05a3939e20ab73aaf9470d0463" +checksum = "0b7b52767868a23d5bab768e390dc5f5c55825b6d30b86c844ff2dc7414044cc" [[package]] name = "windows_x86_64_msvc" -version = "0.42.1" +version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "447660ad36a13288b1db4d4248e857b510e8c3a225c822ba4fb748c0aafecffd" +checksum = "ed94fce61571a4006852b7389a063ab983c02eb1bb37b47f8272ce92d06d9538" + +[[package]] +name = "winnow" +version = "0.5.19" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "829846f3e3db426d4cee4510841b71a8e58aa2a76b1132579487ae430ccd9c7b" +dependencies = [ + "memchr", +] [[package]] name = "yksom" diff --git a/bors.toml b/bors.toml deleted file mode 100644 index 2084ca33..00000000 --- a/bors.toml +++ /dev/null @@ -1,8 +0,0 @@ -status = ["buildbot/buildbot-build-script"] - -timeout_sec = 1800 # 30 minutes - -# Have bors delete auto-merged branches -delete_merged_branches = true - -cut_body_after = "" diff --git a/src/lib/compiler/ast_to_instrs.rs b/src/lib/compiler/ast_to_instrs.rs index 60ff93ac..b462c587 100644 --- a/src/lib/compiler/ast_to_instrs.rs +++ b/src/lib/compiler/ast_to_instrs.rs @@ -8,7 +8,7 @@ use itertools::Itertools; use lrlex::{DefaultLexerTypes, LRNonStreamingLexer}; use lrpar::{NonStreamingLexer, Span}; use num_bigint::BigInt; -use smartstring::alias::String as SmartString; + use std::gc::{Gc, NonFinalizable}; use crate::{ @@ -31,10 +31,10 @@ const CLOSURE_RETURN_VAR: &str = "$$closurereturn$$"; pub struct Compiler<'a, 'input> { lexer: &'a LRNonStreamingLexer<'a, 'input, DefaultLexerTypes>, path: &'a Path, - upvars_stack: Vec>, + upvars_stack: Vec>, /// The stack of local variables at the current point of evaluation. Maps variable names to /// `(captured, var idx)`. - locals_stack: Vec>, + locals_stack: Vec>, blocks_stack: Vec>>, /// Since SOM's "^" operator returns from the enclosed method, we need to track whether we are /// in a closure -- and, if so, how many nested closures we are inside at the current point of @@ -58,7 +58,7 @@ impl<'a, 'input> Compiler<'a, 'input> { lexer: &LRNonStreamingLexer>, path: &Path, astcls: &ast::Class, - ) -> Result<(SmartString, Val), String> { + ) -> Result<(String, Val), String> { let mut compiler = Compiler { lexer, path, @@ -68,7 +68,7 @@ impl<'a, 'input> Compiler<'a, 'input> { closure_depth: 0, }; - let name = SmartString::from(lexer.span_str(astcls.name)); + let name = String::from(lexer.span_str(astcls.name)); let (supercls_val, supercls_meta_val) = if name.as_str() != "Object" { let supercls_val = if let Some(n) = astcls.supername.map(|x| lexer.span_str(x)) { match vm.load_class(n) { @@ -159,7 +159,7 @@ impl<'a, 'input> Compiler<'a, 'input> { &mut self, vm: &mut VM, lexer: &'a LRNonStreamingLexer>, - name: SmartString, + name: String, supercls_val: Val, ast_inst_vars: &[Span], ast_methods: &[ast::Method], @@ -190,7 +190,7 @@ impl<'a, 'input> Compiler<'a, 'input> { }; for var in ast_inst_vars { let vars_len = inst_vars.len(); - let n = SmartString::from(lexer.span_str(*var)); + let n = String::from(lexer.span_str(*var)); match inst_vars.entry(n) { hash_map::Entry::Occupied(_) => { return Err(vec![( @@ -233,7 +233,7 @@ impl<'a, 'input> Compiler<'a, 'input> { let inst_vars_map = self.locals_stack[0] .iter() .map(|(k, v)| (k.clone(), v.1)) - .collect::>(); + .collect::>(); self.locals_stack.pop(); if !errs.is_empty() { return Err(errs); @@ -257,27 +257,21 @@ impl<'a, 'input> Compiler<'a, 'input> { Ok(cls_val) } - fn c_method( - &mut self, - vm: &mut VM, - astmeth: &ast::Method, - ) -> CompileResult<(SmartString, Val)> { + fn c_method(&mut self, vm: &mut VM, astmeth: &ast::Method) -> CompileResult<(String, Val)> { let (name, args) = match astmeth.name { ast::MethodName::BinaryOp(op, arg) => { let arg_v = match arg { Some(l) => vec![l], None => vec![], }; - ((op, SmartString::from(self.lexer.span_str(op))), arg_v) - } - ast::MethodName::Id(span) => { - ((span, SmartString::from(self.lexer.span_str(span))), vec![]) + ((op, String::from(self.lexer.span_str(op))), arg_v) } + ast::MethodName::Id(span) => ((span, String::from(self.lexer.span_str(span))), vec![]), ast::MethodName::Keywords(ref pairs) => { let name = pairs .iter() .map(|x| self.lexer.span_str(x.0)) - .collect::(); + .collect::(); let args = pairs.iter().map(|x| x.1).collect::>(); ((pairs[0].0, name), args) } @@ -444,10 +438,10 @@ impl<'a, 'input> Compiler<'a, 'input> { ) -> CompileResult<(usize, Vec>, Vec)> { self.upvars_stack.push(Vec::new()); let mut vars = HashMap::new(); - vars.insert(SmartString::from("self"), (false, 0)); + vars.insert(String::from("self"), (false, 0)); let mut process_var = |var_sp: Span| { let vars_len = vars.len(); - let var_str = SmartString::from(self.lexer.span_str(var_sp)); + let var_str = String::from(self.lexer.span_str(var_sp)); match vars.entry(var_str.clone()) { hash_map::Entry::Occupied(_) => Err(vec![( var_sp, @@ -542,7 +536,7 @@ impl<'a, 'input> Compiler<'a, 'input> { ast::Expr::BinaryMsg { span, lhs, op, rhs } => { let mut stack_size = self.c_expr(vm, lhs)?; stack_size = max(stack_size, 1 + self.c_expr(vm, rhs)?); - let send_off = vm.add_send((SmartString::from(self.lexer.span_str(*op)), 1)); + let send_off = vm.add_send((String::from(self.lexer.span_str(*op)), 1)); let instr = match lhs { box ast::Expr::UnaryMsg { receiver: box ast::Expr::VarLookup(span2), @@ -640,7 +634,7 @@ impl<'a, 'input> Compiler<'a, 'input> { msglist, } => { let mut max_stack = self.c_expr(vm, receiver)?; - let mut mn = SmartString::new(); + let mut mn = String::new(); for (i, (kw, expr)) in msglist.iter().enumerate() { mn.push_str(self.lexer.span_str(*kw)); let expr_stack = self.c_expr(vm, expr)?; @@ -668,7 +662,7 @@ impl<'a, 'input> Compiler<'a, 'input> { } => { let max_stack = self.c_expr(vm, receiver)?; for (i, id) in ids.iter().enumerate() { - let send_off = vm.add_send((SmartString::from(self.lexer.span_str(*id)), 0)); + let send_off = vm.add_send((String::from(self.lexer.span_str(*id)), 0)); let instr = match receiver { box ast::Expr::VarLookup(span) if i == 0 && self.lexer.span_str(*span) == "super" => @@ -697,7 +691,7 @@ impl<'a, 'input> Compiler<'a, 'input> { // "self" as an upvalue. let locals_stack_len = self.locals_stack[1].len(); self.locals_stack[1] - .entry(SmartString::from(CLOSURE_RETURN_VAR)) + .entry(String::from(CLOSURE_RETURN_VAR)) .or_insert((false, locals_stack_len)); match self.find_var_name(CLOSURE_RETURN_VAR) { VarLookup::UpVar(upidx) => { @@ -711,7 +705,7 @@ impl<'a, 'input> Compiler<'a, 'input> { } ast::Expr::String(span) => { let s_orig = self.lexer.span_str(*span); - let mut new_s = SmartString::new(); + let mut new_s = String::new(); // Start by ignoring the beginning quote. let mut i = '\"'.len_utf8(); // End by ignoring the beginning quote. @@ -752,13 +746,13 @@ impl<'a, 'input> Compiler<'a, 'input> { // XXX are there string escaping rules we need to take account of? let s_orig = self.lexer.span_str(*span); // Strip off the beginning/end quotes. - let s = SmartString::from(&s_orig[1..s_orig.len() - 1]); + let s = String::from(&s_orig[1..s_orig.len() - 1]); let instr = Instr::Symbol(vm.add_symbol(s)); vm.instrs_push(instr, *span); Ok(1) } ast::Expr::Symbol(span) => { - let s = SmartString::from(self.lexer.span_str(*span)); + let s = String::from(self.lexer.span_str(*span)); let instr = Instr::Symbol(vm.add_symbol(s)); vm.instrs_push(instr, *span); Ok(1) @@ -814,7 +808,7 @@ impl<'a, 'input> Compiler<'a, 'input> { e.1 }; self.upvars_stack[depth + 1].push(( - SmartString::from(name), + String::from(name), UpVarDef { capture_local: true, upidx, @@ -828,7 +822,7 @@ impl<'a, 'input> Compiler<'a, 'input> { let mut upidx = i; for j in depth + 1..self.upvars_stack.len() { self.upvars_stack[j].push(( - SmartString::from(name), + String::from(name), UpVarDef { capture_local: false, upidx, diff --git a/src/lib/vm/core.rs b/src/lib/vm/core.rs index 54c532e1..c2c406eb 100644 --- a/src/lib/vm/core.rs +++ b/src/lib/vm/core.rs @@ -13,7 +13,7 @@ use std::{ use lrpar::Span; use num_bigint::BigInt; -use smartstring::alias::String as SmartString; + use static_assertions::const_assert; use std::gc::Gc; @@ -78,24 +78,24 @@ pub struct VM { /// The current known set of globals including those not yet assigned to: in other words, it is /// expected that some entries of this `Vec` are illegal (i.e. created by `Val::illegal`). globals: Vec, - reverse_globals: HashMap, + reverse_globals: HashMap, inline_caches: Vec)>>, /// `instrs` and `instr_span`s are always the same length: they are separated only because we /// rarely access `instr_spans`. instrs: Vec, instr_spans: Vec, - sends: Vec<(Gc, usize)>, + sends: Vec<(Gc, usize)>, /// reverse_sends is an optimisation allowing us to reuse sends: it maps a send `(String, /// usize)` to a `usize` where the latter represents the index of the send in `sends`. - reverse_sends: HashMap<(Gc, usize), usize>, + reverse_sends: HashMap<(Gc, usize), usize>, stack: Gc, arbints: Vec, strings: Vec, /// reverse_strings is an optimisation allowing us to reuse strings: it maps a `String to a /// `usize` where the latter represents the index of the string in `strings`. - reverse_strings: HashMap, + reverse_strings: HashMap, symbols: Vec, - reverse_symbols: HashMap, + reverse_symbols: HashMap, time_at_start: Instant, open_upvars: Option>, } @@ -850,7 +850,7 @@ impl VM { Err(_) => { return SendReturn::Err(VMError::new( self, - VMErrorKind::InvalidInteger(SmartString::from(s)), + VMErrorKind::InvalidInteger(String::from(s)), )) } }, @@ -861,7 +861,7 @@ impl VM { Err(_) => { return SendReturn::Err(VMError::new( self, - VMErrorKind::InvalidDouble(SmartString::from(s)), + VMErrorKind::InvalidDouble(String::from(s)), )) } } @@ -1061,7 +1061,7 @@ impl VM { let path = PathBuf::from(stry!(path_val.downcast::(self)).as_str()); match read_to_string(path) { Ok(s) => { - let v = String_::new_str(self, SmartString::from(s)); + let v = String_::new_str(self, String::from(s)); self.stack.push(v); } Err(_) => self.stack.push(self.nil), @@ -1408,7 +1408,7 @@ impl VM { /// Add the send `send` to the VM, returning its index. Note that sends are reused, so indexes /// are also reused. - pub fn add_send(&mut self, send: (SmartString, usize)) -> usize { + pub fn add_send(&mut self, send: (String, usize)) -> usize { // We want to avoid `clone`ing `send` in the (hopefully common) case of a cache hit, hence // this slightly laborious dance and double-lookup. let send = (Gc::new(send.0), send.1); @@ -1432,7 +1432,7 @@ impl VM { /// Add the string `s` to the VM, returning its index. Note that strings are reused, so indexes /// are also reused. - pub fn add_string(&mut self, s: SmartString) -> usize { + pub fn add_string(&mut self, s: String) -> usize { // We want to avoid `clone`ing `s` in the (hopefully common) case of a cache hit, hence // this slightly laborious dance and double-lookup. if let Some(i) = self.reverse_strings.get(&s) { @@ -1448,7 +1448,7 @@ impl VM { /// Add the symbol `s` to the VM, returning its index. Note that symbols are reused, so indexes /// are also reused. - pub fn add_symbol(&mut self, s: SmartString) -> usize { + pub fn add_symbol(&mut self, s: String) -> usize { // We want to avoid `clone`ing `s` in the (hopefully common) case of a cache hit, hence // this slightly laborious dance and double-lookup. if let Some(i) = self.reverse_symbols.get(&s) { @@ -1469,7 +1469,7 @@ impl VM { *i } else { let len = self.globals.len(); - self.reverse_globals.insert(SmartString::from(s), len); + self.reverse_globals.insert(String::from(s), len); self.globals.push(Val::illegal()); len } @@ -1516,7 +1516,7 @@ impl VM { self.globals[*i] = v; } else { self.reverse_globals - .insert(SmartString::from(name), self.globals.len()); + .insert(String::from(name), self.globals.len()); self.globals.push(v); } } diff --git a/src/lib/vm/error.rs b/src/lib/vm/error.rs index df78825e..78b26caf 100644 --- a/src/lib/vm/error.rs +++ b/src/lib/vm/error.rs @@ -1,7 +1,7 @@ use std::{fs::read_to_string, io::stderr}; use lrpar::Span; -use smartstring::alias::String as SmartString; + use std::gc::Gc; use termion::{is_tty, style}; @@ -163,9 +163,9 @@ pub enum VMErrorKind { got_cls: Val, }, /// Tried to convert an invalid string to a Double. - InvalidDouble(SmartString), + InvalidDouble(String), /// Tried to convert an invalid string to an Integer. - InvalidInteger(SmartString), + InvalidInteger(String), /// Tried to access a global before it being initialised. InvalidSymbol, /// Tried to do a shl or shr with a value below zero. @@ -182,7 +182,7 @@ pub enum VMErrorKind { /// Tried to do a shl that would overflow memory and/or not fit in the required integer size. ShiftTooBig, /// An unknown global. - UnknownGlobal(SmartString), + UnknownGlobal(String), /// An unknown method. UnknownMethod, /// Tried calling a method with the wrong number of arguments. diff --git a/src/lib/vm/objects/block.rs b/src/lib/vm/objects/block.rs index 96cb356f..bb64dc59 100644 --- a/src/lib/vm/objects/block.rs +++ b/src/lib/vm/objects/block.rs @@ -74,10 +74,15 @@ pub struct Block { pub method_stack_base: usize, } -// By default, `Block` is not `FinalizerSafe` because it has fields to other -// `Gc`s. These fields would be unsound to access inside a `drop` method, so -// this explicit impl is needed to tell the compiler we are not doing that. +// The following impls are needed to allow the GC to finalise `Block`. By +// default, `Block` is not `FinalizerSafe` because it has fields to other `Gc`s. +// These fields would be unsound to access inside a `drop` method, so this +// explicit impl is needed to tell the compiler we are not doing that. The only +// time a `Block` is shared between threads is inside a finaliser, which is +// Sync-safe because we guarantee it will not be accessed at the same time as +// the main-thread. unsafe impl FinalizerSafe for Block {} +unsafe impl Sync for Block {} impl Obj for Block { fn dyn_objtype(self: Gc) -> ObjType { diff --git a/src/lib/vm/objects/class.rs b/src/lib/vm/objects/class.rs index 7944b34f..f44e74f8 100644 --- a/src/lib/vm/objects/class.rs +++ b/src/lib/vm/objects/class.rs @@ -8,7 +8,6 @@ use std::{ str, }; -use smartstring::alias::String as SmartString; use std::gc::{Gc, NonFinalizable}; use crate::vm::{ @@ -26,14 +25,14 @@ pub struct Class { /// Offset to this class's instructions in VM::instrs. pub instrs_off: usize, supercls: Cell, - pub inst_vars_map: NonFinalizable>, + pub inst_vars_map: NonFinalizable>, /// A SOM Array of methods (though note that it is *not* guaranteed that these definitely point /// to SOM `Method` instances -- anything can be stored in this array!). methods: Val, /// A map from method names to indexes into the methods SOM Array. Note that indexes are stored /// with SOM indexing (starting from 1). We guarantee that the indexes are valid indexes for /// the `methods` array. - methods_map: NonFinalizable>, + methods_map: NonFinalizable>, inst_vars: UnsafeCell>, } @@ -42,6 +41,7 @@ pub struct Class { // thread, it is guaranteed that the finalizer thread will be the only thread // accessing its data. unsafe impl FinalizerSafe for Class {} +unsafe impl Sync for Class {} impl Obj for Class { fn dyn_objtype(self: Gc) -> ObjType { @@ -93,9 +93,9 @@ impl Class { path: PathBuf, instrs_off: usize, supercls: Val, - inst_vars_map: NonFinalizable>, + inst_vars_map: NonFinalizable>, methods: Val, - methods_map: NonFinalizable>, + methods_map: NonFinalizable>, ) -> Val { #[cfg(debug_assertions)] { diff --git a/src/lib/vm/objects/double.rs b/src/lib/vm/objects/double.rs index 75b24d0d..0ff06ff9 100644 --- a/src/lib/vm/objects/double.rs +++ b/src/lib/vm/objects/double.rs @@ -4,7 +4,7 @@ use std::{collections::hash_map::DefaultHasher, hash::Hasher}; use num_bigint::BigInt; use num_traits::{FromPrimitive, ToPrimitive, Zero}; -use smartstring::alias::String as SmartString; + use std::gc::Gc; use crate::vm::{ @@ -33,10 +33,7 @@ impl Obj for Double { fn to_strval(self: Gc, vm: &mut VM) -> Result> { let mut buf = ryu::Buffer::new(); - Ok(String_::new_str( - vm, - SmartString::from(buf.format(self.val)), - )) + Ok(String_::new_str(vm, String::from(buf.format(self.val)))) } fn hashcode(self: Gc) -> u64 { diff --git a/src/lib/vm/objects/method.rs b/src/lib/vm/objects/method.rs index f5cf7b3d..abdf4ebe 100644 --- a/src/lib/vm/objects/method.rs +++ b/src/lib/vm/objects/method.rs @@ -22,6 +22,7 @@ pub struct Method { // method. This explicit impl is needed to tell the compiler we are not doing // that. unsafe impl FinalizerSafe for Method {} +unsafe impl Sync for Method {} impl Obj for Method { fn dyn_objtype(self: Gc) -> ObjType { diff --git a/src/lib/vm/objects/mod.rs b/src/lib/vm/objects/mod.rs index c1e5033d..0015c9b4 100644 --- a/src/lib/vm/objects/mod.rs +++ b/src/lib/vm/objects/mod.rs @@ -40,6 +40,7 @@ pub use string_::String_; use natrob::narrowable_alloy; use std::gc::Gc; +use std::gc::ReferenceFree; use crate::vm::{ core::VM, @@ -80,7 +81,7 @@ impl ObjType { /// The main SOM Object trait. Notice that code should almost never call these functions directly: /// you should instead call the equivalent function in the `Val` struct. #[narrowable_alloy(ThinObj)] -pub trait Obj: std::fmt::Debug + FinalizerSafe { +pub trait Obj: std::fmt::Debug + Send + Sync + FinalizerSafe + ReferenceFree { /// What `ObjType` does this `Val` represent? fn dyn_objtype(self: Gc) -> ObjType; diff --git a/src/lib/vm/objects/string_.rs b/src/lib/vm/objects/string_.rs index 4cd1d1a4..a2d58f24 100644 --- a/src/lib/vm/objects/string_.rs +++ b/src/lib/vm/objects/string_.rs @@ -7,7 +7,6 @@ use std::{ str, }; -use smartstring::alias::String as SmartString; use std::gc::Gc; use crate::vm::{ @@ -26,7 +25,7 @@ pub struct String_ { /// that if anyone ever manages to make a string of usize::MAX characters, we won't cache its /// length correctly, but will recalculate it each time. chars_len: Cell, - s: SmartString, + s: String, } // This is safe because there is no non-GC'd shared ownership inside `String_`. @@ -34,6 +33,7 @@ pub struct String_ { // thread, it is guaranteed that the finalizer thread will be the only thread // accessing its data. unsafe impl FinalizerSafe for String_ {} +unsafe impl Sync for String_ {} impl Obj for String_ { fn dyn_objtype(self: Gc) -> ObjType { @@ -98,13 +98,13 @@ impl StaticObjType for String_ { } impl String_ { - pub fn new_str(vm: &mut VM, s: SmartString) -> Val { + pub fn new_str(vm: &mut VM, s: String) -> Val { String_::new_str_chars_len(vm, s, usize::MAX) } /// Create a new `String_` whose number of Unicode characters is already known. Note that it is /// safe to pass `usize::MAX` for `chars_len`. - fn new_str_chars_len(vm: &mut VM, s: SmartString, chars_len: usize) -> Val { + fn new_str_chars_len(vm: &mut VM, s: String, chars_len: usize) -> Val { Val::from_obj(String_ { cls: Cell::new(vm.str_cls), chars_len: Cell::new(chars_len), @@ -112,7 +112,7 @@ impl String_ { }) } - pub fn new_sym(vm: &mut VM, s: SmartString) -> Val { + pub fn new_sym(vm: &mut VM, s: String) -> Val { Val::from_obj(String_ { cls: Cell::new(vm.sym_cls), chars_len: Cell::new(usize::MAX), @@ -169,7 +169,7 @@ impl String_ { todo!(); } if end < start { - return Ok(String_::new_str(vm, SmartString::new())); + return Ok(String_::new_str(vm, String::new())); } if start > self.s.len() || end > self.s.len() { todo!(); diff --git a/src/lib/vm/val.rs b/src/lib/vm/val.rs index 9db33f99..f933456f 100644 --- a/src/lib/vm/val.rs +++ b/src/lib/vm/val.rs @@ -9,8 +9,6 @@ use num_enum::{IntoPrimitive, UnsafeFromPrimitive}; use num_traits::{FromPrimitive, ToPrimitive}; use std::gc::Gc; -use std::gc::NoTrace; - use super::{ core::VM, error::{VMError, VMErrorKind}, @@ -62,8 +60,6 @@ pub struct Val { pub val: usize, } -impl !NoTrace for Val {} - impl Val { /// Create a new `Val` from an object that should be allocated on the heap. pub fn from_obj(obj: T) -> Val { @@ -666,7 +662,6 @@ mod tests { }; use serial_test::serial; - use smartstring::alias::String as SmartString; #[test] #[serial] @@ -737,7 +732,7 @@ mod tests { assert_eq!(v.as_usize(&mut vm).unwrap(), 1 << (BITSIZE - 2)); assert_eq!(v.as_isize(&mut vm).unwrap(), 1 << (BITSIZE - 2)); - let v = String_::new_str(&mut vm, SmartString::new()); + let v = String_::new_str(&mut vm, String::new()); assert!(v.as_usize(&mut vm).is_err()); } @@ -747,7 +742,7 @@ mod tests { let mut vm = VM::new_no_bootstrap(); let v = { - let v = String_::new_str(&mut vm, SmartString::from("s")); + let v = String_::new_str(&mut vm, String::from("s")); let v_tobj = v.tobj(&mut vm).unwrap(); let v_str: Gc = v_tobj.downcast().unwrap(); let v_recovered = Val::recover(v_str); @@ -763,7 +758,7 @@ mod tests { #[serial] fn test_cast() { let mut vm = VM::new_no_bootstrap(); - let v = String_::new_str(&mut vm, SmartString::from("s")); + let v = String_::new_str(&mut vm, String::from("s")); assert!(v.downcast::(&mut vm).is_ok()); assert_eq!( v.downcast::(&mut vm).unwrap_err().kind, @@ -778,7 +773,7 @@ mod tests { #[serial] fn test_downcast() { let mut vm = VM::new_no_bootstrap(); - let v = String_::new_str(&mut vm, SmartString::from("s")); + let v = String_::new_str(&mut vm, String::from("s")); assert!(v.downcast::(&mut vm).is_ok()); assert!(v.downcast::(&mut vm).is_err()); assert!(v.try_downcast::(&mut vm).is_some()); diff --git a/src/main.rs b/src/main.rs index 1987cf03..ca8345af 100644 --- a/src/main.rs +++ b/src/main.rs @@ -12,7 +12,6 @@ use std::{ }; use getopts::Options; -use smartstring::alias::String as SmartString; use yksom::vm::{ objects::{NormalArray, String_}, @@ -99,14 +98,14 @@ fn main() { }; let mut src_fname = PathBuf::from(src_fname); src_fname.set_extension(""); - let src_fname_val = String_::new_str(&mut vm, SmartString::from(src_fname.to_str().unwrap())); + let src_fname_val = String_::new_str(&mut vm, String::from(src_fname.to_str().unwrap())); let mut args_vec = vec![src_fname_val]; args_vec.extend( matches .free .iter() .skip(1) - .map(|x| String_::new_str(&mut vm, SmartString::from(x))), + .map(|x| String_::new_str(&mut vm, String::from(x))), ); let args = NormalArray::from_vec(args_vec); match vm.top_level_send(system, "initialize:", vec![args]) {