Skip to content

Commit

Permalink
Update for precise capture bounds
Browse files Browse the repository at this point in the history
    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))]
        |                                                         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  • Loading branch information
dtolnay committed Oct 21, 2024
1 parent 4b3178b commit 8b0f482
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 3 deletions.
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }
4 changes: 3 additions & 1 deletion serde_derive/src/bound.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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(_) => {}
_ => {}
}
}
Expand Down
4 changes: 3 additions & 1 deletion serde_derive/src/internals/receiver.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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(_) => {}
_ => {}
}
}
Expand Down

0 comments on commit 8b0f482

Please sign in to comment.