Skip to content

Commit e3a4165

Browse files
committed
Switch all crates to edition 2021
1 parent 6ac8049 commit e3a4165

File tree

6 files changed

+10
-9
lines changed

6 files changed

+10
-9
lines changed

Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ members = [
55
"serde_derive_internals",
66
"test_suite",
77
]
8+
resolver = "2"
89

910
[patch.crates-io]
1011
serde = { path = "serde" }

serde/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ build = "build.rs"
66
categories = ["encoding", "no-std", "no-std::no-alloc"]
77
description = "A generic serialization/deserialization framework"
88
documentation = "https://docs.rs/serde"
9-
edition = "2018"
9+
edition = "2021"
1010
homepage = "https://serde.rs"
1111
keywords = ["serde", "serialization", "no_std"]
1212
license = "MIT OR Apache-2.0"

serde/src/de/mod.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -206,7 +206,7 @@ macro_rules! declare_error_trait {
206206
/// containing an integer, the unexpected type is the integer and the
207207
/// expected type is the string.
208208
#[cold]
209-
fn invalid_type(unexp: Unexpected, exp: &Expected) -> Self {
209+
fn invalid_type(unexp: Unexpected, exp: &dyn Expected) -> Self {
210210
Error::custom(format_args!("invalid type: {}, expected {}", unexp, exp))
211211
}
212212

@@ -224,7 +224,7 @@ macro_rules! declare_error_trait {
224224
/// that is not valid UTF-8, the unexpected value is the bytes and the
225225
/// expected value is a string.
226226
#[cold]
227-
fn invalid_value(unexp: Unexpected, exp: &Expected) -> Self {
227+
fn invalid_value(unexp: Unexpected, exp: &dyn Expected) -> Self {
228228
Error::custom(format_args!("invalid value: {}, expected {}", unexp, exp))
229229
}
230230

@@ -238,7 +238,7 @@ macro_rules! declare_error_trait {
238238
/// expected. For example `exp` might say that a tuple of size 6 was
239239
/// expected.
240240
#[cold]
241-
fn invalid_length(len: usize, exp: &Expected) -> Self {
241+
fn invalid_length(len: usize, exp: &dyn Expected) -> Self {
242242
Error::custom(format_args!("invalid length {}, expected {}", len, exp))
243243
}
244244

@@ -492,7 +492,7 @@ impl Expected for &str {
492492
}
493493
}
494494

495-
impl Display for Expected + '_ {
495+
impl Display for dyn Expected + '_ {
496496
fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
497497
Expected::fmt(self, formatter)
498498
}

serde/src/private/de.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1065,7 +1065,7 @@ mod content {
10651065
E: de::Error,
10661066
{
10671067
#[cold]
1068-
fn invalid_type(self, exp: &Expected) -> E {
1068+
fn invalid_type(self, exp: &dyn Expected) -> E {
10691069
de::Error::invalid_type(self.content.unexpected(), exp)
10701070
}
10711071

@@ -1654,7 +1654,7 @@ mod content {
16541654
E: de::Error,
16551655
{
16561656
#[cold]
1657-
fn invalid_type(self, exp: &Expected) -> E {
1657+
fn invalid_type(self, exp: &dyn Expected) -> E {
16581658
de::Error::invalid_type(self.content.unexpected(), exp)
16591659
}
16601660

serde_derive/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ authors = ["Erick Tryzelaar <[email protected]>", "David Tolnay <dtolnay
55
categories = ["no-std", "no-std::no-alloc"]
66
description = "Macros 1.1 implementation of #[derive(Serialize, Deserialize)]"
77
documentation = "https://serde.rs/derive.html"
8-
edition = "2015"
8+
edition = "2021"
99
exclude = ["build.rs"]
1010
homepage = "https://serde.rs"
1111
keywords = ["serde", "serialization", "no_std", "derive"]

serde_derive_internals/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ version = "0.29.1"
44
authors = ["Erick Tryzelaar <[email protected]>", "David Tolnay <[email protected]>"]
55
description = "AST representation used by Serde derive macros. Unstable."
66
documentation = "https://docs.rs/serde_derive_internals"
7-
edition = "2015"
7+
edition = "2021"
88
exclude = ["build.rs"]
99
homepage = "https://serde.rs"
1010
keywords = ["serde", "serialization"]

0 commit comments

Comments
 (0)