diff --git a/.cargo/config b/.cargo/config.toml similarity index 100% rename from .cargo/config rename to .cargo/config.toml diff --git a/benches/common/fib.rs b/benches/common/fib.rs index 3d84501e0e..be1e4b7ea9 100644 --- a/benches/common/fib.rs +++ b/benches/common/fib.rs @@ -93,7 +93,7 @@ fn compute_coeffs(store: &Store) -> (usize, usize) { let frame = step_func .call_simple(&input, store, &lang, 0, &dummy_terminal()) .unwrap(); - input = frame.output.clone(); + input.clone_from(&frame.output); iteration += 1; } (coef_lin, coef_ang) diff --git a/lurk-metrics/src/lib.rs b/lurk-metrics/src/lib.rs index a36bcaaa63..30d3361bc6 100644 --- a/lurk-metrics/src/lib.rs +++ b/lurk-metrics/src/lib.rs @@ -32,7 +32,7 @@ thread_local! { /// allows us not to think about contention on a global metrics sink among threads. /// /// A global metrics sink must be installed before any thread-local sinks can be accessed. - static LOCAL_SINK: OnceCell = OnceCell::new(); + static LOCAL_SINK: OnceCell = const { OnceCell::new() }; } /// A global metrics sink that keeps a list of thread-local sinks to aggregate from diff --git a/rust-toolchain.toml b/rust-toolchain.toml index b6b1cee38e..e4205e80bf 100644 --- a/rust-toolchain.toml +++ b/rust-toolchain.toml @@ -1,6 +1,6 @@ [toolchain] # The default profile includes rustc, rust-std, cargo, rust-docs, rustfmt and clippy. profile = "default" -channel = "1.76" +channel = "1.78" targets = [ "wasm32-unknown-unknown" ] diff --git a/src/circuit/gadgets/case.rs b/src/circuit/gadgets/case.rs index 700ff5465d..9da0bc8024 100644 --- a/src/circuit/gadgets/case.rs +++ b/src/circuit/gadgets/case.rs @@ -5,6 +5,7 @@ use std::fmt::Debug; /// Initialized map entry for a fixed `key` with /// an allocated `value` computed at runtime. +#[allow(dead_code)] pub(crate) struct CaseClause<'a, F: LurkField> { pub(crate) key: F, pub(crate) value: &'a AllocatedNum, diff --git a/src/lem/eval.rs b/src/lem/eval.rs index 7db66e7bca..f683bee22d 100644 --- a/src/lem/eval.rs +++ b/src/lem/eval.rs @@ -109,7 +109,7 @@ fn build_frames>( compute_frame(lurk_step, cprocs, &input, store, lang, ch_terminal, pc)?; iterations += 1; - input = frame.output.clone(); + input.clone_from(&frame.output); tracing::info!("{}", &log_fmt(iterations, &input, store)); let expr = frame.output[0]; frames.push(frame); @@ -139,7 +139,7 @@ fn traverse_frames>( compute_frame(lurk_step, cprocs, &input, store, lang, ch_terminal, pc)?; iterations += 1; - input = frame.output.clone(); + input.clone_from(&frame.output); if must_break { break; diff --git a/src/tag.rs b/src/tag.rs index 5740366568..d91bafe6fb 100644 --- a/src/tag.rs +++ b/src/tag.rs @@ -249,6 +249,7 @@ impl From for u64 { } } +#[allow(dead_code)] pub(crate) trait Op where Self: 'static, diff --git a/src/z_data/serde/ser.rs b/src/z_data/serde/ser.rs index ef9d092baa..04bbabae5a 100644 --- a/src/z_data/serde/ser.rs +++ b/src/z_data/serde/ser.rs @@ -171,18 +171,18 @@ impl<'a> ser::Serializer for &'a Serializer { } #[inline] - fn serialize_newtype_struct( + fn serialize_newtype_struct( self, _name: &'static str, value: &T, ) -> Result where - T: ser::Serialize, + T: ?Sized + ser::Serialize, { value.serialize(self) } - fn serialize_newtype_variant( + fn serialize_newtype_variant( self, _name: &'static str, variant_index: u32, @@ -190,7 +190,7 @@ impl<'a> ser::Serializer for &'a Serializer { value: &T, ) -> Result where - T: ser::Serialize, + T: ?Sized + ser::Serialize, { // Assuming # of variants < 256 Ok(ZData::Cell(vec![ @@ -205,9 +205,9 @@ impl<'a> ser::Serializer for &'a Serializer { } #[inline] - fn serialize_some(self, value: &T) -> Result + fn serialize_some(self, value: &T) -> Result where - T: ser::Serialize, + T: ?Sized + ser::Serialize, { Ok(ZData::Cell(vec![value.serialize(self)?])) } @@ -292,9 +292,9 @@ impl ser::SerializeSeq for SerializeCell { type Ok = ZData; type Error = SerdeError; - fn serialize_element(&mut self, value: &T) -> Result<(), Self::Error> + fn serialize_element(&mut self, value: &T) -> Result<(), Self::Error> where - T: ser::Serialize, + T: ?Sized + ser::Serialize, { self.cell.push(value.serialize(&Serializer)?); Ok(()) @@ -309,9 +309,9 @@ impl ser::SerializeTuple for SerializeCell { type Ok = ZData; type Error = SerdeError; - fn serialize_element(&mut self, value: &T) -> Result<(), Self::Error> + fn serialize_element(&mut self, value: &T) -> Result<(), Self::Error> where - T: ser::Serialize, + T: ?Sized + ser::Serialize, { ser::SerializeSeq::serialize_element(self, value) } @@ -325,9 +325,9 @@ impl ser::SerializeTupleStruct for SerializeCell { type Ok = ZData; type Error = SerdeError; - fn serialize_field(&mut self, value: &T) -> Result<(), Self::Error> + fn serialize_field(&mut self, value: &T) -> Result<(), Self::Error> where - T: ser::Serialize, + T: ?Sized + ser::Serialize, { ser::SerializeSeq::serialize_element(self, value) } @@ -341,9 +341,9 @@ impl ser::SerializeTupleVariant for SerializeTupleVariant { type Ok = ZData; type Error = SerdeError; - fn serialize_field(&mut self, value: &T) -> Result<(), Self::Error> + fn serialize_field(&mut self, value: &T) -> Result<(), Self::Error> where - T: ser::Serialize, + T: ?Sized + ser::Serialize, { self.cell.push(value.serialize(&Serializer)?); Ok(()) @@ -362,17 +362,17 @@ impl ser::SerializeMap for SerializeMap { type Ok = ZData; type Error = SerdeError; - fn serialize_key(&mut self, key: &T) -> Result<(), Self::Error> + fn serialize_key(&mut self, key: &T) -> Result<(), Self::Error> where - T: ser::Serialize, + T: ?Sized + ser::Serialize, { self.next_key = Some(key.serialize(&Serializer)?); Ok(()) } - fn serialize_value(&mut self, value: &T) -> Result<(), Self::Error> + fn serialize_value(&mut self, value: &T) -> Result<(), Self::Error> where - T: ser::Serialize, + T: ?Sized + ser::Serialize, { let key = self .next_key