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

difftreelog

style fix formatting

wsyrkszxYaroslav Bolyukin2026-04-25parent: #112adb2.patch.diff
in: master

31 files changed

modifiedcrates/jrsonnet-evaluator/src/analyze.rsdiffbeforeafterboth
--- a/crates/jrsonnet-evaluator/src/analyze.rs
+++ b/crates/jrsonnet-evaluator/src/analyze.rs
@@ -21,10 +21,10 @@
 use jrsonnet_gcmodule::Acyclic;
 use jrsonnet_interner::IStr;
 use jrsonnet_ir::{
-	function::FunctionSignature, ArgsDesc, AssertExpr, AssertStmt, BinaryOp, BinaryOpType,
-	BindSpec, CompSpec, Destruct, Expr, ExprParams, FieldName, ForSpecData, IfElse, IfSpecData,
-	ImportKind, LiteralType, NumValue, ObjBody, ObjComp, ObjMembers, Slice, SliceDesc, Span,
-	Spanned, UnaryOpType, Visibility,
+	ArgsDesc, AssertExpr, AssertStmt, BinaryOp, BinaryOpType, BindSpec, CompSpec, Destruct, Expr,
+	ExprParams, FieldName, ForSpecData, IfElse, IfSpecData, ImportKind, LiteralType, NumValue,
+	ObjBody, ObjComp, ObjMembers, Slice, SliceDesc, Span, Spanned, UnaryOpType, Visibility,
+	function::FunctionSignature,
 };
 use rustc_hash::FxHashMap;
 use smallvec::SmallVec;
modifiedcrates/jrsonnet-evaluator/src/arr/mod.rsdiffbeforeafterboth
--- a/crates/jrsonnet-evaluator/src/arr/mod.rs
+++ b/crates/jrsonnet-evaluator/src/arr/mod.rs
@@ -5,9 +5,9 @@
 	rc::Rc,
 };
 
-use jrsonnet_gcmodule::{cc_dyn, Cc};
+use jrsonnet_gcmodule::{Cc, cc_dyn};
 
-use crate::{analyze::LExpr, function::NativeFn, typed::IntoUntyped, Context, Result, Thunk, Val};
+use crate::{Context, Result, Thunk, Val, analyze::LExpr, function::NativeFn, typed::IntoUntyped};
 
 mod spec;
 pub use spec::{ArrayLike, *};
