error: this loop could be written as a `for` loop
--> serde/src/private/de.rs:2835:9
|
2835 | while let Some(item) = self.iter.next() {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `for item in &mut self.iter`
|
note: the lint level is defined here
--> serde/src/lib.rs:97:44
|
97 | #![cfg_attr(feature = "cargo-clippy", deny(clippy, clippy_pedantic))]
| ^^^^^^
= note: `#[deny(clippy::while_let_on_iterator)]` implied by `#[deny(clippy::all)]`
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#while_let_on_iterator
error: this loop could be written as a `for` loop
--> serde/src/private/de.rs:2937:9
|
2937 | while let Some(item) = self.iter.next() {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `for item in &mut self.iter`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#while_let_on_iterator
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
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
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)]`
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
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;
|
This is equivalent to looping 0..=u8::MAX, except that `..=` syntax is
not supported on old rustc and `...` syntax is not supported on new
rustc, so loop it is.
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).