difftreelog
refactor dyn ObjValue
in: master
5 files changed
Cargo.lockdiffbeforeafterboth108 packageslockfile v3
Might be heavy and slow!
ahash
0.8.3crates.io↘ 3↖ 1sourceregistry+https://github.com/rust-lang/crates.io-indexchecksum2c99f64d1e06488f620f932677e24bc6e2897582980441ae90a671415bd7ec2fused byannotate-snippets
0.9.1crates.io↘ 2↖ 1sourceregistry+https://github.com/rust-lang/crates.io-indexchecksumc3b9d411ecbaf79885c6df4d75fff75858d5995ff25385657a28af47e82f9c36depends onanstream
0.3.2crates.io↘ 7↖ 1sourceregistry+https://github.com/rust-lang/crates.io-indexchecksum0ca84f3628370c59db74ee214b3263d58f9aadd9b4fe7e711fd87dc452b7f163depends onused byanstyle
1.0.1crates.io↘ 0↖ 3sourceregistry+https://github.com/rust-lang/crates.io-indexchecksum3a30da5c5f2d5e72842e00bcb57657162cdabef0931f40e2deb9b4140440cecdanstyle-parse
0.2.1crates.io↘ 1↖ 1sourceregistry+https://github.com/rust-lang/crates.io-indexchecksum938874ff5980b03a87c5524b3ae5b59cf99b1d6bc836848df7bc5ada9643c333depends onused byanstyle-query
1.0.0crates.io↘ 1↖ 1sourceregistry+https://github.com/rust-lang/crates.io-indexchecksum5ca11d4be1bab0c8bc8734a9aa7bf4ee8316d462a08c6ac5052f888fef5b494bdepends onused byanstyle-wincon
1.0.1crates.io↘ 2↖ 1sourceregistry+https://github.com/rust-lang/crates.io-indexchecksum180abfa45703aebe0093f79badacc01b8fd4ea2e35118747e5811127f926e188depends onused byanyhow
1.0.72crates.io↘ 0↖ 1sourceregistry+https://github.com/rust-lang/crates.io-indexchecksum3b13c32d80ecc7ab747b80c3784bce54ee8a7a0cc4fbda9bf4cda2cf6fe90854async-trait
0.1.71crates.io↘ 3↖ 1sourceregistry+https://github.com/rust-lang/crates.io-indexchecksuma564d521dd56509c4c47480d00b80ee55f7e385ae48db5744c67ad50c92d2ebfdepends onautocfg
1.1.0crates.io↘ 0↖ 5sourceregistry+https://github.com/rust-lang/crates.io-indexchecksumd468802bab17cbc0cc575e9b053f41e72aa36bfa6b7f55e3529ffa43161b97fabase64
0.21.2crates.io↘ 0↖ 1sourceregistry+https://github.com/rust-lang/crates.io-indexchecksum604178f6c5c21f02dc555784810edfb88d34ac2c73b2eae109655649ee73ce3dused bybincode
1.3.3crates.io↘ 1↖ 2sourceregistry+https://github.com/rust-lang/crates.io-indexchecksumb1f45e9417d87227c7a56d22e471c6206462cba514c7590c09aff4cf6d1ddcaddepends onbitflags
1.3.2crates.io↘ 0↖ 1sourceregistry+https://github.com/rust-lang/crates.io-indexchecksumbef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718aused bybitflags
2.3.3crates.io↘ 0↖ 1sourceregistry+https://github.com/rust-lang/crates.io-indexchecksum630be753d4e58660abd17930c71b647fe46c27ea6b63cc59e1e3851406972e42used byblock-buffer
0.10.4crates.io↘ 1↖ 1sourceregistry+https://github.com/rust-lang/crates.io-indexchecksum3078c7629b62d3f0439517fa394996acacc5cbc91c5a20d8c658e77abd503a71depends onused bycc
1.0.79crates.io↘ 0↖ 2sourceregistry+https://github.com/rust-lang/crates.io-indexchecksum50d30906286121d95be3d479533b458f87493b30a4b5f79a607db8f5d11aa91fcfg-if
1.0.0crates.io↘ 0↖ 4sourceregistry+https://github.com/rust-lang/crates.io-indexchecksumbaf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fdclap
4.3.12crates.io↘ 3↖ 3sourceregistry+https://github.com/rust-lang/crates.io-indexchecksum3eab9e8ceb9afdade1ab3f0fd8dbce5b1b2f468ad653baf10e771781b2b67b73clap_builder
4.3.12crates.io↘ 4↖ 1sourceregistry+https://github.com/rust-lang/crates.io-indexchecksum9f2763db829349bf00cfc06251268865ed4363b93a943174f638daf3ecdba2cdused byclap_complete
4.3.2crates.io↘ 1↖ 1sourceregistry+https://github.com/rust-lang/crates.io-indexchecksum5fc443334c81a804575546c5a8a79b4913b50e28d69232903604cada1de817cedepends onused byclap_derive
4.3.12crates.io↘ 4↖ 1sourceregistry+https://github.com/rust-lang/crates.io-indexchecksum54a9bb5758fc5dfe728d1019941681eccaf0cf8a4189b692a0ee2f2ecf90a050used byclap_lex
0.5.0crates.io↘ 0↖ 1sourceregistry+https://github.com/rust-lang/crates.io-indexchecksum2da6da31387c7e4ef160ffab6d5e7f00c42626fe39aea70a7b0f1773f7dd6c1bused bycolorchoice
1.0.0crates.io↘ 0↖ 1sourceregistry+https://github.com/rust-lang/crates.io-indexchecksumacbf1af155f9b9ef647e42cdc158db4b64a1b61f743629225fde6f3e0be2a7c7used bycpufeatures
0.2.9crates.io↘ 1↖ 3sourceregistry+https://github.com/rust-lang/crates.io-indexchecksuma17b76ff3a4162b0b27f354a0c87015ddad39d35f9c0c36607a3bdd175dde1f1depends oncrypto-common
0.1.6crates.io↘ 2↖ 1sourceregistry+https://github.com/rust-lang/crates.io-indexchecksum1bfb12502f3fc46cca1bb51ac28df9d618d813cdc3d2f25b9fe775a34af26bb3depends onused bydigest
0.10.7crates.io↘ 2↖ 3sourceregistry+https://github.com/rust-lang/crates.io-indexchecksum9ed9a281f7bc9b7576e61468ba615a66a5c8cfdff42420a70aa82701a3b1e292depends onerrno
0.3.1crates.io↘ 3↖ 1sourceregistry+https://github.com/rust-lang/crates.io-indexchecksum4bcfec3a70f97c962c307b2d2c56e358cf1d00b558d74262b5f929ee8cc7e73aused byerrno-dragonfly
0.1.2crates.io↘ 2↖ 1sourceregistry+https://github.com/rust-lang/crates.io-indexchecksumaa68f1b12764fab894d2755d2518754e71b4fd80ecfb822714a1206c2aab39bfdepends onused bygeneric-array
0.14.7crates.io↘ 2↖ 2sourceregistry+https://github.com/rust-lang/crates.io-indexchecksum85649ca51fd72272d7821adaf274ad91c288277713d9c18820d8499a7ff69e9adepends onhashbrown
0.12.3crates.io↘ 0↖ 1sourceregistry+https://github.com/rust-lang/crates.io-indexchecksum8a9ee70c43aaf417c914396645a0fa852624801b24ebb7ae78fe8272889ac888used byhashbrown
0.13.2crates.io↘ 1↖ 2sourceregistry+https://github.com/rust-lang/crates.io-indexchecksum43a3c133739dddd0d2990f9a4bdf8eb4b21ef50e4851ca85ab661199821d510edepends onheck
0.4.1crates.io↘ 0↖ 1sourceregistry+https://github.com/rust-lang/crates.io-indexchecksum95505c38b4572b2d910cecb0281560f54b440a19336cbbcb27bf6ce6adc6f5a8used byhermit-abi
0.3.2crates.io↘ 0↖ 1sourceregistry+https://github.com/rust-lang/crates.io-indexchecksum443144c8cdadd93ebf52ddb4056d257f5b52c04d3c804e657d19eb73fc33668bused byindexmap
1.9.3crates.io↘ 2↖ 1sourceregistry+https://github.com/rust-lang/crates.io-indexchecksumbd070e393353796e801d209ad339e89596eb4c8d430d18ede6a1cced8fafbd99depends onused byis-terminal
0.4.9crates.io↘ 3↖ 1sourceregistry+https://github.com/rust-lang/crates.io-indexchecksumcb0889898416213fab133e1d33a0e5858a48177452750691bde3666d0fdbaf8bused byitoa
1.0.9crates.io↘ 0↖ 1sourceregistry+https://github.com/rust-lang/crates.io-indexchecksumaf150ab688ff2122fcef229be89cb50dd66af9e01a4ff320cc137eecc9bacc38used byjrsonnet
0.5.0-pre94workspace↘ 8↖ 0jrsonnet-cli
0.5.0-pre94workspace↘ 5↖ 1jrsonnet-evaluator
0.5.0-pre94workspace↘ 17↖ 5depends on- annotate-snippets
0.9.1 - anyhow
1.0.72 - async-trait
0.1.71 - bincode
1.3.3 - hashbrown
0.13.2 - jrsonnet-gcmodule
0.3.6 - jrsonnet-interner
0.5.0-pre94 - jrsonnet-macros
0.5.0-pre94 - jrsonnet-parser
0.5.0-pre94 - jrsonnet-types
0.5.0-pre94 - num-bigint
0.4.3 - pathdiff
0.2.1 - rustc-hash
1.1.0 - serde
1.0.171 - static_assertions
1.1.0 - strsim
0.10.0 - thiserror
1.0.43
- annotate-snippets
jrsonnet-gcmodule
0.3.6crates.io↘ 2↖ 9sourceregistry+https://github.com/rust-lang/crates.io-indexchecksumc11fb98940a7f8b419619e98ccbf2e094671a5fdd0e277f05acd373071186d57jrsonnet-gcmodule-derive
0.3.6crates.io↘ 3↖ 1sourceregistry+https://github.com/rust-lang/crates.io-indexchecksum6bee774b7ba86fc86ee84482cd6732aa860ae3559f9827c65efd75c51e66ac76depends onused byjrsonnet-interner
0.5.0-pre94workspace↘ 5↖ 2jrsonnet-macros
0.5.0-pre94workspace↘ 3↖ 2jrsonnet-parser
0.5.0-pre94workspace↘ 6↖ 5jrsonnet-stdlib
0.5.0-pre94workspace↘ 15↖ 3depends onjrsonnet-types
0.5.0-pre94workspace↘ 2↖ 1depends onkeccak
0.1.4crates.io↘ 1↖ 1sourceregistry+https://github.com/rust-lang/crates.io-indexchecksum8f6d5ed8676d904364de097082f4e7d240b571b67989ced0240f08b7f966f940depends onused bylibc
0.2.147crates.io↘ 0↖ 6sourceregistry+https://github.com/rust-lang/crates.io-indexchecksumb4668fb0ea861c1df094127ac5f1da3409a82116a4ba74fca2e58ef927159bb3libjsonnet
0.5.0-pre94workspace↘ 4↖ 0linked-hash-map
0.5.6crates.io↘ 0↖ 1sourceregistry+https://github.com/rust-lang/crates.io-indexchecksum0717cef1bc8b636c6e1c1bbdefc09e6322da8a9321966e8928ef80d20f7f770fused bylinux-raw-sys
0.4.3crates.io↘ 0↖ 1sourceregistry+https://github.com/rust-lang/crates.io-indexchecksum09fc20d2ca12cb9f044c93e3bd6d32d523e6e2ec3db4f7b2939cd99026ecd3f0used bylock_api
0.4.10crates.io↘ 2↖ 1sourceregistry+https://github.com/rust-lang/crates.io-indexchecksumc1cc9717a20b1bb222f333e6a92fd32f7d8a18ddc5a3191a11af45dcbf4dcd16depends onused bymd5
0.7.0crates.io↘ 0↖ 1sourceregistry+https://github.com/rust-lang/crates.io-indexchecksum490cc448043f947bae3cbee9c203358d62dbee0db12107a74be5c30ccfd09771used bymimalloc-sys
0.1.6crates.io↘ 2↖ 1sourceregistry+https://github.com/rust-lang/crates.io-indexchecksum4aa3cefb626f6ae3d0b2f71c5378c89d2b1d4d7bc246b0ca9a7ee61a4daad291depends onused bymimallocator
0.1.3crates.io↘ 1↖ 1sourceregistry+https://github.com/rust-lang/crates.io-indexchecksum2d44fe4ebf6b538fcf39d9975c2b90bb3232d1ba8e8bffeacd004f27b20c577adepends onused bynum-bigint
0.4.3crates.io↘ 4↖ 2sourceregistry+https://github.com/rust-lang/crates.io-indexchecksumf93ab6289c7b344a8a9f60f88d80aa20032336fe78da341afc91c8a2341fc75fnum-integer
0.1.45crates.io↘ 2↖ 1sourceregistry+https://github.com/rust-lang/crates.io-indexchecksum225d3389fb3509a24c93f5c29eb6bde2586b98d9f016636dff58d7c6f7569cd9depends onused bynum-traits
0.2.15crates.io↘ 1↖ 2sourceregistry+https://github.com/rust-lang/crates.io-indexchecksum578ede34cf02f8924ab9447f50c28075b4d3e5b269972345e7e0372b38c6cdcddepends ononce_cell
1.18.0crates.io↘ 0↖ 2sourceregistry+https://github.com/rust-lang/crates.io-indexchecksumdd8b5dd2ae5ed71462c540258bedcb51965123ad7e7ccf4b9a8cafaa4a63576dused byparking_lot
0.12.1crates.io↘ 2↖ 1sourceregistry+https://github.com/rust-lang/crates.io-indexchecksum3742b2c103b9f06bc9fff0a37ff4912935851bee6d36f3c02bcc755bcfec228fdepends onused byparking_lot_core
0.9.8crates.io↘ 5↖ 1sourceregistry+https://github.com/rust-lang/crates.io-indexchecksum93f00c865fe7cabf650081affecd3871070f26767e7b2070a3ffae14c654b447used bypathdiff
0.2.1crates.io↘ 0↖ 1sourceregistry+https://github.com/rust-lang/crates.io-indexchecksum8835116a5c179084a830efb3adc117ab007512b535bc1a21c991d3b32a6b44ddpeg
0.8.1crates.io↘ 2↖ 2sourceregistry+https://github.com/rust-lang/crates.io-indexchecksuma07f2cafdc3babeebc087e499118343442b742cc7c31b4d054682cc598508554depends onpeg-macros
0.8.1crates.io↘ 3↖ 1sourceregistry+https://github.com/rust-lang/crates.io-indexchecksum4a90084dc05cf0428428e3d12399f39faad19b0909f64fb9170c9fdd6d9cd49bused bypeg-runtime
0.8.1crates.io↘ 0↖ 2sourceregistry+https://github.com/rust-lang/crates.io-indexchecksum9fa00462b37ead6d11a82c9d568b26682d78e0477dc02d1966c013af80969739used byproc-macro2
1.0.65crates.io↘ 1↖ 12sourceregistry+https://github.com/rust-lang/crates.io-indexchecksum92de25114670a878b1261c79c9f8f729fb97e95bac93f6312f583c60dd6a1dfedepends onquote
1.0.30crates.io↘ 1↖ 11sourceregistry+https://github.com/rust-lang/crates.io-indexchecksum5907a1b7c277254a8b15170f6e7c97cfa60ee7872a3217663bb81151e48184bbdepends onredox_syscall
0.3.5crates.io↘ 1↖ 1sourceregistry+https://github.com/rust-lang/crates.io-indexchecksum567664f262709473930a4bf9e51bf2ebf3348f2e748ccc50dea20646858f8f29depends onused byrustc-hash
1.1.0crates.io↘ 0↖ 2sourceregistry+https://github.com/rust-lang/crates.io-indexchecksum08d43f7aa6b08d49f382cde6a7982047c3426db949b1424bc4b7ec9ae12c6ce2rustix
0.38.4crates.io↘ 5↖ 1sourceregistry+https://github.com/rust-lang/crates.io-indexchecksum0a962918ea88d644592894bc6dc55acc6c0956488adcebbfb6e273506b7fd6e5used byryu
1.0.15crates.io↘ 0↖ 2sourceregistry+https://github.com/rust-lang/crates.io-indexchecksum1ad4cc8da4ef723ed60bced201181d83791ad433213d8c24efffda1eec85d741scopeguard
1.1.0crates.io↘ 0↖ 1sourceregistry+https://github.com/rust-lang/crates.io-indexchecksumd29ab0c6d3fc0ee92fe66e2d99f700eab17a8d57d1c1d3b748380fb20baa78cdused byserde
1.0.171crates.io↘ 1↖ 9sourceregistry+https://github.com/rust-lang/crates.io-indexchecksum30e27d1e4fd7659406c492fd6cfaf2066ba8773de45ca75e855590f856dc34a9depends onserde_derive
1.0.171crates.io↘ 3↖ 1sourceregistry+https://github.com/rust-lang/crates.io-indexchecksum389894603bd18c46fa56231694f8d827779c0951a667087194cf9de94ed24682depends onused byserde_json
1.0.103crates.io↘ 3↖ 1sourceregistry+https://github.com/rust-lang/crates.io-indexchecksumd03b412469450d4404fe8499a268edd7f8b79fecb074b0d812ad64ca21f4031bdepends onused byserde_yaml_with_quirks
0.8.24crates.io↘ 4↖ 1sourceregistry+https://github.com/rust-lang/crates.io-indexchecksum47c5983eba86eae2d0058c35fb1065ccffb23af7f8965871069269088098321aused bysha1
0.10.5crates.io↘ 3↖ 1sourceregistry+https://github.com/rust-lang/crates.io-indexchecksumf04293dc80c3993519f2d7f6f511707ee7094fe0c6d3406feb330cdb3540eba3depends onused bysha2
0.10.7crates.io↘ 3↖ 1sourceregistry+https://github.com/rust-lang/crates.io-indexchecksum479fb9d862239e610720565ca91403019f2f00410f1864c5aa7479b950a76ed8depends onused bysha3
0.10.8crates.io↘ 2↖ 1sourceregistry+https://github.com/rust-lang/crates.io-indexchecksum75872d278a8f37ef87fa0ddbda7802605cb18344497949862c0d4dcb291eba60depends onused bysmallvec
1.11.0crates.io↘ 0↖ 1sourceregistry+https://github.com/rust-lang/crates.io-indexchecksum62bb4feee49fdd9f707ef802e22365a35de4b7b299de4763d44bfea899442ff9used bystatic_assertions
1.1.0crates.io↘ 0↖ 2sourceregistry+https://github.com/rust-lang/crates.io-indexchecksuma2eb9349b6444b326872e140eb1cf5e7c522154d69e7a0ffb0fb81c06b37543fstrsim
0.10.0crates.io↘ 0↖ 2sourceregistry+https://github.com/rust-lang/crates.io-indexchecksum73473c0e59e6d5812c5dfe2a064a6444949f089e20eec9a2e5506596494e4623structdump
0.2.0crates.io↘ 3↖ 3sourceregistry+https://github.com/rust-lang/crates.io-indexchecksumb0570327507bf281d8a6e6b0d4c082b12cb6bcee27efce755aa5efacd44076c1structdump-derive
0.2.0crates.io↘ 3↖ 1sourceregistry+https://github.com/rust-lang/crates.io-indexchecksum29cc0b59cfa11f1bceda09a9a7e37e6a6c3138575fd24ade8aa9af6d09aedf28depends onused bysyn
1.0.109crates.io↘ 3↖ 3sourceregistry+https://github.com/rust-lang/crates.io-indexchecksum72b64191b275b66ffe2469e8af2c1cfe3bafa67b529ead792a6d0160888b4237syn
2.0.26crates.io↘ 3↖ 4sourceregistry+https://github.com/rust-lang/crates.io-indexchecksum45c3457aacde3c65315de5031ec191ce46604304d2446e803d71ade03308d970tests
0.1.0workspace↘ 4↖ 0thiserror
1.0.43crates.io↘ 1↖ 2sourceregistry+https://github.com/rust-lang/crates.io-indexchecksuma35fc5b8971143ca348fa6df4f024d4d55264f3468c71ad1c2f365b0a4d58c42depends onthiserror-impl
1.0.43crates.io↘ 3↖ 1sourceregistry+https://github.com/rust-lang/crates.io-indexchecksum463fe12d7993d3b327787537ce8dd4dfa058de32fc2b195ef3cde03dc4771e8fdepends onused bytypenum
1.16.0crates.io↘ 0↖ 2sourceregistry+https://github.com/rust-lang/crates.io-indexchecksum497961ef93d974e23eb6f433eb5fe1b7930b659f06d12dec6fc44a8f554c0bbaunicode-ident
1.0.11crates.io↘ 0↖ 3sourceregistry+https://github.com/rust-lang/crates.io-indexchecksum301abaae475aa91687eb82514b328ab47a211a533026cb25fc3e519b86adfc3cunicode-width
0.1.10crates.io↘ 0↖ 1sourceregistry+https://github.com/rust-lang/crates.io-indexchecksumc0edd1e5b14653f783770bce4a4dabb4a5108a5370a5f5d8cfe8710c361f6c8bused byutf8parse
0.2.1crates.io↘ 0↖ 2sourceregistry+https://github.com/rust-lang/crates.io-indexchecksum711b9620af191e0cdc7468a8d14e709c3dcdb115b36f838e601583af800a370aversion_check
0.9.4crates.io↘ 0↖ 2sourceregistry+https://github.com/rust-lang/crates.io-indexchecksum49874b5167b65d7193b8aba1567f5c7d93d001cafc34600cee003eda787e483fwinapi
0.3.9crates.io↘ 2↖ 1sourceregistry+https://github.com/rust-lang/crates.io-indexchecksum5c839a674fcd7a98952e593242ea400abe93992746761e38641405d28b00f419used bywinapi-i686-pc-windows-gnu
0.4.0crates.io↘ 0↖ 1sourceregistry+https://github.com/rust-lang/crates.io-indexchecksumac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6used bywinapi-x86_64-pc-windows-gnu
0.4.0crates.io↘ 0↖ 1sourceregistry+https://github.com/rust-lang/crates.io-indexchecksum712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183fused bywindows_aarch64_gnullvm
0.48.0crates.io↘ 0↖ 1sourceregistry+https://github.com/rust-lang/crates.io-indexchecksum91ae572e1b79dba883e0d315474df7305d12f569b400fcf90581b06062f7e1bcused bywindows_aarch64_msvc
0.48.0crates.io↘ 0↖ 1sourceregistry+https://github.com/rust-lang/crates.io-indexchecksumb2ef27e0d7bdfcfc7b868b317c1d32c641a6fe4629c171b8928c7b08d98d7cf3used bywindows_i686_gnu
0.48.0crates.io↘ 0↖ 1sourceregistry+https://github.com/rust-lang/crates.io-indexchecksum622a1962a7db830d6fd0a69683c80a18fda201879f0f447f065a3b7467daa241used bywindows_i686_msvc
0.48.0crates.io↘ 0↖ 1sourceregistry+https://github.com/rust-lang/crates.io-indexchecksum4542c6e364ce21bf45d69fdd2a8e455fa38d316158cfd43b3ac1c5b1b19f8e00used bywindows_x86_64_gnu
0.48.0crates.io↘ 0↖ 1sourceregistry+https://github.com/rust-lang/crates.io-indexchecksumca2b8a661f7628cbd23440e50b05d705db3686f894fc9580820623656af974b1used bywindows_x86_64_gnullvm
0.48.0crates.io↘ 0↖ 1sourceregistry+https://github.com/rust-lang/crates.io-indexchecksum7896dbc1f41e08872e9d5e8f8baa8fdd2677f29468c4e156210174edc7f7b953used bywindows_x86_64_msvc
0.48.0crates.io↘ 0↖ 1sourceregistry+https://github.com/rust-lang/crates.io-indexchecksum1a515f5799fe4961cb532f983ce2b23082366b898e52ffbce459c86f67c8378aused bywindows-sys
0.48.0crates.io↘ 1↖ 5sourceregistry+https://github.com/rust-lang/crates.io-indexchecksum677d2418bec65e3338edb076e806bc1ec15693c5d0104683f2efe857f61056a9depends onwindows-targets
0.48.1crates.io↘ 7↖ 2sourceregistry+https://github.com/rust-lang/crates.io-indexchecksum05d4b17490f70499f20b9e791dcf6a299785ce8af4d709018206dc5b4953e95fdepends onyaml-rust
0.4.5crates.io↘ 1↖ 1sourceregistry+https://github.com/rust-lang/crates.io-indexchecksum56c1936c4cc7a1c9ab21a1ebb602eb942ba868cbd44a99cb7cdc5892335e1c85depends onused byyansi-term
0.1.2crates.io↘ 1↖ 1sourceregistry+https://github.com/rust-lang/crates.io-indexchecksumfe5c30ade05e61656247b2e334a031dfd0cc466fadef865bdcdea8d537951bf1depends onused by
crates/jrsonnet-evaluator/Cargo.tomldiffbeforeafterboth--- a/crates/jrsonnet-evaluator/Cargo.toml
+++ b/crates/jrsonnet-evaluator/Cargo.toml
@@ -58,3 +58,4 @@
async-trait = { version = "0.1.60", optional = true }
# Bigint
num-bigint = { version = "0.4.3", features = ["serde"], optional = true }
+derivative = "2.2.0"
crates/jrsonnet-evaluator/src/gc.rsdiffbeforeafterboth--- a/crates/jrsonnet-evaluator/src/gc.rs
+++ b/crates/jrsonnet-evaluator/src/gc.rs
@@ -116,7 +116,10 @@
}
}
-pub struct GcHashMap<K, V>(pub HashMap<K, V, BuildHasherDefault<FxHasher>>);
+#[derive(Debug)]
+pub struct GcHashMap<K, V>(
+ pub HashMap<K, V, BuildHasherDefault<FxHasher>>
+);
impl<K, V> GcHashMap<K, V> {
pub fn new() -> Self {
Self(HashMap::default())
crates/jrsonnet-evaluator/src/obj.rsdiffbeforeafterboth--- a/crates/jrsonnet-evaluator/src/obj.rs
+++ b/crates/jrsonnet-evaluator/src/obj.rs
@@ -1,4 +1,5 @@
use std::{
+ any::Any,
cell::RefCell,
fmt::Debug,
hash::{Hash, Hasher},
@@ -94,11 +95,49 @@
use ordering::*;
+// 0 - add
+// 12 - visibility
+#[derive(Clone, Copy)]
+pub struct ObjFieldFlags(u8);
+impl ObjFieldFlags {
+ fn new(add: bool, visibility: Visibility) -> Self {
+ let mut v = 0;
+ if add {
+ v |= 1;
+ }
+ v |= match visibility {
+ Visibility::Normal => 0b000,
+ Visibility::Hidden => 0b010,
+ Visibility::Unhide => 0b100,
+ };
+ Self(v)
+ }
+ pub fn add(&self) -> bool {
+ self.0 & 1 != 0
+ }
+ pub fn visibility(&self) -> Visibility {
+ match (self.0 & 0b110) >> 1 {
+ 0b00 => Visibility::Normal,
+ 0b01 => Visibility::Hidden,
+ 0b10 => Visibility::Unhide,
+ _ => unreachable!(),
+ }
+ }
+}
+impl Debug for ObjFieldFlags {
+ fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
+ f.debug_struct("ObjFieldFlags")
+ .field("add", &self.add())
+ .field("visibility", &self.visibility())
+ .finish()
+ }
+}
+
#[allow(clippy::module_name_repetitions)]
#[derive(Debug, Trace)]
pub struct ObjMember {
- pub add: bool,
- pub visibility: Visibility,
+ #[trace(skip)]
+ flags: ObjFieldFlags,
original_index: FieldIndex,
pub invoke: MaybeUnbound,
pub location: Option<ExprLocation>,
@@ -121,18 +160,54 @@
#[allow(clippy::module_name_repetitions)]
#[derive(Trace)]
#[trace(tracking(force))]
-pub struct ObjValueInternals {
+pub struct OopObject {
sup: Option<ObjValue>,
- this: Option<ObjValue>,
-
+ // this: Option<ObjValue>,
assertions: Cc<Vec<TraceBox<dyn ObjectAssertion>>>,
assertions_ran: RefCell<GcHashSet<ObjValue>>,
this_entries: Cc<GcHashMap<IStr, ObjMember>>,
value_cache: RefCell<GcHashMap<(IStr, Option<WeakObjValue>), CacheValue>>,
}
+impl Debug for OopObject {
+ fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
+ f.debug_struct("OopObject")
+ .field("sup", &self.sup)
+ // .field("assertions", &self.assertions)
+ // .field("assertions_ran", &self.assertions_ran)
+ .field("this_entries", &self.this_entries)
+ // .field("value_cache", &self.value_cache)
+ .finish()
+ }
+}
+
+type EnumFieldsHandler<'a> = dyn FnMut(SuperDepth, FieldIndex, IStr, Visibility) -> bool + 'a;
+
+pub trait ObjectLike: Trace + Any + Debug {
+ fn extend_from(&self, sup: ObjValue) -> ObjValue;
+ /// When using standalone super in object, `this.super_obj.with_this(this)` is executed
+ fn with_this(&self, me: ObjValue, this: ObjValue) -> ObjValue {
+ ObjValue::new(ThisOverride { inner: me, this })
+ }
+ fn this(&self) -> Option<ObjValue> {
+ None
+ }
+ fn len(&self) -> usize;
+ fn is_empty(&self) -> bool;
+ // If callback returns false, iteration stops
+ fn enum_fields(&self, depth: SuperDepth, handler: &mut EnumFieldsHandler<'_>) -> bool;
+
+ fn has_field_include_hidden(&self, name: IStr) -> bool;
+ fn has_field(&self, name: IStr) -> bool;
+
+ fn get_for(&self, key: IStr, this: ObjValue) -> Result<Option<Val>>;
+ fn get_for_uncached(&self, key: IStr, this: ObjValue) -> Result<Option<Val>>;
+ fn field_visibility(&self, field: IStr) -> Option<Visibility>;
+
+ fn run_assertions_raw(&self, this: ObjValue) -> Result<()>;
+}
#[derive(Clone, Trace)]
-pub struct WeakObjValue(#[trace(skip)] pub(crate) Weak<ObjValueInternals>);
+pub struct WeakObjValue(#[trace(skip)] pub(crate) Weak<TraceBox<dyn ObjectLike>>);
impl PartialEq for WeakObjValue {
fn eq(&self, other: &Self) -> bool {
@@ -150,138 +225,259 @@
}
#[allow(clippy::module_name_repetitions)]
-#[derive(Clone, Trace)]
-pub struct ObjValue(pub(crate) Cc<ObjValueInternals>);
-impl Debug for ObjValue {
- fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
- if let Some(super_obj) = self.0.sup.as_ref() {
- if f.alternate() {
- write!(f, "{super_obj:#?}")?;
- } else {
- write!(f, "{super_obj:?}")?;
- }
- write!(f, " + ")?;
- }
- let mut debug = f.debug_struct("ObjValue");
- for (name, member) in self.0.this_entries.iter() {
- debug.field(name, member);
- }
- debug.finish_non_exhaustive()
+#[derive(Clone, Trace, Debug)]
+pub struct ObjValue(pub(crate) Cc<TraceBox<dyn ObjectLike>>);
+
+#[derive(Debug, Trace)]
+struct EmptyObject;
+impl ObjectLike for EmptyObject {
+ fn extend_from(&self, sup: ObjValue) -> ObjValue {
+ // obj + {} == obj
+ sup
+ }
+
+ fn this(&self) -> Option<ObjValue> {
+ None
+ }
+
+ fn len(&self) -> usize {
+ 0
}
+
+ fn is_empty(&self) -> bool {
+ true
+ }
+
+ fn enum_fields(&self, _depth: SuperDepth, _handler: &mut EnumFieldsHandler<'_>) -> bool {
+ false
+ }
+
+ fn has_field_include_hidden(&self, _name: IStr) -> bool {
+ false
+ }
+
+ fn has_field(&self, _name: IStr) -> bool {
+ false
+ }
+
+ fn get_for(&self, _key: IStr, _this: ObjValue) -> Result<Option<Val>> {
+ Ok(None)
+ }
+ fn get_for_uncached(&self, _key: IStr, _this: ObjValue) -> Result<Option<Val>> {
+ Ok(None)
+ }
+
+ fn run_assertions_raw(&self, _this: ObjValue) -> Result<()> {
+ Ok(())
+ }
+
+ fn field_visibility(&self, _field: IStr) -> Option<Visibility> {
+ None
+ }
}
+#[derive(Trace, Debug)]
+struct ThisOverride {
+ inner: ObjValue,
+ this: ObjValue,
+}
+impl ObjectLike for ThisOverride {
+ fn with_this(&self, _me: ObjValue, this: ObjValue) -> ObjValue {
+ ObjValue::new(ThisOverride {
+ inner: self.inner.clone(),
+ this,
+ })
+ }
+
+ fn extend_from(&self, sup: ObjValue) -> ObjValue {
+ self.inner.extend_from(sup).with_this(self.this.clone())
+ }
+
+ fn this(&self) -> Option<ObjValue> {
+ Some(self.this.clone())
+ }
+
+ fn len(&self) -> usize {
+ self.inner.len()
+ }
+
+ fn is_empty(&self) -> bool {
+ self.inner.is_empty()
+ }
+
+ fn enum_fields(&self, depth: SuperDepth, handler: &mut EnumFieldsHandler<'_>) -> bool {
+ self.inner.enum_fields(depth, handler)
+ }
+
+ fn has_field_include_hidden(&self, name: IStr) -> bool {
+ self.inner.has_field_include_hidden(name)
+ }
+
+ fn has_field(&self, name: IStr) -> bool {
+ self.inner.has_field(name)
+ }
+
+ fn get_for(&self, key: IStr, this: ObjValue) -> Result<Option<Val>> {
+ self.inner.get_for(key, this)
+ }
+
+ fn get_for_uncached(&self, key: IStr, this: ObjValue) -> Result<Option<Val>> {
+ self.inner.get_raw(key, this)
+ }
+
+ fn field_visibility(&self, field: IStr) -> Option<Visibility> {
+ self.inner.field_visibility(field)
+ }
+
+ fn run_assertions_raw(&self, this: ObjValue) -> Result<()> {
+ self.inner.run_assertions_raw(this)
+ }
+}
+
impl ObjValue {
- pub fn new(
- sup: Option<Self>,
- this_entries: Cc<GcHashMap<IStr, ObjMember>>,
- assertions: Cc<Vec<TraceBox<dyn ObjectAssertion>>>,
- ) -> Self {
- Self(Cc::new(ObjValueInternals {
- sup,
- this: None,
- assertions,
- assertions_ran: RefCell::new(GcHashSet::new()),
- this_entries,
- value_cache: RefCell::new(GcHashMap::new()),
- }))
+ pub fn new(v: impl ObjectLike) -> Self {
+ Self(Cc::new(tb!(v)))
}
pub fn new_empty() -> Self {
- Self::new(None, Cc::new(GcHashMap::new()), Cc::new(Vec::new()))
+ Self::new(EmptyObject)
}
pub fn builder() -> ObjValueBuilder {
ObjValueBuilder::new()
}
pub fn builder_with_capacity(capacity: usize) -> ObjValueBuilder {
ObjValueBuilder::with_capacity(capacity)
- }
- #[must_use]
- pub fn extend_from(&self, sup: Self) -> Self {
- match &self.0.sup {
- None => Self::new(
- Some(sup),
- self.0.this_entries.clone(),
- self.0.assertions.clone(),
- ),
- Some(v) => Self::new(
- Some(v.extend_from(sup)),
- self.0.this_entries.clone(),
- self.0.assertions.clone(),
- ),
- }
}
pub(crate) fn extend_with_raw_member(self, key: IStr, value: ObjMember) -> Self {
- let mut new = GcHashMap::with_capacity(1);
- new.insert(key, value);
- Self::new(Some(self), Cc::new(new), Cc::new(Vec::new()))
+ // let mut new = GcHashMap::with_capacity(1);
+ // new.insert(key, value);
+ // Self::new(Some(self), Cc::new(new), Cc::new(Vec::new()))
+ todo!()
}
pub fn extend_field(&mut self, name: IStr) -> ObjMemberBuilder<ExtendBuilder<'_>> {
ObjMemberBuilder::new(ExtendBuilder(self), name, FieldIndex::default())
}
#[must_use]
+ pub fn extend_from(&self, sup: Self) -> Self {
+ self.0.extend_from(sup)
+ }
+ #[must_use]
pub fn with_this(&self, this: Self) -> Self {
- Self(Cc::new(ObjValueInternals {
- sup: self.0.sup.clone(),
- assertions: self.0.assertions.clone(),
- assertions_ran: RefCell::new(GcHashSet::new()),
- this: Some(this),
- this_entries: self.0.this_entries.clone(),
- value_cache: RefCell::new(GcHashMap::new()),
- }))
+ self.0.with_this(self.clone(), this)
}
-
pub fn len(&self) -> usize {
- self.fields_visibility()
- .into_iter()
- .filter(|(_, (visible, _))| *visible)
- .count()
+ self.0.len()
+ }
+ pub fn is_empty(&self) -> bool {
+ self.0.is_empty()
+ }
+ pub fn enum_fields(&self, depth: SuperDepth, handler: &mut EnumFieldsHandler<'_>) -> bool {
+ self.0.enum_fields(depth, handler)
}
- pub fn is_empty(&self) -> bool {
- if !self.0.this_entries.is_empty() {
- return false;
+ pub fn has_field_include_hidden(&self, name: IStr) -> bool {
+ self.0.has_field_include_hidden(name)
+ }
+ pub fn has_field(&self, name: IStr) -> bool {
+ self.0.has_field(name)
+ }
+ pub fn has_field_ex(&self, name: IStr, include_hidden: bool) -> bool {
+ if include_hidden {
+ self.has_field_include_hidden(name)
+ } else {
+ self.has_field(name)
}
- self.0.sup.as_ref().map_or(true, Self::is_empty)
}
- /// Run callback for every field found in object
- ///
- /// Returns true if ended prematurely
- pub(crate) fn enum_fields(
+ pub fn get(&self, key: IStr) -> Result<Option<Val>> {
+ self.run_assertions()?;
+ self.get_for(key, self.0.this().unwrap_or(self.clone()))
+ }
+
+ pub fn get_for(&self, key: IStr, this: ObjValue) -> Result<Option<Val>> {
+ self.0.get_for(key, this)
+ }
+
+ fn get_raw(&self, key: IStr, this: ObjValue) -> Result<Option<Val>> {
+ self.0.get_for_uncached(key, this)
+ }
+
+ fn field_visibility(&self, field: IStr) -> Option<Visibility> {
+ self.0.field_visibility(field)
+ }
+
+ pub fn run_assertions(&self) -> Result<()> {
+ // FIXME: Should it use `self.0.this()` in case of standalone super?
+ self.run_assertions_raw(self.clone())
+ }
+ fn run_assertions_raw(&self, this: ObjValue) -> Result<()> {
+ self.0.run_assertions_raw(this)
+ }
+
+ pub fn iter(
&self,
- depth: SuperDepth,
- handler: &mut impl FnMut(SuperDepth, &IStr, &ObjMember) -> bool,
- ) -> bool {
- if let Some(s) = &self.0.sup {
- if s.enum_fields(depth.deeper(), handler) {
- return true;
- }
+ #[cfg(feature = "exp-preserve-order")] preserve_order: bool,
+ ) -> impl Iterator<Item = (IStr, Result<Val>)> + '_ {
+ let fields = self.fields(
+ #[cfg(feature = "exp-preserve-order")]
+ preserve_order,
+ );
+ fields.into_iter().map(|field| {
+ (
+ field.clone(),
+ self.get(field)
+ .map(|opt| opt.expect("iterating over keys, field exists")),
+ )
+ })
+ }
+ pub fn get_lazy(&self, key: IStr) -> Option<Thunk<Val>> {
+ #[derive(Trace)]
+ struct ThunkGet {
+ obj: ObjValue,
+ key: IStr,
}
- for (name, member) in self.0.this_entries.iter() {
- if handler(depth, name, member) {
- return true;
+ impl ThunkValue for ThunkGet {
+ type Output = Val;
+
+ fn get(self: Box<Self>) -> Result<Self::Output> {
+ Ok(self.obj.get(self.key)?.expect("field exists"))
}
}
- false
+
+ if !self.has_field_ex(key.clone(), true) {
+ return None;
+ }
+ Some(Thunk::new(ThunkGet {
+ obj: self.clone(),
+ key,
+ }))
}
-
- pub fn fields_visibility(&self) -> FxHashMap<IStr, (bool, FieldSortKey)> {
+ pub fn ptr_eq(a: &Self, b: &Self) -> bool {
+ Cc::ptr_eq(&a.0, &b.0)
+ }
+ pub fn downgrade(self) -> WeakObjValue {
+ WeakObjValue(self.0.downgrade())
+ }
+ fn fields_visibility(&self) -> FxHashMap<IStr, (bool, FieldSortKey)> {
let mut out = FxHashMap::default();
- self.enum_fields(SuperDepth::default(), &mut |depth, name, member| {
- let new_sort_key = FieldSortKey::new(depth, member.original_index);
- let entry = out.entry(name.clone());
- let (visible, _) = entry.or_insert((true, new_sort_key));
- match member.visibility {
- Visibility::Normal => {}
- Visibility::Hidden => {
- *visible = false;
- }
- Visibility::Unhide => {
- *visible = true;
- }
- };
- false
- });
+ self.enum_fields(
+ SuperDepth::default(),
+ &mut |depth, index, name, visibility| {
+ let new_sort_key = FieldSortKey::new(depth, index);
+ let entry = out.entry(name.clone());
+ let (visible, _) = entry.or_insert((true, new_sort_key));
+ match visibility {
+ Visibility::Normal => {}
+ Visibility::Hidden => {
+ *visible = false;
+ }
+ Visibility::Unhide => {
+ *visible = true;
+ }
+ };
+ false
+ },
+ );
out
}
pub fn fields_ex(
@@ -333,95 +529,122 @@
preserve_order,
)
}
+}
- pub fn field_visibility(&self, name: IStr) -> Option<Visibility> {
- if let Some(m) = self.0.this_entries.get(&name) {
- Some(match &m.visibility {
- Visibility::Normal => self
- .0
- .sup
- .as_ref()
- .and_then(|super_obj| super_obj.field_visibility(name))
- .unwrap_or(Visibility::Normal),
- v => *v,
- })
- } else if let Some(super_obj) = &self.0.sup {
- super_obj.field_visibility(name)
- } else {
- None
+impl OopObject {
+ pub fn new(
+ sup: Option<ObjValue>,
+ this_entries: Cc<GcHashMap<IStr, ObjMember>>,
+ assertions: Cc<Vec<TraceBox<dyn ObjectAssertion>>>,
+ ) -> Self {
+ Self {
+ sup,
+ // this: None,
+ assertions,
+ assertions_ran: RefCell::new(GcHashSet::new()),
+ this_entries,
+ value_cache: RefCell::new(GcHashMap::new()),
}
}
- fn has_field_include_hidden(&self, name: IStr) -> bool {
- if self.0.this_entries.contains_key(&name) {
- true
- } else if let Some(super_obj) = &self.0.sup {
- super_obj.has_field_include_hidden(name)
- } else {
- false
- }
+ fn evaluate_this(&self, v: &ObjMember, real_this: ObjValue) -> Result<Val> {
+ v.invoke.evaluate(self.sup.clone(), Some(real_this))
}
- pub fn has_field_ex(&self, name: IStr, include_hidden: bool) -> bool {
- if include_hidden {
- self.has_field_include_hidden(name)
- } else {
- self.has_field(name)
- }
+ // FIXME: Duplication between ObjValue and OopObject
+ fn fields_visibility(&self) -> FxHashMap<IStr, (bool, FieldSortKey)> {
+ let mut out = FxHashMap::default();
+ self.enum_fields(
+ SuperDepth::default(),
+ &mut |depth, index, name, visibility| {
+ let new_sort_key = FieldSortKey::new(depth, index);
+ let entry = out.entry(name.clone());
+ let (visible, _) = entry.or_insert((true, new_sort_key));
+ match visibility {
+ Visibility::Normal => {}
+ Visibility::Hidden => {
+ *visible = false;
+ }
+ Visibility::Unhide => {
+ *visible = true;
+ }
+ };
+ false
+ },
+ );
+ out
}
- pub fn has_field(&self, name: IStr) -> bool {
- self.field_visibility(name)
- .map_or(false, |v| v.is_visible())
+}
+
+impl ObjectLike for OopObject {
+ fn extend_from(&self, sup: ObjValue) -> ObjValue {
+ ObjValue::new(match &self.sup {
+ None => Self::new(
+ Some(sup),
+ self.this_entries.clone(),
+ self.assertions.clone(),
+ ),
+ Some(v) => Self::new(
+ Some(v.extend_from(sup)),
+ self.this_entries.clone(),
+ self.assertions.clone(),
+ ),
+ })
}
- pub fn iter(
- &self,
- #[cfg(feature = "exp-preserve-order")] preserve_order: bool,
- ) -> impl Iterator<Item = (IStr, Result<Val>)> + '_ {
- let fields = self.fields(
- #[cfg(feature = "exp-preserve-order")]
- preserve_order,
- );
- fields.into_iter().map(|field| {
- (
- field.clone(),
- self.get(field)
- .map(|opt| opt.expect("iterating over keys, field exists")),
- )
- })
+ fn len(&self) -> usize {
+ self.fields_visibility()
+ .into_iter()
+ .filter(|(_, (visible, _))| *visible)
+ .count()
}
- pub fn get_lazy(&self, key: IStr) -> Option<Thunk<Val>> {
- #[derive(Trace)]
- struct ThunkGet {
- obj: ObjValue,
- key: IStr,
+
+ fn is_empty(&self) -> bool {
+ if !self.this_entries.is_empty() {
+ return false;
}
- impl ThunkValue for ThunkGet {
- type Output = Val;
+ self.sup.as_ref().map_or(true, ObjValue::is_empty)
+ }
- fn get(self: Box<Self>) -> Result<Self::Output> {
- Ok(self.obj.get(self.key)?.expect("field exists"))
+ /// Run callback for every field found in object
+ ///
+ /// Returns true if ended prematurely
+ fn enum_fields(&self, depth: SuperDepth, handler: &mut EnumFieldsHandler<'_>) -> bool {
+ if let Some(s) = &self.sup {
+ if s.enum_fields(depth.deeper(), handler) {
+ return true;
+ }
+ }
+ for (name, member) in self.this_entries.iter() {
+ if handler(
+ depth,
+ member.original_index,
+ name.clone(),
+ member.flags.visibility(),
+ ) {
+ return true;
}
}
+ false
+ }
- if !self.has_field_ex(key.clone(), true) {
- return None;
+ fn has_field_include_hidden(&self, name: IStr) -> bool {
+ if self.this_entries.contains_key(&name) {
+ true
+ } else if let Some(super_obj) = &self.sup {
+ super_obj.has_field_include_hidden(name)
+ } else {
+ false
}
- Some(Thunk::new(ThunkGet {
- obj: self.clone(),
- key,
- }))
}
- pub fn get(&self, key: IStr) -> Result<Option<Val>> {
- self.get_for(key, self.0.this.clone().unwrap_or_else(|| self.clone()))
+ fn has_field(&self, name: IStr) -> bool {
+ self.field_visibility(name)
+ .map_or(false, |v| v.is_visible())
}
- pub fn get_for(&self, key: IStr, this: Self) -> Result<Option<Val>> {
- self.run_assertions()?;
- let cache_key = (
- key.clone(),
- (!ObjValue::ptr_eq(&this, self)).then(|| this.clone().downgrade()),
- );
- if let Some(v) = self.0.value_cache.borrow().get(&cache_key) {
+
+ fn get_for(&self, key: IStr, this: ObjValue) -> Result<Option<Val>> {
+ let cache_key = (key.clone(), Some(this.clone().downgrade()));
+ if let Some(v) = self.value_cache.borrow().get(&cache_key) {
return Ok(match v {
CacheValue::Cached(v) => Some(v.clone()),
CacheValue::NotFound => None,
@@ -429,18 +652,16 @@
CacheValue::Errored(e) => return Err(e.clone()),
});
}
- self.0
- .value_cache
+ self.value_cache
.borrow_mut()
.insert(cache_key.clone(), CacheValue::Pending);
- let value = self.get_raw(key, this).map_err(|e| {
- self.0
- .value_cache
+ let value = self.get_for_uncached(key, this).map_err(|e| {
+ self.value_cache
.borrow_mut()
.insert(cache_key.clone(), CacheValue::Errored(e.clone()));
e
})?;
- self.0.value_cache.borrow_mut().insert(
+ self.value_cache.borrow_mut().insert(
cache_key,
value
.as_ref()
@@ -448,13 +669,12 @@
);
Ok(value)
}
-
- fn get_raw(&self, key: IStr, real_this: Self) -> Result<Option<Val>> {
- match (self.0.this_entries.get(&key), &self.0.sup) {
+ fn get_for_uncached(&self, key: IStr, real_this: ObjValue) -> Result<Option<Val>> {
+ match (self.this_entries.get(&key), &self.sup) {
(Some(k), None) => Ok(Some(self.evaluate_this(k, real_this)?)),
(Some(k), Some(super_obj)) => {
let our = self.evaluate_this(k, real_this.clone())?;
- if k.add {
+ if k.flags.add() {
super_obj
.get_raw(key, real_this)?
.map_or(Ok(Some(our.clone())), |v| {
@@ -468,40 +688,43 @@
(None, None) => Ok(None),
}
}
- fn evaluate_this(&self, v: &ObjMember, real_this: Self) -> Result<Val> {
- v.invoke.evaluate(self.0.sup.clone(), Some(real_this))
+ fn field_visibility(&self, name: IStr) -> Option<Visibility> {
+ if let Some(m) = self.this_entries.get(&name) {
+ Some(match &m.flags.visibility() {
+ Visibility::Normal => self
+ .sup
+ .as_ref()
+ .and_then(|super_obj| super_obj.field_visibility(name))
+ .unwrap_or(Visibility::Normal),
+ v => *v,
+ })
+ } else if let Some(super_obj) = &self.sup {
+ super_obj.field_visibility(name)
+ } else {
+ None
+ }
}
- fn run_assertions_raw(&self, real_this: &Self) -> Result<()> {
- if self.0.assertions.is_empty() {
- if let Some(super_obj) = &self.0.sup {
+ fn run_assertions_raw(&self, real_this: ObjValue) -> Result<()> {
+ if self.assertions.is_empty() {
+ if let Some(super_obj) = &self.sup {
super_obj.run_assertions_raw(real_this)?;
}
return Ok(());
}
- if self.0.assertions_ran.borrow_mut().insert(real_this.clone()) {
- for assertion in self.0.assertions.iter() {
- if let Err(e) = assertion.run(self.0.sup.clone(), Some(real_this.clone())) {
- self.0.assertions_ran.borrow_mut().remove(real_this);
+ if self.assertions_ran.borrow_mut().insert(real_this.clone()) {
+ for assertion in self.assertions.iter() {
+ if let Err(e) = assertion.run(self.sup.clone(), Some(real_this.clone())) {
+ self.assertions_ran.borrow_mut().remove(&real_this);
return Err(e);
}
}
- if let Some(super_obj) = &self.0.sup {
+ if let Some(super_obj) = &self.sup {
super_obj.run_assertions_raw(real_this)?;
}
}
Ok(())
- }
- pub fn run_assertions(&self) -> Result<()> {
- self.run_assertions_raw(self)
- }
-
- pub fn ptr_eq(a: &Self, b: &Self) -> bool {
- Cc::ptr_eq(&a.0, &b.0)
}
- pub fn downgrade(self) -> WeakObjValue {
- WeakObjValue(self.0.downgrade())
- }
}
impl PartialEq for ObjValue {
@@ -556,7 +779,14 @@
}
pub fn build(self) -> ObjValue {
- ObjValue::new(self.sup, Cc::new(self.map), Cc::new(self.assertions))
+ if self.sup.is_none() && self.map.is_empty() && self.assertions.is_empty() {
+ return ObjValue::new_empty();
+ }
+ ObjValue::new(OopObject::new(
+ self.sup,
+ Cc::new(self.map),
+ Cc::new(self.assertions),
+ ))
}
}
impl Default for ObjValueBuilder {
@@ -612,8 +842,7 @@
self.kind,
self.name,
ObjMember {
- add: self.add,
- visibility: self.visibility,
+ flags: ObjFieldFlags::new(self.add, self.visibility),
original_index: self.original_index,
invoke: binding,
location: self.location,
crates/jrsonnet-evaluator/src/val.rsdiffbeforeafterboth--- a/crates/jrsonnet-evaluator/src/val.rs
+++ b/crates/jrsonnet-evaluator/src/val.rs
@@ -1,6 +1,7 @@
use std::{
cell::RefCell,
fmt::{self, Debug, Display},
+ hash::Hasher,
mem::replace,
rc::Rc,
};
@@ -8,6 +9,7 @@
use jrsonnet_gcmodule::{Cc, Trace};
use jrsonnet_interner::IStr;
use jrsonnet_types::ValType;
+use rustc_hash::FxHasher;
pub use crate::arr::{ArrValue, ArrayLike};
use crate::{