modifiedcrates/jrsonnet-evaluator/src/arr/spec.rsdiffbeforeafterboth
--- a/crates/jrsonnet-evaluator/src/arr/spec.rs
+++ b/crates/jrsonnet-evaluator/src/arr/spec.rs
@@ -11,13 +11,13 @@
 
 use super::ArrValue;
 use crate::{
+	Context, Error, ObjValue, Result, Thunk, Val,
 	analyze::LExpr,
 	error::ErrorKind::InfiniteRecursionDetected,
 	evaluate::evaluate,
 	function::NativeFn,
 	typed::{IntoUntyped, Typed},
 	val::ThunkValue,
-	Context, Error, ObjValue, Result, Thunk, Val,
 };
 
 pub trait ArrayLike: Any + Trace + Debug {
modifiedcrates/jrsonnet-evaluator/src/ctx.rsdiffbeforeafterboth
--- a/crates/jrsonnet-evaluator/src/ctx.rs
+++ b/crates/jrsonnet-evaluator/src/ctx.rs
@@ -4,7 +4,7 @@
 use jrsonnet_gcmodule::{Cc, Trace};
 use jrsonnet_interner::IStr;
 
-use crate::{analyze::LocalId, error, error::ErrorKind::*, Pending, Result, SupThis, Thunk, Val};
+use crate::{Pending, Result, SupThis, Thunk, Val, analyze::LocalId, error, error::ErrorKind::*};
 
 #[derive(Debug, Trace, Clone, Educe)]
 #[educe(PartialEq)]
modifiedcrates/jrsonnet-evaluator/src/error.rsdiffbeforeafterboth
before · crates/jrsonnet-evaluator/src/error.rs
1use std::{cmp::Ordering, convert::Infallible, fmt};23use jrsonnet_gcmodule::{Acyclic, Trace};4use jrsonnet_interner::IStr;5use jrsonnet_ir::{6	BinaryOpType, ConvertNumValueError, Source, SourcePath, Span, Spanned, UnaryOpType,7};8use jrsonnet_types::ValType;9use thiserror::Error;1011use crate::{12	function::{CallLocation, FunctionSignature, ParamName},13	stdlib::format::FormatError,14	typed::TypeLocError,15	ObjValue, ResolvePathOwned,16};1718#[derive(Debug, Clone, Acyclic)]19pub struct SyntaxError {20	pub message: String,21	pub location: Span,22}23impl fmt::Display for SyntaxError {24	fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {25		write!(f, "{}", self.message)26	}27}2829pub(crate) fn format_found(list: &[IStr], what: &str) -> String {30	if list.is_empty() {31		return String::new();32	}33	let mut out = String::new();34	out.push_str("\nThere ");35	if list.len() > 1 {36		out.push_str("are ");37	} else {38		out.push_str("is a ");39	}40	out.push_str(what);41	if list.len() > 1 {42		out.push('s');43	}44	out.push_str(" with similar name");45	if list.len() > 1 {46		out.push('s');47	}48	out.push_str(" present: ");49	for (i, v) in list.iter().enumerate() {50		if i != 0 {51			out.push_str(", ");52		}53		out.push_str(v as &str);54	}55	out56}5758const fn format_empty_str(str: &str) -> &str {59	if str.is_empty() {60		"\"\" (empty string)"61	} else {62		str63	}64}6566pub(crate) fn suggest_names<'a, 'b>(67	name: &'a IStr,68	names: impl IntoIterator<Item = &'b IStr>,69) -> Vec<IStr> {70	let mut heap: Vec<(f64, IStr)> = names71		.into_iter()72		.filter_map(|def| {73			let conf = strsim::jaro_winkler(def.as_str(), name.as_str());74			if conf < 0.8 {75				return None;76			}77			debug_assert!(78				def.as_str() != name.as_str(),79				"string pooling failure: look for DOC(string-pooling) comment in jrsonnet-interner"80			);8182			Some((conf, def.clone()))83		})84		.collect();85	heap.sort_by(|a, b| b.0.partial_cmp(&a.0).unwrap_or(Ordering::Equal));86	heap.into_iter().map(|v| v.1).collect()87}8889pub(crate) fn suggest_object_fields(v: &ObjValue, key: IStr) -> Vec<IStr> {90	let fields = v.fields_ex(91		true,92		#[cfg(feature = "exp-preserve-order")]93		false,94	);95	suggest_names(&key, &fields)96}9798/// Possible errors99#[allow(missing_docs)]100#[derive(Error, Debug, Clone, Trace)]101#[non_exhaustive]102pub enum ErrorKind {103	#[error("intrinsic not found: {0}")]104	IntrinsicNotFound(IStr),105106	#[error("operator {0} does not operate on type {1}")]107	UnaryOperatorDoesNotOperateOnType(UnaryOpType, ValType),108	#[error("binary operation {1} {0} {2} is not implemented")]109	BinaryOperatorDoesNotOperateOnValues(BinaryOpType, ValType, ValType),110111	#[error("self/super/$ are only usable inside objects")]112	CantUseSelfSupOutsideOfObject,113114	#[error("static analysis errors: {}", .0.iter().map(|d| d.message.as_str()).collect::<Vec<_>>().join("; "))]115	StaticAnalysisError(Vec<crate::analyze::Diagnostic>),116	#[error("no super found")]117	NoSuperFound,118119	#[error("for loop can only iterate over arrays")]120	InComprehensionCanOnlyIterateOverArray,121122	#[error("array out of bounds: {0} is not within [0,{1})")]123	ArrayBoundsError(isize, u32),124	#[error("string out of bounds: {0} is not within [0,{1})")]125	StringBoundsError(usize, usize),126127	#[error("assert failed: {}", format_empty_str(.0))]128	AssertionFailed(IStr),129130	#[error("type mismatch: expected {expected}, got {2} {0}", expected = .1.iter().map(|e| format!("{e}")).collect::<Vec<_>>().join(", "))]131	TypeMismatch(&'static str, Vec<ValType>, ValType),132	#[error("no such field: {}{}", format_empty_str(.0), format_found(.1, "field"))]133	NoSuchField(IStr, Vec<IStr>),134135	#[error("only functions can be called, got {0}")]136	OnlyFunctionsCanBeCalledGot(ValType),137	#[error("parameter {0} is not defined")]138	UnknownFunctionParameter(IStr),139	#[error("argument {0} is already bound")]140	BindingParameterASecondTime(IStr),141	#[error("too many args, function has {0}\nFunction has the following signature: {1}")]142	TooManyArgsFunctionHas(usize, FunctionSignature),143	#[error("function argument is not passed: {0}\nFunction has the following signature: {1}")]144	FunctionParameterNotBoundInCall(ParamName, FunctionSignature),145146	#[error("external variable is not defined: {0}")]147	UndefinedExternalVariable(IStr),148149	#[error("field name should be string, got {0}")]150	FieldMustBeStringGot(ValType),151	#[error("duplicate field name: {}", format_empty_str(.0))]152	DuplicateFieldName(IStr),153154	#[error("attempted to index array with string {}", format_empty_str(.0))]155	AttemptedIndexAnArrayWithString(IStr),156	#[error("{0} index type should be {1}, got {2}")]157	ValueIndexMustBeTypeGot(ValType, ValType, ValType),158	#[error("cant index into {0}")]159	CantIndexInto(ValType),160	#[error("{0} is not indexable")]161	ValueIsNotIndexable(ValType),162163	#[error("super can't be used standalone")]164	StandaloneSuper,165166	#[error("can't resolve {1} from {0}")]167	ImportFileNotFound(SourcePath, ResolvePathOwned),168	#[error("resolved file not found: {:?}", .0)]169	ResolvedFileNotFound(SourcePath),170	#[error("can't import {0}: is a directory")]171	ImportIsADirectory(SourcePath),172	#[error("imported file is not valid utf-8: {0:?}")]173	ImportBadFileUtf8(SourcePath),174	#[error("import io error: {0}")]175	ImportIo(String),176	#[error("tried to import {1} from {0}, but imports are not supported")]177	ImportNotSupported(SourcePath, ResolvePathOwned),178	#[error("can't import from virtual file")]179	CantImportFromVirtualFile,180	#[error("syntax error: {error}")]181	ImportSyntaxError {182		path: Source,183		error: Box<SyntaxError>,184	},185186	#[error("runtime error: {}", format_empty_str(.0))]187	RuntimeError(IStr),188	#[error("stack overflow, try to reduce recursion, or set --max-stack to bigger value")]189	StackOverflow,190	#[error("infinite recursion detected")]191	InfiniteRecursionDetected,192	#[error("tried to index by fractional value")]193	FractionalIndex,194	#[error("attempted to divide by zero")]195	DivisionByZero,196197	#[error("string manifest output is not an string")]198	StringManifestOutputIsNotAString,199	#[error("stream manifest output is not an array")]200	StreamManifestOutputIsNotAArray,201	#[error("multi manifest output is not an object")]202	MultiManifestOutputIsNotAObject,203204	#[error("cant recurse stream manifest")]205	StreamManifestOutputCannotBeRecursed,206	#[error("stream manifest output cannot consist of raw strings")]207	StreamManifestCannotNestString,208209	#[error("{}", format_empty_str(.0))]210	ImportCallbackError(String),211	#[error("invalid unicode codepoint: {0}")]212	InvalidUnicodeCodepointGot(u32),213214	#[error("convert num value: {0}")]215	ConvertNumValue(#[from] ConvertNumValueError),216217	#[error("format error: {0}")]218	Format(#[from] FormatError),219	#[error("type error: {0}")]220	TypeError(TypeLocError),221222	#[cfg(feature = "anyhow-error")]223	#[error(transparent)]224	Other(#[trace(skip)] std::rc::Rc<anyhow::Error>),225}226227#[cfg(feature = "anyhow-error")]228impl From<anyhow::Error> for Error {229	fn from(e: anyhow::Error) -> Self {230		Self::new(ErrorKind::Other(std::rc::Rc::new(e)))231	}232}233234impl From<ErrorKind> for Error {235	fn from(e: ErrorKind) -> Self {236		Self::new(e)237	}238}239impl From<ConvertNumValueError> for Error {240	fn from(e: ConvertNumValueError) -> Self {241		Self::new(ErrorKind::ConvertNumValue(e))242	}243}244245impl From<Infallible> for Error {246	fn from(_value: Infallible) -> Self {247		unreachable!()248	}249}250251/// Single stack trace frame252#[derive(Clone, Debug, Trace)]253pub struct StackTraceElement {254	/// Source of this frame255	/// Some frames only act as description, without attached source256	pub location: Option<Span>,257	/// Frame description258	pub desc: String,259}260#[derive(Debug, Clone, Trace)]261pub struct StackTrace(pub Vec<StackTraceElement>);262263#[derive(Clone, Trace)]264pub struct Error(Box<(ErrorKind, StackTrace)>);265266#[cfg(target_pointer_width = "64")]267static_assertions::assert_eq_size!(Error, usize);268269impl Error {270	pub fn new(e: ErrorKind) -> Self {271		Self(Box::new((e, StackTrace(vec![]))))272	}273274	pub const fn error(&self) -> &ErrorKind {275		&(self.0).0276	}277	pub fn error_mut(&mut self) -> &mut ErrorKind {278		&mut (self.0).0279	}280	pub const fn trace(&self) -> &StackTrace {281		&(self.0).1282	}283	pub fn trace_mut(&mut self) -> &mut StackTrace {284		&mut (self.0).1285	}286}287impl fmt::Display for Error {288	fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {289		writeln!(f, "{}", self.0 .0)?;290		for el in &self.0 .1 .0 {291			write!(f, "\t{}", el.desc)?;292			if let Some(loc) = &el.location {293				write!(f, "at {}", loc.0 .0 .0)?;294				loc.0.map_source_locations(&[loc.1, loc.2]);295			}296			writeln!(f)?;297		}298		Ok(())299	}300}301impl fmt::Debug for Error {302	fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {303		f.debug_tuple("LocError").field(&self.0).finish()304	}305}306impl std::error::Error for Error {}307308pub trait ErrorSource {309	fn to_location(self) -> Option<Span>;310}311impl<T: Acyclic> ErrorSource for &Spanned<T> {312	fn to_location(self) -> Option<Span> {313		Some(self.span.clone())314	}315}316impl ErrorSource for &Span {317	fn to_location(self) -> Option<Span> {318		Some(self.clone())319	}320}321impl ErrorSource for CallLocation<'_> {322	fn to_location(self) -> Option<Span> {323		self.0.cloned()324	}325}326327pub type Result<V, E = Error> = std::result::Result<V, E>;328pub trait ResultExt: Sized {329	#[must_use]330	fn with_description<O: Into<String>>(self, msg: impl FnOnce() -> O) -> Self;331	#[must_use]332	fn description(self, msg: &str) -> Self {333		self.with_description(|| msg)334	}335336	#[must_use]337	fn with_description_src<O: Into<String>>(338		self,339		src: impl ErrorSource,340		msg: impl FnOnce() -> O,341	) -> Self;342	#[must_use]343	fn description_src(self, src: impl ErrorSource, msg: &str) -> Self {344		self.with_description_src(src, || msg)345	}346}347impl<T> ResultExt for Result<T, Error> {348	fn with_description<O: Into<String>>(mut self, msg: impl FnOnce() -> O) -> Self {349		if let Err(e) = &mut self {350			let trace = e.trace_mut();351			trace.0.push(StackTraceElement {352				location: None,353				desc: msg().into(),354			});355		}356		self357	}358359	fn with_description_src<O: Into<String>>(360		mut self,361		src: impl ErrorSource,362		msg: impl FnOnce() -> O,363	) -> Self {364		if let Err(e) = &mut self {365			let trace = e.trace_mut();366			trace.0.push(StackTraceElement {367				location: src.to_location(),368				desc: msg().into(),369			});370		}371		self372	}373}374375#[macro_export]376macro_rules! bail {377	($w:ident$(::$i:ident)*$(($($tt:tt)*))?) => {378		return Err($w$(::$i)*$(($($tt)*))?.into())379	};380	($w:ident$(::$i:ident)*$({$($tt:tt)*})?) => {381		return Err($w$(::$i)*$({$($tt)*})?.into())382	};383	($l:literal$(, $($tt:tt)*)?) => {384		return Err($crate::error::ErrorKind::RuntimeError($crate::jrsonnet_macros::format_istr!($l$(, $($tt)*)?)).into())385	};386}387#[macro_export]388macro_rules! error {389	($w:ident$(::$i:ident)*$(($($tt:tt)*))?) => {390		$crate::error::Error::from($w$(::$i)*$(($($tt)*))?)391	};392	($w:ident$(::$i:ident)*$({$($tt:tt)*})?) => {393		$crate::error::Error::from($w$(::$i)*$({$($tt)*})?)394	};395	($l:literal$(, $($tt:tt)*)?) => {396		<$crate::error::Error as From<$crate::error::ErrorKind>>::from($crate::error::ErrorKind::RuntimeError($crate::jrsonnet_macros::format_istr!($l$(, $($tt)*)?)).into())397	};398}399400#[macro_export]401macro_rules! runtime_error {402	($l:literal$(, $($tt:tt)*)?) => {403		$crate::error::Error::from($crate::error::ErrorKind::RuntimeError($crate::jrsonnet_macros::format_istr!($l$(, $($tt)*)?)))404	};405}
after · crates/jrsonnet-evaluator/src/error.rs
1use std::{cmp::Ordering, convert::Infallible, fmt};23use jrsonnet_gcmodule::{Acyclic, Trace};4use jrsonnet_interner::IStr;5use jrsonnet_ir::{6	BinaryOpType, ConvertNumValueError, Source, SourcePath, Span, Spanned, UnaryOpType,7};8use jrsonnet_types::ValType;9use thiserror::Error;1011use crate::{12	ObjValue, ResolvePathOwned,13	function::{CallLocation, FunctionSignature, ParamName},14	stdlib::format::FormatError,15	typed::TypeLocError,16};1718#[derive(Debug, Clone, Acyclic)]19pub struct SyntaxError {20	pub message: String,21	pub location: Span,22}23impl fmt::Display for SyntaxError {24	fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {25		write!(f, "{}", self.message)26	}27}2829pub(crate) fn format_found(list: &[IStr], what: &str) -> String {30	if list.is_empty() {31		return String::new();32	}33	let mut out = String::new();34	out.push_str("\nThere ");35	if list.len() > 1 {36		out.push_str("are ");37	} else {38		out.push_str("is a ");39	}40	out.push_str(what);41	if list.len() > 1 {42		out.push('s');43	}44	out.push_str(" with similar name");45	if list.len() > 1 {46		out.push('s');47	}48	out.push_str(" present: ");49	for (i, v) in list.iter().enumerate() {50		if i != 0 {51			out.push_str(", ");52		}53		out.push_str(v as &str);54	}55	out56}5758const fn format_empty_str(str: &str) -> &str {59	if str.is_empty() {60		"\"\" (empty string)"61	} else {62		str63	}64}6566pub(crate) fn suggest_names<'a, 'b>(67	name: &'a IStr,68	names: impl IntoIterator<Item = &'b IStr>,69) -> Vec<IStr> {70	let mut heap: Vec<(f64, IStr)> = names71		.into_iter()72		.filter_map(|def| {73			let conf = strsim::jaro_winkler(def.as_str(), name.as_str());74			if conf < 0.8 {75				return None;76			}77			debug_assert!(78				def.as_str() != name.as_str(),79				"string pooling failure: look for DOC(string-pooling) comment in jrsonnet-interner"80			);8182			Some((conf, def.clone()))83		})84		.collect();85	heap.sort_by(|a, b| b.0.partial_cmp(&a.0).unwrap_or(Ordering::Equal));86	heap.into_iter().map(|v| v.1).collect()87}8889pub(crate) fn suggest_object_fields(v: &ObjValue, key: IStr) -> Vec<IStr> {90	let fields = v.fields_ex(91		true,92		#[cfg(feature = "exp-preserve-order")]93		false,94	);95	suggest_names(&key, &fields)96}9798/// Possible errors99#[allow(missing_docs)]100#[derive(Error, Debug, Clone, Trace)]101#[non_exhaustive]102pub enum ErrorKind {103	#[error("intrinsic not found: {0}")]104	IntrinsicNotFound(IStr),105106	#[error("operator {0} does not operate on type {1}")]107	UnaryOperatorDoesNotOperateOnType(UnaryOpType, ValType),108	#[error("binary operation {1} {0} {2} is not implemented")]109	BinaryOperatorDoesNotOperateOnValues(BinaryOpType, ValType, ValType),110111	#[error("self/super/$ are only usable inside objects")]112	CantUseSelfSupOutsideOfObject,113114	#[error("static analysis errors: {}", .0.iter().map(|d| d.message.as_str()).collect::<Vec<_>>().join("; "))]115	StaticAnalysisError(Vec<crate::analyze::Diagnostic>),116	#[error("no super found")]117	NoSuperFound,118119	#[error("for loop can only iterate over arrays")]120	InComprehensionCanOnlyIterateOverArray,121122	#[error("array out of bounds: {0} is not within [0,{1})")]123	ArrayBoundsError(isize, u32),124	#[error("string out of bounds: {0} is not within [0,{1})")]125	StringBoundsError(usize, usize),126127	#[error("assert failed: {}", format_empty_str(.0))]128	AssertionFailed(IStr),129130	#[error("type mismatch: expected {expected}, got {2} {0}", expected = .1.iter().map(|e| format!("{e}")).collect::<Vec<_>>().join(", "))]131	TypeMismatch(&'static str, Vec<ValType>, ValType),132	#[error("no such field: {}{}", format_empty_str(.0), format_found(.1, "field"))]133	NoSuchField(IStr, Vec<IStr>),134135	#[error("only functions can be called, got {0}")]136	OnlyFunctionsCanBeCalledGot(ValType),137	#[error("parameter {0} is not defined")]138	UnknownFunctionParameter(IStr),139	#[error("argument {0} is already bound")]140	BindingParameterASecondTime(IStr),141	#[error("too many args, function has {0}\nFunction has the following signature: {1}")]142	TooManyArgsFunctionHas(usize, FunctionSignature),143	#[error("function argument is not passed: {0}\nFunction has the following signature: {1}")]144	FunctionParameterNotBoundInCall(ParamName, FunctionSignature),145146	#[error("external variable is not defined: {0}")]147	UndefinedExternalVariable(IStr),148149	#[error("field name should be string, got {0}")]150	FieldMustBeStringGot(ValType),151	#[error("duplicate field name: {}", format_empty_str(.0))]152	DuplicateFieldName(IStr),153154	#[error("attempted to index array with string {}", format_empty_str(.0))]155	AttemptedIndexAnArrayWithString(IStr),156	#[error("{0} index type should be {1}, got {2}")]157	ValueIndexMustBeTypeGot(ValType, ValType, ValType),158	#[error("cant index into {0}")]159	CantIndexInto(ValType),160	#[error("{0} is not indexable")]161	ValueIsNotIndexable(ValType),162163	#[error("super can't be used standalone")]164	StandaloneSuper,165166	#[error("can't resolve {1} from {0}")]167	ImportFileNotFound(SourcePath, ResolvePathOwned),168	#[error("resolved file not found: {:?}", .0)]169	ResolvedFileNotFound(SourcePath),170	#[error("can't import {0}: is a directory")]171	ImportIsADirectory(SourcePath),172	#[error("imported file is not valid utf-8: {0:?}")]173	ImportBadFileUtf8(SourcePath),174	#[error("import io error: {0}")]175	ImportIo(String),176	#[error("tried to import {1} from {0}, but imports are not supported")]177	ImportNotSupported(SourcePath, ResolvePathOwned),178	#[error("can't import from virtual file")]179	CantImportFromVirtualFile,180	#[error("syntax error: {error}")]181	ImportSyntaxError {182		path: Source,183		error: Box<SyntaxError>,184	},185186	#[error("runtime error: {}", format_empty_str(.0))]187	RuntimeError(IStr),188	#[error("stack overflow, try to reduce recursion, or set --max-stack to bigger value")]189	StackOverflow,190	#[error("infinite recursion detected")]191	InfiniteRecursionDetected,192	#[error("tried to index by fractional value")]193	FractionalIndex,194	#[error("attempted to divide by zero")]195	DivisionByZero,196197	#[error("string manifest output is not an string")]198	StringManifestOutputIsNotAString,199	#[error("stream manifest output is not an array")]200	StreamManifestOutputIsNotAArray,201	#[error("multi manifest output is not an object")]202	MultiManifestOutputIsNotAObject,203204	#[error("cant recurse stream manifest")]205	StreamManifestOutputCannotBeRecursed,206	#[error("stream manifest output cannot consist of raw strings")]207	StreamManifestCannotNestString,208209	#[error("{}", format_empty_str(.0))]210	ImportCallbackError(String),211	#[error("invalid unicode codepoint: {0}")]212	InvalidUnicodeCodepointGot(u32),213214	#[error("convert num value: {0}")]215	ConvertNumValue(#[from] ConvertNumValueError),216217	#[error("format error: {0}")]218	Format(#[from] FormatError),219	#[error("type error: {0}")]220	TypeError(TypeLocError),221222	#[cfg(feature = "anyhow-error")]223	#[error(transparent)]224	Other(#[trace(skip)] std::rc::Rc<anyhow::Error>),225}226227#[cfg(feature = "anyhow-error")]228impl From<anyhow::Error> for Error {229	fn from(e: anyhow::Error) -> Self {230		Self::new(ErrorKind::Other(std::rc::Rc::new(e)))231	}232}233234impl From<ErrorKind> for Error {235	fn from(e: ErrorKind) -> Self {236		Self::new(e)237	}238}239impl From<ConvertNumValueError> for Error {240	fn from(e: ConvertNumValueError) -> Self {241		Self::new(ErrorKind::ConvertNumValue(e))242	}243}244245impl From<Infallible> for Error {246	fn from(_value: Infallible) -> Self {247		unreachable!()248	}249}250251/// Single stack trace frame252#[derive(Clone, Debug, Trace)]253pub struct StackTraceElement {254	/// Source of this frame255	/// Some frames only act as description, without attached source256	pub location: Option<Span>,257	/// Frame description258	pub desc: String,259}260#[derive(Debug, Clone, Trace)]261pub struct StackTrace(pub Vec<StackTraceElement>);262263#[derive(Clone, Trace)]264pub struct Error(Box<(ErrorKind, StackTrace)>);265266#[cfg(target_pointer_width = "64")]267static_assertions::assert_eq_size!(Error, usize);268269impl Error {270	pub fn new(e: ErrorKind) -> Self {271		Self(Box::new((e, StackTrace(vec![]))))272	}273274	pub const fn error(&self) -> &ErrorKind {275		&(self.0).0276	}277	pub fn error_mut(&mut self) -> &mut ErrorKind {278		&mut (self.0).0279	}280	pub const fn trace(&self) -> &StackTrace {281		&(self.0).1282	}283	pub fn trace_mut(&mut self) -> &mut StackTrace {284		&mut (self.0).1285	}286}287impl fmt::Display for Error {288	fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {289		writeln!(f, "{}", self.0.0)?;290		for el in &self.0.1.0 {291			write!(f, "\t{}", el.desc)?;292			if let Some(loc) = &el.location {293				write!(f, "at {}", loc.0.0.0)?;294				loc.0.map_source_locations(&[loc.1, loc.2]);295			}296			writeln!(f)?;297		}298		Ok(())299	}300}301impl fmt::Debug for Error {302	fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {303		f.debug_tuple("LocError").field(&self.0).finish()304	}305}306impl std::error::Error for Error {}307308pub trait ErrorSource {309	fn to_location(self) -> Option<Span>;310}311impl<T: Acyclic> ErrorSource for &Spanned<T> {312	fn to_location(self) -> Option<Span> {313		Some(self.span.clone())314	}315}316impl ErrorSource for &Span {317	fn to_location(self) -> Option<Span> {318		Some(self.clone())319	}320}321impl ErrorSource for CallLocation<'_> {322	fn to_location(self) -> Option<Span> {323		self.0.cloned()324	}325}326327pub type Result<V, E = Error> = std::result::Result<V, E>;328pub trait ResultExt: Sized {329	#[must_use]330	fn with_description<O: Into<String>>(self, msg: impl FnOnce() -> O) -> Self;331	#[must_use]332	fn description(self, msg: &str) -> Self {333		self.with_description(|| msg)334	}335336	#[must_use]337	fn with_description_src<O: Into<String>>(338		self,339		src: impl ErrorSource,340		msg: impl FnOnce() -> O,341	) -> Self;342	#[must_use]343	fn description_src(self, src: impl ErrorSource, msg: &str) -> Self {344		self.with_description_src(src, || msg)345	}346}347impl<T> ResultExt for Result<T, Error> {348	fn with_description<O: Into<String>>(mut self, msg: impl FnOnce() -> O) -> Self {349		if let Err(e) = &mut self {350			let trace = e.trace_mut();351			trace.0.push(StackTraceElement {352				location: None,353				desc: msg().into(),354			});355		}356		self357	}358359	fn with_description_src<O: Into<String>>(360		mut self,361		src: impl ErrorSource,362		msg: impl FnOnce() -> O,363	) -> Self {364		if let Err(e) = &mut self {365			let trace = e.trace_mut();366			trace.0.push(StackTraceElement {367				location: src.to_location(),368				desc: msg().into(),369			});370		}371		self372	}373}374375#[macro_export]376macro_rules! bail {377	($w:ident$(::$i:ident)*$(($($tt:tt)*))?) => {378		return Err($w$(::$i)*$(($($tt)*))?.into())379	};380	($w:ident$(::$i:ident)*$({$($tt:tt)*})?) => {381		return Err($w$(::$i)*$({$($tt)*})?.into())382	};383	($l:literal$(, $($tt:tt)*)?) => {384		return Err($crate::error::ErrorKind::RuntimeError($crate::jrsonnet_macros::format_istr!($l$(, $($tt)*)?)).into())385	};386}387#[macro_export]388macro_rules! error {389	($w:ident$(::$i:ident)*$(($($tt:tt)*))?) => {390		$crate::error::Error::from($w$(::$i)*$(($($tt)*))?)391	};392	($w:ident$(::$i:ident)*$({$($tt:tt)*})?) => {393		$crate::error::Error::from($w$(::$i)*$({$($tt)*})?)394	};395	($l:literal$(, $($tt:tt)*)?) => {396		<$crate::error::Error as From<$crate::error::ErrorKind>>::from($crate::error::ErrorKind::RuntimeError($crate::jrsonnet_macros::format_istr!($l$(, $($tt)*)?)).into())397	};398}399400#[macro_export]401macro_rules! runtime_error {402	($l:literal$(, $($tt:tt)*)?) => {403		$crate::error::Error::from($crate::error::ErrorKind::RuntimeError($crate::jrsonnet_macros::format_istr!($l$(, $($tt)*)?)))404	};405}
modifiedcrates/jrsonnet-evaluator/src/evaluate/compspec.rsdiffbeforeafterboth
--- a/crates/jrsonnet-evaluator/src/evaluate/compspec.rs
+++ b/crates/jrsonnet-evaluator/src/evaluate/compspec.rs
@@ -7,12 +7,12 @@
 	evaluate_field_member_static, evaluate_field_member_unbound,
 };
 use crate::{
+	Context, ContextBuilder, ObjValue, ObjValueBuilder, Pending, Result, Thunk, Val,
 	analyze::{LArrComp, LBind, LCompSpec, LDestruct, LExpr, LFieldMember, LObjComp, LocalId},
 	arr::ArrValue,
 	bail,
 	error::ErrorKind::*,
 	evaluate::evaluate,
-	Context, ContextBuilder, ObjValue, ObjValueBuilder, Pending, Result, Thunk, Val,
 };
 
 trait CompCollector {
modifiedcrates/jrsonnet-evaluator/src/evaluate/destructure.rsdiffbeforeafterboth
--- a/crates/jrsonnet-evaluator/src/evaluate/destructure.rs
+++ b/crates/jrsonnet-evaluator/src/evaluate/destructure.rs
@@ -3,10 +3,10 @@
 use jrsonnet_gcmodule::Trace;
 
 use crate::{
+	Context, ContextBuilder, Pending, Result, SupThis, Thunk, Unbound, Val,
 	analyze::{LBind, LDestruct, LDestructField, LDestructRest, LExpr, LocalId},
 	bail,
 	evaluate::evaluate,
-	Context, ContextBuilder, Pending, Result, SupThis, Thunk, Unbound, Val,
 };
 
 #[allow(dead_code, reason = "not dead in exp-destruct")]
@@ -97,7 +97,7 @@
 	use jrsonnet_interner::IStr;
 	use rustc_hash::FxHashSet;
 
-	use crate::{bail, ObjValueBuilder};
+	use crate::{ObjValueBuilder, bail};
 
 	let captured_fields: FxHashSet<IStr> = fields.iter().map(|f| f.name.clone()).collect();
 	let field_names: Vec<(IStr, bool)> = fields
modifiedcrates/jrsonnet-evaluator/src/evaluate/mod.rsdiffbeforeafterboth
--- a/crates/jrsonnet-evaluator/src/evaluate/mod.rs
+++ b/crates/jrsonnet-evaluator/src/evaluate/mod.rs
@@ -11,19 +11,20 @@
 	operator::evaluate_binary_op_special,
 };
 use crate::{
+	Context, Error, ObjValue, ObjValueBuilder, ObjectAssertion, Result, ResultExt as _, SupThis,
+	Unbound, Val,
 	analyze::{
 		LArgsDesc, LAssertStmt, LExpr, LFieldMember, LFieldName, LFunction, LIndexPart, LObjBody,
 		LObjMembers,
 	},
 	bail,
-	error::{suggest_object_fields, ErrorKind::*},
+	error::{ErrorKind::*, suggest_object_fields},
 	evaluate::operator::evaluate_unary_op,
-	function::{prepared::PreparedFuncVal, CallLocation, FuncDesc, FuncVal},
+	function::{CallLocation, FuncDesc, FuncVal, prepared::PreparedFuncVal},
 	in_frame, runtime_error,
 	typed::FromUntyped as _,
 	val::{CachedUnbound, Thunk},
-	with_state, Context, Error, ObjValue, ObjValueBuilder, ObjectAssertion, Result, ResultExt as _,
-	SupThis, Unbound, Val,
+	with_state,
 };
 
 pub mod compspec;
