git.delta.rocks / jrsonnet / refs/commits / 58761866e4bc

difftreelog

style fix clippy warnings

Yaroslav Bolyukin2022-11-12parent: #9a50551.patch.diff
in: master

35 files changed

modifiedCargo.lockdiffbeforeafterboth
--- a/Cargo.lock
+++ b/Cargo.lock
@@ -68,6 +68,15 @@
 checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a"
 
 [[package]]
+name = "block-buffer"
+version = "0.10.3"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "69cce20737498f97b993470a6e536b8523f0af7892a4f928cceb1ac5e52ebe7e"
+dependencies = [
+ "generic-array",
+]
+
+[[package]]
 name = "cc"
 version = "1.0.73"
 source = "registry+https://github.com/rust-lang/crates.io-index"
@@ -141,6 +150,45 @@
 ]
 
 [[package]]
+name = "cpufeatures"
+version = "0.2.5"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "28d997bd5e24a5928dd43e46dc529867e207907fe0b239c3477d924f7f2ca320"
+dependencies = [
+ "libc",
+]
+
+[[package]]
+name = "crypto-common"
+version = "0.1.6"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "1bfb12502f3fc46cca1bb51ac28df9d618d813cdc3d2f25b9fe775a34af26bb3"
+dependencies = [
+ "generic-array",
+ "typenum",
+]
+
+[[package]]
+name = "digest"
+version = "0.10.5"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "adfbc57365a37acbd2ebf2b64d7e69bb766e2fea813521ed536f5d0520dcf86c"
+dependencies = [
+ "block-buffer",
+ "crypto-common",
+]
+
+[[package]]
+name = "generic-array"
+version = "0.14.6"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "bff49e947297f3312447abdca79f45f4738097cc82b06e72054d2223f601f1b9"
+dependencies = [
+ "typenum",
+ "version_check",
+]
+
+[[package]]
 name = "getrandom"
 version = "0.2.8"
 source = "registry+https://github.com/rust-lang/crates.io-index"
@@ -304,6 +352,7 @@
  "serde",
  "serde_json",
  "serde_yaml_with_quirks",
+ "sha2",
  "structdump",
 ]
 
@@ -550,6 +599,17 @@
 ]
 
 [[package]]
+name = "sha2"
+version = "0.10.6"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "82e6b795fe2e3b1e845bafcb27aa35405c4d47cdfc92af5fc8d3002f76cebdc0"
+dependencies = [
+ "cfg-if 1.0.0",
+ "cpufeatures",
+ "digest",
+]
+
+[[package]]
 name = "smallvec"
 version = "1.10.0"
 source = "registry+https://github.com/rust-lang/crates.io-index"
@@ -640,6 +700,12 @@
 ]
 
 [[package]]
+name = "typenum"
+version = "1.15.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "dcf81ac59edc17cc8697ff311e8f5ef2d99fcbd9817b34cec66f90b6c3dfd987"
+
+[[package]]
 name = "unicode-ident"
 version = "1.0.5"
 source = "registry+https://github.com/rust-lang/crates.io-index"
modifiedbindings/jsonnet/src/import.rsdiffbeforeafterboth
--- a/bindings/jsonnet/src/import.rs
+++ b/bindings/jsonnet/src/import.rs
@@ -12,7 +12,7 @@
 };
 
 use jrsonnet_evaluator::{
-	error::{Error::*, Result},
+	error::{ErrorKind::*, Result},
 	throw, FileImportResolver, ImportResolver,
 };
 use jrsonnet_gcmodule::Trace;
modifiedbindings/jsonnet/src/lib.rsdiffbeforeafterboth
--- a/bindings/jsonnet/src/lib.rs
+++ b/bindings/jsonnet/src/lib.rs
@@ -1,3 +1,5 @@
+#![allow(clippy::box_default)]
+
 #[cfg(feature = "interop")]
 pub mod interop;
 
@@ -20,11 +22,11 @@
 	apply_tla,
 	function::TlaArg,
 	gc::GcHashMap,
+	manifest::{JsonFormat, ManifestFormat, ToStringFormat},
 	stack::set_stack_depth_limit,
-	stdlib::manifest::{JsonFormat, ToStringFormat},
 	tb, throw,
 	trace::{CompactFormat, PathResolver, TraceFormat},
-	FileImportResolver, IStr, ManifestFormat, Result, State, Val,
+	FileImportResolver, IStr, Result, State, Val,
 };
 
 /// WASM stub
@@ -193,7 +195,7 @@
 	let filename = parse_path(CStr::from_ptr(filename));
 	match vm
 		.state
