From 8b0f482666c5deca3bdc440f6b1dcaf84d2d2a62 Mon Sep 17 00:00:00 2001 From: David Tolnay Date: Sun, 20 Oct 2024 20:35:40 -0700 Subject: [PATCH] Update for precise capture bounds warning: some variants are not matched explicitly --> serde_derive/src/internals/receiver.rs:209:15 | 209 | match bound { | ^^^^^ pattern `&mut TypeParamBound::PreciseCapture(_)` not covered | = help: ensure that all variants are matched explicitly by adding the suggested match arms = note: the matched value is of type `&mut TypeParamBound` and the `non_exhaustive_omitted_patterns` attribute was found note: the lint level is defined here --> serde_derive/src/internals/receiver.rs:210:53 | 210 | #![cfg_attr(all(test, exhaustive), deny(non_exhaustive_omitted_patterns))] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ warning: some variants are not matched explicitly --> serde_derive/src/bound.rs:227:19 | 227 | match bound { | ^^^^^ pattern `&TypeParamBound::PreciseCapture(_)` not covered | = help: ensure that all variants are matched explicitly by adding the suggested match arms = note: the matched value is of type `&TypeParamBound` and the `non_exhaustive_omitted_patterns` attribute was found note: the lint level is defined here --> serde_derive/src/bound.rs:228:57 | 228 | #![cfg_attr(all(test, exhaustive), deny(non_exhaustive_omitted_patterns))] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ --- Cargo.toml | 2 +- serde_derive/src/bound.rs | 4 +++- serde_derive/src/internals/receiver.rs | 4 +++- 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index ac94fb08..41c11afa 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -12,4 +12,4 @@ serde = { path = "serde" } [workspace.dependencies] proc-macro2 = { version = "1.0.74", default-features = false } quote = { version = "1.0.35", default-features = false } -syn = { version = "2.0.46", default-features = false } +syn = { version = "2.0.81", default-features = false } diff --git a/serde_derive/src/bound.rs b/serde_derive/src/bound.rs index fe8ccfff..2ff6521f 100644 --- a/serde_derive/src/bound.rs +++ b/serde_derive/src/bound.rs @@ -227,7 +227,9 @@ pub fn with_bound( match bound { #![cfg_attr(all(test, exhaustive), deny(non_exhaustive_omitted_patterns))] syn::TypeParamBound::Trait(bound) => self.visit_path(&bound.path), - syn::TypeParamBound::Lifetime(_) | syn::TypeParamBound::Verbatim(_) => {} + syn::TypeParamBound::Lifetime(_) + | syn::TypeParamBound::PreciseCapture(_) + | syn::TypeParamBound::Verbatim(_) => {} _ => {} } } diff --git a/serde_derive/src/internals/receiver.rs b/serde_derive/src/internals/receiver.rs index 852e857b..1e7fc54f 100644 --- a/serde_derive/src/internals/receiver.rs +++ b/serde_derive/src/internals/receiver.rs @@ -209,7 +209,9 @@ impl ReplaceReceiver<'_> { match bound { #![cfg_attr(all(test, exhaustive), deny(non_exhaustive_omitted_patterns))] TypeParamBound::Trait(bound) => self.visit_path_mut(&mut bound.path), - TypeParamBound::Lifetime(_) | TypeParamBound::Verbatim(_) => {} + TypeParamBound::Lifetime(_) + | TypeParamBound::PreciseCapture(_) + | TypeParamBound::Verbatim(_) => {} _ => {} } }