diff --git a/Cargo.lock b/Cargo.lock index 2f8d3f9..886c4ae 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -26,28 +26,6 @@ dependencies = [ "memchr", ] -[[package]] -name = "annotate-snippets" -version = "0.11.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "710e8eae58854cdc1790fcb56cca04d712a17be849eeb81da2a724bf4bae2bc4" -dependencies = [ - "anstyle", - "unicode-width 0.2.0", -] - -[[package]] -name = "anstyle" -version = "1.0.10" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "55cc3b69f167a1ef2e161439aa98aed94e6028e5f9a59be9a6ffb47aef1651f9" - -[[package]] -name = "arrayvec" -version = "0.7.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7c02d123df017efcdfbd739ef81735b36c5ba83ec3c59c80a9d7ecc718f92e50" - [[package]] name = "autocfg" version = "1.3.0" @@ -87,15 +65,6 @@ version = "2.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8f68f53c83ab957f72c32642f3868eec03eb974d1fb82e453128456482613d36" -[[package]] -name = "block-buffer" -version = "0.10.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3078c7629b62d3f0439517fa394996acacc5cbc91c5a20d8c658e77abd503a71" -dependencies = [ - "generic-array", -] - [[package]] name = "bumpalo" version = "3.16.0" @@ -145,77 +114,12 @@ version = "0.8.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "06ea2b9bc92be3c2baa9334a323ebca2d6f074ff852cd1d7b11064035cd3868f" -[[package]] -name = "cpufeatures" -version = "0.2.17" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "59ed5838eebb26a2bb2e58f6d5b5316989ae9d08bab10e0e6d103e656d1b0280" -dependencies = [ - "libc", -] - -[[package]] -name = "crypto-common" -version = "0.1.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1bfb12502f3fc46cca1bb51ac28df9d618d813cdc3d2f25b9fe775a34af26bb3" -dependencies = [ - "generic-array", - "typenum", -] - -[[package]] -name = "darling" -version = "0.20.10" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6f63b86c8a8826a49b8c21f08a2d07338eec8d900540f8630dc76284be802989" -dependencies = [ - "darling_core", - "darling_macro", -] - -[[package]] -name = "darling_core" -version = "0.20.10" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "95133861a8032aaea082871032f5815eb9e98cef03fa916ab4500513994df9e5" -dependencies = [ - "fnv", - "ident_case", - "proc-macro2", - "quote", - "strsim", - "syn", -] - -[[package]] -name = "darling_macro" -version = "0.20.10" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d336a2a514f6ccccaa3e09b02d41d35330c07ddf03a62165fcec10bb561c7806" -dependencies = [ - "darling_core", - "quote", - "syn", -] - [[package]] name = "datafrog" version = "2.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a0afaad2b26fa326569eb264b1363e8ae3357618c43982b3f285f0774ce76b69" -[[package]] -name = "derive-where" -version = "1.2.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "62d671cc41a825ebabc75757b62d3d168c577f9149b2d49ece1dad1f72119d25" -dependencies = [ - "proc-macro2", - "quote", - "syn", -] - [[package]] name = "derive_more" version = "2.0.1" @@ -238,39 +142,6 @@ dependencies = [ "unicode-xid", ] -[[package]] -name = "derive_setters" -version = "0.1.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4e8ef033054e131169b8f0f9a7af8f5533a9436fadf3c500ed547f730f07090d" -dependencies = [ - "darling", - "proc-macro2", - "quote", - "syn", -] - -[[package]] -name = "digest" -version = "0.10.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9ed9a281f7bc9b7576e61468ba615a66a5c8cfdff42420a70aa82701a3b1e292" -dependencies = [ - "block-buffer", - "crypto-common", -] - -[[package]] -name = "displaydoc" -version = "0.2.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "97369cbbc041bc366949bc74d34658d6cda5621039731c6310521892a3a20ae0" -dependencies = [ - "proc-macro2", - "quote", - "syn", -] - [[package]] name = "dot" version = "0.1.4" @@ -283,24 +154,6 @@ version = "1.13.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "60b1af1c220855b6ceac025d3f6ecdd2b7c4894bfe9cd9bda4fbb4bc7c0d4cf0" -[[package]] -name = "elsa" -version = "1.7.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "848fe615fbb0a74d9ae68dcaa510106d32e37d9416207bbea4bd008bd89c47ed" -dependencies = [ - "stable_deref_trait", -] - -[[package]] -name = "ena" -version = "0.14.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3d248bdd43ce613d87415282f69b9bb99d947d290b10962dd6c56233312c2ad5" -dependencies = [ - "log", -] - [[package]] name = "encoding_rs" version = "0.8.34" @@ -332,56 +185,12 @@ version = "2.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9fc0510504f03c51ada170672ac806f1f105a88aa97a5281117e1ddc3368e51a" -[[package]] -name = "field-offset" -version = "0.3.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "38e2275cc4e4fc009b0669731a1e5ab7ebf11f469eaede2bab9309a5b4d6057f" -dependencies = [ - "memoffset", - "rustc_version", -] - [[package]] name = "fixedbitset" version = "0.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0ce7134b9999ecaf8bcd65542e436736ef32ddca1b3e06094cb6ec5755203b80" -[[package]] -name = "fluent-bundle" -version = "0.15.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7fe0a21ee80050c678013f82edf4b705fe2f26f1f9877593d13198612503f493" -dependencies = [ - "fluent-langneg", - "fluent-syntax", - "intl-memoizer", - "intl_pluralrules", - "rustc-hash", - "self_cell 0.10.3", - "smallvec", - "unic-langid", -] - -[[package]] -name = "fluent-langneg" -version = "0.13.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2c4ad0989667548f06ccd0e306ed56b61bd4d35458d54df5ec7587c0e8ed5e94" -dependencies = [ - "unic-langid", -] - -[[package]] -name = "fluent-syntax" -version = "0.11.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2a530c4694a6a8d528794ee9bbd8ba0122e779629ac908d15ad5a7ae7763a33d" -dependencies = [ - "thiserror", -] - [[package]] name = "fnv" version = "1.0.7" @@ -460,40 +269,12 @@ dependencies = [ "slab", ] -[[package]] -name = "generic-array" -version = "0.14.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "85649ca51fd72272d7821adaf274ad91c288277713d9c18820d8499a7ff69e9a" -dependencies = [ - "typenum", - "version_check", -] - -[[package]] -name = "getopts" -version = "0.2.21" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "14dbbfd5c71d70241ecf9e6f13737f7b5ce823821063188d7e46c41d371eebd5" -dependencies = [ - "unicode-width 0.1.14", -] - [[package]] name = "gimli" version = "0.29.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "40ecd4077b5ae9fd2e9e169b102c6c330d0605168eb0e8bf79952b256dbefffd" -[[package]] -name = "gsgdt" -version = "0.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a0d876ce7262df96262a2a19531da6ff9a86048224d49580a585fc5c04617825" -dependencies = [ - "serde", -] - [[package]] name = "h2" version = "0.3.26" @@ -590,106 +371,6 @@ dependencies = [ "tokio-native-tls", ] -[[package]] -name = "icu_list" -version = "1.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bbfeda1d7775b6548edd4e8b7562304a559a91ed56ab56e18961a053f367c365" -dependencies = [ - "displaydoc", - "icu_list_data", - "icu_locid_transform", - "icu_provider", - "regex-automata 0.2.0", - "writeable", -] - -[[package]] -name = "icu_list_data" -version = "1.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e1825170d2c6679cb20dbd96a589d034e49f698aed9a2ef4fafc9a0101ed298f" - -[[package]] -name = "icu_locid" -version = "1.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "13acbb8371917fc971be86fc8057c41a64b521c184808a698c02acc242dbf637" -dependencies = [ - "displaydoc", - "litemap", - "tinystr", - "writeable", - "zerovec", -] - -[[package]] -name = "icu_locid_transform" -version = "1.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "01d11ac35de8e40fdeda00d9e1e9d92525f3f9d887cdd7aa81d727596788b54e" -dependencies = [ - "displaydoc", - "icu_locid", - "icu_locid_transform_data", - "icu_provider", - "tinystr", - "zerovec", -] - -[[package]] -name = "icu_locid_transform_data" -version = "1.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fdc8ff3388f852bede6b579ad4e978ab004f139284d7b28715f773507b946f6e" - -[[package]] -name = "icu_provider" -version = "1.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6ed421c8a8ef78d3e2dbc98a973be2f3770cb42b606e3ab18d6237c4dfde68d9" -dependencies = [ - "displaydoc", - "icu_locid", - "icu_provider_macros", - "stable_deref_trait", - "tinystr", - "writeable", - "yoke", - "zerofrom", - "zerovec", -] - -[[package]] -name = "icu_provider_adapters" -version = "1.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d6324dfd08348a8e0374a447ebd334044d766b1839bb8d5ccf2482a99a77c0bc" -dependencies = [ - "icu_locid", - "icu_locid_transform", - "icu_provider", - "tinystr", - "zerovec", -] - -[[package]] -name = "icu_provider_macros" -version = "1.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1ec89e9337638ecdc08744df490b221a7399bf8d164eb52a665454e60e075ad6" -dependencies = [ - "proc-macro2", - "quote", - "syn", -] - -[[package]] -name = "ident_case" -version = "1.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b9e0384b61958566e926dc50660321d12159025e767c18e043daf26b70104c39" - [[package]] name = "idna" version = "0.5.0" @@ -710,25 +391,6 @@ dependencies = [ "hashbrown", ] -[[package]] -name = "intl-memoizer" -version = "0.5.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fe22e020fce238ae18a6d5d8c502ee76a52a6e880d99477657e6acc30ec57bda" -dependencies = [ - "type-map", - "unic-langid", -] - -[[package]] -name = "intl_pluralrules" -version = "7.0.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "078ea7b7c29a2b4df841a7f6ac8775ff6074020c6776d48491ce2268e068f972" -dependencies = [ - "unic-langid", -] - [[package]] name = "ipnet" version = "2.9.0" @@ -750,15 +412,6 @@ version = "1.0.11" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "49f1f14873335454500d59611f1cf4a4b0f786f9ac11f4312a78e4cf2566695b" -[[package]] -name = "jobserver" -version = "0.1.32" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "48d1dbcbbeb6a7fec7e059840aa538bd62aaccf972c7346c4d9d2059312853d0" -dependencies = [ - "libc", -] - [[package]] name = "js-sys" version = "0.3.69" @@ -786,76 +439,18 @@ version = "0.4.14" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "78b3ae25bc7c8c38cec158d1f2757ee79e9b3740fbc7ccf0e59e4b08d793fa89" -[[package]] -name = "litemap" -version = "0.7.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4ee93343901ab17bd981295f2cf0026d4ad018c7c31ba84549a4ddbb47a45104" - -[[package]] -name = "lock_api" -version = "0.4.12" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "07af8b9cdd281b7915f413fa73f29ebd5d55d0d3f0155584dade1ff18cea1b17" -dependencies = [ - "autocfg", - "scopeguard", -] - [[package]] name = "log" version = "0.4.21" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "90ed8c1e510134f979dbc4f070f87d4313098b704861a105fe34231c70a3901c" -[[package]] -name = "md-5" -version = "0.10.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d89e7ee0cfbedfc4da3340218492196241d89eefb6dab27de5df917a6d2e78cf" -dependencies = [ - "cfg-if", - "digest", -] - -[[package]] -name = "measureme" -version = "11.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dfa4a40f09af7aa6faef38285402a78847d0d72bf8827006cd2a332e1e6e4a8d" -dependencies = [ - "log", - "memmap2", - "parking_lot", - "perf-event-open-sys", - "rustc-hash", - "smallvec", -] - [[package]] name = "memchr" version = "2.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2dffe52ecf27772e601905b7522cb4ef790d2cc203488bbd0e2fe85fcb74566d" -[[package]] -name = "memmap2" -version = "0.2.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "723e3ebdcdc5c023db1df315364573789f8857c11b631a2fdfad7c00f5c046b4" -dependencies = [ - "libc", -] - -[[package]] -name = "memoffset" -version = "0.9.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "488016bfae457b036d996092f6cb448677611ce4449e970ceaf42695203f218a" -dependencies = [ - "autocfg", -] - [[package]] name = "mime" version = "0.3.17" @@ -918,15 +513,6 @@ dependencies = [ "memchr", ] -[[package]] -name = "odht" -version = "0.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5a518809ac14b25b569624d0268eba1e88498f71615893dca57982bed7621abb" -dependencies = [ - "cfg-if", -] - [[package]] name = "once_cell" version = "1.19.0" @@ -983,29 +569,6 @@ version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b15813163c1d831bf4a13c3610c05c0d03b39feb07f7e09fa234dac9b15aaf39" -[[package]] -name = "parking_lot" -version = "0.12.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f1bf18183cf54e8d6059647fc3063646a1801cf30896933ec2311622cc4b9a27" -dependencies = [ - "lock_api", - "parking_lot_core", -] - -[[package]] -name = "parking_lot_core" -version = "0.9.10" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1e401f977ab385c9e4e3ab30627d6f26d00e2c73eef317493c4ec6d468726cf8" -dependencies = [ - "cfg-if", - "libc", - "redox_syscall", - "smallvec", - "windows-targets 0.52.5", -] - [[package]] name = "pcs" version = "0.1.0" @@ -1019,14 +582,6 @@ dependencies = [ "polonius-engine", "regex", "reqwest", - "rustc_ast", - "rustc_borrowck", - "rustc_data_structures", - "rustc_hir", - "rustc_index", - "rustc_middle", - "rustc_mir_dataflow", - "rustc_target", "rustversion", "serde", "serde_derive", @@ -1045,17 +600,8 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e3148f5046208a5d56bcfc03053e3ca6334e51da8dfb19b6cdc8b306fae3283e" [[package]] -name = "perf-event-open-sys" -version = "3.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b29be2ba35c12c6939f6bc73187f728bba82c3c062ecdc5fa90ea739282a1f58" -dependencies = [ - "libc", -] - -[[package]] -name = "petgraph" -version = "0.6.5" +name = "petgraph" +version = "0.6.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b4c5cc86750666a3ed20bdaf5ca2a0344f9c67674cae0515bec2da16fbaa47db" dependencies = [ @@ -1092,18 +638,6 @@ dependencies = [ "rustc-hash", ] -[[package]] -name = "portable-atomic" -version = "1.10.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "280dc24453071f1b63954171985a0b0d30058d287960968b9b2aca264c8d4ee6" - -[[package]] -name = "proc-macro-hack" -version = "0.5.20+deprecated" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dc375e1527247fe1a97d8b7156678dfe7c1af2fc075c9a4db3690ecd2a148068" - [[package]] name = "proc-macro2" version = "1.0.85" @@ -1113,15 +647,6 @@ dependencies = [ "unicode-ident", ] -[[package]] -name = "psm" -version = "0.1.23" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "aa37f80ca58604976033fae9515a8a2989fc13797d953f7c04fb8fa36a11f205" -dependencies = [ - "cc", -] - [[package]] name = "quote" version = "1.0.36" @@ -1131,39 +656,6 @@ dependencies = [ "proc-macro2", ] -[[package]] -name = "rand" -version = "0.8.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "34af8d1a0e25924bc5b7c43c079c942339d8f0a8b57c39049bef581b46327404" -dependencies = [ - "rand_core", -] - -[[package]] -name = "rand_core" -version = "0.6.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ec0be4795e2f6a28069bec0b5ff3e2ac9bafc99e6a9a7dc3547996c5c816922c" - -[[package]] -name = "rand_xoshiro" -version = "0.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6f97cdb2a36ed4183de61b2f824cc45c9f1037f28afe0a322e9fff4c108b5aaa" -dependencies = [ - "rand_core", -] - -[[package]] -name = "redox_syscall" -version = "0.5.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "03a862b389f93e68874fbf580b9de08dd02facb9a788ebadaf4a3fd33cf58834" -dependencies = [ - "bitflags 2.8.0", -] - [[package]] name = "regex" version = "1.9.4" @@ -1172,19 +664,10 @@ checksum = "12de2eff854e5fa4b1295edd650e227e9d8fb0c9e90b12e7f36d6a6811791a29" dependencies = [ "aho-corasick", "memchr", - "regex-automata 0.3.7", + "regex-automata", "regex-syntax", ] -[[package]] -name = "regex-automata" -version = "0.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e9368763f5a9b804326f3af749e16f9abf378d227bcdee7634b13d8f17793782" -dependencies = [ - "memchr", -] - [[package]] name = "regex-automata" version = "0.3.7" @@ -1200,672 +683,59 @@ dependencies = [ name = "regex-syntax" version = "0.7.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dbb5fb1acd8a1a18b3dd5be62d25485eb770e05afb408a9627d14d451bae12da" - -[[package]] -name = "reqwest" -version = "0.11.27" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dd67538700a17451e7cba03ac727fb961abb7607553461627b97de0b89cf4a62" -dependencies = [ - "base64", - "bytes", - "encoding_rs", - "futures-core", - "futures-util", - "h2", - "http", - "http-body", - "hyper", - "hyper-tls", - "ipnet", - "js-sys", - "log", - "mime", - "native-tls", - "once_cell", - "percent-encoding", - "pin-project-lite", - "rustls-pemfile", - "serde", - "serde_json", - "serde_urlencoded", - "sync_wrapper", - "system-configuration", - "tokio", - "tokio-native-tls", - "tower-service", - "url", - "wasm-bindgen", - "wasm-bindgen-futures", - "web-sys", - "winreg", -] - -[[package]] -name = "rustc-demangle" -version = "0.1.24" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "719b953e2095829ee67db738b3bfa9fa368c94900df327b3f07fe6e794d2fe1f" - -[[package]] -name = "rustc-hash" -version = "1.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "08d43f7aa6b08d49f382cde6a7982047c3426db949b1424bc4b7ec9ae12c6ce2" - -[[package]] -name = "rustc-stable-hash" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2febf9acc5ee5e99d1ad0afcdbccc02d87aa3f857a1f01f825b80eacf8edfcd1" - -[[package]] -name = "rustc_abi" -version = "0.0.0" -dependencies = [ - "bitflags 2.8.0", - "rand", - "rand_xoshiro", - "rustc_data_structures", - "rustc_index", - "rustc_macros", - "rustc_serialize", - "tracing", -] - -[[package]] -name = "rustc_apfloat" -version = "0.2.2+llvm-462a31f5a5ab" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "121e2195ff969977a4e2b5c9965ea867fce7e4cb5aee5b09dee698a7932d574f" -dependencies = [ - "bitflags 2.8.0", - "smallvec", -] - -[[package]] -name = "rustc_arena" -version = "0.0.0" -dependencies = [ - "smallvec", -] - -[[package]] -name = "rustc_ast" -version = "0.0.0" -dependencies = [ - "bitflags 2.8.0", - "memchr", - "rustc_ast_ir", - "rustc_data_structures", - "rustc_index", - "rustc_lexer", - "rustc_macros", - "rustc_serialize", - "rustc_span", - "smallvec", - "thin-vec", - "tracing", -] - -[[package]] -name = "rustc_ast_ir" -version = "0.0.0" -dependencies = [ - "rustc_data_structures", - "rustc_macros", - "rustc_serialize", - "rustc_span", -] - -[[package]] -name = "rustc_ast_pretty" -version = "0.0.0" -dependencies = [ - "itertools", - "rustc_ast", - "rustc_lexer", - "rustc_span", - "thin-vec", -] - -[[package]] -name = "rustc_attr" -version = "0.0.0" -dependencies = [ - "rustc_abi", - "rustc_ast", - "rustc_ast_pretty", - "rustc_data_structures", - "rustc_errors", - "rustc_feature", - "rustc_fluent_macro", - "rustc_lexer", - "rustc_macros", - "rustc_serialize", - "rustc_session", - "rustc_span", -] - -[[package]] -name = "rustc_baked_icu_data" -version = "0.0.0" -dependencies = [ - "icu_list", - "icu_locid", - "icu_locid_transform", - "icu_provider", - "zerovec", -] - -[[package]] -name = "rustc_borrowck" -version = "0.0.0" -dependencies = [ - "either", - "itertools", - "polonius-engine", - "rustc_data_structures", - "rustc_errors", - "rustc_fluent_macro", - "rustc_graphviz", - "rustc_hir", - "rustc_index", - "rustc_infer", - "rustc_lexer", - "rustc_macros", - "rustc_middle", - "rustc_mir_dataflow", - "rustc_session", - "rustc_span", - "rustc_target", - "rustc_trait_selection", - "rustc_traits", - "smallvec", - "tracing", -] - -[[package]] -name = "rustc_data_structures" -version = "0.0.0" -dependencies = [ - "arrayvec", - "bitflags 2.8.0", - "either", - "elsa", - "ena", - "indexmap", - "jobserver", - "libc", - "measureme", - "memmap2", - "parking_lot", - "portable-atomic", - "rustc-hash", - "rustc-stable-hash", - "rustc_arena", - "rustc_graphviz", - "rustc_index", - "rustc_macros", - "rustc_serialize", - "smallvec", - "stacker", - "tempfile", - "thin-vec", - "tracing", - "windows", -] - -[[package]] -name = "rustc_error_codes" -version = "0.0.0" - -[[package]] -name = "rustc_error_messages" -version = "0.0.0" -dependencies = [ - "fluent-bundle", - "fluent-syntax", - "icu_list", - "icu_locid", - "icu_provider_adapters", - "intl-memoizer", - "rustc_baked_icu_data", - "rustc_data_structures", - "rustc_macros", - "rustc_serialize", - "rustc_span", - "tracing", - "unic-langid", -] - -[[package]] -name = "rustc_errors" -version = "0.0.0" -dependencies = [ - "annotate-snippets", - "derive_setters", - "rustc_ast", - "rustc_ast_pretty", - "rustc_data_structures", - "rustc_error_codes", - "rustc_error_messages", - "rustc_fluent_macro", - "rustc_hir", - "rustc_index", - "rustc_lint_defs", - "rustc_macros", - "rustc_serialize", - "rustc_span", - "rustc_target", - "rustc_type_ir", - "serde", - "serde_json", - "termcolor", - "termize", - "tracing", - "windows", -] - -[[package]] -name = "rustc_feature" -version = "0.0.0" -dependencies = [ - "rustc_data_structures", - "rustc_span", -] - -[[package]] -name = "rustc_fluent_macro" -version = "0.0.0" -dependencies = [ - "annotate-snippets", - "fluent-bundle", - "fluent-syntax", - "proc-macro2", - "quote", - "syn", - "unic-langid", -] - -[[package]] -name = "rustc_fs_util" -version = "0.0.0" - -[[package]] -name = "rustc_graphviz" -version = "0.0.0" - -[[package]] -name = "rustc_hir" -version = "0.0.0" -dependencies = [ - "odht", - "rustc_arena", - "rustc_ast", - "rustc_data_structures", - "rustc_index", - "rustc_macros", - "rustc_serialize", - "rustc_span", - "rustc_target", - "smallvec", - "tracing", -] - -[[package]] -name = "rustc_hir_pretty" -version = "0.0.0" -dependencies = [ - "rustc_ast", - "rustc_ast_pretty", - "rustc_hir", - "rustc_span", - "rustc_target", -] - -[[package]] -name = "rustc_index" -version = "0.0.0" -dependencies = [ - "arrayvec", - "rustc_index_macros", - "rustc_macros", - "rustc_serialize", - "smallvec", -] - -[[package]] -name = "rustc_index_macros" -version = "0.0.0" -dependencies = [ - "proc-macro2", - "quote", - "syn", -] - -[[package]] -name = "rustc_infer" -version = "0.0.0" -dependencies = [ - "rustc_ast_ir", - "rustc_data_structures", - "rustc_errors", - "rustc_fluent_macro", - "rustc_hir", - "rustc_index", - "rustc_macros", - "rustc_middle", - "rustc_next_trait_solver", - "rustc_span", - "rustc_target", - "rustc_type_ir", - "smallvec", - "tracing", -] - -[[package]] -name = "rustc_lexer" -version = "0.0.0" -dependencies = [ - "unicode-properties", - "unicode-xid", -] - -[[package]] -name = "rustc_lint_defs" -version = "0.0.0" -dependencies = [ - "rustc_ast", - "rustc_data_structures", - "rustc_error_messages", - "rustc_hir", - "rustc_macros", - "rustc_serialize", - "rustc_span", - "rustc_target", - "serde", -] - -[[package]] -name = "rustc_macros" -version = "0.0.0" -dependencies = [ - "proc-macro2", - "quote", - "syn", - "synstructure", -] - -[[package]] -name = "rustc_middle" -version = "0.0.0" -dependencies = [ - "bitflags 2.8.0", - "derive-where", - "either", - "field-offset", - "gsgdt", - "polonius-engine", - "rustc_apfloat", - "rustc_arena", - "rustc_ast", - "rustc_ast_ir", - "rustc_attr", - "rustc_data_structures", - "rustc_error_messages", - "rustc_errors", - "rustc_feature", - "rustc_fluent_macro", - "rustc_graphviz", - "rustc_hir", - "rustc_hir_pretty", - "rustc_index", - "rustc_macros", - "rustc_query_system", - "rustc_serialize", - "rustc_session", - "rustc_span", - "rustc_target", - "rustc_type_ir", - "smallvec", - "thin-vec", - "tracing", -] - -[[package]] -name = "rustc_mir_dataflow" -version = "0.0.0" -dependencies = [ - "polonius-engine", - "regex", - "rustc_ast", - "rustc_data_structures", - "rustc_errors", - "rustc_fluent_macro", - "rustc_graphviz", - "rustc_hir", - "rustc_index", - "rustc_macros", - "rustc_middle", - "rustc_span", - "rustc_target", - "smallvec", - "tracing", -] - -[[package]] -name = "rustc_next_trait_solver" -version = "0.0.0" -dependencies = [ - "bitflags 2.8.0", - "derive-where", - "rustc_ast_ir", - "rustc_data_structures", - "rustc_index", - "rustc_macros", - "rustc_serialize", - "rustc_type_ir", - "rustc_type_ir_macros", - "tracing", -] - -[[package]] -name = "rustc_parse_format" -version = "0.0.0" -dependencies = [ - "rustc_index", - "rustc_lexer", -] - -[[package]] -name = "rustc_query_system" -version = "0.0.0" -dependencies = [ - "parking_lot", - "rustc_ast", - "rustc_data_structures", - "rustc_errors", - "rustc_feature", - "rustc_fluent_macro", - "rustc_hir", - "rustc_index", - "rustc_macros", - "rustc_serialize", - "rustc_session", - "rustc_span", - "rustc_target", - "smallvec", - "thin-vec", - "tracing", -] - -[[package]] -name = "rustc_serialize" -version = "0.0.0" -dependencies = [ - "indexmap", - "smallvec", - "thin-vec", -] - -[[package]] -name = "rustc_session" -version = "0.0.0" -dependencies = [ - "bitflags 2.8.0", - "getopts", - "libc", - "rustc_ast", - "rustc_data_structures", - "rustc_errors", - "rustc_feature", - "rustc_fluent_macro", - "rustc_fs_util", - "rustc_hir", - "rustc_lint_defs", - "rustc_macros", - "rustc_serialize", - "rustc_span", - "rustc_target", - "smallvec", - "termize", - "tracing", - "windows", -] - -[[package]] -name = "rustc_span" -version = "0.0.0" -dependencies = [ - "derive-where", - "indexmap", - "itoa", - "md-5", - "rustc_arena", - "rustc_data_structures", - "rustc_index", - "rustc_macros", - "rustc_serialize", - "scoped-tls", - "sha1", - "sha2", - "tracing", - "unicode-width 0.1.14", -] - -[[package]] -name = "rustc_target" -version = "0.0.0" -dependencies = [ - "bitflags 2.8.0", - "object", - "rustc_abi", - "rustc_data_structures", - "rustc_feature", - "rustc_fs_util", - "rustc_index", - "rustc_macros", - "rustc_serialize", - "rustc_span", - "serde_json", - "tracing", -] - -[[package]] -name = "rustc_trait_selection" -version = "0.0.0" -dependencies = [ - "itertools", - "rustc_ast", - "rustc_ast_ir", - "rustc_attr", - "rustc_data_structures", - "rustc_errors", - "rustc_fluent_macro", - "rustc_hir", - "rustc_infer", - "rustc_macros", - "rustc_middle", - "rustc_next_trait_solver", - "rustc_parse_format", - "rustc_query_system", - "rustc_serialize", - "rustc_session", - "rustc_span", - "rustc_target", - "rustc_transmute", - "rustc_type_ir", - "smallvec", - "tracing", -] - -[[package]] -name = "rustc_traits" -version = "0.0.0" -dependencies = [ - "rustc_data_structures", - "rustc_hir", - "rustc_infer", - "rustc_middle", - "rustc_span", - "rustc_trait_selection", - "tracing", -] - -[[package]] -name = "rustc_transmute" -version = "0.0.0" -dependencies = [ - "rustc_ast_ir", - "rustc_data_structures", - "rustc_hir", - "rustc_infer", - "rustc_macros", - "rustc_middle", - "rustc_span", - "rustc_target", - "tracing", -] +checksum = "dbb5fb1acd8a1a18b3dd5be62d25485eb770e05afb408a9627d14d451bae12da" [[package]] -name = "rustc_type_ir" -version = "0.0.0" +name = "reqwest" +version = "0.11.27" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dd67538700a17451e7cba03ac727fb961abb7607553461627b97de0b89cf4a62" dependencies = [ - "bitflags 2.8.0", - "derive-where", - "indexmap", - "rustc-hash", - "rustc_ast_ir", - "rustc_data_structures", - "rustc_index", - "rustc_macros", - "rustc_serialize", - "rustc_span", - "rustc_type_ir_macros", - "smallvec", - "tracing", + "base64", + "bytes", + "encoding_rs", + "futures-core", + "futures-util", + "h2", + "http", + "http-body", + "hyper", + "hyper-tls", + "ipnet", + "js-sys", + "log", + "mime", + "native-tls", + "once_cell", + "percent-encoding", + "pin-project-lite", + "rustls-pemfile", + "serde", + "serde_json", + "serde_urlencoded", + "sync_wrapper", + "system-configuration", + "tokio", + "tokio-native-tls", + "tower-service", + "url", + "wasm-bindgen", + "wasm-bindgen-futures", + "web-sys", + "winreg", ] [[package]] -name = "rustc_type_ir_macros" -version = "0.0.0" -dependencies = [ - "proc-macro2", - "quote", - "syn", - "synstructure", -] +name = "rustc-demangle" +version = "0.1.24" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "719b953e2095829ee67db738b3bfa9fa368c94900df327b3f07fe6e794d2fe1f" [[package]] -name = "rustc_version" -version = "0.4.1" +name = "rustc-hash" +version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cfcb3a22ef46e85b45de6ee7e79d063319ebb6594faafcf1c225ea92ab6e9b92" -dependencies = [ - "semver", -] +checksum = "08d43f7aa6b08d49f382cde6a7982047c3426db949b1424bc4b7ec9ae12c6ce2" [[package]] name = "rustix" @@ -1910,18 +780,6 @@ dependencies = [ "windows-sys 0.52.0", ] -[[package]] -name = "scoped-tls" -version = "1.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e1cf6437eb19a8f4a6cc0f7dca544973b0b78843adbfeb3683d1a94a0024a294" - -[[package]] -name = "scopeguard" -version = "1.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "94143f37725109f92c262ed2cf5e59bce7498c01bcc1502d7b9afe439a4e9f49" - [[package]] name = "security-framework" version = "2.11.0" @@ -1945,27 +803,6 @@ dependencies = [ "libc", ] -[[package]] -name = "self_cell" -version = "0.10.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e14e4d63b804dc0c7ec4a1e52bcb63f02c7ac94476755aa579edac21e01f915d" -dependencies = [ - "self_cell 1.1.0", -] - -[[package]] -name = "self_cell" -version = "1.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c2fdfc24bc566f839a2da4c4295b82db7d25a24253867d5c64355abb5799bdbe" - -[[package]] -name = "semver" -version = "1.0.25" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f79dfe2d285b0488816f30e700a7438c5a73d816b5b7d3ac72fbc48b0d185e03" - [[package]] name = "serde" version = "1.0.193" @@ -2018,28 +855,6 @@ dependencies = [ "serde", ] -[[package]] -name = "sha1" -version = "0.10.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e3bf829a2d51ab4a5ddf1352d8470c140cadc8301b2ae1789db023f01cedd6ba" -dependencies = [ - "cfg-if", - "cpufeatures", - "digest", -] - -[[package]] -name = "sha2" -version = "0.10.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "793db75ad2bcafc3ffa7c68b215fee268f537982cd901d132f89c6343f3a3dc8" -dependencies = [ - "cfg-if", - "cpufeatures", - "digest", -] - [[package]] name = "sharded-slab" version = "0.1.7" @@ -2080,31 +895,6 @@ dependencies = [ "windows-sys 0.52.0", ] -[[package]] -name = "stable_deref_trait" -version = "1.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a8f112729512f8e442d81f95a8a7ddf2b7c6b8a1a6f509a95864142b30cab2d3" - -[[package]] -name = "stacker" -version = "0.1.17" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "799c883d55abdb5e98af1a7b3f23b9b6de8ecada0ecac058672d7635eb48ca7b" -dependencies = [ - "cc", - "cfg-if", - "libc", - "psm", - "windows-sys 0.52.0", -] - -[[package]] -name = "strsim" -version = "0.11.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7da8b5736845d9f2fcb837ea5d9e2628564b3b043a70948a3f0b778838c5fb4f" - [[package]] name = "syn" version = "2.0.66" @@ -2122,17 +912,6 @@ version = "0.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2047c6ded9c721764247e62cd3b03c09ffc529b2ba5b10ec482ae507a4a70160" -[[package]] -name = "synstructure" -version = "0.13.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c8af7666ab7b6390ab78131fb5b0fce11d6b7a6951602017c35fa82800708971" -dependencies = [ - "proc-macro2", - "quote", - "syn", -] - [[package]] name = "system-configuration" version = "0.5.1" @@ -2166,51 +945,6 @@ dependencies = [ "windows-sys 0.52.0", ] -[[package]] -name = "termcolor" -version = "1.4.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "06794f8f6c5c898b3275aebefa6b8a1cb24cd2c6c79397ab15774837a0bc5755" -dependencies = [ - "winapi-util", -] - -[[package]] -name = "termize" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1706be6b564323ce7092f5f7e6b118a14c8ef7ed0e69c8c5329c914a9f101295" -dependencies = [ - "libc", - "winapi", -] - -[[package]] -name = "thin-vec" -version = "0.2.13" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a38c90d48152c236a3ab59271da4f4ae63d678c5d7ad6b7714d7cb9760be5e4b" - -[[package]] -name = "thiserror" -version = "1.0.65" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5d11abd9594d9b38965ef50805c5e469ca9cc6f197f883f717e0269a3057b3d5" -dependencies = [ - "thiserror-impl", -] - -[[package]] -name = "thiserror-impl" -version = "1.0.65" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ae71770322cbd277e69d762a16c444af02aa0575ac0d174f0b9562d3b37f8602" -dependencies = [ - "proc-macro2", - "quote", - "syn", -] - [[package]] name = "thread_local" version = "1.1.8" @@ -2221,16 +955,6 @@ dependencies = [ "once_cell", ] -[[package]] -name = "tinystr" -version = "0.7.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9117f5d4db391c1cf6927e7bea3db74b9a1c1add8f7eda9ffd5364f40f57b82f" -dependencies = [ - "displaydoc", - "zerovec", -] - [[package]] name = "tinyvec" version = "1.6.0" @@ -2387,64 +1111,6 @@ version = "0.2.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e421abadd41a4225275504ea4d6566923418b7f05506fbc9c0fe86ba7396114b" -[[package]] -name = "type-map" -version = "0.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "deb68604048ff8fa93347f02441e4487594adc20bb8a084f9e564d2b827a0a9f" -dependencies = [ - "rustc-hash", -] - -[[package]] -name = "typenum" -version = "1.17.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "42ff0bf0c66b8238c6f3b578df37d0b7848e55df8577b3f74f92a69acceeb825" - -[[package]] -name = "unic-langid" -version = "0.9.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "23dd9d1e72a73b25e07123a80776aae3e7b0ec461ef94f9151eed6ec88005a44" -dependencies = [ - "unic-langid-impl", - "unic-langid-macros", -] - -[[package]] -name = "unic-langid-impl" -version = "0.9.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0a5422c1f65949306c99240b81de9f3f15929f5a8bfe05bb44b034cc8bf593e5" -dependencies = [ - "tinystr", -] - -[[package]] -name = "unic-langid-macros" -version = "0.9.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0da1cd2c042d3c7569a1008806b02039e7a4a2bdf8f8e96bd3c792434a0e275e" -dependencies = [ - "proc-macro-hack", - "tinystr", - "unic-langid-impl", - "unic-langid-macros-impl", -] - -[[package]] -name = "unic-langid-macros-impl" -version = "0.9.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1ed7f4237ba393424195053097c1516bd4590dc82b84f2f97c5c69e12704555b" -dependencies = [ - "proc-macro-hack", - "quote", - "syn", - "unic-langid-impl", -] - [[package]] name = "unicode-bidi" version = "0.3.15" @@ -2466,30 +1132,12 @@ dependencies = [ "tinyvec", ] -[[package]] -name = "unicode-properties" -version = "0.1.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e70f2a8b45122e719eb623c01822704c4e0907e7e426a05927e1a1cfff5b75d0" - [[package]] name = "unicode-segmentation" version = "1.12.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f6ccf251212114b54433ec949fd6a7841275f9ada20dddd2f29e9ceea4501493" -[[package]] -name = "unicode-width" -version = "0.1.14" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7dd6e30e90baa6f72411720665d41d89b9a3d039dc45b8faea1ddd07f617f6af" - -[[package]] -name = "unicode-width" -version = "0.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1fc81956842c57dac11422a97c3b8195a1ff727f06e85c84ed2e8aa277c9a0fd" - [[package]] name = "unicode-xid" version = "0.2.6" @@ -2519,12 +1167,6 @@ version = "0.2.15" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "accd4ea62f7bb7a82fe23066fb0957d48ef677f6eeb8215f372f52e48bb32426" -[[package]] -name = "version_check" -version = "0.9.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0b928f33d975fc6ad9f86c8f283853ad26bdd5b10b7f1542aa2fa15e2289105a" - [[package]] name = "want" version = "0.3.1" @@ -2632,40 +1274,12 @@ version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" -[[package]] -name = "winapi-util" -version = "0.1.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cf221c93e13a30d793f7645a0e7762c55d169dbb0a49671918a2319d289b10bb" -dependencies = [ - "windows-sys 0.52.0", -] - [[package]] name = "winapi-x86_64-pc-windows-gnu" version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" -[[package]] -name = "windows" -version = "0.52.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e48a53791691ab099e5e2ad123536d0fff50652600abaf43bbf952894110d0be" -dependencies = [ - "windows-core", - "windows-targets 0.52.5", -] - -[[package]] -name = "windows-core" -version = "0.52.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "33ab640c8d7e35bf8ba19b884ba838ceb4fba93a4e8c65a9059d08afcfc683d9" -dependencies = [ - "windows-targets 0.52.5", -] - [[package]] name = "windows-sys" version = "0.48.0" @@ -2823,76 +1437,3 @@ dependencies = [ "cfg-if", "windows-sys 0.48.0", ] - -[[package]] -name = "writeable" -version = "0.5.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1e9df38ee2d2c3c5948ea468a8406ff0db0b29ae1ffde1bcf20ef305bcc95c51" - -[[package]] -name = "yoke" -version = "0.7.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "120e6aef9aa629e3d4f52dc8cc43a015c7724194c97dfaf45180d2daf2b77f40" -dependencies = [ - "serde", - "stable_deref_trait", - "yoke-derive", - "zerofrom", -] - -[[package]] -name = "yoke-derive" -version = "0.7.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2380878cad4ac9aac1e2435f3eb4020e8374b5f13c296cb75b4620ff8e229154" -dependencies = [ - "proc-macro2", - "quote", - "syn", - "synstructure", -] - -[[package]] -name = "zerofrom" -version = "0.1.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cff3ee08c995dee1859d998dea82f7374f2826091dd9cd47def953cae446cd2e" -dependencies = [ - "zerofrom-derive", -] - -[[package]] -name = "zerofrom-derive" -version = "0.1.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "595eed982f7d355beb85837f651fa22e90b3c044842dc7f2c2842c086f295808" -dependencies = [ - "proc-macro2", - "quote", - "syn", - "synstructure", -] - -[[package]] -name = "zerovec" -version = "0.10.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "aa2b893d79df23bfb12d5461018d408ea19dfafe76c2c7ef6d4eba614f8ff079" -dependencies = [ - "yoke", - "zerofrom", - "zerovec-derive", -] - -[[package]] -name = "zerovec-derive" -version = "0.10.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6eafa6dfb17584ea3e2bd6e76e0cc15ad7af12b09abdd1ca55961bed9b1063c6" -dependencies = [ - "proc-macro2", - "quote", - "syn", -] diff --git a/Cargo.toml b/Cargo.toml index 291fe75..56f5e2e 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -6,14 +6,15 @@ edition = "2021" build = "build.rs" [dependencies] -rustc_ast = {path = "/Users/zgrannan/.rustup/toolchains/nightly-2024-09-15-aarch64-apple-darwin/lib/rustlib/rustc-src/rust/compiler/rustc_ast", optional = true} -rustc_borrowck = {path = "/Users/zgrannan/.rustup/toolchains/nightly-2024-09-15-aarch64-apple-darwin/lib/rustlib/rustc-src/rust/compiler/rustc_borrowck", optional = true} -rustc_mir_dataflow = {path = "/Users/zgrannan/.rustup/toolchains/nightly-2024-09-15-aarch64-apple-darwin/lib/rustlib/rustc-src/rust/compiler/rustc_mir_dataflow", optional = true} -rustc_data_structures = {path = "/Users/zgrannan/.rustup/toolchains/nightly-2024-09-15-aarch64-apple-darwin/lib/rustlib/rustc-src/rust/compiler/rustc_data_structures", optional = true} -rustc_hir = {path = "/Users/zgrannan/.rustup/toolchains/nightly-2024-09-15-aarch64-apple-darwin/lib/rustlib/rustc-src/rust/compiler/rustc_hir", optional = true} -rustc_index = {path = "/Users/zgrannan/.rustup/toolchains/nightly-2024-09-15-aarch64-apple-darwin/lib/rustlib/rustc-src/rust/compiler/rustc_index", optional = true} -rustc_middle = {path = "/Users/zgrannan/.rustup/toolchains/nightly-2024-09-15-aarch64-apple-darwin/lib/rustlib/rustc-src/rust/compiler/rustc_middle", optional = true} -rustc_target = {path = "/Users/zgrannan/.rustup/toolchains/nightly-2024-09-15-aarch64-apple-darwin/lib/rustlib/rustc-src/rust/compiler/rustc_target", optional = true} +# For RustRover +# rustc_ast = {path = "~/.rustup/toolchains/nightly-2024-09-15-aarch64-apple-darwin/lib/rustlib/rustc-src/rust/compiler/rustc_ast", optional = true} +# rustc_borrowck = {path = "~/.rustup/toolchains/nightly-2024-09-15-aarch64-apple-darwin/lib/rustlib/rustc-src/rust/compiler/rustc_borrowck", optional = true} +# rustc_mir_dataflow = {path = "~/.rustup/toolchains/nightly-2024-09-15-aarch64-apple-darwin/lib/rustlib/rustc-src/rust/compiler/rustc_mir_dataflow", optional = true} +# rustc_data_structures = {path = "~/.rustup/toolchains/nightly-2024-09-15-aarch64-apple-darwin/lib/rustlib/rustc-src/rust/compiler/rustc_data_structures", optional = true} +# rustc_hir = {path = "~/.rustup/toolchains/nightly-2024-09-15-aarch64-apple-darwin/lib/rustlib/rustc-src/rust/compiler/rustc_hir", optional = true} +# rustc_index = {path = "~/.rustup/toolchains/nightly-2024-09-15-aarch64-apple-darwin/lib/rustlib/rustc-src/rust/compiler/rustc_index", optional = true} +# rustc_middle = {path = "~/.rustup/toolchains/nightly-2024-09-15-aarch64-apple-darwin/lib/rustlib/rustc-src/rust/compiler/rustc_middle", optional = true} +# rustc_target = {path = "~/.rustup/toolchains/nightly-2024-09-15-aarch64-apple-darwin/lib/rustlib/rustc-src/rust/compiler/rustc_target", optional = true} shell-escape = "0.1.5" rustversion = "1.0" itertools = "0.12.0" diff --git a/src/utils/domain_data.rs b/src/utils/domain_data.rs new file mode 100644 index 0000000..df83f53 --- /dev/null +++ b/src/utils/domain_data.rs @@ -0,0 +1,57 @@ +use crate::borrows::engine::DataflowPhase; +use crate::rustc_interface::middle::mir::Location; + +use super::eval_stmt_data::EvalStmtData; + +#[derive(Debug, Clone, PartialEq, Eq)] +pub(crate) struct DomainData { + pub(crate) entry_state: T, + pub(crate) states: EvalStmtData, + phase: DataflowPhase, +} + +impl Default for DomainData { + fn default() -> Self { + Self { + entry_state: T::default(), + states: EvalStmtData::default(), + phase: DataflowPhase::Init, + } + } +} + +impl DomainData { + pub(crate) fn new(entry_state: T) -> Self { + Self { + entry_state, + states: EvalStmtData::default(), + phase: DataflowPhase::Init, + } + } + pub(crate) fn pre_operands_complete(&mut self) { + assert!(self.phase == DataflowPhase::Transfer); + self.states.pre_operands = self.states.post_main.clone(); + } + pub(crate) fn post_operands_complete(&mut self) { + assert!(self.phase == DataflowPhase::Transfer); + self.states.post_operands = self.states.post_main.clone(); + } + + pub(crate) fn pre_main_complete(&mut self) { + assert!(self.phase == DataflowPhase::Transfer); + self.states.pre_main = self.states.post_main.clone(); + } + pub(crate) fn enter_location(&mut self, _location: Location) { + if self.phase != DataflowPhase::Transfer { + // The entry state may have taken into account previous joins + self.states.post_main = self.entry_state.clone(); + self.phase = DataflowPhase::Transfer; + } + } + pub(crate) fn enter_join(&mut self) { + if self.phase == DataflowPhase::Transfer { + self.entry_state = self.states.post_main.clone(); + self.phase = DataflowPhase::Join; + } + } +} diff --git a/src/utils/eval_stmt_data.rs b/src/utils/eval_stmt_data.rs new file mode 100644 index 0000000..2c7748e --- /dev/null +++ b/src/utils/eval_stmt_data.rs @@ -0,0 +1,108 @@ +use serde_json::json; +use crate::utils::json::ToJsonWithRepacker; +use crate::borrows::engine::BorrowsStates; +use crate::combined_pcs::EvalStmtPhase; +use crate::utils::PlaceRepacker; +use crate::utils::validity::HasValidityCheck; + +#[derive(Clone, PartialEq, Eq, Debug)] +pub struct EvalStmtData { + pub(crate) pre_operands: T, + pub(crate) post_operands: T, + pub(crate) pre_main: T, + pub(crate) post_main: T, +} + +impl<'tcx, T: ToJsonWithRepacker<'tcx>> ToJsonWithRepacker<'tcx> for EvalStmtData { + fn to_json(&self, repacker: PlaceRepacker<'_, 'tcx>) -> serde_json::Value { + json!({ + "pre_operands": self.pre_operands.to_json(repacker), + "post_operands": self.post_operands.to_json(repacker), + "pre_main": self.pre_main.to_json(repacker), + "post_main": self.post_main.to_json(repacker), + }) + } +} + +impl Default for EvalStmtData { + fn default() -> Self { + Self { + pre_operands: T::default(), + post_operands: T::default(), + pre_main: T::default(), + post_main: T::default(), + } + } +} + +impl EvalStmtData { + pub fn map(self, f: impl Fn(T) -> U) -> EvalStmtData { + EvalStmtData { + pre_operands: f(self.pre_operands), + post_operands: f(self.post_operands), + pre_main: f(self.pre_main), + post_main: f(self.post_main), + } + } + + pub fn iter(&self) -> impl Iterator { + [ + (EvalStmtPhase::PreOperands, &self.pre_operands), + (EvalStmtPhase::PostOperands, &self.post_operands), + (EvalStmtPhase::PreMain, &self.pre_main), + (EvalStmtPhase::PostMain, &self.post_main), + ] + .into_iter() + } + + #[allow(unused)] + pub(crate) fn iter_mut(&mut self) -> impl Iterator { + [ + (EvalStmtPhase::PreOperands, &mut self.pre_operands), + (EvalStmtPhase::PostOperands, &mut self.post_operands), + (EvalStmtPhase::PreMain, &mut self.pre_main), + (EvalStmtPhase::PostMain, &mut self.post_main), + ] + .into_iter() + } + + pub(crate) fn get(&self, phase: EvalStmtPhase) -> &T { + match phase { + EvalStmtPhase::PreOperands => &self.pre_operands, + EvalStmtPhase::PostOperands => &self.post_operands, + EvalStmtPhase::PreMain => &self.pre_main, + EvalStmtPhase::PostMain => &self.post_main, + } + } + pub fn post_main(&self) -> &T { + &self.post_main + } +} + +impl std::ops::Index for EvalStmtData { + type Output = T; + + fn index(&self, phase: EvalStmtPhase) -> &Self::Output { + self.get(phase) + } +} + +impl std::ops::IndexMut for EvalStmtData { + fn index_mut(&mut self, phase: EvalStmtPhase) -> &mut Self::Output { + match phase { + EvalStmtPhase::PreOperands => &mut self.pre_operands, + EvalStmtPhase::PostOperands => &mut self.post_operands, + EvalStmtPhase::PreMain => &mut self.pre_main, + EvalStmtPhase::PostMain => &mut self.post_main, + } + } +} + +impl<'tcx> HasValidityCheck<'tcx> for BorrowsStates<'tcx> { + fn check_validity(&self, repacker: PlaceRepacker<'_, 'tcx>) -> Result<(), String> { + self.pre_operands.check_validity(repacker)?; + self.post_operands.check_validity(repacker)?; + self.pre_main.check_validity(repacker)?; + self.post_main.check_validity(repacker) + } +} diff --git a/src/utils/place/mod.rs b/src/utils/place/mod.rs new file mode 100644 index 0000000..e3d45aa --- /dev/null +++ b/src/utils/place/mod.rs @@ -0,0 +1,667 @@ +// © 2023, ETH Zurich +// +// This Source Code Form is subject to the terms of the Mozilla Public +// License, v. 2.0. If a copy of the MPL was not distributed with this +// file, You can obtain one at http://mozilla.org/MPL/2.0/. + +use std::{ + cmp::Ordering, + fmt::{Debug, Formatter, Result}, + hash::{Hash, Hasher}, + mem::discriminant, +}; + +use derive_more::{Deref, DerefMut}; + +use crate::rustc_interface::{ + ast::Mutability, + data_structures::fx::FxHasher, + index::IndexVec, + middle::{ + mir::{Body, Local, Place as MirPlace, PlaceElem, PlaceRef, ProjectionElem}, + ty::{self, Ty, TyCtxt, TyKind}, + }, + target::abi::VariantIdx, +}; + +use crate::{ + borrows::{ + borrow_pcg_edge::LocalNode, + borrows_visitor::extract_regions, + region_projection::{ + MaybeRemoteRegionProjectionBase, PCGRegion, RegionIdx, RegionProjection, + RegionProjectionBaseLike, + }, + }, + combined_pcs::{LocalNodeLike, PCGNode, PCGNodeLike}, +}; +use crate::utils::json::ToJsonWithRepacker; +use super::{debug_info::DebugInfo, validity::HasValidityCheck, PlaceRepacker}; + +pub mod corrected; +pub mod maybe_old; +pub mod maybe_remote; +pub mod remote; + +#[derive(Clone, Copy, Deref, DerefMut)] +pub struct Place<'tcx>( + #[deref] + #[deref_mut] + PlaceRef<'tcx>, + DebugInfo<'static>, +); + +impl<'tcx> PartialOrd for Place<'tcx> { + fn partial_cmp(&self, other: &Self) -> Option { + Some(self.cmp(other)) + } +} + +impl<'tcx> Ord for Place<'tcx> { + fn cmp(&self, other: &Self) -> Ordering { + if self == other { + Ordering::Equal + } else { + let mut h1 = FxHasher::default(); + let mut h2 = FxHasher::default(); + self.hash(&mut h1); + other.hash(&mut h2); + match h1.finish().cmp(&h2.finish()) { + Ordering::Equal => { + panic!("Places have same hash, but they aren't equal!") + } + other => other, + } + } + } +} + +impl<'tcx> ToJsonWithRepacker<'tcx> for Place<'tcx> { + fn to_json(&self, repacker: PlaceRepacker<'_, 'tcx>) -> serde_json::Value { + self.to_json(repacker) + } +} + +impl<'tcx> LocalNodeLike<'tcx> for Place<'tcx> { + fn to_local_node(self) -> LocalNode<'tcx> { + LocalNode::Place(self.into()) + } +} + +impl<'tcx> PCGNodeLike<'tcx> for Place<'tcx> { + fn to_pcg_node(self) -> PCGNode<'tcx> { + self.into() + } +} + +impl<'tcx> RegionProjectionBaseLike<'tcx> for Place<'tcx> { + fn regions(&self, repacker: PlaceRepacker<'_, 'tcx>) -> IndexVec { + self.regions(repacker) + } + + fn to_maybe_remote_region_projection_base(&self) -> MaybeRemoteRegionProjectionBase<'tcx> { + (*self).into() + } +} + +impl<'tcx> From> for MaybeRemoteRegionProjectionBase<'tcx> { + fn from(place: Place<'tcx>) -> Self { + MaybeRemoteRegionProjectionBase::Place(place.into()) + } +} + +impl<'tcx> HasValidityCheck<'tcx> for Place<'tcx> { + fn check_validity( + &self, + _repacker: PlaceRepacker<'_, 'tcx>, + ) -> std::result::Result<(), std::string::String> { + Ok(()) + } +} + +/// A trait for PCG nodes that contain a single place. +pub trait HasPlace<'tcx> { + fn place(&self) -> Place<'tcx>; + + fn place_mut(&mut self) -> &mut Place<'tcx>; + + fn project_deeper(&self, repacker: PlaceRepacker<'_, 'tcx>, elem: PlaceElem<'tcx>) -> Self; +} + +impl<'tcx> HasPlace<'tcx> for Place<'tcx> { + fn place(&self) -> Place<'tcx> { + *self + } + fn place_mut(&mut self) -> &mut Place<'tcx> { + self + } + + fn project_deeper(&self, repacker: PlaceRepacker<'_, 'tcx>, elem: PlaceElem<'tcx>) -> Self { + self.0.project_deeper(&[elem], repacker.tcx()).into() + } +} + +impl<'tcx> Place<'tcx> { + pub fn new(local: Local, projection: &'tcx [PlaceElem<'tcx>]) -> Self { + Self(PlaceRef { local, projection }, DebugInfo::new_static()) + } + + pub fn projection(&self) -> &'tcx [PlaceElem<'tcx>] { + self.0.projection + } + + pub(crate) fn contains_unsafe_deref(&self, repacker: PlaceRepacker<'_, 'tcx>) -> bool { + for (p, proj) in self.iter_projections() { + if p.ty(repacker.body(), repacker.tcx()).ty.is_unsafe_ptr() + && matches!(proj, PlaceElem::Deref) + { + return true; + } + } + false + } + + pub(crate) fn ty_region(&self, repacker: PlaceRepacker<'_, 'tcx>) -> Option { + match self.ty(repacker).ty.kind() { + TyKind::Ref(region, _, _) => Some((*region).into()), + _ => None, + } + } + + pub fn prefix_place(&self, _repacker: PlaceRepacker<'_, 'tcx>) -> Option> { + let (prefix, _) = self.last_projection()?; + Some(Place::new(prefix.local, &prefix.projection)) + } + + /// In MIR, if a place is a field projection, then the type of the place + /// will be the determined by the last projection. If the type of that place + /// contains borrows, it appears that the associated regions are not necessarily + /// the same as the one given by the parent struct. + /// + /// In the case that this place is a reference-typed field projection, this function + /// returns a new place with the same data, but with the region of the reference determined + /// by the parent struct. Otherwise, the place is returned unchanged. + pub fn with_inherent_region(self, repacker: PlaceRepacker<'_, 'tcx>) -> Self { + if self.projection.is_empty() { + return self; + } + let base_place = Place::new(self.local, &self.projection[..self.projection.len() - 1]); + let base_place_ty = base_place.ty(repacker); + + if let Some(elem) = self.projection.last() + && let ProjectionElem::Field(field_idx, _) = elem + && let ty::TyKind::Adt(def, substs) = base_place_ty.ty.kind() + { + let variant = match base_place_ty.variant_index { + Some(v) => def.variant(v), + None => def.non_enum_variant(), + }; + let expected_ty = variant.fields[*field_idx].ty(repacker.tcx(), substs); + base_place.mk_place_elem(ProjectionElem::Field(*field_idx, expected_ty), repacker) + } else { + self + } + } + + pub fn region_projection( + &self, + idx: RegionIdx, + repacker: PlaceRepacker<'_, 'tcx>, + ) -> RegionProjection<'tcx, Self> { + self.region_projections(repacker)[idx] + } + + pub(crate) fn regions( + &self, + repacker: PlaceRepacker<'_, 'tcx>, + ) -> IndexVec { + extract_regions(self.ty(repacker).ty) + } + + pub(crate) fn region_projections( + &self, + repacker: PlaceRepacker<'_, 'tcx>, + ) -> IndexVec> { + let place = self.with_inherent_region(repacker); + extract_regions(place.ty(repacker).ty) + .iter() + .map(|region| RegionProjection::new((*region).into(), place.into(), repacker)) + .collect() + } + + pub fn projection_index( + &self, + region: PCGRegion, + repacker: PlaceRepacker<'_, 'tcx>, + ) -> Option { + extract_regions(self.ty(repacker).ty) + .into_iter_enumerated() + .find(|(_, r)| *r == region) + .map(|(idx, _)| idx) + } + + pub fn is_owned(&self, repacker: PlaceRepacker<'_, 'tcx>) -> bool { + !self.iter_projections().any(|(place, elem)| { + elem == ProjectionElem::Deref && !place.ty(repacker.mir, repacker.tcx).ty.is_box() + }) + } + + pub fn is_mut_ref(&self, body: &Body<'tcx>, tcx: TyCtxt<'tcx>) -> bool { + matches!( + self.0.ty(body, tcx).ty.kind(), + TyKind::Ref(_, _, Mutability::Mut) + ) + } + + pub fn is_ref(&self, repacker: PlaceRepacker<'_, 'tcx>) -> bool { + self.0.ty(repacker.mir, repacker.tcx).ty.is_ref() + } + + pub fn ref_mutability(&self, repacker: PlaceRepacker<'_, 'tcx>) -> Option { + self.0.ty(repacker.mir, repacker.tcx).ty.ref_mutability() + } + + pub fn project_deref(&self, repacker: PlaceRepacker<'_, 'tcx>) -> Self { + assert!( + self.ty(repacker).ty.is_ref() || self.ty(repacker).ty.is_box(), + "Expected ref or box, got {:?}", + self.ty(repacker).ty + ); + Place::new( + self.0.local, + self.0 + .project_deeper(&[PlaceElem::Deref], repacker.tcx()) + .projection, + ) + } + + pub(crate) fn compare_projections( + self, + other: Self, + ) -> impl Iterator, PlaceElem<'tcx>)> { + let left = self.projection.iter().copied(); + let right = other.projection.iter().copied(); + left.zip(right).map(|(e1, e2)| (elem_eq((e1, e2)), e1, e2)) + } + + /// Check if the place `left` is a prefix of `right` or vice versa. For example: + /// + /// + `partial_cmp(x.f, y.f) == None` + /// + `partial_cmp(x.f, x.g) == None` + /// + `partial_cmp(x.f, x.f) == Some(Equal)` + /// + `partial_cmp(x.f.g, x.f) == Some(Suffix)` + /// + `partial_cmp(x.f, x.f.g) == Some(Prefix)` + /// + `partial_cmp(x as None, x as Some.0) == Some(Both)` + /// + /// The ultimate question this answers is: are the two places mutually + /// exclusive (i.e. can we have both or not)? + /// For example, all of the following are mutually exclusive: + /// - `x` and `x.f` + /// - `(x as Ok).0` and `(x as Err).0` + /// - `x[_1]` and `x[_2]` + /// - `x[2 of 11]` and `x[5 of 14]` + /// But the following are not: + /// - `x` and `y` + /// - `x.f` and `x.g.h` + /// - `x[3 of 6]` and `x[4 of 6]` + pub(crate) fn partial_cmp(self, right: Self) -> Option { + if self.local != right.local { + return None; + } + let diff = self.compare_projections(right).find(|(eq, _, _)| !eq); + if let Some((_, left, right)) = diff { + use ProjectionElem::*; + fn is_index(elem: PlaceElem<'_>) -> bool { + matches!(elem, Index(_) | ConstantIndex { .. } | Subslice { .. }) + } + match (left, right) { + (Field(..), Field(..)) => None, + ( + ConstantIndex { + min_length: l, + from_end: lfe, + .. + }, + ConstantIndex { + min_length: r, + from_end: rfe, + .. + }, + ) if r == l && lfe == rfe => None, + (Downcast(_, _), Downcast(_, _)) | (OpaqueCast(_), OpaqueCast(_)) => { + Some(PlaceOrdering::Both) + } + (left, right) if is_index(left) && is_index(right) => Some(PlaceOrdering::Both), + diff => unreachable!("Unexpected diff: {diff:?}"), + } + } else { + Some(self.projection.len().cmp(&right.projection.len()).into()) + } + } + + /// Check if the place `self` is a prefix of `place`. For example: + /// + /// + `is_prefix(x.f, x.f) == true` + /// + `is_prefix(x.f, x.f.g) == true` + /// + `is_prefix(x.f.g, x.f) == false` + pub(crate) fn is_prefix(self, place: Self) -> bool { + Self::partial_cmp(self, place) + .map(|o| o == PlaceOrdering::Equal || o == PlaceOrdering::Prefix) + .unwrap_or(false) + } + + /// Check if the place `self` is an exact prefix of `place`. For example: + /// + /// + `is_prefix(x.f, x.f) == false` + /// + `is_prefix(x.f, x.f.g) == true` + /// + `is_prefix(x.f, x.f.g.h) == false` + pub fn is_prefix_exact(self, place: Self) -> bool { + self.0.projection.len() + 1 == place.0.projection.len() + && Self::partial_cmp(self, place) + .map(|o| o == PlaceOrdering::Prefix) + .unwrap_or(false) + } + + /// Check if the place `self` is a prefix of `place` or vice versa. For example: + /// + /// + `is_prefix(x.f, x.f) == None` + /// + `is_prefix(x.f, x.f.g) == Some(true)` + /// + `is_prefix(x.f.g, x.f) == Some(false)` + /// + `is_prefix(x.g, x.f) == None` + pub(crate) fn either_prefix(self, place: Self) -> Option { + Self::partial_cmp(self, place).and_then(|o| { + if o == PlaceOrdering::Prefix { + Some(true) + } else if o == PlaceOrdering::Suffix { + Some(false) + } else { + None + } + }) + } + + /// Returns `true` if either of the places can reach the other + /// with a series of expand/collapse operations. Note that + /// both operations are allowed and so e.g. + /// related_to(`_1[_4]`, `_1[_3]`) == true + pub fn related_to(self, right: Self) -> bool { + self.partial_cmp(right).is_some() + } + + pub fn common_prefix(self, other: Self) -> Self { + assert_eq!(self.local, other.local); + + let max_len = std::cmp::min(self.projection.len(), other.projection.len()); + let common_prefix = self + .compare_projections(other) + .position(|(eq, _, _)| !eq) + .unwrap_or(max_len); + Self::new(self.local, &self.projection[..common_prefix]) + } + + pub fn joinable_to(self, to: Self) -> Self { + assert!(self.is_prefix(to)); + let diff = to.projection.len() - self.projection.len(); + let to_proj = self.projection.len() + + to.projection[self.projection.len()..] + .iter() + .position(|p| !matches!(p, ProjectionElem::Deref | ProjectionElem::Field(..))) + .unwrap_or(diff); + Self::new(self.local, &to.projection[..to_proj]) + } + + pub fn last_projection(self) -> Option<(Self, PlaceElem<'tcx>)> { + self.0 + .last_projection() + .map(|(place, proj)| (place.into(), proj)) + } + + pub fn last_projection_ty(self) -> Option> { + self.last_projection().and_then(|(_, proj)| match proj { + ProjectionElem::Field(_, ty) | ProjectionElem::OpaqueCast(ty) => Some(ty), + _ => None, + }) + } + + pub fn is_deref_of(self, other: Self) -> bool { + self.projection.last() == Some(&ProjectionElem::Deref) + && other.is_prefix(self) + && other.projection.len() == self.projection.len() - 1 + } + + pub fn is_downcast_of(self, other: Self) -> Option { + if let Some(ProjectionElem::Downcast(_, index)) = self.projection.last() { + if other.is_prefix(self) && other.projection.len() == self.projection.len() - 1 { + Some(*index) + } else { + None + } + } else { + None + } + } + + pub fn is_deref(self) -> bool { + self.projection.last() == Some(&ProjectionElem::Deref) + } + + pub fn target_place(self) -> Option { + if let Some(ProjectionElem::Deref) = self.projection.last() { + Some(Place::new( + self.local, + &self.projection[..self.projection.len() - 1], + )) + } else { + None + } + } + + pub fn nearest_owned_place(self, repacker: PlaceRepacker<'_, 'tcx>) -> Self { + if self.is_owned(repacker) { + return self; + } + for (place, _) in self.iter_projections().rev() { + let place: Self = place.into(); + if place.is_owned(repacker) { + return place; + } + } + unreachable!() + } + + pub fn debug_info(&self) -> DebugInfo<'static> { + self.1 + } +} + +impl Debug for Place<'_> { + fn fmt(&self, fmt: &mut Formatter) -> Result { + for elem in self.projection.iter().rev() { + match elem { + ProjectionElem::OpaqueCast(_) | ProjectionElem::Downcast(_, _) => { + write!(fmt, "(").unwrap(); + } + ProjectionElem::Deref => { + write!(fmt, "(*").unwrap(); + } + ProjectionElem::Field(_, _) + | ProjectionElem::Index(_) + | ProjectionElem::ConstantIndex { .. } + | ProjectionElem::Subslice { .. } => {} + ProjectionElem::Subtype(_) => todo!(), + } + } + + write!(fmt, "{:?}", self.local)?; + + for &elem in self.projection.iter() { + match elem { + ProjectionElem::OpaqueCast(ty) => { + write!(fmt, "@{ty})")?; + } + ProjectionElem::Downcast(Some(name), _index) => { + write!(fmt, "@{name})")?; + } + ProjectionElem::Downcast(None, index) => { + write!(fmt, "@variant#{index:?})")?; + } + ProjectionElem::Deref => { + write!(fmt, ")")?; + } + ProjectionElem::Field(field, _ty) => { + write!(fmt, ".{:?}", field.index())?; + } + ProjectionElem::Index(ref index) => { + write!(fmt, "[{index:?}]")?; + } + ProjectionElem::ConstantIndex { + offset, + min_length, + from_end: false, + } => { + write!(fmt, "[{offset:?} of {min_length:?}]")?; + } + ProjectionElem::ConstantIndex { + offset, + min_length, + from_end: true, + } => { + write!(fmt, "[-{offset:?} of {min_length:?}]")?; + } + ProjectionElem::Subslice { + from, + to: 0, + from_end: true, + } => { + write!(fmt, "[{from:?}:]")?; + } + ProjectionElem::Subslice { + from: 0, + to, + from_end: true, + } => { + write!(fmt, "[:-{to:?}]")?; + } + ProjectionElem::Subslice { + from, + to, + from_end: true, + } => { + write!(fmt, "[{from:?}:-{to:?}]")?; + } + ProjectionElem::Subslice { + from, + to, + from_end: false, + } => { + write!(fmt, "[{from:?}..{to:?}]")?; + } + ProjectionElem::Subtype(_) => todo!(), + } + } + + Ok(()) + } +} + +fn elem_eq<'tcx>(to_cmp: (PlaceElem<'tcx>, PlaceElem<'tcx>)) -> bool { + use ProjectionElem::*; + match to_cmp { + (Field(left, _), Field(right, _)) => left == right, + (Downcast(_, left), Downcast(_, right)) => left == right, + (left, right) => left == right, + } +} + +impl PartialEq for Place<'_> { + fn eq(&self, other: &Self) -> bool { + self.local == other.local + && self.projection.len() == other.projection.len() + && self.compare_projections(*other).all(|(eq, _, _)| eq) + } +} +impl Eq for Place<'_> {} + +impl Hash for Place<'_> { + fn hash(&self, state: &mut H) { + self.0.local.hash(state); + let projection = self.0.projection; + for &pe in projection { + match pe { + ProjectionElem::Field(field, _) => { + discriminant(&pe).hash(state); + field.hash(state); + } + ProjectionElem::Downcast(_, variant) => { + discriminant(&pe).hash(state); + variant.hash(state); + } + _ => pe.hash(state), + } + } + } +} + +impl<'tcx> From> for Place<'tcx> { + fn from(value: PlaceRef<'tcx>) -> Self { + Self(value, DebugInfo::new_static()) + } +} +impl<'tcx> From> for Place<'tcx> { + fn from(value: MirPlace<'tcx>) -> Self { + Self(value.as_ref(), DebugInfo::new_static()) + } +} +impl<'tcx> From for Place<'tcx> { + fn from(value: Local) -> Self { + MirPlace::from(value).into() + } +} + +#[derive(Copy, Clone, Debug, PartialEq, Eq)] +pub enum PlaceOrdering { + // For example `x.f` to `x.f.g`. + Prefix, + // For example `x.f` and `x.f`. + Equal, + // For example `x.f.g` to `x.f`. + Suffix, + // Both places share a common prefix, but are not related by prefix or suffix. + // For example `x.f` and `x.h` + Both, +} + +impl PlaceOrdering { + pub fn is_eq(self) -> bool { + matches!(self, PlaceOrdering::Equal) + } + pub fn is_prefix(self) -> bool { + matches!(self, PlaceOrdering::Prefix) + } + pub fn is_suffix(self) -> bool { + matches!(self, PlaceOrdering::Suffix) + } + pub fn is_both(self) -> bool { + matches!(self, PlaceOrdering::Both) + } +} + +impl From for PlaceOrdering { + fn from(ordering: Ordering) -> Self { + match ordering { + Ordering::Less => PlaceOrdering::Prefix, + Ordering::Equal => PlaceOrdering::Equal, + Ordering::Greater => PlaceOrdering::Suffix, + } + } +} +impl From for Option { + fn from(ordering: PlaceOrdering) -> Self { + match ordering { + PlaceOrdering::Prefix => Some(Ordering::Less), + PlaceOrdering::Equal => Some(Ordering::Equal), + PlaceOrdering::Suffix => Some(Ordering::Greater), + PlaceOrdering::Both => None, + } + } +} diff --git a/test-files/37_demo_loop.rs b/test-files/37_demo_loop.rs new file mode 100644 index 0000000..f3eb0ba --- /dev/null +++ b/test-files/37_demo_loop.rs @@ -0,0 +1,26 @@ +struct List { + head: u32, + tail: Option>, +} + +impl List { + fn get_nth_loop(&mut self, n: usize) -> &mut u32 { + let mut i = 0; + let mut current = self; + while i < n { +// ~PCG: bb1[0] pre_operands: (*_12) at After(bb7[2]) -> current↓'?13 under conditions bb7 -> bb8,bb8 -> bb1, +// PCG: bb1[0] pre_operands: Loop(bb1): [Remote(_1)] -> [current↓'?13] under conditions bb1 +// PCG: bb1[0] pre_operands: Loop(bb1): [Remote(_1)↓'?11] -> [current↓'?13] under conditions bb1 +// PCG: bb2[0] pre_operands: Loop(bb1): [Remote(_1)] -> [current↓'?13] under conditions bb1 -> bb2, +// PCG: bb2[0] pre_operands: Loop(bb1): [Remote(_1)↓'?11] -> [current↓'?13] under conditions bb1 -> bb2, + current = match current.tail { + Some(ref mut tail) => tail, + None => unreachable!(), + }; + i += 1; + } + &mut current.head + } +} + +fn main() {} diff --git a/test-files/46_demo_cond_mut_borrow.rs b/test-files/46_demo_cond_mut_borrow.rs new file mode 100644 index 0000000..b832dd7 --- /dev/null +++ b/test-files/46_demo_cond_mut_borrow.rs @@ -0,0 +1,14 @@ +fn f(c: bool){ + let mut x = 1; + let mut y = 2; + let mut r = if c { + &mut x + } else { + &mut y + }; + *r = 7; + x += 1; +} + +fn main(){ +} diff --git a/test-files/47_demo_choose.rs b/test-files/47_demo_choose.rs new file mode 100644 index 0000000..6a12cf2 --- /dev/null +++ b/test-files/47_demo_choose.rs @@ -0,0 +1,14 @@ +fn choose<'a, T>(c: bool, x: &'a mut T, y: &'a mut T) -> &'a mut T { + if c { x } else { y } +} + +fn client(c: bool){ + let mut x = 1; + let mut y = 2; + let r = choose(c, &mut x, &mut y); + *r = 3; +} + +fn main(){ + client(true); +}