Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fork Sync: Update from parent repository #64

Open
wants to merge 295 commits into
base: master
Choose a base branch
from

Conversation

github-actions[bot]
Copy link

No description provided.

dtolnay and others added 30 commits December 30, 2023 14:46
Remove option_if_let_else clippy suppression
    warning: the lint level must be set on the whole match
        --> serde_derive/src/internals/attr.rs:1855:9
         |
    1854 |         #[cfg_attr(all(test, exhaustive), deny(non_exhaustive_omitted_patterns))]
         |                                                ------------------------------- remove this attribute
    1855 |         _ => {}
         |         ^
         |
         = help: it no longer has any effect to set the lint level on an individual match arm
    help: set the lint level on the whole match
         |
    1796 +     #[deny(non_exhaustive_omitted_patterns)]
    1797 |     match ty {
         |

    warning: the lint level must be set on the whole match
       --> serde_derive/src/internals/receiver.rs:151:13
        |
    150 |             #[cfg_attr(all(test, exhaustive), deny(non_exhaustive_omitted_patterns))]
        |                                                    ------------------------------- remove this attribute
    151 |             _ => {}
        |             ^
        |
        = help: it no longer has any effect to set the lint level on an individual match arm
    help: set the lint level on the whole match
        |
    109 +         #[deny(non_exhaustive_omitted_patterns)]
    110 |         match ty {
        |

    warning: the lint level must be set on the whole match
       --> serde_derive/src/internals/receiver.rs:188:25
        |
    187 |                         #[cfg_attr(all(test, exhaustive), deny(non_exhaustive_omitted_patterns))]
        |                                                                ------------------------------- remove this attribute
    188 |                         _ => {}
        |                         ^
        |
        = help: it no longer has any effect to set the lint level on an individual match arm
    help: set the lint level on the whole match
        |
    180 +                     #[deny(non_exhaustive_omitted_patterns)]
    181 |                     match arg {
        |

    warning: the lint level must be set on the whole match
       --> serde_derive/src/internals/receiver.rs:213:13
        |
    212 |             #[cfg_attr(all(test, exhaustive), deny(non_exhaustive_omitted_patterns))]
        |                                                    ------------------------------- remove this attribute
    213 |             _ => {}
        |             ^
        |
        = help: it no longer has any effect to set the lint level on an individual match arm
    help: set the lint level on the whole match
        |
    209 +         #[deny(non_exhaustive_omitted_patterns)]
    210 |         match bound {
        |

    warning: the lint level must be set on the whole match
       --> serde_derive/src/internals/receiver.rs:239:21
        |
    238 |                     #[cfg_attr(all(test, exhaustive), deny(non_exhaustive_omitted_patterns))]
        |                                                            ------------------------------- remove this attribute
    239 |                     _ => {}
        |                     ^
        |
        = help: it no longer has any effect to set the lint level on an individual match arm
    help: set the lint level on the whole match
        |
    230 +                 #[deny(non_exhaustive_omitted_patterns)]
    231 |                 match predicate {
        |

    warning: the lint level must be set on the whole match
       --> serde_derive/src/bound.rs:185:17
        |
    184 |                 #[cfg_attr(all(test, exhaustive), deny(non_exhaustive_omitted_patterns))]
        |                                                        ------------------------------- remove this attribute
    185 |                 _ => {}
        |                 ^
        |
        = help: it no longer has any effect to set the lint level on an individual match arm
    help: set the lint level on the whole match
        |
    146 +             #[deny(non_exhaustive_omitted_patterns)]
    147 |             match ty {
        |

    warning: the lint level must be set on the whole match
       --> serde_derive/src/bound.rs:209:29
        |
    207 | ...                       deny(non_exhaustive_omitted_patterns)
        |                                ------------------------------- remove this attribute
    208 | ...                   )]
    209 | ...                   _ => {}
        |                       ^
        |
        = help: it no longer has any effect to set the lint level on an individual match arm
    help: set the lint level on the whole match
        |
    198 +                         #[deny(non_exhaustive_omitted_patterns)]
    199 |                         match arg {
        |

    warning: the lint level must be set on the whole match
       --> serde_derive/src/bound.rs:234:17
        |
    233 |                 #[cfg_attr(all(test, exhaustive), deny(non_exhaustive_omitted_patterns))]
        |                                                        ------------------------------- remove this attribute
    234 |                 _ => {}
        |                 ^
        |
        = help: it no longer has any effect to set the lint level on an individual match arm
    help: set the lint level on the whole match
        |
    230 +             #[deny(non_exhaustive_omitted_patterns)]
    231 |             match bound {
        |
    error: some variants are not matched explicitly
        --> serde_derive/src/internals/attr.rs:1823:31
         |
    1823 |                         match arg {
         |                               ^^^ patterns `&GenericArgument::Const(_)`, `&GenericArgument::AssocConst(_)` and `&GenericArgument::Constraint(_)` not covered
         |
         = help: ensure that all variants are matched explicitly by adding the suggested match arms
         = note: the matched value is of type `&GenericArgument` and the `non_exhaustive_omitted_patterns` attribute was found
    note: the lint level is defined here
        --> serde_derive/src/internals/attr.rs:1797:49
         |
    1797 |         #![cfg_attr(all(test, exhaustive), deny(non_exhaustive_omitted_patterns))]
         |                                                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Pick up changes to non_exhaustive_omitted_patterns lint
    error: field `0` is never read
       --> test_suite/tests/test_gen.rs:690:33
        |
    690 |         Single(#[serde(borrow)] RelObject<'a>),
        |         ------                  ^^^^^^^^^^^^^
        |         |
        |         field in this variant
        |
    help: consider changing the field to be of unit type to suppress this warning while preserving the field numbering, or remove the field
        |
    690 |         Single(#[serde(borrow)] ()),
        |                                 ~~

    error: field `0` is never read
       --> test_suite/tests/test_gen.rs:691:31
        |
    691 |         Many(#[serde(borrow)] Vec<RelObject<'a>>),
        |         ----                  ^^^^^^^^^^^^^^^^^^
        |         |
        |         field in this variant
        |
    help: consider changing the field to be of unit type to suppress this warning while preserving the field numbering, or remove the field
        |
    691 |         Many(#[serde(borrow)] ()),
        |                               ~~
    warning: field `0` is never read
       --> test_suite/tests/test_remote.rs:143:24
        |
    143 | struct PrimitivePubDef(u8);
        |        --------------- ^^
        |        |
        |        field in this struct
        |
        = note: `#[warn(dead_code)]` on by default
    help: consider changing the field to be of unit type to suppress this warning while preserving the field numbering, or remove the field
        |
    143 | struct PrimitivePubDef(());
        |                        ~~

    warning: field `0` is never read
       --> test_suite/tests/test_remote.rs:162:20
        |
    162 | struct TuplePubDef(u8, #[serde(with = "UnitDef")] remote::Unit);
        |        ----------- ^^
        |        |
        |        field in this struct
        |
    help: consider changing the field to be of unit type to suppress this warning while preserving the field numbering, or remove the field
        |
    162 | struct TuplePubDef((), #[serde(with = "UnitDef")] remote::Unit);
        |                    ~~

    warning: field `0` is never read
       --> test_suite/tests/test_remote.rs:200:13
        |
    200 |     Variant(u8),
        |     ------- ^^
        |     |
        |     field in this variant
        |
    help: consider changing the field to be of unit type to suppress this warning while preserving the field numbering, or remove the field
        |
    200 |     Variant(()),
        |             ~~

    error: field `0` is never read
       --> test_suite/tests/test_gen.rs:390:23
        |
    390 |     struct StrDef<'a>(&'a str);
        |            ------     ^^^^^^^
        |            |
        |            field in this struct
        |
    note: the lint level is defined here
       --> test_suite/tests/test_gen.rs:5:9
        |
    5   | #![deny(warnings)]
        |         ^^^^^^^^
        = note: `#[deny(dead_code)]` implied by `#[deny(warnings)]`
    help: consider changing the field to be of unit type to suppress this warning while preserving the field numbering, or remove the field
        |
    390 |     struct StrDef<'a>(());
        |                       ~~
Fix new dead_code warning in tuple struct and tuple variant remote defs
Use shields.io's MSRV badges
    warning: serde_derive_internals/Cargo.toml: `default-features` is
    ignored for syn, since `default-features` was not specified for
    `workspace.dependencies.syn`, this could become a hard error in the
    future
Fix workspace.dependencies default-features future compat warning
Format Unexpected::Float with decimal point
    warning: trait `AssertNotSerdeSerialize` is never used
      --> test_suite/tests/test_serde_path.rs:39:7
       |
    39 | trait AssertNotSerdeSerialize {}
       |       ^^^^^^^^^^^^^^^^^^^^^^^
       |
       = note: `#[warn(dead_code)]` on by default

    warning: trait `AssertNotSerdeDeserialize` is never used
      --> test_suite/tests/test_serde_path.rs:43:7
       |
    43 | trait AssertNotSerdeDeserialize<'a> {}
       |       ^^^^^^^^^^^^^^^^^^^^^^^^^

    warning: method `serialize` is never used
      --> test_suite/tests/test_serde_path.rs:31:12
       |
    30 |     pub trait Serialize {
       |               --------- method in this trait
    31 |         fn serialize<S: Serializer>(&self, serializer: S) -> Result<S::Ok, S::Error>;
       |            ^^^^^^^^^

    warning: associated function `deserialize` is never used
      --> test_suite/tests/test_serde_path.rs:35:12
       |
    34 |     pub trait Deserialize<'a>: Sized {
       |               ----------- associated function in this trait
    35 |         fn deserialize<D: Deserializer<'a>>(deserializer: D) -> Result<Self, D::Error>;
       |            ^^^^^^^^^^^
    warning: current MSRV (Minimum Supported Rust Version) is `1.31.0` but this item is stable since `1.35.0`
       --> serde/src/de/impls.rs:200:39
        |
    200 |                   Ok((v as Self::Value).copysign(sign))
        |                                         ^^^^^^^^^^^^^^
    ...
    374 | / impl_deserialize_num! {
    375 | |     f32, deserialize_f32
    376 | |     num_self!(f32:visit_f32);
    377 | |     num_as_copysign_self!(f64:visit_f64);
    378 | |     num_as_self!(i8:visit_i8 i16:visit_i16 i32:visit_i32 i64:visit_i64);
    379 | |     num_as_self!(u8:visit_u8 u16:visit_u16 u32:visit_u32 u64:visit_u64);
    380 | | }
        | |_- in this macro invocation
        |
        = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#incompatible_msrv
        = note: `-W clippy::incompatible-msrv` implied by `-W clippy::all`
        = help: to override `-W clippy::all` add `#[allow(clippy::incompatible_msrv)]`
        = note: this warning originates in the macro `num_as_copysign_self` which comes from the expansion of the macro `impl_deserialize_num` (in Nightly builds, run with -Z macro-backtrace for more info)

    warning: current MSRV (Minimum Supported Rust Version) is `1.31.0` but this item is stable since `1.35.0`
       --> serde/src/de/impls.rs:200:39
        |
    200 |                   Ok((v as Self::Value).copysign(sign))
        |                                         ^^^^^^^^^^^^^^
    ...
    382 | / impl_deserialize_num! {
    383 | |     f64, deserialize_f64
    384 | |     num_self!(f64:visit_f64);
    385 | |     num_as_copysign_self!(f32:visit_f32);
    386 | |     num_as_self!(i8:visit_i8 i16:visit_i16 i32:visit_i32 i64:visit_i64);
    387 | |     num_as_self!(u8:visit_u8 u16:visit_u16 u32:visit_u32 u64:visit_u64);
    388 | | }
        | |_- in this macro invocation
        |
        = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#incompatible_msrv
        = note: this warning originates in the macro `num_as_copysign_self` which comes from the expansion of the macro `impl_deserialize_num` (in Nightly builds, run with -Z macro-backtrace for more info)

    warning: current MSRV (Minimum Supported Rust Version) is `1.31.0` but this item is stable since `1.34.0`
        --> serde/src/de/impls.rs:2308:14
         |
    2308 |             .checked_add(duration)
         |              ^^^^^^^^^^^^^^^^^^^^^
         |
         = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#incompatible_msrv

    warning: current MSRV (Minimum Supported Rust Version) is `1.31.0` but this item is stable since `1.34.0`
       --> serde/src/ser/impls.rs:606:26
        |
    606 |                       self.get().serialize(serializer)
        |                            ^^^^^
    ...
    623 | / nonzero_integers! {
    624 | |     NonZeroI8,
    625 | |     NonZeroI16,
    626 | |     NonZeroI32,
    ...   |
    629 | |     NonZeroIsize,
    630 | | }
        | |_- in this macro invocation
        |
        = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#incompatible_msrv
        = note: this warning originates in the macro `nonzero_integers` (in Nightly builds, run with -Z macro-backtrace for more info)

    warning: current MSRV (Minimum Supported Rust Version) is `1.31.0` but this item is stable since `1.34.0`
        --> serde/src/ser/impls.rs:1053:26
         |
    1053 |                       self.load(Ordering::Relaxed).serialize(serializer)
         |                            ^^^^^^^^^^^^^^^^^^^^^^^
    ...
    1061 | / atomic_impl! {
    1062 | |     AtomicBool "8"
    1063 | |     AtomicI8 "8"
    1064 | |     AtomicI16 "16"
    ...    |
    1070 | |     AtomicUsize "ptr"
    1071 | | }
         | |_- in this macro invocation
         |
         = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#incompatible_msrv
         = note: this warning originates in the macro `atomic_impl` (in Nightly builds, run with -Z macro-backtrace for more info)

    warning: current MSRV (Minimum Supported Rust Version) is `1.31.0` but this item is stable since `1.34.0`
        --> serde/src/ser/impls.rs:1053:26
         |
    1053 |                       self.load(Ordering::Relaxed).serialize(serializer)
         |                            ^^^^^^^^^^^^^^^^^^^^^^^
    ...
    1074 | / atomic_impl! {
    1075 | |     AtomicI64 "64"
    1076 | |     AtomicU64 "64"
    1077 | | }
         | |_- in this macro invocation
         |
         = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#incompatible_msrv
         = note: this warning originates in the macro `atomic_impl` (in Nightly builds, run with -Z macro-backtrace for more info)
Apparently `write!` generates more code than `write_str` when used with a simple string, so optimizing it.
A few minor `write_str` optimizations
    warning: the item `Into` is imported redundantly
       --> serde/src/lib.rs:184:47
        |
    184 |     pub use self::core::convert::{self, From, Into};
        |                                               ^^^^
        |
       ::: nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/std/src/prelude/mod.rs:115:13
        |
    115 |     pub use super::v1::*;
        |             --------- the item `Into` is already defined here
        |
        = note: `#[warn(unused_imports)]` on by default
dtolnay and others added 30 commits October 22, 2024 09:38
Fix hygiene of macro-generated local variable accesses in serde(with) wrappers
    warning: this argument (4 byte) is passed by reference, but would be more efficient if passed by value (limit: 8 byte)
      --> test_suite/tests/regression/issue2844.rs:18:28
       |
    18 |     pub fn serialize<S>(_: &i32, _: S) -> Result<S::Ok, S::Error>
       |                            ^^^^ help: consider passing by value instead: `i32`
       |
       = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#trivially_copy_pass_by_ref
       = note: `-W clippy::trivially-copy-pass-by-ref` implied by `-W clippy::pedantic`
       = help: to override `-W clippy::pedantic` add `#[allow(clippy::trivially_copy_pass_by_ref)]`
    error[E0425]: cannot find value `__e` in this scope
      --> test_suite/tests/regression/issue2846.rs:12:19
       |
    12 | declare_in_macro!("with");
       |                   ^^^^^^ not found in this scope
    warning: field `0` is never read
      --> test_suite/tests/regression/issue2846.rs:8:45
       |
    8  |         pub struct S(#[serde(with = $with)] i32);
       |                    - field in this struct   ^^^
    ...
    12 | declare_in_macro!("with");
       | ------------------------- in this macro invocation
       |
       = help: consider removing this field
       = note: `#[warn(dead_code)]` on by default
       = note: this warning originates in the macro `declare_in_macro` (in Nightly builds, run with -Z macro-backtrace for more info)
Hygiene for macro-generated newtype struct deserialization with `with` attr
…module

Unfortunately, blanket implementation IntoDeserializer for Deserializer is impossible
right now because this would be a breaking change. External crates may have this
such implementation (and serde_json actually have it for Value)
- Check that alias is not the same as name of other field (it still can be the name of owning field/variant)
- Check that aliases are unique, i. e. two different fields does not use the same alias
Implement `IntoDeserializer` for all `Deserializer`s in `serde::de::value` module
Add checks for conflicts for aliases
This step has been failing way more than reasonable across my various repos.

    With the provided path, there will be 1 file uploaded
    Artifact name is valid!
    Root directory input is valid!
    Attempt 1 of 5 failed with error: Request timeout: /twirp/github.actions.results.api.v1.ArtifactService/CreateArtifact. Retrying request in 3000 ms...
    Attempt 2 of 5 failed with error: Request timeout: /twirp/github.actions.results.api.v1.ArtifactService/CreateArtifact. Retrying request in 6029 ms...
    Attempt 3 of 5 failed with error: Request timeout: /twirp/github.actions.results.api.v1.ArtifactService/CreateArtifact. Retrying request in 8270 ms...
    Attempt 4 of 5 failed with error: Request timeout: /twirp/github.actions.results.api.v1.ArtifactService/CreateArtifact. Retrying request in 12577 ms...
    Error: Failed to CreateArtifact: Failed to make request after 5 attempts: Request timeout: /twirp/github.actions.results.api.v1.ArtifactService/CreateArtifact
Produce unreachable_patterns warning when deserialization names collide
Produce a separate warning for every colliding name
This reverts commit 951ca5a.
Revert the colliding aliases hard error (PRs #2562 & #2853)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.