mirror of
https://github.com/pezkuwichain/serde.git
synced 2026-06-16 10:11:03 +00:00
Allow more dead code
This commit is contained in:
@@ -1,3 +1,5 @@
|
|||||||
|
#![allow(dead_code)]
|
||||||
|
|
||||||
use serde_derive::Deserialize;
|
use serde_derive::Deserialize;
|
||||||
|
|
||||||
#[derive(Deserialize)]
|
#[derive(Deserialize)]
|
||||||
|
|||||||
@@ -1,3 +1,5 @@
|
|||||||
|
#![allow(dead_code)]
|
||||||
|
|
||||||
use serde_derive::Deserialize;
|
use serde_derive::Deserialize;
|
||||||
|
|
||||||
macro_rules! bug {
|
macro_rules! bug {
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
#![allow(clippy::trivially_copy_pass_by_ref)]
|
#![allow(clippy::trivially_copy_pass_by_ref, dead_code)]
|
||||||
|
|
||||||
use serde_derive::{Deserialize, Serialize};
|
use serde_derive::{Deserialize, Serialize};
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
#![allow(clippy::trivially_copy_pass_by_ref)]
|
#![allow(clippy::trivially_copy_pass_by_ref, dead_code)]
|
||||||
|
|
||||||
use serde_derive::Deserialize;
|
use serde_derive::Deserialize;
|
||||||
|
|
||||||
|
|||||||
@@ -1,7 +1,10 @@
|
|||||||
#![allow(
|
#![allow(
|
||||||
clippy::derive_partial_eq_without_eq,
|
clippy::derive_partial_eq_without_eq,
|
||||||
clippy::items_after_statements,
|
clippy::items_after_statements,
|
||||||
clippy::used_underscore_binding
|
clippy::used_underscore_binding,
|
||||||
|
// We use lots of declarations inside function bodies to avoid conflicts,
|
||||||
|
// but they aren't used. We just want to make sure they compile.
|
||||||
|
dead_code,
|
||||||
)]
|
)]
|
||||||
|
|
||||||
use serde::de::value::{BorrowedStrDeserializer, MapDeserializer};
|
use serde::de::value::{BorrowedStrDeserializer, MapDeserializer};
|
||||||
|
|||||||
@@ -18,7 +18,10 @@
|
|||||||
clippy::ptr_arg,
|
clippy::ptr_arg,
|
||||||
clippy::too_many_lines,
|
clippy::too_many_lines,
|
||||||
clippy::trivially_copy_pass_by_ref,
|
clippy::trivially_copy_pass_by_ref,
|
||||||
clippy::type_repetition_in_bounds
|
clippy::type_repetition_in_bounds,
|
||||||
|
// We use lots of declarations inside function bodies to avoid conflicts,
|
||||||
|
// but they aren't used. We just want to make sure they compile.
|
||||||
|
dead_code,
|
||||||
)]
|
)]
|
||||||
#![deny(clippy::collection_is_never_read)]
|
#![deny(clippy::collection_is_never_read)]
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
#![allow(clippy::redundant_field_names)]
|
#![allow(clippy::redundant_field_names, dead_code)]
|
||||||
|
|
||||||
use serde_derive::{Deserialize, Serialize};
|
use serde_derive::{Deserialize, Serialize};
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
#![allow(clippy::used_underscore_binding)]
|
#![allow(clippy::used_underscore_binding, dead_code)]
|
||||||
|
|
||||||
use serde_derive::{Deserialize, Serialize};
|
use serde_derive::{Deserialize, Serialize};
|
||||||
|
|
||||||
|
|||||||
@@ -13,7 +13,7 @@ warning: unreachable pattern
|
|||||||
13 | b: (),
|
13 | b: (),
|
||||||
| ^ no value can reach this
|
| ^ no value can reach this
|
||||||
|
|
|
|
||||||
= note: `#[warn(unreachable_patterns)]` on by default
|
= note: `#[warn(unreachable_patterns)]` (part of `#[warn(unused)]`) on by default
|
||||||
|
|
||||||
warning: unreachable pattern
|
warning: unreachable pattern
|
||||||
--> tests/ui/conflict/alias-enum.rs:12:25
|
--> tests/ui/conflict/alias-enum.rs:12:25
|
||||||
|
|||||||
@@ -13,7 +13,7 @@ warning: unreachable pattern
|
|||||||
10 | b: (),
|
10 | b: (),
|
||||||
| ^ no value can reach this
|
| ^ no value can reach this
|
||||||
|
|
|
|
||||||
= note: `#[warn(unreachable_patterns)]` on by default
|
= note: `#[warn(unreachable_patterns)]` (part of `#[warn(unused)]`) on by default
|
||||||
|
|
||||||
warning: unreachable pattern
|
warning: unreachable pattern
|
||||||
--> tests/ui/conflict/alias.rs:9:21
|
--> tests/ui/conflict/alias.rs:9:21
|
||||||
|
|||||||
@@ -2,10 +2,7 @@ error[E0308]: mismatched types
|
|||||||
--> tests/ui/default-attribute/incorrect_type_newtype.rs:6:19
|
--> tests/ui/default-attribute/incorrect_type_newtype.rs:6:19
|
||||||
|
|
|
|
||||||
6 | #[serde(default = "main")]
|
6 | #[serde(default = "main")]
|
||||||
| ^^^^^^
|
| ^^^^^^ expected `Newtype`, found `()`
|
||||||
| |
|
|
||||||
| expected `Newtype`, found `()`
|
|
||||||
| expected due to this
|
|
||||||
|
|
||||||
error[E0308]: `match` arms have incompatible types
|
error[E0308]: `match` arms have incompatible types
|
||||||
--> tests/ui/default-attribute/incorrect_type_newtype.rs:7:34
|
--> tests/ui/default-attribute/incorrect_type_newtype.rs:7:34
|
||||||
|
|||||||
@@ -2,10 +2,7 @@ error[E0308]: mismatched types
|
|||||||
--> tests/ui/default-attribute/incorrect_type_struct.rs:6:19
|
--> tests/ui/default-attribute/incorrect_type_struct.rs:6:19
|
||||||
|
|
|
|
||||||
6 | #[serde(default = "main")]
|
6 | #[serde(default = "main")]
|
||||||
| ^^^^^^
|
| ^^^^^^ expected `Struct`, found `()`
|
||||||
| |
|
|
||||||
| expected `Struct`, found `()`
|
|
||||||
| expected due to this
|
|
||||||
|
|
||||||
error[E0308]: `match` arms have incompatible types
|
error[E0308]: `match` arms have incompatible types
|
||||||
--> tests/ui/default-attribute/incorrect_type_struct.rs:8:23
|
--> tests/ui/default-attribute/incorrect_type_struct.rs:8:23
|
||||||
|
|||||||
@@ -2,10 +2,7 @@ error[E0308]: mismatched types
|
|||||||
--> tests/ui/default-attribute/incorrect_type_tuple.rs:6:19
|
--> tests/ui/default-attribute/incorrect_type_tuple.rs:6:19
|
||||||
|
|
|
|
||||||
6 | #[serde(default = "main")]
|
6 | #[serde(default = "main")]
|
||||||
| ^^^^^^
|
| ^^^^^^ expected `Tuple`, found `()`
|
||||||
| |
|
|
||||||
| expected `Tuple`, found `()`
|
|
||||||
| expected due to this
|
|
||||||
|
|
||||||
error[E0308]: `match` arms have incompatible types
|
error[E0308]: `match` arms have incompatible types
|
||||||
--> tests/ui/default-attribute/incorrect_type_tuple.rs:7:36
|
--> tests/ui/default-attribute/incorrect_type_tuple.rs:7:36
|
||||||
|
|||||||
@@ -2,10 +2,15 @@ error[E0277]: the trait bound `MyStruct: Serialize` is not satisfied
|
|||||||
--> tests/ui/on_unimplemented.rs:21:15
|
--> tests/ui/on_unimplemented.rs:21:15
|
||||||
|
|
|
|
||||||
21 | to_string(&MyStruct);
|
21 | to_string(&MyStruct);
|
||||||
| --------- ^^^^^^^^^ the trait `Serialize` is not implemented for `MyStruct`
|
| --------- ^^^^^^^^^ unsatisfied trait bound
|
||||||
| |
|
| |
|
||||||
| required by a bound introduced by this call
|
| required by a bound introduced by this call
|
||||||
|
|
|
|
||||||
|
help: the trait `Serialize` is not implemented for `MyStruct`
|
||||||
|
--> tests/ui/on_unimplemented.rs:18:1
|
||||||
|
|
|
||||||
|
18 | struct MyStruct;
|
||||||
|
| ^^^^^^^^^^^^^^^
|
||||||
= note: for local types consider adding `#[derive(serde::Serialize)]` to your `MyStruct` type
|
= note: for local types consider adding `#[derive(serde::Serialize)]` to your `MyStruct` type
|
||||||
= note: for types from other crates check whether the crate offers a `serde` feature flag
|
= note: for types from other crates check whether the crate offers a `serde` feature flag
|
||||||
= help: the following other types implement trait `Serialize`:
|
= help: the following other types implement trait `Serialize`:
|
||||||
@@ -31,8 +36,13 @@ error[E0277]: the trait bound `MyStruct: Deserialize<'_>` is not satisfied
|
|||||||
--> tests/ui/on_unimplemented.rs:22:23
|
--> tests/ui/on_unimplemented.rs:22:23
|
||||||
|
|
|
|
||||||
22 | let _: MyStruct = from_str("");
|
22 | let _: MyStruct = from_str("");
|
||||||
| ^^^^^^^^^^^^ the trait `Deserialize<'_>` is not implemented for `MyStruct`
|
| ^^^^^^^^^^^^ unsatisfied trait bound
|
||||||
|
|
|
|
||||||
|
help: the trait `Deserialize<'_>` is not implemented for `MyStruct`
|
||||||
|
--> tests/ui/on_unimplemented.rs:18:1
|
||||||
|
|
|
||||||
|
18 | struct MyStruct;
|
||||||
|
| ^^^^^^^^^^^^^^^
|
||||||
= note: for local types consider adding `#[derive(serde::Deserialize)]` to your `MyStruct` type
|
= note: for local types consider adding `#[derive(serde::Deserialize)]` to your `MyStruct` type
|
||||||
= note: for types from other crates check whether the crate offers a `serde` feature flag
|
= note: for types from other crates check whether the crate offers a `serde` feature flag
|
||||||
= help: the following other types implement trait `Deserialize<'de>`:
|
= help: the following other types implement trait `Deserialize<'de>`:
|
||||||
|
|||||||
Reference in New Issue
Block a user