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

[pull] master from serde-rs:master #32

Open
wants to merge 1,053 commits into
base: master
Choose a base branch
from
Open

Conversation

pull[bot]
Copy link

@pull pull bot commented Dec 21, 2020

See Commits and Changes for more details.


Created by pull[bot]

Can you help keep this open source service alive? 💖 Please sponsor : )

dtolnay and others added 22 commits November 6, 2023 08:55
This will allow adding #[doc(cfg(feature = "..."))] attributes to the
impl in an upcoming commit.
Render `doc(cfg(...))` on feature gated APIs in docs.rs
…untagged

Allow internal tag field in untagged variant
Fix more RangeFrom / RangeEnd mixups
Add RangeFrom and RangeTo tests
    warning: possible intra-doc link using quotes instead of backticks
      --> serde/src/de/mod.rs:67:41
       |
    67 | //!    - Rc\<T\>&emsp;*(if* features = ["rc"] *is enabled)*
       |                                         ^^^^
       |
       = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_link_with_quotes
       = note: `-W clippy::doc-link-with-quotes` implied by `-W clippy::pedantic`
       = help: to override `-W clippy::pedantic` add `#[allow(clippy::doc_link_with_quotes)]`

    warning: possible intra-doc link using quotes instead of backticks
      --> serde/src/de/mod.rs:68:42
       |
    68 | //!    - Arc\<T\>&emsp;*(if* features = ["rc"] *is enabled)*
       |                                          ^^^^
       |
       = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_link_with_quotes

    warning: possible intra-doc link using quotes instead of backticks
      --> serde/src/ser/mod.rs:64:41
       |
    64 | //!    - Rc\<T\>&emsp;*(if* features = ["rc"] *is enabled)*
       |                                         ^^^^
       |
       = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_link_with_quotes

    warning: possible intra-doc link using quotes instead of backticks
      --> serde/src/ser/mod.rs:65:42
       |
    65 | //!    - Arc\<T\>&emsp;*(if* features = ["rc"] *is enabled)*
       |                                          ^^^^
       |
       = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_link_with_quotes
