about summary refs log tree commit diff
path: root/tvix/eval/src
diff options
context:
space:
mode:
authorVincent Ambo <mail@tazj.in>2024-12-31T09·05+0300
committerclbot <clbot@tvl.fyi>2025-01-01T17·35+0000
commit54f72afcda5acb08f450f3082b12b63866ad0135 (patch)
tree1b7e009a6b1dc341c47c83895b5ab5228f6a4865 /tvix/eval/src
parentbd73dff0bfd03a411c27193487bdeebf987ccbc7 (diff)
chore(3p/sources): bump channels & overlays (2024-12-31) r/9057
Last one of the year! С наступающим)

Fixes:

* users/wpcarro: remove use-package from emacs packages (it has been built-in
  for a while now)
* users/sterni: the same thing
* users/aspen: remove `coz`, forwardport `gdmap` from stable
* users/flokli: dropped corneish_zen firmware from CI
  This firmware depends on a non-reproducible FOD which, when updated, causes
  build failures. We have worked around this repeatedly, but it needs to be
  fixed properly.
* tvix: regenerate Go protobufs
* tvix: address new clippy lints
* tvix/{castore,store,build}-go: update grpc/protobuf libraries
* tvix/eval: formatting fixes
* 3p/overlays/tvl: work around GCC 14 -Werrors

