git.delta.rocks / jrsonnet / refs/commits / bde2637fa85f

difftreelog

build switch to released gcmodule fork

Yaroslav Bolyukin2022-06-05parent: #d76beb2.patch.diff
in: master

38 files changed

modifiedCargo.lockdiffbeforeafterboth
2525
26[[package]]26[[package]]
27name = "anyhow"27name = "anyhow"
28version = "1.0.49"28version = "1.0.57"
29source = "registry+https://github.com/rust-lang/crates.io-index"29source = "registry+https://github.com/rust-lang/crates.io-index"
30checksum = "0a03e93e97a28fbc9f42fbc5ba0886a3c67eb637b476dbee711f80a6ffe8223d"30checksum = "08f9b8508dccb7687a1d6c4ce66b2b0ecef467c94667de27d8d7fe1f8d2a9cdc"
3131
32[[package]]32[[package]]
33name = "atty"33name = "atty"
4242
43[[package]]43[[package]]
44name = "autocfg"44name = "autocfg"
45version = "1.0.1"45version = "1.1.0"
46source = "registry+https://github.com/rust-lang/crates.io-index"46source = "registry+https://github.com/rust-lang/crates.io-index"
47checksum = "cdb031dd78e28731d87d56cc8ffef4a8f36ca26c38fe2de700543e627f8a464a"47checksum = "d468802bab17cbc0cc575e9b053f41e72aa36bfa6b7f55e3529ffa43161b97fa"
4848
49[[package]]49[[package]]
50name = "base64"50name = "base64"
6969
70[[package]]70[[package]]
71name = "cc"71name = "cc"
72version = "1.0.72"72version = "1.0.73"
73source = "registry+https://github.com/rust-lang/crates.io-index"73source = "registry+https://github.com/rust-lang/crates.io-index"
74checksum = "22a9137b95ea06864e018375b72adfb7db6e6f68cfc8df5a04d00288050485ee"74checksum = "2fff2a6927b3bb87f9595d67196a70493f627687a71d87a0d692242c33f58c11"
7575
76[[package]]76[[package]]
77name = "cfg-if"77name = "cfg-if"
8787
88[[package]]88[[package]]
89name = "clap"89name = "clap"
90version = "3.1.13"90version = "3.1.18"
91source = "registry+https://github.com/rust-lang/crates.io-index"91source = "registry+https://github.com/rust-lang/crates.io-index"
92checksum = "c4b3ee449efa0c4f95cd48b00539829d3655a98e189a90617246492788d22404"92checksum = "d2dbdf4bdacb33466e854ce889eee8dfd5729abf7ccd7664d0a2d60cd384440b"
93dependencies = [93dependencies = [
94 "atty",94 "atty",
95 "bitflags",95 "bitflags",
104104
105[[package]]105[[package]]
106name = "clap_complete"106name = "clap_complete"
107version = "3.1.3"107version = "3.1.4"
108source = "registry+https://github.com/rust-lang/crates.io-index"108source = "registry+https://github.com/rust-lang/crates.io-index"
109checksum = "1d7ca9141e27e6ebc52e3c378b0c07f3cea52db46ed1cc5861735fb697b56356"109checksum = "da92e6facd8d73c22745a5d3cbb59bdf8e46e3235c923e516527d8e81eec14a4"
110dependencies = [110dependencies = [
111 "clap",111 "clap",
112]112]
113113
114[[package]]114[[package]]
115name = "clap_derive"115name = "clap_derive"
116version = "3.1.7"116version = "3.1.18"
117source = "registry+https://github.com/rust-lang/crates.io-index"117source = "registry+https://github.com/rust-lang/crates.io-index"
118checksum = "a3aab4734e083b809aaf5794e14e756d1c798d2c69c7f7de7a09a2f5214993c1"118checksum = "25320346e922cffe59c0bbc5410c8d8784509efb321488971081313cb1e1a33c"
119dependencies = [119dependencies = [
120 "heck",120 "heck",
121 "proc-macro-error",121 "proc-macro-error",
148source = "registry+https://github.com/rust-lang/crates.io-index"148source = "registry+https://github.com/rust-lang/crates.io-index"
149checksum = "56899898ce76aaf4a0f24d914c97ea6ed976d42fec6ad33fcbb0a1103e07b2b0"149checksum = "56899898ce76aaf4a0f24d914c97ea6ed976d42fec6ad33fcbb0a1103e07b2b0"
150
151[[package]]
152name = "gcmodule"
153version = "0.3.3"
154source = "git+https://github.com/CertainLach/gcmodule?branch=jrsonnet#f72713c24c2b1bf5a78f1d01bee5a0f52bc2a094"
155dependencies = [
156 "gcmodule_derive",
157 "parking_lot",
158]
159
160[[package]]
161name = "gcmodule_derive"
162version = "0.3.3"
163source = "git+https://github.com/CertainLach/gcmodule?branch=jrsonnet#f72713c24c2b1bf5a78f1d01bee5a0f52bc2a094"
164dependencies = [
165 "proc-macro2",
166 "quote",
167 "syn",
168 "synstructure",
169]
170150
171[[package]]151[[package]]
172name = "getrandom"152name = "getrandom"
211191
212[[package]]192[[package]]
213name = "indexmap"193name = "indexmap"
214version = "1.7.0"194version = "1.8.2"
215source = "registry+https://github.com/rust-lang/crates.io-index"195source = "registry+https://github.com/rust-lang/crates.io-index"
216checksum = "bc633605454125dec4b66843673f01c7df2b89479b32e0ed634e43a91cff62a5"196checksum = "e6012d540c5baa3589337a98ce73408de9b5a25ec9fc2c6fd6be8f0d39e0ca5a"
217dependencies = [197dependencies = [
218 "autocfg",198 "autocfg",
219 "hashbrown 0.11.2",199 "hashbrown 0.11.2",
220]200]
221201
222[[package]]202[[package]]
223name = "itoa"203name = "itoa"
224version = "0.4.8"204version = "1.0.2"
225source = "registry+https://github.com/rust-lang/crates.io-index"205source = "registry+https://github.com/rust-lang/crates.io-index"
226checksum = "b71991ff56294aa922b450139ee08b3bfc70982c6b2c7562771375cf73542dd4"206checksum = "112c678d4050afce233f4f2852bb2eb519230b3cf12f33585275537d7e41578d"
227207
228[[package]]208[[package]]
229name = "jrsonnet"209name = "jrsonnet"
230version = "0.4.2"210version = "0.4.2"
231dependencies = [211dependencies = [
232 "clap",212 "clap",
233 "clap_complete",213 "clap_complete",
234 "gcmodule",
235 "jrsonnet-cli",214 "jrsonnet-cli",
236 "jrsonnet-evaluator",215 "jrsonnet-evaluator",
216 "jrsonnet-gcmodule",
237 "jrsonnet-parser",217 "jrsonnet-parser",
238 "mimallocator",218 "mimallocator",
239 "thiserror",219 "thiserror",
244version = "0.4.2"224version = "0.4.2"
245dependencies = [225dependencies = [
246 "clap",226 "clap",
247 "gcmodule",
248 "jrsonnet-evaluator",227 "jrsonnet-evaluator",
228 "jrsonnet-gcmodule",
249 "jrsonnet-parser",229 "jrsonnet-parser",
250]230]
251231
257 "anyhow",237 "anyhow",
258 "base64",238 "base64",
259 "bincode",239 "bincode",
260 "gcmodule",
261 "hashbrown 0.12.1",240 "hashbrown 0.12.1",
241 "jrsonnet-gcmodule",
262 "jrsonnet-interner",242 "jrsonnet-interner",
263 "jrsonnet-macros",243 "jrsonnet-macros",
264 "jrsonnet-parser",244 "jrsonnet-parser",
275 "thiserror",255 "thiserror",
276]256]
257
258[[package]]
259name = "jrsonnet-gcmodule"
260version = "0.3.4"
261source = "registry+https://github.com/rust-lang/crates.io-index"
262checksum = "22d4e1572e4b61e4f5deb3701312a330df0e69b48805a540d740e5e53ac8c78a"
263dependencies = [
264 "jrsonnet-gcmodule-derive",
265 "parking_lot",
266]
267
268[[package]]
269name = "jrsonnet-gcmodule-derive"
270version = "0.3.4"
271source = "registry+https://github.com/rust-lang/crates.io-index"
272checksum = "ae2f3bf7d38e0a9098b5b9062a7d9e7a97a206bc3c91118d76e7e37f2e0f1202"
273dependencies = [
274 "proc-macro2",
275 "quote",
276 "syn",
277]
277278
278[[package]]279[[package]]
279name = "jrsonnet-interner"280name = "jrsonnet-interner"
280version = "0.4.2"281version = "0.4.2"
281dependencies = [282dependencies = [
282 "gcmodule",
283 "hashbrown 0.12.1",283 "hashbrown 0.12.1",
284 "jrsonnet-gcmodule",
284 "rustc-hash",285 "rustc-hash",
285 "serde",286 "serde",
286]287]
298name = "jrsonnet-parser"299name = "jrsonnet-parser"
299version = "0.4.2"300version = "0.4.2"
300dependencies = [301dependencies = [
301 "gcmodule",302 "jrsonnet-gcmodule",
302 "jrsonnet-interner",303 "jrsonnet-interner",
303 "jrsonnet-stdlib",304 "jrsonnet-stdlib",
304 "peg",305 "peg",
314name = "jrsonnet-types"315name = "jrsonnet-types"
315version = "0.4.2"316version = "0.4.2"
316dependencies = [317dependencies = [
317 "gcmodule",318 "jrsonnet-gcmodule",
318 "peg",319 "peg",
319]320]
320321
321[[package]]322[[package]]
322name = "jsonnet"323name = "jsonnet"
323version = "0.4.2"324version = "0.4.2"
324dependencies = [325dependencies = [
325 "gcmodule",
326 "jrsonnet-evaluator",326 "jrsonnet-evaluator",
327 "jrsonnet-gcmodule",
327 "jrsonnet-parser",328 "jrsonnet-parser",
328]329]
329330
335336
336[[package]]337[[package]]
337name = "libc"338name = "libc"
338version = "0.2.125"339version = "0.2.126"
339source = "registry+https://github.com/rust-lang/crates.io-index"340source = "registry+https://github.com/rust-lang/crates.io-index"
340checksum = "5916d2ae698f6de9bfb891ad7a8d65c09d232dc58cc4ac433c7da3b2fd84bc2b"341checksum = "349d5a591cd28b49e1d1037471617a32ddcda5731b99419008085f72d5a53836"
341342
342[[package]]343[[package]]
343name = "linked-hash-map"344name = "linked-hash-map"
381382
382[[package]]383[[package]]
383name = "once_cell"384name = "once_cell"
384version = "1.10.0"385version = "1.12.0"
385source = "registry+https://github.com/rust-lang/crates.io-index"386source = "registry+https://github.com/rust-lang/crates.io-index"
386checksum = "87f3e037eac156d1775da914196f0f37741a274155e34a0b7e427c35d2a2ecb9"387checksum = "7709cef83f0c1f58f666e746a08b21e0085f7440fa6a29cc194d68aac97a4225"
387388
388[[package]]389[[package]]
389name = "os_str_bytes"390name = "os_str_bytes"
390version = "6.0.0"391version = "6.1.0"
391source = "registry+https://github.com/rust-lang/crates.io-index"392source = "registry+https://github.com/rust-lang/crates.io-index"
392checksum = "8e22443d1643a904602595ba1cd8f7d896afe56d26712531c5ff73a15b2fbf64"393checksum = "21326818e99cfe6ce1e524c2a805c189a99b5ae555a35d19f9a284b427d86afa"
393394
394[[package]]395[[package]]
395name = "parking_lot"396name = "parking_lot"
474475
475[[package]]476[[package]]
476name = "proc-macro2"477name = "proc-macro2"
477version = "1.0.32"478version = "1.0.39"
478source = "registry+https://github.com/rust-lang/crates.io-index"479source = "registry+https://github.com/rust-lang/crates.io-index"
479checksum = "ba508cc11742c0dc5c1659771673afbab7a0efab23aa17e854cbab0837ed0b43"480checksum = "c54b25569025b7fc9651de43004ae593a75ad88543b17178aa5e1b9c4f15f56f"
480dependencies = [481dependencies = [
481 "unicode-xid",482 "unicode-ident",
482]483]
483484
484[[package]]485[[package]]
485name = "quote"486name = "quote"
486version = "1.0.10"487version = "1.0.18"
487source = "registry+https://github.com/rust-lang/crates.io-index"488source = "registry+https://github.com/rust-lang/crates.io-index"
488checksum = "38bc8cc6a5f2e3655e0899c1b848643b2562f853f114bfec7be120678e3ace05"489checksum = "a1feb54ed693b93a84e14094943b84b7c4eae204c512b7ccb95ab0c66d278ad1"
489dependencies = [490dependencies = [
490 "proc-macro2",491 "proc-macro2",
491]492]
504505
505[[package]]506[[package]]
506name = "ryu"507name = "ryu"
507version = "1.0.5"508version = "1.0.10"
508source = "registry+https://github.com/rust-lang/crates.io-index"509source = "registry+https://github.com/rust-lang/crates.io-index"
509checksum = "71d301d4193d031abdd79ff7e3dd721168a9572ef3fe51a1517aba235bd8f86e"510checksum = "f3f6f92acf49d1b98f7a81226834412ada05458b7364277387724a237f062695"
510511
511[[package]]512[[package]]
512name = "scopeguard"513name = "scopeguard"
516517
517[[package]]518[[package]]
518name = "serde"519name = "serde"
519version = "1.0.130"520version = "1.0.137"
520source = "registry+https://github.com/rust-lang/crates.io-index"521source = "registry+https://github.com/rust-lang/crates.io-index"
521checksum = "f12d06de37cf59146fbdecab66aa99f9fe4f78722e3607577a5375d66bd0c913"522checksum = "61ea8d54c77f8315140a05f4c7237403bf38b72704d031543aa1d16abbf517d1"
522dependencies = [523dependencies = [
523 "serde_derive",524 "serde_derive",
524]525]
525526
526[[package]]527[[package]]
527name = "serde_derive"528name = "serde_derive"
528version = "1.0.130"529version = "1.0.137"
529source = "registry+https://github.com/rust-lang/crates.io-index"530source = "registry+https://github.com/rust-lang/crates.io-index"
530checksum = "d7bc1a1ab1961464eae040d96713baa5a724a8152c1222492465b54322ec508b"531checksum = "1f26faba0c3959972377d3b2d306ee9f71faee9714294e41bb777f83f88578be"
531dependencies = [532dependencies = [
532 "proc-macro2",533 "proc-macro2",
533 "quote",534 "quote",
536537
537[[package]]538[[package]]
538name = "serde_json"539name = "serde_json"
539version = "1.0.72"540version = "1.0.81"
540source = "registry+https://github.com/rust-lang/crates.io-index"541source = "registry+https://github.com/rust-lang/crates.io-index"
541checksum = "d0ffa0837f2dfa6fb90868c2b5468cad482e175f7dad97e7421951e663f2b527"542checksum = "9b7ce2b32a1aed03c558dc61a5cd328f15aff2dbc17daad8fb8af04d2100e15c"
542dependencies = [543dependencies = [
543 "indexmap",544 "indexmap",
544 "itoa",545 "itoa",
559560
560[[package]]561[[package]]
561name = "smallvec"562name = "smallvec"
562version = "1.7.0"563version = "1.8.0"
563source = "registry+https://github.com/rust-lang/crates.io-index"564source = "registry+https://github.com/rust-lang/crates.io-index"
564checksum = "1ecab6c735a6bb4139c0caafd0cc3635748bbb3acf4550e8138122099251f309"565checksum = "f2dd574626839106c320a323308629dcb1acfc96e32a8cba364ddc61ac23ee83"
565566
566[[package]]567[[package]]
567name = "static_assertions"568name = "static_assertions"
577578
578[[package]]579[[package]]
579name = "syn"580name = "syn"
580version = "1.0.82"581version = "1.0.96"
581source = "registry+https://github.com/rust-lang/crates.io-index"582source = "registry+https://github.com/rust-lang/crates.io-index"
582checksum = "8daf5dd0bb60cbd4137b1b587d2fc0ae729bc07cf01cd70b36a1ed5ade3b9d59"583checksum = "0748dd251e24453cb8717f0354206b91557e4ec8703673a4b30208f2abaf1ebf"
583dependencies = [584dependencies = [
584 "proc-macro2",585 "proc-macro2",
585 "quote",586 "quote",
586 "unicode-xid",587 "unicode-ident",
587]588]
588
589[[package]]
590name = "synstructure"
591version = "0.12.6"
592source = "registry+https://github.com/rust-lang/crates.io-index"
593checksum = "f36bdaa60a83aca3921b5259d5400cbf5e90fc51931376a9bd4a0eb79aa7210f"
594dependencies = [
595 "proc-macro2",
596 "quote",
597 "syn",
598 "unicode-xid",
599]
600589
601[[package]]590[[package]]
602name = "termcolor"591name = "termcolor"
603version = "1.1.2"592version = "1.1.3"
604source = "registry+https://github.com/rust-lang/crates.io-index"593source = "registry+https://github.com/rust-lang/crates.io-index"
605checksum = "2dfed899f0eb03f32ee8c6a0aabdb8a7949659e3466561fc0adf54e26d88c5f4"594checksum = "bab24d30b911b2376f3a13cc2cd443142f0c81dda04c118693e35b3835757755"
606dependencies = [595dependencies = [
607 "winapi-util",596 "winapi-util",
608]597]
615604
616[[package]]605[[package]]
617name = "thiserror"606name = "thiserror"
618version = "1.0.30"607version = "1.0.31"
619source = "registry+https://github.com/rust-lang/crates.io-index"608source = "registry+https://github.com/rust-lang/crates.io-index"
620checksum = "854babe52e4df1653706b98fcfc05843010039b406875930a70e4d9644e5c417"609checksum = "bd829fe32373d27f76265620b5309d0340cb8550f523c1dda251d6298069069a"
621dependencies = [610dependencies = [
622 "thiserror-impl",611 "thiserror-impl",
623]612]
624613
625[[package]]614[[package]]
626name = "thiserror-impl"615name = "thiserror-impl"
627version = "1.0.30"616version = "1.0.31"
628source = "registry+https://github.com/rust-lang/crates.io-index"617source = "registry+https://github.com/rust-lang/crates.io-index"
629checksum = "aa32fd3f627f367fe16f893e2597ae3c05020f8bba2666a4e6ea73d377e5714b"618checksum = "0396bc89e626244658bef819e22d0cc459e795a5ebe878e6ec336d1674a8d79a"
630dependencies = [619dependencies = [
631 "proc-macro2",620 "proc-macro2",
632 "quote",621 "quote",
633 "syn",622 "syn",
634]623]
624
625[[package]]
626name = "unicode-ident"
627version = "1.0.0"
628source = "registry+https://github.com/rust-lang/crates.io-index"
629checksum = "d22af068fba1eb5edcb4aea19d382b2a3deb4c8f9d475c589b6ada9e0fd493ee"
635630
636[[package]]631[[package]]
637name = "unicode-width"632name = "unicode-width"
638version = "0.1.9"633version = "0.1.9"
639source = "registry+https://github.com/rust-lang/crates.io-index"634source = "registry+https://github.com/rust-lang/crates.io-index"
640checksum = "3ed742d4ea2bd1176e236172c8429aaf54486e7ac098db29ffe6529e0ce50973"635checksum = "3ed742d4ea2bd1176e236172c8429aaf54486e7ac098db29ffe6529e0ce50973"
641
642[[package]]
643name = "unicode-xid"
644version = "0.2.2"
645source = "registry+https://github.com/rust-lang/crates.io-index"
646checksum = "8ccb82d61f80a663efe1f787a51b16b5a51e3314d6ac365b08639f52387b33f3"
647636
648[[package]]637[[package]]
649name = "version_check"638name = "version_check"
650version = "0.9.3"639version = "0.9.4"
651source = "registry+https://github.com/rust-lang/crates.io-index"640source = "registry+https://github.com/rust-lang/crates.io-index"
652checksum = "5fecdca9a5291cc2b8dcf7dc02453fee791a280f3743cb0905f8822ae463b3fe"641checksum = "49874b5167b65d7193b8aba1567f5c7d93d001cafc34600cee003eda787e483f"
653642
654[[package]]643[[package]]
655name = "wasi"644name = "wasi"
modifiedbindings/jsonnet/Cargo.tomldiffbeforeafterboth
10[dependencies]10[dependencies]
11jrsonnet-evaluator = { path = "../../crates/jrsonnet-evaluator", version = "0.4.2" }11jrsonnet-evaluator = { path = "../../crates/jrsonnet-evaluator", version = "0.4.2" }
12jrsonnet-parser = { path = "../../crates/jrsonnet-parser", version = "0.4.2" }12jrsonnet-parser = { path = "../../crates/jrsonnet-parser", version = "0.4.2" }
13gcmodule = { git = "https://github.com/CertainLach/gcmodule", branch = "jrsonnet" }13jrsonnet-gcmodule = { version = "0.3.4" }
1414
15[lib]15[lib]
16crate-type = ["cdylib"]16crate-type = ["cdylib"]
modifiedbindings/jsonnet/src/native.rsdiffbeforeafterboth
3 os::raw::{c_char, c_int},3 os::raw::{c_char, c_int},
4};4};
55
6use gcmodule::Cc;
7use jrsonnet_evaluator::{6use jrsonnet_evaluator::{
8 error::{Error, LocError},7 error::{Error, LocError},
9 function::builtin::{BuiltinParam, NativeCallback, NativeCallbackHandler},8 function::builtin::{BuiltinParam, NativeCallback, NativeCallbackHandler},
10 tb,9 tb,
11 typed::Typed,10 typed::Typed,
12 IStr, State, Val,11 IStr, State, Val,
13};12};
13use jrsonnet_gcmodule::Cc;
1414
15type JsonnetNativeCallback = unsafe extern "C" fn(15type JsonnetNativeCallback = unsafe extern "C" fn(
16 ctx: *const c_void,16 ctx: *const c_void,
17 argv: *const *const Val,17 argv: *const *const Val,
18 success: *mut c_int,18 success: *mut c_int,
19) -> *mut Val;19) -> *mut Val;
2020
21#[derive(gcmodule::Trace)]21#[derive(jrsonnet_gcmodule::Trace)]
22struct JsonnetNativeCallbackHandler {22struct JsonnetNativeCallbackHandler {
23 #[skip_trace]23 #[trace(skip)]
24 ctx: *const c_void,24 ctx: *const c_void,
25 #[skip_trace]25 #[trace(skip)]
26 cb: JsonnetNativeCallback,26 cb: JsonnetNativeCallback,
27}27}
28impl NativeCallbackHandler for JsonnetNativeCallbackHandler {28impl NativeCallbackHandler for JsonnetNativeCallbackHandler {
modifiedbindings/jsonnet/src/val_make.rsdiffbeforeafterboth
5 os::raw::{c_char, c_double, c_int},5 os::raw::{c_char, c_double, c_int},
6};6};
77
8use gcmodule::Cc;
9use jrsonnet_evaluator::{val::ArrValue, ObjValue, State, Val};8use jrsonnet_evaluator::{val::ArrValue, ObjValue, State, Val};
9use jrsonnet_gcmodule::Cc;
1010
11/// # Safety11/// # Safety
12///12///
modifiedbindings/jsonnet/src/val_modify.rsdiffbeforeafterboth
44
5use std::{ffi::CStr, os::raw::c_char};5use std::{ffi::CStr, os::raw::c_char};
66
7use gcmodule::Cc;
8use jrsonnet_evaluator::{val::ArrValue, State, Thunk, Val};7use jrsonnet_evaluator::{val::ArrValue, State, Thunk, Val};
8use jrsonnet_gcmodule::Cc;
99
10/// # Safety10/// # Safety
11///11///
modifiedcmds/jrsonnet/Cargo.tomldiffbeforeafterboth
23jrsonnet-evaluator = { path = "../../crates/jrsonnet-evaluator", version = "0.4.2" }23jrsonnet-evaluator = { path = "../../crates/jrsonnet-evaluator", version = "0.4.2" }
24jrsonnet-parser = { path = "../../crates/jrsonnet-parser", version = "0.4.2" }24jrsonnet-parser = { path = "../../crates/jrsonnet-parser", version = "0.4.2" }
25jrsonnet-cli = { path = "../../crates/jrsonnet-cli", version = "0.4.2" }25jrsonnet-cli = { path = "../../crates/jrsonnet-cli", version = "0.4.2" }
26jrsonnet-gcmodule = { version = "0.3.4" }
27
26mimallocator = { version = "0.1.3", optional = true }28mimallocator = { version = "0.1.3", optional = true }
27thiserror = "1.0"29thiserror = "1.0"
28gcmodule = { git = "https://github.com/CertainLach/gcmodule", branch = "jrsonnet" }
29clap = { version = "3.1", features = ["derive"] }30clap = { version = "3.1", features = ["derive"] }
30clap_complete = { version = "3.1" }31clap_complete = { version = "3.1" }
3132
modifiedcmds/jrsonnet/src/main.rsdiffbeforeafterboth
115}115}
116116
117fn main_real(s: &State, opts: Opts) -> Result<(), Error> {117fn main_real(s: &State, opts: Opts) -> Result<(), Error> {
118 opts.gc.configure_global();
119 opts.general.configure(s)?;118 opts.general.configure(s)?;
120 opts.manifest.configure(s)?;119 opts.manifest.configure(s)?;
121120
modifiedcrates/jrsonnet-cli/Cargo.tomldiffbeforeafterboth
14 "explaining-traces",14 "explaining-traces",
15] }15] }
16jrsonnet-parser = { path = "../../crates/jrsonnet-parser", version = "0.4.2" }16jrsonnet-parser = { path = "../../crates/jrsonnet-parser", version = "0.4.2" }
17gcmodule = { git = "https://github.com/CertainLach/gcmodule", branch = "jrsonnet" }17jrsonnet-gcmodule = { version = "0.3.4" }
1818
19clap = { version = "3.1", features = ["derive"] }19clap = { version = "3.1", features = ["derive"] }
2020
modifiedcrates/jrsonnet-cli/src/lib.rsdiffbeforeafterboth
8use clap::Parser;8use clap::Parser;
9pub use ext::*;9pub use ext::*;
10use jrsonnet_evaluator::{error::Result, FileImportResolver, State};10use jrsonnet_evaluator::{error::Result, FileImportResolver, State};
11use jrsonnet_gcmodule::with_thread_object_space;
11pub use manifest::*;12pub use manifest::*;
12pub use tla::*;13pub use tla::*;
13pub use trace::*;14pub use trace::*;
111 gc_collect_before_printing_stats: bool,112 gc_collect_before_printing_stats: bool,
112}113}
113impl GcOpts {114impl GcOpts {
114 pub fn configure_global(&self) {
115 if !self.gc_collect_on_exit {
116 gcmodule::set_thread_collect_on_drop(false)
117 }
118 }
119 pub fn stats_printer(&self) -> Option<GcStatsPrinter> {115 pub fn stats_printer(&self) -> (Option<GcStatsPrinter>, Option<LeakSpace>) {
116 (
120 self.gc_print_stats.then(|| GcStatsPrinter {117 self.gc_print_stats.then(|| GcStatsPrinter {
121 collect_before_printing_stats: self.gc_collect_before_printing_stats,118 collect_before_printing_stats: self.gc_collect_before_printing_stats,
122 })119 }),
120 (!self.gc_collect_on_exit).then(|| LeakSpace {}),
121 )
123 }122 }
124}123}
124
125pub struct LeakSpace {}
126
127impl Drop for LeakSpace {
128 fn drop(&mut self) {
129 with_thread_object_space(|s| s.leak())
130 }
131}
125132
126pub struct GcStatsPrinter {133pub struct GcStatsPrinter {
127 collect_before_printing_stats: bool,134 collect_before_printing_stats: bool,
130 fn drop(&mut self) {137 fn drop(&mut self) {
131 eprintln!("=== GC STATS ===");138 eprintln!("=== GC STATS ===");
132 if self.collect_before_printing_stats {139 if self.collect_before_printing_stats {
133 let collected = gcmodule::collect_thread_cycles();140 let collected = jrsonnet_gcmodule::collect_thread_cycles();
134 eprintln!("Collected: {}", collected);141 eprintln!("Collected: {}", collected);
135 }142 }
136 eprintln!("Tracked: {}", gcmodule::count_thread_tracked())143 eprintln!("Tracked: {}", jrsonnet_gcmodule::count_thread_tracked())
137 }144 }
138}145}
139146
modifiedcrates/jrsonnet-evaluator/Cargo.tomldiffbeforeafterboth
30jrsonnet-stdlib = { path = "../jrsonnet-stdlib", version = "0.4.2" }30jrsonnet-stdlib = { path = "../jrsonnet-stdlib", version = "0.4.2" }
31jrsonnet-types = { path = "../jrsonnet-types", version = "0.4.2" }31jrsonnet-types = { path = "../jrsonnet-types", version = "0.4.2" }
32jrsonnet-macros = { path = "../jrsonnet-macros", version = "0.4.2" }32jrsonnet-macros = { path = "../jrsonnet-macros", version = "0.4.2" }
33jrsonnet-gcmodule = { version = "0.3.4" }
34
33pathdiff = "0.2.1"35pathdiff = "0.2.1"
34hashbrown = "0.12.1"36hashbrown = "0.12.1"
39rustc-hash = "1.1"41rustc-hash = "1.1"
4042
41thiserror = "1.0"43thiserror = "1.0"
42gcmodule = { git = "https://github.com/CertainLach/gcmodule", branch = "jrsonnet" }
4344
44serde = "1.0"45serde = "1.0"
45serde_json = "1.0"46serde_json = "1.0"
modifiedcrates/jrsonnet-evaluator/src/ctx.rsdiffbeforeafterboth
1use std::fmt::Debug;1use std::fmt::Debug;
22
3use gcmodule::{Cc, Trace};3use jrsonnet_gcmodule::{Cc, Trace};
4use jrsonnet_interner::IStr;4use jrsonnet_interner::IStr;
55
6use crate::{6use crate::{
7 cc_ptr_eq, error::Error::*, gc::GcHashMap, map::LayeredHashMap, ObjValue, Pending, Result,7 error::Error::*, gc::GcHashMap, map::LayeredHashMap, ObjValue, Pending, Result, Thunk, Val,
8 Thunk, Val,
9};8};
109
136135
137impl PartialEq for Context {136impl PartialEq for Context {
138 fn eq(&self, other: &Self) -> bool {137 fn eq(&self, other: &Self) -> bool {
139 cc_ptr_eq(&self.0, &other.0)138 Cc::ptr_eq(&self.0, &other.0)
140 }139 }
141}140}
142141
modifiedcrates/jrsonnet-evaluator/src/dynamic.rsdiffbeforeafterboth
1use std::cell::RefCell;1use std::cell::RefCell;
22
3use gcmodule::{Cc, Trace};3use jrsonnet_gcmodule::{Cc, Trace};
44
5#[derive(Clone, Trace)]5#[derive(Clone, Trace)]
6pub struct Pending<V: Trace + 'static>(pub Cc<RefCell<Option<V>>>);6pub struct Pending<V: Trace + 'static>(pub Cc<RefCell<Option<V>>>);
modifiedcrates/jrsonnet-evaluator/src/error.rsdiffbeforeafterboth
1use std::{fmt::Debug, path::PathBuf};1use std::{fmt::Debug, path::PathBuf};
22
3use gcmodule::Trace;3use jrsonnet_gcmodule::Trace;
4use jrsonnet_interner::IStr;4use jrsonnet_interner::IStr;
5use jrsonnet_parser::{BinaryOpType, ExprLocation, Source, UnaryOpType};5use jrsonnet_parser::{BinaryOpType, ExprLocation, Source, UnaryOpType};
6use jrsonnet_types::ValType;6use jrsonnet_types::ValType;
125 ImportSyntaxError {125 ImportSyntaxError {
126 path: Source,126 path: Source,
127 source_code: IStr,127 source_code: IStr,
128 #[skip_trace]128 #[trace(skip)]
129 error: Box<jrsonnet_parser::ParseError>,129 error: Box<jrsonnet_parser::ParseError>,
130 },130 },
131131
modifiedcrates/jrsonnet-evaluator/src/evaluate/destructure.rsdiffbeforeafterboth
1use gcmodule::Trace;1use jrsonnet_gcmodule::Trace;
2use jrsonnet_interner::IStr;2use jrsonnet_interner::IStr;
3use jrsonnet_parser::{BindSpec, Destruct, LocExpr, ParamsDesc};3use jrsonnet_parser::{BindSpec, Destruct, LocExpr, ParamsDesc};
44
modifiedcrates/jrsonnet-evaluator/src/evaluate/mod.rsdiffbeforeafterboth
1use std::{cmp::Ordering, rc::Rc};1use std::{cmp::Ordering, rc::Rc};
22
3use gcmodule::{Cc, Trace};3use jrsonnet_gcmodule::{Cc, Trace};
4use jrsonnet_interner::IStr;4use jrsonnet_interner::IStr;
5use jrsonnet_parser::{5use jrsonnet_parser::{
6 ArgsDesc, AssertStmt, BindSpec, CompSpec, Expr, FieldMember, FieldName, ForSpecData,6 ArgsDesc, AssertStmt, BindSpec, CompSpec, Expr, FieldMember, FieldName, ForSpecData,
151 value,151 value,
152 }) => {152 }) => {
153 #[derive(Trace)]153 #[derive(Trace)]
154 struct UnboundValue<B> {154 struct UnboundValue<B: Trace> {
155 uctx: B,155 uctx: B,
156 value: LocExpr,156 value: LocExpr,
157 name: IStr,157 name: IStr,
201 ..201 ..
202 }) => {202 }) => {
203 #[derive(Trace)]203 #[derive(Trace)]
204 struct UnboundMethod<B> {204 struct UnboundMethod<B: Trace> {
205 uctx: B,205 uctx: B,
206 value: LocExpr,206 value: LocExpr,
207 params: ParamsDesc,207 params: ParamsDesc,
247 Member::BindStmt(_) => {}247 Member::BindStmt(_) => {}
248 Member::AssertStmt(stmt) => {248 Member::AssertStmt(stmt) => {
249 #[derive(Trace)]249 #[derive(Trace)]
250 struct ObjectAssert<B> {250 struct ObjectAssert<B: Trace> {
251 uctx: B,251 uctx: B,
252 assert: AssertStmt,252 assert: AssertStmt,
253 }253 }
299 Val::Null => {}299 Val::Null => {}
300 Val::Str(n) => {300 Val::Str(n) => {
301 #[derive(Trace)]301 #[derive(Trace)]
302 struct UnboundValue<B> {302 struct UnboundValue<B: Trace> {
303 uctx: B,303 uctx: B,
304 value: LocExpr,304 value: LocExpr,
305 }305 }
modifiedcrates/jrsonnet-evaluator/src/function/arglike.rsdiffbeforeafterboth
1use std::collections::HashMap;1use std::collections::HashMap;
22
3use gcmodule::Trace;3use jrsonnet_gcmodule::Trace;
4use jrsonnet_interner::IStr;4use jrsonnet_interner::IStr;
5use jrsonnet_parser::{ArgsDesc, LocExpr};5use jrsonnet_parser::{ArgsDesc, LocExpr};
66
modifiedcrates/jrsonnet-evaluator/src/function/builtin.rsdiffbeforeafterboth
1use std::borrow::Cow;1use std::borrow::Cow;
22
3use gcmodule::Trace;3use jrsonnet_gcmodule::Trace;
44
5use super::{arglike::ArgsLike, parse::parse_builtin_call, CallLocation};5use super::{arglike::ArgsLike, parse::parse_builtin_call, CallLocation};
6use crate::{error::Result, gc::TraceBox, Context, State, Val};6use crate::{error::Result, gc::TraceBox, Context, State, Val};
modifiedcrates/jrsonnet-evaluator/src/function/mod.rsdiffbeforeafterboth
1use std::fmt::Debug;1use std::fmt::Debug;
22
3pub use arglike::{ArgLike, ArgsLike, TlaArg};3pub use arglike::{ArgLike, ArgsLike, TlaArg};
4use gcmodule::{Cc, Trace};4use jrsonnet_gcmodule::{Cc, Trace};
5use jrsonnet_interner::IStr;5use jrsonnet_interner::IStr;
6pub use jrsonnet_macros::builtin;6pub use jrsonnet_macros::builtin;
7use jrsonnet_parser::{ExprLocation, LocExpr, ParamsDesc};7use jrsonnet_parser::{ExprLocation, LocExpr, ParamsDesc};
91 /// Plain function implemented in jsonnet91 /// Plain function implemented in jsonnet
92 Normal(Cc<FuncDesc>),92 Normal(Cc<FuncDesc>),
93 /// Standard library function93 /// Standard library function
94 StaticBuiltin(#[skip_trace] &'static dyn StaticBuiltin),94 StaticBuiltin(#[trace(skip)] &'static dyn StaticBuiltin),
95 /// User-provided function95 /// User-provided function
96 Builtin(Cc<TraceBox<dyn Builtin>>),96 Builtin(Cc<TraceBox<dyn Builtin>>),
97}97}
modifiedcrates/jrsonnet-evaluator/src/function/parse.rsdiffbeforeafterboth
1use gcmodule::Trace;1use jrsonnet_gcmodule::Trace;
2use jrsonnet_interner::IStr;2use jrsonnet_interner::IStr;
3use jrsonnet_parser::{LocExpr, ParamsDesc};3use jrsonnet_parser::{LocExpr, ParamsDesc};
44
modifiedcrates/jrsonnet-evaluator/src/gc.rsdiffbeforeafterboth
6 ops::{Deref, DerefMut},6 ops::{Deref, DerefMut},
7};7};
88
9use gcmodule::{Trace, Tracer};9use hashbrown::HashMap;
10use hashbrown::HashMap;10use jrsonnet_gcmodule::{Trace, Tracer};
11use rustc_hash::{FxHashSet, FxHasher};11use rustc_hash::{FxHashSet, FxHasher};
1212
13/// Replacement for box, which assumes that the underlying type is [`Trace`]13/// Replacement for box, which assumes that the underlying type is [`Trace`]
92where92where
93 V: Trace,93 V: Trace,
94{94{
95 fn trace(&self, tracer: &mut gcmodule::Tracer) {95 fn trace(&self, tracer: &mut jrsonnet_gcmodule::Tracer) {
96 for v in &self.0 {96 for v in &self.0 {
97 v.trace(tracer);97 v.trace(tracer);
98 }98 }
133 K: Trace,133 K: Trace,
134 V: Trace,134 V: Trace,
135{135{
136 fn trace(&self, tracer: &mut gcmodule::Tracer) {136 fn trace(&self, tracer: &mut jrsonnet_gcmodule::Tracer) {
137 for (k, v) in &self.0 {137 for (k, v) in &self.0 {
138 k.trace(tracer);138 k.trace(tracer);
139 v.trace(tracer);139 v.trace(tracer);
modifiedcrates/jrsonnet-evaluator/src/lib.rsdiffbeforeafterboth
57pub use evaluate::*;57pub use evaluate::*;
58use function::{builtin::Builtin, CallLocation, TlaArg};58use function::{builtin::Builtin, CallLocation, TlaArg};
59use gc::{GcHashMap, TraceBox};59use gc::{GcHashMap, TraceBox};
60use gcmodule::{Cc, Trace, Weak};
61use hashbrown::hash_map::RawEntryMut;60use hashbrown::hash_map::RawEntryMut;
62pub use import::*;61pub use import::*;
62use jrsonnet_gcmodule::{Cc, Trace};
63use jrsonnet_interner::IBytes;63use jrsonnet_interner::IBytes;
64pub use jrsonnet_interner::IStr;64pub use jrsonnet_interner::IStr;
65pub use jrsonnet_parser as parser;65pub use jrsonnet_parser as parser;
706 }706 }
707}707}
708
709pub fn cc_ptr_eq<T>(a: &Cc<T>, b: &Cc<T>) -> bool {
710 let a = a as &T;
711 let b = b as &T;
712 std::ptr::eq(a, b)
713}
714
715fn weak_raw<T>(a: Weak<T>) -> *const () {
716 unsafe { std::mem::transmute(a) }
717}
718fn weak_ptr_eq<T>(a: Weak<T>, b: Weak<T>) -> bool {
719 std::ptr::eq(weak_raw(a), weak_raw(b))
720}
721
722#[test]
723fn weak_unsafe() {
724 let a = Cc::new(1);
725 let b = Cc::new(2);
726
727 let aw1 = a.clone().downgrade();
728 let aw2 = a.clone().downgrade();
729 let aw3 = a.clone().downgrade();
730
731 let bw = b.clone().downgrade();
732
733 assert!(weak_ptr_eq(aw1, aw2));
734 assert!(!weak_ptr_eq(aw3, bw));
735}
736708
modifiedcrates/jrsonnet-evaluator/src/map.rsdiffbeforeafterboth
1use gcmodule::{Cc, Trace};1use jrsonnet_gcmodule::{Cc, Trace};
2use jrsonnet_interner::IStr;2use jrsonnet_interner::IStr;
33
4use crate::{GcHashMap, Thunk, Val};4use crate::{GcHashMap, Thunk, Val};
55
6#[derive(Trace)]6#[derive(Trace)]
7#[force_tracking]7#[trace(tracking(force))]
8pub struct LayeredHashMapInternals {8pub struct LayeredHashMapInternals {
9 parent: Option<LayeredHashMap>,9 parent: Option<LayeredHashMap>,
10 current: GcHashMap<IStr, Thunk<Val>>,10 current: GcHashMap<IStr, Thunk<Val>>,
modifiedcrates/jrsonnet-evaluator/src/obj.rsdiffbeforeafterboth
5 ptr::addr_of,5 ptr::addr_of,
6};6};
77
8use gcmodule::{Cc, Trace, Weak};8use jrsonnet_gcmodule::{Cc, Trace, Weak};
9use jrsonnet_interner::IStr;9use jrsonnet_interner::IStr;
10use jrsonnet_parser::{ExprLocation, Visibility};10use jrsonnet_parser::{ExprLocation, Visibility};
11use rustc_hash::FxHashMap;11use rustc_hash::FxHashMap;
1212
13use crate::{13use crate::{
14 cc_ptr_eq,
15 error::{Error::*, LocError},14 error::{Error::*, LocError},
16 function::CallLocation,15 function::CallLocation,
17 gc::{GcHashMap, GcHashSet, TraceBox},16 gc::{GcHashMap, GcHashSet, TraceBox},
18 operator::evaluate_add_op,17 operator::evaluate_add_op,
19 throw, weak_ptr_eq, weak_raw, LazyBinding, Result, State, Thunk, Unbound, Val,18 throw, LazyBinding, Result, State, Thunk, Unbound, Val,
20};19};
2120
22#[cfg(not(feature = "exp-preserve-order"))]21#[cfg(not(feature = "exp-preserve-order"))]
26 clippy::unused_self,25 clippy::unused_self,
27 )]26 )]
2827
29 use gcmodule::Trace;28 use jrsonnet_gcmodule::Trace;
3029
31 #[derive(Clone, Copy, Default, Debug, Trace)]30 #[derive(Clone, Copy, Default, Debug, Trace)]
32 pub struct FieldIndex;31 pub struct FieldIndex;
57mod ordering {56mod ordering {
58 use std::cmp::Reverse;57 use std::cmp::Reverse;
5958
60 use gcmodule::Trace;59 use jrsonnet_gcmodule::Trace;
6160
62 #[derive(Clone, Copy, Default, Debug, Trace, PartialEq, Eq, PartialOrd, Ord)]61 #[derive(Clone, Copy, Default, Debug, Trace, PartialEq, Eq, PartialOrd, Ord)]
63 pub struct FieldIndex(u32);62 pub struct FieldIndex(u32);
122121
123#[allow(clippy::module_name_repetitions)]122#[allow(clippy::module_name_repetitions)]
124#[derive(Trace)]123#[derive(Trace)]
125#[force_tracking]124#[trace(tracking(force))]
126pub struct ObjValueInternals {125pub struct ObjValueInternals {
127 sup: Option<ObjValue>,126 sup: Option<ObjValue>,
128 this: Option<ObjValue>,127 this: Option<ObjValue>,
134}133}
135134
136#[derive(Clone, Trace)]135#[derive(Clone, Trace)]
137pub struct WeakObjValue(#[skip_trace] pub(crate) Weak<ObjValueInternals>);136pub struct WeakObjValue(#[trace(skip)] pub(crate) Weak<ObjValueInternals>);
138137
139impl PartialEq for WeakObjValue {138impl PartialEq for WeakObjValue {
140 fn eq(&self, other: &Self) -> bool {139 fn eq(&self, other: &Self) -> bool {
141 weak_ptr_eq(self.0.clone(), other.0.clone())140 Weak::ptr_eq(&self.0, &other.0)
142 }141 }
143}142}
144143
145impl Eq for WeakObjValue {}144impl Eq for WeakObjValue {}
146impl Hash for WeakObjValue {145impl Hash for WeakObjValue {
147 fn hash<H: Hasher>(&self, hasher: &mut H) {146 fn hash<H: Hasher>(&self, hasher: &mut H) {
147 // Safety: usize is POD
148 hasher.write_usize(weak_raw(self.0.clone()) as usize);148 let addr = unsafe { *std::ptr::addr_of!(self.0).cast() };
149 hasher.write_usize(addr);
149 }150 }
150}151}
151152
454 }455 }
455456
456 pub fn ptr_eq(a: &Self, b: &Self) -> bool {457 pub fn ptr_eq(a: &Self, b: &Self) -> bool {
457 cc_ptr_eq(&a.0, &b.0)458 Cc::ptr_eq(&a.0, &b.0)
458 }459 }
459 pub fn downgrade(self) -> WeakObjValue {460 pub fn downgrade(self) -> WeakObjValue {
460 WeakObjValue(self.0.downgrade())461 WeakObjValue(self.0.downgrade())
463464
464impl PartialEq for ObjValue {465impl PartialEq for ObjValue {
465 fn eq(&self, other: &Self) -> bool {466 fn eq(&self, other: &Self) -> bool {
466 cc_ptr_eq(&self.0, &other.0)467 Cc::ptr_eq(&self.0, &other.0)
467 }468 }
468}469}
469470
modifiedcrates/jrsonnet-evaluator/src/stdlib/format.rsdiffbeforeafterboth
1//! faster std.format impl1//! faster std.format impl
2#![allow(clippy::too_many_arguments)]2#![allow(clippy::too_many_arguments)]
33
4use gcmodule::Trace;4use jrsonnet_gcmodule::Trace;
5use jrsonnet_interner::IStr;5use jrsonnet_interner::IStr;
6use jrsonnet_types::ValType;6use jrsonnet_types::ValType;
7use thiserror::Error;7use thiserror::Error;
modifiedcrates/jrsonnet-evaluator/src/stdlib/mod.rsdiffbeforeafterboth
4use std::collections::HashMap;4use std::collections::HashMap;
55
6use format::{format_arr, format_obj};6use format::{format_arr, format_obj};
7use gcmodule::Cc;7use jrsonnet_gcmodule::Cc;
8use jrsonnet_interner::{IBytes, IStr};8use jrsonnet_interner::{IBytes, IStr};
9use serde::Deserialize;9use serde::Deserialize;
10use serde_yaml::DeserializingQuirks;10use serde_yaml::DeserializingQuirks;
modifiedcrates/jrsonnet-evaluator/src/stdlib/sort.rsdiffbeforeafterboth
1use gcmodule::{Cc, Trace};1use jrsonnet_gcmodule::{Cc, Trace};
22
3use crate::{3use crate::{
4 error::{Error, LocError, Result},4 error::{Error, LocError, Result},
modifiedcrates/jrsonnet-evaluator/src/typed/conversions.rsdiffbeforeafterboth
1use std::ops::Deref;1use std::ops::Deref;
22
3use gcmodule::Cc;3use jrsonnet_gcmodule::Cc;
4use jrsonnet_interner::{IBytes, IStr};4use jrsonnet_interner::{IBytes, IStr};
5pub use jrsonnet_macros::Typed;5pub use jrsonnet_macros::Typed;
6use jrsonnet_types::{ComplexValType, ValType};6use jrsonnet_types::{ComplexValType, ValType};
modifiedcrates/jrsonnet-evaluator/src/typed/mod.rsdiffbeforeafterboth
22
3mod conversions;3mod conversions;
4pub use conversions::*;4pub use conversions::*;
5use gcmodule::Trace;5use jrsonnet_gcmodule::Trace;
6pub use jrsonnet_types::{ComplexValType, ValType};6pub use jrsonnet_types::{ComplexValType, ValType};
7use thiserror::Error;7use thiserror::Error;
88
16 #[error("expected {0}, got {1}")]16 #[error("expected {0}, got {1}")]
17 ExpectedGot(ComplexValType, ValType),17 ExpectedGot(ComplexValType, ValType),
18 #[error("missing property {0} from {1}")]18 #[error("missing property {0} from {1}")]
19 MissingProperty(#[skip_trace] Rc<str>, ComplexValType),19 MissingProperty(#[trace(skip)] Rc<str>, ComplexValType),
20 #[error("every failed from {0}:\n{1}")]20 #[error("every failed from {0}:\n{1}")]
21 UnionFailed(ComplexValType, TypeLocErrorList),21 UnionFailed(ComplexValType, TypeLocErrorList),
22 #[error(22 #[error(
119119
120#[derive(Clone, Debug, Trace)]120#[derive(Clone, Debug, Trace)]
121enum ValuePathItem {121enum ValuePathItem {
122 Field(#[skip_trace] Rc<str>),122 Field(#[trace(skip)] Rc<str>),
123 Index(u64),123 Index(u64),
124}124}
125impl Display for ValuePathItem {125impl Display for ValuePathItem {
modifiedcrates/jrsonnet-evaluator/src/val.rsdiffbeforeafterboth
1use std::{cell::RefCell, fmt::Debug, rc::Rc};1use std::{cell::RefCell, fmt::Debug, rc::Rc};
22
3use gcmodule::{Cc, Trace};3use jrsonnet_gcmodule::{Cc, Trace};
4use jrsonnet_interner::{IBytes, IStr};4use jrsonnet_interner::{IBytes, IStr};
5use jrsonnet_types::ValType;5use jrsonnet_types::ValType;
66
7use crate::{7use crate::{
8 cc_ptr_eq,
9 error::{Error::*, LocError},8 error::{Error::*, LocError},
10 function::FuncVal,9 function::FuncVal,
11 gc::{GcHashMap, TraceBox},10 gc::{GcHashMap, TraceBox},
21}20}
2221
23#[derive(Trace)]22#[derive(Trace)]
24enum ThunkInner<T> {23enum ThunkInner<T: Trace> {
25 Computed(T),24 Computed(T),
26 Errored(LocError),25 Errored(LocError),
27 Waiting(TraceBox<dyn ThunkValue<Output = T>>),26 Waiting(TraceBox<dyn ThunkValue<Output = T>>),
3029
31#[allow(clippy::module_name_repetitions)]30#[allow(clippy::module_name_repetitions)]
32#[derive(Clone, Trace)]31#[derive(Clone, Trace)]
33pub struct Thunk<T>(Cc<RefCell<ThunkInner<T>>>);32pub struct Thunk<T: Trace>(Cc<RefCell<ThunkInner<T>>>);
3433
35impl<T> Thunk<T>34impl<T> Thunk<T>
36where35where
78pub struct CachedUnbound<I, T>77pub struct CachedUnbound<I, T>
79where78where
80 I: Unbound<Bound = T>,79 I: Unbound<Bound = T>,
80 T: Trace,
81{81{
82 cache: Cc<RefCell<GcHashMap<CacheKey, T>>>,82 cache: Cc<RefCell<GcHashMap<CacheKey, T>>>,
83 value: I,83 value: I,
113 }113 }
114}114}
115115
116impl<T: Debug> Debug for Thunk<T> {116impl<T: Debug + Trace> Debug for Thunk<T> {
117 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {117 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
118 write!(f, "Lazy")118 write!(f, "Lazy")
119 }119 }
120}120}
121impl<T> PartialEq for Thunk<T> {121impl<T: Trace> PartialEq for Thunk<T> {
122 fn eq(&self, other: &Self) -> bool {122 fn eq(&self, other: &Self) -> bool {
123 cc_ptr_eq(&self.0, &other.0)123 Cc::ptr_eq(&self.0, &other.0)
124 }124 }
125}125}
126126
185}185}
186186
187#[derive(Debug, Clone, Trace)]187#[derive(Debug, Clone, Trace)]
188// may contrain other ArrValue
188#[force_tracking]189#[trace(tracking(force))]
189pub enum ArrValue {190pub enum ArrValue {
190 Bytes(#[skip_trace] IBytes),191 Bytes(#[trace(skip)] IBytes),
191 Lazy(Cc<Vec<Thunk<Val>>>),192 Lazy(Cc<Vec<Thunk<Val>>>),
192 Eager(Cc<Vec<Val>>),193 Eager(Cc<Vec<Val>>),
193 Extended(Box<(Self, Self)>),194 Extended(Box<(Self, Self)>),
434435
435 pub fn ptr_eq(a: &Self, b: &Self) -> bool {436 pub fn ptr_eq(a: &Self, b: &Self) -> bool {
436 match (a, b) {437 match (a, b) {
437 (Self::Lazy(a), Self::Lazy(b)) => cc_ptr_eq(a, b),438 (Self::Lazy(a), Self::Lazy(b)) => Cc::ptr_eq(a, b),
438 (Self::Eager(a), Self::Eager(b)) => cc_ptr_eq(a, b),439 (Self::Eager(a), Self::Eager(b)) => Cc::ptr_eq(a, b),
439 _ => false,440 _ => false,
440 }441 }
441 }442 }
modifiedcrates/jrsonnet-evaluator/tests/builtin.rsdiffbeforeafterboth
1mod common;1mod common;
22
3use gcmodule::Cc;
4use jrsonnet_evaluator::{3use jrsonnet_evaluator::{
5 error::Result,4 error::Result,
6 function::{builtin, builtin::Builtin, CallLocation, FuncVal},5 function::{builtin, builtin::Builtin, CallLocation, FuncVal},
7 tb,6 tb,
8 typed::Typed,7 typed::Typed,
9 State, Val,8 State, Val,
10};9};
10use jrsonnet_gcmodule::Cc;
1111
12#[builtin]12#[builtin]
13fn a() -> Result<u32> {13fn a() -> Result<u32> {
modifiedcrates/jrsonnet-interner/Cargo.tomldiffbeforeafterboth
11serde = ["dep:serde"]11serde = ["dep:serde"]
1212
13[dependencies]13[dependencies]
14jrsonnet-gcmodule = { version = "0.3.4" }
15
14serde = { version = "1.0", optional = true }16serde = { version = "1.0", optional = true }
15rustc-hash = "1.1"17rustc-hash = "1.1"
16gcmodule = { git = "https://github.com/CertainLach/gcmodule", branch = "jrsonnet" }
17hashbrown = { version = "0.12.1", features = ["inline-more"] }18hashbrown = { version = "0.12.1", features = ["inline-more"] }
1819
modifiedcrates/jrsonnet-interner/src/lib.rsdiffbeforeafterboth
13 str,13 str,
14};14};
1515
16use gcmodule::Trace;16use hashbrown::HashMap;
17use hashbrown::HashMap;17use jrsonnet_gcmodule::Trace;
18use rustc_hash::FxHasher;18use rustc_hash::FxHasher;
1919
20mod inner;20mod inner;
modifiedcrates/jrsonnet-macros/src/lib.rsdiffbeforeafterboth
342 #fun342 #fun
343 #[doc(hidden)]343 #[doc(hidden)]
344 #[allow(non_camel_case_types)]344 #[allow(non_camel_case_types)]
345 #[derive(Clone, gcmodule::Trace #static_derive_copy)]345 #[derive(Clone, jrsonnet_gcmodule::Trace #static_derive_copy)]
346 #vis struct #name {346 #vis struct #name {
347 #(#fields)*347 #(#fields)*
348 }348 }
modifiedcrates/jrsonnet-parser/Cargo.tomldiffbeforeafterboth
1111
12[dependencies]12[dependencies]
13jrsonnet-interner = { path = "../jrsonnet-interner", version = "0.4.2" }13jrsonnet-interner = { path = "../jrsonnet-interner", version = "0.4.2" }
14jrsonnet-gcmodule = { version = "0.3.4" }
15
14static_assertions = "1.1.0"16static_assertions = "1.1.0"
1517
16peg = "0.8.0"18peg = "0.8.0"
1719
18serde = { version = "1.0", features = ["derive", "rc"], optional = true }20serde = { version = "1.0", features = ["derive", "rc"], optional = true }
19gcmodule = { git = "https://github.com/CertainLach/gcmodule", branch = "jrsonnet" }
2021
21[dev-dependencies]22[dev-dependencies]
22jrsonnet-stdlib = { path = "../jrsonnet-stdlib", version = "0.4.2" }23jrsonnet-stdlib = { path = "../jrsonnet-stdlib", version = "0.4.2" }
modifiedcrates/jrsonnet-parser/src/expr.rsdiffbeforeafterboth
4 rc::Rc,4 rc::Rc,
5};5};
66
7use gcmodule::Trace;7use jrsonnet_gcmodule::Trace;
8use jrsonnet_interner::IStr;8use jrsonnet_interner::IStr;
9#[cfg(feature = "serde")]9#[cfg(feature = "serde")]
10use serde::{Deserialize, Serialize};10use serde::{Deserialize, Serialize};
359/// file, begin offset, end offset359/// file, begin offset, end offset
360#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]360#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
361#[derive(Clone, PartialEq, Eq, Trace)]361#[derive(Clone, PartialEq, Eq, Trace)]
362#[skip_trace]362#[trace(skip)]
363#[repr(C)]363#[repr(C)]
364pub struct ExprLocation(pub Source, pub u32, pub u32);364pub struct ExprLocation(pub Source, pub u32, pub u32);
365impl ExprLocation {365impl ExprLocation {
modifiedcrates/jrsonnet-parser/src/source.rsdiffbeforeafterboth
5 rc::Rc,5 rc::Rc,
6};6};
77
8use gcmodule::{Trace, Tracer};8use jrsonnet_gcmodule::{Trace, Tracer};
9#[cfg(feature = "serde")]9#[cfg(feature = "serde")]
10use serde::{Deserialize, Serialize};10use serde::{Deserialize, Serialize};
1111
modifiedcrates/jrsonnet-types/Cargo.tomldiffbeforeafterboth
7edition = "2021"7edition = "2021"
88
9[dependencies]9[dependencies]
10peg = "0.8.0"
11gcmodule = { git = "https://github.com/CertainLach/gcmodule", branch = "jrsonnet" }10jrsonnet-gcmodule = { version = "0.3.4" }
11
12peg = "0.8.0"
1213
modifiedcrates/jrsonnet-types/src/lib.rsdiffbeforeafterboth
22
3use std::fmt::Display;3use std::fmt::Display;
44
5use gcmodule::Trace;5use jrsonnet_gcmodule::Trace;
66
7#[macro_export]7#[macro_export]
8macro_rules! ty {8macro_rules! ty {
115}115}
116116
117#[derive(Debug, Clone, PartialEq, Trace)]117#[derive(Debug, Clone, PartialEq, Trace)]
118#[skip_trace]118#[trace(skip)]
119pub enum ComplexValType {119pub enum ComplexValType {
120 Any,120 Any,
121 Char,121 Char,