-		.import(&filename)
+		.import(filename)
 		.and_then(|val| apply_tla(vm.state.clone(), &vm.tla_args, val))
 		.and_then(|val| val.manifest(&vm.manifest_format))
 	{
@@ -286,7 +288,7 @@
 	let filename = parse_path(CStr::from_ptr(filename));
 	match vm
 		.state
-		.import(&filename)
+		.import(filename)
 		.and_then(|val| apply_tla(vm.state.clone(), &vm.tla_args, val))
 		.and_then(|val| val_to_multi(val, &vm.manifest_format))
 	{
modifiedbindings/jsonnet/src/native.rsdiffbeforeafterboth
--- a/bindings/jsonnet/src/native.rs
+++ b/bindings/jsonnet/src/native.rs
@@ -5,7 +5,7 @@
 };
 
 use jrsonnet_evaluator::{
-	error::{Error, LocError},
+	error::{Error, ErrorKind},
 	function::builtin::{NativeCallback, NativeCallbackHandler},
 	tb,
 	typed::Typed,
@@ -38,7 +38,7 @@
 	cb: JsonnetNativeCallback,
 }
 impl NativeCallbackHandler for JsonnetNativeCallbackHandler {
-	fn call(&self, args: &[Val]) -> Result<Val, LocError> {
+	fn call(&self, args: &[Val]) -> Result<Val, Error> {
 		let mut n_args = Vec::new();
 		for a in args {
 			n_args.push(Some(Box::new(a.clone())));
@@ -57,7 +57,7 @@
 			Ok(v)
 		} else {
 			let e = IStr::from_untyped(v).expect("error msg should be a string");
-			Err(Error::RuntimeError(e).into())
+			Err(ErrorKind::RuntimeError(e).into())
 		}
 	}
 }
modifiedcmds/jrsonnet/src/main.rsdiffbeforeafterboth
--- a/cmds/jrsonnet/src/main.rs
+++ b/cmds/jrsonnet/src/main.rs
@@ -6,7 +6,11 @@
 use clap::{CommandFactory, Parser};
 use clap_complete::Shell;
 use jrsonnet_cli::{ConfigureState, GeneralOpts, ManifestOpts, OutputOpts, TraceOpts};
-use jrsonnet_evaluator::{apply_tla, error::LocError, throw, ResultExt, State, Val};
+use jrsonnet_evaluator::{
+	apply_tla,
+	error::{Error as JrError, ErrorKind},
+	throw, ResultExt, State, Val,
+};
 
 #[cfg(feature = "mimalloc")]
 #[global_allocator]
@@ -96,7 +100,7 @@
 enum Error {
 	// Handled differently
 	#[error("evaluation error")]
-	Evaluation(LocError),
+	Evaluation(JrError),
 	#[error("io error")]
 	Io(#[from] std::io::Error),
 	#[error("input is not utf8 encoded")]
@@ -104,14 +108,14 @@
 	#[error("missing input argument")]
 	MissingInputArgument,
 }
-impl From<LocError> for Error {
-	fn from(e: LocError) -> Self {
+impl From<JrError> for Error {
+	fn from(e: JrError) -> Self {
 		Self::Evaluation(e)
 	}
 }
-impl From<jrsonnet_evaluator::error::Error> for Error {
-	fn from(e: jrsonnet_evaluator::error::Error) -> Self {
-		Self::from(LocError::from(e))
+impl From<ErrorKind> for Error {
+	fn from(e: ErrorKind) -> Self {
+		Self::from(JrError::from(e))
 	}
 }
 
modifiedcrates/jrsonnet-cli/src/manifest.rsdiffbeforeafterboth
--- a/crates/jrsonnet-cli/src/manifest.rs
+++ b/crates/jrsonnet-cli/src/manifest.rs
@@ -3,9 +3,10 @@
 use clap::{Parser, ValueEnum};
 use jrsonnet_evaluator::{
 	error::Result,
-	stdlib::manifest::{JsonFormat, StringFormat, ToStringFormat, YamlFormat, YamlStreamFormat},
-	ManifestFormat, State,
+	manifest::{JsonFormat, ManifestFormat, StringFormat, ToStringFormat, YamlStreamFormat},
+	State,
 };
+use jrsonnet_stdlib::YamlFormat;
 
 use crate::ConfigureState;
 
modifiedcrates/jrsonnet-cli/src/tla.rsdiffbeforeafterboth
--- a/crates/jrsonnet-cli/src/tla.rs
+++ b/crates/jrsonnet-cli/src/tla.rs
@@ -1,6 +1,6 @@
 use clap::Parser;
 use jrsonnet_evaluator::{
-	error::{Error, Result},
+	error::{ErrorKind, Result},
 	function::TlaArg,
 	gc::GcHashMap,
 	IStr, State,
@@ -51,15 +51,15 @@
 		{
 			let source = Source::new_virtual(format!("<top-level-arg:{name}>").into(), code.into());
 			out.insert(
-				(&name as &str).into(),
+				(name as &str).into(),
 				TlaArg::Code(
 					jrsonnet_parser::parse(
-						&code,
+						code,
 						&ParserSettings {
 							source: source.clone(),
 						},
 					)
-					.map_err(|e| Error::ImportSyntaxError {
+					.map_err(|e| ErrorKind::ImportSyntaxError {
 						path: source,
 						error: Box::new(e),
 					})?,
modifiedcrates/jrsonnet-evaluator/src/ctx.rsdiffbeforeafterboth
--- a/crates/jrsonnet-evaluator/src/ctx.rs
+++ b/crates/jrsonnet-evaluator/src/ctx.rs
@@ -4,8 +4,8 @@
 use jrsonnet_interner::IStr;
 
 use crate::{
-	error::Error::*, gc::GcHashMap, map::LayeredHashMap, ObjValue, Pending, Result, State, Thunk,
-	Val,
+	error::ErrorKind::*, gc::GcHashMap, map::LayeredHashMap, ObjValue, Pending, Result, State,
+	Thunk, Val,
 };
 
 #[derive(Trace)]
modifiedcrates/jrsonnet-evaluator/src/error.rsdiffbeforeafterboth
before · crates/jrsonnet-evaluator/src/error.rs
1use std::{2	fmt::{Debug, Display},3	path::PathBuf,4};56use jrsonnet_gcmodule::Trace;7use jrsonnet_interner::IStr;8use jrsonnet_parser::{BinaryOpType, ExprLocation, LocExpr, Source, SourcePath, UnaryOpType};9use jrsonnet_types::ValType;10use thiserror::Error;1112use crate::{function::CallLocation, stdlib::format::FormatError, typed::TypeLocError};1314fn format_found(list: &[IStr], what: &str) -> String {15	if list.is_empty() {16		return String::new();17	}18	let mut out = String::new();19	out.push_str("\nThere is ");20	out.push_str(what);21	if list.len() > 1 {22		out.push('s');23	}24	out.push_str(" with similar name");25	if list.len() > 1 {26		out.push('s');27	}28	out.push_str(" present: ");29	for (i, v) in list.iter().enumerate() {30		if i != 0 {31			out.push_str(", ");32		}33		out.push_str(v as &str);34	}35	out36}3738fn format_signature(sig: &FunctionSignature) -> String {39	let mut out = String::new();40	out.push_str("\nFunction has the following signature: ");41	out.push('(');42	if sig.is_empty() {43		out.push_str("/*no arguments*/");44	} else {45		for (i, (name, has_default)) in sig.iter().enumerate() {46			if i != 0 {47				out.push_str(", ");48			}49			if let Some(name) = name {50				out.push_str(name);51			} else {52				out.push_str("<unnamed>");53			}54			if *has_default {55				out.push_str(" = <default>");56			}57		}58	}59	out.push(')');60	out61}6263const fn format_empty_str(str: &str) -> &str {64	if str.is_empty() {65		"\"\" (empty string)"66	} else {67		str68	}69}7071type FunctionSignature = Vec<(Option<IStr>, bool)>;7273/// Possible errors74#[allow(missing_docs)]75#[derive(Error, Debug, Clone, Trace)]76#[non_exhaustive]77pub enum Error {78	#[error("intrinsic not found: {0}")]79	IntrinsicNotFound(IStr),8081	#[error("operator {0} does not operate on type {1}")]82	UnaryOperatorDoesNotOperateOnType(UnaryOpType, ValType),83	#[error("binary operation {1} {0} {2} is not implemented")]84	BinaryOperatorDoesNotOperateOnValues(BinaryOpType, ValType, ValType),8586	#[error("no top level object in this context")]87	NoTopLevelObjectFound,88	#[error("self is only usable inside objects")]89	CantUseSelfOutsideOfObject,90	#[error("no super found")]91	NoSuperFound,9293	#[error("for loop can only iterate over arrays")]94	InComprehensionCanOnlyIterateOverArray,9596	#[error("array out of bounds: {0} is not within [0,{1})")]97	ArrayBoundsError(usize, usize),98	#[error("string out of bounds: {0} is not within [0,{1})")]99	StringBoundsError(usize, usize),100101	#[error("assert failed: {}", format_empty_str(.0))]102	AssertionFailed(IStr),103104	#[error("variable is not defined: {0}{}", format_found(.1, "variable"))]105	VariableIsNotDefined(IStr, Vec<IStr>),106	#[error("duplicate local var: {0}")]107	DuplicateLocalVar(IStr),108109	#[error("type mismatch: expected {}, got {2} {0}", .1.iter().map(|e| format!("{e}")).collect::<Vec<_>>().join(", "))]110	TypeMismatch(&'static str, Vec<ValType>, ValType),111	#[error("no such field: {}{}", format_empty_str(.0), format_found(.1, "field"))]112	NoSuchField(IStr, Vec<IStr>),113114	#[error("only functions can be called, got {0}")]115	OnlyFunctionsCanBeCalledGot(ValType),116	#[error("parameter {0} is not defined")]117	UnknownFunctionParameter(String),118	#[error("argument {0} is already bound")]119	BindingParameterASecondTime(IStr),120	#[error("too many args, function has {0}{}", format_signature(.1))]121	TooManyArgsFunctionHas(usize, FunctionSignature),122	#[error("function argument is not passed: {}{}", .0.as_ref().map_or("<unnamed>", IStr::as_str), format_signature(.1))]123	FunctionParameterNotBoundInCall(Option<IStr>, FunctionSignature),124125	#[error("external variable is not defined: {0}")]126	UndefinedExternalVariable(IStr),127128	#[error("field name should be string, got {0}")]129	FieldMustBeStringGot(ValType),130	#[error("duplicate field name: {}", format_empty_str(.0))]131	DuplicateFieldName(IStr),132133	#[error("attempted to index array with string {}", format_empty_str(.0))]134	AttemptedIndexAnArrayWithString(IStr),135	#[error("{0} index type should be {1}, got {2}")]136	ValueIndexMustBeTypeGot(ValType, ValType, ValType),137	#[error("cant index into {0}")]138	CantIndexInto(ValType),139	#[error("{0} is not indexable")]140	ValueIsNotIndexable(ValType),141142	#[error("super can't be used standalone")]143	StandaloneSuper,144145	#[error("can't resolve {1} from {0}")]146	ImportFileNotFound(SourcePath, String),147	#[error("can't resolve absolute {0}")]148	AbsoluteImportFileNotFound(PathBuf),149	#[error("resolved file not found: {:?}", .0)]150	ResolvedFileNotFound(SourcePath),151	#[error("can't import {0}: is a directory")]152	ImportIsADirectory(SourcePath),153	#[error("imported file is not valid utf-8: {0:?}")]154	ImportBadFileUtf8(SourcePath),155	#[error("import io error: {0}")]156	ImportIo(String),157	#[error("tried to import {1} from {0}, but imports are not supported")]158	ImportNotSupported(SourcePath, String),159	#[error("tried to import {0}, but absolute imports are not supported")]160	AbsoluteImportNotSupported(PathBuf),161	#[error("can't import from virtual file")]162	CantImportFromVirtualFile,163	#[error(164		"syntax error: expected {}, got {:?}",165		.error.expected,166		.path.code().chars().nth(error.location.offset)167		.map_or_else(|| "EOF".into(), |c| c.to_string())168	)]169	ImportSyntaxError {170		path: Source,171		#[trace(skip)]172		error: Box<jrsonnet_parser::ParseError>,173	},174175	#[error("runtime error: {}", format_empty_str(.0))]176	RuntimeError(IStr),177	#[error("stack overflow, try to reduce recursion, or set --max-stack to bigger value")]178	StackOverflow,179	#[error("infinite recursion detected")]180	InfiniteRecursionDetected,181	#[error("tried to index by fractional value")]182	FractionalIndex,183	#[error("attempted to divide by zero")]184	DivisionByZero,185186	#[error("string manifest output is not an string")]187	StringManifestOutputIsNotAString,188	#[error("stream manifest output is not an array")]189	StreamManifestOutputIsNotAArray,190	#[error("multi manifest output is not an object")]191	MultiManifestOutputIsNotAObject,192193	#[error("cant recurse stream manifest")]194	StreamManifestOutputCannotBeRecursed,195	#[error("stream manifest output cannot consist of raw strings")]196	StreamManifestCannotNestString,197198	#[error("{}", format_empty_str(.0))]199	ImportCallbackError(String),200	#[error("invalid unicode codepoint: {0}")]201	InvalidUnicodeCodepointGot(u32),202203	#[error("format error: {0}")]204	Format(#[from] FormatError),205	#[error("type error: {0}")]206	TypeError(TypeLocError),207208	#[cfg(feature = "anyhow-error")]209	#[error(transparent)]210	Other(Rc<anyhow::Error>),211}212213#[cfg(feature = "anyhow-error")]214impl From<anyhow::Error> for LocError {215	fn from(e: anyhow::Error) -> Self {216		Self::new(Error::Other(Rc::new(e)))217	}218}219220impl From<Error> for LocError {221	fn from(e: Error) -> Self {222		Self::new(e)223	}224}225226/// Single stack trace frame227#[derive(Clone, Debug, Trace)]228pub struct StackTraceElement {229	/// Source of this frame230	/// Some frames only act as description, without attached source231	pub location: Option<ExprLocation>,232	/// Frame description233	pub desc: String,234}235#[derive(Debug, Clone, Trace)]236pub struct StackTrace(pub Vec<StackTraceElement>);237238#[derive(Clone, Trace)]239pub struct LocError(Box<(Error, StackTrace)>);240impl LocError {241	pub fn new(e: Error) -> Self {242		Self(Box::new((e, StackTrace(vec![]))))243	}244245	pub const fn error(&self) -> &Error {246		&(self.0).0247	}248	pub fn error_mut(&mut self) -> &mut Error {249		&mut (self.0).0250	}251	pub const fn trace(&self) -> &StackTrace {252		&(self.0).1253	}254	pub fn trace_mut(&mut self) -> &mut StackTrace {255		&mut (self.0).1256	}257}258impl Display for LocError {259	fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {260		writeln!(f, "{}", self.0 .0)?;261		for el in &self.0 .1 .0 {262			write!(f, "\t{}", el.desc)?;263			if let Some(loc) = &el.location {264				write!(f, "at {}", loc.0 .0 .0)?;265				loc.0.map_source_locations(&[loc.1, loc.2]);266			}267			writeln!(f)?;268		}269		Ok(())270	}271}272impl Debug for LocError {273	fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {274		f.debug_tuple("LocError").field(&self.0).finish()275	}276}277278pub trait ErrorSource {279	fn to_location(self) -> Option<ExprLocation>;280}281impl ErrorSource for &LocExpr {282	fn to_location(self) -> Option<ExprLocation> {283		Some(self.1.clone())284	}285}286impl ErrorSource for &ExprLocation {287	fn to_location(self) -> Option<ExprLocation> {288		Some(self.clone())289	}290}291impl ErrorSource for CallLocation<'_> {292	fn to_location(self) -> Option<ExprLocation> {293		self.0.cloned()294	}295}296297pub type Result<V, E = LocError> = std::result::Result<V, E>;298pub trait ResultExt: Sized {299	#[must_use]300	fn with_description<O: Into<String>>(self, msg: impl FnOnce() -> O) -> Self;301	#[must_use]302	fn description(self, msg: &str) -> Self {303		self.with_description(|| msg)304	}305306	#[must_use]307	fn with_description_src<O: Into<String>>(308		self,309		src: impl ErrorSource,310		msg: impl FnOnce() -> O,311	) -> Self;312	#[must_use]313	fn description_src(self, src: impl ErrorSource, msg: &str) -> Self {314		self.with_description_src(src, || msg)315	}316}317impl<T> ResultExt for Result<T, LocError> {318	fn with_description<O: Into<String>>(mut self, msg: impl FnOnce() -> O) -> Self {319		if let Err(e) = &mut self {320			let trace = e.trace_mut();321			trace.0.push(StackTraceElement {322				location: None,323				desc: msg().into(),324			});325		}326		self327	}328329	fn with_description_src<O: Into<String>>(330		mut self,331		src: impl ErrorSource,332		msg: impl FnOnce() -> O,333	) -> Self {334		if let Err(e) = &mut self {335			let trace = e.trace_mut();336			trace.0.push(StackTraceElement {337				location: src.to_location(),338				desc: msg().into(),339			});340		}341		self342	}343}344345#[macro_export]346macro_rules! throw {347	($w:ident$(::$i:ident)*$(($($tt:tt)*))?) => {348		return Err($w$(::$i)*$(($($tt)*))?.into())349	};350	($l:literal) => {351		return Err($crate::error::Error::RuntimeError($l.into()).into())352	};353	($l:literal, $($tt:tt)*) => {354		return Err($crate::error::Error::RuntimeError(format!($l, $($tt)*).into()).into())355	};356}
modifiedcrates/jrsonnet-evaluator/src/evaluate/destructure.rsdiffbeforeafterboth
--- a/crates/jrsonnet-evaluator/src/evaluate/destructure.rs
+++ b/crates/jrsonnet-evaluator/src/evaluate/destructure.rs
@@ -3,7 +3,7 @@
 use jrsonnet_parser::{BindSpec, Destruct, LocExpr, ParamsDesc};
 
 use crate::{
-	error::{Error::*, Result},
+	error::{ErrorKind::*, Result},
 	evaluate, evaluate_method, evaluate_named,
 	gc::GcHashMap,
 	tb, throw,
modifiedcrates/jrsonnet-evaluator/src/evaluate/mod.rsdiffbeforeafterboth
--- a/crates/jrsonnet-evaluator/src/evaluate/mod.rs
+++ b/crates/jrsonnet-evaluator/src/evaluate/mod.rs
@@ -11,14 +11,14 @@
 use self::destructure::destruct;
 use crate::{
 	destructure::evaluate_dest,
-	error::Error::*,
+	error::ErrorKind::*,
 	evaluate::operator::{evaluate_add_op, evaluate_binary_op_special, evaluate_unary_op},
 	function::{CallLocation, FuncDesc, FuncVal},
 	tb, throw,
 	typed::Typed,
 	val::{ArrValue, CachedUnbound, IndexableVal, Thunk, ThunkValue},
-	Context, GcHashMap, LocError, ObjValue, ObjValueBuilder, ObjectAssertion, Pending, Result,
-	ResultExt, State, Unbound, Val,
+	Context, GcHashMap, ObjValue, ObjValueBuilder, ObjectAssertion, Pending, Result, State,
+	Unbound, Val,
 };
 pub mod destructure;
 pub mod operator;
@@ -165,7 +165,7 @@
 	uctx: B,
 	field: &FieldMember,
 ) -> Result<()> {
-	let name = evaluate_field_name(ctx.clone(), &field.name)?;
+	let name = evaluate_field_name(ctx, &field.name)?;
 	let Some(name) = name else {
 		return Ok(());
 	};
@@ -187,11 +187,7 @@
 			impl<B: Unbound<Bound = Context>> Unbound for UnboundValue<B> {
 				type Bound = Val;
 				fn bind(&self, sup: Option<ObjValue>, this: Option<ObjValue>) -> Result<Val> {
-					Ok(evaluate_named(
-						self.uctx.bind(sup, this)?,
-						&self.value,
-						self.name.clone(),
-					)?)
+					evaluate_named(self.uctx.bind(sup, this)?, &self.value, self.name.clone())
 				}
 			}
 
@@ -201,9 +197,9 @@
 				.with_visibility(*visibility)
 				.with_location(value.1.clone())
 				.bindable(tb!(UnboundValue {
-					uctx: uctx.clone(),
+					uctx,
 					value: value.clone(),
-					name: name.clone()
+					name,
 				}))?;
 		}
 		FieldMember {
@@ -236,10 +232,10 @@
 				.with_visibility(*visibility)
 				.with_location(value.1.clone())
 				.bindable(tb!(UnboundMethod {
-					uctx: uctx.clone(),
+					uctx,
 					value: value.clone(),
 					params: params.clone(),
-					name: name.clone()
+					name,
 				}))?;
 		}
 	}
@@ -267,7 +263,7 @@
 	for member in members.iter() {
 		match member {
 			Member::Field(field) => {
-				evaluate_field_member(&mut builder, ctx.clone(), uctx.clone(), &field)?
+				evaluate_field_member(&mut builder, ctx.clone(), uctx.clone(), field)?;
 			}
 			Member::AssertStmt(stmt) => {
 				#[derive(Trace)]
modifiedcrates/jrsonnet-evaluator/src/evaluate/operator.rsdiffbeforeafterboth
--- a/crates/jrsonnet-evaluator/src/evaluate/operator.rs
+++ b/crates/jrsonnet-evaluator/src/evaluate/operator.rs
@@ -3,7 +3,7 @@
 use jrsonnet_parser::{BinaryOpType, LocExpr, UnaryOpType};
 
 use crate::{
-	error::Error::*, evaluate, stdlib::std_format, throw, typed::Typed, val::equals, Context,
+	error::ErrorKind::*, evaluate, stdlib::std_format, throw, typed::Typed, val::equals, Context,
 	Result, Val,
 };
 
modifiedcrates/jrsonnet-evaluator/src/function/arglike.rsdiffbeforeafterboth
--- a/crates/jrsonnet-evaluator/src/function/arglike.rs
+++ b/crates/jrsonnet-evaluator/src/function/arglike.rs
@@ -180,8 +180,8 @@
 	}
 }
 
-impl<A: ArgLike, S> sealed::Named for HashMap<IStr, A, S> {}
-impl<A: ArgLike, S> ArgsLike for HashMap<IStr, A, S> {
+impl<V: ArgLike, S> sealed::Named for HashMap<IStr, V, S> {}
+impl<V: ArgLike, S> ArgsLike for HashMap<IStr, V, S> {
 	fn unnamed_len(&self) -> usize {
 		0
 	}
@@ -213,7 +213,7 @@
 		}
 	}
 }
-impl<A, S> OptionalContext for HashMap<IStr, A, S> where A: ArgLike + OptionalContext {}
+impl<V, S> OptionalContext for HashMap<IStr, V, S> where V: ArgLike + OptionalContext {}
 
 impl<A: ArgLike> ArgsLike for GcHashMap<IStr, A> {
 	fn unnamed_len(&self) -> usize {
@@ -239,7 +239,7 @@
 	}
 
 	fn named_names(&self, handler: &mut dyn FnMut(&IStr)) {
-		self.0.named_names(handler)
+		self.0.named_names(handler);
 	}
 }
 
modifiedcrates/jrsonnet-evaluator/src/function/parse.rsdiffbeforeafterboth
--- a/crates/jrsonnet-evaluator/src/function/parse.rs
+++ b/crates/jrsonnet-evaluator/src/function/parse.rs
@@ -7,7 +7,7 @@
 use super::{arglike::ArgsLike, builtin::BuiltinParam};
 use crate::{
 	destructure::destruct,
-	error::{Error::*, Result},
+	error::{ErrorKind::*, Result},
 	evaluate_named,
 	gc::GcHashMap,
 	tb, throw,
modifiedcrates/jrsonnet-evaluator/src/import.rsdiffbeforeafterboth
--- a/crates/jrsonnet-evaluator/src/import.rs
+++ b/crates/jrsonnet-evaluator/src/import.rs
@@ -12,10 +12,7 @@
 use jrsonnet_parser::{SourceDirectory, SourceFile, SourcePath};
 
 use crate::{
-	error::{
-		Error::{self, *},
-		Result,
-	},
+	error::{ErrorKind::*, Result},
 	throw,
 };
 
@@ -94,7 +91,7 @@
 		} else if let Some(d) = from.downcast_ref::<SourceDirectory>() {
 			d.path().to_owned()
 		} else if from.is_default() {
-			current_dir().map_err(|e| Error::ImportIo(e.to_string()))?
+			current_dir().map_err(|e| ImportIo(e.to_string()))?
 		} else {
 			unreachable!("resolver can't return this path")
 		};
@@ -122,7 +119,7 @@
 			Err(e) if e.kind() == ErrorKind::NotFound => {
 				throw!(AbsoluteImportFileNotFound(path.to_owned()))
 			}
-			Err(e) => throw!(Error::ImportIo(e.to_string())),
+			Err(e) => throw!(ImportIo(e.to_string())),
 		};
 		if meta.is_file() {
 			Ok(SourcePath::new(SourceFile::new(
@@ -141,7 +138,7 @@
 		let path = if let Some(f) = id.downcast_ref::<SourceFile>() {
 			f.path()
 		} else if id.downcast_ref::<SourceDirectory>().is_some() || id.is_default() {
-			throw!(Error::ImportIsADirectory(id.clone()))
+			throw!(ImportIsADirectory(id.clone()))
 		} else {
 			unreachable!("other types are not supported in resolve");
 		};
modifiedcrates/jrsonnet-evaluator/src/lib.rsdiffbeforeafterboth
--- a/crates/jrsonnet-evaluator/src/lib.rs
+++ b/crates/jrsonnet-evaluator/src/lib.rs
@@ -51,6 +51,7 @@
 pub mod gc;
 mod import;
 mod integrations;
+pub mod manifest;
 mod map;
 mod obj;
 pub mod stack;
@@ -69,7 +70,7 @@
 
 pub use ctx::*;
 pub use dynamic::*;
-pub use error::{Error::*, LocError, Result, ResultExt};
+pub use error::{Error, ErrorKind::*, Result, ResultExt};
 pub use evaluate::*;
 use function::CallLocation;
 use gc::{GcHashMap, TraceBox};
@@ -82,7 +83,7 @@
 pub use obj::*;
 use stack::check_depth;
 pub use tla::apply_tla;
-pub use val::{ManifestFormat, Thunk, Val};
+pub use val::{Thunk, Val};
 
 /// Thunk without bound `super`/`this`
 /// object inheritance may be overriden multiple times, and will be fixed only on field read
modifiedcrates/jrsonnet-evaluator/src/obj.rsdiffbeforeafterboth
--- a/crates/jrsonnet-evaluator/src/obj.rs
+++ b/crates/jrsonnet-evaluator/src/obj.rs
@@ -11,7 +11,7 @@
 use rustc_hash::FxHashMap;
 
 use crate::{
-	error::{Error::*, LocError},
+	error::{Error, ErrorKind::*},
 	function::CallLocation,
 	gc::{GcHashMap, GcHashSet, TraceBox},
 	operator::evaluate_add_op,
@@ -115,7 +115,7 @@
 	Cached(Val),
 	NotFound,
 	Pending,
-	Errored(LocError),
+	Errored(Error),
 }
 
 #[allow(clippy::module_name_repetitions)]
modifiedcrates/jrsonnet-evaluator/src/stack.rsdiffbeforeafterboth
--- a/crates/jrsonnet-evaluator/src/stack.rs
+++ b/crates/jrsonnet-evaluator/src/stack.rs
@@ -1,6 +1,6 @@
 use std::{cell::Cell, marker::PhantomData};
 
-use crate::error::{Error, LocError};
+use crate::error::{Error, ErrorKind};
 
 struct StackLimit {
 	max_stack_size: Cell<usize>,
@@ -22,14 +22,14 @@
 }
 
 pub struct StackOverflowError;
-impl From<StackOverflowError> for Error {
+impl From<StackOverflowError> for ErrorKind {
 	fn from(_: StackOverflowError) -> Self {
-		Error::StackOverflow
+		ErrorKind::StackOverflow
 	}
 }
-impl From<StackOverflowError> for LocError {
+impl From<StackOverflowError> for Error {
 	fn from(_: StackOverflowError) -> Self {
-		Error::StackOverflow.into()
+		ErrorKind::StackOverflow.into()
 	}
 }
 
modifiedcrates/jrsonnet-evaluator/src/stdlib/format.rsdiffbeforeafterboth
--- a/crates/jrsonnet-evaluator/src/stdlib/format.rs
+++ b/crates/jrsonnet-evaluator/src/stdlib/format.rs
@@ -6,7 +6,7 @@
 use jrsonnet_types::ValType;
 use thiserror::Error;
 
-use crate::{error::Error::*, throw, typed::Typed, LocError, ObjValue, Result, Val};
+use crate::{error::ErrorKind::*, throw, typed::Typed, Error, ObjValue, Result, Val};
 
 #[derive(Debug, Clone, Error, Trace)]
 pub enum FormatError {
@@ -26,7 +26,7 @@
 	NoSuchFormatField(IStr),
 }
 
-impl From<FormatError> for LocError {
+impl From<FormatError> for Error {
 	fn from(e: FormatError) -> Self {
 		Self::new(Format(e))
 	}
modifiedcrates/jrsonnet-evaluator/src/stdlib/mod.rsdiffbeforeafterboth
--- a/crates/jrsonnet-evaluator/src/stdlib/mod.rs
+++ b/crates/jrsonnet-evaluator/src/stdlib/mod.rs
@@ -7,7 +7,6 @@
 use crate::{error::Result, function::CallLocation, State, Val};
 
 pub mod format;
-pub mod manifest;
 
 pub fn std_format(str: IStr, vals: Val) -> Result<String> {
 	State::push(
modifiedcrates/jrsonnet-evaluator/src/trace/mod.rsdiffbeforeafterboth
--- a/crates/jrsonnet-evaluator/src/trace/mod.rs
+++ b/crates/jrsonnet-evaluator/src/trace/mod.rs
@@ -6,7 +6,7 @@
 use jrsonnet_gcmodule::Trace;
 use jrsonnet_parser::{CodeLocation, Source};
 
-use crate::{error::Error, LocError};
+use crate::{error::ErrorKind, Error};
 
 /// The way paths should be displayed
 #[derive(Clone, Trace)]
@@ -51,9 +51,9 @@
 	fn write_trace(
 		&self,
 		out: &mut dyn std::fmt::Write,
-		error: &LocError,
+		error: &Error,
 	) -> Result<(), std::fmt::Error>;
-	fn format(&self, error: &LocError) -> Result<String, std::fmt::Error> {
+	fn format(&self, error: &Error) -> Result<String, std::fmt::Error> {
 		let mut out = String::new();
 		self.write_trace(&mut out, error)?;
 		Ok(out)
@@ -107,10 +107,10 @@
 	fn write_trace(
 		&self,
 		out: &mut dyn std::fmt::Write,
-		error: &LocError,
+		error: &Error,
 	) -> Result<(), std::fmt::Error> {
 		write!(out, "{}", error.error())?;
-		if let Error::ImportSyntaxError { path, error } = error.error() {
+		if let ErrorKind::ImportSyntaxError { path, error } = error.error() {
 			use std::fmt::Write;
 
 			writeln!(out)?;
@@ -204,7 +204,7 @@
 	fn write_trace(
 		&self,
 		out: &mut dyn std::fmt::Write,
-		error: &LocError,
+		error: &Error,
 	) -> Result<(), std::fmt::Error> {
 		write!(out, "{}", error.error())?;
 		for item in &error.trace().0 {
@@ -250,10 +250,10 @@
 	fn write_trace(
 		&self,
 		out: &mut dyn std::fmt::Write,
-		error: &LocError,
+		error: &Error,
 	) -> Result<(), std::fmt::Error> {
 		write!(out, "{}", error.error())?;
-		if let Error::ImportSyntaxError { path, error } = error.error() {
+		if let ErrorKind::ImportSyntaxError { path, error } = error.error() {
 			writeln!(out)?;
 			let offset = error.location.offset;
 			let location = path
modifiedcrates/jrsonnet-evaluator/src/typed/mod.rsdiffbeforeafterboth
--- a/crates/jrsonnet-evaluator/src/typed/mod.rs
+++ b/crates/jrsonnet-evaluator/src/typed/mod.rs
@@ -7,7 +7,7 @@
 use thiserror::Error;
 
 use crate::{
-	error::{Error, LocError, Result},
+	error::{Error, ErrorKind, Result},
 	State, Val,
 };
 
@@ -26,9 +26,9 @@
 	)]
 	BoundsFailed(f64, Option<f64>, Option<f64>),
 }
-impl From<TypeError> for LocError {
+impl From<TypeError> for Error {
 	fn from(e: TypeError) -> Self {
-		Error::TypeError(e.into()).into()
+		ErrorKind::TypeError(e.into()).into()
 	}
 }
 
@@ -39,9 +39,9 @@
 		Self(Box::new(e), ValuePathStack(Vec::new()))
 	}
 }
-impl From<TypeLocError> for LocError {
+impl From<TypeLocError> for Error {
 	fn from(e: TypeLocError) -> Self {
-		Error::TypeError(e).into()
+		ErrorKind::TypeError(e).into()
 	}
 }
 impl Display for TypeLocError {
@@ -92,7 +92,7 @@
 	State::push_description(error_reason, || match item() {
 		Ok(_) => Ok(()),
 		Err(mut e) => {
-			if let Error::TypeError(e) = &mut e.error_mut() {
+			if let ErrorKind::TypeError(e) = &mut e.error_mut() {
 				(e.1).0.push(path());
 			}
 			Err(e)
@@ -218,7 +218,7 @@
 							return Ok(());
 						}
 						Err(e) => match e.error() {
-							Error::TypeError(e) => errors.push(e.clone()),
+							ErrorKind::TypeError(e) => errors.push(e.clone()),
 							_ => return Err(e),
 						},
 					}
@@ -233,7 +233,7 @@
 							return Ok(());
 						}
 						Err(e) => match e.error() {
-							Error::TypeError(e) => errors.push(e.clone()),
+							ErrorKind::TypeError(e) => errors.push(e.clone()),
 							_ => return Err(e),
 						},
 					}
modifiedcrates/jrsonnet-evaluator/src/val.rsdiffbeforeafterboth
--- a/crates/jrsonnet-evaluator/src/val.rs
+++ b/crates/jrsonnet-evaluator/src/val.rs
@@ -5,9 +5,10 @@
 use jrsonnet_types::ValType;
 
 use crate::{
-	error::{Error::*, LocError},
+	error::{Error, ErrorKind::*},
 	function::FuncVal,
 	gc::{GcHashMap, TraceBox},
+	manifest::{ManifestFormat, ToStringFormat},
 	throw,
 	typed::BoundedUsize,
 	ObjValue, Result, Unbound, WeakObjValue,
@@ -21,7 +22,7 @@
 #[derive(Trace)]
 enum ThunkInner<T: Trace> {
 	Computed(T),
-	Errored(LocError),
+	Errored(Error),
 	Waiting(TraceBox<dyn ThunkValue<Output = T>>),
 	Pending,
 }
@@ -116,33 +117,6 @@
 impl<T: Trace> PartialEq for Thunk<T> {
 	fn eq(&self, other: &Self) -> bool {
 		Cc::ptr_eq(&self.0, &other.0)
-	}
-}
-
-pub trait ManifestFormat {
-	fn manifest_buf(&self, val: Val, buf: &mut String) -> Result<()>;
-	fn manifest(&self, val: Val) -> Result<String> {
-		let mut out = String::new();
-		self.manifest_buf(val, &mut out)?;
-		Ok(out)
-	}
-}
-impl<T> ManifestFormat for Box<T>
-where
-	T: ManifestFormat + ?Sized,
-{
-	fn manifest_buf(&self, val: Val, buf: &mut String) -> Result<()> {
-		let inner = &**self;
-		inner.manifest_buf(val, buf)
-	}
-}
-impl<T> ManifestFormat for &'_ T
-where
-	T: ManifestFormat + ?Sized,
-{
-	fn manifest_buf(&self, val: Val, buf: &mut String) -> Result<()> {
-		let inner = &**self;
-		inner.manifest_buf(val, buf)
 	}
 }
 
@@ -649,9 +623,7 @@
 			Self::Bool(false) => "false".into(),
 			Self::Null => "null".into(),
 			Self::Str(s) => s.clone(),
-			_ => self
-				.manifest(crate::stdlib::manifest::ToStringFormat)
-				.map(IStr::from)?,
+			_ => self.manifest(ToStringFormat).map(IStr::from)?,
 		})
 	}
 
modifiedcrates/jrsonnet-macros/src/lib.rsdiffbeforeafterboth
--- a/crates/jrsonnet-macros/src/lib.rs
+++ b/crates/jrsonnet-macros/src/lib.rs
@@ -540,7 +540,7 @@
 			}
 		} else {
 			quote! {
-				<#ty>::from_untyped(obj.get(#name.into())?.ok_or_else(|| Error::NoSuchField(#name.into(), vec![]))?)?
+				<#ty>::from_untyped(obj.get(#name.into())?.ok_or_else(|| ErrorKind::NoSuchField(#name.into(), vec![]))?)?
 			}
 		};
 
@@ -638,19 +638,19 @@
 			use ::jrsonnet_evaluator::{
 				typed::{ComplexValType, Typed, TypedObj, CheckType},
 				Val, State,
-				error::{LocError, Error, Result},
+				error::{ErrorKind, Result as JrResult},
 				ObjValueBuilder, ObjValue,
 			};
 
 			#typed
 
 			impl TypedObj for #ident {
-				fn serialize(self, out: &mut ObjValueBuilder) -> Result<(), LocError> {
+				fn serialize(self, out: &mut ObjValueBuilder) -> JrResult<()> {
 					#(#fields_serialize)*
 
 					Ok(())
 				}
-				fn parse(obj: &ObjValue) -> Result<Self, LocError> {
+				fn parse(obj: &ObjValue) -> JrResult<Self> {
 					Ok(Self {
 						#(#fields_parse)*
 					})
modifiedcrates/jrsonnet-parser/src/lib.rsdiffbeforeafterboth
--- a/crates/jrsonnet-parser/src/lib.rs
+++ b/crates/jrsonnet-parser/src/lib.rs
@@ -450,15 +450,23 @@
 	fn imports() {
 		assert_eq!(
 			parse!("import \"hello\""),
-			el!(Expr::Import("hello".into()), 0, 14),
+			el!(Expr::Import(el!(Expr::Str("hello".into()), 7, 14)), 0, 14),
 		);
 		assert_eq!(
 			parse!("importstr \"garnish.txt\""),
-			el!(Expr::ImportStr("garnish.txt".into()), 0, 23)
+			el!(
+				Expr::ImportStr(el!(Expr::Str("garnish.txt".into()), 10, 23)),
+				0,
+				23
+			)
 		);
 		assert_eq!(
 			parse!("importbin \"garnish.bin\""),
-			el!(Expr::ImportBin("garnish.bin".into()), 0, 23)
+			el!(
+				Expr::ImportBin(el!(Expr::Str("garnish.bin".into()), 10, 23)),
+				0,
+				23
+			)
 		);
 	}
 
modifiedcrates/jrsonnet-stdlib/Cargo.tomldiffbeforeafterboth
--- a/crates/jrsonnet-stdlib/Cargo.toml
+++ b/crates/jrsonnet-stdlib/Cargo.toml
@@ -7,7 +7,7 @@
 edition = "2021"
 
 [features]
-default = ["codegenerated-stdlib"]
+default = ["codegenerated-stdlib", "exp-more-hashes"]
 # Speed-up initialization by generating code for parsed stdlib, instead
 # of invoking parser for it
 codegenerated-stdlib = ["jrsonnet-parser/structdump"]
@@ -15,6 +15,7 @@
 legacy-this-file = []
 # Add order preservation flag to some functions
 exp-preserve-order = ["jrsonnet-evaluator/exp-preserve-order"]
+exp-more-hashes = ["sha2"]
 
 [dependencies]
 jrsonnet-evaluator.workspace = true
@@ -36,6 +37,8 @@
 # std.parseYaml, custom library fork is used for C++/golang compatibility
 serde_yaml_with_quirks = "0.8.24"
 
+sha2 = { version = "0.10.6", optional = true }
+
 [build-dependencies]
 jrsonnet-parser.workspace = true
 structdump = { version = "0.2.0", features = ["derive"] }
modifiedcrates/jrsonnet-stdlib/build.rsdiffbeforeafterboth
--- a/crates/jrsonnet-stdlib/build.rs
+++ b/crates/jrsonnet-stdlib/build.rs
@@ -19,7 +19,7 @@
 	{
 		let out_dir = env::var("OUT_DIR").unwrap();
 		let dest_path = Path::new(&out_dir).join("stdlib.rs");
-		let mut f = File::create(&dest_path).unwrap();
+		let mut f = File::create(dest_path).unwrap();
 		f.write_all(
 			("#[allow(clippy::redundant_clone)]".to_owned() + &v.to_string())
 				.replace(';', ";\n")
modifiedcrates/jrsonnet-stdlib/src/encoding.rsdiffbeforeafterboth
--- a/crates/jrsonnet-stdlib/src/encoding.rs
+++ b/crates/jrsonnet-stdlib/src/encoding.rs
@@ -1,5 +1,5 @@
 use jrsonnet_evaluator::{
-	error::{Error::RuntimeError, Result},
+	error::{ErrorKind::RuntimeError, Result},
 	function::builtin,
 	typed::{Either, Either2},
 	IBytes, IStr,
modifiedcrates/jrsonnet-stdlib/src/hash.rsdiffbeforeafterboth
--- a/crates/jrsonnet-stdlib/src/hash.rs
+++ b/crates/jrsonnet-stdlib/src/hash.rs
@@ -4,3 +4,10 @@
 pub fn builtin_md5(str: IStr) -> Result<String> {
 	Ok(format!("{:x}", md5::compute(str.as_bytes())))
 }
+
+#[cfg(feature = "exp-more-hashes")]
+#[builtin]
+pub fn builtin_sha256(str: IStr) -> Result<String> {
+	use sha2::digest::Digest;
+	Ok(format!("{:?}", sha2::Sha256::digest(str.as_bytes())))
+}
modifiedcrates/jrsonnet-stdlib/src/lib.rsdiffbeforeafterboth
--- a/crates/jrsonnet-stdlib/src/lib.rs
+++ b/crates/jrsonnet-stdlib/src/lib.rs
@@ -5,7 +5,7 @@
 };
 
 use jrsonnet_evaluator::{
-	error::{Error::*, Result},
+	error::{ErrorKind::*, Result},
 	function::{builtin::Builtin, CallLocation, FuncVal, TlaArg},
 	gc::{GcHashMap, TraceBox},
 	tb,
@@ -101,6 +101,8 @@
 		("sort", builtin_sort::INST),
 		// Hash
 		("md5", builtin_md5::INST),
+		#[cfg(feature = "exp-more-hashes")]
+		("sha256", builtin_sha256::INST),
 		// Encoding
 		("encodeUTF8", builtin_encode_utf8::INST),
 		("decodeUTF8", builtin_decode_utf8::INST),
modifiedcrates/jrsonnet-stdlib/src/misc.rsdiffbeforeafterboth
--- a/crates/jrsonnet-stdlib/src/misc.rs
+++ b/crates/jrsonnet-stdlib/src/misc.rs
@@ -1,7 +1,7 @@
 use std::{cell::RefCell, rc::Rc};
 
 use jrsonnet_evaluator::{
-	error::{Error::*, Result},
+	error::{ErrorKind::*, Result},
 	function::{builtin, ArgLike, CallLocation, FuncVal},
 	throw,
 	typed::{Any, Either2, Either4},
modifiedcrates/jrsonnet-stdlib/src/parse.rsdiffbeforeafterboth
--- a/crates/jrsonnet-stdlib/src/parse.rs
+++ b/crates/jrsonnet-stdlib/src/parse.rs
@@ -1,5 +1,5 @@
 use jrsonnet_evaluator::{
-	error::{Error::RuntimeError, Result},
+	error::{ErrorKind::RuntimeError, Result},
 	function::builtin,
 	typed::Any,
 	IStr, Val,
modifiedcrates/jrsonnet-stdlib/src/strings.rsdiffbeforeafterboth
--- a/crates/jrsonnet-stdlib/src/strings.rs
+++ b/crates/jrsonnet-stdlib/src/strings.rs
@@ -1,5 +1,5 @@
 use jrsonnet_evaluator::{
-	error::{Error::*, Result},
+	error::{ErrorKind::*, Result},
 	function::builtin,
 	typed::{Either2, VecVal, M1},
 	val::ArrValue,
modifiedtests/tests/common.rsdiffbeforeafterboth
--- a/tests/tests/common.rs
+++ b/tests/tests/common.rs
@@ -29,7 +29,7 @@
 macro_rules! ensure_val_eq {
 	($a:expr, $b:expr) => {{
 		if !::jrsonnet_evaluator::val::equals(&$a.clone(), &$b.clone())? {
-			use ::jrsonnet_evaluator::stdlib::manifest::JsonFormat;
+			use ::jrsonnet_evaluator::manifest::JsonFormat;
 			::jrsonnet_evaluator::throw!(
 				"assertion failed: a != b\na={:#?}\nb={:#?}",
 				$a.manifest(JsonFormat::default())?,
modifiedtests/tests/golden.rsdiffbeforeafterboth
--- a/tests/tests/golden.rs
+++ b/tests/tests/golden.rs
@@ -4,7 +4,7 @@
 };
 
 use jrsonnet_evaluator::{
-	stdlib::manifest::JsonFormat,
+	manifest::JsonFormat,
 	trace::{CompactFormat, PathResolver, TraceFormat},
 	FileImportResolver, State,
 };