difftreelog
fix BlackBox formatter support for bigint
in: master
2 files changed
crates/jrsonnet-evaluator/src/gc.rsdiffbeforeafterboth1#![allow(2 clippy::implicit_hasher,3 reason = "those methods exist exactly because with_capacity is only present for default BuildHasher"4)]56/// Macros to help deal with Gc7use jrsonnet_gcmodule::Trace;8use rustc_hash::{FxBuildHasher, FxHashMap, FxHashSet};910pub trait WithCapacityExt {11 fn new() -> Self;12 fn with_capacity(capacity: usize) -> Self;13}14impl<V> WithCapacityExt for FxHashSet<V> {15 fn with_capacity(capacity: usize) -> Self {16 Self::with_capacity_and_hasher(capacity, FxBuildHasher)17 }1819 fn new() -> Self {20 Self::with_hasher(FxBuildHasher)21 }22}23impl<K, V> WithCapacityExt for FxHashMap<K, V> {24 fn with_capacity(capacity: usize) -> Self {25 Self::with_capacity_and_hasher(capacity, FxBuildHasher)26 }2728 fn new() -> Self {29 Self::with_hasher(FxBuildHasher)30 }31}3233pub fn assert_trace<T: Trace>(_v: &T) {}3435pub type ImHashMap<K, V> = im_rc::HashMap<K, V, FxBuildHasher>;1#![allow(2 clippy::implicit_hasher,3 reason = "those methods exist exactly because with_capacity is only present for default BuildHasher"4)]56/// Macros to help deal with Gc7use jrsonnet_gcmodule::Trace;8use rustc_hash::{FxBuildHasher, FxHashMap, FxHashSet};910pub trait WithCapacityExt {11 fn new() -> Self;12 fn with_capacity(capacity: usize) -> Self;13}14impl<V> WithCapacityExt for FxHashSet<V> {15 fn with_capacity(capacity: usize) -> Self {16 Self::with_capacity_and_hasher(capacity, FxBuildHasher)17 }1819 fn new() -> Self {20 Self::with_hasher(FxBuildHasher)21 }22}23impl<K, V> WithCapacityExt for FxHashMap<K, V> {24 fn with_capacity(capacity: usize) -> Self {25 Self::with_capacity_and_hasher(capacity, FxBuildHasher)26 }2728 fn new() -> Self {29 Self::with_hasher(FxBuildHasher)30 }31}3233pub fn assert_trace<T: Trace>(_v: &T) {}crates/jrsonnet-evaluator/src/manifest.rsdiffbeforeafterboth--- a/crates/jrsonnet-evaluator/src/manifest.rs
+++ b/crates/jrsonnet-evaluator/src/manifest.rs
@@ -68,7 +68,10 @@
}
}
Val::Obj(obj_value) => {
- for (name, value) in obj_value.iter() {
+ for (name, value) in obj_value.iter(
+ #[cfg(feature = "exp-preserve-order")]
+ true,
+ ) {
black_box(name);
let value = value?;
self.manifest_buf(value, buf)?;
@@ -78,6 +81,10 @@
black_box(func_val);
bail!("tried to manifest function")
}
+ #[cfg(feature = "exp-bigint")]
+ Val::BigInt(n) => {
+ black_box(n);
+ }
}
Ok(())
}