Skip to content

Commit

Permalink
Update exhaustive matching to syn 1.0.90
Browse files Browse the repository at this point in the history
  • Loading branch information
dtolnay committed Mar 28, 2022
1 parent 7e19ae8 commit b23a768
Show file tree
Hide file tree
Showing 7 changed files with 10 additions and 11 deletions.
4 changes: 4 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,10 @@ jobs:
- run: cd serde && cargo test --features derive,rc,unstable
- run: cd test_suite/no_std && cargo build
if: matrix.os != 'windows'
- run: cd serde_derive && cargo check --tests
env:
RUSTFLAGS: --cfg exhaustive ${{env.RUSTFLAGS}}
if: matrix.os != 'windows'

msrv:
name: Rust 1.13.0
Expand Down
2 changes: 1 addition & 1 deletion serde_derive/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ proc-macro = true
[dependencies]
proc-macro2 = "1.0"
quote = "1.0"
syn = "1.0.60"
syn = "1.0.90"

[dev-dependencies]
serde = { version = "1.0", path = "../serde" }
Expand Down
4 changes: 1 addition & 3 deletions serde_derive/src/bound.rs
Original file line number Diff line number Diff line change
Expand Up @@ -184,9 +184,7 @@ pub fn with_bound(

syn::Type::Infer(_) | syn::Type::Never(_) | syn::Type::Verbatim(_) => {}

#[cfg(test)]
syn::Type::__TestExhaustive(_) => unimplemented!(),
#[cfg(not(test))]
#[cfg_attr(all(test, exhaustive), deny(non_exhaustive_omitted_patterns))]
_ => {}
}
}
Expand Down
4 changes: 1 addition & 3 deletions serde_derive/src/internals/attr.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1912,9 +1912,7 @@ fn collect_lifetimes(ty: &syn::Type, out: &mut BTreeSet<syn::Lifetime>) {
| syn::Type::Infer(_)
| syn::Type::Verbatim(_) => {}

#[cfg(test)]
syn::Type::__TestExhaustive(_) => unimplemented!(),
#[cfg(not(test))]
#[cfg_attr(all(test, exhaustive), deny(non_exhaustive_omitted_patterns))]
_ => {}
}
}
Expand Down
4 changes: 1 addition & 3 deletions serde_derive/src/internals/receiver.rs
Original file line number Diff line number Diff line change
Expand Up @@ -147,9 +147,7 @@ impl ReplaceReceiver<'_> {

Type::Infer(_) | Type::Never(_) | Type::Verbatim(_) => {}

#[cfg(test)]
Type::__TestExhaustive(_) => unimplemented!(),
#[cfg(not(test))]
#[cfg_attr(all(test, exhaustive), deny(non_exhaustive_omitted_patterns))]
_ => {}
}
}
Expand Down
1 change: 1 addition & 0 deletions serde_derive/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@
clippy::use_self,
clippy::wildcard_imports
)]
#![cfg_attr(all(test, exhaustive), feature(non_exhaustive_omitted_patterns_lint))]

#[macro_use]
extern crate quote;
Expand Down
2 changes: 1 addition & 1 deletion serde_derive_internals/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ path = "lib.rs"
[dependencies]
proc-macro2 = "1.0"
quote = "1.0"
syn = { version = "1.0.60", default-features = false, features = ["derive", "parsing", "printing", "clone-impls"] }
syn = { version = "1.0.90", default-features = false, features = ["derive", "parsing", "printing", "clone-impls"] }

[package.metadata.docs.rs]
targets = ["x86_64-unknown-linux-gnu"]

0 comments on commit b23a768

Please sign in to comment.