modifiedcrates/jrsonnet-evaluator/src/evaluate/operator.rsdiffbeforeafterboth
--- a/crates/jrsonnet-evaluator/src/evaluate/operator.rs
+++ b/crates/jrsonnet-evaluator/src/evaluate/operator.rs
@@ -3,6 +3,7 @@
 use jrsonnet_ir::{BinaryOpType, UnaryOpType};
 
 use crate::{
+	Context, Result, Val,
 	analyze::LExpr,
 	arr::ArrValue,
 	bail, error,
@@ -10,8 +11,7 @@
 	evaluate::evaluate,
 	stdlib::std_format,
 	typed::IntoUntyped as _,
-	val::{equals, StrValue},
-	Context, Result, Val,
+	val::{StrValue, equals},
 };
 
 pub fn evaluate_unary_op(op: UnaryOpType, b: &Val) -> Result<Val> {
modifiedcrates/jrsonnet-evaluator/src/function/mod.rsdiffbeforeafterboth
--- a/crates/jrsonnet-evaluator/src/function/mod.rs
+++ b/crates/jrsonnet-evaluator/src/function/mod.rs
@@ -8,13 +8,13 @@
 
 use self::{
 	builtin::Builtin,
-	prepared::{parse_prepared_builtin_call, PreparedCall},
+	prepared::{PreparedCall, parse_prepared_builtin_call},
 };
 use crate::{
+	Context, ContextBuilder, Result, Thunk, Val,
 	analyze::{LDestruct, LExpr, LFunction},
 	evaluate::{destructure::destruct, ensure_sufficient_stack, evaluate, evaluate_trivial},
 	function::builtin::BuiltinFunc,
-	Context, ContextBuilder, Result, Thunk, Val,
 };
 
 pub mod builtin;
@@ -210,8 +210,7 @@
 					return false;
 				}
 				#[allow(irrefutable_let_patterns, reason = "refutable with exp-destruct")]
