Update exhaustive matching to syn 1.0.90

This commit is contained in:
David Tolnay 2022-03-28 10:07:23 -07:00
parent 7e19ae8c94
commit b23a768414
No known key found for this signature in database
GPG Key ID: F9BA143B95FF6D82
7 changed files with 10 additions and 11 deletions

View File

@ -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

View File

@ -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" }

View File

@ -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))]
_ => {}
}
}

View File

@ -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))]
_ => {}
}
}

View File

@ -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))]
_ => {}
}
}

View File

@ -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;

View File

@ -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"]