diff --git a/apps/hash-graph/libs/api/src/rest/middleware.rs b/apps/hash-graph/libs/api/src/rest/middleware.rs index f1e8237a5b6..71f1c2641ef 100644 --- a/apps/hash-graph/libs/api/src/rest/middleware.rs +++ b/apps/hash-graph/libs/api/src/rest/middleware.rs @@ -19,6 +19,10 @@ use tower_http::{ }; use tracing::field::Empty; +#[expect( + clippy::type_complexity, + reason = "factoring out the types would make the code less readable" +)] pub fn span_trace_layer() -> TraceLayer< SharedClassifier, impl Fn(&Request) -> tracing::Span + Clone, @@ -37,7 +41,7 @@ pub fn span_trace_layer() -> TraceLayer< struct HeaderExtractor<'a>(&'a http::HeaderMap); // Let OpenTelemetry pick the field names to make our headers "standardized". // We would have to set `traceparent` in a header to correlate spans. -impl<'a> Extractor for HeaderExtractor<'a> { +impl Extractor for HeaderExtractor<'_> { fn get(&self, key: &str) -> Option<&str> { self.0.get(key).and_then(|value| value.to_str().ok()) } diff --git a/apps/hash-graph/libs/graph/src/store/crud.rs b/apps/hash-graph/libs/graph/src/store/crud.rs index 40a52a0f0ac..6cc1d3484f8 100644 --- a/apps/hash-graph/libs/graph/src/store/crud.rs +++ b/apps/hash-graph/libs/graph/src/store/crud.rs @@ -56,7 +56,7 @@ pub struct ReadParameter<'f, R: QueryRecord, S> { limit: Option, } -impl<'f, R: QueryRecord> Default for ReadParameter<'f, R, ()> { +impl Default for ReadParameter<'_, R, ()> { fn default() -> Self { Self { filters: None, @@ -126,7 +126,7 @@ impl<'f, R: QueryRecord> ReadParameter<'f, R, ()> { } } -impl<'f, R: QueryRecord, S: Sorting> ReadParameter<'f, R, S> { +impl ReadParameter<'_, R, S> { #[must_use] pub const fn limit(mut self, limit: usize) -> Self { self.limit = Some(limit); @@ -155,6 +155,10 @@ pub trait ReadPaginated: Read { type ReadPaginatedStream: Stream> + Send + Sync; + #[expect( + clippy::type_complexity, + reason = "simplification of type would lead to more unreadable code" + )] fn read_paginated( &self, filter: &Filter<'_, R>, @@ -172,6 +176,10 @@ pub trait ReadPaginated: Read { >, > + Send; + #[expect( + clippy::type_complexity, + reason = "simplification of type would lead to more unreadable code" + )] #[instrument(level = "info", skip(self, filter, sorting))] fn read_paginated_vec( &self, diff --git a/apps/hash-graph/libs/graph/src/store/postgres/query/expression/conditional.rs b/apps/hash-graph/libs/graph/src/store/postgres/query/expression/conditional.rs index a463a5943b2..1e9db03175a 100644 --- a/apps/hash-graph/libs/graph/src/store/postgres/query/expression/conditional.rs +++ b/apps/hash-graph/libs/graph/src/store/postgres/query/expression/conditional.rs @@ -242,7 +242,7 @@ impl Transpile for Expression { } pub struct Transpiler<'t, T>(pub &'t T); -impl<'t, T> Display for Transpiler<'t, T> +impl Display for Transpiler<'_, T> where T: Transpile, { diff --git a/apps/hash-graph/libs/store/src/filter/parameter.rs b/apps/hash-graph/libs/store/src/filter/parameter.rs index 55bcb0026fa..54be6e37b1c 100644 --- a/apps/hash-graph/libs/store/src/filter/parameter.rs +++ b/apps/hash-graph/libs/store/src/filter/parameter.rs @@ -77,7 +77,7 @@ pub enum ParameterList<'p> { EntityEditionIds(&'p [EntityEditionId]), } -impl<'p> Parameter<'p> { +impl Parameter<'_> { #[must_use] pub fn to_owned(&self) -> Parameter<'static> { match self { diff --git a/libs/@local/codec/src/serde/mod.rs b/libs/@local/codec/src/serde/mod.rs index 7b89bade481..2b86e2f24a1 100644 --- a/libs/@local/codec/src/serde/mod.rs +++ b/libs/@local/codec/src/serde/mod.rs @@ -1,3 +1,8 @@ +#![expect( + clippy::ref_option, + reason = "serde requires &Option<_> not Option<&_>" +)] + pub mod constant; pub mod string_hash_map; diff --git a/libs/@local/codec/src/serde/string_hash_map.rs b/libs/@local/codec/src/serde/string_hash_map.rs index dab35e7cabc..f3b339dc482 100644 --- a/libs/@local/codec/src/serde/string_hash_map.rs +++ b/libs/@local/codec/src/serde/string_hash_map.rs @@ -81,7 +81,7 @@ where key: PhantomData, } - impl<'de, K> Visitor<'de> for KeySeed + impl Visitor<'_> for KeySeed where K: FromStr, K::Err: Display, diff --git a/libs/@local/harpc/net/src/session/writer/mod.rs b/libs/@local/harpc/net/src/session/writer/mod.rs index bbfdd269e13..1a46fa02edb 100644 --- a/libs/@local/harpc/net/src/session/writer/mod.rs +++ b/libs/@local/harpc/net/src/session/writer/mod.rs @@ -278,7 +278,7 @@ where pub(crate) type ResponseWriter<'a> = PacketWriter<'a, Response>; -impl<'a> ResponseWriter<'a> { +impl ResponseWriter<'_> { pub(crate) const fn is_error(&self) -> bool { matches!(self.context.kind, ResponseKind::Err(_)) } diff --git a/libs/@local/harpc/tower/src/body/mod.rs b/libs/@local/harpc/tower/src/body/mod.rs index 60ca73b5b2d..3405ce355b4 100644 --- a/libs/@local/harpc/tower/src/body/mod.rs +++ b/libs/@local/harpc/tower/src/body/mod.rs @@ -241,15 +241,13 @@ pub trait BodyExt: Body { Pin::new(self).poll_frame(cx) } - fn frame( - &mut self, - ) -> impl Future, Self::Error>>> + fn frame(&mut self) -> impl Future>> where Self: Unpin, { struct FrameFuture<'a, T: ?Sized>(&'a mut T); - impl<'a, T: Body + Unpin + ?Sized> Future for FrameFuture<'a, T> { + impl Future for FrameFuture<'_, T> { type Output = Option, T::Error>>; fn poll(mut self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll { diff --git a/libs/@local/harpc/tower/src/lib.rs b/libs/@local/harpc/tower/src/lib.rs index ca352ff9f38..447ed33df4c 100644 --- a/libs/@local/harpc/tower/src/lib.rs +++ b/libs/@local/harpc/tower/src/lib.rs @@ -2,7 +2,6 @@ impl_trait_in_assoc_type, never_type, type_changing_struct_update, - control_flow_enum, error_generic_member_access )] #![cfg_attr(test, feature(noop_waker, assert_matches))] diff --git a/libs/@local/harpc/wire-protocol/src/codec/buffer.rs b/libs/@local/harpc/wire-protocol/src/codec/buffer.rs index 2a678e5bbd7..e93a009bf42 100644 --- a/libs/@local/harpc/wire-protocol/src/codec/buffer.rs +++ b/libs/@local/harpc/wire-protocol/src/codec/buffer.rs @@ -85,7 +85,7 @@ impl<'a, B> Buffer<'a, B> { } } -impl<'a, B> Buffer<'a, B> +impl Buffer<'_, B> where B: Buf, { @@ -127,7 +127,7 @@ where } } -impl<'a, B> Buffer<'a, B> +impl Buffer<'_, B> where B: BufMut, { diff --git a/libs/@local/hql/cst/src/expr/path.rs b/libs/@local/hql/cst/src/expr/path.rs index 83358030077..cb1b269bfb2 100644 --- a/libs/@local/hql/cst/src/expr/path.rs +++ b/libs/@local/hql/cst/src/expr/path.rs @@ -32,7 +32,7 @@ impl Display for Path<'_> { } } -impl<'arena, 'source> From> for ExprKind<'arena, 'source> { +impl<'arena> From> for ExprKind<'arena, '_> { fn from(path: Path<'arena>) -> Self { Self::Path(path) } diff --git a/libs/@local/hql/cst/src/expr/signature.rs b/libs/@local/hql/cst/src/expr/signature.rs index 3f03eef9845..c294edf31dd 100644 --- a/libs/@local/hql/cst/src/expr/signature.rs +++ b/libs/@local/hql/cst/src/expr/signature.rs @@ -48,7 +48,7 @@ impl Spanned for Signature<'_> { } } -impl<'a> Display for Signature<'a> { +impl Display for Signature<'_> { fn fmt(&self, fmt: &mut fmt::Formatter<'_>) -> fmt::Result { if !self.generics.is_empty() { fmt.write_char('<')?; @@ -78,7 +78,7 @@ impl<'a> Display for Signature<'a> { } } -impl<'arena, 'source> From> for ExprKind<'arena, 'source> { +impl<'arena> From> for ExprKind<'arena, '_> { fn from(signature: Signature<'arena>) -> Self { Self::Signature(signature) } @@ -92,13 +92,13 @@ pub struct Generic<'arena> { pub span: SpanId, } -impl<'arena> Spanned for Generic<'arena> { +impl Spanned for Generic<'_> { fn span(&self) -> SpanId { self.span } } -impl<'a> Display for Generic<'a> { +impl Display for Generic<'_> { fn fmt(&self, fmt: &mut fmt::Formatter<'_>) -> fmt::Result { Display::fmt(&self.name, fmt)?; @@ -119,13 +119,13 @@ pub struct Argument<'arena> { pub span: SpanId, } -impl<'arena> Spanned for Argument<'arena> { +impl Spanned for Argument<'_> { fn span(&self) -> SpanId { self.span } } -impl<'arena> Display for Argument<'arena> { +impl Display for Argument<'_> { fn fmt(&self, fmt: &mut fmt::Formatter<'_>) -> fmt::Result { Display::fmt(&self.name, fmt)?; fmt.write_str(": ")?; @@ -140,13 +140,13 @@ pub struct Return<'arena> { pub span: SpanId, } -impl<'arena> Spanned for Return<'arena> { +impl Spanned for Return<'_> { fn span(&self) -> SpanId { self.span } } -impl<'arena> Display for Return<'arena> { +impl Display for Return<'_> { fn fmt(&self, fmt: &mut fmt::Formatter<'_>) -> fmt::Result { Display::fmt(&self.r#type, fmt) } diff --git a/libs/@local/hql/cst/src/value.rs b/libs/@local/hql/cst/src/value.rs index 628ca953556..ef122967aab 100644 --- a/libs/@local/hql/cst/src/value.rs +++ b/libs/@local/hql/cst/src/value.rs @@ -21,15 +21,15 @@ pub struct ObjectKey<'source> { pub value: Cow<'source, str>, } -impl<'source> PartialEq for ObjectKey<'source> { +impl PartialEq for ObjectKey<'_> { fn eq(&self, other: &Self) -> bool { self.value == other.value } } -impl<'source> Eq for ObjectKey<'source> {} +impl Eq for ObjectKey<'_> {} -impl<'source> Hash for ObjectKey<'source> { +impl Hash for ObjectKey<'_> { fn hash(&self, state: &mut H) { self.value.hash(state); } diff --git a/libs/@local/hql/diagnostics/src/category.rs b/libs/@local/hql/diagnostics/src/category.rs index 7626e1f8744..774640ba295 100644 --- a/libs/@local/hql/diagnostics/src/category.rs +++ b/libs/@local/hql/diagnostics/src/category.rs @@ -16,7 +16,7 @@ impl Category<'_> { pub fn canonical_id(&self) -> impl Display + '_ { struct DisplayCategoryId<'a, 'b>(&'a Category<'b>); - impl<'a, 'b> Display for DisplayCategoryId<'a, 'b> { + impl Display for DisplayCategoryId<'_, '_> { fn fmt(&self, fmt: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { if let Some(parent) = &self.0.parent { DisplayCategoryId(parent.as_ref()).fmt(fmt)?; @@ -34,7 +34,7 @@ impl Category<'_> { pub fn canonical_name(&self) -> impl Display + '_ { struct DisplayCategoryName<'a, 'b>(&'a Category<'b>); - impl<'a, 'b> Display for DisplayCategoryName<'a, 'b> { + impl Display for DisplayCategoryName<'_, '_> { fn fmt(&self, fmt: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { if let Some(parent) = &self.0.parent { DisplayCategoryName(parent.as_ref()).fmt(fmt)?; diff --git a/libs/@local/hql/diagnostics/src/rob.rs b/libs/@local/hql/diagnostics/src/rob.rs index 2fe398ceffd..1de2403ed8f 100644 --- a/libs/@local/hql/diagnostics/src/rob.rs +++ b/libs/@local/hql/diagnostics/src/rob.rs @@ -13,7 +13,7 @@ pub enum RefOrBox<'a, T: ?Sized> { Box(Box), } -impl<'a, T: ?Sized> RefOrBox<'a, T> { +impl RefOrBox<'_, T> { #[must_use] pub fn into_owned(self) -> T where @@ -26,7 +26,7 @@ impl<'a, T: ?Sized> RefOrBox<'a, T> { } } -impl<'a, T> AsRef for RefOrBox<'a, T> { +impl AsRef for RefOrBox<'_, T> { fn as_ref(&self) -> &T { match self { Self::Ref(reference) => reference, @@ -35,7 +35,7 @@ impl<'a, T> AsRef for RefOrBox<'a, T> { } } -impl<'a, T> Clone for RefOrBox<'a, T> +impl Clone for RefOrBox<'_, T> where T: Clone, { @@ -55,7 +55,7 @@ where } } -impl<'a, T: Display + ?Sized> Display for RefOrBox<'a, T> { +impl Display for RefOrBox<'_, T> { fn fmt(&self, fmt: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { match self { Self::Ref(reference) => reference.fmt(fmt), @@ -77,7 +77,7 @@ impl From for RefOrBox<'_, T> { } #[cfg(feature = "serde")] -impl<'a, T> serde::Serialize for RefOrBox<'a, T> +impl serde::Serialize for RefOrBox<'_, T> where T: serde::Serialize, { @@ -93,7 +93,7 @@ where } #[cfg(feature = "serde")] -impl<'a, 'de, T> serde::Deserialize<'de> for RefOrBox<'a, T> +impl<'de, T> serde::Deserialize<'de> for RefOrBox<'_, T> where T: serde::Deserialize<'de>, { diff --git a/libs/@local/hql/syntax-jexpr/src/lexer/token_kind.rs b/libs/@local/hql/syntax-jexpr/src/lexer/token_kind.rs index 3b00cc21002..de02db46e4e 100644 --- a/libs/@local/hql/syntax-jexpr/src/lexer/token_kind.rs +++ b/libs/@local/hql/syntax-jexpr/src/lexer/token_kind.rs @@ -44,7 +44,7 @@ pub(crate) enum TokenKind<'source> { String(Cow<'source, str>), } -impl<'source> TokenKind<'source> { +impl TokenKind<'_> { pub(crate) fn syntax(&self) -> SyntaxKind { SyntaxKind::from(self) } diff --git a/libs/@local/hql/syntax-jexpr/src/parser/stream.rs b/libs/@local/hql/syntax-jexpr/src/parser/stream.rs index 7f4ddde9645..46d680fcdce 100644 --- a/libs/@local/hql/syntax-jexpr/src/parser/stream.rs +++ b/libs/@local/hql/syntax-jexpr/src/parser/stream.rs @@ -18,7 +18,7 @@ pub(crate) struct TokenStream<'arena, 'source> { pub stack: Option>>, } -impl<'arena, 'source> TokenStream<'arena, 'source> { +impl<'source> TokenStream<'_, 'source> { pub(crate) fn next_or_err(&mut self) -> Result, Diagnostic<'static, SpanId>> { let Some(token) = self.lexer.advance() else { let span = Span { diff --git a/libs/@local/status/rust/src/lib.rs b/libs/@local/status/rust/src/lib.rs index cb7700dfcf5..c5589f63c38 100644 --- a/libs/@local/status/rust/src/lib.rs +++ b/libs/@local/status/rust/src/lib.rs @@ -45,8 +45,8 @@ where } #[must_use] - pub const fn message(&self) -> &Option { - &self.message + pub fn message(&self) -> Option<&str> { + self.message.as_deref() } #[must_use] diff --git a/libs/antsi/rust-toolchain.toml b/libs/antsi/rust-toolchain.toml index 7fcef86ad37..ac11fbf6006 100644 --- a/libs/antsi/rust-toolchain.toml +++ b/libs/antsi/rust-toolchain.toml @@ -1,3 +1,3 @@ [toolchain] -channel = "nightly-2024-09-30" +channel = "nightly-2024-10-07" components = ['rustfmt', 'clippy', 'llvm-tools-preview', 'rust-analyzer', 'rustc-codegen-cranelift-preview'] diff --git a/libs/deer/desert/src/deserializer.rs b/libs/deer/desert/src/deserializer.rs index a8c8eb8b033..f96e9240288 100644 --- a/libs/deer/desert/src/deserializer.rs +++ b/libs/deer/desert/src/deserializer.rs @@ -36,7 +36,7 @@ pub struct Deserializer<'a, 'de> { tape: Tape<'de>, } -impl<'a, 'de> deer::Deserializer<'de> for &mut Deserializer<'a, 'de> { +impl<'de> deer::Deserializer<'de> for &mut Deserializer<'_, 'de> { forward!( deserialize_null, deserialize_bool, diff --git a/libs/deer/desert/src/tape.rs b/libs/deer/desert/src/tape.rs index 46d28256d0a..e5437e0637f 100644 --- a/libs/deer/desert/src/tape.rs +++ b/libs/deer/desert/src/tape.rs @@ -36,7 +36,7 @@ pub(crate) struct Tape<'de> { trivia: Trivia, } -impl<'de> Tape<'de> { +impl Tape<'_> { // also includes trivia fn peek_all_n(&self, n: usize) -> Option { self.tokens.get(n).cloned() diff --git a/libs/deer/json/src/token.rs b/libs/deer/json/src/token.rs index 260d0cbb186..95eac97e131 100644 --- a/libs/deer/json/src/token.rs +++ b/libs/deer/json/src/token.rs @@ -52,7 +52,7 @@ impl Reflection for AnyArray { } } -impl<'a> ValueToken<'a> { +impl ValueToken<'_> { pub(crate) fn schema(&self) -> Document { match self { Self::Null => <() as Deserialize>::reflection(), diff --git a/libs/deer/rust-toolchain.toml b/libs/deer/rust-toolchain.toml index bf740c8f842..60cda1d93ed 100644 --- a/libs/deer/rust-toolchain.toml +++ b/libs/deer/rust-toolchain.toml @@ -1,3 +1,3 @@ [toolchain] -channel = "nightly-2024-09-30" +channel = "nightly-2024-10-07" components = ['rustfmt', 'clippy', 'llvm-tools-preview', 'miri', 'rust-analyzer', 'rustc-codegen-cranelift-preview'] diff --git a/libs/deer/src/error/serialize.rs b/libs/deer/src/error/serialize.rs index 7d0b9513d96..6f8b024f05d 100644 --- a/libs/deer/src/error/serialize.rs +++ b/libs/deer/src/error/serialize.rs @@ -20,7 +20,7 @@ struct Message<'a, 'b, E: Variant> { properties: &'b ::Value<'a>, } -impl<'a, 'b, E: Variant> Display for Message<'a, 'b, E> { +impl Display for Message<'_, '_, E> { fn fmt(&self, fmt: &mut Formatter<'_>) -> fmt::Result { self.context.message(fmt, self.properties) } @@ -45,7 +45,7 @@ impl<'a, E: Variant> SerializeErrorProperties<'a, E> { } } -impl<'a, E: Variant> Serialize for SerializeErrorProperties<'a, E> { +impl Serialize for SerializeErrorProperties<'_, E> { fn serialize(&self, serializer: S) -> Result where S: Serializer, diff --git a/libs/deer/src/helpers.rs b/libs/deer/src/helpers.rs index e21e6628a6f..acbe0d042b0 100644 --- a/libs/deer/src/helpers.rs +++ b/libs/deer/src/helpers.rs @@ -82,7 +82,7 @@ where struct ExpectNoneVisitor; -impl<'de> Visitor<'de> for ExpectNoneVisitor { +impl Visitor<'_> for ExpectNoneVisitor { type Value = ExpectNone; fn expecting(&self) -> Document { diff --git a/libs/deer/src/impls/core/bool.rs b/libs/deer/src/impls/core/bool.rs index 9a52313b6d6..7ad9bb293fc 100644 --- a/libs/deer/src/impls/core/bool.rs +++ b/libs/deer/src/impls/core/bool.rs @@ -7,7 +7,7 @@ use crate::{ struct BoolVisitor; -impl<'de> Visitor<'de> for BoolVisitor { +impl Visitor<'_> for BoolVisitor { type Value = bool; fn expecting(&self) -> Document { diff --git a/libs/deer/src/impls/core/cmp.rs b/libs/deer/src/impls/core/cmp.rs index 9bfa5e572d0..eaaeed29539 100644 --- a/libs/deer/src/impls/core/cmp.rs +++ b/libs/deer/src/impls/core/cmp.rs @@ -20,7 +20,7 @@ impl<'de, T: Deserialize<'de>> Deserialize<'de> for Reverse { struct OrderingVisitor; -impl<'de> Visitor<'de> for OrderingVisitor { +impl Visitor<'_> for OrderingVisitor { type Value = Ordering; fn expecting(&self) -> Document { diff --git a/libs/deer/src/impls/core/marker.rs b/libs/deer/src/impls/core/marker.rs index 30040d83e8d..0c3c27ab2b2 100644 --- a/libs/deer/src/impls/core/marker.rs +++ b/libs/deer/src/impls/core/marker.rs @@ -9,7 +9,7 @@ use crate::{ struct PhantomDataVisitor(PhantomData); -impl<'de, T: ?Sized> Visitor<'de> for PhantomDataVisitor { +impl Visitor<'_> for PhantomDataVisitor { type Value = PhantomData; fn expecting(&self) -> Document { diff --git a/libs/deer/src/impls/core/ops.rs b/libs/deer/src/impls/core/ops.rs index fb948b60fd4..e4b89df757f 100644 --- a/libs/deer/src/impls/core/ops.rs +++ b/libs/deer/src/impls/core/ops.rs @@ -115,7 +115,7 @@ struct RangeFieldVisitor<'a, T, U> { end: &'a mut Option, } -impl<'a, 'de, T, U> FieldVisitor<'de> for RangeFieldVisitor<'a, T, U> +impl<'de, T, U> FieldVisitor<'de> for RangeFieldVisitor<'_, T, U> where T: Deserialize<'de>, U: Deserialize<'de>, diff --git a/libs/deer/src/impls/core/result.rs b/libs/deer/src/impls/core/result.rs index d56ec7174c5..e8f6c0df904 100644 --- a/libs/deer/src/impls/core/result.rs +++ b/libs/deer/src/impls/core/result.rs @@ -18,7 +18,7 @@ enum ResultDiscriminant { struct ResultDiscriminantVisitor; -impl<'de> Visitor<'de> for ResultDiscriminantVisitor { +impl Visitor<'_> for ResultDiscriminantVisitor { type Value = ResultDiscriminant; fn expecting(&self) -> Document { diff --git a/libs/deer/src/impls/core/string.rs b/libs/deer/src/impls/core/string.rs index fa3811af29e..764a1eed3dd 100644 --- a/libs/deer/src/impls/core/string.rs +++ b/libs/deer/src/impls/core/string.rs @@ -39,7 +39,7 @@ impl<'de: 'a, 'a> Deserialize<'de> for &'a str { struct CharVisitor; -impl<'de> Visitor<'de> for CharVisitor { +impl Visitor<'_> for CharVisitor { type Value = char; fn expecting(&self) -> Document { diff --git a/libs/deer/src/impls/core/unit.rs b/libs/deer/src/impls/core/unit.rs index c46bdca1d28..16cfdc8a1bc 100644 --- a/libs/deer/src/impls/core/unit.rs +++ b/libs/deer/src/impls/core/unit.rs @@ -7,7 +7,7 @@ use crate::{ struct UnitVisitor; -impl<'de> Visitor<'de> for UnitVisitor { +impl Visitor<'_> for UnitVisitor { type Value = (); fn expecting(&self) -> Document { diff --git a/libs/deer/src/impls/mod.rs b/libs/deer/src/impls/mod.rs index 975eca30360..6f76aed5498 100644 --- a/libs/deer/src/impls/mod.rs +++ b/libs/deer/src/impls/mod.rs @@ -6,7 +6,7 @@ mod core; pub(crate) struct UnitVariantVisitor; -impl<'de> OptionalVisitor<'de> for UnitVariantVisitor { +impl OptionalVisitor<'_> for UnitVariantVisitor { type Value = (); fn expecting(&self) -> Document { diff --git a/libs/deer/src/lib.rs b/libs/deer/src/lib.rs index 4904e6372c9..0828a7e6bbe 100644 --- a/libs/deer/src/lib.rs +++ b/libs/deer/src/lib.rs @@ -815,7 +815,7 @@ pub(crate) mod test { _marker: PhantomData *const E>, } - impl<'a, 'b, E: Variant> Serialize for SerializeFrame<'a, 'b, E> { + impl Serialize for SerializeFrame<'_, '_, E> { fn serialize(&self, serializer: S) -> Result where S: Serializer, diff --git a/libs/deer/src/number.rs b/libs/deer/src/number.rs index e1225de4c30..ff5c8060c6f 100644 --- a/libs/deer/src/number.rs +++ b/libs/deer/src/number.rs @@ -386,7 +386,7 @@ impl<'de> Deserialize<'de> for Number { ) -> error_stack::Result { struct Visitor; - impl<'de> crate::Visitor<'de> for Visitor { + impl crate::Visitor<'_> for Visitor { type Value = Number; fn expecting(&self) -> Document { diff --git a/libs/deer/tests/test_enum_visitor.rs b/libs/deer/tests/test_enum_visitor.rs index b4e6093f0a0..9e6e0b31ed7 100644 --- a/libs/deer/tests/test_enum_visitor.rs +++ b/libs/deer/tests/test_enum_visitor.rs @@ -16,7 +16,7 @@ use serde_json::json; struct DiscriminantVisitor; -impl<'de> Visitor<'de> for DiscriminantVisitor { +impl Visitor<'_> for DiscriminantVisitor { type Value = Discriminant; fn expecting(&self) -> Document { @@ -295,7 +295,7 @@ impl<'de> Visitor<'de> for StructEnumVisitor { Id(u8), } - impl<'de> Visitor<'de> for VariantFieldVisitor { + impl Visitor<'_> for VariantFieldVisitor { type Value = VariantFieldIdent; fn expecting(&self) -> Document { diff --git a/libs/deer/tests/test_struct_visitor.rs b/libs/deer/tests/test_struct_visitor.rs index 4d9d993ea8b..6359fefd760 100644 --- a/libs/deer/tests/test_struct_visitor.rs +++ b/libs/deer/tests/test_struct_visitor.rs @@ -51,7 +51,7 @@ impl<'de> Deserialize<'de> for ExampleFieldDiscriminator { { struct IdentVisitor; - impl<'de> Visitor<'de> for IdentVisitor { + impl Visitor<'_> for IdentVisitor { type Value = ExampleFieldDiscriminator; fn expecting(&self) -> Document { diff --git a/libs/deer/tests/test_value.rs b/libs/deer/tests/test_value.rs index 76b8e0af0d4..97c9e803716 100644 --- a/libs/deer/tests/test_value.rs +++ b/libs/deer/tests/test_value.rs @@ -100,7 +100,7 @@ impl Reflection for Choice { struct ChoiceVisitor; -impl<'de> Visitor<'de> for ChoiceVisitor { +impl Visitor<'_> for ChoiceVisitor { type Value = Choice; fn expecting(&self) -> Document { @@ -139,7 +139,7 @@ impl Reflection for Null { struct NullVisitor; -impl<'de> Visitor<'de> for NullVisitor { +impl Visitor<'_> for NullVisitor { type Value = Null; fn expecting(&self) -> Document { @@ -327,7 +327,7 @@ impl Reflection for BytesLength { struct BytesLengthVisitor; -impl<'de> Visitor<'de> for BytesLengthVisitor { +impl Visitor<'_> for BytesLengthVisitor { type Value = BytesLength; fn expecting(&self) -> Document { @@ -359,7 +359,7 @@ impl Reflection for ByteBuffer { struct ByteBufferVisitor; -impl<'de> Visitor<'de> for ByteBufferVisitor { +impl Visitor<'_> for ByteBufferVisitor { type Value = ByteBuffer; fn expecting(&self) -> Document { diff --git a/libs/error-stack/README.md b/libs/error-stack/README.md index ba45dcaa223..bfab2f50527 100644 --- a/libs/error-stack/README.md +++ b/libs/error-stack/README.md @@ -7,7 +7,7 @@ [![crates.io](https://img.shields.io/crates/v/error-stack)][crates.io] [![libs.rs](https://img.shields.io/badge/libs.rs-error--stack-orange)][libs.rs] -[![rust-version](https://img.shields.io/static/v1?label=Rust&message=1.63.0/nightly-2024-09-30&color=blue)][rust-version] +[![rust-version](https://img.shields.io/static/v1?label=Rust&message=1.63.0/nightly-2024-10-07&color=blue)][rust-version] [![documentation](https://img.shields.io/docsrs/error-stack)][documentation] [![license](https://img.shields.io/crates/l/error-stack)][license] diff --git a/libs/error-stack/macros/README.md b/libs/error-stack/macros/README.md index bd51f35c5c2..c65a14f4845 100644 --- a/libs/error-stack/macros/README.md +++ b/libs/error-stack/macros/README.md @@ -6,7 +6,7 @@ [![crates.io](https://img.shields.io/crates/v/error-stack-macros)][crates.io] [![libs.rs](https://img.shields.io/badge/libs.rs-error--stack--macros-orange)][libs.rs] -[![rust-version](https://img.shields.io/static/v1?label=Rust&message=1.63.0/nightly-2024-09-30&color=blue)][rust-version] +[![rust-version](https://img.shields.io/static/v1?label=Rust&message=1.63.0/nightly-2024-10-07&color=blue)][rust-version] [![documentation](https://img.shields.io/docsrs/error-stack-macros)][documentation] [![license](https://img.shields.io/crates/l/error-stack)][license] diff --git a/libs/error-stack/rust-toolchain.toml b/libs/error-stack/rust-toolchain.toml index 292218c8f7f..4e8c0000bf3 100644 --- a/libs/error-stack/rust-toolchain.toml +++ b/libs/error-stack/rust-toolchain.toml @@ -1,4 +1,4 @@ [toolchain] # Please also update the badges in `README.md`s (`error-stack` and `error-stack-macros`), and `src/lib.rs` -channel = "nightly-2024-09-30" +channel = "nightly-2024-10-07" components = ['rustfmt', 'clippy', 'llvm-tools-preview', 'miri', 'rust-src', 'rust-analyzer', 'rustc-codegen-cranelift-preview'] diff --git a/libs/error-stack/src/fmt/color.rs b/libs/error-stack/src/fmt/color.rs index fcd29b921c9..5d71ec2c35a 100644 --- a/libs/error-stack/src/fmt/color.rs +++ b/libs/error-stack/src/fmt/color.rs @@ -297,7 +297,7 @@ pub(crate) struct StyleDisplay<'a, T: Display> { value: &'a T, } -impl<'a, T: Display> Display for StyleDisplay<'a, T> { +impl Display for StyleDisplay<'_, T> { fn fmt(&self, mut fmt: &mut Formatter<'_>) -> fmt::Result { let mut sequence = ControlSequence::new(fmt); diff --git a/libs/error-stack/src/iter.rs b/libs/error-stack/src/iter.rs index 1baca54aec4..40d058bd6b5 100644 --- a/libs/error-stack/src/iter.rs +++ b/libs/error-stack/src/iter.rs @@ -101,7 +101,7 @@ impl<'r> Iterator for Frames<'r> { } } -impl<'r> FusedIterator for Frames<'r> {} +impl FusedIterator for Frames<'_> {} impl fmt::Debug for Frames<'_> { fn fmt(&self, fmt: &mut fmt::Formatter<'_>) -> fmt::Result { @@ -150,7 +150,7 @@ impl<'r> Iterator for FramesMut<'r> { } } -impl<'r> FusedIterator for FramesMut<'r> {} +impl FusedIterator for FramesMut<'_> {} /// Iterator over requested references in the [`Frame`] stack of a [`Report`]. /// @@ -188,7 +188,7 @@ where } #[cfg(nightly)] -impl<'r, T> FusedIterator for RequestRef<'r, T> where T: ?Sized + 'static {} +impl FusedIterator for RequestRef<'_, T> where T: ?Sized + 'static {} #[cfg(nightly)] impl Clone for RequestRef<'_, T> { @@ -201,7 +201,7 @@ impl Clone for RequestRef<'_, T> { } #[cfg(nightly)] -impl<'r, T> fmt::Debug for RequestRef<'r, T> +impl fmt::Debug for RequestRef<'_, T> where T: ?Sized + fmt::Debug + 'static, { @@ -234,7 +234,7 @@ impl<'r, T> RequestValue<'r, T> { } #[cfg(nightly)] -impl<'r, T> Iterator for RequestValue<'r, T> +impl Iterator for RequestValue<'_, T> where T: 'static, { @@ -246,7 +246,7 @@ where } #[cfg(nightly)] -impl<'r, T> FusedIterator for RequestValue<'r, T> where T: 'static {} +impl FusedIterator for RequestValue<'_, T> where T: 'static {} #[cfg(nightly)] impl Clone for RequestValue<'_, T> { @@ -259,7 +259,7 @@ impl Clone for RequestValue<'_, T> { } #[cfg(nightly)] -impl<'r, T> fmt::Debug for RequestValue<'r, T> +impl fmt::Debug for RequestValue<'_, T> where T: fmt::Debug + 'static, { diff --git a/libs/error-stack/src/lib.rs b/libs/error-stack/src/lib.rs index 1172bd9f3fb..376595f253b 100644 --- a/libs/error-stack/src/lib.rs +++ b/libs/error-stack/src/lib.rs @@ -2,7 +2,7 @@ //! //! [![crates.io](https://img.shields.io/crates/v/error-stack)][crates.io] //! [![libs.rs](https://img.shields.io/badge/libs.rs-error--stack-orange)][libs.rs] -//! [![rust-version](https://img.shields.io/static/v1?label=Rust&message=1.63.0/nightly-2024-09-30&color=blue)][rust-version] +//! [![rust-version](https://img.shields.io/static/v1?label=Rust&message=1.63.0/nightly-2024-10-07&color=blue)][rust-version] //! //! [crates.io]: https://crates.io/crates/error-stack //! [libs.rs]: https://lib.rs/crates/error-stack diff --git a/libs/error-stack/src/serde.rs b/libs/error-stack/src/serde.rs index bfb19df554d..8cb2d33b088 100644 --- a/libs/error-stack/src/serde.rs +++ b/libs/error-stack/src/serde.rs @@ -22,7 +22,7 @@ use crate::{AttachmentKind, Context, Frame, FrameKind, Report}; struct SerializeAttachment<'a>(&'a Frame); -impl<'a> Serialize for SerializeAttachment<'a> { +impl Serialize for SerializeAttachment<'_> { fn serialize(&self, serializer: S) -> Result where S: Serializer, @@ -50,7 +50,7 @@ impl<'a> Serialize for SerializeAttachment<'a> { struct SerializeAttachmentList<'a, 'b>(&'a [&'b Frame]); -impl<'a, 'b> Serialize for SerializeAttachmentList<'a, 'b> { +impl Serialize for SerializeAttachmentList<'_, '_> { fn serialize(&self, serializer: S) -> Result where S: Serializer, @@ -77,7 +77,7 @@ struct SerializeContext<'a> { sources: &'a [Frame], } -impl<'a> Serialize for SerializeContext<'a> { +impl Serialize for SerializeContext<'_> { fn serialize(&self, serializer: S) -> Result where S: Serializer, @@ -99,7 +99,7 @@ impl<'a> Serialize for SerializeContext<'a> { struct SerializeSources<'a>(&'a [Frame]); -impl<'a> Serialize for SerializeSources<'a> { +impl Serialize for SerializeSources<'_> { fn serialize(&self, serializer: S) -> Result where S: Serializer, diff --git a/libs/sarif/rust-toolchain.toml b/libs/sarif/rust-toolchain.toml index 7fcef86ad37..ac11fbf6006 100644 --- a/libs/sarif/rust-toolchain.toml +++ b/libs/sarif/rust-toolchain.toml @@ -1,3 +1,3 @@ [toolchain] -channel = "nightly-2024-09-30" +channel = "nightly-2024-10-07" components = ['rustfmt', 'clippy', 'llvm-tools-preview', 'rust-analyzer', 'rustc-codegen-cranelift-preview'] diff --git a/rust-toolchain.toml b/rust-toolchain.toml index bf740c8f842..60cda1d93ed 100644 --- a/rust-toolchain.toml +++ b/rust-toolchain.toml @@ -1,3 +1,3 @@ [toolchain] -channel = "nightly-2024-09-30" +channel = "nightly-2024-10-07" components = ['rustfmt', 'clippy', 'llvm-tools-preview', 'miri', 'rust-analyzer', 'rustc-codegen-cranelift-preview']