error: redundant closure
--> serde_derive/src/bound.rs:53:19
|
53 | .flat_map(|predicates| predicates.to_vec());
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace the closure with the method itself: `[T]::to_vec`
|
note: the lint level is defined here
--> serde_derive/src/lib.rs:18:22
|
18 | #![deny(clippy::all, clippy::pedantic)]
| ^^^^^^^^^^^^^^^^
= note: `#[deny(clippy::redundant_closure_for_method_calls)]` implied by `#[deny(clippy::pedantic)]`
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_closure_for_method_calls
error: redundant closure
--> serde_derive/src/bound.rs:75:19
|
75 | .flat_map(|predicates| predicates.to_vec());
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace the closure with the method itself: `[T]::to_vec`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_closure_for_method_calls
error: this expression borrows a reference (`&syn::Type`) that is immediately dereferenced by the compiler
--> serde_derive/src/internals/check.rs:399:37
|
399 | if let Type::Path(ty) = ungroup(&field.ty) {
| ^^^^^^^^^ help: change this to: `field.ty`
|
note: the lint level is defined here
--> serde_derive/src/lib.rs:18:9
|
18 | #![deny(clippy::all, clippy::pedantic)]
| ^^^^^^^^^^^
= note: `#[deny(clippy::needless_borrow)]` implied by `#[deny(clippy::all)]`
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow
error: this expression borrows a reference (`&str`) that is immediately dereferenced by the compiler
--> serde_derive/src/de.rs:478:52
|
478 | &type_path, params, fields, false, cattrs, &expecting,
| ^^^^^^^^^^ help: change this to: `expecting`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow
error: this expression borrows a reference (`&str`) that is immediately dereferenced by the compiler
--> serde_derive/src/de.rs:564:76
|
564 | let visit_seq = Stmts(deserialize_seq_in_place(params, fields, cattrs, &expecting));
| ^^^^^^^^^^ help: change this to: `expecting`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow
error: this expression borrows a reference (`&str`) that is immediately dereferenced by the compiler
--> serde_derive/src/de.rs:925:51
|
925 | &type_path, params, fields, true, cattrs, &expecting,
| ^^^^^^^^^^ help: change this to: `expecting`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow
error: this expression borrows a reference (`&str`) that is immediately dereferenced by the compiler
--> serde_derive/src/de.rs:1066:76
|
1066 | let visit_seq = Stmts(deserialize_seq_in_place(params, fields, cattrs, &expecting));
| ^^^^^^^^^^ help: change this to: `expecting`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow
error: this expression borrows a reference (`&proc_macro2::TokenStream`) that is immediately dereferenced by the compiler
--> serde_derive/src/de.rs:2288:80
|
2288 | let fallthrough_borrowed_arm = fallthrough_borrowed.as_ref().unwrap_or(&fallthrough_arm);
| ^^^^^^^^^^^^^^^^ help: change this to: `fallthrough_arm`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow
error: this expression borrows a reference (`&syn::Member`) that is immediately dereferenced by the compiler
--> serde_derive/src/ser.rs:1102:43
|
1102 | get_member(params, field, &member)
| ^^^^^^^ help: change this to: `member`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow
error: consider adding a `;` to the last statement for consistent formatting
--> serde_derive/src/internals/attr.rs:559:25
|
559 | serde_path.set(&m.path, path)
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: add a `;` here: `serde_path.set(&m.path, path);`
|
note: the lint level is defined here
--> serde_derive/src/lib.rs:18:22
|
18 | #![deny(clippy::all, clippy::pedantic)]
| ^^^^^^^^^^^^^^^^
= note: `#[deny(clippy::semicolon_if_nothing_returned)]` implied by `#[deny(clippy::pedantic)]`
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#semicolon_if_nothing_returned
error: consider adding a `;` to the last statement for consistent formatting
--> serde_derive/src/internals/attr.rs:1612:9
|
1612 | cx.error_spanned_by(lit, format!("failed to parse path: {:?}", string.value()))
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: add a `;` here: `cx.error_spanned_by(lit, format!("failed to parse path: {:?}", string.value()));`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#semicolon_if_nothing_returned
error: consider adding a `;` to the last statement for consistent formatting
--> serde_derive/src/internals/attr.rs:1623:9
|
1623 | cx.error_spanned_by(lit, format!("failed to parse path: {:?}", string.value()))
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: add a `;` here: `cx.error_spanned_by(lit, format!("failed to parse path: {:?}", string.value()));`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#semicolon_if_nothing_returned
error: consider adding a `;` to the last statement for consistent formatting
--> serde_derive/src/internals/attr.rs:1649:9
|
1649 | / cx.error_spanned_by(
1650 | | lit,
1651 | | format!("failed to parse type: {} = {:?}", attr_name, string.value()),
1652 | | )
| |_________^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#semicolon_if_nothing_returned
help: add a `;` here
|
1649 | cx.error_spanned_by(
1650 | lit,
1651 | format!("failed to parse type: {} = {:?}", attr_name, string.value()),
1652 | );
|
error: consider adding a `;` to the last statement for consistent formatting
--> serde_derive/src/internals/check.rs:260:9
|
260 | / cx.error_spanned_by(
261 | | cont.original,
262 | | format!("variant field name `{}` conflicts with internal tag", tag),
263 | | )
| |_________^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#semicolon_if_nothing_returned
help: add a `;` here
|
260 | cx.error_spanned_by(
261 | cont.original,
262 | format!("variant field name `{}` conflicts with internal tag", tag),
263 | );
|
error: consider adding a `;` to the last statement for consistent formatting
--> serde_derive/src/de.rs:2090:9
|
2090 | flat_fields.extend(aliases.iter().map(|alias| (alias, ident)))
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: add a `;` here: `flat_fields.extend(aliases.iter().map(|alias| (alias, ident)));`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#semicolon_if_nothing_returned
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,
| ^^^^^^^^^^^^^^^^^^
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
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;
|
https://github.com/rust-lang/rust-clippy/issues/6797
error[E0382]: use of partially moved value: `self`
--> serde_derive/src/internals/attr.rs:71:24
|
71 | self.value.map(|value| (self.tokens, value))
| ----^^^^^^^----------------------
| | | |
| | | use occurs due to use in closure
| | value used here after partial move
| `self.value` partially moved due to this method call
|
note: this function takes ownership of the receiver `self`, which moves `self.value`
--> /home/david/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/option.rs:485:38
|
485 | pub fn map<U, F: FnOnce(T) -> U>(self, f: F) -> Option<U> {
| ^^^^
= note: partial move occurs because `self.value` has type `std::option::Option<T>`, which does not implement the `Copy` trait
Unlike expr macros, macros in type position in a derive input are rare
enough that it's not worth supporting for an issue that has such an easy
workaround (just replace `Self` in the macro input with your type name).
This usage is fine. It's mirroring trait signatures in syn::visit::Visit.
error: unused `self` argument
--> serde_derive/src/bound.rs:241:24
|
241 | fn visit_macro(&mut self, _mac: &'ast syn::Macro) {}
| ^^^^^^^^^
|
note: the lint level is defined here
--> serde_derive/src/lib.rs:18:22
|
18 | #![deny(clippy::all, clippy::pedantic)]
| ^^^^^^^^^^^^^^^^
= note: `#[deny(clippy::unused_self)]` implied by `#[deny(clippy::pedantic)]`
= help: consider refactoring to a associated function
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unused_self