From ce0844b9ecc32377b5e4545d759d385a8c46bc6a Mon Sep 17 00:00:00 2001 From: David Tolnay Date: Fri, 26 Mar 2021 23:28:07 -0400 Subject: [PATCH 01/12] Suppress match_wildcard_for_single_variants clippy false positive https://github.com/rust-lang/rust-clippy/issues/6984 error: wildcard matches only a single variant and will also match any future added variants --> serde_derive/src/internals/attr.rs:1918:9 | 1918 | _ => {} | ^ help: try this: `syn::Type::__TestExhaustive(_)` | note: the lint level is defined here --> serde_derive/src/lib.rs:18:22 | 18 | #![deny(clippy::all, clippy::pedantic)] | ^^^^^^^^^^^^^^^^ = note: `#[deny(clippy::match_wildcard_for_single_variants)]` implied by `#[deny(clippy::pedantic)]` = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#match_wildcard_for_single_variants error: wildcard matches only a single variant and will also match any future added variants --> serde_derive/src/internals/receiver.rs:153:13 | 153 | _ => {} | ^ help: try this: `Type::__TestExhaustive(_)` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#match_wildcard_for_single_variants error: wildcard matches only a single variant and will also match any future added variants --> serde_derive/src/bound.rs:190:17 | 190 | _ => {} | ^ help: try this: `syn::Type::__TestExhaustive(_)` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#match_wildcard_for_single_variants --- serde_derive/src/lib.rs | 2 ++ serde_derive_internals/lib.rs | 2 ++ 2 files changed, 4 insertions(+) diff --git a/serde_derive/src/lib.rs b/serde_derive/src/lib.rs index 84728f123..446f19722 100644 --- a/serde_derive/src/lib.rs +++ b/serde_derive/src/lib.rs @@ -43,6 +43,8 @@ clippy::let_underscore_drop, clippy::map_err_ignore, clippy::match_same_arms, + // clippy bug: https://github.com/rust-lang/rust-clippy/issues/6984 + clippy::match_wildcard_for_single_variants, clippy::module_name_repetitions, clippy::must_use_candidate, clippy::option_if_let_else, diff --git a/serde_derive_internals/lib.rs b/serde_derive_internals/lib.rs index fe67d1f46..2e36229b4 100644 --- a/serde_derive_internals/lib.rs +++ b/serde_derive_internals/lib.rs @@ -22,6 +22,8 @@ clippy::items_after_statements, clippy::let_underscore_drop, clippy::match_same_arms, + // clippy bug: https://github.com/rust-lang/rust-clippy/issues/6984 + clippy::match_wildcard_for_single_variants, clippy::missing_errors_doc, clippy::module_name_repetitions, clippy::must_use_candidate, From 6c3bf7a2fc0a01b0598dece7deecc435425bfba8 Mon Sep 17 00:00:00 2001 From: David Tolnay Date: Thu, 8 Apr 2021 20:07:19 -0700 Subject: [PATCH 02/12] Ignore poor suggestion from branches_sharing_code lint https://github.com/rust-lang/rust-clippy/issues/7054 error: all if blocks contain the same code at the end --> serde_derive/src/de.rs:2160:5 | 2160 | / &fallthrough_arm_tokens 2161 | | }; | |_____^ | note: the lint level is defined here --> serde_derive/src/lib.rs:18:9 | 18 | #![deny(clippy::all, clippy::pedantic)] | ^^^^^^^^^^^ = note: `#[deny(clippy::branches_sharing_code)]` implied by `#[deny(clippy::all)]` = note: The end suggestion probably needs some adjustments to use the expression result correctly = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#branches_sharing_code help: consider moving the end statements out like this | 2160 | } 2161 | &fallthrough_arm_tokens; | --- serde_derive/src/lib.rs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/serde_derive/src/lib.rs b/serde_derive/src/lib.rs index 446f19722..a63405b5d 100644 --- a/serde_derive/src/lib.rs +++ b/serde_derive/src/lib.rs @@ -18,6 +18,8 @@ #![deny(clippy::all, clippy::pedantic)] // Ignored clippy lints #![allow( + // clippy false positive: https://github.com/rust-lang/rust-clippy/issues/7054 + clippy::branches_sharing_code, clippy::cognitive_complexity, clippy::enum_variant_names, // clippy bug: https://github.com/rust-lang/rust-clippy/issues/6797 From b53ebef438eabc53a316341bd9d7965dfbd9ee84 Mon Sep 17 00:00:00 2001 From: David Tolnay Date: Thu, 8 Apr 2021 20:08:16 -0700 Subject: [PATCH 03/12] Resolve safe_packed_borrows lint renamed to unaligned_references warning: lint `safe_packed_borrows` has been renamed to `unaligned_references` --> test_suite/tests/test_macros.rs:1926:8 | 1926 | #[deny(safe_packed_borrows)] | ^^^^^^^^^^^^^^^^^^^ help: use the new name: `unaligned_references` | = note: `#[warn(renamed_and_removed_lints)]` on by default --- test_suite/tests/test_macros.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test_suite/tests/test_macros.rs b/test_suite/tests/test_macros.rs index a6f130272..fea59e0e6 100644 --- a/test_suite/tests/test_macros.rs +++ b/test_suite/tests/test_macros.rs @@ -1923,7 +1923,7 @@ fn test_internally_tagged_newtype_variant_containing_unit_struct() { ); } -#[deny(safe_packed_borrows)] +#[deny(unaligned_references)] #[test] fn test_packed_struct_can_derive_serialize() { #[derive(Copy, Clone, Serialize)] From dc4c31eb50a0abec7be55daf08491f979a72fc85 Mon Sep 17 00:00:00 2001 From: David Tolnay Date: Fri, 9 Apr 2021 14:15:58 -0700 Subject: [PATCH 04/12] Build using relative path in repo if Windows lost symlink --- serde_derive_internals/build.rs | 12 ++++++++++++ serde_derive_internals/lib.rs | 3 ++- 2 files changed, 14 insertions(+), 1 deletion(-) create mode 100644 serde_derive_internals/build.rs diff --git a/serde_derive_internals/build.rs b/serde_derive_internals/build.rs new file mode 100644 index 000000000..b2a2d04ab --- /dev/null +++ b/serde_derive_internals/build.rs @@ -0,0 +1,12 @@ +use std::path::Path; + +fn main() { + // Sometimes on Windows the git checkout does not correctly wire up the + // symlink from serde_derive_internals/src to serde_derive/src/internals. + // When this happens we'll just build based on relative paths within the git + // repo. + let mod_behind_symlink = Path::new("src/mod.rs"); + if !mod_behind_symlink.exists() { + println!("cargo:rustc-cfg=serde_build_from_git"); + } +} diff --git a/serde_derive_internals/lib.rs b/serde_derive_internals/lib.rs index 2e36229b4..5c5abdffe 100644 --- a/serde_derive_internals/lib.rs +++ b/serde_derive_internals/lib.rs @@ -40,7 +40,8 @@ extern crate syn; extern crate proc_macro2; extern crate quote; -#[path = "src/mod.rs"] +#[cfg_attr(serde_build_from_git, path = "../serde_derive/src/internals/mod.rs")] +#[cfg_attr(not(serde_build_from_git), path = "src/mod.rs")] mod internals; pub use internals::*; From 7aa4950504e64dc3987f0c69718d97b4b106d650 Mon Sep 17 00:00:00 2001 From: David Tolnay Date: Fri, 9 Apr 2021 14:23:13 -0700 Subject: [PATCH 05/12] Release serde_derive_internals 0.26.0 --- serde_derive_internals/Cargo.toml | 2 +- serde_derive_internals/lib.rs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/serde_derive_internals/Cargo.toml b/serde_derive_internals/Cargo.toml index 81c9e20d5..fea1b474e 100644 --- a/serde_derive_internals/Cargo.toml +++ b/serde_derive_internals/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "serde_derive_internals" -version = "0.25.0" # remember to update html_root_url +version = "0.26.0" # remember to update html_root_url authors = ["Erick Tryzelaar ", "David Tolnay "] license = "MIT OR Apache-2.0" description = "AST representation used by Serde derive macros. Unstable." diff --git a/serde_derive_internals/lib.rs b/serde_derive_internals/lib.rs index 5c5abdffe..1f8ff187b 100644 --- a/serde_derive_internals/lib.rs +++ b/serde_derive_internals/lib.rs @@ -1,4 +1,4 @@ -#![doc(html_root_url = "https://docs.rs/serde_derive_internals/0.25.0")] +#![doc(html_root_url = "https://docs.rs/serde_derive_internals/0.26.0")] #![allow(unknown_lints, bare_trait_objects)] #![deny(clippy::all, clippy::pedantic)] // Ignored clippy lints From c17c4eef1872a4e864198d03c94760f050f6edcf Mon Sep 17 00:00:00 2001 From: David Tolnay Date: Mon, 19 Apr 2021 19:54:56 -0700 Subject: [PATCH 06/12] Unify stable and beta CI workflow --- .github/workflows/ci.yml | 19 ++++++++----------- 1 file changed, 8 insertions(+), 11 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 22b778b96..ab3041616 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -23,25 +23,22 @@ jobs: - run: cd test_suite && cargo test --features unstable -- --skip ui --exact stable: - name: Rust stable + name: Rust ${{matrix.rust}} runs-on: ubuntu-latest + strategy: + fail-fast: false + matrix: + rust: [stable, beta] steps: - uses: actions/checkout@v2 - - uses: dtolnay/rust-toolchain@stable + - uses: dtolnay/rust-toolchain@master + with: + toolchain: ${{matrix.rust}} - run: cd serde && cargo build --features rc - run: cd serde && cargo build --no-default-features - run: cd serde_test && cargo build - run: cd serde_test && cargo test --features serde/derive,serde/rc - beta: - name: Rust beta - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v2 - - uses: dtolnay/rust-toolchain@beta - - run: cd serde && cargo build --features rc - - run: cd test_suite && cargo test - nightly: name: Rust nightly ${{matrix.os == 'windows' && '(windows)' || ''}} runs-on: ${{matrix.os}}-latest From 2ebc771b881bb1529b6e4baec71b477d4bebccde Mon Sep 17 00:00:00 2001 From: David Tolnay Date: Mon, 19 Apr 2021 19:36:06 -0700 Subject: [PATCH 07/12] Remove non_ascii_idents feature gate from test suite error: the feature `non_ascii_idents` has been stable since 1.53.0 and no longer requires an attribute to enable --> test_suite/tests/test_gen.rs:6:43 | 6 | #![cfg_attr(feature = "unstable", feature(non_ascii_idents))] | ^^^^^^^^^^^^^^^^ | note: the lint level is defined here --> test_suite/tests/test_gen.rs:5:9 | 5 | #![deny(warnings)] | ^^^^^^^^ = note: `#[deny(stable_features)]` implied by `#[deny(warnings)]` --- test_suite/tests/test_gen.rs | 2 -- 1 file changed, 2 deletions(-) diff --git a/test_suite/tests/test_gen.rs b/test_suite/tests/test_gen.rs index 002885ead..309b164b1 100644 --- a/test_suite/tests/test_gen.rs +++ b/test_suite/tests/test_gen.rs @@ -3,7 +3,6 @@ // types involved. #![deny(warnings)] -#![cfg_attr(feature = "unstable", feature(non_ascii_idents))] #![allow( unknown_lints, mixed_script_confusables, @@ -267,7 +266,6 @@ fn test_gen() { } assert::(); - #[cfg(feature = "unstable")] #[derive(Serialize, Deserialize)] struct NonAsciiIdents { σ: f64, From 1093f7e2325398288f4c1ea116a7b6cfcc5b282f Mon Sep 17 00:00:00 2001 From: David Tolnay Date: Sat, 24 Apr 2021 19:23:12 -0700 Subject: [PATCH 08/12] Resolve flat_map_option pedantic clippy lint error: used `flat_map` where `filter_map` could be used instead --> serde_derive/src/bound.rs:52:10 | 52 | .flat_map(|field| from_field(&field.attrs)) | ^^^^^^^^ help: try: `filter_map` | note: the lint level is defined here --> serde_derive/src/lib.rs:18:22 | 18 | #![deny(clippy::all, clippy::pedantic)] | ^^^^^^^^^^^^^^^^ = note: `#[deny(clippy::flat_map_option)]` implied by `#[deny(clippy::pedantic)]` = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#flat_map_option error: used `flat_map` where `filter_map` could be used instead --> serde_derive/src/bound.rs:74:10 | 74 | .flat_map(|variant| from_variant(&variant.attrs)) | ^^^^^^^^ help: try: `filter_map` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#flat_map_option --- serde_derive/src/bound.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/serde_derive/src/bound.rs b/serde_derive/src/bound.rs index 0949dfc5d..6d7402cb4 100644 --- a/serde_derive/src/bound.rs +++ b/serde_derive/src/bound.rs @@ -49,7 +49,7 @@ pub fn with_where_predicates_from_fields( let predicates = cont .data .all_fields() - .flat_map(|field| from_field(&field.attrs)) + .filter_map(|field| from_field(&field.attrs)) .flat_map(|predicates| predicates.to_vec()); let mut generics = generics.clone(); @@ -71,7 +71,7 @@ pub fn with_where_predicates_from_variants( let predicates = variants .iter() - .flat_map(|variant| from_variant(&variant.attrs)) + .filter_map(|variant| from_variant(&variant.attrs)) .flat_map(|predicates| predicates.to_vec()); let mut generics = generics.clone(); From 1120e5af4aa6fd2269459137f01f3b60dcd080eb Mon Sep 17 00:00:00 2001 From: David Tolnay Date: Sat, 24 Apr 2021 19:23:54 -0700 Subject: [PATCH 09/12] Remove suppression of removed clippy lint warning: lint `clippy::filter_map` has been removed: this lint has been replaced by `manual_filter_map`, a more specific lint --> serde_derive/src/lib.rs:42:5 | 42 | clippy::filter_map, | ^^^^^^^^^^^^^^^^^^ | = note: `#[warn(renamed_and_removed_lints)]` on by default warning: lint `clippy::filter_map` has been removed: this lint has been replaced by `manual_filter_map`, a more specific lint --> serde_derive/src/lib.rs:42:5 | 42 | clippy::filter_map, | ^^^^^^^^^^^^^^^^^^ --- serde_derive/src/lib.rs | 1 - 1 file changed, 1 deletion(-) diff --git a/serde_derive/src/lib.rs b/serde_derive/src/lib.rs index a63405b5d..3f1f6f5df 100644 --- a/serde_derive/src/lib.rs +++ b/serde_derive/src/lib.rs @@ -39,7 +39,6 @@ clippy::checked_conversions, clippy::doc_markdown, clippy::enum_glob_use, - clippy::filter_map, clippy::indexing_slicing, clippy::items_after_statements, clippy::let_underscore_drop, From 6366f17da719a0efa5117c780fdd5469b903929d Mon Sep 17 00:00:00 2001 From: David Tolnay Date: Sat, 24 Apr 2021 19:26:12 -0700 Subject: [PATCH 10/12] Ignore clone_instead_of_copied pedantic clippy lint Iterator::copied was introduced in Rust 1.35, whereas serde_test currently supports a minimum compiler version of 1.13. error: used `cloned` where `copied` could be used instead --> serde_test/src/de.rs:49:29 | 49 | self.tokens.first().cloned() | ^^^^^^ help: try: `copied` | note: the lint level is defined here --> serde_test/src/lib.rs:149:52 | 149 | #![cfg_attr(feature = "cargo-clippy", deny(clippy, clippy_pedantic))] | ^^^^^^^^^^^^^^^ = note: `#[deny(clippy::cloned_instead_of_copied)]` implied by `#[deny(clippy::pedantic)]` = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#cloned_instead_of_copied --- serde_test/src/lib.rs | 1 + 1 file changed, 1 insertion(+) diff --git a/serde_test/src/lib.rs b/serde_test/src/lib.rs index a925c916d..d39505276 100644 --- a/serde_test/src/lib.rs +++ b/serde_test/src/lib.rs @@ -153,6 +153,7 @@ #![cfg_attr( feature = "cargo-clippy", allow( + cloned_instead_of_copied, empty_line_after_outer_attr, missing_docs_in_private_items, missing_panics_doc, From dd29825217e0bb91a82687847509758f377c4ad8 Mon Sep 17 00:00:00 2001 From: hyd-dev Date: Wed, 12 May 2021 18:29:28 +0800 Subject: [PATCH 11/12] Allow only `unused_extern_crates` instead of the whole `rust_2018_idioms` lint group in `serde_derive`-generated code --- serde_derive/src/dummy.rs | 2 +- test_suite/tests/expand/de_enum.expanded.rs | 4 ++-- test_suite/tests/expand/default_ty_param.expanded.rs | 4 ++-- test_suite/tests/expand/generic_enum.expanded.rs | 4 ++-- test_suite/tests/expand/generic_struct.expanded.rs | 8 ++++---- test_suite/tests/expand/generic_tuple_struct.expanded.rs | 2 +- test_suite/tests/expand/lifetimes.expanded.rs | 4 ++-- test_suite/tests/expand/named_map.expanded.rs | 4 ++-- test_suite/tests/expand/named_tuple.expanded.rs | 4 ++-- test_suite/tests/expand/named_unit.expanded.rs | 4 ++-- test_suite/tests/expand/ser_enum.expanded.rs | 2 +- test_suite/tests/expand/void.expanded.rs | 4 ++-- 12 files changed, 23 insertions(+), 23 deletions(-) diff --git a/serde_derive/src/dummy.rs b/serde_derive/src/dummy.rs index 9a4e5f085..29de26012 100644 --- a/serde_derive/src/dummy.rs +++ b/serde_derive/src/dummy.rs @@ -23,7 +23,7 @@ pub fn wrap_in_const( use #path as _serde; }, None => quote! { - #[allow(rust_2018_idioms, clippy::useless_attribute)] + #[allow(unused_extern_crates, clippy::useless_attribute)] extern crate serde as _serde; }, }; diff --git a/test_suite/tests/expand/de_enum.expanded.rs b/test_suite/tests/expand/de_enum.expanded.rs index 0aa879e75..4ea3b8383 100644 --- a/test_suite/tests/expand/de_enum.expanded.rs +++ b/test_suite/tests/expand/de_enum.expanded.rs @@ -10,7 +10,7 @@ enum DeEnum { #[doc(hidden)] #[allow(non_upper_case_globals, unused_attributes, unused_qualifications)] const _: () = { - #[allow(rust_2018_idioms, clippy::useless_attribute)] + #[allow(unused_extern_crates, clippy::useless_attribute)] extern crate serde as _serde; #[automatically_derived] impl _serde::Serialize for DeEnum @@ -265,7 +265,7 @@ const _: () = { #[doc(hidden)] #[allow(non_upper_case_globals, unused_attributes, unused_qualifications)] const _: () = { - #[allow(rust_2018_idioms, clippy::useless_attribute)] + #[allow(unused_extern_crates, clippy::useless_attribute)] extern crate serde as _serde; #[automatically_derived] impl<'de, B, C, D> _serde::Deserialize<'de> for DeEnum diff --git a/test_suite/tests/expand/default_ty_param.expanded.rs b/test_suite/tests/expand/default_ty_param.expanded.rs index d24ce254b..829e65e8e 100644 --- a/test_suite/tests/expand/default_ty_param.expanded.rs +++ b/test_suite/tests/expand/default_ty_param.expanded.rs @@ -11,7 +11,7 @@ struct DefaultTyParam = i32> { #[doc(hidden)] #[allow(non_upper_case_globals, unused_attributes, unused_qualifications)] const _: () = { - #[allow(rust_2018_idioms, clippy::useless_attribute)] + #[allow(unused_extern_crates, clippy::useless_attribute)] extern crate serde as _serde; #[automatically_derived] impl> _serde::Serialize for DefaultTyParam { @@ -49,7 +49,7 @@ const _: () = { #[doc(hidden)] #[allow(non_upper_case_globals, unused_attributes, unused_qualifications)] const _: () = { - #[allow(rust_2018_idioms, clippy::useless_attribute)] + #[allow(unused_extern_crates, clippy::useless_attribute)] extern crate serde as _serde; #[automatically_derived] impl<'de, T: AssociatedType> _serde::Deserialize<'de> for DefaultTyParam { diff --git a/test_suite/tests/expand/generic_enum.expanded.rs b/test_suite/tests/expand/generic_enum.expanded.rs index d2d8658d7..a4ad31094 100644 --- a/test_suite/tests/expand/generic_enum.expanded.rs +++ b/test_suite/tests/expand/generic_enum.expanded.rs @@ -8,7 +8,7 @@ pub enum GenericEnum { #[doc(hidden)] #[allow(non_upper_case_globals, unused_attributes, unused_qualifications)] const _: () = { - #[allow(rust_2018_idioms, clippy::useless_attribute)] + #[allow(unused_extern_crates, clippy::useless_attribute)] extern crate serde as _serde; #[automatically_derived] impl _serde::Serialize for GenericEnum @@ -114,7 +114,7 @@ const _: () = { #[doc(hidden)] #[allow(non_upper_case_globals, unused_attributes, unused_qualifications)] const _: () = { - #[allow(rust_2018_idioms, clippy::useless_attribute)] + #[allow(unused_extern_crates, clippy::useless_attribute)] extern crate serde as _serde; #[automatically_derived] impl<'de, T, U> _serde::Deserialize<'de> for GenericEnum diff --git a/test_suite/tests/expand/generic_struct.expanded.rs b/test_suite/tests/expand/generic_struct.expanded.rs index d57460c3b..bb16dc3b2 100644 --- a/test_suite/tests/expand/generic_struct.expanded.rs +++ b/test_suite/tests/expand/generic_struct.expanded.rs @@ -5,7 +5,7 @@ pub struct GenericStruct { #[doc(hidden)] #[allow(non_upper_case_globals, unused_attributes, unused_qualifications)] const _: () = { - #[allow(rust_2018_idioms, clippy::useless_attribute)] + #[allow(unused_extern_crates, clippy::useless_attribute)] extern crate serde as _serde; #[automatically_derived] impl _serde::Serialize for GenericStruct @@ -42,7 +42,7 @@ const _: () = { #[doc(hidden)] #[allow(non_upper_case_globals, unused_attributes, unused_qualifications)] const _: () = { - #[allow(rust_2018_idioms, clippy::useless_attribute)] + #[allow(unused_extern_crates, clippy::useless_attribute)] extern crate serde as _serde; #[automatically_derived] impl<'de, T> _serde::Deserialize<'de> for GenericStruct @@ -410,7 +410,7 @@ pub struct GenericNewTypeStruct(T); #[doc(hidden)] #[allow(non_upper_case_globals, unused_attributes, unused_qualifications)] const _: () = { - #[allow(rust_2018_idioms, clippy::useless_attribute)] + #[allow(unused_extern_crates, clippy::useless_attribute)] extern crate serde as _serde; #[automatically_derived] impl _serde::Serialize for GenericNewTypeStruct @@ -435,7 +435,7 @@ const _: () = { #[doc(hidden)] #[allow(non_upper_case_globals, unused_attributes, unused_qualifications)] const _: () = { - #[allow(rust_2018_idioms, clippy::useless_attribute)] + #[allow(unused_extern_crates, clippy::useless_attribute)] extern crate serde as _serde; #[automatically_derived] impl<'de, T> _serde::Deserialize<'de> for GenericNewTypeStruct diff --git a/test_suite/tests/expand/generic_tuple_struct.expanded.rs b/test_suite/tests/expand/generic_tuple_struct.expanded.rs index f387b6af4..7012f9f40 100644 --- a/test_suite/tests/expand/generic_tuple_struct.expanded.rs +++ b/test_suite/tests/expand/generic_tuple_struct.expanded.rs @@ -3,7 +3,7 @@ pub struct GenericTupleStruct(T, U); #[doc(hidden)] #[allow(non_upper_case_globals, unused_attributes, unused_qualifications)] const _: () = { - #[allow(rust_2018_idioms, clippy::useless_attribute)] + #[allow(unused_extern_crates, clippy::useless_attribute)] extern crate serde as _serde; #[automatically_derived] impl<'de, T, U> _serde::Deserialize<'de> for GenericTupleStruct diff --git a/test_suite/tests/expand/lifetimes.expanded.rs b/test_suite/tests/expand/lifetimes.expanded.rs index f8ec1df75..cf2f00811 100644 --- a/test_suite/tests/expand/lifetimes.expanded.rs +++ b/test_suite/tests/expand/lifetimes.expanded.rs @@ -8,7 +8,7 @@ enum Lifetimes<'a> { #[doc(hidden)] #[allow(non_upper_case_globals, unused_attributes, unused_qualifications)] const _: () = { - #[allow(rust_2018_idioms, clippy::useless_attribute)] + #[allow(unused_extern_crates, clippy::useless_attribute)] extern crate serde as _serde; #[automatically_derived] impl<'a> _serde::Serialize for Lifetimes<'a> { @@ -95,7 +95,7 @@ const _: () = { #[doc(hidden)] #[allow(non_upper_case_globals, unused_attributes, unused_qualifications)] const _: () = { - #[allow(rust_2018_idioms, clippy::useless_attribute)] + #[allow(unused_extern_crates, clippy::useless_attribute)] extern crate serde as _serde; #[automatically_derived] impl<'de, 'a> _serde::Deserialize<'de> for Lifetimes<'a> { diff --git a/test_suite/tests/expand/named_map.expanded.rs b/test_suite/tests/expand/named_map.expanded.rs index 1a621b57f..e30ac34e4 100644 --- a/test_suite/tests/expand/named_map.expanded.rs +++ b/test_suite/tests/expand/named_map.expanded.rs @@ -7,7 +7,7 @@ struct SerNamedMap<'a, 'b, A: 'a, B: 'b, C> { #[doc(hidden)] #[allow(non_upper_case_globals, unused_attributes, unused_qualifications)] const _: () = { - #[allow(rust_2018_idioms, clippy::useless_attribute)] + #[allow(unused_extern_crates, clippy::useless_attribute)] extern crate serde as _serde; #[automatically_derived] impl<'a, 'b, A: 'a, B: 'b, C> _serde::Serialize for SerNamedMap<'a, 'b, A, B, C> @@ -63,7 +63,7 @@ struct DeNamedMap { #[doc(hidden)] #[allow(non_upper_case_globals, unused_attributes, unused_qualifications)] const _: () = { - #[allow(rust_2018_idioms, clippy::useless_attribute)] + #[allow(unused_extern_crates, clippy::useless_attribute)] extern crate serde as _serde; #[automatically_derived] impl<'de, A, B, C> _serde::Deserialize<'de> for DeNamedMap diff --git a/test_suite/tests/expand/named_tuple.expanded.rs b/test_suite/tests/expand/named_tuple.expanded.rs index 707ca0762..be083f633 100644 --- a/test_suite/tests/expand/named_tuple.expanded.rs +++ b/test_suite/tests/expand/named_tuple.expanded.rs @@ -3,7 +3,7 @@ struct SerNamedTuple<'a, 'b, A: 'a, B: 'b, C>(&'a A, &'b mut B, C); #[doc(hidden)] #[allow(non_upper_case_globals, unused_attributes, unused_qualifications)] const _: () = { - #[allow(rust_2018_idioms, clippy::useless_attribute)] + #[allow(unused_extern_crates, clippy::useless_attribute)] extern crate serde as _serde; #[automatically_derived] impl<'a, 'b, A: 'a, B: 'b, C> _serde::Serialize for SerNamedTuple<'a, 'b, A, B, C> @@ -55,7 +55,7 @@ struct DeNamedTuple(A, B, C); #[doc(hidden)] #[allow(non_upper_case_globals, unused_attributes, unused_qualifications)] const _: () = { - #[allow(rust_2018_idioms, clippy::useless_attribute)] + #[allow(unused_extern_crates, clippy::useless_attribute)] extern crate serde as _serde; #[automatically_derived] impl<'de, A, B, C> _serde::Deserialize<'de> for DeNamedTuple diff --git a/test_suite/tests/expand/named_unit.expanded.rs b/test_suite/tests/expand/named_unit.expanded.rs index 44329246d..87876b771 100644 --- a/test_suite/tests/expand/named_unit.expanded.rs +++ b/test_suite/tests/expand/named_unit.expanded.rs @@ -3,7 +3,7 @@ struct NamedUnit; #[doc(hidden)] #[allow(non_upper_case_globals, unused_attributes, unused_qualifications)] const _: () = { - #[allow(rust_2018_idioms, clippy::useless_attribute)] + #[allow(unused_extern_crates, clippy::useless_attribute)] extern crate serde as _serde; #[automatically_derived] impl _serde::Serialize for NamedUnit { @@ -21,7 +21,7 @@ const _: () = { #[doc(hidden)] #[allow(non_upper_case_globals, unused_attributes, unused_qualifications)] const _: () = { - #[allow(rust_2018_idioms, clippy::useless_attribute)] + #[allow(unused_extern_crates, clippy::useless_attribute)] extern crate serde as _serde; #[automatically_derived] impl<'de> _serde::Deserialize<'de> for NamedUnit { diff --git a/test_suite/tests/expand/ser_enum.expanded.rs b/test_suite/tests/expand/ser_enum.expanded.rs index 40b45e07f..b0a83ca3f 100644 --- a/test_suite/tests/expand/ser_enum.expanded.rs +++ b/test_suite/tests/expand/ser_enum.expanded.rs @@ -13,7 +13,7 @@ where #[doc(hidden)] #[allow(non_upper_case_globals, unused_attributes, unused_qualifications)] const _: () = { - #[allow(rust_2018_idioms, clippy::useless_attribute)] + #[allow(unused_extern_crates, clippy::useless_attribute)] extern crate serde as _serde; #[automatically_derived] impl<'a, B: 'a, C: 'a, D> _serde::Serialize for SerEnum<'a, B, C, D> diff --git a/test_suite/tests/expand/void.expanded.rs b/test_suite/tests/expand/void.expanded.rs index 65c3d2c60..35e6763d7 100644 --- a/test_suite/tests/expand/void.expanded.rs +++ b/test_suite/tests/expand/void.expanded.rs @@ -3,7 +3,7 @@ enum Void {} #[doc(hidden)] #[allow(non_upper_case_globals, unused_attributes, unused_qualifications)] const _: () = { - #[allow(rust_2018_idioms, clippy::useless_attribute)] + #[allow(unused_extern_crates, clippy::useless_attribute)] extern crate serde as _serde; #[automatically_derived] impl _serde::Serialize for Void { @@ -21,7 +21,7 @@ const _: () = { #[doc(hidden)] #[allow(non_upper_case_globals, unused_attributes, unused_qualifications)] const _: () = { - #[allow(rust_2018_idioms, clippy::useless_attribute)] + #[allow(unused_extern_crates, clippy::useless_attribute)] extern crate serde as _serde; #[automatically_derived] impl<'de> _serde::Deserialize<'de> for Void { From d9c338ec4abd1dd6fdd305e208bff1fd7faaabff Mon Sep 17 00:00:00 2001 From: David Tolnay Date: Wed, 12 May 2021 10:18:26 -0700 Subject: [PATCH 12/12] Release 1.0.126 --- serde/Cargo.toml | 4 ++-- serde/src/lib.rs | 2 +- serde_derive/Cargo.toml | 2 +- serde_derive/src/lib.rs | 2 +- serde_test/Cargo.toml | 2 +- serde_test/src/lib.rs | 2 +- 6 files changed, 7 insertions(+), 7 deletions(-) diff --git a/serde/Cargo.toml b/serde/Cargo.toml index 6488d903c..9f4f5de98 100644 --- a/serde/Cargo.toml +++ b/serde/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "serde" -version = "1.0.125" # remember to update html_root_url and serde_derive dependency +version = "1.0.126" # remember to update html_root_url and serde_derive dependency authors = ["Erick Tryzelaar ", "David Tolnay "] license = "MIT OR Apache-2.0" description = "A generic serialization/deserialization framework" @@ -14,7 +14,7 @@ include = ["build.rs", "src/**/*.rs", "crates-io.md", "README.md", "LICENSE-APAC build = "build.rs" [dependencies] -serde_derive = { version = "=1.0.125", optional = true, path = "../serde_derive" } +serde_derive = { version = "=1.0.126", optional = true, path = "../serde_derive" } [dev-dependencies] serde_derive = { version = "1.0", path = "../serde_derive" } diff --git a/serde/src/lib.rs b/serde/src/lib.rs index 5c07ece21..fd473b370 100644 --- a/serde/src/lib.rs +++ b/serde/src/lib.rs @@ -84,7 +84,7 @@ //////////////////////////////////////////////////////////////////////////////// // Serde types in rustdoc of other crates get linked to here. -#![doc(html_root_url = "https://docs.rs/serde/1.0.125")] +#![doc(html_root_url = "https://docs.rs/serde/1.0.126")] // Support using Serde without the standard library! #![cfg_attr(not(feature = "std"), no_std)] // Unstable functionality only if the user asks for it. For tracking and diff --git a/serde_derive/Cargo.toml b/serde_derive/Cargo.toml index 0f6624155..d19254744 100644 --- a/serde_derive/Cargo.toml +++ b/serde_derive/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "serde_derive" -version = "1.0.125" # remember to update html_root_url +version = "1.0.126" # remember to update html_root_url authors = ["Erick Tryzelaar ", "David Tolnay "] license = "MIT OR Apache-2.0" description = "Macros 1.1 implementation of #[derive(Serialize, Deserialize)]" diff --git a/serde_derive/src/lib.rs b/serde_derive/src/lib.rs index 3f1f6f5df..8daa36e70 100644 --- a/serde_derive/src/lib.rs +++ b/serde_derive/src/lib.rs @@ -13,7 +13,7 @@ //! //! [https://serde.rs/derive.html]: https://serde.rs/derive.html -#![doc(html_root_url = "https://docs.rs/serde_derive/1.0.125")] +#![doc(html_root_url = "https://docs.rs/serde_derive/1.0.126")] #![allow(unknown_lints, bare_trait_objects)] #![deny(clippy::all, clippy::pedantic)] // Ignored clippy lints diff --git a/serde_test/Cargo.toml b/serde_test/Cargo.toml index 68028c79e..0237d1816 100644 --- a/serde_test/Cargo.toml +++ b/serde_test/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "serde_test" -version = "1.0.125" # remember to update html_root_url +version = "1.0.126" # remember to update html_root_url authors = ["Erick Tryzelaar ", "David Tolnay "] license = "MIT OR Apache-2.0" description = "Token De/Serializer for testing De/Serialize implementations" diff --git a/serde_test/src/lib.rs b/serde_test/src/lib.rs index d39505276..c29d31741 100644 --- a/serde_test/src/lib.rs +++ b/serde_test/src/lib.rs @@ -144,7 +144,7 @@ //! # } //! ``` -#![doc(html_root_url = "https://docs.rs/serde_test/1.0.125")] +#![doc(html_root_url = "https://docs.rs/serde_test/1.0.126")] #![cfg_attr(feature = "cargo-clippy", allow(renamed_and_removed_lints))] #![cfg_attr(feature = "cargo-clippy", deny(clippy, clippy_pedantic))] // Ignored clippy lints