Change-Id: Ice5948ca7780192fb7d2abc6a48971fb875f03c9
Reviewed-on: https://cl.tvl.fyi/c/depot/+/12933
Reviewed-by: tazjin <tazjin@tvl.su>
Reviewed-by: sterni <sternenseemann@systemli.org>
Reviewed-by: aspen <root@gws.fyi>
Autosubmit: tazjin <tazjin@tvl.su>
Tested-by: BuildkiteCI
Diffstat (limited to 'tvix/eval/src')
-rw-r--r--tvix/eval/src/builtins/versions.rs2
-rw-r--r--tvix/eval/src/lib.rs6
-rw-r--r--tvix/eval/src/pretty_ast.rs44
-rw-r--r--tvix/eval/src/value/attrs.rs4
-rw-r--r--tvix/eval/src/value/mod.rs2
-rw-r--r--tvix/eval/src/value/path.rs6
-rw-r--r--tvix/eval/src/value/string/mod.rs14
-rw-r--r--tvix/eval/src/vm/generators.rs2
-rw-r--r--tvix/eval/src/vm/macros.rs2
-rw-r--r--tvix/eval/src/vm/mod.rs4
10 files changed, 41 insertions, 45 deletions
diff --git a/tvix/eval/src/builtins/versions.rs b/tvix/eval/src/builtins/versions.rs
index 6de512142440..bb3fd9f03503 100644
--- a/tvix/eval/src/builtins/versions.rs
+++ b/tvix/eval/src/builtins/versions.rs
@@ -81,7 +81,7 @@ impl<'a> VersionPartsIter<'a> {
     /// like `2.3 < 2.3.0pre` ensues. Luckily for us, this means that we can
     /// lexicographically compare two version strings, _if_ we append an extra
     /// component to both versions.
-    pub fn new_for_cmp(version: &'a BStr) -> Chain<Self, Once<VersionPart>> {
+    pub fn new_for_cmp(version: &'a BStr) -> Chain<Self, Once<VersionPart<'a>>> {
         Self::new(version).chain(once(VersionPart::Word("".into())))
     }
 }
diff --git a/tvix/eval/src/lib.rs b/tvix/eval/src/lib.rs
index a4ef3f01e40a..1c8312a396f1 100644
--- a/tvix/eval/src/lib.rs
+++ b/tvix/eval/src/lib.rs
@@ -293,13 +293,13 @@ impl<'co, 'ro, 'env, IO> EvaluationBuilder<'co, 'ro, 'env, IO> {
     }
 }
 
-impl<'co, 'ro, 'env, IO> EvaluationBuilder<'co, 'ro, 'env, IO> {
+impl<IO> EvaluationBuilder<'_, '_, '_, IO> {
     pub fn source_map(&mut self) -> &SourceCode {
         self.source_map.get_or_insert_with(SourceCode::default)
     }
 }
 
-impl<'co, 'ro, 'env> EvaluationBuilder<'co, 'ro, 'env, Box<dyn EvalIO>> {
+impl EvaluationBuilder<'_, '_, '_, Box<dyn EvalIO>> {
     /// Initialize an `Evaluation`, without the import statement available, and
     /// all IO operations stubbed out.
     pub fn new_pure() -> Self {
@@ -427,7 +427,7 @@ impl<'co, 'ro, 'env> Evaluation<'co, 'ro, 'env, Box<dyn EvalIO>> {
     }
 }
 
-impl<'co, 'ro, 'env, IO> Evaluation<'co, 'ro, 'env, IO>
+impl<IO> Evaluation<'_, '_, '_, IO>
 where
     IO: AsRef<dyn EvalIO> + 'static,
 {
diff --git a/tvix/eval/src/pretty_ast.rs b/tvix/eval/src/pretty_ast.rs
index 5ac115e21c89..8032f9b12ee2 100644
--- a/tvix/eval/src/pretty_ast.rs
+++ b/tvix/eval/src/pretty_ast.rs
@@ -14,7 +14,7 @@ pub fn pretty_print_expr(expr: &ast::Expr) -> String {
 #[repr(transparent)]
 struct SerializeAST<S>(S);
 
-impl<'a> Serialize for SerializeAST<&'a ast::Apply> {
+impl Serialize for SerializeAST<&ast::Apply> {
     fn serialize<S: Serializer>(&self, serializer: S) -> Result<S::Ok, S::Error> {
         let mut map = serializer.serialize_map(Some(3))?;
         map.serialize_entry("kind", "apply")?;
@@ -24,7 +24,7 @@ impl<'a> Serialize for SerializeAST<&'a ast::Apply> {
     }
 }
 
-impl<'a> Serialize for SerializeAST<&'a ast::Assert> {
+impl Serialize for SerializeAST<&ast::Assert> {
     fn serialize<S: Serializer>(&self, serializer: S) -> Result<S::Ok, S::Error> {
         let mut map = serializer.serialize_map(Some(3))?;
         map.serialize_entry("kind", "assert")?;
@@ -34,7 +34,7 @@ impl<'a> Serialize for SerializeAST<&'a ast::Assert> {
     }
 }
 
-impl<'a> Serialize for SerializeAST<&'a ast::Error> {
+impl Serialize for SerializeAST<&ast::Error> {
     fn serialize<S: Serializer>(&self, serializer: S) -> Result<S::Ok, S::Error> {
         let mut map = serializer.serialize_map(Some(2))?;
         map.serialize_entry("kind", "error")?;
@@ -43,7 +43,7 @@ impl<'a> Serialize for SerializeAST<&'a ast::Error> {
     }
 }
 
-impl<'a> Serialize for SerializeAST<&'a ast::IfElse> {
+impl Serialize for SerializeAST<&ast::IfElse> {
     fn serialize<S: Serializer>(&self, serializer: S) -> Result<S::Ok, S::Error> {
         let mut map = serializer.serialize_map(Some(4))?;
         map.serialize_entry("kind", "if_else")?;
@@ -54,7 +54,7 @@ impl<'a> Serialize for SerializeAST<&'a ast::IfElse> {
     }
 }
 
-impl<'a> Serialize for SerializeAST<&'a ast::Select> {
+impl Serialize for SerializeAST<&ast::Select> {
     fn serialize<S: Serializer>(&self, serializer: S) -> Result<S::Ok, S::Error> {
         let size = match self.0.default_expr() {
             Some(_) => 4,
@@ -85,7 +85,7 @@ impl Serialize for SerializeAST<ast::InterpolPart<String>> {
     }
 }
 
-impl<'a> Serialize for SerializeAST<&'a ast::Str> {
+impl Serialize for SerializeAST<&ast::Str> {
     fn serialize<S: Serializer>(&self, serializer: S) -> Result<S::Ok, S::Error> {
         let mut map = serializer.serialize_map(Some(2))?;
         map.serialize_entry("kind", "string")?;
@@ -115,7 +115,7 @@ impl Serialize for SerializeAST<ast::InterpolPart<ast::PathContent>> {
     }
 }
 
-impl<'a> Serialize for SerializeAST<&'a ast::Path> {
+impl Serialize for SerializeAST<&ast::Path> {
     fn serialize<S: Serializer>(&self, serializer: S) -> Result<S::Ok, S::Error> {
         let mut map = serializer.serialize_map(Some(2))?;
         map.serialize_entry("kind", "path")?;
@@ -129,7 +129,7 @@ impl<'a> Serialize for SerializeAST<&'a ast::Path> {
     }
 }
 
-impl<'a> Serialize for SerializeAST<&'a ast::Literal> {
+impl Serialize for SerializeAST<&ast::Literal> {
     fn serialize<S: Serializer>(&self, serializer: S) -> Result<S::Ok, S::Error> {
         let mut map = serializer.serialize_map(Some(2))?;
         map.serialize_entry("kind", "literal")?;
@@ -185,7 +185,7 @@ impl Serialize for SerializeAST<ast::Param> {
     }
 }
 
-impl<'a> Serialize for SerializeAST<&'a ast::Lambda> {
+impl Serialize for SerializeAST<&ast::Lambda> {
     fn serialize<S: Serializer>(&self, serializer: S) -> Result<S::Ok, S::Error> {
         let mut map = serializer.serialize_map(Some(3))?;
         map.serialize_entry("kind", "lambda")?;
@@ -195,7 +195,7 @@ impl<'a> Serialize for SerializeAST<&'a ast::Lambda> {
     }
 }
 
-impl<'a> Serialize for SerializeAST<&'a ast::LegacyLet> {
+impl Serialize for SerializeAST<&ast::LegacyLet> {
     fn serialize<S: Serializer>(&self, serializer: S) -> Result<S::Ok, S::Error> {
         let mut map = serializer.serialize_map(Some(3))?;
         map.serialize_entry("kind", "legacy_let")?;
@@ -218,7 +218,7 @@ impl<'a> Serialize for SerializeAST<&'a ast::LegacyLet> {
     }
 }
 
-impl<'a> Serialize for SerializeAST<&'a ast::LetIn> {
+impl Serialize for SerializeAST<&ast::LetIn> {
     fn serialize<S: Serializer>(&self, serializer: S) -> Result<S::Ok, S::Error> {
         let mut map = serializer.serialize_map(Some(3))?;
         map.serialize_entry("kind", "let")?;
@@ -242,7 +242,7 @@ impl<'a> Serialize for SerializeAST<&'a ast::LetIn> {
     }
 }
 
-impl<'a> Serialize for SerializeAST<&'a ast::List> {
+impl Serialize for SerializeAST<&ast::List> {
     fn serialize<S: Serializer>(&self, serializer: S) -> Result<S::Ok, S::Error> {
         let list = self.0.items().map(SerializeAST).collect::<Vec<_>>();
 
@@ -254,7 +254,7 @@ impl<'a> Serialize for SerializeAST<&'a ast::List> {
     }
 }
 
-impl<'a> Serialize for SerializeAST<&'a ast::BinOp> {
+impl Serialize for SerializeAST<&ast::BinOp> {
     fn serialize<S: Serializer>(&self, serializer: S) -> Result<S::Ok, S::Error> {
         let mut map = serializer.serialize_map(Some(4))?;
         map.serialize_entry("kind", "binary_op")?;
@@ -286,7 +286,7 @@ impl<'a> Serialize for SerializeAST<&'a ast::BinOp> {
     }
 }
 
-impl<'a> Serialize for SerializeAST<&'a ast::Paren> {
+impl Serialize for SerializeAST<&ast::Paren> {
     fn serialize<S: Serializer>(&self, serializer: S) -> Result<S::Ok, S::Error> {
         let mut map = serializer.serialize_map(Some(2))?;
         map.serialize_entry("kind", "paren")?;
@@ -295,7 +295,7 @@ impl<'a> Serialize for SerializeAST<&'a ast::Paren> {
     }
 }
 
-impl<'a> Serialize for SerializeAST<&'a ast::Root> {
+impl Serialize for SerializeAST<&ast::Root> {
     fn serialize<S: Serializer>(&self, serializer: S) -> Result<S::Ok, S::Error> {
         let mut map = serializer.serialize_map(Some(2))?;
         map.serialize_entry("kind", "root")?;
@@ -330,7 +330,7 @@ impl Serialize for SerializeAST<ast::Inherit> {
     }
 }
 
-impl<'a> Serialize for SerializeAST<&'a ast::AttrSet> {
+impl Serialize for SerializeAST<&ast::AttrSet> {
     fn serialize<S: Serializer>(&self, serializer: S) -> Result<S::Ok, S::Error> {
         let mut map = serializer.serialize_map(None)?;
         map.serialize_entry("kind", "attrset")?;
@@ -354,7 +354,7 @@ impl<'a> Serialize for SerializeAST<&'a ast::AttrSet> {
     }
 }
 
-impl<'a> Serialize for SerializeAST<&'a ast::UnaryOp> {
+impl Serialize for SerializeAST<&ast::UnaryOp> {
     fn serialize<S: Serializer>(&self, serializer: S) -> Result<S::Ok, S::Error> {
         let mut map = serializer.serialize_map(Some(3))?;
         map.serialize_entry("kind", "unary_op")?;
@@ -372,7 +372,7 @@ impl<'a> Serialize for SerializeAST<&'a ast::UnaryOp> {
     }
 }
 
-impl<'a> Serialize for SerializeAST<&'a ast::Ident> {
+impl Serialize for SerializeAST<&ast::Ident> {
     fn serialize<S: Serializer>(&self, serializer: S) -> Result<S::Ok, S::Error> {
         let mut map = serializer.serialize_map(Some(2))?;
         map.serialize_entry("kind", "ident")?;
@@ -381,7 +381,7 @@ impl<'a> Serialize for SerializeAST<&'a ast::Ident> {
     }
 }
 
-impl<'a> Serialize for SerializeAST<&'a ast::With> {
+impl Serialize for SerializeAST<&ast::With> {
     fn serialize<S: Serializer>(&self, serializer: S) -> Result<S::Ok, S::Error> {
         let mut map = serializer.serialize_map(Some(3))?;
         map.serialize_entry("kind", "with")?;
@@ -391,7 +391,7 @@ impl<'a> Serialize for SerializeAST<&'a ast::With> {
     }
 }
 
-impl<'a> Serialize for SerializeAST<&'a ast::Dynamic> {
+impl Serialize for SerializeAST<&ast::Dynamic> {
     fn serialize<S: Serializer>(&self, serializer: S) -> Result<S::Ok, S::Error> {
         let mut map = serializer.serialize_map(Some(2))?;
         map.serialize_entry("kind", "dynamic")?;
@@ -424,7 +424,7 @@ impl Serialize for SerializeAST<ast::Attrpath> {
     }
 }
 
-impl<'a> Serialize for SerializeAST<&'a ast::HasAttr> {
+impl Serialize for SerializeAST<&ast::HasAttr> {
     fn serialize<S: Serializer>(&self, serializer: S) -> Result<S::Ok, S::Error> {
         let mut map = serializer.serialize_map(Some(3))?;
         map.serialize_entry("kind", "has_attr")?;
@@ -434,7 +434,7 @@ impl<'a> Serialize for SerializeAST<&'a ast::HasAttr> {
     }
 }
 
-impl<'a> Serialize for SerializeAST<&'a ast::Expr> {
+impl Serialize for SerializeAST<&ast::Expr> {
     fn serialize<S: Serializer>(&self, serializer: S) -> Result<S::Ok, S::Error> {
         match self.0 {
             ast::Expr::Apply(node) => Serialize::serialize(&SerializeAST(node), serializer),
diff --git a/tvix/eval/src/value/attrs.rs b/tvix/eval/src/value/attrs.rs
index 8d06240c65f5..363cf3b1deef 100644
--- a/tvix/eval/src/value/attrs.rs
+++ b/tvix/eval/src/value/attrs.rs
@@ -506,7 +506,7 @@ impl<'a> Iterator for Iter<KeyValue<'a>> {
     }
 }
 
-impl<'a> ExactSizeIterator for Iter<KeyValue<'a>> {
+impl ExactSizeIterator for Iter<KeyValue<'_>> {
     fn len(&self) -> usize {
         match &self.0 {
             KeyValue::Empty => 0,
@@ -554,7 +554,7 @@ impl<'a> IntoIterator for &'a NixAttrs {
     }
 }
 
-impl<'a> ExactSizeIterator for Keys<'a> {
+impl ExactSizeIterator for Keys<'_> {
     fn len(&self) -> usize {
         match &self.0 {
             KeysInner::Empty => 0,
diff --git a/tvix/eval/src/value/mod.rs b/tvix/eval/src/value/mod.rs
index 1775c6f71adb..db754790ee66 100644
--- a/tvix/eval/src/value/mod.rs
+++ b/tvix/eval/src/value/mod.rs
@@ -121,7 +121,7 @@ static WRITE_FLOAT_OPTIONS: LazyLock<lexical_core::WriteFloatOptions> = LazyLock
 /// type, or a type error. This only works for types that implement
 /// `Copy`, as returning a reference to an inner thunk value is not
 /// possible.
-
+///
 /// Generate an `as_*/to_*` accessor method that returns either the
 /// expected type, or a type error.
 macro_rules! gen_cast {
diff --git a/tvix/eval/src/value/path.rs b/tvix/eval/src/value/path.rs
index ad526a8746f8..271793edfdb2 100644
--- a/tvix/eval/src/value/path.rs
+++ b/tvix/eval/src/value/path.rs
@@ -5,10 +5,8 @@ use std::path::PathBuf;
 /// src/libutil/util.cc of cppnix.  Currently it does not match that
 /// behavior; it uses the `path_clean` library which is based on the
 /// Go standard library
-///
-/// TODO: make this match the behavior of cppnix
-/// TODO: write tests for this
-
+// TODO: make this match the behavior of cppnix
+// TODO: write tests for this
 pub fn canon_path(path: PathBuf) -> PathBuf {
     path.clean()
 }
diff --git a/tvix/eval/src/value/string/mod.rs b/tvix/eval/src/value/string/mod.rs
index 0f41ce9dc73c..4419da7777fe 100644
--- a/tvix/eval/src/value/string/mod.rs
+++ b/tvix/eval/src/value/string/mod.rs
@@ -307,7 +307,7 @@ thread_local! {
 /// represented as a single *thin* pointer to a packed data structure containing the
 /// [context][NixContext] and the string data itself (which is a raw byte array, to match the Nix
 /// string semantics that allow any array of bytes to be represented by a string).
-
+///
 /// This memory representation is documented in [`NixStringInner`], but since Rust prefers to deal
 /// with slices via *fat pointers* (pointers that include the length in the *pointer*, not in the
 /// heap allocation), we have to do mostly manual layout management and allocation for this
@@ -506,7 +506,7 @@ impl<'de> Deserialize<'de> for NixString {
     {
         struct StringVisitor;
 
-        impl<'de> Visitor<'de> for StringVisitor {
+        impl Visitor<'_> for StringVisitor {
             type Value = NixString;
 
             fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
@@ -729,9 +729,8 @@ impl NixString {
     /// referring to their `drvPath`, i.e. their full sources and binary closure.
     /// It yields derivation paths.
     pub fn iter_ctx_derivation(&self) -> impl Iterator<Item = &str> {
-        return self
-            .iter_context()
-            .flat_map(|context| context.iter_derivation());
+        self.iter_context()
+            .flat_map(|context| context.iter_derivation())
     }
 
     /// Iterates over "single" context elements, e.g. single derived paths,
@@ -739,9 +738,8 @@ impl NixString {
     /// The first element of the tuple is the output name
     /// and the second element is the derivation path.
     pub fn iter_ctx_single_outputs(&self) -> impl Iterator<Item = (&str, &str)> {
-        return self
-            .iter_context()
-            .flat_map(|context| context.iter_single_outputs());
+        self.iter_context()
+            .flat_map(|context| context.iter_single_outputs())
     }
 
     /// Returns whether this Nix string possess a context or not.
diff --git a/tvix/eval/src/vm/generators.rs b/tvix/eval/src/vm/generators.rs
index b47f20bae289..9c9c8a7b8e04 100644
--- a/tvix/eval/src/vm/generators.rs
+++ b/tvix/eval/src/vm/generators.rs
@@ -230,7 +230,7 @@ pub fn pin_generator(
     Box::pin(f)
 }
 
-impl<'o, IO> VM<'o, IO>
+impl<IO> VM<'_, IO>
 where
     IO: AsRef<dyn EvalIO> + 'static,
 {
diff --git a/tvix/eval/src/vm/macros.rs b/tvix/eval/src/vm/macros.rs
index f9c084d41f91..1d2da8e897a7 100644
--- a/tvix/eval/src/vm/macros.rs
+++ b/tvix/eval/src/vm/macros.rs
@@ -1,6 +1,6 @@
 /// This module provides macros which are used in the implementation
 /// of the VM for the implementation of repetitive operations.
-
+///
 /// This macro simplifies the implementation of arithmetic operations,
 /// correctly handling the behaviour on different pairings of number
 /// types.
diff --git a/tvix/eval/src/vm/mod.rs b/tvix/eval/src/vm/mod.rs
index 0630ed4174e8..5b0d196c2ad5 100644
--- a/tvix/eval/src/vm/mod.rs
+++ b/tvix/eval/src/vm/mod.rs
@@ -49,7 +49,7 @@ trait GetSpan {
     fn get_span(self) -> Span;
 }
 
-impl<'o, IO> GetSpan for &VM<'o, IO> {
+impl<IO> GetSpan for &VM<'_, IO> {
     fn get_span(self) -> Span {
         self.reasonable_span
     }
@@ -983,7 +983,7 @@ where
 }
 
 /// Implementation of helper functions for the runtime logic above.
-impl<'o, IO> VM<'o, IO>
+impl<IO> VM<'_, IO>
 where
     IO: AsRef<dyn EvalIO> + 'static,
 {