-				let LDestruct::Full(id) = &param.destruct
-				else {
+				let LDestruct::Full(id) = &param.destruct else {
 					return false;
 				};
 				matches!(&*desc.func.body, LExpr::Local(v) if v == id)
modifiedcrates/jrsonnet-evaluator/src/function/parse.rsdiffbeforeafterboth
--- a/crates/jrsonnet-evaluator/src/function/parse.rs
+++ b/crates/jrsonnet-evaluator/src/function/parse.rs
@@ -1,9 +1,9 @@
 use std::rc::Rc;
 
 use crate::{
+	Context, ContextBuilder, Result, Thunk,
 	analyze::LFunction,
 	evaluate::{destructure::destruct, evaluate},
-	Context, ContextBuilder, Result, Thunk,
 };
 
 /// Creates Context with all argument default values applied
modifiedcrates/jrsonnet-evaluator/src/function/prepared.rsdiffbeforeafterboth
--- a/crates/jrsonnet-evaluator/src/function/prepared.rs
+++ b/crates/jrsonnet-evaluator/src/function/prepared.rs
@@ -5,10 +5,7 @@
 use rustc_hash::FxHashSet;
 
 use super::{CallLocation, FuncVal};
-use crate::{
-	Result, Thunk, Val, bail,
-	error::ErrorKind::*,
-};
+use crate::{Result, Thunk, Val, bail, error::ErrorKind::*};
 
 #[derive(Debug, Trace, Clone)]
 pub struct PreparedFuncVal {
modifiedcrates/jrsonnet-evaluator/src/integrations/serde.rsdiffbeforeafterboth
--- a/crates/jrsonnet-evaluator/src/integrations/serde.rs
+++ b/crates/jrsonnet-evaluator/src/integrations/serde.rs
@@ -3,16 +3,16 @@
 use jrsonnet_interner::{IBytes, IStr};
 use jrsonnet_ir::NumValue;
 use serde::{
+	Deserialize, Serialize, Serializer,
 	de::{self, Visitor},
 	ser::{
 		Error, SerializeMap, SerializeSeq, SerializeStruct, SerializeStructVariant, SerializeTuple,
 		SerializeTupleStruct, SerializeTupleVariant,
 	},
-	Deserialize, Serialize, Serializer,
 };
 
 use crate::{
-	in_description_frame, runtime_error, Error as JrError, ObjValue, ObjValueBuilder, Result, Val,
+	Error as JrError, ObjValue, ObjValueBuilder, Result, Val, in_description_frame, runtime_error,
 };
 
 impl<'de> Deserialize<'de> for Val {
modifiedcrates/jrsonnet-evaluator/src/lib.rsdiffbeforeafterboth
--- a/crates/jrsonnet-evaluator/src/lib.rs
+++ b/crates/jrsonnet-evaluator/src/lib.rs
@@ -39,7 +39,7 @@
 pub use evaluate::ensure_sufficient_stack;
 use function::CallLocation;
 pub use import::*;
-use jrsonnet_gcmodule::{cc_dyn, Cc, Trace};
+use jrsonnet_gcmodule::{Cc, Trace, cc_dyn};
 pub use jrsonnet_interner::{IBytes, IStr};
 use jrsonnet_ir::Expr;
 pub use jrsonnet_ir::{NumValue, Source, SourcePath, Span};
modifiedcrates/jrsonnet-evaluator/src/manifest.rsdiffbeforeafterboth
--- a/crates/jrsonnet-evaluator/src/manifest.rs
+++ b/crates/jrsonnet-evaluator/src/manifest.rs
@@ -1,8 +1,7 @@
 use std::{borrow::Cow, fmt::Write, hint::black_box, ptr};
 
 use crate::{
-	bail, evaluate::ensure_sufficient_stack, in_description_frame, Error,
-	Result, ResultExt, Val,
+	Error, Result, ResultExt, Val, bail, evaluate::ensure_sufficient_stack, in_description_frame,
 };
 
 pub trait ManifestFormat {
modifiedcrates/jrsonnet-evaluator/src/obj/mod.rsdiffbeforeafterboth
--- a/crates/jrsonnet-evaluator/src/obj/mod.rs
+++ b/crates/jrsonnet-evaluator/src/obj/mod.rs
@@ -11,8 +11,8 @@
 };
 
 use educe::Educe;
-use im_rc::{vector, Vector};
-use jrsonnet_gcmodule::{cc_dyn, Acyclic, Cc, Trace, Weak};
+use im_rc::{Vector, vector};
+use jrsonnet_gcmodule::{Acyclic, Cc, Trace, Weak, cc_dyn};
 use jrsonnet_interner::IStr;
 use jrsonnet_ir::Span;
 use rustc_hash::{FxHashMap, FxHashSet};
@@ -23,13 +23,13 @@
 pub use oop::ObjValueBuilder;
 
 use crate::{
+	CcUnbound, MaybeUnbound, Result, Thunk, Unbound, Val,
 	arr::{PickObjectKeyValues, PickObjectValues},
 	bail,
-	error::{suggest_object_fields, ErrorKind::*},
+	error::{ErrorKind::*, suggest_object_fields},
 	evaluate::operator::evaluate_add_op,
 	identity_hash,
 	val::{ArrValue, ThunkValue},
-	CcUnbound, MaybeUnbound, Result, Thunk, Unbound, Val,
 };
 
 #[cfg(not(feature = "exp-preserve-order"))]
modifiedcrates/jrsonnet-evaluator/src/trace/mod.rsdiffbeforeafterboth
--- a/crates/jrsonnet-evaluator/src/trace/mod.rs
+++ b/crates/jrsonnet-evaluator/src/trace/mod.rs
@@ -10,7 +10,7 @@
 #[cfg(feature = "explaining-traces")]
 use jrsonnet_ir::Span;
 
-use crate::{error::ErrorKind, Error};
+use crate::{Error, error::ErrorKind};
 
 /// The way paths should be displayed
 #[derive(Clone, Trace)]
@@ -259,7 +259,7 @@
 		struct ResetData {
 			loc: Span,
 		}
-		use hi_doc::{source_to_ansi, Formatting, SnippetBuilder, Text};
+		use hi_doc::{Formatting, SnippetBuilder, Text, source_to_ansi};
 
 		write!(out, "{}", error.error())?;
 		if let ErrorKind::ImportSyntaxError { path, error } = error.error() {
@@ -277,14 +277,15 @@
 			use crate::analyze::DiagLevel;
 			let mut builder: Option<SnippetBuilder> = None;
 			let mut current_src: Option<&str> = None;
-			let flush =
-				|builder: Option<SnippetBuilder>, out: &mut dyn std::fmt::Write| -> Result<(), std::fmt::Error> {
-					if let Some(b) = builder {
-						let ansi = source_to_ansi(&b.build());
-						write!(out, "\n{}", ansi.trim_end())?;
-					}
-					Ok(())
-				};
+			let flush = |builder: Option<SnippetBuilder>,
+			             out: &mut dyn std::fmt::Write|
+			 -> Result<(), std::fmt::Error> {
+				if let Some(b) = builder {
+					let ansi = source_to_ansi(&b.build());
+					write!(out, "\n{}", ansi.trim_end())?;
+				}
+				Ok(())
+			};
 			for diag in diagnostics {
 				if let Some(span) = &diag.span {
 					let src = span.0.code();
@@ -295,14 +296,12 @@
 					}
 					let b = builder.as_mut().unwrap();
 					let ab = match diag.level {
-						DiagLevel::Error => b.error(Text::fragment(
-							diag.message.clone(),
-							Formatting::default(),
-						)),
-						DiagLevel::Warning => b.warning(Text::fragment(
-							diag.message.clone(),
-							Formatting::default(),
-						)),
+						DiagLevel::Error => {
+							b.error(Text::fragment(diag.message.clone(), Formatting::default()))
+						}
+						DiagLevel::Warning => {
+							b.warning(Text::fragment(diag.message.clone(), Formatting::default()))
+						}
 					};
 					ab.range(span.range()).build();
 				} else {
modifiedcrates/jrsonnet-evaluator/src/val.rsdiffbeforeafterboth
--- a/crates/jrsonnet-evaluator/src/val.rs
+++ b/crates/jrsonnet-evaluator/src/val.rs
@@ -17,7 +17,13 @@
 
 pub use crate::arr::{ArrValue, ArrayLike};
 use crate::{
-	NumValue, ObjValue, Result, SupThis, Unbound, WeakSupThis, bail, error::{Error, ErrorKind::*}, evaluate::operator::{evaluate_compare_op, evaluate_mod_op}, function::FuncVal, gc::WithCapacityExt as _, manifest::{ManifestFormat, ToStringFormat}, typed::BoundedUsize
+	NumValue, ObjValue, Result, SupThis, Unbound, WeakSupThis, bail,
+	error::{Error, ErrorKind::*},
+	evaluate::operator::{evaluate_compare_op, evaluate_mod_op},
+	function::FuncVal,
+	gc::WithCapacityExt as _,
+	manifest::{ManifestFormat, ToStringFormat},
+	typed::BoundedUsize,
 };
 
 pub trait ThunkValue: Trace {
modifiedcrates/jrsonnet-ir-parser/src/lib.rsdiffbeforeafterboth
--- a/crates/jrsonnet-ir-parser/src/lib.rs
+++ b/crates/jrsonnet-ir-parser/src/lib.rs
@@ -1,11 +1,11 @@
 use jrsonnet_gcmodule::Acyclic;
 use jrsonnet_ir::{
-	unescape, ArgsDesc, AssertExpr, AssertStmt, BinaryOp, BinaryOpType, BindSpec, CompSpec,
-	Destruct, Expr, ExprParam, ExprParams, FieldMember, FieldName, ForSpecData, IStr, IfElse,
-	IfSpecData, ImportKind, IndexPart, LiteralType, Member, NumValue, ObjBody, ObjComp, ObjMembers,
-	Slice, SliceDesc, Source, Span, Spanned, UnaryOpType, Visibility,
+	ArgsDesc, AssertExpr, AssertStmt, BinaryOp, BinaryOpType, BindSpec, CompSpec, Destruct, Expr,
+	ExprParam, ExprParams, FieldMember, FieldName, ForSpecData, IStr, IfElse, IfSpecData,
+	ImportKind, IndexPart, LiteralType, Member, NumValue, ObjBody, ObjComp, ObjMembers, Slice,
+	SliceDesc, Source, Span, Spanned, UnaryOpType, Visibility, unescape,
 };
-use jrsonnet_lexer::{collect_lexed_str_block, Lexeme, Lexer, Span as LexSpan, SyntaxKind, T};
+use jrsonnet_lexer::{Lexeme, Lexer, Span as LexSpan, SyntaxKind, T, collect_lexed_str_block};
 
 pub struct ParserSettings {
 	pub source: Source,
modifiedcrates/jrsonnet-ir/src/expr.rsdiffbeforeafterboth
--- a/crates/jrsonnet-ir/src/expr.rs
+++ b/crates/jrsonnet-ir/src/expr.rs
@@ -7,9 +7,9 @@
 use jrsonnet_interner::IStr;
 
 use crate::{
+	NumValue,
 	function::{FunctionSignature, ParamDefault, ParamName, ParamParse},
 	source::Source,
-	NumValue,
 };
 
 #[derive(Debug, PartialEq, Acyclic)]
modifiedcrates/jrsonnet-macros/src/lib.rsdiffbeforeafterboth
--- a/crates/jrsonnet-macros/src/lib.rs
+++ b/crates/jrsonnet-macros/src/lib.rs
@@ -3,14 +3,13 @@
 use proc_macro2::TokenStream;
 use quote::{quote, quote_spanned};
 use syn::{
-	parenthesized,
+	Attribute, DeriveInput, Error, Expr, ExprClosure, FnArg, GenericArgument, Ident, ItemFn,
+	LitStr, Meta, Pat, Path, PathArguments, Result, ReturnType, Token, Type, parenthesized,
 	parse::{Parse, ParseStream},
 	parse_macro_input,
 	punctuated::Punctuated,
 	spanned::Spanned,
 	token::Comma,
-	Attribute, DeriveInput, Error, Expr, ExprClosure, FnArg, GenericArgument, Ident, ItemFn,
-	LitStr, Meta, Pat, Path, PathArguments, Result, ReturnType, Token, Type,
 };
 
 use self::typed::{derive_from_untyped_inner, derive_into_untyped_inner, derive_typed_inner};
modifiedcrates/jrsonnet-stdlib/src/arrays.rsdiffbeforeafterboth
--- a/crates/jrsonnet-stdlib/src/arrays.rs
+++ b/crates/jrsonnet-stdlib/src/arrays.rs
@@ -1,12 +1,11 @@
 #![allow(non_snake_case)]
 
 use jrsonnet_evaluator::{
-	bail, error,
-	function::{builtin, NativeFn},
+	Either, IStr, ObjValue, ObjValueBuilder, Result, ResultExt, Thunk, Val, bail, error,
+	function::{NativeFn, builtin},
 	runtime_error,
 	typed::{BoundedUsize, Either2, FromUntyped},
-	val::{equals, ArrValue, IndexableVal},
-	Either, IStr, ObjValue, ObjValueBuilder, Result, ResultExt, Thunk, Val,
+	val::{ArrValue, IndexableVal, equals},
 };
 
 pub fn eval_on_empty(on_empty: Option<Thunk<Val>>) -> Result<Val> {
modifiedcrates/jrsonnet-stdlib/src/compat.rsdiffbeforeafterboth
--- a/crates/jrsonnet-stdlib/src/compat.rs
+++ b/crates/jrsonnet-stdlib/src/compat.rs
@@ -1,6 +1,6 @@
 use std::cmp::Ordering;
 
-use jrsonnet_evaluator::{function::builtin, val::ArrValue, Result, Val};
+use jrsonnet_evaluator::{Result, Val, function::builtin, val::ArrValue};
 
 #[builtin]
 #[allow(non_snake_case)]
modifiedcrates/jrsonnet-stdlib/src/lib.rsdiffbeforeafterboth
--- a/crates/jrsonnet-stdlib/src/lib.rs
+++ b/crates/jrsonnet-stdlib/src/lib.rs
@@ -12,7 +12,12 @@
 pub use encoding::*;
 pub use hash::*;
 use jrsonnet_evaluator::{
-	IStr, InitialContextBuilder, NumValue, ObjValue, ObjValueBuilder, Source, Thunk, Val, error::Result, function::{CallLocation, FuncVal, builtin_id}, tla::TlaArg, trace::PathResolver, typed::SerializeTypedObj as _
+	IStr, InitialContextBuilder, NumValue, ObjValue, ObjValueBuilder, Source, Thunk, Val,
+	error::Result,
+	function::{CallLocation, FuncVal, builtin_id},
+	tla::TlaArg,
+	trace::PathResolver,
+	typed::SerializeTypedObj as _,
 };
 use jrsonnet_gcmodule::{Acyclic, Cc, Trace};
 use jrsonnet_macros::{IntoUntyped, Typed};
modifiedcrates/jrsonnet-stdlib/src/manifest/toml.rsdiffbeforeafterboth
--- a/crates/jrsonnet-stdlib/src/manifest/toml.rs
+++ b/crates/jrsonnet-stdlib/src/manifest/toml.rs
@@ -1,7 +1,10 @@
 use std::borrow::Cow;
 
 use jrsonnet_evaluator::{
-	Error, IStr, ObjValue, Result, ResultExt, Val, bail, ensure_sufficient_stack, in_description_frame, manifest::{ManifestFormat, escape_string_json_buf}, val::ArrValue
+	Error, IStr, ObjValue, Result, ResultExt, Val, bail, ensure_sufficient_stack,
+	in_description_frame,
+	manifest::{ManifestFormat, escape_string_json_buf},
+	val::ArrValue,
 };
 
 pub struct TomlFormat<'s> {
@@ -218,14 +221,16 @@
 		}
 		first = false;
 		path.push(k.clone());
-		ensure_sufficient_stack(|| in_description_frame(
-			|| format!("section <{k}> manifestification"),
-			|| match v {
-				Val::Obj(obj) => manifest_table(&obj, path, buf, cur_padding, options),
-				Val::Arr(arr) => manifest_table_array(&arr, path, buf, cur_padding, options),
-				_ => unreachable!("iterating over sections"),
-			},
-		))?;
+		ensure_sufficient_stack(|| {
+			in_description_frame(
+				|| format!("section <{k}> manifestification"),
+				|| match v {
+					Val::Obj(obj) => manifest_table(&obj, path, buf, cur_padding, options),
+					Val::Arr(arr) => manifest_table_array(&arr, path, buf, cur_padding, options),
+					_ => unreachable!("iterating over sections"),
+				},
+			)
+		})?;
 		path.pop();
 	}
 	Ok(())
modifiedcrates/jrsonnet-stdlib/src/misc.rsdiffbeforeafterboth
--- a/crates/jrsonnet-stdlib/src/misc.rs
+++ b/crates/jrsonnet-stdlib/src/misc.rs
@@ -1,13 +1,12 @@
 use std::{cell::RefCell, collections::BTreeSet};
 
 use jrsonnet_evaluator::{
-	bail,
+	Either, IStr, ObjValue, ObjValueBuilder, ResultExt, Thunk, Val, bail,
 	error::{ErrorKind::*, Result},
-	function::{builtin, CallLocation, FuncVal},
+	function::{CallLocation, FuncVal, builtin},
 	manifest::JsonFormat,
 	typed::{Either2, Either4},
-	val::{equals, ArrValue},
-	Either, IStr, ObjValue, ObjValueBuilder, ResultExt, Thunk, Val,
+	val::{ArrValue, equals},
 };
 use jrsonnet_gcmodule::Cc;
 
modifiedcrates/jrsonnet-stdlib/src/operator.rsdiffbeforeafterboth
--- a/crates/jrsonnet-stdlib/src/operator.rs
+++ b/crates/jrsonnet-stdlib/src/operator.rs
@@ -2,11 +2,11 @@
 //! However, in our case we instead implement them in native, and implement native functions on top of core for backwards compatibility
 
 use jrsonnet_evaluator::{
+	IStr, NumValue, Result, Val,
 	function::builtin,
 	stdlib::std_format,
 	typed::{Either, Either2},
 	val::{equals, primitive_equals},
-	IStr, NumValue, Result, Val,
 };
 
 #[builtin]
modifiedcrates/jrsonnet-stdlib/src/sets.rsdiffbeforeafterboth
--- a/crates/jrsonnet-stdlib/src/sets.rs
+++ b/crates/jrsonnet-stdlib/src/sets.rs
@@ -1,6 +1,6 @@
 use std::cmp::Ordering;
 
-use jrsonnet_evaluator::{function::builtin, val::ArrValue, Result, Thunk, Val};
+use jrsonnet_evaluator::{Result, Thunk, Val, function::builtin, val::ArrValue};
 
 use crate::keyf::KeyF;
 
modifiedcrates/jrsonnet-stdlib/src/sort.rsdiffbeforeafterboth
--- a/crates/jrsonnet-stdlib/src/sort.rs
+++ b/crates/jrsonnet-stdlib/src/sort.rs
@@ -3,10 +3,9 @@
 use std::cmp::Ordering;
 
 use jrsonnet_evaluator::{
-	bail,
+	Result, Thunk, Val, bail,
 	function::builtin,
-	val::{equals, ArrValue},
-	Result, Thunk, Val,
+	val::{ArrValue, equals},
 };
 
 use crate::{eval_on_empty, keyf::KeyF};
modifiedtests/tests/builtin.rsdiffbeforeafterboth
--- a/tests/tests/builtin.rs
+++ b/tests/tests/builtin.rs
@@ -1,7 +1,11 @@
 mod common;
 
 use jrsonnet_evaluator::{
-	ContextInitializer, FileImportResolver, InitialContextBuilder, Result, Source, State, Thunk, Val, function::{CallLocation, FuncVal, builtin, builtin::{Builtin}}, trace::PathResolver, typed::FromUntyped
+	ContextInitializer, FileImportResolver, InitialContextBuilder, Result, Source, State, Thunk,
+	Val,
+	function::{CallLocation, FuncVal, builtin, builtin::Builtin},
+	trace::PathResolver,
+	typed::FromUntyped,
 };
 use jrsonnet_gcmodule::Trace;
 use jrsonnet_stdlib::ContextInitializer as StdContextInitializer;
modifiedtests/tests/common.rsdiffbeforeafterboth
--- a/tests/tests/common.rs
+++ b/tests/tests/common.rs
@@ -1,5 +1,7 @@
 use jrsonnet_evaluator::{
-	ContextBuilder, ContextInitializer as ContextInitializerT, InitialContextBuilder, ObjValueBuilder, Result, Thunk, Val, bail, function::{FuncVal, builtin}, Source
+	ContextBuilder, ContextInitializer as ContextInitializerT, InitialContextBuilder,
+	ObjValueBuilder, Result, Source, Thunk, Val, bail,
+	function::{FuncVal, builtin},
 };
 use jrsonnet_gcmodule::Trace;