oli-obk and others added 30 commits October 21, 2024 21:40
Show variant aliases in error message
While fixing other errors from recently merged PRs.
Update ui tests from PR 2558
Ignore needless_lifetimes clippy lint in generated code
    warning: variables can be used directly in the `format!` string
       --> serde_derive/src/internals/attr.rs:546:36
        |
    546 |                         meta.error(format_args!("unknown serde container attribute `{}`", path))
        |                                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
        |
        = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#uninlined_format_args
        = note: `-W clippy::uninlined-format-args` implied by `-W clippy::pedantic`
        = help: to override `-W clippy::pedantic` add `#[allow(clippy::uninlined_format_args)]`
    help: change this to
        |
    546 -                         meta.error(format_args!("unknown serde container attribute `{}`", path))
    546 +                         meta.error(format_args!("unknown serde container attribute `{path}`"))
        |

    warning: variables can be used directly in the `format!` string
       --> serde_derive/src/internals/attr.rs:940:36
        |
    940 |                         meta.error(format_args!("unknown serde variant attribute `{}`", path))
        |                                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
        |
        = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#uninlined_format_args
    help: change this to
        |
    940 -                         meta.error(format_args!("unknown serde variant attribute `{}`", path))
    940 +                         meta.error(format_args!("unknown serde variant attribute `{path}`"))
        |

    warning: variables can be used directly in the `format!` string
        --> serde_derive/src/internals/attr.rs:1095:33
         |
    1095 | ...                   format!("field `{}` does not have lifetime {}", ident, lifetime);
         |                       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
         |
         = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#uninlined_format_args
    help: change this to
         |
    1095 -                                 format!("field `{}` does not have lifetime {}", ident, lifetime);
    1095 +                                 format!("field `{ident}` does not have lifetime {lifetime}");
         |

    warning: variables can be used directly in the `format!` string
        --> serde_derive/src/internals/attr.rs:1196:47
         |
    1196 |   ...                   let msg = format!(
         |  _________________________________^
    1197 | | ...                       "field `{}` does not have lifetime {}",
    1198 | | ...                       ident, lifetime,
    1199 | | ...                   );
         | |_______________________^
         |
         = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#uninlined_format_args

    warning: variables can be used directly in the `format!` string
        --> serde_derive/src/internals/attr.rs:1222:36
         |
    1222 |                         meta.error(format_args!("unknown serde field attribute `{}`", path))
         |                                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
         |
         = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#uninlined_format_args
    help: change this to
         |
    1222 -                         meta.error(format_args!("unknown serde field attribute `{}`", path))
    1222 +                         meta.error(format_args!("unknown serde field attribute `{path}`"))
         |

    warning: variables can be used directly in the `format!` string
        --> serde_derive/src/internals/attr.rs:1415:39
         |
    1415 |                   return Err(meta.error(format_args!(
         |  _______________________________________^
    1416 | |                     "malformed {0} attribute, expected `{0}(serialize = ..., deserialize = ...)`",
    1417 | |                     attr_name,
    1418 | |                 )));
         | |_________________^
         |
         = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#uninlined_format_args

    warning: variables can be used directly in the `format!` string
        --> serde_derive/src/internals/attr.rs:1482:17
         |
    1482 |                 format!("unexpected suffix `{}` on string literal", suffix),
         |                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
         |
         = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#uninlined_format_args
    help: change this to
         |
    1482 -                 format!("unexpected suffix `{}` on string literal", suffix),
    1482 +                 format!("unexpected suffix `{suffix}` on string literal"),
         |

    warning: variables can be used directly in the `format!` string
        --> serde_derive/src/internals/attr.rs:1489:13
         |
    1489 | /             format!(
    1490 | |                 "expected serde {} attribute to be a string: `{} = \"...\"`",
    1491 | |                 attr_name, meta_item_name
    1492 | |             ),
         | |_____________^
         |
         = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#uninlined_format_args

    warning: variables can be used directly in the `format!` string
        --> serde_derive/src/internals/attr.rs:1604:21
         |
    1604 |                     format!("duplicate borrowed lifetime `{}`", lifetime),
         |                     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
         |
         = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#uninlined_format_args
    help: change this to
         |
    1604 -                     format!("duplicate borrowed lifetime `{}`", lifetime),
    1604 +                     format!("duplicate borrowed lifetime `{lifetime}`"),
         |

    warning: variables can be used directly in the `format!` string
        --> serde_derive/src/internals/attr.rs:1778:19
         |
    1778 |         let msg = format!("field `{}` has no lifetimes to borrow", name);
         |                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
         |
         = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#uninlined_format_args
    help: change this to
         |
    1778 -         let msg = format!("field `{}` has no lifetimes to borrow", name);
    1778 +         let msg = format!("field `{name}` has no lifetimes to borrow");
         |

    warning: variables can be used directly in the `format!` string
      --> serde_derive/src/internals/check.rs:41:29
       |
    41 | ...   format!("field must have #[serde(default)] because previous field {} has #[serde(default)]", first),
       |       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
       |
       = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#uninlined_format_args
    help: change this to
       |
    41 -                             format!("field must have #[serde(default)] because previous field {} has #[serde(default)]", first),
    41 +                             format!("field must have #[serde(default)] because previous field {first} has #[serde(default)]"),
       |

    warning: variables can be used directly in the `format!` string
       --> serde_derive/src/internals/check.rs:314:13
        |
    314 |             format!("variant field name `{}` conflicts with internal tag", tag),
        |             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
        |
        = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#uninlined_format_args
    help: change this to
        |
    314 -             format!("variant field name `{}` conflicts with internal tag", tag),
    314 +             format!("variant field name `{tag}` conflicts with internal tag"),
        |

    warning: variables can be used directly in the `format!` string
       --> serde_derive/src/internals/check.rs:361:13
        |
    361 | /             format!(
    362 | |                 "enum tags `{}` for type and content conflict with each other",
    363 | |                 type_tag
    364 | |             ),
        | |_____________^
        |
        = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#uninlined_format_args

    warning: variables can be used directly in the `format!` string
       --> serde_derive/src/internals/check.rs:450:33
        |
    450 |         Member::Named(ident) => format!("`{}`", ident),
        |                                 ^^^^^^^^^^^^^^^^^^^^^^
        |
        = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#uninlined_format_args
    help: change this to
        |
    450 -         Member::Named(ident) => format!("`{}`", ident),
    450 +         Member::Named(ident) => format!("`{ident}`"),
        |

    warning: variables can be used directly in the `format!` string
       --> serde_derive/src/de.rs:697:9
        |
    697 |         format!("{} with 1 element", expecting)
        |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
        |
        = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#uninlined_format_args
    help: change this to
        |
    697 -         format!("{} with 1 element", expecting)
    697 +         format!("{expecting} with 1 element")
        |

    warning: variables can be used directly in the `format!` string
       --> serde_derive/src/de.rs:699:9
        |
    699 |         format!("{} with {} elements", expecting, deserialized_count)
        |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
        |
        = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#uninlined_format_args
    help: change this to
        |
    699 -         format!("{} with {} elements", expecting, deserialized_count)
    699 +         format!("{expecting} with {deserialized_count} elements")
        |

    warning: variables can be used directly in the `format!` string
        --> serde_derive/src/de.rs:1442:21
         |
    1442 |     let expecting = format!("adjacently tagged enum {}", rust_name);
         |                     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
         |
         = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#uninlined_format_args
    help: change this to
         |
    1442 -     let expecting = format!("adjacently tagged enum {}", rust_name);
    1442 +     let expecting = format!("adjacently tagged enum {rust_name}");
         |

    warning: variables can be used directly in the `format!` string
        --> serde_derive/src/de.rs:2842:17
         |
    2842 |     Ident::new(&format!("__field{}", i), Span::call_site())
         |                 ^^^^^^^^^^^^^^^^^^^^^^^
         |
         = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#uninlined_format_args
    help: change this to
         |
    2842 -     Ident::new(&format!("__field{}", i), Span::call_site())
    2842 +     Ident::new(&format!("__field{i}"), Span::call_site())
         |

    warning: variables can be used directly in the `format!` string
       --> serde_derive/src/ser.rs:457:42
        |
    457 |                     .map(|i| Ident::new(&format!("__field{}", i), Span::call_site()));
        |                                          ^^^^^^^^^^^^^^^^^^^^^^^
        |
        = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#uninlined_format_args
    help: change this to
        |
    457 -                     .map(|i| Ident::new(&format!("__field{}", i), Span::call_site()));
    457 +                     .map(|i| Ident::new(&format!("__field{i}"), Span::call_site()));
        |

    warning: variables can be used directly in the `format!` string
       --> serde_derive/src/ser.rs:714:48
        |
    714 |             .map(|i| Member::Named(Ident::new(&format!("__field{}", i), Span::call_site())))
        |                                                ^^^^^^^^^^^^^^^^^^^^^^^
        |
        = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#uninlined_format_args
    help: change this to
        |
    714 -             .map(|i| Member::Named(Ident::new(&format!("__field{}", i), Span::call_site())))
    714 +             .map(|i| Member::Named(Ident::new(&format!("__field{i}"), Span::call_site())))
        |

    warning: variables can be used directly in the `format!` string
       --> serde_derive/src/ser.rs:832:46
        |
    832 |                 let field_expr = Ident::new(&format!("__field{}", i), Span::call_site());
        |                                              ^^^^^^^^^^^^^^^^^^^^^^^
        |
        = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#uninlined_format_args
    help: change this to
        |
    832 -                 let field_expr = Ident::new(&format!("__field{}", i), Span::call_site());
    832 +                 let field_expr = Ident::new(&format!("__field{i}"), Span::call_site());
        |

    warning: variables can be used directly in the `format!` string
        --> serde_derive/src/ser.rs:1062:38
         |
    1062 |                 let id = Ident::new(&format!("__field{}", i), Span::call_site());
         |                                      ^^^^^^^^^^^^^^^^^^^^^^^
         |
         = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#uninlined_format_args
    help: change this to
         |
    1062 -                 let id = Ident::new(&format!("__field{}", i), Span::call_site());
    1062 +                 let id = Ident::new(&format!("__field{i}"), Span::call_site());
         |
This is the rust-version declared by recent versions of Syn.
Reduce scope of quote_spanned on SerializeWith wrapper
Rename field_names_idents -> field_idents_aliases
Collect field ident and aliases into a struct
    error[E0424]: expected value, found module `self`
      --> test_suite/tests/regression/issue2844.rs:13:19
       |
    5  |         #[derive(Serialize, Deserialize)]
       |                  --------- this function has a `self` parameter, but a macro invocation can only access identifiers it receives from parameters
    ...
    13 | declare_in_macro!("with");
       |                   ^^^^^^ `self` value is a keyword only available in methods with a `self` parameter

    error[E0425]: cannot find value `__s` in this scope
      --> test_suite/tests/regression/issue2844.rs:13:19
       |
    13 | declare_in_macro!("with");
       |                   ^^^^^^ not found in this scope

    error[E0425]: cannot find value `__deserializer` in this scope
      --> test_suite/tests/regression/issue2844.rs:13:19
       |
    13 | declare_in_macro!("with");
       |                   ^^^^^^ not found in this scope
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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
⤵️ pull merge-conflict Resolve conflicts manually
Projects
None yet
Development

Successfully merging this pull request may close these issues.