forked from serde-rs/serde
-
Notifications
You must be signed in to change notification settings - Fork 12
[pull] master from serde-rs:master #32
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
Open
pull
wants to merge
1,276
commits into
mesalock-linux:master
Choose a base branch
from
serde-rs:master
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
58c82f1 to
d208762
Compare
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)]`
PR 2987 followup
No longer macro_use integer128 module
Remove InPlaceSeed public re-export
Inline serde_core into serde in docsrs mode
Workaround for RUSTDOCFLAGS='--cfg=docsrs'
This may slightly improve compilation time and costs nothing
Remove some ? from generated code
refactor: remove 1 level of nesting
warning: this could be rewritten as `let...else`
--> serde_derive/src/internals/attr.rs:1460:5
|
1460 | / let string = match get_lit_str(cx, attr_name, meta)? {
1461 | | Some(string) => string,
1462 | | None => return Ok(None),
1463 | | };
| |______^ help: consider writing: `let Some(string) = get_lit_str(cx, attr_name, meta)? else { return Ok(None) };`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_let_else
= note: `-W clippy::manual-let-else` implied by `-W clippy::pedantic`
= help: to override `-W clippy::pedantic` add `#[allow(clippy::manual_let_else)]`
warning: this could be rewritten as `let...else`
--> serde_derive/src/internals/attr.rs:1482:5
|
1482 | / let string = match get_lit_str(cx, attr_name, meta)? {
1483 | | Some(string) => string,
1484 | | None => return Ok(None),
1485 | | };
| |______^ help: consider writing: `let Some(string) = get_lit_str(cx, attr_name, meta)? else { return Ok(None) };`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_let_else
warning: this could be rewritten as `let...else`
--> serde_derive/src/internals/attr.rs:1505:5
|
1505 | / let string = match get_lit_str2(cx, attr_name, meta_item_name, meta)? {
1506 | | Some(string) => string,
1507 | | None => return Ok(Vec::new()),
1508 | | };
| |______^ help: consider writing: `let Some(string) = get_lit_str2(cx, attr_name, meta_item_name, meta)? else { return Ok(Vec::new()) };`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_let_else
warning: this could be rewritten as `let...else`
--> serde_derive/src/internals/attr.rs:1526:5
|
1526 | / let string = match get_lit_str(cx, attr_name, meta)? {
1527 | | Some(string) => string,
1528 | | None => return Ok(None),
1529 | | };
| |______^ help: consider writing: `let Some(string) = get_lit_str(cx, attr_name, meta)? else { return Ok(None) };`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_let_else
warning: this could be rewritten as `let...else`
--> serde_derive/src/internals/attr.rs:1549:5
|
1549 | / let string = match get_lit_str(cx, BORROW, meta)? {
1550 | | Some(string) => string,
1551 | | None => return Ok(BTreeSet::new()),
1552 | | };
| |______^ help: consider writing: `let Some(string) = get_lit_str(cx, BORROW, meta)? else { return Ok(BTreeSet::new()) };`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_let_else
warning: this could be rewritten as `let...else`
--> serde_derive/src/internals/attr.rs:1621:5
|
1621 | / let seg = match path.segments.last() {
1622 | | Some(seg) => seg,
1623 | | None => {
1624 | | return false;
1625 | | }
1626 | | };
| |______^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_let_else
help: consider writing
|
1621 ~ let Some(seg) = path.segments.last() else {
1622 + return false;
1623 + };
|
warning: this could be rewritten as `let...else`
--> serde_derive/src/internals/attr.rs:1648:5
|
1648 | / let seg = match path.segments.last() {
1649 | | Some(seg) => seg,
1650 | | None => {
1651 | | return false;
1652 | | }
1653 | | };
| |______^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_let_else
help: consider writing
|
1648 ~ let Some(seg) = path.segments.last() else {
1649 + return false;
1650 + };
|
warning: this could be rewritten as `let...else`
--> serde_derive/src/internals/ctxt.rs:49:9
|
49 | / let mut combined = match errors.next() {
50 | | Some(first) => first,
51 | | None => return Ok(()),
52 | | };
| |__________^ help: consider writing: `let Some(mut combined) = errors.next() else { return Ok(()) };`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_let_else
warning: this could be rewritten as `let...else`
--> serde_derive/src/de.rs:29:5
|
29 | / let cont = match Container::from_ast(&ctxt, input, Derive::Deserialize, &private...
30 | | Some(cont) => cont,
31 | | None => return Err(ctxt.check().unwrap_err()),
32 | | };
| |______^ help: consider writing: `let Some(cont) = Container::from_ast(&ctxt, input, Derive::Deserialize, &private.ident()) else { return Err(ctxt.check().unwrap_err()) };`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_let_else
warning: this could be rewritten as `let...else`
--> serde_derive/src/ser.rs:16:5
|
16 | / let cont = match Container::from_ast(&ctxt, input, Derive::Serialize, &private.i...
17 | | Some(cont) => cont,
18 | | None => return Err(ctxt.check().unwrap_err()),
19 | | };
| |______^ help: consider writing: `let Some(cont) = Container::from_ast(&ctxt, input, Derive::Serialize, &private.ident()) else { return Err(ctxt.check().unwrap_err()) };`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_let_else
warning: lint `clippy::empty_enum` has been renamed to `clippy::empty_enums`
--> serde/src/lib.rs:122:5
|
122 | clippy::empty_enum,
| ^^^^^^^^^^^^^^^^^^ help: use the new name: `clippy::empty_enums`
|
= note: `#[warn(renamed_and_removed_lints)]` on by default
warning: lint `clippy::empty_enum` has been renamed to `clippy::empty_enums`
--> serde_core/src/lib.rs:57:5
|
57 | clippy::empty_enum,
| ^^^^^^^^^^^^^^^^^^ help: use the new name: `clippy::empty_enums`
|
= note: `#[warn(renamed_and_removed_lints)]` on by default
warning: lint `clippy::empty_enum` has been renamed to `clippy::empty_enums`
--> test_suite/tests/test_de.rs:5:5
|
5 | clippy::empty_enum,
| ^^^^^^^^^^^^^^^^^^ help: use the new name: `clippy::empty_enums`
|
= note: `#[warn(renamed_and_removed_lints)]` on by default
warning: lint `clippy::empty_enum` has been renamed to `clippy::empty_enums`
--> test_suite/tests/test_de_error.rs:3:5
|
3 | clippy::empty_enum,
| ^^^^^^^^^^^^^^^^^^ help: use the new name: `clippy::empty_enums`
|
= note: `#[warn(renamed_and_removed_lints)]` on by default
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
See Commits and Changes for more details.
Created by
pull[bot]
Can you help keep this open source service alive? 💖 Please sponsor : )